trucontext 0.1.3 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trucontext",
3
- "version": "0.1.3",
3
+ "version": "0.2.0",
4
4
  "description": "TruContext CLI — contextual memory for AI applications",
5
5
  "type": "module",
6
6
  "bin": {
@@ -4,7 +4,7 @@ import { dataPlane } from '../client.js';
4
4
  export async function contextsListCommand() {
5
5
  try {
6
6
  const res = await dataPlane('GET', '/v1/contexts');
7
- const contexts = res.data?.contexts || [];
7
+ const contexts = Array.isArray(res.data) ? res.data : (res.data?.contexts || []);
8
8
 
9
9
  if (contexts.length === 0) {
10
10
  console.log(chalk.yellow('No contexts. Create one with: trucontext contexts create <name>'));
@@ -10,7 +10,7 @@ export async function entitiesListCommand(options) {
10
10
  const path = `/v1/entities${qs ? `?${qs}` : ''}`;
11
11
 
12
12
  const res = await dataPlane('GET', path);
13
- const entities = res.data?.entities || [];
13
+ const entities = Array.isArray(res.data) ? res.data : (res.data?.entities || []);
14
14
 
15
15
  if (entities.length === 0) {
16
16
  console.log(chalk.yellow('No entities found.'));