pilotswarm 0.4.1 → 0.5.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.
Files changed (81) hide show
  1. package/mcp/README.md +88 -4
  2. package/mcp/dist/src/context.d.ts +36 -6
  3. package/mcp/dist/src/context.d.ts.map +1 -1
  4. package/mcp/dist/src/context.js +102 -8
  5. package/mcp/dist/src/context.js.map +1 -1
  6. package/mcp/dist/src/resources/artifacts.d.ts +5 -0
  7. package/mcp/dist/src/resources/artifacts.d.ts.map +1 -0
  8. package/mcp/dist/src/resources/artifacts.js +39 -0
  9. package/mcp/dist/src/resources/artifacts.js.map +1 -0
  10. package/mcp/dist/src/resources/capabilities.d.ts +4 -0
  11. package/mcp/dist/src/resources/capabilities.d.ts.map +1 -0
  12. package/mcp/dist/src/resources/capabilities.js +17 -0
  13. package/mcp/dist/src/resources/capabilities.js.map +1 -0
  14. package/mcp/dist/src/resources/graph.d.ts +5 -0
  15. package/mcp/dist/src/resources/graph.d.ts.map +1 -0
  16. package/mcp/dist/src/resources/graph.js +45 -0
  17. package/mcp/dist/src/resources/graph.js.map +1 -0
  18. package/mcp/dist/src/server.d.ts.map +1 -1
  19. package/mcp/dist/src/server.js +61 -2
  20. package/mcp/dist/src/server.js.map +1 -1
  21. package/mcp/dist/src/tools/agents.d.ts.map +1 -1
  22. package/mcp/dist/src/tools/agents.js +3 -2
  23. package/mcp/dist/src/tools/agents.js.map +1 -1
  24. package/mcp/dist/src/tools/artifacts.d.ts +12 -0
  25. package/mcp/dist/src/tools/artifacts.d.ts.map +1 -0
  26. package/mcp/dist/src/tools/artifacts.js +92 -0
  27. package/mcp/dist/src/tools/artifacts.js.map +1 -0
  28. package/mcp/dist/src/tools/capabilities.d.ts +27 -0
  29. package/mcp/dist/src/tools/capabilities.d.ts.map +1 -0
  30. package/mcp/dist/src/tools/capabilities.js +69 -0
  31. package/mcp/dist/src/tools/capabilities.js.map +1 -0
  32. package/mcp/dist/src/tools/debug.d.ts +4 -0
  33. package/mcp/dist/src/tools/debug.d.ts.map +1 -0
  34. package/mcp/dist/src/tools/debug.js +94 -0
  35. package/mcp/dist/src/tools/debug.js.map +1 -0
  36. package/mcp/dist/src/tools/facts-enhanced.d.ts +13 -0
  37. package/mcp/dist/src/tools/facts-enhanced.d.ts.map +1 -0
  38. package/mcp/dist/src/tools/facts-enhanced.js +80 -0
  39. package/mcp/dist/src/tools/facts-enhanced.js.map +1 -0
  40. package/mcp/dist/src/tools/graph.d.ts +12 -0
  41. package/mcp/dist/src/tools/graph.d.ts.map +1 -0
  42. package/mcp/dist/src/tools/graph.js +237 -0
  43. package/mcp/dist/src/tools/graph.js.map +1 -0
  44. package/mcp/dist/src/tools/groups.d.ts +10 -0
  45. package/mcp/dist/src/tools/groups.d.ts.map +1 -0
  46. package/mcp/dist/src/tools/groups.js +107 -0
  47. package/mcp/dist/src/tools/groups.js.map +1 -0
  48. package/mcp/dist/src/tools/models.d.ts.map +1 -1
  49. package/mcp/dist/src/tools/models.js +16 -4
  50. package/mcp/dist/src/tools/models.js.map +1 -1
  51. package/mcp/dist/src/tools/observability.d.ts +13 -0
  52. package/mcp/dist/src/tools/observability.d.ts.map +1 -0
  53. package/mcp/dist/src/tools/observability.js +174 -0
  54. package/mcp/dist/src/tools/observability.js.map +1 -0
  55. package/mcp/dist/src/tools/sessions.d.ts.map +1 -1
  56. package/mcp/dist/src/tools/sessions.js +120 -94
  57. package/mcp/dist/src/tools/sessions.js.map +1 -1
  58. package/mcp/dist/src/tools/system.d.ts +14 -0
  59. package/mcp/dist/src/tools/system.d.ts.map +1 -0
  60. package/mcp/dist/src/tools/system.js +110 -0
  61. package/mcp/dist/src/tools/system.js.map +1 -0
  62. package/mcp/dist/src/tools/turn-control.d.ts +13 -0
  63. package/mcp/dist/src/tools/turn-control.d.ts.map +1 -0
  64. package/mcp/dist/src/tools/turn-control.js +98 -0
  65. package/mcp/dist/src/tools/turn-control.js.map +1 -0
  66. package/mcp/dist/src/util/respond.d.ts +21 -0
  67. package/mcp/dist/src/util/respond.d.ts.map +1 -0
  68. package/mcp/dist/src/util/respond.js +42 -0
  69. package/mcp/dist/src/util/respond.js.map +1 -0
  70. package/package.json +5 -4
  71. package/tui/bin/tui.js +0 -3
  72. package/tui/src/node-sdk-transport.js +24 -0
  73. package/ui/core/src/selectors.js +23 -2
  74. package/ui/react/src/web-app.js +51 -6
  75. package/web/dist/assets/{index-xJ8IzIZY.js → index-B8ge3rzb.js} +4 -4
  76. package/web/dist/assets/index-DXRIxmIv.css +1 -0
  77. package/web/dist/assets/{pilotswarm-D9pEmenA.js → pilotswarm-Dt1qY6hD.js} +52 -52
  78. package/web/dist/assets/{react-CEPDSRB6.js → react-IRUjK5Iz.js} +1 -1
  79. package/web/dist/index.html +4 -4
  80. package/web/runtime.js +30 -0
  81. package/web/dist/assets/index-DmGOcKR-.css +0 -1
