@gobi-ai/cli 2.0.16 → 2.0.18
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.
|
|
7
|
+
"version": "2.0.18",
|
|
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.
|
|
12
|
+
"version": "2.0.18",
|
|
13
13
|
"author": {
|
|
14
14
|
"name": "gobi-ai"
|
|
15
15
|
},
|
package/dist/commands/global.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { WEB_BASE_URL } from "../constants.js";
|
|
1
2
|
import { apiGet, apiPost, apiPatch, apiDelete } from "../client.js";
|
|
2
3
|
import { fetchDraftSummary, isJsonMode, jsonOut, readStdin, resolveVaultSlug, unwrapResp, } from "./utils.js";
|
|
3
4
|
import { extractWikiLinks, uploadAttachments, uploadPostAttachments, assertPostAttachmentMix, } from "../attachments.js";
|
|
@@ -7,6 +8,16 @@ function readContent(value) {
|
|
|
7
8
|
return readStdin();
|
|
8
9
|
return value;
|
|
9
10
|
}
|
|
11
|
+
function buildPersonalPostUrl(post) {
|
|
12
|
+
const id = post.id;
|
|
13
|
+
const vaultSlug = post.vault?.vaultSlug ||
|
|
14
|
+
post.authorVault?.vaultSlug ||
|
|
15
|
+
post.authorVaultSlug ||
|
|
16
|
+
undefined;
|
|
17
|
+
return vaultSlug
|
|
18
|
+
? `${WEB_BASE_URL}/@${vaultSlug}?postId=${id}`
|
|
19
|
+
: `${WEB_BASE_URL}/posts/${id}`;
|
|
20
|
+
}
|
|
10
21
|
function formatFeedLine(m) {
|
|
11
22
|
const isReply = m.parentPostId != null ||
|
|
12
23
|
m.type === "post-reply";
|
|
@@ -250,14 +261,16 @@ export function registerGlobalCommand(program) {
|
|
|
250
261
|
console.error(`Warning: failed to link post to draft ${opts.draftId}: ${e.message}`);
|
|
251
262
|
}
|
|
252
263
|
}
|
|
264
|
+
const shareUrl = buildPersonalPostUrl(post);
|
|
253
265
|
if (isJsonMode(global)) {
|
|
254
|
-
jsonOut(post);
|
|
266
|
+
jsonOut({ ...post, shareUrl });
|
|
255
267
|
return;
|
|
256
268
|
}
|
|
257
269
|
console.log(`Post created!\n` +
|
|
258
270
|
` ID: ${post.id}\n` +
|
|
259
271
|
(post.title ? ` Title: ${post.title}\n` : "") +
|
|
260
|
-
` Created: ${post.createdAt}` +
|
|
272
|
+
` Created: ${post.createdAt}\n` +
|
|
273
|
+
` URL: ${shareUrl}` +
|
|
261
274
|
(opts.draftId ? `\n Linked to draft: ${opts.draftId}` : ""));
|
|
262
275
|
});
|
|
263
276
|
// ── Edit post ──
|
package/dist/commands/space.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { WEB_BASE_URL } from "../constants.js";
|
|
1
2
|
import { apiGet, apiPost, apiPatch, apiDelete } from "../client.js";
|
|
2
3
|
import { requireSpace, selectSpace, setSpaceRequirement, writeSpaceSetting, } from "./init.js";
|
|
3
4
|
import { fetchDraftSummary, isJsonMode, jsonOut, readStdin, resolveSpaceSlug, resolveVaultSlug, unwrapResp, } from "./utils.js";
|
|
@@ -386,14 +387,16 @@ export function registerSpaceCommand(program) {
|
|
|
386
387
|
console.error(`Warning: failed to link post to draft ${opts.draftId}: ${e.message}`);
|
|
387
388
|
}
|
|
388
389
|
}
|
|
390
|
+
const shareUrl = `${WEB_BASE_URL}/spaces/${spaceSlug}/posts/${post.id}`;
|
|
389
391
|
if (isJsonMode(space)) {
|
|
390
|
-
jsonOut(post);
|
|
392
|
+
jsonOut({ ...post, shareUrl });
|
|
391
393
|
return;
|
|
392
394
|
}
|
|
393
395
|
console.log(`Post created!\n` +
|
|
394
396
|
` ID: ${post.id}\n` +
|
|
395
397
|
(post.title ? ` Title: ${post.title}\n` : "") +
|
|
396
|
-
` Created: ${post.createdAt}` +
|
|
398
|
+
` Created: ${post.createdAt}\n` +
|
|
399
|
+
` URL: ${shareUrl}` +
|
|
397
400
|
(opts.draftId ? `\n Linked to draft: ${opts.draftId}` : ""));
|
|
398
401
|
});
|
|
399
402
|
space
|
package/dist/commands/vault.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from "fs";
|
|
2
2
|
import { join, resolve as pathResolve } from "path";
|
|
3
|
-
import { WEBDRIVE_BASE_URL } from "../constants.js";
|
|
3
|
+
import { WEB_BASE_URL, WEBDRIVE_BASE_URL } from "../constants.js";
|
|
4
4
|
import { getValidToken } from "../auth/manager.js";
|
|
5
5
|
import { GobiError } from "../errors.js";
|
|
6
6
|
import { apiDelete, apiGet, apiPatch, apiPost } from "../client.js";
|
|
@@ -118,7 +118,7 @@ export function registerVaultCommand(program) {
|
|
|
118
118
|
throw new GobiError(`Vault "${slug}" not found among vaults you own.`, "VAULT_NOT_FOUND");
|
|
119
119
|
}
|
|
120
120
|
const isPublished = v.public === true;
|
|
121
|
-
const profileUrl =
|
|
121
|
+
const profileUrl = `${WEB_BASE_URL}/@${slug}`;
|
|
122
122
|
const status = {
|
|
123
123
|
vaultSlug: slug,
|
|
124
124
|
name: v.name,
|
package/dist/constants.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export const BASE_URL = process.env.GOBI_BASE_URL || "https://api.joingobi.com";
|
|
2
2
|
export const WEBDRIVE_BASE_URL = process.env.GOBI_WEBDRIVE_BASE_URL || "https://webdrive.joingobi.com";
|
|
3
|
+
export const WEB_BASE_URL = process.env.GOBI_WEB_BASE_URL || "https://gobispace.com";
|
|
3
4
|
// Refresh access token when less than 5 minutes remain
|
|
4
5
|
export const TOKEN_REFRESH_BUFFER_MS = 5 * 60 * 1000;
|
|
5
6
|
// Max polling duration before giving up (ms) - 10 minutes
|
package/package.json
CHANGED
|
@@ -40,25 +40,24 @@ Replace `<RATIO>` with the desired aspect ratio: `1:1`, `16:9`, `9:16`, `4:3`, o
|
|
|
40
40
|
|
|
41
41
|
The `-o` flag implies `--wait` and downloads the image when done.
|
|
42
42
|
|
|
43
|
-
**Where you reference the downloaded file depends on
|
|
43
|
+
**Where you reference the downloaded file depends on the surface you're rendering to:**
|
|
44
44
|
|
|
45
45
|
- **Chat / vault note (vault is mounted, ![[wikilinks]] resolve):** use Obsidian wiki-link syntax:
|
|
46
46
|
```
|
|
47
47
|
![[media/<NAME>.png]]
|
|
48
48
|
```
|
|
49
|
-
- **Post or reply
|
|
49
|
+
- **Post or reply you're authoring with the CLI** (`gobi <scope> create-post` / `create-reply`): do NOT embed the image in `--content`. Pass the file as a first-class attachment:
|
|
50
50
|
```bash
|
|
51
51
|
gobi space create-post --title "<TITLE>" --content "<BODY>" --attach media/<NAME>.png
|
|
52
52
|
gobi space create-reply <postId> --content "<BODY>" --attach media/<NAME>.png
|
|
53
53
|
```
|
|
54
|
-
This uploads
|
|
55
|
-
|
|
56
|
-
In particular, when you're answering a post-mention (`@gobi` / `@space:<slug>` on a thread) and need to send media, **call `gobi <scope> create-reply <postId> --attach <file>` yourself** — your text-only assistant body is auto-posted only if you don't call create-reply this turn, so calling it explicitly is the only way to land media on the thread.
|
|
54
|
+
This uploads to the CDN and renders the image as a slider on the post card. `--attach` is repeatable; mix rule is **4 photos OR 1 GIF OR 1 video**.
|
|
55
|
+
- **Post-mention reply** (you were `@`-mentioned on a thread — `@gobi` / `@space:<slug>` — and your assistant body is auto-posted as the reply): **just write the text reply. Do not include the image as wiki-link, markdown image, or any URL.** The runtime detects every `gobi media generate-image` call you ran this turn and attaches those images to your auto-posted reply automatically. Embedding the image yourself either dangles (the workspace path doesn't resolve publicly) or duplicates the slider.
|
|
57
56
|
|
|
58
57
|
### Key rules
|
|
59
58
|
- Replace `<NAME>` with a descriptive slug — NEVER use example names like `sunset.png` literally.
|
|
60
59
|
- `--name` is **optional** — auto-derived from prompt if omitted.
|
|
61
|
-
- Do NOT use the `downloadUrl` from the response — it is a Miraflow-internal path, not a public link. Always download with `-o` then either wiki-link (chat/vault)
|
|
60
|
+
- Do NOT use the `downloadUrl` from the response — it is a Miraflow-internal path, not a public link. Always download with `-o` then either wiki-link (chat/vault), `--attach` (CLI-authored post/reply), or nothing (post-mention auto-post — the runtime attaches).
|
|
62
61
|
- `download-image` takes a **positional** jobId (NOT `--job-id`): `gobi media download-image <jobId>`
|
|
63
62
|
- The `jobId` (or `id`) field is what you pass to `download-image` / `get-image-status` — NOT `mediaId`.
|
|
64
63
|
|