@poncho-ai/harness 0.16.0 → 0.16.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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @poncho-ai/harness@0.16.0 build /Users/cesar/Dev/latitude/poncho-ai/packages/harness
2
+ > @poncho-ai/harness@0.16.1 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 185.71 KB
11
- ESM ⚡️ Build success in 140ms
10
+ ESM dist/index.js 187.36 KB
11
+ ESM ⚡️ Build success in 91ms
12
12
  DTS Build start
13
- DTS ⚡️ Build success in 7525ms
13
+ DTS ⚡️ Build success in 3621ms
14
14
  DTS dist/index.d.ts 22.38 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @poncho-ai/harness
2
2
 
3
+ ## 0.16.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`7475da5`](https://github.com/cesr/poncho-ai/commit/7475da5c0c2399e79064a2622137c0eb2fb16871) Thanks [@cesr](https://github.com/cesr)! - Inject browser usage context into agent system prompt (auth flow, session persistence, tool selection guidance).
8
+
3
9
  ## 0.16.0
4
10
 
5
11
  ### Minor Changes
package/dist/index.js CHANGED
@@ -3538,9 +3538,29 @@ var AgentHarness = class {
3538
3538
  const developmentContext = this.environment === "development" ? `
3539
3539
 
3540
3540
  ${DEVELOPMENT_MODE_CONTEXT}` : "";
3541
+ const browserContext = this._browserSession ? `
3542
+
3543
+ ## Browser Tools
3544
+
3545
+ The user has a live browser viewport displayed alongside the conversation. They can see everything the browser shows in real time and interact with it directly (click, type, scroll, paste).
3546
+
3547
+ ### Authentication
3548
+ When a website requires authentication or credentials, do NOT ask the user to send them in the chat. Instead, navigate to the login page and let the user enter their credentials directly in the browser viewport. Wait for them to confirm they have logged in before continuing.
3549
+
3550
+ ### Session persistence
3551
+ Browser sessions (cookies, localStorage, login state) are automatically saved and restored across conversations. If the user logged into a website in a previous conversation, that session is likely still active. Try navigating directly to the authenticated page before asking the user to log in again.
3552
+
3553
+ ### Reading page content
3554
+ - Use \`browser_content\` to read the visible text on a page. This is fast and token-efficient.
3555
+ - Use \`browser_snapshot\` to get the accessibility tree with interactive element refs for clicking and typing.
3556
+ - Use \`browser_screenshot\` only when you need to see visual layout or images. Screenshots consume significantly more tokens.
3557
+ - The accessibility tree may be sparse on some pages. If \`browser_snapshot\` returns little or no content, fall back to \`browser_content\` or \`browser_screenshot\`.
3558
+
3559
+ ### Tabs and resources
3560
+ Each conversation gets its own browser tab sharing a single browser instance. Call \`browser_close\` when done to free the tab. If you don't close it, the tab stays open and the user can continue interacting with it.` : "";
3541
3561
  const promptWithSkills = this.skillContextWindow ? `${systemPrompt}${developmentContext}
3542
3562
 
3543
- ${this.skillContextWindow}` : `${systemPrompt}${developmentContext}`;
3563
+ ${this.skillContextWindow}${browserContext}` : `${systemPrompt}${developmentContext}${browserContext}`;
3544
3564
  const mainMemory = this.memoryStore ? await this.memoryStore.getMainMemory() : void 0;
3545
3565
  const boundedMainMemory = mainMemory && mainMemory.content.length > 4e3 ? `${mainMemory.content.slice(0, 4e3)}
3546
3566
  ...[truncated]` : mainMemory?.content;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@poncho-ai/harness",
3
- "version": "0.16.0",
3
+ "version": "0.16.1",
4
4
  "description": "Agent execution runtime - conversation loop, tool dispatch, streaming",
5
5
  "repository": {
6
6
  "type": "git",
package/src/harness.ts CHANGED
@@ -1210,9 +1210,29 @@ export class AgentHarness {
1210
1210
  });
1211
1211
  const developmentContext =
1212
1212
  this.environment === "development" ? `\n\n${DEVELOPMENT_MODE_CONTEXT}` : "";
1213
+ const browserContext = this._browserSession
1214
+ ? `\n\n## Browser Tools
1215
+
1216
+ The user has a live browser viewport displayed alongside the conversation. They can see everything the browser shows in real time and interact with it directly (click, type, scroll, paste).
1217
+
1218
+ ### Authentication
1219
+ When a website requires authentication or credentials, do NOT ask the user to send them in the chat. Instead, navigate to the login page and let the user enter their credentials directly in the browser viewport. Wait for them to confirm they have logged in before continuing.
1220
+
1221
+ ### Session persistence
1222
+ Browser sessions (cookies, localStorage, login state) are automatically saved and restored across conversations. If the user logged into a website in a previous conversation, that session is likely still active. Try navigating directly to the authenticated page before asking the user to log in again.
1223
+
1224
+ ### Reading page content
1225
+ - Use \`browser_content\` to read the visible text on a page. This is fast and token-efficient.
1226
+ - Use \`browser_snapshot\` to get the accessibility tree with interactive element refs for clicking and typing.
1227
+ - Use \`browser_screenshot\` only when you need to see visual layout or images. Screenshots consume significantly more tokens.
1228
+ - The accessibility tree may be sparse on some pages. If \`browser_snapshot\` returns little or no content, fall back to \`browser_content\` or \`browser_screenshot\`.
1229
+
1230
+ ### Tabs and resources
1231
+ Each conversation gets its own browser tab sharing a single browser instance. Call \`browser_close\` when done to free the tab. If you don't close it, the tab stays open and the user can continue interacting with it.`
1232
+ : "";
1213
1233
  const promptWithSkills = this.skillContextWindow
1214
- ? `${systemPrompt}${developmentContext}\n\n${this.skillContextWindow}`
1215
- : `${systemPrompt}${developmentContext}`;
1234
+ ? `${systemPrompt}${developmentContext}\n\n${this.skillContextWindow}${browserContext}`
1235
+ : `${systemPrompt}${developmentContext}${browserContext}`;
1216
1236
  const mainMemory = this.memoryStore
1217
1237
  ? await this.memoryStore.getMainMemory()
1218
1238
  : undefined;