@availsync/node 0.1.0-alpha.0 → 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.
Files changed (2) hide show
  1. package/README.md +22 -0
  2. package/package.json +1 -9
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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@availsync/node",
3
- "version": "0.1.0-alpha.0",
3
+ "version": "0.1.0-alpha.2",
4
4
  "description": "Node SDK for Availsync coding-agent work guardrails.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -18,15 +18,7 @@
18
18
  "README.md",
19
19
  "LICENSE"
20
20
  ],
21
- "repository": {
22
- "type": "git",
23
- "url": "git+https://github.com/arkilstsko/availsync.git",
24
- "directory": "packages/node"
25
- },
26
21
  "homepage": "https://availsync.dev",
27
- "bugs": {
28
- "url": "https://github.com/arkilstsko/availsync/issues"
29
- },
30
22
  "keywords": [
31
23
  "availsync",
32
24
  "ai-agents",