@kanvas/openclaw-plugin 0.1.9 → 0.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,21 +2,23 @@
2
2
 
3
3
  OpenClaw plugin that connects AI agents to [Kanvas](https://kanvas.dev) — your company's nervous system. Kanvas is the operational engine that connects all your data, tools, and workflows. For AI agents, it's what lets them actually run your business — not just talk about it.
4
4
 
5
- This plugin gives agents direct access to CRM, inventory, orders, and messaging so they can search leads, create contacts, check stock, track orders, store structured data, and send emails all through 41 tools with auto-login and built-in system prompt context.
5
+ This plugin gives agents direct access to CRM, inventory, orders, and messaging — 53 tools with auto-login, built-in system prompt context, and domain-specific skills.
6
6
 
7
7
  ## Quick Start
8
8
 
9
9
  ### 1. Install the plugin
10
10
 
11
11
  ```bash
12
- # From local directory (development)
13
- openclaw plugins install /path/to/kanvas-openclaw-plugin --link
12
+ openclaw plugins install @kanvas/openclaw-plugin
13
+ ```
14
+
15
+ ### 2. Update to latest version
14
16
 
15
- # From npm (once published)
16
- openclaw plugins install kanvas-openclaw-plugin
17
+ ```bash
18
+ openclaw plugins update kanvas
17
19
  ```
18
20
 
19
- ### 2. Configure credentials
21
+ ### 3. Configure credentials
20
22
 
21
23
  In your OpenClaw config file:
22
24
 
@@ -42,43 +44,71 @@ In your OpenClaw config file:
42
44
 
43
45
  The API URL is preconfigured. The plugin authenticates automatically on the first tool call using the Kanvas login mutation.
44
46
 
45
- ### 3. Set up the agent's system prompt
47
+ ## Skills
48
+
49
+ The plugin ships with domain-specific **skills** — operational playbooks that teach the agent best practices for each use case. Skills are auto-loaded when the kanvas plugin is configured.
50
+
51
+ ### Included Skills
52
+
53
+ | Skill | Description |
54
+ |-------|-------------|
55
+ | `kanvas-crm` | CRM operations — lead management, pipelines, email templates, follow-ups, file attachments, contact updates, participant relationships, email logging, and context isolation rules |
56
+
57
+ Skills live in `skills/<skill-name>/SKILL.md` and follow the [OpenClaw skills format](https://docs.openclaw.ai/tools/skills). They inject operational guidance into the agent's context automatically.
58
+
59
+ ## Agent Setup Guides
60
+
61
+ The `agent-setup/` directory contains step-by-step runbooks for deploying specific agent types. These are **human-facing documentation** — not auto-loaded by the agent.
62
+
63
+ | Guide | Description |
64
+ |-------|-------------|
65
+ | [Sales Agent](agent-setup/sales.md) | Full setup protocol for an autonomous sales/deal architect agent — persona config, CRM customization, pipeline stages, daily heartbeat, email integration, and anti-pollution rules |
46
66
 
47
- The plugin injects tool documentation into the agent's context automatically. But the agent's **base system prompt** (configured in OpenClaw) should tell it to use Kanvas. Here's a sample:
67
+ ### Agent types you can build with this plugin
68
+
69
+ **Sales / Deal Architect**
70
+ Autonomous lead generation, cold outreach, pipeline management, follow-up scheduling, and daily reporting. See [agent-setup/sales.md](agent-setup/sales.md) for the full setup protocol.
71
+
72
+ **Operations Agent**
73
+ Inventory monitoring, order tracking, stock alerts, and cross-domain reporting.
74
+
75
+ **Customer Success Agent**
76
+ Post-sale follow-ups, onboarding workflows, satisfaction tracking via CRM notes and events.
77
+
78
+ **Data Entry / Admin Agent**
79
+ Bulk lead import, contact enrichment, file attachments, and CRM hygiene.
80
+
81
+ Each agent type uses the same plugin and tools — the difference is the system prompt, skills, and heartbeat configuration.
82
+
83
+ ### Setting up the agent's system prompt
84
+
85
+ The plugin injects tool documentation automatically. But the agent's **base system prompt** (configured in OpenClaw) should define its role. Example for a sales agent:
48
86
 
49
87
  ```
50
88
  You are a sales and operations agent for [Company Name]. You manage leads,
51
- inventory, and orders using Kanvas.
89
+ inventory, and orders using the CRM.
52
90
 
53
91
  Your responsibilities:
54
92
  - Register and manage leads in the CRM pipeline
55
- - Look up products, stock levels, and pricing
56
- - Check and track orders
57
- - Add notes and messages to leads
58
- - Send emails to customers and prospects
93
+ - Send outreach emails and follow up with prospects
94
+ - Log all activity as CRM notes and messages
95
+ - Schedule follow-ups as calendar events (never in local memory)
96
+ - Send daily pipeline summaries to the team
59
97
 
60
98
  When users ask you to do any of these things, use the kanvas_* tools to act
61
99
  on it directly. Don't just describe what you would do — actually do it.
62
-
63
- Before creating a lead, always check kanvas_list_pipelines to get valid
64
- pipeline stage IDs, and kanvas_list_lead_sources for source IDs.
65
-
66
- When you don't have enough information to complete an action (e.g. missing
67
- a required field), ask the user for the missing details before proceeding.
68
100
  ```
69
101
 
70
- Customize this for your business — add your company name, specific workflows, and any domain-specific instructions.
71
-
72
102
  ## Tools Reference
73
103
 
74
- ### CRM (22 tools)
104
+ ### CRM (29 tools)
75
105
 
76
106
  | Tool | Description |
77
107
  |------|-------------|
78
108
  | `kanvas_search_leads` | Search leads by keyword |
79
109
  | `kanvas_get_lead` | Full lead detail (pipeline, owner, participants, files, events) |
80
110
  | `kanvas_create_lead` | Create a new lead |
81
- | `kanvas_update_lead` | Update lead fields |
111
+ | `kanvas_update_lead` | Update lead fields (auto-fetches branch_id/people_id) |
82
112
  | `kanvas_change_lead_owner` | Reassign lead owner |
83
113
  | `kanvas_change_lead_receiver` | Reassign lead receiver |
84
114
  | `kanvas_add_lead_participant` | Add a person to a lead |
@@ -93,6 +123,18 @@ Customize this for your business — add your company name, specific workflows,
93
123
  | `kanvas_add_lead_note_by_lead_id` | Add note by lead ID (auto-resolves channel) |
94
124
  | `kanvas_list_lead_messages` | List messages in a lead channel |
95
125
  | `kanvas_get_lead_primary_channel_slug` | Get the main channel slug for a lead |
126
+ | `kanvas_attach_file_to_lead_by_url` | Attach file from a public URL |
127
+ | `kanvas_upload_file_to_lead` | Upload file (base64, file path, or URL) |
128
+ | `kanvas_upload_file_to_message` | Upload file to a message |
129
+ | `kanvas_search_people` | Search contacts by name, email, or phone |
130
+ | `kanvas_update_people` | Update contact info (phone, email, address, tags) |
131
+ | `kanvas_list_contact_types` | List contact types (email, phone, etc.) |
132
+ | `kanvas_list_people_relationships` | List relationship types |
133
+ | `kanvas_create_people_relationship` | Create a relationship type |
134
+ | `kanvas_update_people_relationship` | Update a relationship type |
135
+ | `kanvas_delete_people_relationship` | Delete a relationship type |
136
+ | `kanvas_create_follow_up` | Schedule a follow-up event linked to a lead |
137
+ | `kanvas_list_events` | List scheduled events/follow-ups |
96
138
  | `kanvas_list_pipelines` | List pipelines and stages |
97
139
  | `kanvas_list_lead_statuses` | List lead statuses |
98
140
  | `kanvas_list_lead_sources` | List lead sources |
@@ -190,4 +232,4 @@ KANVAS_PASSWORD=yourpassword \
190
232
 
191
233
  ## License
192
234
 
193
- Private — see package.json.
235
+ MIT
@@ -0,0 +1,200 @@
1
+ # Deal Architect / Sales Agent Setup Protocol
2
+
3
+ This document outlines the standard operating procedure (SOP) for configuring a new autonomous sales agent (Deal Architect) within the Kanvas ecosystem using Kanvas Plugin v0.1.8+.
4
+
5
+ ---
6
+
7
+ ## Phase 1: Core Persona & Rules Configuration
8
+
9
+ ### 1. Hidden Reasoning
10
+ Instruct the agent to never expose its internal thinking process to the end-user or clients.
11
+
12
+ ### 2. White-labeling
13
+ Instruct the agent to refer to the "Kanvas" system generically as:
14
+ - "your database"
15
+ - "the CRM"
16
+
17
+ When communicating with clients or external parties.
18
+
19
+ ---
20
+
21
+ ## Phase 2: Plugin & Technical Integration
22
+
23
+ ### 1. Kanvas Credentials
24
+ Verify the configuration includes:
25
+ - `xKanvasApp`
26
+ - `xKanvasLocation`
27
+ - Agent `email`
28
+ - Agent `password`
29
+ - `xKanvasKey` (App Key)
30
+
31
+ ### 2. Email Template Setup
32
+
33
+ - Identify or create a branded HTML email template (e.g., `incube-template`)
34
+
35
+ #### Blade Syntax Fix
36
+
37
+ Ensure the backend Laravel Blade template renders the message body using unescaped syntax:
38
+
39
+ ```php
40
+ {!! $message !!}
41
+ ```
42
+
43
+ This allows the agent to send:
44
+ - Bold text
45
+ - Links
46
+ - Line breaks
47
+ - Full HTML formatting
48
+
49
+ ---
50
+
51
+ ## Phase 3: Team Onboarding & Data Gathering
52
+
53
+ ### 1. Draft Welcome Email
54
+
55
+ The agent drafts an onboarding email to the core team requesting:
56
+
57
+ - **Working Email Credentials**
58
+ Ensure backend email syncing is active
59
+
60
+ - **Ideal Customer Profile (ICP)**
61
+ Target audience descriptions
62
+
63
+ - **Priority Reference Projects**
64
+ 3–5 strongest past projects for tailored pitches
65
+
66
+ ### 2. Communication Channel
67
+
68
+ Provide the team with a direct link to the agent’s:
69
+ - Telegram bot
70
+ - Slack bot
71
+
72
+ ---
73
+
74
+ ## Phase 4: CRM Customization (Native Tools)
75
+
76
+ ### 1. Pipeline Stages
77
+
78
+ Use Kanvas dashboard (or API) to map the pipeline:
79
+
80
+ Prospecting → Needs Analysis → Proposal / Pitch Sent → In Negotiation → Contract Sent → Closed Won
81
+
82
+ ### 2. Categorization
83
+
84
+ Use:
85
+
86
+ - `kanvas_create_lead_type`
87
+ - `kanvas_create_lead_source`
88
+
89
+ To match:
90
+ - ICP
91
+ - Acquisition strategy
92
+
93
+ ### 3. Relationships
94
+
95
+ Use:
96
+
97
+ `kanvas_create_people_relationship`
98
+
99
+ To ensure standard relationships exist before adding participants:
100
+
101
+ - Client
102
+ - Architect
103
+ - Decision Maker
104
+
105
+ ---
106
+
107
+ ## Phase 5: Automated Reporting (Mandatory)
108
+
109
+ Every autonomous sales agent must send an automated morning summary.
110
+
111
+ ### 1. Daily Heartbeat
112
+
113
+ Configure:
114
+
115
+ `HEARTBEAT.md`
116
+
117
+ To trigger a daily task (e.g., 07:00–08:00 UTC).
118
+
119
+ ### 2. Cron Logic
120
+
121
+ - Check `MEMORY.md` to avoid duplicate emails
122
+ - Query CRM for:
123
+
124
+ `message_verb: "agent_email_log"`
125
+
126
+ - Review past emails to prevent repetition
127
+ - Draft summary of:
128
+ - Leads
129
+ - Emails
130
+ - Pipeline updates
131
+ - Scheduled follow-ups
132
+ - Send via:
133
+
134
+ `kanvas_send_anonymous_email`
135
+
136
+ - Use branded template
137
+ - Send to team distribution list
138
+ - Log email as CRM message:
139
+
140
+ `message_verb: "agent_email_log"`
141
+
142
+ - Update:
143
+
144
+ `MEMORY.md`
145
+
146
+ With the current date
147
+
148
+ ---
149
+
150
+ ## Phase 6: Anti-Pollution & Context Isolation
151
+
152
+ Sales agents must strictly avoid cross-polluting client data.
153
+
154
+ ### 1. Isolated Contexts
155
+ Treat every interaction as a discrete transaction.
156
+
157
+ ### 2. CRM is the Source of Truth
158
+
159
+ Always query Kanvas before replying:
160
+
161
+ - `kanvas_get_lead`
162
+ - `kanvas_list_lead_messages`
163
+
164
+ ### 3. Stateless Prompting (Sub-Agents)
165
+
166
+ For complex pitches:
167
+
168
+ - Spawn isolated sub-agent sessions
169
+ - Use only that specific lead’s data
170
+
171
+ ---
172
+
173
+ ## Phase 7: Two-Way Email Integration (CRM-Managed)
174
+
175
+ Agents must NEVER handle raw IMAP/SMTP credentials.
176
+
177
+ ### 1. Outbound
178
+
179
+ Handled via CRM routing.
180
+
181
+ ### 2. Inbound (CRM Webhooks)
182
+
183
+ - CRM monitors inbox
184
+ - When a prospect replies:
185
+ - Message is logged in Lead’s message channel
186
+ - Agent is notified to respond
187
+
188
+ ---
189
+
190
+ ## Final Notes
191
+
192
+ - Keep all communication consistent with CRM data
193
+ - Avoid duplicate outreach
194
+ - Maintain strict context isolation between leads
195
+ - Always prioritize clarity, relevance, and forward movement in conversations
196
+
197
+ ---
198
+
199
+ **Owner:** Kanvas Sales Agent System
200
+ **Version:** v0.1.8+
@@ -50,6 +50,7 @@
50
50
  }
51
51
  }
