@axiom-lattice/core 2.1.95 → 2.1.96

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/index.js CHANGED
@@ -1538,11 +1538,13 @@ __export(index_exports, {
1538
1538
  AgentLatticeManager: () => AgentLatticeManager,
1539
1539
  AgentManager: () => AgentManager,
1540
1540
  AgentType: () => import_protocols.AgentType,
1541
+ BUILTIN_PLUGINS: () => BUILTIN_PLUGINS,
1541
1542
  BUILTIN_SKILLS: () => BUILTIN_SKILLS,
1542
1543
  ChunkBuffer: () => ChunkBuffer,
1543
1544
  ChunkBufferLatticeManager: () => ChunkBufferLatticeManager,
1544
1545
  CollectionLatticeManager: () => CollectionLatticeManager,
1545
1546
  CompositeBackend: () => CompositeBackend,
1547
+ ConnectionRegistry: () => ConnectionRegistry,
1546
1548
  ConsoleLoggerClient: () => ConsoleLoggerClient,
1547
1549
  CustomMetricsClient: () => CustomMetricsClient,
1548
1550
  CustomMiddlewareRegistry: () => CustomMiddlewareRegistry,
@@ -1592,6 +1594,7 @@ __export(index_exports, {
1592
1594
  MysqlDatabase: () => MysqlDatabase,
1593
1595
  PersonalAssistantConfig: () => PersonalAssistantConfig,
1594
1596
  PinoLoggerClient: () => PinoLoggerClient,
1597
+ PluginRegistry: () => PluginRegistry,
1595
1598
  PostgresDatabase: () => PostgresDatabase,
1596
1599
  PrometheusClient: () => PrometheusClient,
1597
1600
  Protocols: () => Protocols,
@@ -1754,6 +1757,7 @@ __export(index_exports, {
1754
1757
  sandboxLatticeManager: () => sandboxLatticeManager,
1755
1758
  sanitizeToolCallId: () => sanitizeToolCallId,
1756
1759
  scheduleLatticeManager: () => scheduleLatticeManager,
1760
+ serializePluginMeta: () => serializePluginMeta,
1757
1761
  setBindingRegistry: () => setBindingRegistry,
1758
1762
  setMenuRegistry: () => setMenuRegistry,
1759
1763
  skillLatticeManager: () => skillLatticeManager,
@@ -8836,6 +8840,21 @@ function createCodeEvalMiddleware(params = { vmIsolation: "agent" }) {
8836
8840
  tools: [createShellExecTool({ vmIsolation: params.vmIsolation })]
8837
8841
  });
8838
8842
  }
8843
+ var codeEvalPlugin = {
8844
+ meta: {
8845
+ type: "code_eval",
8846
+ name: "Code Evaluation",
8847
+ description: "Enables safe code execution",
8848
+ configSchema: {
8849
+ type: "object",
8850
+ properties: {
8851
+ vmIsolation: { type: "string" }
8852
+ }
8853
+ },
8854
+ defaultConfig: { vmIsolation: "global" }
8855
+ },
8856
+ middleware: (cfg) => createCodeEvalMiddleware(cfg)
8857
+ };
8839
8858
 
8840
8859
  // src/middlewares/browserMiddleware.ts
8841
8860
  var import_langchain38 = require("langchain");
@@ -8871,6 +8890,22 @@ function createBrowserMiddleware(params = { vmIsolation: "agent" }) {
8871
8890
  tools
8872
8891
  });
8873
8892
  }
8893
+ var browserPlugin = {
8894
+ meta: {
8895
+ type: "browser",
8896
+ name: "Browser",
8897
+ description: "Provides browser automation capabilities",
8898
+ configSchema: {
8899
+ type: "object",
8900
+ properties: {
8901
+ vmIsolation: { type: "string" },
8902
+ headless: { type: "boolean" }
8903
+ }
8904
+ },
8905
+ defaultConfig: { headless: true, vmIsolation: "agent" }
8906
+ },
8907
+ middleware: (cfg) => createBrowserMiddleware(cfg)
8908
+ };
8874
8909
 
8875
8910
  // src/middlewares/sqlMiddleware.ts
8876
8911
  var import_langchain39 = require("langchain");
@@ -8897,6 +8932,27 @@ function createSqlMiddleware(params) {
8897
8932
  ]
8898
8933
  });
8899
8934
  }
8935
+ var sqlPlugin = {
8936
+ meta: {
8937
+ type: "sql",
8938
+ name: "SQL Database",
8939
+ description: "Provides SQL database query capabilities",
8940
+ tools: [
8941
+ { name: "list_tables_sql", description: "List all tables in a database" },
8942
+ { name: "info_sql", description: "Get information about a database connection" },
8943
+ { name: "query_checker_sql", description: "Check a SQL query for correctness" },
8944
+ { name: "query_sql", description: "Execute a SQL query" }
8945
+ ],
8946
+ configSchema: {
8947
+ type: "object",
8948
+ properties: {
8949
+ databaseKeys: { type: "array", items: { type: "string" }, widget: "databaseSelect" }
8950
+ }
8951
+ },
8952
+ defaultConfig: { databaseKeys: [] }
8953
+ },
8954
+ middleware: (cfg) => createSqlMiddleware(cfg)
8955
+ };
8900
8956
 
8901
8957
  // src/middlewares/skillMiddleware.ts
8902
8958
  var import_langchain42 = require("langchain");
@@ -9597,12 +9653,23 @@ Response: \`{"message":"Hello, Simon!"}\`
9597
9653
  From your frontend JS, call the API using relative paths:
9598
9654
 
9599
9655
  \`\`\`js
9600
- // main.js
9656
+ // main.js \u2014 GET
9601
9657
  const res = await fetch(\`./api/hello.js?name=\${name}\`);
9602
9658
  const data = await res.json();
9603
9659
  console.log(data.message);
9660
+
9661
+ // POST with JSON body
9662
+ await fetch("./api/hello.js", {
9663
+ method: "POST",
9664
+ body: JSON.stringify({ title: "New Task", done: false }),
9665
+ });
9666
+
9667
+ // PUT / DELETE \u2014 same pattern
9668
+ await fetch("./api/hello.js", { method: "PUT", body: JSON.stringify({ id: 1, title: "Updated" }) });
9669
+ await fetch("./api/hello.js", { method: "DELETE", body: JSON.stringify({ id: 1 }) });
9604
9670
  \`\`\`
9605
9671
 
9672
+ The API receives the body as \`API_BODY\` env var (raw string), method as \`API_METHOD\`.
9606
9673
  The \`<base>\` tag injected into HTML ensures relative URLs resolve through the share proxy.
9607
9674
 
9608
9675
  ## 4. File Upload
@@ -9889,6 +9956,14 @@ ${skillsPrompt}
9889
9956
  }
9890
9957
  });
9891
9958
  }
9959
+ var skillPlugin = {
9960
+ meta: {
9961
+ type: "skill",
9962
+ name: "Skills",
9963
+ description: "Provides skill loading capabilities for the agent"
9964
+ },
9965
+ middleware: (cfg) => createSkillMiddleware(cfg)
9966
+ };
9892
9967
 
9893
9968
  // src/deep_agent_new/middleware/fs.ts
9894
9969
  var import_langchain43 = require("langchain");
@@ -10756,6 +10831,21 @@ ${systemPrompt}` : systemPrompt;
10756
10831
  }) : void 0
