@3ns/cli 1.2.1 → 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 +8 -3
- package/SKILL.md +5 -3
- package/dist/commands/chats.d.ts.map +1 -1
- package/dist/commands/chats.js +12 -0
- package/dist/commands/chats.js.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -242,6 +242,13 @@ Send a message and get an AI response. The chat folder is auto-detected so you c
|
|
|
242
242
|
# Continue an existing conversation
|
|
243
243
|
3ns chats send "Tell me more about that" --chat-id 1743435000000
|
|
244
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
|
+
|
|
245
252
|
# List all conversations (most recent first)
|
|
246
253
|
3ns chats list
|
|
247
254
|
3ns chats list --json
|
|
@@ -256,9 +263,7 @@ Send a message and get an AI response. The chat folder is auto-detected so you c
|
|
|
256
263
|
|
|
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
|
|
|
259
|
-
**
|
|
260
|
-
1. Upload the file first: `3ns files upload ./photo.jpg --folder FOLDER_ID`
|
|
261
|
-
2. Use the returned URL in the raw API: `POST /openclaw/chats` with `"attachments": [{"url": "FILE_URL", "mimeType": "image/jpeg"}]`
|
|
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.
|
|
262
267
|
|
|
263
268
|
---
|
|
264
269
|
|
package/SKILL.md
CHANGED
|
@@ -82,6 +82,7 @@ These Markdown files define your agent's personality, knowledge, capabilities, a
|
|
|
82
82
|
3ns chats send "message" # Send message, get AI response (folder auto-detected)
|
|
83
83
|
3ns chats send "message" --model openai/gpt-5.2 # Use a specific model
|
|
84
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
|
|
85
86
|
3ns chats list [--json] # List conversations
|
|
86
87
|
3ns chats history CHAT_ID [--json] # View messages
|
|
87
88
|
3ns chats delete CHAT_ID # Delete a conversation
|
|
@@ -89,9 +90,10 @@ These Markdown files define your agent's personality, knowledge, capabilities, a
|
|
|
89
90
|
|
|
90
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`.
|
|
91
92
|
|
|
92
|
-
**Sending images/files with a chat message
|
|
93
|
-
1. Upload the file first: `3ns files upload ./photo.jpg --folder FOLDER_ID`
|
|
94
|
-
2.
|
|
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`
|
|
95
97
|
|
|
96
98
|
## File Management
|
|
97
99
|
|
|
@@ -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
|
@@ -46,6 +46,7 @@ function registerChatsCommands(program) {
|
|
|
46
46
|
.option("--folder <id>", "Folder ID for the chat (auto-detected if omitted)")
|
|
47
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
51
|
const body = { message };
|
|
51
52
|
if (opts.folder)
|
|
@@ -54,6 +55,17 @@ function registerChatsCommands(program) {
|
|
|
54
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) {
|
|
59
71
|
console.log(`\n[Agent] ${data.response}\n`);
|
|
@@ -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"],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AC,GAAG,CAAC,wBAAwB,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;QACrD,CAAC;QACD,IAAI,IAAI,CAAC,KAAK;YAAE,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;IAEL,KAAK;SACF,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,oCAAoC,CAAC;SACjD,QAAQ,CAAC,WAAW,EAAE,iBAAiB,CAAC;SACxC,MAAM,CAAC,KAAK,EAAE,MAAc,EAAE,EAAE;QAC/B,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAA,eAAG,EAAC,QAAQ,EAAE,UAAU,MAAM,EAAE,CAAC,CAAC;QACzD,OAAO,CAAC,GAAG,CAAC,QAAQ,MAAM,aAAa,IAAI,CAAC,eAAe,qBAAqB,CAAC,CAAC;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);
|