@anchrd/intel-api 0.14.0 → 0.16.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/dist/adapters/cloudflare/cloudflare.js +0 -68
- package/dist/adapters/cloudflare/cloudflare.types.d.ts +0 -39
- package/dist/adapters/db/db-flows.js +3 -2
- package/dist/adapters/db/db-grants.d.ts +1 -1
- package/dist/adapters/db/db-grants.js +1 -1
- package/dist/adapters/db/db.js +16 -113
- package/dist/adapters/openid/openid.js +1 -1
- package/dist/adapters/remote-tools/remote-tools.js +1 -1
- package/dist/bundle/bundle.js +31 -141
- package/dist/bundle/bundle.types.d.ts +1 -1
- package/dist/cli/cli.js +18 -11
- package/dist/flows/flows.d.ts +1 -1
- package/dist/flows/flows.js +1 -1
- package/dist/flows/flows.types.d.ts +4 -1
- package/dist/http/http.js +43 -238
- package/dist/http/http.types.d.ts +0 -8
- package/dist/indexing/indexing.js +18 -89
- package/dist/intel/intel.js +4 -9
- package/dist/intel/intel.types.d.ts +0 -6
- package/dist/mcp/mcp.js +84 -361
- package/dist/mcp/mcp.types.d.ts +2 -7
- package/dist/nodes/document-links/document-links.d.ts +6 -8
- package/dist/nodes/document-links/document-links.js +8 -31
- package/dist/nodes/nodes.js +24 -890
- package/dist/nodes/nodes.types.d.ts +14 -173
- package/dist/tools/tool-servers/tool-servers.d.ts +1 -1
- package/dist/tools/tool-servers/tool-servers.js +1 -1
- package/dist/tools/tools.js +37 -148
- package/dist/tools/tools.types.d.ts +1 -22
- package/migrations/0018_no_context_policy_at_last.sql +13 -6
- package/migrations/0019_one_name_for_the_grants.sql +52 -0
- package/package.json +2 -2
- package/dist/adapters/cloudflare-api/cloudflare-api.d.ts +0 -22
- package/dist/adapters/cloudflare-api/cloudflare-api.js +0 -306
- package/dist/adapters/cloudflare-api/cloudflare-api.types.d.ts +0 -64
- package/dist/adapters/cloudflare-api/cloudflare-api.types.js +0 -1
- package/dist/adapters/gate-applications/gate-applications.d.ts +0 -23
- package/dist/adapters/gate-applications/gate-applications.js +0 -88
- package/dist/adapters/tool-delegation/tool-delegation.d.ts +0 -22
- package/dist/adapters/tool-delegation/tool-delegation.js +0 -90
- package/dist/agent-costs/agent-costs.d.ts +0 -16
- package/dist/agent-costs/agent-costs.js +0 -105
- package/dist/agent-costs/agent-costs.types.d.ts +0 -30
- package/dist/agent-costs/agent-costs.types.js +0 -1
- package/dist/agent-runtime/agent-runtime.d.ts +0 -16
- package/dist/agent-runtime/agent-runtime.js +0 -150
- package/dist/agent-runtime/agent-runtime.types.d.ts +0 -122
- package/dist/agent-runtime/agent-runtime.types.js +0 -1
- package/dist/model-catalog/model-catalog.d.ts +0 -2
- package/dist/model-catalog/model-catalog.js +0 -99
- package/dist/model-catalog/model-catalog.types.d.ts +0 -15
- package/dist/model-catalog/model-catalog.types.js +0 -1
- package/dist/nodes/board/board.d.ts +0 -61
- package/dist/nodes/board/board.js +0 -826
- package/dist/nodes/board/board.types.d.ts +0 -38
- package/dist/nodes/board/board.types.js +0 -1
- package/migrations/0013_agents_in_the_tree.sql +0 -76
- package/migrations/0014_agent_applications.sql +0 -25
- package/migrations/0015_tools_delegated_from_a_connection.sql +0 -15
- package/migrations/0016_boards_in_the_tree.sql +0 -80
package/dist/mcp/mcp.types.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import type { Authorized } from "@anchrd/gate-sdk";
|
|
2
|
-
import type { AgentCostsService } from "../agent-costs/agent-costs.types.js";
|
|
3
|
-
import type { AgentRuntimeService } from "../agent-runtime/agent-runtime.types.js";
|
|
4
2
|
import type { BundleService } from "../bundle/bundle.types.js";
|
|
5
3
|
import type { FlowService } from "../flows/flows.types.js";
|
|
6
4
|
import type { NodeService } from "../nodes/nodes.types.js";
|
|
@@ -8,15 +6,12 @@ import type { ToolService } from "../tools/tools.types.js";
|
|
|
8
6
|
export interface McpDeps {
|
|
9
7
|
authorization: Authorized;
|
|
10
8
|
/**
|
|
11
|
-
* The bearer this call was authorized with,
|
|
12
|
-
*
|
|
9
|
+
* The bearer this call was authorized with, passed on where Intel has to speak to Gate as the
|
|
10
|
+
* person asking rather than as itself. Nothing else reads it, and nothing writes it anywhere.
|
|
13
11
|
*/
|
|
14
12
|
bearer: string;
|
|
15
13
|
nodes: NodeService;
|
|
16
14
|
flows: FlowService;
|
|
17
15
|
tools: ToolService;
|
|
18
16
|
bundle: BundleService;
|
|
19
|
-
agents: AgentRuntimeService;
|
|
20
|
-
/** What an agent has cost, out of the AI Gateway log — the MCP half of the profile's figures (#251). */
|
|
21
|
-
agentCosts: AgentCostsService;
|
|
22
17
|
}
|
|
@@ -9,14 +9,12 @@
|
|
|
9
9
|
* newer editor wrote; a strict parse would turn "I do not recognise this block" into "this document
|
|
10
10
|
* cannot be saved". What it does not recognise contributes no link, which is the safe half.
|
|
11
11
|
*
|
|
12
|
-
* ⚠️
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* "what does this body point at" — the writer (`reconcileTextLinks`) asks this function and does
|
|
17
|
-
* not care which kind it is holding.
|
|
12
|
+
* ⚠️ ONE answer to "what does this body point at", whatever kind holds the body: the writer
|
|
13
|
+
* (`reconcileTextLinks`) asks this function and does not care. Until #390 a board answered here
|
|
14
|
+
* too, through the `references` of its tasks — a difference in where the ids were written and not
|
|
15
|
+
* in what they were.
|
|
18
16
|
*
|
|
19
|
-
* Content that is
|
|
20
|
-
* nothing to read.
|
|
17
|
+
* Content that is not a BlockNote document has no links at all: an attachment, a CSV table or plain
|
|
18
|
+
* markdown carries nothing to read.
|
|
21
19
|
*/
|
|
22
20
|
export declare function documentLinkTargets(mediaType: string, content: string): string[];
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { BlockNoteDocument, BlockNoteMediaType,
|
|
2
|
-
import { upgradeStoredBoard } from "../board/board.js";
|
|
1
|
+
import { BlockNoteDocument, BlockNoteMediaType, DocumentLinkInlineType, } from "@anchrd/intel-contract/node";
|
|
3
2
|
function isRecord(value) {
|
|
4
3
|
return typeof value === "object" && value !== null;
|
|
5
4
|
}
|
|
@@ -31,18 +30,16 @@ function collect(value, found) {
|
|
|
31
30
|
* newer editor wrote; a strict parse would turn "I do not recognise this block" into "this document
|
|
32
31
|
* cannot be saved". What it does not recognise contributes no link, which is the safe half.
|
|
33
32
|
*
|
|
34
|
-
* ⚠️
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* "what does this body point at" — the writer (`reconcileTextLinks`) asks this function and does
|
|
39
|
-
* not care which kind it is holding.
|
|
33
|
+
* ⚠️ ONE answer to "what does this body point at", whatever kind holds the body: the writer
|
|
34
|
+
* (`reconcileTextLinks`) asks this function and does not care. Until #390 a board answered here
|
|
35
|
+
* too, through the `references` of its tasks — a difference in where the ids were written and not
|
|
36
|
+
* in what they were.
|
|
40
37
|
*
|
|
41
|
-
* Content that is
|
|
42
|
-
* nothing to read.
|
|
38
|
+
* Content that is not a BlockNote document has no links at all: an attachment, a CSV table or plain
|
|
39
|
+
* markdown carries nothing to read.
|
|
43
40
|
*/
|
|
44
41
|
export function documentLinkTargets(mediaType, content) {
|
|
45
|
-
if (mediaType !== BlockNoteMediaType
|
|
42
|
+
if (mediaType !== BlockNoteMediaType)
|
|
46
43
|
return [];
|
|
47
44
|
let parsed;
|
|
48
45
|
try {
|
|
@@ -52,26 +49,6 @@ export function documentLinkTargets(mediaType, content) {
|
|
|
52
49
|
return [];
|
|
53
50
|
}
|
|
54
51
|
const found = new Set();
|
|
55
|
-
if (mediaType === BoardMediaType) {
|
|
56
|
-
/**
|
|
57
|
-
* ⚠️ Upgraded first, like `parseStoredBoard` and `indexing.ts` — this is the FOURTH place a
|
|
58
|
-
* board body is parsed, and the only one that cannot complain (anchrd/intel#321).
|
|
59
|
-
*
|
|
60
|
-
* A board it fails to parse simply has no links, which reads exactly like a board that points
|
|
61
|
-
* at nothing — and the reconciliation this feeds removes the links a body no longer names, so
|
|
62
|
-
* an unparsed old board would quietly leave the link graph. Every caller hands it a body written
|
|
63
|
-
* moments earlier today, so it has never met one; the upgrade is what keeps that from being the
|
|
64
|
-
* only reason.
|
|
65
|
-
*/
|
|
66
|
-
const board = BoardDocument.safeParse(upgradeStoredBoard(parsed));
|
|
67
|
-
if (!board.success)
|
|
68
|
-
return [];
|
|
69
|
-
for (const task of board.data.tasks) {
|
|
70
|
-
for (const reference of task.references)
|
|
71
|
-
found.add(reference);
|
|
72
|
-
}
|
|
73
|
-
return [...found];
|
|
74
|
-
}
|
|
75
52
|
const document = BlockNoteDocument.safeParse(parsed);
|
|
76
53
|
if (!document.success)
|
|
77
54
|
return [];
|