@heyamiko/amiko-cli 0.9.6-beta.0 → 0.9.6-beta.1
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/dist/index.js +3 -15
- package/package.json +1 -1
- package/skills/SKILL.md +1 -1
package/dist/index.js
CHANGED
|
@@ -21918,29 +21918,17 @@ function registerConversationCommand(program2) {
|
|
|
21918
21918
|
});
|
|
21919
21919
|
program2.command("send").description("Send a message into a conversation").requiredOption("--id <conversationId>", "Target conversation id").requiredOption("--message <text>", "Message body").option("--reply-to <messageId>", "Reply to a specific message").option("--json", "Output as JSON").action(async (opts) => {
|
|
21920
21920
|
const auth = requireAuth();
|
|
21921
|
-
const config2 = loadConfig();
|
|
21922
21921
|
const spinner = opts.json ? null : ora("Sending message...").start();
|
|
21923
21922
|
try {
|
|
21924
|
-
const
|
|
21925
|
-
const res = await fetch(url2, {
|
|
21923
|
+
const data = await amikoWebFetch(auth, `/api/conversations/${encodeURIComponent(opts.id)}/messages`, {
|
|
21926
21924
|
method: "POST",
|
|
21927
|
-
|
|
21928
|
-
Authorization: `Bearer ${auth.twinToken}`,
|
|
21929
|
-
"Content-Type": "application/json"
|
|
21930
|
-
},
|
|
21931
|
-
body: JSON.stringify({
|
|
21932
|
-
conversationId: opts.id,
|
|
21925
|
+
body: {
|
|
21933
21926
|
content: opts.message,
|
|
21934
21927
|
message_type: "text",
|
|
21935
21928
|
...opts.replyTo ? { reply_to_id: opts.replyTo } : {}
|
|
21936
|
-
}
|
|
21929
|
+
}
|
|
21937
21930
|
});
|
|
21938
21931
|
spinner?.stop();
|
|
21939
|
-
if (!res.ok) {
|
|
21940
|
-
const text = await res.text().catch(() => "");
|
|
21941
|
-
throw new Error(`${res.status} POST /messages: ${text.slice(0, 300)}`);
|
|
21942
|
-
}
|
|
21943
|
-
const data = await res.json();
|
|
21944
21932
|
if (opts.json) {
|
|
21945
21933
|
console.log(JSON.stringify(data, null, 2));
|
|
21946
21934
|
return;
|
package/package.json
CHANGED
package/skills/SKILL.md
CHANGED
|
@@ -277,7 +277,7 @@ amiko conversation send --id <id> --message "ok" --reply-to <messageId>
|
|
|
277
277
|
- `list` and `find` query amiko-web's `/api/conversations` (Prisma-backed). `find` filters client-side for a 2-user direct conversation containing both you and `--user-id`.
|
|
278
278
|
- `create` POSTs to `/api/conversations` with `conversation_type=direct`. The server reuses an existing conversation if one already exists between the two users (`reused_existing: true` in the JSON response), so calling it repeatedly is safe.
|
|
279
279
|
- `read` queries amiko-web's `GET /api/conversations/<id>/messages` (paginated by `next_cursor`, oldest-first per page).
|
|
280
|
-
- `send` posts to amiko-
|
|
280
|
+
- `send` posts to amiko-web's `POST /api/conversations/<id>/messages` with the Clawd twin token. The server persists the message and fans it out to other participants via the WebSocket broadcast.
|
|
281
281
|
- `--user-id` expects the **internal** user id (the one returned by `amiko users search`), not a Privy DID or handle.
|
|
282
282
|
|
|
283
283
|
## Composio
|