@indexnetwork/protocol 19.0.0-rc.482.1 → 20.0.0-rc.484.1

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.
Files changed (35) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/IMPLEMENTATION.md +27 -10
  3. package/dist/index.d.ts +2 -3
  4. package/dist/index.js +4 -3
  5. package/dist/networks/{application/indexer.graph.d.ts → indexer.graph.d.ts} +11 -7
  6. package/dist/networks/{application/indexer.graph.js → indexer.graph.js} +6 -6
  7. package/dist/networks/{application/indexer.state.d.ts → indexer.state.d.ts} +7 -17
  8. package/dist/networks/{application/indexer.state.js → indexer.state.js} +6 -10
  9. package/dist/networks/{application/membership.graph.d.ts → membership.graph.d.ts} +2 -4
  10. package/dist/networks/{application/membership.graph.js → membership.graph.js} +3 -3
  11. package/dist/networks/{domain/membership.state.d.ts → membership.state.d.ts} +0 -2
  12. package/dist/networks/{domain/membership.state.js → membership.state.js} +0 -2
  13. package/dist/networks/{application/network.graph.d.ts → network.graph.d.ts} +2 -4
  14. package/dist/networks/{application/network.graph.js → network.graph.js} +3 -3
  15. package/dist/networks/network.module.d.ts +1314 -0
  16. package/dist/networks/network.module.js +83 -0
  17. package/dist/networks/{application/network.recommender.d.ts → network.recommender.d.ts} +0 -2
  18. package/dist/networks/{application/network.recommender.js → network.recommender.js} +4 -6
  19. package/dist/networks/{domain/network.state.d.ts → network.state.d.ts} +0 -2
  20. package/dist/networks/{domain/network.state.js → network.state.js} +0 -2
  21. package/dist/networks/{application/network.tools.d.ts → network.tools.d.ts} +5 -4
  22. package/dist/networks/{application/network.tools.js → network.tools.js} +5 -7
  23. package/dist/shared/agent/tool.factory.js +6 -6
  24. package/dist/shared/agent/tool.registry.js +2 -2
  25. package/package.json +1 -1
  26. package/dist/networks/application/index.d.ts +0 -45
  27. package/dist/networks/application/index.js +0 -50
  28. package/dist/networks/domain/index.d.ts +0 -29
  29. package/dist/networks/domain/index.js +0 -31
  30. package/dist/networks/index.d.ts +0 -9
  31. package/dist/networks/index.js +0 -8
  32. package/dist/networks/ports/communities.tools.port.d.ts +0 -5
  33. package/dist/networks/ports/communities.tools.port.js +0 -1
  34. package/dist/networks/ports/index.d.ts +0 -27
  35. package/dist/networks/ports/index.js +0 -23
