@playcraft/cli 0.1.77 → 0.1.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -42,7 +42,7 @@ import { refreshWorkspaceArtifacts } from '../workspaces/artifact-events.js';
42
42
  import { WorkspaceArtifactStore } from '../workspaces/artifacts.js';
43
43
  import { OperationLogStore } from '../workspaces/operation-log.js';
44
44
  import { acceptOperationCore, observeLevelEditorTransaction } from './accept-operation.js';
45
- import { workspaceArtifactContentQuerySchema, workspaceBindingIdentity } from '@playcraft/common/cloud-workspace/runtime';
45
+ import { workspaceArtifactContentQuerySchema, workspaceBindingIdentity, } from '@playcraft/common/cloud-workspace/runtime';
46
46
  import { searchWorkspaceFiles } from '../workspaces/files-search.js';
47
47
  import { serveWorkspaceArchive } from '../workspaces/archive.js';
48
48
  import { verifyRuntimeAssetProvenance } from '../workspaces/asset-provenance-verifier.js';
@@ -79,6 +79,17 @@ export async function handleRuntimeRequest(state, request, response) {
79
79
  const directoryName = url.searchParams.get('directoryName') ?? 'basic';
80
80
  try {
81
81
  const readContext = { state, workspaceId: workspaceId ?? undefined, directoryName };
82
+ const isGitBundle = url.pathname === '/runtime/git-bundle';
83
+ if (directoryName === 'root' && (url.pathname === '/runtime/archive' || isGitBundle)) {
84
+ // 工作区包含 basic/ 和 remix-variant/ 时,网页下载整项目走 GET /runtime/archive,
85
+ // workspace clone --directory root 走 GET /runtime/git-bundle。两者都用 directoryName=root
86
+ // 指向工作区容器,原先的单目录预检会返回 409 invalid_workspace_directory。
87
+ // 容器路径由各自的处理器解析。关卡编辑器历史只支持工程子目录,
88
+ // 沙箱已有 level-editor-history 时,对 root 执行历史预检会报 level_editor_history_scope_invalid。
89
+ // 工作区级租约覆盖所有子目录。归档持共享租约,Git bundle 读取及推送预检持独占租约,
90
+ // 避免生成或核对 Git 快照时有其他受租约管理的操作修改工作区。
91
+ return await withDirectoryWrite(state, { ...readContext, mode: isGitBundle ? 'exclusive' : 'shared', wait: false }, () => dispatchRuntimeRequest(state, request, response));
92
+ }
82
93
  const root = await workspaceRoot(state, readContext.workspaceId, directoryName);
83
94
  if (await hasPendingLevelEditorTransaction(root, readContext)) {
84
95
  // A retained writer owns the exclusive lease. Reconcile that exact operation before admitting a reader.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playcraft/cli",
3
- "version": "0.1.77",
3
+ "version": "0.1.80",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "engines": {
@@ -57,8 +57,8 @@
57
57
  "@gltf-transform/core": "^4.3.0",
58
58
  "@gltf-transform/extensions": "^4.3.0",
59
59
  "@gltf-transform/functions": "^4.3.0",
60
- "@playcraft/build": "0.1.77",
61
- "@playcraft/common": "0.1.77",
60
+ "@playcraft/build": "0.1.80",
61
+ "@playcraft/common": "0.1.80",
62
62
  "better-sqlite3-pinned": "npm:better-sqlite3@13.0.3",
63
63
  "chokidar": "^4.0.3",
64
64
  "commander": "^13.1.0",