sfora-cli 0.13.0 → 0.13.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.
@@ -573,7 +573,9 @@ export declare class SforaApiClient {
573
573
  /** `GET /api/rooms/:id/messages` — history, newest first (server cap: 100). */
574
574
  listRoomMessages(roomId: string, limit?: number): Promise<MessagesPage>;
575
575
  /** `POST /api/rooms/:id/messages` with `{ body }` — send markdown. */
576
- sendRoomMessage(roomId: string, body: string): Promise<{
576
+ sendRoomMessage(roomId: string, body: string,
577
+ /** Terminal client slug — stamped on the message ("sent via Claude Code"). */
578
+ client?: string): Promise<{
577
579
  messageId: string;
578
580
  }>;
579
581
  /**
@@ -631,10 +631,12 @@ export class SforaApiClient {
631
631
  return this.#json(`/api/rooms/${encodeURIComponent(roomId)}/messages?limit=${limit}`);
632
632
  }
633
633
  /** `POST /api/rooms/:id/messages` with `{ body }` — send markdown. */
634
- async sendRoomMessage(roomId, body) {
634
+ async sendRoomMessage(roomId, body,
635
+ /** Terminal client slug — stamped on the message ("sent via Claude Code"). */
636
+ client) {
635
637
  // Through #request like every other call, so network failures surface as
636
638
  // SforaApiError(0, "network_error") and `--as` rides the shared headers.
637
- const res = await this.#request("POST", `/api/rooms/${encodeURIComponent(roomId)}/messages`, JSON.stringify({ body }), undefined, "application/json");
639
+ const res = await this.#request("POST", `/api/rooms/${encodeURIComponent(roomId)}/messages`, JSON.stringify({ body, client }), undefined, "application/json");
638
640
  return this.#jsonFrom(res);
639
641
  }
640
642
  /**
package/dist/cli.js CHANGED
@@ -836,7 +836,7 @@ async function runChat(args, client) {
836
836
  throw new Error('usage: sfora chat <room> -m "text"');
837
837
  // One beat alongside the send — a script that speaks was here, briefly.
838
838
  void beat();
839
- const { messageId } = await client.sendRoomMessage(room._id, text);
839
+ const { messageId } = await client.sendRoomMessage(room._id, text, clientLabel);
840
840
  if (args.json) {
841
841
  console.log(JSON.stringify({ messageId, roomId: room._id }, null, 2));
842
842
  return;
@@ -927,7 +927,7 @@ async function runChat(args, client) {
927
927
  try {
928
928
  // The send's own echo is the typed line still on screen; recording the
929
929
  // id keeps the tail's refetch from printing it a second time.
930
- const { messageId } = await client.sendRoomMessage(room._id, line);
930
+ const { messageId } = await client.sendRoomMessage(room._id, line, clientLabel);
931
931
  seen.add(messageId);
932
932
  }
933
933
  catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sfora-cli",
3
- "version": "0.13.0",
3
+ "version": "0.13.1",
4
4
  "type": "module",
5
5
  "description": "Your sfora workspace as a markdown filesystem — a CLI + MCP server. Post/task/doc, ls/cat/grep, and a shell so agents operate sfora natively.",
6
6
  "keywords": [