trucontext 0.9.2 → 0.10.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/bin/cli.js +1 -0
- package/package.json +1 -1
- package/src/client.js +2 -2
- package/src/commands/ingest.js +3 -0
package/bin/cli.js
CHANGED
|
@@ -63,6 +63,7 @@ program.command('use <app>')
|
|
|
63
63
|
// Ingest
|
|
64
64
|
program.command('ingest <source>')
|
|
65
65
|
.description('Ingest a file or text string')
|
|
66
|
+
.requiredOption('-a, --agent <agent-id>', 'Agent ID (required — provision first)')
|
|
66
67
|
.option('-c, --context <entry>', 'Link to context node (entity-id:RELATIONSHIP, repeatable)', (val, prev) => [...prev, val], [])
|
|
67
68
|
.option('--confidence <n>', 'Confidence level (0.0-1.0)')
|
|
68
69
|
.option('--temporal', 'Content can decay over time (default)')
|
package/package.json
CHANGED
package/src/client.js
CHANGED
|
@@ -13,7 +13,7 @@ async function request(baseUrl, method, path, body, retry = true) {
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
const ac = new AbortController();
|
|
16
|
-
const timeout = setTimeout(() => ac.abort(),
|
|
16
|
+
const timeout = setTimeout(() => ac.abort(), 60000);
|
|
17
17
|
|
|
18
18
|
try {
|
|
19
19
|
const res = await fetch(`${baseUrl}${path}`, {
|
|
@@ -80,7 +80,7 @@ export function controlPlane(method, path, body) {
|
|
|
80
80
|
|
|
81
81
|
export async function publicApi(method, path) {
|
|
82
82
|
const ac = new AbortController();
|
|
83
|
-
const timeout = setTimeout(() => ac.abort(),
|
|
83
|
+
const timeout = setTimeout(() => ac.abort(), 60000);
|
|
84
84
|
try {
|
|
85
85
|
const res = await fetch(`${CONTROL_PLANE_URL}${path}`, {
|
|
86
86
|
method,
|
package/src/commands/ingest.js
CHANGED
|
@@ -34,6 +34,9 @@ export async function ingestCommand(source, options) {
|
|
|
34
34
|
if (options.confidence !== undefined) body.confidence = parseFloat(options.confidence);
|
|
35
35
|
if (options.temporal !== undefined) body.temporal = options.temporal;
|
|
36
36
|
|
|
37
|
+
// Agent ID (required — enforced by commander's requiredOption)
|
|
38
|
+
body.agent_id = options.agent;
|
|
39
|
+
|
|
37
40
|
// Build contexts array from --context flags: "entity-id:RELATIONSHIP" (required)
|
|
38
41
|
if (!options.context || options.context.length === 0) {
|
|
39
42
|
console.error(chalk.red('At least one context is required.'));
|