@cyanheads/mcp-ts-core 0.8.13 → 0.8.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/CLAUDE.md +5 -3
  2. package/README.md +14 -1
  3. package/changelog/0.8.x/0.8.14.md +33 -0
  4. package/changelog/0.8.x/0.8.15.md +22 -0
  5. package/dist/core/index.d.ts +2 -2
  6. package/dist/core/index.d.ts.map +1 -1
  7. package/dist/core/index.js +1 -1
  8. package/dist/core/index.js.map +1 -1
  9. package/dist/logs/combined.log +4 -4
  10. package/dist/logs/error.log +4 -4
  11. package/dist/services/canvas/{providers/duckdb → core}/schemaSniffer.d.ts +14 -8
  12. package/dist/services/canvas/core/schemaSniffer.d.ts.map +1 -0
  13. package/dist/services/canvas/{providers/duckdb → core}/schemaSniffer.js +41 -33
  14. package/dist/services/canvas/core/schemaSniffer.js.map +1 -0
  15. package/dist/services/canvas/index.d.ts +2 -0
  16. package/dist/services/canvas/index.d.ts.map +1 -1
  17. package/dist/services/canvas/index.js +2 -0
  18. package/dist/services/canvas/index.js.map +1 -1
  19. package/dist/services/canvas/providers/duckdb/DuckdbProvider.d.ts.map +1 -1
  20. package/dist/services/canvas/providers/duckdb/DuckdbProvider.js +1 -1
  21. package/dist/services/canvas/providers/duckdb/DuckdbProvider.js.map +1 -1
  22. package/dist/services/canvas/spillover.d.ts +121 -0
  23. package/dist/services/canvas/spillover.d.ts.map +1 -0
  24. package/dist/services/canvas/spillover.js +201 -0
  25. package/dist/services/canvas/spillover.js.map +1 -0
  26. package/dist/storage/core/IStorageProvider.d.ts +10 -3
  27. package/dist/storage/core/IStorageProvider.d.ts.map +1 -1
  28. package/package.json +9 -8
  29. package/skills/add-tool/SKILL.md +8 -2
  30. package/skills/api-canvas/SKILL.md +77 -1
  31. package/skills/api-errors/SKILL.md +3 -1
  32. package/skills/api-workers/SKILL.md +4 -4
  33. package/skills/design-mcp-server/SKILL.md +2 -1
  34. package/skills/tool-defs-analysis/SKILL.md +209 -0
  35. package/templates/AGENTS.md +3 -0
  36. package/templates/CLAUDE.md +3 -0
  37. package/dist/services/canvas/providers/duckdb/schemaSniffer.d.ts.map +0 -1
  38. package/dist/services/canvas/providers/duckdb/schemaSniffer.js.map +0 -1
package/CLAUDE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Agent Protocol
2
2
 
