@keystrokehq/skills 0.0.6 → 0.0.8
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/CHANGELOG.md +12 -0
- package/README.md +1 -0
- package/package.json +1 -1
- package/src/_AGENTS.md +2 -0
- package/src/keystroke-runtime-scripts/SKILL.md +79 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @keystrokehq/skills
|
|
2
2
|
|
|
3
|
+
## 0.0.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 2c08ba5: Fixing refresh and adding google lifecycle config
|
|
8
|
+
|
|
9
|
+
## 0.0.7
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 7abf3aa: Add runtime script guidance and scaffold `@keystrokehq/runtime` into initialized projects.
|
|
14
|
+
|
|
3
15
|
## 0.0.6
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/README.md
CHANGED
package/package.json
CHANGED
package/src/_AGENTS.md
CHANGED
|
@@ -29,6 +29,8 @@ Keystroke also has one shared unit-of-work primitive: `Operation`.
|
|
|
29
29
|
- Use the `Operation` name when describing shared infrastructure, integrations, or a reusable unit that can be used in both places.
|
|
30
30
|
- The runtime behavior comes from context, not from which alias name was used in the constructor.
|
|
31
31
|
|
|
32
|
+
For local TypeScript scripts, agents can import `@keystrokehq/runtime` to run `Operation` / `Step` / `Tool` instances with automatic credential loading from overrides, env vars, or saved Keystroke auth.
|
|
33
|
+
|
|
32
34
|
Runtime boundary:
|
|
33
35
|
|
|
34
36
|
- workflows and steps are authored as TypeScript control-flow and unit-of-work code
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: keystroke-runtime-scripts
|
|
3
|
+
description: Use @keystrokehq/runtime in local TypeScript scripts to run Keystroke Operation, Step, or Tool instances with credential loading and runtime context. Use when writing one-off scripts, local integration checks, or credential-backed operation runs outside Vitest.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Keystroke Runtime Scripts
|
|
7
|
+
|
|
8
|
+
Use this skill when an agent needs to run Keystroke operations from a local TypeScript or JavaScript script.
|
|
9
|
+
|
|
10
|
+
Default split:
|
|
11
|
+
- use `@keystrokehq/runtime` for local scripts and manual integration checks
|
|
12
|
+
- use `@keystrokehq/testing` for Vitest tests, mocks, hooks, and deterministic assertions
|
|
13
|
+
- use the CLI skill for workflow builds, deploys, credential upload, and deployed workflow runs
|
|
14
|
+
|
|
15
|
+
## Quick start
|
|
16
|
+
|
|
17
|
+
Install the runtime side effect once, then call `.run(...)` on an `Operation`, `Step`, or `Tool`.
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import '@keystrokehq/runtime';
|
|
21
|
+
|
|
22
|
+
import { listObjects } from '@keystrokehq/attio/objects';
|
|
23
|
+
|
|
24
|
+
const objects = await listObjects.run({});
|
|
25
|
+
console.info(JSON.stringify(objects, null, 2));
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Or use the explicit helper:
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
import { run } from '@keystrokehq/runtime';
|
|
32
|
+
import { listObjects } from '@keystrokehq/attio/objects';
|
|
33
|
+
|
|
34
|
+
const objects = await run(listObjects, {});
|
|
35
|
+
console.info(JSON.stringify(objects, null, 2));
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Configure runtime
|
|
39
|
+
|
|
40
|
+
Use `configureRuntime(...)` for process-wide script settings:
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
import { configureRuntime } from '@keystrokehq/runtime';
|
|
44
|
+
|
|
45
|
+
configureRuntime({
|
|
46
|
+
credentials: {
|
|
47
|
+
mode: 'auto',
|
|
48
|
+
overrides: {
|
|
49
|
+
attio: {
|
|
50
|
+
ACCESS_TOKEN: process.env.ATTIO_ACCESS_TOKEN,
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
workflowGlobals: {
|
|
55
|
+
tenantId: 'tenant_local',
|
|
56
|
+
},
|
|
57
|
+
stepContext: {
|
|
58
|
+
stepId: 'local-script',
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Credential modes:
|
|
64
|
+
- `auto`: explicit overrides, env vars, then saved `keystroke auth` credentials
|
|
65
|
+
- `env-only`: overrides and env vars only
|
|
66
|
+
- `off`: no runtime credential resolver
|
|
67
|
+
|
|
68
|
+
Use `withRuntime(options, callback)` when configuration must be scoped to one block. Use `createRuntime(options)` when you need an explicit handle and will call `runtime.dispose()`.
|
|
69
|
+
|
|
70
|
+
## Rules
|
|
71
|
+
|
|
72
|
+
- Keep scripts small and disposable.
|
|
73
|
+
- Prefer operation `.run(input)` after the side-effect import for simple scripts.
|
|
74
|
+
- Prefer `run(operation, input)` when the call site should make the runtime dependency obvious.
|
|
75
|
+
- Put secret values in `credentials.overrides` or env vars named from the credential set, not in source.
|
|
76
|
+
- Pass `workflowGlobals` when the operation expects typed workflow globals.
|
|
77
|
+
- Pass `stepContext` only for local metadata such as `stepId`, attempts, tracing, or prefilled credentials.
|
|
78
|
+
- Do not use runtime scripts as tests; use `@keystrokehq/testing` in `.test.ts` files.
|
|
79
|
+
- Do not use `execution: 'cloud'`; local scripts currently use `execution: 'local'`.
|