Skip to content

chore(deps): bump pi-ai to 0.83.0 - #6

Open
1amKhush wants to merge 8 commits into
ContextVM:masterfrom
1amKhush:chore/pi-ai-0.83
Open

chore(deps): bump pi-ai to 0.83.0#6
1amKhush wants to merge 8 commits into
ContextVM:masterfrom
1amKhush:chore/pi-ai-0.83

Conversation

@1amKhush

@1amKhush 1amKhush commented Aug 4, 2026

Copy link
Copy Markdown

Summary

Updates @earendil-works/pi-ai from ^0.80.3 to ^0.83.0 across the muxll workspace.

This PR is independent of the live FX and ledger-storage follow-up.

Changes

  • Updated @earendil-works/pi-ai in:
    • @muxll/server
    • @muxll/client
    • @muxll/cli
    • @muxll/proxy
    • @muxll/test-utils
  • Refreshed bun.lock.
  • Updated the transitive TypeBox dependency from 1.1.38 to 1.3.7.

Compatibility review

  • Muxll already uses the Models API and supported provider subpaths.
  • Existing imports from the core entrypoint and providers/* remain supported.
  • No migration to @earendil-works/pi-ai/compat was required.
  • Muxll does not use the deprecated TypeBox APIs removed in 0.83.

Verification

  • Typecheck passes.
  • Lint passes.
  • Non-proxy test suite: 69 passed, 2 skipped, 0 failed.
  • Runtime checks for the core and providers/all exports pass.
  • No source compatibility changes were required.

Refs #1

ContextVM-org and others added 8 commits July 4, 2026 12:20
- Introduce model visibility policies via MUXLL_MODELS_ALLOW / DENY and config file
- Add gated admin tools (admin.models.setPolicy, admin.balance.credit) controlled by MUXLL_ADMIN_PUBKEYS
- Implement prepaid billing infrastructure: ledger DB, markup, min charge, option to enable via MUXLL_BILLING
- Update ENV example and developer docs to reflect new capabilities and code organization
Copilot AI lite review requested due to automatic review settings August 4, 2026 17:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the workspace to @earendil-works/pi-ai@^0.83.0 and, beyond the dependency bump, introduces new server/client capabilities around model visibility policy, admin tooling, CEP-8 payments-backed prepaid billing, and forwarding of reasoning_effort into provider-specific “thinking” options.

Changes:

  • Bumped @earendil-works/pi-ai to ^0.83.0 across packages and refreshed bun.lock (including TypeBox 1.1.38 → 1.3.7).
  • Added model catalog policy (models.list search/limit + hidden-model behavior in chat.complete) with admin policy mutation tools.
  • Implemented opt-in billing plumbing (ledger + markup pricing + CEP-8 payment gating + CLI/client balance/topup flows) with new end-to-end test coverage.

Reviewed changes

Copilot reviewed 29 out of 30 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
README.md Documents model policy/admin tools and billing/top-up CLI usage.
packages/test-utils/package.json Bumps @earendil-works/pi-ai dev dependency to ^0.83.0.
packages/server/tests/pricing.test.ts Adds regression tests for free-output cap behavior.
packages/server/tests/policy.test.ts Adds end-to-end tests for model policy behavior and admin gating.
packages/server/tests/integration.test.ts Adds mapReasoning tests and reasoning-effort forwarding coverage.
packages/server/tests/catalog.test.ts Adds unit tests for catalog/policy match/merge/patch behavior.
packages/server/tests/billing.test.ts Adds end-to-end billing + CEP-8 top-up tests over mock relay.
packages/server/src/wire.ts Adds mapReasoning provider/API dispatch for reasoning/thinking options.
packages/server/src/server.ts Threads catalog + billing into tool registration; adds admin + balance tools; wraps transport with server payments.
packages/server/src/pricing.ts Introduces PriceBook and computeOutputCap logic for markup pricing + balance-based output caps.
packages/server/src/payments.ts Adds CEP-8 resolvePrice policy (waive/reject chat; quote topups).
packages/server/src/main.ts Adds policy persistence, billing env wiring, and NWC payment processor setup.
packages/server/src/ledger.ts Adds SQLite-backed prepaid ledger for balances and usage history.
packages/server/src/index.ts Re-exports new server-side catalog/billing/payment utilities as public API.
packages/server/src/catalog.ts Implements policy-layered model catalog for list + resolve.
packages/server/package.json Bumps @earendil-works/pi-ai to ^0.83.0.
packages/proxy/package.json Bumps @earendil-works/pi-ai dev dependency to ^0.83.0.
packages/core/src/index.ts Adds new tool methods + schemas for models.list params, policy tools, balance tools, and reasoning_effort.
packages/client/tests/client.test.ts Adds CEP-8 rejection/top-up flow test using consistent client identity.
packages/client/src/index.ts Exports balance response types from client package.
packages/client/src/client.ts Adds CEP-8 client payments transport, enhanced stream rejection handling, listModels params, and balance/topup calls.
packages/client/package.json Bumps @earendil-works/pi-ai dev dependency to ^0.83.0.
packages/cli/tests/cli.test.ts Adds tests for CLI error formatting and top-up hinting.
packages/cli/src/index.ts Adds balance/topup commands, CEP-8 payment handler, and improved error formatting.
packages/cli/package.json Moves @contextvm/sdk to dependencies; bumps @earendil-works/pi-ai dev dependency.
design/idea.md Adds an “idea” document (currently conflicts with newly implemented billing direction).
design/billing.md Adds billing design doc (currently marked “not yet implemented” despite Phase 1 code in this PR).
bun.lock Updates lockfile for pi-ai 0.83.0 and TypeBox 1.3.7.
AGENTS.md Updates contributor guidance to reflect new catalog/policy/billing surfaces.
.env.example Documents new env vars for model policy, admin tools, and billing.
Suppressed comments (1)

README.md:249

  • The README links to docs/idea.md, but that file doesn't exist (the PR adds design/idea.md). This currently points readers to a dead link.
[`docs/idea.md`](docs/idea.md) for the original design note.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md
files are intentionally out of scope for now.
and without streaming) and model listing. Billing is in progress (Phase 1:
a prepaid USD balance ledger funded by admin grants, with a markup over
upstream cost); see [`docs/billing.md`](docs/billing.md) for the design.
Comment on lines +89 to +98
const billingEnabled = process.env.MUXLL_BILLING === "1";
const ledger = billingEnabled
? new Ledger(process.env.MUXLL_LEDGER_DB ?? "muxll-ledger.sqlite")
: undefined;
const priceBook = billingEnabled
? new PriceBook({
markupPct: Number(process.env.MUXLL_MARKUP_PCT ?? 0),
minChargeUsd: Number(process.env.MUXLL_MIN_CHARGE_USD ?? 0),
})
: undefined;
Comment thread packages/cli/src/index.ts
Comment on lines +164 to +173
export function formatCliError(error: unknown): string {
const message = error instanceof Error ? error.message : String(error);
const code =
typeof error === "object" && error !== null && "code" in error
? (error as { code?: unknown }).code
: undefined;
return code === -32000 && message.includes("insufficient balance")
? `${message}\nRun: muxll topup --usd 0.05`
: message;
}
Comment on lines +175 to +176
if ("reject" in cap) throw new Error(cap.reason);
maxTokens = cap.maxTokens;
Comment thread design/billing.md
Comment on lines +3 to +7
Status: **design** (not yet implemented). This document is the reference for the
next iteration. It supersedes the "Pricing & quotas — out of scope" line in
`README.md` and the matching deferral in `docs/idea.md`; it does **not** change
the inference-adapter principle in `VISION.md` (see
[Architectural tension](#architectural-tension) below).
Comment thread design/idea.md
Comment on lines +9 to +13
For now, we don’t need to worry about pricing or charging for usage since we first want to validate this proof of concept for development purposes. Once everything is in place, we can explore paid options. For now, let’s focus solely on the router and proxy so we can serve LLM inference through our server.

The goal is for operators to plug in APIs from providers—for example—and serve them through our CVM server.

We will implement this in TypeScript, using the CVM SDK and the pi SDK. Codebased and docs are available at the `docs` directory. We also have an example of a server implementing streaming api at `cordn` directory. Also all cvm docs are available as well. No newline at end of file
Comment on lines 125 to +131
/** Register chat.complete and models.list on an McpServer. */
export function registerTools(server: McpServer, models: Models): void {
export function registerTools(
server: McpServer,
models: Models,
catalog: Catalog,
billingOpts?: { ledger: Ledger; priceBook: PriceBook },
): void {
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.

3 participants