trucontext 0.1.1 → 0.1.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.
package/bin/cli.js
CHANGED
|
@@ -18,7 +18,7 @@ import { relationshipTypesListCommand } from '../src/commands/relationship-types
|
|
|
18
18
|
program
|
|
19
19
|
.name('trucontext')
|
|
20
20
|
.description('TruContext CLI — contextual memory for AI applications')
|
|
21
|
-
.version('0.1.
|
|
21
|
+
.version('0.1.2');
|
|
22
22
|
|
|
23
23
|
// Auth
|
|
24
24
|
program.command('login')
|
|
@@ -75,7 +75,7 @@ program.command('recall <query>')
|
|
|
75
75
|
.action(recallCommand);
|
|
76
76
|
|
|
77
77
|
// Contexts
|
|
78
|
-
const contexts = program.command('contexts').description('Manage contexts');
|
|
78
|
+
const contexts = program.command('contexts').description('Manage contexts').action(function() { this.help(); });
|
|
79
79
|
contexts.command('list').description('List contexts').action(contextsListCommand);
|
|
80
80
|
contexts.command('create <name>')
|
|
81
81
|
.description('Create a context')
|
|
@@ -84,7 +84,7 @@ contexts.command('create <name>')
|
|
|
84
84
|
contexts.command('delete <id>').description('Delete a context').action(contextsDeleteCommand);
|
|
85
85
|
|
|
86
86
|
// Entities
|
|
87
|
-
const entities = program.command('entities').description('Manage entities');
|
|
87
|
+
const entities = program.command('entities').description('Manage entities').action(function() { this.help(); });
|
|
88
88
|
entities.command('list')
|
|
89
89
|
.description('List entities')
|
|
90
90
|
.option('--type <type>', 'Filter by entity type')
|
|
@@ -120,7 +120,7 @@ entities.command('delete <entityId>')
|
|
|
120
120
|
.action(entitiesDeleteCommand);
|
|
121
121
|
|
|
122
122
|
// Recipes
|
|
123
|
-
const recipes = program.command('recipes').description('Manage recipes');
|
|
123
|
+
const recipes = program.command('recipes').description('Manage recipes').action(function() { this.help(); });
|
|
124
124
|
recipes.command('list')
|
|
125
125
|
.description('List recipes')
|
|
126
126
|
.action(recipesListCommand);
|
|
@@ -146,7 +146,7 @@ program.command('relationship-types')
|
|
|
146
146
|
.action(relationshipTypesListCommand);
|
|
147
147
|
|
|
148
148
|
// Schema
|
|
149
|
-
const schema = program.command('schema').description('Manage app schema');
|
|
149
|
+
const schema = program.command('schema').description('Manage app schema').action(function() { this.help(); });
|
|
150
150
|
schema.command('show').description('Show current schema').action(schemaShowCommand);
|
|
151
151
|
schema.command('generate')
|
|
152
152
|
.description('AI-generate a schema')
|
package/package.json
CHANGED
package/src/commands/contexts.js
CHANGED
|
@@ -29,8 +29,10 @@ export async function contextsCreateCommand(name, options) {
|
|
|
29
29
|
if (options.metadata) {
|
|
30
30
|
try {
|
|
31
31
|
body.metadata = JSON.parse(options.metadata);
|
|
32
|
-
} catch {
|
|
33
|
-
console.error(chalk.red(
|
|
32
|
+
} catch (parseErr) {
|
|
33
|
+
console.error(chalk.red(`Invalid metadata JSON: ${parseErr.message}`));
|
|
34
|
+
console.error(chalk.dim(`Received: ${options.metadata}`));
|
|
35
|
+
console.error(chalk.dim('Tip: use double quotes around the JSON and escape inner quotes, or use single quotes: --metadata \'{"key":"value"}\''));
|
|
34
36
|
process.exit(1);
|
|
35
37
|
}
|
|
36
38
|
}
|
|
@@ -16,7 +16,7 @@ export async function relationshipTypesListCommand(options) {
|
|
|
16
16
|
const path = `/apps/${appId}/relationship-types${qs ? `?${qs}` : ''}`;
|
|
17
17
|
|
|
18
18
|
const res = await controlPlane('GET', path);
|
|
19
|
-
const types = res.data?.relationshipTypes || res.data || [];
|
|
19
|
+
const types = res.data?.types || res.data?.relationshipTypes || res.data || [];
|
|
20
20
|
|
|
21
21
|
if (Array.isArray(types) && types.length === 0) {
|
|
22
22
|
console.log(chalk.yellow('No relationship types found.'));
|