norn-cli 2.4.0 → 2.5.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 (93) hide show
  1. package/AGENTS.md +2 -2
  2. package/CHANGELOG.md +24 -1
  3. package/dist/cli.js +217 -77
  4. package/package.json +13 -4
  5. package/.claude/settings.local.json +0 -18
  6. package/.claude/skills/norn-social-campaign/SKILL.md +0 -70
  7. package/out/apiResponseIntellisenseCache.js +0 -394
  8. package/out/assertionRunner.js +0 -567
  9. package/out/cacheDir.js +0 -136
  10. package/out/chatParticipant.js +0 -763
  11. package/out/cli/colors.js +0 -127
  12. package/out/cli/formatters/assertion.js +0 -102
  13. package/out/cli/formatters/index.js +0 -23
  14. package/out/cli/formatters/response.js +0 -106
  15. package/out/cli/formatters/summary.js +0 -246
  16. package/out/cli/redaction.js +0 -237
  17. package/out/cli/reporters/html.js +0 -689
  18. package/out/cli/reporters/index.js +0 -22
  19. package/out/cli/reporters/junit.js +0 -226
  20. package/out/codeLensProvider.js +0 -351
  21. package/out/compareContentProvider.js +0 -85
  22. package/out/completionProvider.js +0 -3739
  23. package/out/contractAssertionSummary.js +0 -225
  24. package/out/contractDecorationProvider.js +0 -243
  25. package/out/coverageCalculator.js +0 -879
  26. package/out/coveragePanel.js +0 -597
  27. package/out/debug/breakpointResolver.js +0 -84
  28. package/out/debug/breakpoints.js +0 -52
  29. package/out/debug/nornDebugAdapter.js +0 -166
  30. package/out/debug/nornDebugSession.js +0 -613
  31. package/out/debug/sequenceLocationIndex.js +0 -77
  32. package/out/debug/types.js +0 -3
  33. package/out/deepClone.js +0 -21
  34. package/out/diagnosticProvider.js +0 -2554
  35. package/out/environmentParser.js +0 -736
  36. package/out/environmentProvider.js +0 -544
  37. package/out/environmentTemplates.js +0 -146
  38. package/out/errors/formatError.js +0 -113
  39. package/out/errors/nornError.js +0 -29
  40. package/out/formUrlEncoded.js +0 -89
  41. package/out/httpClient.js +0 -348
  42. package/out/httpRuntimeOptions.js +0 -16
  43. package/out/importErrors.js +0 -31
  44. package/out/inlayHintResolver.js +0 -70
  45. package/out/jsonFileReader.js +0 -323
  46. package/out/mcpClient.js +0 -193
  47. package/out/mcpConfig.js +0 -184
  48. package/out/mcpToolIntellisenseCache.js +0 -96
  49. package/out/mcpToolSchema.js +0 -50
  50. package/out/nornConfig.js +0 -132
  51. package/out/nornHoverProvider.js +0 -124
  52. package/out/nornInlayHintsProvider.js +0 -191
  53. package/out/nornPrompt.js +0 -755
  54. package/out/nornSqlParser.js +0 -286
  55. package/out/nornapiHoverProvider.js +0 -135
  56. package/out/nornapiInlayHintsProvider.js +0 -94
  57. package/out/nornapiParser.js +0 -324
  58. package/out/nornenvCodeActionProvider.js +0 -101
  59. package/out/nornenvDecorationProvider.js +0 -239
  60. package/out/nornenvFoldingProvider.js +0 -63
  61. package/out/nornenvHoverProvider.js +0 -114
  62. package/out/nornenvInlayHintsProvider.js +0 -99
  63. package/out/nornenvLanguageModel.js +0 -187
  64. package/out/nornenvRegionRefactor.js +0 -267
  65. package/out/nornsqlHoverProvider.js +0 -95
  66. package/out/nornsqlInlayHintsProvider.js +0 -114
  67. package/out/parser.js +0 -839
  68. package/out/pathAccess.js +0 -28
  69. package/out/postmanImportPanel.js +0 -732
  70. package/out/postmanImportPlanner.js +0 -1155
  71. package/out/postmanImportSidebarView.js +0 -532
  72. package/out/quotedString.js +0 -35
  73. package/out/requestPreparation.js +0 -179
  74. package/out/requestValidation.js +0 -146
  75. package/out/responsePanel.js +0 -7754
  76. package/out/schemaGenerator.js +0 -562
  77. package/out/scriptRunner.js +0 -419
  78. package/out/secrets/cliSecrets.js +0 -415
  79. package/out/secrets/crypto.js +0 -105
  80. package/out/secrets/envFileSecrets.js +0 -177
  81. package/out/secrets/keyStore.js +0 -259
  82. package/out/sequenceDeclaration.js +0 -15
  83. package/out/sequenceRunner.js +0 -3590
  84. package/out/sqlAdapterRunner.js +0 -122
  85. package/out/sqlBuiltInAdapters.js +0 -604
  86. package/out/sqlConfig.js +0 -184
  87. package/out/starterCatalog.js +0 -554
  88. package/out/stringUtils.js +0 -25
  89. package/out/swaggerBodyIntellisenseCache.js +0 -114
  90. package/out/swaggerParser.js +0 -464
  91. package/out/testProvider.js +0 -767
  92. package/out/theoryCaseLoader.js +0 -113
  93. 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