package/mcp/README.md CHANGED
@@ -348,7 +348,23 @@ resource (`dump_session`), which reads session state files off disk.
348
348
 
349
349
  ---
350
350
 
351
- ## Available Tools (20)
351
+ ## Available Tools
352
+
353
+ **Tool registration is capability-gated.** The base surface is always
354
+ registered; enhanced-facts tools appear only when the deployment reports
355
+ `search: true`, graph tools only when it reports `graph: true`, web-only tools
356
+ (artifacts, system status, session events, execution-history export) only in
357
+ `--api-url` mode, and **[admin]**-tagged tools only when the server's
358
+ credential carries the deployment's admin role (or `anonymous` on a no-auth
359
+ deployment). Absent capability ⇒ the tool is absent from `tools/list` — start
360
+ with `get_capabilities` to see the shape of this server.
361
+
362
+ ### Discovery
363
+
364
+ | Tool | Description |
365
+ |------|-------------|
366
+ | `get_capabilities` | Mode (web/direct), admin role, facts search/embedder flags, graph availability, embedded-worker count, default model |
367
+ | `get_system_status` | Embedded-worker count (0 is normal with dedicated worker pods), session-creation policy, creatable agents, log config *(web)* |
352
368
 
353
369
  ### Session Management
354
370
 
@@ -361,9 +377,73 @@ resource (`dump_session`), which reads session state files off disk.
361
377
  | `abort_session` | Cancel a running session with an optional reason |
362
378
  | `rename_session` | Rename a session title |
363
379
  | `delete_session` | Soft-delete a session |
364
- | `list_sessions` | Discovery — list all sessions with status, model, agent info, and parent/child relationships |
380
+ | `list_sessions` | Discovery — list all sessions with status, model, agent info, and parent/child relationships; keyset pagination via `limit`/`cursor`/`include_deleted` |
365
381
  | `get_session_detail` | Discovery — get detailed info for a session including status, context usage, cron state, and pending questions |
366
- | `get_session_events` | Discovery — read the CMS event stream for a session, with `after_seq` pagination and long-poll support |
382
+ | `get_session_events` | Discovery — CMS event stream with `after_seq` forward paging, `before_seq` history paging, `event_types` server-side filter, and long-poll support |
383
+
384
+ ### Turn & Queue Control
385
+
386
+ | Tool | Description |
387
+ |------|-------------|
388
+ | `stop_turn` | Abort the in-flight turn; the session stays alive |
389
+ | `complete_session` | Mark a session completed (successful terminal state, distinct from cancel) |
390
+ | `cancel_pending_messages` | Cancel queued messages by the `client_message_ids` they were sent with |
391
+ | `send_session_event` | Inject a custom named event into a session *(web)* |
392
+
393
+ ### Session Groups
394
+
395
+ | Tool | Description |
396
+ |------|-------------|
397
+ | `list_session_groups` | List groups; `include_sessions` adds member sessions |
398
+ | `manage_session_group` | `action: create \| update \| assign \| move \| cancel \| complete \| delete` — fleet batching |
399
+
400
+ ### Artifacts *(web)*
401
+
402
+ | Tool | Description |
403
+ |------|-------------|
404
+ | `list_artifacts` | List a session's artifacts |
405
+ | `get_artifact` | Metadata + text content + authenticated binary `download_url` |
406
+ | `upload_artifact` | Upload text or base64 binary into a session (2 MB envelope limit) |
407
+ | `delete_artifact` | Delete an artifact |
408
+
409
+ ### Observability
410
+
411
+ | Tool | Description |
412
+ |------|-------------|
413
+ | `debug_session` | The agent-tuner's diagnostic surface as one tool — `include: [info, status, latest_response, events, summary, tokens_by_model, tree_stats, skill_usage, retrieval_usage, facts_stats, orchestration_stats, execution_history, child_outcomes, graph_node_usage, graph_edge_search_usage, graph_searches]`, per-axis error isolation |
414
+ | `get_session_metrics` | Per-session/tree metrics — `include: [summary, tokens_by_model, skill_usage, retrieval_usage, facts_stats, orchestration_stats]` |
415
+ | `get_fleet_overview` | Fleet aggregates — `include: [stats, skill_usage, retrieval_usage, graph_node_usage, user_stats, top_emitters, shared_facts, tombstones]` |
416
+ | `list_child_outcomes` | What each sub-agent concluded, without transcript dumps |
417
+ | `get_execution_history` | Raw duroxide execution events (orchestration forensics) |
418
+ | `export_execution_history` | Export execution history to a session artifact *(web)* |
419
+
420
+ ### Enhanced Facts *(iff deployment reports `search: true`)*
421
+
422
+ | Tool | Description |
423
+ |------|-------------|
424
+ | `search_facts` | Lexical (BM25) / semantic / hybrid retrieval with scores |
425
+ | `similar_facts` | Semantic nearest-neighbours of a known fact |
426
+ | `embedder_status` | Durable embedder lifecycle state |
427
+ | `start_embedder` / `stop_embedder` | Embedder loop control **[admin]** |
428
+
429
+ ### Knowledge Graph *(iff deployment reports `graph: true`)*
430
+
431
+ | Tool | Description |
432
+ |------|-------------|
433
+ | `graph_search_nodes` / `graph_search_edges` | Lexical/anchored graph search |
434
+ | `graph_neighbourhood` | Bounded subgraph expansion around a node |
435
+ | `graph_stats` | Node/edge counts per namespace |
436
+ | `graph_upsert_node` / `graph_upsert_edge` | Evidence-unioning writes |
437
+ | `graph_delete_node` / `graph_delete_edge` | Deletes (no cross-store cascade) |
438
+ | `list_graph_namespaces` / `get_graph_namespace` | Corpus registry reads |
439
+ | `upsert_graph_namespace` / `delete_graph_namespace` | Corpus registry writes **[admin]** |
440
+
441
+ ### System **[admin]**
442
+
443
+ | Tool | Description |
444
+ |------|-------------|
445
+ | `restart_system_session` | Bounce a system agent (sweeper, resourcemgr, …) with `disposition: complete \| terminate \| hard_delete` |
446
+ | `facts_admin` | `action: purge` (tombstoned facts) or `prune_summaries` — destructive housekeeping |
367
447
 
