@operator-labs/sdk 0.1.5 → 0.1.7

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 +27 -6
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,6 +1,12 @@
1
1
  # @operator-labs/sdk
2
2
 
3
- TypeScript SDK for [Operator.io](https://operator.io). Manage agents, chat, instances, automations, and webhooks programmatically using an API key from [Operator.io](https://operator.io).
3
+ TypeScript SDK for [Operator.io](https://operator.io).
4
+
5
+ [Operator.io](https://operator.io) is the API for building, managing, and hosting [OpenClaw](https://openclaw.ai) agents using AI.
6
+
7
+ Use `op.chat` when you want [Operator.io](https://operator.io) to create agents, update files and skills, inspect instances, run web searches, or handle multi-step work.
8
+
9
+ Use the typed methods for direct control over instances, config, automations, and webhooks.
4
10
 
5
11
  ## Installation
6
12
 
@@ -19,12 +25,17 @@ const op = new Operator({ apiKey: "ck_live_..." });
19
25
  const status = await op.health();
20
26
  console.log(status.planName, status.email);
21
27
 
22
- // Send a message to the AI fleet manager
23
- const { chatId, text } = await op.chat.send("List my instances");
28
+ // Ask Operator.io to build and manage agents for you
29
+ const { chatId, text } = await op.chat.send(
30
+ "Create a new OpenClaw agent for outbound sales research and install the skills it needs."
31
+ );
24
32
  console.log(text);
25
33
 
26
34
  // Continue the conversation
27
- const followUp = await op.chat.send("Restart the first one", { chatId });
35
+ const followUp = await op.chat.send(
36
+ "Now update its state files so it posts a daily summary at 9am Bangkok time.",
37
+ { chatId }
38
+ );
28
39
  console.log(followUp.text);
29
40
  ```
30
41
 
@@ -32,13 +43,13 @@ console.log(followUp.text);
32
43
 
33
44
  ```ts
34
45
  const op = new Operator({
35
- apiKey: "ck_live_...", // Required Chat API key from the dashboard
46
+ apiKey: "ck_live_...", // Required: Chat API key from the dashboard
36
47
  });
37
48
  ```
38
49
 
39
50
  ## Getting an API Key
40
51
 
41
- 1. Go to **Settings > API Keys** in the Operator dashboard
52
+ 1. Go to **Settings > API Keys** in the [Operator.io](https://operator.io) dashboard
42
53
  2. Click **Create Key**
43
54
  3. Copy the key (starts with `ck_live_` or `ck_dev_`)
44
55
 
@@ -53,6 +64,8 @@ const status = await op.health();
53
64
 
54
65
  ### Chat
55
66
 
67
+ `op.chat` is the main agent surface. Use it when you want [Operator.io](https://operator.io) to create agents, inspect an instance, read or mutate files, install or author skills, change agent behavior, run web research, or coordinate multi-step work. Use the typed resources below when you want direct control over common API objects.
68
+
56
69
  ```ts
57
70
  // List all chats
58
71
  const chats = await op.chat.list();
@@ -64,6 +77,12 @@ const detail = await op.chat.get("chat-uuid");
64
77
  const { chatId, text } = await op.chat.send("Create a new instance called my-agent");
65
78
  console.log(text);
66
79
 
80
+ // Update agent files and skills through the agent
81
+ const edit = await op.chat.send(
82
+ "Open the my-agent instance, update its core files for a stricter review style, install any missing skills, and summarize what changed."
83
+ );
84
+ console.log(edit.text);
85
+
67
86
  // Continue a conversation
68
87
  const followUp = await op.chat.send("Now check its logs", { chatId });
69
88
  console.log(followUp.text);
@@ -75,6 +94,8 @@ await op.chat.delete("chat-uuid");
75
94
 
76
95
  ### Instances
77
96
 
97
+ Use `op.instances` for direct lifecycle and config management. If you want [Operator.io](https://operator.io) to inspect or evolve an instance filesystem or state, use `op.chat.send(...)`.
98
+
78
99
  ```ts
79
100
  // List instances
80
101
  const instances = await op.instances.list();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@operator-labs/sdk",
3
- "version": "0.1.5",
4
- "description": "TypeScript SDK for the Operator platform manage agents, chat, instances, automations, and webhooks programmatically.",
3
+ "version": "0.1.7",
4
+ "description": "TypeScript SDK for Operator.io platform: manage agents, chat, instances, automations, and webhooks programmatically.",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "main": "dist/index.js",