@availsync/node 0.1.0-alpha.1 → 0.1.0-alpha.2
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 +22 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,6 +10,16 @@ Use it before Codex, Claude, Cursor, OpenClaw, cron jobs, deploy scripts, or oth
|
|
|
10
10
|
npm install @availsync/node@alpha
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
+
Use the explicit `@alpha` tag for pilots. The package is public, but the SDK API should be treated as prerelease until the first production pilots confirm the shape.
|
|
14
|
+
|
|
15
|
+
## Environment
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
AVAILSYNC_API_KEY=avs_live_...
|
|
19
|
+
AVAILSYNC_AGENT_ID=agent_uuid
|
|
20
|
+
AVAILSYNC_API_URL=https://availsync.dev
|
|
21
|
+
```
|
|
22
|
+
|
|
13
23
|
## Guard a coding-agent run
|
|
14
24
|
|
|
15
25
|
```ts
|
|
@@ -40,6 +50,14 @@ if (result.action === 'skip_run') {
|
|
|
40
50
|
}
|
|
41
51
|
```
|
|
42
52
|
|
|
53
|
+
## API surface
|
|
54
|
+
|
|
55
|
+
- `createAvailsyncClient({ apiKey, agentId, baseUrl? })`
|
|
56
|
+
- `client.work.withClaim(resource, options, fn)`
|
|
57
|
+
- `client.work.start({ resource, durationMinutes?, reason?, idempotencyKey?, metadata? })`
|
|
58
|
+
- `client.work.extend(claimId, { durationMinutes? })`
|
|
59
|
+
- `client.work.finish(claimId, { outcome?, reason?, metadata? })`
|
|
60
|
+
|
|
43
61
|
## Manual flow
|
|
44
62
|
|
|
45
63
|
```ts
|
|
@@ -75,6 +93,10 @@ try {
|
|
|
75
93
|
|
|
76
94
|
Set an agent to Observe in the dashboard when you want Availsync to report what it would have blocked without stopping the automation. Observe mode returns `action: "proceed"` and `claim: null`; no lease is created, so `extend` and `finish` are no-ops you should skip.
|
|
77
95
|
|
|
96
|
+
## Error handling
|
|
97
|
+
|
|
98
|
+
The SDK throws `AvailsyncError` for auth, validation, plan-limit, network, and unexpected API errors. The error includes `code`, `status`, and safe `details` from the API response. It never logs or exposes API keys.
|
|
99
|
+
|
|
78
100
|
## Resource scope
|
|
79
101
|
|
|
80
102
|
- `repo:owner/repo` is the safe default. Only one active agent can work in the repo.
|