wp-typia 0.19.0 → 0.20.1
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.
- package/README.md +4 -2
- package/dist-bunli/.bunli/commands.gen.js +2117 -1465
- package/dist-bunli/.bunli/commands.gen.js.map +42 -35
- package/dist-bunli/cli-03j0axbt.js +163 -0
- package/dist-bunli/cli-03j0axbt.js.map +11 -0
- package/dist-bunli/{cli-yw0mq0wq.js → cli-93wd227r.js} +108 -3
- package/dist-bunli/cli-93wd227r.js.map +10 -0
- package/dist-bunli/{cli-kan7a6db.js → cli-a6dwqnhq.js} +24 -2
- package/dist-bunli/cli-a6dwqnhq.js.map +11 -0
- package/dist-bunli/{cli-add-j2c81sh1.js → cli-add-gcwww85p.js} +263 -250
- package/dist-bunli/cli-add-gcwww85p.js.map +18 -0
- package/dist-bunli/{cli-7svz19s1.js → cli-cfx3gm1r.js} +417 -129
- package/dist-bunli/{cli-7svz19s1.js.map → cli-cfx3gm1r.js.map} +18 -15
- package/dist-bunli/{cli-diagnostics-c65hhyhx.js → cli-diagnostics-e5gxeprp.js} +8 -4
- package/dist-bunli/{cli-diagnostics-c65hhyhx.js.map → cli-diagnostics-e5gxeprp.js.map} +1 -1
- package/dist-bunli/{cli-doctor-hft0wr0e.js → cli-doctor-qk6fwpds.js} +14 -13
- package/dist-bunli/{cli-doctor-hft0wr0e.js.map → cli-doctor-qk6fwpds.js.map} +3 -3
- package/dist-bunli/{cli-572d6g4m.js → cli-hv2yedw2.js} +2 -157
- package/dist-bunli/{cli-572d6g4m.js.map → cli-hv2yedw2.js.map} +4 -6
- package/dist-bunli/cli-mgh3f3k5.js +427 -0
- package/dist-bunli/cli-mgh3f3k5.js.map +12 -0
- package/dist-bunli/{cli-scaffold-vcg6wem5.js → cli-scaffold-f1bdt68d.js} +9 -7
- package/dist-bunli/cli-scaffold-f1bdt68d.js.map +10 -0
- package/dist-bunli/cli-t73q5aqz.js +103 -0
- package/dist-bunli/cli-t73q5aqz.js.map +10 -0
- package/dist-bunli/{cli-templates-4qxszbmc.js → cli-templates-j65r4k9v.js} +1 -1
- package/dist-bunli/{cli-wtrvnce5.js → cli-w4r0rr8a.js} +8 -8
- package/dist-bunli/cli-w4r0rr8a.js.map +10 -0
- package/dist-bunli/cli.js +127 -2863
- package/dist-bunli/cli.js.map +5 -56
- package/dist-bunli/command-list-66cqt7y8.js +2485 -0
- package/dist-bunli/command-list-66cqt7y8.js.map +58 -0
- package/dist-bunli/node-cli.js +432 -323
- package/dist-bunli/node-cli.js.map +11 -10
- package/dist-bunli/{sync-x91y9jtv.js → sync-k2k8svyc.js} +3 -2
- package/dist-bunli/{sync-x91y9jtv.js.map → sync-k2k8svyc.js.map} +1 -1
- package/package.json +6 -3
- package/dist-bunli/cli-add-j2c81sh1.js.map +0 -16
- package/dist-bunli/cli-kan7a6db.js.map +0 -11
- package/dist-bunli/cli-scaffold-vcg6wem5.js.map +0 -10
- package/dist-bunli/cli-wtrvnce5.js.map +0 -10
- package/dist-bunli/cli-yw0mq0wq.js.map +0 -10
- /package/dist-bunli/{cli-templates-4qxszbmc.js.map → cli-templates-j65r4k9v.js.map} +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
|
+
CLI_DIAGNOSTIC_CODES,
|
|
3
4
|
CliDiagnosticError,
|
|
4
5
|
createCliCommandError,
|
|
5
6
|
formatCliDiagnosticError,
|
|
@@ -7,10 +8,12 @@ import {
|
|
|
7
8
|
formatDoctorSummaryLine,
|
|
8
9
|
getDoctorFailureDetailLines,
|
|
9
10
|
getFailingDoctorChecks,
|
|
10
|
-
isCliDiagnosticError
|
|
11
|
-
|
|
11
|
+
isCliDiagnosticError,
|
|
12
|
+
serializeCliDiagnosticError
|
|
13
|
+
} from "./cli-93wd227r.js";
|
|
12
14
|
import"./cli-xnn9xjcy.js";
|
|
13
15
|
export {
|
|
16
|
+
serializeCliDiagnosticError,
|
|
14
17
|
isCliDiagnosticError,
|
|
15
18
|
getFailingDoctorChecks,
|
|
16
19
|
getDoctorFailureDetailLines,
|
|
@@ -18,7 +21,8 @@ export {
|
|
|
18
21
|
formatDoctorCheckLine,
|
|
19
22
|
formatCliDiagnosticError,
|
|
20
23
|
createCliCommandError,
|
|
21
|
-
CliDiagnosticError
|
|
24
|
+
CliDiagnosticError,
|
|
25
|
+
CLI_DIAGNOSTIC_CODES
|
|
22
26
|
};
|
|
23
27
|
|
|
24
|
-
//# debugId=
|
|
28
|
+
//# debugId=D7A37B51FF87D98264756E2164756E21
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
// @bun
|
|
2
|
+
import {
|
|
3
|
+
createCliCommandError,
|
|
4
|
+
formatDoctorCheckLine,
|
|
5
|
+
formatDoctorSummaryLine,
|
|
6
|
+
getDoctorFailureDetailLines
|
|
7
|
+
} from "./cli-93wd227r.js";
|
|
2
8
|
import {
|
|
3
9
|
getBuiltInTemplateLayerDirs,
|
|
4
10
|
isOmittableBuiltInTemplateLayerDir
|
|
5
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-w4r0rr8a.js";
|
|
6
12
|
import {
|
|
7
13
|
isBuiltInTemplateId,
|
|
8
14
|
listTemplates
|
|
9
|
-
} from "./cli-
|
|
15
|
+
} from "./cli-a6dwqnhq.js";
|
|
10
16
|
import {
|
|
11
17
|
EDITOR_PLUGIN_SLOT_IDS,
|
|
12
18
|
HOOKED_BLOCK_ANCHOR_PATTERN,
|
|
@@ -15,18 +21,13 @@ import {
|
|
|
15
21
|
REST_RESOURCE_NAMESPACE_PATTERN,
|
|
16
22
|
readWorkspaceInventory
|
|
17
23
|
} from "./cli-rg481yks.js";
|
|
24
|
+
import"./cli-t73q5aqz.js";
|
|
18
25
|
import {
|
|
19
26
|
WORKSPACE_TEMPLATE_PACKAGE,
|
|
20
27
|
getInvalidWorkspaceProjectReason,
|
|
21
28
|
parseWorkspacePackageJson,
|
|
22
29
|
tryResolveWorkspaceProject
|
|
23
30
|
} from "./cli-pd5pqgre.js";
|
|
24
|
-
import {
|
|
25
|
-
createCliCommandError,
|
|
26
|
-
formatDoctorCheckLine,
|
|
27
|
-
formatDoctorSummaryLine,
|
|
28
|
-
getDoctorFailureDetailLines
|
|
29
|
-
} from "./cli-yw0mq0wq.js";
|
|
30
31
|
import"./cli-xnn9xjcy.js";
|
|
31
32
|
|
|
32
33
|
// ../wp-typia-project-tools/src/runtime/cli-doctor-environment.ts
|
|
@@ -414,20 +415,20 @@ function getWorkspaceDoctorChecks(cwd) {
|
|
|
414
415
|
invalidWorkspaceReason = getInvalidWorkspaceProjectReason(cwd);
|
|
415
416
|
workspace = tryResolveWorkspaceProject(cwd);
|
|
416
417
|
} catch (error) {
|
|
417
|
-
checks.push(createDoctorScopeCheck("fail", "Environment checks ran, but workspace discovery could not continue. Fix the nearby workspace package metadata and rerun `wp-typia doctor`."));
|
|
418
|
+
checks.push(createDoctorScopeCheck("fail", "Scope: blocked before workspace checks. Environment checks ran, but workspace discovery could not continue. Fix the nearby workspace package metadata and rerun `wp-typia doctor`."));
|
|
418
419
|
checks.push(createDoctorCheck2("Workspace package metadata", "fail", error instanceof Error ? error.message : String(error)));
|
|
419
420
|
return checks;
|
|
420
421
|
}
|
|
421
422
|
if (!workspace) {
|
|
422
423
|
if (invalidWorkspaceReason) {
|
|
423
|
-
checks.push(createDoctorScopeCheck("fail", "Environment checks ran, but workspace diagnostics could not continue because a nearby wp-typia workspace candidate is invalid. Fix the workspace package metadata and rerun `wp-typia doctor`."));
|
|
424
|
+
checks.push(createDoctorScopeCheck("fail", "Scope: blocked before workspace checks. Environment checks ran, but workspace diagnostics could not continue because a nearby wp-typia workspace candidate is invalid. Fix the workspace package metadata and rerun `wp-typia doctor`."));
|
|
424
425
|
checks.push(createDoctorCheck2("Workspace package metadata", "fail", invalidWorkspaceReason));
|
|
425
426
|
} else {
|
|
426
|
-
checks.push(createDoctorScopeCheck("pass", "No official wp-typia workspace root was detected, so this run only covered environment readiness. Re-run `wp-typia doctor` from a workspace root if you expected package metadata, inventory, or generated artifact checks."));
|
|
427
|
+
checks.push(createDoctorScopeCheck("pass", "Scope: environment-only. No official wp-typia workspace root was detected, so this run only covered environment readiness. Re-run `wp-typia doctor` from a workspace root if you expected package metadata, inventory, or generated artifact checks."));
|
|
427
428
|
}
|
|
428
429
|
return checks;
|
|
429
430
|
}
|
|
430
|
-
checks.push(createDoctorScopeCheck("pass", `
|
|
431
|
+
checks.push(createDoctorScopeCheck("pass", `Scope: full workspace diagnostics for ${workspace.workspace.namespace}. Environment readiness checks ran and workspace-scoped diagnostics are enabled for the package metadata, inventory, source-tree drift, and any configured migration hint rows below.`));
|
|
431
432
|
let workspacePackageJson;
|
|
432
433
|
try {
|
|
433
434
|
workspacePackageJson = parseWorkspacePackageJson(workspace.projectDir);
|
|
@@ -532,4 +533,4 @@ export {
|
|
|
532
533
|
getDoctorChecks
|
|
533
534
|
};
|
|
534
535
|
|
|
535
|
-
//# debugId=
|
|
536
|
+
//# debugId=BACE4BB4FC84F0EB64756E2164756E21
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
"sources": ["../../wp-typia-project-tools/src/runtime/cli-doctor-environment.ts", "../../wp-typia-project-tools/src/runtime/cli-doctor-workspace.ts", "../../wp-typia-project-tools/src/runtime/cli-doctor.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
5
|
"import { execFileSync } from \"node:child_process\";\nimport { access, constants as fsConstants, rm, writeFile } from \"node:fs/promises\";\nimport fs from \"node:fs\";\nimport os from \"node:os\";\nimport path from \"node:path\";\n\nimport {\n\tgetBuiltInTemplateLayerDirs,\n\tisOmittableBuiltInTemplateLayerDir,\n} from \"./template-builtins.js\";\nimport { isBuiltInTemplateId, listTemplates } from \"./template-registry.js\";\n\nimport type { DoctorCheck } from \"./cli-doctor.js\";\n\nfunction readCommandVersion(command: string, args: string[] = [\"--version\"]): string | null {\n\ttry {\n\t\treturn execFileSync(command, args, {\n\t\t\tencoding: \"utf8\",\n\t\t\tstdio: [\"ignore\", \"pipe\", \"ignore\"],\n\t\t}).trim();\n\t} catch {\n\t\treturn null;\n\t}\n}\n\nfunction compareMajorVersion(actualVersion: string, minimumMajor: number): boolean {\n\tconst parsed = Number.parseInt(actualVersion.replace(/^v/, \"\").split(\".\")[0] ?? \"\", 10);\n\treturn Number.isFinite(parsed) && parsed >= minimumMajor;\n}\n\nasync function checkWritableDirectory(directory: string): Promise<boolean> {\n\ttry {\n\t\tawait access(directory, fsConstants.W_OK);\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nasync function checkTempDirectory(): Promise<boolean> {\n\tconst tempFile = path.join(os.tmpdir(), `wp-typia-${Date.now()}.tmp`);\n\ttry {\n\t\tawait writeFile(tempFile, \"ok\", \"utf8\");\n\t\tawait rm(tempFile, { force: true });\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nfunction createDoctorCheck(\n\tlabel: string,\n\tstatus: DoctorCheck[\"status\"],\n\tdetail: string,\n): DoctorCheck {\n\treturn { detail, label, status };\n}\n\nfunction getTemplateDoctorChecks(): DoctorCheck[] {\n\tconst checks: DoctorCheck[] = [];\n\n\tfor (const template of listTemplates()) {\n\t\tif (!isBuiltInTemplateId(template.id)) {\n\t\t\tconst templateDirExists = fs.existsSync(template.templateDir);\n\t\t\tconst hasAssets =\n\t\t\t\ttemplateDirExists &&\n\t\t\t\tfs.existsSync(path.join(template.templateDir, \"package.json.mustache\"));\n\t\t\tchecks.push({\n\t\t\t\tstatus: !templateDirExists || hasAssets ? \"pass\" : \"fail\",\n\t\t\t\tlabel: `Template ${template.id}`,\n\t\t\t\tdetail: !templateDirExists\n\t\t\t\t\t? \"External template metadata only; local overlay package is not installed.\"\n\t\t\t\t\t: hasAssets\n\t\t\t\t\t\t? template.templateDir\n\t\t\t\t\t\t: \"Missing core template assets\",\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst builtInTemplateId = template.id;\n\t\tconst layerDirs =\n\t\t\tbuiltInTemplateId === \"persistence\"\n\t\t\t\t? Array.from(\n\t\t\t\t\t\tnew Set([\n\t\t\t\t\t\t\t...getBuiltInTemplateLayerDirs(builtInTemplateId, { persistencePolicy: \"authenticated\" }),\n\t\t\t\t\t\t\t...getBuiltInTemplateLayerDirs(builtInTemplateId, { persistencePolicy: \"public\" }),\n\t\t\t\t\t\t]),\n\t\t\t\t\t)\n\t\t\t\t: builtInTemplateId === \"compound\"\n\t\t\t\t\t? Array.from(\n\t\t\t\t\t\t\tnew Set([\n\t\t\t\t\t\t\t\t...getBuiltInTemplateLayerDirs(builtInTemplateId),\n\t\t\t\t\t\t\t\t...getBuiltInTemplateLayerDirs(builtInTemplateId, {\n\t\t\t\t\t\t\t\t\tpersistenceEnabled: true,\n\t\t\t\t\t\t\t\t\tpersistencePolicy: \"authenticated\",\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t...getBuiltInTemplateLayerDirs(builtInTemplateId, {\n\t\t\t\t\t\t\t\t\tpersistenceEnabled: true,\n\t\t\t\t\t\t\t\t\tpersistencePolicy: \"public\",\n\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t)\n\t\t\t\t\t: getBuiltInTemplateLayerDirs(builtInTemplateId);\n\t\tconst missingRequiredLayer = layerDirs.some(\n\t\t\t(layerDir) =>\n\t\t\t\t!fs.existsSync(layerDir) &&\n\t\t\t\t!isOmittableBuiltInTemplateLayerDir(builtInTemplateId, layerDir),\n\t\t);\n\t\tconst existingLayerDirs = layerDirs.filter((layerDir) => fs.existsSync(layerDir));\n\t\tconst hasAssets =\n\t\t\t!missingRequiredLayer &&\n\t\t\texistingLayerDirs.some((layerDir) =>\n\t\t\t\tfs.existsSync(path.join(layerDir, \"package.json.mustache\")),\n\t\t\t) &&\n\t\t\texistingLayerDirs.some((layerDir) => fs.existsSync(path.join(layerDir, \"src\")));\n\t\tchecks.push({\n\t\t\tstatus: hasAssets ? \"pass\" : \"fail\",\n\t\t\tlabel: `Template ${template.id}`,\n\t\t\tdetail: hasAssets\n\t\t\t\t? existingLayerDirs.join(\" + \")\n\t\t\t\t: \"Missing core template assets\",\n\t\t});\n\t}\n\n\treturn checks;\n}\n\n/**\n * Collect environment-scoped doctor checks for the current working directory.\n *\n * The returned rows cover Bun/Node/git availability, writability of the\n * current working directory and OS temp directory, and built-in or external\n * template asset integrity in display order.\n *\n * @param cwd Working directory validated for writability.\n * @returns Ordered environment check rows ready for CLI rendering.\n */\nexport async function getEnvironmentDoctorChecks(cwd: string): Promise<DoctorCheck[]> {\n\tconst bunVersion = readCommandVersion(\"bun\");\n\tconst nodeVersion = readCommandVersion(\"node\");\n\tconst gitVersion = readCommandVersion(\"git\");\n\tconst cwdWritable = await checkWritableDirectory(cwd);\n\tconst tempWritable = await checkTempDirectory();\n\n\treturn [\n\t\tcreateDoctorCheck(\n\t\t\t\"Bun\",\n\t\t\tbunVersion && compareMajorVersion(bunVersion, 1) ? \"pass\" : \"fail\",\n\t\t\tbunVersion ? `Detected ${bunVersion}` : \"Not available\",\n\t\t),\n\t\tcreateDoctorCheck(\n\t\t\t\"Node\",\n\t\t\tnodeVersion && compareMajorVersion(nodeVersion, 20) ? \"pass\" : \"fail\",\n\t\t\tnodeVersion ? `Detected ${nodeVersion}` : \"Not available\",\n\t\t),\n\t\tcreateDoctorCheck(\"git\", gitVersion ? \"pass\" : \"fail\", gitVersion ?? \"Not available\"),\n\t\tcreateDoctorCheck(\n\t\t\t\"Current directory\",\n\t\t\tcwdWritable ? \"pass\" : \"fail\",\n\t\t\tcwdWritable ? \"Writable\" : \"Not writable\",\n\t\t),\n\t\tcreateDoctorCheck(\n\t\t\t\"Temp directory\",\n\t\t\ttempWritable ? \"pass\" : \"fail\",\n\t\t\ttempWritable ? \"Writable\" : \"Not writable\",\n\t\t),\n\t\t...getTemplateDoctorChecks(),\n\t];\n}\n",
|
|
6
|
-
"import fs from \"node:fs\";\nimport path from \"node:path\";\n\nimport { parseScaffoldBlockMetadata } from \"@wp-typia/block-runtime/blocks\";\n\nimport {\n\tEDITOR_PLUGIN_SLOT_IDS,\n\tREST_RESOURCE_METHOD_IDS,\n\tREST_RESOURCE_NAMESPACE_PATTERN,\n} from \"./cli-add-shared.js\";\nimport {\n\tHOOKED_BLOCK_ANCHOR_PATTERN,\n\tHOOKED_BLOCK_POSITION_SET,\n} from \"./hooked-blocks.js\";\nimport { readWorkspaceInventory, type WorkspaceInventory } from \"./workspace-inventory.js\";\nimport {\n\tgetInvalidWorkspaceProjectReason,\n\tparseWorkspacePackageJson,\n\tWORKSPACE_TEMPLATE_PACKAGE,\n\ttryResolveWorkspaceProject,\n\ttype WorkspacePackageJson,\n\ttype WorkspaceProject,\n} from \"./workspace-project.js\";\n\nimport type { DoctorCheck } from \"./cli-doctor.js\";\n\nconst WORKSPACE_COLLECTION_IMPORT_LINE = \"import '../../collection';\";\nconst WORKSPACE_COLLECTION_IMPORT_PATTERN = /^\\s*import\\s+[\"']\\.\\.\\/\\.\\.\\/collection[\"']\\s*;?\\s*$/m;\nconst WORKSPACE_BINDING_SERVER_GLOB = \"/src/bindings/*/server.php\";\nconst WORKSPACE_BINDING_EDITOR_SCRIPT = \"build/bindings/index.js\";\nconst WORKSPACE_BINDING_EDITOR_ASSET = \"build/bindings/index.asset.php\";\nconst WORKSPACE_REST_RESOURCE_GLOB = \"/inc/rest/*.php\";\nconst WORKSPACE_EDITOR_PLUGIN_EDITOR_SCRIPT = \"build/editor-plugins/index.js\";\nconst WORKSPACE_EDITOR_PLUGIN_EDITOR_ASSET = \"build/editor-plugins/index.asset.php\";\nconst WORKSPACE_EDITOR_PLUGIN_EDITOR_STYLE = \"build/editor-plugins/style-index.css\";\nconst WORKSPACE_GENERATED_BLOCK_ARTIFACTS = [\n\t\"block.json\",\n\t\"typia.manifest.json\",\n\t\"typia.schema.json\",\n\t\"typia-validator.php\",\n\t\"typia.openapi.json\",\n] as const;\n\nfunction createDoctorCheck(\n\tlabel: string,\n\tstatus: DoctorCheck[\"status\"],\n\tdetail: string,\n): DoctorCheck {\n\treturn { detail, label, status };\n}\n\nfunction createDoctorScopeCheck(\n\tstatus: DoctorCheck[\"status\"],\n\tdetail: string,\n): DoctorCheck {\n\treturn createDoctorCheck(\"Doctor scope\", status, detail);\n}\n\nfunction escapeRegex(value: string): string {\n\treturn value.replace(/[.*+?^${}()|[\\]\\\\]/gu, \"\\\\$&\");\n}\n\nfunction getWorkspaceBootstrapRelativePath(packageName: string): string {\n\tconst packageBaseName = packageName.split(\"/\").pop() ?? packageName;\n\treturn `${packageBaseName}.php`;\n}\n\nfunction checkExistingFiles(\n\tprojectDir: string,\n\tlabel: string,\n\tfilePaths: Array<string | undefined>,\n): DoctorCheck {\n\tconst missing = filePaths\n\t\t.filter((filePath): filePath is string => typeof filePath === \"string\")\n\t\t.filter((filePath) => !fs.existsSync(path.join(projectDir, filePath)));\n\treturn createDoctorCheck(\n\t\tlabel,\n\t\tmissing.length === 0 ? \"pass\" : \"fail\",\n\t\tmissing.length === 0 ? \"All referenced files exist\" : `Missing: ${missing.join(\", \")}`,\n\t);\n}\n\nfunction checkWorkspacePackageMetadata(\n\tworkspace: WorkspaceProject,\n\tpackageJson: WorkspacePackageJson,\n): DoctorCheck {\n\tconst issues: string[] = [];\n\tconst packageName = packageJson.name;\n\tconst bootstrapRelativePath = getWorkspaceBootstrapRelativePath(\n\t\ttypeof packageName === \"string\" && packageName.length > 0 ? packageName : workspace.packageName,\n\t);\n\tconst wpTypia = packageJson.wpTypia;\n\n\tif (typeof packageName !== \"string\" || packageName.length === 0) {\n\t\tissues.push(\"package.json must define a string name for workspace bootstrap resolution\");\n\t}\n\tif (wpTypia?.projectType !== \"workspace\") {\n\t\tissues.push('wpTypia.projectType must be \"workspace\"');\n\t}\n\tif (wpTypia?.templatePackage !== WORKSPACE_TEMPLATE_PACKAGE) {\n\t\tissues.push(`wpTypia.templatePackage must be \"${WORKSPACE_TEMPLATE_PACKAGE}\"`);\n\t}\n\tif (wpTypia?.namespace !== workspace.workspace.namespace) {\n\t\tissues.push(`wpTypia.namespace must equal \"${workspace.workspace.namespace}\"`);\n\t}\n\tif (wpTypia?.textDomain !== workspace.workspace.textDomain) {\n\t\tissues.push(`wpTypia.textDomain must equal \"${workspace.workspace.textDomain}\"`);\n\t}\n\tif (wpTypia?.phpPrefix !== workspace.workspace.phpPrefix) {\n\t\tissues.push(`wpTypia.phpPrefix must equal \"${workspace.workspace.phpPrefix}\"`);\n\t}\n\tif (!fs.existsSync(path.join(workspace.projectDir, bootstrapRelativePath))) {\n\t\tissues.push(`Missing bootstrap file ${bootstrapRelativePath}`);\n\t}\n\n\treturn createDoctorCheck(\n\t\t\"Workspace package metadata\",\n\t\tissues.length === 0 ? \"pass\" : \"fail\",\n\t\tissues.length === 0\n\t\t\t? `package.json metadata aligns with ${workspace.packageName} and ${bootstrapRelativePath}`\n\t\t\t: issues.join(\"; \"),\n\t);\n}\n\nfunction getWorkspaceBlockRequiredFiles(\n\tblock: WorkspaceInventory[\"blocks\"][number],\n): string[] {\n\tconst blockDir = path.join(\"src\", \"blocks\", block.slug);\n\n\treturn Array.from(\n\t\tnew Set(\n\t\t\t[\n\t\t\t\tblock.typesFile,\n\t\t\t\tblock.apiTypesFile,\n\t\t\t\tblock.openApiFile,\n\t\t\t\tpath.join(blockDir, \"index.tsx\"),\n\t\t\t\t...WORKSPACE_GENERATED_BLOCK_ARTIFACTS.map((fileName) => path.join(blockDir, fileName)),\n\t\t\t].filter((filePath): filePath is string => typeof filePath === \"string\"),\n\t\t),\n\t);\n}\n\nfunction checkWorkspaceBlockMetadata(\n\tprojectDir: string,\n\tworkspace: WorkspaceProject,\n\tblock: WorkspaceInventory[\"blocks\"][number],\n): DoctorCheck {\n\tconst blockJsonRelativePath = path.join(\"src\", \"blocks\", block.slug, \"block.json\");\n\tconst blockJsonPath = path.join(projectDir, blockJsonRelativePath);\n\n\tif (!fs.existsSync(blockJsonPath)) {\n\t\treturn createDoctorCheck(\n\t\t\t`Block metadata ${block.slug}`,\n\t\t\t\"fail\",\n\t\t\t`Missing ${blockJsonRelativePath}`,\n\t\t);\n\t}\n\n\tlet blockJson: { name: string; textdomain?: string };\n\ttry {\n\t\tblockJson = parseScaffoldBlockMetadata<{ textdomain?: string }>(\n\t\t\tJSON.parse(fs.readFileSync(blockJsonPath, \"utf8\")),\n\t\t);\n\t} catch (error) {\n\t\treturn createDoctorCheck(\n\t\t\t`Block metadata ${block.slug}`,\n\t\t\t\"fail\",\n\t\t\terror instanceof Error ? error.message : String(error),\n\t\t);\n\t}\n\n\tconst expectedName = `${workspace.workspace.namespace}/${block.slug}`;\n\tconst issues: string[] = [];\n\tif (blockJson.name !== expectedName) {\n\t\tissues.push(`block.json name must equal \"${expectedName}\"`);\n\t}\n\tif (blockJson.textdomain !== workspace.workspace.textDomain) {\n\t\tissues.push(`block.json textdomain must equal \"${workspace.workspace.textDomain}\"`);\n\t}\n\n\treturn createDoctorCheck(\n\t\t`Block metadata ${block.slug}`,\n\t\tissues.length === 0 ? \"pass\" : \"fail\",\n\t\tissues.length === 0\n\t\t\t? `block.json matches ${expectedName} and ${workspace.workspace.textDomain}`\n\t\t\t: issues.join(\"; \"),\n\t);\n}\n\nfunction checkWorkspaceBlockHooks(\n\tprojectDir: string,\n\tblockSlug: string,\n): DoctorCheck {\n\tconst blockJsonRelativePath = path.join(\"src\", \"blocks\", blockSlug, \"block.json\");\n\tconst blockJsonPath = path.join(projectDir, blockJsonRelativePath);\n\n\tif (!fs.existsSync(blockJsonPath)) {\n\t\treturn createDoctorCheck(\n\t\t\t`Block hooks ${blockSlug}`,\n\t\t\t\"fail\",\n\t\t\t`Missing ${blockJsonRelativePath}`,\n\t\t);\n\t}\n\n\tlet blockJson: Record<string, unknown> & { blockHooks?: unknown };\n\ttry {\n\t\tblockJson = parseScaffoldBlockMetadata<Record<string, unknown> & { blockHooks?: unknown }>(\n\t\t\tJSON.parse(fs.readFileSync(blockJsonPath, \"utf8\")),\n\t\t);\n\t} catch (error) {\n\t\treturn createDoctorCheck(\n\t\t\t`Block hooks ${blockSlug}`,\n\t\t\t\"fail\",\n\t\t\terror instanceof Error ? error.message : String(error),\n\t\t);\n\t}\n\n\tconst blockHooks = blockJson.blockHooks;\n\tif (blockHooks === undefined) {\n\t\treturn createDoctorCheck(\n\t\t\t`Block hooks ${blockSlug}`,\n\t\t\t\"pass\",\n\t\t\t\"No blockHooks metadata configured\",\n\t\t);\n\t}\n\tif (!blockHooks || typeof blockHooks !== \"object\" || Array.isArray(blockHooks)) {\n\t\treturn createDoctorCheck(\n\t\t\t`Block hooks ${blockSlug}`,\n\t\t\t\"fail\",\n\t\t\t`${blockJsonRelativePath} must define blockHooks as an object when present.`,\n\t\t);\n\t}\n\n\tconst blockName =\n\t\ttypeof blockJson.name === \"string\" && blockJson.name.trim().length > 0\n\t\t\t? blockJson.name.trim()\n\t\t\t: null;\n\tconst invalidEntries = Object.entries(blockHooks).filter(\n\t\t([anchor, position]) =>\n\t\t\t(blockName !== null && anchor.trim() === blockName) ||\n\t\t\tanchor.trim().length === 0 ||\n\t\t\tanchor !== anchor.trim() ||\n\t\t\t!HOOKED_BLOCK_ANCHOR_PATTERN.test(anchor) ||\n\t\t\ttypeof position !== \"string\" ||\n\t\t\t!HOOKED_BLOCK_POSITION_SET.has(position),\n\t);\n\n\treturn createDoctorCheck(\n\t\t`Block hooks ${blockSlug}`,\n\t\tinvalidEntries.length === 0 ? \"pass\" : \"fail\",\n\t\tinvalidEntries.length === 0\n\t\t\t? `blockHooks metadata is valid${Object.keys(blockHooks).length > 0 ? ` (${Object.keys(blockHooks).join(\", \")})` : \"\"}`\n\t\t\t: `Invalid blockHooks entries: ${invalidEntries\n\t\t\t\t\t.map(([anchor, position]) => `${anchor || \"<empty>\"} => ${String(position)}`)\n\t\t\t\t\t.join(\", \")}`,\n\t);\n}\n\nfunction checkWorkspaceBlockCollectionImport(\n\tprojectDir: string,\n\tblockSlug: string,\n): DoctorCheck {\n\tconst entryRelativePath = path.join(\"src\", \"blocks\", blockSlug, \"index.tsx\");\n\tconst entryPath = path.join(projectDir, entryRelativePath);\n\n\tif (!fs.existsSync(entryPath)) {\n\t\treturn createDoctorCheck(\n\t\t\t`Block collection ${blockSlug}`,\n\t\t\t\"fail\",\n\t\t\t`Missing ${entryRelativePath}`,\n\t\t);\n\t}\n\n\tconst source = fs.readFileSync(entryPath, \"utf8\");\n\tconst hasCollectionImport = WORKSPACE_COLLECTION_IMPORT_PATTERN.test(source);\n\treturn createDoctorCheck(\n\t\t`Block collection ${blockSlug}`,\n\t\thasCollectionImport ? \"pass\" : \"fail\",\n\t\thasCollectionImport\n\t\t\t? \"Shared block collection import is present\"\n\t\t\t: `Missing a shared collection import like ${WORKSPACE_COLLECTION_IMPORT_LINE}`,\n\t);\n}\n\nfunction checkWorkspacePatternBootstrap(projectDir: string, packageName: string): DoctorCheck {\n\tconst packageBaseName = packageName.split(\"/\").pop() ?? packageName;\n\tconst bootstrapPath = path.join(projectDir, `${packageBaseName}.php`);\n\tif (!fs.existsSync(bootstrapPath)) {\n\t\treturn createDoctorCheck(\"Pattern bootstrap\", \"fail\", `Missing ${path.basename(bootstrapPath)}`);\n\t}\n\tconst source = fs.readFileSync(bootstrapPath, \"utf8\");\n\tconst hasCategoryAnchor = source.includes(\"register_block_pattern_category\");\n\tconst hasPatternGlob = source.includes(\"/src/patterns/*.php\");\n\treturn createDoctorCheck(\n\t\t\"Pattern bootstrap\",\n\t\thasCategoryAnchor && hasPatternGlob ? \"pass\" : \"fail\",\n\t\thasCategoryAnchor && hasPatternGlob\n\t\t\t? \"Pattern category and loader hooks are present\"\n\t\t\t: \"Missing pattern category registration or src/patterns loader hook\",\n\t);\n}\n\nfunction checkWorkspaceBindingBootstrap(projectDir: string, packageName: string): DoctorCheck {\n\tconst packageBaseName = packageName.split(\"/\").pop() ?? packageName;\n\tconst bootstrapPath = path.join(projectDir, `${packageBaseName}.php`);\n\tif (!fs.existsSync(bootstrapPath)) {\n\t\treturn createDoctorCheck(\n\t\t\t\"Binding bootstrap\",\n\t\t\t\"fail\",\n\t\t\t`Missing ${path.basename(bootstrapPath)}`,\n\t\t);\n\t}\n\n\tconst source = fs.readFileSync(bootstrapPath, \"utf8\");\n\tconst hasServerGlob = source.includes(WORKSPACE_BINDING_SERVER_GLOB);\n\tconst hasEditorEnqueueHook = source.includes(\"enqueue_block_editor_assets\");\n\tconst hasEditorScript = source.includes(WORKSPACE_BINDING_EDITOR_SCRIPT);\n\tconst hasEditorAsset = source.includes(WORKSPACE_BINDING_EDITOR_ASSET);\n\n\treturn createDoctorCheck(\n\t\t\"Binding bootstrap\",\n\t\thasServerGlob && hasEditorEnqueueHook && hasEditorScript && hasEditorAsset ? \"pass\" : \"fail\",\n\t\thasServerGlob && hasEditorEnqueueHook && hasEditorScript && hasEditorAsset\n\t\t\t? \"Binding source PHP and editor bootstrap hooks are present\"\n\t\t\t: \"Missing binding source PHP require glob or editor enqueue hook\",\n\t);\n}\n\nfunction checkWorkspaceBindingSourcesIndex(\n\tprojectDir: string,\n\tbindingSources: WorkspaceInventory[\"bindingSources\"],\n): DoctorCheck {\n\tconst indexRelativePath = [path.join(\"src\", \"bindings\", \"index.ts\"), path.join(\"src\", \"bindings\", \"index.js\")].find(\n\t\t(relativePath) => fs.existsSync(path.join(projectDir, relativePath)),\n\t);\n\n\tif (!indexRelativePath) {\n\t\treturn createDoctorCheck(\n\t\t\t\"Binding sources index\",\n\t\t\t\"fail\",\n\t\t\t\"Missing src/bindings/index.ts or src/bindings/index.js\",\n\t\t);\n\t}\n\n\tconst indexPath = path.join(projectDir, indexRelativePath);\n\tconst source = fs.readFileSync(indexPath, \"utf8\");\n\tconst missingImports = bindingSources.filter(\n\t\t(bindingSource) => !source.includes(`./${bindingSource.slug}/editor`),\n\t);\n\n\treturn createDoctorCheck(\n\t\t\"Binding sources index\",\n\t\tmissingImports.length === 0 ? \"pass\" : \"fail\",\n\t\tmissingImports.length === 0\n\t\t\t? \"Binding source editor registrations are aggregated\"\n\t\t\t: `Missing editor imports for: ${missingImports.map((entry) => entry.slug).join(\", \")}`,\n\t);\n}\n\nfunction getWorkspaceRestResourceRequiredFiles(\n\trestResource: WorkspaceInventory[\"restResources\"][number],\n): string[] {\n\tconst schemaNames = new Set<string>();\n\tif (restResource.methods.includes(\"list\")) {\n\t\tschemaNames.add(\"list-query\");\n\t\tschemaNames.add(\"list-response\");\n\t}\n\tif (restResource.methods.includes(\"read\")) {\n\t\tschemaNames.add(\"read-query\");\n\t\tschemaNames.add(\"read-response\");\n\t}\n\tif (restResource.methods.includes(\"create\")) {\n\t\tschemaNames.add(\"create-request\");\n\t\tschemaNames.add(\"create-response\");\n\t}\n\tif (restResource.methods.includes(\"update\")) {\n\t\tschemaNames.add(\"update-query\");\n\t\tschemaNames.add(\"update-request\");\n\t\tschemaNames.add(\"update-response\");\n\t}\n\tif (restResource.methods.includes(\"delete\")) {\n\t\tschemaNames.add(\"delete-query\");\n\t\tschemaNames.add(\"delete-response\");\n\t}\n\n\treturn Array.from(\n\t\tnew Set([\n\t\t\trestResource.apiFile,\n\t\t\t...Array.from(schemaNames, (schemaName) =>\n\t\t\t\tpath.join(\n\t\t\t\t\tpath.dirname(restResource.typesFile),\n\t\t\t\t\t\"api-schemas\",\n\t\t\t\t\t`${schemaName}.schema.json`,\n\t\t\t\t),\n\t\t\t),\n\t\t\trestResource.clientFile,\n\t\t\trestResource.dataFile,\n\t\t\trestResource.openApiFile,\n\t\t\trestResource.phpFile,\n\t\t\trestResource.typesFile,\n\t\t\trestResource.validatorsFile,\n\t\t]),\n\t);\n}\n\nfunction checkWorkspaceRestResourceConfig(\n\trestResource: WorkspaceInventory[\"restResources\"][number],\n): DoctorCheck {\n\tconst hasNamespace = REST_RESOURCE_NAMESPACE_PATTERN.test(restResource.namespace);\n\tconst hasMethods =\n\t\trestResource.methods.length > 0 &&\n\t\trestResource.methods.every((method) =>\n\t\t\t(REST_RESOURCE_METHOD_IDS as readonly string[]).includes(method),\n\t\t);\n\n\treturn createDoctorCheck(\n\t\t`REST resource config ${restResource.slug}`,\n\t\thasNamespace && hasMethods ? \"pass\" : \"fail\",\n\t\thasNamespace && hasMethods\n\t\t\t? `REST resource namespace ${restResource.namespace} with methods ${restResource.methods.join(\", \")}`\n\t\t\t: \"REST resource namespace or methods are invalid\",\n\t);\n}\n\nfunction checkWorkspaceRestResourceBootstrap(\n\tprojectDir: string,\n\tpackageName: string,\n\tphpPrefix: string,\n): DoctorCheck {\n\tconst packageBaseName = packageName.split(\"/\").pop() ?? packageName;\n\tconst bootstrapPath = path.join(projectDir, `${packageBaseName}.php`);\n\tif (!fs.existsSync(bootstrapPath)) {\n\t\treturn createDoctorCheck(\n\t\t\t\"REST resource bootstrap\",\n\t\t\t\"fail\",\n\t\t\t`Missing ${path.basename(bootstrapPath)}`,\n\t\t);\n\t}\n\n\tconst source = fs.readFileSync(bootstrapPath, \"utf8\");\n\tconst registerFunctionName = `${phpPrefix}_register_rest_resources`;\n\tconst registerHook = `add_action( 'init', '${registerFunctionName}', 20 );`;\n\tconst hasServerGlob = source.includes(WORKSPACE_REST_RESOURCE_GLOB);\n\tconst hasRegisterHook = source.includes(registerHook);\n\n\treturn createDoctorCheck(\n\t\t\"REST resource bootstrap\",\n\t\thasServerGlob && hasRegisterHook ? \"pass\" : \"fail\",\n\t\thasServerGlob && hasRegisterHook\n\t\t\t? \"REST resource PHP loader hook is present\"\n\t\t\t: \"Missing REST resource PHP require glob or init hook\",\n\t);\n}\n\nfunction getWorkspaceEditorPluginRequiredFiles(\n\teditorPlugin: WorkspaceInventory[\"editorPlugins\"][number],\n): string[] {\n\tconst editorPluginDir = path.join(\"src\", \"editor-plugins\", editorPlugin.slug);\n\n\treturn Array.from(\n\t\tnew Set([\n\t\t\teditorPlugin.file,\n\t\t\tpath.join(editorPluginDir, \"Sidebar.tsx\"),\n\t\t\tpath.join(editorPluginDir, \"data.ts\"),\n\t\t\tpath.join(editorPluginDir, \"types.ts\"),\n\t\t\tpath.join(editorPluginDir, \"style.scss\"),\n\t\t]),\n\t);\n}\n\nfunction checkWorkspaceEditorPluginConfig(\n\teditorPlugin: WorkspaceInventory[\"editorPlugins\"][number],\n): DoctorCheck {\n\tconst validSlots = new Set<string>(EDITOR_PLUGIN_SLOT_IDS);\n\tconst isValidSlot = validSlots.has(editorPlugin.slot);\n\n\treturn createDoctorCheck(\n\t\t`Editor plugin config ${editorPlugin.slug}`,\n\t\tisValidSlot ? \"pass\" : \"fail\",\n\t\tisValidSlot\n\t\t\t? `Editor plugin slot ${editorPlugin.slot} is supported`\n\t\t\t: `Unsupported editor plugin slot \"${editorPlugin.slot}\". Expected one of: ${EDITOR_PLUGIN_SLOT_IDS.join(\", \")}`,\n\t);\n}\n\nfunction checkWorkspaceEditorPluginBootstrap(\n\tprojectDir: string,\n\tpackageName: string,\n\tphpPrefix: string,\n): DoctorCheck {\n\tconst packageBaseName = packageName.split(\"/\").pop() ?? packageName;\n\tconst bootstrapPath = path.join(projectDir, `${packageBaseName}.php`);\n\tif (!fs.existsSync(bootstrapPath)) {\n\t\treturn createDoctorCheck(\n\t\t\t\"Editor plugin bootstrap\",\n\t\t\t\"fail\",\n\t\t\t`Missing ${path.basename(bootstrapPath)}`,\n\t\t);\n\t}\n\n\tconst source = fs.readFileSync(bootstrapPath, \"utf8\");\n\tconst enqueueFunctionName = `${phpPrefix}_enqueue_editor_plugins_editor`;\n\tconst enqueueHook = `add_action( 'enqueue_block_editor_assets', '${enqueueFunctionName}' );`;\n\tconst hasEditorEnqueueHook = source.includes(enqueueHook);\n\tconst hasEditorScript = source.includes(WORKSPACE_EDITOR_PLUGIN_EDITOR_SCRIPT);\n\tconst hasEditorAsset = source.includes(WORKSPACE_EDITOR_PLUGIN_EDITOR_ASSET);\n\tconst hasEditorStyle = source.includes(WORKSPACE_EDITOR_PLUGIN_EDITOR_STYLE);\n\n\treturn createDoctorCheck(\n\t\t\"Editor plugin bootstrap\",\n\t\thasEditorEnqueueHook && hasEditorScript && hasEditorAsset && hasEditorStyle ? \"pass\" : \"fail\",\n\t\thasEditorEnqueueHook && hasEditorScript && hasEditorAsset && hasEditorStyle\n\t\t\t? \"Editor plugin enqueue hook is present\"\n\t\t\t: \"Missing editor plugin enqueue hook or build/editor-plugins script/style asset references\",\n\t);\n}\n\nfunction checkWorkspaceEditorPluginIndex(\n\tprojectDir: string,\n\teditorPlugins: WorkspaceInventory[\"editorPlugins\"],\n): DoctorCheck {\n\tconst indexRelativePath = [\n\t\tpath.join(\"src\", \"editor-plugins\", \"index.ts\"),\n\t\tpath.join(\"src\", \"editor-plugins\", \"index.js\"),\n\t].find((relativePath) => fs.existsSync(path.join(projectDir, relativePath)));\n\n\tif (!indexRelativePath) {\n\t\treturn createDoctorCheck(\n\t\t\t\"Editor plugins index\",\n\t\t\t\"fail\",\n\t\t\t\"Missing src/editor-plugins/index.ts or src/editor-plugins/index.js\",\n\t\t);\n\t}\n\n\tconst indexPath = path.join(projectDir, indexRelativePath);\n\tconst source = fs.readFileSync(indexPath, \"utf8\");\n\tconst missingImports = editorPlugins.filter((editorPlugin) => {\n\t\tconst importPattern = new RegExp(\n\t\t\t`['\"\\`]\\\\./${escapeRegex(editorPlugin.slug)}(?:/[^'\"\\`]*)?['\"\\`]`,\n\t\t\t\"u\",\n\t\t);\n\t\treturn !importPattern.test(source);\n\t});\n\n\treturn createDoctorCheck(\n\t\t\"Editor plugins index\",\n\t\tmissingImports.length === 0 ? \"pass\" : \"fail\",\n\t\tmissingImports.length === 0\n\t\t\t? \"Editor plugin registrations are aggregated\"\n\t\t\t: `Missing editor plugin imports for: ${missingImports\n\t\t\t\t\t.map((entry) => entry.slug)\n\t\t\t\t\t.join(\", \")}`,\n\t);\n}\n\nfunction checkVariationEntrypoint(projectDir: string, blockSlug: string): DoctorCheck {\n\tconst entryPath = path.join(projectDir, \"src\", \"blocks\", blockSlug, \"index.tsx\");\n\tif (!fs.existsSync(entryPath)) {\n\t\treturn createDoctorCheck(\n\t\t\t`Variation entrypoint ${blockSlug}`,\n\t\t\t\"fail\",\n\t\t\t`Missing ${path.relative(projectDir, entryPath)}`,\n\t\t);\n\t}\n\tconst source = fs.readFileSync(entryPath, \"utf8\");\n\tconst hasImport = source.includes(\"./variations\");\n\tconst hasCall = source.includes(\"registerWorkspaceVariations()\");\n\treturn createDoctorCheck(\n\t\t`Variation entrypoint ${blockSlug}`,\n\t\thasImport && hasCall ? \"pass\" : \"fail\",\n\t\thasImport && hasCall\n\t\t\t? \"Variations registration hook is present\"\n\t\t\t: \"Missing ./variations import or registerWorkspaceVariations() call\",\n\t);\n}\n\nfunction checkMigrationWorkspaceHint(\n\tworkspace: WorkspaceProject,\n\tpackageJson: WorkspacePackageJson,\n): DoctorCheck | null {\n\tconst hasMigrationScript = typeof packageJson.scripts?.[\"migration:doctor\"] === \"string\";\n\tconst migrationConfigRelativePath = path.join(\"src\", \"migrations\", \"config.ts\");\n\tconst hasMigrationConfig = fs.existsSync(\n\t\tpath.join(workspace.projectDir, migrationConfigRelativePath),\n\t);\n\n\tif (!hasMigrationScript && !hasMigrationConfig) {\n\t\treturn null;\n\t}\n\n\treturn createDoctorCheck(\n\t\t\"Migration workspace\",\n\t\thasMigrationConfig ? \"pass\" : \"fail\",\n\t\thasMigrationConfig\n\t\t\t? \"Run `wp-typia migrate doctor --all` for migration target, snapshot, fixture, and generated artifact checks\"\n\t\t\t: `Missing ${migrationConfigRelativePath} for the configured migration workspace`,\n\t);\n}\n\n/**\n * Collect workspace-scoped doctor checks for the given working directory.\n *\n * When the directory is not an official workspace, the function returns a\n * \"Doctor scope\" row explaining that only environment checks ran, plus a\n * failing workspace metadata row when a nearby candidate workspace is invalid.\n * When workspace resolution or metadata parsing throws, the corresponding\n * failing rows are returned early and the remaining checks are skipped.\n * When an official workspace is detected, a passing \"Doctor scope\" row is\n * emitted first so the remaining package metadata, inventory, source-tree\n * drift, and optional migration hint rows are clearly framed as workspace\n * diagnostics for that run.\n *\n * @param cwd Working directory expected to host an official workspace.\n * @returns Ordered workspace check rows ready for CLI rendering.\n */\nexport function getWorkspaceDoctorChecks(cwd: string): DoctorCheck[] {\n\tconst checks: DoctorCheck[] = [];\n\n\tlet workspace: WorkspaceProject | null = null;\n\tlet invalidWorkspaceReason: string | null = null;\n\ttry {\n\t\tinvalidWorkspaceReason = getInvalidWorkspaceProjectReason(cwd);\n\t\tworkspace = tryResolveWorkspaceProject(cwd);\n\t} catch (error) {\n\t\tchecks.push(\n\t\t\tcreateDoctorScopeCheck(\n\t\t\t\t\"fail\",\n\t\t\t\t\"Environment checks ran, but workspace discovery could not continue. Fix the nearby workspace package metadata and rerun `wp-typia doctor`.\",\n\t\t\t),\n\t\t);\n\t\tchecks.push(\n\t\t\tcreateDoctorCheck(\n\t\t\t\t\"Workspace package metadata\",\n\t\t\t\t\"fail\",\n\t\t\t\terror instanceof Error ? error.message : String(error),\n\t\t\t),\n\t\t);\n\t\treturn checks;\n\t}\n\tif (!workspace) {\n\t\tif (invalidWorkspaceReason) {\n\t\t\tchecks.push(\n\t\t\t\tcreateDoctorScopeCheck(\n\t\t\t\t\t\"fail\",\n\t\t\t\t\t\"Environment checks ran, but workspace diagnostics could not continue because a nearby wp-typia workspace candidate is invalid. Fix the workspace package metadata and rerun `wp-typia doctor`.\",\n\t\t\t\t),\n\t\t\t);\n\t\t\tchecks.push(\n\t\t\t\tcreateDoctorCheck(\n\t\t\t\t\t\"Workspace package metadata\",\n\t\t\t\t\t\"fail\",\n\t\t\t\t\tinvalidWorkspaceReason,\n\t\t\t\t),\n\t\t\t);\n\t\t} else {\n\t\t\tchecks.push(\n\t\t\t\tcreateDoctorScopeCheck(\n\t\t\t\t\t\"pass\",\n\t\t\t\t\t\"No official wp-typia workspace root was detected, so this run only covered environment readiness. Re-run `wp-typia doctor` from a workspace root if you expected package metadata, inventory, or generated artifact checks.\",\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\t\treturn checks;\n\t}\n\n\tchecks.push(\n\t\tcreateDoctorScopeCheck(\n\t\t\t\"pass\",\n\t\t\t`Official workspace detected for ${workspace.workspace.namespace}; environment readiness checks ran and workspace-scoped diagnostics are enabled for the package metadata, inventory, source-tree drift, and any configured migration hint rows below.`,\n\t\t),\n\t);\n\n\tlet workspacePackageJson: WorkspacePackageJson;\n\ttry {\n\t\tworkspacePackageJson = parseWorkspacePackageJson(workspace.projectDir);\n\t} catch (error) {\n\t\tchecks.push(\n\t\t\tcreateDoctorCheck(\n\t\t\t\t\"Workspace package metadata\",\n\t\t\t\t\"fail\",\n\t\t\t\terror instanceof Error ? error.message : String(error),\n\t\t\t),\n\t\t);\n\t\treturn checks;\n\t}\n\n\tchecks.push(checkWorkspacePackageMetadata(workspace, workspacePackageJson));\n\n\ttry {\n\t\tconst inventory = readWorkspaceInventory(workspace.projectDir);\n\t\tchecks.push(\n\t\t\tcreateDoctorCheck(\n\t\t\t\t\"Workspace inventory\",\n\t\t\t\t\"pass\",\n\t\t\t\t`${inventory.blocks.length} block(s), ${inventory.variations.length} variation(s), ${inventory.patterns.length} pattern(s), ${inventory.bindingSources.length} binding source(s), ${inventory.restResources.length} REST resource(s), ${inventory.editorPlugins.length} editor plugin(s)`,\n\t\t\t),\n\t\t);\n\n\t\tfor (const block of inventory.blocks) {\n\t\t\tchecks.push(\n\t\t\t\tcheckExistingFiles(\n\t\t\t\t\tworkspace.projectDir,\n\t\t\t\t\t`Block ${block.slug}`,\n\t\t\t\t\tgetWorkspaceBlockRequiredFiles(block),\n\t\t\t\t),\n\t\t\t);\n\t\t\tchecks.push(checkWorkspaceBlockMetadata(workspace.projectDir, workspace, block));\n\t\t\tchecks.push(checkWorkspaceBlockHooks(workspace.projectDir, block.slug));\n\t\t\tchecks.push(checkWorkspaceBlockCollectionImport(workspace.projectDir, block.slug));\n\t\t}\n\n\t\tconst registeredBlockSlugs = new Set(inventory.blocks.map((block) => block.slug));\n\t\tconst variationTargetBlocks = new Set<string>();\n\t\tfor (const variation of inventory.variations) {\n\t\t\tif (!registeredBlockSlugs.has(variation.block)) {\n\t\t\t\tchecks.push(\n\t\t\t\t\tcreateDoctorCheck(\n\t\t\t\t\t\t`Variation ${variation.block}/${variation.slug}`,\n\t\t\t\t\t\t\"fail\",\n\t\t\t\t\t\t`Variation references unknown block \"${variation.block}\"`,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tvariationTargetBlocks.add(variation.block);\n\t\t\tchecks.push(\n\t\t\t\tcheckExistingFiles(\n\t\t\t\t\tworkspace.projectDir,\n\t\t\t\t\t`Variation ${variation.block}/${variation.slug}`,\n\t\t\t\t\t[variation.file],\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\t\tfor (const blockSlug of variationTargetBlocks) {\n\t\t\tchecks.push(checkVariationEntrypoint(workspace.projectDir, blockSlug));\n\t\t}\n\n\t\tconst shouldCheckPatternBootstrap =\n\t\t\tinventory.patterns.length > 0 ||\n\t\t\tfs.existsSync(path.join(workspace.projectDir, \"src\", \"patterns\"));\n\t\tif (shouldCheckPatternBootstrap) {\n\t\t\tchecks.push(checkWorkspacePatternBootstrap(workspace.projectDir, workspace.packageName));\n\t\t}\n\t\tfor (const pattern of inventory.patterns) {\n\t\t\tchecks.push(\n\t\t\t\tcheckExistingFiles(workspace.projectDir, `Pattern ${pattern.slug}`, [pattern.file]),\n\t\t\t);\n\t\t}\n\n\t\tif (inventory.bindingSources.length > 0) {\n\t\t\tchecks.push(checkWorkspaceBindingBootstrap(workspace.projectDir, workspace.packageName));\n\t\t\tchecks.push(\n\t\t\t\tcheckWorkspaceBindingSourcesIndex(workspace.projectDir, inventory.bindingSources),\n\t\t\t);\n\t\t}\n\t\tfor (const bindingSource of inventory.bindingSources) {\n\t\t\tchecks.push(\n\t\t\t\tcheckExistingFiles(workspace.projectDir, `Binding source ${bindingSource.slug}`, [\n\t\t\t\t\tbindingSource.serverFile,\n\t\t\t\t\tbindingSource.editorFile,\n\t\t\t\t]),\n\t\t\t);\n\t\t}\n\n\t\tif (inventory.restResources.length > 0) {\n\t\t\tchecks.push(\n\t\t\t\tcheckWorkspaceRestResourceBootstrap(\n\t\t\t\t\tworkspace.projectDir,\n\t\t\t\t\tworkspace.packageName,\n\t\t\t\t\tworkspace.workspace.phpPrefix,\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\t\tfor (const restResource of inventory.restResources) {\n\t\t\tchecks.push(checkWorkspaceRestResourceConfig(restResource));\n\t\t\tchecks.push(\n\t\t\t\tcheckExistingFiles(\n\t\t\t\t\tworkspace.projectDir,\n\t\t\t\t\t`REST resource ${restResource.slug}`,\n\t\t\t\t\tgetWorkspaceRestResourceRequiredFiles(restResource),\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\n\t\tif (inventory.editorPlugins.length > 0) {\n\t\t\tchecks.push(\n\t\t\t\tcheckWorkspaceEditorPluginBootstrap(\n\t\t\t\t\tworkspace.projectDir,\n\t\t\t\t\tworkspace.packageName,\n\t\t\t\t\tworkspace.workspace.phpPrefix,\n\t\t\t\t),\n\t\t\t);\n\t\t\tchecks.push(\n\t\t\t\tcheckWorkspaceEditorPluginIndex(workspace.projectDir, inventory.editorPlugins),\n\t\t\t);\n\t\t}\n\t\tfor (const editorPlugin of inventory.editorPlugins) {\n\t\t\tchecks.push(\n\t\t\t\tcheckExistingFiles(\n\t\t\t\t\tworkspace.projectDir,\n\t\t\t\t\t`Editor plugin ${editorPlugin.slug}`,\n\t\t\t\t\tgetWorkspaceEditorPluginRequiredFiles(editorPlugin),\n\t\t\t\t),\n\t\t\t);\n\t\t\tchecks.push(checkWorkspaceEditorPluginConfig(editorPlugin));\n\t\t}\n\n\t\tconst migrationWorkspaceCheck = checkMigrationWorkspaceHint(\n\t\t\tworkspace,\n\t\t\tworkspacePackageJson,\n\t\t);\n\t\tif (migrationWorkspaceCheck) {\n\t\t\tchecks.push(migrationWorkspaceCheck);\n\t\t}\n\t} catch (error) {\n\t\tchecks.push(\n\t\t\tcreateDoctorCheck(\n\t\t\t\t\"Workspace inventory\",\n\t\t\t\t\"fail\",\n\t\t\t\terror instanceof Error ? error.message : String(error),\n\t\t\t),\n\t\t);\n\t}\n\n\treturn checks;\n}\n",
|
|
6
|
+
"import fs from \"node:fs\";\nimport path from \"node:path\";\n\nimport { parseScaffoldBlockMetadata } from \"@wp-typia/block-runtime/blocks\";\n\nimport {\n\tEDITOR_PLUGIN_SLOT_IDS,\n\tREST_RESOURCE_METHOD_IDS,\n\tREST_RESOURCE_NAMESPACE_PATTERN,\n} from \"./cli-add-shared.js\";\nimport {\n\tHOOKED_BLOCK_ANCHOR_PATTERN,\n\tHOOKED_BLOCK_POSITION_SET,\n} from \"./hooked-blocks.js\";\nimport { readWorkspaceInventory, type WorkspaceInventory } from \"./workspace-inventory.js\";\nimport {\n\tgetInvalidWorkspaceProjectReason,\n\tparseWorkspacePackageJson,\n\tWORKSPACE_TEMPLATE_PACKAGE,\n\ttryResolveWorkspaceProject,\n\ttype WorkspacePackageJson,\n\ttype WorkspaceProject,\n} from \"./workspace-project.js\";\n\nimport type { DoctorCheck } from \"./cli-doctor.js\";\n\nconst WORKSPACE_COLLECTION_IMPORT_LINE = \"import '../../collection';\";\nconst WORKSPACE_COLLECTION_IMPORT_PATTERN = /^\\s*import\\s+[\"']\\.\\.\\/\\.\\.\\/collection[\"']\\s*;?\\s*$/m;\nconst WORKSPACE_BINDING_SERVER_GLOB = \"/src/bindings/*/server.php\";\nconst WORKSPACE_BINDING_EDITOR_SCRIPT = \"build/bindings/index.js\";\nconst WORKSPACE_BINDING_EDITOR_ASSET = \"build/bindings/index.asset.php\";\nconst WORKSPACE_REST_RESOURCE_GLOB = \"/inc/rest/*.php\";\nconst WORKSPACE_EDITOR_PLUGIN_EDITOR_SCRIPT = \"build/editor-plugins/index.js\";\nconst WORKSPACE_EDITOR_PLUGIN_EDITOR_ASSET = \"build/editor-plugins/index.asset.php\";\nconst WORKSPACE_EDITOR_PLUGIN_EDITOR_STYLE = \"build/editor-plugins/style-index.css\";\nconst WORKSPACE_GENERATED_BLOCK_ARTIFACTS = [\n\t\"block.json\",\n\t\"typia.manifest.json\",\n\t\"typia.schema.json\",\n\t\"typia-validator.php\",\n\t\"typia.openapi.json\",\n] as const;\n\nfunction createDoctorCheck(\n\tlabel: string,\n\tstatus: DoctorCheck[\"status\"],\n\tdetail: string,\n): DoctorCheck {\n\treturn { detail, label, status };\n}\n\nfunction createDoctorScopeCheck(\n\tstatus: DoctorCheck[\"status\"],\n\tdetail: string,\n): DoctorCheck {\n\treturn createDoctorCheck(\"Doctor scope\", status, detail);\n}\n\nfunction escapeRegex(value: string): string {\n\treturn value.replace(/[.*+?^${}()|[\\]\\\\]/gu, \"\\\\$&\");\n}\n\nfunction getWorkspaceBootstrapRelativePath(packageName: string): string {\n\tconst packageBaseName = packageName.split(\"/\").pop() ?? packageName;\n\treturn `${packageBaseName}.php`;\n}\n\nfunction checkExistingFiles(\n\tprojectDir: string,\n\tlabel: string,\n\tfilePaths: Array<string | undefined>,\n): DoctorCheck {\n\tconst missing = filePaths\n\t\t.filter((filePath): filePath is string => typeof filePath === \"string\")\n\t\t.filter((filePath) => !fs.existsSync(path.join(projectDir, filePath)));\n\treturn createDoctorCheck(\n\t\tlabel,\n\t\tmissing.length === 0 ? \"pass\" : \"fail\",\n\t\tmissing.length === 0 ? \"All referenced files exist\" : `Missing: ${missing.join(\", \")}`,\n\t);\n}\n\nfunction checkWorkspacePackageMetadata(\n\tworkspace: WorkspaceProject,\n\tpackageJson: WorkspacePackageJson,\n): DoctorCheck {\n\tconst issues: string[] = [];\n\tconst packageName = packageJson.name;\n\tconst bootstrapRelativePath = getWorkspaceBootstrapRelativePath(\n\t\ttypeof packageName === \"string\" && packageName.length > 0 ? packageName : workspace.packageName,\n\t);\n\tconst wpTypia = packageJson.wpTypia;\n\n\tif (typeof packageName !== \"string\" || packageName.length === 0) {\n\t\tissues.push(\"package.json must define a string name for workspace bootstrap resolution\");\n\t}\n\tif (wpTypia?.projectType !== \"workspace\") {\n\t\tissues.push('wpTypia.projectType must be \"workspace\"');\n\t}\n\tif (wpTypia?.templatePackage !== WORKSPACE_TEMPLATE_PACKAGE) {\n\t\tissues.push(`wpTypia.templatePackage must be \"${WORKSPACE_TEMPLATE_PACKAGE}\"`);\n\t}\n\tif (wpTypia?.namespace !== workspace.workspace.namespace) {\n\t\tissues.push(`wpTypia.namespace must equal \"${workspace.workspace.namespace}\"`);\n\t}\n\tif (wpTypia?.textDomain !== workspace.workspace.textDomain) {\n\t\tissues.push(`wpTypia.textDomain must equal \"${workspace.workspace.textDomain}\"`);\n\t}\n\tif (wpTypia?.phpPrefix !== workspace.workspace.phpPrefix) {\n\t\tissues.push(`wpTypia.phpPrefix must equal \"${workspace.workspace.phpPrefix}\"`);\n\t}\n\tif (!fs.existsSync(path.join(workspace.projectDir, bootstrapRelativePath))) {\n\t\tissues.push(`Missing bootstrap file ${bootstrapRelativePath}`);\n\t}\n\n\treturn createDoctorCheck(\n\t\t\"Workspace package metadata\",\n\t\tissues.length === 0 ? \"pass\" : \"fail\",\n\t\tissues.length === 0\n\t\t\t? `package.json metadata aligns with ${workspace.packageName} and ${bootstrapRelativePath}`\n\t\t\t: issues.join(\"; \"),\n\t);\n}\n\nfunction getWorkspaceBlockRequiredFiles(\n\tblock: WorkspaceInventory[\"blocks\"][number],\n): string[] {\n\tconst blockDir = path.join(\"src\", \"blocks\", block.slug);\n\n\treturn Array.from(\n\t\tnew Set(\n\t\t\t[\n\t\t\t\tblock.typesFile,\n\t\t\t\tblock.apiTypesFile,\n\t\t\t\tblock.openApiFile,\n\t\t\t\tpath.join(blockDir, \"index.tsx\"),\n\t\t\t\t...WORKSPACE_GENERATED_BLOCK_ARTIFACTS.map((fileName) => path.join(blockDir, fileName)),\n\t\t\t].filter((filePath): filePath is string => typeof filePath === \"string\"),\n\t\t),\n\t);\n}\n\nfunction checkWorkspaceBlockMetadata(\n\tprojectDir: string,\n\tworkspace: WorkspaceProject,\n\tblock: WorkspaceInventory[\"blocks\"][number],\n): DoctorCheck {\n\tconst blockJsonRelativePath = path.join(\"src\", \"blocks\", block.slug, \"block.json\");\n\tconst blockJsonPath = path.join(projectDir, blockJsonRelativePath);\n\n\tif (!fs.existsSync(blockJsonPath)) {\n\t\treturn createDoctorCheck(\n\t\t\t`Block metadata ${block.slug}`,\n\t\t\t\"fail\",\n\t\t\t`Missing ${blockJsonRelativePath}`,\n\t\t);\n\t}\n\n\tlet blockJson: { name: string; textdomain?: string };\n\ttry {\n\t\tblockJson = parseScaffoldBlockMetadata<{ textdomain?: string }>(\n\t\t\tJSON.parse(fs.readFileSync(blockJsonPath, \"utf8\")),\n\t\t);\n\t} catch (error) {\n\t\treturn createDoctorCheck(\n\t\t\t`Block metadata ${block.slug}`,\n\t\t\t\"fail\",\n\t\t\terror instanceof Error ? error.message : String(error),\n\t\t);\n\t}\n\n\tconst expectedName = `${workspace.workspace.namespace}/${block.slug}`;\n\tconst issues: string[] = [];\n\tif (blockJson.name !== expectedName) {\n\t\tissues.push(`block.json name must equal \"${expectedName}\"`);\n\t}\n\tif (blockJson.textdomain !== workspace.workspace.textDomain) {\n\t\tissues.push(`block.json textdomain must equal \"${workspace.workspace.textDomain}\"`);\n\t}\n\n\treturn createDoctorCheck(\n\t\t`Block metadata ${block.slug}`,\n\t\tissues.length === 0 ? \"pass\" : \"fail\",\n\t\tissues.length === 0\n\t\t\t? `block.json matches ${expectedName} and ${workspace.workspace.textDomain}`\n\t\t\t: issues.join(\"; \"),\n\t);\n}\n\nfunction checkWorkspaceBlockHooks(\n\tprojectDir: string,\n\tblockSlug: string,\n): DoctorCheck {\n\tconst blockJsonRelativePath = path.join(\"src\", \"blocks\", blockSlug, \"block.json\");\n\tconst blockJsonPath = path.join(projectDir, blockJsonRelativePath);\n\n\tif (!fs.existsSync(blockJsonPath)) {\n\t\treturn createDoctorCheck(\n\t\t\t`Block hooks ${blockSlug}`,\n\t\t\t\"fail\",\n\t\t\t`Missing ${blockJsonRelativePath}`,\n\t\t);\n\t}\n\n\tlet blockJson: Record<string, unknown> & { blockHooks?: unknown };\n\ttry {\n\t\tblockJson = parseScaffoldBlockMetadata<Record<string, unknown> & { blockHooks?: unknown }>(\n\t\t\tJSON.parse(fs.readFileSync(blockJsonPath, \"utf8\")),\n\t\t);\n\t} catch (error) {\n\t\treturn createDoctorCheck(\n\t\t\t`Block hooks ${blockSlug}`,\n\t\t\t\"fail\",\n\t\t\terror instanceof Error ? error.message : String(error),\n\t\t);\n\t}\n\n\tconst blockHooks = blockJson.blockHooks;\n\tif (blockHooks === undefined) {\n\t\treturn createDoctorCheck(\n\t\t\t`Block hooks ${blockSlug}`,\n\t\t\t\"pass\",\n\t\t\t\"No blockHooks metadata configured\",\n\t\t);\n\t}\n\tif (!blockHooks || typeof blockHooks !== \"object\" || Array.isArray(blockHooks)) {\n\t\treturn createDoctorCheck(\n\t\t\t`Block hooks ${blockSlug}`,\n\t\t\t\"fail\",\n\t\t\t`${blockJsonRelativePath} must define blockHooks as an object when present.`,\n\t\t);\n\t}\n\n\tconst blockName =\n\t\ttypeof blockJson.name === \"string\" && blockJson.name.trim().length > 0\n\t\t\t? blockJson.name.trim()\n\t\t\t: null;\n\tconst invalidEntries = Object.entries(blockHooks).filter(\n\t\t([anchor, position]) =>\n\t\t\t(blockName !== null && anchor.trim() === blockName) ||\n\t\t\tanchor.trim().length === 0 ||\n\t\t\tanchor !== anchor.trim() ||\n\t\t\t!HOOKED_BLOCK_ANCHOR_PATTERN.test(anchor) ||\n\t\t\ttypeof position !== \"string\" ||\n\t\t\t!HOOKED_BLOCK_POSITION_SET.has(position),\n\t);\n\n\treturn createDoctorCheck(\n\t\t`Block hooks ${blockSlug}`,\n\t\tinvalidEntries.length === 0 ? \"pass\" : \"fail\",\n\t\tinvalidEntries.length === 0\n\t\t\t? `blockHooks metadata is valid${Object.keys(blockHooks).length > 0 ? ` (${Object.keys(blockHooks).join(\", \")})` : \"\"}`\n\t\t\t: `Invalid blockHooks entries: ${invalidEntries\n\t\t\t\t\t.map(([anchor, position]) => `${anchor || \"<empty>\"} => ${String(position)}`)\n\t\t\t\t\t.join(\", \")}`,\n\t);\n}\n\nfunction checkWorkspaceBlockCollectionImport(\n\tprojectDir: string,\n\tblockSlug: string,\n): DoctorCheck {\n\tconst entryRelativePath = path.join(\"src\", \"blocks\", blockSlug, \"index.tsx\");\n\tconst entryPath = path.join(projectDir, entryRelativePath);\n\n\tif (!fs.existsSync(entryPath)) {\n\t\treturn createDoctorCheck(\n\t\t\t`Block collection ${blockSlug}`,\n\t\t\t\"fail\",\n\t\t\t`Missing ${entryRelativePath}`,\n\t\t);\n\t}\n\n\tconst source = fs.readFileSync(entryPath, \"utf8\");\n\tconst hasCollectionImport = WORKSPACE_COLLECTION_IMPORT_PATTERN.test(source);\n\treturn createDoctorCheck(\n\t\t`Block collection ${blockSlug}`,\n\t\thasCollectionImport ? \"pass\" : \"fail\",\n\t\thasCollectionImport\n\t\t\t? \"Shared block collection import is present\"\n\t\t\t: `Missing a shared collection import like ${WORKSPACE_COLLECTION_IMPORT_LINE}`,\n\t);\n}\n\nfunction checkWorkspacePatternBootstrap(projectDir: string, packageName: string): DoctorCheck {\n\tconst packageBaseName = packageName.split(\"/\").pop() ?? packageName;\n\tconst bootstrapPath = path.join(projectDir, `${packageBaseName}.php`);\n\tif (!fs.existsSync(bootstrapPath)) {\n\t\treturn createDoctorCheck(\"Pattern bootstrap\", \"fail\", `Missing ${path.basename(bootstrapPath)}`);\n\t}\n\tconst source = fs.readFileSync(bootstrapPath, \"utf8\");\n\tconst hasCategoryAnchor = source.includes(\"register_block_pattern_category\");\n\tconst hasPatternGlob = source.includes(\"/src/patterns/*.php\");\n\treturn createDoctorCheck(\n\t\t\"Pattern bootstrap\",\n\t\thasCategoryAnchor && hasPatternGlob ? \"pass\" : \"fail\",\n\t\thasCategoryAnchor && hasPatternGlob\n\t\t\t? \"Pattern category and loader hooks are present\"\n\t\t\t: \"Missing pattern category registration or src/patterns loader hook\",\n\t);\n}\n\nfunction checkWorkspaceBindingBootstrap(projectDir: string, packageName: string): DoctorCheck {\n\tconst packageBaseName = packageName.split(\"/\").pop() ?? packageName;\n\tconst bootstrapPath = path.join(projectDir, `${packageBaseName}.php`);\n\tif (!fs.existsSync(bootstrapPath)) {\n\t\treturn createDoctorCheck(\n\t\t\t\"Binding bootstrap\",\n\t\t\t\"fail\",\n\t\t\t`Missing ${path.basename(bootstrapPath)}`,\n\t\t);\n\t}\n\n\tconst source = fs.readFileSync(bootstrapPath, \"utf8\");\n\tconst hasServerGlob = source.includes(WORKSPACE_BINDING_SERVER_GLOB);\n\tconst hasEditorEnqueueHook = source.includes(\"enqueue_block_editor_assets\");\n\tconst hasEditorScript = source.includes(WORKSPACE_BINDING_EDITOR_SCRIPT);\n\tconst hasEditorAsset = source.includes(WORKSPACE_BINDING_EDITOR_ASSET);\n\n\treturn createDoctorCheck(\n\t\t\"Binding bootstrap\",\n\t\thasServerGlob && hasEditorEnqueueHook && hasEditorScript && hasEditorAsset ? \"pass\" : \"fail\",\n\t\thasServerGlob && hasEditorEnqueueHook && hasEditorScript && hasEditorAsset\n\t\t\t? \"Binding source PHP and editor bootstrap hooks are present\"\n\t\t\t: \"Missing binding source PHP require glob or editor enqueue hook\",\n\t);\n}\n\nfunction checkWorkspaceBindingSourcesIndex(\n\tprojectDir: string,\n\tbindingSources: WorkspaceInventory[\"bindingSources\"],\n): DoctorCheck {\n\tconst indexRelativePath = [path.join(\"src\", \"bindings\", \"index.ts\"), path.join(\"src\", \"bindings\", \"index.js\")].find(\n\t\t(relativePath) => fs.existsSync(path.join(projectDir, relativePath)),\n\t);\n\n\tif (!indexRelativePath) {\n\t\treturn createDoctorCheck(\n\t\t\t\"Binding sources index\",\n\t\t\t\"fail\",\n\t\t\t\"Missing src/bindings/index.ts or src/bindings/index.js\",\n\t\t);\n\t}\n\n\tconst indexPath = path.join(projectDir, indexRelativePath);\n\tconst source = fs.readFileSync(indexPath, \"utf8\");\n\tconst missingImports = bindingSources.filter(\n\t\t(bindingSource) => !source.includes(`./${bindingSource.slug}/editor`),\n\t);\n\n\treturn createDoctorCheck(\n\t\t\"Binding sources index\",\n\t\tmissingImports.length === 0 ? \"pass\" : \"fail\",\n\t\tmissingImports.length === 0\n\t\t\t? \"Binding source editor registrations are aggregated\"\n\t\t\t: `Missing editor imports for: ${missingImports.map((entry) => entry.slug).join(\", \")}`,\n\t);\n}\n\nfunction getWorkspaceRestResourceRequiredFiles(\n\trestResource: WorkspaceInventory[\"restResources\"][number],\n): string[] {\n\tconst schemaNames = new Set<string>();\n\tif (restResource.methods.includes(\"list\")) {\n\t\tschemaNames.add(\"list-query\");\n\t\tschemaNames.add(\"list-response\");\n\t}\n\tif (restResource.methods.includes(\"read\")) {\n\t\tschemaNames.add(\"read-query\");\n\t\tschemaNames.add(\"read-response\");\n\t}\n\tif (restResource.methods.includes(\"create\")) {\n\t\tschemaNames.add(\"create-request\");\n\t\tschemaNames.add(\"create-response\");\n\t}\n\tif (restResource.methods.includes(\"update\")) {\n\t\tschemaNames.add(\"update-query\");\n\t\tschemaNames.add(\"update-request\");\n\t\tschemaNames.add(\"update-response\");\n\t}\n\tif (restResource.methods.includes(\"delete\")) {\n\t\tschemaNames.add(\"delete-query\");\n\t\tschemaNames.add(\"delete-response\");\n\t}\n\n\treturn Array.from(\n\t\tnew Set([\n\t\t\trestResource.apiFile,\n\t\t\t...Array.from(schemaNames, (schemaName) =>\n\t\t\t\tpath.join(\n\t\t\t\t\tpath.dirname(restResource.typesFile),\n\t\t\t\t\t\"api-schemas\",\n\t\t\t\t\t`${schemaName}.schema.json`,\n\t\t\t\t),\n\t\t\t),\n\t\t\trestResource.clientFile,\n\t\t\trestResource.dataFile,\n\t\t\trestResource.openApiFile,\n\t\t\trestResource.phpFile,\n\t\t\trestResource.typesFile,\n\t\t\trestResource.validatorsFile,\n\t\t]),\n\t);\n}\n\nfunction checkWorkspaceRestResourceConfig(\n\trestResource: WorkspaceInventory[\"restResources\"][number],\n): DoctorCheck {\n\tconst hasNamespace = REST_RESOURCE_NAMESPACE_PATTERN.test(restResource.namespace);\n\tconst hasMethods =\n\t\trestResource.methods.length > 0 &&\n\t\trestResource.methods.every((method) =>\n\t\t\t(REST_RESOURCE_METHOD_IDS as readonly string[]).includes(method),\n\t\t);\n\n\treturn createDoctorCheck(\n\t\t`REST resource config ${restResource.slug}`,\n\t\thasNamespace && hasMethods ? \"pass\" : \"fail\",\n\t\thasNamespace && hasMethods\n\t\t\t? `REST resource namespace ${restResource.namespace} with methods ${restResource.methods.join(\", \")}`\n\t\t\t: \"REST resource namespace or methods are invalid\",\n\t);\n}\n\nfunction checkWorkspaceRestResourceBootstrap(\n\tprojectDir: string,\n\tpackageName: string,\n\tphpPrefix: string,\n): DoctorCheck {\n\tconst packageBaseName = packageName.split(\"/\").pop() ?? packageName;\n\tconst bootstrapPath = path.join(projectDir, `${packageBaseName}.php`);\n\tif (!fs.existsSync(bootstrapPath)) {\n\t\treturn createDoctorCheck(\n\t\t\t\"REST resource bootstrap\",\n\t\t\t\"fail\",\n\t\t\t`Missing ${path.basename(bootstrapPath)}`,\n\t\t);\n\t}\n\n\tconst source = fs.readFileSync(bootstrapPath, \"utf8\");\n\tconst registerFunctionName = `${phpPrefix}_register_rest_resources`;\n\tconst registerHook = `add_action( 'init', '${registerFunctionName}', 20 );`;\n\tconst hasServerGlob = source.includes(WORKSPACE_REST_RESOURCE_GLOB);\n\tconst hasRegisterHook = source.includes(registerHook);\n\n\treturn createDoctorCheck(\n\t\t\"REST resource bootstrap\",\n\t\thasServerGlob && hasRegisterHook ? \"pass\" : \"fail\",\n\t\thasServerGlob && hasRegisterHook\n\t\t\t? \"REST resource PHP loader hook is present\"\n\t\t\t: \"Missing REST resource PHP require glob or init hook\",\n\t);\n}\n\nfunction getWorkspaceEditorPluginRequiredFiles(\n\teditorPlugin: WorkspaceInventory[\"editorPlugins\"][number],\n): string[] {\n\tconst editorPluginDir = path.join(\"src\", \"editor-plugins\", editorPlugin.slug);\n\n\treturn Array.from(\n\t\tnew Set([\n\t\t\teditorPlugin.file,\n\t\t\tpath.join(editorPluginDir, \"Sidebar.tsx\"),\n\t\t\tpath.join(editorPluginDir, \"data.ts\"),\n\t\t\tpath.join(editorPluginDir, \"types.ts\"),\n\t\t\tpath.join(editorPluginDir, \"style.scss\"),\n\t\t]),\n\t);\n}\n\nfunction checkWorkspaceEditorPluginConfig(\n\teditorPlugin: WorkspaceInventory[\"editorPlugins\"][number],\n): DoctorCheck {\n\tconst validSlots = new Set<string>(EDITOR_PLUGIN_SLOT_IDS);\n\tconst isValidSlot = validSlots.has(editorPlugin.slot);\n\n\treturn createDoctorCheck(\n\t\t`Editor plugin config ${editorPlugin.slug}`,\n\t\tisValidSlot ? \"pass\" : \"fail\",\n\t\tisValidSlot\n\t\t\t? `Editor plugin slot ${editorPlugin.slot} is supported`\n\t\t\t: `Unsupported editor plugin slot \"${editorPlugin.slot}\". Expected one of: ${EDITOR_PLUGIN_SLOT_IDS.join(\", \")}`,\n\t);\n}\n\nfunction checkWorkspaceEditorPluginBootstrap(\n\tprojectDir: string,\n\tpackageName: string,\n\tphpPrefix: string,\n): DoctorCheck {\n\tconst packageBaseName = packageName.split(\"/\").pop() ?? packageName;\n\tconst bootstrapPath = path.join(projectDir, `${packageBaseName}.php`);\n\tif (!fs.existsSync(bootstrapPath)) {\n\t\treturn createDoctorCheck(\n\t\t\t\"Editor plugin bootstrap\",\n\t\t\t\"fail\",\n\t\t\t`Missing ${path.basename(bootstrapPath)}`,\n\t\t);\n\t}\n\n\tconst source = fs.readFileSync(bootstrapPath, \"utf8\");\n\tconst enqueueFunctionName = `${phpPrefix}_enqueue_editor_plugins_editor`;\n\tconst enqueueHook = `add_action( 'enqueue_block_editor_assets', '${enqueueFunctionName}' );`;\n\tconst hasEditorEnqueueHook = source.includes(enqueueHook);\n\tconst hasEditorScript = source.includes(WORKSPACE_EDITOR_PLUGIN_EDITOR_SCRIPT);\n\tconst hasEditorAsset = source.includes(WORKSPACE_EDITOR_PLUGIN_EDITOR_ASSET);\n\tconst hasEditorStyle = source.includes(WORKSPACE_EDITOR_PLUGIN_EDITOR_STYLE);\n\n\treturn createDoctorCheck(\n\t\t\"Editor plugin bootstrap\",\n\t\thasEditorEnqueueHook && hasEditorScript && hasEditorAsset && hasEditorStyle ? \"pass\" : \"fail\",\n\t\thasEditorEnqueueHook && hasEditorScript && hasEditorAsset && hasEditorStyle\n\t\t\t? \"Editor plugin enqueue hook is present\"\n\t\t\t: \"Missing editor plugin enqueue hook or build/editor-plugins script/style asset references\",\n\t);\n}\n\nfunction checkWorkspaceEditorPluginIndex(\n\tprojectDir: string,\n\teditorPlugins: WorkspaceInventory[\"editorPlugins\"],\n): DoctorCheck {\n\tconst indexRelativePath = [\n\t\tpath.join(\"src\", \"editor-plugins\", \"index.ts\"),\n\t\tpath.join(\"src\", \"editor-plugins\", \"index.js\"),\n\t].find((relativePath) => fs.existsSync(path.join(projectDir, relativePath)));\n\n\tif (!indexRelativePath) {\n\t\treturn createDoctorCheck(\n\t\t\t\"Editor plugins index\",\n\t\t\t\"fail\",\n\t\t\t\"Missing src/editor-plugins/index.ts or src/editor-plugins/index.js\",\n\t\t);\n\t}\n\n\tconst indexPath = path.join(projectDir, indexRelativePath);\n\tconst source = fs.readFileSync(indexPath, \"utf8\");\n\tconst missingImports = editorPlugins.filter((editorPlugin) => {\n\t\tconst importPattern = new RegExp(\n\t\t\t`['\"\\`]\\\\./${escapeRegex(editorPlugin.slug)}(?:/[^'\"\\`]*)?['\"\\`]`,\n\t\t\t\"u\",\n\t\t);\n\t\treturn !importPattern.test(source);\n\t});\n\n\treturn createDoctorCheck(\n\t\t\"Editor plugins index\",\n\t\tmissingImports.length === 0 ? \"pass\" : \"fail\",\n\t\tmissingImports.length === 0\n\t\t\t? \"Editor plugin registrations are aggregated\"\n\t\t\t: `Missing editor plugin imports for: ${missingImports\n\t\t\t\t\t.map((entry) => entry.slug)\n\t\t\t\t\t.join(\", \")}`,\n\t);\n}\n\nfunction checkVariationEntrypoint(projectDir: string, blockSlug: string): DoctorCheck {\n\tconst entryPath = path.join(projectDir, \"src\", \"blocks\", blockSlug, \"index.tsx\");\n\tif (!fs.existsSync(entryPath)) {\n\t\treturn createDoctorCheck(\n\t\t\t`Variation entrypoint ${blockSlug}`,\n\t\t\t\"fail\",\n\t\t\t`Missing ${path.relative(projectDir, entryPath)}`,\n\t\t);\n\t}\n\tconst source = fs.readFileSync(entryPath, \"utf8\");\n\tconst hasImport = source.includes(\"./variations\");\n\tconst hasCall = source.includes(\"registerWorkspaceVariations()\");\n\treturn createDoctorCheck(\n\t\t`Variation entrypoint ${blockSlug}`,\n\t\thasImport && hasCall ? \"pass\" : \"fail\",\n\t\thasImport && hasCall\n\t\t\t? \"Variations registration hook is present\"\n\t\t\t: \"Missing ./variations import or registerWorkspaceVariations() call\",\n\t);\n}\n\nfunction checkMigrationWorkspaceHint(\n\tworkspace: WorkspaceProject,\n\tpackageJson: WorkspacePackageJson,\n): DoctorCheck | null {\n\tconst hasMigrationScript = typeof packageJson.scripts?.[\"migration:doctor\"] === \"string\";\n\tconst migrationConfigRelativePath = path.join(\"src\", \"migrations\", \"config.ts\");\n\tconst hasMigrationConfig = fs.existsSync(\n\t\tpath.join(workspace.projectDir, migrationConfigRelativePath),\n\t);\n\n\tif (!hasMigrationScript && !hasMigrationConfig) {\n\t\treturn null;\n\t}\n\n\treturn createDoctorCheck(\n\t\t\"Migration workspace\",\n\t\thasMigrationConfig ? \"pass\" : \"fail\",\n\t\thasMigrationConfig\n\t\t\t? \"Run `wp-typia migrate doctor --all` for migration target, snapshot, fixture, and generated artifact checks\"\n\t\t\t: `Missing ${migrationConfigRelativePath} for the configured migration workspace`,\n\t);\n}\n\n/**\n * Collect workspace-scoped doctor checks for the given working directory.\n *\n * When the directory is not an official workspace, the function returns a\n * \"Doctor scope\" row explaining that only environment checks ran, plus a\n * failing workspace metadata row when a nearby candidate workspace is invalid.\n * When workspace resolution or metadata parsing throws, the corresponding\n * failing rows are returned early and the remaining checks are skipped.\n * When an official workspace is detected, a passing \"Doctor scope\" row is\n * emitted first so the remaining package metadata, inventory, source-tree\n * drift, and optional migration hint rows are clearly framed as workspace\n * diagnostics for that run.\n *\n * @param cwd Working directory expected to host an official workspace.\n * @returns Ordered workspace check rows ready for CLI rendering.\n */\nexport function getWorkspaceDoctorChecks(cwd: string): DoctorCheck[] {\n\tconst checks: DoctorCheck[] = [];\n\n\tlet workspace: WorkspaceProject | null = null;\n\tlet invalidWorkspaceReason: string | null = null;\n\ttry {\n\t\tinvalidWorkspaceReason = getInvalidWorkspaceProjectReason(cwd);\n\t\tworkspace = tryResolveWorkspaceProject(cwd);\n\t} catch (error) {\n\t\tchecks.push(\n\t\t\tcreateDoctorScopeCheck(\n\t\t\t\t\"fail\",\n\t\t\t\t\"Scope: blocked before workspace checks. Environment checks ran, but workspace discovery could not continue. Fix the nearby workspace package metadata and rerun `wp-typia doctor`.\",\n\t\t\t),\n\t\t);\n\t\tchecks.push(\n\t\t\tcreateDoctorCheck(\n\t\t\t\t\"Workspace package metadata\",\n\t\t\t\t\"fail\",\n\t\t\t\terror instanceof Error ? error.message : String(error),\n\t\t\t),\n\t\t);\n\t\treturn checks;\n\t}\n\tif (!workspace) {\n\t\tif (invalidWorkspaceReason) {\n\t\t\tchecks.push(\n\t\t\t\tcreateDoctorScopeCheck(\n\t\t\t\t\t\"fail\",\n\t\t\t\t\t\"Scope: blocked before workspace checks. Environment checks ran, but workspace diagnostics could not continue because a nearby wp-typia workspace candidate is invalid. Fix the workspace package metadata and rerun `wp-typia doctor`.\",\n\t\t\t\t),\n\t\t\t);\n\t\t\tchecks.push(\n\t\t\t\tcreateDoctorCheck(\n\t\t\t\t\t\"Workspace package metadata\",\n\t\t\t\t\t\"fail\",\n\t\t\t\t\tinvalidWorkspaceReason,\n\t\t\t\t),\n\t\t\t);\n\t\t} else {\n\t\t\tchecks.push(\n\t\t\t\tcreateDoctorScopeCheck(\n\t\t\t\t\t\"pass\",\n\t\t\t\t\t\"Scope: environment-only. No official wp-typia workspace root was detected, so this run only covered environment readiness. Re-run `wp-typia doctor` from a workspace root if you expected package metadata, inventory, or generated artifact checks.\",\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\t\treturn checks;\n\t}\n\n\tchecks.push(\n\t\tcreateDoctorScopeCheck(\n\t\t\t\"pass\",\n\t\t\t`Scope: full workspace diagnostics for ${workspace.workspace.namespace}. Environment readiness checks ran and workspace-scoped diagnostics are enabled for the package metadata, inventory, source-tree drift, and any configured migration hint rows below.`,\n\t\t),\n\t);\n\n\tlet workspacePackageJson: WorkspacePackageJson;\n\ttry {\n\t\tworkspacePackageJson = parseWorkspacePackageJson(workspace.projectDir);\n\t} catch (error) {\n\t\tchecks.push(\n\t\t\tcreateDoctorCheck(\n\t\t\t\t\"Workspace package metadata\",\n\t\t\t\t\"fail\",\n\t\t\t\terror instanceof Error ? error.message : String(error),\n\t\t\t),\n\t\t);\n\t\treturn checks;\n\t}\n\n\tchecks.push(checkWorkspacePackageMetadata(workspace, workspacePackageJson));\n\n\ttry {\n\t\tconst inventory = readWorkspaceInventory(workspace.projectDir);\n\t\tchecks.push(\n\t\t\tcreateDoctorCheck(\n\t\t\t\t\"Workspace inventory\",\n\t\t\t\t\"pass\",\n\t\t\t\t`${inventory.blocks.length} block(s), ${inventory.variations.length} variation(s), ${inventory.patterns.length} pattern(s), ${inventory.bindingSources.length} binding source(s), ${inventory.restResources.length} REST resource(s), ${inventory.editorPlugins.length} editor plugin(s)`,\n\t\t\t),\n\t\t);\n\n\t\tfor (const block of inventory.blocks) {\n\t\t\tchecks.push(\n\t\t\t\tcheckExistingFiles(\n\t\t\t\t\tworkspace.projectDir,\n\t\t\t\t\t`Block ${block.slug}`,\n\t\t\t\t\tgetWorkspaceBlockRequiredFiles(block),\n\t\t\t\t),\n\t\t\t);\n\t\t\tchecks.push(checkWorkspaceBlockMetadata(workspace.projectDir, workspace, block));\n\t\t\tchecks.push(checkWorkspaceBlockHooks(workspace.projectDir, block.slug));\n\t\t\tchecks.push(checkWorkspaceBlockCollectionImport(workspace.projectDir, block.slug));\n\t\t}\n\n\t\tconst registeredBlockSlugs = new Set(inventory.blocks.map((block) => block.slug));\n\t\tconst variationTargetBlocks = new Set<string>();\n\t\tfor (const variation of inventory.variations) {\n\t\t\tif (!registeredBlockSlugs.has(variation.block)) {\n\t\t\t\tchecks.push(\n\t\t\t\t\tcreateDoctorCheck(\n\t\t\t\t\t\t`Variation ${variation.block}/${variation.slug}`,\n\t\t\t\t\t\t\"fail\",\n\t\t\t\t\t\t`Variation references unknown block \"${variation.block}\"`,\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tvariationTargetBlocks.add(variation.block);\n\t\t\tchecks.push(\n\t\t\t\tcheckExistingFiles(\n\t\t\t\t\tworkspace.projectDir,\n\t\t\t\t\t`Variation ${variation.block}/${variation.slug}`,\n\t\t\t\t\t[variation.file],\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\t\tfor (const blockSlug of variationTargetBlocks) {\n\t\t\tchecks.push(checkVariationEntrypoint(workspace.projectDir, blockSlug));\n\t\t}\n\n\t\tconst shouldCheckPatternBootstrap =\n\t\t\tinventory.patterns.length > 0 ||\n\t\t\tfs.existsSync(path.join(workspace.projectDir, \"src\", \"patterns\"));\n\t\tif (shouldCheckPatternBootstrap) {\n\t\t\tchecks.push(checkWorkspacePatternBootstrap(workspace.projectDir, workspace.packageName));\n\t\t}\n\t\tfor (const pattern of inventory.patterns) {\n\t\t\tchecks.push(\n\t\t\t\tcheckExistingFiles(workspace.projectDir, `Pattern ${pattern.slug}`, [pattern.file]),\n\t\t\t);\n\t\t}\n\n\t\tif (inventory.bindingSources.length > 0) {\n\t\t\tchecks.push(checkWorkspaceBindingBootstrap(workspace.projectDir, workspace.packageName));\n\t\t\tchecks.push(\n\t\t\t\tcheckWorkspaceBindingSourcesIndex(workspace.projectDir, inventory.bindingSources),\n\t\t\t);\n\t\t}\n\t\tfor (const bindingSource of inventory.bindingSources) {\n\t\t\tchecks.push(\n\t\t\t\tcheckExistingFiles(workspace.projectDir, `Binding source ${bindingSource.slug}`, [\n\t\t\t\t\tbindingSource.serverFile,\n\t\t\t\t\tbindingSource.editorFile,\n\t\t\t\t]),\n\t\t\t);\n\t\t}\n\n\t\tif (inventory.restResources.length > 0) {\n\t\t\tchecks.push(\n\t\t\t\tcheckWorkspaceRestResourceBootstrap(\n\t\t\t\t\tworkspace.projectDir,\n\t\t\t\t\tworkspace.packageName,\n\t\t\t\t\tworkspace.workspace.phpPrefix,\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\t\tfor (const restResource of inventory.restResources) {\n\t\t\tchecks.push(checkWorkspaceRestResourceConfig(restResource));\n\t\t\tchecks.push(\n\t\t\t\tcheckExistingFiles(\n\t\t\t\t\tworkspace.projectDir,\n\t\t\t\t\t`REST resource ${restResource.slug}`,\n\t\t\t\t\tgetWorkspaceRestResourceRequiredFiles(restResource),\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\n\t\tif (inventory.editorPlugins.length > 0) {\n\t\t\tchecks.push(\n\t\t\t\tcheckWorkspaceEditorPluginBootstrap(\n\t\t\t\t\tworkspace.projectDir,\n\t\t\t\t\tworkspace.packageName,\n\t\t\t\t\tworkspace.workspace.phpPrefix,\n\t\t\t\t),\n\t\t\t);\n\t\t\tchecks.push(\n\t\t\t\tcheckWorkspaceEditorPluginIndex(workspace.projectDir, inventory.editorPlugins),\n\t\t\t);\n\t\t}\n\t\tfor (const editorPlugin of inventory.editorPlugins) {\n\t\t\tchecks.push(\n\t\t\t\tcheckExistingFiles(\n\t\t\t\t\tworkspace.projectDir,\n\t\t\t\t\t`Editor plugin ${editorPlugin.slug}`,\n\t\t\t\t\tgetWorkspaceEditorPluginRequiredFiles(editorPlugin),\n\t\t\t\t),\n\t\t\t);\n\t\t\tchecks.push(checkWorkspaceEditorPluginConfig(editorPlugin));\n\t\t}\n\n\t\tconst migrationWorkspaceCheck = checkMigrationWorkspaceHint(\n\t\t\tworkspace,\n\t\t\tworkspacePackageJson,\n\t\t);\n\t\tif (migrationWorkspaceCheck) {\n\t\t\tchecks.push(migrationWorkspaceCheck);\n\t\t}\n\t} catch (error) {\n\t\tchecks.push(\n\t\t\tcreateDoctorCheck(\n\t\t\t\t\"Workspace inventory\",\n\t\t\t\t\"fail\",\n\t\t\t\terror instanceof Error ? error.message : String(error),\n\t\t\t),\n\t\t);\n\t}\n\n\treturn checks;\n}\n",
|
|
7
7
|
"import {\n\tcreateCliCommandError,\n\tformatDoctorCheckLine,\n\tformatDoctorSummaryLine,\n\tgetDoctorFailureDetailLines,\n} from \"./cli-diagnostics.js\";\nimport { getEnvironmentDoctorChecks } from \"./cli-doctor-environment.js\";\nimport { getWorkspaceDoctorChecks } from \"./cli-doctor-workspace.js\";\n\n/**\n * One doctor check rendered by the CLI diagnostics flow.\n */\nexport interface DoctorCheck {\n\t/** Human-readable status detail rendered next to the label. */\n\tdetail: string;\n\t/** Short label for the dependency, directory, or template check. */\n\tlabel: string;\n\t/** Final pass/fail status for this diagnostic row. */\n\tstatus: \"pass\" | \"fail\";\n}\n\ninterface RunDoctorOptions {\n\trenderLine?: (check: DoctorCheck) => void;\n\trenderSummaryLine?: (summaryLine: string) => void;\n}\n\n/**\n * Collect all runtime doctor checks for the current environment.\n *\n * The returned array concatenates environment checks (command availability,\n * directory writability, and built-in template assets) followed by\n * workspace checks (package metadata, inventory, blocks, variations,\n * patterns, bindings, and optional migration hints) in display order.\n *\n * @param cwd Working directory to validate for writability.\n * @returns Ordered doctor check rows ready for CLI rendering.\n */\nexport async function getDoctorChecks(cwd: string): Promise<DoctorCheck[]> {\n\treturn [\n\t\t...(await getEnvironmentDoctorChecks(cwd)),\n\t\t...getWorkspaceDoctorChecks(cwd),\n\t];\n}\n\n/**\n * Run doctor checks, render each line, and fail when any check does not pass.\n *\n * @param cwd Working directory to validate.\n * @param options Optional renderer override for each emitted check row.\n * @returns The completed list of doctor checks.\n * @throws {Error} When one or more checks fail.\n */\nexport async function runDoctor(\n\tcwd: string,\n\toptions: RunDoctorOptions = {},\n): Promise<DoctorCheck[]> {\n\tconst renderLine =\n\t\toptions.renderLine ?? ((check: DoctorCheck) => console.log(formatDoctorCheckLine(check)));\n\tconst renderSummaryLine =\n\t\toptions.renderSummaryLine ??\n\t\t(options.renderLine ? () => undefined : (summaryLine: string) => console.log(summaryLine));\n\tconst checks = await getDoctorChecks(cwd);\n\n\tfor (const check of checks) {\n\t\trenderLine(check);\n\t}\n\n\trenderSummaryLine(formatDoctorSummaryLine(checks));\n\n\tconst failureDetailLines = getDoctorFailureDetailLines(checks);\n\tif (failureDetailLines.length > 0) {\n\t\tthrow createCliCommandError({\n\t\t\tcommand: \"doctor\",\n\t\t\tdetailLines: failureDetailLines,\n\t\t\tsummary: \"One or more doctor checks failed.\",\n\t\t});\n\t}\n\n\treturn checks;\n}\n"
|
|
8
8
|
],
|
|
9
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA,8BAAiB;AACjB;AACA;AACA;AAUA,SAAS,kBAAkB,CAAC,SAAiB,OAAiB,CAAC,WAAW,GAAkB;AAAA,EAC3F,IAAI;AAAA,IACH,OAAO,aAAa,SAAS,MAAM;AAAA,MAClC,UAAU;AAAA,MACV,OAAO,CAAC,UAAU,QAAQ,QAAQ;AAAA,IACnC,CAAC,EAAE,KAAK;AAAA,IACP,MAAM;AAAA,IACP,OAAO;AAAA;AAAA;AAIT,SAAS,mBAAmB,CAAC,eAAuB,cAA+B;AAAA,EAClF,MAAM,SAAS,OAAO,SAAS,cAAc,QAAQ,MAAM,EAAE,EAAE,MAAM,GAAG,EAAE,MAAM,IAAI,EAAE;AAAA,EACtF,OAAO,OAAO,SAAS,MAAM,KAAK,UAAU;AAAA;AAG7C,eAAe,sBAAsB,CAAC,WAAqC;AAAA,EAC1E,IAAI;AAAA,IACH,MAAM,OAAO,WAAW,YAAY,IAAI;AAAA,IACxC,OAAO;AAAA,IACN,MAAM;AAAA,IACP,OAAO;AAAA;AAAA;AAIT,eAAe,kBAAkB,GAAqB;AAAA,EACrD,MAAM,W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AAe,CAAC,KAAqC;AAAA,EAC1E,OAAO;AAAA,IACN,GAAI,MAAM,2BAA2B,GAAG;AAAA,IACxC,GAAG,yBAAyB,GAAG;AAAA,EAChC;AAAA;AAWD,eAAsB,SAAS,CAC9B,KACA,UAA4B,CAAC,GACJ;AAAA,EACzB,MAAM,aACL,QAAQ,eAAe,CAAC,UAAuB,QAAQ,IAAI,sBAAsB,KAAK,CAAC;AAAA,EACxF,MAAM,oBACL,QAAQ,sBACP,QAAQ,aAAa,MAAG;AAAA,IAAG;AAAA,MAAY,CAAC,gBAAwB,QAAQ,IAAI,WAAW;AAAA,EACzF,MAAM,SAAS,MAAM,gBAAgB,GAAG;AAAA,EAExC,WAAW,SAAS,QAAQ;AAAA,IAC3B,WAAW,KAAK;AAAA,EACjB;AAAA,EAEA,kBAAkB,wBAAwB,MAAM,CAAC;AAAA,EAEjD,MAAM,qBAAqB,4BAA4B,MAAM;AAAA,EAC7D,IAAI,mBAAmB,SAAS,GAAG;AAAA,IAClC,MAAM,sBAAsB;AAAA,MAC3B,SAAS;AAAA,MACT,aAAa;AAAA,MACb,SAAS;AAAA,IACV,CAAC;AAAA,EACF;AAAA,EAEA,OAAO;AAAA;",
|
|
10
|
+
"debugId": "BACE4BB4FC84F0EB64756E2164756E21",
|
|
11
11
|
"names": []
|
|
12
12
|
}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import {
|
|
3
|
-
builtinAgents,
|
|
4
|
-
detectAgents
|
|
5
|
-
} from "./cli-6v0pcxw6.js";
|
|
6
2
|
import {
|
|
7
3
|
__commonJS,
|
|
8
4
|
__export,
|
|
@@ -18448,13 +18444,6 @@ var require_public_api = __commonJS((exports) => {
|
|
|
18448
18444
|
exports.stringify = stringify;
|
|
18449
18445
|
});
|
|
18450
18446
|
|
|
18451
|
-
// ../../node_modules/.bun/@bunli+plugin-skills@0.1.0+44deef6f8e4a2f18/node_modules/@bunli/plugin-skills/src/sync.ts
|
|
18452
|
-
import * as fs2 from "fs";
|
|
18453
|
-
import * as fsp from "fs/promises";
|
|
18454
|
-
import * as os2 from "os";
|
|
18455
|
-
import * as path6 from "path";
|
|
18456
|
-
import { createHash } from "crypto";
|
|
18457
|
-
|
|
18458
18447
|
// ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v4/classic/external.js
|
|
18459
18448
|
var exports_external = {};
|
|
18460
18449
|
__export(exports_external, {
|
|
@@ -74597,150 +74586,6 @@ function option2(schema, metadata2) {
|
|
|
74597
74586
|
...metadata2
|
|
74598
74587
|
};
|
|
74599
74588
|
}
|
|
74600
|
-
|
|
74601
|
-
function generateSkillFile(cliName, commands, options = {}) {
|
|
74602
|
-
const { description } = options;
|
|
74603
|
-
const slug = cliName.replace(/\s+/g, "-");
|
|
74604
|
-
const frontmatter = renderFrontmatter({
|
|
74605
|
-
name: slug,
|
|
74606
|
-
...description ? { description } : {}
|
|
74607
|
-
});
|
|
74608
|
-
const body = renderFull(cliName, commands, description);
|
|
74609
|
-
return `${frontmatter}
|
|
74610
|
-
|
|
74611
|
-
${body}
|
|
74612
|
-
`;
|
|
74613
|
-
}
|
|
74614
|
-
function renderFrontmatter(fields) {
|
|
74615
|
-
const lines = ["---"];
|
|
74616
|
-
for (const [key2, value2] of Object.entries(fields)) {
|
|
74617
|
-
lines.push(`${key2}: ${formatFrontmatterValue(key2, value2)}`);
|
|
74618
|
-
}
|
|
74619
|
-
lines.push("---");
|
|
74620
|
-
return lines.join(`
|
|
74621
|
-
`);
|
|
74622
|
-
}
|
|
74623
|
-
function formatFrontmatterValue(key2, value2) {
|
|
74624
|
-
if (key2 === "name" && /^[a-z0-9][a-z0-9-]*$/.test(value2)) {
|
|
74625
|
-
return value2;
|
|
74626
|
-
}
|
|
74627
|
-
return JSON.stringify(value2);
|
|
74628
|
-
}
|
|
74629
|
-
|
|
74630
|
-
// ../../node_modules/.bun/@bunli+plugin-skills@0.1.0+44deef6f8e4a2f18/node_modules/@bunli/plugin-skills/src/sync.ts
|
|
74631
|
-
var defaultSyncRuntime = {
|
|
74632
|
-
homeDir: () => os2.homedir(),
|
|
74633
|
-
dataHome: () => process.env.XDG_DATA_HOME || path6.join(os2.homedir(), ".local", "share")
|
|
74634
|
-
};
|
|
74635
|
-
async function syncSkills(cliName, commands, options = {}, runtime2 = defaultSyncRuntime) {
|
|
74636
|
-
const {
|
|
74637
|
-
global: isGlobal = true,
|
|
74638
|
-
force = false,
|
|
74639
|
-
description,
|
|
74640
|
-
cwd = process.cwd()
|
|
74641
|
-
} = options;
|
|
74642
|
-
const canonicalBase = path6.join(isGlobal ? runtime2.homeDir() : cwd, ".agents", "skills");
|
|
74643
|
-
const cacheKey = stalenessCacheKey(cliName, isGlobal, cwd, canonicalBase);
|
|
74644
|
-
const skillName = cliName.replace(/\s+/g, "-");
|
|
74645
|
-
const canonicalDir = path6.join(canonicalBase, skillName);
|
|
74646
|
-
const detected = options.agents ?? detectAgents(builtinAgents);
|
|
74647
|
-
const agentKey = computeAgentKey(detected, canonicalDir, skillName, isGlobal, cwd);
|
|
74648
|
-
const content = generateSkillFile(cliName, commands, { description });
|
|
74649
|
-
const hash2 = createHash("sha256").update(content).digest("hex").slice(0, 16);
|
|
74650
|
-
const prevState = readState(cacheKey, runtime2);
|
|
74651
|
-
if (!force && prevState?.hash === hash2 && prevState.agentKey === agentKey) {
|
|
74652
|
-
return { paths: [], agents: [], updated: false };
|
|
74653
|
-
}
|
|
74654
|
-
await fsp.mkdir(canonicalDir, { recursive: true });
|
|
74655
|
-
await fsp.writeFile(path6.join(canonicalDir, "SKILL.md"), content);
|
|
74656
|
-
const paths = [canonicalDir];
|
|
74657
|
-
const agentInstalls = [];
|
|
74658
|
-
let hadInstallFailure = false;
|
|
74659
|
-
for (const agent of detected) {
|
|
74660
|
-
const agentSkillsDir = isGlobal ? agent.globalSkillsDir : path6.join(cwd, agent.projectSkillsDir);
|
|
74661
|
-
const agentDir = path6.join(agentSkillsDir, skillName);
|
|
74662
|
-
if (agentDir === canonicalDir)
|
|
74663
|
-
continue;
|
|
74664
|
-
try {
|
|
74665
|
-
rmForce(agentDir);
|
|
74666
|
-
fs2.mkdirSync(path6.dirname(agentDir), { recursive: true });
|
|
74667
|
-
const realLinkDir = resolveParent(path6.dirname(agentDir));
|
|
74668
|
-
const realTarget = resolveParent(canonicalDir);
|
|
74669
|
-
const rel = path6.relative(realLinkDir, realTarget);
|
|
74670
|
-
fs2.symlinkSync(rel, agentDir);
|
|
74671
|
-
agentInstalls.push({ agent: agent.name, path: agentDir, mode: "symlink" });
|
|
74672
|
-
} catch {
|
|
74673
|
-
try {
|
|
74674
|
-
fs2.cpSync(canonicalDir, agentDir, { recursive: true });
|
|
74675
|
-
agentInstalls.push({ agent: agent.name, path: agentDir, mode: "copy" });
|
|
74676
|
-
} catch {
|
|
74677
|
-
hadInstallFailure = true;
|
|
74678
|
-
}
|
|
74679
|
-
}
|
|
74680
|
-
}
|
|
74681
|
-
if (!hadInstallFailure) {
|
|
74682
|
-
writeState(cacheKey, { hash: hash2, agentKey }, runtime2);
|
|
74683
|
-
}
|
|
74684
|
-
return { paths, agents: agentInstalls, updated: true };
|
|
74685
|
-
}
|
|
74686
|
-
function stalenessCacheKey(name2, isGlobal, cwd, canonicalBase) {
|
|
74687
|
-
const scope = isGlobal ? `global:${path6.resolve(canonicalBase)}` : `local:${path6.resolve(cwd)}`;
|
|
74688
|
-
const scopeHash = createHash("sha256").update(scope).digest("hex").slice(0, 8);
|
|
74689
|
-
return `${name2}-${scopeHash}`;
|
|
74690
|
-
}
|
|
74691
|
-
function hashPath(cacheKey, runtime2) {
|
|
74692
|
-
const dir = runtime2.dataHome();
|
|
74693
|
-
return path6.join(dir, "bunli", `${cacheKey}-skills.json`);
|
|
74694
|
-
}
|
|
74695
|
-
function computeAgentKey(agents, canonicalDir, skillName, isGlobal, cwd) {
|
|
74696
|
-
const targets = agents.map((agent) => isGlobal ? path6.join(agent.globalSkillsDir, skillName) : path6.join(cwd, agent.projectSkillsDir, skillName)).filter((target) => target !== canonicalDir).sort();
|
|
74697
|
-
return createHash("sha256").update(JSON.stringify(targets)).digest("hex").slice(0, 16);
|
|
74698
|
-
}
|
|
74699
|
-
function writeState(cacheKey, state, runtime2 = defaultSyncRuntime) {
|
|
74700
|
-
const file2 = hashPath(cacheKey, runtime2);
|
|
74701
|
-
const dir = path6.dirname(file2);
|
|
74702
|
-
if (!fs2.existsSync(dir))
|
|
74703
|
-
fs2.mkdirSync(dir, { recursive: true });
|
|
74704
|
-
fs2.writeFileSync(file2, JSON.stringify({ ...state, at: new Date().toISOString() }) + `
|
|
74705
|
-
`);
|
|
74706
|
-
}
|
|
74707
|
-
function readState(cacheKey, runtime2 = defaultSyncRuntime) {
|
|
74708
|
-
try {
|
|
74709
|
-
const data = JSON.parse(fs2.readFileSync(hashPath(cacheKey, runtime2), "utf-8"));
|
|
74710
|
-
if (typeof data?.hash !== "string")
|
|
74711
|
-
return;
|
|
74712
|
-
return {
|
|
74713
|
-
hash: data.hash,
|
|
74714
|
-
agentKey: typeof data.agentKey === "string" ? data.agentKey : undefined
|
|
74715
|
-
};
|
|
74716
|
-
} catch {
|
|
74717
|
-
return;
|
|
74718
|
-
}
|
|
74719
|
-
}
|
|
74720
|
-
function rmForce(target) {
|
|
74721
|
-
try {
|
|
74722
|
-
const stat = fs2.lstatSync(target);
|
|
74723
|
-
if (stat.isSymbolicLink())
|
|
74724
|
-
fs2.unlinkSync(target);
|
|
74725
|
-
else
|
|
74726
|
-
fs2.rmSync(target, { recursive: true, force: true });
|
|
74727
|
-
} catch {}
|
|
74728
|
-
}
|
|
74729
|
-
function resolveParent(dir) {
|
|
74730
|
-
try {
|
|
74731
|
-
return fs2.realpathSync(dir);
|
|
74732
|
-
} catch {
|
|
74733
|
-
const parent = path6.dirname(dir);
|
|
74734
|
-
if (parent === dir)
|
|
74735
|
-
return dir;
|
|
74736
|
-
try {
|
|
74737
|
-
return path6.join(fs2.realpathSync(parent), path6.relative(parent, dir));
|
|
74738
|
-
} catch {
|
|
74739
|
-
return dir;
|
|
74740
|
-
}
|
|
74741
|
-
}
|
|
74742
|
-
}
|
|
74743
|
-
|
|
74744
|
-
export { exports_external, defineConfig, TaggedError, Result, require_react, require_jsx_dev_runtime, useKeyboard, createKeyMatcher, deepMerge, GLOBAL_FLAGS, useRuntime, createCLI, defineCommand, defineGroup, option2 as option, syncSkills };
|
|
74589
|
+
export { exports_external, defineConfig, TaggedError, Result, require_react, require_jsx_dev_runtime, useKeyboard, createKeyMatcher, deepMerge, GLOBAL_FLAGS, useRuntime, renderFull, createCLI, defineCommand, defineGroup, option2 as option };
|
|
74745
74590
|
|
|
74746
|
-
//# debugId=
|
|
74591
|
+
//# debugId=4ADB3F3F1322C56D64756E2164756E21
|