Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ body:
attributes:
label: Version
description: Output of `vapi --version`
placeholder: "0.17.4"
placeholder: "0.17.5"
validations: { required: true }
- type: dropdown
id: surface
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ sentence under it is the summary shown on the

## Unreleased

## 0.17.5 - 2026-12-03

`vapi task fund` can renew an expired, unused USDC authorization without counting the replacement twice against spend caps.

### Fixed

- `vapi task fund` can request a new USDC authorization after vAPI or confirmed chain state proves an earlier authorization expired unused, including when a pool was already created or the signer was interrupted. The replacement counts once against spend caps.

## 0.17.4 - 2026-12-02

Pools with claims work in the CLI: `vapi task claim`, `show`, `cancel … pool` and `board` read them again.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ vAPI Network is not related to Vapi.ai, the voice AI company.

## Quickstart

This README describes client 0.17.4. `npm view vapi-network version` shows the latest published release.
This README describes client 0.17.5. `npm view vapi-network version` shows the latest published release.
The client needs Node.js 22 or newer.

```bash
Expand Down
2 changes: 1 addition & 1 deletion docs/wallets.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ vapi
This screen comes from a vault restored from the BIP-39 test phrase into an empty home, so the account holds nothing and is not linked yet:

```text
vAPI 0.17.4 home /tmp/vapi-docs-home registry api.vapinetwork.ai
vAPI 0.17.5 home /tmp/vapi-docs-home registry api.vapinetwork.ai

Owner not linked console: https://api.vapinetwork.ai/agents
Vault unlocked on this device (macOS Keychain) backup: vapi backup
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vapi-network-workspace",
"version": "0.17.4",
"version": "0.17.5",
"private": true,
"description": "Open-source, non-custodial access to x402 APIs",
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vapi-network/cli",
"version": "0.17.4",
"version": "0.17.5",
"description": "Command-line interface for the non-custodial vAPI Network wallet",
"license": "Apache-2.0",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/version.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// Kept in sync with packages/cli/package.json by version.test.ts. The CLI is
// bundled into a single file, so it cannot read its own manifest at runtime.
export const CLI_VERSION = "0.17.4";
export const CLI_VERSION = "0.17.5";
2 changes: 1 addition & 1 deletion packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ basis points, or the registry label and computed percentage for legacy fees.
| `validatePrivateKey` | function (value: string): Hex | 0.5.0 or earlier |
| `validateRecoveryPhrase` | function (phrase: string): string | 0.5.0 or earlier |
| `VAPI_BUILDER_CODE` | constant VAPI_BUILDER_CODE: "vapi" | 0.5.0 or earlier |
| `VAPI_CLIENT_VERSION` | constant VAPI_CLIENT_VERSION: "0.17.4" | 0.4.0 |
| `VAPI_CLIENT_VERSION` | constant VAPI_CLIENT_VERSION: "0.17.5" | 0.4.0 |
| `WALLET_NAME_PATTERN` | constant WALLET_NAME_PATTERN: RegExp | 0.5.0 or earlier |
| `walletEntrySchema` | constant walletEntrySchema: ZodObject<{ createdAt: ZodISODateTime; label: ZodOptional<ZodString>; spendCaps: ZodObject<{ perCallAtomic: ZodString; perDayAtomic: ZodString; }, $strip>; routerRefill: ZodOptional<...>; link: ZodOptional<...>; }, $strip> | 0.5.0 or earlier |
| `walletNameSchema` | constant walletNameSchema: ZodString | 0.5.0 or earlier |
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vapi-network/core",
"version": "0.17.4",
"version": "0.17.5",
"description": "Non-custodial x402 protocol, wallet policy, discovery, and receipts core",
"license": "Apache-2.0",
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/router-client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3290,7 +3290,7 @@ describe("Router purchase credit and receipt guards", () => {
paymentId: "purchase_1234567890",
phases: { requestMs: 100 },
policy: { capsApplied: true },
client: { name: "vapi-network", version: "0.17.4" },
client: { name: "vapi-network", version: "0.17.5" },
resourceUrl: `${API_BASE}/api/router/top-up/5`,
settlement: { outcome: "unknown" },
outcome: "settlement_unknown",
Expand Down Expand Up @@ -3337,7 +3337,7 @@ describe("Router purchase credit and receipt guards", () => {
paymentId: "purchase_1234567890",
phases: { requestMs: 100 },
policy: { capsApplied: true },
client: { name: "vapi-network", version: "0.17.4" },
client: { name: "vapi-network", version: "0.17.5" },
outcome: "paid",
});
const raw = await readFile(receiptsPath, "utf8");
Expand Down
51 changes: 51 additions & 0 deletions packages/core/src/spend-policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,57 @@ export async function releaseSpend(
});
}

type TaskFundingReservationLookup = {
ledgerPath: string;
wallet: WalletName;
taskKey: string;
reservationId: string;
now: Date;
};

function matchesTaskFundingReservation(
entry: z.infer<typeof spendReservationSchema>,
input: TaskFundingReservationLookup,
) {
return (
entry.id === input.reservationId &&
entry.kind === "escrow-funding" &&
(entry.taskKey === undefined || entry.taskKey === input.taskKey)
);
}