3
- **Package:** `@cyanheads/mcp-ts-core` · **Version:** 0.8.13
3
+ **Package:** `@cyanheads/mcp-ts-core` · **Version:** 0.8.15
4
4
  **npm:** [@cyanheads/mcp-ts-core](https://www.npmjs.com/package/@cyanheads/mcp-ts-core) · **Docker:** [ghcr.io/cyanheads/mcp-ts-core](https://ghcr.io/cyanheads/mcp-ts-core)
5
5
 
6
6
  > **Developer note:** Never assume. Read related files and docs before making changes. Read full file content for context. Never edit a file before reading it.
@@ -35,7 +35,7 @@
35
35
  | `/auth` | `checkScopes` | Dynamic scope checking |
36
36
  | `/storage` | `StorageService` | Storage abstraction |
37
37
  | `/storage/types` | `IStorageProvider` | Provider interface |
38
- | `/canvas` | `DataCanvas`, `CanvasInstance`, `CanvasRegistry`, `IDataCanvasProvider`, `DuckdbProvider`, `assertReadOnlyQuery`, `quoteIdentifier`, ... | DataCanvas primitive (Tier 3, optional peer dep `@duckdb/node-api`); SQL/analytical workspace |
38
+ | `/canvas` | `DataCanvas`, `CanvasInstance`, `CanvasRegistry`, `IDataCanvasProvider`, `DuckdbProvider`, `spillover`, `inferSchemaFromRows`, `assertReadOnlyQuery`, `quoteIdentifier`, ... | DataCanvas primitive (Tier 3, optional peer dep `@duckdb/node-api`); SQL/analytical workspace + source-agnostic spillover helper |
39
39
  | `/utils` | formatting, encoding, network, pagination, logging, runtime, telemetry, token counting, parsers†, sanitization†, scheduling† | All utilities (†optional peer deps) |
40
40
  | `/services` | `OpenRouterProvider`, `SpeechService`, `createSpeechProvider`, `ElevenLabsProvider`, `WhisperProvider`, `GraphService`, provider interfaces and types | LLM, Speech (TTS/STT), Graph services |
41
41
  | `/linter` | `validateDefinitions`, `LintReport`, `LintDiagnostic`, `LintInput`, `LintSeverity` | Definition validation |
@@ -378,6 +378,8 @@ async handler(input, ctx) {
378
378
 
379
379
  **`ctx.recoveryFor(reason)`** is the first member of a planned family of opt-in resolution helpers (future: `troubleshootingFor`, `userMessageFor`, …). Always present on `Context` (returns `{}` when no contract is attached or the reason is unknown — spread-safe), strictly typed on `HandlerContext<R>` against the declared reason union. The same resolver works in services that accept `ctx`: `throw validationError(msg, { reason: 'X', ...ctx.recoveryFor('X') })`. No auto-population — author opts in by typing the helper.
380
380
 
381
+ **Declare contracts inline on each tool, even when they look similar across tools.** The contract is part of the tool's documented public surface — reading one tool definition file should give the full picture (input, output, errors, handler, format). Don't extract a shared `errors[]` constant or contract module to deduplicate; per-tool repetition is the intended cost of locality, and dynamic `recovery` hints often need tool-specific context anyway.
382
+
381
383
  The contract describes the **public failure surface** — declare domain-specific failures only. **Baseline codes** (`InternalError`, `ServiceUnavailable`, `Timeout`, `ValidationError`, `SerializationError`) bubble from anywhere and are auto-allowed by the conformance lint, so you don't need to enumerate them per-tool. The conformance lint scans handler source text only — failures thrown from called services aren't visible to it (still reach the client correctly via the auto-classifier, just without lint enforcement).
382
384
 
383
385
  **Fallback for ad-hoc throws** (no contract entry fits, prototype tools, service-layer code): use error factories.
@@ -500,7 +502,7 @@ Each `skills/<name>/SKILL.md` carries a `metadata.version` string in its frontma
500
502
  | `api-config` | `skills/api-config/SKILL.md` | AppConfig, parseConfig, env vars |
501
503
  | `api-testing` | `skills/api-testing/SKILL.md` | createMockContext, test patterns, MockContextOptions |
502
504
  | `api-workers` | `skills/api-workers/SKILL.md` | createWorkerHandler, CloudflareBindings, Worker runtime |
503
- | `api-canvas` | `skills/api-canvas/SKILL.md` | DataCanvas primitive: acquire/register/query/export, token-sharing model, SQL gate, lifecycle |
505
+ | `api-canvas` | `skills/api-canvas/SKILL.md` | DataCanvas primitive: acquire/register/query/export, token-sharing model, SQL gate, lifecycle, spillover pattern |
504
506
  | `api-linter` | `skills/api-linter/SKILL.md` | Definition lint rules (`format-parity`, `schema-*`, `name-*`, `server-json-*`, …) — look here when devcheck reports a lint diagnostic |
505
507
  | `add-tool` | `skills/add-tool/SKILL.md` | Scaffold a new MCP tool definition |
506
508
  | `add-app-tool` | `skills/add-app-tool/SKILL.md` | Scaffold an MCP App tool + UI resource pair |
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  <div align="center">
7
7
 
8
- [![Version](https://img.shields.io/badge/Version-0.8.13-blue.svg?style=flat-square)](./CHANGELOG.md) [![MCP Spec](https://img.shields.io/badge/MCP%20Spec-2025--11--25-8A2BE2.svg?style=flat-square)](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/docs/specification/2025-11-25/changelog.mdx) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^1.29.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE)
8
+ [![Version](https://img.shields.io/badge/Version-0.8.15-blue.svg?style=flat-square)](./CHANGELOG.md) [![MCP Spec](https://img.shields.io/badge/MCP%20Spec-2025--11--25-8A2BE2.svg?style=flat-square)](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/docs/specification/2025-11-25/changelog.mdx) [![MCP SDK](https://img.shields.io/badge/MCP%20SDK-^1.29.0-green.svg?style=flat-square)](https://modelcontextprotocol.io/) [![License](https://img.shields.io/badge/License-Apache%202.0-orange.svg?style=flat-square)](./LICENSE)
9
9
 
10
10
  [![TypeScript](https://img.shields.io/badge/TypeScript-^6.0.3-3178C6.svg?style=flat-square)](https://www.typescriptlang.org/) [![Bun](https://img.shields.io/badge/Bun-v1.3.2-blueviolet.svg?style=flat-square)](https://bun.sh/)
11
11
 
@@ -110,6 +110,19 @@ It also works on Cloudflare Workers with `createWorkerHandler()` — same defini
110
110
  - **Tiered dependencies** — parsers, OTEL SDK, Supabase, and OpenAI are optional peers. Install what you use.
111
111
  - **Agent-first DX** — ships `CLAUDE.md` with the full exports catalog so AI agents ramp up without prompting.
112
112
 
113
+ ### Storage Behavior Snapshot
114
+
115
+ Provider behavior is intentionally normalized at the interface, but backend limits still matter:
116
+
117
+ | Provider | Delete count accuracy | List TTL filtering | Notes |
118
+ |:---------|:----------------------|:-------------------|:------|
119
+ | `in-memory` | Exact | Exact | Volatile process memory |
120
+ | `filesystem` | Exact | Exact | Node/Bun only |
121
+ | `supabase` | Exact | Exact | Requires configured Supabase client |
122
+ | `cloudflare-d1` | Exact | Exact | Workers D1 binding |
123
+ | `cloudflare-kv` | Idempotent API success | Native/eventual | Delete cannot prove prior existence |
124
+ | `cloudflare-r2` | Idempotent API success | Not applied during list | Expired envelopes are removed on read |
125
+
113
126
  ## Server structure
114
127
 
115
128
  ```text
@@ -0,0 +1,33 @@
1
+ ---
2
+ summary: "disabledTool/DisabledMetadata re-exported from package root (#109); new tool-defs-analysis skill (#111); Worker-runtime test harness via @cloudflare/vitest-pool-workers; example definitions polished; storage provider behavior table in README."
3
+ breaking: false
4
+ ---
5
+
6
+ # 0.8.14 — 2026-05-04
7
+
8
+ Polish release. The `disabledTool` re-export gap promised by the 0.8.11 changelog is closed; a new audit skill walks the LLM-facing language across every definition in a server; example tool/resource definitions get a top-to-bottom title/description/recovery scrub so scaffolded servers ship with prose worth keeping; and a Workers-runtime test harness now exercises `createWorkerHandler` inside Miniflare instead of mocked stubs.
9
+
10
+ ## Added
11
+
12
+ - **`disabledTool` and `DisabledMetadata` re-exported from the package root** ([#109](https://github.com/cyanheads/mcp-ts-core/issues/109)) — the 0.8.11 changelog claimed this surface but only the deep import path worked. `import { disabledTool, type DisabledMetadata } from '@cyanheads/mcp-ts-core'` now resolves; deep imports remain unchanged.
13
+ - **`tool-defs-analysis` skill** ([#111](https://github.com/cyanheads/mcp-ts-core/issues/111)) — read-only audit of MCP definition language across an existing surface. Walks every tool/resource/prompt and checks 10 categories the LLM reads to decide whether and how to call (voice, internal leaks, audience leaks, defaults, recovery hints, output descriptions, cross-references, sparsity, examples, structure). Produces grouped findings with `file:line` citations and a numbered options list. Complements `field-test` (behavior testing) and `security-pass` (security audit).
14
+ - **Storage Behavior Snapshot table in `README.md`** — six providers × two columns (delete-count accuracy, list-TTL filtering) so consumers can see the trade-offs at a glance without reading provider source.
15
+ - **Worker-runtime test harness** — new `vitest.worker.ts` config, `tests/fixtures/worker-runtime.fixture.ts`, and `tests/worker/create-worker-handler.worker.test.ts` exercise `createWorkerHandler` inside Miniflare via `@cloudflare/vitest-pool-workers`. Pinned to the system Node binary because the pool's loader hooks don't run under bun-node. Wired into `bun run test:worker` and the `test:all` chain.
16
+ - **`tests/integration/package-consumer.int.test.ts`** — verifies that a downstream project consuming `@cyanheads/mcp-ts-core` from `node_modules` resolves every documented subpath export and the package-root re-exports actually exist at runtime.
17
+ - **`tests/unit/linter/server-json-rules.test.ts`** — closes the test gap on `src/linter/rules/server-json-rules.ts`; the file is now pinned at 100% line/statement and 90% branch coverage.
18
+
19
+ ## Changed
20
+
21
+ - **Example tool/resource/prompt definitions polished across the board** — titles trimmed of "Template" prefix (`Template Echo Message` → `Echo Message`, `Template Cat Fact` → `Random Cat Fact`, `Async Countdown (Task Demo)` → `Async Countdown`); descriptions rewritten in active voice with concrete behavior (`"Demonstrates the MCP Tasks API with a countdown timer"` → `"Run a countdown timer for the requested number of seconds, reporting progress as it ticks. Cancellable mid-run."`); ad-hoc `throw new Error(...)` replaced with `serviceUnavailable`/`validationError` factories carrying contract-style `recovery.hint`s. The same tightening flows through `templates/` so `npx @cyanheads/mcp-ts-core init` scaffolds servers that already meet `tool-defs-analysis` review standards.
22
+ - **JSDoc on `IStorageProvider` and `StorageOptions.ttl` documents per-provider behavior** — exact vs. idempotent delete counts, exact vs. native/eventual list-TTL filtering, and the `cloudflare-r2` `list()` opt-out. `cloudflare-d1` row appears alongside the existing providers; `in-memory` description corrected to "timers and lazy filtering on get/list" instead of "setTimeout for proactive deletion."
23
+ - **"Declare contracts inline on each tool" guidance** added to `AGENTS.md`/`CLAUDE.md`, `templates/AGENTS.md`/`templates/CLAUDE.md`, `skills/add-tool` (v2.6→2.7), and `skills/api-errors` (v1.4→1.5). Per-tool repetition of the `errors[]` contract is the intended cost of locality; a code-cleanup pass that suggests consolidating contracts into a shared module should be declined.
24
+ - **`skills/api-workers` (v1.2→1.3)** — Workers storage allowlist documentation tightened: `filesystem` and unknown provider types throw `ConfigurationError` in serverless environments instead of silently falling back to `in-memory`. The "silent force to in-memory" claim was outdated.
25
+ - **Coverage thresholds raised** in `vitest.config.ts` — global `lines 80→89`, `functions 75→90`, `branches 70→79`, `statements 80→88`. Per-file pins added: `src/linter/rules/server-json-rules.ts` at 100/100/90/100 and `src/storage/providers/supabase/supabaseProvider.ts` at 95/100/60/85 to lock in the new test coverage.
26
+ - **`@cloudflare/vitest-pool-workers ^0.15.2`** added to `devDependencies`; corresponding type packages added to `tsconfig.json` and `tsconfig.test.json` `types` arrays.
27
+ - **`devcheck.config.json`** — `cloudflare:*` added to depcheck `ignoreMatches` so `cloudflare:test` and `cloudflare:workers` virtual specifiers stop tripping the unused-deps check.
28
+ - **Stale `docs/audit/` and `docs/server-ideas/` removed** along with `docs/conformance-test-plan.md` and `docs/resource-notifications.md` — historical scaffolding that was no longer referenced from anywhere.
29
+ - **Dependency bumps** — `zod ^4.4.2 → ^4.4.3` (peer), `@cloudflare/workers-types ^4.20260503.1 → ^4.20260505.1`, `@supabase/supabase-js ^2.105.1 → ^2.105.3`, `openai ^6.35.0 → ^6.36.0`. `zod` removed from `dependencies` (it was already declared as a peer dep; the duplicate listing is gone).
30
+
31
+ ## Fixed
32
+
33
+ - **Package-root export of `disabledTool`/`DisabledMetadata`** ([#109](https://github.com/cyanheads/mcp-ts-core/issues/109)) — see Added.
@@ -0,0 +1,22 @@
1
+ ---
2
+ summary: "Source-agnostic `spillover()` helper exported from /canvas (#113); engine-agnostic `inferSchemaFromRows` lifted into canvas/core; api-canvas, add-tool, design-mcp-server skills updated."
3
+ breaking: false
4
+ ---
5
+
6
+ # 0.8.15 — 2026-05-05
7
+
8
+ `spillover()` closes the most common pattern for canvas-coupled tools: pair an inline preview with a `DataCanvas` table holding the full source, so an agent gets a sized slice plus a SQL handle for the rest in one call. Source-agnostic — anything `registerTable` accepts (arrays, sync/async iterables, paginated upstream APIs wrapped as generators) flows through.
9
+
10
+ ## Added
11
+
12
+ - **`spillover()`** ([#113](https://github.com/cyanheads/mcp-ts-core/issues/113)) — exported from `@cyanheads/mcp-ts-core/canvas`. Drains a tabular source up to a character budget for the inline preview, then — if the source exceeds the budget — registers the full source (preview rows + overflow sentinel + remaining tail) to a canvas table and returns a handle. Returns a discriminated union: `{ spilled: false, previewRows }` when the source fit, `{ spilled: true, previewRows, handle, truncated }` when the source overflowed. Caller controls the canvas (acquire once, spill many sources). `caps.maxRows` enforces a hard upper bound during the spill drain; `truncated` reports whether the source had more rows than the cap allowed. Best-effort `canvas.drop()` on register failure so aborted runs don't leave half-appended tables. `previewChars: 0` rejected — spillover always implies a visible preview; call `canvas.registerTable` directly for headless spills.
13
+ - **`inferSchemaFromRows(rows)`** — exported from `@cyanheads/mcp-ts-core/canvas`. Engine-agnostic schema inference over an in-memory row buffer. Powers `spillover()`'s default schema path; available standalone for callers that want to derive a `ColumnSchema[]` without going through `sniffSchema`'s iterable contract.
14
+ - **`SpilloverOptions`, `SpilloverResult`, `SpilloverFitResult`, `SpilloverSpillResult`** — types exported from `/canvas` for callers that wrap or compose the helper.
15
+
16
+ ## Changed
17
+
18
+ - **`schemaSniffer` lifted from `services/canvas/providers/duckdb/` to `services/canvas/core/`.** `sniffSchema` (the iterable-buffering variant) now delegates to the new `inferSchemaFromRows` for the actual type inference. `DuckdbProvider` import path updated; engine-agnostic so future providers don't need to re-implement schema sniffing. Internal `unionToDuckdbType` renamed to `unionToColumnType` to match the engine-agnostic role.
19
+ - **`skills/api-canvas` (v1.1→1.2)** — new "Pattern: spillover" section with API surface, character-budget sizing table (10k tokens ≈ 40k chars, 25k ≈ 100k, 50k ≈ 200k), drain/overflow flow, schema-handling table, cancellation behavior, and "when not to use" notes.
20
+ - **`skills/add-tool` (v2.7→2.8)** — "Tabular working sets" bullet expanded to name `spillover()` explicitly, mention auto-register-on-overflow and the full-result distribution pattern.
21
+ - **`skills/design-mcp-server` (v2.9→2.10)** — new bullet under Output design ("Spill big tabular results to a queryable surface") pointing at `spillover()` for paginated APIs, streamed exports, and large query results. Reinforces computing aggregate signal across the full result, not the preview.
22
+ - **`AGENTS.md`/`CLAUDE.md` `/canvas` exports row** updated to list `spillover` and `inferSchemaFromRows`. `templates/AGENTS.md` and `templates/CLAUDE.md` skill table gained an `api-canvas` row so newly scaffolded servers see the helper alongside the rest of the canvas surface.
@@ -18,8 +18,8 @@ export type { AnyResourceDefinition, ResourceDefinition, } from '../mcp-server/r
18
18
  export { resource } from '../mcp-server/resources/utils/resourceDefinition.js';
19
19
  /** Union of all accepted tool definition shapes (standard + task). */
20
20
  export type { AnyToolDef } from '../mcp-server/tools/tool-registration.js';
21
- export type { AnyToolDefinition, ToolAnnotations, ToolDefinition, } from '../mcp-server/tools/utils/toolDefinition.js';
22
- export { tool } from '../mcp-server/tools/utils/toolDefinition.js';
21
+ export type { AnyToolDefinition, DisabledMetadata, ToolAnnotations, ToolDefinition, } from '../mcp-server/tools/utils/toolDefinition.js';
22
+ export { disabledTool, tool } from '../mcp-server/tools/utils/toolDefinition.js';
23
23
  export type { LintDefinitionType, LintDiagnostic, LintInput, LintReport, LintSeverity, } from '../linter/types.js';
24
24
  export { validateDefinitions } from '../linter/validate.js';
25
25
  export type { CallToolResult, ContentBlock, CreateMessageResult, ElicitResult, ModelPreferences, PromptMessage, SamplingMessage, } from '@modelcontextprotocol/sdk/types.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,YAAY,EAAE,YAAY,EAAE,gBA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,EACZ,mBAAmB,EACnB,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACb,eAAe,GAChB,MAAM,oCAAoC,CAAC"}
@@ -17,6 +17,6 @@ export { createFail, createRecoveryFor } from '../core/context.js';
17
17
  export { APP_RESOURCE_MIME_TYPE, appResource, appTool } from '../mcp-server/apps/appBuilders.js';
18
18
  export { prompt } from '../mcp-server/prompts/utils/promptDefinition.js';
19
19
  export { resource } from '../mcp-server/resources/utils/resourceDefinition.js';
20
- export { tool } from '../mcp-server/tools/utils/toolDefinition.js';
20
+ export { disabledTool, tool } from '../mcp-server/tools/utils/toolDefinition.js';
21
21
  export { validateDefinitions } from '../linter/validate.js';
22
22
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAOH,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAQ1C,8EAA8E;AAC9E,0EAA0E;AAC1E,8EAA8E;AAE9E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAkBxB,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAElE,8EAA8E;AAC9E,8BAA8B;AAC9B,8EAA8E;AAE9E,OAAO,EAAE,sBAAsB,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAKhG,OAAO,EAAE,MAAM,EAAE,MAAM,gDAAgD,CAAC;AAKxE,OAAO,EAAE,QAAQ,EAAE,MAAM,oDAAoD,CAAC;AAQ9E,OAAO,EAAE,IAAI,EAAE,MAAM,4CAA4C,CAAC;AAalE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAOH,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAQ1C,8EAA8E;AAC9E,0EAA0E;AAC1E,8EAA8E;AAE9E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAkBxB,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAElE,8EAA8E;AAC9E,8BAA8B;AAC9B,8EAA8E;AAE9E,OAAO,EAAE,sBAAsB,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAKhG,OAAO,EAAE,MAAM,EAAE,MAAM,gDAAgD,CAAC;AAKxE,OAAO,EAAE,QAAQ,EAAE,MAAM,oDAAoD,CAAC;AAS9E,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,4CAA4C,CAAC;AAahF,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC"}
@@ -1,4 +1,4 @@
1
- {"level":50,"time":1777795711727,"env":"testing","version":"0.0.0-test","pid":4050,"requestId":"60L97-GTRZT","timestamp":"2026-05-03T08:08:31.726Z","operation":"HandleToolRequest","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"a1b4457ff0e3dff4a5aee4cbbf29fd1082f49f2fa876a03879869d4435197481","toolName":"scoped_echo","tenantId":"authz-tenant","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant"},"errorData":{"sessionId":"a1b4457ff0e3dff4a5aee4cbbf29fd1082f49f2fa876a03879869d4435197481","toolName":"scoped_echo","requestId":"60L97-GTRZT","timestamp":"2026-05-03T08:08:31.726Z","tenantId":"authz-tenant","operation":"HandleToolRequest","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant"},"originalErrorName":"McpError","originalMessage":"Insufficient permissions.","originalStack":"McpError: Insufficient permissions.\n at forbidden (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:84:58)\n at withRequiredScopes (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/authUtils.js:61:15)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:133:17)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Insufficient permissions.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:170:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:168:26)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)","msg":"Error in tool:scoped_echo: Insufficient permissions."}
2
- {"level":50,"time":1777795712041,"env":"testing","version":"0.8.13","pid":4052,"requestId":"ORW4B-XHO3Z","timestamp":"2026-05-03T08:08:32.041Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"POST","errorData":{"path":"/mcp","method":"POST","requestId":"ORW4B-XHO3Z","timestamp":"2026-05-03T08:08:32.041Z","operation":"httpErrorHandler","originalErrorName":"McpError","originalMessage":"Missing or invalid Authorization header. Bearer scheme required.","originalStack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at unauthorized (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:86:61)\n at authMiddleware (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/authMiddleware.js:64:19)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpTransport.js:232:22)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at cors2 (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/middleware/cors/index.js:82:11)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:170:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpErrorHandler.js:59:39)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:26:25)\n at processTicksAndRejections (native:7:39)","msg":"Error in httpTransport: Missing or invalid Authorization header. Bearer scheme required."}
3
- {"level":50,"time":1777795712056,"env":"testing","version":"0.8.13","pid":4052,"requestId":"UB134-4WCWE","timestamp":"2026-05-03T08:08:32.056Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"POST","errorData":{"path":"/mcp","method":"POST","requestId":"UB134-4WCWE","timestamp":"2026-05-03T08:08:32.056Z","operation":"httpErrorHandler","originalErrorName":"McpError","originalMessage":"Token has expired.","originalStack":"McpError: Token has expired.\n at unauthorized (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:86:61)\n at handleJoseVerifyError (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/claimParser.js:56:11)\n at verify (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/strategies/jwtStrategy.js:91:13)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Token has expired.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:170:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpErrorHandler.js:59:39)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:26:25)\n at processTicksAndRejections (native:7:39)","msg":"Error in httpTransport: Token has expired."}
4
- {"level":50,"time":1777795712061,"env":"testing","version":"0.8.13","pid":4052,"requestId":"4811D-03SA6","timestamp":"2026-05-03T08:08:32.061Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"GET","errorData":{"path":"/mcp","method":"GET","requestId":"4811D-03SA6","timestamp":"2026-05-03T08:08:32.061Z","operation":"httpErrorHandler","originalErrorName":"McpError","originalMessage":"Missing or invalid Authorization header. Bearer scheme required.","originalStack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at unauthorized (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:86:61)\n at authMiddleware (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/authMiddleware.js:64:19)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpTransport.js:232:22)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at cors2 (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/middleware/cors/index.js:82:11)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:170:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpErrorHandler.js:59:39)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:26:25)\n at processTicksAndRejections (native:7:39)","msg":"Error in httpTransport: Missing or invalid Authorization header. Bearer scheme required."}
1
+ {"level":50,"time":1777967541162,"env":"testing","version":"0.0.0-test","pid":62868,"requestId":"0FL3P-PR4X9","timestamp":"2026-05-05T07:52:21.161Z","operation":"HandleToolRequest","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"a054ea024d91a80eff4c5aa5e6d4190a50b098c4f2d1d3345e733a05ab38aa8c","toolName":"scoped_echo","tenantId":"authz-tenant","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant"},"errorData":{"sessionId":"a054ea024d91a80eff4c5aa5e6d4190a50b098c4f2d1d3345e733a05ab38aa8c","toolName":"scoped_echo","requestId":"0FL3P-PR4X9","timestamp":"2026-05-05T07:52:21.161Z","tenantId":"authz-tenant","operation":"HandleToolRequest","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant"},"originalErrorName":"McpError","originalMessage":"Insufficient permissions.","originalStack":"McpError: Insufficient permissions.\n at forbidden (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:84:58)\n at withRequiredScopes (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/authUtils.js:61:15)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:133:17)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Insufficient permissions.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:170:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:168:26)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)","msg":"Error in tool:scoped_echo: Insufficient permissions."}
2
+ {"level":50,"time":1777967542139,"env":"testing","version":"0.8.15","pid":62874,"requestId":"NR8MT-ZACPF","timestamp":"2026-05-05T07:52:22.139Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"POST","errorData":{"path":"/mcp","method":"POST","requestId":"NR8MT-ZACPF","timestamp":"2026-05-05T07:52:22.139Z","operation":"httpErrorHandler","originalErrorName":"McpError","originalMessage":"Missing or invalid Authorization header. Bearer scheme required.","originalStack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at unauthorized (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:86:61)\n at authMiddleware (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/authMiddleware.js:64:19)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpTransport.js:232:22)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at cors2 (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/middleware/cors/index.js:82:11)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:170:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpErrorHandler.js:59:39)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:26:25)\n at processTicksAndRejections (native:7:39)","msg":"Error in httpTransport: Missing or invalid Authorization header. Bearer scheme required."}
3
+ {"level":50,"time":1777967542154,"env":"testing","version":"0.8.15","pid":62874,"requestId":"EHHRO-B8TIH","timestamp":"2026-05-05T07:52:22.154Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"POST","errorData":{"path":"/mcp","method":"POST","requestId":"EHHRO-B8TIH","timestamp":"2026-05-05T07:52:22.154Z","operation":"httpErrorHandler","originalErrorName":"McpError","originalMessage":"Token has expired.","originalStack":"McpError: Token has expired.\n at unauthorized (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:86:61)\n at handleJoseVerifyError (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/claimParser.js:56:11)\n at verify (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/strategies/jwtStrategy.js:91:13)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Token has expired.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:170:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpErrorHandler.js:59:39)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:26:25)\n at processTicksAndRejections (native:7:39)","msg":"Error in httpTransport: Token has expired."}
4
+ {"level":50,"time":1777967542158,"env":"testing","version":"0.8.15","pid":62874,"requestId":"YR4G7-ZSMOH","timestamp":"2026-05-05T07:52:22.158Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"GET","errorData":{"path":"/mcp","method":"GET","requestId":"YR4G7-ZSMOH","timestamp":"2026-05-05T07:52:22.158Z","operation":"httpErrorHandler","originalErrorName":"McpError","originalMessage":"Missing or invalid Authorization header. Bearer scheme required.","originalStack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at unauthorized (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:86:61)\n at authMiddleware (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/authMiddleware.js:64:19)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpTransport.js:232:22)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at cors2 (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/middleware/cors/index.js:82:11)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:170:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpErrorHandler.js:59:39)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:26:25)\n at processTicksAndRejections (native:7:39)","msg":"Error in httpTransport: Missing or invalid Authorization header. Bearer scheme required."}
@@ -1,4 +1,4 @@
1
- {"level":50,"time":1777795711727,"env":"testing","version":"0.0.0-test","pid":4050,"requestId":"60L97-GTRZT","timestamp":"2026-05-03T08:08:31.726Z","operation":"HandleToolRequest","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"a1b4457ff0e3dff4a5aee4cbbf29fd1082f49f2fa876a03879869d4435197481","toolName":"scoped_echo","tenantId":"authz-tenant","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant"},"errorData":{"sessionId":"a1b4457ff0e3dff4a5aee4cbbf29fd1082f49f2fa876a03879869d4435197481","toolName":"scoped_echo","requestId":"60L97-GTRZT","timestamp":"2026-05-03T08:08:31.726Z","tenantId":"authz-tenant","operation":"HandleToolRequest","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant"},"originalErrorName":"McpError","originalMessage":"Insufficient permissions.","originalStack":"McpError: Insufficient permissions.\n at forbidden (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:84:58)\n at withRequiredScopes (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/authUtils.js:61:15)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:133:17)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Insufficient permissions.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:170:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:168:26)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)","msg":"Error in tool:scoped_echo: Insufficient permissions."}
2
- {"level":50,"time":1777795712041,"env":"testing","version":"0.8.13","pid":4052,"requestId":"ORW4B-XHO3Z","timestamp":"2026-05-03T08:08:32.041Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"POST","errorData":{"path":"/mcp","method":"POST","requestId":"ORW4B-XHO3Z","timestamp":"2026-05-03T08:08:32.041Z","operation":"httpErrorHandler","originalErrorName":"McpError","originalMessage":"Missing or invalid Authorization header. Bearer scheme required.","originalStack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at unauthorized (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:86:61)\n at authMiddleware (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/authMiddleware.js:64:19)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpTransport.js:232:22)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at cors2 (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/middleware/cors/index.js:82:11)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:170:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpErrorHandler.js:59:39)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:26:25)\n at processTicksAndRejections (native:7:39)","msg":"Error in httpTransport: Missing or invalid Authorization header. Bearer scheme required."}
3
- {"level":50,"time":1777795712056,"env":"testing","version":"0.8.13","pid":4052,"requestId":"UB134-4WCWE","timestamp":"2026-05-03T08:08:32.056Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"POST","errorData":{"path":"/mcp","method":"POST","requestId":"UB134-4WCWE","timestamp":"2026-05-03T08:08:32.056Z","operation":"httpErrorHandler","originalErrorName":"McpError","originalMessage":"Token has expired.","originalStack":"McpError: Token has expired.\n at unauthorized (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:86:61)\n at handleJoseVerifyError (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/claimParser.js:56:11)\n at verify (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/strategies/jwtStrategy.js:91:13)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Token has expired.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:170:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpErrorHandler.js:59:39)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:26:25)\n at processTicksAndRejections (native:7:39)","msg":"Error in httpTransport: Token has expired."}
4
- {"level":50,"time":1777795712061,"env":"testing","version":"0.8.13","pid":4052,"requestId":"4811D-03SA6","timestamp":"2026-05-03T08:08:32.061Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"GET","errorData":{"path":"/mcp","method":"GET","requestId":"4811D-03SA6","timestamp":"2026-05-03T08:08:32.061Z","operation":"httpErrorHandler","originalErrorName":"McpError","originalMessage":"Missing or invalid Authorization header. Bearer scheme required.","originalStack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at unauthorized (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:86:61)\n at authMiddleware (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/authMiddleware.js:64:19)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpTransport.js:232:22)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at cors2 (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/middleware/cors/index.js:82:11)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:170:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpErrorHandler.js:59:39)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:26:25)\n at processTicksAndRejections (native:7:39)","msg":"Error in httpTransport: Missing or invalid Authorization header. Bearer scheme required."}
1
+ {"level":50,"time":1777967541162,"env":"testing","version":"0.0.0-test","pid":62868,"requestId":"0FL3P-PR4X9","timestamp":"2026-05-05T07:52:21.161Z","operation":"HandleToolRequest","critical":false,"errorCode":-32005,"originalErrorType":"McpError","finalErrorType":"McpError","sessionId":"a054ea024d91a80eff4c5aa5e6d4190a50b098c4f2d1d3345e733a05ab38aa8c","toolName":"scoped_echo","tenantId":"authz-tenant","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant"},"errorData":{"sessionId":"a054ea024d91a80eff4c5aa5e6d4190a50b098c4f2d1d3345e733a05ab38aa8c","toolName":"scoped_echo","requestId":"0FL3P-PR4X9","timestamp":"2026-05-05T07:52:21.161Z","tenantId":"authz-tenant","operation":"HandleToolRequest","auth":{"sub":"authz-user","scopes":["tool:other:read"],"clientId":"authz-client","tenantId":"authz-tenant"},"originalErrorName":"McpError","originalMessage":"Insufficient permissions.","originalStack":"McpError: Insufficient permissions.\n at forbidden (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:84:58)\n at withRequiredScopes (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/authUtils.js:61:15)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:133:17)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Insufficient permissions.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:170:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/tools/utils/toolHandlerFactory.js:168:26)\n at executeToolHandler (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:231:34)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js:126:43)\n at processTicksAndRejections (native:7:39)","msg":"Error in tool:scoped_echo: Insufficient permissions."}
2
+ {"level":50,"time":1777967542139,"env":"testing","version":"0.8.15","pid":62874,"requestId":"NR8MT-ZACPF","timestamp":"2026-05-05T07:52:22.139Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"POST","errorData":{"path":"/mcp","method":"POST","requestId":"NR8MT-ZACPF","timestamp":"2026-05-05T07:52:22.139Z","operation":"httpErrorHandler","originalErrorName":"McpError","originalMessage":"Missing or invalid Authorization header. Bearer scheme required.","originalStack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at unauthorized (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:86:61)\n at authMiddleware (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/authMiddleware.js:64:19)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpTransport.js:232:22)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at cors2 (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/middleware/cors/index.js:82:11)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:170:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpErrorHandler.js:59:39)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:26:25)\n at processTicksAndRejections (native:7:39)","msg":"Error in httpTransport: Missing or invalid Authorization header. Bearer scheme required."}
3
+ {"level":50,"time":1777967542154,"env":"testing","version":"0.8.15","pid":62874,"requestId":"EHHRO-B8TIH","timestamp":"2026-05-05T07:52:22.154Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"POST","errorData":{"path":"/mcp","method":"POST","requestId":"EHHRO-B8TIH","timestamp":"2026-05-05T07:52:22.154Z","operation":"httpErrorHandler","originalErrorName":"McpError","originalMessage":"Token has expired.","originalStack":"McpError: Token has expired.\n at unauthorized (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:86:61)\n at handleJoseVerifyError (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/lib/claimParser.js:56:11)\n at verify (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/strategies/jwtStrategy.js:91:13)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Token has expired.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:170:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpErrorHandler.js:59:39)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:26:25)\n at processTicksAndRejections (native:7:39)","msg":"Error in httpTransport: Token has expired."}
4
+ {"level":50,"time":1777967542158,"env":"testing","version":"0.8.15","pid":62874,"requestId":"YR4G7-ZSMOH","timestamp":"2026-05-05T07:52:22.158Z","operation":"httpErrorHandler","critical":false,"errorCode":-32006,"originalErrorType":"McpError","finalErrorType":"McpError","path":"/mcp","method":"GET","errorData":{"path":"/mcp","method":"GET","requestId":"YR4G7-ZSMOH","timestamp":"2026-05-05T07:52:22.158Z","operation":"httpErrorHandler","originalErrorName":"McpError","originalMessage":"Missing or invalid Authorization header. Bearer scheme required.","originalStack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at unauthorized (/Users/casey/Developer/github/mcp-ts-core/dist/types-global/errors.js:86:61)\n at authMiddleware (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/auth/authMiddleware.js:64:19)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpTransport.js:232:22)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:22:23)\n at cors2 (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/middleware/cors/index.js:82:11)\n at processTicksAndRejections (native:7:39)"},"stack":"McpError: Missing or invalid Authorization header. Bearer scheme required.\n at handleError (/Users/casey/Developer/github/mcp-ts-core/dist/utils/internal/error-handler/errorHandler.js:170:23)\n at <anonymous> (/Users/casey/Developer/github/mcp-ts-core/dist/mcp-server/transports/http/httpErrorHandler.js:59:39)\n at dispatch (/Users/casey/Developer/github/mcp-ts-core/node_modules/hono/dist/compose.js:26:25)\n at processTicksAndRejections (native:7:39)","msg":"Error in httpTransport: Missing or invalid Authorization header. Bearer scheme required."}
@@ -1,13 +1,13 @@
1
1
  /**
2
- * @fileoverview Schema inference for {@link DuckdbProvider.registerTable}.
3
- * Buffers the first N rows of an iterable, unions JS-side types per column,
4
- * and maps to DuckDB types. `VARCHAR` is the safe fallback for ambiguous
5
- * unions. Only used when the caller does not pass an explicit `schema`;
6
- * `AsyncIterable` inputs must always supply one because we cannot peek
7
- * without consuming.
8
- * @module src/services/canvas/providers/duckdb/schemaSniffer
2
+ * @fileoverview Schema inference for canvas table registration. Engine-agnostic
3
+ * produces `ColumnSchema[]` from observed JS values; providers map those
4
+ * tags to native types when needed. `VARCHAR` is the safe fallback for
5
+ * ambiguous unions. Used by the DuckDB provider for the no-explicit-schema
6
+ * sync path and by the spillover helper to infer a schema from its preview
7
+ * buffer when the source is async.
8
+ * @module src/services/canvas/core/schemaSniffer
9
9
  */
10
- import type { ColumnSchema } from '../../types.js';
10
+ import type { ColumnSchema } from '../types.js';
11
11
  /** Row shape — mirrors what registerTable accepts. */
12
12
  type Row = Record<string, unknown>;
13
13
  /**
@@ -25,6 +25,12 @@ export interface SniffedSchema {
25
25
  /** Rows already consumed; append these first. */
26
26
  sniffedRows: Row[];
27
27
  }
28
+ /**
29
+ * Infer a `ColumnSchema[]` from a set of fully-buffered rows. Column ordering
30
+ * follows first appearance. A column is `nullable` if any sampled row had
31
+ * `null`/`undefined` for it or was missing the key. Throws if `rows` is empty.
32
+ */
33
+ export declare function inferSchemaFromRows(rows: readonly Row[]): ColumnSchema[];
28
34
  /**
29
35
  * Buffer up to `sniffRowCount` rows and return the inferred schema, the
30
36
  * buffered rows, and a continuation iterator. Throws if the input is empty.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemaSniffer.d.ts","sourceRoot":"","sources":["../../../../src/services/canvas/core/schemaSniffer.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAc,MAAM,aAAa,CAAC;AAE5D,sDAAsD;AACtD,KAAK,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEnC;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,SAAS,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC;IACzB,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,iDAAiD;IACjD,WAAW,EAAE,GAAG,EAAE,CAAC;CACpB;AAkDD;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,SAAS,GAAG,EAAE,GAAG,YAAY,EAAE,CAgCxE;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC,EAAE,aAAa,EAAE,MAAM,GAAG,aAAa,CAczF"}
@@ -1,13 +1,13 @@
1
1
  /**
2
- * @fileoverview Schema inference for {@link DuckdbProvider.registerTable}.
3
- * Buffers the first N rows of an iterable, unions JS-side types per column,
4
- * and maps to DuckDB types. `VARCHAR` is the safe fallback for ambiguous
5
- * unions. Only used when the caller does not pass an explicit `schema`;
6
- * `AsyncIterable` inputs must always supply one because we cannot peek
7
- * without consuming.
8
- * @module src/services/canvas/providers/duckdb/schemaSniffer
2
+ * @fileoverview Schema inference for canvas table registration. Engine-agnostic
3
+ * produces `ColumnSchema[]` from observed JS values; providers map those
4
+ * tags to native types when needed. `VARCHAR` is the safe fallback for
5
+ * ambiguous unions. Used by the DuckDB provider for the no-explicit-schema
6
+ * sync path and by the spillover helper to infer a schema from its preview
7
+ * buffer when the source is async.
8
+ * @module src/services/canvas/core/schemaSniffer
9
9
  */
10
- import { validationError } from '../../../../types-global/errors.js';
10
+ import { validationError } from '../../../types-global/errors.js';
11
11
  function classify(value) {
12
12
  if (value === null || value === undefined)
13
13
  return 'null';
@@ -24,10 +24,10 @@ function classify(value) {
24
24
  return 'object';
25
25
  }
26
26
  /**
27
- * Pick a DuckDB column type from the union of observed JS types. Conservative:
27
+ * Pick a column type tag from the union of observed JS types. Conservative:
28
28
  * mixed string+numeric falls back to `VARCHAR` rather than guessing.
29
29
  */
30
- function unionToDuckdbType(observed) {
30
+ function unionToColumnType(observed) {
31
31
  const nonNull = new Set(observed);
32
32
  nonNull.delete('null');
33
33
  if (nonNull.size === 0)
@@ -59,32 +59,18 @@ function unionToDuckdbType(observed) {
59
59
  return 'VARCHAR';
60
60
  }
61
61
  /**
62
- * Buffer up to `sniffRowCount` rows and return the inferred schema, the
63
- * buffered rows, and a continuation iterator. Throws if the input is empty.
64
- *
65
- * Column ordering follows first appearance. A column is `nullable` if any
66
- * sampled row had `null`/`undefined` for it or was missing the key.
62
+ * Infer a `ColumnSchema[]` from a set of fully-buffered rows. Column ordering
63
+ * follows first appearance. A column is `nullable` if any sampled row had
64
+ * `null`/`undefined` for it or was missing the key. Throws if `rows` is empty.
67
65
  */
68
- export function sniffSchema(iterable, sniffRowCount) {
69
- if (sniffRowCount < 1) {
70
- throw validationError('sniffRowCount must be at least 1.', { sniffRowCount });
71
- }
72
- // Consume the same iterator we hand back so generators aren't re-iterated.
73
- const iter = iterable[Symbol.iterator]();
74
- const sniffedRows = [];
75
- while (sniffedRows.length < sniffRowCount) {
76
- const next = iter.next();
77
- if (next.done)
78
- break;
79
- sniffedRows.push(next.value);
80
- }
81
- if (sniffedRows.length === 0) {
66
+ export function inferSchemaFromRows(rows) {
67
+ if (rows.length === 0) {
82
68
  throw validationError('Cannot infer schema from an empty input. Provide either rows or an explicit `schema`.', { reason: 'empty_input' });
83
69
  }
84
70
  const observedByCol = new Map();
85
71
  const columnOrder = [];
86
72
  const presenceCount = new Map();
87
- for (const row of sniffedRows) {
73
+ for (const row of rows) {
88
74
  for (const key of Object.keys(row)) {
89
75
  let bag = observedByCol.get(key);
90
76
  if (!bag) {
@@ -96,13 +82,35 @@ export function sniffSchema(iterable, sniffRowCount) {
96
82
  presenceCount.set(key, (presenceCount.get(key) ?? 0) + 1);
97
83
  }
98
84
  }
99
- const total = sniffedRows.length;
100
- const schema = columnOrder.map((name) => {
85
+ const total = rows.length;
86
+ return columnOrder.map((name) => {
101
87
  const observed = observedByCol.get(name) ?? new Set(['null']);
102
88
  const present = presenceCount.get(name) ?? 0;
103
89
  const nullable = observed.has('null') || present < total;
104
- return { name, type: unionToDuckdbType(observed), nullable };
90
+ return { name, type: unionToColumnType(observed), nullable };
105
91
  });
92
+ }
93
+ /**
94
+ * Buffer up to `sniffRowCount` rows and return the inferred schema, the
95
+ * buffered rows, and a continuation iterator. Throws if the input is empty.
96
+ *
97
+ * Column ordering follows first appearance. A column is `nullable` if any
98
+ * sampled row had `null`/`undefined` for it or was missing the key.
99
+ */
100
+ export function sniffSchema(iterable, sniffRowCount) {
101
+ if (sniffRowCount < 1) {
102
+ throw validationError('sniffRowCount must be at least 1.', { sniffRowCount });
103
+ }
104
+ // Consume the same iterator we hand back so generators aren't re-iterated.
105
+ const iter = iterable[Symbol.iterator]();
106
+ const sniffedRows = [];
107
+ while (sniffedRows.length < sniffRowCount) {
108
+ const next = iter.next();
109
+ if (next.done)
110
+ break;
111
+ sniffedRows.push(next.value);
112
+ }
113
+ const schema = inferSchemaFromRows(sniffedRows);
106
114
  return { schema, sniffedRows, remaining: iter };
107
115
  }
108
116
  //# sourceMappingURL=schemaSniffer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemaSniffer.js","sourceRoot":"","sources":["../../../../src/services/canvas/core/schemaSniffer.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAyB3D,SAAS,QAAQ,CAAC,KAAc;IAC9B,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC;IACzD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,QAAQ,CAAC;IAC/C,IAAI,OAAO,KAAK,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACjD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,QAAQ,CAAC;IAC/C,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC;IACxD,CAAC;IACD,iDAAiD;IACjD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;GAGG;AACH,SAAS,iBAAiB,CAAC,QAAqB;IAC9C,MAAM,OAAO,GAAG,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,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC/D,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,QAAuB,EAAE,aAAqB;IACxE,IAAI,aAAa,GAAG,CAAC,EAAE,CAAC;QACtB,MAAM,eAAe,CAAC,mCAAmC,EAAE,EAAE,aAAa,EAAE,CAAC,CAAC;IAChF,CAAC;IACD,2EAA2E;IAC3E,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;IACzC,MAAM,WAAW,GAAU,EAAE,CAAC;IAC9B,OAAO,WAAW,CAAC,MAAM,GAAG,aAAa,EAAE,CAAC;QAC1C,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;QACzB,IAAI,IAAI,CAAC,IAAI;YAAE,MAAM;QACrB,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;IACD,MAAM,MAAM,GAAG,mBAAmB,CAAC,WAAW,CAAC,CAAC;IAChD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;AAClD,CAAC"}
@@ -15,7 +15,9 @@ export { type AcquireResult, CanvasRegistry, type CanvasRegistryOptions, DEFAULT
15
15
  export { createCanvasService } from './core/canvasFactory.js';
16
16
  export { DataCanvas } from './core/DataCanvas.js';
17
17
  export type { IDataCanvasProvider } from './core/IDataCanvasProvider.js';
18
+ export { inferSchemaFromRows } from './core/schemaSniffer.js';
18
19
  export { ALLOWED_PLAN_OPERATORS, ALLOWED_STATEMENT_TYPES, assertNoDeniedFunctions, assertReadOnlyQuery, assertValidIdentifier, CANVAS_IDENTIFIER_REGEX, collectDisallowedOperators, collectPlanViolations, DENIED_TABLE_FUNCTIONS, type DuckdbStatementType, quoteIdentifier, SQL_GATE_REASONS, type SqlGateReason, } from './core/sqlGate.js';
19
20
  export { DuckdbProvider, type DuckdbProviderOptions, } from './providers/duckdb/DuckdbProvider.js';
21
+ export { type SpilloverFitResult, type SpilloverOptions, type SpilloverResult, type SpilloverSpillResult, spillover, } from './spillover.js';
20
22
  export type { AcquireOptions, CanvasObjectKind, ColumnSchema, ColumnType, DescribeOptions, ExportFormat, ExportOptions, ExportResult, ExportTarget, ImportFromOptions, QueryOptions, QueryResult, RegisterRows, RegisterTableOptions, RegisterTableResult, RegisterViewOptions, RegisterViewResult, TableInfo, } from './types.js';
21
23
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/canvas/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EACL,KAAK,aAAa,EAClB,cAAc,EACd,KAAK,qBAAqB,EAC1B,+BAA+B,GAChC,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EACL,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC1B,qBAAqB,EACrB,sBAAsB,EACtB,KAAK,mBAAmB,EACxB,eAAe,EACf,gBAAgB,EAChB,KAAK,aAAa,GACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,cAAc,EACd,KAAK,qBAAqB,GAC3B,MAAM,sCAAsC,CAAC;AAC9C,YAAY,EACV,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,eAAe,EACf,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,SAAS,GACV,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/canvas/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EACL,KAAK,aAAa,EAClB,cAAc,EACd,KAAK,qBAAqB,EAC1B,+BAA+B,GAChC,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EACL,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC1B,qBAAqB,EACrB,sBAAsB,EACtB,KAAK,mBAAmB,EACxB,eAAe,EACf,gBAAgB,EAChB,KAAK,aAAa,GACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,cAAc,EACd,KAAK,qBAAqB,GAC3B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,SAAS,GACV,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,eAAe,EACf,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,SAAS,GACV,MAAM,YAAY,CAAC"}
@@ -14,6 +14,8 @@ export { CanvasInstance } from './core/CanvasInstance.js';
14
14
  export { CanvasRegistry, DEFAULT_CANVAS_REGISTRY_OPTIONS, } from './core/CanvasRegistry.js';
15
15
  export { createCanvasService } from './core/canvasFactory.js';
16
16
  export { DataCanvas } from './core/DataCanvas.js';
17
+ export { inferSchemaFromRows } from './core/schemaSniffer.js';
17
18
  export { ALLOWED_PLAN_OPERATORS, ALLOWED_STATEMENT_TYPES, assertNoDeniedFunctions, assertReadOnlyQuery, assertValidIdentifier, CANVAS_IDENTIFIER_REGEX, collectDisallowedOperators, collectPlanViolations, DENIED_TABLE_FUNCTIONS, quoteIdentifier, SQL_GATE_REASONS, } from './core/sqlGate.js';
18
19
  export { DuckdbProvider, } from './providers/duckdb/DuckdbProvider.js';
20
+ export { spillover, } from './spillover.js';
19
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/canvas/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAEL,cAAc,EAEd,+BAA+B,GAChC,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,EACL,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC1B,qBAAqB,EACrB,sBAAsB,EAEtB,eAAe,EACf,gBAAgB,GAEjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,cAAc,GAEf,MAAM,sCAAsC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/canvas/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAEL,cAAc,EAEd,+BAA+B,GAChC,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EACL,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC1B,qBAAqB,EACrB,sBAAsB,EAEtB,eAAe,EACf,gBAAgB,GAEjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,cAAc,GAEf,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAKL,SAAS,GACV,MAAM,gBAAgB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"DuckdbProvider.d.ts","sourceRoot":"","sources":["../../../../../src/services/canvas/providers/duckdb/DuckdbProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAOH,OAAO,EAAE,KAAK,cAAc,EAAyB,MAAM,oCAAoC,CAAC;AAEhG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAQ7E,OAAO,KAAK,EAIV,eAAe,EACf,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,SAAS,EACV,MAAM,gBAAgB,CAAC;AAsBxB,oFAAoF;AACpF,MAAM,WAAW,qBAAqB;IACpC,6CAA6C;IAC7C,eAAe,EAAE,MAAM,CAAC;IACxB,8CAA8C;IAC9C,cAAc,EAAE,MAAM,CAAC;IACvB,qDAAqD;IACrD,aAAa,EAAE,MAAM,CAAC;IACtB,oDAAoD;I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;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAwB5E;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAuBrE;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,GAAG,UAAU,CAW3E;AA6BD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,KAAK,CAoBvD"}
@@ -11,9 +11,9 @@ import { databaseError, notFound, timeout, validationError } from '../../../../t
11
11
  import { lazyImport } from '../../../../utils/internal/lazyImport.js';
12
12
  import { logger } from '../../../../utils/internal/logger.js';
13
13
  import { requestContextService } from '../../../../utils/internal/requestContext.js';
14
+ import { sniffSchema } from '../../core/schemaSniffer.js';
14
15
  import { assertNoDeniedFunctions, assertPlanReadOnly, assertSelectOnly, assertValidIdentifier, quoteIdentifier, } from '../../core/sqlGate.js';
15
16
  import { copyFormatClause, isPathTarget, pipeFileToStream, resolveExportPath, safeSizeBytes, tempFilePathFor, } from './exportWriter.js';
16
- import { sniffSchema } from './schemaSniffer.js';
17
17
  const importDuckDB = lazyImport(() => import('@duckdb/node-api'), 'Install "@duckdb/node-api" to use the DuckDB canvas provider: bun add @duckdb/node-api');
18
18
  export class DuckdbProvider {
19
19
  options;