@volcengine/tls-observer-trae 0.0.2
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 +20 -0
- package/dist/config.d.ts +4 -0
- package/dist/contextfs.d.ts +12 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +2604 -0
- package/dist/state.d.ts +8 -0
- package/dist/stdin.d.ts +1 -0
- package/dist/tracer.d.ts +3 -0
- package/dist/types.d.ts +78 -0
- package/hooks/hooks.json +49 -0
- package/package.json +30 -0
package/README.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# @volcengine/tls-observer-trae
|
|
2
|
+
|
|
3
|
+
Trae observability runtime. It reads Trae hook input, builds a turn snapshot from hook events, converts it with the shared Trae adapter, and sends it through `runTracePipeline`.
|
|
4
|
+
|
|
5
|
+
The preferred installer is `@volcengine/tls-observer-trae-install`.
|
|
6
|
+
|
|
7
|
+
The runtime handles four Trae hooks:
|
|
8
|
+
|
|
9
|
+
- `UserPromptSubmit`: records turn start state and does not send a trace.
|
|
10
|
+
- `PreToolUse`: records tool call input and local start time.
|
|
11
|
+
- `PostToolUse`: records tool call output and completes the tool span data.
|
|
12
|
+
- `Stop`: records the final assistant output, attaches token usage to the root span when present, builds a trace snapshot, and sends it.
|
|
13
|
+
|
|
14
|
+
## Environment
|
|
15
|
+
|
|
16
|
+
- `TRAE_TLS_ENV_FILE`: optional env file path.
|
|
17
|
+
- `TRAE_TLS_DATA_ROOT`: runtime state and send logs.
|
|
18
|
+
- `TRAE_TLS_REGION`, `TRAE_TLS_ENDPOINT`, `TRAE_TLS_TRACE_TOPIC_ID`, `TRAE_TLS_API_KEY` or `TRAE_TLS_AK`/`TRAE_TLS_SK`: TLS export config.
|
|
19
|
+
- `TRAE_TLS_CAPTURE_CONTENT=0`: disable prompt/response/tool payload capture.
|
|
20
|
+
- `TRAE_TLS_DIAGNOSTIC_LOG_MAX_FILES`: max diagnostic log files, default `3`.
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Config, ContextFsTurn, HookInput } from './types';
|
|
2
|
+
export declare function sessionIdFromInput(input: HookInput): string | undefined;
|
|
3
|
+
export declare function turnIdFromInput(input: HookInput): string | undefined;
|
|
4
|
+
export declare function contextFsEnvStatus(env?: NodeJS.ProcessEnv): ContextFsTurn['envStatus'] & {
|
|
5
|
+
missing: string[];
|
|
6
|
+
};
|
|
7
|
+
export declare function readContextFsTurn(options: {
|
|
8
|
+
config: Config;
|
|
9
|
+
sessionId: string;
|
|
10
|
+
turnId?: string;
|
|
11
|
+
env?: NodeJS.ProcessEnv;
|
|
12
|
+
}): Promise<ContextFsTurn>;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { loadConfig, loadEnvFile } from './config';
|
|
2
|
+
export { contextFsEnvStatus, readContextFsTurn, sessionIdFromInput, turnIdFromInput } from './contextfs';
|
|
3
|
+
export { traceTraeSession } from './tracer';
|
|
4
|
+
export type { Config, ContextFsTurn, HookInput, TraceTraeOptions } from './types';
|