@anchrd/intel-ui 0.18.0 → 0.20.0
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/package.json +2 -9
- package/src/app/app-tree/app-tree.tsx +68 -147
- package/src/app/header-search/header-search.tsx +2 -1
- package/src/app/reindex-dialog/reindex-dialog.tsx +79 -0
- package/src/app/settings-dialog/settings-dialog.tsx +10 -32
- package/src/app/user-footer/user-footer.tsx +19 -0
- package/src/archive/archive.tsx +2 -1
- package/src/data/intel-data-provider/intel-data-provider.ts +42 -191
- package/src/data/intel-data-provider/intel-data-provider.types.ts +36 -120
- package/src/document-link/document-link.tsx +1 -1
- package/src/entry-picker/entry-picker.tsx +7 -7
- package/src/flow-runs/flow-runs.tsx +1 -1
- package/src/flows/flows.tsx +3 -2
- package/src/flows/node-icon/node-icon.ts +1 -1
- package/src/flows/node-palette/node-palette.tsx +1 -1
- package/src/flows/node-palette/node-palette.types.ts +1 -1
- package/src/graph-pane/graph-pane.tsx +1 -1
- package/src/i18n/de.json +14 -217
- package/src/i18n/en.json +14 -217
- package/src/i18n/es.json +14 -217
- package/src/import-bundle/import-bundle.tsx +152 -0
- package/src/kind-icon.ts +1 -15
- package/src/main.tsx +7 -10
- package/src/node-editor/node-editor.tsx +1 -1
- package/src/node-graph/graph-notice.tsx +1 -1
- package/src/node-graph/node-graph.ts +1 -1
- package/src/node-graph/node-graph.tsx +1 -1
- package/src/node-table/node-table.tsx +3 -3
- package/src/nodes/nodes.tsx +1 -35
- package/src/resource-menu/resource-menu.tsx +45 -21
- package/src/section-hint/section-hint.tsx +2 -2
- package/src/title-row/title-row.tsx +5 -22
- package/src/tools/tools.tsx +1 -3
- package/vite.config.ts +0 -4
- package/src/agent/agent-avatar/agent-avatar.tsx +0 -34
- package/src/agent/agent-calendar/agent-calendar.tsx +0 -160
- package/src/agent/agent-chat/agent-chat.tsx +0 -118
- package/src/agent/agent-costs/agent-costs.ts +0 -95
- package/src/agent/agent-cron/agent-cron.ts +0 -68
- package/src/agent/agent-definition/agent-definition.ts +0 -96
- package/src/agent/agent-delegation-notice/agent-delegation-notice.ts +0 -48
- package/src/agent/agent-entry-title/agent-entry-title.ts +0 -72
- package/src/agent/agent-log/agent-log.tsx +0 -308
- package/src/agent/agent-models/agent-models.ts +0 -166
- package/src/agent/agent-models/agent-models.types.ts +0 -24
- package/src/agent/agent-profile/agent-profile.tsx +0 -1006
- package/src/agent/agent-state/agent-state.ts +0 -85
- package/src/agent/agent-status-dot/agent-status-dot.ts +0 -73
- package/src/agent/agent.tsx +0 -507
- package/src/board/board-calendar/board-calendar.tsx +0 -89
- package/src/board/board-card/board-card.tsx +0 -106
- package/src/board/board-data/board-data.ts +0 -241
- package/src/board/board-data/board-data.types.ts +0 -63
- package/src/board/board-detail/board-detail.tsx +0 -629
- package/src/board/board-gantt/board-gantt.ts +0 -545
- package/src/board/board-gantt/board-gantt.tsx +0 -286
- package/src/board/board-graph/board-graph.ts +0 -174
- package/src/board/board-graph/board-graph.tsx +0 -168
- package/src/board/board-items/board-items.ts +0 -183
- package/src/board/board-kanban/board-kanban.ts +0 -137
- package/src/board/board-kanban/board-kanban.tsx +0 -257
- package/src/board/board-status/board-status.ts +0 -59
- package/src/board/board-statuses/board-statuses.ts +0 -63
- package/src/board/board-statuses/board-statuses.tsx +0 -228
- package/src/board/board-table/board-table.ts +0 -33
- package/src/board/board-table/board-table.tsx +0 -413
- package/src/board/board-views/board-views.tsx +0 -68
- package/src/board/board-views/board-views.types.ts +0 -29
- package/src/board/board.tsx +0 -251
- package/src/components/ui/item-calendar.tsx +0 -181
- package/src/components/ui/item-gantt.tsx +0 -463
- package/src/components/ui/kanban.tsx +0 -282
- package/src/data/agent-runtime/agent-runtime.ts +0 -131
- package/src/hooks/use-capabilities.ts +0 -22
- package/src/hooks/use-model-catalog.ts +0 -26
- package/src/timezone/timezone-combobox/timezone-combobox.tsx +0 -149
- package/src/timezone/timezone-context.tsx +0 -65
- package/src/timezone/timezone.ts +0 -174
|
@@ -1,81 +1,64 @@
|
|
|
1
|
+
import { ProblemDetails, SessionUser } from "@anchrd/intel-contract";
|
|
2
|
+
import { BundleImportResult } from "@anchrd/intel-contract/bundle";
|
|
1
3
|
import {
|
|
2
|
-
AddBoardTaskInput,
|
|
3
|
-
AgentCosts,
|
|
4
|
-
AgentKeyRotated,
|
|
5
|
-
AppendTableRowsInput,
|
|
6
|
-
AppendTableRowsResult,
|
|
7
4
|
ArchiveFlowInput,
|
|
8
|
-
ArchiveNodeInput,
|
|
9
|
-
BoardTaskResult,
|
|
10
|
-
BundleImportResult,
|
|
11
|
-
CompleteFlowRunStepInput,
|
|
12
|
-
ConfigureBoardInput,
|
|
13
|
-
ConfigureBoardResult,
|
|
14
|
-
CreateAgentInput,
|
|
15
|
-
CreatedAgent,
|
|
16
5
|
CreateFlowInput,
|
|
17
|
-
CreateNodeInput,
|
|
18
|
-
DefineTableInput,
|
|
19
|
-
DeleteBoardTaskInput,
|
|
20
|
-
DeleteBoardTaskResult,
|
|
21
6
|
Flow,
|
|
22
7
|
FlowDocument,
|
|
23
8
|
FlowList,
|
|
24
9
|
FlowPublishPreview,
|
|
25
10
|
FlowRequirements,
|
|
11
|
+
FlowValidation,
|
|
12
|
+
ListFlowsInput,
|
|
13
|
+
PreviewFlowPublishInput,
|
|
14
|
+
PublishFlowInput,
|
|
15
|
+
RelationGraph,
|
|
16
|
+
RelationGraphInput,
|
|
17
|
+
SaveFlowVersionInput,
|
|
18
|
+
UpdateFlowInput,
|
|
19
|
+
} from "@anchrd/intel-contract/flow";
|
|
20
|
+
import {
|
|
21
|
+
CompleteFlowRunStepInput,
|
|
26
22
|
FlowRunHistory,
|
|
27
23
|
FlowRunList,
|
|
28
24
|
FlowRunStep,
|
|
29
|
-
FlowValidation,
|
|
30
|
-
IntelCapabilities,
|
|
31
25
|
ListFlowRunsInput,
|
|
32
|
-
|
|
26
|
+
StartFlowRunInput,
|
|
27
|
+
} from "@anchrd/intel-contract/flow-run";
|
|
28
|
+
import {
|
|
29
|
+
ArchiveNodeInput,
|
|
30
|
+
CreateNodeInput,
|
|
33
31
|
ListNodesInput,
|
|
34
|
-
ModelCatalog,
|
|
35
|
-
MoveBoardTaskInput,
|
|
36
32
|
Node,
|
|
37
|
-
NodeAgent,
|
|
38
|
-
NodeBoard,
|
|
39
33
|
NodeDocument,
|
|
40
34
|
NodeGraph,
|
|
41
35
|
NodeLinkList,
|
|
42
36
|
NodeList,
|
|
43
37
|
NodeTable,
|
|
44
38
|
NodeVersionList,
|
|
45
|
-
|
|
46
|
-
ProblemDetails,
|
|
47
|
-
PublishFlowInput,
|
|
48
|
-
RelationGraph,
|
|
49
|
-
RelationGraphInput,
|
|
39
|
+
ReindexResult,
|
|
50
40
|
ResolveNodeLinksInput,
|
|
51
41
|
ResolveNodeLinksResult,
|
|
52
|
-
ResourceGrantList,
|
|
53
|
-
RevokeGrantInput,
|
|
54
|
-
RevokeGrantResult,
|
|
55
|
-
SaveAgentDefinitionInput,
|
|
56
42
|
SaveAttachmentInput,
|
|
57
|
-
SaveFlowVersionInput,
|
|
58
43
|
SaveNodeVersionInput,
|
|
59
44
|
SearchInput,
|
|
60
45
|
SearchResult,
|
|
61
|
-
|
|
46
|
+
UpdateNodeInput,
|
|
47
|
+
} from "@anchrd/intel-contract/node";
|
|
48
|
+
import {
|
|
49
|
+
ResourceGrantList,
|
|
50
|
+
RevokeGrantInput,
|
|
51
|
+
RevokeGrantResult,
|
|
62
52
|
ShareInput,
|
|
63
53
|
ShareResult,
|
|
64
|
-
|
|
65
|
-
ToolCatalog,
|
|
66
|
-
ToolServerCatalog,
|
|
67
|
-
UpdateBoardTaskInput,
|
|
68
|
-
UpdateFlowInput,
|
|
69
|
-
UpdateNodeInput,
|
|
70
|
-
} from "@anchrd/intel-contract";
|
|
71
|
-
import type { z } from "zod";
|
|
54
|
+
} from "@anchrd/intel-contract/share";
|
|
72
55
|
import {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
} from "
|
|
56
|
+
AppendTableRowsInput,
|
|
57
|
+
AppendTableRowsResult,
|
|
58
|
+
DefineTableInput,
|
|
59
|
+
} from "@anchrd/intel-contract/table";
|
|
60
|
+
import { ToolCatalog, ToolServerCatalog } from "@anchrd/intel-contract/tool";
|
|
61
|
+
import type { z } from "zod";
|
|
79
62
|
import { createBrowserSignIn } from "@/data/sign-in/sign-in.ts";
|
|
80
63
|
import type { IntelDataProvider, TreeEntry } from "./intel-data-provider.types.ts";
|
|
81
64
|
|
|
@@ -211,18 +194,8 @@ export function createIntelDataProvider(
|
|
|
211
194
|
async getSession() {
|
|
212
195
|
return await request("/session", SessionUser);
|
|
213
196
|
},
|
|
214
|
-
async
|
|
215
|
-
return await request("/
|
|
216
|
-
},
|
|
217
|
-
/**
|
|
218
|
-
* What the offered models cost and hold (#257).
|
|
219
|
-
*
|
|
220
|
-
* ⚠️ Asked of intel, never of Cloudflare. The account endpoint needs a token and a token does
|
|
221
|
-
* not belong in a SPA — which was the stated reason the price table stayed hard-coded in this
|
|
222
|
-
* package until now. The figures cross the wire; the credential does not.
|
|
223
|
-
*/
|
|
224
|
-
async listModels() {
|
|
225
|
-
return await request("/models", ModelCatalog);
|
|
197
|
+
async reindexNodes() {
|
|
198
|
+
return await request("/nodes/reindex", ReindexResult, { method: "POST", body: "{}" });
|
|
226
199
|
},
|
|
227
200
|
listNodes,
|
|
228
201
|
async listTreeChildren(parentId) {
|
|
@@ -336,49 +309,6 @@ export function createIntelDataProvider(
|
|
|
336
309
|
{ method: "POST", body: JSON.stringify(parsed) },
|
|
337
310
|
);
|
|
338
311
|
},
|
|
339
|
-
async getBoard(nodeId) {
|
|
340
|
-
return await request(`/nodes/${encodeURIComponent(nodeId)}/board`, NodeBoard);
|
|
341
|
-
},
|
|
342
|
-
async configureBoard(input) {
|
|
343
|
-
const parsed = ConfigureBoardInput.parse(input);
|
|
344
|
-
return await request(
|
|
345
|
-
`/nodes/${encodeURIComponent(parsed.nodeId)}/board/configure`,
|
|
346
|
-
ConfigureBoardResult,
|
|
347
|
-
{ method: "POST", body: JSON.stringify(parsed) },
|
|
348
|
-
);
|
|
349
|
-
},
|
|
350
|
-
async addBoardTask(input) {
|
|
351
|
-
const parsed = AddBoardTaskInput.parse(input);
|
|
352
|
-
return await request(
|
|
353
|
-
`/nodes/${encodeURIComponent(parsed.nodeId)}/board/tasks`,
|
|
354
|
-
BoardTaskResult,
|
|
355
|
-
{ method: "POST", body: JSON.stringify(parsed) },
|
|
356
|
-
);
|
|
357
|
-
},
|
|
358
|
-
async updateBoardTask(input) {
|
|
359
|
-
const parsed = UpdateBoardTaskInput.parse(input);
|
|
360
|
-
return await request(
|
|
361
|
-
`/nodes/${encodeURIComponent(parsed.nodeId)}/board/tasks/update`,
|
|
362
|
-
BoardTaskResult,
|
|
363
|
-
{ method: "POST", body: JSON.stringify(parsed) },
|
|
364
|
-
);
|
|
365
|
-
},
|
|
366
|
-
async moveBoardTask(input) {
|
|
367
|
-
const parsed = MoveBoardTaskInput.parse(input);
|
|
368
|
-
return await request(
|
|
369
|
-
`/nodes/${encodeURIComponent(parsed.nodeId)}/board/tasks/move`,
|
|
370
|
-
BoardTaskResult,
|
|
371
|
-
{ method: "POST", body: JSON.stringify(parsed) },
|
|
372
|
-
);
|
|
373
|
-
},
|
|
374
|
-
async deleteBoardTask(input) {
|
|
375
|
-
const parsed = DeleteBoardTaskInput.parse(input);
|
|
376
|
-
return await request(
|
|
377
|
-
`/nodes/${encodeURIComponent(parsed.nodeId)}/board/tasks/delete`,
|
|
378
|
-
DeleteBoardTaskResult,
|
|
379
|
-
{ method: "POST", body: JSON.stringify(parsed) },
|
|
380
|
-
);
|
|
381
|
-
},
|
|
382
312
|
async listNodeVersions(nodeId) {
|
|
383
313
|
return await request(`/nodes/${encodeURIComponent(nodeId)}/versions`, NodeVersionList);
|
|
384
314
|
},
|
|
@@ -519,10 +449,14 @@ export function createIntelDataProvider(
|
|
|
519
449
|
},
|
|
520
450
|
async completeFlowStep(input) {
|
|
521
451
|
const parsed = CompleteFlowRunStepInput.parse(input);
|
|
522
|
-
return await request(
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
452
|
+
return await request(
|
|
453
|
+
`/flow-runs/${encodeURIComponent(parsed.runId)}/steps/complete`,
|
|
454
|
+
FlowRunStep,
|
|
455
|
+
{
|
|
456
|
+
method: "POST",
|
|
457
|
+
body: JSON.stringify(parsed),
|
|
458
|
+
},
|
|
459
|
+
);
|
|
526
460
|
},
|
|
527
461
|
async listTools() {
|
|
528
462
|
return await request("/tools", ToolCatalog);
|
|
@@ -533,89 +467,6 @@ export function createIntelDataProvider(
|
|
|
533
467
|
async listToolServers() {
|
|
534
468
|
return await request("/tools/servers", ToolServerCatalog);
|
|
535
469
|
},
|
|
536
|
-
async getAgent(nodeId) {
|
|
537
|
-
return await request(`/nodes/${encodeURIComponent(nodeId)}/agent`, NodeAgent);
|
|
538
|
-
},
|
|
539
|
-
// ⚠️ `CreatedAgent` is `NodeAgent` since D29, and that is the point rather than a leftover: the
|
|
540
|
-
// create answer used to carry the Gate application key once (#182), and the browser had to be
|
|
541
|
-
// given a credential it could not do anything with. It now goes from Gate into the agent runtime
|
|
542
|
-
// inside the request, so the create answers exactly what a read answers.
|
|
543
|
-
async createAgent(input) {
|
|
544
|
-
return await request("/nodes/agents", CreatedAgent, {
|
|
545
|
-
method: "POST",
|
|
546
|
-
body: JSON.stringify(CreateAgentInput.parse(input)),
|
|
547
|
-
});
|
|
548
|
-
},
|
|
549
|
-
/**
|
|
550
|
-
* Replace the key of the Gate Application an agent runs as (D29, #207).
|
|
551
|
-
*
|
|
552
|
-
* ⚠️ The repair path for `agent_key_missing`, and the answer carries no key — intel asks Gate
|
|
553
|
-
* and hands the new one to the runtime itself. Nothing here has a credential to hold.
|
|
554
|
-
*/
|
|
555
|
-
async rotateAgentKey(nodeId) {
|
|
556
|
-
return await request(
|
|
557
|
-
`/nodes/agents/${encodeURIComponent(nodeId)}/rotate-key`,
|
|
558
|
-
AgentKeyRotated,
|
|
559
|
-
{ method: "POST" },
|
|
560
|
-
);
|
|
561
|
-
},
|
|
562
|
-
async saveAgentDefinition(input) {
|
|
563
|
-
const parsed = SaveAgentDefinitionInput.parse(input);
|
|
564
|
-
return await request(`/nodes/${encodeURIComponent(parsed.nodeId)}/agent`, NodeAgent, {
|
|
565
|
-
method: "POST",
|
|
566
|
-
body: JSON.stringify(parsed),
|
|
567
|
-
});
|
|
568
|
-
},
|
|
569
|
-
/**
|
|
570
|
-
* The agent runtime, asked through intel (#178).
|
|
571
|
-
*
|
|
572
|
-
* ⚠️ Plain `request`, with no second origin and no bearer of its own — that is the whole change.
|
|
573
|
-
* The runtime used to be a Worker this page called directly, which meant CORS it does not
|
|
574
|
-
* answer and a Gate token the browser cannot have. Intel now proxies `/agents/:agentId/*` and
|
|
575
|
-
* attaches the caller's own token server-side, so a 401 from here really is intel's session
|
|
576
|
-
* expiring and the sign-in that follows is the right one.
|
|
577
|
-
*
|
|
578
|
-
* ⚠️ A 403 is NOT that. It means the reader may not drive agents, which the agent page renders
|
|
579
|
-
* as an answer rather than as a failure.
|
|
580
|
-
*/
|
|
581
|
-
async listAgentRuns(agentId) {
|
|
582
|
-
return await request(agentRuntimePath(agentId, "/runs"), AgentRunList);
|
|
583
|
-
},
|
|
584
|
-
/**
|
|
585
|
-
* ⚠️ The one path under `/agents/:agentId` that intel answers ITSELF (#251). The runtime has no
|
|
586
|
-
* idea what anything costs — the figures come out of Cloudflare's AI Gateway log, read with a
|
|
587
|
-
* token that lives in intel and never in the browser.
|
|
588
|
-
*/
|
|
589
|
-
async getAgentCosts(agentId) {
|
|
590
|
-
return await request(agentRuntimePath(agentId, "/costs"), AgentCosts);
|
|
591
|
-
},
|
|
592
|
-
async getAgentRun(agentId, runId) {
|
|
593
|
-
return await request(
|
|
594
|
-
agentRuntimePath(agentId, `/runs/${encodeURIComponent(runId)}`),
|
|
595
|
-
AgentRunDetail,
|
|
596
|
-
);
|
|
597
|
-
},
|
|
598
|
-
async getAgentState(agentId) {
|
|
599
|
-
return await request(agentRuntimePath(agentId, "/state"), AgentState);
|
|
600
|
-
},
|
|
601
|
-
async pauseAgent(agentId) {
|
|
602
|
-
return await request(agentRuntimePath(agentId, "/pause"), AgentState, { method: "POST" });
|
|
603
|
-
},
|
|
604
|
-
async resumeAgent(agentId) {
|
|
605
|
-
return await request(agentRuntimePath(agentId, "/resume"), AgentState, { method: "POST" });
|
|
606
|
-
},
|
|
607
|
-
async runAgentNow(agentId, target) {
|
|
608
|
-
return await request(agentRuntimePath(agentId, "/run"), AgentManualRun, {
|
|
609
|
-
method: "POST",
|
|
610
|
-
body: JSON.stringify({ target }),
|
|
611
|
-
});
|
|
612
|
-
},
|
|
613
|
-
agentChatApi(agentId) {
|
|
614
|
-
// assistant-ui dials this itself, so it needs the path a browser can use — the same one every
|
|
615
|
-
// other call above goes to, intel's own `/api/v1`.
|
|
616
|
-
return `${baseUrl}/api/v1${agentRuntimePath(agentId, "/chat")}`;
|
|
617
|
-
},
|
|
618
|
-
|
|
619
470
|
// The Worker serves the connect route, so this navigation belongs to the data layer for the
|
|
620
471
|
// same reason `loginPath` does. `silent=1` is what makes it a redirect nobody has to watch.
|
|
621
472
|
startPortalSignIn(returnTo = "/tools") {
|
|
@@ -1,42 +1,35 @@
|
|
|
1
|
+
import type { SessionUser } from "@anchrd/intel-contract";
|
|
2
|
+
import type { BundleImportResult } from "@anchrd/intel-contract/bundle";
|
|
1
3
|
import type {
|
|
2
|
-
AddBoardTaskInput,
|
|
3
|
-
AgentCosts,
|
|
4
|
-
AgentKeyRotated,
|
|
5
|
-
AgentScheduleTarget,
|
|
6
|
-
AppendTableRowsInput,
|
|
7
|
-
AppendTableRowsResult,
|
|
8
4
|
ArchiveFlowInput,
|
|
9
|
-
ArchiveNodeInput,
|
|
10
|
-
BoardTaskResult,
|
|
11
|
-
BundleImportResult,
|
|
12
|
-
CompleteFlowRunStepInput,
|
|
13
|
-
ConfigureBoardInput,
|
|
14
|
-
ConfigureBoardResult,
|
|
15
|
-
CreateAgentInput,
|
|
16
|
-
CreatedAgent,
|
|
17
5
|
CreateFlowInput,
|
|
18
|
-
CreateNodeInput,
|
|
19
|
-
DefineTableInput,
|
|
20
|
-
DeleteBoardTaskInput,
|
|
21
|
-
DeleteBoardTaskResult,
|
|
22
6
|
Flow,
|
|
23
7
|
FlowDocument,
|
|
24
8
|
FlowList,
|
|
25
9
|
FlowPublishPreview,
|
|
26
10
|
FlowRequirements,
|
|
11
|
+
FlowValidation,
|
|
12
|
+
ListFlowsInput,
|
|
13
|
+
PreviewFlowPublishInput,
|
|
14
|
+
PublishFlowInput,
|
|
15
|
+
RelationGraph,
|
|
16
|
+
RelationGraphScope,
|
|
17
|
+
SaveFlowVersionInput,
|
|
18
|
+
UpdateFlowInput,
|
|
19
|
+
} from "@anchrd/intel-contract/flow";
|
|
20
|
+
import type {
|
|
21
|
+
CompleteFlowRunStepInput,
|
|
27
22
|
FlowRunHistory,
|
|
28
23
|
FlowRunList,
|
|
29
24
|
FlowRunStep,
|
|
30
|
-
FlowValidation,
|
|
31
|
-
IntelCapabilities,
|
|
32
25
|
ListFlowRunsInput,
|
|
33
|
-
|
|
26
|
+
StartFlowRunInput,
|
|
27
|
+
} from "@anchrd/intel-contract/flow-run";
|
|
28
|
+
import type {
|
|
29
|
+
ArchiveNodeInput,
|
|
30
|
+
CreateNodeInput,
|
|
34
31
|
ListNodesInput,
|
|
35
|
-
ModelCatalog,
|
|
36
|
-
MoveBoardTaskInput,
|
|
37
32
|
Node,
|
|
38
|
-
NodeAgent,
|
|
39
|
-
NodeBoard,
|
|
40
33
|
NodeDocument,
|
|
41
34
|
NodeGraph,
|
|
42
35
|
NodeKind,
|
|
@@ -44,37 +37,28 @@ import type {
|
|
|
44
37
|
NodeList,
|
|
45
38
|
NodeTable,
|
|
46
39
|
NodeVersionList,
|
|
47
|
-
|
|
48
|
-
PublishFlowInput,
|
|
49
|
-
RelationGraph,
|
|
50
|
-
RelationGraphScope,
|
|
40
|
+
ReindexResult,
|
|
51
41
|
ResolveNodeLinksInput,
|
|
52
42
|
ResolveNodeLinksResult,
|
|
53
|
-
ResourceGrantList,
|
|
54
|
-
RevokeGrantInput,
|
|
55
|
-
RevokeGrantResult,
|
|
56
|
-
SaveAgentDefinitionInput,
|
|
57
43
|
SaveAttachmentInput,
|
|
58
|
-
SaveFlowVersionInput,
|
|
59
44
|
SaveNodeVersionInput,
|
|
60
45
|
SearchInput,
|
|
61
46
|
SearchResult,
|
|
62
|
-
|
|
47
|
+
UpdateNodeInput,
|
|
48
|
+
} from "@anchrd/intel-contract/node";
|
|
49
|
+
import type {
|
|
50
|
+
ResourceGrantList,
|
|
51
|
+
RevokeGrantInput,
|
|
52
|
+
RevokeGrantResult,
|
|
63
53
|
ShareInput,
|
|
64
54
|
ShareResult,
|
|
65
|
-
|
|
66
|
-
ToolCatalog,
|
|
67
|
-
ToolServerCatalog,
|
|
68
|
-
UpdateBoardTaskInput,
|
|
69
|
-
UpdateFlowInput,
|
|
70
|
-
UpdateNodeInput,
|
|
71
|
-
} from "@anchrd/intel-contract";
|
|
55
|
+
} from "@anchrd/intel-contract/share";
|
|
72
56
|
import type {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
} from "
|
|
57
|
+
AppendTableRowsInput,
|
|
58
|
+
AppendTableRowsResult,
|
|
59
|
+
DefineTableInput,
|
|
60
|
+
} from "@anchrd/intel-contract/table";
|
|
61
|
+
import type { ToolCatalog, ToolServerCatalog } from "@anchrd/intel-contract/tool";
|
|
78
62
|
|
|
79
63
|
// One row of the shared tree. Nodes and Flows share the folder, not their nature (ADR-0004), so
|
|
80
64
|
// this is a union that keeps each side's record whole — never a merged "node" that is a bit of both.
|
|
@@ -94,17 +78,14 @@ export type TreeEntry =
|
|
|
94
78
|
|
|
95
79
|
export interface IntelDataProvider {
|
|
96
80
|
getSession(): Promise<SessionUser>;
|
|
97
|
-
// What this installation is equipped to do (#190) — deployment facts, not the caller's
|
|
98
|
-
// permissions. `/session` stays identity only on purpose; this is the separate question.
|
|
99
|
-
getCapabilities(): Promise<IntelCapabilities>;
|
|
100
81
|
/**
|
|
101
|
-
*
|
|
82
|
+
* Rebuild the whole search index (`intel/admin`).
|
|
102
83
|
*
|
|
103
|
-
* ⚠️
|
|
104
|
-
*
|
|
105
|
-
*
|
|
84
|
+
* ⚠️ Answers as soon as the work is QUEUED, not when it is done — `queued` counts the nodes that
|
|
85
|
+
* will be read again, and the index catches up behind it. A screen that said "finished" here
|
|
86
|
+
* would be reporting the wrong thing.
|
|
106
87
|
*/
|
|
107
|
-
|
|
88
|
+
reindexNodes(): Promise<ReindexResult>;
|
|
108
89
|
listNodes(input?: Partial<ListNodesInput>): Promise<NodeList>;
|
|
109
90
|
// One level of the shared tree: the documents and the flows filed in the same folder, in one
|
|
110
91
|
// sorted list. Per level rather than recursive, so opening a folder is what costs a request.
|
|
@@ -137,27 +118,6 @@ export interface IntelDataProvider {
|
|
|
137
118
|
defineTable(input: DefineTableInput): Promise<NodeTable>;
|
|
138
119
|
appendTableRows(input: AppendTableRowsInput): Promise<AppendTableRowsResult>;
|
|
139
120
|
|
|
140
|
-
// A board's whole document — the status list and every task — as one read (#285). There is no
|
|
141
|
-
// per-task GET and there is not meant to be: the file IS the board, and every view of it
|
|
142
|
-
// (anchrd/intel#286) draws the same list.
|
|
143
|
-
getBoard(nodeId: string): Promise<NodeBoard>;
|
|
144
|
-
// The status list, written whole and in the order it should be drawn. Adding, renaming and
|
|
145
|
-
// reordering are all this one call.
|
|
146
|
-
configureBoard(input: ConfigureBoardInput): Promise<ConfigureBoardResult>;
|
|
147
|
-
// ⚠️ The five task operations answer with the ONE task that was written, never the whole board.
|
|
148
|
-
// A board holds up to five thousand tasks, and a one-card edit that answered with all of them
|
|
149
|
-
// would make every write pay for a full read — so the cache is patched from the answer here
|
|
150
|
-
// (`board-data.ts`) rather than refetched.
|
|
151
|
-
addBoardTask(input: AddBoardTaskInput): Promise<BoardTaskResult>;
|
|
152
|
-
updateBoardTask(input: UpdateBoardTaskInput): Promise<BoardTaskResult>;
|
|
153
|
-
// Where a task sits: its column, its parent, its place among its neighbours. ⚠️ A move names
|
|
154
|
-
// its NEIGHBOURS and never an index — the server mints the order key, so one drag writes one
|
|
155
|
-
// task and renumbers nothing.
|
|
156
|
-
moveBoardTask(input: MoveBoardTaskInput): Promise<BoardTaskResult>;
|
|
157
|
-
// ⚠️ Deleting cascades to every descendant and `deleted` counts them, so a surface can say what
|
|
158
|
-
// it is about to do before it does it rather than afterwards.
|
|
159
|
-
deleteBoardTask(input: DeleteBoardTaskInput): Promise<DeleteBoardTaskResult>;
|
|
160
|
-
|
|
161
121
|
// Walks the browser through the portal's OAuth flow without asking anybody anything: Gate is the
|
|
162
122
|
// identity provider Cloudflare Access consumes, so a signed-in person is already known there
|
|
163
123
|
// (#60). It navigates away — the caller renders no button for it and gets no answer back.
|
|
@@ -209,49 +169,5 @@ export interface IntelDataProvider {
|
|
|
209
169
|
listTools(): Promise<ToolCatalog>;
|
|
210
170
|
listToolServers(): Promise<ToolServerCatalog>;
|
|
211
171
|
|
|
212
|
-
// An agent node and the definition its current version carries. `definition` is `null` in the one
|
|
213
|
-
// window where the node exists and no version has been written — the same window a document's
|
|
214
|
-
// content is `null` in.
|
|
215
|
-
getAgent(nodeId: string): Promise<NodeAgent>;
|
|
216
|
-
// ⚠️ `CreatedAgent`: the create answer carries the Gate application key ONCE (#182). Nothing in
|
|
217
|
-
// the UI stores or displays it yet — showing it is its own ticket — but the type has to be honest
|
|
218
|
-
// about what comes back, or the strict read schema would reject the response.
|
|
219
|
-
createAgent(input: CreateAgentInput): Promise<CreatedAgent>;
|
|
220
|
-
// ⚠️ Every change to references, schedules or the model writes a NEW definition version; nothing
|
|
221
|
-
// is edited in place (ADR-0005). `baseVersionId` is the version the editor read, so a parallel
|
|
222
|
-
// change is refused rather than silently overwritten.
|
|
223
|
-
saveAgentDefinition(input: SaveAgentDefinitionInput): Promise<NodeAgent>;
|
|
224
|
-
// Replace the key of the Gate Application an agent runs as (D29). The repair path an agent that
|
|
225
|
-
// answers `agent_key_missing` has, and the only one — Gate keeps a key hashed. ⚠️ No key comes
|
|
226
|
-
// back: intel hands the new one to the agent runtime itself.
|
|
227
|
-
rotateAgentKey(nodeId: string): Promise<AgentKeyRotated>;
|
|
228
|
-
|
|
229
|
-
// ⚠️ The seven below are answered by the agent RUNTIME, a separate Worker — but they are asked of
|
|
230
|
-
// intel, which proxies them with the caller's own Gate token (#178). One origin, one cookie, no
|
|
231
|
-
// CORS. What that costs is that a 403 here means "you may not drive agents", which is a state the
|
|
232
|
-
// agent page renders as an answer rather than as a failure.
|
|
233
|
-
listAgentRuns(agentId: string): Promise<AgentRunList>;
|
|
234
|
-
/**
|
|
235
|
-
* What this agent has actually cost, out of Cloudflare's AI Gateway log (#251).
|
|
236
|
-
*
|
|
237
|
-
* ⚠️ Unlike its neighbours this one is answered by INTEL and not forwarded to the runtime, which
|
|
238
|
-
* knows nothing about money. ⚠️ Read `status` before the numbers: empty with `not_configured` or
|
|
239
|
-
* `unreadable` means "not known", and rendering it like "cost nothing" turns an outage into a
|
|
240
|
-
* saving.
|
|
241
|
-
*/
|
|
242
|
-
getAgentCosts(agentId: string): Promise<AgentCosts>;
|
|
243
|
-
getAgentRun(agentId: string, runId: string): Promise<AgentRunDetail>;
|
|
244
|
-
// Whether the agent is switched off. Runtime state, deliberately not part of the definition: a
|
|
245
|
-
// definition is versioned, shared and read into model context (#179).
|
|
246
|
-
getAgentState(agentId: string): Promise<AgentState>;
|
|
247
|
-
pauseAgent(agentId: string): Promise<AgentState>;
|
|
248
|
-
resumeAgent(agentId: string): Promise<AgentState>;
|
|
249
|
-
// Fires one of the agent's own schedules now. The target must be one it already schedules — a run
|
|
250
|
-
// acts with the AGENT's grants, so naming any node here would be borrowing them.
|
|
251
|
-
runAgentNow(agentId: string, target: AgentScheduleTarget): Promise<AgentManualRun>;
|
|
252
|
-
// Where assistant-ui posts. A URL rather than a method: the chat is an SSE stream the transport
|
|
253
|
-
// owns end to end, and handing it a string is the whole of what it needs from this layer.
|
|
254
|
-
agentChatApi(agentId: string): string;
|
|
255
|
-
|
|
256
172
|
logout(): Promise<void>;
|
|
257
173
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DocumentLinkInlineType } from "@anchrd/intel-contract";
|
|
1
|
+
import { DocumentLinkInlineType } from "@anchrd/intel-contract/node";
|
|
2
2
|
import { BlockNoteSchema } from "@blocknote/core";
|
|
3
3
|
import { createReactInlineContentSpec } from "@blocknote/react";
|
|
4
4
|
import { FileText, Link2Off } from "lucide-react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { NodeKind } from "@anchrd/intel-contract";
|
|
1
|
+
import type { NodeKind } from "@anchrd/intel-contract/node";
|
|
2
2
|
import { useQuery } from "@tanstack/react-query";
|
|
3
3
|
import { ChevronRight, Folder, Search } from "lucide-react";
|
|
4
4
|
import { useMemo, useState } from "react";
|
|
@@ -33,13 +33,13 @@ export function EntryPicker({
|
|
|
33
33
|
}: {
|
|
34
34
|
// Which kind of node may be chosen. `null` offers every kind — what the Flow step uses.
|
|
35
35
|
//
|
|
36
|
-
// ⚠️ A list is not a convenience (#255).
|
|
37
|
-
//
|
|
38
|
-
// and refuses afterwards —
|
|
39
|
-
// picked has to be the same question the caller can answer in one place.
|
|
36
|
+
// ⚠️ A list is not a convenience (#255). A caller that accepts a folder, a document OR a table
|
|
37
|
+
// has one question to ask, and the alternatives — one picker per kind, or a picker that offers
|
|
38
|
+
// everything and refuses afterwards — are either three dialogs or a rejection after the fact.
|
|
39
|
+
// What may be picked has to be the same question the caller can answer in one place.
|
|
40
40
|
kind: NodeKind | NodeKind[] | null;
|
|
41
|
-
// ⚠️ Flows are a second list, not a kind of node, so they are asked for rather than assumed.
|
|
42
|
-
//
|
|
41
|
+
// ⚠️ Flows are a second list, not a kind of node, so they are asked for rather than assumed. A
|
|
42
|
+
// caller that may aim at either says so; every other caller wants nodes only and pays for no
|
|
43
43
|
// second request.
|
|
44
44
|
flows?: boolean;
|
|
45
45
|
value: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FlowRunSummary } from "@anchrd/intel-contract";
|
|
1
|
+
import type { FlowRunSummary } from "@anchrd/intel-contract/flow-run";
|
|
2
2
|
import { useInfiniteQuery, useQuery } from "@tanstack/react-query";
|
|
3
3
|
import { ChevronDown, ChevronRight, CornerDownRight } from "lucide-react";
|
|
4
4
|
import { useState } from "react";
|
package/src/flows/flows.tsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { Flow, FlowGraph, FlowNode
|
|
2
|
-
import { flowNodeLayer } from "@anchrd/intel-contract";
|
|
1
|
+
import type { Flow, FlowGraph, FlowNode } from "@anchrd/intel-contract/flow";
|
|
2
|
+
import { flowNodeLayer } from "@anchrd/intel-contract/flow";
|
|
3
|
+
import type { Node } from "@anchrd/intel-contract/node";
|
|
3
4
|
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
4
5
|
import { useNavigate, useRouterState } from "@tanstack/react-router";
|
|
5
6
|
import {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { flowNodeLayer } from "@anchrd/intel-contract";
|
|
1
|
+
import { flowNodeLayer } from "@anchrd/intel-contract/flow";
|
|
2
2
|
import { Plus, X } from "lucide-react";
|
|
3
3
|
import { Fragment, useId, useRef, useState } from "react";
|
|
4
4
|
import { type NodeIcon, nodeIcon } from "@/flows/node-icon/node-icon.ts";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RelationGraph } from "@anchrd/intel-contract";
|
|
1
|
+
import type { RelationGraph } from "@anchrd/intel-contract/flow";
|
|
2
2
|
import type { UseQueryResult } from "@tanstack/react-query";
|
|
3
3
|
import { lazy, Suspense } from "react";
|
|
4
4
|
import { useI18n } from "@/i18n/i18n-context.tsx";
|