10757
10832
  });
10758
10833
  }
10834
+ var filesystemPlugin = {
10835
+ meta: {
10836
+ type: "filesystem",
10837
+ name: "Filesystem",
10838
+ description: "Provides file system operations for reading, writing, and managing files",
10839
+ configSchema: {
10840
+ type: "object",
10841
+ properties: {
10842
+ vmIsolation: { type: "string" }
10843
+ }
10844
+ },
10845
+ defaultConfig: { vmIsolation: "global" }
10846
+ },
10847
+ middleware: (cfg) => createFilesystemMiddleware(cfg)
10848
+ };
10759
10849
 
10760
10850
  // src/middlewares/metricsMiddleware.ts
10761
10851
  var import_langchain44 = require("langchain");
@@ -10790,6 +10880,31 @@ function createMetricsMiddleware(params) {
10790
10880
  ]
10791
10881
  });
10792
10882
  }
10883
+ var metricsPlugin = {
10884
+ meta: {
10885
+ type: "metrics",
10886
+ name: "Metrics",
10887
+ description: "Provides metrics querying capabilities",
10888
+ tools: [
10889
+ { name: "list_datasources", description: "List all datasources from all configured servers" },
10890
+ { name: "query_metrics_list", description: "Query available metrics from datasources" },
10891
+ { name: "query_metric_definition", description: "Get detailed definition of a specific metric" },
10892
+ { name: "query_semantic_metric_data", description: "Query actual metric data" },
10893
+ { name: "query_tables_list", description: "Query available tables from datasources" },
10894
+ { name: "query_table_definition", description: "Get detailed definition of a specific table" },
10895
+ { name: "execute_sql_query", description: "Execute custom SQL queries" }
10896
+ ],
10897
+ configSchema: {
10898
+ type: "object",
10899
+ properties: {
10900
+ connectAll: { type: "boolean" },
10901
+ serverKeys: { type: "array", items: { type: "string" } }
10902
+ }
10903
+ },
10904
+ defaultConfig: { connectAll: false, serverKeys: [] }
10905
+ },
10906
+ middleware: (cfg) => createMetricsMiddleware(cfg)
10907
+ };
10793
10908
 
10794
10909
  // src/middlewares/collectionMiddleware.ts
10795
10910
  var import_langchain55 = require("langchain");
@@ -11375,6 +11490,34 @@ function createCollectionMiddleware(params) {
11375
11490
  ]
11376
11491
  });
11377
11492
  }
11493
+ var collectionPlugin = {
11494
+ meta: {
11495
+ type: "collection",
11496
+ name: "Collection",
11497
+ description: "Provides vector search and CRUD access to knowledge collections",
11498
+ tools: [
11499
+ { name: "list_collections", description: "List all available collections" },
11500
+ { name: "search_collection", description: "Search for documents in a collection" },
11501
+ { name: "get_collection", description: "Get a specific collection's details" },
11502
+ { name: "list_entries", description: "List entries in a collection" },
11503
+ { name: "create_collection", description: "Create a new collection" },
11504
+ { name: "update_collection", description: "Update an existing collection" },
11505
+ { name: "delete_collection", description: "Delete a collection" },
11506
+ { name: "add_entry", description: "Add an entry to a collection" },
11507
+ { name: "update_entry", description: "Update an entry in a collection" },
11508
+ { name: "delete_entry", description: "Delete an entry from a collection" }
11509
+ ],
11510
+ configSchema: {
11511
+ type: "object",
11512
+ properties: {
11513
+ connectAll: { type: "boolean" },
11514
+ collectionKeys: { type: "array", items: { type: "string" } }
11515
+ }
11516
+ },
11517
+ defaultConfig: { connectAll: false, collectionKeys: [] }
11518
+ },
11519
+ middleware: (cfg) => createCollectionMiddleware(cfg)
11520
+ };
11378
11521
 
11379
11522
  // src/middlewares/askUserClarifyMiddleware.ts
11380
11523
  var import_langchain57 = require("langchain");
@@ -11495,6 +11638,14 @@ function createAskUserClarifyMiddleware() {
11495
11638
  }
11496
11639
  });
11497
11640
  }
11641
+ var askUserClarifyPlugin = {
11642
+ meta: {
11643
+ type: "ask_user_to_clarify",
11644
+ name: "Ask User To Clarify",
11645
+ description: "Enables the agent to ask users clarifying questions"
11646
+ },
11647
+ middleware: () => createAskUserClarifyMiddleware()
11648
+ };
11498
11649
 
11499
11650
  // src/middlewares/widgetMiddleware.ts
11500
11651
  var import_langchain60 = require("langchain");
@@ -12385,6 +12536,14 @@ function createWidgetMiddleware() {
12385
12536
  tools
12386
12537
  });
12387
12538
  }
12539
+ var widgetPlugin = {
12540
+ meta: {
12541
+ type: "widget",
12542
+ name: "Widget",
12543
+ description: "Enables the agent to render interactive HTML widgets"
12544
+ },
12545
+ middleware: () => createWidgetMiddleware()
12546
+ };
12388
12547
 
12389
12548
  // src/middlewares/modelSelectorMiddleware.ts
12390
12549
  var import_langchain61 = require("langchain");
@@ -13000,6 +13159,14 @@ ${startupSections.join("\n\n")}
13000
13159
  }
13001
13160
  });
13002
13161
  }
13162
+ var clawPlugin = {
13163
+ meta: {
13164
+ type: "claw",
13165
+ name: "Memory",
13166
+ description: "Injects and manages memory/bootstrap files in the runtime workspace"
13167
+ },
13168
+ middleware: (cfg) => createClawMiddleware(cfg)
13169
+ };
13003
13170
 
13004
13171
  // src/middlewares/unknownToolHandlerMiddleware.ts
13005
13172
  var import_langchain63 = require("langchain");
