trucontext 0.8.4 → 0.8.5
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 +1 -1
- package/src/commands/billing.js +2 -2
- package/src/commands/contexts.js +1 -1
- package/src/commands/docs.js +1 -1
- package/src/commands/entities.js +3 -3
- package/src/commands/ingest.js +1 -1
- package/src/commands/init.js +1 -1
- package/src/commands/query.js +1 -1
- package/src/commands/recall.js +1 -1
- package/src/commands/recipes.js +3 -3
- package/src/commands/relationship-types.js +1 -1
- package/src/commands/schema.js +1 -1
package/package.json
CHANGED
package/src/commands/billing.js
CHANGED
|
@@ -45,7 +45,7 @@ export async function usageCommand(options) {
|
|
|
45
45
|
const params = [`period=${period}`];
|
|
46
46
|
if (source) params.push(`source=${source}`);
|
|
47
47
|
const res = await controlPlane('GET', `/billing/usage/${appId}?${params.join('&')}`);
|
|
48
|
-
const usage = res.data
|
|
48
|
+
const usage = res.data;
|
|
49
49
|
|
|
50
50
|
if (!usage || (!usage.apiCalls && !usage.llmInputTokens && !usage.processingMs)) {
|
|
51
51
|
console.log(chalk.yellow('No usage data available.'));
|
|
@@ -92,7 +92,7 @@ export async function usageHistoryCommand(options) {
|
|
|
92
92
|
const params = [`period=${period}`];
|
|
93
93
|
if (source) params.push(`source=${source}`);
|
|
94
94
|
const res = await controlPlane('GET', `/billing/usage/${appId}/history?${params.join('&')}`);
|
|
95
|
-
const historyData = res.data
|
|
95
|
+
const historyData = res.data;
|
|
96
96
|
const history = historyData.history || [];
|
|
97
97
|
|
|
98
98
|
if (history.length === 0) {
|
package/src/commands/contexts.js
CHANGED
|
@@ -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 =
|
|
7
|
+
const contexts = res.data;
|
|
8
8
|
|
|
9
9
|
if (contexts.length === 0) {
|
|
10
10
|
console.log(chalk.yellow('No contexts. Create one with: trucontext contexts create <name>'));
|
package/src/commands/docs.js
CHANGED
|
@@ -27,7 +27,7 @@ export async function docsListCommand() {
|
|
|
27
27
|
export async function docsShowCommand(slug) {
|
|
28
28
|
try {
|
|
29
29
|
const res = await publicApi('GET', `/public/docs/${slug}`);
|
|
30
|
-
const doc = res.data
|
|
30
|
+
const doc = res.data;
|
|
31
31
|
|
|
32
32
|
if (!doc || !doc.title) {
|
|
33
33
|
console.error(chalk.red(`No doc found for slug: ${slug}`));
|
package/src/commands/entities.js
CHANGED
|
@@ -70,13 +70,13 @@ export async function entitiesGetCommand(entityId) {
|
|
|
70
70
|
try {
|
|
71
71
|
const appId = getActiveApp();
|
|
72
72
|
const res = await controlPlane('GET', `/apps/${appId}/entities/${entityId}`);
|
|
73
|
-
const e = res.data
|
|
73
|
+
const e = res.data;
|
|
74
74
|
displayEntity(e);
|
|
75
75
|
|
|
76
76
|
// Show edges if available
|
|
77
77
|
try {
|
|
78
78
|
const edgeRes = await controlPlane('GET', `/apps/${appId}/entities/${entityId}/edges`);
|
|
79
|
-
const edges = edgeRes.data
|
|
79
|
+
const edges = edgeRes.data;
|
|
80
80
|
if (edges.length > 0) {
|
|
81
81
|
console.log(chalk.dim(`\n Edges (${edges.length}):`));
|
|
82
82
|
for (const edge of edges) {
|
|
@@ -138,7 +138,7 @@ export async function entitiesCreateCommand(options) {
|
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
const res = await controlPlane('POST', `/apps/${appId}/entities`, body);
|
|
141
|
-
const e = res.data
|
|
141
|
+
const e = res.data;
|
|
142
142
|
console.log(chalk.green(`Created: ${chalk.bold(e.entityId || options.id)}`));
|
|
143
143
|
} catch (err) {
|
|
144
144
|
console.error(chalk.red(`Failed: ${err.message}`));
|
package/src/commands/ingest.js
CHANGED
|
@@ -53,7 +53,7 @@ export async function ingestCommand(source, options) {
|
|
|
53
53
|
});
|
|
54
54
|
|
|
55
55
|
const res = await controlPlane('POST', `/apps/${appId}/ingest`, body);
|
|
56
|
-
const data = res.data
|
|
56
|
+
const data = res.data;
|
|
57
57
|
console.log(chalk.green('Accepted'));
|
|
58
58
|
console.log(chalk.dim(`Content ID: ${data.contentId}`));
|
|
59
59
|
if (data.status === 'upload_required') {
|
package/src/commands/init.js
CHANGED
package/src/commands/query.js
CHANGED
|
@@ -28,7 +28,7 @@ export async function queryCommand(question, options) {
|
|
|
28
28
|
if (options.context) body.context_id = options.context;
|
|
29
29
|
|
|
30
30
|
const res = await controlPlane('POST', `/apps/${appId}/mind/query`, body);
|
|
31
|
-
const data = res.data
|
|
31
|
+
const data = res.data;
|
|
32
32
|
|
|
33
33
|
// Print answer
|
|
34
34
|
if (data.answer?.summary) {
|
package/src/commands/recall.js
CHANGED
|
@@ -23,7 +23,7 @@ export async function recallCommand(query, options) {
|
|
|
23
23
|
if (options.context) body.context_id = options.context;
|
|
24
24
|
|
|
25
25
|
const res = await controlPlane('POST', `/apps/${appId}/recall`, body);
|
|
26
|
-
const data = res.data
|
|
26
|
+
const data = res.data;
|
|
27
27
|
|
|
28
28
|
// Print synthesis
|
|
29
29
|
if (data.synthesis?.summary) {
|
package/src/commands/recipes.js
CHANGED
|
@@ -16,7 +16,7 @@ export async function recipesListCommand() {
|
|
|
16
16
|
try {
|
|
17
17
|
const appId = requireApp();
|
|
18
18
|
const res = await controlPlane('GET', `/apps/${appId}/recipes`);
|
|
19
|
-
const recipes =
|
|
19
|
+
const recipes = res.data;
|
|
20
20
|
|
|
21
21
|
if (recipes.length === 0) {
|
|
22
22
|
console.log(chalk.yellow('No recipes found.'));
|
|
@@ -37,7 +37,7 @@ export async function recipesGetCommand(recipeId) {
|
|
|
37
37
|
try {
|
|
38
38
|
const appId = requireApp();
|
|
39
39
|
const res = await controlPlane('GET', `/apps/${appId}/recipes/${recipeId}`);
|
|
40
|
-
const r = res.data
|
|
40
|
+
const r = res.data;
|
|
41
41
|
|
|
42
42
|
console.log(chalk.bold(r.recipeId || recipeId));
|
|
43
43
|
if (r.name) console.log(` name: ${r.name}`);
|
|
@@ -139,7 +139,7 @@ export async function recipesCreateCommand(options) {
|
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
const res = await controlPlane('POST', `/apps/${appId}/recipes`, body);
|
|
142
|
-
const r = res.data
|
|
142
|
+
const r = res.data;
|
|
143
143
|
console.log(chalk.green(`Created: ${chalk.bold(r.recipeId || options.id)}`));
|
|
144
144
|
} catch (err) {
|
|
145
145
|
console.error(chalk.red(`Failed: ${err.message}`));
|
|
@@ -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
|
|
19
|
+
const types = res.data;
|
|
20
20
|
|
|
21
21
|
if (Array.isArray(types) && types.length === 0) {
|
|
22
22
|
console.log(chalk.yellow('No relationship types found.'));
|
package/src/commands/schema.js
CHANGED
|
@@ -15,7 +15,7 @@ export async function schemaShowCommand() {
|
|
|
15
15
|
const appId = requireActiveApp();
|
|
16
16
|
try {
|
|
17
17
|
const res = await controlPlane('GET', `/apps/${appId}/schema`);
|
|
18
|
-
const schema = res.data
|
|
18
|
+
const schema = res.data;
|
|
19
19
|
|
|
20
20
|
if (!schema) {
|
|
21
21
|
console.log(chalk.yellow('No schema configured. Generate one with: trucontext schema generate'));
|