pi-agent-browser-native 0.2.17 → 0.2.19

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/CHANGELOG.md CHANGED
@@ -2,6 +2,22 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.2.19 - 2026-05-03
6
+
7
+ ### Fixed
8
+ - resolve relative Pi package sources from the settings file directory in `pi-agent-browser-doctor`, so global settings that point at a local checkout are detected correctly
9
+
10
+ ## 0.2.18 - 2026-05-03
11
+
12
+ ### Fixed
13
+ - persist oversized parse-failure spill files when Pi provides a session directory without a session file
14
+ - isolate the opt-in real-upstream download contract test from the user's global Downloads folder and avoid killing unrelated `agent-browser` processes
15
+
16
+ ### Changed
17
+ - clarified the README and repo guidance for the current published package state
18
+ - marked the completed implementation plan as superseded so current design guidance stays canonical
19
+ - tightened the implicit-session idle-timeout helper to return milliseconds as a number and convert to an environment string only at the process boundary
20
+
5
21
  ## 0.2.17 - 2026-05-03
6
22
 
7
23
  ### Fixed
package/README.md CHANGED
@@ -4,9 +4,9 @@ Native `pi` integration for [`agent-browser`](https://agent-browser.dev/).
4
4
 
5
5
  ## Status
6
6
 
7
- Early working scaffold.
7
+ Published pre-1.0 package.
8
8
 
9
- The package scaffold, native `agent_browser` tool, local typecheck/test setup, and release/package verification workflow are in place.
9
+ The native `agent_browser` tool, local verification workflow, package-content checks, and release checks are in place. Package install is the default path; checkout loading is for development and validation.
10
10
 
11
11
  ## Goal
12
12
 
@@ -45,7 +45,7 @@ A native `pi` integration can improve on the current skill by adding:
45
45
 
46
46
  ## Install and try
47
47
 
48
- The product direction is package-first. Prefer the package source once a release exists, while keeping the local-checkout flow for current development and pre-release validation.
48
+ The product direction is package-first. Prefer the package source for normal use; keep the local-checkout flow for development and pre-release validation.
49
49
 
50
50
  ### Preferred package install
51
51
 
@@ -1216,17 +1216,12 @@ function buildSessionDetailFields(sessionName: string | undefined, usedImplicitS
1216
1216
  function getPersistentSessionArtifactStore(ctx: {
1217
1217
  sessionManager: {
1218
1218
  getSessionDir?: () => string;
1219
- getSessionFile?: () => string | undefined;
1220
1219
  getSessionId: () => string | undefined;
1221
1220
  };
1222
1221
  }): PersistentSessionArtifactStore | undefined {
1223
- const sessionFile = typeof ctx.sessionManager.getSessionFile === "function" ? ctx.sessionManager.getSessionFile() : undefined;
1224
1222
  const sessionDir = typeof ctx.sessionManager.getSessionDir === "function" ? ctx.sessionManager.getSessionDir() : undefined;
1225
1223
  const sessionId = ctx.sessionManager.getSessionId();
1226
- if (!sessionFile || !sessionDir || !sessionId) {
1227
- return undefined;
1228
- }
1229
- return { sessionDir, sessionId };
1224
+ return sessionDir && sessionId ? { sessionDir, sessionId } : undefined;
1230
1225
  }
1231
1226
 
1232
1227
  async function preserveParseFailureOutput(options: {
@@ -1360,7 +1355,7 @@ export default function agentBrowserExtension(pi: ExtensionAPI) {
1360
1355
  const ephemeralSessionSeed = createEphemeralSessionSeed();
1361
1356
  const hasBraveApiKey = hasUsableBraveApiKey();
1362
1357
  const toolPromptGuidelines = buildToolPromptGuidelines({ includeBraveSearch: hasBraveApiKey });
1363
- const implicitSessionIdleTimeoutMs = getImplicitSessionIdleTimeoutMs();
1358
+ const implicitSessionIdleTimeoutMs = String(getImplicitSessionIdleTimeoutMs());
1364
1359
  const implicitSessionCloseTimeoutMs = getImplicitSessionCloseTimeoutMs();
1365
1360
  let managedSessionActive = false;
1366
1361
  let managedSessionBaseName = createImplicitSessionName(undefined, process.cwd(), ephemeralSessionSeed);
@@ -421,12 +421,10 @@ function parseTimeoutMs(rawValue: string | undefined, minimumValue: number): num
421
421
  return parsedValue;
422
422
  }
423
423
 
424
- export function getImplicitSessionIdleTimeoutMs(env: NodeJS.ProcessEnv = process.env): string {
425
- return String(
426
- parseTimeoutMs(env[IMPLICIT_SESSION_IDLE_TIMEOUT_ENV], 0) ??
427
- parseTimeoutMs(env[AGENT_BROWSER_IDLE_TIMEOUT_ENV], 0) ??
428
- DEFAULT_IMPLICIT_SESSION_IDLE_TIMEOUT_MS,
429
- );
424
+ export function getImplicitSessionIdleTimeoutMs(env: NodeJS.ProcessEnv = process.env): number {
425
+ return parseTimeoutMs(env[IMPLICIT_SESSION_IDLE_TIMEOUT_ENV], 0) ??
426
+ parseTimeoutMs(env[AGENT_BROWSER_IDLE_TIMEOUT_ENV], 0) ??
427
+ DEFAULT_IMPLICIT_SESSION_IDLE_TIMEOUT_MS;
430
428
  }
431
429
 
432
430
  export function getImplicitSessionCloseTimeoutMs(env: NodeJS.ProcessEnv = process.env): number {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-agent-browser-native",
3
- "version": "0.2.17",
3
+ "version": "0.2.19",
4
4
  "description": "pi extension that exposes agent-browser as a native tool for browser automation",
5
5
  "type": "module",
6
6
  "author": "Mitch Fultz (https://github.com/fitchmultz)",
@@ -125,7 +125,7 @@ function isPathLikeSource(source) {
125
125
  return source.startsWith("/") || source.startsWith("./") || source.startsWith("../") || source.startsWith("~");
126
126
  }
127
127
 
128
- function sourceLooksLikeThisPackage(source, cwd) {
128
+ function sourceLooksLikeThisPackage(source, cwd, sourceBaseDir = cwd) {
129
129
  const text = String(source ?? "").trim();
130
130
  if (text.length === 0) return false;
131
131
  if (/^npm:pi-agent-browser-native(?:@|$)/.test(text)) return true;
@@ -133,12 +133,13 @@ function sourceLooksLikeThisPackage(source, cwd) {
133
133
  if (text.includes(REPO_URL_FRAGMENT)) return true;
134
134
 
135
135
  if (!isPathLikeSource(text)) return false;
136
- const resolvedSource = resolve(cwd, expandUserPath(text));
136
+ const resolvedSource = resolve(sourceBaseDir, expandUserPath(text));
137
137
  const cwdEntrypoint = resolve(cwd, EXTENSION_ENTRYPOINT);
138
138
  const packageEntrypoint = resolve(THIS_PACKAGE_ROOT, EXTENSION_ENTRYPOINT);
139
139
  return (
140
140
  resolvedSource === cwd ||
141
141
  resolvedSource === cwdEntrypoint ||
142
+ resolvedSource === THIS_PACKAGE_ROOT ||
142
143
  resolvedSource === packageEntrypoint ||
143
144
  isInsidePath(cwdEntrypoint, resolvedSource) ||
144
145
  isInsidePath(packageEntrypoint, resolvedSource)
@@ -223,15 +224,16 @@ function entrySource(entry) {
223
224
 
224
225
  function collectSettingsSources(settings, settingsPath, cwd) {
225
226
  const sources = [];
227
+ const sourceBaseDir = dirname(settingsPath);
226
228
  for (const [index, entry] of arrayEntries(settings?.packages)) {
227
229
  const source = entrySource(entry);
228
- if (sourceLooksLikeThisPackage(source, cwd)) {
230
+ if (sourceLooksLikeThisPackage(source, cwd, sourceBaseDir)) {
229
231
  sources.push({ kind: "package", source: String(source), location: `${settingsPath} packages[${index}]` });
230
232
  }
231
233
  }
232
234
  for (const [index, entry] of arrayEntries(settings?.extensions)) {
233
235
  const source = entrySource(entry);
234
- if (sourceLooksLikeThisPackage(source, cwd)) {
236
+ if (sourceLooksLikeThisPackage(source, cwd, sourceBaseDir)) {
235
237
  sources.push({ kind: "extension", source: String(source), location: `${settingsPath} extensions[${index}]` });
236
238
  }
237
239
  }