@poncho-ai/harness 0.20.4 → 0.20.6

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @poncho-ai/harness@0.20.4 build /home/runner/work/poncho-ai/poncho-ai/packages/harness
2
+ > @poncho-ai/harness@0.20.6 build /Users/cesar/Dev/latitude/poncho-ai/packages/harness
3
3
  > tsup src/index.ts --format esm --dts
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -7,8 +7,8 @@
7
7
  CLI tsup v8.5.1
8
8
  CLI Target: es2022
9
9
  ESM Build start
10
- ESM dist/index.js 199.61 KB
11
- ESM ⚡️ Build success in 134ms
10
+ ESM dist/index.js 199.28 KB
11
+ ESM ⚡️ Build success in 94ms
12
12
  DTS Build start
13
- DTS ⚡️ Build success in 6692ms
13
+ DTS ⚡️ Build success in 6337ms
14
14
  DTS dist/index.d.ts 24.36 KB
@@ -0,0 +1,6 @@
1
+
2
+ > @poncho-ai/harness@0.11.2 lint /Users/cesar/Dev/latitude/poncho-ai/packages/harness
3
+ > eslint src/
4
+
5
+ sh: eslint: command not found
6
+  ELIFECYCLE  Command failed.
@@ -0,0 +1,135 @@
1
+
2
+ > @poncho-ai/harness@0.16.1 test /Users/cesar/Dev/latitude/poncho-ai/packages/harness
3
+ > vitest
4
+
5
+
6
+  RUN  v1.6.1 /Users/cesar/Dev/latitude/poncho-ai/packages/harness
7
+
8
+ ✓ test/telemetry.test.ts  (3 tests) 2ms
9
+ [event] step:completed {"type":"step:completed","step":1,"duration":1}
10
+ [event] step:started {"type":"step:started","step":2}
11
+ ✓ test/schema-converter.test.ts  (27 tests) 19ms
12
+ stdout | test/mcp.test.ts > mcp bridge protocol transports > discovers and calls tools over streamable HTTP
13
+ [poncho][mcp] {"event":"catalog.loaded","server":"remote","discoveredCount":1}
14
+ [poncho][mcp] {"event":"tools.selected","requestedPatternCount":1,"registeredCount":1,"filteredByPolicyCount":0,"filteredByIntentCount":0}
15
+
16
+ stdout | test/mcp.test.ts > mcp bridge protocol transports > selects discovered tools by requested patterns
17
+ [poncho][mcp] {"event":"catalog.loaded","server":"remote","discoveredCount":2}
18
+ [poncho][mcp] {"event":"tools.selected","requestedPatternCount":1,"registeredCount":1,"filteredByPolicyCount":0,"filteredByIntentCount":1}
19
+ [poncho][mcp] {"event":"tools.selected","requestedPatternCount":1,"registeredCount":2,"filteredByPolicyCount":0,"filteredByIntentCount":0}
20
+
21
+ ✓ test/agent-parser.test.ts  (10 tests) 24ms
22
+ stdout | test/mcp.test.ts > mcp bridge protocol transports > skips discovery when bearer token env value is missing
23
+ [poncho][mcp] {"event":"tools.selected","requestedPatternCount":1,"registeredCount":0,"filteredByPolicyCount":0,"filteredByIntentCount":0}
24
+
25
+ stderr | test/mcp.test.ts > mcp bridge protocol transports > skips discovery when bearer token env value is missing
26
+ [poncho][mcp] {"event":"auth.token_missing","server":"remote","tokenEnv":"MISSING_TOKEN_ENV"}
27
+
28
+ stdout | test/mcp.test.ts > mcp bridge protocol transports > returns actionable errors for 403 permission failures
29
+ [poncho][mcp] {"event":"catalog.loaded","server":"remote","discoveredCount":1}
30
+ [poncho][mcp] {"event":"tools.selected","requestedPatternCount":1,"registeredCount":1,"filteredByPolicyCount":0,"filteredByIntentCount":0}
31
+
32
+ ✓ test/mcp.test.ts  (6 tests) 81ms
33
+ ✓ test/memory.test.ts  (4 tests) 56ms
34
+ ✓ test/state.test.ts  (5 tests) 237ms
35
+ ✓ test/model-factory.test.ts  (4 tests) 2ms
36
+ ✓ test/agent-identity.test.ts  (2 tests) 43ms
37
+ stdout | test/harness.test.ts > agent harness > registers default filesystem tools
38
+ [poncho][mcp] {"event":"tools.cleared","reason":"initialize","requestedPatterns":[]}
39
+
40
+ stdout | test/harness.test.ts > agent harness > disables write_file by default in production environment
41
+ [poncho][mcp] {"event":"tools.cleared","reason":"initialize","requestedPatterns":[]}
42
+
43
+ stdout | test/harness.test.ts > agent harness > allows disabling built-in tools via poncho.config.js
44
+ [poncho][mcp] {"event":"tools.cleared","reason":"initialize","requestedPatterns":[]}
45
+
46
+ stdout | test/harness.test.ts > agent harness > supports per-environment tool overrides
47
+ [poncho][mcp] {"event":"tools.cleared","reason":"initialize","requestedPatterns":[]}
48
+
49
+ stdout | test/harness.test.ts > agent harness > supports per-environment tool overrides
50
+ [poncho][mcp] {"event":"tools.cleared","reason":"initialize","requestedPatterns":[]}
51
+
52
+ stdout | test/harness.test.ts > agent harness > does not auto-register exported tool objects from skill scripts
53
+ [poncho][mcp] {"event":"tools.cleared","reason":"initialize","requestedPatterns":[]}
54
+
55
+ stdout | test/harness.test.ts > agent harness > refreshes skill metadata and tools in development mode
56
+ [poncho][mcp] {"event":"tools.cleared","reason":"initialize","requestedPatterns":[]}
57
+
58
+ stdout | test/harness.test.ts > agent harness > refreshes skill metadata and tools in development mode
59
+ [poncho][mcp] {"event":"tools.cleared","reason":"skills:changed","requestedPatterns":[]}
60
+ [poncho][mcp] {"event":"tools.cleared","reason":"activate:beta","requestedPatterns":[]}
61
+
62
+ stdout | test/harness.test.ts > agent harness > prunes removed active skills after refresh in development mode
63
+ [poncho][mcp] {"event":"tools.cleared","reason":"initialize","requestedPatterns":[]}
64
+ [poncho][mcp] {"event":"tools.cleared","reason":"activate:obsolete","requestedPatterns":[]}
65
+
66
+ stdout | test/harness.test.ts > agent harness > prunes removed active skills after refresh in development mode
67
+ [poncho][mcp] {"event":"tools.cleared","reason":"skills:changed","requestedPatterns":[]}
68
+
69
+ stdout | test/harness.test.ts > agent harness > does not refresh skills outside development mode
70
+ [poncho][mcp] {"event":"tools.cleared","reason":"initialize","requestedPatterns":[]}
71
+
72
+ stdout | test/harness.test.ts > agent harness > clears active skills when skill metadata changes in development mode
73
+ [poncho][mcp] {"event":"tools.cleared","reason":"initialize","requestedPatterns":[]}
74
+ [poncho][mcp] {"event":"tools.cleared","reason":"activate:alpha","requestedPatterns":[]}
75
+
76
+ stdout | test/harness.test.ts > agent harness > clears active skills when skill metadata changes in development mode
77
+ [poncho][mcp] {"event":"tools.cleared","reason":"skills:changed","requestedPatterns":[]}
78
+
79
+ stdout | test/harness.test.ts > agent harness > lists skill scripts through list_skill_scripts
80
+ [poncho][mcp] {"event":"tools.cleared","reason":"initialize","requestedPatterns":[]}
81
+
82
+ stdout | test/harness.test.ts > agent harness > runs JavaScript/TypeScript skill scripts through run_skill_script
83
+ [poncho][mcp] {"event":"tools.cleared","reason":"initialize","requestedPatterns":[]}
84
+
85
+ stdout | test/harness.test.ts > agent harness > runs AGENT-scope scripts from root scripts directory
86
+ [poncho][mcp] {"event":"tools.cleared","reason":"initialize","requestedPatterns":[]}
87
+
88
+ stdout | test/harness.test.ts > agent harness > blocks path traversal in run_skill_script
89
+ [poncho][mcp] {"event":"tools.cleared","reason":"initialize","requestedPatterns":[]}
90
+
91
+ stdout | test/harness.test.ts > agent harness > requires allowed-tools entries for non-standard script directories
92
+ [poncho][mcp] {"event":"tools.cleared","reason":"initialize","requestedPatterns":[]}
93
+
94
+ stdout | test/harness.test.ts > agent harness > registers MCP tools dynamically for stacked active skills and supports deactivation
95
+ [poncho][mcp] {"event":"catalog.loaded","server":"remote","discoveredCount":2}
96
+ [poncho][mcp] {"event":"tools.cleared","reason":"initialize","requestedPatterns":[]}
97
+ [poncho][mcp] {"event":"tools.selected","requestedPatternCount":1,"registeredCount":1,"filteredByPolicyCount":0,"filteredByIntentCount":1}
98
+ [poncho][mcp] {"event":"tools.refreshed","reason":"activate:skill-a","requestedPatterns":["remote/a"],"registeredCount":1,"activeSkills":["skill-a"]}
99
+ [poncho][mcp] {"event":"tools.selected","requestedPatternCount":2,"registeredCount":2,"filteredByPolicyCount":0,"filteredByIntentCount":0}
100
+ [poncho][mcp] {"event":"tools.refreshed","reason":"activate:skill-b","requestedPatterns":["remote/a","remote/b"],"registeredCount":2,"activeSkills":["skill-a","skill-b"]}
101
+ [poncho][mcp] {"event":"tools.selected","requestedPatternCount":1,"registeredCount":1,"filteredByPolicyCount":0,"filteredByIntentCount":1}
102
+ [poncho][mcp] {"event":"tools.refreshed","reason":"deactivate:skill-a","requestedPatterns":["remote/b"],"registeredCount":1,"activeSkills":["skill-b"]}
103
+
104
+ stdout | test/harness.test.ts > agent harness > supports flat tool access config format
105
+ [poncho][mcp] {"event":"tools.cleared","reason":"initialize","requestedPatterns":[]}
106
+
107
+ stdout | test/harness.test.ts > agent harness > flat tool access takes priority over legacy defaults
108
+ [poncho][mcp] {"event":"tools.cleared","reason":"initialize","requestedPatterns":[]}
109
+
110
+ stdout | test/harness.test.ts > agent harness > byEnvironment overrides flat tool access
111
+ [poncho][mcp] {"event":"tools.cleared","reason":"initialize","requestedPatterns":[]}
112
+
113
+ stdout | test/harness.test.ts > agent harness > registerTools skips tools disabled via config
114
+ [poncho][mcp] {"event":"tools.cleared","reason":"initialize","requestedPatterns":[]}
115
+
116
+ stdout | test/harness.test.ts > agent harness > approval access level registers the tool but marks it for approval
117
+ [poncho][mcp] {"event":"tools.cleared","reason":"initialize","requestedPatterns":[]}
118
+
119
+ stdout | test/harness.test.ts > agent harness > tools without approval config do not require approval
120
+ [poncho][mcp] {"event":"tools.cleared","reason":"initialize","requestedPatterns":[]}
121
+
122
+ stdout | test/harness.test.ts > agent harness > allows in-flight MCP calls to finish after skill deactivation
123
+ [poncho][mcp] {"event":"catalog.loaded","server":"remote","discoveredCount":1}
124
+ [poncho][mcp] {"event":"tools.cleared","reason":"initialize","requestedPatterns":[]}
125
+ [poncho][mcp] {"event":"tools.selected","requestedPatternCount":1,"registeredCount":1,"filteredByPolicyCount":0,"filteredByIntentCount":0}
126
+ [poncho][mcp] {"event":"tools.refreshed","reason":"activate:skill-slow","requestedPatterns":["remote/slow"],"registeredCount":1,"activeSkills":["skill-slow"]}
127
+ [poncho][mcp] {"event":"tools.cleared","reason":"deactivate:skill-slow","requestedPatterns":[]}
128
+
129
+ ✓ test/harness.test.ts  (25 tests) 291ms
130
+
131
+  Test Files  9 passed (9)
132
+  Tests  86 passed (86)
133
+  Start at  17:47:43
134
+  Duration  1.88s (transform 684ms, setup 1ms, collect 2.34s, tests 755ms, environment 2ms, prepare 1.27s)
135
+
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @poncho-ai/harness
2
2
 
