Modernize TypeBox imports

Amolith created

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.

Change summary

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(-)

Detailed changes

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=="],

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"
 	}
 }

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;

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"
 	}
 }

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.
 

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";
 

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";
 

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"
 	}
 }

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 {