Skip to content

ZZfive/SourcePort

Repository files navigation

SourcePort

Stable, diagnosable, evidence-preserving access to specified web sources for AI agents.

SourcePort turns source-specific retrieval paths—public HTTP, OpenCLI adapters, logged-in browser sessions, and human-assisted recovery—into explicit source operations with structured results and provenance.

Boundary

SourcePort is an information-access layer. It is responsible for:

  • source capability discovery;
  • source-specific operations and versioned schemas;
  • ordered backend routing and fallback;
  • authentication, captcha, rate-limit, timeout, and drift diagnosis;
  • structured data plus raw evidence and retrieval metadata;
  • fixtures, contract tests, live probes, and recovery guidance.

SourcePort does not own cross-source recommendation or domain decisions. A consumer skill may use SourcePort to research cars, housing, or another domain, but filtering and ranking remain outside the core.

First validation slice

The first consumer is a car-research skill backed by Dongchedi and Autohome source adapters. It validates that SourcePort can retrieve exact series, trim, configuration, price, and review evidence without turning the core into a car decision engine.

Current MVP status

  • Core request/result contracts, evidence, failure taxonomy, redaction, capability registry, bounded routing, diagnostics, and circuit breaking are implemented.
  • The CLI discovers and executes registered operations.
  • Autohome list-brand-series and get-series-score have passed live end-to-end retrieval through SourcePort.
  • Dongchedi search-series, list-trims, and get-trim-configuration have passed live end-to-end retrieval through the logged-in OpenCLI Browser Bridge. Exact-trim results retain the full configuration sheet and separately model claimed assistance level, concrete capabilities, operating domains, perception hardware, optional equipment, and unknown system/vendor fields.
  • The car-research consumer, doctor, and cache are not yet complete.

Development

npm install --ignore-scripts
npm run typecheck
npm test
npm run build

Discover and run operations through the built CLI:

node packages/cli/dist/main.js sources
node packages/cli/dist/main.js capabilities autohome
node packages/cli/dist/main.js run autohome list-brand-series \
  --input '{"brand":"宝马","limit":5}'
node packages/cli/dist/main.js run autohome get-series-score \
  --input '{"seriesId":"6548"}'

For Dongchedi's logged-in fallback:

  1. Install and enable the OpenCLI Chrome extension.
  2. Log in to Dongchedi in that Chrome profile and keep Chrome open.
  3. Confirm the bridge with node_modules/.bin/opencli doctor.
  4. Run:
node packages/cli/dist/main.js run dongchedi search-series \
  --input '{"keyword":"宝马X5","limit":5}'
node packages/cli/dist/main.js run dongchedi list-trims \
  --input '{"seriesId":"5273","status":"online"}'
node packages/cli/dist/main.js run dongchedi get-trim-configuration \
  --input '{"trimId":"255925"}'

The public backend is tried first. When it returns the observed login state, SourcePort follows the explicit switch_backend recovery to the logged-in browser backend. It does not copy cookies into the repository or bypass access verification.

Design documents

See:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages