@3ns/cli 1.2.0 → 1.2.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 -13
- package/SKILL.md +13 -6
- package/dist/commands/chats.d.ts.map +1 -1
- package/dist/commands/chats.js +27 -11
- package/dist/commands/chats.js.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -227,11 +227,28 @@ Your agent's brain lives in Markdown files. These instruction files control your
|
|
|
227
227
|
|
|
228
228
|
---
|
|
229
229
|
|
|
230
|
-
### `3ns chats` -- Chat
|
|
230
|
+
### `3ns chats` -- Chat with Your Agent
|
|
231
231
|
|
|
232
|
-
|
|
232
|
+
Send a message and get an AI response. The chat folder is auto-detected so you can just send a message.
|
|
233
233
|
|
|
234
234
|
```bash
|
|
235
|
+
# Send a message and get an AI response
|
|
236
|
+
3ns chats send "What can you help me with?"
|
|
237
|
+
|
|
238
|
+
# Use a specific AI model for this message
|
|
239
|
+
3ns chats send "Summarise this document" --model openai/gpt-5.2
|
|
240
|
+
3ns chats send "Write a poem" --model anthropic/claude-4-opus
|
|
241
|
+
|
|
242
|
+
# Continue an existing conversation
|
|
243
|
+
3ns chats send "Tell me more about that" --chat-id 1743435000000
|
|
244
|
+
|
|
245
|
+
# Send with an image/file attachment (upload first, then pass the URL)
|
|
246
|
+
3ns files upload ./photo.jpg --folder FOLDER_ID # note the returned URL
|
|
247
|
+
3ns chats send "What's in this image?" --attachment https://storage.googleapis.com/.../photo.jpg
|
|
248
|
+
|
|
249
|
+
# Multiple attachments
|
|
250
|
+
3ns chats send "Compare these" --attachment URL1 --attachment URL2
|
|
251
|
+
|
|
235
252
|
# List all conversations (most recent first)
|
|
236
253
|
3ns chats list
|
|
237
254
|
3ns chats list --json
|
|
@@ -240,22 +257,14 @@ Browse and manage your agent's conversation history.
|
|
|
240
257
|
3ns chats history CHAT_ID
|
|
241
258
|
3ns chats history CHAT_ID --json
|
|
242
259
|
|
|
243
|
-
# Send a message to start or continue a conversation
|
|
244
|
-
3ns chats send --folder FOLDER_ID "What can you help me with?"
|
|
245
|
-
3ns chats send --folder FOLDER_ID "Tell me about cooking" --agent-type NORM
|
|
246
|
-
|
|
247
|
-
# Specify which AI model to use for this message
|
|
248
|
-
3ns chats send --folder FOLDER_ID "Summarise this document" --model openai/gpt-5.2
|
|
249
|
-
3ns chats send --folder FOLDER_ID "Write a poem" --model anthropic/claude-4-opus
|
|
250
|
-
|
|
251
260
|
# Delete a chat and all its messages
|
|
252
261
|
3ns chats delete CHAT_ID
|
|
253
262
|
```
|
|
254
263
|
|
|
255
|
-
Agent types: `NORM` (standard), `AMPS` (amplified), `CUST` (custom).
|
|
256
|
-
|
|
257
264
|
Use `--model` to override the default model for a single message. Run `3ns models` to see all valid model names. Ollama models are also supported with `ollamadynamic/MODEL_NAME`.
|
|
258
265
|
|
|
266
|
+
**Attachment workflow:** Upload the file first with `3ns files upload`, then pass the returned URL via `--attachment`. The MIME type is auto-detected from the file extension. Supported: jpg, png, gif, webp, svg, pdf, mp3, wav, mp4.
|
|
267
|
+
|
|
259
268
|
---
|
|
260
269
|
|
|
261
270
|
### `3ns files` -- File Management
|
|
@@ -368,7 +377,7 @@ The CLI provides complete parity with the 3NS web dashboard. Everything you can
|
|
|
368
377
|
| Config folders | `3ns config folders` | `/openclaw/config/folders` | GET |
|
|
369
378
|
| Config documents | `3ns config read/write` | `/openclaw/config/documents` | GET / PUT / POST |
|
|
370
379
|
| Available AI models | `3ns models` | `/openclaw/models` | GET |
|
|
371
|
-
| Chat
|
|
380
|
+
| Chat (send + AI reply) | `3ns chats send` | `/openclaw/chats` | GET / POST / DELETE |
|
|
372
381
|
| File management | `3ns files` | `/openclaw/files` | GET / POST / DELETE |
|
|
373
382
|
| Agent search | `3ns agents search` | `/openclaw/agents/search` | GET |
|
|
374
383
|
| Agent card | `3ns agents card` | `/openclaw/agents/:id/card` | GET |
|
package/SKILL.md
CHANGED
|
@@ -76,18 +76,25 @@ These Markdown files define your agent's personality, knowledge, capabilities, a
|
|
|
76
76
|
3ns models --json # Machine-readable output
|
|
77
77
|
```
|
|
78
78
|
|
|
79
|
-
## Chat
|
|
79
|
+
## Chat (Send a Message, Get an AI Response)
|
|
80
80
|
|
|
81
81
|
```bash
|
|
82
|
-
3ns chats
|
|
83
|
-
3ns chats
|
|
84
|
-
3ns chats send
|
|
85
|
-
3ns chats send
|
|
86
|
-
3ns chats
|
|
82
|
+
3ns chats send "message" # Send message, get AI response (folder auto-detected)
|
|
83
|
+
3ns chats send "message" --model openai/gpt-5.2 # Use a specific model
|
|
84
|
+
3ns chats send "follow-up question" --chat-id CHAT_ID # Continue an existing conversation
|
|
85
|
+
3ns chats send "describe this" --attachment https://... # Send with an image/file attachment
|
|
86
|
+
3ns chats list [--json] # List conversations
|
|
87
|
+
3ns chats history CHAT_ID [--json] # View messages
|
|
88
|
+
3ns chats delete CHAT_ID # Delete a conversation
|
|
87
89
|
```
|
|
88
90
|
|
|
89
91
|
Use `--model` to override the default AI model for a single message. Run `3ns models` to see valid names. Ollama models: `ollamadynamic/MODEL_NAME`.
|
|
90
92
|
|
|
93
|
+
**Sending images/files with a chat message:**
|
|
94
|
+
1. Upload the file first: `3ns files upload ./photo.jpg --folder FOLDER_ID` — note the returned URL.
|
|
95
|
+
2. Pass the URL via `--attachment`: `3ns chats send "What's in this image?" --attachment FILE_URL`
|
|
96
|
+
3. Multiple attachments: `3ns chats send "Compare these" --attachment URL1 --attachment URL2`
|
|
97
|
+
|
|
91
98
|
## File Management
|
|
92
99
|
|
|
93
100
|
```bash
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chats.d.ts","sourceRoot":"","sources":["../../src/commands/chats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"chats.d.ts","sourceRoot":"","sources":["../../src/commands/chats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAmF5D"}
|
package/dist/commands/chats.js
CHANGED
|
@@ -41,25 +41,41 @@ function registerChatsCommands(program) {
|
|
|
41
41
|
});
|
|
42
42
|
chats
|
|
43
43
|
.command("send")
|
|
44
|
-
.description("Send a message
|
|
45
|
-
.requiredOption("--folder <id>", "Folder ID for the chat")
|
|
44
|
+
.description("Send a message and get an AI response")
|
|
46
45
|
.argument("<message>", "Message text")
|
|
47
|
-
.option("--
|
|
46
|
+
.option("--folder <id>", "Folder ID for the chat (auto-detected if omitted)")
|
|
47
|
+
.option("--chat-id <id>", "Existing chat ID to continue a conversation")
|
|
48
48
|
.option("--model <model>", "AI model to use (e.g. openai/gpt-5.2). Run '3ns models' to see options.")
|
|
49
|
+
.option("--attachment <url...>", "File URL(s) to attach (upload first via '3ns files upload')")
|
|
49
50
|
.action(async (message, opts) => {
|
|
50
|
-
const body = {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
const body = { message };
|
|
52
|
+
if (opts.folder)
|
|
53
|
+
body.folderId = opts.folder;
|
|
54
|
+
if (opts.chatId)
|
|
55
|
+
body.chatId = opts.chatId;
|
|
55
56
|
if (opts.model)
|
|
56
57
|
body.model = opts.model;
|
|
58
|
+
if (opts.attachment && opts.attachment.length > 0) {
|
|
59
|
+
body.attachments = opts.attachment.map((url) => {
|
|
60
|
+
const ext = url.split(".").pop()?.split("?")[0]?.toLowerCase() || "";
|
|
61
|
+
const mimeMap = {
|
|
62
|
+
png: "image/png", jpg: "image/jpeg", jpeg: "image/jpeg", gif: "image/gif",
|
|
63
|
+
webp: "image/webp", svg: "image/svg+xml", pdf: "application/pdf",
|
|
64
|
+
mp3: "audio/mpeg", wav: "audio/wav", mp4: "video/mp4",
|
|
65
|
+
};
|
|
66
|
+
return { url, mimeType: mimeMap[ext] || "application/octet-stream" };
|
|
67
|
+
});
|
|
68
|
+
}
|
|
57
69
|
const { data } = await (0, apiClient_1.api)("POST", "/chats", body);
|
|
58
|
-
|
|
70
|
+
if (data.response) {
|
|
71
|
+
console.log(`\n[Agent] ${data.response}\n`);
|
|
72
|
+
console.log(`Chat ID: ${data.chatId} (use --chat-id ${data.chatId} to continue)`);
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
console.log(`Message sent to chat ${data.chatId}`);
|
|
76
|
+
}
|
|
59
77
|
if (data.model)
|
|
60
78
|
console.log(`Model: ${data.model}`);
|
|
61
|
-
if (data.note)
|
|
62
|
-
console.log(data.note);
|
|
63
79
|
});
|
|
64
80
|
chats
|
|
65
81
|
.command("delete")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chats.js","sourceRoot":"","sources":["../../src/commands/chats.ts"],"names":[],"mappings":";;AAGA,
|
|
1
|
+
{"version":3,"file":"chats.js","sourceRoot":"","sources":["../../src/commands/chats.ts"],"names":[],"mappings":";;AAGA,sDAmFC;AArFD,4CAA0D;AAE1D,SAAgB,qBAAqB,CAAC,OAAgB;IACpD,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,2BAA2B,CAAC,CAAC;IAEhF,KAAK;SACF,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,qBAAqB,CAAC;SAClC,MAAM,CAAC,QAAQ,EAAE,gBAAgB,CAAC;SAClC,MAAM,CAAC,KAAK,EAAE,IAAwB,EAAE,EAAE;QACzC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAA,eAAG,EAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QAC5C,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;YACd,IAAA,qBAAS,EAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACxB,CAAC;aAAM,CAA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;IACpF,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -16,7 +16,7 @@ const program = new commander_1.Command();
|
|
|
16
16
|
program
|
|
17
17
|
.name("3ns")
|
|
18
18
|
.description("Control your 3NS agent domain from the command line")
|
|
19
|
-
.version("1.2.
|
|
19
|
+
.version("1.2.2");
|
|
20
20
|
(0, auth_1.registerAuthCommands)(program);
|
|
21
21
|
(0, links_1.registerLinksCommands)(program);
|
|
22
22
|
(0, config_1.registerConfigCommands)(program);
|