@keystrokehq/skills 0.0.2 → 0.0.3
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/keystroke-agent-authoring/SKILL.md +4 -4
- package/keystroke-agent-authoring/references/messaging-gateways.md +7 -7
- package/keystroke-agent-authoring/references/patterns.md +5 -5
- package/keystroke-agent-authoring/references/prebuilt-integrations.md +78 -78
- package/keystroke-agent-authoring/references/sandbox-and-mcp.md +2 -2
- package/keystroke-agent-authoring/references/source-map.md +1 -1
- package/keystroke-agent-authoring/references/testing.md +4 -4
- package/keystroke-credential-binding/SKILL.md +43 -108
- package/keystroke-credential-binding/references/patterns.md +38 -66
- package/keystroke-credential-binding/references/source-map.md +9 -9
- package/keystroke-trigger-authoring/references/testing.md +2 -2
- package/keystroke-workflow-authoring/SKILL.md +1 -1
- package/keystroke-workflow-authoring/references/prebuilt-integrations.md +65 -65
- package/keystroke-workflow-authoring/references/runtime-helpers.md +3 -3
- package/keystroke-workflow-authoring/references/source-map.md +1 -1
- package/keystroke-workflow-authoring/references/testing.md +5 -4
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: keystroke-agent-authoring
|
|
3
|
-
description: Build Keystroke agents with @keystrokehq/core plus provider credentials from @
|
|
3
|
+
description: Build Keystroke agents with @keystrokehq/core plus provider credentials from @keystrokehq/ai. Use when the user wants to author, refactor, explain, or test Keystroke agent code, tool code, messaging gateways, sandboxed coding agents, MCP servers, or agent credential wiring.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Keystroke Agent Authoring
|
|
@@ -64,7 +64,7 @@ export const lookupCustomerTool = new Tool({
|
|
|
64
64
|
`support.agent.ts`
|
|
65
65
|
|
|
66
66
|
```ts
|
|
67
|
-
import { anthropic } from '@
|
|
67
|
+
import { anthropic } from '@keystrokehq/ai';
|
|
68
68
|
import { Agent } from '@keystrokehq/core';
|
|
69
69
|
import { lookupCustomerTool } from './lookup-customer.tool';
|
|
70
70
|
|
|
@@ -87,7 +87,7 @@ Teach this mental model clearly:
|
|
|
87
87
|
- an agent is an LLM-driven worker
|
|
88
88
|
- a `Tool` is the agent-facing alias for `Operation`
|
|
89
89
|
- authored agents use `new Agent({...})` from `@keystrokehq/core`
|
|
90
|
-
- AI provider credentials such as `anthropic` and `openai` come from `@
|
|
90
|
+
- AI provider credentials such as `anthropic` and `openai` come from `@keystrokehq/ai`
|
|
91
91
|
- agents operate through conversations and agent runs, not workflow trigger attachments
|
|
92
92
|
- workflows can call agents, but workflows still own orchestration
|
|
93
93
|
- agents can use workflows as tools; sync workflows return inline and suspending workflows yield/resume
|
|
@@ -168,7 +168,7 @@ Teach these rules explicitly:
|
|
|
168
168
|
- Keep each exported messaging gateway in its own `*.gateway.ts` file.
|
|
169
169
|
- Keep tool selection aligned with the agent’s job.
|
|
170
170
|
- Do not wrap an existing integration operation in a redundant custom tool.
|
|
171
|
-
- Use `CredentialSet` for custom secrets and use provider credential sets from `@
|
|
171
|
+
- Use `CredentialSet` for custom secrets and use provider credential sets from `@keystrokehq/ai` for model auth.
|
|
172
172
|
- Do not use `process.env` in authored agent or tool code.
|
|
173
173
|
- Expect the default agent sandbox to be persistent.
|
|
174
174
|
- Create a custom `Sandbox` only when the default sandbox needs customization.
|
|
@@ -85,14 +85,14 @@ Key differences from the platform gateway:
|
|
|
85
85
|
- `appRef` identifies which user-created app this gateway connects to
|
|
86
86
|
- the credential set typically requires more fields because the user supplies all auth values
|
|
87
87
|
|
|
88
|
-
## Prebuilt gateway helpers from `@
|
|
88
|
+
## Prebuilt gateway helpers from `@keystrokehq/slack`
|
|
89
89
|
|
|
90
90
|
Integration packages ship prebuilt gateway factories so users don't need to wire credential sets manually. Prefer these over hand-constructing a `MessagingGateway` with `@keystrokehq/core` when the provider has one available.
|
|
91
91
|
|
|
92
92
|
### Platform gateway (prebuilt)
|
|
93
93
|
|
|
94
94
|
```ts
|
|
95
|
-
import { slackPlatformGateway } from '@
|
|
95
|
+
import { slackPlatformGateway } from '@keystrokehq/slack/platform';
|
|
96
96
|
|
|
97
97
|
export const supportGateway = slackPlatformGateway();
|
|
98
98
|
```
|
|
@@ -110,7 +110,7 @@ export const supportGateway = slackPlatformGateway({
|
|
|
110
110
|
### Custom app gateway (prebuilt)
|
|
111
111
|
|
|
112
112
|
```ts
|
|
113
|
-
import { slackCustomGateway } from '@
|
|
113
|
+
import { slackCustomGateway } from '@keystrokehq/slack/custom';
|
|
114
114
|
|
|
115
115
|
export const salesGateway = slackCustomGateway({
|
|
116
116
|
appRef: 'sales-bot',
|
|
@@ -137,9 +137,9 @@ export const salesGateway = slackCustomGateway({
|
|
|
137
137
|
Using a prebuilt gateway:
|
|
138
138
|
|
|
139
139
|
```ts
|
|
140
|
-
import { anthropic } from '@
|
|
140
|
+
import { anthropic } from '@keystrokehq/ai';
|
|
141
141
|
import { Agent } from '@keystrokehq/core';
|
|
142
|
-
import { slackPlatformGateway } from '@
|
|
142
|
+
import { slackPlatformGateway } from '@keystrokehq/slack/platform';
|
|
143
143
|
|
|
144
144
|
export const supportAgent = new Agent({
|
|
145
145
|
id: 'support-agent',
|
|
@@ -154,7 +154,7 @@ export const supportAgent = new Agent({
|
|
|
154
154
|
Or importing a gateway from its own file:
|
|
155
155
|
|
|
156
156
|
```ts
|
|
157
|
-
import { anthropic } from '@
|
|
157
|
+
import { anthropic } from '@keystrokehq/ai';
|
|
158
158
|
import { Agent } from '@keystrokehq/core';
|
|
159
159
|
import { supportSlackGateway } from './support-slack.gateway';
|
|
160
160
|
|
|
@@ -227,7 +227,7 @@ Use `appRef` only with `mode: 'custom'` to identify which user-created app insta
|
|
|
227
227
|
|
|
228
228
|
Integration packages and `core` export gateway factory functions so users don't need to construct gateways manually:
|
|
229
229
|
|
|
230
|
-
- **Slack**: `slackPlatformGateway()` from `@
|
|
230
|
+
- **Slack**: `slackPlatformGateway()` from `@keystrokehq/slack/platform`, `slackCustomGateway()` from `@keystrokehq/slack/custom`
|
|
231
231
|
- **GitHub**: `githubPlatformGateway()` from `@keystrokehq/core`
|
|
232
232
|
|
|
233
233
|
Use these when the helper fits. Fall back to `new MessagingGateway({...})` when no helper exists for the provider or the credential set needs to differ.
|
|
@@ -17,7 +17,7 @@ File layout reminder:
|
|
|
17
17
|
## Minimal `Agent`
|
|
18
18
|
|
|
19
19
|
```ts
|
|
20
|
-
import { anthropic } from '@
|
|
20
|
+
import { anthropic } from '@keystrokehq/ai';
|
|
21
21
|
import { Agent } from '@keystrokehq/core';
|
|
22
22
|
|
|
23
23
|
export const summarizer = new Agent({
|
|
@@ -38,7 +38,7 @@ This is the smallest runnable authored agent:
|
|
|
38
38
|
## `Agent` with optional fields
|
|
39
39
|
|
|
40
40
|
```ts
|
|
41
|
-
import { anthropic } from '@
|
|
41
|
+
import { anthropic } from '@keystrokehq/ai';
|
|
42
42
|
import { Agent, CredentialSet } from '@keystrokehq/core';
|
|
43
43
|
import { z } from 'zod';
|
|
44
44
|
|
|
@@ -93,7 +93,7 @@ The same example could also be written with `new Operation({...})` if the unit i
|
|
|
93
93
|
## Workflow Tool
|
|
94
94
|
|
|
95
95
|
```ts
|
|
96
|
-
import { anthropic } from '@
|
|
96
|
+
import { anthropic } from '@keystrokehq/ai';
|
|
97
97
|
import { Agent, Workflow } from '@keystrokehq/core';
|
|
98
98
|
import { z } from 'zod';
|
|
99
99
|
import { lookupCustomerTool } from './lookup-customer.tool';
|
|
@@ -267,7 +267,7 @@ Use `stream(...)` when the caller wants incremental events such as:
|
|
|
267
267
|
## Agent hooks
|
|
268
268
|
|
|
269
269
|
```ts
|
|
270
|
-
import { anthropic } from '@
|
|
270
|
+
import { anthropic } from '@keystrokehq/ai';
|
|
271
271
|
import { Agent } from '@keystrokehq/core';
|
|
272
272
|
|
|
273
273
|
export const guardedAgent = new Agent({
|
|
@@ -378,7 +378,7 @@ const toolManifest = formatTicketTool.toManifest();
|
|
|
378
378
|
## `skills`
|
|
379
379
|
|
|
380
380
|
```ts
|
|
381
|
-
import { anthropic } from '@
|
|
381
|
+
import { anthropic } from '@keystrokehq/ai';
|
|
382
382
|
import { Agent } from '@keystrokehq/core';
|
|
383
383
|
|
|
384
384
|
export const codingAgent = new Agent({
|
|
@@ -18,14 +18,14 @@ Important distinction:
|
|
|
18
18
|
Install the package that exports the operation:
|
|
19
19
|
|
|
20
20
|
```sh
|
|
21
|
-
pnpm add @
|
|
21
|
+
pnpm add @keystrokehq/slack
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
Import the named operation you want:
|
|
25
25
|
|
|
26
26
|
```ts
|
|
27
|
-
import { sendMessage } from '@
|
|
28
|
-
import { anthropic } from '@
|
|
27
|
+
import { sendMessage } from '@keystrokehq/slack/platform/messages';
|
|
28
|
+
import { anthropic } from '@keystrokehq/ai';
|
|
29
29
|
import { Agent } from '@keystrokehq/core';
|
|
30
30
|
```
|
|
31
31
|
|
|
@@ -44,24 +44,24 @@ const notifierAgent = new Agent({
|
|
|
44
44
|
|
|
45
45
|
Replace `sendMessage` with any of the integration operation exports listed below.
|
|
46
46
|
|
|
47
|
-
## `@
|
|
47
|
+
## `@keystrokehq/ai`
|
|
48
48
|
|
|
49
49
|
Install:
|
|
50
50
|
|
|
51
51
|
```sh
|
|
52
|
-
pnpm add @
|
|
52
|
+
pnpm add @keystrokehq/ai
|
|
53
53
|
```
|
|
54
54
|
|
|
55
55
|
### Generated operations
|
|
56
56
|
|
|
57
|
-
Prefer subpath imports from `@
|
|
57
|
+
Prefer subpath imports from `@keystrokehq/ai/generate`.
|
|
58
58
|
|
|
59
59
|
Import and use:
|
|
60
60
|
|
|
61
61
|
```ts
|
|
62
|
-
import { anthropic } from '@
|
|
62
|
+
import { anthropic } from '@keystrokehq/ai';
|
|
63
63
|
import { Agent } from '@keystrokehq/core';
|
|
64
|
-
import { generateObject, generateText } from '@
|
|
64
|
+
import { generateObject, generateText } from '@keystrokehq/ai/generate';
|
|
65
65
|
|
|
66
66
|
const researchAgent = new Agent({
|
|
67
67
|
id: 'research-agent',
|
|
@@ -82,23 +82,23 @@ const researchAgent = new Agent({
|
|
|
82
82
|
- `anthropic`: Anthropic credential set.
|
|
83
83
|
- `openai`: OpenAI credential set.
|
|
84
84
|
|
|
85
|
-
## `@
|
|
85
|
+
## `@keystrokehq/apollo`
|
|
86
86
|
|
|
87
87
|
Install:
|
|
88
88
|
|
|
89
89
|
```sh
|
|
90
|
-
pnpm add @
|
|
90
|
+
pnpm add @keystrokehq/apollo
|
|
91
91
|
```
|
|
92
92
|
|
|
93
|
-
Prefer domain subpath imports such as `@
|
|
93
|
+
Prefer domain subpath imports such as `@keystrokehq/apollo/accounts` or `@keystrokehq/apollo/contacts`.
|
|
94
94
|
|
|
95
95
|
Import and use:
|
|
96
96
|
|
|
97
97
|
```ts
|
|
98
|
-
import { anthropic } from '@
|
|
98
|
+
import { anthropic } from '@keystrokehq/ai';
|
|
99
99
|
import { Agent } from '@keystrokehq/core';
|
|
100
|
-
import { createAccount } from '@
|
|
101
|
-
import { searchContacts } from '@
|
|
100
|
+
import { createAccount } from '@keystrokehq/apollo/accounts';
|
|
101
|
+
import { searchContacts } from '@keystrokehq/apollo/contacts';
|
|
102
102
|
|
|
103
103
|
const salesAgent = new Agent({
|
|
104
104
|
id: 'sales-agent',
|
|
@@ -158,22 +158,22 @@ const salesAgent = new Agent({
|
|
|
158
158
|
- `createTasks`: Create Apollo tasks.
|
|
159
159
|
- `searchTasks`: Search Apollo tasks.
|
|
160
160
|
|
|
161
|
-
## `@
|
|
161
|
+
## `@keystrokehq/attio`
|
|
162
162
|
|
|
163
163
|
Install:
|
|
164
164
|
|
|
165
165
|
```sh
|
|
166
|
-
pnpm add @
|
|
166
|
+
pnpm add @keystrokehq/attio
|
|
167
167
|
```
|
|
168
168
|
|
|
169
|
-
Prefer domain subpath imports such as `@
|
|
169
|
+
Prefer domain subpath imports such as `@keystrokehq/attio/records` or `@keystrokehq/attio/lists`.
|
|
170
170
|
|
|
171
171
|
Import and use:
|
|
172
172
|
|
|
173
173
|
```ts
|
|
174
|
-
import { anthropic } from '@
|
|
174
|
+
import { anthropic } from '@keystrokehq/ai';
|
|
175
175
|
import { Agent } from '@keystrokehq/core';
|
|
176
|
-
import { createRecord, queryRecords } from '@
|
|
176
|
+
import { createRecord, queryRecords } from '@keystrokehq/attio/records';
|
|
177
177
|
|
|
178
178
|
const crmAgent = new Agent({
|
|
179
179
|
id: 'crm-agent',
|
|
@@ -225,18 +225,18 @@ const crmAgent = new Agent({
|
|
|
225
225
|
- `listTasks`: List Attio tasks.
|
|
226
226
|
- `updateTask`: Update an Attio task.
|
|
227
227
|
|
|
228
|
-
## `@
|
|
228
|
+
## `@keystrokehq/daytona`
|
|
229
229
|
|
|
230
230
|
Install:
|
|
231
231
|
|
|
232
232
|
```sh
|
|
233
|
-
pnpm add @
|
|
233
|
+
pnpm add @keystrokehq/daytona
|
|
234
234
|
```
|
|
235
235
|
|
|
236
236
|
Import example:
|
|
237
237
|
|
|
238
238
|
```ts
|
|
239
|
-
import { DaytonaSandbox } from '@
|
|
239
|
+
import { DaytonaSandbox } from '@keystrokehq/daytona';
|
|
240
240
|
```
|
|
241
241
|
|
|
242
242
|
This package does not currently export agent operations.
|
|
@@ -247,23 +247,23 @@ It exports sandbox helpers instead:
|
|
|
247
247
|
- `DaytonaSandbox`: Create a Daytona-backed sandbox for agents.
|
|
248
248
|
- `DaytonaSandboxProvider`: Configure the Daytona sandbox provider.
|
|
249
249
|
|
|
250
|
-
## `@
|
|
250
|
+
## `@keystrokehq/github`
|
|
251
251
|
|
|
252
252
|
Install:
|
|
253
253
|
|
|
254
254
|
```sh
|
|
255
|
-
pnpm add @
|
|
255
|
+
pnpm add @keystrokehq/github
|
|
256
256
|
```
|
|
257
257
|
|
|
258
|
-
Prefer domain subpath imports such as `@
|
|
258
|
+
Prefer domain subpath imports such as `@keystrokehq/github/issues`, `@keystrokehq/github/pull-requests`, or `@keystrokehq/github/repos`.
|
|
259
259
|
|
|
260
260
|
Import and use:
|
|
261
261
|
|
|
262
262
|
```ts
|
|
263
|
-
import { anthropic } from '@
|
|
263
|
+
import { anthropic } from '@keystrokehq/ai';
|
|
264
264
|
import { Agent } from '@keystrokehq/core';
|
|
265
|
-
import { getIssue } from '@
|
|
266
|
-
import { listPullRequests } from '@
|
|
265
|
+
import { getIssue } from '@keystrokehq/github/issues';
|
|
266
|
+
import { listPullRequests } from '@keystrokehq/github/pull-requests';
|
|
267
267
|
|
|
268
268
|
const githubAgent = new Agent({
|
|
269
269
|
id: 'github-agent',
|
|
@@ -289,24 +289,24 @@ Common operation groups:
|
|
|
289
289
|
|
|
290
290
|
The package also exposes `connection`, `client`, and `schemas` support surfaces on explicit subpaths. Keep internal provider-app wiring off agent-facing imports.
|
|
291
291
|
|
|
292
|
-
## `@
|
|
292
|
+
## `@keystrokehq/google`
|
|
293
293
|
|
|
294
294
|
Install:
|
|
295
295
|
|
|
296
296
|
```sh
|
|
297
|
-
pnpm add @
|
|
297
|
+
pnpm add @keystrokehq/google
|
|
298
298
|
```
|
|
299
299
|
|
|
300
|
-
Prefer domain subpath imports such as `@
|
|
300
|
+
Prefer domain subpath imports such as `@keystrokehq/google/gmail`, `@keystrokehq/google/sheets`, or `@keystrokehq/google/calendar`.
|
|
301
301
|
|
|
302
302
|
Import and use:
|
|
303
303
|
|
|
304
304
|
```ts
|
|
305
|
-
import { anthropic } from '@
|
|
305
|
+
import { anthropic } from '@keystrokehq/ai';
|
|
306
306
|
import { Agent } from '@keystrokehq/core';
|
|
307
|
-
import { listCalendarEventsTool, createCalendarEventTool } from '@
|
|
308
|
-
import { getEmailTool, sendEmailTool } from '@
|
|
309
|
-
import { readSpreadsheetTabTool } from '@
|
|
307
|
+
import { listCalendarEventsTool, createCalendarEventTool } from '@keystrokehq/google/calendar';
|
|
308
|
+
import { getEmailTool, sendEmailTool } from '@keystrokehq/google/gmail';
|
|
309
|
+
import { readSpreadsheetTabTool } from '@keystrokehq/google/sheets';
|
|
310
310
|
|
|
311
311
|
const googleAgent = new Agent({
|
|
312
312
|
id: 'google-agent',
|
|
@@ -343,25 +343,25 @@ const googleAgent = new Agent({
|
|
|
343
343
|
|
|
344
344
|
This package also exports polling triggers (`gmailNewUnreadInboxEmails`, `calendarNewOrUpdatedEvents`) and non-Tool workflow step variants (`sendEmail`, `getEmail`, `listEmails`, `labelEmail`, `createSpreadsheet`, `addSpreadsheetTab`, `readSpreadsheetTab`, `writeSpreadsheetRange`, `listCalendars`, `listCalendarEvents`, `getCalendarEvent`, `createCalendarEvent`, `updateCalendarEvent`, `deleteCalendarEvent`). Those step variants are not agent tools.
|
|
345
345
|
|
|
346
|
-
## `@
|
|
346
|
+
## `@keystrokehq/hubspot`
|
|
347
347
|
|
|
348
348
|
Install:
|
|
349
349
|
|
|
350
350
|
```sh
|
|
351
|
-
pnpm add @
|
|
351
|
+
pnpm add @keystrokehq/hubspot
|
|
352
352
|
```
|
|
353
353
|
|
|
354
|
-
Prefer explicit subpaths such as `@
|
|
355
|
-
`@
|
|
356
|
-
`@
|
|
354
|
+
Prefer explicit subpaths such as `@keystrokehq/hubspot/connection`,
|
|
355
|
+
`@keystrokehq/hubspot/triggers`, and domain paths like
|
|
356
|
+
`@keystrokehq/hubspot/companies` or `@keystrokehq/hubspot/contacts`.
|
|
357
357
|
|
|
358
358
|
Import and use:
|
|
359
359
|
|
|
360
360
|
```ts
|
|
361
|
-
import { anthropic } from '@
|
|
361
|
+
import { anthropic } from '@keystrokehq/ai';
|
|
362
362
|
import { Agent } from '@keystrokehq/core';
|
|
363
|
-
import { createCompany } from '@
|
|
364
|
-
import { searchContacts } from '@
|
|
363
|
+
import { createCompany } from '@keystrokehq/hubspot/companies';
|
|
364
|
+
import { searchContacts } from '@keystrokehq/hubspot/contacts';
|
|
365
365
|
|
|
366
366
|
const hubspotAgent = new Agent({
|
|
367
367
|
id: 'hubspot-agent',
|
|
@@ -411,23 +411,23 @@ const hubspotAgent = new Agent({
|
|
|
411
411
|
|
|
412
412
|
This package also exports triggers, verification helpers, and example workflows from its root entrypoint. Those are not agent tools.
|
|
413
413
|
|
|
414
|
-
## `@
|
|
414
|
+
## `@keystrokehq/kalshi`
|
|
415
415
|
|
|
416
416
|
Install:
|
|
417
417
|
|
|
418
418
|
```sh
|
|
419
|
-
pnpm add @
|
|
419
|
+
pnpm add @keystrokehq/kalshi
|
|
420
420
|
```
|
|
421
421
|
|
|
422
|
-
Prefer domain subpath imports such as `@
|
|
422
|
+
Prefer domain subpath imports such as `@keystrokehq/kalshi/markets` or `@keystrokehq/kalshi/portfolio`.
|
|
423
423
|
|
|
424
424
|
Import and use:
|
|
425
425
|
|
|
426
426
|
```ts
|
|
427
|
-
import { anthropic } from '@
|
|
427
|
+
import { anthropic } from '@keystrokehq/ai';
|
|
428
428
|
import { Agent } from '@keystrokehq/core';
|
|
429
|
-
import { getMarkets } from '@
|
|
430
|
-
import { createOrder } from '@
|
|
429
|
+
import { getMarkets } from '@keystrokehq/kalshi/markets';
|
|
430
|
+
import { createOrder } from '@keystrokehq/kalshi/portfolio';
|
|
431
431
|
|
|
432
432
|
const traderAgent = new Agent({
|
|
433
433
|
id: 'trader-agent',
|
|
@@ -571,22 +571,22 @@ const traderAgent = new Agent({
|
|
|
571
571
|
|
|
572
572
|
This package also exports triggers and plain helper functions such as `getTopOfBook` and `listActiveMarkets`. Those helpers are not agent operations unless you wrap them yourself.
|
|
573
573
|
|
|
574
|
-
## `@
|
|
574
|
+
## `@keystrokehq/linear`
|
|
575
575
|
|
|
576
576
|
Install:
|
|
577
577
|
|
|
578
578
|
```sh
|
|
579
|
-
pnpm add @
|
|
579
|
+
pnpm add @keystrokehq/linear
|
|
580
580
|
```
|
|
581
581
|
|
|
582
|
-
Prefer domain subpath imports such as `@
|
|
582
|
+
Prefer domain subpath imports such as `@keystrokehq/linear/issues` or `@keystrokehq/linear/users`.
|
|
583
583
|
|
|
584
584
|
Import and use:
|
|
585
585
|
|
|
586
586
|
```ts
|
|
587
|
-
import { anthropic } from '@
|
|
587
|
+
import { anthropic } from '@keystrokehq/ai';
|
|
588
588
|
import { Agent } from '@keystrokehq/core';
|
|
589
|
-
import { createIssue, searchIssues } from '@
|
|
589
|
+
import { createIssue, searchIssues } from '@keystrokehq/linear/issues';
|
|
590
590
|
|
|
591
591
|
const triageAgent = new Agent({
|
|
592
592
|
id: 'triage-agent',
|
|
@@ -653,23 +653,23 @@ const triageAgent = new Agent({
|
|
|
653
653
|
- `deleteWebhook`: Delete a Linear webhook.
|
|
654
654
|
- `listWebhooks`: List Linear webhooks.
|
|
655
655
|
|
|
656
|
-
## `@
|
|
656
|
+
## `@keystrokehq/perplexity`
|
|
657
657
|
|
|
658
658
|
Install:
|
|
659
659
|
|
|
660
660
|
```sh
|
|
661
|
-
pnpm add @
|
|
661
|
+
pnpm add @keystrokehq/perplexity
|
|
662
662
|
```
|
|
663
663
|
|
|
664
|
-
Prefer subpath imports such as `@
|
|
664
|
+
Prefer subpath imports such as `@keystrokehq/perplexity/search`, `@keystrokehq/perplexity/stream`, and `@keystrokehq/perplexity/generate`.
|
|
665
665
|
|
|
666
666
|
Import and use:
|
|
667
667
|
|
|
668
668
|
```ts
|
|
669
|
-
import { anthropic } from '@
|
|
669
|
+
import { anthropic } from '@keystrokehq/ai';
|
|
670
670
|
import { Agent } from '@keystrokehq/core';
|
|
671
|
-
import { generateText } from '@
|
|
672
|
-
import { research, search } from '@
|
|
671
|
+
import { generateText } from '@keystrokehq/perplexity/generate';
|
|
672
|
+
import { research, search } from '@keystrokehq/perplexity/search';
|
|
673
673
|
|
|
674
674
|
const researchAgent = new Agent({
|
|
675
675
|
id: 'perplexity-research-agent',
|
|
@@ -686,23 +686,23 @@ const researchAgent = new Agent({
|
|
|
686
686
|
- `search`: Run a Perplexity search query.
|
|
687
687
|
- `streamSearch`: Stream Perplexity search results.
|
|
688
688
|
|
|
689
|
-
## `@
|
|
689
|
+
## `@keystrokehq/polymarket`
|
|
690
690
|
|
|
691
691
|
Install:
|
|
692
692
|
|
|
693
693
|
```sh
|
|
694
|
-
pnpm add @
|
|
694
|
+
pnpm add @keystrokehq/polymarket
|
|
695
695
|
```
|
|
696
696
|
|
|
697
|
-
Prefer domain subpath imports such as `@
|
|
697
|
+
Prefer domain subpath imports such as `@keystrokehq/polymarket/markets` or `@keystrokehq/polymarket/discovery`.
|
|
698
698
|
|
|
699
699
|
Import and use:
|
|
700
700
|
|
|
701
701
|
```ts
|
|
702
|
-
import { anthropic } from '@
|
|
702
|
+
import { anthropic } from '@keystrokehq/ai';
|
|
703
703
|
import { Agent } from '@keystrokehq/core';
|
|
704
|
-
import { getMarket } from '@
|
|
705
|
-
import { search } from '@
|
|
704
|
+
import { getMarket } from '@keystrokehq/polymarket/markets';
|
|
705
|
+
import { search } from '@keystrokehq/polymarket/discovery';
|
|
706
706
|
|
|
707
707
|
const marketAgent = new Agent({
|
|
708
708
|
id: 'market-agent',
|
|
@@ -761,23 +761,23 @@ const marketAgent = new Agent({
|
|
|
761
761
|
- `getPriceHistory`: Fetch historical price data for a market.
|
|
762
762
|
- `listPrices`: List prices across markets.
|
|
763
763
|
|
|
764
|
-
## `@
|
|
764
|
+
## `@keystrokehq/scrapin`
|
|
765
765
|
|
|
766
766
|
Install:
|
|
767
767
|
|
|
768
768
|
```sh
|
|
769
|
-
pnpm add @
|
|
769
|
+
pnpm add @keystrokehq/scrapin
|
|
770
770
|
```
|
|
771
771
|
|
|
772
|
-
Prefer domain subpath imports such as `@
|
|
772
|
+
Prefer domain subpath imports such as `@keystrokehq/scrapin/persons` or `@keystrokehq/scrapin/companies`.
|
|
773
773
|
|
|
774
774
|
Import and use:
|
|
775
775
|
|
|
776
776
|
```ts
|
|
777
|
-
import { anthropic } from '@
|
|
777
|
+
import { anthropic } from '@keystrokehq/ai';
|
|
778
778
|
import { Agent } from '@keystrokehq/core';
|
|
779
|
-
import { getCompanyProfile } from '@
|
|
780
|
-
import { searchPersons } from '@
|
|
779
|
+
import { getCompanyProfile } from '@keystrokehq/scrapin/companies';
|
|
780
|
+
import { searchPersons } from '@keystrokehq/scrapin/persons';
|
|
781
781
|
|
|
782
782
|
const prospectingAgent = new Agent({
|
|
783
783
|
id: 'prospecting-agent',
|
|
@@ -820,23 +820,23 @@ const prospectingAgent = new Agent({
|
|
|
820
820
|
- `resolvePersonByEmail`: Resolve a person from an email address.
|
|
821
821
|
- `searchPersons`: Search people.
|
|
822
822
|
|
|
823
|
-
## `@
|
|
823
|
+
## `@keystrokehq/slack`
|
|
824
824
|
|
|
825
825
|
Install:
|
|
826
826
|
|
|
827
827
|
```sh
|
|
828
|
-
pnpm add @
|
|
828
|
+
pnpm add @keystrokehq/slack
|
|
829
829
|
```
|
|
830
830
|
|
|
831
|
-
Prefer mode/domain imports such as `@
|
|
831
|
+
Prefer mode/domain imports such as `@keystrokehq/slack/platform/messages` or `@keystrokehq/slack/platform/users`.
|
|
832
832
|
|
|
833
833
|
Import and use:
|
|
834
834
|
|
|
835
835
|
```ts
|
|
836
|
-
import { anthropic } from '@
|
|
836
|
+
import { anthropic } from '@keystrokehq/ai';
|
|
837
837
|
import { Agent } from '@keystrokehq/core';
|
|
838
|
-
import { sendMessage } from '@
|
|
839
|
-
import { listUsers } from '@
|
|
838
|
+
import { sendMessage } from '@keystrokehq/slack/platform/messages';
|
|
839
|
+
import { listUsers } from '@keystrokehq/slack/platform/users';
|
|
840
840
|
|
|
841
841
|
const slackAgent = new Agent({
|
|
842
842
|
id: 'slack-agent',
|
|
@@ -58,7 +58,7 @@ What these fields do:
|
|
|
58
58
|
This example reuses `repoSandbox` from the previous snippet.
|
|
59
59
|
|
|
60
60
|
```ts
|
|
61
|
-
import { anthropic } from '@
|
|
61
|
+
import { anthropic } from '@keystrokehq/ai';
|
|
62
62
|
import { Agent } from '@keystrokehq/core';
|
|
63
63
|
|
|
64
64
|
export const codingAgent = new Agent({
|
|
@@ -160,7 +160,7 @@ export const securedServer = new McpServer({
|
|
|
160
160
|
This example reuses `localDocsServer` and `securedServer` from the previous snippets.
|
|
161
161
|
|
|
162
162
|
```ts
|
|
163
|
-
import { anthropic } from '@
|
|
163
|
+
import { anthropic } from '@keystrokehq/ai';
|
|
164
164
|
import { Agent } from '@keystrokehq/core';
|
|
165
165
|
|
|
166
166
|
export const docsAgent = new Agent({
|
|
@@ -13,11 +13,11 @@ Default testing targets:
|
|
|
13
13
|
|
|
14
14
|
## Vitest setup
|
|
15
15
|
|
|
16
|
-
`keystrokeTestPlugin()` adds the
|
|
16
|
+
`keystrokeTestPlugin()` adds the Keystroke testing setup file to Vitest, which is required for credential resolution and sandbox mocks.
|
|
17
17
|
|
|
18
18
|
```ts
|
|
19
19
|
import { defineConfig } from 'vitest/config';
|
|
20
|
-
import { keystrokeTestPlugin } from '@keystrokehq/
|
|
20
|
+
import { keystrokeTestPlugin } from '@keystrokehq/testing/vitest';
|
|
21
21
|
|
|
22
22
|
export default defineConfig({
|
|
23
23
|
plugins: [keystrokeTestPlugin()],
|
|
@@ -26,10 +26,10 @@ export default defineConfig({
|
|
|
26
26
|
|
|
27
27
|
## Test tools directly
|
|
28
28
|
|
|
29
|
-
For testing tools in isolation, use the specialized `runTool` helper from `@keystrokehq/
|
|
29
|
+
For testing tools in isolation, use the specialized `runTool` helper from `@keystrokehq/testing` which automatically creates the appropriate tool context.
|
|
30
30
|
|
|
31
31
|
```ts
|
|
32
|
-
import { runTool } from '@keystrokehq/
|
|
32
|
+
import { runTool } from '@keystrokehq/testing';
|
|
33
33
|
|
|
34
34
|
const result = await runTool(
|
|
35
35
|
lookupCustomerTool,
|