trucontext 0.7.0 → 0.8.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/README.md CHANGED
@@ -17,17 +17,20 @@ That's it. No API keys to copy, no config files to edit. Browser-based OAuth, th
17
17
  ## The 30-Second Version
18
18
 
19
19
  ```bash
20
- # Create an entity for the person your agent works with
21
- npx trucontext entities create --id dustin --type Person \
22
- --properties '{"name": "Dustin", "role": "founder"}' \
23
- --recipe recipe:personal-assistant-memory
20
+ # Create a root node the intelligence boundary for your agent's memory
21
+ npx trucontext roots create --id dustin --type Person \
22
+ --recipe recipe:personal-assistant-memory \
23
+ --properties '{"name": "Dustin", "role": "founder"}'
24
+
25
+ # Set it as the active root for queries
26
+ npx trucontext roots use dustin
24
27
 
25
28
  # Ingest what your agent learned
26
29
  npx trucontext ingest "Dustin prefers async communication and dark mode. \
27
30
  He values clean code over backwards compatibility." \
28
31
  --context dustin:ABOUT --confidence 0.85 --temporal
29
32
 
30
- # Ask an intelligent question
33
+ # Ask an intelligent question (scoped to the root's ego network)
31
34
  npx trucontext query "What does Dustin prefer?"
32
35
  ```
33
36
 
@@ -135,28 +138,35 @@ Observe → Capture → Sleep → Wake → Query → Observe → ...
135
138
  ### Apps
136
139
  | Command | Description |
137
140
  |---------|-------------|
138
- | `init [name]` | Create a new app with AI-generated schema |
141
+ | `init [name]` | Create a new app with schema + root node |
139
142
  | `apps` | List your apps |
140
143
  | `use <app>` | Set the active app |
141
144
 
145
+ ### Root Nodes
146
+ | Command | Description |
147
+ |---------|-------------|
148
+ | `roots create` | Create a root node with recipe and dreamers |
149
+ | `roots list` | List all root nodes |
150
+ | `roots show <id>` | Show root node details and linked roots |
151
+ | `roots update <id>` | Update recipe, dreamers, or properties |
152
+ | `roots delete <id>` | Demote to regular entity |
153
+ | `roots use <id>` | Set active root for queries |
154
+
142
155
  ### Data
143
156
  | Command | Description |
144
157
  |---------|-------------|
145
- | `ingest <source>` | Ingest text or file with confidence, temporal, and context linking |
146
- | `query <question>` | Query the intelligent knowledge graph |
147
- | `recall <query>` | Semantic memory recall with graph expansion |
158
+ | `ingest <source>` | Ingest text or file (requires `--context`) |
159
+ | `query <question>` | Query the graph (requires active root or `--root`) |
160
+ | `recall <query>` | Semantic recall (requires active root or `--root`) |
148
161
 
149
- ### Structure
162
+ ### Entities
150
163
  | Command | Description |
151
164
  |---------|-------------|
152
165
  | `entities list` | List entities |
153
- | `entities create` | Create entity with recipe, confidence, temporal, contexts |
166
+ | `entities create` | Create entity (requires `--context`) |
154
167
  | `entities get <id>` | Get entity details |
155
- | `entities update <id>` | Update entity properties, recipe, heartbeat settings |
168
+ | `entities update <id>` | Update properties, recipe, heartbeat |
156
169
  | `entities delete <id>` | Delete entity |
157
- | `contexts list` | List contexts |
158
- | `contexts create <name>` | Create a scoping context |
159
- | `contexts delete <id>` | Delete context |
160
170
 
161
171
  ### Intelligence
162
172
  | Command | Description |
