sigmap 2.0.0-beta.1 → 2.0.0-beta.3
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/CHANGELOG.md +32 -0
- package/gen-context.js +1 -1
- package/package.json +1 -1
- package/src/extractors/python.js +4 -0
- package/src/extractors/typescript.js +18 -1
- package/src/mcp/server.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,38 @@ Format: [Semantic Versioning](https://semver.org/)
|
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
+
## [2.0.0-beta.3] — 2026-04-03
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
- Prerelease version bumped from `2.0.0-beta.2` to `2.0.0-beta.3` across CLI, MCP server info, root package metadata, and VS Code extension metadata.
|
|
13
|
+
- Version drift in [gen-context.js](gen-context.js) was corrected so runtime reporting matches published package metadata.
|
|
14
|
+
|
|
15
|
+
### Validation gate
|
|
16
|
+
- `node scripts/bundle.js`
|
|
17
|
+
- `node test/run.js`
|
|
18
|
+
- `node test/integration/all.js`
|
|
19
|
+
- `node gen-context.js --report`
|
|
20
|
+
|
|
21
|
+
## [2.0.0-beta.2] — 2026-04-03
|
|
22
|
+
|
|
23
|
+
### Fixed
|
|
24
|
+
- Python BaseModel field extraction no longer bleeds into subsequent classes when class bodies are separated by blank lines.
|
|
25
|
+
- Updated [src/extractors/python.js](src/extractors/python.js) `tryExtractBaseModelFields` to stop scanning at the next top-level block.
|
|
26
|
+
- TypeScript interface member type previews now preserve longer union strings.
|
|
27
|
+
- Updated [src/extractors/typescript.js](src/extractors/typescript.js) to extend interface type truncation from 20 to 35 characters.
|
|
28
|
+
- TypeScript function-style hooks (`export function useX`) now include compact return object shapes, matching existing arrow-hook behavior.
|
|
29
|
+
- Updated [src/extractors/typescript.js](src/extractors/typescript.js) export-function extraction path.
|
|
30
|
+
|
|
31
|
+
### Changed
|
|
32
|
+
- Prerelease version bumped from `2.0.0-beta.1` to `2.0.0-beta.2` across CLI, MCP server info, root package metadata, and VS Code extension metadata.
|
|
33
|
+
|
|
34
|
+
### Validation gate
|
|
35
|
+
- `node scripts/bundle.js`
|
|
36
|
+
- `node test/run.js`
|
|
37
|
+
- `node test/integration/all.js`
|
|
38
|
+
- `node gen-context.js --report`
|
|
39
|
+
- `node /Users/manojmallick/context-forge/gen-context.js --report` on arbi-platform
|
|
40
|
+
|
|
9
41
|
## [2.0.0-beta.1] — 2026-04-03
|
|
10
42
|
|
|
11
43
|
### Added
|
package/gen-context.js
CHANGED
|
@@ -3520,7 +3520,7 @@ const path = require('path');
|
|
|
3520
3520
|
const os = require('os');
|
|
3521
3521
|
const { execSync } = require('child_process');
|
|
3522
3522
|
|
|
3523
|
-
const VERSION = '2.0.0-beta.
|
|
3523
|
+
const VERSION = '2.0.0-beta.3';
|
|
3524
3524
|
const MARKER = '\n\n## Auto-generated signatures\n<!-- Updated by gen-context.js -->\n';
|
|
3525
3525
|
|
|
3526
3526
|
function requireSourceOrBundled(key) {
|
package/package.json
CHANGED
package/src/extractors/python.js
CHANGED
|
@@ -106,8 +106,12 @@ function tryExtractDataclassFields(stripped, classIndex) {
|
|
|
106
106
|
function tryExtractBaseModelFields(stripped, bodyStart) {
|
|
107
107
|
const lines = stripped.slice(bodyStart, bodyStart + 800).split('\n');
|
|
108
108
|
const fields = [];
|
|
109
|
+
let foundFirst = false;
|
|
109
110
|
for (const line of lines) {
|
|
111
|
+
if (line.trim() === '') continue;
|
|
112
|
+
if (foundFirst && !/^\s/.test(line)) break;
|
|
110
113
|
if (!line.match(/^\s{4}\w/)) continue;
|
|
114
|
+
foundFirst = true;
|
|
111
115
|
const f = line.match(/^\s{4}(\w+)\s*(?::\s*([^=\n]+?))?(?:\s*=\s*(.*))?$/);
|
|
112
116
|
if (!f || f[1].startsWith('_') || f[1] === 'class' || f[1] === 'def') continue;
|
|
113
117
|
const isOptional = (f[2] || '').includes('Optional') || f[3] !== undefined;
|
|
@@ -54,6 +54,23 @@ function extract(src) {
|
|
|
54
54
|
const retType = retMatch ? retMatch[1].trim().replace(/\s+/g, ' ').slice(0, 30) : '';
|
|
55
55
|
const retStr = retType ? ` → ${retType}` : '';
|
|
56
56
|
sigs.push(`export ${asyncKw}function ${m[1]}(${params})${retStr}`);
|
|
57
|
+
|
|
58
|
+
// Hooks: capture compact return object shape for use* functions.
|
|
59
|
+
if (m[1].startsWith('use')) {
|
|
60
|
+
const bodyStart = m.index + m[0].length;
|
|
61
|
+
const body = stripped.slice(bodyStart, bodyStart + 800);
|
|
62
|
+
const ret = body.match(/return\s*\{([^}]{1,260})\}/);
|
|
63
|
+
if (ret) {
|
|
64
|
+
const keys = ret[1]
|
|
65
|
+
.split(',')
|
|
66
|
+
.map((s) => s.trim().split(':')[0].split('(')[0].trim())
|
|
67
|
+
.filter(Boolean)
|
|
68
|
+
.slice(0, 8);
|
|
69
|
+
if (keys.length) {
|
|
70
|
+
sigs[sigs.length - 1] += ` → { ${keys.join(', ')} }`;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
57
74
|
}
|
|
58
75
|
|
|
59
76
|
// Exported arrow functions / const functions
|
|
@@ -102,7 +119,7 @@ function extractInterfaceMembers(block) {
|
|
|
102
119
|
for (const m of block.matchAll(/^\s+(readonly\s+)?(\w+)(\??):\s*([^;]+);/gm)) {
|
|
103
120
|
const readonly = m[1] ? 'readonly ' : '';
|
|
104
121
|
const optional = m[3] ? '?' : '';
|
|
105
|
-
const typeStr = m[4].trim().replace(/\s+/g, ' ').slice(0,
|
|
122
|
+
const typeStr = m[4].trim().replace(/\s+/g, ' ').slice(0, 35);
|
|
106
123
|
members.push(`${readonly}${m[2]}${optional}: ${typeStr}`);
|
|
107
124
|
}
|
|
108
125
|
for (const m of block.matchAll(/^\s+(\w+)\s*(?:<[^(]*>)?\s*\(([^)]*)\)\s*:/gm)) {
|
package/src/mcp/server.js
CHANGED