@wp-typia/project-tools 0.23.0 → 0.24.0
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/dist/runtime/ai-feature-artifacts.js +4 -1
- package/dist/runtime/block-generator-service-spec.js +2 -1
- package/dist/runtime/built-in-block-non-ts-basic-artifacts.d.ts +9 -0
- package/dist/runtime/built-in-block-non-ts-basic-artifacts.js +84 -0
- package/dist/runtime/built-in-block-non-ts-compound-artifacts.d.ts +9 -0
- package/dist/runtime/built-in-block-non-ts-compound-artifacts.js +36 -0
- package/dist/runtime/built-in-block-non-ts-compound-templates.d.ts +23 -0
- package/dist/runtime/built-in-block-non-ts-compound-templates.js +453 -0
- package/dist/runtime/built-in-block-non-ts-family-artifacts.d.ts +8 -26
- package/dist/runtime/built-in-block-non-ts-family-artifacts.js +8 -1034
- package/dist/runtime/built-in-block-non-ts-interactivity-artifacts.d.ts +9 -0
- package/dist/runtime/built-in-block-non-ts-interactivity-artifacts.js +83 -0
- package/dist/runtime/built-in-block-non-ts-persistence-artifacts.d.ts +9 -0
- package/dist/runtime/built-in-block-non-ts-persistence-artifacts.js +33 -0
- package/dist/runtime/built-in-block-non-ts-persistence-templates.d.ts +23 -0
- package/dist/runtime/built-in-block-non-ts-persistence-templates.js +395 -0
- package/dist/runtime/cli-add-block-json.js +5 -1
- package/dist/runtime/cli-add-collision.js +8 -0
- package/dist/runtime/cli-add-help.js +14 -10
- package/dist/runtime/cli-add-kind-ids.d.ts +1 -1
- package/dist/runtime/cli-add-kind-ids.js +1 -0
- package/dist/runtime/cli-add-types.d.ts +45 -6
- package/dist/runtime/cli-add-types.js +2 -0
- package/dist/runtime/cli-add-validation.d.ts +7 -0
- package/dist/runtime/cli-add-validation.js +9 -0
- package/dist/runtime/cli-add-workspace-ability-anchors.d.ts +24 -0
- package/dist/runtime/cli-add-workspace-ability-anchors.js +294 -0
- package/dist/runtime/cli-add-workspace-ability-registry.d.ts +10 -0
- package/dist/runtime/cli-add-workspace-ability-registry.js +51 -0
- package/dist/runtime/cli-add-workspace-ability-scaffold.d.ts +1 -1
- package/dist/runtime/cli-add-workspace-ability-scaffold.js +5 -308
- package/dist/runtime/cli-add-workspace-admin-view-scaffold.js +6 -2
- package/dist/runtime/cli-add-workspace-admin-view-templates-core-data.d.ts +34 -0
- package/dist/runtime/cli-add-workspace-admin-view-templates-core-data.js +483 -0
- package/dist/runtime/cli-add-workspace-admin-view-templates-default.d.ts +30 -0
- package/dist/runtime/cli-add-workspace-admin-view-templates-default.js +310 -0
- package/dist/runtime/cli-add-workspace-admin-view-templates-rest.d.ts +25 -0
- package/dist/runtime/cli-add-workspace-admin-view-templates-rest.js +124 -0
- package/dist/runtime/cli-add-workspace-admin-view-templates-settings.d.ts +34 -0
- package/dist/runtime/cli-add-workspace-admin-view-templates-settings.js +370 -0
- package/dist/runtime/cli-add-workspace-admin-view-templates-shared.d.ts +49 -0
- package/dist/runtime/cli-add-workspace-admin-view-templates-shared.js +259 -0
- package/dist/runtime/cli-add-workspace-admin-view-templates.d.ts +18 -27
- package/dist/runtime/cli-add-workspace-admin-view-templates.js +30 -1326
- package/dist/runtime/cli-add-workspace-ai-anchors.d.ts +4 -4
- package/dist/runtime/cli-add-workspace-ai-anchors.js +8 -233
- package/dist/runtime/cli-add-workspace-ai-scaffold.js +4 -2
- package/dist/runtime/cli-add-workspace-ai-source-emitters.d.ts +1 -4
- package/dist/runtime/cli-add-workspace-ai-source-emitters.js +1 -129
- package/dist/runtime/cli-add-workspace-ai-sync-rest-anchors.d.ts +5 -0
- package/dist/runtime/cli-add-workspace-ai-sync-rest-anchors.js +236 -0
- package/dist/runtime/cli-add-workspace-ai-sync-script-source.d.ts +4 -0
- package/dist/runtime/cli-add-workspace-ai-sync-script-source.js +145 -0
- package/dist/runtime/cli-add-workspace-assets.d.ts +6 -63
- package/dist/runtime/cli-add-workspace-assets.js +6 -950
- package/dist/runtime/cli-add-workspace-binding-source-anchors.d.ts +23 -0
- package/dist/runtime/cli-add-workspace-binding-source-anchors.js +112 -0
- package/dist/runtime/cli-add-workspace-binding-source-source-emitters.d.ts +33 -0
- package/dist/runtime/cli-add-workspace-binding-source-source-emitters.js +436 -0
- package/dist/runtime/cli-add-workspace-binding-source-types.d.ts +20 -0
- package/dist/runtime/cli-add-workspace-binding-source-types.js +1 -0
- package/dist/runtime/cli-add-workspace-binding-source.d.ts +40 -0
- package/dist/runtime/cli-add-workspace-binding-source.js +275 -0
- package/dist/runtime/cli-add-workspace-block-style.d.ts +22 -0
- package/dist/runtime/cli-add-workspace-block-style.js +148 -0
- package/dist/runtime/cli-add-workspace-block-transform.d.ts +32 -0
- package/dist/runtime/cli-add-workspace-block-transform.js +197 -0
- package/dist/runtime/cli-add-workspace-contract.js +1 -1
- package/dist/runtime/cli-add-workspace-core-variation.d.ts +20 -0
- package/dist/runtime/cli-add-workspace-core-variation.js +322 -0
- package/dist/runtime/cli-add-workspace-editor-plugin-anchors.d.ts +37 -0
- package/dist/runtime/cli-add-workspace-editor-plugin-anchors.js +206 -0
- package/dist/runtime/cli-add-workspace-editor-plugin-source-emitters.d.ts +47 -0
- package/dist/runtime/cli-add-workspace-editor-plugin-source-emitters.js +219 -0
- package/dist/runtime/cli-add-workspace-editor-plugin.d.ts +22 -0
- package/dist/runtime/cli-add-workspace-editor-plugin.js +78 -0
- package/dist/runtime/cli-add-workspace-hooked-block.d.ts +23 -0
- package/dist/runtime/cli-add-workspace-hooked-block.js +57 -0
- package/dist/runtime/cli-add-workspace-integration-env-files.d.ts +33 -0
- package/dist/runtime/cli-add-workspace-integration-env-files.js +65 -0
- package/dist/runtime/cli-add-workspace-integration-env-package-json.d.ts +38 -0
- package/dist/runtime/cli-add-workspace-integration-env-package-json.js +122 -0
- package/dist/runtime/cli-add-workspace-integration-env-source-emitters.d.ts +44 -0
- package/dist/runtime/cli-add-workspace-integration-env-source-emitters.js +262 -0
- package/dist/runtime/cli-add-workspace-integration-env.d.ts +3 -1
- package/dist/runtime/cli-add-workspace-integration-env.js +10 -313
- package/dist/runtime/cli-add-workspace-pattern-anchors.d.ts +10 -0
- package/dist/runtime/cli-add-workspace-pattern-anchors.js +95 -0
- package/dist/runtime/cli-add-workspace-pattern-options.d.ts +20 -0
- package/dist/runtime/cli-add-workspace-pattern-options.js +113 -0
- package/dist/runtime/cli-add-workspace-pattern-source-emitters.d.ts +20 -0
- package/dist/runtime/cli-add-workspace-pattern-source-emitters.js +57 -0
- package/dist/runtime/cli-add-workspace-pattern.d.ts +42 -0
- package/dist/runtime/cli-add-workspace-pattern.js +99 -0
- package/dist/runtime/cli-add-workspace-post-meta.js +1 -1
- package/dist/runtime/cli-add-workspace-registration-hooks.d.ts +50 -0
- package/dist/runtime/cli-add-workspace-registration-hooks.js +162 -0
- package/dist/runtime/cli-add-workspace-rest-anchors.d.ts +9 -4
- package/dist/runtime/cli-add-workspace-rest-anchors.js +9 -428
- package/dist/runtime/cli-add-workspace-rest-bootstrap-anchors.d.ts +17 -0
- package/dist/runtime/cli-add-workspace-rest-bootstrap-anchors.js +108 -0
- package/dist/runtime/cli-add-workspace-rest-contract-sync-anchors.d.ts +9 -0
- package/dist/runtime/cli-add-workspace-rest-contract-sync-anchors.js +142 -0
- package/dist/runtime/cli-add-workspace-rest-generated-source-emitters.d.ts +51 -0
- package/dist/runtime/cli-add-workspace-rest-generated-source-emitters.js +415 -0
- package/dist/runtime/cli-add-workspace-rest-generated.d.ts +9 -0
- package/dist/runtime/cli-add-workspace-rest-generated.js +160 -0
- package/dist/runtime/cli-add-workspace-rest-manual-source-emitters.d.ts +80 -0
- package/dist/runtime/cli-add-workspace-rest-manual-source-emitters.js +238 -0
- package/dist/runtime/cli-add-workspace-rest-manual.d.ts +8 -0
- package/dist/runtime/cli-add-workspace-rest-manual.js +266 -0
- package/dist/runtime/cli-add-workspace-rest-php-templates.d.ts +18 -0
- package/dist/runtime/cli-add-workspace-rest-php-templates.js +359 -0
- package/dist/runtime/cli-add-workspace-rest-resource-php-routing-template.d.ts +33 -0
- package/dist/runtime/cli-add-workspace-rest-resource-php-routing-template.js +145 -0
- package/dist/runtime/cli-add-workspace-rest-resource-sync-anchors.d.ts +9 -0
- package/dist/runtime/cli-add-workspace-rest-resource-sync-anchors.js +162 -0
- package/dist/runtime/cli-add-workspace-rest-schema-helper-php-template.d.ts +7 -0
- package/dist/runtime/cli-add-workspace-rest-schema-helper-php-template.js +193 -0
- package/dist/runtime/cli-add-workspace-rest-source-emitters.d.ts +5 -91
- package/dist/runtime/cli-add-workspace-rest-source-emitters.js +5 -642
- package/dist/runtime/cli-add-workspace-rest-source-utils.d.ts +17 -0
- package/dist/runtime/cli-add-workspace-rest-source-utils.js +50 -0
- package/dist/runtime/cli-add-workspace-rest-sync-script-shared.d.ts +56 -0
- package/dist/runtime/cli-add-workspace-rest-sync-script-shared.js +122 -0
- package/dist/runtime/cli-add-workspace-rest-types.d.ts +108 -0
- package/dist/runtime/cli-add-workspace-rest-types.js +1 -0
- package/dist/runtime/cli-add-workspace-rest.d.ts +3 -20
- package/dist/runtime/cli-add-workspace-rest.js +33 -788
- package/dist/runtime/cli-add-workspace-variation.d.ts +22 -0
- package/dist/runtime/cli-add-workspace-variation.js +162 -0
- package/dist/runtime/cli-add-workspace.d.ts +42 -107
- package/dist/runtime/cli-add-workspace.js +42 -674
- package/dist/runtime/cli-add.d.ts +3 -3
- package/dist/runtime/cli-add.js +2 -2
- package/dist/runtime/cli-core.d.ts +3 -2
- package/dist/runtime/cli-core.js +2 -2
- package/dist/runtime/cli-diagnostics.d.ts +3 -1
- package/dist/runtime/cli-diagnostics.js +17 -5
- package/dist/runtime/cli-doctor-workspace-bindings.js +63 -1
- package/dist/runtime/cli-doctor-workspace-block-addons.d.ts +12 -0
- package/dist/runtime/cli-doctor-workspace-block-addons.js +162 -0
- package/dist/runtime/cli-doctor-workspace-block-iframe.d.ts +9 -0
- package/dist/runtime/cli-doctor-workspace-block-iframe.js +228 -0
- package/dist/runtime/cli-doctor-workspace-block-metadata.d.ts +11 -0
- package/dist/runtime/cli-doctor-workspace-block-metadata.js +111 -0
- package/dist/runtime/cli-doctor-workspace-blocks.js +6 -424
- package/dist/runtime/cli-doctor-workspace-features-abilities.d.ts +11 -0
- package/dist/runtime/cli-doctor-workspace-features-abilities.js +112 -0
- package/dist/runtime/cli-doctor-workspace-features-admin-views.d.ts +11 -0
- package/dist/runtime/cli-doctor-workspace-features-admin-views.js +128 -0
- package/dist/runtime/cli-doctor-workspace-features-ai.d.ts +11 -0
- package/dist/runtime/cli-doctor-workspace-features-ai.js +57 -0
- package/dist/runtime/cli-doctor-workspace-features-editor-plugins.d.ts +11 -0
- package/dist/runtime/cli-doctor-workspace-features-editor-plugins.js +80 -0
- package/dist/runtime/cli-doctor-workspace-features-post-meta.d.ts +11 -0
- package/dist/runtime/cli-doctor-workspace-features-post-meta.js +77 -0
- package/dist/runtime/cli-doctor-workspace-features-rest.d.ts +11 -0
- package/dist/runtime/cli-doctor-workspace-features-rest.js +120 -0
- package/dist/runtime/cli-doctor-workspace-features.js +14 -487
- package/dist/runtime/cli-doctor.d.ts +54 -3
- package/dist/runtime/cli-doctor.js +92 -10
- package/dist/runtime/cli-help.js +12 -7
- package/dist/runtime/cli-init-package-json.js +4 -2
- package/dist/runtime/cli-prompt.d.ts +16 -2
- package/dist/runtime/cli-prompt.js +29 -12
- package/dist/runtime/cli-scaffold.d.ts +2 -1
- package/dist/runtime/cli-scaffold.js +19 -10
- package/dist/runtime/external-template-guards.js +4 -6
- package/dist/runtime/index.d.ts +6 -3
- package/dist/runtime/index.js +4 -2
- package/dist/runtime/json-utils.d.ts +62 -4
- package/dist/runtime/json-utils.js +78 -4
- package/dist/runtime/local-dev-presets.js +6 -2
- package/dist/runtime/migration-ui-capability.js +4 -1
- package/dist/runtime/migration-utils.js +4 -1
- package/dist/runtime/package-managers.js +6 -1
- package/dist/runtime/package-versions.d.ts +1 -0
- package/dist/runtime/package-versions.js +16 -3
- package/dist/runtime/pattern-catalog.d.ts +122 -0
- package/dist/runtime/pattern-catalog.js +471 -0
- package/dist/runtime/post-meta-binding-fields.d.ts +46 -0
- package/dist/runtime/post-meta-binding-fields.js +135 -0
- package/dist/runtime/scaffold-bootstrap.js +7 -2
- package/dist/runtime/scaffold-package-manager-files.js +5 -1
- package/dist/runtime/scaffold-repository-reference.js +4 -2
- package/dist/runtime/scaffold-template-variables.js +2 -1
- package/dist/runtime/scaffold.d.ts +18 -1
- package/dist/runtime/scaffold.js +55 -2
- package/dist/runtime/temp-roots.js +4 -1
- package/dist/runtime/template-layers.js +4 -1
- package/dist/runtime/template-registry.js +9 -3
- package/dist/runtime/template-source-contracts.d.ts +2 -0
- package/dist/runtime/template-source-normalization.js +2 -1
- package/dist/runtime/template-source-remote.js +18 -5
- package/dist/runtime/template-source-seeds.js +10 -3
- package/dist/runtime/typia-llm-json-schema.d.ts +24 -0
- package/dist/runtime/typia-llm-json-schema.js +33 -0
- package/dist/runtime/typia-llm-openapi-constraints.d.ts +20 -0
- package/dist/runtime/typia-llm-openapi-constraints.js +254 -0
- package/dist/runtime/typia-llm-projection.d.ts +25 -0
- package/dist/runtime/typia-llm-projection.js +58 -0
- package/dist/runtime/typia-llm-render.d.ts +21 -0
- package/dist/runtime/typia-llm-render.js +252 -0
- package/dist/runtime/typia-llm-sync.d.ts +10 -0
- package/dist/runtime/typia-llm-sync.js +63 -0
- package/dist/runtime/typia-llm-types.d.ts +197 -0
- package/dist/runtime/typia-llm-types.js +1 -0
- package/dist/runtime/typia-llm.d.ts +9 -255
- package/dist/runtime/typia-llm.js +5 -634
- package/dist/runtime/workspace-inventory-mutations.js +15 -1
- package/dist/runtime/workspace-inventory-parser-entries.d.ts +17 -0
- package/dist/runtime/workspace-inventory-parser-entries.js +157 -0
- package/dist/runtime/workspace-inventory-parser-validation.d.ts +104 -0
- package/dist/runtime/workspace-inventory-parser-validation.js +34 -0
- package/dist/runtime/workspace-inventory-parser.d.ts +3 -45
- package/dist/runtime/workspace-inventory-parser.js +3 -581
- package/dist/runtime/workspace-inventory-section-descriptors.d.ts +19 -0
- package/dist/runtime/workspace-inventory-section-descriptors.js +443 -0
- package/dist/runtime/workspace-inventory-templates.d.ts +3 -3
- package/dist/runtime/workspace-inventory-templates.js +10 -1
- package/dist/runtime/workspace-inventory-types.d.ts +10 -1
- package/dist/runtime/workspace-project.js +4 -6
- package/package.json +8 -3
- package/templates/_shared/compound/core/scripts/block-config.ts.mustache +22 -0
- package/templates/_shared/compound/core/scripts/sync-types-to-block-json.ts.mustache +103 -2
- package/templates/_shared/compound/core/src/inner-blocks-templates.ts.mustache +13 -0
- package/templates/_shared/compound/persistence/scripts/block-config.ts.mustache +22 -1
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import type { WorkspaceProject } from "./workspace-project.js";
|
|
2
|
+
/**
|
|
3
|
+
* Patch generated sync-rest scripts so AI feature REST artifacts join workspace REST synchronization.
|
|
4
|
+
*/
|
|
5
|
+
export { ensureAiFeatureSyncRestAnchors, } from "./cli-add-workspace-ai-sync-rest-anchors.js";
|
|
2
6
|
/**
|
|
3
7
|
* Patch the workspace bootstrap file so it loads generated AI feature PHP modules.
|
|
4
8
|
*/
|
|
@@ -16,7 +20,3 @@ export declare function ensureAiFeaturePackageScripts(workspace: WorkspaceProjec
|
|
|
16
20
|
* Patch `scripts/sync-project.ts` after package scripts so generated workspaces invoke `sync-ai` when present.
|
|
17
21
|
*/
|
|
18
22
|
export declare function ensureAiFeatureSyncProjectAnchors(workspace: WorkspaceProject): Promise<void>;
|
|
19
|
-
/**
|
|
20
|
-
* Patch `scripts/sync-rest-contracts.ts` after sync-project wiring so AI feature REST artifacts join the split sync flow.
|
|
21
|
-
*/
|
|
22
|
-
export declare function ensureAiFeatureSyncRestAnchors(workspace: WorkspaceProject): Promise<void>;
|
|
@@ -3,8 +3,13 @@ import path from "node:path";
|
|
|
3
3
|
import { getPackageVersions } from "./package-versions.js";
|
|
4
4
|
import { getWorkspaceBootstrapPath, patchFile, } from "./cli-add-shared.js";
|
|
5
5
|
import { appendPhpSnippetBeforeClosingTag, insertPhpSnippetBeforeWorkspaceAnchors, } from "./cli-add-workspace-mutation.js";
|
|
6
|
+
import { readJsonFile } from "./json-utils.js";
|
|
6
7
|
import { hasPhpFunctionDefinition } from "./php-utils.js";
|
|
7
8
|
const AI_FEATURE_SERVER_GLOB = "/inc/ai-features/*.php";
|
|
9
|
+
/**
|
|
10
|
+
* Patch generated sync-rest scripts so AI feature REST artifacts join workspace REST synchronization.
|
|
11
|
+
*/
|
|
12
|
+
export { ensureAiFeatureSyncRestAnchors, } from "./cli-add-workspace-ai-sync-rest-anchors.js";
|
|
8
13
|
/**
|
|
9
14
|
* Patch the workspace bootstrap file so it loads generated AI feature PHP modules.
|
|
10
15
|
*/
|
|
@@ -43,7 +48,9 @@ function ${registerFunctionName}() {
|
|
|
43
48
|
*/
|
|
44
49
|
export async function ensureAiFeaturePackageScripts(workspace) {
|
|
45
50
|
const packageJsonPath = path.join(workspace.projectDir, "package.json");
|
|
46
|
-
const packageJson =
|
|
51
|
+
const packageJson = await readJsonFile(packageJsonPath, {
|
|
52
|
+
context: "workspace package manifest",
|
|
53
|
+
});
|
|
47
54
|
const nextScripts = {
|
|
48
55
|
...(packageJson.scripts ?? {}),
|
|
49
56
|
"sync-ai": packageJson.scripts?.["sync-ai"] ?? "tsx scripts/sync-ai-features.ts",
|
|
@@ -109,235 +116,3 @@ export async function ensureAiFeatureSyncProjectAnchors(workspace) {
|
|
|
109
116
|
return nextSource;
|
|
110
117
|
});
|
|
111
118
|
}
|
|
112
|
-
function assertSyncRestAnchor(nextSource, target, anchorDescription, hasAnchor, syncRestScriptPath) {
|
|
113
|
-
if (!nextSource.includes(target) && !hasAnchor) {
|
|
114
|
-
throw new Error([
|
|
115
|
-
`ensureAiFeatureSyncRestAnchors could not patch ${path.basename(syncRestScriptPath)}.`,
|
|
116
|
-
`Missing expected ${anchorDescription} anchor in scripts/sync-rest-contracts.ts.`,
|
|
117
|
-
"Restore the generated template or add the AI feature wiring manually before retrying.",
|
|
118
|
-
].join(" "));
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
function replaceRequiredSyncRestSource(nextSource, target, anchor, replacement, anchorDescription, syncRestScriptPath) {
|
|
122
|
-
if (nextSource.includes(target)) {
|
|
123
|
-
return nextSource;
|
|
124
|
-
}
|
|
125
|
-
const hasAnchor = typeof anchor === "string" ? nextSource.includes(anchor) : anchor.test(nextSource);
|
|
126
|
-
assertSyncRestAnchor(nextSource, target, anchorDescription, hasAnchor, syncRestScriptPath);
|
|
127
|
-
return nextSource.replace(anchor, replacement);
|
|
128
|
-
}
|
|
129
|
-
function replaceBlockConfigImportForAiFeatures(nextSource, syncRestScriptPath) {
|
|
130
|
-
const importPatterns = [
|
|
131
|
-
/^import\s*\{\n(?:\t[^\n]*\n)+\} from ["']\.\/block-config["'];?$/mu,
|
|
132
|
-
/^import\s*\{[^\n]*\}\s*from\s*["']\.\/block-config["'];?$/mu,
|
|
133
|
-
];
|
|
134
|
-
const importMatch = importPatterns.map((pattern) => pattern.exec(nextSource)).find(Boolean) ??
|
|
135
|
-
null;
|
|
136
|
-
if (!importMatch) {
|
|
137
|
-
throw new Error([
|
|
138
|
-
`ensureAiFeatureSyncRestAnchors could not patch ${path.basename(syncRestScriptPath)}.`,
|
|
139
|
-
"Missing expected workspace inventory import anchor in scripts/sync-rest-contracts.ts.",
|
|
140
|
-
"Restore the generated template or add the AI feature wiring manually before retrying.",
|
|
141
|
-
].join(" "));
|
|
142
|
-
}
|
|
143
|
-
const importSource = importMatch[0];
|
|
144
|
-
if (importSource.includes("AI_FEATURES") &&
|
|
145
|
-
importSource.includes("WorkspaceAiFeatureConfig")) {
|
|
146
|
-
return nextSource;
|
|
147
|
-
}
|
|
148
|
-
const hasContracts = importSource.includes("CONTRACTS");
|
|
149
|
-
const hasContractConfig = importSource.includes("WorkspaceContractConfig");
|
|
150
|
-
const hasPostMeta = importSource.includes("POST_META");
|
|
151
|
-
const hasPostMetaConfig = importSource.includes("WorkspacePostMetaConfig");
|
|
152
|
-
const replacement = [
|
|
153
|
-
"import {",
|
|
154
|
-
"\tAI_FEATURES,",
|
|
155
|
-
"\tBLOCKS,",
|
|
156
|
-
...(hasContracts ? ["\tCONTRACTS,"] : []),
|
|
157
|
-
...(hasPostMeta ? ["\tPOST_META,"] : []),
|
|
158
|
-
"\tREST_RESOURCES,",
|
|
159
|
-
"\ttype WorkspaceAiFeatureConfig,",
|
|
160
|
-
"\ttype WorkspaceBlockConfig,",
|
|
161
|
-
...(hasContractConfig ? ["\ttype WorkspaceContractConfig,"] : []),
|
|
162
|
-
...(hasPostMetaConfig ? ["\ttype WorkspacePostMetaConfig,"] : []),
|
|
163
|
-
"\ttype WorkspaceRestResourceConfig,",
|
|
164
|
-
"} from './block-config';",
|
|
165
|
-
].join("\n");
|
|
166
|
-
return nextSource.replace(importSource, replacement);
|
|
167
|
-
}
|
|
168
|
-
function replaceAiFeatureSyncSummaryCopy(nextSource, syncRestScriptPath) {
|
|
169
|
-
const standaloneSummary = "workspace blocks, standalone contracts, and plugin-level resources";
|
|
170
|
-
const standaloneAiSummary = "workspace blocks, standalone contracts, plugin-level resources, and AI features";
|
|
171
|
-
const standalonePostMetaSummary = "workspace blocks, standalone contracts, post meta contracts, and plugin-level resources";
|
|
172
|
-
const standalonePostMetaAiSummary = "workspace blocks, standalone contracts, post meta contracts, plugin-level resources, and AI features";
|
|
173
|
-
const postMetaSummary = "workspace blocks, post meta contracts, and plugin-level resources";
|
|
174
|
-
const postMetaAiSummary = "workspace blocks, post meta contracts, plugin-level resources, and AI features";
|
|
175
|
-
const restResourceSummary = "workspace blocks and plugin-level resources";
|
|
176
|
-
const restResourceAiSummary = "workspace blocks, plugin-level resources, and AI features";
|
|
177
|
-
if (nextSource.includes(standalonePostMetaSummary)) {
|
|
178
|
-
return nextSource
|
|
179
|
-
.split(standalonePostMetaSummary)
|
|
180
|
-
.join(standalonePostMetaAiSummary);
|
|
181
|
-
}
|
|
182
|
-
if (nextSource.includes(standaloneSummary)) {
|
|
183
|
-
return nextSource.split(standaloneSummary).join(standaloneAiSummary);
|
|
184
|
-
}
|
|
185
|
-
if (nextSource.includes(postMetaSummary)) {
|
|
186
|
-
return nextSource.split(postMetaSummary).join(postMetaAiSummary);
|
|
187
|
-
}
|
|
188
|
-
if (nextSource.includes(restResourceSummary)) {
|
|
189
|
-
return nextSource.split(restResourceSummary).join(restResourceAiSummary);
|
|
190
|
-
}
|
|
191
|
-
if (nextSource.includes(standaloneAiSummary) ||
|
|
192
|
-
nextSource.includes(standalonePostMetaAiSummary) ||
|
|
193
|
-
nextSource.includes(postMetaAiSummary) ||
|
|
194
|
-
nextSource.includes(restResourceAiSummary)) {
|
|
195
|
-
return nextSource;
|
|
196
|
-
}
|
|
197
|
-
throw new Error([
|
|
198
|
-
`ensureAiFeatureSyncRestAnchors could not patch ${path.basename(syncRestScriptPath)}.`,
|
|
199
|
-
"Missing expected sync summary copy anchor in scripts/sync-rest-contracts.ts.",
|
|
200
|
-
"Restore the generated template or add the AI feature wiring manually before retrying.",
|
|
201
|
-
].join(" "));
|
|
202
|
-
}
|
|
203
|
-
function formatNoResourcesSubject(subjects) {
|
|
204
|
-
if (subjects.length <= 2) {
|
|
205
|
-
return subjects.join(" or ");
|
|
206
|
-
}
|
|
207
|
-
const lastSubject = subjects[subjects.length - 1];
|
|
208
|
-
return `${subjects.slice(0, -1).join(", ")}, or ${lastSubject}`;
|
|
209
|
-
}
|
|
210
|
-
function buildAiFeatureNoResourcesGuard({ hasPostMeta, hasStandaloneContracts, }) {
|
|
211
|
-
const condition = ["restBlocks.length === 0"];
|
|
212
|
-
if (hasStandaloneContracts) {
|
|
213
|
-
condition[condition.length - 1] = `${condition[condition.length - 1]} &&`;
|
|
214
|
-
condition.push("standaloneContracts.length === 0");
|
|
215
|
-
}
|
|
216
|
-
if (hasPostMeta) {
|
|
217
|
-
condition[condition.length - 1] = `${condition[condition.length - 1]} &&`;
|
|
218
|
-
condition.push("postMetaContracts.length === 0");
|
|
219
|
-
}
|
|
220
|
-
condition[condition.length - 1] = `${condition[condition.length - 1]} &&`;
|
|
221
|
-
condition.push("restResources.length === 0 &&");
|
|
222
|
-
condition.push("aiFeatures.length === 0");
|
|
223
|
-
const noResourcesSubject = formatNoResourcesSubject([
|
|
224
|
-
"REST-enabled workspace blocks",
|
|
225
|
-
...(hasStandaloneContracts ? ["standalone contracts"] : []),
|
|
226
|
-
...(hasPostMeta ? ["post meta contracts"] : []),
|
|
227
|
-
"plugin-level REST resources",
|
|
228
|
-
"AI features",
|
|
229
|
-
]);
|
|
230
|
-
return [
|
|
231
|
-
"if (",
|
|
232
|
-
...condition.map((line) => `\t\t${line}`),
|
|
233
|
-
"\t) {",
|
|
234
|
-
"\t\tconsole.log(",
|
|
235
|
-
"\t\t\toptions.check",
|
|
236
|
-
`\t\t\t\t? 'ℹ️ No ${noResourcesSubject} are registered yet. \`sync-rest --check\` is already clean.'`,
|
|
237
|
-
`\t\t\t\t: 'ℹ️ No ${noResourcesSubject} are registered yet.'`,
|
|
238
|
-
"\t\t);",
|
|
239
|
-
"\t\treturn;",
|
|
240
|
-
"\t}",
|
|
241
|
-
].join("\n");
|
|
242
|
-
}
|
|
243
|
-
const NO_RESOURCES_GUARD_PATTERN = /if \(\s*restBlocks\.length === 0(?:\s*&&\s*standaloneContracts\.length === 0)?(?:\s*&&\s*postMetaContracts\.length === 0)?\s*&&\s*restResources\.length === 0(?:\s*&&\s*aiFeatures\.length === 0)?\s*\) \{[\s\S]*?\n\t\treturn;\n\t\}/u;
|
|
244
|
-
/**
|
|
245
|
-
* Patch `scripts/sync-rest-contracts.ts` after sync-project wiring so AI feature REST artifacts join the split sync flow.
|
|
246
|
-
*/
|
|
247
|
-
export async function ensureAiFeatureSyncRestAnchors(workspace) {
|
|
248
|
-
const syncRestScriptPath = path.join(workspace.projectDir, "scripts", "sync-rest-contracts.ts");
|
|
249
|
-
await patchFile(syncRestScriptPath, (source) => {
|
|
250
|
-
let nextSource = replaceBlockConfigImportForAiFeatures(source, syncRestScriptPath);
|
|
251
|
-
const helperInsertionAnchor = "async function assertTypeArtifactsCurrent";
|
|
252
|
-
const restResourcesAnchor = "const restResources = REST_RESOURCES.filter( isWorkspaceRestResource );";
|
|
253
|
-
const consoleLogPattern = /\n\tconsole\.log\(\n\t\toptions\.check/u;
|
|
254
|
-
nextSource = replaceRequiredSyncRestSource(nextSource, "function isWorkspaceAiFeature(", helperInsertionAnchor, [
|
|
255
|
-
"function isWorkspaceAiFeature(",
|
|
256
|
-
"\tfeature: WorkspaceAiFeatureConfig",
|
|
257
|
-
"): feature is WorkspaceAiFeatureConfig & {",
|
|
258
|
-
"\taiSchemaFile: string;",
|
|
259
|
-
"\tclientFile: string;",
|
|
260
|
-
"\topenApiFile: string;",
|
|
261
|
-
"\trestManifest: NonNullable< WorkspaceAiFeatureConfig[ 'restManifest' ] >;",
|
|
262
|
-
"\ttypesFile: string;",
|
|
263
|
-
"\tvalidatorsFile: string;",
|
|
264
|
-
"} {",
|
|
265
|
-
"\treturn (",
|
|
266
|
-
"\t\ttypeof feature.aiSchemaFile === 'string' &&",
|
|
267
|
-
"\t\ttypeof feature.clientFile === 'string' &&",
|
|
268
|
-
"\t\ttypeof feature.openApiFile === 'string' &&",
|
|
269
|
-
"\t\ttypeof feature.typesFile === 'string' &&",
|
|
270
|
-
"\t\ttypeof feature.validatorsFile === 'string' &&",
|
|
271
|
-
"\t\ttypeof feature.restManifest === 'object' &&",
|
|
272
|
-
"\t\tfeature.restManifest !== null",
|
|
273
|
-
"\t);",
|
|
274
|
-
"}",
|
|
275
|
-
"",
|
|
276
|
-
"async function assertTypeArtifactsCurrent",
|
|
277
|
-
].join("\n"), "type artifact assertion helper", syncRestScriptPath);
|
|
278
|
-
nextSource = replaceRequiredSyncRestSource(nextSource, "const aiFeatures = AI_FEATURES.filter( isWorkspaceAiFeature );", restResourcesAnchor, [
|
|
279
|
-
"const restResources = REST_RESOURCES.filter( isWorkspaceRestResource );",
|
|
280
|
-
"const aiFeatures = AI_FEATURES.filter( isWorkspaceAiFeature );",
|
|
281
|
-
].join("\n"), "rest resource filter", syncRestScriptPath);
|
|
282
|
-
nextSource = replaceRequiredSyncRestSource(nextSource, "aiFeatures.length === 0", NO_RESOURCES_GUARD_PATTERN, buildAiFeatureNoResourcesGuard({
|
|
283
|
-
hasPostMeta: nextSource.includes("const postMetaContracts = POST_META.filter( isWorkspacePostMetaContract );"),
|
|
284
|
-
hasStandaloneContracts: nextSource.includes("const standaloneContracts = CONTRACTS.filter( isWorkspaceStandaloneContract );"),
|
|
285
|
-
}), "no-resources guard", syncRestScriptPath);
|
|
286
|
-
nextSource = replaceRequiredSyncRestSource(nextSource, "for ( const feature of aiFeatures ) {", consoleLogPattern, [
|
|
287
|
-
"",
|
|
288
|
-
"\tfor ( const feature of aiFeatures ) {",
|
|
289
|
-
"\t\tconst contracts = feature.restManifest.contracts;",
|
|
290
|
-
"",
|
|
291
|
-
"\t\tfor ( const [ baseName, contract ] of Object.entries( contracts ) ) {",
|
|
292
|
-
"\t\t\tawait syncTypeSchemas(",
|
|
293
|
-
"\t\t\t\t{",
|
|
294
|
-
"\t\t\t\t\tjsonSchemaFile: path.join(",
|
|
295
|
-
"\t\t\t\t\t\tpath.dirname( feature.typesFile ),",
|
|
296
|
-
"\t\t\t\t\t\t'api-schemas',",
|
|
297
|
-
"\t\t\t\t\t\t`${ baseName }.schema.json`",
|
|
298
|
-
"\t\t\t\t\t),",
|
|
299
|
-
"\t\t\t\t\topenApiFile: path.join(",
|
|
300
|
-
"\t\t\t\t\t\tpath.dirname( feature.typesFile ),",
|
|
301
|
-
"\t\t\t\t\t\t'api-schemas',",
|
|
302
|
-
"\t\t\t\t\t\t`${ baseName }.openapi.json`",
|
|
303
|
-
"\t\t\t\t\t),",
|
|
304
|
-
"\t\t\t\t\tsourceTypeName: contract.sourceTypeName,",
|
|
305
|
-
"\t\t\t\t\ttypesFile: feature.typesFile,",
|
|
306
|
-
"\t\t\t\t},",
|
|
307
|
-
"\t\t\t\t{",
|
|
308
|
-
"\t\t\t\t\tcheck: options.check,",
|
|
309
|
-
"\t\t\t\t}",
|
|
310
|
-
"\t\t\t);",
|
|
311
|
-
"\t\t}",
|
|
312
|
-
"",
|
|
313
|
-
"\t\tawait syncRestOpenApi(",
|
|
314
|
-
"\t\t\t{",
|
|
315
|
-
"\t\t\t\tmanifest: feature.restManifest,",
|
|
316
|
-
"\t\t\t\topenApiFile: feature.openApiFile,",
|
|
317
|
-
"\t\t\t\ttypesFile: feature.typesFile,",
|
|
318
|
-
"\t\t\t},",
|
|
319
|
-
"\t\t\t{",
|
|
320
|
-
"\t\t\t\tcheck: options.check,",
|
|
321
|
-
"\t\t\t}",
|
|
322
|
-
"\t\t);",
|
|
323
|
-
"",
|
|
324
|
-
"\t\tawait syncEndpointClient(",
|
|
325
|
-
"\t\t\t{",
|
|
326
|
-
"\t\t\t\tclientFile: feature.clientFile,",
|
|
327
|
-
"\t\t\t\tmanifest: feature.restManifest,",
|
|
328
|
-
"\t\t\t\ttypesFile: feature.typesFile,",
|
|
329
|
-
"\t\t\t\tvalidatorsFile: feature.validatorsFile,",
|
|
330
|
-
"\t\t\t},",
|
|
331
|
-
"\t\t\t{",
|
|
332
|
-
"\t\t\t\tcheck: options.check,",
|
|
333
|
-
"\t\t\t}",
|
|
334
|
-
"\t\t);",
|
|
335
|
-
"\t}",
|
|
336
|
-
"",
|
|
337
|
-
"\tconsole.log(",
|
|
338
|
-
"\t\toptions.check",
|
|
339
|
-
].join("\n"), "final sync summary", syncRestScriptPath);
|
|
340
|
-
nextSource = replaceAiFeatureSyncSummaryCopy(nextSource, syncRestScriptPath);
|
|
341
|
-
return nextSource;
|
|
342
|
-
});
|
|
343
|
-
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { promises as fsp } from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { ensureBlockConfigCanAddRestManifests } from "./cli-add-block-legacy-validator.js";
|
|
4
|
-
import { buildAiFeatureConfigEntry, buildAiFeatureDataSource,
|
|
5
|
-
import {
|
|
4
|
+
import { buildAiFeatureConfigEntry, buildAiFeatureDataSource, buildAiFeatureTypesSource, buildAiFeatureValidatorsSource, buildAiFeatureApiSource, } from "./cli-add-workspace-ai-source-emitters.js";
|
|
5
|
+
import { buildAiFeatureSyncScriptSource, } from "./cli-add-workspace-ai-sync-script-source.js";
|
|
6
|
+
import { ensureAiFeatureBootstrapAnchors, ensureAiFeaturePackageScripts, ensureAiFeatureSyncProjectAnchors, } from "./cli-add-workspace-ai-anchors.js";
|
|
7
|
+
import { ensureAiFeatureSyncRestAnchors, } from "./cli-add-workspace-ai-sync-rest-anchors.js";
|
|
6
8
|
import { buildAiFeaturePhpSource } from "./cli-add-workspace-ai-templates.js";
|
|
7
9
|
import { appendWorkspaceInventoryEntries } from "./workspace-inventory.js";
|
|
8
10
|
import { getWorkspaceBootstrapPath, patchFile, } from "./cli-add-shared.js";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { buildAiFeatureSyncScriptSource, } from "./cli-add-workspace-ai-sync-script-source.js";
|
|
1
2
|
/**
|
|
2
3
|
* Build the workspace inventory entry written into `scripts/block-config.ts` for one AI feature.
|
|
3
4
|
*/
|
|
@@ -18,7 +19,3 @@ export declare function buildAiFeatureApiSource(aiFeatureSlug: string): string;
|
|
|
18
19
|
* Generate React endpoint-mutation hooks for the scaffolded AI feature client wrapper.
|
|
19
20
|
*/
|
|
20
21
|
export declare function buildAiFeatureDataSource(aiFeatureSlug: string): string;
|
|
21
|
-
/**
|
|
22
|
-
* Generate the `scripts/sync-ai-features.ts` source that projects AI-safe schemas for workspace features.
|
|
23
|
-
*/
|
|
24
|
-
export declare function buildAiFeatureSyncScriptSource(): string;
|
|
@@ -2,6 +2,7 @@ import { quoteTsString } from "./cli-add-shared.js";
|
|
|
2
2
|
import { buildAiFeatureEndpointManifest } from "./ai-feature-artifacts.js";
|
|
3
3
|
import { OPTIONAL_WORDPRESS_AI_CLIENT_COMPATIBILITY, createScaffoldCompatibilityConfig, renderScaffoldCompatibilityConfig, resolveScaffoldCompatibilityPolicy, } from "./scaffold-compatibility.js";
|
|
4
4
|
import { toPascalCase, toTitleCase } from "./string-case.js";
|
|
5
|
+
export { buildAiFeatureSyncScriptSource, } from "./cli-add-workspace-ai-sync-script-source.js";
|
|
5
6
|
function indentMultiline(source, prefix) {
|
|
6
7
|
return source
|
|
7
8
|
.split("\n")
|
|
@@ -323,132 +324,3 @@ export {
|
|
|
323
324
|
};
|
|
324
325
|
`;
|
|
325
326
|
}
|
|
326
|
-
/**
|
|
327
|
-
* Generate the `scripts/sync-ai-features.ts` source that projects AI-safe schemas for workspace features.
|
|
328
|
-
*/
|
|
329
|
-
export function buildAiFeatureSyncScriptSource() {
|
|
330
|
-
return `/* eslint-disable no-console */
|
|
331
|
-
import { mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
332
|
-
import path from 'node:path';
|
|
333
|
-
|
|
334
|
-
import { projectWordPressAiSchema } from '@wp-typia/project-tools/ai-artifacts';
|
|
335
|
-
|
|
336
|
-
import {
|
|
337
|
-
\tAI_FEATURES,
|
|
338
|
-
\ttype WorkspaceAiFeatureConfig,
|
|
339
|
-
} from './block-config';
|
|
340
|
-
|
|
341
|
-
function parseCliOptions( argv: string[] ) {
|
|
342
|
-
\tconst options = {
|
|
343
|
-
\t\tcheck: false,
|
|
344
|
-
\t};
|
|
345
|
-
|
|
346
|
-
\tfor ( const argument of argv ) {
|
|
347
|
-
\t\tif ( argument === '--check' ) {
|
|
348
|
-
\t\t\toptions.check = true;
|
|
349
|
-
\t\t\tcontinue;
|
|
350
|
-
\t\t}
|
|
351
|
-
|
|
352
|
-
\t\tthrow new Error( \`Unknown sync-ai flag: \${ argument }\` );
|
|
353
|
-
\t}
|
|
354
|
-
|
|
355
|
-
\treturn options;
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
function isWorkspaceAiFeature(
|
|
359
|
-
\tfeature: WorkspaceAiFeatureConfig
|
|
360
|
-
): feature is WorkspaceAiFeatureConfig & {
|
|
361
|
-
\taiSchemaFile: string;
|
|
362
|
-
\ttypesFile: string;
|
|
363
|
-
} {
|
|
364
|
-
\treturn (
|
|
365
|
-
\t\ttypeof feature.aiSchemaFile === 'string' &&
|
|
366
|
-
\t\ttypeof feature.typesFile === 'string'
|
|
367
|
-
\t);
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
function normalizeGeneratedArtifactContent( content: string ) {
|
|
371
|
-
\treturn content.replace( /\\r\\n?/g, '\\n' );
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
async function reconcileGeneratedArtifact( options: {
|
|
375
|
-
\tcheck: boolean;
|
|
376
|
-
\tcontent: string;
|
|
377
|
-
\tfilePath: string;
|
|
378
|
-
\tlabel: string;
|
|
379
|
-
} ) {
|
|
380
|
-
\tif ( ! options.check ) {
|
|
381
|
-
\t\tawait mkdir( path.dirname( options.filePath ), {
|
|
382
|
-
\t\t\trecursive: true,
|
|
383
|
-
\t\t} );
|
|
384
|
-
\t\tawait writeFile( options.filePath, options.content, 'utf8' );
|
|
385
|
-
\t\treturn;
|
|
386
|
-
\t}
|
|
387
|
-
|
|
388
|
-
\tconst current = normalizeGeneratedArtifactContent(
|
|
389
|
-
\t\tawait readFile( options.filePath, 'utf8' )
|
|
390
|
-
\t);
|
|
391
|
-
\tconst expected = normalizeGeneratedArtifactContent( options.content );
|
|
392
|
-
\tif ( current !== expected ) {
|
|
393
|
-
\t\tthrow new Error(
|
|
394
|
-
\t\t\t\`Generated AI feature artifact is stale: \${ options.label } (\${ options.filePath }).\`
|
|
395
|
-
\t\t);
|
|
396
|
-
\t}
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
async function loadJsonDocument( filePath: string ) {
|
|
400
|
-
\tconst decoded = JSON.parse( await readFile( filePath, 'utf8' ) ) as unknown;
|
|
401
|
-
\tif ( ! decoded || typeof decoded !== 'object' || Array.isArray( decoded ) ) {
|
|
402
|
-
\t\tthrow new Error( \`Expected \${ filePath } to decode to a JSON object.\` );
|
|
403
|
-
\t}
|
|
404
|
-
|
|
405
|
-
\treturn decoded as Parameters< typeof projectWordPressAiSchema >[ 0 ];
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
async function main() {
|
|
409
|
-
\tconst options = parseCliOptions( process.argv.slice( 2 ) );
|
|
410
|
-
\tconst aiFeatures = AI_FEATURES.filter( isWorkspaceAiFeature );
|
|
411
|
-
\tif ( AI_FEATURES.length > 0 && aiFeatures.length === 0 ) {
|
|
412
|
-
\t\tconsole.warn(
|
|
413
|
-
\t\t\t'⚠️ AI_FEATURES entries exist, but none satisfied the generated sync-ai guard. Check for missing aiSchemaFile/typesFile fields in scripts/block-config.ts.'
|
|
414
|
-
\t\t);
|
|
415
|
-
\t}
|
|
416
|
-
|
|
417
|
-
\tif ( aiFeatures.length === 0 ) {
|
|
418
|
-
\t\tconsole.log(
|
|
419
|
-
\t\t\toptions.check
|
|
420
|
-
\t\t\t\t? 'ℹ️ No workspace AI features are registered yet. \`sync-ai --check\` is already clean.'
|
|
421
|
-
\t\t\t\t: 'ℹ️ No workspace AI features are registered yet.'
|
|
422
|
-
\t\t);
|
|
423
|
-
\t\treturn;
|
|
424
|
-
\t}
|
|
425
|
-
|
|
426
|
-
\tfor ( const feature of aiFeatures ) {
|
|
427
|
-
\t\tconst sourceSchemaPath = path.join(
|
|
428
|
-
\t\t\tpath.dirname( feature.typesFile ),
|
|
429
|
-
\t\t\t'api-schemas',
|
|
430
|
-
\t\t\t'feature-result.schema.json'
|
|
431
|
-
\t\t);
|
|
432
|
-
\t\tconst sourceSchema = await loadJsonDocument( sourceSchemaPath );
|
|
433
|
-
\t\tconst aiSchema = projectWordPressAiSchema( sourceSchema );
|
|
434
|
-
\t\tawait reconcileGeneratedArtifact( {
|
|
435
|
-
\t\t\tcheck: options.check,
|
|
436
|
-
\t\t\tcontent: \`\${ JSON.stringify( aiSchema, null, 2 ) }\\n\`,
|
|
437
|
-
\t\t\tfilePath: feature.aiSchemaFile,
|
|
438
|
-
\t\t\tlabel: feature.slug,
|
|
439
|
-
\t\t} );
|
|
440
|
-
\t}
|
|
441
|
-
|
|
442
|
-
\tconsole.log(
|
|
443
|
-
\t\toptions.check
|
|
444
|
-
\t\t\t? '✅ AI feature structured-output schemas are already synchronized.'
|
|
445
|
-
\t\t\t: '✅ AI feature structured-output schemas were synchronized.'
|
|
446
|
-
\t);
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
main().catch( ( error ) => {
|
|
450
|
-
\tconsole.error( '❌ AI feature sync failed:', error );
|
|
451
|
-
\tprocess.exit( 1 );
|
|
452
|
-
} );
|
|
453
|
-
`;
|
|
454
|
-
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { WorkspaceProject } from "./workspace-project.js";
|
|
2
|
+
/**
|
|
3
|
+
* Patch `scripts/sync-rest-contracts.ts` after sync-project wiring so AI feature REST artifacts join the split sync flow.
|
|
4
|
+
*/
|
|
5
|
+
export declare function ensureAiFeatureSyncRestAnchors(workspace: WorkspaceProject): Promise<void>;
|