package/bin/cli.js CHANGED
@@ -19,6 +19,7 @@ import { recipesListCommand, recipesGetCommand, recipesCreateCommand, recipesDel
19
19
  import { relationshipTypesListCommand } from '../src/commands/relationship-types.js';
20
20
  import { docsListCommand, docsShowCommand } from '../src/commands/docs.js';
21
21
  import { registerRootsCommand } from '../src/commands/roots.js';
22
+ import { registerCuriosityCommand } from '../src/commands/curiosity.js';
22
23
 
23
24
  program
24
25
  .name('trucontext')
@@ -136,6 +137,9 @@ entities.command('edges <entityId>')
136
137
  // Root Nodes
137
138
  registerRootsCommand(program);
138
139
 
140
+ // Curiosity
141
+ registerCuriosityCommand(program);
142
+
139
143
  // Recipes
140
144
  const recipes = program.command('recipes').description('Manage recipes').action(function() { this.help(); });
141
145
  recipes.command('list')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trucontext",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "TruContext CLI — contextual memory for AI applications",
5
5
  "type": "module",
6
6
  "bin": {
@@ -0,0 +1,97 @@
1
+ // curiosity.js — Curiosity Engine commands
2
+ //
3
+ // Trigger curiosity analysis and view knowledge gaps for a root node.
4
+ // Curiosity analysis is always scoped to a root node's ego network.
5
+
6
+ import chalk from 'chalk';
7
+ import { controlPlane } from '../client.js';
8
+ import { getConfig, getActiveApp } from '../config.js';
9
+
10
+ export function registerCuriosityCommand(program) {
11
+ const curiosity = program
12
+ .command('curiosity')
13
+ .description('Curiosity engine — discover knowledge gaps')
14
+ .action(function() { this.help(); });
15
+
16
+ // List curiosity packets
17
+ curiosity
18
+ .command('list')
19
+ .description('List curiosity packets for a root node')
20
+ .option('--root <rootId>', 'Root node ID (uses active root if not specified)')
21
+ .option('--status <status>', 'Filter by status: PENDING, DISMISSED', 'PENDING')
22
+ .option('--limit <n>', 'Max packets to return', '20')
23
+ .action(async (opts) => {
24
+ const appId = getActiveApp();
25
+ const config = getConfig();
26
+ const rootId = opts.root || config.activeRoot;
27
+ if (!rootId) {
28
+ console.error(chalk.red('No root specified. Use --root <id> or set active root with: trucontext roots use <id>'));
29
+ process.exit(1);
30
+ }
31
+
32
+ try {
33
+ const res = await controlPlane('GET', `/apps/${appId}/mind/curiosity?root_id=${rootId}&status=${opts.status}&limit=${opts.limit}`);
34
+ const packets = res.data?.packets || [];
35
+
36
+ if (packets.length === 0) {
37
+ console.log(chalk.dim(`No ${opts.status.toLowerCase()} curiosity packets for root: ${rootId}`));
38
+ return;
39
+ }
40
+
41
+ console.log(chalk.bold(`Curiosity Packets (${packets.length}) — root: ${rootId}\n`));
42
+ for (const p of packets) {
43
+ const typeColor = p.curiosity_type === 'EXTERNAL' ? chalk.cyan : chalk.yellow;
44
+ console.log(` ${typeColor(`[${p.gap_type}]`)} ${p.question}`);
45
+ if (p.why_it_matters) console.log(chalk.dim(` Why: ${p.why_it_matters}`));
46
+ if (p.suggested_approach) console.log(chalk.dim(` Approach: ${p.suggested_approach}`));
47
+ console.log(chalk.dim(` Priority: ${p.priority_score?.toFixed(2) || '?'} | Status: ${p.status} | ID: ${p.packet_id}`));
48
+ console.log();
49
+ }
50
+ } catch (err) {
51
+ console.error(chalk.red('Failed:'), err.response?.data?.error || err.message);
52
+ process.exit(1);
53
+ }
54
+ });
55
+
56
+ // Trigger on-demand curiosity evaluation
57
+ curiosity
58
+ .command('trigger')
59
+ .description('Run curiosity analysis on a root node')
60
+ .option('--root <rootId>', 'Root node ID (uses active root if not specified)')
61
+ .action(async (opts) => {
62
+ const appId = getActiveApp();
63
+ const config = getConfig();
64
+ const rootId = opts.root || config.activeRoot;
65
+ if (!rootId) {
66
+ console.error(chalk.red('No root specified. Use --root <id> or set active root with: trucontext roots use <id>'));
67
+ process.exit(1);
68
+ }
69
+
70
+ try {
71
+ console.log(chalk.dim(`Triggering curiosity analysis for root: ${rootId}...`));
72
+ await controlPlane('POST', `/apps/${appId}/mind/curiosity/trigger`, {
73
+ root_id: rootId,
74
+ });
75
+ console.log(chalk.green(`Curiosity analysis started for root: ${rootId}`));
76
+ console.log(chalk.dim(`Results will appear shortly. Check with: trucontext curiosity list --root ${rootId}`));
77
+ } catch (err) {
78
+ console.error(chalk.red('Failed:'), err.response?.data?.error || err.message);
79
+ process.exit(1);
80
+ }
81
+ });
82
+
83
+ // Dismiss a curiosity packet
84
+ curiosity
85
+ .command('dismiss <packetId>')
86
+ .description('Dismiss a curiosity packet')
87
+ .action(async (packetId) => {
88
+ const appId = getActiveApp();
89
+ try {
90
+ await controlPlane('PUT', `/apps/${appId}/mind/curiosity/${packetId}/dismiss`);
91
+ console.log(chalk.green(`Dismissed: ${packetId}`));
92
+ } catch (err) {
93
+ console.error(chalk.red('Failed:'), err.response?.data?.error || err.message);
94
+ process.exit(1);
95
+ }
96
+ });
97
+ }
@@ -20,7 +20,7 @@ export function registerRootsCommand(program) {
20
20
  .requiredOption('--id <entityId>', 'Unique identifier for the root node')
21
21
  .requiredOption('--type <type>', 'Node type (e.g., Person, Agent, Organization)')
22
22
  .requiredOption('--recipe <recipeId>', 'Recipe ID (e.g., recipe:personal-assistant-memory)')
23
- .option('--dreamers <list>', 'Dreamers: "all" or comma-separated (e.g., decay,curiosity)', 'all')
23
+ .option('--dreamers <list>', 'Dreamers: "all" or comma-separated. Valid: decay, concepts, people, primitives, curiosity, entity-linking, consolidation, fitness', 'all')
24
24
  .option('--hop-depth <n>', 'Max traversal depth for ego network (default: unlimited)', parseInt)
25
25
  .option('--do-not-follow', 'Mark as structural root — do not traverse into from other roots')
26
26
  .option('--properties <json>', 'JSON properties object')
@@ -128,7 +128,7 @@ export function registerRootsCommand(program) {
128
128
  .command('update <rootId>')
129
129
  .description('Update a root node')
130
130
  .option('--recipe <recipeId>', 'New recipe ID')
131
- .option('--dreamers <list>', 'New dreamers: "all" or comma-separated')
131
+ .option('--dreamers <list>', 'New dreamers: "all" or comma-separated. Valid: decay, concepts, people, primitives, curiosity, entity-linking, consolidation, fitness')
132
132
  .option('--hop-depth <n>', 'New hop depth', parseInt)
133
133
  .option('--do-not-follow', 'Set do-not-follow flag')
134
134
  .option('--no-do-not-follow', 'Clear do-not-follow flag')