@gobi-ai/cli 2.0.1 → 2.0.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.
@@ -4,12 +4,12 @@
4
4
  "name": "gobi-ai"
5
5
  },
6
6
  "description": "Claude Code plugin for the Gobi collaborative knowledge platform CLI",
7
- "version": "2.0.1",
7
+ "version": "2.0.2",
8
8
  "plugins": [
9
9
  {
10
10
  "name": "gobi",
11
11
  "description": "Manage the Gobi collaborative knowledge platform from the command line. Publish vault profiles, create posts and replies, manage saved notes and posts, manage sessions, generate images and videos.",
12
- "version": "2.0.1",
12
+ "version": "2.0.2",
13
13
  "author": {
14
14
  "name": "gobi-ai"
15
15
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "gobi",
3
3
  "description": "Manage the Gobi collaborative knowledge platform from the command line",
4
- "version": "2.0.1",
4
+ "version": "2.0.2",
5
5
  "author": {
6
6
  "name": "gobi-ai"
7
7
  },
package/README.md CHANGED
@@ -238,19 +238,21 @@ Times are ISO 8601 UTC (e.g. `2026-03-20T00:00:00Z`).
238
238
 
239
239
  ### Drafts
240
240
 
241
- A *draft* is a unit of standing guidance authored by an agent. Each draft carries 0–3 AI-suggested action labels the user picks from. The top 5 pending drafts (lowest priority first) are injected into the agent's system prompt every turn — drafts turn agent suggestions into running context.
241
+ A *draft* is a unit of standing guidance authored by an agent. Each draft carries 0–3 AI-suggested actions the user picks from. The top 5 pending drafts (lowest priority first) are injected into the agent's system prompt every turn — drafts turn agent suggestions into running context.
242
242
 
243
243
  When invoked from inside an agent run, the runtime exports `GOBI_SESSION_ID` so `gobi draft add` picks it up automatically; otherwise pass `--session <uuid>`.
244
244
 
245
+ Each action is `{ label, message? }`: `label` is the short button text (1–80 chars) the user sees; `message` (optional, ≤2000 chars) is what the user is taken to be saying to the agent on click. When `message` is omitted, the client falls back to `label`. From the CLI, pass an action as `--action "Label::Message"` — the literal `::` separates the two. Without `::`, the whole value is the label.
246
+
245
247
  | Command | Description |
246
248
  |---------|-------------|
247
249
  | `gobi draft list [--limit N]` | List drafts (priority ASC, then newest first) |
248
250
  | `gobi draft get <id>` | Show one draft with its history and suggested actions |
249
- | `gobi draft add <title> <content> [--session <id>] [--priority N] [--action <label>]…` | Add a draft. Pass `--action` up to 3 times. `--session` falls back to `$GOBI_SESSION_ID`. Use `-` for content to read from stdin. |
251
+ | `gobi draft add <title> <content> [--session <id>] [--priority N] [--action <label[::message]>]…` | Add a draft. Pass `--action` up to 3 times; each action is `Label` or `Label::Message`. `--session` falls back to `$GOBI_SESSION_ID`. Use `-` for content to read from stdin. |
250
252
  | `gobi draft delete <id>` | Delete a draft |
251
253
  | `gobi draft prioritize <id> <priority>` | Set priority (lower = higher) |
252
- | `gobi draft action <id> <index>` | Take one of the draft's suggested actions by 0-based index. Marks `actioned` and posts the synthesized message into the originating session. |
253
- | `gobi draft revise <id> <comment> [--title <t>] [--content <c>] [--action <label>]…` | Bump revision with a comment; optionally replace title / content / actions in the same call |
254
+ | `gobi draft action <id> <index>` | Take one of the draft's suggested actions by 0-based index. Marks `actioned` and posts the action's `message` (or `label`, if no message) into the originating session. |
255
+ | `gobi draft revise <id> <comment> [--title <t>] [--content <c>] [--action <label[::message]>]…` | Bump revision with a comment; optionally replace title / content / actions in the same call |
254
256
 
255
257
  ### Media generation
256
258
 
@@ -16,7 +16,15 @@ function parseActionFlags(values) {
16
16
  .map((v) => v.trim())
17
17
  .filter(Boolean)
18
18
  .slice(0, 3)
19
- .map((label) => ({ label }));
19
+ .map((entry) => {
20
+ const sep = entry.indexOf("::");
21
+ if (sep === -1)
22
+ return { label: entry };
23
+ const label = entry.slice(0, sep).trim();
24
+ const message = entry.slice(sep + 2).trim();
25
+ return message ? { label, message } : { label };
26
+ })
27
+ .filter((a) => a.label.length > 0);
20
28
  }
21
29
  function formatDraftLine(d) {
22
30
  const status = d.status === "pending" ? "·" : "✓";
@@ -76,7 +84,11 @@ export function registerDraftCommand(program) {
76
84
  if (d.actions.length) {
77
85
  console.log("");
78
86
  console.log("Suggested actions:");
79
- d.actions.forEach((a, i) => console.log(` [${i}] ${a.label}`));
87
+ d.actions.forEach((a, i) => {
88
+ console.log(` [${i}] ${a.label}`);
89
+ if (a.message)
90
+ console.log(` → ${a.message}`);
91
+ });
80
92
  }
81
93
  if (d.history.length) {
82
94
  console.log("");
@@ -90,7 +102,9 @@ export function registerDraftCommand(program) {
90
102
  console.log(` content: ${snippet(h.content, 200)}`);
91
103
  }
92
104
  if (h.actions !== undefined && h.actions.length) {
93
- console.log(` actions: ${h.actions.map((a) => a.label).join(" | ")}`);
105
+ console.log(` actions: ${h.actions
106
+ .map((a) => (a.message ? `${a.label} :: ${a.message}` : a.label))
107
+ .join(" | ")}`);
94
108
  }
95
109
  if (h.comment !== undefined)
96
110
  console.log(` comment: ${h.comment}`);
@@ -110,7 +124,7 @@ export function registerDraftCommand(program) {
110
124
  .description("Add a draft. Pass '-' for content to read from stdin. Pass --action up to 3 times to attach AI-suggested actions. Requires a chat session — the agent runtime exports GOBI_SESSION_ID automatically; outside that, pass --session.")
111
125
  .option("--session <sessionId>", "Originating chat session UUID. Falls back to $GOBI_SESSION_ID when set.")
112
126
  .option("--priority <number>", "Priority (lower = higher), default 100")
113
- .option("--action <label>", "Suggested action label (repeatable, max 3). Each label is what the user sees on the button.", (value, prev = []) => [...prev, value], [])
127
+ .option("--action <label[::message]>", "Suggested action (repeatable, max 3). `label` is the button text; an optional `::message` suffix is what the user is taken to be saying to the agent on click. Without the suffix, the message falls back to the label.", (value, prev = []) => [...prev, value], [])
114
128
  .action(async (title, content, opts) => {
115
129
  const sessionId = opts.session || process.env.GOBI_SESSION_ID || "";
116
130
  if (!sessionId) {
@@ -189,7 +203,7 @@ export function registerDraftCommand(program) {
189
203
  .description("Bump the draft to a new revision. Comment is required. Pass --title, --content, and/or --action to update the draft in the same call (--action repeatable, max 3, replaces all). Pass '-' for any of comment/title/content to read from stdin.")
190
204
  .option("--title <title>", "Replacement title")
191
205
  .option("--content <content>", "Replacement content; pass '-' to read from stdin")
192
- .option("--action <label>", "Replacement suggested action label (repeatable, max 3). When passed, replaces the entire actions array.", (value, prev = []) => [...prev, value], [])
206
+ .option("--action <label[::message]>", "Replacement suggested action (repeatable, max 3). Same `label[::message]` syntax as `draft add`. When passed, replaces the entire actions array.", (value, prev = []) => [...prev, value], [])
193
207
  .action(async (draftId, comment, opts) => {
194
208
  const body = {
195
209
  comment: readContent(comment),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gobi-ai/cli",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "CLI client for the Gobi collaborative knowledge platform",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -25,7 +25,9 @@ A draft is a unit of standing guidance authored by an agent (in-process during c
25
25
 
26
26
  - **title** — short headline (1–200 chars)
27
27
  - **content** — the draft text (markdown, 1–8000 chars)
28
- - **actions** — 0–3 AI-suggested action labels the user can pick from (e.g. "Accept", "Reject", "Schedule for later"). The agent generates these when authoring the draft.
28
+ - **actions** — 0–3 AI-suggested actions. Each action is `{ label, message? }`:
29
+ - `label` — short button text (1–80 chars) the user sees, e.g. `"Apply"`, `"Skip"`.
30
+ - `message` — optional (≤2000 chars). What the user is taken to be saying to the agent when they click that button. Falls back to `label` when omitted. Use this whenever the click should send something more specific than the button text — e.g. label `"Punch it up"`, message `"Tighten the opening paragraph and shorten the CTA"`.
29
31
  - **sessionId** — required; the chat session that produced the draft
30
32
  - **priority** — lower number = higher priority; default `100`
31
33
  - **status** — `pending` until the user picks an action, then `actioned`
@@ -52,18 +54,32 @@ For programmatic/agent usage, always pass `--json` as a **global** option (befor
52
54
 
53
55
  ```bash
54
56
  gobi --json draft list --limit 20
55
- gobi --json draft add "Concise titles" "Prefer concise titles for personal posts." --action "Apply" --action "Skip" --priority 50
57
+ gobi --json draft add "Concise titles" "Prefer concise titles for personal posts." \
58
+ --action "Apply::Yes, rewrite my last three posts with concise titles." \
59
+ --action "Skip" \
60
+ --priority 50
56
61
  gobi --json draft action <draftId> 0
57
62
  ```
58
63
 
59
64
  JSON mode wraps the response as `{"success": true, "data": <draft>}` (or `{"success": false, "error": "..."}`).
60
65
 
66
+ ## Action `label::message` syntax
67
+
68
+ The `--action` flag (on both `add` and `revise`) accepts either form:
69
+
70
+ - `--action "Apply"` — label only; message falls back to `"Apply"` on click.
71
+ - `--action "Apply::Yes, rewrite my last three posts with concise titles."` — label is `Apply`, the click sends the full sentence as the user's next turn into the originating chat session.
72
+
73
+ The literal `::` separator splits the two. Use `message` whenever the click should send something more specific than the button text — that's the whole point of the field. Keep `label` punchy (a few words); put the actual instruction in `message`.
74
+
75
+ When the user picks an action via `gobi draft action <id> <index>`, the response includes the picked action's `message` (or `label` as fallback) in `data.actions[index]`, which the client then posts into the originating session.
76
+
61
77
  ## Available Commands
62
78
 
63
79
  - `gobi draft` — Drafts authored by your agent during chat. Each carries up to 3 AI-suggested actions. Top-5 pending feed the system prompt; picking an action posts a synthesized message into the originating session.
64
80
  - `gobi draft list` — List drafts (priority ASC, then newest first).
65
81
  - `gobi draft get` — Show one draft with its history and suggested actions.
66
- - `gobi draft add` — Add a draft. Pass `--action <label>` up to 3 times to attach AI-suggested actions.
82
+ - `gobi draft add` — Add a draft. Pass `--action <label[::message]>` up to 3 times to attach AI-suggested actions.
67
83
  - `gobi draft delete` — Delete a draft.
68
84
  - `gobi draft prioritize` — Set priority (lower = higher). Top 5 feed the system prompt.
69
85
  - `gobi draft action` — Take one of the draft's suggested actions by 0-based index. Posts the synthesized message into the originating session.
@@ -54,10 +54,11 @@ Add a draft. Pass '-' for content to read from stdin. Pass --action up to 3 time
54
54
  outside that, pass --session.
55
55
 
56
56
  Options:
57
- --session <sessionId> Originating chat session UUID. Falls back to $GOBI_SESSION_ID when set.
58
- --priority <number> Priority (lower = higher), default 100
59
- --action <label> Suggested action label (repeatable, max 3). Each label is what the user sees on the button. (default: [])
60
- -h, --help display help for command
57
+ --session <sessionId> Originating chat session UUID. Falls back to $GOBI_SESSION_ID when set.
58
+ --priority <number> Priority (lower = higher), default 100
59
+ --action <label[::message]> Suggested action (repeatable, max 3). `label` is the button text; an optional `::message` suffix is what the user is taken to be saying to the agent on click. Without
60
+ the suffix, the message falls back to the label. (default: [])
61
+ -h, --help display help for command
61
62
  ```
62
63
 
63
64
  ## delete
@@ -102,8 +103,8 @@ Bump the draft to a new revision. Comment is required. Pass --title, --content,
102
103
  comment/title/content to read from stdin.
103
104
 
104
105
  Options:
105
- --title <title> Replacement title
106
- --content <content> Replacement content; pass '-' to read from stdin
107
- --action <label> Replacement suggested action label (repeatable, max 3). When passed, replaces the entire actions array. (default: [])
108
- -h, --help display help for command
106
+ --title <title> Replacement title
107
+ --content <content> Replacement content; pass '-' to read from stdin
108
+ --action <label[::message]> Replacement suggested action (repeatable, max 3). Same `label[::message]` syntax as `draft add`. When passed, replaces the entire actions array. (default: [])
109
+ -h, --help display help for command
109
110
  ```