@gobi-ai/cli 0.1.2 → 0.2.0
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/commands/astra.js +27 -4
- package/package.json +2 -1
package/dist/commands/astra.js
CHANGED
|
@@ -63,15 +63,17 @@ export function registerAstraCommand(program) {
|
|
|
63
63
|
.description("Ask a brain a question. Creates a targeted session (1:1 conversation).")
|
|
64
64
|
.requiredOption("--vault-slug <vaultSlug>", "Slug of the brain/vault to ask")
|
|
65
65
|
.requiredOption("--question <question>", "The question to ask (markdown supported)")
|
|
66
|
-
.option("--mode <mode>", 'Session mode: "auto" or "manual"'
|
|
66
|
+
.option("--mode <mode>", 'Session mode: "auto" or "manual"')
|
|
67
67
|
.action(async (opts) => {
|
|
68
68
|
const spaceSlug = resolveSpaceSlug(astra);
|
|
69
|
-
const
|
|
69
|
+
const body = {
|
|
70
70
|
vaultSlug: opts.vaultSlug,
|
|
71
71
|
spaceSlug,
|
|
72
72
|
question: opts.question,
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
};
|
|
74
|
+
if (opts.mode != null)
|
|
75
|
+
body.mode = opts.mode;
|
|
76
|
+
const resp = (await apiPost(`/session/targeted`, body));
|
|
75
77
|
const data = unwrapResp(resp);
|
|
76
78
|
if (isJsonMode(astra)) {
|
|
77
79
|
jsonOut(data);
|
|
@@ -451,6 +453,27 @@ export function registerAstraCommand(program) {
|
|
|
451
453
|
` Source: ${msg.source}\n` +
|
|
452
454
|
` Created: ${msg.createdAt}`);
|
|
453
455
|
});
|
|
456
|
+
astra
|
|
457
|
+
.command("update-session <sessionId>")
|
|
458
|
+
.description('Update a session\'s mode. "auto" lets the AI respond automatically; "manual" requires human replies.')
|
|
459
|
+
.requiredOption("--mode <mode>", 'Session mode: "auto" or "manual"')
|
|
460
|
+
.action(async (sessionId, opts) => {
|
|
461
|
+
if (opts.mode !== "auto" && opts.mode !== "manual") {
|
|
462
|
+
throw new Error('Invalid mode. Must be "auto" or "manual".');
|
|
463
|
+
}
|
|
464
|
+
const resp = (await apiPatch(`/session/${sessionId}`, {
|
|
465
|
+
mode: opts.mode,
|
|
466
|
+
}));
|
|
467
|
+
const data = unwrapResp(resp);
|
|
468
|
+
if (isJsonMode(astra)) {
|
|
469
|
+
jsonOut(data);
|
|
470
|
+
return;
|
|
471
|
+
}
|
|
472
|
+
const session = (data.session || data);
|
|
473
|
+
console.log(`Session updated!\n` +
|
|
474
|
+
` ID: ${session.id}\n` +
|
|
475
|
+
` Mode: ${session.mode}`);
|
|
476
|
+
});
|
|
454
477
|
// ── Brain Updates (list, create, edit, delete) ──
|
|
455
478
|
astra
|
|
456
479
|
.command("list-brain-updates")
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gobi-ai/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "CLI client for the Gobi collaborative knowledge platform",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"dev": "tsx src/index.ts",
|
|
38
38
|
"start": "node dist/index.js",
|
|
39
39
|
"test": "node --test dist/*.test.js",
|
|
40
|
+
"generate-skill-docs": "npm run build && npx tsx skills/gobi-cli/scripts/generate-docs.ts",
|
|
40
41
|
"prepublishOnly": "npm run build"
|
|
41
42
|
},
|
|
42
43
|
"dependencies": {
|