3
+ ## 0.20.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [`afbcc7b`](https://github.com/cesr/poncho-ai/commit/afbcc7b188258b7d193aa1f6f9f4462c2841ceec) Thanks [@cesr](https://github.com/cesr)! - Fix Latitude telemetry traces being silently dropped when conversation IDs are not valid UUIDs (e.g. Resend/Slack-derived IDs). Only pass conversationUuid to Latitude when it matches UUID v4 format.
8
+
9
+ ## 0.20.5
10
+
11
+ ### Patch Changes
12
+
13
+ - [`8286e1e`](https://github.com/cesr/poncho-ai/commit/8286e1ef244208d74e1daf8ef1c2a1a3afb1459e) Thanks [@cesr](https://github.com/cesr)! - Match Latitude telemetry integration exactly to their documented Vercel AI SDK pattern — no custom constructor options.
14
+
3
15
  ## 0.20.4
4
16
 
5
17
  ### Patch Changes
package/dist/index.js CHANGED
@@ -2637,7 +2637,6 @@ var createSubagentTools = (manager, getConversationId, getOwnerId) => [
2637
2637
 
2638
2638
  // src/harness.ts
2639
2639
  import { LatitudeTelemetry } from "@latitude-data/telemetry";
2640
- import { diag, DiagLogLevel } from "@opentelemetry/api";
2641
2640
 
2642
2641
  // src/tool-dispatcher.ts
2643
2642
  var ToolDispatcher = class {
@@ -3472,26 +3471,7 @@ var AgentHarness = class {
3472
3471
  const rawProjectId = process.env[latProjectIdEnv];
3473
3472
  const latitudeProjectId = rawProjectId ? parseInt(rawProjectId, 10) : void 0;
3474
3473
  if (telemetryEnabled && latitudeApiKey && latitudeProjectId) {
3475
- diag.setLogger(
3476
- {
3477
- error: (msg, ...args) => {
3478
- if (typeof msg === "string" && msg.includes("Attempted duplicate registration")) return;
3479
- console.error(`[poncho][otel] ${msg}`, ...args);
3480
- },
3481
- warn: () => {
3482
- },
3483
- info: () => {
3484
- },
3485
- debug: () => {
3486
- },
3487
- verbose: () => {
3488
- }
3489
- },
3490
- DiagLogLevel.ERROR
3491
- );
3492
- this.latitudeTelemetry = new LatitudeTelemetry(latitudeApiKey, {
3493
- instrumentations: {}
3494
- });
3474
+ this.latitudeTelemetry = new LatitudeTelemetry(latitudeApiKey);
3495
3475
  } else if (telemetryEnabled && latitudeBlock && (!latitudeApiKey || !latitudeProjectId)) {
3496
3476
  const missing = [];
3497
3477
  if (!latitudeApiKey) missing.push(`${latApiKeyEnv} env var`);
@@ -3667,7 +3647,9 @@ var AgentHarness = class {
3667
3647
  const projectId = parseInt(process.env[latProjectIdEnv2] ?? "", 10);
3668
3648
  const rawPath = config?.telemetry?.latitude?.path ?? this.parsedAgent?.frontmatter.name ?? "agent";
3669
3649
  const path = rawPath.replace(/[^\w\-./]/g, "-").replace(/-+/g, "-").replace(/^-+|-+$/g, "") || "agent";
3670
- const conversationUuid = input.conversationId ?? (typeof input.parameters?.__activeConversationId === "string" ? input.parameters.__activeConversationId : void 0);
3650
+ const rawConversationId = input.conversationId ?? (typeof input.parameters?.__activeConversationId === "string" ? input.parameters.__activeConversationId : void 0);
3651
+ const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
3652
+ const conversationUuid = rawConversationId && UUID_RE.test(rawConversationId) ? rawConversationId : void 0;
3671
3653
  console.info(
3672
3654
  `[poncho][telemetry] Latitude telemetry active \u2013 projectId=${projectId}, path="${path}"${conversationUuid ? `, conversation="${conversationUuid}"` : ""}`
3673
3655
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@poncho-ai/harness",
3
- "version": "0.20.4",
3
+ "version": "0.20.6",
4
4
  "description": "Agent execution runtime - conversation loop, tool dispatch, streaming",
5
5
  "repository": {
6
6
  "type": "git",
package/src/harness.ts CHANGED
@@ -32,7 +32,6 @@ import { createSkillTools, normalizeScriptPolicyPath } from "./skill-tools.js";
32
32
  import { createSubagentTools } from "./subagent-tools.js";
33
33
  import type { SubagentManager } from "./subagent-manager.js";
34
34
  import { LatitudeTelemetry } from "@latitude-data/telemetry";
35
- import { diag, DiagLogLevel } from "@opentelemetry/api";
36
35
  import {
37
36
  isSiblingScriptsPattern,
38
37
  matchesRelativeScriptPattern,
@@ -915,22 +914,7 @@ export class AgentHarness {
915
914
  const rawProjectId = process.env[latProjectIdEnv];
916
915
  const latitudeProjectId = rawProjectId ? parseInt(rawProjectId, 10) : undefined;
917
916
  if (telemetryEnabled && latitudeApiKey && latitudeProjectId) {
918
- diag.setLogger(
919
- {
920
- error: (msg, ...args) => {
921
- if (typeof msg === "string" && msg.includes("Attempted duplicate registration")) return;
922
- console.error(`[poncho][otel] ${msg}`, ...args);
923
- },
924
- warn: () => {},
925
- info: () => {},
926
- debug: () => {},
927
- verbose: () => {},
928
- },
929
- DiagLogLevel.ERROR,
930
- );
931
- this.latitudeTelemetry = new LatitudeTelemetry(latitudeApiKey, {
932
- instrumentations: {},
933
- });
917
+ this.latitudeTelemetry = new LatitudeTelemetry(latitudeApiKey);
934
918
  } else if (telemetryEnabled && latitudeBlock && (!latitudeApiKey || !latitudeProjectId)) {
935
919
  const missing: string[] = [];
936
920
  if (!latitudeApiKey) missing.push(`${latApiKeyEnv} env var`);
@@ -1132,11 +1116,16 @@ export class AgentHarness {
1132
1116
  // Sanitize path for Latitude's DOCUMENT_PATH_REGEXP: /^([\w-]+\/)*([\w-.])+$/
1133
1117
  const path = rawPath.replace(/[^\w\-./]/g, '-').replace(/-+/g, '-').replace(/^-+|-+$/g, '') || 'agent';
1134
1118
 
1135
- const conversationUuid = input.conversationId ?? (
1119
+ const rawConversationId = input.conversationId ?? (
1136
1120
  typeof input.parameters?.__activeConversationId === "string"
1137
1121
  ? input.parameters.__activeConversationId
1138
1122
  : undefined
1139
1123
  );
1124
+ // Latitude expects a UUID v4 for documentLogUuid; only pass it if valid
1125
+ const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
1126
+ const conversationUuid = rawConversationId && UUID_RE.test(rawConversationId)
1127
+ ? rawConversationId
1128
+ : undefined;
1140
1129
 
1141
1130
  console.info(
1142
1131
  `[poncho][telemetry] Latitude telemetry active – projectId=${projectId}, path="${path}"${conversationUuid ? `, conversation="${conversationUuid}"` : ""}`,