@marktoflow/integrations 2.0.0-alpha.3 → 2.0.0-alpha.4
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 +460 -0
- package/package.json +4 -3
package/README.md
ADDED
|
@@ -0,0 +1,460 @@
|
|
|
1
|
+
# @marktoflow/integrations
|
|
2
|
+
|
|
3
|
+
Standard integrations for marktoflow - connect to Slack, GitHub, Jira, Gmail, and more.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
`@marktoflow/integrations` provides ready-to-use service integrations and AI agent adapters for the marktoflow automation framework.
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
### Service Integrations (11)
|
|
12
|
+
|
|
13
|
+
- **Slack** - Send messages, manage channels, socket mode
|
|
14
|
+
- **GitHub** - Create PRs, issues, comments, manage repos
|
|
15
|
+
- **Jira** - Create/update issues, transitions, search
|
|
16
|
+
- **Gmail** - Send emails, read inbox, manage labels, webhook triggers
|
|
17
|
+
- **Outlook** - Send emails, read calendar/inbox, webhook triggers
|
|
18
|
+
- **Linear** - Issue tracking and project management
|
|
19
|
+
- **Notion** - Database operations, page management
|
|
20
|
+
- **Discord** - Bot interactions, message management
|
|
21
|
+
- **Airtable** - Spreadsheet database operations
|
|
22
|
+
- **Confluence** - Wiki page management
|
|
23
|
+
- **HTTP** - Generic HTTP requests with auth
|
|
24
|
+
|
|
25
|
+
### AI Agent Adapters (3)
|
|
26
|
+
|
|
27
|
+
- **Ollama** - Local LLM integration
|
|
28
|
+
- **Claude Code** - Anthropic Claude integration
|
|
29
|
+
- **OpenCode** - OpenCode AI integration
|
|
30
|
+
|
|
31
|
+
## Installation
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npm install @marktoflow/integrations
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
This package depends on `@marktoflow/core` which will be installed automatically.
|
|
38
|
+
|
|
39
|
+
## Quick Start
|
|
40
|
+
|
|
41
|
+
### Using in Workflows
|
|
42
|
+
|
|
43
|
+
Integrations are designed to work seamlessly in workflow YAML definitions:
|
|
44
|
+
|
|
45
|
+
```yaml
|
|
46
|
+
workflow:
|
|
47
|
+
id: slack-notification
|
|
48
|
+
name: Send Slack Notification
|
|
49
|
+
|
|
50
|
+
tools:
|
|
51
|
+
slack:
|
|
52
|
+
sdk: '@slack/web-api'
|
|
53
|
+
auth:
|
|
54
|
+
token: '${SLACK_BOT_TOKEN}'
|
|
55
|
+
|
|
56
|
+
steps:
|
|
57
|
+
- action: slack.chat.postMessage
|
|
58
|
+
inputs:
|
|
59
|
+
channel: '#general'
|
|
60
|
+
text: 'Hello from marktoflow!'
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Programmatic Usage
|
|
64
|
+
|
|
65
|
+
You can also use integrations directly in TypeScript:
|
|
66
|
+
|
|
67
|
+
```typescript
|
|
68
|
+
import { SlackInitializer } from '@marktoflow/integrations';
|
|
69
|
+
import { SDKRegistry } from '@marktoflow/core';
|
|
70
|
+
|
|
71
|
+
// Register Slack integration
|
|
72
|
+
const registry = new SDKRegistry();
|
|
73
|
+
await registry.registerSDK(SlackInitializer);
|
|
74
|
+
|
|
75
|
+
// Load and use SDK
|
|
76
|
+
const slack = await registry.loadSDK('slack', {
|
|
77
|
+
auth: { token: process.env.SLACK_BOT_TOKEN },
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
// Execute action
|
|
81
|
+
const result = await registry.executeAction('slack', 'chat.postMessage', slack, {
|
|
82
|
+
channel: '#general',
|
|
83
|
+
text: 'Hello World!',
|
|
84
|
+
});
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Available Integrations
|
|
88
|
+
|
|
89
|
+
### Slack
|
|
90
|
+
|
|
91
|
+
Send messages, manage channels, handle events.
|
|
92
|
+
|
|
93
|
+
**Setup**:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
# Set environment variable
|
|
97
|
+
export SLACK_BOT_TOKEN=xoxb-your-token
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**Actions**:
|
|
101
|
+
|
|
102
|
+
- `chat.postMessage` - Send a message
|
|
103
|
+
- `conversations.list` - List channels
|
|
104
|
+
- `conversations.create` - Create channel
|
|
105
|
+
- `users.list` - List workspace users
|
|
106
|
+
|
|
107
|
+
**Example**:
|
|
108
|
+
|
|
109
|
+
```yaml
|
|
110
|
+
action: slack.chat.postMessage
|
|
111
|
+
inputs:
|
|
112
|
+
channel: '#general'
|
|
113
|
+
text: 'Deployment complete!'
|
|
114
|
+
blocks:
|
|
115
|
+
- type: section
|
|
116
|
+
text:
|
|
117
|
+
type: mrkdwn
|
|
118
|
+
text: '*Status:* ✅ Success'
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### GitHub
|
|
122
|
+
|
|
123
|
+
Manage repositories, PRs, issues, and more.
|
|
124
|
+
|
|
125
|
+
**Setup**:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
export GITHUB_TOKEN=ghp_your-token
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
**Actions**:
|
|
132
|
+
|
|
133
|
+
- `repos.get` - Get repository info
|
|
134
|
+
- `pulls.create` - Create pull request
|
|
135
|
+
- `issues.create` - Create issue
|
|
136
|
+
- `issues.createComment` - Comment on issue
|
|
137
|
+
|
|
138
|
+
**Example**:
|
|
139
|
+
|
|
140
|
+
```yaml
|
|
141
|
+
action: github.pulls.create
|
|
142
|
+
inputs:
|
|
143
|
+
owner: scottgl9
|
|
144
|
+
repo: marktoflow
|
|
145
|
+
title: 'Add new feature'
|
|
146
|
+
head: feature-branch
|
|
147
|
+
base: main
|
|
148
|
+
body: 'This PR adds...'
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Jira
|
|
152
|
+
|
|
153
|
+
Issue tracking and project management.
|
|
154
|
+
|
|
155
|
+
**Setup**:
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
export JIRA_HOST=your-domain.atlassian.net
|
|
159
|
+
export JIRA_EMAIL=your@email.com
|
|
160
|
+
export JIRA_API_TOKEN=your-token
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
**Actions**:
|
|
164
|
+
|
|
165
|
+
- `issues.createIssue` - Create issue
|
|
166
|
+
- `issues.updateIssue` - Update issue
|
|
167
|
+
- `issues.searchIssues` - Search issues
|
|
168
|
+
- `issues.getIssue` - Get issue details
|
|
169
|
+
|
|
170
|
+
**Example**:
|
|
171
|
+
|
|
172
|
+
```yaml
|
|
173
|
+
action: jira.issues.createIssue
|
|
174
|
+
inputs:
|
|
175
|
+
fields:
|
|
176
|
+
project:
|
|
177
|
+
key: PROJ
|
|
178
|
+
summary: 'Bug: Login fails'
|
|
179
|
+
description: 'Users cannot log in'
|
|
180
|
+
issuetype:
|
|
181
|
+
name: Bug
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### Gmail
|
|
185
|
+
|
|
186
|
+
Email operations with webhook support.
|
|
187
|
+
|
|
188
|
+
**Setup**:
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
export GMAIL_CLIENT_ID=your-client-id
|
|
192
|
+
export GMAIL_CLIENT_SECRET=your-secret
|
|
193
|
+
export GMAIL_REFRESH_TOKEN=your-refresh-token
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
**Actions**:
|
|
197
|
+
|
|
198
|
+
- `users.messages.send` - Send email
|
|
199
|
+
- `users.messages.list` - List messages
|
|
200
|
+
- `users.labels.list` - List labels
|
|
201
|
+
- `users.messages.get` - Get message details
|
|
202
|
+
|
|
203
|
+
**Example**:
|
|
204
|
+
|
|
205
|
+
```yaml
|
|
206
|
+
action: gmail.users.messages.send
|
|
207
|
+
inputs:
|
|
208
|
+
to: user@example.com
|
|
209
|
+
subject: 'Daily Report'
|
|
210
|
+
body: 'Here is your daily report...'
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
### Outlook
|
|
214
|
+
|
|
215
|
+
Microsoft 365 email and calendar.
|
|
216
|
+
|
|
217
|
+
**Setup**:
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
export OUTLOOK_CLIENT_ID=your-client-id
|
|
221
|
+
export OUTLOOK_CLIENT_SECRET=your-secret
|
|
222
|
+
export OUTLOOK_TENANT_ID=your-tenant-id
|
|
223
|
+
export OUTLOOK_REFRESH_TOKEN=your-refresh-token
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
**Actions**:
|
|
227
|
+
|
|
228
|
+
- `sendMail` - Send email
|
|
229
|
+
- `listMessages` - List inbox messages
|
|
230
|
+
- `listCalendarEvents` - List calendar events
|
|
231
|
+
- `createCalendarEvent` - Create calendar event
|
|
232
|
+
|
|
233
|
+
**Example**:
|
|
234
|
+
|
|
235
|
+
```yaml
|
|
236
|
+
action: outlook.sendMail
|
|
237
|
+
inputs:
|
|
238
|
+
to: [user@example.com]
|
|
239
|
+
subject: 'Meeting Reminder'
|
|
240
|
+
body: 'Don't forget our meeting at 2pm'
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
### Linear
|
|
244
|
+
|
|
245
|
+
Modern issue tracking.
|
|
246
|
+
|
|
247
|
+
**Setup**:
|
|
248
|
+
|
|
249
|
+
```bash
|
|
250
|
+
export LINEAR_API_KEY=your-api-key
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
**Actions**:
|
|
254
|
+
|
|
255
|
+
- `createIssue` - Create issue
|
|
256
|
+
- `updateIssue` - Update issue
|
|
257
|
+
- `listIssues` - List issues
|
|
258
|
+
|
|
259
|
+
### Notion
|
|
260
|
+
|
|
261
|
+
Database and page management.
|
|
262
|
+
|
|
263
|
+
**Setup**:
|
|
264
|
+
|
|
265
|
+
```bash
|
|
266
|
+
export NOTION_TOKEN=secret_your-token
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
**Actions**:
|
|
270
|
+
|
|
271
|
+
- `databases.query` - Query database
|
|
272
|
+
- `pages.create` - Create page
|
|
273
|
+
- `blocks.children.append` - Add content blocks
|
|
274
|
+
|
|
275
|
+
### Discord
|
|
276
|
+
|
|
277
|
+
Bot interactions and messaging.
|
|
278
|
+
|
|
279
|
+
**Setup**:
|
|
280
|
+
|
|
281
|
+
```bash
|
|
282
|
+
export DISCORD_BOT_TOKEN=your-bot-token
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
**Actions**:
|
|
286
|
+
|
|
287
|
+
- `sendMessage` - Send message to channel
|
|
288
|
+
- `editMessage` - Edit message
|
|
289
|
+
- `deleteMessage` - Delete message
|
|
290
|
+
|
|
291
|
+
### Airtable
|
|
292
|
+
|
|
293
|
+
Spreadsheet database operations.
|
|
294
|
+
|
|
295
|
+
**Setup**:
|
|
296
|
+
|
|
297
|
+
```bash
|
|
298
|
+
export AIRTABLE_API_KEY=your-api-key
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
**Actions**:
|
|
302
|
+
|
|
303
|
+
- `select` - Query records
|
|
304
|
+
- `create` - Create records
|
|
305
|
+
- `update` - Update records
|
|
306
|
+
- `delete` - Delete records
|
|
307
|
+
|
|
308
|
+
### Confluence
|
|
309
|
+
|
|
310
|
+
Wiki page management.
|
|
311
|
+
|
|
312
|
+
**Setup**:
|
|
313
|
+
|
|
314
|
+
```bash
|
|
315
|
+
export CONFLUENCE_HOST=your-domain.atlassian.net
|
|
316
|
+
export CONFLUENCE_EMAIL=your@email.com
|
|
317
|
+
export CONFLUENCE_API_TOKEN=your-token
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
**Actions**:
|
|
321
|
+
|
|
322
|
+
- `getPage` - Get page content
|
|
323
|
+
- `createPage` - Create page
|
|
324
|
+
- `updatePage` - Update page
|
|
325
|
+
- `deletePage` - Delete page
|
|
326
|
+
|
|
327
|
+
### HTTP
|
|
328
|
+
|
|
329
|
+
Generic HTTP requests with authentication.
|
|
330
|
+
|
|
331
|
+
**Actions**:
|
|
332
|
+
|
|
333
|
+
- `request` - Make HTTP request
|
|
334
|
+
|
|
335
|
+
**Example**:
|
|
336
|
+
|
|
337
|
+
```yaml
|
|
338
|
+
action: http.request
|
|
339
|
+
inputs:
|
|
340
|
+
method: POST
|
|
341
|
+
url: https://api.example.com/endpoint
|
|
342
|
+
headers:
|
|
343
|
+
Authorization: 'Bearer ${API_TOKEN}'
|
|
344
|
+
body:
|
|
345
|
+
key: value
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
## AI Agent Adapters
|
|
349
|
+
|
|
350
|
+
### Ollama
|
|
351
|
+
|
|
352
|
+
Run local LLMs via Ollama.
|
|
353
|
+
|
|
354
|
+
**Setup**:
|
|
355
|
+
|
|
356
|
+
```bash
|
|
357
|
+
export OLLAMA_BASE_URL=http://localhost:11434
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
**Example**:
|
|
361
|
+
|
|
362
|
+
```yaml
|
|
363
|
+
tools:
|
|
364
|
+
ollama:
|
|
365
|
+
adapter: ollama
|
|
366
|
+
|
|
367
|
+
steps:
|
|
368
|
+
- action: ollama.generate
|
|
369
|
+
inputs:
|
|
370
|
+
model: llama2
|
|
371
|
+
prompt: 'Explain quantum computing'
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
### Claude Code
|
|
375
|
+
|
|
376
|
+
Anthropic Claude integration.
|
|
377
|
+
|
|
378
|
+
**Setup**:
|
|
379
|
+
|
|
380
|
+
```bash
|
|
381
|
+
export ANTHROPIC_API_KEY=sk-ant-your-key
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
### OpenCode
|
|
385
|
+
|
|
386
|
+
OpenCode AI integration.
|
|
387
|
+
|
|
388
|
+
**Setup**:
|
|
389
|
+
|
|
390
|
+
```bash
|
|
391
|
+
export OPENCODE_API_KEY=your-key
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
## Advanced Usage
|
|
395
|
+
|
|
396
|
+
### Custom Integration
|
|
397
|
+
|
|
398
|
+
Create your own integration:
|
|
399
|
+
|
|
400
|
+
```typescript
|
|
401
|
+
import type { SDKInitializer } from '@marktoflow/core';
|
|
402
|
+
|
|
403
|
+
export const MyServiceInitializer: SDKInitializer = {
|
|
404
|
+
name: 'myservice',
|
|
405
|
+
async initialize(config) {
|
|
406
|
+
return new MyServiceClient(config.auth.apiKey);
|
|
407
|
+
},
|
|
408
|
+
actions: {
|
|
409
|
+
doSomething: async (sdk, inputs) => {
|
|
410
|
+
return sdk.doSomething(inputs);
|
|
411
|
+
},
|
|
412
|
+
},
|
|
413
|
+
};
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
### Error Handling
|
|
417
|
+
|
|
418
|
+
All integrations support automatic retry and error handling:
|
|
419
|
+
|
|
420
|
+
```yaml
|
|
421
|
+
steps:
|
|
422
|
+
- action: slack.chat.postMessage
|
|
423
|
+
inputs:
|
|
424
|
+
channel: '#general'
|
|
425
|
+
text: 'Message'
|
|
426
|
+
retry:
|
|
427
|
+
max_attempts: 3
|
|
428
|
+
backoff: exponential
|
|
429
|
+
initial_delay: 1000
|
|
430
|
+
on_error: continue # or 'fail', 'retry'
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
## OAuth Setup Guides
|
|
434
|
+
|
|
435
|
+
For Gmail and Outlook, use the CLI to set up OAuth:
|
|
436
|
+
|
|
437
|
+
```bash
|
|
438
|
+
# Gmail OAuth
|
|
439
|
+
npx @marktoflow/cli@alpha connect gmail
|
|
440
|
+
|
|
441
|
+
# Outlook OAuth
|
|
442
|
+
npx @marktoflow/cli@alpha connect outlook
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
## Testing
|
|
446
|
+
|
|
447
|
+
```bash
|
|
448
|
+
npm test
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
## Links
|
|
452
|
+
|
|
453
|
+
- [Main Repository](https://github.com/scottgl9/marktoflow)
|
|
454
|
+
- [Documentation](https://github.com/scottgl9/marktoflow#readme)
|
|
455
|
+
- [Core Package](@marktoflow/core)
|
|
456
|
+
- [CLI Package](@marktoflow/cli)
|
|
457
|
+
|
|
458
|
+
## License
|
|
459
|
+
|
|
460
|
+
Apache-2.0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marktoflow/integrations",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.4",
|
|
4
4
|
"description": "Standard integrations for marktoflow",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"clean": "rm -rf dist"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@marktoflow/core": "
|
|
30
|
+
"@marktoflow/core": "workspace:*",
|
|
31
31
|
"@microsoft/microsoft-graph-client": "^3.0.7",
|
|
32
32
|
"@octokit/rest": "^22.0.1",
|
|
33
33
|
"@opencode-ai/sdk": "^1.1.34",
|
|
@@ -41,7 +41,8 @@
|
|
|
41
41
|
"typescript": "^5.0.0"
|
|
42
42
|
},
|
|
43
43
|
"files": [
|
|
44
|
-
"dist"
|
|
44
|
+
"dist",
|
|
45
|
+
"README.md"
|
|
45
46
|
],
|
|
46
47
|
"keywords": [
|
|
47
48
|
"marktoflow",
|