Skip to content

Commit 0a64b32

Browse files
jonathanMLDevzhocursoragent
authored
feat: phase 1 export trim — remove experimental block builders from public API (#166)
Remove buildQueryExperimental and buildGuidedQueryExperimental from package root and /alliance re-exports. PineconeClient return types and Zod response schemas remain public. Add MIGRATION.md guidance, CHANGELOG entry, and export-surface regression test. Co-authored-by: zho <jornathanm910923@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 435dcdd commit 0a64b32

4 files changed

Lines changed: 38 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,18 @@ Tagged releases are published to npm from GitHub Actions when a **GitHub Release
2424
- **Breaking (core):** `resolveConfig` requires a Pinecone index name and no longer applies Alliance index/rerank defaults. Removed exported `DEFAULT_INDEX_NAME` and `DEFAULT_RERANK_MODEL` from the package root. Rerank is opt-in when `PINECONE_RERANK_MODEL` / `rerankModel` is unset.
2525
- **Breaking (core):** `setupCoreServer` MCP `instructions` use `CORE_SERVER_INSTRUCTIONS` (no `guided_query` / `suggest_query_params`). `resolveConfig` defaults `disableSuggestFlow` to `true` so `query` / `count` / `query_documents` work without Alliance tools. Alliance CLI / `resolveAllianceConfig` unchanged: gate on by default, `ALLIANCE_SERVER_INSTRUCTIONS`.
2626
- **Alliance CLI / `resolveAllianceConfig`:** When index or rerank env/CLI values are omitted, defaults remain `rag-hybrid` and `bge-reranker-v2-m3` (API-key-only MCP configs unchanged). See [examples/alliance/.env.example](examples/alliance/.env.example).
27+
- **Breaking (library):** Trimmed public re-exports — `buildQueryExperimental` and `buildGuidedQueryExperimental` removed from package root and `/alliance` entry. See [MIGRATION.md](docs/MIGRATION.md#unreleased-trimmed-library-exports).
28+
29+
### Added
30+
31+
- Zod schemas for all nine MCP tool success responses (`queryResponseSchema`, `guidedQueryResponseSchema`, etc.) exported from the package root for client-side validation. Success payloads are runtime-validated before return.
32+
- Stable vs experimental response field taxonomy documented in [docs/TOOLS.md](docs/TOOLS.md) and [docs/deprecation-policy.md](docs/deprecation-policy.md#stable-vs-experimental-mcp-response-fields).
33+
- Formal deprecation policy ([docs/deprecation-policy.md](docs/deprecation-policy.md)) and breaking-change release notes template ([docs/templates/breaking-change-release-notes.md](docs/templates/breaking-change-release-notes.md)).
34+
35+
### Removed
36+
37+
- **Breaking (library):** `buildQueryExperimental` and `buildGuidedQueryExperimental` are no longer re-exported from `@will-cppa/pinecone-read-only-mcp` or `@will-cppa/pinecone-read-only-mcp/alliance`. They were internal helpers used to assemble the `experimental` block on `query` / `query_documents` / `guided_query` success payloads. The assembled fields and Zod schemas (`queryResponseSchema`, `QueryExperimental`, etc.) are unchanged — see [Unreleased stable vs experimental](docs/MIGRATION.md#unreleased-stable-vs-experimental-response-fields).
38+
- **No change:** `HybridQueryResult`, `HybridLegFailed`, and `KeywordIndexNamespacesResult` remain exported as the declared return types of public `PineconeClient` methods.
2739

2840
## [0.2.0] - 2026-05-29
2941

docs/MIGRATION.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,23 @@ When no experimental fields apply, the `experimental` key is **omitted** (not an
6969

7070
**Promotion:** Moving a field from `experimental` to stable requires CHANGELOG, TOOLS.md, and schema updates per [deprecation-policy.md § Stable vs experimental](./deprecation-policy.md#stable-vs-experimental-mcp-response-fields).
7171

72+
## Unreleased: trimmed library exports
73+
74+
**Who is affected:** Library embedders that imported `buildQueryExperimental` or `buildGuidedQueryExperimental` from `@will-cppa/pinecone-read-only-mcp` or `/alliance`.
75+
76+
**Before:**
77+
78+
```ts
79+
import { buildQueryExperimental } from '@will-cppa/pinecone-read-only-mcp';
80+
```
81+
82+
**After:** These helpers are internal to the server. Options:
83+
84+
1. Invoke the relevant MCP tool handler and parse the success payload with `queryResponseSchema` / `guidedQueryResponseSchema`.
85+
2. Build the `experimental` object yourself to match `QueryExperimental` if you control the response shape.
86+
87+
`PineconeClient.query()` return types (`HybridQueryResult`, etc.) and all Zod response schemas remain on the public surface.
88+
7289
## Unreleased: `ServerContext` instance APIs (phase 1)
7390

7491
**Rationale:** Process-global singletons (Pinecone client slot, config, URL registry, suggest-flow gate, namespaces cache) complicate testing and multi-tenant embedding. Phase 1 introduces an opt-in **`ServerContext`** without removing legacy getters.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { describe, expect, it } from 'vitest';
2+
import * as core from '../index.js';
3+
4+
describe('public export surface', () => {
5+
it('does not export internal experimental block builders', () => {
6+
expect('buildQueryExperimental' in core).toBe(false);
7+
expect('buildGuidedQueryExperimental' in core).toBe(false);
8+
});
9+
});

src/core/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ export type { MetadataFilterValidationError } from './server/metadata-filter.js'
2626
export { toolErrorSchema } from './server/tool-error.js';
2727
export type { ToolError, ToolErrorCode } from './server/tool-error.js';
2828
export {
29-
buildGuidedQueryExperimental,
30-
buildQueryExperimental,
3129
countResponseSchema,
3230
generateUrlsResponseSchema,
3331
guidedQueryResponseSchema,

0 commit comments

Comments
 (0)