@mnemonica/tactica 0.1.0 → 0.1.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 +340 -262
- package/lib/analyzer.d.ts +195 -7
- package/lib/analyzer.js +1584 -19
- package/lib/analyzer.js.map +1 -1
- package/lib/cli.d.ts +6 -0
- package/lib/cli.js +202 -6
- package/lib/cli.js.map +1 -1
- package/lib/generator.d.ts +41 -7
- package/lib/generator.js +243 -49
- package/lib/generator.js.map +1 -1
- package/lib/graph.d.ts +4 -0
- package/lib/graph.js +11 -0
- package/lib/graph.js.map +1 -1
- package/lib/index.d.ts +3 -3
- package/lib/index.js +39 -9
- package/lib/index.js.map +1 -1
- package/lib/topologica-analyzer.d.ts +85 -0
- package/lib/topologica-analyzer.js +509 -0
- package/lib/topologica-analyzer.js.map +1 -0
- package/lib/types.d.ts +110 -0
- package/lib/writer.d.ts +25 -13
- package/lib/writer.js +94 -51
- package/lib/writer.js.map +1 -1
- package/package.json +20 -21
- package/lib/plugin.d.ts +0 -8
- package/lib/plugin.js +0 -128
- package/lib/plugin.js.map +0 -1
package/lib/generator.js
CHANGED
|
@@ -5,8 +5,15 @@ exports.TypesGenerator = void 0;
|
|
|
5
5
|
* TypeScript declaration file generator
|
|
6
6
|
*/
|
|
7
7
|
class TypesGenerator {
|
|
8
|
-
constructor(graph) {
|
|
8
|
+
constructor(graph, esm = false) {
|
|
9
9
|
this.graph = graph;
|
|
10
|
+
this.esm = esm;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Get import path with optional .js extension for ESM NodeNext
|
|
14
|
+
*/
|
|
15
|
+
importPath(relative) {
|
|
16
|
+
return this.esm ? `${relative}.js` : relative;
|
|
10
17
|
}
|
|
11
18
|
/**
|
|
12
19
|
* Generate global augmentation file that augments user classes directly
|
|
@@ -26,23 +33,19 @@ class TypesGenerator {
|
|
|
26
33
|
lines.push('/* eslint-disable @typescript-eslint/no-empty-object-type */');
|
|
27
34
|
lines.push('/* eslint-disable @typescript-eslint/no-empty-interface */');
|
|
28
35
|
lines.push('');
|
|
36
|
+
// Import ProtoFlat from mnemonica
|
|
37
|
+
lines.push("import type { ProtoFlat } from 'mnemonica';");
|
|
38
|
+
lines.push('');
|
|
29
39
|
// Make this a module so we can use declare global
|
|
30
40
|
lines.push('export {};');
|
|
31
41
|
lines.push('');
|
|
32
42
|
// All types go inside declare global so they are globally accessible
|
|
33
43
|
lines.push('declare global {');
|
|
34
44
|
lines.push('');
|
|
35
|
-
// Helper type - in global scope
|
|
36
|
-
lines.push(' // Helper type for nested type constructors');
|
|
37
|
-
lines.push(' type TypeConstructor<T> = {');
|
|
38
|
-
lines.push(' new (...args: unknown[]): T;');
|
|
39
|
-
lines.push(' (...args: unknown[]): T;');
|
|
40
|
-
lines.push(' };');
|
|
41
|
-
lines.push('');
|
|
42
45
|
// Generate instance types for all types - in global scope
|
|
43
46
|
for (const root of this.graph.roots.values()) {
|
|
44
47
|
for (const node of this.graph.dfs(root)) {
|
|
45
|
-
const instanceName =
|
|
48
|
+
const instanceName = this.getInstanceTypeName(node);
|
|
46
49
|
generatedTypes.push(instanceName);
|
|
47
50
|
this.generateInstanceType(node, lines, 1);
|
|
48
51
|
}
|
|
@@ -65,26 +68,46 @@ class TypesGenerator {
|
|
|
65
68
|
}
|
|
66
69
|
/**
|
|
67
70
|
* Generate instance type alias (describes what the instance IS)
|
|
68
|
-
* Uses
|
|
71
|
+
* Uses ProtoFlat for proper inheritance (excludes overridden parent props)
|
|
69
72
|
*/
|
|
70
73
|
generateInstanceType(node, lines, indent) {
|
|
71
74
|
const indentStr = '\t'.repeat(indent);
|
|
72
|
-
const instanceName =
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
const instanceName = this.getInstanceTypeName(node);
|
|
76
|
+
if (node.parent) {
|
|
77
|
+
// Nested type: Use ProtoFlat to properly exclude overridden properties
|
|
78
|
+
lines.push(`${indentStr}type ${instanceName} = ProtoFlat<${this.getInstanceTypeName(node.parent)}, {`);
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
// Root type: just the properties object
|
|
82
|
+
lines.push(`${indentStr}type ${instanceName} = {`);
|
|
83
|
+
}
|
|
77
84
|
// Add instance properties
|
|
78
85
|
for (const [propName, propInfo] of node.properties.entries()) {
|
|
79
86
|
const optional = propInfo.optional ? '?' : '';
|
|
80
|
-
|
|
87
|
+
const readonly = propInfo.readonly ? 'readonly ' : '';
|
|
88
|
+
lines.push(`${indentStr}\t${readonly}${propName}${optional}: ${propInfo.type};`);
|
|
81
89
|
}
|
|
82
|
-
// Add nested constructor properties (
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
90
|
+
// Add nested constructor properties (only for root types)
|
|
91
|
+
// Nested type constructors are accessible via parent, not directly on instances
|
|
92
|
+
if (!node.parent) {
|
|
93
|
+
for (const child of node.children.values()) {
|
|
94
|
+
const childInstanceType = this.getInstanceTypeName(child);
|
|
95
|
+
const constructorSig = this.generateConstructorSignature(child);
|
|
96
|
+
lines.push(`${indentStr}\t${child.name}: ${constructorSig} => ${childInstanceType};`);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
// For nested types, add Subtype: undefined to indicate no further subtypes
|
|
100
|
+
// This is needed for strict chain behavior
|
|
101
|
+
if (node.parent) {
|
|
102
|
+
lines.push(`${indentStr}\t${node.name}: undefined;`);
|
|
103
|
+
}
|
|
104
|
+
// Close the type properly - ProtoFlat uses }>; for nested, }; for root
|
|
105
|
+
if (node.parent) {
|
|
106
|
+
lines.push(`${indentStr}}>;`);
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
lines.push(`${indentStr}};`);
|
|
86
110
|
}
|
|
87
|
-
lines.push(`${indentStr}}`);
|
|
88
111
|
// Add empty line after each type
|
|
89
112
|
lines.push('');
|
|
90
113
|
}
|
|
@@ -107,12 +130,16 @@ class TypesGenerator {
|
|
|
107
130
|
// Add all instance properties (for type merging)
|
|
108
131
|
for (const [propName, propInfo] of node.properties.entries()) {
|
|
109
132
|
const optional = propInfo.optional ? '?' : '';
|
|
110
|
-
|
|
133
|
+
const readonly = propInfo.readonly ? 'readonly ' : '';
|
|
134
|
+
lines.push(`${indentStr}\t${readonly}${propName}${optional}: ${propInfo.type};`);
|
|
111
135
|
}
|
|
112
|
-
// Add subtype constructors (non-optional so they're accessible)
|
|
113
|
-
|
|
114
|
-
const
|
|
115
|
-
|
|
136
|
+
// Add subtype constructors (non-optional so they're accessible) - only for root types
|
|
137
|
+
if (!node.parent) {
|
|
138
|
+
for (const child of node.children.values()) {
|
|
139
|
+
const childInstanceType = this.getInstanceTypeName(child);
|
|
140
|
+
const constructorSig = this.generateConstructorSignature(child);
|
|
141
|
+
lines.push(`${indentStr}\t${child.name}: ${constructorSig} => ${childInstanceType};`);
|
|
142
|
+
}
|
|
116
143
|
}
|
|
117
144
|
lines.push(`${indentStr}}`);
|
|
118
145
|
lines.push('');
|
|
@@ -131,17 +158,13 @@ class TypesGenerator {
|
|
|
131
158
|
lines.push('/* eslint-disable @typescript-eslint/no-empty-object-type */');
|
|
132
159
|
lines.push('/* eslint-disable @typescript-eslint/no-empty-interface */');
|
|
133
160
|
lines.push('');
|
|
134
|
-
//
|
|
135
|
-
lines.push(
|
|
136
|
-
lines.push('type TypeConstructor<T> = {');
|
|
137
|
-
lines.push('\tnew (...args: unknown[]): T;');
|
|
138
|
-
lines.push('\t(...args: unknown[]): T;');
|
|
139
|
-
lines.push('};');
|
|
161
|
+
// Import ProtoFlat from mnemonica
|
|
162
|
+
lines.push("import type { ProtoFlat } from 'mnemonica';");
|
|
140
163
|
lines.push('');
|
|
141
164
|
// Generate complete instance interfaces
|
|
142
165
|
for (const root of this.graph.roots.values()) {
|
|
143
166
|
for (const node of this.graph.dfs(root)) {
|
|
144
|
-
const interfaceName =
|
|
167
|
+
const interfaceName = this.getInstanceTypeName(node);
|
|
145
168
|
generatedTypes.push(interfaceName);
|
|
146
169
|
this.generateCompleteInstanceInterface(node, lines);
|
|
147
170
|
}
|
|
@@ -152,36 +175,207 @@ class TypesGenerator {
|
|
|
152
175
|
};
|
|
153
176
|
}
|
|
154
177
|
/**
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
178
|
+
* Generate a complete instance type alias with all properties
|
|
179
|
+
* This is for the types.ts file that users import from
|
|
180
|
+
*/
|
|
158
181
|
generateCompleteInstanceInterface(node, lines) {
|
|
159
|
-
const typeName =
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
182
|
+
const typeName = this.getInstanceTypeName(node);
|
|
183
|
+
if (node.parent) {
|
|
184
|
+
// Nested type: Use ProtoFlat to properly exclude overridden properties
|
|
185
|
+
lines.push(`export type ${typeName} = ProtoFlat<${this.getInstanceTypeName(node.parent)}, {`);
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
// Root type: just the properties object
|
|
189
|
+
lines.push(`export type ${typeName} = {`);
|
|
190
|
+
}
|
|
164
191
|
// Add instance properties extracted from the constructor
|
|
165
192
|
for (const [propName, propInfo] of node.properties.entries()) {
|
|
166
193
|
const optional = propInfo.optional ? '?' : '';
|
|
167
|
-
|
|
194
|
+
const readonly = propInfo.readonly ? 'readonly ' : '';
|
|
195
|
+
lines.push(`\t${readonly}${propName}${optional}: ${this.resolveTypeInString(propInfo.type, node)};`);
|
|
168
196
|
}
|
|
169
|
-
// Add nested constructor properties
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
197
|
+
// Add nested constructor properties for non-leaf nodes
|
|
198
|
+
// Leaf nodes (no children) don't get constructor properties
|
|
199
|
+
// This follows mnemonica's strictChain behavior
|
|
200
|
+
if (node.children.size > 0) {
|
|
201
|
+
for (const child of node.children.values()) {
|
|
202
|
+
const childInstanceType = this.getInstanceTypeName(child);
|
|
203
|
+
const constructorSig = this.generateConstructorSignature(child);
|
|
204
|
+
lines.push(`\t${child.name}: ${constructorSig} => ${childInstanceType};`);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
// For nested types, add this node's constructor and all siblings from same parent as undefined
|
|
208
|
+
// This is needed for strict chain behavior - parent undefineds are inherited via ProtoFlat
|
|
209
|
+
if (node.parent) {
|
|
210
|
+
// Add this node's own constructor as undefined
|
|
211
|
+
lines.push(`\t${node.name}: undefined;`);
|
|
212
|
+
// Add all siblings (other children of the same parent) as undefined
|
|
213
|
+
for (const sibling of node.parent.children.values()) {
|
|
214
|
+
if (sibling.name !== node.name) {
|
|
215
|
+
lines.push(`\t${sibling.name}: undefined;`);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
// Close the type properly - ProtoFlat uses }>; for nested, }; for root
|
|
220
|
+
if (node.parent) {
|
|
221
|
+
lines.push('}>;');
|
|
222
|
+
}
|
|
223
|
+
else {
|
|
224
|
+
lines.push('};');
|
|
173
225
|
}
|
|
174
|
-
lines.push('}');
|
|
175
226
|
lines.push('');
|
|
176
227
|
}
|
|
177
228
|
/**
|
|
178
|
-
|
|
179
|
-
|
|
229
|
+
* Generate a simple type declaration for a single type
|
|
230
|
+
*/
|
|
180
231
|
generateSingleType(node) {
|
|
181
232
|
const lines = [];
|
|
182
233
|
this.generateCompleteInstanceInterface(node, lines);
|
|
183
234
|
return lines.join('\n');
|
|
184
235
|
}
|
|
236
|
+
/**
|
|
237
|
+
* Generate TypeRegistry interface for type-safe lookupTyped() function
|
|
238
|
+
* Import this interface and pass it to lookupTyped<TypeRegistry>() from mnemonica
|
|
239
|
+
*/
|
|
240
|
+
generateTypeRegistry() {
|
|
241
|
+
const lines = [];
|
|
242
|
+
const generatedTypes = [];
|
|
243
|
+
// Header
|
|
244
|
+
lines.push('// Generated TypeRegistry for type-safe mnemonica.lookupTyped<TypeRegistry>()');
|
|
245
|
+
lines.push('// Import this interface and use with lookupTyped from mnemonica');
|
|
246
|
+
lines.push('//');
|
|
247
|
+
lines.push('// Usage:');
|
|
248
|
+
lines.push("// import { lookupTyped } from 'mnemonica';");
|
|
249
|
+
lines.push("// import { TypeRegistry } from './.tactica/registry';");
|
|
250
|
+
lines.push("// const Sentience = lookupTyped<TypeRegistry>('Sentience');");
|
|
251
|
+
lines.push('// // TypeScript knows: Sentience is a constructor for SentienceInstance');
|
|
252
|
+
lines.push("// const instance = new Sentience({ purpose: 'AI' });");
|
|
253
|
+
lines.push('// // instance has full intellisense for Consciousness, Memory, etc.');
|
|
254
|
+
lines.push('');
|
|
255
|
+
// Import instance types from types.ts
|
|
256
|
+
lines.push('import type {');
|
|
257
|
+
for (const root of this.graph.roots.values()) {
|
|
258
|
+
for (const node of this.graph.dfs(root)) {
|
|
259
|
+
const instanceTypeName = this.getInstanceTypeName(node);
|
|
260
|
+
lines.push(`\t${instanceTypeName},`);
|
|
261
|
+
generatedTypes.push(instanceTypeName);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
lines.push(`} from '${this.importPath('./types')}';`);
|
|
265
|
+
lines.push('');
|
|
266
|
+
// Generate module augmentation for mnemonica TypeRegistry
|
|
267
|
+
lines.push('/**');
|
|
268
|
+
lines.push(' * Type registry augmenting mnemonica\'s TypeRegistry interface');
|
|
269
|
+
lines.push(' * This enables type-safe lookupTyped() without explicit type arguments');
|
|
270
|
+
lines.push(' *');
|
|
271
|
+
lines.push(' * Usage: const SomeType = lookupTyped(\'SomeType\'); // Fully typed!');
|
|
272
|
+
lines.push(' */');
|
|
273
|
+
lines.push('declare module \'mnemonica\' {');
|
|
274
|
+
lines.push(' interface TypeRegistry {');
|
|
275
|
+
// Generate entries for all type paths
|
|
276
|
+
for (const root of this.graph.roots.values()) {
|
|
277
|
+
for (const node of this.graph.dfs(root)) {
|
|
278
|
+
const fullPath = this.getFullPath(node);
|
|
279
|
+
const instanceType = this.getInstanceTypeName(node);
|
|
280
|
+
// Generate typed constructor signature for nested types with properties
|
|
281
|
+
const constructorSig = this.generateConstructorSignature(node);
|
|
282
|
+
lines.push(`\t\t'${fullPath}': ${constructorSig} => ${instanceType};`);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
lines.push('\t}');
|
|
286
|
+
lines.push('}');
|
|
287
|
+
lines.push('');
|
|
288
|
+
// Re-export for backward compatibility and explicit usage
|
|
289
|
+
lines.push('import type { TypeRegistry } from \'mnemonica\';');
|
|
290
|
+
lines.push('export type { TypeRegistry };');
|
|
291
|
+
return {
|
|
292
|
+
content: lines.join('\n'),
|
|
293
|
+
types: generatedTypes,
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Generate constructor signature for a type node
|
|
298
|
+
* Uses constructorParams for TypeRegistry signature (not instance properties)
|
|
299
|
+
*/
|
|
300
|
+
generateConstructorSignature(node) {
|
|
301
|
+
// Use constructorParams if available, otherwise fall back to empty signature
|
|
302
|
+
const params = node.constructorParams;
|
|
303
|
+
if (!params || params.length === 0) {
|
|
304
|
+
return 'new ()';
|
|
305
|
+
}
|
|
306
|
+
// Build typed constructor signature from constructor parameters
|
|
307
|
+
const props = [];
|
|
308
|
+
for (const param of params) {
|
|
309
|
+
const optional = param.optional ? '?' : '';
|
|
310
|
+
props.push(`${param.name}${optional}: ${param.type}`);
|
|
311
|
+
}
|
|
312
|
+
// Return constructor signature with data parameter
|
|
313
|
+
return `new (${props.join(', ')})`;
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Get the full dotted path for a type node
|
|
317
|
+
*/
|
|
318
|
+
getFullPath(node) {
|
|
319
|
+
if (!node.parent) {
|
|
320
|
+
return node.name;
|
|
321
|
+
}
|
|
322
|
+
return `${this.getFullPath(node.parent)}.${node.name}`;
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* Get the instance type name for a node
|
|
326
|
+
* Uses full path with underscores: Usages.UsageEntry -> Usages_UsageEntry
|
|
327
|
+
*/
|
|
328
|
+
getInstanceTypeName(node) {
|
|
329
|
+
const fullPath = this.getFullPath(node);
|
|
330
|
+
return fullPath.replace(/\./g, '_');
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Resolve a simple type name to its full path name
|
|
334
|
+
* e.g., "DefinitionEntry" -> "Definitions_DefinitionEntry"
|
|
335
|
+
*/
|
|
336
|
+
resolveTypeName(simpleName, currentNode) {
|
|
337
|
+
// First check if it's the current node or its children
|
|
338
|
+
if (currentNode.name === simpleName) {
|
|
339
|
+
return this.getInstanceTypeName(currentNode);
|
|
340
|
+
}
|
|
341
|
+
for (const child of currentNode.children.values()) {
|
|
342
|
+
if (child.name === simpleName) {
|
|
343
|
+
return this.getInstanceTypeName(child);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
// Search all types in the graph
|
|
347
|
+
for (const type of this.graph.getAllTypes()) {
|
|
348
|
+
if (type.name === simpleName) {
|
|
349
|
+
return this.getInstanceTypeName(type);
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
return simpleName;
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* Resolve simple type names to full path names within a type string
|
|
356
|
+
* Handles complex types like Array<UsageEntry>, Map<string, TypeEntry>, etc.
|
|
357
|
+
*/
|
|
358
|
+
resolveTypeInString(typeStr, currentNode) {
|
|
359
|
+
// Get all type names from the graph
|
|
360
|
+
const allTypes = this.graph.getAllTypes();
|
|
361
|
+
const typeNames = new Set();
|
|
362
|
+
for (const type of allTypes) {
|
|
363
|
+
typeNames.add(type.name);
|
|
364
|
+
}
|
|
365
|
+
// Sort by length (longest first) to avoid partial replacements
|
|
366
|
+
const sortedNames = Array.from(typeNames).sort((a, b) => b.length - a.length);
|
|
367
|
+
// Replace each simple type name with its full path version
|
|
368
|
+
let result = typeStr;
|
|
369
|
+
for (const name of sortedNames) {
|
|
370
|
+
// Use word boundary matching to avoid replacing partial names
|
|
371
|
+
const regex = new RegExp(`\\b${name}\\b`, 'g');
|
|
372
|
+
const fullTypeName = this.resolveTypeName(name, currentNode);
|
|
373
|
+
if (fullTypeName !== name) {
|
|
374
|
+
result = result.replace(regex, fullTypeName);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
return result;
|
|
378
|
+
}
|
|
185
379
|
}
|
|
186
380
|
exports.TypesGenerator = TypesGenerator;
|
|
187
381
|
//# sourceMappingURL=generator.js.map
|
package/lib/generator.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../src/generator.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;AAKb;;GAEG;AACH,MAAa,cAAc;IAC1B,YAAoB,KAAoB;QAApB,UAAK,GAAL,KAAK,CAAe;IAAG,CAAC;IAE5C;;;;;;;UAOG;IACH,0BAA0B;QACzB,MAAM,KAAK,GAAa,EAAE,CAAC;QAC3B,MAAM,cAAc,GAAa,EAAE,CAAC;QAEpC,2DAA2D;QAC3D,KAAK,CAAC,IAAI,CAAC,kDAAkD,CAAC,CAAC;QAC/D,KAAK,CAAC,IAAI,CAAC,yEAAyE,CAAC,CAAC;QACtF,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACf,KAAK,CAAC,IAAI,CAAC,8DAA8D,CAAC,CAAC;QAC3E,KAAK,CAAC,IAAI,CAAC,4DAA4D,CAAC,CAAC;QACzE,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAEf,kDAAkD;QAClD,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACzB,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAEf,qEAAqE;QACrE,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;QAC/B,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAEf,gCAAgC;QAChC,KAAK,CAAC,IAAI,CAAC,8CAA8C,CAAC,CAAC;QAC3D,KAAK,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;QAC3C,KAAK,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;QAC7C,KAAK,CAAC,IAAI,CAAC,4BAA4B,CAAC,CA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K,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC;QAE9E,2DAA2D;QAC3D,IAAI,MAAM,GAAG,OAAO,CAAC;QACrB,KAAK,MAAM,IAAI,IAAI,WAAW,EAAE,CAAC;YAChC,8DAA8D;YAC9D,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,MAAM,IAAI,KAAK,EAAE,GAAG,CAAC,CAAC;YAC/C,MAAM,YAAY,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;YAC7D,IAAI,YAAY,KAAK,IAAI,EAAE,CAAC;gBAC3B,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;YAC9C,CAAC;QACF,CAAC;QACD,OAAO,MAAM,CAAC;IACf,CAAC;CACD;AAzaD,wCAyaC"}
|
package/lib/graph.d.ts
CHANGED
|
@@ -8,6 +8,10 @@ export declare class TypeGraphImpl implements TypeGraph {
|
|
|
8
8
|
addRoot(node: TypeNode): void;
|
|
9
9
|
addChild(parent: TypeNode, child: TypeNode): void;
|
|
10
10
|
findType(fullPath: string): TypeNode | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Find a type by name (search through all types, return first match)
|
|
13
|
+
*/
|
|
14
|
+
findTypeByName(name: string): TypeNode | undefined;
|
|
11
15
|
getAllTypes(): TypeNode[];
|
|
12
16
|
clear(): void;
|
|
13
17
|
/**
|
package/lib/graph.js
CHANGED
|
@@ -21,6 +21,17 @@ class TypeGraphImpl {
|
|
|
21
21
|
findType(fullPath) {
|
|
22
22
|
return this.allTypes.get(fullPath);
|
|
23
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Find a type by name (search through all types, return first match)
|
|
26
|
+
*/
|
|
27
|
+
findTypeByName(name) {
|
|
28
|
+
for (const type of this.allTypes.values()) {
|
|
29
|
+
if (type.name === name) {
|
|
30
|
+
return type;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
24
35
|
getAllTypes() {
|
|
25
36
|
return Array.from(this.allTypes.values());
|
|
26
37
|
}
|
package/lib/graph.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph.js","sourceRoot":"","sources":["../src/graph.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;AAIb;;GAEG;AACH,MAAa,aAAa;IAA1B;QACC,UAAK,GAA0B,IAAI,GAAG,EAAE,CAAC;QACzC,aAAQ,GAA0B,IAAI,GAAG,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"graph.js","sourceRoot":"","sources":["../src/graph.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;AAIb;;GAEG;AACH,MAAa,aAAa;IAA1B;QACC,UAAK,GAA0B,IAAI,GAAG,EAAE,CAAC;QACzC,aAAQ,GAA0B,IAAI,GAAG,EAAE,CAAC;IAkG7C,CAAC;IAhGA,OAAO,CAAC,IAAc;QACrB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAChC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IACxC,CAAC;IAED,QAAQ,CAAC,MAAgB,EAAE,KAAe;QACzC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACvC,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IAC1C,CAAC;IAED,QAAQ,CAAC,QAAgB;QACxB,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;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AC,EAAE,CAAC;gBAChC,SAAS;YACV,CAAC;YACD,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC3B,MAAM,IAAI,CAAC;YAEX,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC;gBAC5C,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACnB,CAAC;QACF,CAAC;IACF,CAAC;IAED;;OAEG;IACH,CAAC,GAAG,CAAC,IAAe,EAAE,UAAU,IAAI,GAAG,EAAU;QAChD,MAAM,SAAS,GAAG,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC;QAC3D,IAAI,CAAC,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC;YACnD,OAAO;QACR,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;QAChC,MAAM,SAAS,CAAC;QAEhB,KAAK,MAAM,KAAK,IAAI,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC;YACjD,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QACjC,CAAC;IACF,CAAC;CACD;AApGD,sCAoGC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
* define() and decorate() calls.
|
|
7
7
|
*/
|
|
8
8
|
export { MnemonicaAnalyzer } from './analyzer';
|
|
9
|
+
export { TopologicaAnalyzer } from './topologica-analyzer';
|
|
9
10
|
export { TypeGraphImpl } from './graph';
|
|
10
11
|
export { TypesGenerator } from './generator';
|
|
11
12
|
export { TypesWriter } from './writer';
|
|
12
|
-
export type { TacticaConfig, TypeNode, TypeGraph, PropertyInfo, AnalyzeResult, AnalyzeError, GeneratedTypes, } from './types';
|
|
13
|
+
export type { TacticaConfig, TypeNode, TypeGraph, PropertyInfo, AnalyzeResult, AnalyzeError, GeneratedTypes, DefinitionInfo, UsageInfo, DefinitionsJson, UsagesJson, } from './types';
|
|
13
14
|
export { main, run, watch, parseArgs } from './cli';
|
|
14
|
-
export
|
|
15
|
-
export declare const VERSION = "0.1.0";
|
|
15
|
+
export declare const VERSION: string;
|
package/lib/index.js
CHANGED
|
@@ -1,9 +1,40 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
5
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.VERSION = exports.
|
|
36
|
+
exports.VERSION = exports.parseArgs = exports.watch = exports.run = exports.main = exports.TypesWriter = exports.TypesGenerator = exports.TypeGraphImpl = exports.TopologicaAnalyzer = exports.MnemonicaAnalyzer = void 0;
|
|
37
|
+
const pkg = __importStar(require("../package.json"));
|
|
7
38
|
/**
|
|
8
39
|
* Tactica - TypeScript Language Service Plugin for Mnemonica
|
|
9
40
|
*
|
|
@@ -13,6 +44,8 @@ exports.VERSION = exports.default = exports.parseArgs = exports.watch = exports.
|
|
|
13
44
|
*/
|
|
14
45
|
var analyzer_1 = require("./analyzer");
|
|
15
46
|
Object.defineProperty(exports, "MnemonicaAnalyzer", { enumerable: true, get: function () { return analyzer_1.MnemonicaAnalyzer; } });
|
|
47
|
+
var topologica_analyzer_1 = require("./topologica-analyzer");
|
|
48
|
+
Object.defineProperty(exports, "TopologicaAnalyzer", { enumerable: true, get: function () { return topologica_analyzer_1.TopologicaAnalyzer; } });
|
|
16
49
|
var graph_1 = require("./graph");
|
|
17
50
|
Object.defineProperty(exports, "TypeGraphImpl", { enumerable: true, get: function () { return graph_1.TypeGraphImpl; } });
|
|
18
51
|
var generator_1 = require("./generator");
|
|
@@ -25,9 +58,6 @@ Object.defineProperty(exports, "main", { enumerable: true, get: function () { re
|
|
|
25
58
|
Object.defineProperty(exports, "run", { enumerable: true, get: function () { return cli_1.run; } });
|
|
26
59
|
Object.defineProperty(exports, "watch", { enumerable: true, get: function () { return cli_1.watch; } });
|
|
27
60
|
Object.defineProperty(exports, "parseArgs", { enumerable: true, get: function () { return cli_1.parseArgs; } });
|
|
28
|
-
//
|
|
29
|
-
|
|
30
|
-
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(plugin_1).default; } });
|
|
31
|
-
// Version
|
|
32
|
-
exports.VERSION = '0.1.0';
|
|
61
|
+
// Version from package.json
|
|
62
|
+
exports.VERSION = pkg.version;
|
|
33
63
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEb,qDAAuC;AAEvC;;;;;;GAMG;AAEH,uCAA+C;AAAtC,6GAAA,iBAAiB,OAAA;AAC1B,6DAA2D;AAAlD,yHAAA,kBAAkB,OAAA;AAC3B,iCAAwC;AAA/B,sGAAA,aAAa,OAAA;AACtB,yCAA6C;AAApC,2GAAA,cAAc,OAAA;AACvB,mCAAuC;AAA9B,qGAAA,WAAW,OAAA;AAiBpB,kBAAkB;AAClB,6BAAoD;AAA3C,2FAAA,IAAI,OAAA;AAAE,0FAAA,GAAG,OAAA;AAAE,4FAAA,KAAK,OAAA;AAAE,gGAAA,SAAS,OAAA;AAEpC,4BAA4B;AACf,QAAA,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { TypeNode } from './types';
|
|
2
|
+
import { TypeGraphImpl } from './graph';
|
|
3
|
+
/**
|
|
4
|
+
* Analyzer for Topologica directory-based type definitions
|
|
5
|
+
* Scans directory structures to create type hierarchies like:
|
|
6
|
+
* ai-types/Sentience/Consciousness/Empathy/Gratitude/
|
|
7
|
+
*
|
|
8
|
+
* Now with AST-based property extraction from TypeScript/JavaScript files
|
|
9
|
+
*/
|
|
10
|
+
export declare class TopologicaAnalyzer {
|
|
11
|
+
private errors;
|
|
12
|
+
private graph;
|
|
13
|
+
/**
|
|
14
|
+
* Analyze a directory structure for topologica type definitions
|
|
15
|
+
*/
|
|
16
|
+
analyzeDirectory(directoryPath: string): {
|
|
17
|
+
types: Map<string, TypeNode>;
|
|
18
|
+
errors: string[];
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Recursively scan directory structure to build type hierarchy
|
|
22
|
+
*/
|
|
23
|
+
private scanDirectory;
|
|
24
|
+
/**
|
|
25
|
+
* Extract properties from a directory's index file
|
|
26
|
+
* Supports both .ts and .js files
|
|
27
|
+
*/
|
|
28
|
+
private extractPropertiesFromDir;
|
|
29
|
+
/**
|
|
30
|
+
* Collect type aliases from source file
|
|
31
|
+
* e.g., export type SentienceData = { awareness?: string; }
|
|
32
|
+
*/
|
|
33
|
+
private collectTypeAliases;
|
|
34
|
+
/**
|
|
35
|
+
* Extract property assignments from a source file
|
|
36
|
+
* Returns constructor parameters and handler location if found
|
|
37
|
+
*/
|
|
38
|
+
private extractPropertiesFromSourceFile;
|
|
39
|
+
/**
|
|
40
|
+
* Extract `this.property = value` assignments from a function body
|
|
41
|
+
*/
|
|
42
|
+
private extractThisProperties;
|
|
43
|
+
/**
|
|
44
|
+
* Check if a call expression is Object.assign(this, ...)
|
|
45
|
+
*/
|
|
46
|
+
private isObjectAssignCall;
|
|
47
|
+
/**
|
|
48
|
+
* Extract properties from Object.assign(this, data) pattern
|
|
49
|
+
*/
|
|
50
|
+
private extractFromObjectAssign;
|
|
51
|
+
/**
|
|
52
|
+
* Extract constructor parameters from a function
|
|
53
|
+
* Similar to main analyzer - skips `this` parameter and expands data types
|
|
54
|
+
*/
|
|
55
|
+
private extractConstructorParams;
|
|
56
|
+
/**
|
|
57
|
+
* Expand a type node to its object literal representation
|
|
58
|
+
* Similar to main analyzer's resolveTypeAndExtract
|
|
59
|
+
*/
|
|
60
|
+
private expandTypeToObject;
|
|
61
|
+
/**
|
|
62
|
+
* Convert a TypeScript type node to a simple string representation
|
|
63
|
+
*/
|
|
64
|
+
private typeNodeToSimpleString;
|
|
65
|
+
/**
|
|
66
|
+
* Infer TypeScript type from an expression
|
|
67
|
+
*/
|
|
68
|
+
private inferType;
|
|
69
|
+
/**
|
|
70
|
+
* Infer type from new expressions like new Date(), new Array(), etc.
|
|
71
|
+
*/
|
|
72
|
+
private inferNewExpressionType;
|
|
73
|
+
/**
|
|
74
|
+
* Infer type from call expressions like Date.now(), parseInt(), etc.
|
|
75
|
+
*/
|
|
76
|
+
private inferCallExpressionType;
|
|
77
|
+
/**
|
|
78
|
+
* Get the type graph
|
|
79
|
+
*/
|
|
80
|
+
getGraph(): TypeGraphImpl;
|
|
81
|
+
/**
|
|
82
|
+
* Get collected errors
|
|
83
|
+
*/
|
|
84
|
+
getErrors(): string[];
|
|
85
|
+
}
|