norn-cli 2.4.0 → 2.6.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.
Files changed (96) hide show
  1. package/AGENTS.md +2 -2
  2. package/CHANGELOG.md +26 -1
  3. package/dist/cli.js +330 -85
  4. package/package.json +24 -5
  5. package/schemas/norn.config.schema.json +43 -1
  6. package/scripts/__pycache__/reddit_signal_miner.cpython-312.pyc +0 -0
  7. package/scripts/reddit_signal_miner.py +482 -0
  8. package/.claude/settings.local.json +0 -18
  9. package/.claude/skills/norn-social-campaign/SKILL.md +0 -70
  10. package/out/apiResponseIntellisenseCache.js +0 -394
  11. package/out/assertionRunner.js +0 -567
  12. package/out/cacheDir.js +0 -136
  13. package/out/chatParticipant.js +0 -763
  14. package/out/cli/colors.js +0 -127
  15. package/out/cli/formatters/assertion.js +0 -102
  16. package/out/cli/formatters/index.js +0 -23
  17. package/out/cli/formatters/response.js +0 -106
  18. package/out/cli/formatters/summary.js +0 -246
  19. package/out/cli/redaction.js +0 -237
  20. package/out/cli/reporters/html.js +0 -689
  21. package/out/cli/reporters/index.js +0 -22
  22. package/out/cli/reporters/junit.js +0 -226
  23. package/out/codeLensProvider.js +0 -351
  24. package/out/compareContentProvider.js +0 -85
  25. package/out/completionProvider.js +0 -3739
  26. package/out/contractAssertionSummary.js +0 -225
  27. package/out/contractDecorationProvider.js +0 -243
  28. package/out/coverageCalculator.js +0 -879
  29. package/out/coveragePanel.js +0 -597
  30. package/out/debug/breakpointResolver.js +0 -84
  31. package/out/debug/breakpoints.js +0 -52
  32. package/out/debug/nornDebugAdapter.js +0 -166
  33. package/out/debug/nornDebugSession.js +0 -613
  34. package/out/debug/sequenceLocationIndex.js +0 -77
  35. package/out/debug/types.js +0 -3
  36. package/out/deepClone.js +0 -21
  37. package/out/diagnosticProvider.js +0 -2554
  38. package/out/environmentParser.js +0 -736
  39. package/out/environmentProvider.js +0 -544
  40. package/out/environmentTemplates.js +0 -146
  41. package/out/errors/formatError.js +0 -113
  42. package/out/errors/nornError.js +0 -29
  43. package/out/formUrlEncoded.js +0 -89
  44. package/out/httpClient.js +0 -348
  45. package/out/httpRuntimeOptions.js +0 -16
  46. package/out/importErrors.js +0 -31
  47. package/out/inlayHintResolver.js +0 -70
  48. package/out/jsonFileReader.js +0 -323
  49. package/out/mcpClient.js +0 -193
  50. package/out/mcpConfig.js +0 -184
  51. package/out/mcpToolIntellisenseCache.js +0 -96
  52. package/out/mcpToolSchema.js +0 -50
  53. package/out/nornConfig.js +0 -132
  54. package/out/nornHoverProvider.js +0 -124
  55. package/out/nornInlayHintsProvider.js +0 -191
  56. package/out/nornPrompt.js +0 -755
  57. package/out/nornSqlParser.js +0 -286
  58. package/out/nornapiHoverProvider.js +0 -135
  59. package/out/nornapiInlayHintsProvider.js +0 -94
  60. package/out/nornapiParser.js +0 -324
  61. package/out/nornenvCodeActionProvider.js +0 -101
  62. package/out/nornenvDecorationProvider.js +0 -239
  63. package/out/nornenvFoldingProvider.js +0 -63
  64. package/out/nornenvHoverProvider.js +0 -114
  65. package/out/nornenvInlayHintsProvider.js +0 -99
  66. package/out/nornenvLanguageModel.js +0 -187
  67. package/out/nornenvRegionRefactor.js +0 -267
  68. package/out/nornsqlHoverProvider.js +0 -95
  69. package/out/nornsqlInlayHintsProvider.js +0 -114
  70. package/out/parser.js +0 -839
  71. package/out/pathAccess.js +0 -28
  72. package/out/postmanImportPanel.js +0 -732
  73. package/out/postmanImportPlanner.js +0 -1155
  74. package/out/postmanImportSidebarView.js +0 -532
  75. package/out/quotedString.js +0 -35
  76. package/out/requestPreparation.js +0 -179
  77. package/out/requestValidation.js +0 -146
  78. package/out/responsePanel.js +0 -7754
  79. package/out/schemaGenerator.js +0 -562
  80. package/out/scriptRunner.js +0 -419
  81. package/out/secrets/cliSecrets.js +0 -415
  82. package/out/secrets/crypto.js +0 -105
  83. package/out/secrets/envFileSecrets.js +0 -177
  84. package/out/secrets/keyStore.js +0 -259
  85. package/out/sequenceDeclaration.js +0 -15
  86. package/out/sequenceRunner.js +0 -3590
  87. package/out/sqlAdapterRunner.js +0 -122
  88. package/out/sqlBuiltInAdapters.js +0 -604
  89. package/out/sqlConfig.js +0 -184
  90. package/out/starterCatalog.js +0 -554
  91. package/out/stringUtils.js +0 -25
  92. package/out/swaggerBodyIntellisenseCache.js +0 -114
  93. package/out/swaggerParser.js +0 -464
  94. package/out/testProvider.js +0 -767
  95. package/out/theoryCaseLoader.js +0 -113
  96. package/out/validationCache.js +0 -211
