@axiom-lattice/core 2.1.69 → 2.1.71

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.mjs CHANGED
@@ -2793,7 +2793,7 @@ var manageBindingSchema = z3.object({
2793
2793
  channelInstallationId: z3.string().optional().describe("Channel installation ID (auto-detected if omitted and only one exists for this channel)"),
2794
2794
  senderId: z3.string().optional().describe("Sender identifier (email address, Lark openId, Slack userId)"),
2795
2795
  agentId: z3.string().optional().describe("Target agent ID to route messages to"),
2796
- threadMode: z3.enum(["fixed", "per_conversation"]).optional().describe("Thread mode: fixed or per_conversation"),
2796
+ threadMode: z3.enum(["fixed", "per_conversation"]).optional().default("per_conversation").describe("Thread mode: per_conversation (recommended) or fixed"),
2797
2797
  senderDisplayName: z3.string().optional().describe("Human-readable name for the sender")
2798
2798
  });
2799
2799
  registerToolLattice(
@@ -2803,8 +2803,8 @@ registerToolLattice(
2803
2803
  description: `Manage sender-to-agent bindings for external channels (email, Lark, Slack).
2804
2804
 
2805
2805
  - list_installations: List available channel installations. Filter by channel type (optional). Use this first to discover available channelInstallationIds.
2806
- - create: Bind a sender to an agent. Required: channel, senderId, agentId. channelInstallationId is optional \u2014 auto-detected if only one installation exists for this channel.
2807
- - update: Update an existing binding. Required: channel, senderId. Optional: agentId, threadMode, senderDisplayName.
2806
+ - create: Bind a sender to an agent. Required: channel, senderId, agentId. Optional: threadMode (default: per_conversation). channelInstallationId is optional \u2014 auto-detected if only one installation exists for this channel.
2807
+ - update: Update an existing binding. Required: channel, senderId. Optional: agentId, threadMode (default: per_conversation), senderDisplayName.
2808
2808
  - delete: Remove a binding. Required: channel, senderId.
2809
2809
  - list: List all bindings. Optional: channel, agentId, channelInstallationId.
2810
2810
 
@@ -18804,7 +18804,7 @@ If the user's intent is unclear after creation, ask: "Edit this agent or create
18804
18804
 
18805
18805
  ## Your Tools
18806
18806
 
18807
- You have eight tools for agent management:
18807
+ You have nine tools for agent management:
18808
18808
  - **list_agents** \u2014 See all existing agents for this workspace
18809
18809
  - **list_tools** \u2014 See all available tools that can be assigned to agents
18810
18810
  - **get_agent** \u2014 View the full configuration of a specific agent
@@ -18813,6 +18813,7 @@ You have eight tools for agent management:
18813
18813
  - **update_processing_agent** \u2014 Modify a PROCESSING agent's topology edges, name, prompt, or sub-agents
18814
18814
  - **update_agent** \u2014 Modify an existing REACT or DEEP_AGENT agent's configuration
18815
18815
  - **delete_agent** \u2014 Remove an agent permanently
18816
+ - **manage_binding** \u2014 Bind a sender (email, Lark, Slack user) to an agent so external messages are routed to it
18816
18817
 
18817
18818
  You also have an **Agent Reviewer** sub-agent that handles testing and configuration review. When you or the user needs to test an agent or review a configuration for correctness, delegate to the Agent Reviewer \u2014 it has the \`invoke_agent\`, \`get_agent\`, \`list_agents\`, and \`list_tools\` tools and runs in a clean isolated context.
18818
18819
 
@@ -18893,10 +18894,13 @@ Use this when the task follows a standard BPO (Business Process Orchestration) p
18893
18894
 
18894
18895
  **Step 1: Process analysis.** Ask: What is the end-to-end process? Map the stages.
18895
18896
 
18897
+ **Business rule \u2014 Draft-then-confirm pattern:** When a workflow creates business objects that require human approval (e.g., draft orders in SAP B1, purchase requisitions, expense reports), the design MUST include a confirmation step AFTER the creation step. The create step must complete successfully before the confirm step runs. The flow is always: **Create draft \u2192 User confirms \u2192 Finalize**. Reason: systems like SAP B1 only expose drafts to users after they are created \u2014 the user cannot see or approve something that doesn't exist yet. The confirm step MUST use the \`ask_user_to_clarify\` middleware.
18898
+
18896
18899
  **Step 2: Topology design.** Design the agent topology and use \`show_widget\` to render an interactive diagram showing the flow: Orchestrator \u2192 Stage 1 \u2192 Stage 2 \u2192 ... \u2192 Output. Each edge should be labeled with its business purpose.
18897
18900
 
18898
- **Step 3: Design each sub-agent** (one at a time). For each:
18901
+ **Step 3: Design each sub-agent** as a **deep_agent** type (one at a time). For each:
18899
18902
  - Responsibility, system prompt, middleware, input/output contract
18903
+ - Deep agents have built-in file capabilities (ls, read, write, edit, glob, grep), so do NOT add filesystem middleware.
18900
18904
  - **Ask for confirmation before moving to the next sub-agent.**
18901
18905
 
18902
18906
  **Step 4: Design the orchestrator.** Responsibility, system prompt, topology edges, sub-agent list.
@@ -18927,7 +18931,7 @@ Use this when the task follows a standard BPO (Business Process Orchestration) p
18927
18931
  - Be detailed but concise \u2014 each section should be 1-5 lines
18928
18932
  - Avoid placeholder text like "TODO" or "TBD"
18929
18933
 
18930
- **Example structure:**
18934
+ **Example structure** (\u5B50 Agent \u5747\u4E3A deep_agent \u7C7B\u578B\uFF0C\u65E0\u9700 filesystem \u4E2D\u95F4\u4EF6):
18931
18935
 
18932
18936
  \`\`\`markdown
18933
18937
  ## Overview
@@ -18936,7 +18940,7 @@ Use this when the task follows a standard BPO (Business Process Orchestration) p
18936
18940
  ## Steps
18937
18941
  1. **\u6570\u636E\u91C7\u96C6 (data-collector)** \u2014 \u4F7F\u7528 browser \u5DE5\u5177\u722C\u53D6\u6307\u5B9AURL\u7684\u7ADE\u54C1\u4EF7\u683C\u6570\u636E\uFF0C\u8C03\u7528 metrics API \u62C9\u53D6\u5386\u53F2\u4EF7\u683C\u3002\u8F93\u51FA\u539F\u59CB\u4EF7\u683C\u6570\u636E\u96C6 JSON\u3002
18938
18942
  2. **\u6570\u636E\u6E05\u6D17 (data-cleaner)** \u2014 \u4F7F\u7528 code_eval \u6267\u884C Python \u811A\u672C\u6E05\u6D17\u5F02\u5E38\u503C\u548C\u7F3A\u5931\u503C\uFF0C\u7EDF\u4E00\u8D27\u5E01\u5355\u4F4D\u3002\u8F93\u51FA\u6807\u51C6\u5316\u6570\u636E\u96C6\u3002
18939
- 3. **\u62A5\u544A\u751F\u6210 (report-generator)** \u2014 \u4F7F\u7528 filesystem \u8BFB\u53D6\u6A21\u677F\uFF0Ccode_eval \u8BA1\u7B97\u6DA8\u8DCC\u5E45\u548C\u8D8B\u52BF\uFF0C\u751F\u6210 Markdown \u5BF9\u6BD4\u62A5\u544A\u3002\u8F93\u51FA\u62A5\u544A\u6587\u4EF6\u8DEF\u5F84\u3002
18943
+ 3. **\u62A5\u544A\u751F\u6210 (report-generator)** \u2014 \u8BFB\u53D6\u6A21\u677F\u6587\u4EF6\uFF0Ccode_eval \u8BA1\u7B97\u6DA8\u8DCC\u5E45\u548C\u8D8B\u52BF\uFF0C\u751F\u6210 Markdown \u5BF9\u6BD4\u62A5\u544A\u3002\u8F93\u51FA\u62A5\u544A\u6587\u4EF6\u8DEF\u5F84\u3002
18940
18944
  4. **\u901A\u77E5\u63A8\u9001 (notifier)** \u2014 \u8C03\u7528 scheduler \u5B89\u6392\u5B9A\u65F6\u53D1\u9001\uFF0C\u4F7F\u7528 ask_user_to_clarify \u8BF7\u6C42\u53D1\u9001\u786E\u8BA4\u3002\u8F93\u51FA\u53D1\u9001\u7ED3\u679C\u3002
18941
18945
 
18942
18946
  ## Data Flow
@@ -18952,8 +18956,8 @@ Use this when the task follows a standard BPO (Business Process Orchestration) p
18952
18956
  | \u5B50Agent | \u5DE5\u5177 |
18953
18957
  |---------|------|
18954
18958
  | data-collector | browser, metrics |
18955
- | data-cleaner | code_eval, filesystem |
18956
- | report-generator | code_eval, filesystem |
18959
+ | data-cleaner | code_eval |
18960
+ | report-generator | code_eval |
18957
18961
  | notifier | scheduler, ask_user_to_clarify |
18958
18962
 
18959
18963
  ## Expected Input
@@ -18977,9 +18981,9 @@ Use this when the task follows a standard BPO (Business Process Orchestration) p
18977
18981
  Create sub-agents FIRST, then the orchestrator:
18978
18982
 
18979
18983
  \`\`\`
18980
- 1. create_agent(name: "stage-1", type: "react", ...)
18981
- 2. create_agent(name: "stage-2", type: "react", ...)
18982
- 3. create_agent(name: "stage-3", type: "react", ...)
18984
+ 1. create_agent(name: "stage-1", type: "deep_agent", ...)
18985
+ 2. create_agent(name: "stage-2", type: "deep_agent", ...)
18986
+ 3. create_agent(name: "stage-3", type: "deep_agent", ...)
18983
18987
  4. create_processing_agent(
18984
18988
  name: "orchestrator",
18985
18989
  prompt: "...",
@@ -18998,6 +19002,18 @@ First edge's \`from\` uses orchestrator name as placeholder (auto-resolved). Sub
18998
19002
 
18999
19003
  You may ask: "Want me to test the orchestrator end-to-end?" If yes, delegate to the **Agent Reviewer** sub-agent.
19000
19004
 
19005
+ ### Phase 5: Bind channel (ask)
19006
+
19007
+ After the workflow is created, ask the user if they want to bind an email address (or Lark/Slack sender) to drive the workflow. This allows external users to trigger the workflow by sending messages to the channel.
19008
+
19009
+ **Step 1: Check installations.** Call \`manage_binding\` with \`action: "list_installations"\` to see available channel installations.
19010
+
19011
+ **Step 2: Ask user.** Present the available channels and ask: "Would you like to bind an email address to drive this workflow? If so, what email address should trigger it?"
19012
+
19013
+ **Step 3: Bind.** Call \`manage_binding\` with \`action: "create"\`, providing \`channel\`, \`senderId\` (the email), and \`agentId\` (the orchestrator's ID).
19014
+
19015
+ **IMPORTANT:** Only create a binding after the user explicitly provides the email address. Do NOT guess or fabricate sender information.
19016
+
19001
19017
  ---
19002
19018
 
19003
19019
  ## Workflow C: Dynamic Agent (DEEP_AGENT type)
@@ -19016,7 +19032,7 @@ Use this for complex, open-ended tasks where the execution path cannot be fully
19016
19032
  - Work through todos one at a time
19017
19033
  - Refine the list as understanding deepens
19018
19034
  - Self-correct based on intermediate findings
19019
- 2. **Middleware** \u2014 filesystem, code_eval, browser, skill, widget, ask_user_to_clarify as needed
19035
+ 2. **Middleware** \u2014 code_eval, browser, skill, widget, ask_user_to_clarify as needed (deep_agent already has built-in file capabilities, so filesystem middleware is NOT needed)
19020
19036
  3. **Sub-agents** (optional) \u2014 Specialized delegates for specific capabilities
19021
19037
 
19022
19038
  **Step 4: Self-review.** Verify: autonomy, tool coverage, guardrails.
@@ -19084,29 +19100,7 @@ All fields except name, type, and prompt are optional.
19084
19100
 
19085
19101
  ### create_processing_agent (PROCESSING)
19086
19102
 
19087
- Creates a PROCESSING agent with a business-defined workflow topology. Sub-agents must already exist.
19088
-
19089
- \`\`\`typescript
19090
- {
19091
- name: string, // Required. Display name for the orchestrator
19092
- description?: string, // Required for good UX. Comprehensive workflow spec in Markdown (Chinese if user speaks Chinese). Must cover: Overview, Steps (with tools per step), Data Flow, Logic & Conditions, Tools Used, Expected Input, Expected Output. This is the single source of truth displayed in the automation view info popover.
19093
- prompt: string, // Required. System prompt \u2014 how to route through the topology
19094
- edges: [{ // Required. At least 1 edge defining the workflow
19095
- from: string, // Orchestrator's ID (use placeholder name; tool auto-replaces)
19096
- to: string, // Sub-agent ID to delegate to
19097
- purpose: string, // Business purpose \u2014 what this step accomplishes
19098
- }],
19099
- tools?: string[], // Optional. Tool keys from list_tools
19100
- subAgents: string[], // Required. IDs of sub-agents in the pipeline
19101
- internalSubAgents?: AgentConfig[], // Optional. Inline sub-agent configs
19102
- middleware?: MiddlewareConfig[], // Optional. Additional middleware (topology is auto-added)
19103
- modelKey?: string, // Optional. Model to use
19104
- }
19105
- \`\`\`
19106
-
19107
- ### create_processing_agent (PROCESSING)
19108
-
19109
- Creates a PROCESSING agent with a business-defined workflow topology. Sub-agents must already exist.
19103
+ Creates a PROCESSING agent with a business-defined workflow topology. Sub-agents must already exist (created as **deep_agent** type).
19110
19104
 
19111
19105
  \`\`\`typescript
19112
19106
  {
@@ -19118,6 +19112,7 @@ Creates a PROCESSING agent with a business-defined workflow topology. Sub-agents
19118
19112
  to: string, // Sub-agent ID to delegate to
19119
19113
  purpose: string, // Business purpose \u2014 what this step accomplishes
19120
19114
  }],
19115
+ tools?: string[], // Optional. Tool keys from list_tools
19121
19116
  subAgents: string[], // Required. IDs of sub-agents in the pipeline
19122
19117
  internalSubAgents?: AgentConfig[], // Optional. Inline sub-agent configs
19123
19118
  middleware?: MiddlewareConfig[], // Optional. Additional middleware (topology is auto-added)
@@ -19248,15 +19243,31 @@ Provides: \`read_topo_progress\` \u2014 enforces multi-agent workflow topology.
19248
19243
 
19249
19244
  | Agent Role | Recommended Middleware |
19250
19245
  |-----------|----------------------|
19251
- | Code assistant | filesystem, code_eval, widget |
19252
- | Data analyst | filesystem, sql, code_eval, widget |
19253
- | Web researcher | browser, filesystem, widget |
19246
+ | Code assistant | code_eval, widget |
19247
+ | Data analyst | sql, code_eval, widget |
19248
+ | Web researcher | browser, widget |
19254
19249
  | Operations / SRE | metrics, sql, widget |
19255
19250
  | Process orchestrator | skill, date, scheduler, widget |
19256
- | General assistant | filesystem, date, widget |
19257
- | Approval-gated operations | ask_user_to_clarify, filesystem, widget |
19251
+ | General assistant | date, widget |
19252
+ | Approval-gated operations | ask_user_to_clarify, widget |
19258
19253
  | Interactive Q&A | ask_user_to_clarify, date, widget |
19259
19254
 
19255
+ ### manage_binding Reference
19256
+
19257
+ Use \`manage_binding\` to bind external senders (email, Lark, Slack) to agents. A binding routes inbound messages from the sender to the specified agent.
19258
+
19259
+ | action | description | required params |
19260
+ |--------|-------------|----------------|
19261
+ | list_installations | List available channel installations | channel (optional) |
19262
+ | create | Bind a sender to an agent | channel, senderId, agentId |
19263
+ | update | Update an existing binding | channel, senderId |
19264
+ | delete | Remove a binding | channel, senderId |
19265
+ | list | List all bindings | channel, agentId (optional) |
19266
+
19267
+ - **senderId**: For email channel, this is the email address. For Lark, it's the openId. For Slack, it's the userId.
19268
+ - **threadMode**: Always use \`"per_conversation"\` (new thread per conversation). Do NOT use \`"fixed"\`.
19269
+ - **channelInstallationId**: Auto-detected if only one installation exists for the channel. Use \`list_installations\` first if unsure.
19270
+
19260
19271
  ### update_processing_agent
19261
19272
 
19262
19273
  Updates a PROCESSING agent's topology edges, name, prompt, or sub-agents. Unlike update_agent, this properly handles placeholder resolution for edge \`from\` values and manages the topology middleware correctly.