@crewx/cli 0.8.8-rc.23 → 0.8.8-rc.24
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/dist/commands/execute.js
CHANGED
|
@@ -26,6 +26,7 @@ const parse_agent_message_1 = require("./parse-agent-message");
|
|
|
26
26
|
const parse_common_flags_1 = require("./parse-common-flags");
|
|
27
27
|
const resolve_prompt_1 = require("./resolve-prompt");
|
|
28
28
|
const crewx_cli_1 = require("../bootstrap/crewx-cli");
|
|
29
|
+
const inherited_trace_1 = require("../utils/inherited-trace");
|
|
29
30
|
/**
|
|
30
31
|
* Handle `crewx execute <agentRef> <message>` command.
|
|
31
32
|
*
|
|
@@ -101,6 +102,7 @@ async function handleExecute(args) {
|
|
|
101
102
|
threadId: thread,
|
|
102
103
|
metadata: Object.keys(parsedMetadata).length > 0 ? parsedMetadata : undefined,
|
|
103
104
|
vars: Object.keys(vars).length > 0 ? vars : undefined,
|
|
105
|
+
trace: (0, inherited_trace_1.readInheritedTrace)(),
|
|
104
106
|
});
|
|
105
107
|
if (!result.ok) {
|
|
106
108
|
const errMsg = result.error?.message ?? 'Execute failed';
|
package/dist/commands/query.js
CHANGED
|
@@ -26,6 +26,7 @@ const parse_agent_message_1 = require("./parse-agent-message");
|
|
|
26
26
|
const parse_common_flags_1 = require("./parse-common-flags");
|
|
27
27
|
const resolve_prompt_1 = require("./resolve-prompt");
|
|
28
28
|
const crewx_cli_1 = require("../bootstrap/crewx-cli");
|
|
29
|
+
const inherited_trace_1 = require("../utils/inherited-trace");
|
|
29
30
|
/**
|
|
30
31
|
* Handle `crewx query <agentRef> <message>` command.
|
|
31
32
|
*
|
|
@@ -101,6 +102,7 @@ async function handleQuery(args) {
|
|
|
101
102
|
threadId: thread,
|
|
102
103
|
metadata: Object.keys(parsedMetadata).length > 0 ? parsedMetadata : undefined,
|
|
103
104
|
vars: Object.keys(vars).length > 0 ? vars : undefined,
|
|
105
|
+
trace: (0, inherited_trace_1.readInheritedTrace)(),
|
|
104
106
|
});
|
|
105
107
|
if (!result.ok) {
|
|
106
108
|
const errMsg = result.error?.message ?? 'Query failed';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { TraceContext } from '@crewx/sdk';
|
|
2
|
+
/**
|
|
3
|
+
* Read cross-process trace context from inherited environment variables.
|
|
4
|
+
*
|
|
5
|
+
* This is the ONLY place in the CLI that reads CREWX_PARENT_TASK_ID /
|
|
6
|
+
* CREWX_TRACE_ID / CREWX_CALLER_AGENT_ID. The values are passed as
|
|
7
|
+
* options.trace into crewx.query/execute so the SDK's ALS takes over
|
|
8
|
+
* from there — no direct env reads inside SDK code.
|
|
9
|
+
*
|
|
10
|
+
* Returns undefined when none of the three vars are set (root invocation).
|
|
11
|
+
*/
|
|
12
|
+
export declare function readInheritedTrace(): TraceContext | undefined;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.readInheritedTrace = readInheritedTrace;
|
|
4
|
+
/**
|
|
5
|
+
* Read cross-process trace context from inherited environment variables.
|
|
6
|
+
*
|
|
7
|
+
* This is the ONLY place in the CLI that reads CREWX_PARENT_TASK_ID /
|
|
8
|
+
* CREWX_TRACE_ID / CREWX_CALLER_AGENT_ID. The values are passed as
|
|
9
|
+
* options.trace into crewx.query/execute so the SDK's ALS takes over
|
|
10
|
+
* from there — no direct env reads inside SDK code.
|
|
11
|
+
*
|
|
12
|
+
* Returns undefined when none of the three vars are set (root invocation).
|
|
13
|
+
*/
|
|
14
|
+
function readInheritedTrace() {
|
|
15
|
+
const parentTaskId = process.env['CREWX_PARENT_TASK_ID'] || null;
|
|
16
|
+
const rootTraceId = process.env['CREWX_TRACE_ID'] || null;
|
|
17
|
+
const callerAgentId = process.env['CREWX_CALLER_AGENT_ID'] || null;
|
|
18
|
+
if (!parentTaskId && !rootTraceId && !callerAgentId)
|
|
19
|
+
return undefined;
|
|
20
|
+
return {
|
|
21
|
+
parentTaskId,
|
|
22
|
+
rootTraceId: rootTraceId ?? (parentTaskId ?? ''),
|
|
23
|
+
callerAgentId,
|
|
24
|
+
};
|
|
25
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crewx/cli",
|
|
3
|
-
"version": "0.8.8-rc.
|
|
3
|
+
"version": "0.8.8-rc.24",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=20.19.0"
|
|
@@ -23,17 +23,17 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@crewx/adapter-slack": "0.1.4",
|
|
25
25
|
"better-sqlite3": "*",
|
|
26
|
+
"@crewx/sdk": "0.8.8-rc.24",
|
|
26
27
|
"@crewx/search": "0.1.9",
|
|
27
|
-
"@crewx/sdk": "0.8.8-rc.23",
|
|
28
|
-
"@crewx/memory": "0.1.23-rc.3",
|
|
29
|
-
"@crewx/wbs": "0.1.10-rc.16",
|
|
30
28
|
"@crewx/doc": "0.1.8",
|
|
31
|
-
"@crewx/
|
|
32
|
-
"@crewx/
|
|
33
|
-
"@crewx/
|
|
34
|
-
"@crewx/
|
|
29
|
+
"@crewx/memory": "0.1.23-rc.4",
|
|
30
|
+
"@crewx/wbs": "0.1.10-rc.17",
|
|
31
|
+
"@crewx/cron": "0.1.10-rc.22",
|
|
32
|
+
"@crewx/wi": "0.1.10",
|
|
33
|
+
"@crewx/chromex": "0.1.0-rc.24",
|
|
34
|
+
"@crewx/workflow": "0.3.22-rc.4",
|
|
35
35
|
"@crewx/skill": "0.1.20",
|
|
36
|
-
"@crewx/
|
|
36
|
+
"@crewx/shared": "0.0.5"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/better-sqlite3": "*",
|