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
16 changes: 9 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions packages/api-types/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# @codespar/api-types — CHANGELOG

## 0.6.0 — 2026-11-15

### Security

- **zod 4 (GHSA-mrhx-c7xc-m3w5, core#214).** It depends on `zod ^4.6.6`. zod up to 4.6.5, and every 3.x, can exhaust memory while validating an oversized array. The schemas are now zod 4 schemas: the shapes and the inferred types are the same. A consumer that passes them to zod 3 tooling (an OpenAPI generator, for example) or composes them with its own zod 3 schemas has to move to zod 4 when it adopts 0.6.0. That is why the version is a minor: `^0.5.0` does not pick it up.

### Added

- `AuthTypeSchema` contains `two_header` (#72). It landed after 0.5.0 was published and reaches the registry with this version (core#132).
4 changes: 2 additions & 2 deletions packages/api-types/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@codespar/api-types",
"version": "0.5.0",
"version": "0.6.0",
"description": "Shared REST wire contract for the CodeSpar managed-tier API (api.codespar.dev) — Zod schemas + inferred TypeScript types",
"type": "module",
"main": "./dist/index.js",
Expand Down Expand Up @@ -45,7 +45,7 @@
"node": ">=20"
},
"dependencies": {
"zod": "^3.23.0"
"zod": "^4.6.6"
},
"devDependencies": {
"@types/node": "^25.6.0",
Expand Down
11 changes: 11 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# @codespar/sdk — CHANGELOG

## 0.16.30 — 2026-11-15

### Security

- **zod 4 (GHSA-mrhx-c7xc-m3w5, core#214).** The SDK now depends on `zod ^4.6.6`. zod up to 4.6.5, and every 3.x, can exhaust memory while validating an oversized array. `SessionConfigSchema` is now a zod 4 schema with the same shape and the same `SessionConfig` type. Code that only calls `new CodeSpar(...)` / `create(...)` changes nothing. Code that composes `SessionConfigSchema` with its own zod 3 schemas (`.extend`, `.merge`, `z.union`) has to move to zod 4.
- In the schema, `metadata` and `mocks` use the two-argument `z.record(key, value)`. What validates is the same.

### Changed

- The OpenAPI snapshot follows the served document (868a0272e249, 390 operations): `GET /v1/account/balances` gains `usdc_accounts[].seed` (the one Test top-up from the treasury, enterprise#2582), and a Shop purchase's `awaiting.reason` gains `identity_required` and `consent_required` (enterprise#2580). An exhaustive `switch` over `awaiting.reason` needs the two new cases.

## 0.16.29 — 2026-11-11

### Changed
Expand Down
70 changes: 65 additions & 5 deletions packages/core/openapi-snapshot.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@codespar/sdk",
"version": "0.16.29",
"version": "0.16.30",
"description": "Commerce SDK for AI agents \u2014 sessions, managed auth, Complete Loop orchestration for Latin American APIs",
"type": "module",
"main": "./dist/index.js",
Expand Down Expand Up @@ -59,7 +59,7 @@
},
"dependencies": {
"@codespar/types": "^0.10.1 || ^0.11.0",
"zod": "^3.24.0"
"zod": "^4.6.6"
},
"devDependencies": {
"@types/node": "^25.6.0",
Expand Down
19 changes: 15 additions & 4 deletions packages/core/src/generated/openapi.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/core/src/generated/operations.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions packages/core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ export interface LoopResult {
// validation, so the client-side schema accepts any object shape
// rather than re-encoding the rules and risking drift.
const MockValueSchema = z.union([
z.record(z.unknown()),
z.array(z.record(z.unknown())),
z.record(z.string(), z.unknown()),
z.array(z.record(z.string(), z.unknown())),
]);

/** Wire format for a project scope. Shared by the Zod session schema
Expand All @@ -131,9 +131,9 @@ export const SessionConfigSchema = z.object({
timeout: z.number().optional(),
})
.optional(),
metadata: z.record(z.string()).optional(),
metadata: z.record(z.string(), z.string()).optional(),
projectId: z.string().regex(PROJECT_ID_REGEX).optional(),
mocks: z.record(MockValueSchema).optional(),
mocks: z.record(z.string(), MockValueSchema).optional(),
});

/* ── Payables: documents and batches (/v1/payables/files, /v1/payables/batches) ── */
Expand Down
6 changes: 6 additions & 0 deletions packages/langchain/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @codespar/langchain — changelog

## 0.5.2 — 2026-11-15

### Security

- **zod 4 in development (GHSA-mrhx-c7xc-m3w5, core#214).** The dev dependency goes to `zod ^4.6.6`, and the tests import `zod/v3`, the same entry as `schema.ts`. The peer stays `zod >=3.25.0`: the package reads the classic API through `zod/v3`, which zod 3.25+ and zod 4 both ship. The input bound of 0.5.1 is unchanged. A project on zod 3 still has the advisory in its own tree; moving it to zod >= 4.6.6 is what removes it.

## 0.5.1 — 2026-11-08

### Security
Expand Down
4 changes: 2 additions & 2 deletions packages/langchain/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@codespar/langchain",
"version": "0.5.1",
"version": "0.5.2",
"description": "LangChain.js adapter for CodeSpar — convert session tools to LangChain StructuredTool format",
"type": "module",
"main": "./dist/index.js",
Expand Down Expand Up @@ -48,7 +48,7 @@
"ajv-formats": "^3.0.1",
"typescript": "^5.8.0",
"vitest": "^3.1.0",
"zod": "^3.25.0",
"zod": "^4.6.6",
"zod-to-json-schema": "^3.25.2"
}
}
2 changes: 1 addition & 1 deletion packages/langchain/src/__tests__/schema.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import { describe, it, expect } from "vitest";
import { z } from "zod";
import { z } from "zod/v3";
import {
CHARGE_DEFINITION,
CRYPTO_PAY_DEFINITION,
Expand Down
11 changes: 1 addition & 10 deletions scripts/audit-exceptions.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
{
"_comment": "Read by scripts/audit-gate.mjs. Each entry accepts ONE advisory for ONE package until `expires` (UTC date, exclusive). Only HIGH can be accepted, only when npm offers no fix inside the declared range (none, or a semver-major one). Renewing an entry is a reviewed change, not an edit to keep CI green.",
"exceptions": [
{
"id": "GHSA-mrhx-c7xc-m3w5",
"package": "zod",
"severity": "high",
"expires": "2026-11-16",
"issue": "https://github.com/codespar/codespar-core/issues/214",
"justification": "Memory exhaustion while validating oversized constrained collections: a denial of service of the process doing the validation, with no data exposure. The only fix is zod >= 4.6.6, a major that changes the public types of @codespar/api-types and @codespar/sdk consumed by codespar-enterprise and codespar-web; no patched 3.x exists. Renewed on 2026-11-09 for seven days only because of the mitigation in #245: a model's tool arguments, the untrusted input that reaches Zod in this repo, are bounded by @codespar/langchain before any schema parses them. The other parses in this repo read developer configuration and first-party API responses. Without #245 this renewal does not stand. The zod 4 migration is tracked in #214 with the coordinated bumps."
}
]
"exceptions": []
}
10 changes: 1 addition & 9 deletions scripts/publish-drift-baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,5 @@
"rather than accumulated. This file is not a place to silence new findings.",
"Regenerate a fingerprint with: node scripts/check-publish-drift.mjs --json"
],
"waivers": [
{
"name": "@codespar/api-types",
"version": "0.5.0",
"fingerprint": "d77dae43ecfca2fe5aa7fb188706fc9bc59b08b890180a9edd4ab4d2d1077c09",
"issue": "core#132",
"note": "The two_header auth type (#72) landed after 0.5.0 was published; the published AuthTypeSchema does not contain it. Additive to a schema, so 0.5.1 vs 0.6.0 is a release decision."
}
]
"waivers": []
}
Loading