@swarm-agent/sdk 0.1.51 → 0.1.52

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 CHANGED
@@ -21,8 +21,8 @@ Requires Node 22 or newer (ESM). The package is public on npm:
21
21
  npm install @swarm-agent/sdk
22
22
  </copy>
23
23
 
24
- You need a running Swarm on Linux x86_64. Install one with
25
- `curl -fsSL https://swarmagent.dev/install-launcher | sh -s -- --yes`.
24
+ You need a running Swarm. Install the Swarm box (Ubuntu 24.04 x86_64) with
25
+ `curl -fsSL https://swarmagent.dev/install | sudo bash`.
26
26
 
27
27
  ## Connect to your Swarm
28
28
 
@@ -58,10 +58,14 @@ example, not source tests or node_modules. `prepack` builds locally; there are n
58
58
  install/prepare hooks. TypeScript/tsx are build/test tools, not runtime dependencies.
59
59
  CommonJS `require` and non-Node runtimes are not validated by this packaging step.
60
60
 
61
- For the headless container, use the matching `@swarm-agent/cli` package and explicitly
62
- export a scoped token through `swarm-headless setup -- sdk-token`. Connect to
63
- `http://127.0.0.1:7783`; **do not** use Desktop bootstrap or a privileged socket.
64
- The headless listener allows session operations only, not the complete API below.
61
+ On the Swarm box, `http://127.0.0.1:7783` is the scoped-token listener. The AI
62
+ key the installer wrote to `~/.config/swarm/ai-key` (a new one:
63
+ `sudo bash /var/lib/swarm-headless/src/containers/headless/app/install.sh connect-ai`)
64
+ works only through its MCP, `http://127.0.0.1:7783/mcp`, with any MCP client;
65
+ it reaches no SDK route. For the session routes there, use a client key (a full
66
+ AI key's `swarm_create_client_key` mints one); **do not** use Desktop bootstrap
67
+ or a privileged socket. A client key reaches session operations only, not the
68
+ complete API below.
65
69
  The packaged `examples/headless-session.ts` imports `@swarm-agent/sdk` and can be copied
66
70
  into your consumer and run with an explicitly installed `tsx` runner. Protect its
67
71
  `SWARM_SDK_TOKEN_FILE` (0600); the example asks before each tool approval and uses
package/dist/auth.d.ts CHANGED
@@ -25,10 +25,11 @@ export declare class SwarmAuthNamespace {
25
25
  /**
26
26
  * Creates an AI key for Swarm Control (`/mcp` on the scoped-token gateway).
27
27
  * `read` keys see and call only read tools; `write` keys may also start and
28
- * steer sessions; neither may approve tool calls or manage anything. `full`
28
+ * steer sessions and start the person's ChatGPT sign-in (they finish it in
29
+ * their own browser); neither may approve tool calls or manage anything. `full`
29
30
  * keys are for an AI the owner trusts to run the box: they also approve
30
- * tool calls and manage models, workers, limits, custom agents, client app
31
- * keys and ChatGPT sign-in. Every level reaches only `/mcp`. Lifetime
31
+ * tool calls and manage models, workers, limits, custom agents and client app
32
+ * keys. Every level reaches only `/mcp`. Lifetime
32
33
  * defaults to 30 days (at most 365). Owner only.
33
34
  */
34
35
  createAIKey(params: {
package/dist/auth.js CHANGED
@@ -57,10 +57,11 @@ export class SwarmAuthNamespace {
57
57
  /**
58
58
  * Creates an AI key for Swarm Control (`/mcp` on the scoped-token gateway).
59
59
  * `read` keys see and call only read tools; `write` keys may also start and
60
- * steer sessions; neither may approve tool calls or manage anything. `full`
60
+ * steer sessions and start the person's ChatGPT sign-in (they finish it in
61
+ * their own browser); neither may approve tool calls or manage anything. `full`
61
62
  * keys are for an AI the owner trusts to run the box: they also approve
62
- * tool calls and manage models, workers, limits, custom agents, client app
63
- * keys and ChatGPT sign-in. Every level reaches only `/mcp`. Lifetime
63
+ * tool calls and manage models, workers, limits, custom agents and client app
64
+ * keys. Every level reaches only `/mcp`. Lifetime
64
65
  * defaults to 30 days (at most 365). Owner only.
65
66
  */
66
67
  async createAIKey(params) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swarm-agent/sdk",
3
- "version": "0.1.51",
3
+ "version": "0.1.52",
4
4
  "description": "Official TypeScript SDK for Swarm local AI coding workspace",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",