From e0068dd9f4e14b8c327ff4dfb127fadf76e1af10 Mon Sep 17 00:00:00 2001 From: Travis Gilbert <1travisgilbert@gmail.com> Date: Wed, 5 Aug 2026 19:28:50 -0400 Subject: [PATCH] Fix theorem-chat-register imports for Next webpack resolve. Drop extensionful relative imports so the console Railway build can transpile the package the same way theorem-acp and model-canvas do. --- .../src/TheoremChatRegister.tsx | 6 +++--- .../src/http-stream-transport.ts | 2 +- packages/theorem-chat-register/src/index.ts | 12 ++++++------ packages/theorem-chat-register/src/session.test.ts | 6 +++--- packages/theorem-chat-register/src/session.ts | 2 +- packages/theorem-chat-register/src/webview-html.ts | 2 +- packages/theorem-chat-register/tsconfig.json | 1 - 7 files changed, 15 insertions(+), 16 deletions(-) diff --git a/packages/theorem-chat-register/src/TheoremChatRegister.tsx b/packages/theorem-chat-register/src/TheoremChatRegister.tsx index 80278a9e..17432133 100644 --- a/packages/theorem-chat-register/src/TheoremChatRegister.tsx +++ b/packages/theorem-chat-register/src/TheoremChatRegister.tsx @@ -2,13 +2,13 @@ // SOURCING: none. SPEC-THEOREM-CHAT-REGISTER-1.0 TheoremChatRegister. import { useEffect, useMemo, useState, type FormEvent } from 'react'; -import { REGISTER_IMPL } from './register-impl.js'; +import { REGISTER_IMPL } from './register-impl'; import { createChatSessionController, type ChatSessionController, type ChatSessionSnapshot, -} from './session.js'; -import type { ChatTransport } from './transport.js'; +} from './session'; +import type { ChatTransport } from './transport'; export type TheoremChatRegisterProps = { readonly transport: ChatTransport; diff --git a/packages/theorem-chat-register/src/http-stream-transport.ts b/packages/theorem-chat-register/src/http-stream-transport.ts index f3684d2c..977634f6 100644 --- a/packages/theorem-chat-register/src/http-stream-transport.ts +++ b/packages/theorem-chat-register/src/http-stream-transport.ts @@ -1,6 +1,6 @@ // SOURCING: none. Console mount uses fetch SSE to /api/chat/stream (theorem-acp // bridge already behind that route). No OpenWork / opencode import. -import type { ChatTransport } from './transport.js'; +import type { ChatTransport } from './transport'; export type HttpStreamTransportOptions = { readonly endpoint?: string; diff --git a/packages/theorem-chat-register/src/index.ts b/packages/theorem-chat-register/src/index.ts index 1cc7e67b..30600f7f 100644 --- a/packages/theorem-chat-register/src/index.ts +++ b/packages/theorem-chat-register/src/index.ts @@ -1,12 +1,12 @@ // SOURCING: none. SPEC-THEOREM-CHAT-REGISTER-1.0 package barrel. -export { REGISTER_IMPL, type TheoremChatRegisterImpl } from './register-impl.js'; +export { REGISTER_IMPL, type TheoremChatRegisterImpl } from './register-impl'; export { createChatSessionController, type ChatMessage, type ChatSessionController, type ChatSessionSnapshot, -} from './session.js'; -export type { ChatTransport } from './transport.js'; -export { createHttpStreamTransport, type HttpStreamTransportOptions } from './http-stream-transport.js'; -export { TheoremChatRegister, type TheoremChatRegisterProps } from './TheoremChatRegister.tsx'; -export { renderTheoremChatWebviewHtml } from './webview-html.js'; +} from './session'; +export type { ChatTransport } from './transport'; +export { createHttpStreamTransport, type HttpStreamTransportOptions } from './http-stream-transport'; +export { TheoremChatRegister, type TheoremChatRegisterProps } from './TheoremChatRegister'; +export { renderTheoremChatWebviewHtml } from './webview-html'; diff --git a/packages/theorem-chat-register/src/session.test.ts b/packages/theorem-chat-register/src/session.test.ts index 43993fb1..2e06f612 100644 --- a/packages/theorem-chat-register/src/session.test.ts +++ b/packages/theorem-chat-register/src/session.test.ts @@ -1,8 +1,8 @@ // SOURCING: none. SPEC-THEOREM-CHAT-REGISTER-1.0 §2 / §6 CR-004 oracle. import { describe, expect, it, vi } from 'vitest'; -import { createChatSessionController } from './session.js'; -import type { ChatTransport } from './transport.js'; -import { REGISTER_IMPL } from './register-impl.js'; +import { createChatSessionController } from './session'; +import type { ChatTransport } from './transport'; +import { REGISTER_IMPL } from './register-impl'; function fakeTransport(replies: Record = { hi: 'hello' }): ChatTransport { let sessionId = ''; diff --git a/packages/theorem-chat-register/src/session.ts b/packages/theorem-chat-register/src/session.ts index 0ea6aad9..e54f5332 100644 --- a/packages/theorem-chat-register/src/session.ts +++ b/packages/theorem-chat-register/src/session.ts @@ -1,5 +1,5 @@ // SOURCING: none. SPEC-THEOREM-CHAT-REGISTER-1.0 §2 session controller. -import type { ChatTransport } from './transport.js'; +import type { ChatTransport } from './transport'; export type ChatMessage = { readonly id: string; diff --git a/packages/theorem-chat-register/src/webview-html.ts b/packages/theorem-chat-register/src/webview-html.ts index afb3d5e2..b7d91063 100644 --- a/packages/theorem-chat-register/src/webview-html.ts +++ b/packages/theorem-chat-register/src/webview-html.ts @@ -1,6 +1,6 @@ // SOURCING: none. Studio webview host: stamped HTML shell shared with the // React register's identity (theorem.chat). No OpenWork markup. -import { REGISTER_IMPL } from './register-impl.js'; +import { REGISTER_IMPL } from './register-impl'; /** * Minimal HTML document for VS Code / Studio webviews. The extension host owns diff --git a/packages/theorem-chat-register/tsconfig.json b/packages/theorem-chat-register/tsconfig.json index 5a86cff5..cda40df8 100644 --- a/packages/theorem-chat-register/tsconfig.json +++ b/packages/theorem-chat-register/tsconfig.json @@ -8,7 +8,6 @@ "strict": true, "skipLibCheck": true, "noEmit": true, - "verbatimModuleSyntax": true, "types": ["vitest/globals"] }, "include": ["src/**/*.ts", "src/**/*.tsx"]