52
52
  },
53
+ "skills": ["skills"],
53
54
  "uiHints": {
54
55
  "apiUrl": { "label": "API URL", "placeholder": "https://graphapi.kanvas.dev/graphql" },
55
56
  "xKanvasApp": { "label": "App ID", "placeholder": "your-app-key" },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kanvas/openclaw-plugin",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "description": "Connects agents to Kanvas — your company's nervous system for CRM, inventory, orders, and messaging.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -23,6 +23,8 @@
23
23
  },
24
24
  "files": [
25
25
  "dist/",
26
+ "skills/",
27
+ "agent-setup/",
26
28
  "openclaw.plugin.json",
27
29
  "README.md"
28
30
  ],
@@ -0,0 +1,80 @@
1
+ ---
2
+ name: kanvas-crm
3
+ description: Use when interacting with the Kanvas CRM to manage leads, pipelines, send template emails, create follow-ups, upload files, and log sales activity.
4
+ metadata: {"openclaw":{"requires":{"config":["plugins.entries.kanvas"]}}}
5
+ ---
6
+
7
+ # Kanvas CRM Skill
8
+
9
+ This skill provides operational guidance and technical best practices for using the Kanvas CRM plugin effectively.
10
+
11
+ ## Core Features & Usage Patterns
12
+
13
+ ### 1. HTML Email Templates (Laravel Blade)
14
+ When sending emails via `kanvas_send_anonymous_email` using Kanvas notification templates, the backend uses Laravel Blade.
15
+ - **The Issue:** Blade escapes HTML tags by default (`{{ $message }}`), causing `<br>` and `<strong>` to render as raw text.
16
+ - **The Fix:** Ensure the backend template uses unescaped syntax (`{!! $message !!}`). Pass raw HTML in your message payloads to render properly formatted emails.
17
+
18
+ ### 2. Updating Lead Pipelines
19
+ Use the native `kanvas_update_lead` tool.
20
+ - Pass `id` and `input: { pipeline_stage_id: XYZ }`.
21
+ - The plugin auto-fetches required fields (`branch_id`, `people_id`) behind the scenes as of v0.1.8+. No custom GraphQL scripts are necessary.
22
+
23
+ ### 3. Updating Contacts (People)
24
+ Use the native `kanvas_update_people` tool.
25
+ - You can seamlessly append phone numbers, emails, and custom fields to a Contact profile.
26
+ - Pass the contacts array with the correct `contacts_types_id` (e.g., 1 for Email, 2 for Phone). Call `kanvas_list_contact_types` first if you are unsure of the IDs.
27
+
28
+ ### 4. File Attachments
29
+ Use the native tools:
30
+ - `kanvas_attach_file_to_lead_by_url`: Supply a public URL to download a PDF or image straight to the Lead profile.
31
+ - `kanvas_upload_file_to_lead` / `kanvas_upload_file_to_message`: If passing base64 or a local file path.
32
+
33
+ ### 5. Follow-ups and Task Management
34
+ Use the native `kanvas_create_follow_up` tool.
35
+ - **Why:** Do not use local text files (`MEMORY.md`) to manage the sales pipeline reminders. If you schedule a follow-up, the human team needs to be able to see it natively inside the Kanvas dashboard.
36
+ - **Usage:** Create a calendar event, pass the `lead_id`, `date`, `start_time`, and `end_time`. Use `kanvas_list_events` during your morning sweep to execute them.
37
+
38
+ ### 6. Participant API & Relationship Creation
39
+ When using `kanvas_add_lead_participant`, the CRM requires a `relationship_id`.
40
+ - **Pre-requisite:** Before attaching a person to a lead, ensure a relationship type exists (like "Architect", "Client", or "Consultant").
41
+ - **Tool:** Use `kanvas_create_people_relationship` to dynamically create the relationship if it's missing, get its ID, and then call `kanvas_add_lead_participant`.
42
+
43
+ ### 7. Anti-Pollution & Context Isolation
44
+ When handling multiple outbound conversations, strictly avoid mixing up client details.
45
+ - **The CRM is the Single Source of Truth:** Before drafting a reply or follow-up, the agent must query Kanvas for the specific Lead ID (`kanvas_get_lead`), read the Lead Profile, and fetch the Message Channel history (`kanvas_list_lead_messages`). Build the response *strictly* based on this retrieved data.
46
+ - **Stateless Prompting (Sub-Agents):** For complex negotiations or drafting highly technical pitches, spawn an isolated sub-agent session. Feed the sub-agent *only* the data for that specific lead and the required reference projects, retrieve the drafted text, and terminate the sub-agent to ensure zero cross-contamination.
47
+
48
+ ### 8. Email Logging & Deduplication
49
+ To avoid sending the same update or repeating the same information to clients and the team:
50
+ - **Logging:** EVERY outbound email sent (e.g., via `kanvas_send_anonymous_email` or custom scripts) MUST be immediately logged into Kanvas using a direct GraphQL `CreateMessage` mutation with the `message_verb: "agent_email_log"`.
51
+ - **Payload Structure:** The `message` JSON payload must include the exact `subject`, `date`, `recipients` (array of emails), and `body` (the full HTML/text sent).
52
+ - **Reviewing:** Before drafting a daily report or a follow-up pitch, query the CRM for messages with the `message_verb: "agent_email_log"` to review past logs and ensure you do not repeat topics that were covered in previous emails.
53
+
54
+ ### 9. Lead Generation & Injection (The Sourcing Loop)
55
+ When sourcing targets automatically (via Apollo API or Web Search):
56
+ - **Quota:** Source exactly 5 distinct companies/projects per run (10 per day: morning and after-lunch sweeps).
57
+ - **Deduplication:** Always query Kanvas (`kanvas_search_leads`) by the prospect's email or company name *before* creating a new lead to prevent duplicate entries and spamming.
58
+ - **Injection:** Create the Lead using `kanvas_create_lead` in the "Prospecting" stage with the correct ICP Lead Type and Source.
59
+ - **Documentation:** Draft the initial cold email pitch and attach it as a note to the Lead profile so the leadership team can review it natively before sending.
60
+ - **Reporting:** When sending the daily Approval Report email, you MUST include the strategic rationale (the "Why") directly in the email body, and link the company name directly to its CRM dashboard page using this exact URL format:
61
+ `https://kanvas.domain/projects/{app-uuid}/leads/{leaduuid}`
62
+
63
+ ### 10. Structured Pitch Notes (JSON)
64
+ When attaching a drafted cold email or pitch to a Lead profile for human review, DO NOT pass it as a raw string.
65
+ - **Requirement:** The UI parses pitches better when passed as a structured JSON object.
66
+ - **Format:** When calling `kanvas_add_lead_note_by_lead_id`, pass the `message` payload as a structured object containing ONLY `title` and `body` fields.
67
+ - **Title Formatting:** The title must be a clean, professional string in Norwegian (e.g., `Utkast til e-post: [Selskap]`). Never include debugging or array tags in the title.
68
+ - **Body Formatting Rule:** Do NOT use explicit `\n\n` strings or JSON arrays in the `body`. Use the HTML `<br><br>` format for a single, continuous `body` string so that Kanvas frontend renders the JSON payloads with clean line breaks instead of visible newline escape characters.
69
+
70
+ ### 11. Apollo Integration & Contact Enrichment
71
+ When using Apollo API to source leads, always extract the following fields and map them to Kanvas:
72
+ - **Email:** Use `kanvas_list_contact_types` to find the ID (usually 1) and map to `contacts: [{ value: email, contacts_types_id: 1 }]`.
73
+ - **LinkedIn Profile (Optional):** If the contact has a `linkedin_url`, extract it and map to `contacts: [{ value: linkedin_url, contacts_types_id: 5 }]`. Do not fail or block the lead creation if the LinkedIn profile is missing.
74
+ - **Phone Numbers:** Apollo requires a webhook to reveal direct phone numbers. Until this is built into Kanvas, phone numbers cannot be automatically extracted via the synchronous API.
75
+
76
+ ### 12. White-Labeling & Value Communication
77
+ When communicating with the leadership team, founders, or human architects, NEVER mention the specific technical backend tools (e.g., Apollo, Kanvas, OpenClaw, GraphQL).
78
+ - **The Value Proposition:** Human teams only care about the *results*: qualified meetings booked, deals moved to the next stage, and a healthy sales pipeline. They do not care about the APIs used to get there.
79
+ - **Reporting Rule:** In daily summaries and rationale notes, use generic business terminology. Instead of "Sourced via Apollo API," say "Identified via market intelligence." Instead of "Injected into Kanvas," say "Added to the CRM pipeline."
80
+ - **Internal Tagging:** If you need to track the origin of a lead for analytics, use native CRM tags or the `LeadSource` field silently in the backend payload. Do not expose the data provider in the public-facing text notes or emails.q