{"version":3,"file":"pi-user-agent.d.ts","sourceRoot":"","sources":["../../src/utils/pi-user-agent.ts"],"names":[],"mappings":"AAIA,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAGtD;AAED;;;;GAIG;AACH,eAAO,MAAM,+BAA+B,WAAW,CAAC;AAExD;;;;;;;;;;;GAWG;AACH,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAGnE","sourcesContent":["import { APP_NAME } from \"../config.ts\";\n\n// Function name kept as-is (upstream-merge friendly); the emitted UA string\n// follows the configured app name (\"phi/<version> (...)\" for phi-code).\nexport function getPiUserAgent(version: string): string {\n\tconst runtime = process.versions.bun ? `bun/${process.versions.bun}` : `node/${process.version}`;\n\treturn `${APP_NAME}/${version} (${process.platform}; ${runtime}; ${process.arch})`;\n}\n\n/**\n * Upstream pi release whose model schema phi-code's model layer (phi-code-ai) implements.\n * Keep it equal to the phi-code-ai package version: bump it when an upstream merge moves\n * the internal packages (a regression test compares the two).\n */\nexport const PI_MODEL_CATALOG_COMPAT_VERSION = \"0.84.2\";\n\n/**\n * User-Agent for the pi.dev model catalog (`/api/models/providers/<id>`).\n *\n * pi.dev only serves a schema-compatible catalog revision to clients whose User-Agent\n * matches `pi/<version> (...)` (pi scripts/model-catalog-protocol.ts): it redirects them\n * to `?pi-version=<version>` and picks the newest revision whose minimumPiVersion does\n * not exceed it. Any other User-Agent, including `phi/<version>`, gets the latest\n * revision, whose schema may be newer than what phi-code-ai understands. Announcing the\n * upstream base version (never phi's own 0.99.x, which pi.dev would read as a newer pi)\n * selects the revision phi was built against. phi stays identifiable in the comment part,\n * which the protocol's pattern accepts.\n */\nexport function getModelCatalogUserAgent(appVersion: string): string {\n\tconst runtime = process.versions.bun ? `bun/${process.versions.bun}` : `node/${process.version}`;\n\treturn `pi/${PI_MODEL_CATALOG_COMPAT_VERSION} (${process.platform}; ${runtime}; ${process.arch}; ${APP_NAME}/${appVersion})`;\n}\n"]}