368
448
  ### External MCP boundary
369
449
 
@@ -411,10 +491,14 @@ Top-level session control (`create_session`, `send_message`, `delete_session`, e
411
491
 
412
492
  ---
413
493
 
414
- ## Available Resources (15)
494
+ ## Available Resources
415
495
 
416
496
  | URI | Description |
417
497
  |-----|-------------|
498
+ | `pilotswarm://capabilities` | Capability descriptor: mode, admin, facts/graph flags |
499
+ | `pilotswarm://sessions/{id}/artifacts` | Artifacts for a session *(web)* |
500
+ | `pilotswarm://graph/stats` | Graph node/edge counts *(iff graph)* |
501
+ | `pilotswarm://graph/namespaces` | Registered graph namespaces *(iff graph)* |
418
502
  | `pilotswarm://sessions` | List all sessions with status |
419
503
  | `pilotswarm://sessions/{id}` | Detailed info for a specific session |
420
504
  | `pilotswarm://sessions/{id}/messages` | Chat history for a session |
@@ -1,9 +1,39 @@
1
- import { PilotSwarmClient, PilotSwarmManagementClient, ModelProviderRegistry, loadAgentFiles, type FactStore } from "pilotswarm-sdk";
1
+ import { PilotSwarmClient, PilotSwarmManagementClient, ModelProviderRegistry, loadAgentFiles, type FactStore, type EnhancedFactStore, type GraphStore } from "pilotswarm-sdk";
2
+ import { ApiClient } from "pilotswarm-sdk/api";
2
3
  type AgentConfig = ReturnType<typeof loadAgentFiles>[number];
3
4
  export interface ServerContext {
4
5
  client: PilotSwarmClient;
5
6
  mgmt: PilotSwarmManagementClient;
6
7
  facts: FactStore;
8
+ /**
9
+ * The same store as `facts`, narrowed once at boot via
10
+ * `isEnhancedFactStore` — null when the provider has no search/embedder
11
+ * surface. Enhanced tools register iff non-null (per-boot gate, never
12
+ * sniffed per call).
13
+ */
14
+ enhancedFacts: EnhancedFactStore | null;
15
+ /**
16
+ * Optional graph store — a SEPARATE injection (enhancedfactstore 07 D2),
17
+ * never derived from the fact store. Web mode: capability-probed via
18
+ * `createWebGraphStore`. Direct mode: constructed from HORIZON_* env.
19
+ * Graph tools register iff non-null.
20
+ */
21
+ graph: GraphStore | null;
22
+ /**
23
+ * Web API client (web mode only; null in direct mode). Escape hatch for
24
+ * operations the web management client does not wrap (artifacts, system
25
+ * ops) — `api.call(<operation>, params)` dispatches any operation in the
26
+ * protocol table.
27
+ */
28
+ api: ApiClient | null;
29
+ /**
30
+ * Whether this process's credential carries the deployment's admin role.
31
+ * Web mode: `role === "admin" || role === "anonymous"` from /auth/me
32
+ * (mirrors the server's isAdminAuth). Direct mode: always true — a
33
+ * process holding DATABASE_URL is definitionally privileged.
34
+ * [admin]-tagged tools register iff true.
35
+ */
36
+ admin: boolean;
7
37
  /** True when running over the Web API (`--api-url`); false in direct mode. */
8
38
  webMode: boolean;
9
39
  models: ModelProviderRegistry | null;
@@ -13,11 +43,11 @@ export interface ServerContext {
13
43
  prompt: string;
14
44
  }>;
15
45
  /**
16
- * Agent definitions visible to this MCP server, loaded from
17
- * `<pluginDir>/agents/*.agent.md` for each configured plugin dir.
18
- * Used by the read-only `list_registered_agents` tool. Workers in
19
- * different processes may have a different catalog — see the tool
20
- * description for the divergence note.
46
+ * Agent definitions visible to this MCP server. Web mode: the
47
+ * deployment's creatable-agent catalog (`GET /api/v1/agents`) the
48
+ * authoritative set `createSessionForAgent` will accept. Direct mode:
49
+ * loaded from `<pluginDir>/agents/*.agent.md` for each configured plugin
50
+ * dir (may diverge from any particular worker's catalog).
21
51
  */
22
52
  registeredAgents: AgentConfig[];
23
53
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/context.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,gBAAgB,EAChB,0BAA0B,EAI1B,qBAAqB,EAErB,cAAc,EACd,KAAK,SAAS,EACjB,MAAM,gBAAgB,CAAC;AAIxB,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7D,MAAM,WAAW,aAAa;IAC1B,MAAM,EAAE,gBAAgB,CAAC;IACzB,IAAI,EAAE,0BAA0B,CAAC;IACjC,KAAK,EAAE,SAAS,CAAC;IACjB,8EAA8E;IAC9E,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,qBAAqB,GAAG,IAAI,CAAC;IACrC,MAAM,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC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G;IACH,KAAK,EAAE,OAAO,CAAC;IACf,8EAA8E;IAC9E,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,qBAAqB,GAAG,IAAI,CAAC;IACrC,MAAM,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACrE;;;;;;OAMG;IACH,gBAAgB,EAAE,WAAW,EAAE,CAAC;IAChC;;;;;OAKG;IACH,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC5B;;;;;OAKG;IACH,qBAAqB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1C;AAED,MAAM,WAAW,oBAAoB;IACjC,wFAAwF;IACxF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+EAA+E;IAC/E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,wBAAsB,aAAa,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,aAAa,CAAC,CA6KtF"}
@@ -1,10 +1,14 @@
1
- import { PilotSwarmClient, PilotSwarmManagementClient, createFactStoreForUrl, createWebFactStore, loadModelProviders, loadSkills, loadAgentFiles, } from "pilotswarm-sdk";
1
+ import { PilotSwarmClient, PilotSwarmManagementClient, createFactStoreForUrl, createWebFactStore, createGraphStoreForUrl, createWebGraphStore, isEnhancedFactStore, horizonConfigFromEnv, loadModelProviders, loadSkills, loadAgentFiles, } from "pilotswarm-sdk";
2
2
  import { ApiClient } from "pilotswarm-sdk/api";
3
3
  import { createApiTokenProvider } from "./auth.js";
4
4
  export async function createContext(opts) {
5
5
  let client;
6
6
  let mgmt;
7
7
  let facts;
8
+ let graph = null;
9
+ let api = null;
10
+ let admin = false;
11
+ let webAgents = null;
8
12
  if (opts.apiUrl) {
9
13
  // Web API mode (supported): no database credentials in this process.
10
14
  const getAccessToken = await createApiTokenProvider(opts.apiUrl) ?? undefined;
@@ -12,22 +16,98 @@ export async function createContext(opts) {
12
16
  await client.start();
13
17
  mgmt = new PilotSwarmManagementClient({ apiUrl: opts.apiUrl, getAccessToken });
14
18
  await mgmt.start();
15
- const api = new ApiClient({ apiUrl: opts.apiUrl, getAccessToken });
19
+ api = new ApiClient({ apiUrl: opts.apiUrl, getAccessToken });
16
20
  facts = await createWebFactStore(api);
21
+ // Graph: capability-probed against the deployment (null ⇒ no graph
22
+ // tools). A transient probe failure disables graph rather than
23
+ // failing boot — same posture as the worker's graph init.
24
+ try {
25
+ graph = await createWebGraphStore(api);
26
+ }
27
+ catch {
28
+ graph = null;
29
+ }
30
+ // Admin role: mirrors the server's isAdminAuth (router.js) — the
31
+ // admin role, or "anonymous" on a no-auth deployment (binary
32
+ // admission = full access).
33
+ try {
34
+ const me = await api.getAuthContext();
35
+ const role = me?.authorization?.role;
36
+ admin = role === "admin" || role === "anonymous";
37
+ }
38
+ catch {
39
+ admin = false;
40
+ }
41
+ // Registered agents: the deployment's creatable-agent catalog is the
42
+ // truth in web mode — local plugin dirs may diverge from what
43
+ // createSessionForAgent will accept.
44
+ try {
45
+ const creatable = await api.call("listCreatableAgents");
46
+ if (Array.isArray(creatable)) {
47
+ webAgents = creatable.map((a) => ({
48
+ name: a.name ?? a.id,
49
+ title: a.title ?? null,
50
+ description: a.description ?? null,
51
+ system: Boolean(a.system),
52
+ parent: a.parent ?? null,
53
+ }));
54
+ }
55
+ }
56
+ catch {
57
+ webAgents = null; // fall back to plugin dirs below
58
+ }
17
59
  }
18
60
  else if (opts.store) {
19
- // Direct mode (internal/testing): straight to the datastore.
61
+ // Direct mode (internal/testing): straight to the datastore. A
62
+ // process holding DATABASE_URL is definitionally privileged.
63
+ admin = true;
20
64
  client = new PilotSwarmClient({ store: opts.store });
21
65
  await client.start();
22
66
  mgmt = new PilotSwarmManagementClient({ store: opts.store });
23
67
  await mgmt.start();
24
- facts = await createFactStoreForUrl(opts.store);
68
+ // Enhanced facts + graph provisioning from HORIZON_* env — the same
69
+ // mapping the worker uses, so an MCP server co-located with workers
70
+ // sees the same providers.
71
+ const horizon = horizonConfigFromEnv();
72
+ if (horizon.enhancedFactsDatabaseUrl) {
73
+ facts = await createFactStoreForUrl(horizon.enhancedFactsDatabaseUrl, horizon.enhancedFactsSchema, {
74
+ provider: "horizon",
75
+ embedding: horizon.horizonEmbed,
76
+ });
77
+ }
78
+ else {
79
+ facts = await createFactStoreForUrl(opts.store);
80
+ }
25
81
  await facts.initialize();
82
+ if (horizon.graphDatabaseUrl) {
83
+ try {
84
+ const g = await createGraphStoreForUrl(horizon.graphDatabaseUrl, horizon.graphSchema, {
85
+ registrySchema: horizon.graphRegistrySchema,
86
+ namespaceCacheTtlMs: horizon.graphNamespaceCacheTtlMs,
87
+ });
88
+ if (g) {
89
+ await g.initialize();
90
+ graph = g;
91
+ }
92
+ }
93
+ catch {
94
+ graph = null; // graph disabled; facts unaffected
95
+ }
96
+ }
26
97
  }
27
98
  else {
28
99
  throw new Error("createContext requires either apiUrl (web mode) or store (direct mode).");
29
100
  }
30
- const models = loadModelProviders(opts.modelProvidersPath ?? undefined) ?? null;
101
+ // Narrow ONCE at boot; enhanced tools register iff non-null.
102
+ const enhancedFacts = isEnhancedFactStore(facts) ? facts : null;
103
+ // Local model-provider registry is a DIRECT-mode concern — in web mode
104
+ // the deployment serves the model list, and auto-discovering a local
105
+ // .model_providers.json (cwd) can crash boot on a file that is valid for
106
+ // the deployment but not for this machine's env. Load it in web mode only
107
+ // when the caller explicitly passed --model-providers.
108
+ const models = opts.apiUrl && !opts.modelProvidersPath
109
+ ? null
110
+ : (loadModelProviders(opts.modelProvidersPath ?? undefined) ?? null);
31
111
  let skills = [];
32
112
  if (opts.pluginDirs) {
33
113
  for (const dir of opts.pluginDirs) {
@@ -40,8 +120,8 @@ export async function createContext(opts) {
40
120
  }
41
121
  }
42
122
  }
43
- let registeredAgents = [];
44
- if (opts.pluginDirs) {
123
+ let registeredAgents = webAgents ?? [];
124
+ if (!webAgents && opts.pluginDirs) {
45
125
  // Mirror the worker's loading semantics: name-keyed, last-write-wins
46
126
  // (see packages/sdk/src/worker.ts ~line 720). Keying on `id ?? name`
47
127
  // would let the MCP catalog diverge from any specific worker's
@@ -78,6 +158,20 @@ export async function createContext(opts) {
78
158
  }
79
159
  }
80
160
  await refreshSystemAgentIds();
81
- return { client, mgmt, facts, webMode: Boolean(opts.apiUrl), models, skills, registeredAgents, systemAgentIds, refreshSystemAgentIds };
161
+ return {
162
+ client,
163
+ mgmt,
164
+ facts,
165
+ enhancedFacts,
166
+ graph,
167
+ api,
168
+ admin,
169
+ webMode: Boolean(opts.apiUrl),
170
+ models,
171
+ skills,
172
+ registeredAgents,
173
+ systemAgentIds,
174
+ refreshSystemAgentIds,
175
+ };
82
176
  }
83
177
  //# sourceMappingURL=context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/context.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,gBAAgB,EAChB,0BAA0B,EAC1B,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,EAElB,UAAU,EACV,cAAc,GAEjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AA6CnD,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,IAA0B;IAC1D,IAAI,MAAwB,CAAC;IAC7B,IAAI,IAAgC,CAAC;IACrC,IAAI,KAAgB,CAAC;IAErB,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;QACd,qEAAqE;QACrE,MAAM,cAAc,GAAG,MAAM,sBAAsB,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,SAAS,CAAC;QAC9E,MAAM,GAAG,IAAI,gBAAgB,CAAC,EAAE,MAAM,EAAE,IAAI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C3C,cAAc,CAAC,KAAK,EAAE,CAAC;YACvB,KAAK,MAAM,CAAC,IAAI,QAAiB,EAAE,CAAC;gBAChC,IAAI,CAAC,EAAE,QAAQ,IAAI,OAAO,CAAC,CAAC,OAAO,KAAK,QAAQ,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBACvE,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;gBAClC,CAAC;YACL,CAAC;QACL,CAAC;QAAC,MAAM,CAAC;YACL,iFAAiF;QACrF,CAAC;IACL,CAAC;IACD,MAAM,qBAAqB,EAAE,CAAC;IAE9B,OAAO;QACH,MAAM;QACN,IAAI;QACJ,KAAK;QACL,aAAa;QACb,KAAK;QACL,GAAG;QACH,KAAK;QACL,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC;QAC7B,MAAM;QACN,MAAM;QACN,gBAAgB;QAChB,cAAc;QACd,qBAAqB;KACxB,CAAC;AACN,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import type { ServerContext } from "../context.js";
3
+ /** Artifact listing resource — web mode only (see tools/artifacts.ts). */
4
+ export declare function registerArtifactResources(server: McpServer, ctx: ServerContext): void;
5
+ //# sourceMappingURL=artifacts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifacts.d.ts","sourceRoot":"","sources":["../../../src/resources/artifacts.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,0EAA0E;AAC1E,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,aAAa,QAuC9E"}
@@ -0,0 +1,39 @@
1
+ import { ResourceTemplate } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ /** Artifact listing resource — web mode only (see tools/artifacts.ts). */
3
+ export function registerArtifactResources(server, ctx) {
4
+ const api = ctx.api;
5
+ if (!api)
6
+ return;
7
+ server.registerResource("session-artifacts", new ResourceTemplate("pilotswarm://sessions/{id}/artifacts", {
8
+ list: async () => {
9
+ const sessions = await ctx.mgmt.listSessions();
10
+ return {
11
+ resources: sessions.map((s) => ({
12
+ uri: `pilotswarm://sessions/${s.sessionId}/artifacts`,
13
+ name: `Artifacts: ${s.title ?? s.sessionId}`,
14
+ description: `Artifacts for session ${s.sessionId}`,
15
+ mimeType: "application/json",
16
+ })),
17
+ };
18
+ },
19
+ }), {
20
+ description: "Artifacts (files) produced by or given to a session",
21
+ mimeType: "application/json",
22
+ }, async (uri, variables) => {
23
+ const id = String(variables.id);
24
+ try {
25
+ const artifacts = await api.call("listArtifacts", { sessionId: id });
26
+ const list = Array.isArray(artifacts) ? artifacts : (artifacts?.artifacts ?? []);
27
+ return {
28
+ contents: [{ uri: uri.href, text: JSON.stringify(list, null, 2), mimeType: "application/json" }],
29
+ };
30
+ }
31
+ catch (err) {
32
+ const message = err instanceof Error ? err.message : String(err);
33
+ return {
34
+ contents: [{ uri: uri.href, text: JSON.stringify({ error: message }), mimeType: "application/json" }],
35
+ };
36
+ }
37
+ });
38
+ }
39
+ //# sourceMappingURL=artifacts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifacts.js","sourceRoot":"","sources":["../../../src/resources/artifacts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAI3E,0EAA0E;AAC1E,MAAM,UAAU,yBAAyB,CAAC,MAAiB,EAAE,GAAkB;IAC3E,MAAM,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC;IACpB,IAAI,CAAC,GAAG;QAAE,OAAO;IAEjB,MAAM,CAAC,gBAAgB,CACnB,mBAAmB,EACnB,IAAI,gBAAgB,CAAC,sCAAsC,EAAE;QACzD,IAAI,EAAE,KAAK,IAAI,EAAE;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GAAG,CAAC,CAAC;YACjE,OAAO;gBACH,QAAQ,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAE,kBAAkB,EAAE,CAAC;aACxG,CAAC;QACN,CAAC;IACL,CAAC,CACJ,CAAC;AACN,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import type { ServerContext } from "../context.js";
3
+ export declare function registerCapabilityResources(server: McpServer, ctx: ServerContext): void;
4
+ //# sourceMappingURL=capabilities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../../src/resources/capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAGnD,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,aAAa,QAoBhF"}
@@ -0,0 +1,17 @@
1
+ import { buildCapabilities } from "../tools/capabilities.js";
2
+ export function registerCapabilityResources(server, ctx) {
3
+ server.registerResource("capabilities", "pilotswarm://capabilities", {
4
+ title: "Server Capabilities",
5
+ description: "Capability descriptor for this MCP server: mode, admin role, enhanced-facts flags, graph availability.",
6
+ mimeType: "application/json",
7
+ }, async (uri) => ({
8
+ contents: [
9
+ {
10
+ uri: uri.href,
11
+ text: JSON.stringify(buildCapabilities(ctx), null, 2),
12
+ mimeType: "application/json",
13
+ },
14
+ ],
15
+ }));
16
+ }
17
+ //# sourceMappingURL=capabilities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../../../src/resources/capabilities.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,MAAM,UAAU,2BAA2B,CAAC,MAAiB,EAAE,GAAkB;IAC7E,MAAM,CAAC,gBAAgB,CACnB,cAAc,EACd,2BAA2B,EAC3B;QACI,KAAK,EAAE,qBAAqB;QAC5B,WAAW,EACP,wGAAwG;QAC5G,QAAQ,EAAE,kBAAkB;KAC/B,EACD,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;QACZ,QAAQ,EAAE;YACN;gBACI,GAAG,EAAE,GAAG,CAAC,IAAI;gBACb,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;gBACrD,QAAQ,EAAE,kBAAkB;aAC/B;SACJ;KACJ,CAAC,CACL,CAAC;AACN,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import type { ServerContext } from "../context.js";
3
+ /** Graph read resources — registered only when ctx.graph is present. */
4
+ export declare function registerGraphResources(server: McpServer, ctx: ServerContext): void;
5
+ //# sourceMappingURL=graph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../../src/resources/graph.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,wEAAwE;AACxE,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,aAAa,QAmD3E"}
@@ -0,0 +1,45 @@
1
+ /** Graph read resources — registered only when ctx.graph is present. */
2
+ export function registerGraphResources(server, ctx) {
3
+ const graph = ctx.graph;
4
+ if (!graph)
5
+ return;
6
+ if (typeof graph.graphStats === "function") {
7
+ server.registerResource("graph-stats", "pilotswarm://graph/stats", {
8
+ description: "Knowledge-graph node/edge counts (default namespace)",
9
+ mimeType: "application/json",
10
+ }, async (uri) => {
11
+ try {
12
+ const stats = await graph.graphStats();
13
+ return {
14
+ contents: [{ uri: uri.href, text: JSON.stringify(stats, null, 2), mimeType: "application/json" }],
15
+ };
16
+ }
17
+ catch (err) {
18
+ const message = err instanceof Error ? err.message : String(err);
19
+ return {
20
+ contents: [{ uri: uri.href, text: JSON.stringify({ error: message }), mimeType: "application/json" }],
21
+ };
22
+ }
23
+ });
24
+ }
25
+ if (typeof graph.listGraphNamespaces === "function") {
26
+ server.registerResource("graph-namespaces", "pilotswarm://graph/namespaces", {
27
+ description: "Registered knowledge-graph namespaces (corpora)",
28
+ mimeType: "application/json",
29
+ }, async (uri) => {
30
+ try {
31
+ const namespaces = await graph.listGraphNamespaces();
32
+ return {
33
+ contents: [{ uri: uri.href, text: JSON.stringify(namespaces, null, 2), mimeType: "application/json" }],
34
+ };
35
+ }
36
+ catch (err) {
37
+ const message = err instanceof Error ? err.message : String(err);
38
+ return {
39
+ contents: [{ uri: uri.href, text: JSON.stringify({ error: message }), mimeType: "application/json" }],
40
+ };
41
+ }
42
+ });
43
+ }
44
+ }
45
+ //# sourceMappingURL=graph.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph.js","sourceRoot":"","sources":["../../../src/resources/graph.ts"],"names":[],"mappings":"AAGA,wEAAwE;AACxE,MAAM,UAAU,sBAAsB,CAAC,MAAiB,EAAE,GAAkB;IACxE,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC;IACxB,IAAI,CAAC,KAAK;QAAE,OAAO;IAEnB,IAAI,OAAO,KAAK,CAAC,UAAU,KAAK,UAAU,EAAE,CAAC;QACzC,MAAM,CAAC,gBAAgB,CACnB,aAAa,EACb,0BAA0B,EAC1B;YACI,WAAW,EAAE,sDAAsD;YACnE,QAAQ,EAAE,kBAAkB;SAC/B,EACD,KAAK,EAAE,GAAG,EAAE,EAAE;YACV,IAAI,CAAC;gBACD,MAAM,KAAK,GAAG,MAAM,KAAK,CAAC,UAAW,EA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AC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;gBACjE,OAAO;oBACH,QAAQ,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAE,kBAAkB,EAAE,CAAC;iBACxG,CAAC;YACN,CAAC;QACL,CAAC,CACJ,CAAC;IACN,CAAC;AACL,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAYlD,wBAAgB,eAAe,CAAC,GAAG,EAAE,aAAa,GAAG,SAAS,CAsD7D"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAwBlD,wBAAgB,eAAe,CAAC,GAAG,EAAE,aAAa,GAAG,SAAS,CAsG7D"}
@@ -4,33 +4,92 @@ import { registerSessionTools } from "./tools/sessions.js";
4
4
  import { registerAgentTools } from "./tools/agents.js";
5
5
  import { registerFactsTools } from "./tools/facts.js";
6
6
  import { registerModelTools } from "./tools/models.js";
7
+ import { registerCapabilityTools } from "./tools/capabilities.js";
8
+ import { registerEnhancedFactTools } from "./tools/facts-enhanced.js";
9
+ import { registerGraphTools } from "./tools/graph.js";
10
+ import { registerTurnControlTools } from "./tools/turn-control.js";
11
+ import { registerArtifactTools } from "./tools/artifacts.js";
12
+ import { registerGroupTools } from "./tools/groups.js";
13
+ import { registerObservabilityTools } from "./tools/observability.js";
14
+ import { registerDebugTools } from "./tools/debug.js";
15
+ import { registerSystemTools } from "./tools/system.js";
7
16
  import { registerSessionResources } from "./resources/sessions.js";
8
17
  import { registerAgentResources } from "./resources/agents.js";
9
18
  import { registerFactsResources } from "./resources/facts.js";
10
19
  import { registerModelsResources } from "./resources/models.js";
20
+ import { registerCapabilityResources } from "./resources/capabilities.js";
21
+ import { registerGraphResources } from "./resources/graph.js";
22
+ import { registerArtifactResources } from "./resources/artifacts.js";
11
23
  import { registerSkillPrompts } from "./prompts/skills.js";
12
24
  import { enableResourceSubscriptions } from "./resources/subscriptions.js";
13
25
  export function createMcpServer(ctx) {
14
26
  const server = new McpServer({
15
27
  name: "pilotswarm",
16
- version: "0.1.0",
28
+ version: "0.2.0",
17
29
  }, {
18
30
  capabilities: {
19
31
  tools: { listChanged: true },
20
32
  resources: { subscribe: true, listChanged: true },
21
33
  prompts: { listChanged: true },
22
34
  },
35
+ // Model-facing usage guidance, handed to the client at initialize.
36
+ instructions: [
37
+ "PilotSwarm fleet control plane: manage sessions (agent runs), sub-agent trees, session groups,",
38
+ "artifacts, the shared facts/graph knowledge store, and fleet metrics.",
39
+ "",
40
+ "Start with get_capabilities: it reports mode (web/direct), whether this credential has the admin",
41
+ "role, and enhanced-facts/graph availability. Tools for absent capabilities are not registered.",
42
+ "Then interrogate the AGENT CATALOG — list_registered_agents (or get_system_status include:",
43
+ "['agents']) — to learn what kinds of work this deployment can actually do: each registered agent",
44
+ "definition (name, description, parent constraint) is a capability you can run by creating a",
45
+ "session bound to it (create_session {agent: <name>, prompt: ...}).",
46
+ "Sessions queue durably and run asynchronously: after create_session or send_message, monitor the",
47
+ "session itself — get_session_detail (include: ['status']) for a snapshot, get_session_events",
48
+ "(wait: true) to long-poll for progress. For deep diagnosis of a misbehaving session, use",
49
+ "debug_session (the agent-tuner's read-only evidence bundle: events, metrics, retrieval/graph",
50
+ "usage, orchestration stats, execution history).",
51
+ "",
52
+ "Boundary: this is an EXTERNAL operator surface. It creates/messages/cancels TOP-LEVEL sessions",
53
+ "only; sub-agents are spawned by their parent session's own reasoning loop. Inspect them freely",
54
+ "(list_agents, get_agent_tree, get_session_detail on any session id) but do not expect spawn tools.",
55
+ "",
56
+ "Sessions run asynchronously: send_message returns immediately — follow with get_session_events",
57
+ "(wait=true long-polls) or use send_and_wait for a single blocking turn. Sessions awaiting input",
58
+ "show status input_required; answer with send_answer. stop_turn aborts one turn; abort_session",
59
+ "cancels the whole session; complete_session marks success.",
60
+ "",
61
+ "Destructive tools (delete_session, delete_fact, facts_admin, delete_graph_namespace,",
62
+ "manage_session_group cancel/delete) act immediately — verify targets before calling.",
63
+ "",
64
+ "Reference: https://github.com/affandar/PilotSwarm — docs/user-guide/ (usage guide),",
65
+ "docs/api/reference.md (the Web API this server fronts), packages/app/mcp/README.md (this",
66
+ "server's tool catalog, security model, and client setup).",
67
+ ].join("\n"),
23
68
  });
24
- // Tools
69
+ // Tools — unconditional surface
25
70
  registerSessionTools(server, ctx);
26
71
  registerAgentTools(server, ctx);
27
72
  registerFactsTools(server, ctx);
28
73
  registerModelTools(server, ctx);
74
+ registerCapabilityTools(server, ctx);
75
+ registerTurnControlTools(server, ctx);
76
+ registerGroupTools(server, ctx);
77
+ registerObservabilityTools(server, ctx);
78
+ registerDebugTools(server, ctx);
79
+ registerSystemTools(server, ctx);
80
+ // Tools — capability-gated (each register function no-ops when its
81
+ // provider/mode/role gate fails, so absence ⇒ absent from tools/list).
82
+ registerEnhancedFactTools(server, ctx); // iff ctx.enhancedFacts
83
+ registerGraphTools(server, ctx); // iff ctx.graph ([admin] subset iff ctx.admin)
84
+ registerArtifactTools(server, ctx); // iff web mode (ctx.api)
29
85
  // Resources
30
86
  registerSessionResources(server, ctx);
31
87
  registerAgentResources(server, ctx);
32
88
  registerFactsResources(server, ctx);
33
89
  registerModelsResources(server, ctx);
90
+ registerCapabilityResources(server, ctx);
91
+ registerGraphResources(server, ctx); // iff ctx.graph
92
+ registerArtifactResources(server, ctx); // iff web mode
34
93
  // Prompts
35
94
  registerSkillPrompts(server, ctx);
36
95
  // We advertise the `prompts` capability unconditionally (see constructor
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAE9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;AAE3E,MAAM,UAAU,eAAe,CAAC,GAAkB;IAC9C,MAAM,MAAM,GAAG,IAAI,SAAS,CACxB;QACI,IAAI,EAAE,YAAY;QAClB,OAAO,EAAE,OAAO;KACnB,EACD;QACI,YAAY,EAAE;YACV,KAAK,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE;YAC5B,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE;YACjD,OAAO,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE;SACjC;KACJ,CACJ,CAAC;IAEF,QAAQ;IACR,oBAAoB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAClC,kBAAkB,CAAC,MAAM,EAAE,GAAG,CAAC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OAAO,MAAM,CAAC;AAClB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../../src/tools/agents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,aAAa,QAwWvE"}
1
+ {"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../../src/tools/agents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,aAAa,QAyWvE"}