@@ -13188,6 +13355,14 @@ ${currentSystemPrompt}` : dateContext;
13188
13355
  }
13189
13356
  });
13190
13357
  }
13358
+ var datePlugin = {
13359
+ meta: {
13360
+ type: "date",
13361
+ name: "Current Date",
13362
+ description: "Injects the current date into the agent system prompt"
13363
+ },
13364
+ middleware: (cfg) => createDateMiddleware(cfg)
13365
+ };
13191
13366
 
13192
13367
  // src/deep_agent_new/middleware/scheduler.ts
13193
13368
  var import_langchain66 = require("langchain");
@@ -16194,6 +16369,14 @@ function createSchedulerMiddleware(options = {}) {
16194
16369
  ]
16195
16370
  });
16196
16371
  }
16372
+ var schedulerPlugin = {
16373
+ meta: {
16374
+ type: "scheduler",
16375
+ name: "Scheduler",
16376
+ description: "Enables the agent to schedule future work"
16377
+ },
16378
+ middleware: (cfg) => createSchedulerMiddleware(cfg)
16379
+ };
16197
16380
 
16198
16381
  // src/middlewares/taskMiddleware.ts
16199
16382
  var import_langchain67 = require("langchain");
@@ -16326,28 +16509,121 @@ function createTaskMiddleware() {
16326
16509
  ]
16327
16510
  });
16328
16511
  }
16512
+ var taskPlugin = {
16513
+ meta: {
16514
+ type: "task",
16515
+ name: "Task Management",
16516
+ description: "Enables persistent task management with delegation and tracking"
16517
+ },
16518
+ middleware: () => createTaskMiddleware()
16519
+ };
16520
+
16521
+ // src/plugin/metaSerializer.ts
16522
+ function tryExtractTools(plugin) {
16523
+ if (!plugin.middleware) return [];
16524
+ try {
16525
+ const result = plugin.middleware({});
16526
+ if (result instanceof Promise) return [];
16527
+ const mw = result;
16528
+ if (Array.isArray(mw.tools)) {
16529
+ return mw.tools.map((t) => ({
16530
+ name: t.name || "",
16531
+ description: t.description || ""
16532
+ }));
16533
+ }
16534
+ } catch {
16535
+ }
16536
+ return [];
16537
+ }
16538
+ function serializePluginMeta(plugin) {
16539
+ const meta = {
16540
+ type: plugin.meta.type,
16541
+ name: plugin.meta.name,
16542
+ description: plugin.meta.description,
16543
+ version: plugin.meta.version,
16544
+ source: plugin.meta.source,
16545
+ icon: plugin.meta.icon,
16546
+ tools: plugin.meta.tools ?? tryExtractTools(plugin),
16547
+ configSchema: plugin.meta.configSchema,
16548
+ defaultConfig: plugin.meta.defaultConfig
16549
+ };
16550
+ if (plugin.connection) {
16551
+ meta.connectionSchema = {
16552
+ fields: plugin.connection.fields,
16553
+ hasTest: typeof plugin.connection.test === "function",
16554
+ hasDiscover: typeof plugin.connection.discover === "function",
16555
+ resourceLabel: plugin.connection.resourceLabel
16556
+ };
16557
+ }
16558
+ return meta;
16559
+ }
16560
+
16561
+ // src/plugin/PluginRegistry.ts
16562
+ var PluginRegistry = class {
16563
+ /** Register a plugin (overwrites if type conflicts) */
16564
+ static register(plugin) {
16565
+ const key4 = plugin.meta.type;
16566
+ if (this.plugins.has(key4)) {
16567
+ console.warn(`[PluginRegistry] "${key4}" overwritten`);
16568
+ }
16569
+ this.plugins.set(key4, plugin);
16570
+ }
16571
+ /** Unregister */
16572
+ static unregister(key4) {
16573
+ return this.plugins.delete(key4);
16574
+ }
16575
+ /** Get plugin instance */
16576
+ static get(key4) {
16577
+ return this.plugins.get(key4);
16578
+ }
16579
+ /** Check if registered */
16580
+ static has(key4) {
16581
+ return this.plugins.has(key4);
16582
+ }
16583
+ /** List all registered plugin keys */
16584
+ static list() {
16585
+ return Array.from(this.plugins.keys());
16586
+ }
16587
+ /** Serialize all registered plugins to API-ready meta list */
16588
+ static listMeta() {
16589
+ return Array.from(this.plugins.values()).map(serializePluginMeta);
16590
+ }
16591
+ };
16592
+ PluginRegistry.plugins = /* @__PURE__ */ new Map();
16329
16593
 
16330
16594
  // src/agent_lattice/builders/CustomMiddlewareRegistry.ts
16331
16595
  var CustomMiddlewareRegistry = class {
16332
16596
  /**
16333
16597
  * Register a custom middleware factory under the given key.
16334
16598
  *
16335
- * The key is referenced by `config.key` in the database middleware configuration.
16336
- * When an agent is built, the framework looks up this key and calls the factory
16337
- * with the remaining config fields.
16599
+ * Supports three calling conventions:
16600
+ * - register(key, factory) legacy, wraps factory as anonymous Plugin
16601
+ * - register(key, factory, meta) — legacy with optional meta
16602
+ *
16603
+ * For new code, prefer PluginRegistry.register(plugin).
16338
16604
  *
16339
16605
  * @param key - Unique identifier, referenced in database config as `config.key`
16340
16606
  * @param factory - Function that receives config (minus `key`) and returns an AgentMiddleware
16341
- *
16342
- * @example
16343
- * ```ts
16344
- * CustomMiddlewareRegistry.register("my-logger", (config) =>
16345
- * createMiddleware({ name: "Logger", beforeAgent: async () => { ... } }),
16346
- * );
16347
- * ```
16607
+ * @param deprecatedMeta - Optional metadata for API discovery
16348
16608
  */
16349
- static register(key4, factory) {
16609
+ static register(key4, factory, deprecatedMeta) {
16350
16610
  this.factories.set(key4, factory);
16611
+ const existing = PluginRegistry.get(key4);
16612
+ if (existing) return;
16613
+ const plugin = {
16614
+ meta: {
16615
+ type: key4,
16616
+ name: deprecatedMeta?.name || key4,
16617
+ description: deprecatedMeta?.description || "",
16618
+ version: deprecatedMeta?.version,
16619
+ source: deprecatedMeta?.source,
16620
+ tools: deprecatedMeta?.tools,
16621
+ configSchema: deprecatedMeta?.configSchema,
16622
+ defaultConfig: deprecatedMeta?.defaultConfig
16623
+ },
16624
+ middleware: factory
16625
+ };
16626
+ PluginRegistry.register(plugin);
16351
16627
  }
16352
16628
  /**
16353
16629
  * Remove a previously registered factory.
@@ -16356,6 +16632,7 @@ var CustomMiddlewareRegistry = class {
16356
16632
  * @returns `true` if a factory was removed, `false` if the key was not found
16357
16633
  */
16358
16634
  static unregister(key4) {
16635
+ PluginRegistry.unregister(key4);
16359
16636
  return this.factories.delete(key4);
16360
16637
  }
16361
16638
  /**
@@ -16365,29 +16642,73 @@ var CustomMiddlewareRegistry = class {
16365
16642
  * @returns The factory function, or `undefined` if not registered
16366
16643
  */
16367
16644
  static get(key4) {
16368
- return this.factories.get(key4);
16645
+ const factory = this.factories.get(key4);
16646
+ if (factory) return factory;
16647
+ const plugin = PluginRegistry.get(key4);
16648
+ if (plugin?.middleware) {
16649
+ return ((config) => plugin.middleware(config));
16650
+ }
16651
+ return void 0;
16369
16652
  }
16370
16653
  /**
16371
16654
  * Check whether a factory is registered under the given key.
16372
- *
16373
- * @param key - The factory key to check
16374
16655
  */
16375
16656
  static has(key4) {
16376
- return this.factories.has(key4);
16657
+ return this.factories.has(key4) || PluginRegistry.has(key4);
16377
16658
  }
16378
16659
  /**
16379
16660
  * Get all currently registered factory keys.
16380
- *
16381
- * @returns Array of registered key strings
16382
16661
  */
16383
16662
  static list() {
16384
- return Array.from(this.factories.keys());
16663
+ const keys = new Set(this.factories.keys());
16664
+ for (const k of PluginRegistry.list()) keys.add(k);
16665
+ return Array.from(keys);
16385
16666
  }
16386
16667
  };
16387
16668
  CustomMiddlewareRegistry.factories = /* @__PURE__ */ new Map();
16388
16669
 
16670
+ // src/connection/ConnectionRegistry.ts
16671
+ var ConnectionRegistry = class {
16672
+ static setStore(store) {
16673
+ this.store = store;
16674
+ }
16675
+ static async list(type, tenantId) {
16676
+ this.ensureStore();
16677
+ return this.store.listByType(tenantId, type);
16678
+ }
16679
+ static async get(type, key4, tenantId) {
16680
+ this.ensureStore();
16681
+ return this.store.getByKey(tenantId, type, key4);
16682
+ }
16683
+ static async create(entry) {
16684
+ this.ensureStore();
16685
+ return this.store.create(entry);
16686
+ }
16687
+ static async update(tenantId, type, key4, updates) {
16688
+ this.ensureStore();
16689
+ return this.store.update(tenantId, type, key4, updates);
16690
+ }
16691
+ static async delete(tenantId, type, key4) {
16692
+ this.ensureStore();
16693
+ return this.store.delete(tenantId, type, key4);
16694
+ }
16695
+ static ensureStore() {
16696
+ if (!this.store) throw new Error("ConnectionStore not configured");
16697
+ }
16698
+ };
16699
+ ConnectionRegistry.store = null;
16700
+
16389
16701
  // src/agent_lattice/builders/commonMiddleware.ts
16390
- async function createCommonMiddlewares(middlewareConfigs, filesystemBackend, fsIsExised) {
16702
+ function applyToolFilter(mw, allowedTools) {
16703
+ if (allowedTools?.length && mw.tools?.length) {
16704
+ mw.tools = mw.tools.filter((t) => {
16705
+ const toolName = t.name;
16706
+ return typeof toolName === "string" && allowedTools.includes(toolName);
16707
+ });
16708
+ }
16709
+ return mw;
16710
+ }
16711
+ async function createCommonMiddlewares(middlewareConfigs, filesystemBackend, fsIsExised, tenantId) {
16391
16712
  const middlewares = [];
16392
16713
  middlewares.push(createUnknownToolHandlerMiddleware());
16393
16714
  middlewares.push(createModelSelectorMiddleware());
@@ -16397,17 +16718,26 @@ async function createCommonMiddlewares(middlewareConfigs, filesystemBackend, fsI
16397
16718
  if (needsFilesystemBackend && filesystemBackend) {
16398
16719
  if (!fsIsExised) {
16399
16720
  const options = { backend: filesystemBackend };
16400
- middlewares.push(createFilesystemMiddleware(options));
16721
+ middlewares.push(applyToolFilter(
16722
+ createFilesystemMiddleware(options),
16723
+ filesystemConfig?.allowedTools
16724
+ ));
16401
16725
  }
16402
16726
  }
16403
16727
  for (const config of middlewareConfigs) {
16404
16728
  if (!config.enabled || config.type === "filesystem") continue;
16405
16729
  switch (config.type) {
16406
16730
  case "code_eval":
16407
- middlewares.push(createCodeEvalMiddleware(config.config));
16731
+ middlewares.push(applyToolFilter(
16732
+ createCodeEvalMiddleware(config.config),
16733
+ config.allowedTools
16734
+ ));
16408
16735
  break;
16409
16736
  case "browser":
16410
- middlewares.push(createBrowserMiddleware(config.config));
16737
+ middlewares.push(applyToolFilter(
16738
+ createBrowserMiddleware(config.config),
16739
+ config.allowedTools
16740
+ ));
16411
16741
  break;
16412
16742
  case "sql":
16413
16743
  {
@@ -16420,21 +16750,30 @@ async function createCommonMiddlewares(middlewareConfigs, filesystemBackend, fsI
16420
16750
  descriptions[db.key] = db.description || db.name || "";
16421
16751
  }
16422
16752
  }
16423
- middlewares.push(createSqlMiddleware({
16424
- databaseKeys: sqlConfig.databaseKeys,
16425
- databaseDescriptions: descriptions
16426
- }));
16753
+ middlewares.push(applyToolFilter(
16754
+ createSqlMiddleware({
16755
+ databaseKeys: sqlConfig.databaseKeys,
16756
+ databaseDescriptions: descriptions
16757
+ }),
16758
+ config.allowedTools
16759
+ ));
16427
16760
  }
16428
16761
  }
16429
16762
  break;
16430
16763
  case "skill":
16431
- middlewares.push(createSkillMiddleware(config.config));
16764
+ middlewares.push(applyToolFilter(
16765
+ createSkillMiddleware(config.config),
16766
+ config.allowedTools
16767
+ ));
16432
16768
  break;
16433
16769
  case "metrics":
16434
16770
  {
16435
16771
  const metricsConfig = config.config;
16436
16772
  if (metricsConfig.connectAll || metricsConfig.serverKeys && metricsConfig.serverKeys.length > 0) {
16437
- middlewares.push(createMetricsMiddleware(metricsConfig));
16773
+ middlewares.push(applyToolFilter(
16774
+ createMetricsMiddleware(metricsConfig),
16775
+ config.allowedTools
16776
+ ));
16438
16777
  }
16439
16778
  }
16440
16779
  break;
@@ -16442,36 +16781,57 @@ async function createCommonMiddlewares(middlewareConfigs, filesystemBackend, fsI
16442
16781
  {
16443
16782
  const collectionConfig = config.config;
16444
16783
  if (collectionConfig.connectAll || collectionConfig.collectionKeys && collectionConfig.collectionKeys.length > 0) {
16445
- middlewares.push(createCollectionMiddleware(collectionConfig));
16784
+ middlewares.push(applyToolFilter(
16785
+ createCollectionMiddleware(collectionConfig),
16786
+ config.allowedTools
16787
+ ));
16446
16788
  }
16447
16789
  }
16448
16790
  break;
16449
16791
  case "ask_user_to_clarify":
16450
- middlewares.push(createAskUserClarifyMiddleware());
16792
+ middlewares.push(applyToolFilter(
16793
+ createAskUserClarifyMiddleware(),
16794
+ config.allowedTools
16795
+ ));
16451
16796
  break;
16452
16797
  case "widget":
16453
- middlewares.push(createWidgetMiddleware());
16798
+ middlewares.push(applyToolFilter(
16799
+ createWidgetMiddleware(),
16800
+ config.allowedTools
16801
+ ));
16454
16802
  break;
16455
16803
  case "claw":
16456
16804
  if (filesystemBackend) {
16457
16805
  const clawMiddlewareConfig = config.config;
16458
- middlewares.push(createClawMiddleware({
16459
- backend: filesystemBackend,
16460
- injectBootstrapFiles: clawMiddlewareConfig.injectBootstrapFiles ?? true,
16461
- bootstrapFiles: clawMiddlewareConfig.bootstrapFiles ?? {}
16462
- }));
16806
+ middlewares.push(applyToolFilter(
16807
+ createClawMiddleware({
16808
+ backend: filesystemBackend,
16809
+ injectBootstrapFiles: clawMiddlewareConfig.injectBootstrapFiles ?? true,
16810
+ bootstrapFiles: clawMiddlewareConfig.bootstrapFiles ?? {}
16811
+ }),
16812
+ config.allowedTools
16813
+ ));
16463
16814
  } else {
16464
16815
  console.warn("[claw middleware] Filesystem backend not available. Claw middleware requires filesystem backend to function.");
16465
16816
  }
16466
16817
  break;
16467
16818
  case "date":
16468
- middlewares.push(createDateMiddleware(config.config));
16819
+ middlewares.push(applyToolFilter(
16820
+ createDateMiddleware(config.config),
16821
+ config.allowedTools
16822
+ ));
16469
16823
  break;
16470
16824
  case "scheduler":
16471
- middlewares.push(createSchedulerMiddleware(config.config));
16825
+ middlewares.push(applyToolFilter(
16826
+ createSchedulerMiddleware(config.config),
16827
+ config.allowedTools
16828
+ ));
16472
16829
  break;
16473
16830
  case "task":
16474
- middlewares.push(createTaskMiddleware());
16831
+ middlewares.push(applyToolFilter(
16832
+ createTaskMiddleware(),
16833
+ config.allowedTools
16834
+ ));
16475
16835
  break;
16476
16836
  case "custom":
16477
16837
  {
@@ -16479,8 +16839,20 @@ async function createCommonMiddlewares(middlewareConfigs, filesystemBackend, fsI
16479
16839
  const { key: key4, ...rest } = customConfig;
16480
16840
  const factory = CustomMiddlewareRegistry.get(key4);
16481
16841
  if (factory) {
16842
+ if (rest.connections?.length && tenantId) {
16843
+ const resolved = (await Promise.all(
16844
+ rest.connections.map(async (connKey) => {
16845
+ const entry = await ConnectionRegistry.get(key4, connKey, tenantId);
16846
+ return entry ? { key: connKey, config: entry.config } : null;
16847
+ })
16848
+ )).filter(Boolean);
16849
+ rest._resolvedConnections = resolved;
16850
+ }
16482
16851
  const middleware = factory(rest);
16483
- middlewares.push(middleware instanceof Promise ? await middleware : middleware);
16852
+ middlewares.push(applyToolFilter(
16853
+ middleware instanceof Promise ? await middleware : middleware,
16854
+ config.allowedTools
16855
+ ));
16484
16856
  } else {
16485
16857
  console.warn(
16486
16858
  `[custom middleware] No factory registered for key "${key4}". Use CustomMiddlewareRegistry.register("${key4}", factory) before building the agent.`
@@ -16488,6 +16860,30 @@ async function createCommonMiddlewares(middlewareConfigs, filesystemBackend, fsI
16488
16860
  }
16489
16861
  }
16490
16862
  break;
16863
+ default:
16864
+ {
16865
+ const plugin = PluginRegistry.get(config.type);
16866
+ if (plugin?.middleware) {
16867
+ const pluginConfig = config.config;
16868
+ if (pluginConfig.connections?.length && tenantId) {
16869
+ const resolved = (await Promise.all(
16870
+ pluginConfig.connections.map(async (connKey) => {
16871
+ const entry = await ConnectionRegistry.get(config.type, connKey, tenantId);
16872
+ return entry ? { key: connKey, config: entry.config } : null;
16873
+ })
16874
+ )).filter(Boolean);
16875
+ pluginConfig._resolvedConnections = resolved;
16876
+ }
16877
+ const mw = plugin.middleware(pluginConfig);
16878
+ middlewares.push(applyToolFilter(
16879
+ mw instanceof Promise ? await mw : mw,
16880
+ config.allowedTools
16881
+ ));
16882
+ } else {
16883
+ console.warn(`[commonMiddleware] Unknown middleware type "${config.type}" \u2014 skipping`);
16884
+ }
16885
+ }
16886
+ break;
16491
16887
  }
16492
16888
  }
16493
16889
  return middlewares;
@@ -16671,8 +17067,8 @@ function createFilesystemBackendFactory(middlewareConfigs) {
16671
17067
 
16672
17068
  // src/agent_lattice/builders/ReActAgentGraphBuilder.ts
16673
17069
  var ReActAgentGraphBuilder = class {
16674
- async createMiddlewares(middlewareConfigs) {
16675
- return await createCommonMiddlewares(middlewareConfigs);
17070
+ async createMiddlewares(middlewareConfigs, tenantId) {
17071
+ return await createCommonMiddlewares(middlewareConfigs, void 0, void 0, tenantId);
16676
17072
  }
16677
17073
  /**
16678
17074
  * 构建ReAct Agent Graph
@@ -16689,7 +17085,7 @@ var ReActAgentGraphBuilder = class {
16689
17085
  const stateSchema2 = createReactAgentSchema(params.stateSchema);
16690
17086
  const middlewareConfigs = params.middleware || [];
16691
17087
  const filesystemBackend = createFilesystemBackendFactory(middlewareConfigs);
16692
- const middlewares = await createCommonMiddlewares(middlewareConfigs, filesystemBackend);
17088
+ const middlewares = await createCommonMiddlewares(middlewareConfigs, filesystemBackend, void 0, params.tenantId);
16693
17089
  return (0, import_langchain68.createAgent)({
16694
17090
  model: params.model,
16695
17091
  tools,
@@ -19039,7 +19435,7 @@ var DeepAgentGraphBuilder = class {
19039
19435
  }));
19040
19436
  const middlewareConfigs = params.middleware || [];
19041
19437
  const filesystemBackend = createFilesystemBackendFactory(middlewareConfigs);
19042
- const middlewares = await createCommonMiddlewares(middlewareConfigs, filesystemBackend, true);
19438
+ const middlewares = await createCommonMiddlewares(middlewareConfigs, filesystemBackend, true, params.tenantId);
19043
19439
  const deepAgent = createDeepAgent({
19044
19440
  tools,
19045
19441
  model: params.model,
@@ -21088,7 +21484,7 @@ var ProcessingAgentGraphBuilder = class {
21088
21484
  }));
21089
21485
  const middlewareConfigs = params.middleware || [];
21090
21486
  const filesystemBackend = createFilesystemBackendFactory(middlewareConfigs);
21091
- const middlewares = await createCommonMiddlewares(middlewareConfigs, filesystemBackend, true);
21487
+ const middlewares = await createCommonMiddlewares(middlewareConfigs, filesystemBackend, true, params.tenantId);
21092
21488
  const topologyConfig = middlewareConfigs.find(
21093
21489
  (m) => m.type === "topology" && m.enabled
21094
21490
  );
@@ -21350,7 +21746,7 @@ var WorkflowAgentGraphBuilder = class {
21350
21746
  const checkpointer = getCheckpointSaver("default");
21351
21747
  const tools = params.tools.map((t) => t.executor).filter(Boolean);
21352
21748
  const middlewareConfigs = params.middleware || [];
21353
- const middlewares = await createCommonMiddlewares(middlewareConfigs, void 0, false);
21749
+ const middlewares = await createCommonMiddlewares(middlewareConfigs, void 0, false, params.tenantId);
21354
21750
  const askMiddlewares = await createCommonMiddlewares([
21355
21751
  {
21356
21752
  id: "ask_user_to_clarify",
@@ -21783,6 +22179,10 @@ async function configureStores(stores, options = {}) {
21783
22179
  }
21784
22180
  storeLatticeManager.registerLattice("default", type, store);
21785
22181
  }
22182
+ if (storeLatticeManager.hasLattice("default", "connection")) {
22183
+ const connectionStore = storeLatticeManager.getStoreLattice("default", "connection").store;
22184
+ ConnectionRegistry.setStore(connectionStore);
22185
+ }
21786
22186
  if (schedule !== void 0) {
21787
22187
  await initAndRegister(schedule, localDisposables);
21788
22188
  const scheduleConfig = {
@@ -23019,6 +23419,53 @@ registerToolLattice(
23019
23419
  }
23020
23420
  }
23021
23421
  );
23422
+ registerToolLattice(
23423
+ "list_middleware_types",
23424
+ {
23425
+ name: "list_middleware_types",
23426
+ description: "\u5217\u51FA\u5F53\u524D\u7CFB\u7EDF\u4E2D\u6240\u6709\u53EF\u7528\u7684\u4E2D\u95F4\u4EF6\u7C7B\u578B\uFF08Middlewares\uFF09\uFF0C\u5305\u62EC\u5185\u7F6E\u548C\u81EA\u5B9A\u4E49\u63D2\u4EF6\u3002\u8FD4\u56DE\u6BCF\u4E2A\u4E2D\u95F4\u4EF6\u7684 type\u3001name\u3001description\u3001tools \u6E05\u5355\uFF08\u652F\u6301 allowedTools \u8FC7\u6EE4\uFF09\u3001configSchema\uFF08\u914D\u7F6E\u9762\u677F\u9700\u8981\u54EA\u4E9B\u5B57\u6BB5\uFF09\u548C connectionSchema\uFF08\u662F\u5426\u652F\u6301\u8FDE\u63A5\u6D4B\u8BD5\u548C\u8D44\u6E90\u53D1\u73B0\uFF09\u3002\n\n\u4F7F\u7528\u573A\u666F\uFF1A\n1. \u5728\u521B\u5EFA agent \u524D\uFF0C\u5148\u8C03\u6B64\u5DE5\u5177\u4E86\u89E3\u6709\u54EA\u4E9B\u4E2D\u95F4\u4EF6\u53EF\u914D\u7F6E\n2. \u6839\u636E configSchema \u51B3\u5B9A\u9700\u8981\u63D0\u4F9B\u54EA\u4E9B\u914D\u7F6E\u5B57\u6BB5\uFF08\u5982 databaseKeys\u3001connections \u7B49\uFF09\n3. \u5982\u679C\u67D0\u4E2A\u4E2D\u95F4\u4EF6\u7684 connectionSchema \u5B58\u5728\uFF0C\u8BF4\u660E\u5B83\u662F\u8FDE\u63A5\u578B\u4E2D\u95F4\u4EF6\uFF0C\u9700\u8981\u518D\u8C03 list_connections \u83B7\u53D6\u53EF\u7528\u8FDE\u63A5\n4. \u7528\u8FD4\u56DE\u7684 type \u5B57\u6BB5\u6784\u5EFA middleware \u6570\u7EC4\u4F20\u7ED9 create_agent / update_agent",
23427
+ schema: import_zod64.default.object({})
23428
+ },
23429
+ async () => {
23430
+ const metas = PluginRegistry.listMeta();
23431
+ return JSON.stringify(metas);
23432
+ }
23433
+ );
23434
+ registerToolLattice(
23435
+ "list_connections",
23436
+ {
23437
+ name: "list_connections",
23438
+ description: "\u5217\u51FA\u6307\u5B9A\u63D2\u4EF6\u7C7B\u578B\u7684\u6240\u6709\u5DF2\u914D\u7F6E\u8FDE\u63A5\u3002\u7528\u4E8E\u67E5\u8BE2\u6709\u54EA\u4E9B\u53EF\u7528\u7684\u8FDE\u63A5\u5B9E\u4F8B\uFF08\u5982 'sap-prod', 'sap-dev'\uFF09\uFF0C\u65B9\u4FBF\u5728 agent \u914D\u7F6E\u4E2D\u9009\u62E9\u5177\u4F53\u8FDE\u63A5\u3002\n\n\u4F7F\u7528\u573A\u666F\uFF1A\n1. \u5148\u8C03 list_middleware_types \u786E\u5B9A\u67D0\u4E2A\u4E2D\u95F4\u4EF6\u662F\u8FDE\u63A5\u578B\uFF08\u6709 connectionSchema\uFF09\n2. \u8C03\u6B64\u5DE5\u5177\u4F20\u5165 type\uFF08\u5982 'erp'\uFF09\uFF0C\u83B7\u53D6\u8BE5\u7C7B\u578B\u4E0B\u5DF2\u914D\u597D\u7684\u8FDE\u63A5\u5217\u8868\n3. \u5728 create_agent \u7684 middleware[i].config.connections \u4E2D\u586B\u5165\u5BF9\u5E94\u7684 key \u503C\n\n\u8FD4\u56DE\u683C\u5F0F\uFF1A{ success: true, data: { records: [{ key, name, ... }] } }",
23439
+ schema: import_zod64.default.object({
23440
+ type: import_zod64.default.string().describe("\u63D2\u4EF6\u7C7B\u578B\u6807\u8BC6\uFF0C\u5982 'erp'\u3002\u4ECE list_middleware_types \u7684\u8FD4\u56DE\u4E2D\u83B7\u53D6")
23441
+ }),
23442
+ needUserApprove: false
23443
+ },
23444
+ async (input, config) => {
23445
+ const tenantId = getTenantId(config);
23446
+ try {
23447
+ const entries = await ConnectionRegistry.list(input.type, tenantId);
23448
+ return JSON.stringify({
23449
+ success: true,
23450
+ data: {
23451
+ records: entries.map((e) => ({
23452
+ key: e.key,
23453
+ name: e.name,
23454
+ description: e.description,
23455
+ updatedAt: e.updatedAt
23456
+ })),
23457
+ total: entries.length
23458
+ }
23459
+ });
23460
+ } catch (error) {
23461
+ return JSON.stringify({
23462
+ success: false,
23463
+ error: error.message,
23464
+ hint: "\u8BF7\u786E\u8BA4 ConnectionStore \u5DF2\u914D\u7F6E\u4E14\u63D2\u4EF6\u7C7B\u578B\u6B63\u786E\u3002\u8C03\u7528 list_middleware_types \u67E5\u770B\u53EF\u7528\u7C7B\u578B\u3002"
23465
+ });
23466
+ }
23467
+ }
23468
+ );
23022
23469
 
23023
23470
  // src/agent_lattice/agentArchitectConfig.ts
23024
23471
  var import_protocols14 = require("@axiom-lattice/protocols");
@@ -23338,101 +23785,29 @@ Returns: \`{ valid: boolean, stepCount, issues: [{ type: "error"|"warning", mess
23338
23785
 
23339
23786
  ### Middleware Config Reference
23340
23787
 
23788
+ **Always call \`list_middleware_types\` first** to see what middleware types are currently available, their config schemas, and whether they are connection-type middleware. The static list below may be outdated \u2014 the tool is the source of truth.
23789
+
23341
23790
  Each middleware entry uses this base shape:
23342
23791
 
23343
23792
  \`\`\`typescript
23344
23793
  {
23345
23794
  id: string, // Unique ID, usually same as type
23346
- type: string, // Middleware type from the table below
23795
+ type: string, // Middleware type from list_middleware_types
23347
23796
  name: string, // Display name
23348
23797
  description: string, // What this middleware provides
23349
23798
  enabled: true, // Always true for active middleware
23350
- config: { ... } // Type-specific config (see table)
23799
+ config: { ... } // Type-specific config (see list_middleware_types result)
23351
23800
  }
23352
23801
  \`\`\`
23353
23802
 
23354
- #### filesystem
23355
- Provides: \`ls\`, \`read_file\`, \`write_file\`, \`edit_file\`, \`glob\`, \`grep\`
23356
- | config field | type | description |
23357
- |-------------|------|-------------|
23358
- | backend | string | Pluggable backend, usually omitted (uses default) |
23359
- | systemPrompt | string? | Custom system prompt override for filesystem conventions |
23360
-
23361
- #### code_eval
23362
- Provides: \`run_code\` \u2014 execute Python/JavaScript in a sandbox
23363
- | config field | type | description |
23364
- |-------------|------|-------------|
23365
- | vmIsolation | "agent" | "project" | "global" | Sandbox isolation level. Default recommended: \`"agent"\` |
23366
- | timeout | number? | Execution timeout in milliseconds |
23367
- | memoryLimit | number? | Memory limit in MB |
23368
-
23369
- #### browser
23370
- Provides: \`browser_navigate\`, \`browser_click\`, \`browser_screenshot\`, \`browser_get_markdown\`, etc. (21 tools)
23371
- | config field | type | description |
23372
- |-------------|------|-------------|
23373
- | vmIsolation | "agent" | "project" | "global" | Sandbox isolation level. Default recommended: \`"agent"\` |
23374
- | headless | boolean? | Whether to run in headless mode |
23375
-
23376
- #### sql
23377
- Provides: \`sql_list_tables\`, \`sql_table_info\`, \`sql_query_checker\`, \`sql_query\`
23378
- | config field | type | description |
23379
- |-------------|------|-------------|
23380
- | databaseKeys | string[] | Array of database config keys to expose. Required. |
23381
- | databaseDescriptions | Record<string,string>? | Optional human-readable descriptions keyed by database key |
23382
-
23383
- #### skill
23384
- Provides: \`load_skill_content\` \u2014 load and read detailed skill instructions
23385
- | config field | type | description |
23386
- |-------------|------|-------------|
23387
- | skills | string[]? | List of specific skill IDs to expose |
23388
- | readAll | boolean? | When \`true\`, all available skills are exposed (recommended) |
23389
- | heading | string? | Optional heading for the skills section |
23390
- | extraNote | string? | Optional extra note appended after skills list |
23391
-
23392
- #### metrics
23393
- Provides: \`list_datasources\`, \`query_metrics_list\`, \`query_semantic_metric_data\`, \`query_tables_list\`, \`execute_sql_query\`, etc. (7 tools)
23394
- | config field | type | description |
23395
- |-------------|------|-------------|
23396
- | serverKeys | string[] | List of metrics server keys. Required. |
23397
- | serverDescriptions | Record<string,string>? | Optional descriptions for each server |
23398
- | connectAll | boolean? | When \`true\`, connects to all available metrics servers automatically |
23399
-
23400
- #### ask_user_to_clarify
23401
- Provides: \`ask_user_to_clarify\` \u2014 pause execution and present questions with predefined options to the user. The agent halts until the user responds, then receives the answers as structured data.
23402
- **Use this when:** the agent needs to confirm an action, get user approval, ask "which one?", or gather missing parameters. Without this middleware, the agent CANNOT interact with the user mid-execution.
23403
- Config: \`{}\` \u2014 no configuration needed.
23404
-
23405
- #### widget
23406
- Provides: \`load_guidelines\`, \`show_widget\` \u2014 render interactive HTML widgets and SVG diagrams
23407
- Config: \`{}\` \u2014 no configuration needed.
23408
-
23409
- #### claw
23410
- Provides: bootstrap file management (AGENTS.md, SOUL.md, etc.) \u2014 injects project context into system prompt
23411
- | config field | type | description |
23412
- |-------------|------|-------------|
23413
- | injectBootstrapFiles | boolean? | Whether to inject bootstrap files into system prompt. Default: \`true\` |
23414
- | bootstrapFiles | object? | Custom content for each bootstrap file |
23415
-
23416
- \`bootstrapFiles\` sub-fields: \`agents\`, \`soul\`, \`identity\`, \`user\`, \`tools\`, \`bootstrap\` \u2014 each is an optional string.
23417
-
23418
- #### date
23419
- Provides: \`get_current_date_time\` \u2014 get current date and time
23420
- | config field | type | description |
23421
- |-------------|------|-------------|
23422
- | timezone | string? | IANA timezone like \`"Asia/Shanghai"\` or \`"America/New_York"\`. Default: \`"UTC"\` |
23423
-
23424
- #### scheduler
23425
- Provides: \`schedule_at\`, \`schedule_after\`, \`schedule_recurring\`, \`cancel_scheduled_task\`, \`list_scheduled_tasks\`
23426
- | config field | type | description |
23427
- |-------------|------|-------------|
23428
- | defaultMaxRetries | number? | Default max retries for scheduled tasks. Default: \`0\` |
23429
-
23430
- #### topology [DEPRECATED \u2014 use WORKFLOW DSL instead]
23431
- Provides: \`read_topo_progress\` \u2014 enforces multi-agent workflow topology for PROCESSING agents only. Not needed for WORKFLOW agents.
23432
- | config field | type | description |
23433
- |-------------|------|-------------|
23434
- | edges | TopologyEdge[] | **Required.** Directed edges: \`{ from: string, to: string, purpose: string }\`. The \`purpose\` must describe the business intent of this delegation step. |
23435
- | trackingStore | object? | Optional persistence for workflow run tracking | |
23803
+ **Connection-type middleware** (those with \`connectionSchema\` in list_middleware_types output):
23804
+ 1. Call \`list_connections(type="xxx")\` to see available connection keys
23805
+ 2. Use the returned keys in \`config.connections: ["sap-prod", "sap-dev"]\`
23806
+
23807
+ **Tool filtering:** Use \`allowedTools\` to restrict which tools a middleware exposes:
23808
+ \`\`\`typescript
23809
+ { type: "browser", enabled: true, config: {}, allowedTools: ["browser_navigate", "browser_screenshot"] }
23810
+ \`\`\`
23436
23811
 
23437
23812
  ### When to use ask_user_to_clarify Middleware
23438
23813
 
@@ -23455,19 +23830,6 @@ Provides: \`read_topo_progress\` \u2014 enforces multi-agent workflow topology f
23455
23830
 
23456
23831
  **Design rule:** If your agent's system prompt says anything like "confirm with the user before...", "ask the user to choose...", or "get approval for...", you MUST include the \`ask_user_to_clarify\` middleware.
23457
23832
 
23458
- ### Quick Pick: Common Middleware Combos
23459
-
23460
- | Agent Role | Recommended Middleware |
23461
- |-----------|----------------------|
23462
- | Code assistant | code_eval, widget |
23463
- | Data analyst | sql, code_eval, widget |
23464
- | Web researcher | browser, widget |
23465
- | Operations / SRE | metrics, sql, widget |
23466
- | Process orchestrator | skill, date, scheduler, widget |
23467
- | General assistant | date, widget |
23468
- | Approval-gated operations | ask_user_to_clarify, widget |
23469
- | Interactive Q&A | ask_user_to_clarify, date, widget |
23470
-
23471
23833
  ### manage_binding Reference
23472
23834
 
23473
23835
  Use \`manage_binding\` to bind external senders (email, Lark, Slack) to agents. A binding routes inbound messages from the sender to the specified agent.
@@ -23598,6 +23960,8 @@ var agentArchitectConfig = {
23598
23960
  tools: [
23599
23961
  "list_agents",
23600
23962
  "list_tools",
23963
+ "list_middleware_types",
23964
+ "list_connections",
23601
23965
  "get_agent",
23602
23966
  "create_agent",
23603
23967
  "create_workflow",
@@ -26768,7 +27132,9 @@ function generateToken() {
26768
27132
  function createSharePayload(tenantId, workspaceId, projectId, userId, request) {
26769
27133
  const resourcePath = (request.resourcePath || "").replace(/^\/?project\/?/, "").replace(/\/+$/, "");
26770
27134
  if (!resourcePath || resourcePath === "/") {
26771
- throw new Error("Cannot share project root \u2014 share a subdirectory or file instead");
27135
+ if (request.visibility !== "internal") {
27136
+ throw new Error("Cannot share project root \u2014 share a subdirectory or file instead");
27137
+ }
26772
27138
  }
26773
27139
  return {
26774
27140
  address: createResourceAddress({
@@ -26895,6 +27261,28 @@ function clearEncryptionKeyCache() {
26895
27261
  keyValidated = false;
26896
27262
  }
26897
27263
 
27264
+ // src/plugin/BuiltinPlugins.ts
27265
+ var BUILTIN_PLUGINS = [
27266
+ filesystemPlugin,
27267
+ codeEvalPlugin,
27268
+ browserPlugin,
27269
+ sqlPlugin,
27270
+ skillPlugin,
27271
+ metricsPlugin,
27272
+ askUserClarifyPlugin,
27273
+ widgetPlugin,
27274
+ clawPlugin,
27275
+ datePlugin,
27276
+ schedulerPlugin,
27277
+ taskPlugin,
27278
+ collectionPlugin
27279
+ ];
27280
+ function registerBuiltinPlugins() {
27281
+ for (const plugin of BUILTIN_PLUGINS) {
27282
+ PluginRegistry.register(plugin);
27283
+ }
27284
+ }
27285
+
26898
27286
  // src/workflow/index.ts
26899
27287
  init_compile();
26900
27288
  init_parse_yaml();
@@ -27051,6 +27439,9 @@ var PersonalAssistantConfig = class {
27051
27439
  }
27052
27440
  };
27053
27441
  PersonalAssistantConfig._config = deepClone(DEFAULT_CONFIG);
27442
+
27443
+ // src/index.ts
27444
+ registerBuiltinPlugins();
27054
27445
  // Annotate the CommonJS export names for ESM import in node:
27055
27446
  0 && (module.exports = {
27056
27447
  AGENT_TASK_EVENT,
@@ -27059,11 +27450,13 @@ PersonalAssistantConfig._config = deepClone(DEFAULT_CONFIG);
27059
27450
  AgentLatticeManager,
27060
27451
  AgentManager,
27061
27452
  AgentType,
27453
+ BUILTIN_PLUGINS,
27062
27454
  BUILTIN_SKILLS,
27063
27455
  ChunkBuffer,
27064
27456
  ChunkBufferLatticeManager,
27065
27457
  CollectionLatticeManager,
27066
27458
  CompositeBackend,
27459
+ ConnectionRegistry,
27067
27460
  ConsoleLoggerClient,
27068
27461
  CustomMetricsClient,
27069
27462
  CustomMiddlewareRegistry,
@@ -27113,6 +27506,7 @@ PersonalAssistantConfig._config = deepClone(DEFAULT_CONFIG);
27113
27506
  MysqlDatabase,
27114
27507
  PersonalAssistantConfig,
27115
27508
  PinoLoggerClient,
27509
+ PluginRegistry,
27116
27510
  PostgresDatabase,
27117
27511
  PrometheusClient,
27118
27512
  Protocols,
@@ -27275,6 +27669,7 @@ PersonalAssistantConfig._config = deepClone(DEFAULT_CONFIG);
27275
27669
  sandboxLatticeManager,
27276
27670
  sanitizeToolCallId,
27277
27671
  scheduleLatticeManager,
27672
+ serializePluginMeta,
27278
27673
  setBindingRegistry,
27279
27674
  setMenuRegistry,
27280
27675
  skillLatticeManager,