/** Whether this preparation has reserved funding spend on any stored day. */
export async function hasTaskFundingReservation(input: TaskFundingReservationLookup) {
const rows = await readStoredSpendLedgerRows(input.ledgerPath, input.now, true);
return rows.some(
(row) =>
row.wallet === input.wallet &&
row.reservations?.some((entry) => matchesTaskFundingReservation(entry, input)),
);
}

/** Releases the exact reservation after its funding authorization is proven unusable. */
export async function releaseTaskFundingReservation(
input: TaskFundingReservationLookup,
): Promise<void> {
await withLedgerLock(input.ledgerPath, async () => {
const rows = await readStoredSpendLedgerRows(input.ledgerPath, input.now, true);
let released = false;
for (const row of rows) {
if (row.wallet !== input.wallet) continue;
const reservation = row.reservations?.find((entry) =>
matchesTaskFundingReservation(entry, input),
);
if (!reservation) continue;
const remaining = BigInt(row.spentAtomic) - BigInt(reservation.amountAtomic);
row.spentAtomic = (remaining > 0n ? remaining : 0n).toString();
row.reservations = row.reservations!.filter((entry) => entry !== reservation);
released = true;
}
if (released) await writeLedgerAtomically(input.ledgerPath, rows);
});
}

function parseAtomicCap(value: string, label: string): bigint {
if (!/^\d+$/.test(value)) {
throw new Error(`Invalid ${label} spend cap ${JSON.stringify(value)}.`);
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/status.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function linkedAccount(): AgentLink {

function deps(home: string, wallets: WalletStore, overrides: Partial<StatusDeps> = {}): StatusDeps {
return {
version: "0.17.4",
version: "0.17.5",
home,
registry: "https://api.vapinetwork.ai",
wallets,
Expand Down Expand Up @@ -123,7 +123,7 @@ describe("buildStatus", () => {
await expect(
buildStatus(deps(home, wallets, { registry: "https://api.vapinetwork.ai/" })),
).resolves.toEqual({
version: "0.17.4",
version: "0.17.5",
home,
registry: "https://api.vapinetwork.ai",
vault: {
Expand Down Expand Up @@ -170,7 +170,7 @@ describe("buildStatus", () => {
);

expect(report).toEqual({
version: "0.17.4",
version: "0.17.5",
home,
registry: "https://api.vapinetwork.ai",
owner: {
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/support-report.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ describe("support reports", () => {
expect(result).toMatchObject({
path: join(reportsDirectory, "2026-09-10T08-09-10-123Z.json"),
issueUrl:
"https://github.com/vAPI-Network/vapi-network/issues/new?template=bug.yml&title=payment%20failed%20oddly&version=0.17.4",
"https://github.com/vAPI-Network/vapi-network/issues/new?template=bug.yml&title=payment%20failed%20oddly&version=0.17.5",
report: {
message: "payment failed oddly",
clientVersion: "0.17.4",
clientVersion: "0.17.5",
os: { platform: "test-os", release: "1.2.3", arch: "test-arch" },
node: "v22.0.0-test",
receiptIds: ["receipt-1", "receipt-2", "receipt-3", "receipt-4", "receipt-5"],
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/support-report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { DEFAULT_REGISTRY_URL, getVapiPaths } from "./config.js";
import { createPublicFetch, type LookupFn } from "./net-guard.js";
import { readReceipts } from "./receipts.js";

export const VAPI_CLIENT_VERSION = "0.17.4";
export const VAPI_CLIENT_VERSION = "0.17.5";

export type SupportSystemInfo = {
platform: string;
Expand Down
10 changes: 8 additions & 2 deletions packages/core/src/tasks/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ export type TasksRequestOptions = { signal?: AbortSignal };
/** Retain the same key when retrying the same mutation. The client never retries automatically. */
export type TasksMutationOptions = TasksRequestOptions & { idempotencyKey: string };

type TaskV2OperationBody = {
step: string;
transactionHash?: string;
proof?: "expired-authorization";
};

const tasksClientErrorBrand = Symbol.for("@vapi-network/core/TasksClientError");

export class TasksClientError extends Error {
Expand Down Expand Up @@ -381,7 +387,7 @@ export function createTasksClient(options: TasksClientOptions): TasksClientV2 {
operationV2(
id: string,
mode: "transaction" | "reconcile" | "recover" | "abandon",
body: { step: string; transactionHash?: string },
body: TaskV2OperationBody,
call: TasksMutationOptions,
) {
input(taskV2StepSchema, body.step);
Expand Down Expand Up @@ -912,7 +918,7 @@ export type TasksClient = {
operationV2?(
id: string,
mode: "transaction" | "reconcile" | "recover" | "abandon",
body: { step: string; transactionHash?: string },
body: TaskV2OperationBody,
call: TasksMutationOptions,
): Promise<
| z.infer<typeof taskV2OperationResponseSchema>
Expand Down
Loading
Loading