From 587d31424c57c0d9b394a7ae8a760e64ecf4a47d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=94=A1=E5=BE=B7=E6=A3=AE?= Date: Wed, 21 Oct 2026 08:47:23 +0800 Subject: [PATCH 1/4] =?UTF-8?q?refactor:=20=E5=B0=86=20workspace=20?= =?UTF-8?q?=E5=8C=85=E5=91=BD=E5=90=8D=E7=A9=BA=E9=97=B4=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=E4=B8=BA=20@tarp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release-cli.yml | 2 +- README.md | 2 +- apps/desktop/AGENTS.md | 2 +- apps/desktop/README.md | 2 +- apps/desktop/package.json | 10 ++++----- apps/desktop/src/main/desktop.ts | 2 +- .../src/main/game/room-ai-settings.test.ts | 4 ++-- .../src/main/game/room-state-service.test.ts | 4 ++-- .../src/main/game/subscription-auth.test.ts | 2 +- apps/desktop/src/main/index.ts | 2 +- apps/desktop/src/main/mcp/playtest.test.ts | 6 ++--- apps/desktop/src/main/mcp/playtest.ts | 4 ++-- apps/desktop/src/main/media-path.test.ts | 2 +- .../src/main/modules/import-local-module.ts | 6 ++--- .../src/main/modules/list-modules.test.ts | 12 +++++----- apps/desktop/src/main/modules/list-modules.ts | 2 +- .../main/modules/module-companions.test.ts | 4 ++-- .../desktop/src/main/modules/module-import.ts | 4 ++-- .../main/modules/module-integration.test.ts | 2 +- apps/desktop/src/main/modules/module-root.ts | 2 +- .../desktop/src/main/modules/module-router.ts | 8 +++---- .../src/main/sessions/character-store.test.ts | 2 +- .../src/main/sessions/session-store.test.ts | 2 +- apps/desktop/src/main/tts/service.test.ts | 2 +- apps/desktop/src/main/tts/service.ts | 4 ++-- .../computation/document-worker-protocol.ts | 4 ++-- .../computation/document-worker-runtime.ts | 2 +- .../documents/computation/ses-compiler.ts | 2 +- .../worker-document-evaluator.test.ts | 6 ++--- .../computation/worker-document-evaluator.ts | 6 ++--- .../modules/DefaultDocumentLayout.tsx | 4 ++-- .../src/features/modules/DocumentCard.tsx | 4 ++-- .../features/modules/DocumentCardContent.tsx | 4 ++-- .../src/features/modules/DocumentCover.tsx | 2 +- .../features/modules/DocumentDetail.test.tsx | 2 +- .../src/features/modules/DocumentDetail.tsx | 6 ++--- .../src/features/modules/DocumentDialog.tsx | 4 ++-- .../features/modules/DocumentFieldErrors.tsx | 4 ++-- .../features/modules/DocumentFieldView.tsx | 6 ++--- .../features/modules/DocumentPreview.test.tsx | 8 +++---- .../src/features/modules/DocumentPreview.tsx | 4 ++-- .../features/modules/DocumentReferences.tsx | 6 ++--- .../src/features/modules/DocumentRenderer.tsx | 2 +- .../src/features/modules/DocumentSheet.tsx | 4 ++-- .../src/features/modules/DocumentTable.tsx | 10 ++++----- .../features/modules/DocumentTypesPage.tsx | 4 ++-- .../features/modules/DocumentValue.test.tsx | 2 +- .../src/features/modules/DocumentValue.tsx | 4 ++-- .../features/modules/EquipmentSlots.test.tsx | 4 ++-- .../src/features/modules/EquipmentSlots.tsx | 4 ++-- .../src/features/modules/FieldTable.tsx | 6 ++--- .../src/features/modules/FlowOutline.tsx | 9 ++------ .../src/features/modules/HandlebarsLayout.tsx | 11 ++++------ .../features/modules/LaunchOverviewPage.tsx | 6 ++--- .../src/features/modules/ModuleDocuments.tsx | 2 +- .../src/features/modules/ModulePage.tsx | 2 +- .../modules/ReferenceCollection.test.tsx | 4 ++-- .../features/modules/ReferenceCollection.tsx | 4 ++-- .../src/features/modules/ReferenceSheet.tsx | 4 ++-- .../modules/TemplateComponentView.tsx | 2 +- .../features/modules/TypeDefinitionPanel.tsx | 10 ++++----- .../src/features/modules/document-preview.ts | 10 ++++----- .../modules/document-renderer-element.tsx | 2 +- .../src/features/modules/document-sheet.ts | 8 +++---- .../src/features/modules/layout-values.ts | 10 ++++----- .../features/modules/reference-collection.ts | 8 +++---- .../features/modules/room-collection-rows.ts | 2 +- .../features/sessions/CharacterCardDialog.tsx | 2 +- .../src/features/sessions/CharacterFields.tsx | 4 ++-- .../sessions/CharacterPreview.test.tsx | 4 ++-- .../features/sessions/CharacterPreview.tsx | 4 ++-- .../features/sessions/CharacterSummary.tsx | 4 ++-- .../features/sessions/ChatMessageEntry.tsx | 2 +- .../src/features/sessions/ChatPanel.tsx | 4 ++-- .../features/sessions/CreationWorkbench.tsx | 2 +- .../src/features/sessions/GameParty.tsx | 2 +- .../src/features/sessions/LaunchCard.tsx | 2 +- .../src/features/sessions/RoomModule.tsx | 2 +- .../src/features/sessions/WorldStateCard.tsx | 6 ++--- .../sessions/character-sheet.test.tsx | 2 +- .../src/features/sessions/character-sheet.ts | 4 ++-- .../features/sessions/chat-markdown.test.tsx | 2 +- .../features/sessions/chat-timeline.test.ts | 4 ++-- .../sessions/npc-portrait-documents.ts | 2 +- .../src/features/sessions/npc-portrait.ts | 2 +- .../features/sessions/room-connection.test.ts | 16 +++++++------- .../src/features/sessions/room-connection.ts | 6 ++--- .../sessions/room-display-mutation.test.ts | 2 +- .../src/features/sessions/room-document.tsx | 2 +- .../src/features/sessions/room-draft-view.ts | 2 +- .../src/features/sessions/room-launch-view.ts | 4 ++-- .../src/features/sessions/use-room-state.ts | 2 +- .../sessions/use-room-visible-documents.ts | 2 +- apps/desktop/src/shared/desktop-api.ts | 6 ++--- bun.lock | 22 +++++++++---------- ...13\350\257\225\347\273\264\346\212\244.md" | 2 +- package.json | 8 +++---- packages/core/README.md | 2 +- packages/core/package.json | 2 +- .../node/agent/companion-document-tools.ts | 6 ++--- .../src/node/agent/context-subscriptions.ts | 2 +- .../src/node/agent/game-compaction.test.ts | 2 +- packages/core/src/node/agent/game-tools.ts | 4 ++-- packages/core/src/node/agent/pi-runtime.ts | 2 +- .../core/src/node/game/chat-service.test.ts | 14 ++++++------ .../core/src/node/game/chat/launch-cards.ts | 2 +- packages/core/src/node/game/chat/launch.ts | 2 +- packages/core/src/node/game/chat/narration.ts | 4 ++-- .../src/node/game/companion-launch.test.ts | 6 ++--- packages/core/src/node/game/companion.test.ts | 6 ++--- packages/core/src/node/game/companion.ts | 2 +- .../src/node/game/room-state-projection.ts | 10 ++++----- .../core/src/node/sessions/character-db.ts | 8 +++---- .../src/node/sessions/character-ownership.ts | 4 ++-- .../core/src/node/sessions/character-store.ts | 18 ++++++--------- .../src/node/sessions/companion-selection.ts | 4 ++-- .../core/src/node/sessions/compile-module.ts | 12 +++++----- .../node/sessions/document-reference-store.ts | 8 +++---- .../core/src/node/sessions/frozen-module.ts | 12 +++++----- .../src/node/sessions/game-document-patch.ts | 4 ++-- .../src/node/sessions/game-document-path.ts | 4 ++-- .../src/node/sessions/game-document-read.ts | 6 ++--- .../src/node/sessions/game-document-source.ts | 12 +++++----- .../src/node/sessions/game-document-views.ts | 10 ++++----- .../src/node/sessions/game-document-write.ts | 21 ++++++++---------- .../src/node/sessions/game-file-access.ts | 2 +- .../core/src/node/sessions/game-file-index.ts | 4 ++-- .../src/node/sessions/game-overlay.test.ts | 2 +- .../core/src/node/sessions/game-overlay.ts | 4 ++-- .../core/src/node/sessions/game-pointers.ts | 2 +- .../core/src/node/sessions/game-state.test.ts | 10 ++++----- packages/core/src/node/sessions/launch-db.ts | 4 ++-- .../src/node/sessions/launch-store.test.ts | 4 ++-- .../core/src/node/sessions/launch-store.ts | 10 ++++----- .../src/node/sessions/module-sync.test.ts | 4 ++-- .../core/src/node/sessions/module-sync.ts | 17 ++++++-------- .../core/src/node/sessions/room-storage.ts | 2 +- .../core/src/node/sessions/session-store.ts | 16 +++++++------- .../core/src/node/storage/config-file.test.ts | 10 ++++----- packages/core/src/node/storage/config-file.ts | 4 ++-- packages/core/src/shared/launch.ts | 10 ++++----- packages/core/src/shared/narrative.ts | 2 +- packages/core/src/shared/room-state.ts | 6 ++--- packages/core/src/shared/session.ts | 4 ++-- packages/core/src/testing/launch-module.ts | 4 ++-- packages/module-cli/README.md | 10 ++++----- packages/module-cli/package.json | 8 +++---- packages/module-cli/src/commands.test.ts | 4 ++-- packages/module-cli/src/commands.ts | 6 ++--- packages/module/README.md | 6 ++--- packages/module/package.json | 6 ++--- .../module/src/node/module-documents.test.ts | 2 +- .../module/src/node/module-metadata.test.ts | 2 +- scripts/test.ts | 10 ++++----- 154 files changed, 388 insertions(+), 406 deletions(-) diff --git a/.github/workflows/release-cli.yml b/.github/workflows/release-cli.yml index 3e02342..61b83d2 100644 --- a/.github/workflows/release-cli.yml +++ b/.github/workflows/release-cli.yml @@ -40,7 +40,7 @@ jobs: throw new Error(`tag 必须为 cli-v${version}`); } JS - - run: bun run --filter @jointarp/module-cli pack + - run: bun run --filter @tarp/module-cli pack - run: bun scripts/release/smoke.ts cli - name: 整理发布包、对应源码和校验和 run: | diff --git a/README.md b/README.md index 74189bf..9ee6fd0 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ bun run dev 构建 CLI 后,可以直接用 Bun 校验模组: ```sh -bun run --filter @jointarp/module-cli build +bun run --filter @tarp/module-cli build bun run cli module validate ./apps/desktop/examples/建卡控件演示 --json ``` diff --git a/apps/desktop/AGENTS.md b/apps/desktop/AGENTS.md index 199ca07..d553d44 100644 --- a/apps/desktop/AGENTS.md +++ b/apps/desktop/AGENTS.md @@ -1,7 +1,7 @@ # 桌面应用约定 - 使用中文交流和中文 Markdown 文档。 -- 本目录是 TARP Bun workspace 的 `@jointarp/desktop` 子包;依赖在仓库根目录安装,锁文件由根目录统一维护。 +- 本目录是 TARP Bun workspace 的 `@tarp/desktop` 子包;依赖在仓库根目录安装,锁文件由根目录统一维护。 - 保留 TypeScript 7、Electrobun(Bun 主进程、系统 WebView)和 Oxfmt;Git 钩子由仓库根目录管理。 - 测试优先覆盖可观察行为并复用已有场景;简单映射、纯透传和样式调整不新增独立测试文件。测试范围与维护原则见 `../../docs/测试维护.md`。 - 源码仓库只维护开发环境、内部契约、架构、实现、扩展、恢复、测试和发布文档;玩家指南与模组配置规范统一在官网文档维护,不在 README 或 `docs/` 复制教程、参数表和完整配置示例。影响公开行为或模组格式时同步更新官网正文。跨仓库文档引用使用公开地址,不依赖本地目录布局。 diff --git a/apps/desktop/README.md b/apps/desktop/README.md index b34618e..0605b66 100644 --- a/apps/desktop/README.md +++ b/apps/desktop/README.md @@ -23,7 +23,7 @@ bun install --cwd ../.. bun run dev ``` -本目录是 `@jointarp/desktop` workspace 子包。依赖在 monorepo 根目录统一安装,仅维护根级 `bun.lock`;需要按锁文件安装时从根目录运行 `bun install --frozen-lockfile`。本页桌面命令在 `apps/desktop/` 执行。 +本目录是 `@tarp/desktop` workspace 子包。依赖在 monorepo 根目录统一安装,仅维护根级 `bun.lock`;需要按锁文件安装时从根目录运行 `bun install --frozen-lockfile`。本页桌面命令在 `apps/desktop/` 执行。 首次运行构建、开发或类型检查时,`electrobun prepare` 下载固定的 Electrobun 2.0.4 devkit、配套 Hutch 和 Bun 1.4.0,生成忽略提交的 `.hutch/devkit/`。开发机器的 Bun 负责 workspace 和脚本,随桌面分发的 Bun 由 Electrobun 固定,两者独立。所有依赖仍从仓库根目录安装,仅维护根级 `bun.lock`;`hutch.config.ts` 明确使用 Bun,不生成 `hutch.lock`。 diff --git a/apps/desktop/package.json b/apps/desktop/package.json index 048ddcd..1aa5219 100644 --- a/apps/desktop/package.json +++ b/apps/desktop/package.json @@ -1,5 +1,5 @@ { - "name": "@jointarp/desktop", + "name": "@tarp/desktop", "version": "0.1.0", "private": true, "description": "由 AI 主持的桌面跑团应用。", @@ -12,8 +12,8 @@ "typecheck": "bun run prepare:desktop && bun --bun x --no-install tsc --noEmit", "fmt": "oxfmt", "fmt:check": "oxfmt --check", - "test": "bun ../../scripts/test.ts --scope @jointarp/desktop", - "test:changed": "bun ../../scripts/test.ts --scope @jointarp/desktop --changed", + "test": "bun ../../scripts/test.ts --scope @tarp/desktop", + "test:changed": "bun ../../scripts/test.ts --scope @tarp/desktop --changed", "preview": "electrobun dev", "package": "bun run scripts/desktop.ts package", "dist": "bun run scripts/desktop.ts dist", @@ -24,8 +24,6 @@ "@colyseus/schema": "5.0.34", "@earendil-works/pi-ai": "1.2.0", "@earendil-works/pi-coding-agent": "1.2.0", - "@jointarp/module": "workspace:*", - "@jointarp/module-cli": "workspace:*", "@modelcontextprotocol/sdk": "^1.32.1", "@orpc/client": "^2.0.0-beta.36", "@orpc/contract": "^2.0.0-beta.36", @@ -35,6 +33,8 @@ "@tanstack/react-router": "^1.170.17", "@tanstack/react-virtual": "^3.14.13", "@tarp/core": "workspace:*", + "@tarp/module": "workspace:*", + "@tarp/module-cli": "workspace:*", "class-variance-authority": "^0.7.1", "cn": "^0.2.6", "es-toolkit": "^1.52.0", diff --git a/apps/desktop/src/main/desktop.ts b/apps/desktop/src/main/desktop.ts index 357e3c6..5f128ea 100644 --- a/apps/desktop/src/main/desktop.ts +++ b/apps/desktop/src/main/desktop.ts @@ -1,9 +1,9 @@ import { isAbsolute, join } from "node:path"; -import { modulePreviewHash } from "@jointarp/module-cli/commands"; import { NativeMessagePort, type NativeBridge } from "@shared/native-bridge"; import { ChatService, createPiRuntime } from "@tarp/core/node"; import { narrationGapMs } from "@tarp/core/shared/narration"; +import { modulePreviewHash } from "@tarp/module-cli/commands"; import Electrobun, { BrowserView, Utils } from "electrobun/main"; import { readAppConfig, resolveAppConfigLocation } from "./config/app-config"; diff --git a/apps/desktop/src/main/game/room-ai-settings.test.ts b/apps/desktop/src/main/game/room-ai-settings.test.ts index 164369e..627b7a8 100644 --- a/apps/desktop/src/main/game/room-ai-settings.test.ts +++ b/apps/desktop/src/main/game/room-ai-settings.test.ts @@ -6,11 +6,11 @@ import { tmpdir } from "node:os"; import { join } from "node:path"; import { builtinProviders } from "@earendil-works/pi-ai/providers/all"; -import { waitFor } from "@jointarp/module/testing/async"; -import { writeTestFile as writeFile } from "@jointarp/module/testing/files"; import { ChatService } from "@tarp/core/node/game/chat-service"; import { readRoomSettings } from "@tarp/core/node/sessions/room-settings"; import { createSession } from "@tarp/core/node/sessions/session-store"; +import { waitFor } from "@tarp/module/testing/async"; +import { writeTestFile as writeFile } from "@tarp/module/testing/files"; import { LocalGameSettings } from "./local-settings"; import { RoomAiSettingsStore } from "./room-ai-settings"; diff --git a/apps/desktop/src/main/game/room-state-service.test.ts b/apps/desktop/src/main/game/room-state-service.test.ts index 4087dd2..9373ad1 100644 --- a/apps/desktop/src/main/game/room-state-service.test.ts +++ b/apps/desktop/src/main/game/room-state-service.test.ts @@ -7,8 +7,6 @@ import { join } from "node:path"; import { MessageChannel } from "node:worker_threads"; import { Decoder } from "@colyseus/schema"; -import type { WorkbenchView } from "@jointarp/module/creation-workbench"; -import { writeTestFile as writeFile } from "@jointarp/module/testing/files"; import { createORPCClient } from "@orpc/client"; import { RPCLink } from "@orpc/client/message-port"; import type { ContractRouterClient } from "@orpc/contract"; @@ -46,6 +44,8 @@ import type { LaunchAction } from "@tarp/core/shared/launch"; import { ROOM_PROTOCOL_VERSION } from "@tarp/core/shared/room-state"; import { RoomStateSchema } from "@tarp/core/shared/room-state-schema"; import { createLaunchTestModule } from "@tarp/core/testing/launch-module"; +import type { WorkbenchView } from "@tarp/module/creation-workbench"; +import { writeTestFile as writeFile } from "@tarp/module/testing/files"; import { RoomConnection } from "../../renderer/src/features/sessions/room-connection"; import { diff --git a/apps/desktop/src/main/game/subscription-auth.test.ts b/apps/desktop/src/main/game/subscription-auth.test.ts index 5d1ccbe..4a2ab2b 100644 --- a/apps/desktop/src/main/game/subscription-auth.test.ts +++ b/apps/desktop/src/main/game/subscription-auth.test.ts @@ -6,7 +6,7 @@ import { join } from "node:path"; import type { OAuthCredential, OAuthAuth } from "@earendil-works/pi-ai"; import { openaiCodexProvider } from "@earendil-works/pi-ai/providers/openai-codex"; -import { waitFor } from "@jointarp/module/testing/async"; +import { waitFor } from "@tarp/module/testing/async"; import { LocalGameSettings } from "./local-settings"; import { SubscriptionAuth } from "./subscription-auth"; diff --git a/apps/desktop/src/main/index.ts b/apps/desktop/src/main/index.ts index 9375578..110446c 100644 --- a/apps/desktop/src/main/index.ts +++ b/apps/desktop/src/main/index.ts @@ -1,4 +1,4 @@ -import { parseModuleCommand, runModuleCommand } from "@jointarp/module-cli/commands"; +import { parseModuleCommand, runModuleCommand } from "@tarp/module-cli/commands"; import manifest from "../../package.json"; diff --git a/apps/desktop/src/main/mcp/playtest.test.ts b/apps/desktop/src/main/mcp/playtest.test.ts index 264d50d..fdcf8e2 100644 --- a/apps/desktop/src/main/mcp/playtest.test.ts +++ b/apps/desktop/src/main/mcp/playtest.test.ts @@ -6,15 +6,15 @@ import { createServer } from "node:http"; import { join } from "node:path"; import { fauxAssistantMessage, fauxToolCall } from "@earendil-works/pi-ai"; -import { waitFor } from "@jointarp/module/testing/async"; -import { writeTestFile as writeFile } from "@jointarp/module/testing/files"; -import { createTestModule } from "@jointarp/module/testing/test-module"; import { Client } from "@modelcontextprotocol/sdk/client/index.js"; import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"; import { ChatService, type Runtime } from "@tarp/core/node"; import { updateGameDocument } from "@tarp/core/node/sessions/game-state"; import { createSession, openSessionDatabase } from "@tarp/core/node/sessions/session-store"; import { gameDefaultsSchema } from "@tarp/core/shared/game-defaults"; +import { waitFor } from "@tarp/module/testing/async"; +import { writeTestFile as writeFile } from "@tarp/module/testing/files"; +import { createTestModule } from "@tarp/module/testing/test-module"; import { PlaytestService, playtestCreateSchema } from "./playtest"; import { startPlaytestMcp } from "./server"; diff --git a/apps/desktop/src/main/mcp/playtest.ts b/apps/desktop/src/main/mcp/playtest.ts index 371972f..14f83fd 100644 --- a/apps/desktop/src/main/mcp/playtest.ts +++ b/apps/desktop/src/main/mcp/playtest.ts @@ -1,7 +1,5 @@ import { join, isAbsolute } from "node:path"; -import { sameDocumentIdentity } from "@jointarp/module/document-path"; -import { emptyFlowRun } from "@jointarp/module/flow"; import type { ChatService } from "@tarp/core/node"; import { readCharacters } from "@tarp/core/node/sessions/character-db"; import { gameDocumentViews } from "@tarp/core/node/sessions/game-state"; @@ -23,6 +21,8 @@ import { structuredFile } from "@tarp/core/node/storage/structured-file"; import { chatText } from "@tarp/core/shared/agent-message"; import { aiConfigSchema, type Player } from "@tarp/core/shared/game"; import type { GameDefaults } from "@tarp/core/shared/game-defaults"; +import { sameDocumentIdentity } from "@tarp/module/document-path"; +import { emptyFlowRun } from "@tarp/module/flow"; import { z } from "zod"; export const playtestCreateSchema = z.strictObject({ diff --git a/apps/desktop/src/main/media-path.test.ts b/apps/desktop/src/main/media-path.test.ts index 48bf794..df9f7f4 100644 --- a/apps/desktop/src/main/media-path.test.ts +++ b/apps/desktop/src/main/media-path.test.ts @@ -4,7 +4,7 @@ import { mkdir, mkdtemp, realpath, rename, rm, symlink } from "node:fs/promises" import { tmpdir } from "node:os"; import { join } from "node:path"; -import { writeTestFile as writeFile } from "@jointarp/module/testing/files"; +import { writeTestFile as writeFile } from "@tarp/module/testing/files"; import { documentMediaUrl } from "../shared/document-media"; import { allowDocumentMediaRoots, resolveMediaRequestFile } from "./media-path"; diff --git a/apps/desktop/src/main/modules/import-local-module.ts b/apps/desktop/src/main/modules/import-local-module.ts index 2ca53eb..bf80d0b 100644 --- a/apps/desktop/src/main/modules/import-local-module.ts +++ b/apps/desktop/src/main/modules/import-local-module.ts @@ -1,10 +1,10 @@ import { mkdir, readdir, realpath } from "node:fs/promises"; import { basename, join } from "node:path"; -import { configFilePath } from "@jointarp/module/node/config-file"; -import { extractModuleZip } from "@jointarp/module/node/extract-zip"; -import { loadModuleMetadata } from "@jointarp/module/node/module-metadata"; import { copyModule, directoryExists } from "@tarp/core/node/sessions/module-copy"; +import { configFilePath } from "@tarp/module/node/config-file"; +import { extractModuleZip } from "@tarp/module/node/extract-zip"; +import { loadModuleMetadata } from "@tarp/module/node/module-metadata"; import { assertNoSymlinks, moduleFolderName, publishModule } from "./module-import"; import { resolveModuleRoot } from "./module-root"; diff --git a/apps/desktop/src/main/modules/list-modules.test.ts b/apps/desktop/src/main/modules/list-modules.test.ts index 84d4797..2fb16e7 100644 --- a/apps/desktop/src/main/modules/list-modules.test.ts +++ b/apps/desktop/src/main/modules/list-modules.test.ts @@ -7,15 +7,15 @@ import { dirname, join } from "node:path"; import { pathToFileURL } from "node:url"; import { promisify } from "node:util"; -import { loadDocumentTypes } from "@jointarp/module/node/document-types"; +import { createSession } from "@tarp/core/node/sessions/session-store"; +import { loadDocumentTypes } from "@tarp/module/node/document-types"; import { loadModuleDocuments, loadModuleLibraryDocuments, -} from "@jointarp/module/node/module-documents"; -import { loadModuleMetadata } from "@jointarp/module/node/module-metadata"; -import { loadModulePages } from "@jointarp/module/node/module-pages"; -import { writeTestFile as writeFile } from "@jointarp/module/testing/files"; -import { createSession } from "@tarp/core/node/sessions/session-store"; +} from "@tarp/module/node/module-documents"; +import { loadModuleMetadata } from "@tarp/module/node/module-metadata"; +import { loadModulePages } from "@tarp/module/node/module-pages"; +import { writeTestFile as writeFile } from "@tarp/module/testing/files"; import { documentMediaUrl } from "../../shared/document-media"; import { resolveMediaRequestFile } from "../media-path"; diff --git a/apps/desktop/src/main/modules/list-modules.ts b/apps/desktop/src/main/modules/list-modules.ts index b31e0a2..3a1c3ff 100644 --- a/apps/desktop/src/main/modules/list-modules.ts +++ b/apps/desktop/src/main/modules/list-modules.ts @@ -1,8 +1,8 @@ import { mkdir, readdir, stat } from "node:fs/promises"; import { join } from "node:path"; -import { loadModuleMetadata } from "@jointarp/module/node/module-metadata"; import type { ModuleSummary } from "@shared/desktop-api"; +import { loadModuleMetadata } from "@tarp/module/node/module-metadata"; import { allowDocumentMediaRoots } from "../media-path"; import { resolveModuleRoot } from "./module-root"; diff --git a/apps/desktop/src/main/modules/module-companions.test.ts b/apps/desktop/src/main/modules/module-companions.test.ts index 9061559..471d2f5 100644 --- a/apps/desktop/src/main/modules/module-companions.test.ts +++ b/apps/desktop/src/main/modules/module-companions.test.ts @@ -2,11 +2,11 @@ import { test } from "bun:test"; import { strict as assert } from "node:assert"; import { randomUUID } from "node:crypto"; -import { loadModuleMetadata } from "@jointarp/module/node/module-metadata"; -import { createTestModule } from "@jointarp/module/testing/test-module"; import { ChatService } from "@tarp/core/node/game/chat-service"; import { advanceLaunch, launchState } from "@tarp/core/node/sessions/launch-store"; import { createSession } from "@tarp/core/node/sessions/session-store"; +import { loadModuleMetadata } from "@tarp/module/node/module-metadata"; +import { createTestModule } from "@tarp/module/testing/test-module"; test("模组预设角色可作为 AI 队友入队,真人角色不可重复占用", async () => { const fixture = await createTestModule(); diff --git a/apps/desktop/src/main/modules/module-import.ts b/apps/desktop/src/main/modules/module-import.ts index aa85050..7adaa43 100644 --- a/apps/desktop/src/main/modules/module-import.ts +++ b/apps/desktop/src/main/modules/module-import.ts @@ -1,9 +1,9 @@ import { lstat, mkdir, mkdtemp, readdir, rename, rm } from "node:fs/promises"; import { join, relative } from "node:path"; -import { loadDocumentTypes } from "@jointarp/module/node/document-types"; -import { loadModuleMetadata } from "@jointarp/module/node/module-metadata"; import { isMissingFile, withFileMutation } from "@tarp/core/node/storage/file-queue"; +import { loadDocumentTypes } from "@tarp/module/node/document-types"; +import { loadModuleMetadata } from "@tarp/module/node/module-metadata"; import { resolveModuleRoot } from "./module-root"; diff --git a/apps/desktop/src/main/modules/module-integration.test.ts b/apps/desktop/src/main/modules/module-integration.test.ts index 01d88c0..ba7b655 100644 --- a/apps/desktop/src/main/modules/module-integration.test.ts +++ b/apps/desktop/src/main/modules/module-integration.test.ts @@ -4,7 +4,6 @@ import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; import { join } from "node:path"; -import { createTestModule, type TestComputedCharacter } from "@jointarp/module/testing/test-module"; import { createGameTools } from "@tarp/core/node/agent/game-tools"; import { ChatService } from "@tarp/core/node/game/chat-service"; import { @@ -20,6 +19,7 @@ import { openSessionDatabase, roomDirectory, } from "@tarp/core/node/sessions/session-store"; +import { createTestModule, type TestComputedCharacter } from "@tarp/module/testing/test-module"; test("模组选角与开场隔离秘密,主持可读取资料,字段揭示与结算持久化且失败不写入", async () => { const f = await createTestModule(); diff --git a/apps/desktop/src/main/modules/module-root.ts b/apps/desktop/src/main/modules/module-root.ts index 28e787d..ec5c95f 100644 --- a/apps/desktop/src/main/modules/module-root.ts +++ b/apps/desktop/src/main/modules/module-root.ts @@ -1,8 +1,8 @@ import { lstat } from "node:fs/promises"; import { join } from "node:path"; -import { configFilePath } from "@jointarp/module/node/config-file"; import { isMissingFile } from "@tarp/core/node/storage/file-queue"; +import { configFilePath } from "@tarp/module/node/config-file"; /** 模组库允许直接内容目录或固定 module/ 外层,根路径本身可以是本地快捷方式。 */ export async function resolveModuleRoot(directory: string): Promise { diff --git a/apps/desktop/src/main/modules/module-router.ts b/apps/desktop/src/main/modules/module-router.ts index 6fbd5f0..ef8c3e0 100644 --- a/apps/desktop/src/main/modules/module-router.ts +++ b/apps/desktop/src/main/modules/module-router.ts @@ -1,11 +1,11 @@ import { mkdir } from "node:fs/promises"; -import { loadDocumentTypes } from "@jointarp/module/node/document-types"; -import { loadModuleLibraryDocuments } from "@jointarp/module/node/module-documents"; -import { loadModuleMetadata } from "@jointarp/module/node/module-metadata"; -import { loadModulePages } from "@jointarp/module/node/module-pages"; import { ORPCError } from "@orpc/server"; import type { ModulesDirectory, OpenModuleLibraryResult } from "@shared/desktop-api"; +import { loadDocumentTypes } from "@tarp/module/node/document-types"; +import { loadModuleLibraryDocuments } from "@tarp/module/node/module-documents"; +import { loadModuleMetadata } from "@tarp/module/node/module-metadata"; +import { loadModulePages } from "@tarp/module/node/module-pages"; import { z } from "zod"; import { diff --git a/apps/desktop/src/main/sessions/character-store.test.ts b/apps/desktop/src/main/sessions/character-store.test.ts index fe68de4..b13ccac 100644 --- a/apps/desktop/src/main/sessions/character-store.test.ts +++ b/apps/desktop/src/main/sessions/character-store.test.ts @@ -5,7 +5,6 @@ import { access, mkdir, mkdtemp, realpath, rm } from "node:fs/promises"; import { tmpdir } from "node:os"; import { join } from "node:path"; -import { writeTestFile as writeFile } from "@jointarp/module/testing/files"; import { readAdventureState } from "@tarp/core/node/sessions/adventure-state"; import { readCharacters } from "@tarp/core/node/sessions/character-db"; import { @@ -16,6 +15,7 @@ import { } from "@tarp/core/node/sessions/character-store"; import { publicGameDocuments } from "@tarp/core/node/sessions/game-state"; import { createSession } from "@tarp/core/node/sessions/session-store"; +import { writeTestFile as writeFile } from "@tarp/module/testing/files"; import { documentMediaUrl } from "../../shared/document-media"; import { resolveMediaRequestFile } from "../media-path"; diff --git a/apps/desktop/src/main/sessions/session-store.test.ts b/apps/desktop/src/main/sessions/session-store.test.ts index 868b581..0dd9f62 100644 --- a/apps/desktop/src/main/sessions/session-store.test.ts +++ b/apps/desktop/src/main/sessions/session-store.test.ts @@ -16,7 +16,6 @@ import { import { tmpdir } from "node:os"; import { join } from "node:path"; -import { writeTestFile as writeFile } from "@jointarp/module/testing/files"; import { beginAdventureEdit, commitAdventureEdit, @@ -35,6 +34,7 @@ import { saveRoomNotes, setSessionStatus, } from "@tarp/core/node/sessions/session-store"; +import { writeTestFile as writeFile } from "@tarp/module/testing/files"; import { documentMediaUrl } from "../../shared/document-media"; import { resolveMediaRequestFile } from "../media-path"; diff --git a/apps/desktop/src/main/tts/service.test.ts b/apps/desktop/src/main/tts/service.test.ts index 997b3aa..1b6bfa1 100644 --- a/apps/desktop/src/main/tts/service.test.ts +++ b/apps/desktop/src/main/tts/service.test.ts @@ -4,9 +4,9 @@ import { mkdir, mkdtemp, readFile, rm } from "node:fs/promises"; import { tmpdir } from "node:os"; import { join } from "node:path"; -import { writeTestFile as writeFile } from "@jointarp/module/testing/files"; import { initializeRoomSettings } from "@tarp/core/node/sessions/room-settings"; import { initializeAdventure, updateAdventure } from "@tarp/core/node/sessions/room-storage"; +import { writeTestFile as writeFile } from "@tarp/module/testing/files"; import { mimoTtsProvider } from "./mimo"; import type { TtsProvider } from "./provider"; diff --git a/apps/desktop/src/main/tts/service.ts b/apps/desktop/src/main/tts/service.ts index d319ef3..1d15374 100644 --- a/apps/desktop/src/main/tts/service.ts +++ b/apps/desktop/src/main/tts/service.ts @@ -1,11 +1,11 @@ import { createHash } from "node:crypto"; import { join } from "node:path"; -import { documentIdentity } from "@jointarp/module/document-path"; -import { loadModuleMetadata } from "@jointarp/module/node/module-metadata"; import { readRoomSettings, updateRoomSettings } from "@tarp/core/node/sessions/room-settings"; import { readAdventure } from "@tarp/core/node/sessions/room-storage"; import { roomDirectory } from "@tarp/core/node/sessions/session-store"; +import { documentIdentity } from "@tarp/module/document-path"; +import { loadModuleMetadata } from "@tarp/module/node/module-metadata"; import { z } from "zod"; import type { ModuleMetadata } from "../../shared/desktop-api"; diff --git a/apps/desktop/src/renderer/src/features/documents/computation/document-worker-protocol.ts b/apps/desktop/src/renderer/src/features/documents/computation/document-worker-protocol.ts index 079db18..a23a654 100644 --- a/apps/desktop/src/renderer/src/features/documents/computation/document-worker-protocol.ts +++ b/apps/desktop/src/renderer/src/features/documents/computation/document-worker-protocol.ts @@ -1,5 +1,5 @@ -import type { ParsedModuleDocument } from "@jointarp/module/document-evaluator"; -import type { ModuleDocument } from "@jointarp/module/module-document"; +import type { ParsedModuleDocument } from "@tarp/module/document-evaluator"; +import type { ModuleDocument } from "@tarp/module/module-document"; export type DocumentSnapshotItem = ParsedModuleDocument | ModuleDocument; export type DocumentWorkerCommand = diff --git a/apps/desktop/src/renderer/src/features/documents/computation/document-worker-runtime.ts b/apps/desktop/src/renderer/src/features/documents/computation/document-worker-runtime.ts index e5f4cfe..fd99935 100644 --- a/apps/desktop/src/renderer/src/features/documents/computation/document-worker-runtime.ts +++ b/apps/desktop/src/renderer/src/features/documents/computation/document-worker-runtime.ts @@ -1,4 +1,4 @@ -import { DocumentEvaluator } from "@jointarp/module/document-evaluator"; +import { DocumentEvaluator } from "@tarp/module/document-evaluator"; import type { DocumentWorkerRequest, DocumentWorkerResponse } from "./document-worker-protocol"; import { createSESCompiler } from "./ses-compiler"; diff --git a/apps/desktop/src/renderer/src/features/documents/computation/ses-compiler.ts b/apps/desktop/src/renderer/src/features/documents/computation/ses-compiler.ts index a784178..e130530 100644 --- a/apps/desktop/src/renderer/src/features/documents/computation/ses-compiler.ts +++ b/apps/desktop/src/renderer/src/features/documents/computation/ses-compiler.ts @@ -1,4 +1,4 @@ -import type { DocumentComputationCompiler } from "@jointarp/module/document-evaluator"; +import type { DocumentComputationCompiler } from "@tarp/module/document-evaluator"; import type {} from "ses"; const names = [ diff --git a/apps/desktop/src/renderer/src/features/documents/computation/worker-document-evaluator.test.ts b/apps/desktop/src/renderer/src/features/documents/computation/worker-document-evaluator.test.ts index 7cb20bc..c215e41 100644 --- a/apps/desktop/src/renderer/src/features/documents/computation/worker-document-evaluator.test.ts +++ b/apps/desktop/src/renderer/src/features/documents/computation/worker-document-evaluator.test.ts @@ -1,9 +1,9 @@ import { onTestFinished, test } from "bun:test"; import { strict as assert } from "node:assert"; -import { DocumentEvaluator, type ParsedModuleDocument } from "@jointarp/module/document-evaluator"; -import { documentIdentity } from "@jointarp/module/document-path"; -import { validateDocumentLayout, validateDocumentType } from "@jointarp/module/document-type"; +import { DocumentEvaluator, type ParsedModuleDocument } from "@tarp/module/document-evaluator"; +import { documentIdentity } from "@tarp/module/document-path"; +import { validateDocumentLayout, validateDocumentType } from "@tarp/module/document-type"; import { WorkerDocumentEvaluator, type WorkerEvaluatorOptions } from "./worker-document-evaluator"; diff --git a/apps/desktop/src/renderer/src/features/documents/computation/worker-document-evaluator.ts b/apps/desktop/src/renderer/src/features/documents/computation/worker-document-evaluator.ts index 97f7e3e..ff72f5e 100644 --- a/apps/desktop/src/renderer/src/features/documents/computation/worker-document-evaluator.ts +++ b/apps/desktop/src/renderer/src/features/documents/computation/worker-document-evaluator.ts @@ -1,6 +1,6 @@ -import type { ParsedModuleDocument } from "@jointarp/module/document-evaluator"; -import { documentIdentity } from "@jointarp/module/document-path"; -import type { ModuleDocument } from "@jointarp/module/module-document"; +import type { ParsedModuleDocument } from "@tarp/module/document-evaluator"; +import { documentIdentity } from "@tarp/module/document-path"; +import type { ModuleDocument } from "@tarp/module/module-document"; import type { DocumentSnapshotItem, diff --git a/apps/desktop/src/renderer/src/features/modules/DefaultDocumentLayout.tsx b/apps/desktop/src/renderer/src/features/modules/DefaultDocumentLayout.tsx index 6d6bd37..70ffa35 100644 --- a/apps/desktop/src/renderer/src/features/modules/DefaultDocumentLayout.tsx +++ b/apps/desktop/src/renderer/src/features/modules/DefaultDocumentLayout.tsx @@ -1,5 +1,5 @@ -import { defaultDocumentFields, type PresetLayout } from "@jointarp/module/document-templates"; -import { shouldHideEmptyField } from "@jointarp/module/public-document-field"; +import { defaultDocumentFields, type PresetLayout } from "@tarp/module/document-templates"; +import { shouldHideEmptyField } from "@tarp/module/public-document-field"; import { Suspense } from "react"; import { DocumentMarkdown, documentMarkdownPlugins } from "./document-markdown"; diff --git a/apps/desktop/src/renderer/src/features/modules/DocumentCard.tsx b/apps/desktop/src/renderer/src/features/modules/DocumentCard.tsx index fd7a0b4..5d64ac2 100644 --- a/apps/desktop/src/renderer/src/features/modules/DocumentCard.tsx +++ b/apps/desktop/src/renderer/src/features/modules/DocumentCard.tsx @@ -1,6 +1,6 @@ -import type { DocumentType } from "@jointarp/module/document-type"; -import { isDocumentVisible } from "@jointarp/module/module-document"; import type { ModuleDocument } from "@shared/desktop-api"; +import type { DocumentType } from "@tarp/module/document-type"; +import { isDocumentVisible } from "@tarp/module/module-document"; import { cn } from "cn"; import { Check } from "lucide-react"; import { AnimatePresence, motion } from "motion/react"; diff --git a/apps/desktop/src/renderer/src/features/modules/DocumentCardContent.tsx b/apps/desktop/src/renderer/src/features/modules/DocumentCardContent.tsx index c9c39fb..de2e5ae 100644 --- a/apps/desktop/src/renderer/src/features/modules/DocumentCardContent.tsx +++ b/apps/desktop/src/renderer/src/features/modules/DocumentCardContent.tsx @@ -1,6 +1,6 @@ -import { defaultDocumentCard, type DocumentType } from "@jointarp/module/document-type"; -import { isDocumentVisible } from "@jointarp/module/module-document"; import type { ModuleDocument } from "@shared/desktop-api"; +import { defaultDocumentCard, type DocumentType } from "@tarp/module/document-type"; +import { isDocumentVisible } from "@tarp/module/module-document"; import type { SyntheticEvent } from "react"; import { Tooltip } from "../../components/ui/tooltip"; diff --git a/apps/desktop/src/renderer/src/features/modules/DocumentCover.tsx b/apps/desktop/src/renderer/src/features/modules/DocumentCover.tsx index 5058b49..84bbea4 100644 --- a/apps/desktop/src/renderer/src/features/modules/DocumentCover.tsx +++ b/apps/desktop/src/renderer/src/features/modules/DocumentCover.tsx @@ -1,4 +1,4 @@ -import { imageAspectRatio, type ImageAspect } from "@jointarp/module/image-aspect"; +import { imageAspectRatio, type ImageAspect } from "@tarp/module/image-aspect"; import { cn } from "cn"; import { useState } from "react"; diff --git a/apps/desktop/src/renderer/src/features/modules/DocumentDetail.test.tsx b/apps/desktop/src/renderer/src/features/modules/DocumentDetail.test.tsx index 6a85549..ae9c6a6 100644 --- a/apps/desktop/src/renderer/src/features/modules/DocumentDetail.test.tsx +++ b/apps/desktop/src/renderer/src/features/modules/DocumentDetail.test.tsx @@ -1,7 +1,7 @@ import { test } from "bun:test"; import { strict as assert } from "node:assert"; -import { validateDocumentLayout, validateDocumentType } from "@jointarp/module/document-type"; +import { validateDocumentLayout, validateDocumentType } from "@tarp/module/document-type"; import type { ReactNode } from "react"; import { renderToReadableStream } from "react-dom/server"; diff --git a/apps/desktop/src/renderer/src/features/modules/DocumentDetail.tsx b/apps/desktop/src/renderer/src/features/modules/DocumentDetail.tsx index 094cd1b..a5231f6 100644 --- a/apps/desktop/src/renderer/src/features/modules/DocumentDetail.tsx +++ b/apps/desktop/src/renderer/src/features/modules/DocumentDetail.tsx @@ -1,7 +1,7 @@ -import { documentDetailTemplate } from "@jointarp/module/document-templates"; -import type { DocumentType } from "@jointarp/module/document-type"; -import { isDocumentVisible } from "@jointarp/module/module-document"; import type { ModuleDocument } from "@shared/desktop-api"; +import { documentDetailTemplate } from "@tarp/module/document-templates"; +import type { DocumentType } from "@tarp/module/document-type"; +import { isDocumentVisible } from "@tarp/module/module-document"; import { ScrollAreaPane } from "../../components/ui/scroll-area"; import { RoomDocument } from "../sessions/room-document"; diff --git a/apps/desktop/src/renderer/src/features/modules/DocumentDialog.tsx b/apps/desktop/src/renderer/src/features/modules/DocumentDialog.tsx index 45ab461..63d4ad1 100644 --- a/apps/desktop/src/renderer/src/features/modules/DocumentDialog.tsx +++ b/apps/desktop/src/renderer/src/features/modules/DocumentDialog.tsx @@ -1,6 +1,6 @@ -import type { DocumentType } from "@jointarp/module/document-type"; -import { isDocumentVisible } from "@jointarp/module/module-document"; import type { ModuleDocument } from "@shared/desktop-api"; +import type { DocumentType } from "@tarp/module/document-type"; +import { isDocumentVisible } from "@tarp/module/module-document"; import { useEffect, useRef, type ReactElement, type ReactNode } from "react"; import { preload } from "react-dom"; diff --git a/apps/desktop/src/renderer/src/features/modules/DocumentFieldErrors.tsx b/apps/desktop/src/renderer/src/features/modules/DocumentFieldErrors.tsx index 9018c5b..80abeef 100644 --- a/apps/desktop/src/renderer/src/features/modules/DocumentFieldErrors.tsx +++ b/apps/desktop/src/renderer/src/features/modules/DocumentFieldErrors.tsx @@ -1,5 +1,5 @@ -import type { DocumentType } from "@jointarp/module/document-type"; -import { getDocumentField } from "@jointarp/module/public-document-field"; +import type { DocumentType } from "@tarp/module/document-type"; +import { getDocumentField } from "@tarp/module/public-document-field"; import { FieldCalculationError } from "./FieldCalculationError"; diff --git a/apps/desktop/src/renderer/src/features/modules/DocumentFieldView.tsx b/apps/desktop/src/renderer/src/features/modules/DocumentFieldView.tsx index 2bf79db..fcdc7b4 100644 --- a/apps/desktop/src/renderer/src/features/modules/DocumentFieldView.tsx +++ b/apps/desktop/src/renderer/src/features/modules/DocumentFieldView.tsx @@ -1,6 +1,6 @@ -import type { DocumentFieldViewLayout } from "@jointarp/module/document-field-view"; -import type { DocumentField } from "@jointarp/module/document-type"; -import { fieldErrorAtPath, getDocumentField } from "@jointarp/module/public-document-field"; +import type { DocumentFieldViewLayout } from "@tarp/module/document-field-view"; +import type { DocumentField } from "@tarp/module/document-type"; +import { fieldErrorAtPath, getDocumentField } from "@tarp/module/public-document-field"; import { DocumentValue } from "./DocumentValue"; import { EquipmentSlots } from "./EquipmentSlots"; diff --git a/apps/desktop/src/renderer/src/features/modules/DocumentPreview.test.tsx b/apps/desktop/src/renderer/src/features/modules/DocumentPreview.test.tsx index a4cb349..535953e 100644 --- a/apps/desktop/src/renderer/src/features/modules/DocumentPreview.test.tsx +++ b/apps/desktop/src/renderer/src/features/modules/DocumentPreview.test.tsx @@ -1,11 +1,11 @@ import { test } from "bun:test"; import { strict as assert } from "node:assert"; -import { publicValues } from "@jointarp/module/character"; -import { evaluateComputedFields } from "@jointarp/module/computed-fields"; -import { validateDocumentLayout, validateDocumentType } from "@jointarp/module/document-type"; -import { equipmentSlotsSchema } from "@jointarp/module/equipment-slots"; import type { ModuleDocument } from "@shared/desktop-api"; +import { publicValues } from "@tarp/module/character"; +import { evaluateComputedFields } from "@tarp/module/computed-fields"; +import { validateDocumentLayout, validateDocumentType } from "@tarp/module/document-type"; +import { equipmentSlotsSchema } from "@tarp/module/equipment-slots"; import type { ReactNode } from "react"; import { renderToReadableStream, renderToStaticMarkup } from "react-dom/server"; diff --git a/apps/desktop/src/renderer/src/features/modules/DocumentPreview.tsx b/apps/desktop/src/renderer/src/features/modules/DocumentPreview.tsx index c979c52..62740d7 100644 --- a/apps/desktop/src/renderer/src/features/modules/DocumentPreview.tsx +++ b/apps/desktop/src/renderer/src/features/modules/DocumentPreview.tsx @@ -1,6 +1,6 @@ -import { defaultDocumentHover, type DocumentType } from "@jointarp/module/document-type"; -import { isDocumentVisible } from "@jointarp/module/module-document"; import type { ModuleDocument } from "@shared/desktop-api"; +import { defaultDocumentHover, type DocumentType } from "@tarp/module/document-type"; +import { isDocumentVisible } from "@tarp/module/module-document"; import type { ReactNode } from "react"; import { RoomDocument } from "../sessions/room-document"; diff --git a/apps/desktop/src/renderer/src/features/modules/DocumentReferences.tsx b/apps/desktop/src/renderer/src/features/modules/DocumentReferences.tsx index 06138b1..6856c8a 100644 --- a/apps/desktop/src/renderer/src/features/modules/DocumentReferences.tsx +++ b/apps/desktop/src/renderer/src/features/modules/DocumentReferences.tsx @@ -1,8 +1,8 @@ import { PreviewCard } from "@base-ui/react/preview-card"; -import { documentIdentity } from "@jointarp/module/document-path"; -import { defaultDocumentHover, type DocumentType } from "@jointarp/module/document-type"; -import { isDocumentVisible } from "@jointarp/module/module-document"; import type { ModuleDocument } from "@shared/desktop-api"; +import { documentIdentity } from "@tarp/module/document-path"; +import { defaultDocumentHover, type DocumentType } from "@tarp/module/document-type"; +import { isDocumentVisible } from "@tarp/module/module-document"; import { createContext, useContext, useMemo, useState, useEffect, type ReactNode } from "react"; import type { Components } from "react-markdown"; diff --git a/apps/desktop/src/renderer/src/features/modules/DocumentRenderer.tsx b/apps/desktop/src/renderer/src/features/modules/DocumentRenderer.tsx index c510e9a..d3a8098 100644 --- a/apps/desktop/src/renderer/src/features/modules/DocumentRenderer.tsx +++ b/apps/desktop/src/renderer/src/features/modules/DocumentRenderer.tsx @@ -1,4 +1,4 @@ -import type { DocumentPresentation } from "@jointarp/module/document-templates"; +import type { DocumentPresentation } from "@tarp/module/document-templates"; import { createElement, useLayoutEffect, useRef } from "react"; import { diff --git a/apps/desktop/src/renderer/src/features/modules/DocumentSheet.tsx b/apps/desktop/src/renderer/src/features/modules/DocumentSheet.tsx index 6cfd3d0..4b5d873 100644 --- a/apps/desktop/src/renderer/src/features/modules/DocumentSheet.tsx +++ b/apps/desktop/src/renderer/src/features/modules/DocumentSheet.tsx @@ -1,5 +1,5 @@ -import { documentIdentity } from "@jointarp/module/document-path"; -import { isDocumentVisible } from "@jointarp/module/module-document"; +import { documentIdentity } from "@tarp/module/document-path"; +import { isDocumentVisible } from "@tarp/module/module-document"; import { useContext } from "react"; import { useDocumentLibrary } from "./document-library-context"; diff --git a/apps/desktop/src/renderer/src/features/modules/DocumentTable.tsx b/apps/desktop/src/renderer/src/features/modules/DocumentTable.tsx index afd2618..0a88598 100644 --- a/apps/desktop/src/renderer/src/features/modules/DocumentTable.tsx +++ b/apps/desktop/src/renderer/src/features/modules/DocumentTable.tsx @@ -1,14 +1,14 @@ -import { documentIdentity } from "@jointarp/module/document-path"; -import type { DocumentListLayout, DocumentType } from "@jointarp/module/document-type"; -import { isDocumentVisible } from "@jointarp/module/module-document"; +import type { ModuleDocument } from "@shared/desktop-api"; +import { documentIdentity } from "@tarp/module/document-path"; +import type { DocumentListLayout, DocumentType } from "@tarp/module/document-type"; +import { isDocumentVisible } from "@tarp/module/module-document"; import { fieldErrorAtPath, getDocumentField, hasFieldErrors, getPublicDocumentField, shouldHideEmptyField, -} from "@jointarp/module/public-document-field"; -import type { ModuleDocument } from "@shared/desktop-api"; +} from "@tarp/module/public-document-field"; import { RoomDocument } from "../sessions/room-document"; import { useDocumentLibrary } from "./document-library-context"; diff --git a/apps/desktop/src/renderer/src/features/modules/DocumentTypesPage.tsx b/apps/desktop/src/renderer/src/features/modules/DocumentTypesPage.tsx index ab1fedb..132dbb0 100644 --- a/apps/desktop/src/renderer/src/features/modules/DocumentTypesPage.tsx +++ b/apps/desktop/src/renderer/src/features/modules/DocumentTypesPage.tsx @@ -1,7 +1,7 @@ -import { typeFormatLabel } from "@jointarp/module/document-path"; -import type { DocumentType } from "@jointarp/module/document-type"; import type { ModuleDocument } from "@shared/desktop-api"; import { Link } from "@tanstack/react-router"; +import { typeFormatLabel } from "@tarp/module/document-path"; +import type { DocumentType } from "@tarp/module/document-type"; import { cn } from "cn"; import { FileCode2, FileText, Shapes } from "lucide-react"; diff --git a/apps/desktop/src/renderer/src/features/modules/DocumentValue.test.tsx b/apps/desktop/src/renderer/src/features/modules/DocumentValue.test.tsx index 05421c5..64409bb 100644 --- a/apps/desktop/src/renderer/src/features/modules/DocumentValue.test.tsx +++ b/apps/desktop/src/renderer/src/features/modules/DocumentValue.test.tsx @@ -1,7 +1,7 @@ import { test } from "bun:test"; import { strict as assert } from "node:assert"; -import type { DocumentField } from "@jointarp/module/document-type"; +import type { DocumentField } from "@tarp/module/document-type"; import type { ReactNode } from "react"; import { renderToReadableStream } from "react-dom/server"; diff --git a/apps/desktop/src/renderer/src/features/modules/DocumentValue.tsx b/apps/desktop/src/renderer/src/features/modules/DocumentValue.tsx index e526e0b..0eb3c13 100644 --- a/apps/desktop/src/renderer/src/features/modules/DocumentValue.tsx +++ b/apps/desktop/src/renderer/src/features/modules/DocumentValue.tsx @@ -1,9 +1,9 @@ -import type { DocumentField, DocumentListItem } from "@jointarp/module/document-type"; +import type { DocumentField, DocumentListItem } from "@tarp/module/document-type"; import { fieldErrorAtPath, hasFieldErrors, shouldHideEmptyField, -} from "@jointarp/module/public-document-field"; +} from "@tarp/module/public-document-field"; import { Suspense } from "react"; import { LoadingIndicator } from "../../components/ui/loading-indicator"; diff --git a/apps/desktop/src/renderer/src/features/modules/EquipmentSlots.test.tsx b/apps/desktop/src/renderer/src/features/modules/EquipmentSlots.test.tsx index 1822db2..8bfd414 100644 --- a/apps/desktop/src/renderer/src/features/modules/EquipmentSlots.test.tsx +++ b/apps/desktop/src/renderer/src/features/modules/EquipmentSlots.test.tsx @@ -1,8 +1,8 @@ import { test } from "bun:test"; import { strict as assert } from "node:assert"; -import { validateDocumentLayout, validateDocumentType } from "@jointarp/module/document-type"; -import type { EquipmentSlotsLayout } from "@jointarp/module/equipment-slots"; +import { validateDocumentLayout, validateDocumentType } from "@tarp/module/document-type"; +import type { EquipmentSlotsLayout } from "@tarp/module/equipment-slots"; import type { ReactNode } from "react"; import { renderToReadableStream } from "react-dom/server"; diff --git a/apps/desktop/src/renderer/src/features/modules/EquipmentSlots.tsx b/apps/desktop/src/renderer/src/features/modules/EquipmentSlots.tsx index 4ecbad3..642a17e 100644 --- a/apps/desktop/src/renderer/src/features/modules/EquipmentSlots.tsx +++ b/apps/desktop/src/renderer/src/features/modules/EquipmentSlots.tsx @@ -1,6 +1,6 @@ -import type { EquipmentSlotsLayout } from "@jointarp/module/equipment-slots"; -import { isDocumentVisible } from "@jointarp/module/module-document"; import type { ModuleDocument } from "@shared/desktop-api"; +import type { EquipmentSlotsLayout } from "@tarp/module/equipment-slots"; +import { isDocumentVisible } from "@tarp/module/module-document"; import { CircleQuestionMark, Crown, Footprints, Gem, Hand, Shield, Shirt } from "lucide-react"; import { RoomDocument } from "../sessions/room-document"; diff --git a/apps/desktop/src/renderer/src/features/modules/FieldTable.tsx b/apps/desktop/src/renderer/src/features/modules/FieldTable.tsx index 0aa8146..3e3b77f 100644 --- a/apps/desktop/src/renderer/src/features/modules/FieldTable.tsx +++ b/apps/desktop/src/renderer/src/features/modules/FieldTable.tsx @@ -1,10 +1,10 @@ -import type { DocumentField } from "@jointarp/module/document-type"; -import { validateFieldTableRows, type FieldTableLayout } from "@jointarp/module/field-table"; +import type { DocumentField } from "@tarp/module/document-type"; +import { validateFieldTableRows, type FieldTableLayout } from "@tarp/module/field-table"; import { fieldErrorAtPath, getPublicDocumentField, shouldHideEmptyField, -} from "@jointarp/module/public-document-field"; +} from "@tarp/module/public-document-field"; import { useState } from "react"; import { Input } from "../../components/ui/input"; diff --git a/apps/desktop/src/renderer/src/features/modules/FlowOutline.tsx b/apps/desktop/src/renderer/src/features/modules/FlowOutline.tsx index 8876ce5..d67ec69 100644 --- a/apps/desktop/src/renderer/src/features/modules/FlowOutline.tsx +++ b/apps/desktop/src/renderer/src/features/modules/FlowOutline.tsx @@ -1,11 +1,6 @@ -import { documentIdentity, sameDocumentIdentity } from "@jointarp/module/document-path"; -import { - nodeOptions, - type CreationFlow, - type FlowNode, - type PreludeFlow, -} from "@jointarp/module/flow"; import type { ModuleDocument } from "@shared/desktop-api"; +import { documentIdentity, sameDocumentIdentity } from "@tarp/module/document-path"; +import { nodeOptions, type CreationFlow, type FlowNode, type PreludeFlow } from "@tarp/module/flow"; import { ArrowRight, BookOpen } from "lucide-react"; import { DocumentReference } from "./DocumentReferences"; diff --git a/apps/desktop/src/renderer/src/features/modules/HandlebarsLayout.tsx b/apps/desktop/src/renderer/src/features/modules/HandlebarsLayout.tsx index 9e36ff4..db9a794 100644 --- a/apps/desktop/src/renderer/src/features/modules/HandlebarsLayout.tsx +++ b/apps/desktop/src/renderer/src/features/modules/HandlebarsLayout.tsx @@ -1,15 +1,12 @@ -import { publicValues } from "@jointarp/module/character"; -import { - renderHandlebarsTemplate, - type TemplateHtmlNode, -} from "@jointarp/module/handlebars-template"; -import { fieldErrorAtPath, publicFieldErrors } from "@jointarp/module/public-document-field"; +import { publicValues } from "@tarp/module/character"; +import { renderHandlebarsTemplate, type TemplateHtmlNode } from "@tarp/module/handlebars-template"; +import { fieldErrorAtPath, publicFieldErrors } from "@tarp/module/public-document-field"; import { templateComponentSchema, templateComponentNode, validateTemplateComponent, type TemplateLayout, -} from "@jointarp/module/template-layout"; +} from "@tarp/module/template-layout"; import { attributesToProps } from "html-react-parser"; import { createElement, type ReactNode } from "react"; diff --git a/apps/desktop/src/renderer/src/features/modules/LaunchOverviewPage.tsx b/apps/desktop/src/renderer/src/features/modules/LaunchOverviewPage.tsx index 454a3b9..ee6e57f 100644 --- a/apps/desktop/src/renderer/src/features/modules/LaunchOverviewPage.tsx +++ b/apps/desktop/src/renderer/src/features/modules/LaunchOverviewPage.tsx @@ -1,8 +1,8 @@ -import type { DocumentType } from "@jointarp/module/document-type"; -import type { GameStart } from "@jointarp/module/flow"; -import { parseNarrative } from "@jointarp/module/narrative"; import type { ModuleDocument, ModuleMetadata } from "@shared/desktop-api"; import { Link } from "@tanstack/react-router"; +import type { DocumentType } from "@tarp/module/document-type"; +import type { GameStart } from "@tarp/module/flow"; +import { parseNarrative } from "@tarp/module/narrative"; import { cn } from "cn"; import { ArrowLeft, UserRound } from "lucide-react"; diff --git a/apps/desktop/src/renderer/src/features/modules/ModuleDocuments.tsx b/apps/desktop/src/renderer/src/features/modules/ModuleDocuments.tsx index cb97ec8..b0c0eb2 100644 --- a/apps/desktop/src/renderer/src/features/modules/ModuleDocuments.tsx +++ b/apps/desktop/src/renderer/src/features/modules/ModuleDocuments.tsx @@ -1,5 +1,5 @@ -import { defaultDocumentList, type DocumentType } from "@jointarp/module/document-type"; import type { ModuleDocument } from "@shared/desktop-api"; +import { defaultDocumentList, type DocumentType } from "@tarp/module/document-type"; import { FileText } from "lucide-react"; import { useEffect } from "react"; diff --git a/apps/desktop/src/renderer/src/features/modules/ModulePage.tsx b/apps/desktop/src/renderer/src/features/modules/ModulePage.tsx index e14f02b..dcff106 100644 --- a/apps/desktop/src/renderer/src/features/modules/ModulePage.tsx +++ b/apps/desktop/src/renderer/src/features/modules/ModulePage.tsx @@ -1,7 +1,7 @@ -import { typeFormatLabel } from "@jointarp/module/document-path"; import { searchItems } from "@shared/query"; import { useQuery } from "@tanstack/react-query"; import { useSearch } from "@tanstack/react-router"; +import { typeFormatLabel } from "@tarp/module/document-path"; import { BookOpenText, FileCode2, FileText, TriangleAlert } from "lucide-react"; import { useEffect, useMemo, useState } from "react"; diff --git a/apps/desktop/src/renderer/src/features/modules/ReferenceCollection.test.tsx b/apps/desktop/src/renderer/src/features/modules/ReferenceCollection.test.tsx index cbc566a..6db1ed1 100644 --- a/apps/desktop/src/renderer/src/features/modules/ReferenceCollection.test.tsx +++ b/apps/desktop/src/renderer/src/features/modules/ReferenceCollection.test.tsx @@ -1,8 +1,8 @@ import { test, mock } from "bun:test"; import { strict as assert } from "node:assert"; -import { validateDocumentLayout, validateDocumentType } from "@jointarp/module/document-type"; -import { referenceCollectionSchema } from "@jointarp/module/reference-collection"; +import { validateDocumentLayout, validateDocumentType } from "@tarp/module/document-type"; +import { referenceCollectionSchema } from "@tarp/module/reference-collection"; import type { ReactNode } from "react"; import { renderToReadableStream, renderToStaticMarkup } from "react-dom/server"; diff --git a/apps/desktop/src/renderer/src/features/modules/ReferenceCollection.tsx b/apps/desktop/src/renderer/src/features/modules/ReferenceCollection.tsx index 119d4a8..7759b36 100644 --- a/apps/desktop/src/renderer/src/features/modules/ReferenceCollection.tsx +++ b/apps/desktop/src/renderer/src/features/modules/ReferenceCollection.tsx @@ -1,5 +1,5 @@ -import type { DocumentField } from "@jointarp/module/document-type"; -import type { ReferenceCollectionLayout } from "@jointarp/module/reference-collection"; +import type { DocumentField } from "@tarp/module/document-type"; +import type { ReferenceCollectionLayout } from "@tarp/module/reference-collection"; import { LayoutGrid, List, PanelsTopLeft, Search } from "lucide-react"; import { lazy, Suspense, useMemo, useState } from "react"; diff --git a/apps/desktop/src/renderer/src/features/modules/ReferenceSheet.tsx b/apps/desktop/src/renderer/src/features/modules/ReferenceSheet.tsx index 869f2b0..96c0873 100644 --- a/apps/desktop/src/renderer/src/features/modules/ReferenceSheet.tsx +++ b/apps/desktop/src/renderer/src/features/modules/ReferenceSheet.tsx @@ -1,6 +1,6 @@ -import { documentIdentity } from "@jointarp/module/document-path"; -import { isDocumentVisible } from "@jointarp/module/module-document"; import type { ModuleDocument } from "@shared/desktop-api"; +import { documentIdentity } from "@tarp/module/document-path"; +import { isDocumentVisible } from "@tarp/module/module-document"; import { useContext } from "react"; import { Button } from "../../components/ui/button"; diff --git a/apps/desktop/src/renderer/src/features/modules/TemplateComponentView.tsx b/apps/desktop/src/renderer/src/features/modules/TemplateComponentView.tsx index 13a1ad5..f8fccf7 100644 --- a/apps/desktop/src/renderer/src/features/modules/TemplateComponentView.tsx +++ b/apps/desktop/src/renderer/src/features/modules/TemplateComponentView.tsx @@ -1,4 +1,4 @@ -import { itemGridConfig, type TemplateComponent } from "@jointarp/module/template-layout"; +import { itemGridConfig, type TemplateComponent } from "@tarp/module/template-layout"; import { Suspense } from "react"; import { DocumentMarkdown, documentMarkdownPlugins } from "./document-markdown"; diff --git a/apps/desktop/src/renderer/src/features/modules/TypeDefinitionPanel.tsx b/apps/desktop/src/renderer/src/features/modules/TypeDefinitionPanel.tsx index d90d5c4..e0c6479 100644 --- a/apps/desktop/src/renderer/src/features/modules/TypeDefinitionPanel.tsx +++ b/apps/desktop/src/renderer/src/features/modules/TypeDefinitionPanel.tsx @@ -1,14 +1,14 @@ -import { typeFormatLabel } from "@jointarp/module/document-path"; +import type { ModuleDocument } from "@shared/desktop-api"; +import { Link } from "@tanstack/react-router"; +import { typeFormatLabel } from "@tarp/module/document-path"; import { defaultDocumentCard, defaultDocumentHover, defaultDocumentReference, type DocumentLayoutSection, type DocumentType, -} from "@jointarp/module/document-type"; -import { imageAspectRatio } from "@jointarp/module/image-aspect"; -import type { ModuleDocument } from "@shared/desktop-api"; -import { Link } from "@tanstack/react-router"; +} from "@tarp/module/document-type"; +import { imageAspectRatio } from "@tarp/module/image-aspect"; import { cn } from "cn"; import { buttonVariants } from "../../components/ui/button"; diff --git a/apps/desktop/src/renderer/src/features/modules/document-preview.ts b/apps/desktop/src/renderer/src/features/modules/document-preview.ts index a7b1ccd..529664f 100644 --- a/apps/desktop/src/renderer/src/features/modules/document-preview.ts +++ b/apps/desktop/src/renderer/src/features/modules/document-preview.ts @@ -1,14 +1,14 @@ -import type { DocumentType } from "@jointarp/module/document-type"; -import { isDocumentVisible } from "@jointarp/module/module-document"; +import type { ModuleDocument } from "@shared/desktop-api"; +import type { DocumentType } from "@tarp/module/document-type"; +import { isDocumentVisible } from "@tarp/module/module-document"; import { fieldErrorAtPath, getDocumentField, hasFieldErrors, getPublicDocumentField, shouldHideEmptyField, -} from "@jointarp/module/public-document-field"; -import { displayFieldDefinition } from "@jointarp/module/template-layout"; -import type { ModuleDocument } from "@shared/desktop-api"; +} from "@tarp/module/public-document-field"; +import { displayFieldDefinition } from "@tarp/module/template-layout"; import { fromMarkdown } from "mdast-util-from-markdown"; import { gfmFromMarkdown } from "mdast-util-gfm"; import { gfm } from "micromark-extension-gfm"; diff --git a/apps/desktop/src/renderer/src/features/modules/document-renderer-element.tsx b/apps/desktop/src/renderer/src/features/modules/document-renderer-element.tsx index ef39b49..83bed04 100644 --- a/apps/desktop/src/renderer/src/features/modules/document-renderer-element.tsx +++ b/apps/desktop/src/renderer/src/features/modules/document-renderer-element.tsx @@ -1,4 +1,4 @@ -import type { DocumentPresentation } from "@jointarp/module/document-templates"; +import type { DocumentPresentation } from "@tarp/module/document-templates"; import { createElement } from "react"; import { createRoot, type Root } from "react-dom/client"; diff --git a/apps/desktop/src/renderer/src/features/modules/document-sheet.ts b/apps/desktop/src/renderer/src/features/modules/document-sheet.ts index 7af4420..36ac7d7 100644 --- a/apps/desktop/src/renderer/src/features/modules/document-sheet.ts +++ b/apps/desktop/src/renderer/src/features/modules/document-sheet.ts @@ -1,7 +1,7 @@ -import { documentDetailTemplate } from "@jointarp/module/document-templates"; -import type { DocumentPresentation } from "@jointarp/module/document-templates"; -import type { DocumentType } from "@jointarp/module/document-type"; -import type { ModuleDocument } from "@jointarp/module/module-document"; +import { documentDetailTemplate } from "@tarp/module/document-templates"; +import type { DocumentPresentation } from "@tarp/module/document-templates"; +import type { DocumentType } from "@tarp/module/document-type"; +import type { ModuleDocument } from "@tarp/module/module-document"; export interface DocumentSheetModel { template: DocumentPresentation; diff --git a/apps/desktop/src/renderer/src/features/modules/layout-values.ts b/apps/desktop/src/renderer/src/features/modules/layout-values.ts index 8636fea..9a03c1f 100644 --- a/apps/desktop/src/renderer/src/features/modules/layout-values.ts +++ b/apps/desktop/src/renderer/src/features/modules/layout-values.ts @@ -1,12 +1,12 @@ -import { readDocumentPath } from "@jointarp/module/document-field-values"; -import type { DocumentField, DocumentType } from "@jointarp/module/document-type"; -import type { ModuleDocument } from "@jointarp/module/module-document"; +import { readDocumentPath } from "@tarp/module/document-field-values"; +import type { DocumentField, DocumentType } from "@tarp/module/document-type"; +import type { ModuleDocument } from "@tarp/module/module-document"; import { fieldErrorAtPath, getDocumentField, getPublicDocumentField, -} from "@jointarp/module/public-document-field"; -import { displayFieldDefinition } from "@jointarp/module/template-layout"; +} from "@tarp/module/public-document-field"; +import { displayFieldDefinition } from "@tarp/module/template-layout"; export interface LayoutContext { document: ModuleDocument; diff --git a/apps/desktop/src/renderer/src/features/modules/reference-collection.ts b/apps/desktop/src/renderer/src/features/modules/reference-collection.ts index fefee78..648a552 100644 --- a/apps/desktop/src/renderer/src/features/modules/reference-collection.ts +++ b/apps/desktop/src/renderer/src/features/modules/reference-collection.ts @@ -1,7 +1,7 @@ -import { documentIdentity } from "@jointarp/module/document-path"; -import type { DocumentField } from "@jointarp/module/document-type"; -import { shouldHideEmptyField } from "@jointarp/module/public-document-field"; -import type { ReferenceCollectionLayout } from "@jointarp/module/reference-collection"; +import { documentIdentity } from "@tarp/module/document-path"; +import type { DocumentField } from "@tarp/module/document-type"; +import { shouldHideEmptyField } from "@tarp/module/public-document-field"; +import type { ReferenceCollectionLayout } from "@tarp/module/reference-collection"; import type { ReferenceDocument } from "./DocumentReferences"; diff --git a/apps/desktop/src/renderer/src/features/modules/room-collection-rows.ts b/apps/desktop/src/renderer/src/features/modules/room-collection-rows.ts index 4b701d7..c5629b4 100644 --- a/apps/desktop/src/renderer/src/features/modules/room-collection-rows.ts +++ b/apps/desktop/src/renderer/src/features/modules/room-collection-rows.ts @@ -1,5 +1,5 @@ -import { documentIdentity } from "@jointarp/module/document-path"; import type { ModuleDocument } from "@shared/desktop-api"; +import { documentIdentity } from "@tarp/module/document-path"; import type { ReferenceDocument } from "./DocumentReferences"; import type { ReferenceCollectionRow } from "./reference-collection"; diff --git a/apps/desktop/src/renderer/src/features/sessions/CharacterCardDialog.tsx b/apps/desktop/src/renderer/src/features/sessions/CharacterCardDialog.tsx index d6260e8..214da15 100644 --- a/apps/desktop/src/renderer/src/features/sessions/CharacterCardDialog.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/CharacterCardDialog.tsx @@ -1,5 +1,5 @@ -import type { Character } from "@jointarp/module/character"; import type { GameSession } from "@tarp/core/shared/session"; +import type { Character } from "@tarp/module/character"; import { useRef } from "react"; import { Dialog, DialogContent, DialogTitle } from "../../components/ui/dialog"; diff --git a/apps/desktop/src/renderer/src/features/sessions/CharacterFields.tsx b/apps/desktop/src/renderer/src/features/sessions/CharacterFields.tsx index 0506dcf..74319b1 100644 --- a/apps/desktop/src/renderer/src/features/sessions/CharacterFields.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/CharacterFields.tsx @@ -1,6 +1,6 @@ -import { documentIdentity } from "@jointarp/module/document-path"; -import type { DocumentField } from "@jointarp/module/document-type"; import type { ModuleDocument } from "@shared/desktop-api"; +import { documentIdentity } from "@tarp/module/document-path"; +import type { DocumentField } from "@tarp/module/document-type"; import { useId } from "react"; import { Button } from "../../components/ui/button"; diff --git a/apps/desktop/src/renderer/src/features/sessions/CharacterPreview.test.tsx b/apps/desktop/src/renderer/src/features/sessions/CharacterPreview.test.tsx index 62d4946..e59187f 100644 --- a/apps/desktop/src/renderer/src/features/sessions/CharacterPreview.test.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/CharacterPreview.test.tsx @@ -1,8 +1,8 @@ import { test } from "bun:test"; import { strict as assert } from "node:assert"; -import type { Character } from "@jointarp/module/character"; -import { validateDocumentLayout, validateDocumentType } from "@jointarp/module/document-type"; +import type { Character } from "@tarp/module/character"; +import { validateDocumentLayout, validateDocumentType } from "@tarp/module/document-type"; import type { ReactNode } from "react"; import { renderToReadableStream } from "react-dom/server"; diff --git a/apps/desktop/src/renderer/src/features/sessions/CharacterPreview.tsx b/apps/desktop/src/renderer/src/features/sessions/CharacterPreview.tsx index e7fdcea..f34029f 100644 --- a/apps/desktop/src/renderer/src/features/sessions/CharacterPreview.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/CharacterPreview.tsx @@ -1,5 +1,5 @@ -import type { Character, CharacterDraft } from "@jointarp/module/character"; -import type { DocumentType } from "@jointarp/module/document-type"; +import type { Character, CharacterDraft } from "@tarp/module/character"; +import type { DocumentType } from "@tarp/module/document-type"; import { DocumentDetail } from "../modules/DocumentDetail"; import { DocumentReferences, type ReferenceDocument } from "../modules/DocumentReferences"; diff --git a/apps/desktop/src/renderer/src/features/sessions/CharacterSummary.tsx b/apps/desktop/src/renderer/src/features/sessions/CharacterSummary.tsx index 6336b11..ef5b397 100644 --- a/apps/desktop/src/renderer/src/features/sessions/CharacterSummary.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/CharacterSummary.tsx @@ -1,6 +1,6 @@ -import type { Character } from "@jointarp/module/character"; -import type { DocumentType } from "@jointarp/module/document-type"; import type { GameSession } from "@tarp/core/shared/session"; +import type { Character } from "@tarp/module/character"; +import type { DocumentType } from "@tarp/module/document-type"; import { DocumentReferences } from "../modules/DocumentReferences"; import { buildCharacterSheet } from "./character-sheet"; diff --git a/apps/desktop/src/renderer/src/features/sessions/ChatMessageEntry.tsx b/apps/desktop/src/renderer/src/features/sessions/ChatMessageEntry.tsx index eb4b819..f14d947 100644 --- a/apps/desktop/src/renderer/src/features/sessions/ChatMessageEntry.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/ChatMessageEntry.tsx @@ -1,8 +1,8 @@ -import { documentIdentity } from "@jointarp/module/document-path"; import { chatText, visibleAgentMessages } from "@tarp/core/shared/agent-message"; import { parseCompanionPerformance } from "@tarp/core/shared/companion"; import type { ChatMessage } from "@tarp/core/shared/game"; import { parseNarrative, type NarrativeSegment } from "@tarp/core/shared/narrative"; +import { documentIdentity } from "@tarp/module/document-path"; import { Flag } from "lucide-react"; import { createContext, diff --git a/apps/desktop/src/renderer/src/features/sessions/ChatPanel.tsx b/apps/desktop/src/renderer/src/features/sessions/ChatPanel.tsx index c771ee8..df6481b 100644 --- a/apps/desktop/src/renderer/src/features/sessions/ChatPanel.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/ChatPanel.tsx @@ -1,9 +1,9 @@ -import type { Character } from "@jointarp/module/character"; -import { documentIdentity } from "@jointarp/module/document-path"; import type { SpeechPart } from "@shared/speech-text"; import { useQuery } from "@tanstack/react-query"; import type { ChatMessage } from "@tarp/core/shared/game"; import type { GameSession, SessionModule } from "@tarp/core/shared/session"; +import type { Character } from "@tarp/module/character"; +import { documentIdentity } from "@tarp/module/document-path"; import { BookOpen } from "lucide-react"; import { useCallback, diff --git a/apps/desktop/src/renderer/src/features/sessions/CreationWorkbench.tsx b/apps/desktop/src/renderer/src/features/sessions/CreationWorkbench.tsx index d6b3ca8..b2ebd33 100644 --- a/apps/desktop/src/renderer/src/features/sessions/CreationWorkbench.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/CreationWorkbench.tsx @@ -1,6 +1,6 @@ -import type { CreationAnswer } from "@jointarp/module/creation-workbench"; import type { LaunchAction, LaunchState } from "@tarp/core/shared/launch"; import type { RoomLaunchState } from "@tarp/core/shared/room-state"; +import type { CreationAnswer } from "@tarp/module/creation-workbench"; import { Dices, Check } from "lucide-react"; import { lazy, Suspense, useState } from "react"; diff --git a/apps/desktop/src/renderer/src/features/sessions/GameParty.tsx b/apps/desktop/src/renderer/src/features/sessions/GameParty.tsx index 2282da7..1cde0ae 100644 --- a/apps/desktop/src/renderer/src/features/sessions/GameParty.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/GameParty.tsx @@ -1,6 +1,6 @@ -import type { Character } from "@jointarp/module/character"; import type { Player } from "@tarp/core/shared/game"; import type { GameSession } from "@tarp/core/shared/session"; +import type { Character } from "@tarp/module/character"; import { UserRound } from "lucide-react"; import { useState } from "react"; diff --git a/apps/desktop/src/renderer/src/features/sessions/LaunchCard.tsx b/apps/desktop/src/renderer/src/features/sessions/LaunchCard.tsx index 48681bf..3180d31 100644 --- a/apps/desktop/src/renderer/src/features/sessions/LaunchCard.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/LaunchCard.tsx @@ -1,5 +1,5 @@ -import type { Character } from "@jointarp/module/character"; import type { ChatMessage } from "@tarp/core/shared/game"; +import type { Character } from "@tarp/module/character"; import { Check, ContactRound, X } from "lucide-react"; import { AnimatePresence, motion, useReducedMotion } from "motion/react"; import { memo, useLayoutEffect, useRef, useState, type ReactNode } from "react"; diff --git a/apps/desktop/src/renderer/src/features/sessions/RoomModule.tsx b/apps/desktop/src/renderer/src/features/sessions/RoomModule.tsx index 8cc9897..3ecbe83 100644 --- a/apps/desktop/src/renderer/src/features/sessions/RoomModule.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/RoomModule.tsx @@ -1,7 +1,7 @@ -import { documentIdentity, typeFormatLabel } from "@jointarp/module/document-path"; import type { ModuleDocument } from "@shared/desktop-api"; import { searchItems } from "@shared/query"; import type { GameSession } from "@tarp/core/shared/session"; +import { documentIdentity, typeFormatLabel } from "@tarp/module/document-path"; import { BookOpenText, FileCode2, FileText, Library } from "lucide-react"; import { useEffect, useMemo, useState, type ReactNode } from "react"; diff --git a/apps/desktop/src/renderer/src/features/sessions/WorldStateCard.tsx b/apps/desktop/src/renderer/src/features/sessions/WorldStateCard.tsx index 5e4db86..653c89a 100644 --- a/apps/desktop/src/renderer/src/features/sessions/WorldStateCard.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/WorldStateCard.tsx @@ -1,7 +1,7 @@ -import type { DocumentType } from "@jointarp/module/document-type"; -import type { ModuleDocument } from "@jointarp/module/module-document"; -import { isDocumentVisible } from "@jointarp/module/module-document"; import type { GameSession } from "@tarp/core/shared/session"; +import type { DocumentType } from "@tarp/module/document-type"; +import type { ModuleDocument } from "@tarp/module/module-document"; +import { isDocumentVisible } from "@tarp/module/module-document"; import { ChevronDown } from "lucide-react"; import { useState } from "react"; diff --git a/apps/desktop/src/renderer/src/features/sessions/character-sheet.test.tsx b/apps/desktop/src/renderer/src/features/sessions/character-sheet.test.tsx index 39cf773..dc2cd3f 100644 --- a/apps/desktop/src/renderer/src/features/sessions/character-sheet.test.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/character-sheet.test.tsx @@ -1,7 +1,7 @@ import { test, mock } from "bun:test"; import { strict as assert } from "node:assert"; -import { validateDocumentLayout, validateDocumentType } from "@jointarp/module/document-type"; +import { validateDocumentLayout, validateDocumentType } from "@tarp/module/document-type"; import type { ReactNode } from "react"; import { renderToReadableStream } from "react-dom/server"; diff --git a/apps/desktop/src/renderer/src/features/sessions/character-sheet.ts b/apps/desktop/src/renderer/src/features/sessions/character-sheet.ts index 9e028ca..3755912 100644 --- a/apps/desktop/src/renderer/src/features/sessions/character-sheet.ts +++ b/apps/desktop/src/renderer/src/features/sessions/character-sheet.ts @@ -1,5 +1,5 @@ -import type { DocumentType } from "@jointarp/module/document-type"; -import type { ModuleDocument } from "@jointarp/module/module-document"; +import type { DocumentType } from "@tarp/module/document-type"; +import type { ModuleDocument } from "@tarp/module/module-document"; import { buildDocumentSheet, type DocumentSheetModel } from "../modules/document-sheet"; diff --git a/apps/desktop/src/renderer/src/features/sessions/chat-markdown.test.tsx b/apps/desktop/src/renderer/src/features/sessions/chat-markdown.test.tsx index 09d4c92..409643b 100644 --- a/apps/desktop/src/renderer/src/features/sessions/chat-markdown.test.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/chat-markdown.test.tsx @@ -4,7 +4,7 @@ import { mkdir, mkdtemp, realpath, rm } from "node:fs/promises"; import { tmpdir } from "node:os"; import { join } from "node:path"; -import { writeTestFile as writeFile } from "@jointarp/module/testing/files"; +import { writeTestFile as writeFile } from "@tarp/module/testing/files"; import { renderToStaticMarkup } from "react-dom/server"; import Markdown from "react-markdown"; diff --git a/apps/desktop/src/renderer/src/features/sessions/chat-timeline.test.ts b/apps/desktop/src/renderer/src/features/sessions/chat-timeline.test.ts index cb70fe9..2d852a2 100644 --- a/apps/desktop/src/renderer/src/features/sessions/chat-timeline.test.ts +++ b/apps/desktop/src/renderer/src/features/sessions/chat-timeline.test.ts @@ -2,13 +2,13 @@ import { test, mock } from "bun:test"; import { strict as assert } from "node:assert"; import type { AssistantMessage } from "@earendil-works/pi-ai"; +import type { ChatMessage } from "@tarp/core/shared/game"; import { advanceTimersByTime, getTimerCount, useFakeTimers, useRealTimers, -} from "@jointarp/module/testing/async"; -import type { ChatMessage } from "@tarp/core/shared/game"; +} from "@tarp/module/testing/async"; import { createElement } from "react"; import { renderToStaticMarkup } from "react-dom/server"; diff --git a/apps/desktop/src/renderer/src/features/sessions/npc-portrait-documents.ts b/apps/desktop/src/renderer/src/features/sessions/npc-portrait-documents.ts index 2d8dd06..981fed6 100644 --- a/apps/desktop/src/renderer/src/features/sessions/npc-portrait-documents.ts +++ b/apps/desktop/src/renderer/src/features/sessions/npc-portrait-documents.ts @@ -1,8 +1,8 @@ -import { documentIdentity } from "@jointarp/module/document-path"; import type { ModuleDocument } from "@shared/desktop-api"; import { visibleAgentMessages, publicAssistantText } from "@tarp/core/shared/agent-message"; import type { ChatMessage } from "@tarp/core/shared/game"; import { parseNarrative } from "@tarp/core/shared/narrative"; +import { documentIdentity } from "@tarp/module/document-path"; /** 只选取实际发言的文档,图片和名称仍须读取玩家可见投影。 */ export function npcPortraitDocuments( diff --git a/apps/desktop/src/renderer/src/features/sessions/npc-portrait.ts b/apps/desktop/src/renderer/src/features/sessions/npc-portrait.ts index 177408b..bed64de 100644 --- a/apps/desktop/src/renderer/src/features/sessions/npc-portrait.ts +++ b/apps/desktop/src/renderer/src/features/sessions/npc-portrait.ts @@ -1,5 +1,5 @@ -import { documentIdentity } from "@jointarp/module/document-path"; import type { ModuleDocument } from "@shared/desktop-api"; +import { documentIdentity } from "@tarp/module/document-path"; export type NpcPortraitResolver = (path: string) => ModuleDocument | undefined; diff --git a/apps/desktop/src/renderer/src/features/sessions/room-connection.test.ts b/apps/desktop/src/renderer/src/features/sessions/room-connection.test.ts index 88f13b0..833dd50 100644 --- a/apps/desktop/src/renderer/src/features/sessions/room-connection.test.ts +++ b/apps/desktop/src/renderer/src/features/sessions/room-connection.test.ts @@ -2,13 +2,13 @@ import { test } from "bun:test"; import { strict as assert } from "node:assert"; import { randomUUID } from "node:crypto"; -import { advanceTimersByTime, useFakeTimers, useRealTimers } from "@jointarp/module/testing/async"; import type { ChatMessage, RoomNotification } from "@tarp/core/shared/game"; import { createRoomReplica, createRoomBaseline, createRoomEncoder, } from "@tarp/core/testing/room-replica"; +import { advanceTimersByTime, useFakeTimers, useRealTimers } from "@tarp/module/testing/async"; import type { GameClient } from "./game-client"; import { RoomConnection, type LocalRoomModuleLoader } from "./room-connection"; @@ -371,7 +371,7 @@ test("取消单个读取者不影响其他面板,旧版结果自动重读", as revision = version; }, evaluateDocument: async ( - item: import("@jointarp/module/document-evaluator").ParsedModuleDocument, + item: import("@tarp/module/document-evaluator").ParsedModuleDocument, ) => item.document, readDocument: async () => { if (revision === initialRevision) return first; @@ -415,7 +415,7 @@ test("取消单个读取者不影响其他面板,旧版结果自动重读", as test("草稿同版读取共享,单方取消不影响图片及计算,旧版本结果被丢弃", async () => { const f = fixture(); - const { validateDocumentType } = await import("@jointarp/module/document-type"); + const { validateDocumentType } = await import("@tarp/module/document-type"); const type = validateDocumentType("角色", { fields: { strength: { type: "number" } } }); const resources = await f.localModule.resources(); const localModule: LocalRoomModuleLoader = { @@ -427,14 +427,14 @@ test("草稿同版读取共享,单方取消不影响图片及计算,旧版 const first = new Promise((done) => { resolve = done; }); - const engine = new (await import("@jointarp/module/document-evaluator")).DocumentEvaluator(); + const engine = new (await import("@tarp/module/document-evaluator")).DocumentEvaluator(); const evaluator = { setSnapshot: engine.setSnapshot.bind(engine), updateSnapshot: engine.updateSnapshot.bind(engine), readDocument: engine.readDocument.bind(engine), readDocumentName: engine.readDocumentName.bind(engine), evaluateDocument: async ( - item: import("@jointarp/module/document-evaluator").ParsedModuleDocument, + item: import("@tarp/module/document-evaluator").ParsedModuleDocument, ) => { reads++; if (reads === 1) return first; @@ -448,7 +448,7 @@ test("草稿同版读取共享,单方取消不影响图片及计算,旧版 () => evaluator, ); const release = connection.retain(); - const draft: import("@jointarp/module/character").Character = { + const draft: import("@tarp/module/character").Character = { id: "draft", typeId: type.id, name: "草稿", @@ -499,7 +499,7 @@ test("NPC名称候选共享版本缓存与取消读取,不解析候选图片 revision = version; }, evaluateDocument: async ( - item: import("@jointarp/module/document-evaluator").ParsedModuleDocument, + item: import("@tarp/module/document-evaluator").ParsedModuleDocument, ) => item.document, readDocument: async () => { fullReads++; @@ -589,7 +589,7 @@ test("同版计算失败可显式重建计算器重试,共享模组资源不 test("房间同步将公式配置独立交给计算器,配置变化与删除刷新展示", async () => { const f = fixture(); - const { validateDocumentType } = await import("@jointarp/module/document-type"); + const { validateDocumentType } = await import("@tarp/module/document-type"); const monsterType = validateDocumentType("怪物", { fields: { attack: { type: "number", compute: "1" }, diff --git a/apps/desktop/src/renderer/src/features/sessions/room-connection.ts b/apps/desktop/src/renderer/src/features/sessions/room-connection.ts index a6d97b8..0b2a044 100644 --- a/apps/desktop/src/renderer/src/features/sessions/room-connection.ts +++ b/apps/desktop/src/renderer/src/features/sessions/room-connection.ts @@ -1,6 +1,3 @@ -import { publicValues, type Character } from "@jointarp/module/character"; -import { documentIdentity } from "@jointarp/module/document-path"; -import { visibleDocumentProjection } from "@jointarp/module/module-document"; import type { ModuleDocument } from "@shared/desktop-api"; import type { ChatEvent } from "@tarp/core/shared/game"; import { @@ -9,6 +6,9 @@ import { type SessionModuleResources, type RoomEntity, } from "@tarp/core/shared/room-state"; +import { publicValues, type Character } from "@tarp/module/character"; +import { documentIdentity } from "@tarp/module/document-path"; +import { visibleDocumentProjection } from "@tarp/module/module-document"; import type { RendererDocumentEvaluator } from "../documents/computation/document-worker-protocol"; import { WorkerDocumentEvaluator } from "../documents/computation/worker-document-evaluator"; diff --git a/apps/desktop/src/renderer/src/features/sessions/room-display-mutation.test.ts b/apps/desktop/src/renderer/src/features/sessions/room-display-mutation.test.ts index cb909eb..7c00b80 100644 --- a/apps/desktop/src/renderer/src/features/sessions/room-display-mutation.test.ts +++ b/apps/desktop/src/renderer/src/features/sessions/room-display-mutation.test.ts @@ -1,8 +1,8 @@ import { test } from "bun:test"; import { strict as assert } from "node:assert"; -import { waitFor } from "@jointarp/module/testing/async"; import { MutationObserver, QueryClient } from "@tanstack/react-query"; +import { waitFor } from "@tarp/module/testing/async"; import { roomDisplayMutation } from "./room-display-mutation"; diff --git a/apps/desktop/src/renderer/src/features/sessions/room-document.tsx b/apps/desktop/src/renderer/src/features/sessions/room-document.tsx index 596855c..c972829 100644 --- a/apps/desktop/src/renderer/src/features/sessions/room-document.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/room-document.tsx @@ -1,5 +1,5 @@ -import type { Character } from "@jointarp/module/character"; import type { ModuleDocument } from "@shared/desktop-api"; +import type { Character } from "@tarp/module/character"; import { createContext, lazy, Suspense, useContext, type ReactNode } from "react"; import { DocumentImageScope } from "../modules/document-image"; diff --git a/apps/desktop/src/renderer/src/features/sessions/room-draft-view.ts b/apps/desktop/src/renderer/src/features/sessions/room-draft-view.ts index 75b7871..2c7ff28 100644 --- a/apps/desktop/src/renderer/src/features/sessions/room-draft-view.ts +++ b/apps/desktop/src/renderer/src/features/sessions/room-draft-view.ts @@ -1,5 +1,5 @@ -import type { Character } from "@jointarp/module/character"; import type { ModuleDocument } from "@shared/desktop-api"; +import type { Character } from "@tarp/module/character"; /** 内容修改仍属于同一草稿;房间、角色类型或来源切换则不能借用旧预览。 */ export function roomDraftIdentity(roomId: string, draft: Character): string { diff --git a/apps/desktop/src/renderer/src/features/sessions/room-launch-view.ts b/apps/desktop/src/renderer/src/features/sessions/room-launch-view.ts index 3929e10..2a27e4e 100644 --- a/apps/desktop/src/renderer/src/features/sessions/room-launch-view.ts +++ b/apps/desktop/src/renderer/src/features/sessions/room-launch-view.ts @@ -1,7 +1,7 @@ -import type { WorkbenchView } from "@jointarp/module/creation-workbench"; -import { documentIdentity } from "@jointarp/module/document-path"; import type { ModuleDocument } from "@shared/desktop-api"; import type { RoomEntity, RoomLaunchState } from "@tarp/core/shared/room-state"; +import type { WorkbenchView } from "@tarp/module/creation-workbench"; +import { documentIdentity } from "@tarp/module/document-path"; /** 仅供下一条命令使用,不作为界面展示缓存。 */ export type LaunchCommandProgress = Pick & { roomId: string }; diff --git a/apps/desktop/src/renderer/src/features/sessions/use-room-state.ts b/apps/desktop/src/renderer/src/features/sessions/use-room-state.ts index a962007..c510893 100644 --- a/apps/desktop/src/renderer/src/features/sessions/use-room-state.ts +++ b/apps/desktop/src/renderer/src/features/sessions/use-room-state.ts @@ -1,8 +1,8 @@ -import { publicDocumentType, type Character } from "@jointarp/module/character"; import type { ModuleDocument } from "@shared/desktop-api"; import { keepPreviousData, useQueries, useQuery, useQueryClient } from "@tanstack/react-query"; import type { LaunchState } from "@tarp/core/shared/launch"; import type { RoomEntity, RoomReplica } from "@tarp/core/shared/room-state"; +import { publicDocumentType, type Character } from "@tarp/module/character"; import { useEffect, useMemo, useRef, useSyncExternalStore } from "react"; import { desktopOrpc, desktopRpc } from "../../desktop-rpc"; diff --git a/apps/desktop/src/renderer/src/features/sessions/use-room-visible-documents.ts b/apps/desktop/src/renderer/src/features/sessions/use-room-visible-documents.ts index 4a5f5f2..bb00f68 100644 --- a/apps/desktop/src/renderer/src/features/sessions/use-room-visible-documents.ts +++ b/apps/desktop/src/renderer/src/features/sessions/use-room-visible-documents.ts @@ -1,7 +1,7 @@ -import { documentIdentity } from "@jointarp/module/document-path"; import type { ModuleDocument } from "@shared/desktop-api"; import { useQueries } from "@tanstack/react-query"; import type { ChatMessage } from "@tarp/core/shared/game"; +import { documentIdentity } from "@tarp/module/document-path"; import { useMemo } from "react"; import { desktopRpc } from "../../desktop-rpc"; diff --git a/apps/desktop/src/shared/desktop-api.ts b/apps/desktop/src/shared/desktop-api.ts index 5346440..34c80a3 100644 --- a/apps/desktop/src/shared/desktop-api.ts +++ b/apps/desktop/src/shared/desktop-api.ts @@ -1,15 +1,15 @@ -import type { DocumentType } from "@jointarp/module/document-type"; +import type { DocumentType } from "@tarp/module/document-type"; import type { ModuleDocument, ModuleMetadata, ModulePageDocument, -} from "@jointarp/module/module-document"; +} from "@tarp/module/module-document"; export type { ModuleDocument, ModuleMetadata, ModulePageDocument, -} from "@jointarp/module/module-document"; +} from "@tarp/module/module-document"; export interface ModuleSummary { readonly path: string; diff --git a/bun.lock b/bun.lock index 3a439f4..1e99d6a 100644 --- a/bun.lock +++ b/bun.lock @@ -3,7 +3,7 @@ "configVersion": 1, "workspaces": { "": { - "name": "jointarp", + "name": "tarp", "dependencies": { "fast-json-patch": "^3.1.1", "nanoid": "^6.0.2", @@ -15,7 +15,7 @@ }, }, "apps/desktop": { - "name": "@jointarp/desktop", + "name": "@tarp/desktop", "version": "0.1.0", "dependencies": { "@base-ui/react": "^1.8.0", @@ -31,8 +31,8 @@ "@tanstack/react-router": "^1.170.17", "@tanstack/react-virtual": "^3.14.13", "@tarp/core": "workspace:*", - "@jointarp/module": "workspace:*", - "@jointarp/module-cli": "workspace:*", + "@tarp/module": "workspace:*", + "@tarp/module-cli": "workspace:*", "class-variance-authority": "^0.7.1", "cn": "^0.2.6", "es-toolkit": "^1.52.0", @@ -80,7 +80,7 @@ "@earendil-works/pi-coding-agent": "1.2.0", "@orpc/contract": "^2.0.0-beta.36", "@orpc/server": "^2.0.0-beta.36", - "@jointarp/module": "workspace:*", + "@tarp/module": "workspace:*", "es-toolkit": "^1.52.0", "fast-json-patch": "^3.1.1", "kysely": "^0.29.6", @@ -100,7 +100,7 @@ }, }, "packages/module": { - "name": "@jointarp/module", + "name": "@tarp/module", "version": "0.1.0", "dependencies": { "handlebars": "^4.7.10", @@ -118,7 +118,7 @@ }, }, "packages/module-cli": { - "name": "@jointarp/module-cli", + "name": "@tarp/module-cli", "version": "0.1.0", "bin": { "tarp": "./out/index.js", @@ -129,7 +129,7 @@ "zod": "^4.6.5", }, "devDependencies": { - "@jointarp/module": "workspace:*", + "@tarp/module": "workspace:*", "@types/bun": "^1.4.0", "typescript": "^7.0.2", }, @@ -434,11 +434,11 @@ "@tarp/core": ["@tarp/core@workspace:packages/core"], - "@jointarp/desktop": ["@jointarp/desktop@workspace:apps/desktop"], + "@tarp/desktop": ["@tarp/desktop@workspace:apps/desktop"], - "@jointarp/module": ["@jointarp/module@workspace:packages/module"], + "@tarp/module": ["@tarp/module@workspace:packages/module"], - "@jointarp/module-cli": ["@jointarp/module-cli@workspace:packages/module-cli"], + "@tarp/module-cli": ["@tarp/module-cli@workspace:packages/module-cli"], "@types/bun": ["@types/bun@1.4.3", "", { "dependencies": { "bun-types": "1.4.3" } }, "sha512-N67Pqy8JXbAY/j0tNraS3V5mubGvc6rrrNDmDCtZLlFzccbUJPDb0tvgUBC5q4m8ybkP93Jcn1QB+RYQ6PvBhw=="], diff --git "a/docs/\346\265\213\350\257\225\347\273\264\346\212\244.md" "b/docs/\346\265\213\350\257\225\347\273\264\346\212\244.md" index b011f87..ebd1501 100644 --- "a/docs/\346\265\213\350\257\225\347\273\264\346\212\244.md" +++ "b/docs/\346\265\213\350\257\225\347\273\264\346\212\244.md" @@ -31,7 +31,7 @@ Git 影响筛选使用 Bun 的导入关系,无法替代运行时协议、磁 - 字段计算由计算核心验证,界面测试验证计算结果是否被正确消费;不要在每个界面重复公式组合。 - 页面和组件断言围绕可见结果、数据丢失、错误状态及可操作性,不绑定 CSS 类、内部节点数量或无关文案。 - 相同输入和相同代码路径的重复检查删除;真实不同的边界保留清楚的场景,不能仅为降低数量合并成难排查的大测试。 -- 重试、取消等时间行为使用 `@jointarp/module/testing/async` 的 `useFakeTimers` 模拟时间;同步计时器用 `advanceTimersByTime` 推进,涉及 Promise、文件或网络操作时用 `await advanceTimersByTimeAsync`。`useFakeTimers` 已注册测试结束时的自动恢复;需要在测试中途恢复真实时钟时调用 `useRealTimers`。文件或消息操作使用独立临时数据并清理;单个测试的清理使用 `bun:test` 的 `onTestFinished`。 +- 重试、取消等时间行为使用 `@tarp/module/testing/async` 的 `useFakeTimers` 模拟时间;同步计时器用 `advanceTimersByTime` 推进,涉及 Promise、文件或网络操作时用 `await advanceTimersByTimeAsync`。`useFakeTimers` 已注册测试结束时的自动恢复;需要在测试中途恢复真实时钟时调用 `useRealTimers`。文件或消息操作使用独立临时数据并清理;单个测试的清理使用 `bun:test` 的 `onTestFinished`。 - 剧情模组的规则数值、剧情路线与素材完整性由各模组仓库自行验收,具体入口见对应仓库的 README。平台共用测试模组维护在 `packages/module/test-fixtures/platform/`,随 Git 提交,只覆盖平台功能,不包含剧情逻辑。`createTestModule()` 将固定模组复制到独立临时目录,测试只修改副本并在结束后清理;特殊错误与边界数据由对应测试在副本中构造。 ## 性能测量 diff --git a/package.json b/package.json index 9882a64..bd597e0 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "jointarp", + "name": "tarp", "private": true, "homepage": "https://jointarp.party", "license": "GPL-3.0-only", @@ -9,15 +9,15 @@ ], "type": "module", "scripts": { - "dev": "bun run --filter @jointarp/desktop dev", + "dev": "bun run --filter @tarp/desktop dev", "cli": "bun packages/module-cli/out/index.js", "build": "bun run --workspaces --if-present build", "typecheck": "bun run --workspaces typecheck", "test": "bun scripts/test.ts", "fmt": "oxfmt", "fmt:check": "oxfmt --check", - "package": "bun run --filter @jointarp/desktop package", - "dist": "bun run --filter @jointarp/desktop dist", + "package": "bun run --filter @tarp/desktop package", + "dist": "bun run --filter @tarp/desktop dist", "prepare": "simple-git-hooks", "test:changed": "bun scripts/test.ts --changed" }, diff --git a/packages/core/README.md b/packages/core/README.md index 491eaf2..5f6edd0 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -22,7 +22,7 @@ - `src/node/agent/`:Pi 会话、资料检索、游戏工具与公开事件投影。 - `src/node/storage/`:文件队列、编解码、结构化读改写与原子写入。 -通用模组格式、加载、校验和计算仍归 `@jointarp/module`。游戏核心负责选择房间的冻结模组、合并本局修改和执行业务命令。 +通用模组格式、加载、校验和计算仍归 `@tarp/module`。游戏核心负责选择房间的冻结模组、合并本局修改和执行业务命令。 ## 宿主接入 diff --git a/packages/core/package.json b/packages/core/package.json index 5b701b9..9034c1f 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -26,9 +26,9 @@ "@colyseus/schema": "5.0.34", "@earendil-works/pi-ai": "1.2.0", "@earendil-works/pi-coding-agent": "1.2.0", - "@jointarp/module": "workspace:*", "@orpc/contract": "^2.0.0-beta.36", "@orpc/server": "^2.0.0-beta.36", + "@tarp/module": "workspace:*", "es-toolkit": "^1.52.0", "fast-json-patch": "^3.1.1", "kysely": "^0.29.6", diff --git a/packages/core/src/node/agent/companion-document-tools.ts b/packages/core/src/node/agent/companion-document-tools.ts index 3947c68..58cd1c1 100644 --- a/packages/core/src/node/agent/companion-document-tools.ts +++ b/packages/core/src/node/agent/companion-document-tools.ts @@ -1,9 +1,9 @@ import { basename, dirname, join } from "node:path"; import type { ToolDefinition } from "@earendil-works/pi-coding-agent"; -import { documentIdentity } from "@jointarp/module/document-path"; -import { normalizeInstanceDefinition, type DocumentField } from "@jointarp/module/document-type"; -import { isDocumentVisible, type ModuleDocument } from "@jointarp/module/module-document"; +import { documentIdentity } from "@tarp/module/document-path"; +import { normalizeInstanceDefinition, type DocumentField } from "@tarp/module/document-type"; +import { isDocumentVisible, type ModuleDocument } from "@tarp/module/module-document"; import { fromMarkdown } from "mdast-util-from-markdown"; import { gfmFromMarkdown, gfmToMarkdown } from "mdast-util-gfm"; import { toMarkdown } from "mdast-util-to-markdown"; diff --git a/packages/core/src/node/agent/context-subscriptions.ts b/packages/core/src/node/agent/context-subscriptions.ts index e4b7ce5..5ed2d81 100644 --- a/packages/core/src/node/agent/context-subscriptions.ts +++ b/packages/core/src/node/agent/context-subscriptions.ts @@ -1,7 +1,7 @@ import { basename, dirname, join } from "node:path"; import type { ToolDefinition } from "@earendil-works/pi-coding-agent"; -import { documentIdentity } from "@jointarp/module/document-path"; +import { documentIdentity } from "@tarp/module/document-path"; import { Type } from "typebox"; import { z } from "zod"; diff --git a/packages/core/src/node/agent/game-compaction.test.ts b/packages/core/src/node/agent/game-compaction.test.ts index 191b29f..0de5183 100644 --- a/packages/core/src/node/agent/game-compaction.test.ts +++ b/packages/core/src/node/agent/game-compaction.test.ts @@ -18,7 +18,7 @@ import { SessionManager, SettingsManager, } from "@earendil-works/pi-coding-agent"; -import { createTestModule } from "@jointarp/module/testing/test-module"; +import { createTestModule } from "@tarp/module/testing/test-module"; import type { CompactionRole } from "../../shared/compaction-settings"; import { initializeRoomSettings } from "../sessions/room-settings"; diff --git a/packages/core/src/node/agent/game-tools.ts b/packages/core/src/node/agent/game-tools.ts index b7d4e85..061bdf6 100644 --- a/packages/core/src/node/agent/game-tools.ts +++ b/packages/core/src/node/agent/game-tools.ts @@ -1,8 +1,8 @@ import { basename, dirname, join } from "node:path"; import type { ToolDefinition } from "@earendil-works/pi-coding-agent"; -import { documentTypeId } from "@jointarp/module/document-path"; -import { parseDocumentContent } from "@jointarp/module/node/document-codec"; +import { documentTypeId } from "@tarp/module/document-path"; +import { parseDocumentContent } from "@tarp/module/node/document-codec"; import { Type } from "typebox"; import { z } from "zod"; diff --git a/packages/core/src/node/agent/pi-runtime.ts b/packages/core/src/node/agent/pi-runtime.ts index 0d15eef..3888d41 100644 --- a/packages/core/src/node/agent/pi-runtime.ts +++ b/packages/core/src/node/agent/pi-runtime.ts @@ -15,7 +15,7 @@ import { type SessionManager, type ToolDefinition, } from "@earendil-works/pi-coding-agent"; -import { loadModuleMetadata } from "@jointarp/module/node/module-metadata"; +import { loadModuleMetadata } from "@tarp/module/node/module-metadata"; import { Type } from "typebox"; import { chatText } from "../../shared/agent-message"; diff --git a/packages/core/src/node/game/chat-service.test.ts b/packages/core/src/node/game/chat-service.test.ts index 35f7ad9..a1ef54f 100644 --- a/packages/core/src/node/game/chat-service.test.ts +++ b/packages/core/src/node/game/chat-service.test.ts @@ -8,19 +8,19 @@ import { join } from "node:path"; import { MessageChannel } from "node:worker_threads"; import { SessionManager } from "@earendil-works/pi-coding-agent"; -import { launchConfigSchema, type LaunchConfig } from "@jointarp/module/flow"; +import { createORPCClient } from "@orpc/client"; +import { RPCLink } from "@orpc/client/message-port"; +import type { ContractRouterClient } from "@orpc/contract"; +import { RPCHandler } from "@orpc/server/message-port"; +import { launchConfigSchema, type LaunchConfig } from "@tarp/module/flow"; import { advanceTimersByTime, advanceTimersByTimeAsync, useFakeTimers, useRealTimers, waitFor, -} from "@jointarp/module/testing/async"; -import { writeTestFile as writeFile } from "@jointarp/module/testing/files"; -import { createORPCClient } from "@orpc/client"; -import { RPCLink } from "@orpc/client/message-port"; -import type { ContractRouterClient } from "@orpc/contract"; -import { RPCHandler } from "@orpc/server/message-port"; +} from "@tarp/module/testing/async"; +import { writeTestFile as writeFile } from "@tarp/module/testing/files"; import { chatText } from "../../shared/agent-message"; import type { diff --git a/packages/core/src/node/game/chat/launch-cards.ts b/packages/core/src/node/game/chat/launch-cards.ts index cce0b21..ff710cb 100644 --- a/packages/core/src/node/game/chat/launch-cards.ts +++ b/packages/core/src/node/game/chat/launch-cards.ts @@ -1,6 +1,6 @@ import { randomUUID } from "node:crypto"; -import { finishIntroductionRun } from "@jointarp/module/flow"; +import { finishIntroductionRun } from "@tarp/module/flow"; import { messageSchema } from "../../../shared/game"; import type { Player } from "../../../shared/game"; diff --git a/packages/core/src/node/game/chat/launch.ts b/packages/core/src/node/game/chat/launch.ts index af82c7a..8d08a85 100644 --- a/packages/core/src/node/game/chat/launch.ts +++ b/packages/core/src/node/game/chat/launch.ts @@ -1,7 +1,7 @@ import { randomUUID } from "node:crypto"; -import { emptyFlowRun } from "@jointarp/module/flow"; import { ORPCError } from "@orpc/server"; +import { emptyFlowRun } from "@tarp/module/flow"; import type { Player } from "../../../shared/game"; import type { LaunchAction } from "../../../shared/launch"; diff --git a/packages/core/src/node/game/chat/narration.ts b/packages/core/src/node/game/chat/narration.ts index 10ef33b..05acca9 100644 --- a/packages/core/src/node/game/chat/narration.ts +++ b/packages/core/src/node/game/chat/narration.ts @@ -1,7 +1,7 @@ import { randomUUID } from "node:crypto"; -import { sameDocumentIdentity } from "@jointarp/module/document-path"; -import { emptyFlowRun, preludeNarration } from "@jointarp/module/flow"; +import { sameDocumentIdentity } from "@tarp/module/document-path"; +import { emptyFlowRun, preludeNarration } from "@tarp/module/flow"; import { messageSchema, type ChatMessage } from "../../../shared/game"; import { narrationLines, startNarrationBeats } from "../../../shared/narration"; diff --git a/packages/core/src/node/game/companion-launch.test.ts b/packages/core/src/node/game/companion-launch.test.ts index 98e39bf..6f6d0e1 100644 --- a/packages/core/src/node/game/companion-launch.test.ts +++ b/packages/core/src/node/game/companion-launch.test.ts @@ -4,9 +4,9 @@ import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; import { join } from "node:path"; -import { waitFor } from "@jointarp/module/testing/async"; -import { writeTestFile as writeFile } from "@jointarp/module/testing/files"; -import { createTestModule } from "@jointarp/module/testing/test-module"; +import { waitFor } from "@tarp/module/testing/async"; +import { writeTestFile as writeFile } from "@tarp/module/testing/files"; +import { createTestModule } from "@tarp/module/testing/test-module"; import type { LaunchAction } from "../../shared/launch"; import { advanceLaunch, launchState } from "../sessions/launch-store"; diff --git a/packages/core/src/node/game/companion.test.ts b/packages/core/src/node/game/companion.test.ts index 44c65a5..e978f12 100644 --- a/packages/core/src/node/game/companion.test.ts +++ b/packages/core/src/node/game/companion.test.ts @@ -12,9 +12,9 @@ import { useFakeTimers, useRealTimers, waitFor, -} from "@jointarp/module/testing/async"; -import { writeTestFile as writeFile } from "@jointarp/module/testing/files"; -import { createWorldStateDefinition } from "@jointarp/module/testing/world-state"; +} from "@tarp/module/testing/async"; +import { writeTestFile as writeFile } from "@tarp/module/testing/files"; +import { createWorldStateDefinition } from "@tarp/module/testing/world-state"; import { chatText, companionDisplayText } from "../../shared/agent-message"; import { companionRulingFromToolCall } from "../../shared/companion"; diff --git a/packages/core/src/node/game/companion.ts b/packages/core/src/node/game/companion.ts index ac88e1c..8f11504 100644 --- a/packages/core/src/node/game/companion.ts +++ b/packages/core/src/node/game/companion.ts @@ -1,4 +1,4 @@ -import { documentIdentity } from "@jointarp/module/document-path"; +import { documentIdentity } from "@tarp/module/document-path"; import { chatText, publicAssistantText, visibleAgentMessages } from "../../shared/agent-message"; import { companionSchema, type Companion } from "../../shared/companion"; diff --git a/packages/core/src/node/game/room-state-projection.ts b/packages/core/src/node/game/room-state-projection.ts index 19c2b52..0de5a35 100644 --- a/packages/core/src/node/game/room-state-projection.ts +++ b/packages/core/src/node/game/room-state-projection.ts @@ -2,12 +2,12 @@ import { createHash } from "node:crypto"; import { readFile, readdir } from "node:fs/promises"; import { join } from "node:path"; -import { publicValues } from "@jointarp/module/character"; -import { documentFormat, documentIdentity, documentTypeId } from "@jointarp/module/document-path"; -import type { LaunchConfig } from "@jointarp/module/flow"; -import type { ModuleDocument } from "@jointarp/module/module-document"; -import { parseDocumentContent } from "@jointarp/module/node/document-codec"; import { ORPCError } from "@orpc/server"; +import { publicValues } from "@tarp/module/character"; +import { documentFormat, documentIdentity, documentTypeId } from "@tarp/module/document-path"; +import type { LaunchConfig } from "@tarp/module/flow"; +import type { ModuleDocument } from "@tarp/module/module-document"; +import { parseDocumentContent } from "@tarp/module/node/document-codec"; import type { LaunchState } from "../../shared/launch"; import { diff --git a/packages/core/src/node/sessions/character-db.ts b/packages/core/src/node/sessions/character-db.ts index 3aaffc0..9d4fb5f 100644 --- a/packages/core/src/node/sessions/character-db.ts +++ b/packages/core/src/node/sessions/character-db.ts @@ -1,13 +1,13 @@ import { basename } from "node:path"; -import type { Character } from "@jointarp/module/character"; -import { documentIdentity } from "@jointarp/module/document-path"; +import type { Character } from "@tarp/module/character"; +import { documentIdentity } from "@tarp/module/document-path"; import { documentMetadataSchema, validateDocumentValues, type DocumentType, -} from "@jointarp/module/document-type"; -import { parseDocumentContent } from "@jointarp/module/node/document-codec"; +} from "@tarp/module/document-type"; +import { parseDocumentContent } from "@tarp/module/node/document-codec"; import { createIdentityId } from "../identity"; import type { SessionDatabase } from "../storage/session-database"; diff --git a/packages/core/src/node/sessions/character-ownership.ts b/packages/core/src/node/sessions/character-ownership.ts index cb1cfc4..bcd7719 100644 --- a/packages/core/src/node/sessions/character-ownership.ts +++ b/packages/core/src/node/sessions/character-ownership.ts @@ -1,5 +1,5 @@ -import type { Character } from "@jointarp/module/character"; -import { sameDocumentIdentity } from "@jointarp/module/document-path"; +import type { Character } from "@tarp/module/character"; +import { sameDocumentIdentity } from "@tarp/module/document-path"; import type { SessionDatabase } from "../storage/session-database"; import { markStateChanged, readAdventureState, updateAdventureState } from "./adventure-state"; diff --git a/packages/core/src/node/sessions/character-store.ts b/packages/core/src/node/sessions/character-store.ts index bcc0477..8423dc1 100644 --- a/packages/core/src/node/sessions/character-store.ts +++ b/packages/core/src/node/sessions/character-store.ts @@ -1,21 +1,17 @@ -import { - characterDraftSchema, - type Character, - type CharacterDraft, -} from "@jointarp/module/character"; +import { characterDraftSchema, type Character, type CharacterDraft } from "@tarp/module/character"; import { resolveDocumentComputations, documentSourceValues, -} from "@jointarp/module/document-computations"; -import { resolveModuleDocuments } from "@jointarp/module/document-evaluator"; -import { documentFormat, documentIdentity } from "@jointarp/module/document-path"; -import { validateDocumentValues, type DocumentField } from "@jointarp/module/document-type"; +} from "@tarp/module/document-computations"; +import { resolveModuleDocuments } from "@tarp/module/document-evaluator"; +import { documentFormat, documentIdentity } from "@tarp/module/document-path"; +import { validateDocumentValues, type DocumentField } from "@tarp/module/document-type"; import { resolveInstanceDefinition, validateInstanceBindings, type InstanceResolver, -} from "@jointarp/module/instance-state"; -import type { ModuleDocument } from "@jointarp/module/module-document"; +} from "@tarp/module/instance-state"; +import type { ModuleDocument } from "@tarp/module/module-document"; import type { SessionDatabase } from "../storage/session-database"; import { readCharacters, storedTypes } from "./character-db"; diff --git a/packages/core/src/node/sessions/companion-selection.ts b/packages/core/src/node/sessions/companion-selection.ts index c025d92..3a35923 100644 --- a/packages/core/src/node/sessions/companion-selection.ts +++ b/packages/core/src/node/sessions/companion-selection.ts @@ -1,5 +1,5 @@ -import type { Character } from "@jointarp/module/character"; -import { sameDocumentIdentity } from "@jointarp/module/document-path"; +import type { Character } from "@tarp/module/character"; +import { sameDocumentIdentity } from "@tarp/module/document-path"; import type { SessionDatabase } from "../storage/session-database"; import { readCharacters } from "./character-db"; diff --git a/packages/core/src/node/sessions/compile-module.ts b/packages/core/src/node/sessions/compile-module.ts index 6857aab..c59810b 100644 --- a/packages/core/src/node/sessions/compile-module.ts +++ b/packages/core/src/node/sessions/compile-module.ts @@ -1,12 +1,12 @@ import { lstat, readFile, readdir, unlink, writeFile } from "node:fs/promises"; import { join } from "node:path"; -import { documentIdentity } from "@jointarp/module/document-path"; -import { configFilePath, parseConfig } from "@jointarp/module/node/config-file"; -import { parseDocumentContent } from "@jointarp/module/node/document-codec"; -import { loadDocumentTypes } from "@jointarp/module/node/document-types"; -import { loadModuleDocuments } from "@jointarp/module/node/module-documents"; -import { loadModuleMetadata } from "@jointarp/module/node/module-metadata"; +import { documentIdentity } from "@tarp/module/document-path"; +import { configFilePath, parseConfig } from "@tarp/module/node/config-file"; +import { parseDocumentContent } from "@tarp/module/node/document-codec"; +import { loadDocumentTypes } from "@tarp/module/node/document-types"; +import { loadModuleDocuments } from "@tarp/module/node/module-documents"; +import { loadModuleMetadata } from "@tarp/module/node/module-metadata"; /** 只编译 staging 副本;保留作者原值、公式及引用,阅读页和附件不转换。 */ export async function compileModule(directory: string): Promise { diff --git a/packages/core/src/node/sessions/document-reference-store.ts b/packages/core/src/node/sessions/document-reference-store.ts index a015ff0..7fdaced 100644 --- a/packages/core/src/node/sessions/document-reference-store.ts +++ b/packages/core/src/node/sessions/document-reference-store.ts @@ -2,14 +2,14 @@ import { createHash } from "node:crypto"; import { lstatSync, readFileSync } from "node:fs"; import { join } from "node:path"; -import type { DocumentData } from "@jointarp/module/document-computations"; +import type { DocumentData } from "@tarp/module/document-computations"; import { collectReferences, type DeclaredReferences, type DocumentReferenceIndex, -} from "@jointarp/module/document-references"; -import type { DocumentType } from "@jointarp/module/document-type"; -import { hasInstanceBindings, type InstanceResolver } from "@jointarp/module/instance-state"; +} from "@tarp/module/document-references"; +import type { DocumentType } from "@tarp/module/document-type"; +import { hasInstanceBindings, type InstanceResolver } from "@tarp/module/instance-state"; import { z } from "zod"; import type { SessionDatabase } from "../storage/session-database"; diff --git a/packages/core/src/node/sessions/frozen-module.ts b/packages/core/src/node/sessions/frozen-module.ts index d8456ae..115ad93 100644 --- a/packages/core/src/node/sessions/frozen-module.ts +++ b/packages/core/src/node/sessions/frozen-module.ts @@ -1,11 +1,11 @@ import { join } from "node:path"; -import type { DocumentType } from "@jointarp/module/document-type"; -import { launchConfigSchema, validateLaunch, type LaunchConfig } from "@jointarp/module/flow"; -import type { RawModuleDocument } from "@jointarp/module/module-document"; -import { loadDocumentTypes } from "@jointarp/module/node/document-types"; -import { loadModuleDocuments } from "@jointarp/module/node/module-documents"; -import { loadModuleMetadata } from "@jointarp/module/node/module-metadata"; +import type { DocumentType } from "@tarp/module/document-type"; +import { launchConfigSchema, validateLaunch, type LaunchConfig } from "@tarp/module/flow"; +import type { RawModuleDocument } from "@tarp/module/module-document"; +import { loadDocumentTypes } from "@tarp/module/node/document-types"; +import { loadModuleDocuments } from "@tarp/module/node/module-documents"; +import { loadModuleMetadata } from "@tarp/module/node/module-metadata"; import type { SessionDatabase } from "../storage/session-database"; import { roomDirectoryForDatabase } from "./session-paths"; diff --git a/packages/core/src/node/sessions/game-document-patch.ts b/packages/core/src/node/sessions/game-document-patch.ts index 8129883..c24aab7 100644 --- a/packages/core/src/node/sessions/game-document-patch.ts +++ b/packages/core/src/node/sessions/game-document-patch.ts @@ -1,5 +1,5 @@ -import type { DocumentType } from "@jointarp/module/document-type"; -import { instancePointerType, type InstanceResolver } from "@jointarp/module/instance-state"; +import type { DocumentType } from "@tarp/module/document-type"; +import { instancePointerType, type InstanceResolver } from "@tarp/module/instance-state"; import jsonPatch from "fast-json-patch"; import { z } from "zod"; diff --git a/packages/core/src/node/sessions/game-document-path.ts b/packages/core/src/node/sessions/game-document-path.ts index a85ac8c..09a3d13 100644 --- a/packages/core/src/node/sessions/game-document-path.ts +++ b/packages/core/src/node/sessions/game-document-path.ts @@ -1,8 +1,8 @@ import { lstatSync } from "node:fs"; import { dirname } from "node:path"; -import { documentIdentity, documentTypeId } from "@jointarp/module/document-path"; -import type { DocumentType } from "@jointarp/module/document-type"; +import { documentIdentity, documentTypeId } from "@tarp/module/document-path"; +import type { DocumentType } from "@tarp/module/document-type"; import { overlayEntries, overlayPath } from "./game-overlay"; diff --git a/packages/core/src/node/sessions/game-document-read.ts b/packages/core/src/node/sessions/game-document-read.ts index 1b5160d..02273ac 100644 --- a/packages/core/src/node/sessions/game-document-read.ts +++ b/packages/core/src/node/sessions/game-document-read.ts @@ -2,9 +2,9 @@ import { lstatSync } from "node:fs"; import { lstat, readFile } from "node:fs/promises"; import { basename, dirname } from "node:path"; -import { documentIdentity } from "@jointarp/module/document-path"; -import { parseConfig } from "@jointarp/module/node/config-file"; -import { parseGameDocumentContent as parseContent } from "@jointarp/module/node/game-state-validation"; +import { documentIdentity } from "@tarp/module/document-path"; +import { parseConfig } from "@tarp/module/node/config-file"; +import { parseGameDocumentContent as parseContent } from "@tarp/module/node/game-state-validation"; import type { SessionDatabase } from "../storage/session-database"; import { readAdventureState } from "./adventure-state"; diff --git a/packages/core/src/node/sessions/game-document-source.ts b/packages/core/src/node/sessions/game-document-source.ts index 3bfe929..633fd07 100644 --- a/packages/core/src/node/sessions/game-document-source.ts +++ b/packages/core/src/node/sessions/game-document-source.ts @@ -2,12 +2,12 @@ import { lstatSync } from "node:fs"; import { lstat, readFile, realpath } from "node:fs/promises"; import { basename } from "node:path"; -import { resolveDocumentComputations } from "@jointarp/module/document-computations"; -import type { ParsedModuleDocument } from "@jointarp/module/document-evaluator"; -import { documentFormat, documentIdentity, documentTypeId } from "@jointarp/module/document-path"; -import type { DocumentType } from "@jointarp/module/document-type"; -import type { InstanceResolver } from "@jointarp/module/instance-state"; -import { parseGameDocumentContent as parseContent } from "@jointarp/module/node/game-state-validation"; +import { resolveDocumentComputations } from "@tarp/module/document-computations"; +import type { ParsedModuleDocument } from "@tarp/module/document-evaluator"; +import { documentFormat, documentIdentity, documentTypeId } from "@tarp/module/document-path"; +import type { DocumentType } from "@tarp/module/document-type"; +import type { InstanceResolver } from "@tarp/module/instance-state"; +import { parseGameDocumentContent as parseContent } from "@tarp/module/node/game-state-validation"; import type { SessionDatabase } from "../storage/session-database"; import { readAdventureState } from "./adventure-state"; diff --git a/packages/core/src/node/sessions/game-document-views.ts b/packages/core/src/node/sessions/game-document-views.ts index 2a33cf1..fa5b895 100644 --- a/packages/core/src/node/sessions/game-document-views.ts +++ b/packages/core/src/node/sessions/game-document-views.ts @@ -1,14 +1,14 @@ import { dirname } from "node:path"; -import { publicValues } from "@jointarp/module/character"; +import { publicValues } from "@tarp/module/character"; import { DocumentEvaluator, resolveModuleDocuments, type ParsedModuleDocument, -} from "@jointarp/module/document-evaluator"; -import { documentIdentity } from "@jointarp/module/document-path"; -import { visibleDocumentProjection, type ModuleDocument } from "@jointarp/module/module-document"; -import { publicFieldErrors } from "@jointarp/module/public-document-field"; +} from "@tarp/module/document-evaluator"; +import { documentIdentity } from "@tarp/module/document-path"; +import { visibleDocumentProjection, type ModuleDocument } from "@tarp/module/module-document"; +import { publicFieldErrors } from "@tarp/module/public-document-field"; import type { SessionDatabase } from "../storage/session-database"; import { storedTypes } from "./character-db"; diff --git a/packages/core/src/node/sessions/game-document-write.ts b/packages/core/src/node/sessions/game-document-write.ts index e28347f..911d076 100644 --- a/packages/core/src/node/sessions/game-document-write.ts +++ b/packages/core/src/node/sessions/game-document-write.ts @@ -1,28 +1,25 @@ import { lstat, mkdir, realpath } from "node:fs/promises"; import { dirname, isAbsolute, join, relative, sep } from "node:path"; -import type { Character } from "@jointarp/module/character"; -import { hasComputedFields } from "@jointarp/module/computed-fields"; +import type { Character } from "@tarp/module/character"; +import { hasComputedFields } from "@tarp/module/computed-fields"; import { resolveDocumentComputations, documentSourceValues, -} from "@jointarp/module/document-computations"; -import { - resolveModuleDocuments, - type ParsedModuleDocument, -} from "@jointarp/module/document-evaluator"; -import { documentFormat, documentIdentity } from "@jointarp/module/document-path"; -import type { DocumentType } from "@jointarp/module/document-type"; +} from "@tarp/module/document-computations"; +import { resolveModuleDocuments, type ParsedModuleDocument } from "@tarp/module/document-evaluator"; +import { documentFormat, documentIdentity } from "@tarp/module/document-path"; +import type { DocumentType } from "@tarp/module/document-type"; import { assertInstanceChanges, instancePointerType, validateInstanceBindings, -} from "@jointarp/module/instance-state"; -import { stringifyDocumentContent } from "@jointarp/module/node/document-codec"; +} from "@tarp/module/instance-state"; +import { stringifyDocumentContent } from "@tarp/module/node/document-codec"; import { parseGameDocumentContent as parseContent, validateGameDocumentReferences, -} from "@jointarp/module/node/game-state-validation"; +} from "@tarp/module/node/game-state-validation"; import { assertRoomOverlayAdmission } from "../game/room-state-projection"; import { createIdentityId } from "../identity"; diff --git a/packages/core/src/node/sessions/game-file-access.ts b/packages/core/src/node/sessions/game-file-access.ts index d4cc939..7c6a980 100644 --- a/packages/core/src/node/sessions/game-file-access.ts +++ b/packages/core/src/node/sessions/game-file-access.ts @@ -1,4 +1,4 @@ -import type { DocumentType } from "@jointarp/module/document-type"; +import type { DocumentType } from "@tarp/module/document-type"; import type { SessionDatabase } from "../storage/session-database"; import { storedTypes } from "./character-db"; diff --git a/packages/core/src/node/sessions/game-file-index.ts b/packages/core/src/node/sessions/game-file-index.ts index 8663bf7..57e42b5 100644 --- a/packages/core/src/node/sessions/game-file-index.ts +++ b/packages/core/src/node/sessions/game-file-index.ts @@ -1,7 +1,7 @@ import { createHash } from "node:crypto"; -import { documentFormat, documentIdentity, documentTypeId } from "@jointarp/module/document-path"; -import type { DocumentType } from "@jointarp/module/document-type"; +import { documentFormat, documentIdentity, documentTypeId } from "@tarp/module/document-path"; +import type { DocumentType } from "@tarp/module/document-type"; import type { SessionDatabase } from "../storage/session-database"; import { readAdventureState } from "./adventure-state"; diff --git a/packages/core/src/node/sessions/game-overlay.test.ts b/packages/core/src/node/sessions/game-overlay.test.ts index b91674e..0fe5868 100644 --- a/packages/core/src/node/sessions/game-overlay.test.ts +++ b/packages/core/src/node/sessions/game-overlay.test.ts @@ -14,7 +14,7 @@ import { import { tmpdir } from "node:os"; import { basename, join } from "node:path"; -import { writeTestFile as writeFile } from "@jointarp/module/testing/files"; +import { writeTestFile as writeFile } from "@tarp/module/testing/files"; import { createGameTools } from "../agent/game-tools"; import { readCharacters } from "./character-db"; diff --git a/packages/core/src/node/sessions/game-overlay.ts b/packages/core/src/node/sessions/game-overlay.ts index 9b67642..c7caffa 100644 --- a/packages/core/src/node/sessions/game-overlay.ts +++ b/packages/core/src/node/sessions/game-overlay.ts @@ -1,13 +1,13 @@ import { lstatSync, readFileSync, readdirSync, realpathSync } from "node:fs"; import { dirname, isAbsolute, join, relative, sep } from "node:path"; -import type { DocumentType } from "@jointarp/module/document-type"; +import type { DocumentType } from "@tarp/module/document-type"; import { parseDocumentContent, parseStructuredDocument, stringifyDocumentContent, stringifyStructuredDocument, -} from "@jointarp/module/node/document-codec"; +} from "@tarp/module/node/document-codec"; import { cloneDeep, isEqual, isPlainObject, mergeWith } from "es-toolkit"; import { z } from "zod"; diff --git a/packages/core/src/node/sessions/game-pointers.ts b/packages/core/src/node/sessions/game-pointers.ts index 65f52ac..9b65d53 100644 --- a/packages/core/src/node/sessions/game-pointers.ts +++ b/packages/core/src/node/sessions/game-pointers.ts @@ -1,4 +1,4 @@ -import type { DocumentField, DocumentType } from "@jointarp/module/document-type"; +import type { DocumentField, DocumentType } from "@tarp/module/document-type"; export function pointerParts(pointer: string): string[] { if (!pointer.startsWith("/") || pointer === "/") throw new Error("更新路径必须是 JSON Pointer"); diff --git a/packages/core/src/node/sessions/game-state.test.ts b/packages/core/src/node/sessions/game-state.test.ts index 25d7ecc..7af8573 100644 --- a/packages/core/src/node/sessions/game-state.test.ts +++ b/packages/core/src/node/sessions/game-state.test.ts @@ -4,11 +4,11 @@ import { access, chmod, mkdir, mkdtemp, readFile, readdir, rm } from "node:fs/pr import { tmpdir } from "node:os"; import { dirname, join } from "node:path"; -import { stringifyConfig } from "@jointarp/module/node/config-file"; -import { validateModule } from "@jointarp/module/node/validate-module"; -import { writeTestFile as writeFile } from "@jointarp/module/testing/files"; -import { createTestModule } from "@jointarp/module/testing/test-module"; -import { createWorldStateDefinition } from "@jointarp/module/testing/world-state"; +import { stringifyConfig } from "@tarp/module/node/config-file"; +import { validateModule } from "@tarp/module/node/validate-module"; +import { writeTestFile as writeFile } from "@tarp/module/testing/files"; +import { createTestModule } from "@tarp/module/testing/test-module"; +import { createWorldStateDefinition } from "@tarp/module/testing/world-state"; import { createCompanionDocumentTools } from "../agent/companion-document-tools"; import { ContextSubscriptions } from "../agent/context-subscriptions"; diff --git a/packages/core/src/node/sessions/launch-db.ts b/packages/core/src/node/sessions/launch-db.ts index 05533f4..35381cc 100644 --- a/packages/core/src/node/sessions/launch-db.ts +++ b/packages/core/src/node/sessions/launch-db.ts @@ -1,5 +1,5 @@ -import type { LaunchConfig } from "@jointarp/module/flow"; -import { emptyFlowRun } from "@jointarp/module/flow"; +import type { LaunchConfig } from "@tarp/module/flow"; +import { emptyFlowRun } from "@tarp/module/flow"; import type { LaunchProgress, LaunchRoom } from "../../shared/launch"; import type { SessionDatabase } from "../storage/session-database"; diff --git a/packages/core/src/node/sessions/launch-store.test.ts b/packages/core/src/node/sessions/launch-store.test.ts index 1bb7e12..de7451f 100644 --- a/packages/core/src/node/sessions/launch-store.test.ts +++ b/packages/core/src/node/sessions/launch-store.test.ts @@ -5,8 +5,8 @@ import { mkdir, mkdtemp, readFile, rm } from "node:fs/promises"; import { tmpdir } from "node:os"; import { join } from "node:path"; -import { creationFlowSchema, launchConfigSchema } from "@jointarp/module/flow"; -import { writeTestFile as writeFile } from "@jointarp/module/testing/files"; +import { creationFlowSchema, launchConfigSchema } from "@tarp/module/flow"; +import { writeTestFile as writeFile } from "@tarp/module/testing/files"; import { ZodError } from "zod"; import type { LaunchAction, LaunchState } from "../../shared/launch"; diff --git a/packages/core/src/node/sessions/launch-store.ts b/packages/core/src/node/sessions/launch-store.ts index 1688b50..0c1d244 100644 --- a/packages/core/src/node/sessions/launch-store.ts +++ b/packages/core/src/node/sessions/launch-store.ts @@ -5,11 +5,11 @@ import { publicValues, type Character, type CharacterDraft, -} from "@jointarp/module/character"; -import { evaluateCreation, newCreationProgress } from "@jointarp/module/creation-workbench"; -import { documentFormat, sameDocumentIdentity } from "@jointarp/module/document-path"; -import { advanceFlow, backFlow, currentNode, finishIntroductionRun } from "@jointarp/module/flow"; -import type { ModuleDocument } from "@jointarp/module/module-document"; +} from "@tarp/module/character"; +import { evaluateCreation, newCreationProgress } from "@tarp/module/creation-workbench"; +import { documentFormat, sameDocumentIdentity } from "@tarp/module/document-path"; +import { advanceFlow, backFlow, currentNode, finishIntroductionRun } from "@tarp/module/flow"; +import type { ModuleDocument } from "@tarp/module/module-document"; import { messageSchema } from "../../shared/game"; import { launchActionSchema, type LaunchAction, type LaunchState } from "../../shared/launch"; diff --git a/packages/core/src/node/sessions/module-sync.test.ts b/packages/core/src/node/sessions/module-sync.test.ts index e09fb50..79f2e7c 100644 --- a/packages/core/src/node/sessions/module-sync.test.ts +++ b/packages/core/src/node/sessions/module-sync.test.ts @@ -4,8 +4,8 @@ import * as fs from "node:fs"; import { lstat, mkdir, readFile, rename, rm, symlink } from "node:fs/promises"; import { join } from "node:path"; -import { writeTestFile as writeFile } from "@jointarp/module/testing/files"; -import { createTestModule } from "@jointarp/module/testing/test-module"; +import { writeTestFile as writeFile } from "@tarp/module/testing/files"; +import { createTestModule } from "@tarp/module/testing/test-module"; import { readCharacters } from "./character-db"; import { updateGameDocument, readGameDocumentView, writeGameDocument } from "./game-state"; diff --git a/packages/core/src/node/sessions/module-sync.ts b/packages/core/src/node/sessions/module-sync.ts index f0ad149..494e609 100644 --- a/packages/core/src/node/sessions/module-sync.ts +++ b/packages/core/src/node/sessions/module-sync.ts @@ -3,17 +3,14 @@ import { lstatSync, readFileSync, renameSync, writeFileSync } from "node:fs"; import { lstat, mkdir, mkdtemp, readFile, readdir, rm } from "node:fs/promises"; import { isAbsolute, join } from "node:path"; -import { - resolveModuleDocuments, - type ParsedModuleDocument, -} from "@jointarp/module/document-evaluator"; -import { documentIdentity } from "@jointarp/module/document-path"; -import { validateDocumentValues } from "@jointarp/module/document-type"; -import { validateAnswer } from "@jointarp/module/flow"; -import { stringifyDocumentContent } from "@jointarp/module/node/document-codec"; -import { validateInitialGameState } from "@jointarp/module/node/game-state-validation"; -import { loadModuleMetadata } from "@jointarp/module/node/module-metadata"; import { ORPCError } from "@orpc/server"; +import { resolveModuleDocuments, type ParsedModuleDocument } from "@tarp/module/document-evaluator"; +import { documentIdentity } from "@tarp/module/document-path"; +import { validateDocumentValues } from "@tarp/module/document-type"; +import { validateAnswer } from "@tarp/module/flow"; +import { stringifyDocumentContent } from "@tarp/module/node/document-codec"; +import { validateInitialGameState } from "@tarp/module/node/game-state-validation"; +import { loadModuleMetadata } from "@tarp/module/node/module-metadata"; import { z } from "zod"; import { forgetRoomProjection, projectEntities } from "../game/room-state-projection"; diff --git a/packages/core/src/node/sessions/room-storage.ts b/packages/core/src/node/sessions/room-storage.ts index ab726b0..f234bc5 100644 --- a/packages/core/src/node/sessions/room-storage.ts +++ b/packages/core/src/node/sessions/room-storage.ts @@ -1,6 +1,6 @@ import { join } from "node:path"; -import { characterDraftSchema } from "@jointarp/module/character"; +import { characterDraftSchema } from "@tarp/module/character"; import { z } from "zod"; import { companionModelSchema } from "../../shared/companion"; diff --git a/packages/core/src/node/sessions/session-store.ts b/packages/core/src/node/sessions/session-store.ts index f3ee3b5..c6733c8 100644 --- a/packages/core/src/node/sessions/session-store.ts +++ b/packages/core/src/node/sessions/session-store.ts @@ -12,15 +12,15 @@ import { } from "node:fs/promises"; import { join, resolve } from "node:path"; -import { publicDocumentType } from "@jointarp/module/character"; -import { launchConfigSchema, validateLaunch } from "@jointarp/module/flow"; -import type { ModulePageDocument } from "@jointarp/module/module-document"; -import { loadDocumentTypes } from "@jointarp/module/node/document-types"; -import { validateInitialGameState } from "@jointarp/module/node/game-state-validation"; -import { loadModuleDocuments } from "@jointarp/module/node/module-documents"; -import { loadModuleMetadata } from "@jointarp/module/node/module-metadata"; -import { loadModulePages } from "@jointarp/module/node/module-pages"; import { ORPCError } from "@orpc/server"; +import { publicDocumentType } from "@tarp/module/character"; +import { launchConfigSchema, validateLaunch } from "@tarp/module/flow"; +import type { ModulePageDocument } from "@tarp/module/module-document"; +import { loadDocumentTypes } from "@tarp/module/node/document-types"; +import { validateInitialGameState } from "@tarp/module/node/game-state-validation"; +import { loadModuleDocuments } from "@tarp/module/node/module-documents"; +import { loadModuleMetadata } from "@tarp/module/node/module-metadata"; +import { loadModulePages } from "@tarp/module/node/module-pages"; import type { z } from "zod"; import type { gameDefaultsSchema } from "../../shared/game-defaults"; diff --git a/packages/core/src/node/storage/config-file.test.ts b/packages/core/src/node/storage/config-file.test.ts index 3a8296f..9a44a23 100644 --- a/packages/core/src/node/storage/config-file.test.ts +++ b/packages/core/src/node/storage/config-file.test.ts @@ -4,11 +4,11 @@ import { mkdir, mkdtemp, rm } from "node:fs/promises"; import { tmpdir } from "node:os"; import { join } from "node:path"; -import { parseConfig, stringifyConfig } from "@jointarp/module/node/config-file"; -import { loadDocumentTypes } from "@jointarp/module/node/document-types"; -import { loadModuleDocuments } from "@jointarp/module/node/module-documents"; -import { loadModuleMetadata } from "@jointarp/module/node/module-metadata"; -import { writeTestFile as writeFile } from "@jointarp/module/testing/files"; +import { parseConfig, stringifyConfig } from "@tarp/module/node/config-file"; +import { loadDocumentTypes } from "@tarp/module/node/document-types"; +import { loadModuleDocuments } from "@tarp/module/node/module-documents"; +import { loadModuleMetadata } from "@tarp/module/node/module-metadata"; +import { writeTestFile as writeFile } from "@tarp/module/testing/files"; import { createGameTools } from "../agent/game-tools"; import { createSession } from "../sessions/session-store"; diff --git a/packages/core/src/node/storage/config-file.ts b/packages/core/src/node/storage/config-file.ts index a69a326..6662522 100644 --- a/packages/core/src/node/storage/config-file.ts +++ b/packages/core/src/node/storage/config-file.ts @@ -1,8 +1,8 @@ -import { parseConfig, stringifyConfig } from "@jointarp/module/node/config-file"; +import { parseConfig, stringifyConfig } from "@tarp/module/node/config-file"; import type { FileCodec } from "./structured-file"; -export { configFilePath } from "@jointarp/module/node/config-file"; +export { configFilePath } from "@tarp/module/node/config-file"; export const configFileCodec: FileCodec = { format: "JSON/TOML", diff --git a/packages/core/src/shared/launch.ts b/packages/core/src/shared/launch.ts index 508d459..e45c15f 100644 --- a/packages/core/src/shared/launch.ts +++ b/packages/core/src/shared/launch.ts @@ -1,12 +1,12 @@ -import { characterDraftSchema, type Character } from "@jointarp/module/character"; +import { characterDraftSchema, type Character } from "@tarp/module/character"; import { creationAnswerSchema, creationProgressSchema, type WorkbenchView, -} from "@jointarp/module/creation-workbench"; -import type { DocumentType } from "@jointarp/module/document-type"; -import { flowAnswerSchema, flowRunSchema, type LaunchConfig } from "@jointarp/module/flow"; -import type { ModuleDocument } from "@jointarp/module/module-document"; +} from "@tarp/module/creation-workbench"; +import type { DocumentType } from "@tarp/module/document-type"; +import { flowAnswerSchema, flowRunSchema, type LaunchConfig } from "@tarp/module/flow"; +import type { ModuleDocument } from "@tarp/module/module-document"; import { z } from "zod"; import type { ChatMessage } from "./game"; diff --git a/packages/core/src/shared/narrative.ts b/packages/core/src/shared/narrative.ts index 43b9a7a..8e1747a 100644 --- a/packages/core/src/shared/narrative.ts +++ b/packages/core/src/shared/narrative.ts @@ -13,4 +13,4 @@ NPC 的 path 必须指向现有角色文档,从工作区根目录出发,保 公开正文只呈现玩家可感知的场景、人物反应、对话及必要规则说明,不泄露秘密、内部推理或工具原始结果。 正文支持 Markdown。提到资料关键词时主动用 [[文档路径]] 引用,无需玩家要求;保留类型目录、分组路径和文档名称,省略扩展名,同段只引用一次。有可见 image 时可用 ![简短描述](图片路径) 配图,无需确认,同一场景不重复展示。图片辅助叙述,不替代描写,不粘贴资料正文。仅用玩家当前可见的信息与实际路径,不用 _image;引用、图片及替代文本不得泄密。`; -export { parseNarrative, type NarrativeSegment } from "@jointarp/module/narrative"; +export { parseNarrative, type NarrativeSegment } from "@tarp/module/narrative"; diff --git a/packages/core/src/shared/room-state.ts b/packages/core/src/shared/room-state.ts index 4d42037..0ba1049 100644 --- a/packages/core/src/shared/room-state.ts +++ b/packages/core/src/shared/room-state.ts @@ -1,6 +1,6 @@ -import type { Character } from "@jointarp/module/character"; -import type { LaunchConfig } from "@jointarp/module/flow"; -import type { RawModuleDocument } from "@jointarp/module/module-document"; +import type { Character } from "@tarp/module/character"; +import type { LaunchConfig } from "@tarp/module/flow"; +import type { RawModuleDocument } from "@tarp/module/module-document"; import { z } from "zod"; import { identityIdSchema } from "./identity"; diff --git a/packages/core/src/shared/session.ts b/packages/core/src/shared/session.ts index c6f0587..92b74fd 100644 --- a/packages/core/src/shared/session.ts +++ b/packages/core/src/shared/session.ts @@ -1,5 +1,5 @@ -import type { DocumentType } from "@jointarp/module/document-type"; -import type { ModuleDocument, ModulePageDocument } from "@jointarp/module/module-document"; +import type { DocumentType } from "@tarp/module/document-type"; +import type { ModuleDocument, ModulePageDocument } from "@tarp/module/module-document"; import { z } from "zod"; export const gameRoomSchema = z.object({ diff --git a/packages/core/src/testing/launch-module.ts b/packages/core/src/testing/launch-module.ts index da5c3ac..ffc2713 100644 --- a/packages/core/src/testing/launch-module.ts +++ b/packages/core/src/testing/launch-module.ts @@ -2,8 +2,8 @@ import { mkdir, mkdtemp, rm, writeFile } from "node:fs/promises"; import { tmpdir } from "node:os"; import { dirname, join } from "node:path"; -import { stringifyDocumentContent } from "@jointarp/module/node/document-codec"; -import { createWorldStateDefinition } from "@jointarp/module/testing/world-state"; +import { stringifyDocumentContent } from "@tarp/module/node/document-codec"; +import { createWorldStateDefinition } from "@tarp/module/testing/world-state"; /** 为文件存档及主持工具测试创建真实的临时模组,同时覆盖 TOML 配置和 JSON 文档。 */ export async function createLaunchTestModule() { diff --git a/packages/module-cli/README.md b/packages/module-cli/README.md index 0199f36..e49a47b 100644 --- a/packages/module-cli/README.md +++ b/packages/module-cli/README.md @@ -1,13 +1,13 @@ # 模组开发 CLI -`@jointarp/module-cli` 是同时支持 Node.js 和 Bun 的独立命令行子包。校验使用 `@jointarp/module` 的真实加载器,无需桌面运行时、桌面构建或个人应用配置,不创建存档、不修改模组。 +`@tarp/module-cli` 是同时支持 Node.js 和 Bun 的独立命令行子包。校验使用 `@tarp/module` 的真实加载器,无需桌面运行时、桌面构建或个人应用配置,不创建存档、不修改模组。 ## npm 安装 发布到 npm 后,Node.js 22.12.0 或更新版本可直接运行 `tarp`;Bun 可显式执行同一份 JavaScript 产物: ```sh -npm install -g @jointarp/module-cli +npm install -g @tarp/module-cli tarp --help tarp module validate ./module --json ``` @@ -24,13 +24,13 @@ tarp module validate ./module --json ```sh bun install --frozen-lockfile -bun run --filter @jointarp/module-cli build +bun run --filter @tarp/module-cli build bun run cli --help bun run cli --version bun run cli module validate ./apps/desktop/examples/建卡控件演示 --json ``` -模组路径相对于命令执行目录解析,含空格的路径请加引号。子包提供基于 `#!/usr/bin/env node` 的 `tarp` 可执行入口,指向构建后的 `out/index.js`。也可以直接用 `node packages/module-cli/out/index.js` 或 `bun packages/module-cli/out/index.js` 执行。仅安装 Bun 时,使用显式 `bun` 命令;公开包发布后也可使用 `bunx --bun @jointarp/module-cli`,避免按 Node.js shebang 启动。 +模组路径相对于命令执行目录解析,含空格的路径请加引号。子包提供基于 `#!/usr/bin/env node` 的 `tarp` 可执行入口,指向构建后的 `out/index.js`。也可以直接用 `node packages/module-cli/out/index.js` 或 `bun packages/module-cli/out/index.js` 执行。仅安装 Bun 时,使用显式 `bun` 命令;公开包发布后也可使用 `bunx --bun @tarp/module-cli`,避免按 Node.js shebang 启动。 CLI 的校验输出与退出码属于共享协议:`0` 成功,`1` 校验或操作失败,`2` 参数错误。Agent 使用退出码及 JSON 字段判断,不依赖中文提示措辞。`--json` 包含 `schemaVersion`、`appVersion`、`status`、路径、数量和 `issues`;`appVersion` 是当前执行入口版本。 @@ -48,7 +48,7 @@ bun run build ## 打包与发布 -在本子包执行 `bun run pack`,生成 `out/tarp-module-cli.tgz`。构建通过 `Bun.build` 的 Node.js 目标,将 CLI 与 `@jointarp/module` workspace 源码打进 `index.js`;第三方库不打入产物,发布目录中的 `package.json.dependencies` 声明其运行依赖,没有 `workspace:*` 或源码导出。 +在本子包执行 `bun run pack`,生成 `out/tarp-module-cli.tgz`。构建通过 `Bun.build` 的 Node.js 目标,将 CLI 与 `@tarp/module` workspace 源码打进 `index.js`;第三方库不打入产物,发布目录中的 `package.json.dependencies` 声明其运行依赖,没有 `workspace:*` 或源码导出。 发布包只包含 `index.js`、`package.json`、README、GPL v3 LICENSE 和 NOTICE.md。发布时使用独立的 `out/` 目录。`bun run pack` 只生成本地产物,不上传到 npm。 diff --git a/packages/module-cli/package.json b/packages/module-cli/package.json index 0674351..b18e62f 100644 --- a/packages/module-cli/package.json +++ b/packages/module-cli/package.json @@ -1,5 +1,5 @@ { - "name": "@jointarp/module-cli", + "name": "@tarp/module-cli", "version": "0.1.0", "homepage": "https://jointarp.party", "license": "GPL-3.0-only", @@ -14,9 +14,9 @@ "cli": "bun out/index.js", "build": "bun scripts/build.mjs", "typecheck": "bun --bun x --no-install tsc --noEmit", - "test": "bun ../../scripts/test.ts --scope @jointarp/module-cli", + "test": "bun ../../scripts/test.ts --scope @tarp/module-cli", "pack": "bun run build && bun pm pack --cwd out --filename tarp-module-cli.tgz", - "test:changed": "bun ../../scripts/test.ts --scope @jointarp/module-cli --changed" + "test:changed": "bun ../../scripts/test.ts --scope @tarp/module-cli --changed" }, "dependencies": { "smol-toml": "^1.9.0", @@ -24,7 +24,7 @@ "zod": "^4.6.5" }, "devDependencies": { - "@jointarp/module": "workspace:*", + "@tarp/module": "workspace:*", "@types/bun": "^1.4.0", "typescript": "^7.0.2" }, diff --git a/packages/module-cli/src/commands.test.ts b/packages/module-cli/src/commands.test.ts index c2c653c..ca746b3 100644 --- a/packages/module-cli/src/commands.test.ts +++ b/packages/module-cli/src/commands.test.ts @@ -5,8 +5,8 @@ import { readFile, readdir, realpath, rm } from "node:fs/promises"; import { join } from "node:path"; import { promisify } from "node:util"; -import { writeTestFile as writeFile } from "@jointarp/module/testing/files"; -import { createTestModule } from "@jointarp/module/testing/test-module"; +import { writeTestFile as writeFile } from "@tarp/module/testing/files"; +import { createTestModule } from "@tarp/module/testing/test-module"; import { version } from "../package.json"; import { modulePreviewHash, parseModuleCommand, runModuleCommand } from "./commands"; diff --git a/packages/module-cli/src/commands.ts b/packages/module-cli/src/commands.ts index 8003a69..fe26378 100644 --- a/packages/module-cli/src/commands.ts +++ b/packages/module-cli/src/commands.ts @@ -1,9 +1,9 @@ import { resolve } from "node:path"; import { parseArgs } from "node:util"; -import { loadDocumentTypes } from "@jointarp/module/node/document-types"; -import { loadModuleMetadata } from "@jointarp/module/node/module-metadata"; -import { validateModule } from "@jointarp/module/node/validate-module"; +import { loadDocumentTypes } from "@tarp/module/node/document-types"; +import { loadModuleMetadata } from "@tarp/module/node/module-metadata"; +import { validateModule } from "@tarp/module/node/validate-module"; export type ModuleCommand = | { readonly kind: "desktop" } diff --git a/packages/module/README.md b/packages/module/README.md index c663685..4e69c48 100644 --- a/packages/module/README.md +++ b/packages/module/README.md @@ -1,10 +1,10 @@ # 模组共享能力 -`@jointarp/module` 提供游戏服务核心、桌面应用与模组 CLI 共用的文档模型、字段计算和加载校验逻辑。房间生命周期与本局状态由 `@tarp/core` 管理,通用模组读取不依赖游戏服务。 +`@tarp/module` 提供游戏服务核心、桌面应用与模组 CLI 共用的文档模型、字段计算和加载校验逻辑。房间生命周期与本局状态由 `@tarp/core` 管理,通用模组读取不依赖游戏服务。 - 根级子路径:文档类型、元配置、引用、开局和计算字段等逻辑,可供前端与主进程使用。 -- `@jointarp/module/node/*`:JSON/TOML/Markdown 编解码、文件加载、模组校验与 ZIP 安全解压,仅供具备文件系统能力的运行时使用。 -- `@jointarp/module/testing/*`:平台测试共用的类型与临时副本工具。 +- `@tarp/module/node/*`:JSON/TOML/Markdown 编解码、文件加载、模组校验与 ZIP 安全解压,仅供具备文件系统能力的运行时使用。 +- `@tarp/module/testing/*`:平台测试共用的类型与临时副本工具。 `test-fixtures/platform/` 保存随 Git 维护的固定功能测试模组,不包含剧情或冒险规则。测试通过 `createTestModule()` 复制到独立临时目录,修改与存档只写入副本,结束后清理。 diff --git a/packages/module/package.json b/packages/module/package.json index ba0b359..aaab96d 100644 --- a/packages/module/package.json +++ b/packages/module/package.json @@ -1,5 +1,5 @@ { - "name": "@jointarp/module", + "name": "@tarp/module", "version": "0.1.0", "private": true, "license": "GPL-3.0-only", @@ -11,8 +11,8 @@ }, "scripts": { "typecheck": "bun --bun x --no-install tsc --noEmit", - "test": "bun ../../scripts/test.ts --scope @jointarp/module", - "test:changed": "bun ../../scripts/test.ts --scope @jointarp/module --changed" + "test": "bun ../../scripts/test.ts --scope @tarp/module", + "test:changed": "bun ../../scripts/test.ts --scope @tarp/module --changed" }, "dependencies": { "handlebars": "^4.7.10", diff --git a/packages/module/src/node/module-documents.test.ts b/packages/module/src/node/module-documents.test.ts index b4ced67..331f731 100644 --- a/packages/module/src/node/module-documents.test.ts +++ b/packages/module/src/node/module-documents.test.ts @@ -4,7 +4,7 @@ import { mkdir, mkdtemp, rm } from "node:fs/promises"; import { tmpdir } from "node:os"; import { join } from "node:path"; -import { writeTestFile as writeFile } from "@jointarp/module/testing/files"; +import { writeTestFile as writeFile } from "@tarp/module/testing/files"; import { typeFormatLabel } from "../schema/document-path"; import { validateDocumentLayout, validateDocumentType } from "../schema/document-type"; diff --git a/packages/module/src/node/module-metadata.test.ts b/packages/module/src/node/module-metadata.test.ts index 73c4beb..06191e7 100644 --- a/packages/module/src/node/module-metadata.test.ts +++ b/packages/module/src/node/module-metadata.test.ts @@ -4,7 +4,7 @@ import { mkdir, mkdtemp, rm } from "node:fs/promises"; import { tmpdir } from "node:os"; import { join } from "node:path"; -import { writeTestFile as writeFile } from "@jointarp/module/testing/files"; +import { writeTestFile as writeFile } from "@tarp/module/testing/files"; import { loadModuleDocuments } from "./module-documents"; import { loadModuleMetadata } from "./module-metadata"; diff --git a/scripts/test.ts b/scripts/test.ts index 5be4018..6506106 100644 --- a/scripts/test.ts +++ b/scripts/test.ts @@ -4,17 +4,17 @@ const root = resolve(import.meta.dirname, ".."); const args = process.argv.slice(2); const scopeIndex = args.indexOf("--scope"); const scopes: Record = { - "@jointarp/desktop": ["apps/desktop/src", "apps/desktop/scripts"], + "@tarp/desktop": ["apps/desktop/src", "apps/desktop/scripts"], "@tarp/core": ["packages/core/src"], - "@jointarp/module": ["packages/module/src"], - "@jointarp/module-cli": ["packages/module-cli/src"], + "@tarp/module": ["packages/module/src"], + "@tarp/module-cli": ["packages/module-cli/src"], }; const scope = scopeIndex >= 0 ? args.splice(scopeIndex, 2)[1] : undefined; if (scopeIndex >= 0 && !scope) throw new Error("请指定测试 workspace"); if (scope && !scopes[scope]) throw new Error(`未知测试范围:${scope}`); // CLI 测试验证实际分发入口,不能依赖此前构建留下的文件。 -if (!scope || scope === "@jointarp/module-cli") { - const build = Bun.spawn([process.execPath, "run", "--filter", "@jointarp/module-cli", "build"], { +if (!scope || scope === "@tarp/module-cli") { + const build = Bun.spawn([process.execPath, "run", "--filter", "@tarp/module-cli", "build"], { cwd: root, stdout: "inherit", stderr: "inherit", From a0485c32ed784254c9ade84ab696c665770a583e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=94=A1=E5=BE=B7=E6=A3=AE?= Date: Wed, 21 Oct 2026 08:52:00 +0800 Subject: [PATCH 2/4] =?UTF-8?q?ci:=20=E6=8E=A8=E9=80=81=20CLI=20=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E6=A0=87=E7=AD=BE=E5=90=8E=E8=87=AA=E5=8A=A8=E5=8F=91?= =?UTF-8?q?=E5=B8=83=20npm=20=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release-cli.yml | 19 ++++++++++++++++++- ...21\345\270\203\346\265\201\347\250\213.md" | 17 ++++++++++++----- packages/module-cli/README.md | 4 ++-- 3 files changed, 32 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release-cli.yml b/.github/workflows/release-cli.yml index 61b83d2..979ae2e 100644 --- a/.github/workflows/release-cli.yml +++ b/.github/workflows/release-cli.yml @@ -16,7 +16,7 @@ jobs: uses: ./.github/workflows/ci.yml release: - name: 打包、验收并创建 Release 草稿 + name: 打包、验收并发布 npm 包 needs: check runs-on: ubuntu-24.04 timeout-minutes: 15 @@ -26,6 +26,14 @@ jobs: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false + - name: 检查 npm 发布凭据 + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + run: | + if [[ -z "$NPM_TOKEN" ]]; then + echo '::error::请在仓库 Actions Secrets 配置有 @tarp/module-cli 发布权限的 NPM_TOKEN。' + exit 1 + fi - uses: ./.github/actions/setup - name: 准备 CLI 兼容性验收运行时 uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 @@ -33,12 +41,16 @@ jobs: node-version: "22.12.0" package-manager-cache: false - name: 校验 tag 与 CLI 版本 + id: version run: | bun run - <<'JS' + const { appendFileSync } = require('node:fs'); const { version } = require('./packages/module-cli/package.json'); if (process.env.GITHUB_REF_NAME !== `cli-v${version}`) { throw new Error(`tag 必须为 cli-v${version}`); } + const npmTag = version.split('+')[0].includes('-') ? 'next' : 'latest'; + appendFileSync(process.env.GITHUB_OUTPUT, `npm-tag=${npmTag}\n`); JS - run: bun run --filter @tarp/module-cli pack - run: bun scripts/release/smoke.ts cli @@ -53,3 +65,8 @@ jobs: env: GH_TOKEN: ${{ github.token }} run: bash scripts/release/draft.sh release-assets + - name: 发布已验收的 npm 包 + env: + NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }} + NPM_TAG: ${{ steps.version.outputs.npm-tag }} + run: bun publish "release-assets/tarp-$GITHUB_REF_NAME.tgz" --registry https://registry.npmjs.org --access public --tag "$NPM_TAG" diff --git "a/docs/\345\217\221\345\270\203\346\265\201\347\250\213.md" "b/docs/\345\217\221\345\270\203\346\265\201\347\250\213.md" index 25c1a53..10a17a5 100644 --- "a/docs/\345\217\221\345\270\203\346\265\201\347\250\213.md" +++ "b/docs/\345\217\221\345\270\203\346\265\201\347\250\213.md" @@ -6,7 +6,7 @@ | --------------------------------------- | -------------------------- | ----------------------------------------------- | | `.github/workflows/ci.yml` | PR、手动运行、发布流程调用 | 格式、类型、完整测试与构建;PR 另验收桌面安装包 | | `.github/workflows/release-desktop.yml` | `desktop-v*` tag | 检查 → 各平台打包与验收 → Release 草稿 | -| `.github/workflows/release-cli.yml` | `cli-v*` tag | 检查 → CLI 打包与验收 → Release 草稿 | +| `.github/workflows/release-cli.yml` | `cli-v*` tag | 检查 → CLI 打包与验收 → Release 草稿 → npm 发布 | 发布工作流复用 CI,共用 `.github/actions/setup/action.yml` 安装根级 `packageManager` 指定的 Bun。依赖统一从根目录按 `bun.lock` 安装;共享包随产品构建,官网和剧情模组不参与构建。CLI 兼容性检查与 CLI 发布流程另外安装 Node.js 22.12.0,验证支持的最低版本。第三方 Actions 固定到提交 SHA,升级时同步核对版本。 @@ -56,10 +56,17 @@ macOS 签名使用仓库 Secrets `MAC_CSC_LINK`(HTTPS 证书地址或 Base64 P 流程完成后,在 GitHub Releases 检查草稿附件、版本说明和源码。在目标系统验收安装、GUI 启动、模组加载、计算及签名,再公开草稿;自动化验收不能替代安装器和 GUI 验证。源码与许可声明随分发产物提供,公开后同步官网的玩家下载入口。 -CLI 暂不自动上传 npm。确认包名、scope 权限和版本后,从草稿下载已验收的 tgz,在本机登录 npm 并使用 Bun 发布;正式版本使用 `latest`,预发布版本使用 `next`: +## CLI 自动发布到 npm -```sh -bun publish ./tarp-cli-v0.1.0.tgz --access public --tag latest -``` +推送 `cli-v*` tag 后,工作流先检查版本、打包并在 Node.js 与 Bun 下独立安装验收,再创建 GitHub Release 草稿,最后将同一份已验收 tgz 发布到 npm。包名为 `@tarp/module-cli`,公开访问;正式版本使用 `latest`,带预发布标识的版本使用 `next`。GitHub Release 仍需手动公开,但 npm 包会在流程成功后立即公开。 + +首次使用前完成以下配置: + +1. npm 账号拥有 `@tarp` scope,并有权发布 `@tarp/module-cli`;首次发布时 Token 的权限需要覆盖新包创建。 +2. 在 npm 创建 Granular Access Token,授予目标包或 scope 的发布写权限;启用用于无人值守发布的 2FA bypass,并设置合适的有效期。 +3. 在 GitHub 仓库 `Settings → Secrets and variables → Actions` 添加 `NPM_TOKEN`。工作流仅在凭据检查和发布步骤读取它,不将其写入下载缓存。 +4. 修改 CLI 版本并同步根级锁文件,合并 PR 后推送完全一致的 tag。发布成功后可用 `bunx --bun @tarp/module-cli@0.1.0 --version` 验证目标版本。 + +工作流使用 Bun 发布,无需 npm CLI。缺失 Token、权限不足、Token 过期或同版本已存在均会使任务失败;不会跳过失败并宣称已发布。 构建或上传失败可重跑失败任务,Actions 中间产物保留 14 天。已有草稿可重跑更新同名附件,已公开版本拒绝覆盖;修复源码或产物时发布新版本,不移动已发布 tag。npm 同名同版本不可重复上传。 diff --git a/packages/module-cli/README.md b/packages/module-cli/README.md index e49a47b..f9e86f2 100644 --- a/packages/module-cli/README.md +++ b/packages/module-cli/README.md @@ -52,9 +52,9 @@ bun run build 发布包只包含 `index.js`、`package.json`、README、GPL v3 LICENSE 和 NOTICE.md。发布时使用独立的 `out/` 目录。`bun run pack` 只生成本地产物,不上传到 npm。 -确认包名、scope 权限和版本后,在本子包执行 `bun publish --cwd out` 发布。用户安装的是构建后的 JavaScript,无需在安装时运行 Bun 构建。 +推送与 CLI 版本一致的 `cli-v*` tag 后,GitHub Actions 验收 tgz,再将同一份包自动发布到 npm;需要预先配置 `NPM_TOKEN`。用户安装的是构建后的 JavaScript,无需在安装时运行 Bun 构建。 -GitHub Actions 的 CLI tag、独立安装验收、Release 草稿和手动 npm 发布见[发布流程](../../docs/发布流程.md)。 +GitHub Actions 的 CLI tag、独立安装验收、Release 草稿和 npm 自动发布见[发布流程](../../docs/发布流程.md)。 ## 许可证 From ab3645baebdea516ad0d04a439f2a5eee8a8428d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=94=A1=E5=BE=B7=E6=A3=AE?= Date: Wed, 21 Oct 2026 10:01:29 +0800 Subject: [PATCH 3/4] =?UTF-8?q?ci:=20=E6=8E=A5=E5=85=A5=20Turborepo=20?= =?UTF-8?q?=E7=BC=93=E5=AD=98=E5=B9=B6=E7=BB=9F=E4=B8=80=20jointarp=20work?= =?UTF-8?q?space=20=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/actions/setup/action.yml | 8 +++ .github/workflows/release-cli.yml | 4 +- .gitignore | 2 + README.md | 4 +- apps/desktop/AGENTS.md | 2 +- apps/desktop/README.md | 4 +- apps/desktop/package.json | 15 +++--- apps/desktop/scripts/desktop.ts | 2 +- apps/desktop/scripts/runtime-smoke.ts | 2 +- .../src/main/agent/host-system-prompt.test.ts | 6 +-- apps/desktop/src/main/config/app-settings.ts | 8 +-- apps/desktop/src/main/desktop-rpc-context.ts | 2 +- apps/desktop/src/main/desktop-rpc.ts | 4 +- apps/desktop/src/main/desktop.ts | 6 +-- apps/desktop/src/main/game/local-settings.ts | 12 ++--- .../src/main/game/room-ai-settings.test.ts | 10 ++-- .../desktop/src/main/game/room-ai-settings.ts | 12 ++--- .../src/main/game/room-state-service.test.ts | 46 ++++++++--------- .../src/main/game/subscription-auth.test.ts | 2 +- .../src/main/game/subscription-auth.ts | 2 +- apps/desktop/src/main/index.ts | 2 +- apps/desktop/src/main/mcp/playtest.test.ts | 14 +++--- apps/desktop/src/main/mcp/playtest.ts | 24 ++++----- apps/desktop/src/main/mcp/server.ts | 2 +- apps/desktop/src/main/mcp/service.ts | 2 +- apps/desktop/src/main/media-path.test.ts | 2 +- apps/desktop/src/main/media-path.ts | 2 +- .../src/main/modules/import-local-module.ts | 8 +-- .../src/main/modules/list-modules.test.ts | 12 ++--- apps/desktop/src/main/modules/list-modules.ts | 2 +- .../main/modules/module-companions.test.ts | 10 ++-- .../desktop/src/main/modules/module-import.ts | 6 +-- .../main/modules/module-integration.test.ts | 12 ++--- apps/desktop/src/main/modules/module-root.ts | 4 +- .../desktop/src/main/modules/module-router.ts | 8 +-- .../src/main/reference-window-state.ts | 2 +- .../src/main/sessions/character-store.test.ts | 12 ++--- .../src/main/sessions/local-room-resources.ts | 4 +- .../main/sessions/local-session-lifecycle.ts | 4 +- .../main/sessions/room-notes-router.test.ts | 2 +- .../src/main/sessions/room-notes-router.ts | 4 +- .../src/main/sessions/session-router.ts | 24 ++++----- .../src/main/sessions/session-store.test.ts | 14 +++--- apps/desktop/src/main/tts/mimo.ts | 2 +- apps/desktop/src/main/tts/router.ts | 2 +- apps/desktop/src/main/tts/service.test.ts | 6 +-- apps/desktop/src/main/tts/service.ts | 10 ++-- .../computation/document-worker-protocol.ts | 4 +- .../computation/document-worker-runtime.ts | 2 +- .../documents/computation/ses-compiler.ts | 2 +- .../worker-document-evaluator.test.ts | 6 +-- .../computation/worker-document-evaluator.ts | 6 +-- .../modules/DefaultDocumentLayout.tsx | 4 +- .../src/features/modules/DocumentCard.tsx | 4 +- .../features/modules/DocumentCardContent.tsx | 4 +- .../src/features/modules/DocumentCover.tsx | 2 +- .../features/modules/DocumentDetail.test.tsx | 2 +- .../src/features/modules/DocumentDetail.tsx | 6 +-- .../src/features/modules/DocumentDialog.tsx | 4 +- .../features/modules/DocumentFieldErrors.tsx | 4 +- .../features/modules/DocumentFieldView.tsx | 6 +-- .../features/modules/DocumentPreview.test.tsx | 8 +-- .../src/features/modules/DocumentPreview.tsx | 4 +- .../features/modules/DocumentReferences.tsx | 6 +-- .../src/features/modules/DocumentRenderer.tsx | 2 +- .../src/features/modules/DocumentSheet.tsx | 4 +- .../src/features/modules/DocumentTable.tsx | 10 ++-- .../features/modules/DocumentTypesPage.tsx | 4 +- .../features/modules/DocumentValue.test.tsx | 2 +- .../src/features/modules/DocumentValue.tsx | 4 +- .../features/modules/EquipmentSlots.test.tsx | 4 +- .../src/features/modules/EquipmentSlots.tsx | 4 +- .../src/features/modules/FieldTable.tsx | 6 +-- .../src/features/modules/FlowOutline.tsx | 9 +++- .../src/features/modules/HandlebarsLayout.tsx | 11 ++-- .../features/modules/LaunchOverviewPage.tsx | 6 +-- .../src/features/modules/ModuleDocuments.tsx | 2 +- .../src/features/modules/ModulePage.tsx | 2 +- .../modules/ReferenceCollection.test.tsx | 4 +- .../features/modules/ReferenceCollection.tsx | 4 +- .../src/features/modules/ReferenceSheet.tsx | 4 +- .../modules/TemplateComponentView.tsx | 2 +- .../features/modules/TypeDefinitionPanel.tsx | 10 ++-- .../src/features/modules/document-preview.ts | 10 ++-- .../modules/document-renderer-element.tsx | 2 +- .../src/features/modules/document-sheet.ts | 8 +-- .../src/features/modules/layout-values.ts | 10 ++-- .../features/modules/reference-collection.ts | 8 +-- .../features/modules/room-collection-rows.ts | 2 +- .../features/sessions/AgentContextDialog.tsx | 2 +- .../src/features/sessions/AgentDetails.tsx | 2 +- .../features/sessions/CharacterCardDialog.tsx | 4 +- .../src/features/sessions/CharacterFields.tsx | 4 +- .../sessions/CharacterPreview.test.tsx | 4 +- .../features/sessions/CharacterPreview.tsx | 4 +- .../features/sessions/CharacterSummary.tsx | 6 +-- .../features/sessions/ChatMessageEntry.tsx | 10 ++-- .../src/features/sessions/ChatPanel.tsx | 8 +-- .../features/sessions/CompactionSettings.tsx | 4 +- .../sessions/CompanionInitiativeSettings.tsx | 4 +- .../features/sessions/CompanionLaunchCard.tsx | 2 +- .../sessions/CompanionSettingsDialog.tsx | 8 +-- .../features/sessions/CreationWorkbench.tsx | 6 +-- .../src/features/sessions/DiceCard.tsx | 4 +- .../src/features/sessions/GameParty.tsx | 6 +-- .../sessions/HistoryAdventureList.tsx | 2 +- .../src/features/sessions/LaunchCard.tsx | 4 +- .../src/features/sessions/LaunchFlow.tsx | 4 +- .../src/features/sessions/ReadyLobby.tsx | 4 +- .../sessions/RoomCompanionSettings.tsx | 4 +- .../sessions/RoomConfigurationSettings.tsx | 2 +- .../src/features/sessions/RoomList.tsx | 2 +- .../features/sessions/RoomMentionSettings.tsx | 2 +- .../features/sessions/RoomModelSettings.tsx | 4 +- .../src/features/sessions/RoomModule.test.tsx | 2 +- .../src/features/sessions/RoomModule.tsx | 4 +- .../src/features/sessions/SessionStatus.tsx | 2 +- .../src/features/sessions/WorldStateCard.tsx | 8 +-- .../features/sessions/adventure-actions.tsx | 2 +- .../sessions/character-sheet.test.tsx | 2 +- .../src/features/sessions/character-sheet.ts | 4 +- .../features/sessions/chat-markdown.test.tsx | 2 +- .../features/sessions/chat-timeline.test.ts | 4 +- .../src/features/sessions/chat-timeline.ts | 2 +- .../src/features/sessions/dice-timeline.ts | 2 +- .../src/features/sessions/game-client.test.ts | 2 +- .../src/features/sessions/game-client.ts | 2 +- .../sessions/history-adventures.test.tsx | 2 +- .../features/sessions/history-adventures.ts | 2 +- .../src/features/sessions/mention.test.ts | 2 +- .../renderer/src/features/sessions/mention.ts | 2 +- .../sessions/npc-portrait-documents.ts | 8 +-- .../features/sessions/npc-portrait.test.ts | 2 +- .../src/features/sessions/npc-portrait.ts | 2 +- .../src/features/sessions/room-chat-store.ts | 4 +- .../features/sessions/room-connection.test.ts | 20 ++++---- .../src/features/sessions/room-connection.ts | 12 ++--- .../sessions/room-display-mutation.test.ts | 2 +- .../sessions/room-document-loader.tsx | 2 +- .../src/features/sessions/room-document.tsx | 2 +- .../src/features/sessions/room-draft-view.ts | 2 +- .../src/features/sessions/room-launch-view.ts | 6 +-- .../sessions/room-state-store.test.ts | 6 +-- .../src/features/sessions/room-state-store.ts | 6 +-- .../sessions/use-adventure-actions.ts | 2 +- .../features/sessions/use-chat-composer.ts | 6 +-- .../src/features/sessions/use-chat-log.ts | 6 ++- .../src/features/sessions/use-room-state.ts | 6 +-- .../sessions/use-room-visible-documents.ts | 4 +- .../src/features/settings/AiSettingsPanel.tsx | 2 +- .../settings/GameConfigurationFields.tsx | 12 ++--- .../settings/GameConfigurationForm.tsx | 4 +- .../src/features/settings/ModelPicker.tsx | 2 +- .../settings/use-game-configuration.ts | 4 +- apps/desktop/src/shared/desktop-api.ts | 6 +-- apps/desktop/src/shared/speech-text.test.ts | 2 +- apps/desktop/src/shared/speech-text.ts | 6 +-- apps/desktop/src/shared/tts.ts | 12 ++--- bun.lock | 41 ++++++++++----- ...21\345\270\203\346\265\201\347\250\213.md" | 12 +++-- ...13\350\257\225\347\273\264\346\212\244.md" | 6 +-- package.json | 13 ++--- packages/core/README.md | 18 +++---- packages/core/package.json | 8 +-- .../node/agent/companion-document-tools.ts | 6 +-- .../src/node/agent/context-subscriptions.ts | 2 +- .../src/node/agent/game-compaction.test.ts | 2 +- packages/core/src/node/agent/game-tools.ts | 4 +- packages/core/src/node/agent/pi-runtime.ts | 2 +- .../core/src/node/game/chat-service.test.ts | 14 +++--- .../core/src/node/game/chat/launch-cards.ts | 2 +- packages/core/src/node/game/chat/launch.ts | 2 +- packages/core/src/node/game/chat/narration.ts | 4 +- .../src/node/game/companion-launch.test.ts | 6 +-- packages/core/src/node/game/companion.test.ts | 6 +-- packages/core/src/node/game/companion.ts | 2 +- .../src/node/game/room-state-projection.ts | 10 ++-- .../core/src/node/sessions/character-db.ts | 8 +-- .../src/node/sessions/character-ownership.ts | 4 +- .../core/src/node/sessions/character-store.ts | 18 ++++--- .../src/node/sessions/companion-selection.ts | 4 +- .../core/src/node/sessions/compile-module.ts | 12 ++--- .../node/sessions/document-reference-store.ts | 8 +-- .../core/src/node/sessions/frozen-module.ts | 12 ++--- .../src/node/sessions/game-document-patch.ts | 4 +- .../src/node/sessions/game-document-path.ts | 4 +- .../src/node/sessions/game-document-read.ts | 6 +-- .../src/node/sessions/game-document-source.ts | 12 ++--- .../src/node/sessions/game-document-views.ts | 10 ++-- .../src/node/sessions/game-document-write.ts | 21 ++++---- .../src/node/sessions/game-file-access.ts | 2 +- .../core/src/node/sessions/game-file-index.ts | 4 +- .../src/node/sessions/game-overlay.test.ts | 2 +- .../core/src/node/sessions/game-overlay.ts | 4 +- .../core/src/node/sessions/game-pointers.ts | 2 +- .../core/src/node/sessions/game-state.test.ts | 10 ++-- packages/core/src/node/sessions/launch-db.ts | 4 +- .../src/node/sessions/launch-store.test.ts | 4 +- .../core/src/node/sessions/launch-store.ts | 10 ++-- .../src/node/sessions/module-sync.test.ts | 4 +- .../core/src/node/sessions/module-sync.ts | 17 ++++--- .../core/src/node/sessions/room-storage.ts | 2 +- .../core/src/node/sessions/session-store.ts | 16 +++--- .../core/src/node/storage/config-file.test.ts | 10 ++-- packages/core/src/node/storage/config-file.ts | 4 +- packages/core/src/shared/launch.ts | 10 ++-- packages/core/src/shared/narrative.ts | 2 +- packages/core/src/shared/room-state.ts | 6 +-- packages/core/src/shared/session.ts | 4 +- packages/core/src/testing/launch-module.ts | 4 +- packages/module-cli/README.md | 10 ++-- packages/module-cli/package.json | 10 ++-- packages/module-cli/src/commands.test.ts | 4 +- packages/module-cli/src/commands.ts | 6 +-- packages/module/README.md | 6 +-- packages/module/package.json | 6 +-- .../module/src/node/module-documents.test.ts | 2 +- .../module/src/node/module-metadata.test.ts | 2 +- scripts/tasks.ts | 18 +++++++ scripts/test.ts | 25 ++++++---- turbo.json | 50 +++++++++++++++++++ 221 files changed, 763 insertions(+), 637 deletions(-) create mode 100644 scripts/tasks.ts create mode 100644 turbo.json diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 5020380..8beca93 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -33,6 +33,14 @@ runs: key: desktop-tools-v1-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('package.json', 'bun.lock', 'apps/desktop/package.json', 'apps/desktop/hutch.config.ts') }} restore-keys: | desktop-tools-v1-${{ runner.os }}-${{ runner.arch }}- + - name: 缓存 Turborepo 任务结果 + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + with: + path: .turbo/cache + key: turbo-v1-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('bun.lock', 'turbo.json') }}-${{ github.sha }}-${{ github.job }} + restore-keys: | + turbo-v1-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('bun.lock', 'turbo.json') }}- + turbo-v1-${{ runner.os }}-${{ runner.arch }}- - name: 从根目录安装依赖 shell: bash env: diff --git a/.github/workflows/release-cli.yml b/.github/workflows/release-cli.yml index 979ae2e..aebd6ba 100644 --- a/.github/workflows/release-cli.yml +++ b/.github/workflows/release-cli.yml @@ -31,7 +31,7 @@ jobs: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} run: | if [[ -z "$NPM_TOKEN" ]]; then - echo '::error::请在仓库 Actions Secrets 配置有 @tarp/module-cli 发布权限的 NPM_TOKEN。' + echo '::error::请在仓库 Actions Secrets 配置有 @jointarp/module-cli 发布权限的 NPM_TOKEN。' exit 1 fi - uses: ./.github/actions/setup @@ -52,7 +52,7 @@ jobs: const npmTag = version.split('+')[0].includes('-') ? 'next' : 'latest'; appendFileSync(process.env.GITHUB_OUTPUT, `npm-tag=${npmTag}\n`); JS - - run: bun run --filter @tarp/module-cli pack + - run: bun run --filter @jointarp/module-cli pack - run: bun scripts/release/smoke.ts cli - name: 整理发布包、对应源码和校验和 run: | diff --git a/.gitignore b/.gitignore index 9f10415..ebf6e50 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ release/ .env .env.* !.env.example + +.turbo/ diff --git a/README.md b/README.md index 9ee6fd0..c5888b6 100644 --- a/README.md +++ b/README.md @@ -47,10 +47,12 @@ bun run dev | `bun run package` | 打包桌面应用目录 | | `bun run dist` | 生成桌面分发产物 | +类型检查与构建由 Turborepo 调度,可复用 CLI 和页面构建结果;缓存范围与 Actions 配置见[发布流程](docs/发布流程.md)。完整测试与桌面原生打包仍实际执行。 + 构建 CLI 后,可以直接用 Bun 校验模组: ```sh -bun run --filter @tarp/module-cli build +bun run --filter @jointarp/module-cli build bun run cli module validate ./apps/desktop/examples/建卡控件演示 --json ``` diff --git a/apps/desktop/AGENTS.md b/apps/desktop/AGENTS.md index d553d44..199ca07 100644 --- a/apps/desktop/AGENTS.md +++ b/apps/desktop/AGENTS.md @@ -1,7 +1,7 @@ # 桌面应用约定 - 使用中文交流和中文 Markdown 文档。 -- 本目录是 TARP Bun workspace 的 `@tarp/desktop` 子包;依赖在仓库根目录安装,锁文件由根目录统一维护。 +- 本目录是 TARP Bun workspace 的 `@jointarp/desktop` 子包;依赖在仓库根目录安装,锁文件由根目录统一维护。 - 保留 TypeScript 7、Electrobun(Bun 主进程、系统 WebView)和 Oxfmt;Git 钩子由仓库根目录管理。 - 测试优先覆盖可观察行为并复用已有场景;简单映射、纯透传和样式调整不新增独立测试文件。测试范围与维护原则见 `../../docs/测试维护.md`。 - 源码仓库只维护开发环境、内部契约、架构、实现、扩展、恢复、测试和发布文档;玩家指南与模组配置规范统一在官网文档维护,不在 README 或 `docs/` 复制教程、参数表和完整配置示例。影响公开行为或模组格式时同步更新官网正文。跨仓库文档引用使用公开地址,不依赖本地目录布局。 diff --git a/apps/desktop/README.md b/apps/desktop/README.md index 0605b66..83f409c 100644 --- a/apps/desktop/README.md +++ b/apps/desktop/README.md @@ -23,7 +23,7 @@ bun install --cwd ../.. bun run dev ``` -本目录是 `@tarp/desktop` workspace 子包。依赖在 monorepo 根目录统一安装,仅维护根级 `bun.lock`;需要按锁文件安装时从根目录运行 `bun install --frozen-lockfile`。本页桌面命令在 `apps/desktop/` 执行。 +本目录是 `@jointarp/desktop` workspace 子包。依赖在 monorepo 根目录统一安装,仅维护根级 `bun.lock`;需要按锁文件安装时从根目录运行 `bun install --frozen-lockfile`。本页桌面命令在 `apps/desktop/` 执行。 首次运行构建、开发或类型检查时,`electrobun prepare` 下载固定的 Electrobun 2.0.4 devkit、配套 Hutch 和 Bun 1.4.0,生成忽略提交的 `.hutch/devkit/`。开发机器的 Bun 负责 workspace 和脚本,随桌面分发的 Bun 由 Electrobun 固定,两者独立。所有依赖仍从仓库根目录安装,仅维护根级 `bun.lock`;`hutch.config.ts` 明确使用 Bun,不生成 `hutch.lock`。 @@ -70,7 +70,7 @@ GitHub Actions 的版本 tag、跨平台构建、签名配置和 Release 草稿 - `src/main/`:Electrobun 启动与桌面 RPC 入口。`config/` 负责用户配置;`modules/` 负责模组列表与导入;`sessions/` 接入本地房间资源与笔记接口;`game/` 管理本机模型配置、房间模型选择与订阅登录;`tts/` 维护语音服务。房间存档、聊天、状态、开局与 AI 执行位于 `packages/core/`,通用模组加载、校验和计算位于 `packages/module/`。 - `src/renderer/src/native-bridge.ts`:Electrobun 页面桥,连接 oRPC、桌面事件和本地图片服务。 -- `src/shared/`:主进程和渲染进程之间的桌面契约。游戏共享契约从 `@tarp/core/shared/*` 导入,浏览器不引用 `node` 入口。 +- `src/shared/`:主进程和渲染进程之间的桌面契约。游戏共享契约从 `@jointarp/core/shared/*` 导入,浏览器不引用 `node` 入口。 - `src/renderer/src/features/modules/`:模组库列表、打开模组与文档预览。 - `src/renderer/src/features/settings/`:设置导航、常规设置与外观设置。 - `src/renderer/src/components/`:跨功能复用的界面组件,`ui/` 存放基于 Base UI 或原生元素维护的基础组件。 diff --git a/apps/desktop/package.json b/apps/desktop/package.json index 1aa5219..22026d3 100644 --- a/apps/desktop/package.json +++ b/apps/desktop/package.json @@ -1,5 +1,5 @@ { - "name": "@tarp/desktop", + "name": "@jointarp/desktop", "version": "0.1.0", "private": true, "description": "由 AI 主持的桌面跑团应用。", @@ -12,18 +12,22 @@ "typecheck": "bun run prepare:desktop && bun --bun x --no-install tsc --noEmit", "fmt": "oxfmt", "fmt:check": "oxfmt --check", - "test": "bun ../../scripts/test.ts --scope @tarp/desktop", - "test:changed": "bun ../../scripts/test.ts --scope @tarp/desktop --changed", + "test": "bun ../../scripts/test.ts --scope @jointarp/desktop", + "test:changed": "bun ../../scripts/test.ts --scope @jointarp/desktop --changed", "preview": "electrobun dev", "package": "bun run scripts/desktop.ts package", "dist": "bun run scripts/desktop.ts dist", - "prepare:desktop": "electrobun prepare" + "prepare:desktop": "electrobun prepare", + "build:renderer": "bun --bun x --no-install vite build" }, "dependencies": { "@base-ui/react": "^1.8.0", "@colyseus/schema": "5.0.34", "@earendil-works/pi-ai": "1.2.0", "@earendil-works/pi-coding-agent": "1.2.0", + "@jointarp/core": "workspace:*", + "@jointarp/module": "workspace:*", + "@jointarp/module-cli": "workspace:*", "@modelcontextprotocol/sdk": "^1.32.1", "@orpc/client": "^2.0.0-beta.36", "@orpc/contract": "^2.0.0-beta.36", @@ -32,9 +36,6 @@ "@tanstack/react-query": "^5.103.1", "@tanstack/react-router": "^1.170.17", "@tanstack/react-virtual": "^3.14.13", - "@tarp/core": "workspace:*", - "@tarp/module": "workspace:*", - "@tarp/module-cli": "workspace:*", "class-variance-authority": "^0.7.1", "cn": "^0.2.6", "es-toolkit": "^1.52.0", diff --git a/apps/desktop/scripts/desktop.ts b/apps/desktop/scripts/desktop.ts index 5728214..6dc9804 100644 --- a/apps/desktop/scripts/desktop.ts +++ b/apps/desktop/scripts/desktop.ts @@ -77,7 +77,7 @@ if (process.platform === "darwin") { } } } -await run(["bun", "--bun", "x", "--no-install", "vite", "build"]); +await run(["bun", "../../scripts/tasks.ts", "run", "build:renderer", "--filter=./apps/desktop"]); if (mode === "dev") { // Vite 提供页面热更新;Electrobun 监听主进程并重启。 const vite = Bun.spawn(["bun", "--bun", "x", "--no-install", "vite"], { diff --git a/apps/desktop/scripts/runtime-smoke.ts b/apps/desktop/scripts/runtime-smoke.ts index b809edc..f21ffbb 100644 --- a/apps/desktop/scripts/runtime-smoke.ts +++ b/apps/desktop/scripts/runtime-smoke.ts @@ -1,6 +1,6 @@ import { strict as assert } from "node:assert"; -import { SqliteDatabase } from "@tarp/core/node/storage/sqlite"; +import { SqliteDatabase } from "@jointarp/core/node/storage/sqlite"; import { Kysely, SqliteDialect } from "kysely"; import { getQuickJS } from "quickjs-emscripten"; diff --git a/apps/desktop/src/main/agent/host-system-prompt.test.ts b/apps/desktop/src/main/agent/host-system-prompt.test.ts index 7934c6d..062c439 100644 --- a/apps/desktop/src/main/agent/host-system-prompt.test.ts +++ b/apps/desktop/src/main/agent/host-system-prompt.test.ts @@ -4,12 +4,12 @@ import { mkdtemp, rm } from "node:fs/promises"; import { tmpdir } from "node:os"; import { join } from "node:path"; -import { roomResources } from "@tarp/core/node/agent/pi-runtime"; +import { roomResources } from "@jointarp/core/node/agent/pi-runtime"; import { defaultHostSystemPrompt, hostInputInstructions, -} from "@tarp/core/shared/host-system-prompt"; -import { narrativeInstructions } from "@tarp/core/shared/narrative"; +} from "@jointarp/core/shared/host-system-prompt"; +import { narrativeInstructions } from "@jointarp/core/shared/narrative"; import { readAppConfig, updateAppConfig } from "../config/app-config"; import { readGameDefaults, updateGameDefaults } from "../config/app-settings"; diff --git a/apps/desktop/src/main/config/app-settings.ts b/apps/desktop/src/main/config/app-settings.ts index 94f63e6..692531f 100644 --- a/apps/desktop/src/main/config/app-settings.ts +++ b/apps/desktop/src/main/config/app-settings.ts @@ -1,11 +1,11 @@ -import { createIdentityId } from "@tarp/core/node/identity"; -import { structuredFile, StructuredFileError } from "@tarp/core/node/storage/structured-file"; -import { playerSchema } from "@tarp/core/shared/game"; +import { createIdentityId } from "@jointarp/core/node/identity"; +import { structuredFile, StructuredFileError } from "@jointarp/core/node/storage/structured-file"; +import { playerSchema } from "@jointarp/core/shared/game"; import { gameDefaultsSchema, patchGameDefaults, type GameDefaultsPatch, -} from "@tarp/core/shared/game-defaults"; +} from "@jointarp/core/shared/game-defaults"; import { z } from "zod"; import { appConfigSchema } from "../../shared/app-config"; diff --git a/apps/desktop/src/main/desktop-rpc-context.ts b/apps/desktop/src/main/desktop-rpc-context.ts index aa28475..5cd8266 100644 --- a/apps/desktop/src/main/desktop-rpc-context.ts +++ b/apps/desktop/src/main/desktop-rpc-context.ts @@ -1,5 +1,5 @@ +import type { GameContext } from "@jointarp/core/node"; import { os, ORPCError } from "@orpc/server"; -import type { GameContext } from "@tarp/core/node"; import { AppConfigError } from "./config/app-config"; import type { LocalGameSettings } from "./game/local-settings"; diff --git a/apps/desktop/src/main/desktop-rpc.ts b/apps/desktop/src/main/desktop-rpc.ts index 054d8b8..42ca26c 100644 --- a/apps/desktop/src/main/desktop-rpc.ts +++ b/apps/desktop/src/main/desktop-rpc.ts @@ -1,8 +1,8 @@ +import { gameRouter } from "@jointarp/core/node"; +import { gameDefaultsPatchSchema } from "@jointarp/core/shared/game-defaults"; import { onError } from "@orpc/server"; import { RPCHandler } from "@orpc/server/message-port"; import { appConfigSchema } from "@shared/app-config"; -import { gameRouter } from "@tarp/core/node"; -import { gameDefaultsPatchSchema } from "@tarp/core/shared/game-defaults"; import { z } from "zod"; import { readAppConfig, updateAppConfig } from "./config/app-config"; diff --git a/apps/desktop/src/main/desktop.ts b/apps/desktop/src/main/desktop.ts index 5f128ea..70104ad 100644 --- a/apps/desktop/src/main/desktop.ts +++ b/apps/desktop/src/main/desktop.ts @@ -1,9 +1,9 @@ import { isAbsolute, join } from "node:path"; +import { ChatService, createPiRuntime } from "@jointarp/core/node"; +import { narrationGapMs } from "@jointarp/core/shared/narration"; +import { modulePreviewHash } from "@jointarp/module-cli/commands"; import { NativeMessagePort, type NativeBridge } from "@shared/native-bridge"; -import { ChatService, createPiRuntime } from "@tarp/core/node"; -import { narrationGapMs } from "@tarp/core/shared/narration"; -import { modulePreviewHash } from "@tarp/module-cli/commands"; import Electrobun, { BrowserView, Utils } from "electrobun/main"; import { readAppConfig, resolveAppConfigLocation } from "./config/app-config"; diff --git a/apps/desktop/src/main/game/local-settings.ts b/apps/desktop/src/main/game/local-settings.ts index b10fc19..3c4480a 100644 --- a/apps/desktop/src/main/game/local-settings.ts +++ b/apps/desktop/src/main/game/local-settings.ts @@ -2,18 +2,18 @@ import { join } from "node:path"; import type { AuthContext, Provider } from "@earendil-works/pi-ai"; import { builtinProviders } from "@earendil-works/pi-ai/providers/all"; -import { ORPCError } from "@orpc/server"; -import { ModelRuntime, InMemoryModelsStore } from "@tarp/core/node/agent/models"; -import { createIdentityId } from "@tarp/core/node/identity"; -import { structuredFile, StructuredFileError } from "@tarp/core/node/storage/structured-file"; +import { ModelRuntime, InMemoryModelsStore } from "@jointarp/core/node/agent/models"; +import { createIdentityId } from "@jointarp/core/node/identity"; +import { structuredFile, StructuredFileError } from "@jointarp/core/node/storage/structured-file"; import { playerSchema, customAiApis, type AiSettings, type ThinkingLevel, type AvailableAiModel, -} from "@tarp/core/shared/game"; -import { gameDefaultsSchema, type GameDefaultsPatch } from "@tarp/core/shared/game-defaults"; +} from "@jointarp/core/shared/game"; +import { gameDefaultsSchema, type GameDefaultsPatch } from "@jointarp/core/shared/game-defaults"; +import { ORPCError } from "@orpc/server"; import { z } from "zod"; import { diff --git a/apps/desktop/src/main/game/room-ai-settings.test.ts b/apps/desktop/src/main/game/room-ai-settings.test.ts index 627b7a8..d239657 100644 --- a/apps/desktop/src/main/game/room-ai-settings.test.ts +++ b/apps/desktop/src/main/game/room-ai-settings.test.ts @@ -6,11 +6,11 @@ import { tmpdir } from "node:os"; import { join } from "node:path"; import { builtinProviders } from "@earendil-works/pi-ai/providers/all"; -import { ChatService } from "@tarp/core/node/game/chat-service"; -import { readRoomSettings } from "@tarp/core/node/sessions/room-settings"; -import { createSession } from "@tarp/core/node/sessions/session-store"; -import { waitFor } from "@tarp/module/testing/async"; -import { writeTestFile as writeFile } from "@tarp/module/testing/files"; +import { ChatService } from "@jointarp/core/node/game/chat-service"; +import { readRoomSettings } from "@jointarp/core/node/sessions/room-settings"; +import { createSession } from "@jointarp/core/node/sessions/session-store"; +import { waitFor } from "@jointarp/module/testing/async"; +import { writeTestFile as writeFile } from "@jointarp/module/testing/files"; import { LocalGameSettings } from "./local-settings"; import { RoomAiSettingsStore } from "./room-ai-settings"; diff --git a/apps/desktop/src/main/game/room-ai-settings.ts b/apps/desktop/src/main/game/room-ai-settings.ts index 1383cbb..e5449cd 100644 --- a/apps/desktop/src/main/game/room-ai-settings.ts +++ b/apps/desktop/src/main/game/room-ai-settings.ts @@ -1,12 +1,12 @@ -import { ORPCError } from "@orpc/server"; import { readCompactionSettingsFile, saveCompactionSettingsFile, -} from "@tarp/core/node/game/compaction-settings"; -import { readRoomSettings, updateRoomSettings } from "@tarp/core/node/sessions/room-settings"; -import { readRoomState } from "@tarp/core/node/sessions/session-store"; -import type { CompactionRole, CompactionSettings } from "@tarp/core/shared/compaction-settings"; -import type { AvailableAiModel, RoomAiSettings, ThinkingLevel } from "@tarp/core/shared/game"; +} from "@jointarp/core/node/game/compaction-settings"; +import { readRoomSettings, updateRoomSettings } from "@jointarp/core/node/sessions/room-settings"; +import { readRoomState } from "@jointarp/core/node/sessions/session-store"; +import type { CompactionRole, CompactionSettings } from "@jointarp/core/shared/compaction-settings"; +import type { AvailableAiModel, RoomAiSettings, ThinkingLevel } from "@jointarp/core/shared/game"; +import { ORPCError } from "@orpc/server"; import type { LocalGameSettings } from "./local-settings"; diff --git a/apps/desktop/src/main/game/room-state-service.test.ts b/apps/desktop/src/main/game/room-state-service.test.ts index 9373ad1..05aeb25 100644 --- a/apps/desktop/src/main/game/room-state-service.test.ts +++ b/apps/desktop/src/main/game/room-state-service.test.ts @@ -7,45 +7,45 @@ import { join } from "node:path"; import { MessageChannel } from "node:worker_threads"; import { Decoder } from "@colyseus/schema"; -import { createORPCClient } from "@orpc/client"; -import { RPCLink } from "@orpc/client/message-port"; -import type { ContractRouterClient } from "@orpc/contract"; -import { RPCHandler } from "@orpc/server/message-port"; -import { ChatService } from "@tarp/core/node/game/chat-service"; -import { gameRouter } from "@tarp/core/node/game/game-router"; -import { RoomStateEncoder } from "@tarp/core/node/game/room-state-encoder"; +import { ChatService } from "@jointarp/core/node/game/chat-service"; +import { gameRouter } from "@jointarp/core/node/game/game-router"; +import { RoomStateEncoder } from "@jointarp/core/node/game/room-state-encoder"; import { assertRoomOverlayAdmission, projectLaunch, projectEntities, -} from "@tarp/core/node/game/room-state-projection"; -import { readCharacters } from "@tarp/core/node/sessions/character-db"; +} from "@jointarp/core/node/game/room-state-projection"; +import { readCharacters } from "@jointarp/core/node/sessions/character-db"; import { characterSnapshot, validateCharacterDraft, -} from "@tarp/core/node/sessions/character-store"; +} from "@jointarp/core/node/sessions/character-store"; import { materializeCharacter, updateGameDocument, writeGameDocument, -} from "@tarp/core/node/sessions/game-state"; -import { launchState } from "@tarp/core/node/sessions/launch-store"; -import { notifyRoomChanged } from "@tarp/core/node/sessions/room-changes"; -import { roomDirectoryForDatabase } from "@tarp/core/node/sessions/session-paths"; +} from "@jointarp/core/node/sessions/game-state"; +import { launchState } from "@jointarp/core/node/sessions/launch-store"; +import { notifyRoomChanged } from "@jointarp/core/node/sessions/room-changes"; +import { roomDirectoryForDatabase } from "@jointarp/core/node/sessions/session-paths"; import { createSession, loadSessionModuleResources, openSessionDatabase, gameDirectoryForDatabase, -} from "@tarp/core/node/sessions/session-store"; -import { documentRevision } from "@tarp/core/node/sessions/state-version"; -import type { gameContract, RoomNotification } from "@tarp/core/shared/game"; -import type { LaunchAction } from "@tarp/core/shared/launch"; -import { ROOM_PROTOCOL_VERSION } from "@tarp/core/shared/room-state"; -import { RoomStateSchema } from "@tarp/core/shared/room-state-schema"; -import { createLaunchTestModule } from "@tarp/core/testing/launch-module"; -import type { WorkbenchView } from "@tarp/module/creation-workbench"; -import { writeTestFile as writeFile } from "@tarp/module/testing/files"; +} from "@jointarp/core/node/sessions/session-store"; +import { documentRevision } from "@jointarp/core/node/sessions/state-version"; +import type { gameContract, RoomNotification } from "@jointarp/core/shared/game"; +import type { LaunchAction } from "@jointarp/core/shared/launch"; +import { ROOM_PROTOCOL_VERSION } from "@jointarp/core/shared/room-state"; +import { RoomStateSchema } from "@jointarp/core/shared/room-state-schema"; +import { createLaunchTestModule } from "@jointarp/core/testing/launch-module"; +import type { WorkbenchView } from "@jointarp/module/creation-workbench"; +import { writeTestFile as writeFile } from "@jointarp/module/testing/files"; +import { createORPCClient } from "@orpc/client"; +import { RPCLink } from "@orpc/client/message-port"; +import type { ContractRouterClient } from "@orpc/contract"; +import { RPCHandler } from "@orpc/server/message-port"; import { RoomConnection } from "../../renderer/src/features/sessions/room-connection"; import { diff --git a/apps/desktop/src/main/game/subscription-auth.test.ts b/apps/desktop/src/main/game/subscription-auth.test.ts index 4a2ab2b..5d1ccbe 100644 --- a/apps/desktop/src/main/game/subscription-auth.test.ts +++ b/apps/desktop/src/main/game/subscription-auth.test.ts @@ -6,7 +6,7 @@ import { join } from "node:path"; import type { OAuthCredential, OAuthAuth } from "@earendil-works/pi-ai"; import { openaiCodexProvider } from "@earendil-works/pi-ai/providers/openai-codex"; -import { waitFor } from "@tarp/module/testing/async"; +import { waitFor } from "@jointarp/module/testing/async"; import { LocalGameSettings } from "./local-settings"; import { SubscriptionAuth } from "./subscription-auth"; diff --git a/apps/desktop/src/main/game/subscription-auth.ts b/apps/desktop/src/main/game/subscription-auth.ts index 412d043..76d0455 100644 --- a/apps/desktop/src/main/game/subscription-auth.ts +++ b/apps/desktop/src/main/game/subscription-auth.ts @@ -1,7 +1,7 @@ import { randomUUID } from "node:crypto"; import { registerBunOAuthFlows } from "@earendil-works/pi-ai/bun-oauth"; -import type { ModelRuntime } from "@tarp/core/node/agent/models"; +import type { ModelRuntime } from "@jointarp/core/node/agent/models"; // 桌面主进程会被 Bun 打包,pi 的变量路径动态导入无法随包发布。 registerBunOAuthFlows(); diff --git a/apps/desktop/src/main/index.ts b/apps/desktop/src/main/index.ts index 110446c..9375578 100644 --- a/apps/desktop/src/main/index.ts +++ b/apps/desktop/src/main/index.ts @@ -1,4 +1,4 @@ -import { parseModuleCommand, runModuleCommand } from "@tarp/module-cli/commands"; +import { parseModuleCommand, runModuleCommand } from "@jointarp/module-cli/commands"; import manifest from "../../package.json"; diff --git a/apps/desktop/src/main/mcp/playtest.test.ts b/apps/desktop/src/main/mcp/playtest.test.ts index fdcf8e2..7c353ee 100644 --- a/apps/desktop/src/main/mcp/playtest.test.ts +++ b/apps/desktop/src/main/mcp/playtest.test.ts @@ -6,15 +6,15 @@ import { createServer } from "node:http"; import { join } from "node:path"; import { fauxAssistantMessage, fauxToolCall } from "@earendil-works/pi-ai"; +import { ChatService, type Runtime } from "@jointarp/core/node"; +import { updateGameDocument } from "@jointarp/core/node/sessions/game-state"; +import { createSession, openSessionDatabase } from "@jointarp/core/node/sessions/session-store"; +import { gameDefaultsSchema } from "@jointarp/core/shared/game-defaults"; +import { waitFor } from "@jointarp/module/testing/async"; +import { writeTestFile as writeFile } from "@jointarp/module/testing/files"; +import { createTestModule } from "@jointarp/module/testing/test-module"; import { Client } from "@modelcontextprotocol/sdk/client/index.js"; import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"; -import { ChatService, type Runtime } from "@tarp/core/node"; -import { updateGameDocument } from "@tarp/core/node/sessions/game-state"; -import { createSession, openSessionDatabase } from "@tarp/core/node/sessions/session-store"; -import { gameDefaultsSchema } from "@tarp/core/shared/game-defaults"; -import { waitFor } from "@tarp/module/testing/async"; -import { writeTestFile as writeFile } from "@tarp/module/testing/files"; -import { createTestModule } from "@tarp/module/testing/test-module"; import { PlaytestService, playtestCreateSchema } from "./playtest"; import { startPlaytestMcp } from "./server"; diff --git a/apps/desktop/src/main/mcp/playtest.ts b/apps/desktop/src/main/mcp/playtest.ts index 14f83fd..41af601 100644 --- a/apps/desktop/src/main/mcp/playtest.ts +++ b/apps/desktop/src/main/mcp/playtest.ts @@ -1,28 +1,28 @@ import { join, isAbsolute } from "node:path"; -import type { ChatService } from "@tarp/core/node"; -import { readCharacters } from "@tarp/core/node/sessions/character-db"; -import { gameDocumentViews } from "@tarp/core/node/sessions/game-state"; +import type { ChatService } from "@jointarp/core/node"; +import { readCharacters } from "@jointarp/core/node/sessions/character-db"; +import { gameDocumentViews } from "@jointarp/core/node/sessions/game-state"; import { readLaunchConfig, readLaunchRoom, saveLaunchProgress, saveLaunchRoom, -} from "@tarp/core/node/sessions/launch-db"; -import { patchRoomSettings, readRoomSettings } from "@tarp/core/node/sessions/room-settings"; +} from "@jointarp/core/node/sessions/launch-db"; +import { patchRoomSettings, readRoomSettings } from "@jointarp/core/node/sessions/room-settings"; import { createSession, deleteSession, openSessionDatabase, readRoomState, roomDirectory, -} from "@tarp/core/node/sessions/session-store"; -import { structuredFile } from "@tarp/core/node/storage/structured-file"; -import { chatText } from "@tarp/core/shared/agent-message"; -import { aiConfigSchema, type Player } from "@tarp/core/shared/game"; -import type { GameDefaults } from "@tarp/core/shared/game-defaults"; -import { sameDocumentIdentity } from "@tarp/module/document-path"; -import { emptyFlowRun } from "@tarp/module/flow"; +} from "@jointarp/core/node/sessions/session-store"; +import { structuredFile } from "@jointarp/core/node/storage/structured-file"; +import { chatText } from "@jointarp/core/shared/agent-message"; +import { aiConfigSchema, type Player } from "@jointarp/core/shared/game"; +import type { GameDefaults } from "@jointarp/core/shared/game-defaults"; +import { sameDocumentIdentity } from "@jointarp/module/document-path"; +import { emptyFlowRun } from "@jointarp/module/flow"; import { z } from "zod"; export const playtestCreateSchema = z.strictObject({ diff --git a/apps/desktop/src/main/mcp/server.ts b/apps/desktop/src/main/mcp/server.ts index dc11d6a..5eb1379 100644 --- a/apps/desktop/src/main/mcp/server.ts +++ b/apps/desktop/src/main/mcp/server.ts @@ -3,9 +3,9 @@ import { rm } from "node:fs/promises"; import { createServer } from "node:http"; import { join } from "node:path"; +import { writeFileAtomic } from "@jointarp/core/node/storage/write-file-atomic"; import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js"; -import { writeFileAtomic } from "@tarp/core/node/storage/write-file-atomic"; import { z } from "zod"; import { PlaytestService, playtestCreateSchema } from "./playtest"; diff --git a/apps/desktop/src/main/mcp/service.ts b/apps/desktop/src/main/mcp/service.ts index 74572fc..33cc656 100644 --- a/apps/desktop/src/main/mcp/service.ts +++ b/apps/desktop/src/main/mcp/service.ts @@ -1,8 +1,8 @@ import { randomBytes } from "node:crypto"; import { join } from "node:path"; +import { structuredFile } from "@jointarp/core/node/storage/structured-file"; import type { McpStatus } from "@shared/mcp"; -import { structuredFile } from "@tarp/core/node/storage/structured-file"; import { z } from "zod"; import type { PlaytestService } from "./playtest"; diff --git a/apps/desktop/src/main/media-path.test.ts b/apps/desktop/src/main/media-path.test.ts index df9f7f4..48bf794 100644 --- a/apps/desktop/src/main/media-path.test.ts +++ b/apps/desktop/src/main/media-path.test.ts @@ -4,7 +4,7 @@ import { mkdir, mkdtemp, realpath, rename, rm, symlink } from "node:fs/promises" import { tmpdir } from "node:os"; import { join } from "node:path"; -import { writeTestFile as writeFile } from "@tarp/module/testing/files"; +import { writeTestFile as writeFile } from "@jointarp/module/testing/files"; import { documentMediaUrl } from "../shared/document-media"; import { allowDocumentMediaRoots, resolveMediaRequestFile } from "./media-path"; diff --git a/apps/desktop/src/main/media-path.ts b/apps/desktop/src/main/media-path.ts index 3624bd2..a864160 100644 --- a/apps/desktop/src/main/media-path.ts +++ b/apps/desktop/src/main/media-path.ts @@ -2,7 +2,7 @@ import { realpathSync } from "node:fs"; import { realpath, stat } from "node:fs/promises"; import { dirname, isAbsolute, join, resolve } from "node:path"; -import { isInsideDirectory } from "@tarp/core/node/storage/path"; +import { isInsideDirectory } from "@jointarp/core/node/storage/path"; export const mediaScheme = "tarp"; const imagePattern = /\.(avif|gif|jpe?g|png|svg|webp)$/iu; diff --git a/apps/desktop/src/main/modules/import-local-module.ts b/apps/desktop/src/main/modules/import-local-module.ts index bf80d0b..e36f3b3 100644 --- a/apps/desktop/src/main/modules/import-local-module.ts +++ b/apps/desktop/src/main/modules/import-local-module.ts @@ -1,10 +1,10 @@ import { mkdir, readdir, realpath } from "node:fs/promises"; import { basename, join } from "node:path"; -import { copyModule, directoryExists } from "@tarp/core/node/sessions/module-copy"; -import { configFilePath } from "@tarp/module/node/config-file"; -import { extractModuleZip } from "@tarp/module/node/extract-zip"; -import { loadModuleMetadata } from "@tarp/module/node/module-metadata"; +import { copyModule, directoryExists } from "@jointarp/core/node/sessions/module-copy"; +import { configFilePath } from "@jointarp/module/node/config-file"; +import { extractModuleZip } from "@jointarp/module/node/extract-zip"; +import { loadModuleMetadata } from "@jointarp/module/node/module-metadata"; import { assertNoSymlinks, moduleFolderName, publishModule } from "./module-import"; import { resolveModuleRoot } from "./module-root"; diff --git a/apps/desktop/src/main/modules/list-modules.test.ts b/apps/desktop/src/main/modules/list-modules.test.ts index 2fb16e7..947ab72 100644 --- a/apps/desktop/src/main/modules/list-modules.test.ts +++ b/apps/desktop/src/main/modules/list-modules.test.ts @@ -7,15 +7,15 @@ import { dirname, join } from "node:path"; import { pathToFileURL } from "node:url"; import { promisify } from "node:util"; -import { createSession } from "@tarp/core/node/sessions/session-store"; -import { loadDocumentTypes } from "@tarp/module/node/document-types"; +import { createSession } from "@jointarp/core/node/sessions/session-store"; +import { loadDocumentTypes } from "@jointarp/module/node/document-types"; import { loadModuleDocuments, loadModuleLibraryDocuments, -} from "@tarp/module/node/module-documents"; -import { loadModuleMetadata } from "@tarp/module/node/module-metadata"; -import { loadModulePages } from "@tarp/module/node/module-pages"; -import { writeTestFile as writeFile } from "@tarp/module/testing/files"; +} from "@jointarp/module/node/module-documents"; +import { loadModuleMetadata } from "@jointarp/module/node/module-metadata"; +import { loadModulePages } from "@jointarp/module/node/module-pages"; +import { writeTestFile as writeFile } from "@jointarp/module/testing/files"; import { documentMediaUrl } from "../../shared/document-media"; import { resolveMediaRequestFile } from "../media-path"; diff --git a/apps/desktop/src/main/modules/list-modules.ts b/apps/desktop/src/main/modules/list-modules.ts index 3a1c3ff..b31e0a2 100644 --- a/apps/desktop/src/main/modules/list-modules.ts +++ b/apps/desktop/src/main/modules/list-modules.ts @@ -1,8 +1,8 @@ import { mkdir, readdir, stat } from "node:fs/promises"; import { join } from "node:path"; +import { loadModuleMetadata } from "@jointarp/module/node/module-metadata"; import type { ModuleSummary } from "@shared/desktop-api"; -import { loadModuleMetadata } from "@tarp/module/node/module-metadata"; import { allowDocumentMediaRoots } from "../media-path"; import { resolveModuleRoot } from "./module-root"; diff --git a/apps/desktop/src/main/modules/module-companions.test.ts b/apps/desktop/src/main/modules/module-companions.test.ts index 471d2f5..8af3570 100644 --- a/apps/desktop/src/main/modules/module-companions.test.ts +++ b/apps/desktop/src/main/modules/module-companions.test.ts @@ -2,11 +2,11 @@ import { test } from "bun:test"; import { strict as assert } from "node:assert"; import { randomUUID } from "node:crypto"; -import { ChatService } from "@tarp/core/node/game/chat-service"; -import { advanceLaunch, launchState } from "@tarp/core/node/sessions/launch-store"; -import { createSession } from "@tarp/core/node/sessions/session-store"; -import { loadModuleMetadata } from "@tarp/module/node/module-metadata"; -import { createTestModule } from "@tarp/module/testing/test-module"; +import { ChatService } from "@jointarp/core/node/game/chat-service"; +import { advanceLaunch, launchState } from "@jointarp/core/node/sessions/launch-store"; +import { createSession } from "@jointarp/core/node/sessions/session-store"; +import { loadModuleMetadata } from "@jointarp/module/node/module-metadata"; +import { createTestModule } from "@jointarp/module/testing/test-module"; test("模组预设角色可作为 AI 队友入队,真人角色不可重复占用", async () => { const fixture = await createTestModule(); diff --git a/apps/desktop/src/main/modules/module-import.ts b/apps/desktop/src/main/modules/module-import.ts index 7adaa43..992b076 100644 --- a/apps/desktop/src/main/modules/module-import.ts +++ b/apps/desktop/src/main/modules/module-import.ts @@ -1,9 +1,9 @@ import { lstat, mkdir, mkdtemp, readdir, rename, rm } from "node:fs/promises"; import { join, relative } from "node:path"; -import { isMissingFile, withFileMutation } from "@tarp/core/node/storage/file-queue"; -import { loadDocumentTypes } from "@tarp/module/node/document-types"; -import { loadModuleMetadata } from "@tarp/module/node/module-metadata"; +import { isMissingFile, withFileMutation } from "@jointarp/core/node/storage/file-queue"; +import { loadDocumentTypes } from "@jointarp/module/node/document-types"; +import { loadModuleMetadata } from "@jointarp/module/node/module-metadata"; import { resolveModuleRoot } from "./module-root"; diff --git a/apps/desktop/src/main/modules/module-integration.test.ts b/apps/desktop/src/main/modules/module-integration.test.ts index ba7b655..bf865c6 100644 --- a/apps/desktop/src/main/modules/module-integration.test.ts +++ b/apps/desktop/src/main/modules/module-integration.test.ts @@ -4,22 +4,22 @@ import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; import { join } from "node:path"; -import { createGameTools } from "@tarp/core/node/agent/game-tools"; -import { ChatService } from "@tarp/core/node/game/chat-service"; +import { createGameTools } from "@jointarp/core/node/agent/game-tools"; +import { ChatService } from "@jointarp/core/node/game/chat-service"; import { gameDocumentViews, gameFolderIndex, readGamePath, updateGameDocument, -} from "@tarp/core/node/sessions/game-state"; -import { advanceLaunch, launchState } from "@tarp/core/node/sessions/launch-store"; +} from "@jointarp/core/node/sessions/game-state"; +import { advanceLaunch, launchState } from "@jointarp/core/node/sessions/launch-store"; import { createSession, gameDirectoryForDatabase, openSessionDatabase, roomDirectory, -} from "@tarp/core/node/sessions/session-store"; -import { createTestModule, type TestComputedCharacter } from "@tarp/module/testing/test-module"; +} from "@jointarp/core/node/sessions/session-store"; +import { createTestModule, type TestComputedCharacter } from "@jointarp/module/testing/test-module"; test("模组选角与开场隔离秘密,主持可读取资料,字段揭示与结算持久化且失败不写入", async () => { const f = await createTestModule(); diff --git a/apps/desktop/src/main/modules/module-root.ts b/apps/desktop/src/main/modules/module-root.ts index ec5c95f..4a97e4e 100644 --- a/apps/desktop/src/main/modules/module-root.ts +++ b/apps/desktop/src/main/modules/module-root.ts @@ -1,8 +1,8 @@ import { lstat } from "node:fs/promises"; import { join } from "node:path"; -import { isMissingFile } from "@tarp/core/node/storage/file-queue"; -import { configFilePath } from "@tarp/module/node/config-file"; +import { isMissingFile } from "@jointarp/core/node/storage/file-queue"; +import { configFilePath } from "@jointarp/module/node/config-file"; /** 模组库允许直接内容目录或固定 module/ 外层,根路径本身可以是本地快捷方式。 */ export async function resolveModuleRoot(directory: string): Promise { diff --git a/apps/desktop/src/main/modules/module-router.ts b/apps/desktop/src/main/modules/module-router.ts index ef8c3e0..6fbd5f0 100644 --- a/apps/desktop/src/main/modules/module-router.ts +++ b/apps/desktop/src/main/modules/module-router.ts @@ -1,11 +1,11 @@ import { mkdir } from "node:fs/promises"; +import { loadDocumentTypes } from "@jointarp/module/node/document-types"; +import { loadModuleLibraryDocuments } from "@jointarp/module/node/module-documents"; +import { loadModuleMetadata } from "@jointarp/module/node/module-metadata"; +import { loadModulePages } from "@jointarp/module/node/module-pages"; import { ORPCError } from "@orpc/server"; import type { ModulesDirectory, OpenModuleLibraryResult } from "@shared/desktop-api"; -import { loadDocumentTypes } from "@tarp/module/node/document-types"; -import { loadModuleLibraryDocuments } from "@tarp/module/node/module-documents"; -import { loadModuleMetadata } from "@tarp/module/node/module-metadata"; -import { loadModulePages } from "@tarp/module/node/module-pages"; import { z } from "zod"; import { diff --git a/apps/desktop/src/main/reference-window-state.ts b/apps/desktop/src/main/reference-window-state.ts index edc38fe..71f55ad 100644 --- a/apps/desktop/src/main/reference-window-state.ts +++ b/apps/desktop/src/main/reference-window-state.ts @@ -1,4 +1,4 @@ -import { structuredFile } from "@tarp/core/node/storage/structured-file"; +import { structuredFile } from "@jointarp/core/node/storage/structured-file"; import { z } from "zod"; import type { WindowRectangle } from "./reference-window-bounds"; diff --git a/apps/desktop/src/main/sessions/character-store.test.ts b/apps/desktop/src/main/sessions/character-store.test.ts index b13ccac..0a9a8c3 100644 --- a/apps/desktop/src/main/sessions/character-store.test.ts +++ b/apps/desktop/src/main/sessions/character-store.test.ts @@ -5,17 +5,17 @@ import { access, mkdir, mkdtemp, realpath, rm } from "node:fs/promises"; import { tmpdir } from "node:os"; import { join } from "node:path"; -import { readAdventureState } from "@tarp/core/node/sessions/adventure-state"; -import { readCharacters } from "@tarp/core/node/sessions/character-db"; +import { readAdventureState } from "@jointarp/core/node/sessions/adventure-state"; +import { readCharacters } from "@jointarp/core/node/sessions/character-db"; import { characterSnapshot, characterViews, validateCharacterDraft, withCharacters, -} from "@tarp/core/node/sessions/character-store"; -import { publicGameDocuments } from "@tarp/core/node/sessions/game-state"; -import { createSession } from "@tarp/core/node/sessions/session-store"; -import { writeTestFile as writeFile } from "@tarp/module/testing/files"; +} from "@jointarp/core/node/sessions/character-store"; +import { publicGameDocuments } from "@jointarp/core/node/sessions/game-state"; +import { createSession } from "@jointarp/core/node/sessions/session-store"; +import { writeTestFile as writeFile } from "@jointarp/module/testing/files"; import { documentMediaUrl } from "../../shared/document-media"; import { resolveMediaRequestFile } from "../media-path"; diff --git a/apps/desktop/src/main/sessions/local-room-resources.ts b/apps/desktop/src/main/sessions/local-room-resources.ts index 2c4a4d4..931f513 100644 --- a/apps/desktop/src/main/sessions/local-room-resources.ts +++ b/apps/desktop/src/main/sessions/local-room-resources.ts @@ -1,7 +1,7 @@ import { join } from "node:path"; -import { listSessions, loadSession, loadSessionModuleResources } from "@tarp/core/node"; -import { roomDirectory } from "@tarp/core/node/sessions/session-store"; +import { listSessions, loadSession, loadSessionModuleResources } from "@jointarp/core/node"; +import { roomDirectory } from "@jointarp/core/node/sessions/session-store"; import { allowDocumentMediaRoots } from "../media-path"; diff --git a/apps/desktop/src/main/sessions/local-session-lifecycle.ts b/apps/desktop/src/main/sessions/local-session-lifecycle.ts index b3d12ef..6887537 100644 --- a/apps/desktop/src/main/sessions/local-session-lifecycle.ts +++ b/apps/desktop/src/main/sessions/local-session-lifecycle.ts @@ -1,5 +1,5 @@ -import type { ChatService } from "@tarp/core/node"; -import { deleteSession, setSessionStatus } from "@tarp/core/node/sessions/session-store"; +import type { ChatService } from "@jointarp/core/node"; +import { deleteSession, setSessionStatus } from "@jointarp/core/node/sessions/session-store"; /** 本地冒险状态、运行连接与资料窗口的关闭顺序由宿主统一协调。 */ export class LocalSessionLifecycle { diff --git a/apps/desktop/src/main/sessions/room-notes-router.test.ts b/apps/desktop/src/main/sessions/room-notes-router.test.ts index 5c51bd7..238df16 100644 --- a/apps/desktop/src/main/sessions/room-notes-router.test.ts +++ b/apps/desktop/src/main/sessions/room-notes-router.test.ts @@ -5,8 +5,8 @@ import { mkdir, mkdtemp, rm } from "node:fs/promises"; import { tmpdir } from "node:os"; import { join } from "node:path"; +import { initializeAdventure } from "@jointarp/core/node/sessions/room-storage"; import { call } from "@orpc/server"; -import { initializeAdventure } from "@tarp/core/node/sessions/room-storage"; import { roomNotesRouter } from "./room-notes-router"; diff --git a/apps/desktop/src/main/sessions/room-notes-router.ts b/apps/desktop/src/main/sessions/room-notes-router.ts index 7bb744d..c9fc9ca 100644 --- a/apps/desktop/src/main/sessions/room-notes-router.ts +++ b/apps/desktop/src/main/sessions/room-notes-router.ts @@ -1,6 +1,6 @@ +import { loadRoomNotes, saveRoomNotes } from "@jointarp/core/node/sessions/session-store"; +import { playerSchema, type Player } from "@jointarp/core/shared/game"; import { os, ORPCError } from "@orpc/server"; -import { loadRoomNotes, saveRoomNotes } from "@tarp/core/node/sessions/session-store"; -import { playerSchema, type Player } from "@tarp/core/shared/game"; import { z } from "zod"; interface RoomNotesContext { diff --git a/apps/desktop/src/main/sessions/session-router.ts b/apps/desktop/src/main/sessions/session-router.ts index 99ecf14..465aadd 100644 --- a/apps/desktop/src/main/sessions/session-router.ts +++ b/apps/desktop/src/main/sessions/session-router.ts @@ -1,22 +1,22 @@ -import { ORPCError } from "@orpc/server"; -import { ttsVoiceOverrideSchema } from "@shared/tts"; import { bindModuleSource, checkModuleUpdate, readModuleSource, -} from "@tarp/core/node/sessions/module-sync"; -import { roomDisplaySettings } from "@tarp/core/node/sessions/room-display-settings"; -import { readRoomSettings, patchRoomSettings } from "@tarp/core/node/sessions/room-settings"; -import { roomDirectory, createSession } from "@tarp/core/node/sessions/session-store"; +} from "@jointarp/core/node/sessions/module-sync"; +import { roomDisplaySettings } from "@jointarp/core/node/sessions/room-display-settings"; +import { readRoomSettings, patchRoomSettings } from "@jointarp/core/node/sessions/room-settings"; +import { roomDirectory, createSession } from "@jointarp/core/node/sessions/session-store"; import { compactionRoleSchema, compactionSettingsSchema, -} from "@tarp/core/shared/compaction-settings"; -import { companionInputSchema } from "@tarp/core/shared/companion"; -import { companionInitiativeSchema } from "@tarp/core/shared/companion-initiative"; -import { thinkingLevelSchema } from "@tarp/core/shared/game"; -import { roomConfigurationPatchSchema } from "@tarp/core/shared/game-defaults"; -import { identityIdSchema } from "@tarp/core/shared/identity"; +} from "@jointarp/core/shared/compaction-settings"; +import { companionInputSchema } from "@jointarp/core/shared/companion"; +import { companionInitiativeSchema } from "@jointarp/core/shared/companion-initiative"; +import { thinkingLevelSchema } from "@jointarp/core/shared/game"; +import { roomConfigurationPatchSchema } from "@jointarp/core/shared/game-defaults"; +import { identityIdSchema } from "@jointarp/core/shared/identity"; +import { ORPCError } from "@orpc/server"; +import { ttsVoiceOverrideSchema } from "@shared/tts"; import { z } from "zod"; import { assertAbsolutePath } from "../config/app-config"; diff --git a/apps/desktop/src/main/sessions/session-store.test.ts b/apps/desktop/src/main/sessions/session-store.test.ts index 0dd9f62..5bd8f94 100644 --- a/apps/desktop/src/main/sessions/session-store.test.ts +++ b/apps/desktop/src/main/sessions/session-store.test.ts @@ -20,11 +20,11 @@ import { beginAdventureEdit, commitAdventureEdit, updateAdventureState, -} from "@tarp/core/node/sessions/adventure-state"; -import { updateGameDocument } from "@tarp/core/node/sessions/game-state"; -import { roomDisplaySettings } from "@tarp/core/node/sessions/room-display-settings"; -import { readRoomSettings } from "@tarp/core/node/sessions/room-settings"; -import { readAdventure } from "@tarp/core/node/sessions/room-storage"; +} from "@jointarp/core/node/sessions/adventure-state"; +import { updateGameDocument } from "@jointarp/core/node/sessions/game-state"; +import { roomDisplaySettings } from "@jointarp/core/node/sessions/room-display-settings"; +import { readRoomSettings } from "@jointarp/core/node/sessions/room-settings"; +import { readAdventure } from "@jointarp/core/node/sessions/room-storage"; import { createSession, deleteSession, @@ -33,8 +33,8 @@ import { roomDirectory, saveRoomNotes, setSessionStatus, -} from "@tarp/core/node/sessions/session-store"; -import { writeTestFile as writeFile } from "@tarp/module/testing/files"; +} from "@jointarp/core/node/sessions/session-store"; +import { writeTestFile as writeFile } from "@jointarp/module/testing/files"; import { documentMediaUrl } from "../../shared/document-media"; import { resolveMediaRequestFile } from "../media-path"; diff --git a/apps/desktop/src/main/tts/mimo.ts b/apps/desktop/src/main/tts/mimo.ts index 1d3feac..1fff4d1 100644 --- a/apps/desktop/src/main/tts/mimo.ts +++ b/apps/desktop/src/main/tts/mimo.ts @@ -1,4 +1,4 @@ -import { defaultTtsConfig } from "@tarp/core/shared/voice"; +import { defaultTtsConfig } from "@jointarp/core/shared/voice"; import { TtsError, type TtsRequest, type TtsProvider } from "./provider"; import { readSse } from "./sse"; diff --git a/apps/desktop/src/main/tts/router.ts b/apps/desktop/src/main/tts/router.ts index 1ced188..8d1378c 100644 --- a/apps/desktop/src/main/tts/router.ts +++ b/apps/desktop/src/main/tts/router.ts @@ -1,7 +1,7 @@ +import { identityIdSchema } from "@jointarp/core/shared/identity"; import { eventIterator } from "@orpc/contract"; import { ORPCError } from "@orpc/server"; import { ttsVoiceOverrideSchema, ttsChunkSchema, ttsSynthesizeSchema } from "@shared/tts"; -import { identityIdSchema } from "@tarp/core/shared/identity"; import { z } from "zod"; import { AppConfigError } from "../config/app-config"; diff --git a/apps/desktop/src/main/tts/service.test.ts b/apps/desktop/src/main/tts/service.test.ts index 1b6bfa1..626b9e2 100644 --- a/apps/desktop/src/main/tts/service.test.ts +++ b/apps/desktop/src/main/tts/service.test.ts @@ -4,9 +4,9 @@ import { mkdir, mkdtemp, readFile, rm } from "node:fs/promises"; import { tmpdir } from "node:os"; import { join } from "node:path"; -import { initializeRoomSettings } from "@tarp/core/node/sessions/room-settings"; -import { initializeAdventure, updateAdventure } from "@tarp/core/node/sessions/room-storage"; -import { writeTestFile as writeFile } from "@tarp/module/testing/files"; +import { initializeRoomSettings } from "@jointarp/core/node/sessions/room-settings"; +import { initializeAdventure, updateAdventure } from "@jointarp/core/node/sessions/room-storage"; +import { writeTestFile as writeFile } from "@jointarp/module/testing/files"; import { mimoTtsProvider } from "./mimo"; import type { TtsProvider } from "./provider"; diff --git a/apps/desktop/src/main/tts/service.ts b/apps/desktop/src/main/tts/service.ts index 1d15374..dfa0a6b 100644 --- a/apps/desktop/src/main/tts/service.ts +++ b/apps/desktop/src/main/tts/service.ts @@ -1,11 +1,11 @@ import { createHash } from "node:crypto"; import { join } from "node:path"; -import { readRoomSettings, updateRoomSettings } from "@tarp/core/node/sessions/room-settings"; -import { readAdventure } from "@tarp/core/node/sessions/room-storage"; -import { roomDirectory } from "@tarp/core/node/sessions/session-store"; -import { documentIdentity } from "@tarp/module/document-path"; -import { loadModuleMetadata } from "@tarp/module/node/module-metadata"; +import { readRoomSettings, updateRoomSettings } from "@jointarp/core/node/sessions/room-settings"; +import { readAdventure } from "@jointarp/core/node/sessions/room-storage"; +import { roomDirectory } from "@jointarp/core/node/sessions/session-store"; +import { documentIdentity } from "@jointarp/module/document-path"; +import { loadModuleMetadata } from "@jointarp/module/node/module-metadata"; import { z } from "zod"; import type { ModuleMetadata } from "../../shared/desktop-api"; diff --git a/apps/desktop/src/renderer/src/features/documents/computation/document-worker-protocol.ts b/apps/desktop/src/renderer/src/features/documents/computation/document-worker-protocol.ts index a23a654..079db18 100644 --- a/apps/desktop/src/renderer/src/features/documents/computation/document-worker-protocol.ts +++ b/apps/desktop/src/renderer/src/features/documents/computation/document-worker-protocol.ts @@ -1,5 +1,5 @@ -import type { ParsedModuleDocument } from "@tarp/module/document-evaluator"; -import type { ModuleDocument } from "@tarp/module/module-document"; +import type { ParsedModuleDocument } from "@jointarp/module/document-evaluator"; +import type { ModuleDocument } from "@jointarp/module/module-document"; export type DocumentSnapshotItem = ParsedModuleDocument | ModuleDocument; export type DocumentWorkerCommand = diff --git a/apps/desktop/src/renderer/src/features/documents/computation/document-worker-runtime.ts b/apps/desktop/src/renderer/src/features/documents/computation/document-worker-runtime.ts index fd99935..e5f4cfe 100644 --- a/apps/desktop/src/renderer/src/features/documents/computation/document-worker-runtime.ts +++ b/apps/desktop/src/renderer/src/features/documents/computation/document-worker-runtime.ts @@ -1,4 +1,4 @@ -import { DocumentEvaluator } from "@tarp/module/document-evaluator"; +import { DocumentEvaluator } from "@jointarp/module/document-evaluator"; import type { DocumentWorkerRequest, DocumentWorkerResponse } from "./document-worker-protocol"; import { createSESCompiler } from "./ses-compiler"; diff --git a/apps/desktop/src/renderer/src/features/documents/computation/ses-compiler.ts b/apps/desktop/src/renderer/src/features/documents/computation/ses-compiler.ts index e130530..a784178 100644 --- a/apps/desktop/src/renderer/src/features/documents/computation/ses-compiler.ts +++ b/apps/desktop/src/renderer/src/features/documents/computation/ses-compiler.ts @@ -1,4 +1,4 @@ -import type { DocumentComputationCompiler } from "@tarp/module/document-evaluator"; +import type { DocumentComputationCompiler } from "@jointarp/module/document-evaluator"; import type {} from "ses"; const names = [ diff --git a/apps/desktop/src/renderer/src/features/documents/computation/worker-document-evaluator.test.ts b/apps/desktop/src/renderer/src/features/documents/computation/worker-document-evaluator.test.ts index c215e41..7cb20bc 100644 --- a/apps/desktop/src/renderer/src/features/documents/computation/worker-document-evaluator.test.ts +++ b/apps/desktop/src/renderer/src/features/documents/computation/worker-document-evaluator.test.ts @@ -1,9 +1,9 @@ import { onTestFinished, test } from "bun:test"; import { strict as assert } from "node:assert"; -import { DocumentEvaluator, type ParsedModuleDocument } from "@tarp/module/document-evaluator"; -import { documentIdentity } from "@tarp/module/document-path"; -import { validateDocumentLayout, validateDocumentType } from "@tarp/module/document-type"; +import { DocumentEvaluator, type ParsedModuleDocument } from "@jointarp/module/document-evaluator"; +import { documentIdentity } from "@jointarp/module/document-path"; +import { validateDocumentLayout, validateDocumentType } from "@jointarp/module/document-type"; import { WorkerDocumentEvaluator, type WorkerEvaluatorOptions } from "./worker-document-evaluator"; diff --git a/apps/desktop/src/renderer/src/features/documents/computation/worker-document-evaluator.ts b/apps/desktop/src/renderer/src/features/documents/computation/worker-document-evaluator.ts index ff72f5e..97f7e3e 100644 --- a/apps/desktop/src/renderer/src/features/documents/computation/worker-document-evaluator.ts +++ b/apps/desktop/src/renderer/src/features/documents/computation/worker-document-evaluator.ts @@ -1,6 +1,6 @@ -import type { ParsedModuleDocument } from "@tarp/module/document-evaluator"; -import { documentIdentity } from "@tarp/module/document-path"; -import type { ModuleDocument } from "@tarp/module/module-document"; +import type { ParsedModuleDocument } from "@jointarp/module/document-evaluator"; +import { documentIdentity } from "@jointarp/module/document-path"; +import type { ModuleDocument } from "@jointarp/module/module-document"; import type { DocumentSnapshotItem, diff --git a/apps/desktop/src/renderer/src/features/modules/DefaultDocumentLayout.tsx b/apps/desktop/src/renderer/src/features/modules/DefaultDocumentLayout.tsx index 70ffa35..6d6bd37 100644 --- a/apps/desktop/src/renderer/src/features/modules/DefaultDocumentLayout.tsx +++ b/apps/desktop/src/renderer/src/features/modules/DefaultDocumentLayout.tsx @@ -1,5 +1,5 @@ -import { defaultDocumentFields, type PresetLayout } from "@tarp/module/document-templates"; -import { shouldHideEmptyField } from "@tarp/module/public-document-field"; +import { defaultDocumentFields, type PresetLayout } from "@jointarp/module/document-templates"; +import { shouldHideEmptyField } from "@jointarp/module/public-document-field"; import { Suspense } from "react"; import { DocumentMarkdown, documentMarkdownPlugins } from "./document-markdown"; diff --git a/apps/desktop/src/renderer/src/features/modules/DocumentCard.tsx b/apps/desktop/src/renderer/src/features/modules/DocumentCard.tsx index 5d64ac2..fd7a0b4 100644 --- a/apps/desktop/src/renderer/src/features/modules/DocumentCard.tsx +++ b/apps/desktop/src/renderer/src/features/modules/DocumentCard.tsx @@ -1,6 +1,6 @@ +import type { DocumentType } from "@jointarp/module/document-type"; +import { isDocumentVisible } from "@jointarp/module/module-document"; import type { ModuleDocument } from "@shared/desktop-api"; -import type { DocumentType } from "@tarp/module/document-type"; -import { isDocumentVisible } from "@tarp/module/module-document"; import { cn } from "cn"; import { Check } from "lucide-react"; import { AnimatePresence, motion } from "motion/react"; diff --git a/apps/desktop/src/renderer/src/features/modules/DocumentCardContent.tsx b/apps/desktop/src/renderer/src/features/modules/DocumentCardContent.tsx index de2e5ae..c9c39fb 100644 --- a/apps/desktop/src/renderer/src/features/modules/DocumentCardContent.tsx +++ b/apps/desktop/src/renderer/src/features/modules/DocumentCardContent.tsx @@ -1,6 +1,6 @@ +import { defaultDocumentCard, type DocumentType } from "@jointarp/module/document-type"; +import { isDocumentVisible } from "@jointarp/module/module-document"; import type { ModuleDocument } from "@shared/desktop-api"; -import { defaultDocumentCard, type DocumentType } from "@tarp/module/document-type"; -import { isDocumentVisible } from "@tarp/module/module-document"; import type { SyntheticEvent } from "react"; import { Tooltip } from "../../components/ui/tooltip"; diff --git a/apps/desktop/src/renderer/src/features/modules/DocumentCover.tsx b/apps/desktop/src/renderer/src/features/modules/DocumentCover.tsx index 84bbea4..5058b49 100644 --- a/apps/desktop/src/renderer/src/features/modules/DocumentCover.tsx +++ b/apps/desktop/src/renderer/src/features/modules/DocumentCover.tsx @@ -1,4 +1,4 @@ -import { imageAspectRatio, type ImageAspect } from "@tarp/module/image-aspect"; +import { imageAspectRatio, type ImageAspect } from "@jointarp/module/image-aspect"; import { cn } from "cn"; import { useState } from "react"; diff --git a/apps/desktop/src/renderer/src/features/modules/DocumentDetail.test.tsx b/apps/desktop/src/renderer/src/features/modules/DocumentDetail.test.tsx index ae9c6a6..6a85549 100644 --- a/apps/desktop/src/renderer/src/features/modules/DocumentDetail.test.tsx +++ b/apps/desktop/src/renderer/src/features/modules/DocumentDetail.test.tsx @@ -1,7 +1,7 @@ import { test } from "bun:test"; import { strict as assert } from "node:assert"; -import { validateDocumentLayout, validateDocumentType } from "@tarp/module/document-type"; +import { validateDocumentLayout, validateDocumentType } from "@jointarp/module/document-type"; import type { ReactNode } from "react"; import { renderToReadableStream } from "react-dom/server"; diff --git a/apps/desktop/src/renderer/src/features/modules/DocumentDetail.tsx b/apps/desktop/src/renderer/src/features/modules/DocumentDetail.tsx index a5231f6..094cd1b 100644 --- a/apps/desktop/src/renderer/src/features/modules/DocumentDetail.tsx +++ b/apps/desktop/src/renderer/src/features/modules/DocumentDetail.tsx @@ -1,7 +1,7 @@ +import { documentDetailTemplate } from "@jointarp/module/document-templates"; +import type { DocumentType } from "@jointarp/module/document-type"; +import { isDocumentVisible } from "@jointarp/module/module-document"; import type { ModuleDocument } from "@shared/desktop-api"; -import { documentDetailTemplate } from "@tarp/module/document-templates"; -import type { DocumentType } from "@tarp/module/document-type"; -import { isDocumentVisible } from "@tarp/module/module-document"; import { ScrollAreaPane } from "../../components/ui/scroll-area"; import { RoomDocument } from "../sessions/room-document"; diff --git a/apps/desktop/src/renderer/src/features/modules/DocumentDialog.tsx b/apps/desktop/src/renderer/src/features/modules/DocumentDialog.tsx index 63d4ad1..45ab461 100644 --- a/apps/desktop/src/renderer/src/features/modules/DocumentDialog.tsx +++ b/apps/desktop/src/renderer/src/features/modules/DocumentDialog.tsx @@ -1,6 +1,6 @@ +import type { DocumentType } from "@jointarp/module/document-type"; +import { isDocumentVisible } from "@jointarp/module/module-document"; import type { ModuleDocument } from "@shared/desktop-api"; -import type { DocumentType } from "@tarp/module/document-type"; -import { isDocumentVisible } from "@tarp/module/module-document"; import { useEffect, useRef, type ReactElement, type ReactNode } from "react"; import { preload } from "react-dom"; diff --git a/apps/desktop/src/renderer/src/features/modules/DocumentFieldErrors.tsx b/apps/desktop/src/renderer/src/features/modules/DocumentFieldErrors.tsx index 80abeef..9018c5b 100644 --- a/apps/desktop/src/renderer/src/features/modules/DocumentFieldErrors.tsx +++ b/apps/desktop/src/renderer/src/features/modules/DocumentFieldErrors.tsx @@ -1,5 +1,5 @@ -import type { DocumentType } from "@tarp/module/document-type"; -import { getDocumentField } from "@tarp/module/public-document-field"; +import type { DocumentType } from "@jointarp/module/document-type"; +import { getDocumentField } from "@jointarp/module/public-document-field"; import { FieldCalculationError } from "./FieldCalculationError"; diff --git a/apps/desktop/src/renderer/src/features/modules/DocumentFieldView.tsx b/apps/desktop/src/renderer/src/features/modules/DocumentFieldView.tsx index fcdc7b4..2bf79db 100644 --- a/apps/desktop/src/renderer/src/features/modules/DocumentFieldView.tsx +++ b/apps/desktop/src/renderer/src/features/modules/DocumentFieldView.tsx @@ -1,6 +1,6 @@ -import type { DocumentFieldViewLayout } from "@tarp/module/document-field-view"; -import type { DocumentField } from "@tarp/module/document-type"; -import { fieldErrorAtPath, getDocumentField } from "@tarp/module/public-document-field"; +import type { DocumentFieldViewLayout } from "@jointarp/module/document-field-view"; +import type { DocumentField } from "@jointarp/module/document-type"; +import { fieldErrorAtPath, getDocumentField } from "@jointarp/module/public-document-field"; import { DocumentValue } from "./DocumentValue"; import { EquipmentSlots } from "./EquipmentSlots"; diff --git a/apps/desktop/src/renderer/src/features/modules/DocumentPreview.test.tsx b/apps/desktop/src/renderer/src/features/modules/DocumentPreview.test.tsx index 535953e..a4cb349 100644 --- a/apps/desktop/src/renderer/src/features/modules/DocumentPreview.test.tsx +++ b/apps/desktop/src/renderer/src/features/modules/DocumentPreview.test.tsx @@ -1,11 +1,11 @@ import { test } from "bun:test"; import { strict as assert } from "node:assert"; +import { publicValues } from "@jointarp/module/character"; +import { evaluateComputedFields } from "@jointarp/module/computed-fields"; +import { validateDocumentLayout, validateDocumentType } from "@jointarp/module/document-type"; +import { equipmentSlotsSchema } from "@jointarp/module/equipment-slots"; import type { ModuleDocument } from "@shared/desktop-api"; -import { publicValues } from "@tarp/module/character"; -import { evaluateComputedFields } from "@tarp/module/computed-fields"; -import { validateDocumentLayout, validateDocumentType } from "@tarp/module/document-type"; -import { equipmentSlotsSchema } from "@tarp/module/equipment-slots"; import type { ReactNode } from "react"; import { renderToReadableStream, renderToStaticMarkup } from "react-dom/server"; diff --git a/apps/desktop/src/renderer/src/features/modules/DocumentPreview.tsx b/apps/desktop/src/renderer/src/features/modules/DocumentPreview.tsx index 62740d7..c979c52 100644 --- a/apps/desktop/src/renderer/src/features/modules/DocumentPreview.tsx +++ b/apps/desktop/src/renderer/src/features/modules/DocumentPreview.tsx @@ -1,6 +1,6 @@ +import { defaultDocumentHover, type DocumentType } from "@jointarp/module/document-type"; +import { isDocumentVisible } from "@jointarp/module/module-document"; import type { ModuleDocument } from "@shared/desktop-api"; -import { defaultDocumentHover, type DocumentType } from "@tarp/module/document-type"; -import { isDocumentVisible } from "@tarp/module/module-document"; import type { ReactNode } from "react"; import { RoomDocument } from "../sessions/room-document"; diff --git a/apps/desktop/src/renderer/src/features/modules/DocumentReferences.tsx b/apps/desktop/src/renderer/src/features/modules/DocumentReferences.tsx index 6856c8a..06138b1 100644 --- a/apps/desktop/src/renderer/src/features/modules/DocumentReferences.tsx +++ b/apps/desktop/src/renderer/src/features/modules/DocumentReferences.tsx @@ -1,8 +1,8 @@ import { PreviewCard } from "@base-ui/react/preview-card"; +import { documentIdentity } from "@jointarp/module/document-path"; +import { defaultDocumentHover, type DocumentType } from "@jointarp/module/document-type"; +import { isDocumentVisible } from "@jointarp/module/module-document"; import type { ModuleDocument } from "@shared/desktop-api"; -import { documentIdentity } from "@tarp/module/document-path"; -import { defaultDocumentHover, type DocumentType } from "@tarp/module/document-type"; -import { isDocumentVisible } from "@tarp/module/module-document"; import { createContext, useContext, useMemo, useState, useEffect, type ReactNode } from "react"; import type { Components } from "react-markdown"; diff --git a/apps/desktop/src/renderer/src/features/modules/DocumentRenderer.tsx b/apps/desktop/src/renderer/src/features/modules/DocumentRenderer.tsx index d3a8098..c510e9a 100644 --- a/apps/desktop/src/renderer/src/features/modules/DocumentRenderer.tsx +++ b/apps/desktop/src/renderer/src/features/modules/DocumentRenderer.tsx @@ -1,4 +1,4 @@ -import type { DocumentPresentation } from "@tarp/module/document-templates"; +import type { DocumentPresentation } from "@jointarp/module/document-templates"; import { createElement, useLayoutEffect, useRef } from "react"; import { diff --git a/apps/desktop/src/renderer/src/features/modules/DocumentSheet.tsx b/apps/desktop/src/renderer/src/features/modules/DocumentSheet.tsx index 4b5d873..6cfd3d0 100644 --- a/apps/desktop/src/renderer/src/features/modules/DocumentSheet.tsx +++ b/apps/desktop/src/renderer/src/features/modules/DocumentSheet.tsx @@ -1,5 +1,5 @@ -import { documentIdentity } from "@tarp/module/document-path"; -import { isDocumentVisible } from "@tarp/module/module-document"; +import { documentIdentity } from "@jointarp/module/document-path"; +import { isDocumentVisible } from "@jointarp/module/module-document"; import { useContext } from "react"; import { useDocumentLibrary } from "./document-library-context"; diff --git a/apps/desktop/src/renderer/src/features/modules/DocumentTable.tsx b/apps/desktop/src/renderer/src/features/modules/DocumentTable.tsx index 0a88598..afd2618 100644 --- a/apps/desktop/src/renderer/src/features/modules/DocumentTable.tsx +++ b/apps/desktop/src/renderer/src/features/modules/DocumentTable.tsx @@ -1,14 +1,14 @@ -import type { ModuleDocument } from "@shared/desktop-api"; -import { documentIdentity } from "@tarp/module/document-path"; -import type { DocumentListLayout, DocumentType } from "@tarp/module/document-type"; -import { isDocumentVisible } from "@tarp/module/module-document"; +import { documentIdentity } from "@jointarp/module/document-path"; +import type { DocumentListLayout, DocumentType } from "@jointarp/module/document-type"; +import { isDocumentVisible } from "@jointarp/module/module-document"; import { fieldErrorAtPath, getDocumentField, hasFieldErrors, getPublicDocumentField, shouldHideEmptyField, -} from "@tarp/module/public-document-field"; +} from "@jointarp/module/public-document-field"; +import type { ModuleDocument } from "@shared/desktop-api"; import { RoomDocument } from "../sessions/room-document"; import { useDocumentLibrary } from "./document-library-context"; diff --git a/apps/desktop/src/renderer/src/features/modules/DocumentTypesPage.tsx b/apps/desktop/src/renderer/src/features/modules/DocumentTypesPage.tsx index 132dbb0..ab1fedb 100644 --- a/apps/desktop/src/renderer/src/features/modules/DocumentTypesPage.tsx +++ b/apps/desktop/src/renderer/src/features/modules/DocumentTypesPage.tsx @@ -1,7 +1,7 @@ +import { typeFormatLabel } from "@jointarp/module/document-path"; +import type { DocumentType } from "@jointarp/module/document-type"; import type { ModuleDocument } from "@shared/desktop-api"; import { Link } from "@tanstack/react-router"; -import { typeFormatLabel } from "@tarp/module/document-path"; -import type { DocumentType } from "@tarp/module/document-type"; import { cn } from "cn"; import { FileCode2, FileText, Shapes } from "lucide-react"; diff --git a/apps/desktop/src/renderer/src/features/modules/DocumentValue.test.tsx b/apps/desktop/src/renderer/src/features/modules/DocumentValue.test.tsx index 64409bb..05421c5 100644 --- a/apps/desktop/src/renderer/src/features/modules/DocumentValue.test.tsx +++ b/apps/desktop/src/renderer/src/features/modules/DocumentValue.test.tsx @@ -1,7 +1,7 @@ import { test } from "bun:test"; import { strict as assert } from "node:assert"; -import type { DocumentField } from "@tarp/module/document-type"; +import type { DocumentField } from "@jointarp/module/document-type"; import type { ReactNode } from "react"; import { renderToReadableStream } from "react-dom/server"; diff --git a/apps/desktop/src/renderer/src/features/modules/DocumentValue.tsx b/apps/desktop/src/renderer/src/features/modules/DocumentValue.tsx index 0eb3c13..e526e0b 100644 --- a/apps/desktop/src/renderer/src/features/modules/DocumentValue.tsx +++ b/apps/desktop/src/renderer/src/features/modules/DocumentValue.tsx @@ -1,9 +1,9 @@ -import type { DocumentField, DocumentListItem } from "@tarp/module/document-type"; +import type { DocumentField, DocumentListItem } from "@jointarp/module/document-type"; import { fieldErrorAtPath, hasFieldErrors, shouldHideEmptyField, -} from "@tarp/module/public-document-field"; +} from "@jointarp/module/public-document-field"; import { Suspense } from "react"; import { LoadingIndicator } from "../../components/ui/loading-indicator"; diff --git a/apps/desktop/src/renderer/src/features/modules/EquipmentSlots.test.tsx b/apps/desktop/src/renderer/src/features/modules/EquipmentSlots.test.tsx index 8bfd414..1822db2 100644 --- a/apps/desktop/src/renderer/src/features/modules/EquipmentSlots.test.tsx +++ b/apps/desktop/src/renderer/src/features/modules/EquipmentSlots.test.tsx @@ -1,8 +1,8 @@ import { test } from "bun:test"; import { strict as assert } from "node:assert"; -import { validateDocumentLayout, validateDocumentType } from "@tarp/module/document-type"; -import type { EquipmentSlotsLayout } from "@tarp/module/equipment-slots"; +import { validateDocumentLayout, validateDocumentType } from "@jointarp/module/document-type"; +import type { EquipmentSlotsLayout } from "@jointarp/module/equipment-slots"; import type { ReactNode } from "react"; import { renderToReadableStream } from "react-dom/server"; diff --git a/apps/desktop/src/renderer/src/features/modules/EquipmentSlots.tsx b/apps/desktop/src/renderer/src/features/modules/EquipmentSlots.tsx index 642a17e..4ecbad3 100644 --- a/apps/desktop/src/renderer/src/features/modules/EquipmentSlots.tsx +++ b/apps/desktop/src/renderer/src/features/modules/EquipmentSlots.tsx @@ -1,6 +1,6 @@ +import type { EquipmentSlotsLayout } from "@jointarp/module/equipment-slots"; +import { isDocumentVisible } from "@jointarp/module/module-document"; import type { ModuleDocument } from "@shared/desktop-api"; -import type { EquipmentSlotsLayout } from "@tarp/module/equipment-slots"; -import { isDocumentVisible } from "@tarp/module/module-document"; import { CircleQuestionMark, Crown, Footprints, Gem, Hand, Shield, Shirt } from "lucide-react"; import { RoomDocument } from "../sessions/room-document"; diff --git a/apps/desktop/src/renderer/src/features/modules/FieldTable.tsx b/apps/desktop/src/renderer/src/features/modules/FieldTable.tsx index 3e3b77f..0aa8146 100644 --- a/apps/desktop/src/renderer/src/features/modules/FieldTable.tsx +++ b/apps/desktop/src/renderer/src/features/modules/FieldTable.tsx @@ -1,10 +1,10 @@ -import type { DocumentField } from "@tarp/module/document-type"; -import { validateFieldTableRows, type FieldTableLayout } from "@tarp/module/field-table"; +import type { DocumentField } from "@jointarp/module/document-type"; +import { validateFieldTableRows, type FieldTableLayout } from "@jointarp/module/field-table"; import { fieldErrorAtPath, getPublicDocumentField, shouldHideEmptyField, -} from "@tarp/module/public-document-field"; +} from "@jointarp/module/public-document-field"; import { useState } from "react"; import { Input } from "../../components/ui/input"; diff --git a/apps/desktop/src/renderer/src/features/modules/FlowOutline.tsx b/apps/desktop/src/renderer/src/features/modules/FlowOutline.tsx index d67ec69..8876ce5 100644 --- a/apps/desktop/src/renderer/src/features/modules/FlowOutline.tsx +++ b/apps/desktop/src/renderer/src/features/modules/FlowOutline.tsx @@ -1,6 +1,11 @@ +import { documentIdentity, sameDocumentIdentity } from "@jointarp/module/document-path"; +import { + nodeOptions, + type CreationFlow, + type FlowNode, + type PreludeFlow, +} from "@jointarp/module/flow"; import type { ModuleDocument } from "@shared/desktop-api"; -import { documentIdentity, sameDocumentIdentity } from "@tarp/module/document-path"; -import { nodeOptions, type CreationFlow, type FlowNode, type PreludeFlow } from "@tarp/module/flow"; import { ArrowRight, BookOpen } from "lucide-react"; import { DocumentReference } from "./DocumentReferences"; diff --git a/apps/desktop/src/renderer/src/features/modules/HandlebarsLayout.tsx b/apps/desktop/src/renderer/src/features/modules/HandlebarsLayout.tsx index db9a794..9e36ff4 100644 --- a/apps/desktop/src/renderer/src/features/modules/HandlebarsLayout.tsx +++ b/apps/desktop/src/renderer/src/features/modules/HandlebarsLayout.tsx @@ -1,12 +1,15 @@ -import { publicValues } from "@tarp/module/character"; -import { renderHandlebarsTemplate, type TemplateHtmlNode } from "@tarp/module/handlebars-template"; -import { fieldErrorAtPath, publicFieldErrors } from "@tarp/module/public-document-field"; +import { publicValues } from "@jointarp/module/character"; +import { + renderHandlebarsTemplate, + type TemplateHtmlNode, +} from "@jointarp/module/handlebars-template"; +import { fieldErrorAtPath, publicFieldErrors } from "@jointarp/module/public-document-field"; import { templateComponentSchema, templateComponentNode, validateTemplateComponent, type TemplateLayout, -} from "@tarp/module/template-layout"; +} from "@jointarp/module/template-layout"; import { attributesToProps } from "html-react-parser"; import { createElement, type ReactNode } from "react"; diff --git a/apps/desktop/src/renderer/src/features/modules/LaunchOverviewPage.tsx b/apps/desktop/src/renderer/src/features/modules/LaunchOverviewPage.tsx index ee6e57f..454a3b9 100644 --- a/apps/desktop/src/renderer/src/features/modules/LaunchOverviewPage.tsx +++ b/apps/desktop/src/renderer/src/features/modules/LaunchOverviewPage.tsx @@ -1,8 +1,8 @@ +import type { DocumentType } from "@jointarp/module/document-type"; +import type { GameStart } from "@jointarp/module/flow"; +import { parseNarrative } from "@jointarp/module/narrative"; import type { ModuleDocument, ModuleMetadata } from "@shared/desktop-api"; import { Link } from "@tanstack/react-router"; -import type { DocumentType } from "@tarp/module/document-type"; -import type { GameStart } from "@tarp/module/flow"; -import { parseNarrative } from "@tarp/module/narrative"; import { cn } from "cn"; import { ArrowLeft, UserRound } from "lucide-react"; diff --git a/apps/desktop/src/renderer/src/features/modules/ModuleDocuments.tsx b/apps/desktop/src/renderer/src/features/modules/ModuleDocuments.tsx index b0c0eb2..cb97ec8 100644 --- a/apps/desktop/src/renderer/src/features/modules/ModuleDocuments.tsx +++ b/apps/desktop/src/renderer/src/features/modules/ModuleDocuments.tsx @@ -1,5 +1,5 @@ +import { defaultDocumentList, type DocumentType } from "@jointarp/module/document-type"; import type { ModuleDocument } from "@shared/desktop-api"; -import { defaultDocumentList, type DocumentType } from "@tarp/module/document-type"; import { FileText } from "lucide-react"; import { useEffect } from "react"; diff --git a/apps/desktop/src/renderer/src/features/modules/ModulePage.tsx b/apps/desktop/src/renderer/src/features/modules/ModulePage.tsx index dcff106..e14f02b 100644 --- a/apps/desktop/src/renderer/src/features/modules/ModulePage.tsx +++ b/apps/desktop/src/renderer/src/features/modules/ModulePage.tsx @@ -1,7 +1,7 @@ +import { typeFormatLabel } from "@jointarp/module/document-path"; import { searchItems } from "@shared/query"; import { useQuery } from "@tanstack/react-query"; import { useSearch } from "@tanstack/react-router"; -import { typeFormatLabel } from "@tarp/module/document-path"; import { BookOpenText, FileCode2, FileText, TriangleAlert } from "lucide-react"; import { useEffect, useMemo, useState } from "react"; diff --git a/apps/desktop/src/renderer/src/features/modules/ReferenceCollection.test.tsx b/apps/desktop/src/renderer/src/features/modules/ReferenceCollection.test.tsx index 6db1ed1..cbc566a 100644 --- a/apps/desktop/src/renderer/src/features/modules/ReferenceCollection.test.tsx +++ b/apps/desktop/src/renderer/src/features/modules/ReferenceCollection.test.tsx @@ -1,8 +1,8 @@ import { test, mock } from "bun:test"; import { strict as assert } from "node:assert"; -import { validateDocumentLayout, validateDocumentType } from "@tarp/module/document-type"; -import { referenceCollectionSchema } from "@tarp/module/reference-collection"; +import { validateDocumentLayout, validateDocumentType } from "@jointarp/module/document-type"; +import { referenceCollectionSchema } from "@jointarp/module/reference-collection"; import type { ReactNode } from "react"; import { renderToReadableStream, renderToStaticMarkup } from "react-dom/server"; diff --git a/apps/desktop/src/renderer/src/features/modules/ReferenceCollection.tsx b/apps/desktop/src/renderer/src/features/modules/ReferenceCollection.tsx index 7759b36..119d4a8 100644 --- a/apps/desktop/src/renderer/src/features/modules/ReferenceCollection.tsx +++ b/apps/desktop/src/renderer/src/features/modules/ReferenceCollection.tsx @@ -1,5 +1,5 @@ -import type { DocumentField } from "@tarp/module/document-type"; -import type { ReferenceCollectionLayout } from "@tarp/module/reference-collection"; +import type { DocumentField } from "@jointarp/module/document-type"; +import type { ReferenceCollectionLayout } from "@jointarp/module/reference-collection"; import { LayoutGrid, List, PanelsTopLeft, Search } from "lucide-react"; import { lazy, Suspense, useMemo, useState } from "react"; diff --git a/apps/desktop/src/renderer/src/features/modules/ReferenceSheet.tsx b/apps/desktop/src/renderer/src/features/modules/ReferenceSheet.tsx index 96c0873..869f2b0 100644 --- a/apps/desktop/src/renderer/src/features/modules/ReferenceSheet.tsx +++ b/apps/desktop/src/renderer/src/features/modules/ReferenceSheet.tsx @@ -1,6 +1,6 @@ +import { documentIdentity } from "@jointarp/module/document-path"; +import { isDocumentVisible } from "@jointarp/module/module-document"; import type { ModuleDocument } from "@shared/desktop-api"; -import { documentIdentity } from "@tarp/module/document-path"; -import { isDocumentVisible } from "@tarp/module/module-document"; import { useContext } from "react"; import { Button } from "../../components/ui/button"; diff --git a/apps/desktop/src/renderer/src/features/modules/TemplateComponentView.tsx b/apps/desktop/src/renderer/src/features/modules/TemplateComponentView.tsx index f8fccf7..13a1ad5 100644 --- a/apps/desktop/src/renderer/src/features/modules/TemplateComponentView.tsx +++ b/apps/desktop/src/renderer/src/features/modules/TemplateComponentView.tsx @@ -1,4 +1,4 @@ -import { itemGridConfig, type TemplateComponent } from "@tarp/module/template-layout"; +import { itemGridConfig, type TemplateComponent } from "@jointarp/module/template-layout"; import { Suspense } from "react"; import { DocumentMarkdown, documentMarkdownPlugins } from "./document-markdown"; diff --git a/apps/desktop/src/renderer/src/features/modules/TypeDefinitionPanel.tsx b/apps/desktop/src/renderer/src/features/modules/TypeDefinitionPanel.tsx index e0c6479..d90d5c4 100644 --- a/apps/desktop/src/renderer/src/features/modules/TypeDefinitionPanel.tsx +++ b/apps/desktop/src/renderer/src/features/modules/TypeDefinitionPanel.tsx @@ -1,14 +1,14 @@ -import type { ModuleDocument } from "@shared/desktop-api"; -import { Link } from "@tanstack/react-router"; -import { typeFormatLabel } from "@tarp/module/document-path"; +import { typeFormatLabel } from "@jointarp/module/document-path"; import { defaultDocumentCard, defaultDocumentHover, defaultDocumentReference, type DocumentLayoutSection, type DocumentType, -} from "@tarp/module/document-type"; -import { imageAspectRatio } from "@tarp/module/image-aspect"; +} from "@jointarp/module/document-type"; +import { imageAspectRatio } from "@jointarp/module/image-aspect"; +import type { ModuleDocument } from "@shared/desktop-api"; +import { Link } from "@tanstack/react-router"; import { cn } from "cn"; import { buttonVariants } from "../../components/ui/button"; diff --git a/apps/desktop/src/renderer/src/features/modules/document-preview.ts b/apps/desktop/src/renderer/src/features/modules/document-preview.ts index 529664f..a7b1ccd 100644 --- a/apps/desktop/src/renderer/src/features/modules/document-preview.ts +++ b/apps/desktop/src/renderer/src/features/modules/document-preview.ts @@ -1,14 +1,14 @@ -import type { ModuleDocument } from "@shared/desktop-api"; -import type { DocumentType } from "@tarp/module/document-type"; -import { isDocumentVisible } from "@tarp/module/module-document"; +import type { DocumentType } from "@jointarp/module/document-type"; +import { isDocumentVisible } from "@jointarp/module/module-document"; import { fieldErrorAtPath, getDocumentField, hasFieldErrors, getPublicDocumentField, shouldHideEmptyField, -} from "@tarp/module/public-document-field"; -import { displayFieldDefinition } from "@tarp/module/template-layout"; +} from "@jointarp/module/public-document-field"; +import { displayFieldDefinition } from "@jointarp/module/template-layout"; +import type { ModuleDocument } from "@shared/desktop-api"; import { fromMarkdown } from "mdast-util-from-markdown"; import { gfmFromMarkdown } from "mdast-util-gfm"; import { gfm } from "micromark-extension-gfm"; diff --git a/apps/desktop/src/renderer/src/features/modules/document-renderer-element.tsx b/apps/desktop/src/renderer/src/features/modules/document-renderer-element.tsx index 83bed04..ef39b49 100644 --- a/apps/desktop/src/renderer/src/features/modules/document-renderer-element.tsx +++ b/apps/desktop/src/renderer/src/features/modules/document-renderer-element.tsx @@ -1,4 +1,4 @@ -import type { DocumentPresentation } from "@tarp/module/document-templates"; +import type { DocumentPresentation } from "@jointarp/module/document-templates"; import { createElement } from "react"; import { createRoot, type Root } from "react-dom/client"; diff --git a/apps/desktop/src/renderer/src/features/modules/document-sheet.ts b/apps/desktop/src/renderer/src/features/modules/document-sheet.ts index 36ac7d7..7af4420 100644 --- a/apps/desktop/src/renderer/src/features/modules/document-sheet.ts +++ b/apps/desktop/src/renderer/src/features/modules/document-sheet.ts @@ -1,7 +1,7 @@ -import { documentDetailTemplate } from "@tarp/module/document-templates"; -import type { DocumentPresentation } from "@tarp/module/document-templates"; -import type { DocumentType } from "@tarp/module/document-type"; -import type { ModuleDocument } from "@tarp/module/module-document"; +import { documentDetailTemplate } from "@jointarp/module/document-templates"; +import type { DocumentPresentation } from "@jointarp/module/document-templates"; +import type { DocumentType } from "@jointarp/module/document-type"; +import type { ModuleDocument } from "@jointarp/module/module-document"; export interface DocumentSheetModel { template: DocumentPresentation; diff --git a/apps/desktop/src/renderer/src/features/modules/layout-values.ts b/apps/desktop/src/renderer/src/features/modules/layout-values.ts index 9a03c1f..8636fea 100644 --- a/apps/desktop/src/renderer/src/features/modules/layout-values.ts +++ b/apps/desktop/src/renderer/src/features/modules/layout-values.ts @@ -1,12 +1,12 @@ -import { readDocumentPath } from "@tarp/module/document-field-values"; -import type { DocumentField, DocumentType } from "@tarp/module/document-type"; -import type { ModuleDocument } from "@tarp/module/module-document"; +import { readDocumentPath } from "@jointarp/module/document-field-values"; +import type { DocumentField, DocumentType } from "@jointarp/module/document-type"; +import type { ModuleDocument } from "@jointarp/module/module-document"; import { fieldErrorAtPath, getDocumentField, getPublicDocumentField, -} from "@tarp/module/public-document-field"; -import { displayFieldDefinition } from "@tarp/module/template-layout"; +} from "@jointarp/module/public-document-field"; +import { displayFieldDefinition } from "@jointarp/module/template-layout"; export interface LayoutContext { document: ModuleDocument; diff --git a/apps/desktop/src/renderer/src/features/modules/reference-collection.ts b/apps/desktop/src/renderer/src/features/modules/reference-collection.ts index 648a552..fefee78 100644 --- a/apps/desktop/src/renderer/src/features/modules/reference-collection.ts +++ b/apps/desktop/src/renderer/src/features/modules/reference-collection.ts @@ -1,7 +1,7 @@ -import { documentIdentity } from "@tarp/module/document-path"; -import type { DocumentField } from "@tarp/module/document-type"; -import { shouldHideEmptyField } from "@tarp/module/public-document-field"; -import type { ReferenceCollectionLayout } from "@tarp/module/reference-collection"; +import { documentIdentity } from "@jointarp/module/document-path"; +import type { DocumentField } from "@jointarp/module/document-type"; +import { shouldHideEmptyField } from "@jointarp/module/public-document-field"; +import type { ReferenceCollectionLayout } from "@jointarp/module/reference-collection"; import type { ReferenceDocument } from "./DocumentReferences"; diff --git a/apps/desktop/src/renderer/src/features/modules/room-collection-rows.ts b/apps/desktop/src/renderer/src/features/modules/room-collection-rows.ts index c5629b4..4b701d7 100644 --- a/apps/desktop/src/renderer/src/features/modules/room-collection-rows.ts +++ b/apps/desktop/src/renderer/src/features/modules/room-collection-rows.ts @@ -1,5 +1,5 @@ +import { documentIdentity } from "@jointarp/module/document-path"; import type { ModuleDocument } from "@shared/desktop-api"; -import { documentIdentity } from "@tarp/module/document-path"; import type { ReferenceDocument } from "./DocumentReferences"; import type { ReferenceCollectionRow } from "./reference-collection"; diff --git a/apps/desktop/src/renderer/src/features/sessions/AgentContextDialog.tsx b/apps/desktop/src/renderer/src/features/sessions/AgentContextDialog.tsx index a930b9e..a8cdc13 100644 --- a/apps/desktop/src/renderer/src/features/sessions/AgentContextDialog.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/AgentContextDialog.tsx @@ -1,5 +1,5 @@ +import type { AgentContext } from "@jointarp/core/shared/agent-context"; import { useMutation, useQuery } from "@tanstack/react-query"; -import type { AgentContext } from "@tarp/core/shared/agent-context"; import { Copy, RefreshCw } from "lucide-react"; import { Button } from "../../components/ui/button"; diff --git a/apps/desktop/src/renderer/src/features/sessions/AgentDetails.tsx b/apps/desktop/src/renderer/src/features/sessions/AgentDetails.tsx index 3ab7715..4e9224e 100644 --- a/apps/desktop/src/renderer/src/features/sessions/AgentDetails.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/AgentDetails.tsx @@ -1,5 +1,5 @@ +import type { ChatMessage } from "@jointarp/core/shared/game"; import { useQuery } from "@tanstack/react-query"; -import type { ChatMessage } from "@tarp/core/shared/game"; import { ChevronRight, Brain, Wrench } from "lucide-react"; import { useState } from "react"; diff --git a/apps/desktop/src/renderer/src/features/sessions/CharacterCardDialog.tsx b/apps/desktop/src/renderer/src/features/sessions/CharacterCardDialog.tsx index 214da15..41423cd 100644 --- a/apps/desktop/src/renderer/src/features/sessions/CharacterCardDialog.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/CharacterCardDialog.tsx @@ -1,5 +1,5 @@ -import type { GameSession } from "@tarp/core/shared/session"; -import type { Character } from "@tarp/module/character"; +import type { GameSession } from "@jointarp/core/shared/session"; +import type { Character } from "@jointarp/module/character"; import { useRef } from "react"; import { Dialog, DialogContent, DialogTitle } from "../../components/ui/dialog"; diff --git a/apps/desktop/src/renderer/src/features/sessions/CharacterFields.tsx b/apps/desktop/src/renderer/src/features/sessions/CharacterFields.tsx index 74319b1..0506dcf 100644 --- a/apps/desktop/src/renderer/src/features/sessions/CharacterFields.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/CharacterFields.tsx @@ -1,6 +1,6 @@ +import { documentIdentity } from "@jointarp/module/document-path"; +import type { DocumentField } from "@jointarp/module/document-type"; import type { ModuleDocument } from "@shared/desktop-api"; -import { documentIdentity } from "@tarp/module/document-path"; -import type { DocumentField } from "@tarp/module/document-type"; import { useId } from "react"; import { Button } from "../../components/ui/button"; diff --git a/apps/desktop/src/renderer/src/features/sessions/CharacterPreview.test.tsx b/apps/desktop/src/renderer/src/features/sessions/CharacterPreview.test.tsx index e59187f..62d4946 100644 --- a/apps/desktop/src/renderer/src/features/sessions/CharacterPreview.test.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/CharacterPreview.test.tsx @@ -1,8 +1,8 @@ import { test } from "bun:test"; import { strict as assert } from "node:assert"; -import type { Character } from "@tarp/module/character"; -import { validateDocumentLayout, validateDocumentType } from "@tarp/module/document-type"; +import type { Character } from "@jointarp/module/character"; +import { validateDocumentLayout, validateDocumentType } from "@jointarp/module/document-type"; import type { ReactNode } from "react"; import { renderToReadableStream } from "react-dom/server"; diff --git a/apps/desktop/src/renderer/src/features/sessions/CharacterPreview.tsx b/apps/desktop/src/renderer/src/features/sessions/CharacterPreview.tsx index f34029f..e7fdcea 100644 --- a/apps/desktop/src/renderer/src/features/sessions/CharacterPreview.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/CharacterPreview.tsx @@ -1,5 +1,5 @@ -import type { Character, CharacterDraft } from "@tarp/module/character"; -import type { DocumentType } from "@tarp/module/document-type"; +import type { Character, CharacterDraft } from "@jointarp/module/character"; +import type { DocumentType } from "@jointarp/module/document-type"; import { DocumentDetail } from "../modules/DocumentDetail"; import { DocumentReferences, type ReferenceDocument } from "../modules/DocumentReferences"; diff --git a/apps/desktop/src/renderer/src/features/sessions/CharacterSummary.tsx b/apps/desktop/src/renderer/src/features/sessions/CharacterSummary.tsx index ef5b397..c8c5cd5 100644 --- a/apps/desktop/src/renderer/src/features/sessions/CharacterSummary.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/CharacterSummary.tsx @@ -1,6 +1,6 @@ -import type { GameSession } from "@tarp/core/shared/session"; -import type { Character } from "@tarp/module/character"; -import type { DocumentType } from "@tarp/module/document-type"; +import type { GameSession } from "@jointarp/core/shared/session"; +import type { Character } from "@jointarp/module/character"; +import type { DocumentType } from "@jointarp/module/document-type"; import { DocumentReferences } from "../modules/DocumentReferences"; import { buildCharacterSheet } from "./character-sheet"; diff --git a/apps/desktop/src/renderer/src/features/sessions/ChatMessageEntry.tsx b/apps/desktop/src/renderer/src/features/sessions/ChatMessageEntry.tsx index f14d947..bb42ae6 100644 --- a/apps/desktop/src/renderer/src/features/sessions/ChatMessageEntry.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/ChatMessageEntry.tsx @@ -1,8 +1,8 @@ -import { chatText, visibleAgentMessages } from "@tarp/core/shared/agent-message"; -import { parseCompanionPerformance } from "@tarp/core/shared/companion"; -import type { ChatMessage } from "@tarp/core/shared/game"; -import { parseNarrative, type NarrativeSegment } from "@tarp/core/shared/narrative"; -import { documentIdentity } from "@tarp/module/document-path"; +import { chatText, visibleAgentMessages } from "@jointarp/core/shared/agent-message"; +import { parseCompanionPerformance } from "@jointarp/core/shared/companion"; +import type { ChatMessage } from "@jointarp/core/shared/game"; +import { parseNarrative, type NarrativeSegment } from "@jointarp/core/shared/narrative"; +import { documentIdentity } from "@jointarp/module/document-path"; import { Flag } from "lucide-react"; import { createContext, diff --git a/apps/desktop/src/renderer/src/features/sessions/ChatPanel.tsx b/apps/desktop/src/renderer/src/features/sessions/ChatPanel.tsx index df6481b..02fd647 100644 --- a/apps/desktop/src/renderer/src/features/sessions/ChatPanel.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/ChatPanel.tsx @@ -1,9 +1,9 @@ +import type { ChatMessage } from "@jointarp/core/shared/game"; +import type { GameSession, SessionModule } from "@jointarp/core/shared/session"; +import type { Character } from "@jointarp/module/character"; +import { documentIdentity } from "@jointarp/module/document-path"; import type { SpeechPart } from "@shared/speech-text"; import { useQuery } from "@tanstack/react-query"; -import type { ChatMessage } from "@tarp/core/shared/game"; -import type { GameSession, SessionModule } from "@tarp/core/shared/session"; -import type { Character } from "@tarp/module/character"; -import { documentIdentity } from "@tarp/module/document-path"; import { BookOpen } from "lucide-react"; import { useCallback, diff --git a/apps/desktop/src/renderer/src/features/sessions/CompactionSettings.tsx b/apps/desktop/src/renderer/src/features/sessions/CompactionSettings.tsx index 7ef2f32..58a0bc5 100644 --- a/apps/desktop/src/renderer/src/features/sessions/CompactionSettings.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/CompactionSettings.tsx @@ -1,9 +1,9 @@ -import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; import { compactionSettingsSchema, resolveCompaction, type CompactionRole, -} from "@tarp/core/shared/compaction-settings"; +} from "@jointarp/core/shared/compaction-settings"; +import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; import { useId, useState } from "react"; import { Button } from "../../components/ui/button"; diff --git a/apps/desktop/src/renderer/src/features/sessions/CompanionInitiativeSettings.tsx b/apps/desktop/src/renderer/src/features/sessions/CompanionInitiativeSettings.tsx index dc73742..57ccfe6 100644 --- a/apps/desktop/src/renderer/src/features/sessions/CompanionInitiativeSettings.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/CompanionInitiativeSettings.tsx @@ -1,9 +1,9 @@ -import { useMutation, useQueryClient } from "@tanstack/react-query"; import { companionInitiativeOptions, companionInitiativeSchema, type CompanionInitiative, -} from "@tarp/core/shared/companion-initiative"; +} from "@jointarp/core/shared/companion-initiative"; +import { useMutation, useQueryClient } from "@tanstack/react-query"; import { useId, useState } from "react"; import { Button } from "../../components/ui/button"; diff --git a/apps/desktop/src/renderer/src/features/sessions/CompanionLaunchCard.tsx b/apps/desktop/src/renderer/src/features/sessions/CompanionLaunchCard.tsx index 67ceddb..4a17318 100644 --- a/apps/desktop/src/renderer/src/features/sessions/CompanionLaunchCard.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/CompanionLaunchCard.tsx @@ -1,5 +1,5 @@ +import type { CardData } from "@jointarp/core/shared/game"; import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; -import type { CardData } from "@tarp/core/shared/game"; import { Check, ChevronRight, UserRound, UsersRound } from "lucide-react"; import { useRef } from "react"; diff --git a/apps/desktop/src/renderer/src/features/sessions/CompanionSettingsDialog.tsx b/apps/desktop/src/renderer/src/features/sessions/CompanionSettingsDialog.tsx index fd94122..4c648c0 100644 --- a/apps/desktop/src/renderer/src/features/sessions/CompanionSettingsDialog.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/CompanionSettingsDialog.tsx @@ -1,10 +1,10 @@ -import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; -import type { CompanionModel } from "@tarp/core/shared/companion"; +import type { CompanionModel } from "@jointarp/core/shared/companion"; import { defaultCompanionInitiative, type CompanionInitiative, -} from "@tarp/core/shared/companion-initiative"; -import type { AiConfig } from "@tarp/core/shared/game"; +} from "@jointarp/core/shared/companion-initiative"; +import type { AiConfig } from "@jointarp/core/shared/game"; +import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; import { useState } from "react"; import { Button } from "../../components/ui/button"; diff --git a/apps/desktop/src/renderer/src/features/sessions/CreationWorkbench.tsx b/apps/desktop/src/renderer/src/features/sessions/CreationWorkbench.tsx index b2ebd33..1f14bdb 100644 --- a/apps/desktop/src/renderer/src/features/sessions/CreationWorkbench.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/CreationWorkbench.tsx @@ -1,6 +1,6 @@ -import type { LaunchAction, LaunchState } from "@tarp/core/shared/launch"; -import type { RoomLaunchState } from "@tarp/core/shared/room-state"; -import type { CreationAnswer } from "@tarp/module/creation-workbench"; +import type { LaunchAction, LaunchState } from "@jointarp/core/shared/launch"; +import type { RoomLaunchState } from "@jointarp/core/shared/room-state"; +import type { CreationAnswer } from "@jointarp/module/creation-workbench"; import { Dices, Check } from "lucide-react"; import { lazy, Suspense, useState } from "react"; diff --git a/apps/desktop/src/renderer/src/features/sessions/DiceCard.tsx b/apps/desktop/src/renderer/src/features/sessions/DiceCard.tsx index 662da89..b32ca9c 100644 --- a/apps/desktop/src/renderer/src/features/sessions/DiceCard.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/DiceCard.tsx @@ -1,5 +1,5 @@ -import { parseDice } from "@tarp/core/shared/dice"; -import type { ChatMessage, Player } from "@tarp/core/shared/game"; +import { parseDice } from "@jointarp/core/shared/dice"; +import type { ChatMessage, Player } from "@jointarp/core/shared/game"; import { Dices } from "lucide-react"; import { AnimatePresence, motion, useReducedMotion } from "motion/react"; import { memo, useCallback, useEffect, useLayoutEffect, useRef, useState } from "react"; diff --git a/apps/desktop/src/renderer/src/features/sessions/GameParty.tsx b/apps/desktop/src/renderer/src/features/sessions/GameParty.tsx index 1cde0ae..eaba540 100644 --- a/apps/desktop/src/renderer/src/features/sessions/GameParty.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/GameParty.tsx @@ -1,6 +1,6 @@ -import type { Player } from "@tarp/core/shared/game"; -import type { GameSession } from "@tarp/core/shared/session"; -import type { Character } from "@tarp/module/character"; +import type { Player } from "@jointarp/core/shared/game"; +import type { GameSession } from "@jointarp/core/shared/session"; +import type { Character } from "@jointarp/module/character"; import { UserRound } from "lucide-react"; import { useState } from "react"; diff --git a/apps/desktop/src/renderer/src/features/sessions/HistoryAdventureList.tsx b/apps/desktop/src/renderer/src/features/sessions/HistoryAdventureList.tsx index 3ca7812..39fd015 100644 --- a/apps/desktop/src/renderer/src/features/sessions/HistoryAdventureList.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/HistoryAdventureList.tsx @@ -1,6 +1,6 @@ +import type { GameRoom, GameRoomSummary } from "@jointarp/core/shared/session"; import { documentMediaUrl } from "@shared/document-media"; import { Link } from "@tanstack/react-router"; -import type { GameRoom, GameRoomSummary } from "@tarp/core/shared/session"; import { History } from "lucide-react"; import { Button, buttonVariants } from "../../components/ui/button"; diff --git a/apps/desktop/src/renderer/src/features/sessions/LaunchCard.tsx b/apps/desktop/src/renderer/src/features/sessions/LaunchCard.tsx index 3180d31..109bf47 100644 --- a/apps/desktop/src/renderer/src/features/sessions/LaunchCard.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/LaunchCard.tsx @@ -1,5 +1,5 @@ -import type { ChatMessage } from "@tarp/core/shared/game"; -import type { Character } from "@tarp/module/character"; +import type { ChatMessage } from "@jointarp/core/shared/game"; +import type { Character } from "@jointarp/module/character"; import { Check, ContactRound, X } from "lucide-react"; import { AnimatePresence, motion, useReducedMotion } from "motion/react"; import { memo, useLayoutEffect, useRef, useState, type ReactNode } from "react"; diff --git a/apps/desktop/src/renderer/src/features/sessions/LaunchFlow.tsx b/apps/desktop/src/renderer/src/features/sessions/LaunchFlow.tsx index a1d440c..24f67cd 100644 --- a/apps/desktop/src/renderer/src/features/sessions/LaunchFlow.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/LaunchFlow.tsx @@ -1,5 +1,5 @@ -import type { LaunchAction, LaunchState } from "@tarp/core/shared/launch"; -import type { RoomLaunchState } from "@tarp/core/shared/room-state"; +import type { LaunchAction, LaunchState } from "@jointarp/core/shared/launch"; +import type { RoomLaunchState } from "@jointarp/core/shared/room-state"; import { ArrowLeft, ChevronLeft, ChevronRight, Plus, UserRound } from "lucide-react"; import { AnimatePresence, motion, type Variants } from "motion/react"; import { useEffect, useId, useRef, useState } from "react"; diff --git a/apps/desktop/src/renderer/src/features/sessions/ReadyLobby.tsx b/apps/desktop/src/renderer/src/features/sessions/ReadyLobby.tsx index 62f4f48..013610d 100644 --- a/apps/desktop/src/renderer/src/features/sessions/ReadyLobby.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/ReadyLobby.tsx @@ -1,5 +1,5 @@ -import type { ChatMessage } from "@tarp/core/shared/game"; -import type { SessionModule } from "@tarp/core/shared/session"; +import type { ChatMessage } from "@jointarp/core/shared/game"; +import type { SessionModule } from "@jointarp/core/shared/session"; import { ArrowRight, Check } from "lucide-react"; import { useState } from "react"; diff --git a/apps/desktop/src/renderer/src/features/sessions/RoomCompanionSettings.tsx b/apps/desktop/src/renderer/src/features/sessions/RoomCompanionSettings.tsx index d39e493..857dc58 100644 --- a/apps/desktop/src/renderer/src/features/sessions/RoomCompanionSettings.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/RoomCompanionSettings.tsx @@ -1,6 +1,6 @@ +import type { CompanionModel } from "@jointarp/core/shared/companion"; +import type { CompanionInitiative } from "@jointarp/core/shared/companion-initiative"; import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; -import type { CompanionModel } from "@tarp/core/shared/companion"; -import type { CompanionInitiative } from "@tarp/core/shared/companion-initiative"; import { Plus, Settings, UserRound, X } from "lucide-react"; import { useState, type ReactNode } from "react"; diff --git a/apps/desktop/src/renderer/src/features/sessions/RoomConfigurationSettings.tsx b/apps/desktop/src/renderer/src/features/sessions/RoomConfigurationSettings.tsx index 37abd49..52bb1a5 100644 --- a/apps/desktop/src/renderer/src/features/sessions/RoomConfigurationSettings.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/RoomConfigurationSettings.tsx @@ -1,5 +1,5 @@ +import { roomConfiguration } from "@jointarp/core/shared/game-defaults"; import { useQuery, useQueryClient } from "@tanstack/react-query"; -import { roomConfiguration } from "@tarp/core/shared/game-defaults"; import { Button } from "../../components/ui/button"; import { desktopOrpc, desktopRpc } from "../../desktop-rpc"; diff --git a/apps/desktop/src/renderer/src/features/sessions/RoomList.tsx b/apps/desktop/src/renderer/src/features/sessions/RoomList.tsx index 616ff6f..8836274 100644 --- a/apps/desktop/src/renderer/src/features/sessions/RoomList.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/RoomList.tsx @@ -1,6 +1,6 @@ +import type { GameRoomSummary } from "@jointarp/core/shared/session"; import { documentMediaUrl } from "@shared/document-media"; import { Link } from "@tanstack/react-router"; -import type { GameRoomSummary } from "@tarp/core/shared/session"; import { cn } from "cn"; import { ArrowRight } from "lucide-react"; import { useState } from "react"; diff --git a/apps/desktop/src/renderer/src/features/sessions/RoomMentionSettings.tsx b/apps/desktop/src/renderer/src/features/sessions/RoomMentionSettings.tsx index a6616d7..a0fe8fd 100644 --- a/apps/desktop/src/renderer/src/features/sessions/RoomMentionSettings.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/RoomMentionSettings.tsx @@ -1,5 +1,5 @@ +import { mentionReplyLimitSchema } from "@jointarp/core/shared/mentions"; import { useQuery, useQueryClient } from "@tanstack/react-query"; -import { mentionReplyLimitSchema } from "@tarp/core/shared/mentions"; import { Button } from "../../components/ui/button"; import { desktopOrpc, desktopRpc } from "../../desktop-rpc"; diff --git a/apps/desktop/src/renderer/src/features/sessions/RoomModelSettings.tsx b/apps/desktop/src/renderer/src/features/sessions/RoomModelSettings.tsx index 8e2e6d8..1b8ca30 100644 --- a/apps/desktop/src/renderer/src/features/sessions/RoomModelSettings.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/RoomModelSettings.tsx @@ -1,6 +1,6 @@ +import type { AiConfig } from "@jointarp/core/shared/game"; +import type { RoomAiSettings } from "@jointarp/core/shared/game"; import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; -import type { AiConfig } from "@tarp/core/shared/game"; -import type { RoomAiSettings } from "@tarp/core/shared/game"; import { useState } from "react"; import { Button } from "../../components/ui/button"; diff --git a/apps/desktop/src/renderer/src/features/sessions/RoomModule.test.tsx b/apps/desktop/src/renderer/src/features/sessions/RoomModule.test.tsx index 7309ee1..6665147 100644 --- a/apps/desktop/src/renderer/src/features/sessions/RoomModule.test.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/RoomModule.test.tsx @@ -1,7 +1,7 @@ import { test, mock } from "bun:test"; import { strict as assert } from "node:assert"; -import type { GameSession } from "@tarp/core/shared/session"; +import type { GameSession } from "@jointarp/core/shared/session"; import type { ReactNode } from "react"; import { renderToReadableStream } from "react-dom/server"; diff --git a/apps/desktop/src/renderer/src/features/sessions/RoomModule.tsx b/apps/desktop/src/renderer/src/features/sessions/RoomModule.tsx index 3ecbe83..9f660cc 100644 --- a/apps/desktop/src/renderer/src/features/sessions/RoomModule.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/RoomModule.tsx @@ -1,7 +1,7 @@ +import type { GameSession } from "@jointarp/core/shared/session"; +import { documentIdentity, typeFormatLabel } from "@jointarp/module/document-path"; import type { ModuleDocument } from "@shared/desktop-api"; import { searchItems } from "@shared/query"; -import type { GameSession } from "@tarp/core/shared/session"; -import { documentIdentity, typeFormatLabel } from "@tarp/module/document-path"; import { BookOpenText, FileCode2, FileText, Library } from "lucide-react"; import { useEffect, useMemo, useState, type ReactNode } from "react"; diff --git a/apps/desktop/src/renderer/src/features/sessions/SessionStatus.tsx b/apps/desktop/src/renderer/src/features/sessions/SessionStatus.tsx index f31123a..5954fd2 100644 --- a/apps/desktop/src/renderer/src/features/sessions/SessionStatus.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/SessionStatus.tsx @@ -1,5 +1,5 @@ +import type { SessionActorMetrics, SessionMetrics } from "@jointarp/core/shared/session-metrics"; import { useMutation } from "@tanstack/react-query"; -import type { SessionActorMetrics, SessionMetrics } from "@tarp/core/shared/session-metrics"; import { Activity, Bot, diff --git a/apps/desktop/src/renderer/src/features/sessions/WorldStateCard.tsx b/apps/desktop/src/renderer/src/features/sessions/WorldStateCard.tsx index 653c89a..2844807 100644 --- a/apps/desktop/src/renderer/src/features/sessions/WorldStateCard.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/WorldStateCard.tsx @@ -1,7 +1,7 @@ -import type { GameSession } from "@tarp/core/shared/session"; -import type { DocumentType } from "@tarp/module/document-type"; -import type { ModuleDocument } from "@tarp/module/module-document"; -import { isDocumentVisible } from "@tarp/module/module-document"; +import type { GameSession } from "@jointarp/core/shared/session"; +import type { DocumentType } from "@jointarp/module/document-type"; +import type { ModuleDocument } from "@jointarp/module/module-document"; +import { isDocumentVisible } from "@jointarp/module/module-document"; import { ChevronDown } from "lucide-react"; import { useState } from "react"; diff --git a/apps/desktop/src/renderer/src/features/sessions/adventure-actions.tsx b/apps/desktop/src/renderer/src/features/sessions/adventure-actions.tsx index 2c2564d..2562f92 100644 --- a/apps/desktop/src/renderer/src/features/sessions/adventure-actions.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/adventure-actions.tsx @@ -1,5 +1,5 @@ import { Menu } from "@base-ui/react/menu"; -import type { GameRoom } from "@tarp/core/shared/session"; +import type { GameRoom } from "@jointarp/core/shared/session"; import { Archive, MoreHorizontal, RotateCcw, Trash2 } from "lucide-react"; import { useState } from "react"; diff --git a/apps/desktop/src/renderer/src/features/sessions/character-sheet.test.tsx b/apps/desktop/src/renderer/src/features/sessions/character-sheet.test.tsx index dc2cd3f..39cf773 100644 --- a/apps/desktop/src/renderer/src/features/sessions/character-sheet.test.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/character-sheet.test.tsx @@ -1,7 +1,7 @@ import { test, mock } from "bun:test"; import { strict as assert } from "node:assert"; -import { validateDocumentLayout, validateDocumentType } from "@tarp/module/document-type"; +import { validateDocumentLayout, validateDocumentType } from "@jointarp/module/document-type"; import type { ReactNode } from "react"; import { renderToReadableStream } from "react-dom/server"; diff --git a/apps/desktop/src/renderer/src/features/sessions/character-sheet.ts b/apps/desktop/src/renderer/src/features/sessions/character-sheet.ts index 3755912..9e028ca 100644 --- a/apps/desktop/src/renderer/src/features/sessions/character-sheet.ts +++ b/apps/desktop/src/renderer/src/features/sessions/character-sheet.ts @@ -1,5 +1,5 @@ -import type { DocumentType } from "@tarp/module/document-type"; -import type { ModuleDocument } from "@tarp/module/module-document"; +import type { DocumentType } from "@jointarp/module/document-type"; +import type { ModuleDocument } from "@jointarp/module/module-document"; import { buildDocumentSheet, type DocumentSheetModel } from "../modules/document-sheet"; diff --git a/apps/desktop/src/renderer/src/features/sessions/chat-markdown.test.tsx b/apps/desktop/src/renderer/src/features/sessions/chat-markdown.test.tsx index 409643b..09d4c92 100644 --- a/apps/desktop/src/renderer/src/features/sessions/chat-markdown.test.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/chat-markdown.test.tsx @@ -4,7 +4,7 @@ import { mkdir, mkdtemp, realpath, rm } from "node:fs/promises"; import { tmpdir } from "node:os"; import { join } from "node:path"; -import { writeTestFile as writeFile } from "@tarp/module/testing/files"; +import { writeTestFile as writeFile } from "@jointarp/module/testing/files"; import { renderToStaticMarkup } from "react-dom/server"; import Markdown from "react-markdown"; diff --git a/apps/desktop/src/renderer/src/features/sessions/chat-timeline.test.ts b/apps/desktop/src/renderer/src/features/sessions/chat-timeline.test.ts index 2d852a2..80028ce 100644 --- a/apps/desktop/src/renderer/src/features/sessions/chat-timeline.test.ts +++ b/apps/desktop/src/renderer/src/features/sessions/chat-timeline.test.ts @@ -2,13 +2,13 @@ import { test, mock } from "bun:test"; import { strict as assert } from "node:assert"; import type { AssistantMessage } from "@earendil-works/pi-ai"; -import type { ChatMessage } from "@tarp/core/shared/game"; +import type { ChatMessage } from "@jointarp/core/shared/game"; import { advanceTimersByTime, getTimerCount, useFakeTimers, useRealTimers, -} from "@tarp/module/testing/async"; +} from "@jointarp/module/testing/async"; import { createElement } from "react"; import { renderToStaticMarkup } from "react-dom/server"; diff --git a/apps/desktop/src/renderer/src/features/sessions/chat-timeline.ts b/apps/desktop/src/renderer/src/features/sessions/chat-timeline.ts index cec3b07..771bbe9 100644 --- a/apps/desktop/src/renderer/src/features/sessions/chat-timeline.ts +++ b/apps/desktop/src/renderer/src/features/sessions/chat-timeline.ts @@ -1,4 +1,4 @@ -import type { ChatMessage } from "@tarp/core/shared/game"; +import type { ChatMessage } from "@jointarp/core/shared/game"; import { diceTimeline } from "./dice-timeline"; diff --git a/apps/desktop/src/renderer/src/features/sessions/dice-timeline.ts b/apps/desktop/src/renderer/src/features/sessions/dice-timeline.ts index fbd683a..439f418 100644 --- a/apps/desktop/src/renderer/src/features/sessions/dice-timeline.ts +++ b/apps/desktop/src/renderer/src/features/sessions/dice-timeline.ts @@ -1,4 +1,4 @@ -import type { ChatMessage } from "@tarp/core/shared/game"; +import type { ChatMessage } from "@jointarp/core/shared/game"; /** 同一 AI 回合可能先提出检定,掷骰后再继续;按调用位置展开公开正文。 */ export function diceTimeline(messages: ChatMessage[]): { key: string; message: ChatMessage }[] { diff --git a/apps/desktop/src/renderer/src/features/sessions/game-client.test.ts b/apps/desktop/src/renderer/src/features/sessions/game-client.test.ts index bab2bc8..e658738 100644 --- a/apps/desktop/src/renderer/src/features/sessions/game-client.test.ts +++ b/apps/desktop/src/renderer/src/features/sessions/game-client.test.ts @@ -1,7 +1,7 @@ import { test } from "bun:test"; import { strict as assert } from "node:assert"; -import type { SteeringSnapshot } from "@tarp/core/shared/game"; +import type { SteeringSnapshot } from "@jointarp/core/shared/game"; import { errorMessage, type GameClient } from "./game-client"; import { RoomChatStore } from "./room-chat-store"; diff --git a/apps/desktop/src/renderer/src/features/sessions/game-client.ts b/apps/desktop/src/renderer/src/features/sessions/game-client.ts index b99106d..e694d98 100644 --- a/apps/desktop/src/renderer/src/features/sessions/game-client.ts +++ b/apps/desktop/src/renderer/src/features/sessions/game-client.ts @@ -1,5 +1,5 @@ +import type { gameContract, ChatMessage } from "@jointarp/core/shared/game"; import type { ContractRouterClient } from "@orpc/contract"; -import type { gameContract, ChatMessage } from "@tarp/core/shared/game"; export type GameClient = ContractRouterClient; diff --git a/apps/desktop/src/renderer/src/features/sessions/history-adventures.test.tsx b/apps/desktop/src/renderer/src/features/sessions/history-adventures.test.tsx index 03a82ab..8e5696a 100644 --- a/apps/desktop/src/renderer/src/features/sessions/history-adventures.test.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/history-adventures.test.tsx @@ -1,6 +1,7 @@ import { test, mock } from "bun:test"; import { strict as assert } from "node:assert"; +import type { GameRoomSummary } from "@jointarp/core/shared/session"; import { createMemoryHistory, createRootRoute, @@ -9,7 +10,6 @@ import { Outlet, RouterProvider, } from "@tanstack/react-router"; -import type { GameRoomSummary } from "@tarp/core/shared/session"; import type { ComponentProps, ReactNode } from "react"; import { renderToReadableStream } from "react-dom/server"; diff --git a/apps/desktop/src/renderer/src/features/sessions/history-adventures.ts b/apps/desktop/src/renderer/src/features/sessions/history-adventures.ts index 142d620..09524f1 100644 --- a/apps/desktop/src/renderer/src/features/sessions/history-adventures.ts +++ b/apps/desktop/src/renderer/src/features/sessions/history-adventures.ts @@ -1,4 +1,4 @@ -import type { GameRoom } from "@tarp/core/shared/session"; +import type { GameRoom } from "@jointarp/core/shared/session"; const endedDate = new Intl.DateTimeFormat("zh-CN", { year: "numeric", diff --git a/apps/desktop/src/renderer/src/features/sessions/mention.test.ts b/apps/desktop/src/renderer/src/features/sessions/mention.test.ts index 877e603..1f96a80 100644 --- a/apps/desktop/src/renderer/src/features/sessions/mention.test.ts +++ b/apps/desktop/src/renderer/src/features/sessions/mention.test.ts @@ -1,7 +1,7 @@ import { test } from "bun:test"; import { strict as assert } from "node:assert"; -import { parseMentionRefs, resolveMentionRefs } from "@tarp/core/shared/mentions"; +import { parseMentionRefs, resolveMentionRefs } from "@jointarp/core/shared/mentions"; import { mentionDraftSchema, diff --git a/apps/desktop/src/renderer/src/features/sessions/mention.ts b/apps/desktop/src/renderer/src/features/sessions/mention.ts index 8d5f867..ebcb4cf 100644 --- a/apps/desktop/src/renderer/src/features/sessions/mention.ts +++ b/apps/desktop/src/renderer/src/features/sessions/mention.ts @@ -1,4 +1,4 @@ -import { identityIdSchema } from "@tarp/core/shared/identity"; +import { identityIdSchema } from "@jointarp/core/shared/identity"; import { z } from "zod"; /** 仅编辑器内部使用的文字和原子标签,不进入房间消息协议。 */ diff --git a/apps/desktop/src/renderer/src/features/sessions/npc-portrait-documents.ts b/apps/desktop/src/renderer/src/features/sessions/npc-portrait-documents.ts index 981fed6..1e71b4d 100644 --- a/apps/desktop/src/renderer/src/features/sessions/npc-portrait-documents.ts +++ b/apps/desktop/src/renderer/src/features/sessions/npc-portrait-documents.ts @@ -1,8 +1,8 @@ +import { visibleAgentMessages, publicAssistantText } from "@jointarp/core/shared/agent-message"; +import type { ChatMessage } from "@jointarp/core/shared/game"; +import { parseNarrative } from "@jointarp/core/shared/narrative"; +import { documentIdentity } from "@jointarp/module/document-path"; import type { ModuleDocument } from "@shared/desktop-api"; -import { visibleAgentMessages, publicAssistantText } from "@tarp/core/shared/agent-message"; -import type { ChatMessage } from "@tarp/core/shared/game"; -import { parseNarrative } from "@tarp/core/shared/narrative"; -import { documentIdentity } from "@tarp/module/document-path"; /** 只选取实际发言的文档,图片和名称仍须读取玩家可见投影。 */ export function npcPortraitDocuments( diff --git a/apps/desktop/src/renderer/src/features/sessions/npc-portrait.test.ts b/apps/desktop/src/renderer/src/features/sessions/npc-portrait.test.ts index 76db3c4..e9766e6 100644 --- a/apps/desktop/src/renderer/src/features/sessions/npc-portrait.test.ts +++ b/apps/desktop/src/renderer/src/features/sessions/npc-portrait.test.ts @@ -1,8 +1,8 @@ import { test } from "bun:test"; import { strict as assert } from "node:assert"; +import type { ChatMessage } from "@jointarp/core/shared/game"; import type { ModuleDocument } from "@shared/desktop-api"; -import type { ChatMessage } from "@tarp/core/shared/game"; import { createNpcPortraitResolver } from "./npc-portrait"; import { npcPortraitDocuments } from "./npc-portrait-documents"; diff --git a/apps/desktop/src/renderer/src/features/sessions/npc-portrait.ts b/apps/desktop/src/renderer/src/features/sessions/npc-portrait.ts index bed64de..177408b 100644 --- a/apps/desktop/src/renderer/src/features/sessions/npc-portrait.ts +++ b/apps/desktop/src/renderer/src/features/sessions/npc-portrait.ts @@ -1,5 +1,5 @@ +import { documentIdentity } from "@jointarp/module/document-path"; import type { ModuleDocument } from "@shared/desktop-api"; -import { documentIdentity } from "@tarp/module/document-path"; export type NpcPortraitResolver = (path: string) => ModuleDocument | undefined; diff --git a/apps/desktop/src/renderer/src/features/sessions/room-chat-store.ts b/apps/desktop/src/renderer/src/features/sessions/room-chat-store.ts index df7b79f..ce7b3c7 100644 --- a/apps/desktop/src/renderer/src/features/sessions/room-chat-store.ts +++ b/apps/desktop/src/renderer/src/features/sessions/room-chat-store.ts @@ -1,10 +1,10 @@ -import { applyChatEvent } from "@tarp/core/shared/agent-message"; +import { applyChatEvent } from "@jointarp/core/shared/agent-message"; import type { ChatEvent, ChatMessage, SubmissionModeSnapshot, SteeringSnapshot, -} from "@tarp/core/shared/game"; +} from "@jointarp/core/shared/game"; import { mergeMessages, type GameClient } from "./game-client"; diff --git a/apps/desktop/src/renderer/src/features/sessions/room-connection.test.ts b/apps/desktop/src/renderer/src/features/sessions/room-connection.test.ts index 833dd50..1cfcf27 100644 --- a/apps/desktop/src/renderer/src/features/sessions/room-connection.test.ts +++ b/apps/desktop/src/renderer/src/features/sessions/room-connection.test.ts @@ -2,13 +2,13 @@ import { test } from "bun:test"; import { strict as assert } from "node:assert"; import { randomUUID } from "node:crypto"; -import type { ChatMessage, RoomNotification } from "@tarp/core/shared/game"; +import type { ChatMessage, RoomNotification } from "@jointarp/core/shared/game"; import { createRoomReplica, createRoomBaseline, createRoomEncoder, -} from "@tarp/core/testing/room-replica"; -import { advanceTimersByTime, useFakeTimers, useRealTimers } from "@tarp/module/testing/async"; +} from "@jointarp/core/testing/room-replica"; +import { advanceTimersByTime, useFakeTimers, useRealTimers } from "@jointarp/module/testing/async"; import type { GameClient } from "./game-client"; import { RoomConnection, type LocalRoomModuleLoader } from "./room-connection"; @@ -371,7 +371,7 @@ test("取消单个读取者不影响其他面板,旧版结果自动重读", as revision = version; }, evaluateDocument: async ( - item: import("@tarp/module/document-evaluator").ParsedModuleDocument, + item: import("@jointarp/module/document-evaluator").ParsedModuleDocument, ) => item.document, readDocument: async () => { if (revision === initialRevision) return first; @@ -415,7 +415,7 @@ test("取消单个读取者不影响其他面板,旧版结果自动重读", as test("草稿同版读取共享,单方取消不影响图片及计算,旧版本结果被丢弃", async () => { const f = fixture(); - const { validateDocumentType } = await import("@tarp/module/document-type"); + const { validateDocumentType } = await import("@jointarp/module/document-type"); const type = validateDocumentType("角色", { fields: { strength: { type: "number" } } }); const resources = await f.localModule.resources(); const localModule: LocalRoomModuleLoader = { @@ -427,14 +427,14 @@ test("草稿同版读取共享,单方取消不影响图片及计算,旧版 const first = new Promise((done) => { resolve = done; }); - const engine = new (await import("@tarp/module/document-evaluator")).DocumentEvaluator(); + const engine = new (await import("@jointarp/module/document-evaluator")).DocumentEvaluator(); const evaluator = { setSnapshot: engine.setSnapshot.bind(engine), updateSnapshot: engine.updateSnapshot.bind(engine), readDocument: engine.readDocument.bind(engine), readDocumentName: engine.readDocumentName.bind(engine), evaluateDocument: async ( - item: import("@tarp/module/document-evaluator").ParsedModuleDocument, + item: import("@jointarp/module/document-evaluator").ParsedModuleDocument, ) => { reads++; if (reads === 1) return first; @@ -448,7 +448,7 @@ test("草稿同版读取共享,单方取消不影响图片及计算,旧版 () => evaluator, ); const release = connection.retain(); - const draft: import("@tarp/module/character").Character = { + const draft: import("@jointarp/module/character").Character = { id: "draft", typeId: type.id, name: "草稿", @@ -499,7 +499,7 @@ test("NPC名称候选共享版本缓存与取消读取,不解析候选图片 revision = version; }, evaluateDocument: async ( - item: import("@tarp/module/document-evaluator").ParsedModuleDocument, + item: import("@jointarp/module/document-evaluator").ParsedModuleDocument, ) => item.document, readDocument: async () => { fullReads++; @@ -589,7 +589,7 @@ test("同版计算失败可显式重建计算器重试,共享模组资源不 test("房间同步将公式配置独立交给计算器,配置变化与删除刷新展示", async () => { const f = fixture(); - const { validateDocumentType } = await import("@tarp/module/document-type"); + const { validateDocumentType } = await import("@jointarp/module/document-type"); const monsterType = validateDocumentType("怪物", { fields: { attack: { type: "number", compute: "1" }, diff --git a/apps/desktop/src/renderer/src/features/sessions/room-connection.ts b/apps/desktop/src/renderer/src/features/sessions/room-connection.ts index 0b2a044..942ec90 100644 --- a/apps/desktop/src/renderer/src/features/sessions/room-connection.ts +++ b/apps/desktop/src/renderer/src/features/sessions/room-connection.ts @@ -1,14 +1,14 @@ -import type { ModuleDocument } from "@shared/desktop-api"; -import type { ChatEvent } from "@tarp/core/shared/game"; +import type { ChatEvent } from "@jointarp/core/shared/game"; import { ROOM_PROTOCOL_VERSION, type RoomReplica, type SessionModuleResources, type RoomEntity, -} from "@tarp/core/shared/room-state"; -import { publicValues, type Character } from "@tarp/module/character"; -import { documentIdentity } from "@tarp/module/document-path"; -import { visibleDocumentProjection } from "@tarp/module/module-document"; +} from "@jointarp/core/shared/room-state"; +import { publicValues, type Character } from "@jointarp/module/character"; +import { documentIdentity } from "@jointarp/module/document-path"; +import { visibleDocumentProjection } from "@jointarp/module/module-document"; +import type { ModuleDocument } from "@shared/desktop-api"; import type { RendererDocumentEvaluator } from "../documents/computation/document-worker-protocol"; import { WorkerDocumentEvaluator } from "../documents/computation/worker-document-evaluator"; diff --git a/apps/desktop/src/renderer/src/features/sessions/room-display-mutation.test.ts b/apps/desktop/src/renderer/src/features/sessions/room-display-mutation.test.ts index 7c00b80..cb909eb 100644 --- a/apps/desktop/src/renderer/src/features/sessions/room-display-mutation.test.ts +++ b/apps/desktop/src/renderer/src/features/sessions/room-display-mutation.test.ts @@ -1,8 +1,8 @@ import { test } from "bun:test"; import { strict as assert } from "node:assert"; +import { waitFor } from "@jointarp/module/testing/async"; import { MutationObserver, QueryClient } from "@tanstack/react-query"; -import { waitFor } from "@tarp/module/testing/async"; import { roomDisplayMutation } from "./room-display-mutation"; diff --git a/apps/desktop/src/renderer/src/features/sessions/room-document-loader.tsx b/apps/desktop/src/renderer/src/features/sessions/room-document-loader.tsx index 267b37f..d3f83a1 100644 --- a/apps/desktop/src/renderer/src/features/sessions/room-document-loader.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/room-document-loader.tsx @@ -1,6 +1,6 @@ +import type { RoomEntity } from "@jointarp/core/shared/room-state"; import type { ModuleDocument } from "@shared/desktop-api"; import { keepPreviousData, useQuery } from "@tanstack/react-query"; -import type { RoomEntity } from "@tarp/core/shared/room-state"; import type { ReactNode } from "react"; import { desktopRpc } from "../../desktop-rpc"; diff --git a/apps/desktop/src/renderer/src/features/sessions/room-document.tsx b/apps/desktop/src/renderer/src/features/sessions/room-document.tsx index c972829..596855c 100644 --- a/apps/desktop/src/renderer/src/features/sessions/room-document.tsx +++ b/apps/desktop/src/renderer/src/features/sessions/room-document.tsx @@ -1,5 +1,5 @@ +import type { Character } from "@jointarp/module/character"; import type { ModuleDocument } from "@shared/desktop-api"; -import type { Character } from "@tarp/module/character"; import { createContext, lazy, Suspense, useContext, type ReactNode } from "react"; import { DocumentImageScope } from "../modules/document-image"; diff --git a/apps/desktop/src/renderer/src/features/sessions/room-draft-view.ts b/apps/desktop/src/renderer/src/features/sessions/room-draft-view.ts index 2c7ff28..75b7871 100644 --- a/apps/desktop/src/renderer/src/features/sessions/room-draft-view.ts +++ b/apps/desktop/src/renderer/src/features/sessions/room-draft-view.ts @@ -1,5 +1,5 @@ +import type { Character } from "@jointarp/module/character"; import type { ModuleDocument } from "@shared/desktop-api"; -import type { Character } from "@tarp/module/character"; /** 内容修改仍属于同一草稿;房间、角色类型或来源切换则不能借用旧预览。 */ export function roomDraftIdentity(roomId: string, draft: Character): string { diff --git a/apps/desktop/src/renderer/src/features/sessions/room-launch-view.ts b/apps/desktop/src/renderer/src/features/sessions/room-launch-view.ts index 2a27e4e..bc7dab3 100644 --- a/apps/desktop/src/renderer/src/features/sessions/room-launch-view.ts +++ b/apps/desktop/src/renderer/src/features/sessions/room-launch-view.ts @@ -1,7 +1,7 @@ +import type { RoomEntity, RoomLaunchState } from "@jointarp/core/shared/room-state"; +import type { WorkbenchView } from "@jointarp/module/creation-workbench"; +import { documentIdentity } from "@jointarp/module/document-path"; import type { ModuleDocument } from "@shared/desktop-api"; -import type { RoomEntity, RoomLaunchState } from "@tarp/core/shared/room-state"; -import type { WorkbenchView } from "@tarp/module/creation-workbench"; -import { documentIdentity } from "@tarp/module/document-path"; /** 仅供下一条命令使用,不作为界面展示缓存。 */ export type LaunchCommandProgress = Pick & { roomId: string }; diff --git a/apps/desktop/src/renderer/src/features/sessions/room-state-store.test.ts b/apps/desktop/src/renderer/src/features/sessions/room-state-store.test.ts index 4044a0d..5dc0681 100644 --- a/apps/desktop/src/renderer/src/features/sessions/room-state-store.test.ts +++ b/apps/desktop/src/renderer/src/features/sessions/room-state-store.test.ts @@ -2,13 +2,13 @@ import { test } from "bun:test"; import { strict as assert } from "node:assert"; import { Decoder } from "@colyseus/schema"; -import { ROOM_MAX_FRAME_BYTES, type RoomReplica } from "@tarp/core/shared/room-state"; -import { RoomStateSchema } from "@tarp/core/shared/room-state-schema"; +import { ROOM_MAX_FRAME_BYTES, type RoomReplica } from "@jointarp/core/shared/room-state"; +import { RoomStateSchema } from "@jointarp/core/shared/room-state-schema"; import { createRoomReplica, createRoomBaseline, createRoomEncoder, -} from "@tarp/core/testing/room-replica"; +} from "@jointarp/core/testing/room-replica"; import { RoomStateStore } from "./room-state-store"; function setFields(state: RoomReplica, fields: Record) { diff --git a/apps/desktop/src/renderer/src/features/sessions/room-state-store.ts b/apps/desktop/src/renderer/src/features/sessions/room-state-store.ts index a7adafb..c268eb3 100644 --- a/apps/desktop/src/renderer/src/features/sessions/room-state-store.ts +++ b/apps/desktop/src/renderer/src/features/sessions/room-state-store.ts @@ -8,9 +8,9 @@ import { type RoomReplica, type RoomSections, type RoomStateFrame, -} from "@tarp/core/shared/room-state"; -import { applyRoomEntityOverlay } from "@tarp/core/shared/room-state-overlay"; -import { RoomStateSchema, stableJson } from "@tarp/core/shared/room-state-schema"; +} from "@jointarp/core/shared/room-state"; +import { applyRoomEntityOverlay } from "@jointarp/core/shared/room-state-overlay"; +import { RoomStateSchema, stableJson } from "@jointarp/core/shared/room-state-schema"; /** Decoder 保存累计覆盖;只有合并模组基线并校验成功后才发布当前视图。 */ export class RoomStateStore { diff --git a/apps/desktop/src/renderer/src/features/sessions/use-adventure-actions.ts b/apps/desktop/src/renderer/src/features/sessions/use-adventure-actions.ts index c3fabbb..7fb4518 100644 --- a/apps/desktop/src/renderer/src/features/sessions/use-adventure-actions.ts +++ b/apps/desktop/src/renderer/src/features/sessions/use-adventure-actions.ts @@ -1,6 +1,6 @@ +import type { GameRoom } from "@jointarp/core/shared/session"; import { useMutation, useQuery } from "@tanstack/react-query"; import { useNavigate } from "@tanstack/react-router"; -import type { GameRoom } from "@tarp/core/shared/session"; import { useState } from "react"; import { desktopOrpc, desktopRpc, queryClient } from "../../desktop-rpc"; diff --git a/apps/desktop/src/renderer/src/features/sessions/use-chat-composer.ts b/apps/desktop/src/renderer/src/features/sessions/use-chat-composer.ts index 96cfe0d..7960dfc 100644 --- a/apps/desktop/src/renderer/src/features/sessions/use-chat-composer.ts +++ b/apps/desktop/src/renderer/src/features/sessions/use-chat-composer.ts @@ -4,9 +4,9 @@ import type { SendInput, SubmissionMode, SteeringSnapshot, -} from "@tarp/core/shared/game"; -import { parseMentionRefs } from "@tarp/core/shared/mentions"; -import type { ChatActivitySnapshot } from "@tarp/core/shared/room-state"; +} from "@jointarp/core/shared/game"; +import { parseMentionRefs } from "@jointarp/core/shared/mentions"; +import type { ChatActivitySnapshot } from "@jointarp/core/shared/room-state"; import { useCallback, useEffect, useRef, useState } from "react"; import { errorMessage, type GameClient } from "./game-client"; diff --git a/apps/desktop/src/renderer/src/features/sessions/use-chat-log.ts b/apps/desktop/src/renderer/src/features/sessions/use-chat-log.ts index 6f7d0b5..e5d4a98 100644 --- a/apps/desktop/src/renderer/src/features/sessions/use-chat-log.ts +++ b/apps/desktop/src/renderer/src/features/sessions/use-chat-log.ts @@ -1,5 +1,9 @@ +import type { + ChatMessage, + SubmissionModeSnapshot, + SteeringSnapshot, +} from "@jointarp/core/shared/game"; import { AutomaticSpeechTracker, type SpeechPart } from "@shared/speech-text"; -import type { ChatMessage, SubmissionModeSnapshot, SteeringSnapshot } from "@tarp/core/shared/game"; import { useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react"; import { errorMessage, type GameClient } from "./game-client"; diff --git a/apps/desktop/src/renderer/src/features/sessions/use-room-state.ts b/apps/desktop/src/renderer/src/features/sessions/use-room-state.ts index c510893..d3365bc 100644 --- a/apps/desktop/src/renderer/src/features/sessions/use-room-state.ts +++ b/apps/desktop/src/renderer/src/features/sessions/use-room-state.ts @@ -1,8 +1,8 @@ +import type { LaunchState } from "@jointarp/core/shared/launch"; +import type { RoomEntity, RoomReplica } from "@jointarp/core/shared/room-state"; +import { publicDocumentType, type Character } from "@jointarp/module/character"; import type { ModuleDocument } from "@shared/desktop-api"; import { keepPreviousData, useQueries, useQuery, useQueryClient } from "@tanstack/react-query"; -import type { LaunchState } from "@tarp/core/shared/launch"; -import type { RoomEntity, RoomReplica } from "@tarp/core/shared/room-state"; -import { publicDocumentType, type Character } from "@tarp/module/character"; import { useEffect, useMemo, useRef, useSyncExternalStore } from "react"; import { desktopOrpc, desktopRpc } from "../../desktop-rpc"; diff --git a/apps/desktop/src/renderer/src/features/sessions/use-room-visible-documents.ts b/apps/desktop/src/renderer/src/features/sessions/use-room-visible-documents.ts index bb00f68..f3011dc 100644 --- a/apps/desktop/src/renderer/src/features/sessions/use-room-visible-documents.ts +++ b/apps/desktop/src/renderer/src/features/sessions/use-room-visible-documents.ts @@ -1,7 +1,7 @@ +import type { ChatMessage } from "@jointarp/core/shared/game"; +import { documentIdentity } from "@jointarp/module/document-path"; import type { ModuleDocument } from "@shared/desktop-api"; import { useQueries } from "@tanstack/react-query"; -import type { ChatMessage } from "@tarp/core/shared/game"; -import { documentIdentity } from "@tarp/module/document-path"; import { useMemo } from "react"; import { desktopRpc } from "../../desktop-rpc"; diff --git a/apps/desktop/src/renderer/src/features/settings/AiSettingsPanel.tsx b/apps/desktop/src/renderer/src/features/settings/AiSettingsPanel.tsx index 523ba6e..78de941 100644 --- a/apps/desktop/src/renderer/src/features/settings/AiSettingsPanel.tsx +++ b/apps/desktop/src/renderer/src/features/settings/AiSettingsPanel.tsx @@ -1,4 +1,4 @@ -import { customAiApis, type AiProviderSettings, type AiSettings } from "@tarp/core/shared/game"; +import { customAiApis, type AiProviderSettings, type AiSettings } from "@jointarp/core/shared/game"; import { Check, ChevronRight, Eye, EyeOff, Plus } from "lucide-react"; import { useCallback, useEffect, useState } from "react"; diff --git a/apps/desktop/src/renderer/src/features/settings/GameConfigurationFields.tsx b/apps/desktop/src/renderer/src/features/settings/GameConfigurationFields.tsx index bca6cf6..fccfe2c 100644 --- a/apps/desktop/src/renderer/src/features/settings/GameConfigurationFields.tsx +++ b/apps/desktop/src/renderer/src/features/settings/GameConfigurationFields.tsx @@ -1,17 +1,17 @@ -import { companionInitiativeOptions } from "@tarp/core/shared/companion-initiative"; +import { companionInitiativeOptions } from "@jointarp/core/shared/companion-initiative"; import { companionRoleplayInstructions, maxCompanionRoleplayLength, resolveCompanionRoleplay, -} from "@tarp/core/shared/companion-roleplay"; -import type { GameDefaults } from "@tarp/core/shared/game-defaults"; +} from "@jointarp/core/shared/companion-roleplay"; +import type { GameDefaults } from "@jointarp/core/shared/game-defaults"; import { defaultHostSystemPrompt, maxHostSystemPromptLength, resolveHostSystemPrompt, -} from "@tarp/core/shared/host-system-prompt"; -import { mentionReplyLimitSchema } from "@tarp/core/shared/mentions"; -import type { TtsVoiceOverride } from "@tarp/core/shared/voice"; +} from "@jointarp/core/shared/host-system-prompt"; +import { mentionReplyLimitSchema } from "@jointarp/core/shared/mentions"; +import type { TtsVoiceOverride } from "@jointarp/core/shared/voice"; import { useState, type ReactNode } from "react"; import { Button } from "../../components/ui/button"; diff --git a/apps/desktop/src/renderer/src/features/settings/GameConfigurationForm.tsx b/apps/desktop/src/renderer/src/features/settings/GameConfigurationForm.tsx index 85f265d..e3f14e7 100644 --- a/apps/desktop/src/renderer/src/features/settings/GameConfigurationForm.tsx +++ b/apps/desktop/src/renderer/src/features/settings/GameConfigurationForm.tsx @@ -1,5 +1,5 @@ -import { companionRoleplayInstructions } from "@tarp/core/shared/companion-roleplay"; -import { defaultHostSystemPrompt } from "@tarp/core/shared/host-system-prompt"; +import { companionRoleplayInstructions } from "@jointarp/core/shared/companion-roleplay"; +import { defaultHostSystemPrompt } from "@jointarp/core/shared/host-system-prompt"; import { useRef, useState } from "react"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "../../components/ui/tabs"; diff --git a/apps/desktop/src/renderer/src/features/settings/ModelPicker.tsx b/apps/desktop/src/renderer/src/features/settings/ModelPicker.tsx index 4619a25..bf003c3 100644 --- a/apps/desktop/src/renderer/src/features/settings/ModelPicker.tsx +++ b/apps/desktop/src/renderer/src/features/settings/ModelPicker.tsx @@ -2,7 +2,7 @@ import { thinkingLevelSchema, type ThinkingLevel, type AvailableAiModel, -} from "@tarp/core/shared/game"; +} from "@jointarp/core/shared/game"; import { Check, Search } from "lucide-react"; import { useRef, useState } from "react"; diff --git a/apps/desktop/src/renderer/src/features/settings/use-game-configuration.ts b/apps/desktop/src/renderer/src/features/settings/use-game-configuration.ts index 9adb38f..4473bc2 100644 --- a/apps/desktop/src/renderer/src/features/settings/use-game-configuration.ts +++ b/apps/desktop/src/renderer/src/features/settings/use-game-configuration.ts @@ -1,9 +1,9 @@ -import { useQuery } from "@tanstack/react-query"; import { patchGameDefaults, type GameDefaults, type GameDefaultsPatch, -} from "@tarp/core/shared/game-defaults"; +} from "@jointarp/core/shared/game-defaults"; +import { useQuery } from "@tanstack/react-query"; import { useEffect, useRef, useState } from "react"; import { desktopOrpc } from "../../desktop-rpc"; diff --git a/apps/desktop/src/shared/desktop-api.ts b/apps/desktop/src/shared/desktop-api.ts index 34c80a3..5346440 100644 --- a/apps/desktop/src/shared/desktop-api.ts +++ b/apps/desktop/src/shared/desktop-api.ts @@ -1,15 +1,15 @@ -import type { DocumentType } from "@tarp/module/document-type"; +import type { DocumentType } from "@jointarp/module/document-type"; import type { ModuleDocument, ModuleMetadata, ModulePageDocument, -} from "@tarp/module/module-document"; +} from "@jointarp/module/module-document"; export type { ModuleDocument, ModuleMetadata, ModulePageDocument, -} from "@tarp/module/module-document"; +} from "@jointarp/module/module-document"; export interface ModuleSummary { readonly path: string; diff --git a/apps/desktop/src/shared/speech-text.test.ts b/apps/desktop/src/shared/speech-text.test.ts index b4115ca..dda5ce8 100644 --- a/apps/desktop/src/shared/speech-text.test.ts +++ b/apps/desktop/src/shared/speech-text.test.ts @@ -1,7 +1,7 @@ import { test } from "bun:test"; import { strict as assert } from "node:assert"; -import type { ChatMessage } from "@tarp/core/shared/game"; +import type { ChatMessage } from "@jointarp/core/shared/game"; import { AutomaticSpeechTracker, speechText, splitSpeechText } from "./speech-text"; import { ttsTextLimit } from "./tts"; diff --git a/apps/desktop/src/shared/speech-text.ts b/apps/desktop/src/shared/speech-text.ts index c9d9426..73261b8 100644 --- a/apps/desktop/src/shared/speech-text.ts +++ b/apps/desktop/src/shared/speech-text.ts @@ -1,6 +1,6 @@ -import { chatText, publicAssistantText } from "@tarp/core/shared/agent-message"; -import type { ChatMessage } from "@tarp/core/shared/game"; -import { parseNarrative } from "@tarp/core/shared/narrative"; +import { chatText, publicAssistantText } from "@jointarp/core/shared/agent-message"; +import type { ChatMessage } from "@jointarp/core/shared/game"; +import { parseNarrative } from "@jointarp/core/shared/narrative"; import type { TtsSpeaker } from "./tts"; import { ttsTextLimit } from "./tts"; diff --git a/apps/desktop/src/shared/tts.ts b/apps/desktop/src/shared/tts.ts index 456a175..4e867d2 100644 --- a/apps/desktop/src/shared/tts.ts +++ b/apps/desktop/src/shared/tts.ts @@ -1,12 +1,12 @@ -import type { TtsVoiceOverride } from "@tarp/core/shared/voice"; +import type { TtsVoiceOverride } from "@jointarp/core/shared/voice"; import { z } from "zod"; -export { roomTtsSettingsSchema, ttsVoiceOverrideSchema } from "@tarp/core/shared/voice"; -export type { TtsVoiceOverride } from "@tarp/core/shared/voice"; +export { roomTtsSettingsSchema, ttsVoiceOverrideSchema } from "@jointarp/core/shared/voice"; +export type { TtsVoiceOverride } from "@jointarp/core/shared/voice"; /** 播放端只依赖通用音频与配置;服务商协议留在主进程。 */ -export { ttsConfigSchema } from "@tarp/core/shared/voice"; -export type { TtsConfig } from "@tarp/core/shared/voice"; -import { ttsConfigSchema, type TtsConfig } from "@tarp/core/shared/voice"; +export { ttsConfigSchema } from "@jointarp/core/shared/voice"; +export type { TtsConfig } from "@jointarp/core/shared/voice"; +import { ttsConfigSchema, type TtsConfig } from "@jointarp/core/shared/voice"; export interface TtsProviderInfo { id: string; name: string; diff --git a/bun.lock b/bun.lock index 1e99d6a..6487dbf 100644 --- a/bun.lock +++ b/bun.lock @@ -12,10 +12,11 @@ "lint-staged": "^17.6.0", "oxfmt": "^0.68.0", "simple-git-hooks": "^2.14.0", + "turbo": "2.11.10", }, }, "apps/desktop": { - "name": "@tarp/desktop", + "name": "@jointarp/desktop", "version": "0.1.0", "dependencies": { "@base-ui/react": "^1.8.0", @@ -30,9 +31,9 @@ "@tanstack/react-query": "^5.103.1", "@tanstack/react-router": "^1.170.17", "@tanstack/react-virtual": "^3.14.13", - "@tarp/core": "workspace:*", - "@tarp/module": "workspace:*", - "@tarp/module-cli": "workspace:*", + "@jointarp/core": "workspace:*", + "@jointarp/module": "workspace:*", + "@jointarp/module-cli": "workspace:*", "class-variance-authority": "^0.7.1", "cn": "^0.2.6", "es-toolkit": "^1.52.0", @@ -72,7 +73,7 @@ }, }, "packages/core": { - "name": "@tarp/core", + "name": "@jointarp/core", "version": "0.1.0", "dependencies": { "@colyseus/schema": "5.0.34", @@ -80,7 +81,7 @@ "@earendil-works/pi-coding-agent": "1.2.0", "@orpc/contract": "^2.0.0-beta.36", "@orpc/server": "^2.0.0-beta.36", - "@tarp/module": "workspace:*", + "@jointarp/module": "workspace:*", "es-toolkit": "^1.52.0", "fast-json-patch": "^3.1.1", "kysely": "^0.29.6", @@ -100,7 +101,7 @@ }, }, "packages/module": { - "name": "@tarp/module", + "name": "@jointarp/module", "version": "0.1.0", "dependencies": { "handlebars": "^4.7.10", @@ -118,7 +119,7 @@ }, }, "packages/module-cli": { - "name": "@tarp/module-cli", + "name": "@jointarp/module-cli", "version": "0.1.0", "bin": { "tarp": "./out/index.js", @@ -129,7 +130,7 @@ "zod": "^4.6.5", }, "devDependencies": { - "@tarp/module": "workspace:*", + "@jointarp/module": "workspace:*", "@types/bun": "^1.4.0", "typescript": "^7.0.2", }, @@ -432,13 +433,25 @@ "@tanstack/virtual-core": ["@tanstack/virtual-core@3.17.11", "", {}, "sha512-+ILjvtHup6Y2hzQ6YzwMgX1Q+oQpxEGOXCEsCNaPoIP0VxMbizIBTmYTDtkerkIQS8/CbP1BRuyt8V/8BCsy1g=="], - "@tarp/core": ["@tarp/core@workspace:packages/core"], + "@jointarp/core": ["@jointarp/core@workspace:packages/core"], - "@tarp/desktop": ["@tarp/desktop@workspace:apps/desktop"], + "@jointarp/desktop": ["@jointarp/desktop@workspace:apps/desktop"], - "@tarp/module": ["@tarp/module@workspace:packages/module"], + "@jointarp/module": ["@jointarp/module@workspace:packages/module"], - "@tarp/module-cli": ["@tarp/module-cli@workspace:packages/module-cli"], + "@jointarp/module-cli": ["@jointarp/module-cli@workspace:packages/module-cli"], + + "@turbo/darwin-64": ["@turbo/darwin-64@2.11.10", "", { "os": "darwin", "cpu": "x64" }, "sha512-By4idRap5+nLnMuRzLB4qkOPRlvNdyY1ne4VJYDyUoUB11H94k7uif9mbe3JT8JSNXs1D68uMcBj6hJ/jMQRvA=="], + + "@turbo/darwin-arm64": ["@turbo/darwin-arm64@2.11.10", "", { "os": "darwin", "cpu": "arm64" }, "sha512-pyEYlVcuexOPa92p0Wlwl9YT1Is5D60lxN3ItWm3g30YLvFaUq86TF4BBWg5ZAc0uMTnrOzCvuCsOBTdzUWnRQ=="], + + "@turbo/linux-64": ["@turbo/linux-64@2.11.10", "", { "os": [ "linux", "android", ], "cpu": "x64" }, "sha512-1tYeR/IDZ5HEdsb0jNq2L2xam5nMQ+g80tlV2BZmv4OFw+pMcUM0mMmUcfc5wXPPNHVNPuDMjh9Y8G8HgXPLZA=="], + + "@turbo/linux-arm64": ["@turbo/linux-arm64@2.11.10", "", { "os": [ "linux", "android", ], "cpu": "arm64" }, "sha512-HuekQxvVGhUd46g1Im/DKdOtglHr4/gguZAvzEpPUgtxNkztSa8lWhQEGQ+EmPQ0n7w19qjThFU+OfEEd0uvlw=="], + + "@turbo/windows-64": ["@turbo/windows-64@2.11.10", "", { "os": "win32", "cpu": "x64" }, "sha512-UJOP3BkbreY3/JlMgJR6ZiimxYIBn+c+B4tnBIxD0E9c3Estmk+XoVNVBNBottZLNRXe3/ScgOU4+/k8tIWysg=="], + + "@turbo/windows-arm64": ["@turbo/windows-arm64@2.11.10", "", { "os": "win32", "cpu": "arm64" }, "sha512-xOkEjF3ws/b/YNlc+bvJHMYBn+vL+QbEISZFVi0qS+ImmhA1X3/gmNmBrjjIG3dg6aeN+n6gQitzSkXQ286qJQ=="], "@types/bun": ["@types/bun@1.4.3", "", { "dependencies": { "bun-types": "1.4.3" } }, "sha512-N67Pqy8JXbAY/j0tNraS3V5mubGvc6rrrNDmDCtZLlFzccbUJPDb0tvgUBC5q4m8ybkP93Jcn1QB+RYQ6PvBhw=="], @@ -1122,6 +1135,8 @@ "tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="], + "turbo": ["turbo@2.11.10", "", { "optionalDependencies": { "@turbo/darwin-64": "2.11.10", "@turbo/darwin-arm64": "2.11.10", "@turbo/linux-64": "2.11.10", "@turbo/linux-arm64": "2.11.10", "@turbo/windows-64": "2.11.10", "@turbo/windows-arm64": "2.11.10" }, "bin": { "turbo": "bin/turbo" } }, "sha512-3GJYwig8ygEI89oaOZdduJX8/aw6O9eRPYHoIt6T3FZl9hkKjiyIspufJoVgqXihPoJu8M5CSV0DlZvzfohBCw=="], + "tw-animate-css": ["tw-animate-css@1.4.0", "", {}, "sha512-7bziOlRqH0hJx80h/3mbicLW7o8qLsH5+RaLR2t+OHM3D0JlWGODQKQ4cxbK7WlvmUxpcj6Kgu6EKqjrGFe3QQ=="], "type-detect": ["type-detect@4.0.8", "", {}, "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g=="], diff --git "a/docs/\345\217\221\345\270\203\346\265\201\347\250\213.md" "b/docs/\345\217\221\345\270\203\346\265\201\347\250\213.md" index 10a17a5..9b372f5 100644 --- "a/docs/\345\217\221\345\270\203\346\265\201\347\250\213.md" +++ "b/docs/\345\217\221\345\270\203\346\265\201\347\250\213.md" @@ -10,7 +10,11 @@ 发布工作流复用 CI,共用 `.github/actions/setup/action.yml` 安装根级 `packageManager` 指定的 Bun。依赖统一从根目录按 `bun.lock` 安装;共享包随产品构建,官网和剧情模组不参与构建。CLI 兼容性检查与 CLI 发布流程另外安装 Node.js 22.12.0,验证支持的最低版本。第三方 Actions 固定到提交 SHA,升级时同步核对版本。 -开发环境安装步骤缓存 Bun 的依赖下载目录,以及 Hutch 下的 `npm/`、`releases/`、`toolchains/`;按操作系统、架构、锁文件与工具链配置区分缓存。命中后仍执行 `bun install --frozen-lockfile`、构建和验收,不缓存 `node_modules`、项目构建目录、安装包或签名凭据。缓存不可用时按正常流程重新下载。 +开发环境安装步骤缓存 Bun 的依赖下载目录,以及 Hutch 下的 `npm/`、`releases/`、`toolchains/`;按操作系统、架构、锁文件与工具链配置区分缓存。命中后仍执行 `bun install --frozen-lockfile`、构建和验收,下载缓存不包含 `node_modules`、项目构建目录、安装包或签名凭据。缓存不可用时按正常流程重新下载。 + +根级 `bun run typecheck` 和 `bun run build` 由 Turborepo 调度。类型检查、CLI 构建以及桌面 Vite 页面构建可复用成功任务的结果;共享包源码通过依赖任务参与指纹,实际 Bun 版本、操作系统、架构和构建环境变量也参与区分。CLI 打包与测试准备复用同一构建任务。桌面主进程及原生应用始终重新构建,完整测试、打包、签名、公证、分发验收和 npm 发布均实际执行,不以缓存命中替代。 + +Actions 在开发环境安装步骤恢复并保存 `.turbo/cache`,按系统和架构隔离归档,无需新增 Secret 或远程缓存账号。缓存键包含锁文件、任务配置、提交和 job,后续提交通过前缀恢复已有任务结果,再由 Turbo 决定哪些任务需要重跑。`scripts/tasks.ts` 统一注入实际平台和 Bun 版本;排查时可运行 `bun scripts/tasks.ts run typecheck --force` 强制执行,或用 `--dry=json` 查看依赖和指纹。缓存输出不包括签名凭据、桌面原生应用及已发布的安装包。 GitHub 缓存有分支和 tag 作用域限制,PR 保存的缓存不能由合并后的发布 tag 直接读取;首次发布或新的 tag 可能需要重新下载,同一 tag 重跑可复用已有缓存。默认分支已有的兼容缓存也可供其他分支及发布流程读取。 @@ -58,14 +62,14 @@ macOS 签名使用仓库 Secrets `MAC_CSC_LINK`(HTTPS 证书地址或 Base64 P ## CLI 自动发布到 npm -推送 `cli-v*` tag 后,工作流先检查版本、打包并在 Node.js 与 Bun 下独立安装验收,再创建 GitHub Release 草稿,最后将同一份已验收 tgz 发布到 npm。包名为 `@tarp/module-cli`,公开访问;正式版本使用 `latest`,带预发布标识的版本使用 `next`。GitHub Release 仍需手动公开,但 npm 包会在流程成功后立即公开。 +推送 `cli-v*` tag 后,工作流先检查版本、打包并在 Node.js 与 Bun 下独立安装验收,再创建 GitHub Release 草稿,最后将同一份已验收 tgz 发布到 npm。包名为 `@jointarp/module-cli`,公开访问;正式版本使用 `latest`,带预发布标识的版本使用 `next`。GitHub Release 仍需手动公开,但 npm 包会在流程成功后立即公开。 首次使用前完成以下配置: -1. npm 账号拥有 `@tarp` scope,并有权发布 `@tarp/module-cli`;首次发布时 Token 的权限需要覆盖新包创建。 +1. npm 账号拥有 `@jointarp` scope,并有权发布 `@jointarp/module-cli`;首次发布时 Token 的权限需要覆盖新包创建。 2. 在 npm 创建 Granular Access Token,授予目标包或 scope 的发布写权限;启用用于无人值守发布的 2FA bypass,并设置合适的有效期。 3. 在 GitHub 仓库 `Settings → Secrets and variables → Actions` 添加 `NPM_TOKEN`。工作流仅在凭据检查和发布步骤读取它,不将其写入下载缓存。 -4. 修改 CLI 版本并同步根级锁文件,合并 PR 后推送完全一致的 tag。发布成功后可用 `bunx --bun @tarp/module-cli@0.1.0 --version` 验证目标版本。 +4. 修改 CLI 版本并同步根级锁文件,合并 PR 后推送完全一致的 tag。发布成功后可用 `bunx --bun @jointarp/module-cli@0.1.0 --version` 验证目标版本。 工作流使用 Bun 发布,无需 npm CLI。缺失 Token、权限不足、Token 过期或同版本已存在均会使任务失败;不会跳过失败并宣称已发布。 diff --git "a/docs/\346\265\213\350\257\225\347\273\264\346\212\244.md" "b/docs/\346\265\213\350\257\225\347\273\264\346\212\244.md" index ebd1501..9cee96c 100644 --- "a/docs/\346\265\213\350\257\225\347\273\264\346\212\244.md" +++ "b/docs/\346\265\213\350\257\225\347\273\264\346\212\244.md" @@ -4,7 +4,7 @@ 测试统一使用 Bun 内置的 `bun:test`,运行环境与桌面主进程一致。`scripts/test.ts` 负责 workspace 范围和 CLI 预构建,使用 `--isolate` 隔离每个测试文件的模块与全局状态。根级 `bunfig.toml` 加载 `scripts/test-preload.ts`,解析已有 UI 别名并忽略样式导入;TypeScript 与 TSX 由 Bun 原生处理。当前界面测试验证服务端渲染结果,真实界面交互按相关变更手工检查。 -数据库直接使用 `bun:sqlite` 与 Kysely,业务查询和事务同步执行,建表在打开连接时完成。开发环境和 CI 使用 Bun 1.4.0 或更新版本。CLI 测试在执行前构建产物,并分别通过 Node.js 和 Bun 验证同一份实际分发入口;这部分测试需要 Node.js 22.12.0 或更新版本,CI 固定最低版本执行。可用 `TARP_CLI_NODE` 指向指定的 Node.js 可执行文件。 +数据库直接使用 `bun:sqlite` 与 Kysely,业务查询和事务同步执行,建表在打开连接时完成。开发环境和 CI 使用 Bun 1.4.0 或更新版本。CLI 测试在执行前通过 Turborepo 构建或恢复与当前源码和 Bun 环境对应的产物,并分别通过 Node.js 和 Bun 验证同一份实际分发入口;这部分测试需要 Node.js 22.12.0 或更新版本,CI 固定最低版本执行。可用 `TARP_CLI_NODE` 指向指定的 Node.js 可执行文件。 测试用于发现独立故障。新增测试应说明具体触发条件、错误结果和用户影响;不按函数数量、文件数量或覆盖率目标补用例。 @@ -16,7 +16,7 @@ | `bun run test <文件路径或功能目录>` | 已知修改范围时直接运行相关测试 | | `bun run test` | 平台完整回归,包含同步、存档、计算核心和界面消费者 | -根目录运行以上命令覆盖整个平台,在应用或包目录执行时只运行对应 workspace。也可以在根目录使用 `bun run test --scope @tarp/core` 指定 workspace。 +根目录运行以上命令覆盖整个平台,在应用或包目录执行时只运行对应 workspace。也可以在根目录使用 `bun run test --scope @jointarp/core` 指定 workspace。 Git 影响筛选使用 Bun 的导入关系,无法替代运行时协议、磁盘格式和跨进程链路验证,也不会跟踪运行时从磁盘复制的测试模组文件。修改包内固定测试模组时运行 `bun run test`。修改这些边界时运行平台完整回归。改动已提交后,默认影响筛选可能没有结果;此时明确指定文件或用 `bun run test --changed=<提交或分支>` 指定比较基准。性能脚本按相关改动运行,不纳入每次迭代的默认测试。 @@ -31,7 +31,7 @@ Git 影响筛选使用 Bun 的导入关系,无法替代运行时协议、磁 - 字段计算由计算核心验证,界面测试验证计算结果是否被正确消费;不要在每个界面重复公式组合。 - 页面和组件断言围绕可见结果、数据丢失、错误状态及可操作性,不绑定 CSS 类、内部节点数量或无关文案。 - 相同输入和相同代码路径的重复检查删除;真实不同的边界保留清楚的场景,不能仅为降低数量合并成难排查的大测试。 -- 重试、取消等时间行为使用 `@tarp/module/testing/async` 的 `useFakeTimers` 模拟时间;同步计时器用 `advanceTimersByTime` 推进,涉及 Promise、文件或网络操作时用 `await advanceTimersByTimeAsync`。`useFakeTimers` 已注册测试结束时的自动恢复;需要在测试中途恢复真实时钟时调用 `useRealTimers`。文件或消息操作使用独立临时数据并清理;单个测试的清理使用 `bun:test` 的 `onTestFinished`。 +- 重试、取消等时间行为使用 `@jointarp/module/testing/async` 的 `useFakeTimers` 模拟时间;同步计时器用 `advanceTimersByTime` 推进,涉及 Promise、文件或网络操作时用 `await advanceTimersByTimeAsync`。`useFakeTimers` 已注册测试结束时的自动恢复;需要在测试中途恢复真实时钟时调用 `useRealTimers`。文件或消息操作使用独立临时数据并清理;单个测试的清理使用 `bun:test` 的 `onTestFinished`。 - 剧情模组的规则数值、剧情路线与素材完整性由各模组仓库自行验收,具体入口见对应仓库的 README。平台共用测试模组维护在 `packages/module/test-fixtures/platform/`,随 Git 提交,只覆盖平台功能,不包含剧情逻辑。`createTestModule()` 将固定模组复制到独立临时目录,测试只修改副本并在结束后清理;特殊错误与边界数据由对应测试在副本中构造。 ## 性能测量 diff --git a/package.json b/package.json index bd597e0..9535f53 100644 --- a/package.json +++ b/package.json @@ -9,15 +9,15 @@ ], "type": "module", "scripts": { - "dev": "bun run --filter @tarp/desktop dev", + "dev": "bun run --filter @jointarp/desktop dev", "cli": "bun packages/module-cli/out/index.js", - "build": "bun run --workspaces --if-present build", - "typecheck": "bun run --workspaces typecheck", + "build": "bun scripts/tasks.ts run build", + "typecheck": "bun scripts/tasks.ts run typecheck", "test": "bun scripts/test.ts", "fmt": "oxfmt", "fmt:check": "oxfmt --check", - "package": "bun run --filter @tarp/desktop package", - "dist": "bun run --filter @tarp/desktop dist", + "package": "bun run --filter @jointarp/desktop package", + "dist": "bun run --filter @jointarp/desktop dist", "prepare": "simple-git-hooks", "test:changed": "bun scripts/test.ts --changed" }, @@ -28,7 +28,8 @@ "devDependencies": { "lint-staged": "^17.6.0", "oxfmt": "^0.68.0", - "simple-git-hooks": "^2.14.0" + "simple-git-hooks": "^2.14.0", + "turbo": "2.11.10" }, "simple-git-hooks": { "pre-commit": "bunx --bun lint-staged" diff --git a/packages/core/README.md b/packages/core/README.md index 5f6edd0..c8fd07f 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -1,16 +1,16 @@ # 游戏服务核心 -`@tarp/core` 提供桌面主进程与未来云端宿主共用的房间服务。依赖方向为宿主 → `core` → `module`;核心不引用桌面源码、Electrobun、React 或个人应用配置。 +`@jointarp/core` 提供桌面主进程与未来云端宿主共用的房间服务。依赖方向为宿主 → `core` → `module`;核心不引用桌面源码、Electrobun、React 或个人应用配置。 ## 入口与职责 -| 入口 | 职责 | -| ---------------------- | ------------------------------------------------------ | -| `@tarp/core/shared` | 游戏通信契约、房间与开局类型;浏览器和宿主共用 | -| `@tarp/core/shared/*` | 消息处理、同步结构、叙事解析、队友与声音配置等共享能力 | -| `@tarp/core/node` | `ChatService`、游戏路由、Pi runtime 和房间存档入口 | -| `@tarp/core/node/*` | 房间存储、状态、AI 工具及文件读写等服务端能力 | -| `@tarp/core/testing/*` | 已有测试共用的独立临时模组与房间数据 | +| 入口 | 职责 | +| -------------------------- | ------------------------------------------------------ | +| `@jointarp/core/shared` | 游戏通信契约、房间与开局类型;浏览器和宿主共用 | +| `@jointarp/core/shared/*` | 消息处理、同步结构、叙事解析、队友与声音配置等共享能力 | +| `@jointarp/core/node` | `ChatService`、游戏路由、Pi runtime 和房间存档入口 | +| `@jointarp/core/node/*` | 房间存储、状态、AI 工具及文件读写等服务端能力 | +| `@jointarp/core/testing/*` | 已有测试共用的独立临时模组与房间数据 | `node` 入口在浏览器条件下不可导入。共享入口只引用浏览器可用的实现或类型,不导出 SQLite、文件系统和 AI runtime。 @@ -22,7 +22,7 @@ - `src/node/agent/`:Pi 会话、资料检索、游戏工具与公开事件投影。 - `src/node/storage/`:文件队列、编解码、结构化读改写与原子写入。 -通用模组格式、加载、校验和计算仍归 `@tarp/module`。游戏核心负责选择房间的冻结模组、合并本局修改和执行业务命令。 +通用模组格式、加载、校验和计算仍归 `@jointarp/module`。游戏核心负责选择房间的冻结模组、合并本局修改和执行业务命令。 ## 宿主接入 diff --git a/packages/core/package.json b/packages/core/package.json index 9034c1f..8a34b63 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,5 +1,5 @@ { - "name": "@tarp/core", + "name": "@jointarp/core", "version": "0.1.0", "private": true, "license": "GPL-3.0-only", @@ -19,16 +19,16 @@ }, "scripts": { "typecheck": "bun --bun x --no-install tsc --noEmit", - "test": "bun ../../scripts/test.ts --scope @tarp/core", - "test:changed": "bun ../../scripts/test.ts --scope @tarp/core --changed" + "test": "bun ../../scripts/test.ts --scope @jointarp/core", + "test:changed": "bun ../../scripts/test.ts --scope @jointarp/core --changed" }, "dependencies": { "@colyseus/schema": "5.0.34", "@earendil-works/pi-ai": "1.2.0", "@earendil-works/pi-coding-agent": "1.2.0", + "@jointarp/module": "workspace:*", "@orpc/contract": "^2.0.0-beta.36", "@orpc/server": "^2.0.0-beta.36", - "@tarp/module": "workspace:*", "es-toolkit": "^1.52.0", "fast-json-patch": "^3.1.1", "kysely": "^0.29.6", diff --git a/packages/core/src/node/agent/companion-document-tools.ts b/packages/core/src/node/agent/companion-document-tools.ts index 58cd1c1..3947c68 100644 --- a/packages/core/src/node/agent/companion-document-tools.ts +++ b/packages/core/src/node/agent/companion-document-tools.ts @@ -1,9 +1,9 @@ import { basename, dirname, join } from "node:path"; import type { ToolDefinition } from "@earendil-works/pi-coding-agent"; -import { documentIdentity } from "@tarp/module/document-path"; -import { normalizeInstanceDefinition, type DocumentField } from "@tarp/module/document-type"; -import { isDocumentVisible, type ModuleDocument } from "@tarp/module/module-document"; +import { documentIdentity } from "@jointarp/module/document-path"; +import { normalizeInstanceDefinition, type DocumentField } from "@jointarp/module/document-type"; +import { isDocumentVisible, type ModuleDocument } from "@jointarp/module/module-document"; import { fromMarkdown } from "mdast-util-from-markdown"; import { gfmFromMarkdown, gfmToMarkdown } from "mdast-util-gfm"; import { toMarkdown } from "mdast-util-to-markdown"; diff --git a/packages/core/src/node/agent/context-subscriptions.ts b/packages/core/src/node/agent/context-subscriptions.ts index 5ed2d81..e4b7ce5 100644 --- a/packages/core/src/node/agent/context-subscriptions.ts +++ b/packages/core/src/node/agent/context-subscriptions.ts @@ -1,7 +1,7 @@ import { basename, dirname, join } from "node:path"; import type { ToolDefinition } from "@earendil-works/pi-coding-agent"; -import { documentIdentity } from "@tarp/module/document-path"; +import { documentIdentity } from "@jointarp/module/document-path"; import { Type } from "typebox"; import { z } from "zod"; diff --git a/packages/core/src/node/agent/game-compaction.test.ts b/packages/core/src/node/agent/game-compaction.test.ts index 0de5183..191b29f 100644 --- a/packages/core/src/node/agent/game-compaction.test.ts +++ b/packages/core/src/node/agent/game-compaction.test.ts @@ -18,7 +18,7 @@ import { SessionManager, SettingsManager, } from "@earendil-works/pi-coding-agent"; -import { createTestModule } from "@tarp/module/testing/test-module"; +import { createTestModule } from "@jointarp/module/testing/test-module"; import type { CompactionRole } from "../../shared/compaction-settings"; import { initializeRoomSettings } from "../sessions/room-settings"; diff --git a/packages/core/src/node/agent/game-tools.ts b/packages/core/src/node/agent/game-tools.ts index 061bdf6..b7d4e85 100644 --- a/packages/core/src/node/agent/game-tools.ts +++ b/packages/core/src/node/agent/game-tools.ts @@ -1,8 +1,8 @@ import { basename, dirname, join } from "node:path"; import type { ToolDefinition } from "@earendil-works/pi-coding-agent"; -import { documentTypeId } from "@tarp/module/document-path"; -import { parseDocumentContent } from "@tarp/module/node/document-codec"; +import { documentTypeId } from "@jointarp/module/document-path"; +import { parseDocumentContent } from "@jointarp/module/node/document-codec"; import { Type } from "typebox"; import { z } from "zod"; diff --git a/packages/core/src/node/agent/pi-runtime.ts b/packages/core/src/node/agent/pi-runtime.ts index 3888d41..0d15eef 100644 --- a/packages/core/src/node/agent/pi-runtime.ts +++ b/packages/core/src/node/agent/pi-runtime.ts @@ -15,7 +15,7 @@ import { type SessionManager, type ToolDefinition, } from "@earendil-works/pi-coding-agent"; -import { loadModuleMetadata } from "@tarp/module/node/module-metadata"; +import { loadModuleMetadata } from "@jointarp/module/node/module-metadata"; import { Type } from "typebox"; import { chatText } from "../../shared/agent-message"; diff --git a/packages/core/src/node/game/chat-service.test.ts b/packages/core/src/node/game/chat-service.test.ts index a1ef54f..35f7ad9 100644 --- a/packages/core/src/node/game/chat-service.test.ts +++ b/packages/core/src/node/game/chat-service.test.ts @@ -8,19 +8,19 @@ import { join } from "node:path"; import { MessageChannel } from "node:worker_threads"; import { SessionManager } from "@earendil-works/pi-coding-agent"; -import { createORPCClient } from "@orpc/client"; -import { RPCLink } from "@orpc/client/message-port"; -import type { ContractRouterClient } from "@orpc/contract"; -import { RPCHandler } from "@orpc/server/message-port"; -import { launchConfigSchema, type LaunchConfig } from "@tarp/module/flow"; +import { launchConfigSchema, type LaunchConfig } from "@jointarp/module/flow"; import { advanceTimersByTime, advanceTimersByTimeAsync, useFakeTimers, useRealTimers, waitFor, -} from "@tarp/module/testing/async"; -import { writeTestFile as writeFile } from "@tarp/module/testing/files"; +} from "@jointarp/module/testing/async"; +import { writeTestFile as writeFile } from "@jointarp/module/testing/files"; +import { createORPCClient } from "@orpc/client"; +import { RPCLink } from "@orpc/client/message-port"; +import type { ContractRouterClient } from "@orpc/contract"; +import { RPCHandler } from "@orpc/server/message-port"; import { chatText } from "../../shared/agent-message"; import type { diff --git a/packages/core/src/node/game/chat/launch-cards.ts b/packages/core/src/node/game/chat/launch-cards.ts index ff710cb..cce0b21 100644 --- a/packages/core/src/node/game/chat/launch-cards.ts +++ b/packages/core/src/node/game/chat/launch-cards.ts @@ -1,6 +1,6 @@ import { randomUUID } from "node:crypto"; -import { finishIntroductionRun } from "@tarp/module/flow"; +import { finishIntroductionRun } from "@jointarp/module/flow"; import { messageSchema } from "../../../shared/game"; import type { Player } from "../../../shared/game"; diff --git a/packages/core/src/node/game/chat/launch.ts b/packages/core/src/node/game/chat/launch.ts index 8d08a85..af82c7a 100644 --- a/packages/core/src/node/game/chat/launch.ts +++ b/packages/core/src/node/game/chat/launch.ts @@ -1,7 +1,7 @@ import { randomUUID } from "node:crypto"; +import { emptyFlowRun } from "@jointarp/module/flow"; import { ORPCError } from "@orpc/server"; -import { emptyFlowRun } from "@tarp/module/flow"; import type { Player } from "../../../shared/game"; import type { LaunchAction } from "../../../shared/launch"; diff --git a/packages/core/src/node/game/chat/narration.ts b/packages/core/src/node/game/chat/narration.ts index 05acca9..10ef33b 100644 --- a/packages/core/src/node/game/chat/narration.ts +++ b/packages/core/src/node/game/chat/narration.ts @@ -1,7 +1,7 @@ import { randomUUID } from "node:crypto"; -import { sameDocumentIdentity } from "@tarp/module/document-path"; -import { emptyFlowRun, preludeNarration } from "@tarp/module/flow"; +import { sameDocumentIdentity } from "@jointarp/module/document-path"; +import { emptyFlowRun, preludeNarration } from "@jointarp/module/flow"; import { messageSchema, type ChatMessage } from "../../../shared/game"; import { narrationLines, startNarrationBeats } from "../../../shared/narration"; diff --git a/packages/core/src/node/game/companion-launch.test.ts b/packages/core/src/node/game/companion-launch.test.ts index 6f6d0e1..98e39bf 100644 --- a/packages/core/src/node/game/companion-launch.test.ts +++ b/packages/core/src/node/game/companion-launch.test.ts @@ -4,9 +4,9 @@ import { randomUUID } from "node:crypto"; import { readFile } from "node:fs/promises"; import { join } from "node:path"; -import { waitFor } from "@tarp/module/testing/async"; -import { writeTestFile as writeFile } from "@tarp/module/testing/files"; -import { createTestModule } from "@tarp/module/testing/test-module"; +import { waitFor } from "@jointarp/module/testing/async"; +import { writeTestFile as writeFile } from "@jointarp/module/testing/files"; +import { createTestModule } from "@jointarp/module/testing/test-module"; import type { LaunchAction } from "../../shared/launch"; import { advanceLaunch, launchState } from "../sessions/launch-store"; diff --git a/packages/core/src/node/game/companion.test.ts b/packages/core/src/node/game/companion.test.ts index e978f12..44c65a5 100644 --- a/packages/core/src/node/game/companion.test.ts +++ b/packages/core/src/node/game/companion.test.ts @@ -12,9 +12,9 @@ import { useFakeTimers, useRealTimers, waitFor, -} from "@tarp/module/testing/async"; -import { writeTestFile as writeFile } from "@tarp/module/testing/files"; -import { createWorldStateDefinition } from "@tarp/module/testing/world-state"; +} from "@jointarp/module/testing/async"; +import { writeTestFile as writeFile } from "@jointarp/module/testing/files"; +import { createWorldStateDefinition } from "@jointarp/module/testing/world-state"; import { chatText, companionDisplayText } from "../../shared/agent-message"; import { companionRulingFromToolCall } from "../../shared/companion"; diff --git a/packages/core/src/node/game/companion.ts b/packages/core/src/node/game/companion.ts index 8f11504..ac88e1c 100644 --- a/packages/core/src/node/game/companion.ts +++ b/packages/core/src/node/game/companion.ts @@ -1,4 +1,4 @@ -import { documentIdentity } from "@tarp/module/document-path"; +import { documentIdentity } from "@jointarp/module/document-path"; import { chatText, publicAssistantText, visibleAgentMessages } from "../../shared/agent-message"; import { companionSchema, type Companion } from "../../shared/companion"; diff --git a/packages/core/src/node/game/room-state-projection.ts b/packages/core/src/node/game/room-state-projection.ts index 0de5a35..19c2b52 100644 --- a/packages/core/src/node/game/room-state-projection.ts +++ b/packages/core/src/node/game/room-state-projection.ts @@ -2,12 +2,12 @@ import { createHash } from "node:crypto"; import { readFile, readdir } from "node:fs/promises"; import { join } from "node:path"; +import { publicValues } from "@jointarp/module/character"; +import { documentFormat, documentIdentity, documentTypeId } from "@jointarp/module/document-path"; +import type { LaunchConfig } from "@jointarp/module/flow"; +import type { ModuleDocument } from "@jointarp/module/module-document"; +import { parseDocumentContent } from "@jointarp/module/node/document-codec"; import { ORPCError } from "@orpc/server"; -import { publicValues } from "@tarp/module/character"; -import { documentFormat, documentIdentity, documentTypeId } from "@tarp/module/document-path"; -import type { LaunchConfig } from "@tarp/module/flow"; -import type { ModuleDocument } from "@tarp/module/module-document"; -import { parseDocumentContent } from "@tarp/module/node/document-codec"; import type { LaunchState } from "../../shared/launch"; import { diff --git a/packages/core/src/node/sessions/character-db.ts b/packages/core/src/node/sessions/character-db.ts index 9d4fb5f..3aaffc0 100644 --- a/packages/core/src/node/sessions/character-db.ts +++ b/packages/core/src/node/sessions/character-db.ts @@ -1,13 +1,13 @@ import { basename } from "node:path"; -import type { Character } from "@tarp/module/character"; -import { documentIdentity } from "@tarp/module/document-path"; +import type { Character } from "@jointarp/module/character"; +import { documentIdentity } from "@jointarp/module/document-path"; import { documentMetadataSchema, validateDocumentValues, type DocumentType, -} from "@tarp/module/document-type"; -import { parseDocumentContent } from "@tarp/module/node/document-codec"; +} from "@jointarp/module/document-type"; +import { parseDocumentContent } from "@jointarp/module/node/document-codec"; import { createIdentityId } from "../identity"; import type { SessionDatabase } from "../storage/session-database"; diff --git a/packages/core/src/node/sessions/character-ownership.ts b/packages/core/src/node/sessions/character-ownership.ts index bcd7719..cb1cfc4 100644 --- a/packages/core/src/node/sessions/character-ownership.ts +++ b/packages/core/src/node/sessions/character-ownership.ts @@ -1,5 +1,5 @@ -import type { Character } from "@tarp/module/character"; -import { sameDocumentIdentity } from "@tarp/module/document-path"; +import type { Character } from "@jointarp/module/character"; +import { sameDocumentIdentity } from "@jointarp/module/document-path"; import type { SessionDatabase } from "../storage/session-database"; import { markStateChanged, readAdventureState, updateAdventureState } from "./adventure-state"; diff --git a/packages/core/src/node/sessions/character-store.ts b/packages/core/src/node/sessions/character-store.ts index 8423dc1..bcc0477 100644 --- a/packages/core/src/node/sessions/character-store.ts +++ b/packages/core/src/node/sessions/character-store.ts @@ -1,17 +1,21 @@ -import { characterDraftSchema, type Character, type CharacterDraft } from "@tarp/module/character"; +import { + characterDraftSchema, + type Character, + type CharacterDraft, +} from "@jointarp/module/character"; import { resolveDocumentComputations, documentSourceValues, -} from "@tarp/module/document-computations"; -import { resolveModuleDocuments } from "@tarp/module/document-evaluator"; -import { documentFormat, documentIdentity } from "@tarp/module/document-path"; -import { validateDocumentValues, type DocumentField } from "@tarp/module/document-type"; +} from "@jointarp/module/document-computations"; +import { resolveModuleDocuments } from "@jointarp/module/document-evaluator"; +import { documentFormat, documentIdentity } from "@jointarp/module/document-path"; +import { validateDocumentValues, type DocumentField } from "@jointarp/module/document-type"; import { resolveInstanceDefinition, validateInstanceBindings, type InstanceResolver, -} from "@tarp/module/instance-state"; -import type { ModuleDocument } from "@tarp/module/module-document"; +} from "@jointarp/module/instance-state"; +import type { ModuleDocument } from "@jointarp/module/module-document"; import type { SessionDatabase } from "../storage/session-database"; import { readCharacters, storedTypes } from "./character-db"; diff --git a/packages/core/src/node/sessions/companion-selection.ts b/packages/core/src/node/sessions/companion-selection.ts index 3a35923..c025d92 100644 --- a/packages/core/src/node/sessions/companion-selection.ts +++ b/packages/core/src/node/sessions/companion-selection.ts @@ -1,5 +1,5 @@ -import type { Character } from "@tarp/module/character"; -import { sameDocumentIdentity } from "@tarp/module/document-path"; +import type { Character } from "@jointarp/module/character"; +import { sameDocumentIdentity } from "@jointarp/module/document-path"; import type { SessionDatabase } from "../storage/session-database"; import { readCharacters } from "./character-db"; diff --git a/packages/core/src/node/sessions/compile-module.ts b/packages/core/src/node/sessions/compile-module.ts index c59810b..6857aab 100644 --- a/packages/core/src/node/sessions/compile-module.ts +++ b/packages/core/src/node/sessions/compile-module.ts @@ -1,12 +1,12 @@ import { lstat, readFile, readdir, unlink, writeFile } from "node:fs/promises"; import { join } from "node:path"; -import { documentIdentity } from "@tarp/module/document-path"; -import { configFilePath, parseConfig } from "@tarp/module/node/config-file"; -import { parseDocumentContent } from "@tarp/module/node/document-codec"; -import { loadDocumentTypes } from "@tarp/module/node/document-types"; -import { loadModuleDocuments } from "@tarp/module/node/module-documents"; -import { loadModuleMetadata } from "@tarp/module/node/module-metadata"; +import { documentIdentity } from "@jointarp/module/document-path"; +import { configFilePath, parseConfig } from "@jointarp/module/node/config-file"; +import { parseDocumentContent } from "@jointarp/module/node/document-codec"; +import { loadDocumentTypes } from "@jointarp/module/node/document-types"; +import { loadModuleDocuments } from "@jointarp/module/node/module-documents"; +import { loadModuleMetadata } from "@jointarp/module/node/module-metadata"; /** 只编译 staging 副本;保留作者原值、公式及引用,阅读页和附件不转换。 */ export async function compileModule(directory: string): Promise { diff --git a/packages/core/src/node/sessions/document-reference-store.ts b/packages/core/src/node/sessions/document-reference-store.ts index 7fdaced..a015ff0 100644 --- a/packages/core/src/node/sessions/document-reference-store.ts +++ b/packages/core/src/node/sessions/document-reference-store.ts @@ -2,14 +2,14 @@ import { createHash } from "node:crypto"; import { lstatSync, readFileSync } from "node:fs"; import { join } from "node:path"; -import type { DocumentData } from "@tarp/module/document-computations"; +import type { DocumentData } from "@jointarp/module/document-computations"; import { collectReferences, type DeclaredReferences, type DocumentReferenceIndex, -} from "@tarp/module/document-references"; -import type { DocumentType } from "@tarp/module/document-type"; -import { hasInstanceBindings, type InstanceResolver } from "@tarp/module/instance-state"; +} from "@jointarp/module/document-references"; +import type { DocumentType } from "@jointarp/module/document-type"; +import { hasInstanceBindings, type InstanceResolver } from "@jointarp/module/instance-state"; import { z } from "zod"; import type { SessionDatabase } from "../storage/session-database"; diff --git a/packages/core/src/node/sessions/frozen-module.ts b/packages/core/src/node/sessions/frozen-module.ts index 115ad93..d8456ae 100644 --- a/packages/core/src/node/sessions/frozen-module.ts +++ b/packages/core/src/node/sessions/frozen-module.ts @@ -1,11 +1,11 @@ import { join } from "node:path"; -import type { DocumentType } from "@tarp/module/document-type"; -import { launchConfigSchema, validateLaunch, type LaunchConfig } from "@tarp/module/flow"; -import type { RawModuleDocument } from "@tarp/module/module-document"; -import { loadDocumentTypes } from "@tarp/module/node/document-types"; -import { loadModuleDocuments } from "@tarp/module/node/module-documents"; -import { loadModuleMetadata } from "@tarp/module/node/module-metadata"; +import type { DocumentType } from "@jointarp/module/document-type"; +import { launchConfigSchema, validateLaunch, type LaunchConfig } from "@jointarp/module/flow"; +import type { RawModuleDocument } from "@jointarp/module/module-document"; +import { loadDocumentTypes } from "@jointarp/module/node/document-types"; +import { loadModuleDocuments } from "@jointarp/module/node/module-documents"; +import { loadModuleMetadata } from "@jointarp/module/node/module-metadata"; import type { SessionDatabase } from "../storage/session-database"; import { roomDirectoryForDatabase } from "./session-paths"; diff --git a/packages/core/src/node/sessions/game-document-patch.ts b/packages/core/src/node/sessions/game-document-patch.ts index c24aab7..8129883 100644 --- a/packages/core/src/node/sessions/game-document-patch.ts +++ b/packages/core/src/node/sessions/game-document-patch.ts @@ -1,5 +1,5 @@ -import type { DocumentType } from "@tarp/module/document-type"; -import { instancePointerType, type InstanceResolver } from "@tarp/module/instance-state"; +import type { DocumentType } from "@jointarp/module/document-type"; +import { instancePointerType, type InstanceResolver } from "@jointarp/module/instance-state"; import jsonPatch from "fast-json-patch"; import { z } from "zod"; diff --git a/packages/core/src/node/sessions/game-document-path.ts b/packages/core/src/node/sessions/game-document-path.ts index 09a3d13..a85ac8c 100644 --- a/packages/core/src/node/sessions/game-document-path.ts +++ b/packages/core/src/node/sessions/game-document-path.ts @@ -1,8 +1,8 @@ import { lstatSync } from "node:fs"; import { dirname } from "node:path"; -import { documentIdentity, documentTypeId } from "@tarp/module/document-path"; -import type { DocumentType } from "@tarp/module/document-type"; +import { documentIdentity, documentTypeId } from "@jointarp/module/document-path"; +import type { DocumentType } from "@jointarp/module/document-type"; import { overlayEntries, overlayPath } from "./game-overlay"; diff --git a/packages/core/src/node/sessions/game-document-read.ts b/packages/core/src/node/sessions/game-document-read.ts index 02273ac..1b5160d 100644 --- a/packages/core/src/node/sessions/game-document-read.ts +++ b/packages/core/src/node/sessions/game-document-read.ts @@ -2,9 +2,9 @@ import { lstatSync } from "node:fs"; import { lstat, readFile } from "node:fs/promises"; import { basename, dirname } from "node:path"; -import { documentIdentity } from "@tarp/module/document-path"; -import { parseConfig } from "@tarp/module/node/config-file"; -import { parseGameDocumentContent as parseContent } from "@tarp/module/node/game-state-validation"; +import { documentIdentity } from "@jointarp/module/document-path"; +import { parseConfig } from "@jointarp/module/node/config-file"; +import { parseGameDocumentContent as parseContent } from "@jointarp/module/node/game-state-validation"; import type { SessionDatabase } from "../storage/session-database"; import { readAdventureState } from "./adventure-state"; diff --git a/packages/core/src/node/sessions/game-document-source.ts b/packages/core/src/node/sessions/game-document-source.ts index 633fd07..3bfe929 100644 --- a/packages/core/src/node/sessions/game-document-source.ts +++ b/packages/core/src/node/sessions/game-document-source.ts @@ -2,12 +2,12 @@ import { lstatSync } from "node:fs"; import { lstat, readFile, realpath } from "node:fs/promises"; import { basename } from "node:path"; -import { resolveDocumentComputations } from "@tarp/module/document-computations"; -import type { ParsedModuleDocument } from "@tarp/module/document-evaluator"; -import { documentFormat, documentIdentity, documentTypeId } from "@tarp/module/document-path"; -import type { DocumentType } from "@tarp/module/document-type"; -import type { InstanceResolver } from "@tarp/module/instance-state"; -import { parseGameDocumentContent as parseContent } from "@tarp/module/node/game-state-validation"; +import { resolveDocumentComputations } from "@jointarp/module/document-computations"; +import type { ParsedModuleDocument } from "@jointarp/module/document-evaluator"; +import { documentFormat, documentIdentity, documentTypeId } from "@jointarp/module/document-path"; +import type { DocumentType } from "@jointarp/module/document-type"; +import type { InstanceResolver } from "@jointarp/module/instance-state"; +import { parseGameDocumentContent as parseContent } from "@jointarp/module/node/game-state-validation"; import type { SessionDatabase } from "../storage/session-database"; import { readAdventureState } from "./adventure-state"; diff --git a/packages/core/src/node/sessions/game-document-views.ts b/packages/core/src/node/sessions/game-document-views.ts index fa5b895..2a33cf1 100644 --- a/packages/core/src/node/sessions/game-document-views.ts +++ b/packages/core/src/node/sessions/game-document-views.ts @@ -1,14 +1,14 @@ import { dirname } from "node:path"; -import { publicValues } from "@tarp/module/character"; +import { publicValues } from "@jointarp/module/character"; import { DocumentEvaluator, resolveModuleDocuments, type ParsedModuleDocument, -} from "@tarp/module/document-evaluator"; -import { documentIdentity } from "@tarp/module/document-path"; -import { visibleDocumentProjection, type ModuleDocument } from "@tarp/module/module-document"; -import { publicFieldErrors } from "@tarp/module/public-document-field"; +} from "@jointarp/module/document-evaluator"; +import { documentIdentity } from "@jointarp/module/document-path"; +import { visibleDocumentProjection, type ModuleDocument } from "@jointarp/module/module-document"; +import { publicFieldErrors } from "@jointarp/module/public-document-field"; import type { SessionDatabase } from "../storage/session-database"; import { storedTypes } from "./character-db"; diff --git a/packages/core/src/node/sessions/game-document-write.ts b/packages/core/src/node/sessions/game-document-write.ts index 911d076..e28347f 100644 --- a/packages/core/src/node/sessions/game-document-write.ts +++ b/packages/core/src/node/sessions/game-document-write.ts @@ -1,25 +1,28 @@ import { lstat, mkdir, realpath } from "node:fs/promises"; import { dirname, isAbsolute, join, relative, sep } from "node:path"; -import type { Character } from "@tarp/module/character"; -import { hasComputedFields } from "@tarp/module/computed-fields"; +import type { Character } from "@jointarp/module/character"; +import { hasComputedFields } from "@jointarp/module/computed-fields"; import { resolveDocumentComputations, documentSourceValues, -} from "@tarp/module/document-computations"; -import { resolveModuleDocuments, type ParsedModuleDocument } from "@tarp/module/document-evaluator"; -import { documentFormat, documentIdentity } from "@tarp/module/document-path"; -import type { DocumentType } from "@tarp/module/document-type"; +} from "@jointarp/module/document-computations"; +import { + resolveModuleDocuments, + type ParsedModuleDocument, +} from "@jointarp/module/document-evaluator"; +import { documentFormat, documentIdentity } from "@jointarp/module/document-path"; +import type { DocumentType } from "@jointarp/module/document-type"; import { assertInstanceChanges, instancePointerType, validateInstanceBindings, -} from "@tarp/module/instance-state"; -import { stringifyDocumentContent } from "@tarp/module/node/document-codec"; +} from "@jointarp/module/instance-state"; +import { stringifyDocumentContent } from "@jointarp/module/node/document-codec"; import { parseGameDocumentContent as parseContent, validateGameDocumentReferences, -} from "@tarp/module/node/game-state-validation"; +} from "@jointarp/module/node/game-state-validation"; import { assertRoomOverlayAdmission } from "../game/room-state-projection"; import { createIdentityId } from "../identity"; diff --git a/packages/core/src/node/sessions/game-file-access.ts b/packages/core/src/node/sessions/game-file-access.ts index 7c6a980..d4cc939 100644 --- a/packages/core/src/node/sessions/game-file-access.ts +++ b/packages/core/src/node/sessions/game-file-access.ts @@ -1,4 +1,4 @@ -import type { DocumentType } from "@tarp/module/document-type"; +import type { DocumentType } from "@jointarp/module/document-type"; import type { SessionDatabase } from "../storage/session-database"; import { storedTypes } from "./character-db"; diff --git a/packages/core/src/node/sessions/game-file-index.ts b/packages/core/src/node/sessions/game-file-index.ts index 57e42b5..8663bf7 100644 --- a/packages/core/src/node/sessions/game-file-index.ts +++ b/packages/core/src/node/sessions/game-file-index.ts @@ -1,7 +1,7 @@ import { createHash } from "node:crypto"; -import { documentFormat, documentIdentity, documentTypeId } from "@tarp/module/document-path"; -import type { DocumentType } from "@tarp/module/document-type"; +import { documentFormat, documentIdentity, documentTypeId } from "@jointarp/module/document-path"; +import type { DocumentType } from "@jointarp/module/document-type"; import type { SessionDatabase } from "../storage/session-database"; import { readAdventureState } from "./adventure-state"; diff --git a/packages/core/src/node/sessions/game-overlay.test.ts b/packages/core/src/node/sessions/game-overlay.test.ts index 0fe5868..b91674e 100644 --- a/packages/core/src/node/sessions/game-overlay.test.ts +++ b/packages/core/src/node/sessions/game-overlay.test.ts @@ -14,7 +14,7 @@ import { import { tmpdir } from "node:os"; import { basename, join } from "node:path"; -import { writeTestFile as writeFile } from "@tarp/module/testing/files"; +import { writeTestFile as writeFile } from "@jointarp/module/testing/files"; import { createGameTools } from "../agent/game-tools"; import { readCharacters } from "./character-db"; diff --git a/packages/core/src/node/sessions/game-overlay.ts b/packages/core/src/node/sessions/game-overlay.ts index c7caffa..9b67642 100644 --- a/packages/core/src/node/sessions/game-overlay.ts +++ b/packages/core/src/node/sessions/game-overlay.ts @@ -1,13 +1,13 @@ import { lstatSync, readFileSync, readdirSync, realpathSync } from "node:fs"; import { dirname, isAbsolute, join, relative, sep } from "node:path"; -import type { DocumentType } from "@tarp/module/document-type"; +import type { DocumentType } from "@jointarp/module/document-type"; import { parseDocumentContent, parseStructuredDocument, stringifyDocumentContent, stringifyStructuredDocument, -} from "@tarp/module/node/document-codec"; +} from "@jointarp/module/node/document-codec"; import { cloneDeep, isEqual, isPlainObject, mergeWith } from "es-toolkit"; import { z } from "zod"; diff --git a/packages/core/src/node/sessions/game-pointers.ts b/packages/core/src/node/sessions/game-pointers.ts index 9b65d53..65f52ac 100644 --- a/packages/core/src/node/sessions/game-pointers.ts +++ b/packages/core/src/node/sessions/game-pointers.ts @@ -1,4 +1,4 @@ -import type { DocumentField, DocumentType } from "@tarp/module/document-type"; +import type { DocumentField, DocumentType } from "@jointarp/module/document-type"; export function pointerParts(pointer: string): string[] { if (!pointer.startsWith("/") || pointer === "/") throw new Error("更新路径必须是 JSON Pointer"); diff --git a/packages/core/src/node/sessions/game-state.test.ts b/packages/core/src/node/sessions/game-state.test.ts index 7af8573..25d7ecc 100644 --- a/packages/core/src/node/sessions/game-state.test.ts +++ b/packages/core/src/node/sessions/game-state.test.ts @@ -4,11 +4,11 @@ import { access, chmod, mkdir, mkdtemp, readFile, readdir, rm } from "node:fs/pr import { tmpdir } from "node:os"; import { dirname, join } from "node:path"; -import { stringifyConfig } from "@tarp/module/node/config-file"; -import { validateModule } from "@tarp/module/node/validate-module"; -import { writeTestFile as writeFile } from "@tarp/module/testing/files"; -import { createTestModule } from "@tarp/module/testing/test-module"; -import { createWorldStateDefinition } from "@tarp/module/testing/world-state"; +import { stringifyConfig } from "@jointarp/module/node/config-file"; +import { validateModule } from "@jointarp/module/node/validate-module"; +import { writeTestFile as writeFile } from "@jointarp/module/testing/files"; +import { createTestModule } from "@jointarp/module/testing/test-module"; +import { createWorldStateDefinition } from "@jointarp/module/testing/world-state"; import { createCompanionDocumentTools } from "../agent/companion-document-tools"; import { ContextSubscriptions } from "../agent/context-subscriptions"; diff --git a/packages/core/src/node/sessions/launch-db.ts b/packages/core/src/node/sessions/launch-db.ts index 35381cc..05533f4 100644 --- a/packages/core/src/node/sessions/launch-db.ts +++ b/packages/core/src/node/sessions/launch-db.ts @@ -1,5 +1,5 @@ -import type { LaunchConfig } from "@tarp/module/flow"; -import { emptyFlowRun } from "@tarp/module/flow"; +import type { LaunchConfig } from "@jointarp/module/flow"; +import { emptyFlowRun } from "@jointarp/module/flow"; import type { LaunchProgress, LaunchRoom } from "../../shared/launch"; import type { SessionDatabase } from "../storage/session-database"; diff --git a/packages/core/src/node/sessions/launch-store.test.ts b/packages/core/src/node/sessions/launch-store.test.ts index de7451f..1bb7e12 100644 --- a/packages/core/src/node/sessions/launch-store.test.ts +++ b/packages/core/src/node/sessions/launch-store.test.ts @@ -5,8 +5,8 @@ import { mkdir, mkdtemp, readFile, rm } from "node:fs/promises"; import { tmpdir } from "node:os"; import { join } from "node:path"; -import { creationFlowSchema, launchConfigSchema } from "@tarp/module/flow"; -import { writeTestFile as writeFile } from "@tarp/module/testing/files"; +import { creationFlowSchema, launchConfigSchema } from "@jointarp/module/flow"; +import { writeTestFile as writeFile } from "@jointarp/module/testing/files"; import { ZodError } from "zod"; import type { LaunchAction, LaunchState } from "../../shared/launch"; diff --git a/packages/core/src/node/sessions/launch-store.ts b/packages/core/src/node/sessions/launch-store.ts index 0c1d244..1688b50 100644 --- a/packages/core/src/node/sessions/launch-store.ts +++ b/packages/core/src/node/sessions/launch-store.ts @@ -5,11 +5,11 @@ import { publicValues, type Character, type CharacterDraft, -} from "@tarp/module/character"; -import { evaluateCreation, newCreationProgress } from "@tarp/module/creation-workbench"; -import { documentFormat, sameDocumentIdentity } from "@tarp/module/document-path"; -import { advanceFlow, backFlow, currentNode, finishIntroductionRun } from "@tarp/module/flow"; -import type { ModuleDocument } from "@tarp/module/module-document"; +} from "@jointarp/module/character"; +import { evaluateCreation, newCreationProgress } from "@jointarp/module/creation-workbench"; +import { documentFormat, sameDocumentIdentity } from "@jointarp/module/document-path"; +import { advanceFlow, backFlow, currentNode, finishIntroductionRun } from "@jointarp/module/flow"; +import type { ModuleDocument } from "@jointarp/module/module-document"; import { messageSchema } from "../../shared/game"; import { launchActionSchema, type LaunchAction, type LaunchState } from "../../shared/launch"; diff --git a/packages/core/src/node/sessions/module-sync.test.ts b/packages/core/src/node/sessions/module-sync.test.ts index 79f2e7c..e09fb50 100644 --- a/packages/core/src/node/sessions/module-sync.test.ts +++ b/packages/core/src/node/sessions/module-sync.test.ts @@ -4,8 +4,8 @@ import * as fs from "node:fs"; import { lstat, mkdir, readFile, rename, rm, symlink } from "node:fs/promises"; import { join } from "node:path"; -import { writeTestFile as writeFile } from "@tarp/module/testing/files"; -import { createTestModule } from "@tarp/module/testing/test-module"; +import { writeTestFile as writeFile } from "@jointarp/module/testing/files"; +import { createTestModule } from "@jointarp/module/testing/test-module"; import { readCharacters } from "./character-db"; import { updateGameDocument, readGameDocumentView, writeGameDocument } from "./game-state"; diff --git a/packages/core/src/node/sessions/module-sync.ts b/packages/core/src/node/sessions/module-sync.ts index 494e609..f0ad149 100644 --- a/packages/core/src/node/sessions/module-sync.ts +++ b/packages/core/src/node/sessions/module-sync.ts @@ -3,14 +3,17 @@ import { lstatSync, readFileSync, renameSync, writeFileSync } from "node:fs"; import { lstat, mkdir, mkdtemp, readFile, readdir, rm } from "node:fs/promises"; import { isAbsolute, join } from "node:path"; +import { + resolveModuleDocuments, + type ParsedModuleDocument, +} from "@jointarp/module/document-evaluator"; +import { documentIdentity } from "@jointarp/module/document-path"; +import { validateDocumentValues } from "@jointarp/module/document-type"; +import { validateAnswer } from "@jointarp/module/flow"; +import { stringifyDocumentContent } from "@jointarp/module/node/document-codec"; +import { validateInitialGameState } from "@jointarp/module/node/game-state-validation"; +import { loadModuleMetadata } from "@jointarp/module/node/module-metadata"; import { ORPCError } from "@orpc/server"; -import { resolveModuleDocuments, type ParsedModuleDocument } from "@tarp/module/document-evaluator"; -import { documentIdentity } from "@tarp/module/document-path"; -import { validateDocumentValues } from "@tarp/module/document-type"; -import { validateAnswer } from "@tarp/module/flow"; -import { stringifyDocumentContent } from "@tarp/module/node/document-codec"; -import { validateInitialGameState } from "@tarp/module/node/game-state-validation"; -import { loadModuleMetadata } from "@tarp/module/node/module-metadata"; import { z } from "zod"; import { forgetRoomProjection, projectEntities } from "../game/room-state-projection"; diff --git a/packages/core/src/node/sessions/room-storage.ts b/packages/core/src/node/sessions/room-storage.ts index f234bc5..ab726b0 100644 --- a/packages/core/src/node/sessions/room-storage.ts +++ b/packages/core/src/node/sessions/room-storage.ts @@ -1,6 +1,6 @@ import { join } from "node:path"; -import { characterDraftSchema } from "@tarp/module/character"; +import { characterDraftSchema } from "@jointarp/module/character"; import { z } from "zod"; import { companionModelSchema } from "../../shared/companion"; diff --git a/packages/core/src/node/sessions/session-store.ts b/packages/core/src/node/sessions/session-store.ts index c6733c8..f3ee3b5 100644 --- a/packages/core/src/node/sessions/session-store.ts +++ b/packages/core/src/node/sessions/session-store.ts @@ -12,15 +12,15 @@ import { } from "node:fs/promises"; import { join, resolve } from "node:path"; +import { publicDocumentType } from "@jointarp/module/character"; +import { launchConfigSchema, validateLaunch } from "@jointarp/module/flow"; +import type { ModulePageDocument } from "@jointarp/module/module-document"; +import { loadDocumentTypes } from "@jointarp/module/node/document-types"; +import { validateInitialGameState } from "@jointarp/module/node/game-state-validation"; +import { loadModuleDocuments } from "@jointarp/module/node/module-documents"; +import { loadModuleMetadata } from "@jointarp/module/node/module-metadata"; +import { loadModulePages } from "@jointarp/module/node/module-pages"; import { ORPCError } from "@orpc/server"; -import { publicDocumentType } from "@tarp/module/character"; -import { launchConfigSchema, validateLaunch } from "@tarp/module/flow"; -import type { ModulePageDocument } from "@tarp/module/module-document"; -import { loadDocumentTypes } from "@tarp/module/node/document-types"; -import { validateInitialGameState } from "@tarp/module/node/game-state-validation"; -import { loadModuleDocuments } from "@tarp/module/node/module-documents"; -import { loadModuleMetadata } from "@tarp/module/node/module-metadata"; -import { loadModulePages } from "@tarp/module/node/module-pages"; import type { z } from "zod"; import type { gameDefaultsSchema } from "../../shared/game-defaults"; diff --git a/packages/core/src/node/storage/config-file.test.ts b/packages/core/src/node/storage/config-file.test.ts index 9a44a23..3a8296f 100644 --- a/packages/core/src/node/storage/config-file.test.ts +++ b/packages/core/src/node/storage/config-file.test.ts @@ -4,11 +4,11 @@ import { mkdir, mkdtemp, rm } from "node:fs/promises"; import { tmpdir } from "node:os"; import { join } from "node:path"; -import { parseConfig, stringifyConfig } from "@tarp/module/node/config-file"; -import { loadDocumentTypes } from "@tarp/module/node/document-types"; -import { loadModuleDocuments } from "@tarp/module/node/module-documents"; -import { loadModuleMetadata } from "@tarp/module/node/module-metadata"; -import { writeTestFile as writeFile } from "@tarp/module/testing/files"; +import { parseConfig, stringifyConfig } from "@jointarp/module/node/config-file"; +import { loadDocumentTypes } from "@jointarp/module/node/document-types"; +import { loadModuleDocuments } from "@jointarp/module/node/module-documents"; +import { loadModuleMetadata } from "@jointarp/module/node/module-metadata"; +import { writeTestFile as writeFile } from "@jointarp/module/testing/files"; import { createGameTools } from "../agent/game-tools"; import { createSession } from "../sessions/session-store"; diff --git a/packages/core/src/node/storage/config-file.ts b/packages/core/src/node/storage/config-file.ts index 6662522..a69a326 100644 --- a/packages/core/src/node/storage/config-file.ts +++ b/packages/core/src/node/storage/config-file.ts @@ -1,8 +1,8 @@ -import { parseConfig, stringifyConfig } from "@tarp/module/node/config-file"; +import { parseConfig, stringifyConfig } from "@jointarp/module/node/config-file"; import type { FileCodec } from "./structured-file"; -export { configFilePath } from "@tarp/module/node/config-file"; +export { configFilePath } from "@jointarp/module/node/config-file"; export const configFileCodec: FileCodec = { format: "JSON/TOML", diff --git a/packages/core/src/shared/launch.ts b/packages/core/src/shared/launch.ts index e45c15f..508d459 100644 --- a/packages/core/src/shared/launch.ts +++ b/packages/core/src/shared/launch.ts @@ -1,12 +1,12 @@ -import { characterDraftSchema, type Character } from "@tarp/module/character"; +import { characterDraftSchema, type Character } from "@jointarp/module/character"; import { creationAnswerSchema, creationProgressSchema, type WorkbenchView, -} from "@tarp/module/creation-workbench"; -import type { DocumentType } from "@tarp/module/document-type"; -import { flowAnswerSchema, flowRunSchema, type LaunchConfig } from "@tarp/module/flow"; -import type { ModuleDocument } from "@tarp/module/module-document"; +} from "@jointarp/module/creation-workbench"; +import type { DocumentType } from "@jointarp/module/document-type"; +import { flowAnswerSchema, flowRunSchema, type LaunchConfig } from "@jointarp/module/flow"; +import type { ModuleDocument } from "@jointarp/module/module-document"; import { z } from "zod"; import type { ChatMessage } from "./game"; diff --git a/packages/core/src/shared/narrative.ts b/packages/core/src/shared/narrative.ts index 8e1747a..43b9a7a 100644 --- a/packages/core/src/shared/narrative.ts +++ b/packages/core/src/shared/narrative.ts @@ -13,4 +13,4 @@ NPC 的 path 必须指向现有角色文档,从工作区根目录出发,保 公开正文只呈现玩家可感知的场景、人物反应、对话及必要规则说明,不泄露秘密、内部推理或工具原始结果。 正文支持 Markdown。提到资料关键词时主动用 [[文档路径]] 引用,无需玩家要求;保留类型目录、分组路径和文档名称,省略扩展名,同段只引用一次。有可见 image 时可用 ![简短描述](图片路径) 配图,无需确认,同一场景不重复展示。图片辅助叙述,不替代描写,不粘贴资料正文。仅用玩家当前可见的信息与实际路径,不用 _image;引用、图片及替代文本不得泄密。`; -export { parseNarrative, type NarrativeSegment } from "@tarp/module/narrative"; +export { parseNarrative, type NarrativeSegment } from "@jointarp/module/narrative"; diff --git a/packages/core/src/shared/room-state.ts b/packages/core/src/shared/room-state.ts index 0ba1049..4d42037 100644 --- a/packages/core/src/shared/room-state.ts +++ b/packages/core/src/shared/room-state.ts @@ -1,6 +1,6 @@ -import type { Character } from "@tarp/module/character"; -import type { LaunchConfig } from "@tarp/module/flow"; -import type { RawModuleDocument } from "@tarp/module/module-document"; +import type { Character } from "@jointarp/module/character"; +import type { LaunchConfig } from "@jointarp/module/flow"; +import type { RawModuleDocument } from "@jointarp/module/module-document"; import { z } from "zod"; import { identityIdSchema } from "./identity"; diff --git a/packages/core/src/shared/session.ts b/packages/core/src/shared/session.ts index 92b74fd..c6f0587 100644 --- a/packages/core/src/shared/session.ts +++ b/packages/core/src/shared/session.ts @@ -1,5 +1,5 @@ -import type { DocumentType } from "@tarp/module/document-type"; -import type { ModuleDocument, ModulePageDocument } from "@tarp/module/module-document"; +import type { DocumentType } from "@jointarp/module/document-type"; +import type { ModuleDocument, ModulePageDocument } from "@jointarp/module/module-document"; import { z } from "zod"; export const gameRoomSchema = z.object({ diff --git a/packages/core/src/testing/launch-module.ts b/packages/core/src/testing/launch-module.ts index ffc2713..da5c3ac 100644 --- a/packages/core/src/testing/launch-module.ts +++ b/packages/core/src/testing/launch-module.ts @@ -2,8 +2,8 @@ import { mkdir, mkdtemp, rm, writeFile } from "node:fs/promises"; import { tmpdir } from "node:os"; import { dirname, join } from "node:path"; -import { stringifyDocumentContent } from "@tarp/module/node/document-codec"; -import { createWorldStateDefinition } from "@tarp/module/testing/world-state"; +import { stringifyDocumentContent } from "@jointarp/module/node/document-codec"; +import { createWorldStateDefinition } from "@jointarp/module/testing/world-state"; /** 为文件存档及主持工具测试创建真实的临时模组,同时覆盖 TOML 配置和 JSON 文档。 */ export async function createLaunchTestModule() { diff --git a/packages/module-cli/README.md b/packages/module-cli/README.md index f9e86f2..380d1f3 100644 --- a/packages/module-cli/README.md +++ b/packages/module-cli/README.md @@ -1,13 +1,13 @@ # 模组开发 CLI -`@tarp/module-cli` 是同时支持 Node.js 和 Bun 的独立命令行子包。校验使用 `@tarp/module` 的真实加载器,无需桌面运行时、桌面构建或个人应用配置,不创建存档、不修改模组。 +`@jointarp/module-cli` 是同时支持 Node.js 和 Bun 的独立命令行子包。校验使用 `@jointarp/module` 的真实加载器,无需桌面运行时、桌面构建或个人应用配置,不创建存档、不修改模组。 ## npm 安装 发布到 npm 后,Node.js 22.12.0 或更新版本可直接运行 `tarp`;Bun 可显式执行同一份 JavaScript 产物: ```sh -npm install -g @tarp/module-cli +npm install -g @jointarp/module-cli tarp --help tarp module validate ./module --json ``` @@ -24,13 +24,13 @@ tarp module validate ./module --json ```sh bun install --frozen-lockfile -bun run --filter @tarp/module-cli build +bun run --filter @jointarp/module-cli build bun run cli --help bun run cli --version bun run cli module validate ./apps/desktop/examples/建卡控件演示 --json ``` -模组路径相对于命令执行目录解析,含空格的路径请加引号。子包提供基于 `#!/usr/bin/env node` 的 `tarp` 可执行入口,指向构建后的 `out/index.js`。也可以直接用 `node packages/module-cli/out/index.js` 或 `bun packages/module-cli/out/index.js` 执行。仅安装 Bun 时,使用显式 `bun` 命令;公开包发布后也可使用 `bunx --bun @tarp/module-cli`,避免按 Node.js shebang 启动。 +模组路径相对于命令执行目录解析,含空格的路径请加引号。子包提供基于 `#!/usr/bin/env node` 的 `tarp` 可执行入口,指向构建后的 `out/index.js`。也可以直接用 `node packages/module-cli/out/index.js` 或 `bun packages/module-cli/out/index.js` 执行。仅安装 Bun 时,使用显式 `bun` 命令;公开包发布后也可使用 `bunx --bun @jointarp/module-cli`,避免按 Node.js shebang 启动。 CLI 的校验输出与退出码属于共享协议:`0` 成功,`1` 校验或操作失败,`2` 参数错误。Agent 使用退出码及 JSON 字段判断,不依赖中文提示措辞。`--json` 包含 `schemaVersion`、`appVersion`、`status`、路径、数量和 `issues`;`appVersion` 是当前执行入口版本。 @@ -48,7 +48,7 @@ bun run build ## 打包与发布 -在本子包执行 `bun run pack`,生成 `out/tarp-module-cli.tgz`。构建通过 `Bun.build` 的 Node.js 目标,将 CLI 与 `@tarp/module` workspace 源码打进 `index.js`;第三方库不打入产物,发布目录中的 `package.json.dependencies` 声明其运行依赖,没有 `workspace:*` 或源码导出。 +在本子包执行 `bun run pack`,生成 `out/tarp-module-cli.tgz`。构建通过 `Bun.build` 的 Node.js 目标,将 CLI 与 `@jointarp/module` workspace 源码打进 `index.js`;第三方库不打入产物,发布目录中的 `package.json.dependencies` 声明其运行依赖,没有 `workspace:*` 或源码导出。 发布包只包含 `index.js`、`package.json`、README、GPL v3 LICENSE 和 NOTICE.md。发布时使用独立的 `out/` 目录。`bun run pack` 只生成本地产物,不上传到 npm。 diff --git a/packages/module-cli/package.json b/packages/module-cli/package.json index b18e62f..a1e2c46 100644 --- a/packages/module-cli/package.json +++ b/packages/module-cli/package.json @@ -1,5 +1,5 @@ { - "name": "@tarp/module-cli", + "name": "@jointarp/module-cli", "version": "0.1.0", "homepage": "https://jointarp.party", "license": "GPL-3.0-only", @@ -14,9 +14,9 @@ "cli": "bun out/index.js", "build": "bun scripts/build.mjs", "typecheck": "bun --bun x --no-install tsc --noEmit", - "test": "bun ../../scripts/test.ts --scope @tarp/module-cli", - "pack": "bun run build && bun pm pack --cwd out --filename tarp-module-cli.tgz", - "test:changed": "bun ../../scripts/test.ts --scope @tarp/module-cli --changed" + "test": "bun ../../scripts/test.ts --scope @jointarp/module-cli", + "pack": "bun ../../scripts/tasks.ts run build --filter=./packages/module-cli && bun pm pack --cwd out --filename tarp-module-cli.tgz", + "test:changed": "bun ../../scripts/test.ts --scope @jointarp/module-cli --changed" }, "dependencies": { "smol-toml": "^1.9.0", @@ -24,7 +24,7 @@ "zod": "^4.6.5" }, "devDependencies": { - "@tarp/module": "workspace:*", + "@jointarp/module": "workspace:*", "@types/bun": "^1.4.0", "typescript": "^7.0.2" }, diff --git a/packages/module-cli/src/commands.test.ts b/packages/module-cli/src/commands.test.ts index ca746b3..c2c653c 100644 --- a/packages/module-cli/src/commands.test.ts +++ b/packages/module-cli/src/commands.test.ts @@ -5,8 +5,8 @@ import { readFile, readdir, realpath, rm } from "node:fs/promises"; import { join } from "node:path"; import { promisify } from "node:util"; -import { writeTestFile as writeFile } from "@tarp/module/testing/files"; -import { createTestModule } from "@tarp/module/testing/test-module"; +import { writeTestFile as writeFile } from "@jointarp/module/testing/files"; +import { createTestModule } from "@jointarp/module/testing/test-module"; import { version } from "../package.json"; import { modulePreviewHash, parseModuleCommand, runModuleCommand } from "./commands"; diff --git a/packages/module-cli/src/commands.ts b/packages/module-cli/src/commands.ts index fe26378..8003a69 100644 --- a/packages/module-cli/src/commands.ts +++ b/packages/module-cli/src/commands.ts @@ -1,9 +1,9 @@ import { resolve } from "node:path"; import { parseArgs } from "node:util"; -import { loadDocumentTypes } from "@tarp/module/node/document-types"; -import { loadModuleMetadata } from "@tarp/module/node/module-metadata"; -import { validateModule } from "@tarp/module/node/validate-module"; +import { loadDocumentTypes } from "@jointarp/module/node/document-types"; +import { loadModuleMetadata } from "@jointarp/module/node/module-metadata"; +import { validateModule } from "@jointarp/module/node/validate-module"; export type ModuleCommand = | { readonly kind: "desktop" } diff --git a/packages/module/README.md b/packages/module/README.md index 4e69c48..ed5e8a8 100644 --- a/packages/module/README.md +++ b/packages/module/README.md @@ -1,10 +1,10 @@ # 模组共享能力 -`@tarp/module` 提供游戏服务核心、桌面应用与模组 CLI 共用的文档模型、字段计算和加载校验逻辑。房间生命周期与本局状态由 `@tarp/core` 管理,通用模组读取不依赖游戏服务。 +`@jointarp/module` 提供游戏服务核心、桌面应用与模组 CLI 共用的文档模型、字段计算和加载校验逻辑。房间生命周期与本局状态由 `@jointarp/core` 管理,通用模组读取不依赖游戏服务。 - 根级子路径:文档类型、元配置、引用、开局和计算字段等逻辑,可供前端与主进程使用。 -- `@tarp/module/node/*`:JSON/TOML/Markdown 编解码、文件加载、模组校验与 ZIP 安全解压,仅供具备文件系统能力的运行时使用。 -- `@tarp/module/testing/*`:平台测试共用的类型与临时副本工具。 +- `@jointarp/module/node/*`:JSON/TOML/Markdown 编解码、文件加载、模组校验与 ZIP 安全解压,仅供具备文件系统能力的运行时使用。 +- `@jointarp/module/testing/*`:平台测试共用的类型与临时副本工具。 `test-fixtures/platform/` 保存随 Git 维护的固定功能测试模组,不包含剧情或冒险规则。测试通过 `createTestModule()` 复制到独立临时目录,修改与存档只写入副本,结束后清理。 diff --git a/packages/module/package.json b/packages/module/package.json index aaab96d..ba0b359 100644 --- a/packages/module/package.json +++ b/packages/module/package.json @@ -1,5 +1,5 @@ { - "name": "@tarp/module", + "name": "@jointarp/module", "version": "0.1.0", "private": true, "license": "GPL-3.0-only", @@ -11,8 +11,8 @@ }, "scripts": { "typecheck": "bun --bun x --no-install tsc --noEmit", - "test": "bun ../../scripts/test.ts --scope @tarp/module", - "test:changed": "bun ../../scripts/test.ts --scope @tarp/module --changed" + "test": "bun ../../scripts/test.ts --scope @jointarp/module", + "test:changed": "bun ../../scripts/test.ts --scope @jointarp/module --changed" }, "dependencies": { "handlebars": "^4.7.10", diff --git a/packages/module/src/node/module-documents.test.ts b/packages/module/src/node/module-documents.test.ts index 331f731..b4ced67 100644 --- a/packages/module/src/node/module-documents.test.ts +++ b/packages/module/src/node/module-documents.test.ts @@ -4,7 +4,7 @@ import { mkdir, mkdtemp, rm } from "node:fs/promises"; import { tmpdir } from "node:os"; import { join } from "node:path"; -import { writeTestFile as writeFile } from "@tarp/module/testing/files"; +import { writeTestFile as writeFile } from "@jointarp/module/testing/files"; import { typeFormatLabel } from "../schema/document-path"; import { validateDocumentLayout, validateDocumentType } from "../schema/document-type"; diff --git a/packages/module/src/node/module-metadata.test.ts b/packages/module/src/node/module-metadata.test.ts index 06191e7..73c4beb 100644 --- a/packages/module/src/node/module-metadata.test.ts +++ b/packages/module/src/node/module-metadata.test.ts @@ -4,7 +4,7 @@ import { mkdir, mkdtemp, rm } from "node:fs/promises"; import { tmpdir } from "node:os"; import { join } from "node:path"; -import { writeTestFile as writeFile } from "@tarp/module/testing/files"; +import { writeTestFile as writeFile } from "@jointarp/module/testing/files"; import { loadModuleDocuments } from "./module-documents"; import { loadModuleMetadata } from "./module-metadata"; diff --git a/scripts/tasks.ts b/scripts/tasks.ts new file mode 100644 index 0000000..0896751 --- /dev/null +++ b/scripts/tasks.ts @@ -0,0 +1,18 @@ +import { resolve } from "node:path"; + +// 平台与实际 Bun 版本参与任务指纹,避免本地和不同 runner 误用缓存。 +const child = Bun.spawn( + [process.execPath, "x", "--no-install", "turbo", ...process.argv.slice(2)], + { + cwd: resolve(import.meta.dirname, ".."), + env: { + ...process.env, + TARP_TASK_PLATFORM: `${process.platform}-${process.arch}`, + TARP_TASK_BUN: Bun.version, + }, + stdin: "inherit", + stdout: "inherit", + stderr: "inherit", + }, +); +process.exit(await child.exited); diff --git a/scripts/test.ts b/scripts/test.ts index 6506106..0aef8de 100644 --- a/scripts/test.ts +++ b/scripts/test.ts @@ -4,21 +4,24 @@ const root = resolve(import.meta.dirname, ".."); const args = process.argv.slice(2); const scopeIndex = args.indexOf("--scope"); const scopes: Record = { - "@tarp/desktop": ["apps/desktop/src", "apps/desktop/scripts"], - "@tarp/core": ["packages/core/src"], - "@tarp/module": ["packages/module/src"], - "@tarp/module-cli": ["packages/module-cli/src"], + "@jointarp/desktop": ["apps/desktop/src", "apps/desktop/scripts"], + "@jointarp/core": ["packages/core/src"], + "@jointarp/module": ["packages/module/src"], + "@jointarp/module-cli": ["packages/module-cli/src"], }; const scope = scopeIndex >= 0 ? args.splice(scopeIndex, 2)[1] : undefined; if (scopeIndex >= 0 && !scope) throw new Error("请指定测试 workspace"); if (scope && !scopes[scope]) throw new Error(`未知测试范围:${scope}`); -// CLI 测试验证实际分发入口,不能依赖此前构建留下的文件。 -if (!scope || scope === "@tarp/module-cli") { - const build = Bun.spawn([process.execPath, "run", "--filter", "@tarp/module-cli", "build"], { - cwd: root, - stdout: "inherit", - stderr: "inherit", - }); +// CLI 测试验证实际分发入口;Turbo 按源码和运行环境构建或恢复对应产物。 +if (!scope || scope === "@jointarp/module-cli") { + const build = Bun.spawn( + [process.execPath, "scripts/tasks.ts", "run", "build", "--filter=./packages/module-cli"], + { + cwd: root, + stdout: "inherit", + stderr: "inherit", + }, + ); if (await build.exited) process.exit(1); } const ignored = scope diff --git a/turbo.json b/turbo.json new file mode 100644 index 0000000..04f2f16 --- /dev/null +++ b/turbo.json @@ -0,0 +1,50 @@ +{ + "$schema": "https://turborepo.dev/schema.json", + "globalDependencies": [ + "bunfig.toml", + "scripts/**/*.ts", + "scripts/**/*.mjs", + "LICENSE", + "NOTICE.md" + ], + "globalEnv": ["TARP_TASK_PLATFORM", "TARP_TASK_BUN", "NODE_ENV"], + "globalPassThroughEnv": [ + "HUTCH_HOME", + "DASH_HOME", + "BUN_INSTALL_CACHE_DIR", + "TMPDIR", + "TMP", + "TEMP" + ], + "tasks": { + "source": { + "dependsOn": ["^source"] + }, + "typecheck": { + "dependsOn": ["^source"], + "outputs": [] + }, + "build": { + "dependsOn": ["^source"], + "outputs": [ + "out/index.js", + "out/package.json", + "out/README.md", + "out/LICENSE", + "out/NOTICE.md" + ] + }, + "@jointarp/desktop#build": { + "dependsOn": ["^build"], + "cache": false, + "env": ["TARP_CODESIGN", "TARP_NOTARIZE", "ELECTROBUN_*"], + "outputs": [] + }, + "build:renderer": { + "dependsOn": ["^source"], + "env": ["VITE_*"], + "inputs": ["$TURBO_DEFAULT$", ".env", ".env.*", "src/renderer/.env", "src/renderer/.env.*"], + "outputs": ["out/renderer/**"] + } + } +} From 81d05336598c72860005dca016e04cccb99db897 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=94=A1=E5=BE=B7=E6=A3=AE?= Date: Wed, 21 Oct 2026 10:03:09 +0800 Subject: [PATCH 4/4] =?UTF-8?q?docs:=20=E7=A7=BB=E9=99=A4=20CLI=20?= =?UTF-8?q?=E5=8C=85=E5=90=8D=E5=B0=9A=E5=BE=85=E7=A1=AE=E8=AE=A4=E7=9A=84?= =?UTF-8?q?=E8=BF=87=E6=B8=A1=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/module-cli/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/module-cli/README.md b/packages/module-cli/README.md index 380d1f3..f77228e 100644 --- a/packages/module-cli/README.md +++ b/packages/module-cli/README.md @@ -12,7 +12,7 @@ tarp --help tarp module validate ./module --json ``` -安装时自动提供 YAML、Zod、smol-toml,不需要源码仓库。预览仍需安装桌面应用,并设置 `TARP_DESKTOP` 为其可执行文件路径。包名与 scope 需在实际发布前确认。 +安装时自动提供 YAML、Zod、smol-toml,不需要源码仓库。预览仍需安装桌面应用,并设置 `TARP_DESKTOP` 为其可执行文件路径。 完整使用说明只在「官网 CLI 指南」维护。本页保留 npm 最小入口及源码开发、协议验收和发布步骤。