@poncho-ai/harness 0.50.5 → 0.51.1
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/.turbo/turbo-build.log +5 -5
- package/CHANGELOG.md +23 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +7 -5
- package/package.json +2 -2
- package/src/harness.ts +7 -3
- package/src/orchestrator/run-conversation-turn.ts +7 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @poncho-ai/harness@0.
|
|
2
|
+
> @poncho-ai/harness@0.51.1 build /home/runner/work/poncho-ai/poncho-ai/packages/harness
|
|
3
3
|
> node scripts/embed-docs.js && tsup src/index.ts --format esm --dts
|
|
4
4
|
|
|
5
5
|
[embed-docs] Generated poncho-docs.ts with 4 topics
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
[34mCLI[39m tsup v8.5.1
|
|
9
9
|
[34mCLI[39m Target: es2022
|
|
10
10
|
[34mESM[39m Build start
|
|
11
|
-
[32mESM[39m [1mdist/index.js [22m[32m535.
|
|
11
|
+
[32mESM[39m [1mdist/index.js [22m[32m535.75 KB[39m
|
|
12
12
|
[32mESM[39m [1mdist/isolate-F2PPSUL6.js [22m[32m53.82 KB[39m
|
|
13
|
-
[32mESM[39m ⚡️ Build success in
|
|
13
|
+
[32mESM[39m ⚡️ Build success in 234ms
|
|
14
14
|
[34mDTS[39m Build start
|
|
15
|
-
[32mDTS[39m ⚡️ Build success in
|
|
16
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[32m91.
|
|
15
|
+
[32mDTS[39m ⚡️ Build success in 7701ms
|
|
16
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m91.75 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @poncho-ai/harness
|
|
2
2
|
|
|
3
|
+
## 0.51.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`3c72a7f`](https://github.com/cesr/poncho-ai/commit/3c72a7f0861dbe2c623931e3a08e1a89a14554b1) Thanks [@cesr](https://github.com/cesr)! - harness: forward `suppressTelemetry` through `runConversationTurn` and `continueFromToolResult`.
|
|
8
|
+
|
|
9
|
+
`RunConversationTurnOpts` and `continueFromToolResult`'s input now carry `suppressTelemetry`, passed into the run input (alongside the existing `disablePromptCache` passthrough). Hosts driving turns through these helpers (rather than calling `runWithTelemetry` directly) can now suppress telemetry per turn and per approval-resume — the missing piece for serving telemetry-off (incognito) turns and their continuations from a single shared harness.
|
|
10
|
+
|
|
11
|
+
## 0.51.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [`773f113`](https://github.com/cesr/poncho-ai/commit/773f11309e2410d6c5e17af0fde17425953105f2) Thanks [@cesr](https://github.com/cesr)! - harness: add a per-run `suppressTelemetry` flag so one harness can serve both telemetry-on and telemetry-off runs.
|
|
16
|
+
|
|
17
|
+
Telemetry was effectively an instance-level property: whether the OTLP exporter is attached is decided at construction, so a host that wants telemetry-off runs (e.g. incognito) had to build and maintain a _second_ harness instance with no exporter — duplicating all per-harness provisioning (tool registration, subagent manager, etc.) and risking drift between the two.
|
|
18
|
+
|
|
19
|
+
`RunInput.suppressTelemetry` lets a single harness — built once, with the exporter attached — emit nothing for a given run: the `invoke_agent` root span, the `execute_tool` spans, and the AI-SDK spans are all gated on `!input.suppressTelemetry`. Hosts can now keep one harness per user and pass `suppressTelemetry: true` per run instead of routing to a parallel exporter-less instance.
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Updated dependencies [[`773f113`](https://github.com/cesr/poncho-ai/commit/773f11309e2410d6c5e17af0fde17425953105f2)]:
|
|
24
|
+
- @poncho-ai/sdk@1.13.0
|
|
25
|
+
|
|
3
26
|
## 0.50.5
|
|
4
27
|
|
|
5
28
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -1450,6 +1450,9 @@ declare class AgentHarness {
|
|
|
1450
1450
|
tenantId?: string;
|
|
1451
1451
|
parameters?: Record<string, unknown>;
|
|
1452
1452
|
abortSignal?: AbortSignal;
|
|
1453
|
+
/** Emit no telemetry for the continuation run (e.g. resuming an
|
|
1454
|
+
* incognito turn after an approval). */
|
|
1455
|
+
suppressTelemetry?: boolean;
|
|
1453
1456
|
}): AsyncGenerator<AgentEvent>;
|
|
1454
1457
|
runToCompletion(input: RunInput): Promise<HarnessRunOutput>;
|
|
1455
1458
|
}
|
|
@@ -2162,6 +2165,12 @@ interface RunConversationTurnOpts {
|
|
|
2162
2165
|
* harness skips the Anthropic cache write.
|
|
2163
2166
|
*/
|
|
2164
2167
|
disablePromptCache?: boolean;
|
|
2168
|
+
/**
|
|
2169
|
+
* Forwarded to `RunInput.suppressTelemetry`. Set true to emit no telemetry
|
|
2170
|
+
* for this run (e.g. an incognito / telemetry-off turn) even on a harness
|
|
2171
|
+
* built with an OTLP exporter attached.
|
|
2172
|
+
*/
|
|
2173
|
+
suppressTelemetry?: boolean;
|
|
2165
2174
|
/** Per-event hook — called for every AgentEvent yielded by the run, in order. */
|
|
2166
2175
|
onEvent?: (event: AgentEvent) => void | Promise<void>;
|
|
2167
2176
|
}
|
package/dist/index.js
CHANGED
|
@@ -10169,7 +10169,7 @@ var AgentHarness = class _AgentHarness {
|
|
|
10169
10169
|
* child spans (LLM calls via AI SDK, tool execution) group under one trace.
|
|
10170
10170
|
*/
|
|
10171
10171
|
async *runWithTelemetry(input) {
|
|
10172
|
-
if (this.hasOtlpExporter && this.otlpTracerProvider) {
|
|
10172
|
+
if (this.hasOtlpExporter && this.otlpTracerProvider && !input.suppressTelemetry) {
|
|
10173
10173
|
const tracer = this.otlpTracerProvider.getTracer("gen_ai");
|
|
10174
10174
|
const agentName = this.parsedAgent?.frontmatter.name ?? "agent";
|
|
10175
10175
|
const rootSpan = tracer.startSpan(`invoke_agent ${agentName}`, {
|
|
@@ -10863,7 +10863,7 @@ ${textContent}` };
|
|
|
10863
10863
|
abortSignal: input.abortSignal,
|
|
10864
10864
|
...typeof maxTokens === "number" ? { maxTokens } : {},
|
|
10865
10865
|
experimental_telemetry: {
|
|
10866
|
-
isEnabled: telemetryEnabled && this.hasOtlpExporter,
|
|
10866
|
+
isEnabled: telemetryEnabled && this.hasOtlpExporter && !input.suppressTelemetry,
|
|
10867
10867
|
recordInputs: true,
|
|
10868
10868
|
recordOutputs: true
|
|
10869
10869
|
}
|
|
@@ -11254,7 +11254,7 @@ ${textContent}` };
|
|
|
11254
11254
|
return;
|
|
11255
11255
|
}
|
|
11256
11256
|
const toolSpans = /* @__PURE__ */ new Map();
|
|
11257
|
-
if (this.hasOtlpExporter && this.otlpTracerProvider) {
|
|
11257
|
+
if (this.hasOtlpExporter && this.otlpTracerProvider && !input.suppressTelemetry) {
|
|
11258
11258
|
const tracer = this.otlpTracerProvider.getTracer("gen_ai");
|
|
11259
11259
|
for (const call of approvedCalls) {
|
|
11260
11260
|
const toolDef = this.dispatcher.get(call.name);
|
|
@@ -11610,7 +11610,8 @@ ${this.skillFingerprint}`;
|
|
|
11610
11610
|
conversationId: input.conversationId,
|
|
11611
11611
|
tenantId: input.tenantId,
|
|
11612
11612
|
parameters: input.parameters,
|
|
11613
|
-
abortSignal: input.abortSignal
|
|
11613
|
+
abortSignal: input.abortSignal,
|
|
11614
|
+
suppressTelemetry: input.suppressTelemetry
|
|
11614
11615
|
});
|
|
11615
11616
|
}
|
|
11616
11617
|
async runToCompletion(input) {
|
|
@@ -13807,7 +13808,8 @@ var runConversationTurn = async (opts) => {
|
|
|
13807
13808
|
messages: harnessMessages,
|
|
13808
13809
|
files: opts.files && opts.files.length > 0 ? opts.files : void 0,
|
|
13809
13810
|
abortSignal: opts.abortSignal,
|
|
13810
|
-
disablePromptCache: opts.disablePromptCache
|
|
13811
|
+
disablePromptCache: opts.disablePromptCache,
|
|
13812
|
+
suppressTelemetry: opts.suppressTelemetry
|
|
13811
13813
|
},
|
|
13812
13814
|
initialContextTokens: conversation.contextTokens ?? 0,
|
|
13813
13815
|
initialContextWindow: conversation.contextWindow ?? 0,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@poncho-ai/harness",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.51.1",
|
|
4
4
|
"description": "Agent execution runtime - conversation loop, tool dispatch, streaming",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"mustache": "^4.2.0",
|
|
35
35
|
"yaml": "^2.4.0",
|
|
36
36
|
"zod": "^3.22.0",
|
|
37
|
-
"@poncho-ai/sdk": "1.
|
|
37
|
+
"@poncho-ai/sdk": "1.13.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"esbuild": ">=0.17.0",
|
package/src/harness.ts
CHANGED
|
@@ -2049,7 +2049,7 @@ export class AgentHarness {
|
|
|
2049
2049
|
* child spans (LLM calls via AI SDK, tool execution) group under one trace.
|
|
2050
2050
|
*/
|
|
2051
2051
|
async *runWithTelemetry(input: RunInput): AsyncGenerator<AgentEvent> {
|
|
2052
|
-
if (this.hasOtlpExporter && this.otlpTracerProvider) {
|
|
2052
|
+
if (this.hasOtlpExporter && this.otlpTracerProvider && !input.suppressTelemetry) {
|
|
2053
2053
|
const tracer = this.otlpTracerProvider.getTracer("gen_ai");
|
|
2054
2054
|
const agentName = this.parsedAgent?.frontmatter.name ?? "agent";
|
|
2055
2055
|
|
|
@@ -2975,7 +2975,7 @@ Code is wrapped in an async IIFE — use \`return\` to return a value to the too
|
|
|
2975
2975
|
abortSignal: input.abortSignal,
|
|
2976
2976
|
...(typeof maxTokens === "number" ? { maxTokens } : {}),
|
|
2977
2977
|
experimental_telemetry: {
|
|
2978
|
-
isEnabled: telemetryEnabled && this.hasOtlpExporter,
|
|
2978
|
+
isEnabled: telemetryEnabled && this.hasOtlpExporter && !input.suppressTelemetry,
|
|
2979
2979
|
recordInputs: true,
|
|
2980
2980
|
recordOutputs: true,
|
|
2981
2981
|
},
|
|
@@ -3461,7 +3461,7 @@ Code is wrapped in an async IIFE — use \`return\` to return a value to the too
|
|
|
3461
3461
|
// OTel GenAI execute_tool spans for tool call visibility in traces
|
|
3462
3462
|
type OtelSpan = ReturnType<ReturnType<typeof trace.getTracer>["startSpan"]>;
|
|
3463
3463
|
const toolSpans = new Map<string, OtelSpan>();
|
|
3464
|
-
if (this.hasOtlpExporter && this.otlpTracerProvider) {
|
|
3464
|
+
if (this.hasOtlpExporter && this.otlpTracerProvider && !input.suppressTelemetry) {
|
|
3465
3465
|
const tracer = this.otlpTracerProvider.getTracer("gen_ai");
|
|
3466
3466
|
for (const call of approvedCalls) {
|
|
3467
3467
|
const toolDef = this.dispatcher.get(call.name);
|
|
@@ -3825,6 +3825,9 @@ Code is wrapped in an async IIFE — use \`return\` to return a value to the too
|
|
|
3825
3825
|
tenantId?: string;
|
|
3826
3826
|
parameters?: Record<string, unknown>;
|
|
3827
3827
|
abortSignal?: AbortSignal;
|
|
3828
|
+
/** Emit no telemetry for the continuation run (e.g. resuming an
|
|
3829
|
+
* incognito turn after an approval). */
|
|
3830
|
+
suppressTelemetry?: boolean;
|
|
3828
3831
|
}): AsyncGenerator<AgentEvent> {
|
|
3829
3832
|
const messages = [...input.messages];
|
|
3830
3833
|
const lastMsg = messages[messages.length - 1];
|
|
@@ -3883,6 +3886,7 @@ Code is wrapped in an async IIFE — use \`return\` to return a value to the too
|
|
|
3883
3886
|
tenantId: input.tenantId,
|
|
3884
3887
|
parameters: input.parameters,
|
|
3885
3888
|
abortSignal: input.abortSignal,
|
|
3889
|
+
suppressTelemetry: input.suppressTelemetry,
|
|
3886
3890
|
});
|
|
3887
3891
|
}
|
|
3888
3892
|
|
|
@@ -68,6 +68,12 @@ export interface RunConversationTurnOpts {
|
|
|
68
68
|
* harness skips the Anthropic cache write.
|
|
69
69
|
*/
|
|
70
70
|
disablePromptCache?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Forwarded to `RunInput.suppressTelemetry`. Set true to emit no telemetry
|
|
73
|
+
* for this run (e.g. an incognito / telemetry-off turn) even on a harness
|
|
74
|
+
* built with an OTLP exporter attached.
|
|
75
|
+
*/
|
|
76
|
+
suppressTelemetry?: boolean;
|
|
71
77
|
/** Per-event hook — called for every AgentEvent yielded by the run, in order. */
|
|
72
78
|
onEvent?: (event: AgentEvent) => void | Promise<void>;
|
|
73
79
|
}
|
|
@@ -210,6 +216,7 @@ export const runConversationTurn = async (
|
|
|
210
216
|
files: opts.files && opts.files.length > 0 ? opts.files : undefined,
|
|
211
217
|
abortSignal: opts.abortSignal,
|
|
212
218
|
disablePromptCache: opts.disablePromptCache,
|
|
219
|
+
suppressTelemetry: opts.suppressTelemetry,
|
|
213
220
|
},
|
|
214
221
|
initialContextTokens: conversation.contextTokens ?? 0,
|
|
215
222
|
initialContextWindow: conversation.contextWindow ?? 0,
|