@@ -1,259 +0,0 @@
1
- "use strict";
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
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.resolveSecretKey = resolveSecretKey;
37
- exports.setSessionSecretKey = setSessionSecretKey;
38
- exports.clearSessionSecretKeys = clearSessionSecretKeys;
39
- exports.listSessionSecretKeyIds = listSessionSecretKeyIds;
40
- exports.saveSecretKeyToCache = saveSecretKeyToCache;
41
- exports.removeSecretKeyFromCache = removeSecretKeyFromCache;
42
- exports.listCachedSecretKeyIds = listCachedSecretKeyIds;
43
- const fs = __importStar(require("fs"));
44
- const path = __importStar(require("path"));
45
- const cacheDir_1 = require("../cacheDir");
46
- const CACHE_FILE = 'secret-keys.json';
47
- const CACHE_VERSION = 1;
48
- const CACHE_SCAN_IGNORED_DIRS = new Set(['node_modules', '.git', 'dist', 'out']);
49
- const sessionKeys = new Map();
50
- const projectSecretKeyCacheDirs = new Map();
51
- function getCacheFilePath(cacheDir) {
52
- return path.join(cacheDir, CACHE_FILE);
53
- }
54
- function cacheFileExists(cacheDir) {
55
- const cacheFilePath = getCacheFilePath(cacheDir);
56
- try {
57
- return fs.existsSync(cacheFilePath) && fs.statSync(cacheFilePath).isFile();
58
- }
59
- catch {
60
- return false;
61
- }
62
- }
63
- function getProjectSecretKeyCacheDirs(projectRoot) {
64
- const cached = projectSecretKeyCacheDirs.get(projectRoot);
65
- if (cached && cached.every(cacheDir => cacheFileExists(cacheDir))) {
66
- return cached;
67
- }
68
- const results = [];
69
- const queue = [projectRoot];
70
- while (queue.length > 0) {
71
- const dir = queue.shift();
72
- if (!dir) {
73
- continue;
74
- }
75
- const cacheDir = path.join(dir, cacheDir_1.NORN_CACHE_DIR);
76
- if (cacheFileExists(cacheDir)) {
77
- results.push(cacheDir);
78
- }
79
- let entries;
80
- try {
81
- entries = fs.readdirSync(dir, { withFileTypes: true });
82
- }
83
- catch {
84
- continue;
85
- }
86
- for (const entry of entries) {
87
- if (!entry.isDirectory()) {
88
- continue;
89
- }
90
- if (entry.name === cacheDir_1.NORN_CACHE_DIR || CACHE_SCAN_IGNORED_DIRS.has(entry.name)) {
91
- continue;
92
- }
93
- queue.push(path.join(dir, entry.name));
94
- }
95
- }
96
- results.sort();
97
- projectSecretKeyCacheDirs.set(projectRoot, results);
98
- return results;
99
- }
100
- function getCacheDistance(targetPath, cacheDir) {
101
- const relative = path.relative((0, cacheDir_1.getSearchStartDirectory)(targetPath), cacheDir);
102
- if (!relative || relative === '.') {
103
- return 0;
104
- }
105
- return relative.split(path.sep).filter(segment => segment !== '').length;
106
- }
107
- function findExistingSecretKeyCacheDir(targetPath) {
108
- const projectRoot = (0, cacheDir_1.findProjectRoot)(targetPath);
109
- const candidates = getProjectSecretKeyCacheDirs(projectRoot);
110
- let bestMatch;
111
- let bestScore = Number.POSITIVE_INFINITY;
112
- for (const candidate of candidates) {
113
- const score = getCacheDistance(targetPath, candidate);
114
- if (score < bestScore || (score === bestScore && candidate < (bestMatch ?? candidate))) {
115
- bestMatch = candidate;
116
- bestScore = score;
117
- }
118
- }
119
- return bestMatch;
120
- }
121
- function rememberSecretKeyCacheDir(targetPath, cacheDir) {
122
- const projectRoot = (0, cacheDir_1.findProjectRoot)(targetPath);
123
- const cached = projectSecretKeyCacheDirs.get(projectRoot) ?? [];
124
- if (cached.includes(cacheDir)) {
125
- return;
126
- }
127
- projectSecretKeyCacheDirs.set(projectRoot, [...cached, cacheDir].sort());
128
- }
129
- function ensureCacheDir(targetPath) {
130
- const existing = findExistingSecretKeyCacheDir(targetPath);
131
- const projectRoot = (0, cacheDir_1.findProjectRoot)(targetPath);
132
- const cacheDir = existing ?? path.join(projectRoot, cacheDir_1.NORN_CACHE_DIR);
133
- if (!fs.existsSync(cacheDir)) {
134
- fs.mkdirSync(cacheDir, { recursive: true });
135
- }
136
- (0, cacheDir_1.ensureNornCacheGitignore)(cacheDir);
137
- rememberSecretKeyCacheDir(targetPath, cacheDir);
138
- return cacheDir;
139
- }
140
- function getReadCachePath(targetPath) {
141
- const existing = findExistingSecretKeyCacheDir(targetPath);
142
- if (existing) {
143
- return getCacheFilePath(existing);
144
- }
145
- const projectRoot = (0, cacheDir_1.findProjectRoot)(targetPath);
146
- const projectCacheDir = path.join(projectRoot, cacheDir_1.NORN_CACHE_DIR);
147
- if (fs.existsSync(projectCacheDir) && fs.statSync(projectCacheDir).isDirectory()) {
148
- return getCacheFilePath(projectCacheDir);
149
- }
150
- return undefined;
151
- }
152
- function getWriteCachePath(targetPath) {
153
- return getCacheFilePath(ensureCacheDir(targetPath));
154
- }
155
- function readCache(targetPath) {
156
- const cachePath = getReadCachePath(targetPath);
157
- if (!cachePath || !fs.existsSync(cachePath)) {
158
- return { version: CACHE_VERSION, keys: {} };
159
- }
160
- try {
161
- const parsed = JSON.parse(fs.readFileSync(cachePath, 'utf8'));
162
- if (parsed.version !== CACHE_VERSION || typeof parsed.keys !== 'object' || parsed.keys === null) {
163
- return { version: CACHE_VERSION, keys: {} };
164
- }
165
- return parsed;
166
- }
167
- catch {
168
- return { version: CACHE_VERSION, keys: {} };
169
- }
170
- }
171
- function writeCache(targetPath, cache) {
172
- const cachePath = getWriteCachePath(targetPath);
173
- fs.writeFileSync(cachePath, JSON.stringify(cache, null, 2), { encoding: 'utf8', mode: 0o600 });
174
- try {
175
- fs.chmodSync(cachePath, 0o600);
176
- }
177
- catch {
178
- // Best-effort permission hardening.
179
- }
180
- }
181
- function kidToEnvVarSuffix(kid) {
182
- return kid.replace(/[^a-zA-Z0-9]/g, '_').toUpperCase();
183
- }
184
- function getEnvMappedKeys() {
185
- const raw = process.env.NORN_SECRET_KEYS;
186
- if (!raw) {
187
- return {};
188
- }
189
- try {
190
- const parsed = JSON.parse(raw);
191
- const mapped = {};
192
- for (const [key, value] of Object.entries(parsed)) {
193
- if (typeof value === 'string' && value.trim() !== '') {
194
- mapped[key] = value;
195
- }
196
- }
197
- return mapped;
198
- }
199
- catch {
200
- return {};
201
- }
202
- }
203
- function resolveSecretKey(kid, targetPath) {
204
- const sessionValue = sessionKeys.get(kid);
205
- if (sessionValue) {
206
- return sessionValue;
207
- }
208
- const mapped = getEnvMappedKeys();
209
- if (mapped[kid]) {
210
- return mapped[kid];
211
- }
212
- const specific = process.env[`NORN_SECRET_KEY_${kidToEnvVarSuffix(kid)}`];
213
- if (specific && specific.trim() !== '') {
214
- return specific;
215
- }
216
- const cache = readCache(targetPath);
217
- const cached = cache.keys[kid]?.value;
218
- if (cached && cached.trim() !== '') {
219
- return cached;
220
- }
221
- const fallback = process.env.NORN_SECRET_KEY;
222
- if (fallback && fallback.trim() !== '') {
223
- return fallback;
224
- }
225
- return undefined;
226
- }
227
- function setSessionSecretKey(kid, key) {
228
- sessionKeys.set(kid, key);
229
- }
230
- function clearSessionSecretKeys() {
231
- sessionKeys.clear();
232
- }
233
- function listSessionSecretKeyIds() {
234
- return Array.from(sessionKeys.keys()).sort();
235
- }
236
- function saveSecretKeyToCache(kid, key, targetPath) {
237
- const cache = readCache(targetPath);
238
- cache.keys[kid] = {
239
- value: key,
240
- updatedAt: new Date().toISOString()
241
- };
242
- writeCache(targetPath, cache);
243
- setSessionSecretKey(kid, key);
244
- }
245
- function removeSecretKeyFromCache(kid, targetPath) {
246
- const cache = readCache(targetPath);
247
- if (!cache.keys[kid]) {
248
- return false;
249
- }
250
- delete cache.keys[kid];
251
- writeCache(targetPath, cache);
252
- sessionKeys.delete(kid);
253
- return true;
254
- }
255
- function listCachedSecretKeyIds(targetPath) {
256
- const cache = readCache(targetPath);
257
- return Object.keys(cache.keys).sort();
258
- }
259
- //# sourceMappingURL=keyStore.js.map
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.findSequenceDeclarationLine = findSequenceDeclarationLine;
4
- function findSequenceDeclarationLine(lines, seqStartLine, seqEndLine, options = {}) {
5
- const pattern = options.testOnly
6
- ? /^\s*test\s+sequence\s+/
7
- : /^\s*(test\s+)?sequence\s+/;
8
- for (let index = seqStartLine; index <= seqEndLine; index++) {
9
- if (pattern.test(lines[index])) {
10
- return index;
11
- }
12
- }
13
- return seqStartLine;
14
- }
15
- //# sourceMappingURL=sequenceDeclaration.js.map