@@ -0,0 +1,83 @@
1
+ /**
2
+ * networks — the capability's single public surface.
3
+ *
4
+ * Everything the rest of the package (and every host) may reach lives on the
5
+ * {@link Networks} class. The files beside this one are private implementation,
6
+ * named for what they do rather than for the layer they sit in:
7
+ *
8
+ * network.graph the community lifecycle graph — create, read, update, delete
9
+ * network.state that graph's channel state
10
+ * membership.graph the roster graph — add, list, remove members
11
+ * membership.state that graph's channel state
12
+ * indexer.graph signal↔community assignment, direct or model-evaluated
13
+ * indexer.state that graph's channel state
14
+ * network.recommender ranking public communities during onboarding
15
+ * network.tools the agent-facing tool definitions
16
+ *
17
+ * No directories: every stage here is one or two files, so a folder per stage
18
+ * would only add a hop. Nothing outside `networks/` imports any of it; the
19
+ * layout may change freely as long as this class keeps its shape.
20
+ */
21
+ import { IntentNetworkGraphFactory } from "./indexer.graph.js";
22
+ import { NetworkMembershipGraphFactory } from "./membership.graph.js";
23
+ import { NetworkGraphFactory } from "./network.graph.js";
24
+ import { createNetworkTools } from "./network.tools.js";
25
+ /**
26
+ * The networks capability.
27
+ *
28
+ * One instance is cheap: it holds its dependencies and compiles a graph only
29
+ * when asked, so a host can keep a single `Networks` and build just the graphs
30
+ * it serves.
31
+ */
32
+ export class Networks {
33
+ constructor(deps = {}) {
34
+ this.deps = deps;
35
+ }
36
+ // ── Community lifecycle ─────────────────────────────────────────────────────
37
+ /**
38
+ * Build the community lifecycle graph — create, read, update, delete.
39
+ *
40
+ * @throws If the instance was constructed without a `database`.
41
+ */
42
+ createGraph() {
43
+ return new NetworkGraphFactory(this.database("createGraph")).createGraph();
44
+ }
45
+ // ── Roster ──────────────────────────────────────────────────────────────────
46
+ /**
47
+ * Build the membership graph — add, list, and remove members, under the
48
+ * community's join policy and owner authority.
49
+ *
50
+ * @throws If the instance was constructed without a `database`.
51
+ */
52
+ createMembershipGraph() {
53
+ return new NetworkMembershipGraphFactory(this.database("createMembershipGraph")).createGraph();
54
+ }
55
+ // ── Signal assignment ───────────────────────────────────────────────────────
56
+ /**
57
+ * Build the signal↔community assignment graph — link a signal to a community
58
+ * directly or after model evaluation, and unlink it.
59
+ *
60
+ * @throws If the instance was constructed without a `database` or an `indexer`.
61
+ */
62
+ createAssignmentGraph() {
63
+ const { indexer } = this.deps;
64
+ if (!indexer) {
65
+ throw new Error("Networks.createAssignmentGraph() requires an `indexer` dependency.");
66
+ }
67
+ return new IntentNetworkGraphFactory(this.database("createAssignmentGraph"), indexer).createGraph();
68
+ }
69
+ // ── Stateless surface ───────────────────────────────────────────────────────
70
+ /** Register the agent-facing community tools against a tool definer. */
71
+ static createTools(defineTool, deps) {
72
+ return createNetworkTools(defineTool, deps);
73
+ }
74
+ // ── Internals ───────────────────────────────────────────────────────────────
75
+ /** The database, or the error naming the method that needed it. */
76
+ database(method) {
77
+ const { database } = this.deps;
78
+ if (!database) {
79
+ throw new Error(`Networks.${method}() requires a \`database\` dependency.`);
80
+ }
81
+ return database;
82
+ }
83
+ }
@@ -28,8 +28,6 @@ export interface NetworkRecommenderInput {
28
28
  * (not at module level) so that importing this module does not require
29
29
  * OPENROUTER_API_KEY to be set — tests that import communities tools without a
30
30
  * live LLM env are unaffected.
31
- *
32
- * IND-546: canonical home — previously network/network.recommender.ts.
33
31
  */
34
32
  export declare class NetworkRecommender {
35
33
  private model;
@@ -9,10 +9,10 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  };
10
10
  import { HumanMessage, SystemMessage } from "@langchain/core/messages";
11
11
  import { z } from "zod";
12
- import { log } from "../../shared/observability/log.js";
13
- import { Timed } from "../../shared/observability/performance.js";
14
- import { createStructuredModel } from "../../shared/agent/model.config.js";
15
- import { invokeWithAbortSignal } from "../../shared/agent/model-signal.js";
12
+ import { log } from "../shared/observability/log.js";
13
+ import { Timed } from "../shared/observability/performance.js";
14
+ import { createStructuredModel } from "../shared/agent/model.config.js";
15
+ import { invokeWithAbortSignal } from "../shared/agent/model-signal.js";
16
16
  // ─── Response schema ───────────────────────────────────────────────────────────
17
17
  export const NetworkRecommenderOutputSchema = z.object({
18
18
  rankedNetworkIds: z
@@ -57,8 +57,6 @@ OUTPUT RULES:
57
57
  * (not at module level) so that importing this module does not require
58
58
  * OPENROUTER_API_KEY to be set — tests that import communities tools without a
59
59
  * live LLM env are unaffected.
60
- *
61
- * IND-546: canonical home — previously network/network.recommender.ts.
62
60
  */
63
61
  export class NetworkRecommender {
64
62
  constructor() {
@@ -10,8 +10,6 @@
10
10
  * When the chat is network-scoped (`networkId` is set) and `showAll` is false,
11
11
  * readNode surfaces only the focused network plus the user's personal network
12
12
  * (contacts). Setting `showAll: true` bypasses the restriction (admin use).
13
- *
14
- * IND-546: canonical home — previously network/network.state.ts.
15
13
  */
16
14
  export declare const NetworkGraphState: import("@langchain/langgraph").AnnotationRoot<{
17
15
  /** User performing the action. Always required. */
@@ -11,8 +11,6 @@ import { Annotation } from "@langchain/langgraph";
11
11
  * When the chat is network-scoped (`networkId` is set) and `showAll` is false,
12
12
  * readNode surfaces only the focused network plus the user's personal network
13
13
  * (contacts). Setting `showAll: true` bypasses the restriction (admin use).
14
- *
15
- * IND-546: canonical home — previously network/network.state.ts.
16
14
  */
17
15
  export const NetworkGraphState = Annotation.Root({
18
16
  // --- Core Inputs (from ChatGraph via ToolContext) ---
@@ -1,5 +1,8 @@
1
- import type { DefineTool } from "../../shared/agent/tool.helpers.js";
2
- import type { NetworkToolDeps } from "../ports/communities.tools.port.js";
1
+ import type { DefineTool, ToolRegistryCompositionDeps } from "../shared/agent/tool.helpers.js";
2
+ /** Host capabilities consumed by community discovery and membership tools. */
3
+ export type NetworkToolDeps = Pick<ToolRegistryCompositionDeps, "userDb" | "systemDb" | "getUserContextText" | "networkRanker" | "reportToolError"> & {
4
+ graphs: Pick<ToolRegistryCompositionDeps["graphs"], "index" | "networkMembership">;
5
+ };
3
6
  /**
4
7
  * Creates all community (network) lifecycle and membership tools.
5
8
  *
@@ -29,7 +32,5 @@ import type { NetworkToolDeps } from "../ports/communities.tools.port.js";
29
32
  * `context.isOnboarding` is true and public networks are available. Ranking is
30
33
  * performed by `NetworkRecommender` (ambient LLM agent) or a `deps.networkRanker`
31
34
  * override, with graceful degradation if ranking fails.
32
- *
33
- * IND-546: canonical home — previously network/network.tools.ts.
34
35
  */
35
36
  export declare function createNetworkTools(defineTool: DefineTool, deps: NetworkToolDeps): readonly [any, any, any, any, any, any, any];
@@ -1,9 +1,9 @@
1
1
  import { z } from "zod";
2
- import { requestContext } from "../../shared/observability/request-context.js";
3
- import { log } from "../../shared/observability/log.js";
4
- import { renderNetworkContext } from "../../shared/network/metadata.renderer.js";
5
- import { success, error, UUID_REGEX } from "../../shared/agent/tool.helpers.js";
6
- import { focusedNetworkId } from "../../shared/agent/tool.scope.js";
2
+ import { requestContext } from "../shared/observability/request-context.js";
3
+ import { log } from "../shared/observability/log.js";
4
+ import { renderNetworkContext } from "../shared/network/metadata.renderer.js";
5
+ import { success, error, UUID_REGEX } from "../shared/agent/tool.helpers.js";
6
+ import { focusedNetworkId } from "../shared/agent/tool.scope.js";
7
7
  import { NetworkRecommender } from "./network.recommender.js";
8
8
  /**
9
9
  * Resolves the community this caller is hard-bound to, if any.
@@ -52,8 +52,6 @@ const logger = log.protocol.from("ChatTools:Network");
52
52
  * `context.isOnboarding` is true and public networks are available. Ranking is
53
53
  * performed by `NetworkRecommender` (ambient LLM agent) or a `deps.networkRanker`
54
54
  * override, with graceful degradation if ranking fails.
55
- *
56
- * IND-546: canonical home — previously network/network.tools.ts.
57
55
  */
58
56
  export function createNetworkTools(defineTool, deps) {
59
57
  const { graphs, userDb, systemDb } = deps;
@@ -5,7 +5,7 @@ import { OpportunityGraphFactory } from "../../opportunities/index.js";
5
5
  import { HydeGraphFactory } from "../../discovery/hyde.graph.js";
6
6
  import { HydeGenerator } from "../../discovery/hyde.generator.js";
7
7
  import { LensInferrer } from "../../discovery/lens.inferrer.js";
8
- import { NetworkGraphFactory, NetworkMembershipGraphFactory, IntentNetworkGraphFactory } from "../../networks/index.js";
8
+ import { Networks } from "../../networks/network.module.js";
9
9
  import { NegotiationGraphFactory } from "../../negotiations/index.js";
10
10
  import { PremiseGraphFactory } from "../../premises/premise.graph.js";
11
11
  import { protocolLogger } from "../observability/protocol.logger.js";
@@ -13,7 +13,6 @@ import { resolveChatContext, error, redactSensitiveFields } from "./tool.helpers
13
13
  import { deriveAllowedNetworkIds, focusedIntentId, scopeFromNetworkId } from "./tool.scope.js";
14
14
  import { invokeToolRuntime, toolRuntimeErrorToResult } from "./tool.runtime.js";
15
15
  import { createEnrichmentTools } from "../../enrichment/enrichment.tools.js";
16
- import { createNetworkTools } from "../../networks/index.js";
17
16
  import { createOpportunityTools } from "../../opportunities/index.js";
18
17
  import { createUtilityTools } from "./utility.tools.js";
19
18
  import { createContactTools } from "../../contacts/index.js";
@@ -133,9 +132,10 @@ export async function createChatTools(deps, preResolvedContext) {
133
132
  const opportunityGraph = new OpportunityGraphFactory(database, embedder, compiledHydeGraph, undefined, // evaluator (default)
134
133
  undefined, // queueNotification
135
134
  negotiationGraph, deps.agentDispatcher, deps.queueNegotiateExisting, deps.stampNewbornOpportunities).createGraph();
136
- const networkGraph = new NetworkGraphFactory(database).createGraph();
137
- const networkMembershipGraph = new NetworkMembershipGraphFactory(database).createGraph();
138
- const intentNetworkGraph = new IntentNetworkGraphFactory(database, intents).createGraph();
135
+ const networks = new Networks({ database, indexer: intents });
136
+ const networkGraph = networks.createGraph();
137
+ const networkMembershipGraph = networks.createMembershipGraph();
138
+ const intentNetworkGraph = networks.createAssignmentGraph();
139
139
  // ─── Create context-bound databases ────────────────────────────────────────
140
140
  // Use injected instances when provided (e.g. tests). Otherwise create from the same
141
141
  // database used for graphs so that scope checks (e.g. ensureScopedMembership, opportunity
@@ -197,7 +197,7 @@ export async function createChatTools(deps, preResolvedContext) {
197
197
  const intentToolsForChat = focusedIntentId(resolvedContext)
198
198
  ? intentTools.filter((candidate) => candidate.name !== "create_intent")
199
199
  : intentTools;
200
- const networkTools = createNetworkTools(defineTool, toolDeps);
200
+ const networkTools = Networks.createTools(defineTool, toolDeps);
201
201
  const opportunityTools = createOpportunityTools(defineTool, toolDeps);
202
202
  const utilityTools = createUtilityTools(defineTool, toolDeps);
203
203
  const contactTools = createContactTools(defineTool, toolDeps);
@@ -1,7 +1,7 @@
1
1
  import { error, redactSensitiveFields } from './tool.helpers.js';
2
2
  import { createEnrichmentTools } from '../../enrichment/enrichment.tools.js';
3
3
  import { Intents } from '../../intents/intent.module.js';
4
- import { createNetworkTools } from '../../networks/index.js';
4
+ import { Networks } from '../../networks/network.module.js';
5
5
  import { createOpportunityTools } from '../../opportunities/index.js';
6
6
  import { createUtilityTools } from './utility.tools.js';
7
7
  import { createContactTools } from '../../contacts/index.js';
@@ -54,7 +54,7 @@ export function createToolRegistry(deps, options = {}) {
54
54
  const dt = defineTool;
55
55
  createEnrichmentTools(dt, deps, { surface: isMcpSurface ? 'mcp' : 'rest' });
56
56
  Intents.createTools(dt, deps);
57
- createNetworkTools(dt, deps);
57
+ Networks.createTools(dt, deps);
58
58
  createOpportunityTools(dt, deps);
59
59
  // Utility tools always register read_docs + read_activity_summary; on the
60
60
  // MCP surface scrape_url is omitted and read_docs guidance is sanitized
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indexnetwork/protocol",
3
- "version": "19.0.0-rc.482.1",
3
+ "version": "20.0.0-rc.484.1",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -1,45 +0,0 @@
1
- /**
2
- * networks/application — orchestrators, factories, tools, and agents.
3
- *
4
- * Re-exports the orchestration tier of the communities capability: graph
5
- * factories (LangGraph compilations), tool factories, and agent classes.
6
- *
7
- * Boundary: application-layer only. Imports from networks/domain,
8
- * networks/ports, and shared/ infrastructure — never from runtime/,
9
- * host implementations, or capability facades (except as injected ports).
10
- *
11
- * ## Foreground use cases (participant-directed)
12
- *
13
- * - {@link NetworkGraphFactory} — compiles the network lifecycle graph
14
- * (create, read, update, delete networks).
15
- * - {@link NetworkMembershipGraphFactory} — compiles the membership graph
16
- * (add, list, remove members; enforces join-policy and owner authority).
17
- * - {@link IntentNetworkGraphFactory} — compiles the signal assignment graph
18
- * (direct or LLM-evaluated intent–network linking; unassign).
19
- * IntentIndexer is injected from the signals public facade.
20
- * - {@link createNetworkTools} — foreground tool factory; accepts compiled graphs
21
- * and host deps through communities.tools.port and produces LangChain-compatible
22
- * tool arrays for the tool registry.
23
- *
24
- * ## Ambient use case (ranking / recommendation)
25
- *
26
- * - {@link NetworkRecommender} — LLM-based community ranking used during onboarding
27
- * (step 6) to surface the most relevant public communities for a user. Lazy-
28
- * instantiated inside createNetworkTools to avoid requiring OPENROUTER_API_KEY
29
- * at import time.
30
- *
31
- * ## Application-internal (not in public surface)
32
- *
33
- * - {@link IntentNetworkGraphState}, {@link AssignmentResult}, etc. — graph execution
34
- * state types used within indexer.graph.ts; available here for consumers that
35
- * need the application-layer state shape.
36
- *
37
- * IND-546: canonical application home for communities capability previously spread
38
- * across network/, network/membership/, and network/indexer/.
39
- */
40
- export { NetworkGraphFactory } from "./network.graph.js";
41
- export { NetworkMembershipGraphFactory } from "./membership.graph.js";
42
- export { IntentNetworkGraphFactory } from "./indexer.graph.js";
43
- export { IntentNetworkGraphState, type AssignmentResult, type IntentForIndexing, type IndexMemberContext, } from "./indexer.state.js";
44
- export { NetworkRecommender, NetworkRecommenderOutputSchema, type NetworkRecommenderOutput, type NetworkRecommenderInput, type NetworkRecommenderNetwork, } from "./network.recommender.js";
45
- export { createNetworkTools } from "./network.tools.js";
@@ -1,50 +0,0 @@
1
- /**
2
- * networks/application — orchestrators, factories, tools, and agents.
3
- *
4
- * Re-exports the orchestration tier of the communities capability: graph
5
- * factories (LangGraph compilations), tool factories, and agent classes.
6
- *
7
- * Boundary: application-layer only. Imports from networks/domain,
8
- * networks/ports, and shared/ infrastructure — never from runtime/,
9
- * host implementations, or capability facades (except as injected ports).
10
- *
11
- * ## Foreground use cases (participant-directed)
12
- *
13
- * - {@link NetworkGraphFactory} — compiles the network lifecycle graph
14
- * (create, read, update, delete networks).
15
- * - {@link NetworkMembershipGraphFactory} — compiles the membership graph
16
- * (add, list, remove members; enforces join-policy and owner authority).
17
- * - {@link IntentNetworkGraphFactory} — compiles the signal assignment graph
18
- * (direct or LLM-evaluated intent–network linking; unassign).
19
- * IntentIndexer is injected from the signals public facade.
20
- * - {@link createNetworkTools} — foreground tool factory; accepts compiled graphs
21
- * and host deps through communities.tools.port and produces LangChain-compatible
22
- * tool arrays for the tool registry.
23
- *
24
- * ## Ambient use case (ranking / recommendation)
25
- *
26
- * - {@link NetworkRecommender} — LLM-based community ranking used during onboarding
27
- * (step 6) to surface the most relevant public communities for a user. Lazy-
28
- * instantiated inside createNetworkTools to avoid requiring OPENROUTER_API_KEY
29
- * at import time.
30
- *
31
- * ## Application-internal (not in public surface)
32
- *
33
- * - {@link IntentNetworkGraphState}, {@link AssignmentResult}, etc. — graph execution
34
- * state types used within indexer.graph.ts; available here for consumers that
35
- * need the application-layer state shape.
36
- *
37
- * IND-546: canonical application home for communities capability previously spread
38
- * across network/, network/membership/, and network/indexer/.
39
- */
40
- // ── Network lifecycle graph ───────────────────────────────────────────────────
41
- export { NetworkGraphFactory } from "./network.graph.js";
42
- // ── Membership graph ──────────────────────────────────────────────────────────
43
- export { NetworkMembershipGraphFactory } from "./membership.graph.js";
44
- // ── Signal-assignment (indexer) graph + state ─────────────────────────────────
45
- export { IntentNetworkGraphFactory } from "./indexer.graph.js";
46
- export { IntentNetworkGraphState, } from "./indexer.state.js";
47
- // ── Community ranking agent ───────────────────────────────────────────────────
48
- export { NetworkRecommender, NetworkRecommenderOutputSchema, } from "./network.recommender.js";
49
- // ── Tool factory (foreground adapter entry point) ─────────────────────────────
50
- export { createNetworkTools } from "./network.tools.js";
@@ -1,29 +0,0 @@
1
- /**
2
- * networks/domain — pure community contracts.
3
- *
4
- * Value types and graph-state shapes that define the communities capability's
5
- * domain language. No LLM calls, no LangGraph edges, no cross-capability
6
- * imports beyond domain-level @langchain/langgraph annotations.
7
- *
8
- * ## What lives here
9
- *
10
- * - **NetworkGraphState** — input/output envelope for network lifecycle CRUD
11
- * (create, read, update, delete). Scope semantics (showAll, networkId filter)
12
- * are part of this state.
13
- * - **NetworkMembershipGraphState** — input/output envelope for membership CRUD
14
- * (add member, list members, remove member). Membership authority policy
15
- * (join-policy enforcement, owner-only removals) is implemented in the
16
- * application layer but expressed through this state's inputs.
17
- *
18
- * ## What does NOT live here
19
- *
20
- * - IntentNetworkGraphState: it carries `IntentIndexerOutput` (a signals type)
21
- * and `DebugMetaAgent` (a participant-agents type), so it belongs in the
22
- * application layer (networks/application/indexer.state.ts).
23
- *
24
- * IND-546: canonical home for pure community state types.
25
- * Legacy paths (network/network.state.ts, network/membership/membership.state.ts)
26
- * are thin compatibility re-exports pointing here.
27
- */
28
- export { NetworkGraphState } from "./network.state.js";
29
- export { NetworkMembershipGraphState } from "./membership.state.js";
@@ -1,31 +0,0 @@
1
- /**
2
- * networks/domain — pure community contracts.
3
- *
4
- * Value types and graph-state shapes that define the communities capability's
5
- * domain language. No LLM calls, no LangGraph edges, no cross-capability
6
- * imports beyond domain-level @langchain/langgraph annotations.
7
- *
8
- * ## What lives here
9
- *
10
- * - **NetworkGraphState** — input/output envelope for network lifecycle CRUD
11
- * (create, read, update, delete). Scope semantics (showAll, networkId filter)
12
- * are part of this state.
13
- * - **NetworkMembershipGraphState** — input/output envelope for membership CRUD
14
- * (add member, list members, remove member). Membership authority policy
15
- * (join-policy enforcement, owner-only removals) is implemented in the
16
- * application layer but expressed through this state's inputs.
17
- *
18
- * ## What does NOT live here
19
- *
20
- * - IntentNetworkGraphState: it carries `IntentIndexerOutput` (a signals type)
21
- * and `DebugMetaAgent` (a participant-agents type), so it belongs in the
22
- * application layer (networks/application/indexer.state.ts).
23
- *
24
- * IND-546: canonical home for pure community state types.
25
- * Legacy paths (network/network.state.ts, network/membership/membership.state.ts)
26
- * are thin compatibility re-exports pointing here.
27
- */
28
- // ── Network lifecycle state ───────────────────────────────────────────────────
29
- export { NetworkGraphState } from "./network.state.js";
30
- // ── Membership state ──────────────────────────────────────────────────────────
31
- export { NetworkMembershipGraphState } from "./membership.state.js";
@@ -1,9 +0,0 @@
1
- /**
2
- * communities — the capability's sole cross-capability surface.
3
- *
4
- * Anything outside this capability imports from here and nowhere else.
5
- * Supersedes the capabilities/*.facade.ts + networks/public/ pair; the export
6
- * list is the union of the facades it replaces, so the contract is unchanged.
7
- */
8
- export { createNetworkTools, IntentNetworkGraphFactory, NetworkGraphFactory, NetworkMembershipGraphFactory, } from "./application/index.js";
9
- export type { NetworkToolDeps, } from "./ports/communities.tools.port.js";
@@ -1,8 +0,0 @@
1
- /**
2
- * communities — the capability's sole cross-capability surface.
3
- *
4
- * Anything outside this capability imports from here and nowhere else.
5
- * Supersedes the capabilities/*.facade.ts + networks/public/ pair; the export
6
- * list is the union of the facades it replaces, so the contract is unchanged.
7
- */
8
- export { createNetworkTools, IntentNetworkGraphFactory, NetworkGraphFactory, NetworkMembershipGraphFactory, } from "./application/index.js";
@@ -1,5 +0,0 @@
1
- import type { ToolRegistryCompositionDeps } from "../../shared/agent/tool.helpers.js";
2
- /** Host capabilities consumed by community discovery and membership tools. */
3
- export type NetworkToolDeps = Pick<ToolRegistryCompositionDeps, "userDb" | "systemDb" | "getUserContextText" | "networkRanker" | "reportToolError"> & {
4
- graphs: Pick<ToolRegistryCompositionDeps["graphs"], "index" | "networkMembership">;
5
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,27 +0,0 @@
1
- /**
2
- * networks/ports — narrow injected dependency contracts.
3
- *
4
- * Re-exports the subset of types that the communities capability declares as
5
- * explicit injected ports. Consumers of the communities module should import
6
- * these types from here rather than from the broader shared/interfaces barrel
7
- * to keep the dependency surface narrow and auditable.
8
- *
9
- * ## Port groups
10
- *
11
- * ### Persistence ports
12
- * - NetworkGraphDatabase — network lifecycle CRUD (membership + owner queries).
13
- * - NetworkMembershipGraphDatabase — cross-user membership operations.
14
- * - IntentNetworkGraphDatabase — intent–network link CRUD + context queries.
15
- *
16
- * ### Signal-assignment port
17
- * - IntentIndexer, IntentIndexerOutput — LLM evaluator interface injected into
18
- * IntentNetworkGraphFactory. Sourced from capabilities/signals.facade.ts (the
19
- * signals public facade) so that communities never imports signals internals.
20
- *
21
- * IND-546: explicit port layer for communities; signals consumed via capabilities/signals.facade.ts.
22
- */
23
- export type { NetworkGraphDatabase, NetworkMembershipGraphDatabase, IntentNetworkGraphDatabase, } from "../../shared/interfaces/database.interface.js";
24
- import type { Intents } from "../../intents/intent.module.js";
25
- /** The one intents method communities calls: score a signal against a network. */
26
- export type IntentNetworkIndexer = Pick<Intents, "indexIntent">;
27
- export type { IntentIndexerOutput } from "../../intents/intent.module.js";
@@ -1,23 +0,0 @@
1
- /**
2
- * networks/ports — narrow injected dependency contracts.
3
- *
4
- * Re-exports the subset of types that the communities capability declares as
5
- * explicit injected ports. Consumers of the communities module should import
6
- * these types from here rather than from the broader shared/interfaces barrel
7
- * to keep the dependency surface narrow and auditable.
8
- *
9
- * ## Port groups
10
- *
11
- * ### Persistence ports
12
- * - NetworkGraphDatabase — network lifecycle CRUD (membership + owner queries).
13
- * - NetworkMembershipGraphDatabase — cross-user membership operations.
14
- * - IntentNetworkGraphDatabase — intent–network link CRUD + context queries.
15
- *
16
- * ### Signal-assignment port
17
- * - IntentIndexer, IntentIndexerOutput — LLM evaluator interface injected into
18
- * IntentNetworkGraphFactory. Sourced from capabilities/signals.facade.ts (the
19
- * signals public facade) so that communities never imports signals internals.
20
- *
21
- * IND-546: explicit port layer for communities; signals consumed via capabilities/signals.facade.ts.
22
- */
23
- export {};