From 59bb87669bf325e76e4d82956cd25a9fb19131fb Mon Sep 17 00:00:00 2001 From: Amolith Date: Thu, 4 Jun 2026 07:34:12 -0600 Subject: [PATCH] Modernize TypeBox imports Use the Pi 0.78 extension docs' direct typebox dependency and import style for package tool schemas. This removes the legacy @sinclair/typebox dependency from packages that build TypeBox schemas at runtime. --- bun.lock | 8 +++----- packages/answer/package.json | 12 ++++++------ packages/answer/src/prompt.ts | 2 +- packages/handoff/package.json | 12 ++++++------ packages/handoff/src/handoff-extraction.ts | 2 +- packages/handoff/src/handoff-tool.ts | 2 +- packages/handoff/src/session-query-tool.ts | 2 +- packages/questionnaire/package.json | 10 +++++----- packages/questionnaire/src/index.ts | 2 +- 9 files changed, 25 insertions(+), 27 deletions(-) diff --git a/bun.lock b/bun.lock index f0e9361bc1ddd403219716494d1ddc0431bcab78..efd058812466f57ff6fb66b09877e3bd529a311c 100644 --- a/bun.lock +++ b/bun.lock @@ -15,7 +15,7 @@ "name": "@amolith/pi-answer", "version": "0.1.0", "dependencies": { - "@sinclair/typebox": "^0.34.49", + "typebox": "^1.1.38", }, "peerDependencies": { "@earendil-works/pi-ai": ">=0.74.0", @@ -27,7 +27,7 @@ "name": "@amolith/pi-handoff", "version": "0.1.0", "dependencies": { - "@sinclair/typebox": "^0.34.49", + "typebox": "^1.1.38", }, "peerDependencies": { "@earendil-works/pi-ai": ">=0.74.0", @@ -46,7 +46,7 @@ "name": "@amolith/pi-questionnaire", "version": "0.1.0", "dependencies": { - "@sinclair/typebox": "^0.34.49", + "typebox": "^1.1.38", }, "peerDependencies": { "@earendil-works/pi-coding-agent": ">=0.74.0", @@ -193,8 +193,6 @@ "@silvia-odwyer/photon-node": ["@silvia-odwyer/photon-node@0.3.4", "", {}, "sha512-bnly4BKB3KDTFxrUIcgCLbaeVVS8lrAkri1pEzskpmxu9MdfGQTy8b8EgcD83ywD3RPMsIulY8xJH5Awa+t9fA=="], - "@sinclair/typebox": ["@sinclair/typebox@0.34.49", "", {}, "sha512-brySQQs7Jtn0joV8Xh9ZV/hZb9Ozb0pmazDIASBkYKCjXrXU3mpcFahmK/z4YDhGkQvP9mWJbVyahdtU5wQA+A=="], - "@smithy/core": ["@smithy/core@3.24.6", "", { "dependencies": { "@aws-crypto/crc32": "5.2.0", "@smithy/types": "^4.14.3", "tslib": "^2.6.2" } }, "sha512-wBXDRup6UU97VKyaiRo8AssnfStPtG0oAAfpq/bC0a1YYau8pM86YB4kM6ccoVi1mS8l/UHbn9oDM+7uozr/ug=="], "@smithy/credential-provider-imds": ["@smithy/credential-provider-imds@4.3.7", "", { "dependencies": { "@smithy/core": "^3.24.6", "@smithy/types": "^4.14.3", "tslib": "^2.6.2" } }, "sha512-xj8gq/bjFABAh6qWPSDCYcY3kzQIm4b561C+YnHH4zGq8rOgzQ3Shk+JGlpUxSd41UGiO6FkLdUCtNX1FAeHgg=="], diff --git a/packages/answer/package.json b/packages/answer/package.json index 75e03f9e68b042efb60715906b9ab7054a3d1825..ae9fc7ee45db93044246373ed6543dfca93ba8ab 100644 --- a/packages/answer/package.json +++ b/packages/answer/package.json @@ -1,6 +1,11 @@ { "name": "@amolith/pi-answer", "version": "0.1.0", + "peerDependencies": { + "@earendil-works/pi-ai": ">=0.74.0", + "@earendil-works/pi-coding-agent": ">=0.74.0", + "@earendil-works/pi-tui": ">=0.74.0" + }, "description": "Interactive Q&A extraction from assistant responses for Pi", "keywords": [ "pi-package" @@ -13,13 +18,8 @@ "scripts": { "typecheck": "tsc --noEmit" }, - "peerDependencies": { - "@earendil-works/pi-ai": ">=0.74.0", - "@earendil-works/pi-coding-agent": ">=0.74.0", - "@earendil-works/pi-tui": ">=0.74.0" - }, "type": "module", "dependencies": { - "@sinclair/typebox": "^0.34.49" + "typebox": "^1.1.38" } } diff --git a/packages/answer/src/prompt.ts b/packages/answer/src/prompt.ts index 7f2c8ee42ade3bae1a8a9e98bfce460f148443ef..d4989e427af2ba8560c903398ab3ef9331862347 100644 --- a/packages/answer/src/prompt.ts +++ b/packages/answer/src/prompt.ts @@ -4,7 +4,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { Tool } from "@earendil-works/pi-ai"; -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; export interface ExtractedQuestion { question: string; diff --git a/packages/handoff/package.json b/packages/handoff/package.json index 6773d018c27afb786cfb8a2fbd182aa33b9ec66f..43b44941db9f6638e3b313784c4a4ae8b4845051 100644 --- a/packages/handoff/package.json +++ b/packages/handoff/package.json @@ -1,6 +1,11 @@ { "name": "@amolith/pi-handoff", "version": "0.1.0", + "peerDependencies": { + "@earendil-works/pi-ai": ">=0.74.0", + "@earendil-works/pi-coding-agent": ">=0.74.0", + "@earendil-works/pi-tui": ">=0.74.0" + }, "description": "Context-preserving session handoffs for Pi", "keywords": [ "pi-package" @@ -13,13 +18,8 @@ "scripts": { "typecheck": "tsc --noEmit" }, - "peerDependencies": { - "@earendil-works/pi-ai": ">=0.74.0", - "@earendil-works/pi-coding-agent": ">=0.74.0", - "@earendil-works/pi-tui": ">=0.74.0" - }, "type": "module", "dependencies": { - "@sinclair/typebox": "^0.34.49" + "typebox": "^1.1.38" } } diff --git a/packages/handoff/src/handoff-extraction.ts b/packages/handoff/src/handoff-extraction.ts index 24659ae75921008771e0a9755af66d4c6b51dcee..7ba9beb71fdb256fbce856bc982e8bfdce349b5e 100644 --- a/packages/handoff/src/handoff-extraction.ts +++ b/packages/handoff/src/handoff-extraction.ts @@ -5,7 +5,7 @@ import { complete, type Message, type Tool } from "@earendil-works/pi-ai"; import type { ExtensionContext } from "@earendil-works/pi-coding-agent"; -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; const SYSTEM_PROMPT = `You're helping transfer context between coding sessions. The next session starts fresh with no memory of this conversation, so extract what matters. diff --git a/packages/handoff/src/handoff-tool.ts b/packages/handoff/src/handoff-tool.ts index 83c4ca5b69c8a84092b1fb8c0661a9152d5537d3..551b7e04a34a0af94570f39b92d7f273a155623b 100644 --- a/packages/handoff/src/handoff-tool.ts +++ b/packages/handoff/src/handoff-tool.ts @@ -5,7 +5,7 @@ import type { ExtensionAPI, SessionEntry } from "@earendil-works/pi-coding-agent"; import { convertToLlm, serializeConversation } from "@earendil-works/pi-coding-agent"; -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import { extractCandidateFiles, extractLoadedSkills, resolveExtractionModel } from "./session-analysis.js"; import { type HandoffExtraction, assembleHandoffDraft, extractHandoffContext } from "./handoff-extraction.js"; diff --git a/packages/handoff/src/session-query-tool.ts b/packages/handoff/src/session-query-tool.ts index 80515f6bc5d7ccb2bfdb8b0d84c38710e1b0a127..4b8d08f5178b5bafbdedfe1ae50be553d583d530 100644 --- a/packages/handoff/src/session-query-tool.ts +++ b/packages/handoff/src/session-query-tool.ts @@ -6,7 +6,7 @@ import { complete, type Message } from "@earendil-works/pi-ai"; import type { ExtensionAPI, SessionEntry } from "@earendil-works/pi-coding-agent"; import { SessionManager, convertToLlm, serializeConversation } from "@earendil-works/pi-coding-agent"; -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; import * as fs from "node:fs"; import { getFallbackSessionsRoot, getSessionsRoot, normalizeSessionPath, sessionPathAllowed } from "./session-paths.js"; diff --git a/packages/questionnaire/package.json b/packages/questionnaire/package.json index f0cfb0e8ad33173ae8d8e4cb3b34312821004efe..9de7f2fa7c7abfdf849b04d127fb2d863806cd0e 100644 --- a/packages/questionnaire/package.json +++ b/packages/questionnaire/package.json @@ -1,6 +1,10 @@ { "name": "@amolith/pi-questionnaire", "version": "0.1.0", + "peerDependencies": { + "@earendil-works/pi-coding-agent": ">=0.74.0", + "@earendil-works/pi-tui": ">=0.74.0" + }, "description": "Multi-question interactive prompts for Pi", "keywords": [ "pi-package" @@ -13,12 +17,8 @@ "scripts": { "typecheck": "tsc --noEmit" }, - "peerDependencies": { - "@earendil-works/pi-coding-agent": ">=0.74.0", - "@earendil-works/pi-tui": ">=0.74.0" - }, "type": "module", "dependencies": { - "@sinclair/typebox": "^0.34.49" + "typebox": "^1.1.38" } } diff --git a/packages/questionnaire/src/index.ts b/packages/questionnaire/src/index.ts index e56dcf8add2c61534a98462e50227eca4151abba..da48f5a613c9f43746eb282641ee4f602b75e551 100644 --- a/packages/questionnaire/src/index.ts +++ b/packages/questionnaire/src/index.ts @@ -19,7 +19,7 @@ import { truncateToWidth, wrapTextWithAnsi, } from "@earendil-works/pi-tui"; -import { Type } from "@sinclair/typebox"; +import { Type } from "typebox"; // Types interface QuestionOption {