@smthrs/observability 0.33.0 → 0.34.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 +5 -4
- package/src/SmithersEvent.ts +25 -0
- package/src/detectCaptureMode.js +6 -1
- package/src/index.d.ts +22 -0
- package/src/metrics/index.d.ts +22 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smthrs/observability",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.34.0",
|
|
4
4
|
"description": "Concrete Smithers metrics, logging, tracing, and observability integrations",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -31,9 +31,10 @@
|
|
|
31
31
|
"grafana/"
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@effect/opentelemetry": "4.0.0-beta.
|
|
35
|
-
"@effect/platform-bun": "4.0.0-beta.
|
|
36
|
-
"effect": "4.0.0-beta.
|
|
34
|
+
"@effect/opentelemetry": "4.0.0-beta.105",
|
|
35
|
+
"@effect/platform-bun": "4.0.0-beta.105",
|
|
36
|
+
"@effect/platform-node-shared": "4.0.0-beta.105",
|
|
37
|
+
"effect": "4.0.0-beta.105"
|
|
37
38
|
},
|
|
38
39
|
"devDependencies": {
|
|
39
40
|
"@types/bun": "latest",
|
package/src/SmithersEvent.ts
CHANGED
|
@@ -432,6 +432,31 @@ export type SmithersEvent =
|
|
|
432
432
|
iteration: number;
|
|
433
433
|
timestampMs: number;
|
|
434
434
|
}
|
|
435
|
+
| {
|
|
436
|
+
type: "SteerQueued";
|
|
437
|
+
runId: string;
|
|
438
|
+
nodeId: string;
|
|
439
|
+
steerId: string;
|
|
440
|
+
message: string;
|
|
441
|
+
author?: string;
|
|
442
|
+
timestampMs: number;
|
|
443
|
+
}
|
|
444
|
+
| {
|
|
445
|
+
type: "SteerConsumed";
|
|
446
|
+
runId: string;
|
|
447
|
+
nodeId: string;
|
|
448
|
+
iteration: number;
|
|
449
|
+
attempt: number;
|
|
450
|
+
steerId: string;
|
|
451
|
+
timestampMs: number;
|
|
452
|
+
}
|
|
453
|
+
| {
|
|
454
|
+
type: "SteerExpired";
|
|
455
|
+
runId: string;
|
|
456
|
+
nodeId: string;
|
|
457
|
+
steerId: string;
|
|
458
|
+
timestampMs: number;
|
|
459
|
+
}
|
|
435
460
|
| {
|
|
436
461
|
type: "ToolCallStarted";
|
|
437
462
|
runId: string;
|
package/src/detectCaptureMode.js
CHANGED
|
@@ -9,13 +9,18 @@ import { detectAgentFamily } from "./detectAgentFamily.js";
|
|
|
9
9
|
*/
|
|
10
10
|
export function detectCaptureMode(agent) {
|
|
11
11
|
const family = detectAgentFamily(agent);
|
|
12
|
+
const constructorName = String(agent?.constructor?.name ?? "").toLowerCase();
|
|
12
13
|
const mode = agent?.opts?.mode ?? agent?.mode;
|
|
13
14
|
if (family === "pi") {
|
|
14
15
|
if (mode === "rpc") return "rpc-events";
|
|
15
16
|
if (mode === "json") return "cli-json-stream";
|
|
16
17
|
return "cli-text";
|
|
17
18
|
}
|
|
18
|
-
|
|
19
|
+
// NanocodexAgent consumes its private JSONL bridge internally and exposes
|
|
20
|
+
// already-decoded assistant text through onStdout plus sanitized lifecycle
|
|
21
|
+
// events through onEvent. Parsing that text again as Codex CLI JSONL creates
|
|
22
|
+
// false truncated-json-stream warnings and loses valid deltas.
|
|
23
|
+
if (family === "codex") return constructorName.includes("nanocodexagent") ? "cli-text" : "cli-json-stream";
|
|
19
24
|
const outputFormat = agent?.opts?.outputFormat ?? agent?.outputFormat;
|
|
20
25
|
if (family === "openai" || family === "anthropic") return "sdk-events";
|
|
21
26
|
if (outputFormat === "stream-json") return "cli-json-stream";
|
package/src/index.d.ts
CHANGED
|
@@ -491,6 +491,28 @@ type SmithersEvent$2 = {
|
|
|
491
491
|
nodeId: string;
|
|
492
492
|
iteration: number;
|
|
493
493
|
timestampMs: number;
|
|
494
|
+
} | {
|
|
495
|
+
type: "SteerQueued";
|
|
496
|
+
runId: string;
|
|
497
|
+
nodeId: string;
|
|
498
|
+
steerId: string;
|
|
499
|
+
message: string;
|
|
500
|
+
author?: string;
|
|
501
|
+
timestampMs: number;
|
|
502
|
+
} | {
|
|
503
|
+
type: "SteerConsumed";
|
|
504
|
+
runId: string;
|
|
505
|
+
nodeId: string;
|
|
506
|
+
iteration: number;
|
|
507
|
+
attempt: number;
|
|
508
|
+
steerId: string;
|
|
509
|
+
timestampMs: number;
|
|
510
|
+
} | {
|
|
511
|
+
type: "SteerExpired";
|
|
512
|
+
runId: string;
|
|
513
|
+
nodeId: string;
|
|
514
|
+
steerId: string;
|
|
515
|
+
timestampMs: number;
|
|
494
516
|
} | {
|
|
495
517
|
type: "ToolCallStarted";
|
|
496
518
|
runId: string;
|
package/src/metrics/index.d.ts
CHANGED
|
@@ -478,6 +478,28 @@ type SmithersEvent$2 = {
|
|
|
478
478
|
nodeId: string;
|
|
479
479
|
iteration: number;
|
|
480
480
|
timestampMs: number;
|
|
481
|
+
} | {
|
|
482
|
+
type: "SteerQueued";
|
|
483
|
+
runId: string;
|
|
484
|
+
nodeId: string;
|
|
485
|
+
steerId: string;
|
|
486
|
+
message: string;
|
|
487
|
+
author?: string;
|
|
488
|
+
timestampMs: number;
|
|
489
|
+
} | {
|
|
490
|
+
type: "SteerConsumed";
|
|
491
|
+
runId: string;
|
|
492
|
+
nodeId: string;
|
|
493
|
+
iteration: number;
|
|
494
|
+
attempt: number;
|
|
495
|
+
steerId: string;
|
|
496
|
+
timestampMs: number;
|
|
497
|
+
} | {
|
|
498
|
+
type: "SteerExpired";
|
|
499
|
+
runId: string;
|
|
500
|
+
nodeId: string;
|
|
501
|
+
steerId: string;
|
|
502
|
+
timestampMs: number;
|
|
481
503
|
} | {
|
|
482
504
|
type: "ToolCallStarted";
|
|
483
505
|
runId: string;
|