@gobi-ai/cli 0.9.11 → 0.9.13
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": "0.9.
|
|
7
|
+
"version": "0.9.13",
|
|
8
8
|
"plugins": [
|
|
9
9
|
{
|
|
10
10
|
"name": "gobi",
|
|
11
11
|
"description": "Manage the Gobi collaborative knowledge platform from the command line. Search and ask brains, publish brain documents, create threads, manage sessions, generate images and videos.",
|
|
12
|
-
"version": "0.9.
|
|
12
|
+
"version": "0.9.13",
|
|
13
13
|
"author": {
|
|
14
14
|
"name": "gobi-ai"
|
|
15
15
|
},
|
package/dist/commands/brain.js
CHANGED
|
@@ -259,4 +259,89 @@ export function registerBrainCommand(program) {
|
|
|
259
259
|
}
|
|
260
260
|
console.log(`Brain update ${updateId} deleted.`);
|
|
261
261
|
});
|
|
262
|
+
// ── Update Replies (get-update, reply-to-update, edit-update-reply, delete-update-reply) ──
|
|
263
|
+
brain
|
|
264
|
+
.command("get-update <updateId>")
|
|
265
|
+
.description("Get a brain update and its replies (paginated).")
|
|
266
|
+
.option("--limit <number>", "Replies per page", "20")
|
|
267
|
+
.option("--cursor <string>", "Pagination cursor from previous response")
|
|
268
|
+
.option("--full", "Show full reply content without truncation")
|
|
269
|
+
.action(async (updateId, opts) => {
|
|
270
|
+
const params = {
|
|
271
|
+
limit: parseInt(opts.limit, 10),
|
|
272
|
+
};
|
|
273
|
+
if (opts.cursor)
|
|
274
|
+
params.cursor = opts.cursor;
|
|
275
|
+
const resp = (await apiGet(`/brain-updates/${updateId}`, params));
|
|
276
|
+
const data = unwrapResp(resp);
|
|
277
|
+
const pagination = (resp.pagination || {});
|
|
278
|
+
if (isJsonMode(brain)) {
|
|
279
|
+
jsonOut({ ...data, pagination });
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
const update = (data.update || data);
|
|
283
|
+
const replies = (data.replies || []);
|
|
284
|
+
const author = update.author?.name ||
|
|
285
|
+
`User ${update.authorId}`;
|
|
286
|
+
const vault = update.vault?.vaultSlug || "?";
|
|
287
|
+
const replyLines = [];
|
|
288
|
+
for (const r of replies) {
|
|
289
|
+
const rAuthor = r.author?.name ||
|
|
290
|
+
`User ${r.authorId}`;
|
|
291
|
+
const text = r.content;
|
|
292
|
+
const truncated = opts.full || text.length <= 200 ? text : text.slice(0, 200) + "\u2026";
|
|
293
|
+
replyLines.push(` - ${rAuthor}: ${truncated} (${r.createdAt})`);
|
|
294
|
+
}
|
|
295
|
+
const output = [
|
|
296
|
+
`Brain Update: ${update.title || "(no title)"}`,
|
|
297
|
+
`By: ${author} (vault: ${vault}) on ${update.createdAt}`,
|
|
298
|
+
"",
|
|
299
|
+
update.content,
|
|
300
|
+
"",
|
|
301
|
+
`Replies (${replies.length} items):`,
|
|
302
|
+
...replyLines,
|
|
303
|
+
...(pagination.hasMore
|
|
304
|
+
? [` Next cursor: ${pagination.nextCursor}`]
|
|
305
|
+
: []),
|
|
306
|
+
].join("\n");
|
|
307
|
+
console.log(output);
|
|
308
|
+
});
|
|
309
|
+
brain
|
|
310
|
+
.command("reply-to-update <updateId>")
|
|
311
|
+
.description("Reply to a brain update.")
|
|
312
|
+
.requiredOption("--content <content>", 'Reply content (markdown supported, use "-" for stdin)')
|
|
313
|
+
.action(async (updateId, opts) => {
|
|
314
|
+
const content = opts.content === "-" ? readFileSync("/dev/stdin", "utf8") : opts.content;
|
|
315
|
+
const resp = (await apiPost(`/brain-updates/${updateId}/replies`, { content }));
|
|
316
|
+
const reply = unwrapResp(resp);
|
|
317
|
+
if (isJsonMode(brain)) {
|
|
318
|
+
jsonOut(reply);
|
|
319
|
+
return;
|
|
320
|
+
}
|
|
321
|
+
console.log(`Reply created!\n ID: ${reply.id}\n Created: ${reply.createdAt}`);
|
|
322
|
+
});
|
|
323
|
+
brain
|
|
324
|
+
.command("edit-update-reply <replyId>")
|
|
325
|
+
.description("Edit a brain update reply. You must be the author.")
|
|
326
|
+
.requiredOption("--content <content>", "New content for the reply (markdown supported)")
|
|
327
|
+
.action(async (replyId, opts) => {
|
|
328
|
+
const resp = (await apiPatch(`/brain-updates/replies/${replyId}`, { content: opts.content }));
|
|
329
|
+
const reply = unwrapResp(resp);
|
|
330
|
+
if (isJsonMode(brain)) {
|
|
331
|
+
jsonOut(reply);
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
334
|
+
console.log(`Reply edited!\n ID: ${reply.id}\n Edited: ${reply.editedAt}`);
|
|
335
|
+
});
|
|
336
|
+
brain
|
|
337
|
+
.command("delete-update-reply <replyId>")
|
|
338
|
+
.description("Delete a brain update reply. You must be the author.")
|
|
339
|
+
.action(async (replyId) => {
|
|
340
|
+
await apiDelete(`/brain-updates/replies/${replyId}`);
|
|
341
|
+
if (isJsonMode(brain)) {
|
|
342
|
+
jsonOut({ replyId });
|
|
343
|
+
return;
|
|
344
|
+
}
|
|
345
|
+
console.log(`Brain update reply ${replyId} deleted.`);
|
|
346
|
+
});
|
|
262
347
|
}
|
package/package.json
CHANGED
|
@@ -51,6 +51,63 @@ gobi --json brain search --query "machine learning"
|
|
|
51
51
|
- `gobi brain edit-update` — Edit a published brain update. You must be the author.
|
|
52
52
|
- `gobi brain delete-update` — Delete a published brain update. You must be the author.
|
|
53
53
|
|
|
54
|
+
## BRAIN.md Frontmatter Reference
|
|
55
|
+
|
|
56
|
+
`BRAIN.md` is the metadata file at the root of every vault. Its YAML frontmatter controls the vault's public profile, homepage, and AI agent behavior. Example:
|
|
57
|
+
|
|
58
|
+
```yaml
|
|
59
|
+
---
|
|
60
|
+
title: My Brain
|
|
61
|
+
tags:
|
|
62
|
+
- topic1
|
|
63
|
+
- topic2
|
|
64
|
+
description: A short description of what this brain is about.
|
|
65
|
+
thumbnail: "[[BRAIN.png]]"
|
|
66
|
+
homepage: "[[app/home.html?nav=false]]"
|
|
67
|
+
prompt: "[[system-prompt.md]]"
|
|
68
|
+
---
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Fields
|
|
72
|
+
|
|
73
|
+
- **`title`** (required) — Display name of the brain/vault.
|
|
74
|
+
- **`description`** (required for public listing) — Short description shown on the brain card and public profile. Without both `title` and `description`, the brain won't appear in the public catalog.
|
|
75
|
+
- **`tags`** — Tags for categorization and discovery. Supports YAML block list or inline array format:
|
|
76
|
+
```yaml
|
|
77
|
+
# Block list
|
|
78
|
+
tags:
|
|
79
|
+
- ambient ai
|
|
80
|
+
- wearables
|
|
81
|
+
|
|
82
|
+
# Inline array
|
|
83
|
+
tags: [ambient ai, wearables]
|
|
84
|
+
```
|
|
85
|
+
- **`thumbnail`** — Profile image for the brain card. Uses wiki-link syntax pointing to an image file in the vault (e.g. `"[[BRAIN.png]]"`).
|
|
86
|
+
- **`homepage`** — Custom HTML page to serve as the vault's public homepage at `gobispace.com/@{vaultSlug}`. Uses wiki-link syntax pointing to an HTML file in the vault. Supports a `nav` query parameter to control Gobi's sidebar navigation:
|
|
87
|
+
- `"[[app/home.html]]"` — Shows the Gobi sidebar alongside the homepage (default)
|
|
88
|
+
- `"[[app/home.html?nav=false]]"` — Full-screen, no Gobi sidebar/chrome
|
|
89
|
+
- **`prompt`** — Wiki-link to a custom system prompt file for the brain's AI agent (e.g. `"[[system-prompt.md]]"`).
|
|
90
|
+
|
|
91
|
+
> For details on building custom HTML homepages and using the `window.gobi` API, see the **gobi-homepage** skill.
|
|
92
|
+
|
|
93
|
+
## Publishing Workflow
|
|
94
|
+
|
|
95
|
+
After editing `BRAIN.md` frontmatter, follow these steps to make your changes live:
|
|
96
|
+
|
|
97
|
+
1. **Edit `BRAIN.md`** in the vault root with the desired frontmatter fields.
|
|
98
|
+
2. **Sync referenced files** — if the homepage HTML, thumbnail image, or prompt file is new or updated, upload them first:
|
|
99
|
+
```bash
|
|
100
|
+
gobi sync
|
|
101
|
+
```
|
|
102
|
+
3. **Publish the brain**:
|
|
103
|
+
```bash
|
|
104
|
+
gobi brain publish
|
|
105
|
+
```
|
|
106
|
+
This uploads `BRAIN.md` to webdrive, triggers post-processing that extracts metadata (title, description, tags, thumbnail, homepage path), updates the vault's public profile, and sends a Discord notification.
|
|
107
|
+
4. The vault is now live at `https://gobispace.com/@{vaultSlug}`.
|
|
108
|
+
|
|
109
|
+
> **Important:** Any time you change `BRAIN.md` frontmatter (e.g. adding or updating `homepage`), you must re-run `gobi brain publish` for the changes to take effect.
|
|
110
|
+
|
|
54
111
|
## Reference Documentation
|
|
55
112
|
|
|
56
113
|
- [gobi brain](references/brain.md)
|
|
@@ -6,19 +6,23 @@ Usage: gobi brain [options] [command]
|
|
|
6
6
|
Brain commands (search, ask, publish, unpublish, updates).
|
|
7
7
|
|
|
8
8
|
Options:
|
|
9
|
-
-h, --help
|
|
9
|
+
-h, --help display help for command
|
|
10
10
|
|
|
11
11
|
Commands:
|
|
12
|
-
search [options]
|
|
13
|
-
ask [options]
|
|
14
|
-
publish
|
|
15
|
-
unpublish
|
|
16
|
-
list-updates [options]
|
|
17
|
-
|
|
18
|
-
post-update [options]
|
|
19
|
-
edit-update [options] <updateId>
|
|
20
|
-
delete-update <updateId>
|
|
21
|
-
|
|
12
|
+
search [options] Search public brains by text and semantic similarity.
|
|
13
|
+
ask [options] Ask a brain a question. Creates a targeted session (1:1 conversation).
|
|
14
|
+
publish Upload BRAIN.md to the vault root on webdrive. Triggers post-processing (brain sync, metadata update, Discord notification).
|
|
15
|
+
unpublish Delete BRAIN.md from the vault on webdrive.
|
|
16
|
+
list-updates [options] List recent brain updates. Without --space-slug, lists all updates for you. With --space-slug, lists updates for that space. Use --mine to show only updates
|
|
17
|
+
by you.
|
|
18
|
+
post-update [options] Post a brain update for a vault.
|
|
19
|
+
edit-update [options] <updateId> Edit a published brain update. You must be the author.
|
|
20
|
+
delete-update <updateId> Delete a published brain update. You must be the author.
|
|
21
|
+
get-update [options] <updateId> Get a brain update and its replies (paginated).
|
|
22
|
+
reply-to-update [options] <updateId> Reply to a brain update.
|
|
23
|
+
edit-update-reply [options] <replyId> Edit a brain update reply. You must be the author.
|
|
24
|
+
delete-update-reply <replyId> Delete a brain update reply. You must be the author.
|
|
25
|
+
help [command] display help for command
|
|
22
26
|
```
|
|
23
27
|
|
|
24
28
|
## search
|
|
@@ -126,3 +130,52 @@ Delete a published brain update. You must be the author.
|
|
|
126
130
|
Options:
|
|
127
131
|
-h, --help display help for command
|
|
128
132
|
```
|
|
133
|
+
|
|
134
|
+
## get-update
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
Usage: gobi brain get-update [options] <updateId>
|
|
138
|
+
|
|
139
|
+
Get a brain update and its replies (paginated).
|
|
140
|
+
|
|
141
|
+
Options:
|
|
142
|
+
--limit <number> Replies per page (default: "20")
|
|
143
|
+
--cursor <string> Pagination cursor from previous response
|
|
144
|
+
--full Show full reply content without truncation
|
|
145
|
+
-h, --help display help for command
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## reply-to-update
|
|
149
|
+
|
|
150
|
+
```
|
|
151
|
+
Usage: gobi brain reply-to-update [options] <updateId>
|
|
152
|
+
|
|
153
|
+
Reply to a brain update.
|
|
154
|
+
|
|
155
|
+
Options:
|
|
156
|
+
--content <content> Reply content (markdown supported, use "-" for stdin)
|
|
157
|
+
-h, --help display help for command
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## edit-update-reply
|
|
161
|
+
|
|
162
|
+
```
|
|
163
|
+
Usage: gobi brain edit-update-reply [options] <replyId>
|
|
164
|
+
|
|
165
|
+
Edit a brain update reply. You must be the author.
|
|
166
|
+
|
|
167
|
+
Options:
|
|
168
|
+
--content <content> New content for the reply (markdown supported)
|
|
169
|
+
-h, --help display help for command
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
## delete-update-reply
|
|
173
|
+
|
|
174
|
+
```
|
|
175
|
+
Usage: gobi brain delete-update-reply [options] <replyId>
|
|
176
|
+
|
|
177
|
+
Delete a brain update reply. You must be the author.
|
|
178
|
+
|
|
179
|
+
Options:
|
|
180
|
+
-h, --help display help for command
|
|
181
|
+
```
|