Skip to content

Add tab activate, links pagination/filtering, and text marker extraction; remove phase 09 tooling#25

Merged
dimdasci merged 9 commits into
mainfrom
feat/21-agentic-ux-lane-b
Jun 23, 2026
Merged

Add tab activate, links pagination/filtering, and text marker extraction; remove phase 09 tooling#25
dimdasci merged 9 commits into
mainfrom
feat/21-agentic-ux-lane-b

Conversation

@dimdasci

@dimdasci dimdasci commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Summary

This PR primarily delivers the Phase 10 work from docs/internal/plans/phases/10-agent-session-dx.md, then folds in the follow-up cleanup that removed the ineffective Phase 09 Pi search-tooling experiment.

Phase 10 implementation

  • add tab activate as an explicit background-handled browser action
  • add links --href-contains for substring filtering on absolute hrefs
  • fix large-response stdout truncation in the CLI output path
  • add links --offset pagination and extend links results with total / capped
  • bump protocol version from 1 to 2 and centralize version literals behind PROTOCOL_VERSION
  • add CLI-local text --after and --limit-chars post-processing

Follow-up cleanup in this branch

  • remove the Phase 09 repo-local Pi search-tooling extension and related config/scripts
  • mark Phase 09 as decommissioned in its phase log
  • bump the project version to 0.9.0 and sync versioned artifacts
  • replace LinkedIn-specific documentation wording with neutral feed/composer language
  • fix the SonarCloud issues reported on this PR

Validation

  • pnpm check
  • pnpm test
  • pnpm check-versions
  • SonarCloud PR issues: 0 open, hotspots: 0

dimdasci added 9 commits June 22, 2026 21:27
Features planned:
- tab.activate command (background-handled, follows tab.pin pattern)
- links --href-contains filter (content-script substring predicate)
- Response truncation fix + links --offset pagination
- text --after CLI-local marker extraction

Rejected:
- scroll --until-end (violates ADR-017/ADR-024)
- --activate-if-needed on destructive actions (hidden strategy)
Implement tab.activate as a background-handled browser action that
foregrounds a session-owned tab and focuses its window. Follows the
exact tab.pin pattern across all layers.

Changes:
- shared: add tab.activate to Action union, params, result, forwarded params
- cli: new tab/activate.ts command, registry classification (destructive)
- service: routing in tab-actions.ts, Zod schema
- extension: BrowserWindowsSeam interface, handleTabActivate implementation
- tests: extension unit tests, service routing test, CLI registry coverage

Closes the TAB_NOT_VISIBLE → screenshot --activate → retry workaround
by giving agents an explicit one-shot way to foreground a tab.
Phase 10, Feature 2: allow agents to filter links at extraction time
by case-sensitive substring match on the resolved absolute href.

Changes across all layers:
- shared: add hrefContains?: string to ActionParams['links']
- service: add hrefContains to links Zod schema
- cli: add --href-contains flag, wire to params
- extension: apply filter after toLinkInfo, before limit cap
- tests: extension unit tests (match/no-match/empty/undefined/limit)
         and CLI param wiring test

Filter semantics:
- Case-sensitive .includes() on absolute URL
- Empty string matches everything (no-op)
- undefined means no filter (standard omission)
- Applied before limit cap: --limit 5 --href-contains '/in/' returns
  at most 5 matching links, not 5 links then filtered

Refs: #21
Part A — Truncation fix:
- executeExitPlan uses synchronous writeFileSync(fd=1) for stdout
  when no test stream is injected, preventing pipe-buffer truncation
  on payloads >64KB (root cause of 'unterminated string at char 65200')
- Added regression test with 250-entry links response (>64KB)

Part B — links --offset pagination:
- ActionParams['links'] gains offset?: number
- ActionResult['links'] changes to { links, total, capped? }
- Extension handleLinks refactored: collect-then-slice with
  MAX_COLLECTION_CAP (2000) safety bound
- CLI adds --offset flag (non-negative integer)
- Service Zod schema adds offset validation
- Daemon decorateReadHandles preserves total/capped fields

All 845 tests pass. pnpm check clean.
Breaking wire change: ActionResult['links'] now requires 'total: number'
field (offset pagination, Feature 3B). Old extensions that omit 'total'
produce incompatible responses.

Cohesion-of-name refactoring:
- All scattered protocol_version/protocolVersion literals replaced with
  the PROTOCOL_VERSION constant imported from @bproxy/shared
- Future version bumps are a single-line change in shared/src/version.ts
- Type definitions use 'typeof PROTOCOL_VERSION' for compile-time safety

Test improvements:
- Compile-time assertion for ActionResult['links'] shape (_LinksResult)
- Extension: capped behavior test (MAX_COLLECTION_CAP boundary, 2001 links)
- CLI: offset/limit parsing validation tests (+9)
- Service: schema coverage for offset/hrefContains (+3)

53 files changed, 858 tests passing, pnpm check green.
@dimdasci dimdasci changed the title Remove phase 09 tooling and neutralize docs Complete phase 10 agent session DX; remove phase 09 tooling Jun 23, 2026
@dimdasci dimdasci changed the title Complete phase 10 agent session DX; remove phase 09 tooling Add tab activate, links pagination/filtering, and text marker extraction; remove phase 09 tooling Jun 23, 2026
@dimdasci
dimdasci merged commit 392aead into main Jun 23, 2026
5 checks passed
@dimdasci
dimdasci deleted the feat/21-agentic-ux-lane-b branch June 23, 2026 10:27
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant