@deepseek-ai/dsh-typert-generator 0.1.6-alpha.1 → 0.1.6-alpha.2
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.i18n.yaml +2 -2
- package/README.md +4 -2
- package/README.zh.md +4 -2
- package/lib/index.js +17 -13
- package/lib/types/analyzer.js +5 -4
- package/lib/types/cordis-catalog.d.ts +2 -0
- package/lib/types/cordis-catalog.js +7 -5
- package/lib/types/emitter.js +7 -6
- package/package.json +3 -3
package/README.i18n.yaml
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
3
|
# after editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm run verify-translation-pairing --write packages/typert/generator/README.md
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: 399e4fe622a785d68452ffeae79e106246941fa1
|
|
6
|
+
README.zh.md: 1fd19fd76ab804013a8741cb90522e9fd3f608d3
|
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ English | [中文](README.zh.md)
|
|
|
9
9
|
|
|
10
10
|
## Summary
|
|
11
11
|
|
|
12
|
-
`dsh-typert-generator` lets maintainers turn public TypeScript types into build artifacts and compiler-independent models. Packages opt in through the `./typert` and optional `./client/typert` exports, and generation rejects declarations, publish lists, Remote exports, or Zod projections that it cannot represent correctly. Repository builds
|
|
12
|
+
`dsh-typert-generator` lets maintainers turn public TypeScript types into build artifacts and compiler-independent models. Packages opt in through the `./typert` and optional `./client/typert` exports, and generation rejects declarations, publish lists, Remote exports, or Zod projections that it cannot represent correctly. Repository builds emit executable schema factories and matching declarations, while tools can call `WorkspaceAnalyzer` for inspection or catalog generation without publishing artifacts. Generation runs only at build time and never in a live agent session.
|
|
13
13
|
|
|
14
14
|
## Table of Contents
|
|
15
15
|
|
|
@@ -83,10 +83,12 @@ Host and Client are independent TypeScript programs. Direct project references e
|
|
|
83
83
|
|
|
84
84
|
### Emission and publication contract
|
|
85
85
|
|
|
86
|
-
`FaceModelEmitter` emits executable JavaScript containing
|
|
86
|
+
`FaceModelEmitter` emits executable JavaScript containing success-cached Zod schema factories and the `TYPERT` contribution, plus a declaration file whose factories return `z.ZodType<SourceType>` through the package's public export; unsupported Zod projections fail. The Host face with Remote methods additionally emits `typert.remote-client.*` projections of Host Remote contracts for the Client. `WorkspaceTypertGenerator` validates each contributor's `package.json`: `./typert` and `./client/typert` (and `./remote` when Remote methods exist) must point at the exact generated files, and the `files` list must include them.
|
|
87
87
|
|
|
88
88
|
### Catalog projection
|
|
89
89
|
|
|
90
|
+
The runtime type closure indexes exported workspace declarations and referenced framework enums. Vendored declarations stay outside business API discovery; their enums remain available when a public result refers to them.
|
|
91
|
+
|
|
90
92
|
The root export includes the model-driven extraction, completeness checks, and deterministic text renderers used by this repository's Cordis catalogs. They accept a `CordisCatalogPolicy`; repository-owned type links, foundation and exemption classifications, and inherited Cordis entries stay in `scripts/gen-cordis-catalog.ts` and are passed in explicitly, so this package contains projection mechanics, not a hidden copy of the repository's documentation taxonomy.
|
|
91
93
|
|
|
92
94
|
</details>
|
package/README.zh.md
CHANGED
|
@@ -9,7 +9,7 @@ kind: "package-library"
|
|
|
9
9
|
|
|
10
10
|
## 概述
|
|
11
11
|
|
|
12
|
-
`dsh-typert-generator` 让维护者把公开的 TypeScript 类型转换为构建产物和与编译器无关的模型。包通过 `./typert` 和可选的 `./client/typert` 导出选择加入;如果声明、发布清单、Remote 导出或 Zod
|
|
12
|
+
`dsh-typert-generator` 让维护者把公开的 TypeScript 类型转换为构建产物和与编译器无关的模型。包通过 `./typert` 和可选的 `./client/typert` 导出选择加入;如果声明、发布清单、Remote 导出或 Zod 投影无法被正确表示,生成过程就会失败。仓库构建会生成可执行 schema factory 与配套声明,工具也可以调用 `WorkspaceAnalyzer` 完成检查或目录生成而不发布产物。生成过程只在构建时运行,绝不会进入实时 agent(智能体)会话。
|
|
13
13
|
|
|
14
14
|
## 目录
|
|
15
15
|
|
|
@@ -83,10 +83,12 @@ Host 与 Client 是两个独立的 TypeScript 程序。直接项目引用确定
|
|
|
83
83
|
|
|
84
84
|
### 生成与发布约定
|
|
85
85
|
|
|
86
|
-
`FaceModelEmitter`
|
|
86
|
+
`FaceModelEmitter` 输出包含只缓存成功结果的 Zod schema factory 与 `TYPERT` 贡献的可执行 JavaScript,以及把 factory 通过包的公开导出标注为返回 `z.ZodType<SourceType>` 的声明文件;不支持的 Zod 投影会失败。含 Remote 方法的 Host face 还会额外为 Client 生成 Host Remote 约定的 `typert.remote-client.*` 投影。`WorkspaceTypertGenerator` 校验每个贡献方的 `package.json`:`./typert` 与 `./client/typert`(存在 Remote 方法时还有 `./remote`)必须指向精确的生成文件,且 `files` 清单必须包含它们。
|
|
87
87
|
|
|
88
88
|
### 目录投影
|
|
89
89
|
|
|
90
|
+
运行时类型闭包索引导出的 workspace 声明和被引用的框架 enum。Vendor 声明不参与业务 API 发现;公共结果引用其中 enum 时,目录仍提供其定义。
|
|
91
|
+
|
|
90
92
|
根导出包含本仓库 Cordis 目录使用的模型驱动提取逻辑、完整性检查与确定性文本渲染器。它们接受 `CordisCatalogPolicy`;由仓库持有的类型链接、基础类型/豁免分类与继承的 Cordis 条目仍位于 `scripts/gen-cordis-catalog.ts`,由调用方显式传入,因此本包只包含投影机制,不会隐式复制仓库的文档分类体系。
|
|
91
93
|
|
|
92
94
|
</details>
|
package/lib/index.js
CHANGED
|
@@ -238,7 +238,7 @@ var WorkspaceAnalyzer = class WorkspaceAnalyzer {
|
|
|
238
238
|
indexSourceDeclarations() {
|
|
239
239
|
const selected = this.options.packages === void 0 ? void 0 : new Set(this.options.packages);
|
|
240
240
|
const declarations = [];
|
|
241
|
-
for (const registration of this.loadRegistrations()) {
|
|
241
|
+
for (const registration of this.loadRegistrations(true)) {
|
|
242
242
|
if (!this.options.faces.includes(registration.face) || selected !== void 0 && !selected.has(registration.name)) continue;
|
|
243
243
|
for (const file of registration.config.parsed.fileNames) {
|
|
244
244
|
const relativeFile = slash(relative(this.options.root, file));
|
|
@@ -264,8 +264,8 @@ var WorkspaceAnalyzer = class WorkspaceAnalyzer {
|
|
|
264
264
|
}
|
|
265
265
|
return uniqueBy(declarations, (declaration) => `${declaration.face}\0${declaration.location.file}\0${String(declaration.location.line)}\0${declaration.name}`).sort((left, right) => left.face.localeCompare(right.face) || left.location.file.localeCompare(right.location.file) || left.location.line - right.location.line);
|
|
266
266
|
}
|
|
267
|
-
loadRegistrations() {
|
|
268
|
-
const inventoryKey = `${this.options.root}\0${this.options.hostConfig}\0${this.options.clientConfig}`;
|
|
267
|
+
loadRegistrations(includeVendor = false) {
|
|
268
|
+
const inventoryKey = `${this.options.root}\0${this.options.hostConfig}\0${this.options.clientConfig}\0${String(includeVendor)}`;
|
|
269
269
|
const cached = this.caches.registrations.get(inventoryKey);
|
|
270
270
|
if (cached !== void 0) return cached;
|
|
271
271
|
const registrations = [];
|
|
@@ -276,7 +276,7 @@ var WorkspaceAnalyzer = class WorkspaceAnalyzer {
|
|
|
276
276
|
for (const reference of aggregate.parsed.projectReferences ?? []) {
|
|
277
277
|
const configPath = projectConfigPath(reference.path);
|
|
278
278
|
const packageRoot = dirname(configPath);
|
|
279
|
-
if (!isWithin(realPath(packageRoot), join(this.options.root, "packages"))) continue;
|
|
279
|
+
if (!isWithin(realPath(packageRoot), join(this.options.root, "packages")) && !(includeVendor && isWithin(realPath(packageRoot), join(this.options.root, "vendor")))) continue;
|
|
280
280
|
const manifestPath = join(packageRoot, "package.json");
|
|
281
281
|
if (!existsSync(manifestPath)) continue;
|
|
282
282
|
const manifest = JSON.parse(readFileSync(manifestPath, "utf8"));
|
|
@@ -2821,7 +2821,7 @@ var FaceModelEmitter = class {
|
|
|
2821
2821
|
lines.push(` package: ${quote$1(packageModel.name)},`);
|
|
2822
2822
|
lines.push(` face: ${quote$1(this.face.face)},`);
|
|
2823
2823
|
lines.push(" schemas: [");
|
|
2824
|
-
for (const schema of schemas.exports) lines.push(` { name: ${quote$1(schema.exportName)},
|
|
2824
|
+
for (const schema of schemas.exports) lines.push(` { name: ${quote$1(schema.exportName)}, create: ${schema.exportName} },`);
|
|
2825
2825
|
lines.push(" ],");
|
|
2826
2826
|
lines.push(" invocations: [");
|
|
2827
2827
|
for (const invocation of packageModel.invocations) lines.push(`${indent(this.invocationLiteral(invocation, schemas), 4)},`);
|
|
@@ -2842,7 +2842,7 @@ var FaceModelEmitter = class {
|
|
|
2842
2842
|
if (schemas.exports.length > 0) lines.splice(1, 0, "import type { z } from 'zod'");
|
|
2843
2843
|
for (const [specifier, names] of [...imports].sort(([left], [right]) => left.localeCompare(right))) lines.push(`import type { ${names.sort().join(", ")} } from ${quote$1(specifier)}`);
|
|
2844
2844
|
lines.push("");
|
|
2845
|
-
for (const schema of schemas.exports) lines.push(`export declare const ${schema.exportName}: z.ZodType<${schema.exportName}$source>`);
|
|
2845
|
+
for (const schema of schemas.exports) lines.push(`export declare const ${schema.exportName}: () => z.ZodType<${schema.exportName}$source>`);
|
|
2846
2846
|
if (schemas.exports.length > 0) lines.push("");
|
|
2847
2847
|
lines.push("export declare const TYPERT: unknown");
|
|
2848
2848
|
return `${lines.join("\n")}\n`;
|
|
@@ -3056,7 +3056,10 @@ var SchemaEmitter = class {
|
|
|
3056
3056
|
}
|
|
3057
3057
|
emit() {
|
|
3058
3058
|
const definitions = this.declarations.map((declaration) => this.declarationDefinition(declaration));
|
|
3059
|
-
for (const boundary of this.boundaries)
|
|
3059
|
+
for (const boundary of this.boundaries) {
|
|
3060
|
+
const name = this.boundaryName(boundary.key);
|
|
3061
|
+
definitions.push(`let ${name}$value\nconst ${name} = () => (${name}$value ??= ${this.typeSchema(boundary.type)})`);
|
|
3062
|
+
}
|
|
3060
3063
|
return {
|
|
3061
3064
|
definitions,
|
|
3062
3065
|
exports: this.schemas.map((model) => ({
|
|
@@ -3069,7 +3072,7 @@ var SchemaEmitter = class {
|
|
|
3069
3072
|
}
|
|
3070
3073
|
declarationDefinition(declaration) {
|
|
3071
3074
|
const name = this.schemaName(declaration.id);
|
|
3072
|
-
if (declaration.typeParameters.length === 0) return `
|
|
3075
|
+
if (declaration.typeParameters.length === 0) return `let ${name}$value\nconst ${name} = () => (${name}$value ??= ${this.declarationSchema(declaration, /* @__PURE__ */ new Map())})`;
|
|
3073
3076
|
const parameters = declaration.typeParameters.map((parameter, index) => [`type${String(index)}$schema`, parameter.id]);
|
|
3074
3077
|
const substitutions = new Map(parameters.map(([schema, id]) => [id, schema]));
|
|
3075
3078
|
return `const ${name} = (${parameters.map(([schema]) => schema).join(", ")}) => ${this.declarationSchema(declaration, substitutions)}`;
|
|
@@ -3129,7 +3132,7 @@ var SchemaEmitter = class {
|
|
|
3129
3132
|
const declaration = this.renderer.declaration(node.target.symbol);
|
|
3130
3133
|
if (declaration.typeParameters.length === 0) {
|
|
3131
3134
|
if (node.arguments.length > 0) this.fail(node.name, `non-generic declaration received ${String(node.arguments.length)} type arguments`);
|
|
3132
|
-
return `z.lazy(() => ${name})`;
|
|
3135
|
+
return `z.lazy(() => ${name}())`;
|
|
3133
3136
|
}
|
|
3134
3137
|
return `z.lazy(() => ${name}(${this.declarationArguments(node, declaration, substitutions).join(", ")}))`;
|
|
3135
3138
|
}
|
|
@@ -3297,7 +3300,7 @@ function strictCodec(boundary, schema) {
|
|
|
3297
3300
|
"{",
|
|
3298
3301
|
" mode: 'strict',",
|
|
3299
3302
|
` typeSymbol: ${quote$1(boundary.typeSymbol)},`,
|
|
3300
|
-
`
|
|
3303
|
+
` create: ${schema},`,
|
|
3301
3304
|
"}"
|
|
3302
3305
|
].join("\n");
|
|
3303
3306
|
}
|
|
@@ -3529,13 +3532,14 @@ var CordisCatalogProjector = class {
|
|
|
3529
3532
|
runtimeTypes(services, events) {
|
|
3530
3533
|
const declarations = /* @__PURE__ */ new Map();
|
|
3531
3534
|
const ambiguous = /* @__PURE__ */ new Set();
|
|
3535
|
+
const maxDeclarationChars = this.policy.runtimeDeclarationMaxChars ?? DEFAULT_MAX_DECL_CHARS;
|
|
3532
3536
|
for (const declaration of this.sourceDeclarations) {
|
|
3533
|
-
if (declaration.face !== this.face.face || declaration.kind === "enum"
|
|
3537
|
+
if (declaration.face !== this.face.face || !/^packages\/[^/]+\/[^/]+\/src\/.+\.tsx?$/.test(declaration.location.file) && !(declaration.kind === "enum" && /^vendor\/[^/]+\/src\/.+\.ts$/.test(declaration.location.file))) continue;
|
|
3534
3538
|
if (declarations.has(declaration.name)) {
|
|
3535
3539
|
ambiguous.add(declaration.name);
|
|
3536
3540
|
continue;
|
|
3537
3541
|
}
|
|
3538
|
-
declarations.set(declaration.name, declaration.text.length >
|
|
3542
|
+
declarations.set(declaration.name, declaration.text.length > maxDeclarationChars ? `${declaration.text.slice(0, maxDeclarationChars)} /* …truncated — full shape in source */` : declaration.text);
|
|
3539
3543
|
}
|
|
3540
3544
|
for (const name of ambiguous) declarations.delete(name);
|
|
3541
3545
|
return referencedTypes([...services.flatMap((service) => service.methods.map((method) => method.signature)), ...events.map((event) => event.signature)], declarations);
|
|
@@ -3751,7 +3755,7 @@ function signatureTypeNames(renderer, signature) {
|
|
|
3751
3755
|
return [...names].sort();
|
|
3752
3756
|
}
|
|
3753
3757
|
/** Declarations longer than this render as a truncated stub. */
|
|
3754
|
-
const
|
|
3758
|
+
const DEFAULT_MAX_DECL_CHARS = 1500;
|
|
3755
3759
|
/** Render one value as a single-quoted TypeScript literal. */
|
|
3756
3760
|
function quote(value) {
|
|
3757
3761
|
return `'${value.replaceAll("\\", "\\\\").replaceAll("'", "\\'").replaceAll("\n", "\\n")}'`;
|
package/lib/types/analyzer.js
CHANGED
|
@@ -254,7 +254,7 @@ export class WorkspaceAnalyzer {
|
|
|
254
254
|
indexSourceDeclarations() {
|
|
255
255
|
const selected = this.options.packages === undefined ? undefined : new Set(this.options.packages);
|
|
256
256
|
const declarations = [];
|
|
257
|
-
for (const registration of this.loadRegistrations()) {
|
|
257
|
+
for (const registration of this.loadRegistrations(true)) {
|
|
258
258
|
if (!this.options.faces.includes(registration.face)
|
|
259
259
|
|| (selected !== undefined && !selected.has(registration.name)))
|
|
260
260
|
continue;
|
|
@@ -297,8 +297,8 @@ export class WorkspaceAnalyzer {
|
|
|
297
297
|
|| left.location.file.localeCompare(right.location.file)
|
|
298
298
|
|| left.location.line - right.location.line);
|
|
299
299
|
}
|
|
300
|
-
loadRegistrations() {
|
|
301
|
-
const inventoryKey = `${this.options.root}\0${this.options.hostConfig}\0${this.options.clientConfig}`;
|
|
300
|
+
loadRegistrations(includeVendor = false) {
|
|
301
|
+
const inventoryKey = `${this.options.root}\0${this.options.hostConfig}\0${this.options.clientConfig}\0${String(includeVendor)}`;
|
|
302
302
|
const cached = this.caches.registrations.get(inventoryKey);
|
|
303
303
|
if (cached !== undefined)
|
|
304
304
|
return cached;
|
|
@@ -311,7 +311,8 @@ export class WorkspaceAnalyzer {
|
|
|
311
311
|
for (const reference of aggregate.parsed.projectReferences ?? []) {
|
|
312
312
|
const configPath = projectConfigPath(reference.path);
|
|
313
313
|
const packageRoot = dirname(configPath);
|
|
314
|
-
if (!isWithin(realPath(packageRoot), join(this.options.root, 'packages'))
|
|
314
|
+
if (!isWithin(realPath(packageRoot), join(this.options.root, 'packages'))
|
|
315
|
+
&& !(includeVendor && isWithin(realPath(packageRoot), join(this.options.root, 'vendor'))))
|
|
315
316
|
continue;
|
|
316
317
|
const manifestPath = join(packageRoot, 'package.json');
|
|
317
318
|
if (!existsSync(manifestPath))
|
|
@@ -72,6 +72,8 @@ export interface CordisCatalogPolicy {
|
|
|
72
72
|
readonly inheritedEvents: readonly InheritedEntry[];
|
|
73
73
|
/** Manually curated framework context members inherited by every plugin. */
|
|
74
74
|
readonly inheritedServices: readonly InheritedEntry[];
|
|
75
|
+
/** Maximum rendered characters per runtime type declaration. */
|
|
76
|
+
readonly runtimeDeclarationMaxChars?: number;
|
|
75
77
|
}
|
|
76
78
|
/** Complete model-level Cordis projection used by every text renderer. */
|
|
77
79
|
export interface CordisCatalogModel {
|
|
@@ -218,16 +218,18 @@ export class CordisCatalogProjector {
|
|
|
218
218
|
runtimeTypes(services, events) {
|
|
219
219
|
const declarations = new Map();
|
|
220
220
|
const ambiguous = new Set();
|
|
221
|
+
const maxDeclarationChars = this.policy.runtimeDeclarationMaxChars ?? DEFAULT_MAX_DECL_CHARS;
|
|
221
222
|
for (const declaration of this.sourceDeclarations) {
|
|
222
|
-
if (declaration.face !== this.face.face
|
|
223
|
-
|| !/^packages\/[^/]+\/[^/]+\/src\/.+\.tsx?$/.test(declaration.location.file)
|
|
223
|
+
if (declaration.face !== this.face.face
|
|
224
|
+
|| (!/^packages\/[^/]+\/[^/]+\/src\/.+\.tsx?$/.test(declaration.location.file)
|
|
225
|
+
&& !(declaration.kind === 'enum' && /^vendor\/[^/]+\/src\/.+\.ts$/.test(declaration.location.file))))
|
|
224
226
|
continue;
|
|
225
227
|
if (declarations.has(declaration.name)) {
|
|
226
228
|
ambiguous.add(declaration.name);
|
|
227
229
|
continue;
|
|
228
230
|
}
|
|
229
|
-
declarations.set(declaration.name, declaration.text.length >
|
|
230
|
-
? `${declaration.text.slice(0,
|
|
231
|
+
declarations.set(declaration.name, declaration.text.length > maxDeclarationChars
|
|
232
|
+
? `${declaration.text.slice(0, maxDeclarationChars)} /* …truncated — full shape in source */`
|
|
231
233
|
: declaration.text);
|
|
232
234
|
}
|
|
233
235
|
for (const name of ambiguous)
|
|
@@ -487,7 +489,7 @@ function signatureTypeNames(renderer, signature) {
|
|
|
487
489
|
return [...names].sort();
|
|
488
490
|
}
|
|
489
491
|
/** Declarations longer than this render as a truncated stub. */
|
|
490
|
-
const
|
|
492
|
+
const DEFAULT_MAX_DECL_CHARS = 1_500;
|
|
491
493
|
/** Render one value as a single-quoted TypeScript literal. */
|
|
492
494
|
function quote(value) {
|
|
493
495
|
return `'${value.replaceAll('\\', '\\\\').replaceAll("'", "\\'").replaceAll('\n', '\\n')}'`;
|
package/lib/types/emitter.js
CHANGED
|
@@ -121,7 +121,7 @@ export class FaceModelEmitter {
|
|
|
121
121
|
lines.push(` face: ${quote(this.face.face)},`);
|
|
122
122
|
lines.push(' schemas: [');
|
|
123
123
|
for (const schema of schemas.exports) {
|
|
124
|
-
lines.push(` { name: ${quote(schema.exportName)},
|
|
124
|
+
lines.push(` { name: ${quote(schema.exportName)}, create: ${schema.exportName} },`);
|
|
125
125
|
}
|
|
126
126
|
lines.push(' ],');
|
|
127
127
|
lines.push(' invocations: [');
|
|
@@ -151,7 +151,7 @@ export class FaceModelEmitter {
|
|
|
151
151
|
}
|
|
152
152
|
lines.push('');
|
|
153
153
|
for (const schema of schemas.exports) {
|
|
154
|
-
lines.push(`export declare const ${schema.exportName}: z.ZodType<${schema.exportName}$source>`);
|
|
154
|
+
lines.push(`export declare const ${schema.exportName}: () => z.ZodType<${schema.exportName}$source>`);
|
|
155
155
|
}
|
|
156
156
|
if (schemas.exports.length > 0)
|
|
157
157
|
lines.push('');
|
|
@@ -410,7 +410,8 @@ class SchemaEmitter {
|
|
|
410
410
|
emit() {
|
|
411
411
|
const definitions = this.declarations.map(declaration => this.declarationDefinition(declaration));
|
|
412
412
|
for (const boundary of this.boundaries) {
|
|
413
|
-
|
|
413
|
+
const name = this.boundaryName(boundary.key);
|
|
414
|
+
definitions.push(`let ${name}$value\nconst ${name} = () => (${name}$value ??= ${this.typeSchema(boundary.type)})`);
|
|
414
415
|
}
|
|
415
416
|
const exports = this.schemas.map((model) => ({
|
|
416
417
|
model,
|
|
@@ -426,7 +427,7 @@ class SchemaEmitter {
|
|
|
426
427
|
declarationDefinition(declaration) {
|
|
427
428
|
const name = this.schemaName(declaration.id);
|
|
428
429
|
if (declaration.typeParameters.length === 0) {
|
|
429
|
-
return `
|
|
430
|
+
return `let ${name}$value\nconst ${name} = () => (${name}$value ??= ${this.declarationSchema(declaration, new Map())})`;
|
|
430
431
|
}
|
|
431
432
|
const parameters = declaration.typeParameters.map((parameter, index) => [`type${String(index)}$schema`, parameter.id]);
|
|
432
433
|
const substitutions = new Map(parameters.map(([schema, id]) => [id, schema]));
|
|
@@ -500,7 +501,7 @@ class SchemaEmitter {
|
|
|
500
501
|
if (node.arguments.length > 0) {
|
|
501
502
|
this.fail(node.name, `non-generic declaration received ${String(node.arguments.length)} type arguments`);
|
|
502
503
|
}
|
|
503
|
-
return `z.lazy(() => ${name})`;
|
|
504
|
+
return `z.lazy(() => ${name}())`;
|
|
504
505
|
}
|
|
505
506
|
const arguments_ = this.declarationArguments(node, declaration, substitutions);
|
|
506
507
|
return `z.lazy(() => ${name}(${arguments_.join(', ')}))`;
|
|
@@ -694,7 +695,7 @@ function strictCodec(boundary, schema) {
|
|
|
694
695
|
'{',
|
|
695
696
|
' mode: \'strict\',',
|
|
696
697
|
` typeSymbol: ${quote(boundary.typeSymbol)},`,
|
|
697
|
-
`
|
|
698
|
+
` create: ${schema},`,
|
|
698
699
|
'}',
|
|
699
700
|
].join('\n');
|
|
700
701
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-typert-generator",
|
|
3
3
|
"description": "TypeScript project analyzer and model-driven Typert artifact generator",
|
|
4
|
-
"version": "0.1.6-alpha.
|
|
4
|
+
"version": "0.1.6-alpha.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"zod": "^4.4.3",
|
|
43
|
-
"@deepseek-ai/dsh-tool-cordis": "^0.1.6-alpha.
|
|
44
|
-
"@deepseek-ai/dsh-typert-registry": "^0.1.6-alpha.
|
|
43
|
+
"@deepseek-ai/dsh-tool-cordis": "^0.1.6-alpha.2",
|
|
44
|
+
"@deepseek-ai/dsh-typert-registry": "^0.1.6-alpha.2",
|
|
45
45
|
"@deepseek-ai/cordis": "^4.0.2"
|
|
46
46
|
}
|
|
47
47
|
}
|