@pellux/goodvibes-tui 0.19.52 → 0.19.53

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pellux/goodvibes-tui",
3
- "version": "0.19.52",
3
+ "version": "0.19.53",
4
4
  "description": "Terminal-native GoodVibes product for coding, operations, automation, knowledge, channels, and daemon-backed control-plane workflows.",
5
5
  "type": "module",
6
6
  "main": "src/main.ts",
@@ -91,7 +91,7 @@
91
91
  "@anthropic-ai/vertex-sdk": "^0.16.0",
92
92
  "@ast-grep/napi": "^0.42.0",
93
93
  "@aws/bedrock-token-generator": "^1.1.0",
94
- "@pellux/goodvibes-sdk": "0.26.7",
94
+ "@pellux/goodvibes-sdk": "0.26.8",
95
95
  "bash-language-server": "^5.6.0",
96
96
  "fuse.js": "^7.1.0",
97
97
  "graphql": "^16.13.2",
@@ -1,5 +1,9 @@
1
1
  import type { CommandContext, SlashCommand } from '../command-registry.ts';
2
2
 
3
+ const KNOWLEDGE_REVIEW_ACTIONS = ['accept', 'reject', 'resolve', 'reopen', 'edit', 'forget'] as const;
4
+
5
+ type KnowledgeReviewAction = typeof KNOWLEDGE_REVIEW_ACTIONS[number];
6
+
3
7
  function requireKnowledgeApi(context: CommandContext) {
4
8
  const knowledgeApi = context.clients?.knowledgeApi;
5
9
  if (!knowledgeApi) {
@@ -20,6 +24,20 @@ function readStringListFlag(args: string[], name: string): string[] {
20
24
  return value.split(',').map((entry) => entry.trim()).filter(Boolean);
21
25
  }
22
26
 
27
+ function readJsonObjectFlag(args: string[], name: string): Record<string, unknown> | null | undefined {
28
+ const value = readFlag(args, name);
29
+ if (!value) return undefined;
30
+ try {
31
+ const parsed = JSON.parse(value) as unknown;
32
+ if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {
33
+ return null;
34
+ }
35
+ return parsed as Record<string, unknown>;
36
+ } catch {
37
+ return null;
38
+ }
39
+ }
40
+
23
41
  function positionalArgs(args: string[], valuedFlags: readonly string[] = []): string[] {
24
42
  return args.filter((token, index) => {
25
43
  if (token.startsWith('--')) return false;
@@ -33,7 +51,7 @@ export const knowledgeCommand: SlashCommand = {
33
51
  aliases: ['know', 'kb'],
34
52
  description: 'Structured knowledge graph: ingest URLs/bookmarks, inspect issues, and build compact prompt packets.',
35
53
  usage: '<subcommand> [args]',
36
- argsHint: 'status|ingest-url|import-bookmarks|import-urls|list|search|get|queue|candidates|reports|schedules|lint|packet|explain|reindex|consolidate',
54
+ argsHint: 'status|ingest-url|import-bookmarks|import-urls|list|search|get|queue|review-issue|candidates|reports|schedules|lint|packet|explain|reindex|consolidate',
37
55
  handler: async (args: string[], context: CommandContext): Promise<void> => {
38
56
  const knowledge = requireKnowledgeApi(context);
39
57
  if (!knowledge) {
@@ -241,6 +259,40 @@ export const knowledgeCommand: SlashCommand = {
241
259
  break;
242
260
  }
243
261
 
262
+ case 'review-issue':
263
+ case 'issue-review': {
264
+ const [issueId, actionValue] = positionalArgs(rest, ['--reviewer', '--value']);
265
+ const action = actionValue?.toLowerCase();
266
+ if (!issueId || !action || !KNOWLEDGE_REVIEW_ACTIONS.includes(action as KnowledgeReviewAction)) {
267
+ context.print('[knowledge] Usage: /knowledge review-issue <issueId> <accept|reject|resolve|reopen|edit|forget> [--reviewer <name>] [--value <json-object>]');
268
+ return;
269
+ }
270
+ const value = readJsonObjectFlag(rest, '--value');
271
+ if (value === null) {
272
+ context.print('[knowledge] --value must be a JSON object.');
273
+ return;
274
+ }
275
+ try {
276
+ const result = await knowledge.graph.issues.review({
277
+ issueId,
278
+ action: action as KnowledgeReviewAction,
279
+ reviewer: readFlag(rest, '--reviewer') ?? 'tui',
280
+ ...(value ? { value } : {}),
281
+ });
282
+ context.print([
283
+ `[knowledge] Reviewed issue ${result.issue.id}`,
284
+ ` action: ${action}`,
285
+ ` status: ${result.issue.status}`,
286
+ ...(result.node ? [` node: ${result.node.id} ${result.node.title}`] : []),
287
+ ...(result.source ? [` source: ${result.source.id} ${result.source.title ?? result.source.canonicalUri ?? result.source.sourceUri ?? 'untitled'}`] : []),
288
+ ...(result.appliedFacts ? [` applied facts: ${Object.keys(result.appliedFacts).join(', ') || 'none'}`] : []),
289
+ ].join('\n'));
290
+ } catch (error) {
291
+ context.print(`[knowledge] ${error instanceof Error ? error.message : String(error)}`);
292
+ }
293
+ break;
294
+ }
295
+
244
296
  case 'candidates': {
245
297
  const [limitArg] = positionalArgs(rest);
246
298
  const limit = Math.max(1, Number.parseInt(limitArg ?? '10', 10) || 10);
@@ -354,6 +406,7 @@ export const knowledgeCommand: SlashCommand = {
354
406
  ' search <query> [--limit <n>]',
355
407
  ' get <id>',
356
408
  ' queue [limit]',
409
+ ' review-issue <issueId> <accept|reject|resolve|reopen|edit|forget> [--reviewer <name>] [--value <json-object>]',
357
410
  ' candidates [limit]',
358
411
  ' reports [limit]',
359
412
  ' schedules',
package/src/version.ts CHANGED
@@ -6,7 +6,7 @@ import { join } from 'node:path';
6
6
  // The prebuild script updates the fallback value before compilation.
7
7
  // Uses import.meta.dir (Bun) to locate package.json relative to this file,
8
8
  // which is correct regardless of the process working directory.
9
- let _version = '0.19.52';
9
+ let _version = '0.19.53';
10
10
  try {
11
11
  const pkg = JSON.parse(readFileSync(join(import.meta.dir, '..', 'package.json'), 'utf-8'));
12
12
  _version = pkg.version ?? _version;