@anchrd/intel-api 0.6.6 → 0.7.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/README.md +44 -3
- package/dist/adapters/cloudflare/cloudflare.js +50 -16
- package/dist/adapters/cloudflare/cloudflare.types.d.ts +11 -0
- package/dist/adapters/content/content.d.ts +1 -1
- package/dist/adapters/db/db-flows.js +161 -20
- package/dist/adapters/db/db-grants.d.ts +13 -2
- package/dist/adapters/db/db-grants.js +25 -8
- package/dist/adapters/db/db-indexing.d.ts +2 -2
- package/dist/adapters/db/db-indexing.js +26 -19
- package/dist/adapters/db/db.d.ts +3 -3
- package/dist/adapters/db/db.js +448 -119
- package/dist/adapters/gate-applications/gate-applications.d.ts +23 -0
- package/dist/adapters/gate-applications/gate-applications.js +66 -0
- package/dist/adapters/index-queue/index-queue.d.ts +1 -1
- package/dist/adapters/index-queue/index-queue.js +2 -2
- package/dist/adapters/semantic-index/semantic-index.types.d.ts +2 -2
- package/dist/agent-runtime/agent-runtime.d.ts +16 -0
- package/dist/agent-runtime/agent-runtime.js +76 -0
- package/dist/agent-runtime/agent-runtime.types.d.ts +57 -0
- package/dist/bundle/bundle.d.ts +4 -0
- package/dist/bundle/bundle.js +1035 -0
- package/dist/bundle/bundle.types.d.ts +33 -0
- package/dist/bundle/bundle.types.js +1 -0
- package/dist/cli/cli.js +10 -1
- package/dist/flows/flows.d.ts +8 -8
- package/dist/flows/flows.js +158 -42
- package/dist/flows/flows.types.d.ts +40 -7
- package/dist/http/http.d.ts +1 -0
- package/dist/http/http.js +329 -63
- package/dist/http/http.types.d.ts +6 -2
- package/dist/indexing/indexing.js +14 -2
- package/dist/indexing/indexing.types.d.ts +2 -2
- package/dist/intel/intel.js +12 -3
- package/dist/intel/intel.types.d.ts +6 -2
- package/dist/mcp/mcp.js +483 -124
- package/dist/mcp/mcp.types.d.ts +11 -2
- package/dist/nodes/nodes.d.ts +2 -0
- package/dist/nodes/nodes.js +1337 -0
- package/dist/nodes/nodes.types.d.ts +314 -0
- package/dist/nodes/nodes.types.js +1 -0
- package/migrations/0011_one_name_for_the_tree.sql +53 -0
- package/migrations/0012_table_snapshots.sql +29 -0
- package/migrations/0013_agents_in_the_tree.sql +76 -0
- package/migrations/0014_agent_applications.sql +25 -0
- package/package.json +3 -2
- package/dist/knowledge/knowledge.d.ts +0 -2
- package/dist/knowledge/knowledge.js +0 -761
- package/dist/knowledge/knowledge.types.d.ts +0 -198
- /package/dist/{knowledge/knowledge.types.js → agent-runtime/agent-runtime.types.js} +0 -0
- /package/dist/{knowledge → nodes}/document-links/document-links.d.ts +0 -0
- /package/dist/{knowledge → nodes}/document-links/document-links.js +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { DocumentConverter } from "../adapters/document-converter/document-converter.types.js";
|
|
2
2
|
import type { SemanticIndex } from "../adapters/semantic-index/semantic-index.types.js";
|
|
3
|
-
import type { ContentStore,
|
|
3
|
+
import type { ContentStore, NodeIndexRepository } from "../nodes/nodes.types.js";
|
|
4
4
|
export interface IndexingDeps {
|
|
5
|
-
repository:
|
|
5
|
+
repository: NodeIndexRepository;
|
|
6
6
|
content: ContentStore;
|
|
7
7
|
semantic?: SemanticIndex | undefined;
|
|
8
8
|
converter?: DocumentConverter | undefined;
|
package/dist/intel/intel.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Hono } from "hono";
|
|
2
2
|
import { createHttp } from "../http/http.js";
|
|
3
3
|
import { handleMcp } from "../mcp/mcp.js";
|
|
4
|
-
import { authorize, authorizeBearer } from "../shared/gate-authorization/gate-authorization.js";
|
|
4
|
+
import { authorize, authorizeBearer, bearer, } from "../shared/gate-authorization/gate-authorization.js";
|
|
5
5
|
import { IntelError } from "../shared/intel-error/intel-error.js";
|
|
6
6
|
import { problemDetails } from "../shared/problem-details/problem-details.js";
|
|
7
7
|
import { reportUnexpectedError } from "../shared/report-unexpected-error/report-unexpected-error.js";
|
|
@@ -68,9 +68,11 @@ export function createIntel(deps) {
|
|
|
68
68
|
}
|
|
69
69
|
app.route("/api/v1", createHttp({
|
|
70
70
|
gate: deps.gate,
|
|
71
|
-
|
|
71
|
+
nodes: deps.nodes,
|
|
72
72
|
flows: deps.flows,
|
|
73
73
|
tools: deps.tools,
|
|
74
|
+
bundle: deps.bundle,
|
|
75
|
+
agents: deps.agents,
|
|
74
76
|
resource,
|
|
75
77
|
resourceMetadataUrl,
|
|
76
78
|
...(deps.auth ? { auth: deps.auth } : {}),
|
|
@@ -83,9 +85,16 @@ export function createIntel(deps) {
|
|
|
83
85
|
}
|
|
84
86
|
return await handleMcp(context.req.raw, {
|
|
85
87
|
authorization,
|
|
88
|
+
// ⚠️ The very token this call was authorized with, so the agent tools reach the runtime as the
|
|
89
|
+
// caller and not as Intel. There is no cookie path on `/mcp`, so `bearer` is the same value
|
|
90
|
+
// `authorize` just used — read again rather than passed out of it, because a function that
|
|
91
|
+
// returned a credential beside its answer would be one somebody logs.
|
|
92
|
+
bearer: bearer(context.req.raw.headers) ?? "",
|
|
93
|
+
agents: deps.agents,
|
|
86
94
|
flows: deps.flows,
|
|
87
|
-
|
|
95
|
+
nodes: deps.nodes,
|
|
88
96
|
tools: deps.tools,
|
|
97
|
+
bundle: deps.bundle,
|
|
89
98
|
});
|
|
90
99
|
});
|
|
91
100
|
return app;
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import type { GateClient } from "@anchrd/gate-sdk";
|
|
2
|
+
import type { AgentRuntimeService } from "../agent-runtime/agent-runtime.types.js";
|
|
2
3
|
import type { BrowserAuth } from "../auth/auth.types.js";
|
|
4
|
+
import type { BundleService } from "../bundle/bundle.types.js";
|
|
3
5
|
import type { FlowService } from "../flows/flows.types.js";
|
|
4
|
-
import type {
|
|
6
|
+
import type { NodeService } from "../nodes/nodes.types.js";
|
|
5
7
|
import type { ToolService } from "../tools/tools.types.js";
|
|
6
8
|
export interface IntelDeps {
|
|
7
9
|
baseUrl: string;
|
|
8
10
|
gateUrl: string;
|
|
9
11
|
gate: Pick<GateClient, "authorize">;
|
|
10
|
-
|
|
12
|
+
nodes: NodeService;
|
|
11
13
|
flows: FlowService;
|
|
12
14
|
tools: ToolService;
|
|
15
|
+
bundle: BundleService;
|
|
16
|
+
agents: AgentRuntimeService;
|
|
13
17
|
auth?: BrowserAuth;
|
|
14
18
|
}
|