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,113 +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.formatTheoryCaseLabel = formatTheoryCaseLabel;
37
- exports.normalizeTheoryCase = normalizeTheoryCase;
38
- exports.loadTheoryCasesFromSource = loadTheoryCasesFromSource;
39
- exports.resolveTheoryCases = resolveTheoryCases;
40
- exports.buildTheoryCaseArgs = buildTheoryCaseArgs;
41
- exports.resolveSequenceRunCases = resolveSequenceRunCases;
42
- const fs = __importStar(require("fs/promises"));
43
- const path = __importStar(require("path"));
44
- function formatTheoryCaseLabel(params, index) {
45
- const entries = Object.entries(params);
46
- if (entries.length === 0) {
47
- return index === undefined ? '[]' : `Case ${index + 1}`;
48
- }
49
- const parts = entries.map(([key, value]) => {
50
- if (typeof value === 'string') {
51
- return `${key}="${value}"`;
52
- }
53
- return `${key}=${value}`;
54
- });
55
- return `[${parts.join(', ')}]`;
56
- }
57
- function normalizeTheoryCase(caseValue, sequenceParamNames) {
58
- if (caseValue && typeof caseValue === 'object' && !Array.isArray(caseValue)) {
59
- return caseValue;
60
- }
61
- if (sequenceParamNames.length === 1) {
62
- return { [sequenceParamNames[0]]: caseValue };
63
- }
64
- return undefined;
65
- }
66
- async function loadTheoryCasesFromSource(sourcePath, workingDir, sequenceParamNames) {
67
- const resolvedPath = path.resolve(workingDir, sourcePath);
68
- const content = await fs.readFile(resolvedPath, 'utf-8');
69
- const parsed = JSON.parse(content);
70
- if (!Array.isArray(parsed)) {
71
- throw new Error(`Theory file "${sourcePath}" must contain a JSON array of test cases`);
72
- }
73
- const cases = [];
74
- for (let index = 0; index < parsed.length; index++) {
75
- const normalized = normalizeTheoryCase(parsed[index], sequenceParamNames);
76
- if (!normalized) {
77
- throw new Error(`Theory file "${sourcePath}" has invalid case at index ${index}. ` +
78
- 'Use objects for multi-parameter sequences.');
79
- }
80
- cases.push(normalized);
81
- }
82
- return cases;
83
- }
84
- async function resolveTheoryCases(sequence, workingDir) {
85
- const inlineCases = sequence.theoryData?.cases ?? [];
86
- if (inlineCases.length > 0) {
87
- return inlineCases;
88
- }
89
- if (!sequence.theoryData?.source) {
90
- return [];
91
- }
92
- return loadTheoryCasesFromSource(sequence.theoryData.source, workingDir, sequence.parameters.map(parameter => parameter.name));
93
- }
94
- function buildTheoryCaseArgs(defaultArgs, caseParams) {
95
- const args = { ...defaultArgs };
96
- for (const [key, value] of Object.entries(caseParams)) {
97
- if (value !== undefined) {
98
- args[key] = String(value);
99
- }
100
- }
101
- return args;
102
- }
103
- async function resolveSequenceRunCases(sequence, workingDir, defaultArgs) {
104
- const cases = await resolveTheoryCases(sequence, workingDir);
105
- if (cases.length === 0) {
106
- return [{ args: { ...defaultArgs } }];
107
- }
108
- return cases.map((caseParams, index) => ({
109
- label: formatTheoryCaseLabel(caseParams, index),
110
- args: buildTheoryCaseArgs(defaultArgs, caseParams)
111
- }));
112
- }
113
- //# sourceMappingURL=theoryCaseLoader.js.map
@@ -1,211 +0,0 @@
1
- "use strict";
2
- /**
3
- * Validation Cache - Stores schema validation results for decorations and status tracking
4
- * Results are persisted in .norn-cache/validation-results.json
5
- */
6
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
- if (k2 === undefined) k2 = k;
8
- var desc = Object.getOwnPropertyDescriptor(m, k);
9
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
- desc = { enumerable: true, get: function() { return m[k]; } };
11
- }
12
- Object.defineProperty(o, k2, desc);
13
- }) : (function(o, m, k, k2) {
14
- if (k2 === undefined) k2 = k;
15
- o[k2] = m[k];
16
- }));
17
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
18
- Object.defineProperty(o, "default", { enumerable: true, value: v });
19
- }) : function(o, v) {
20
- o["default"] = v;
21
- });
22
- var __importStar = (this && this.__importStar) || (function () {
23
- var ownKeys = function(o) {
24
- ownKeys = Object.getOwnPropertyNames || function (o) {
25
- var ar = [];
26
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
27
- return ar;
28
- };
29
- return ownKeys(o);
30
- };
31
- return function (mod) {
32
- if (mod && mod.__esModule) return mod;
33
- var result = {};
34
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
35
- __setModuleDefault(result, mod);
36
- return result;
37
- };
38
- })();
39
- Object.defineProperty(exports, "__esModule", { value: true });
40
- exports.loadCache = loadCache;
41
- exports.saveValidationResult = saveValidationResult;
42
- exports.getResultForAssertion = getResultForAssertion;
43
- exports.getResultsForFile = getResultsForFile;
44
- exports.clearResultsForFile = clearResultsForFile;
45
- exports.clearAllResults = clearAllResults;
46
- exports.markResultsAsStale = markResultsAsStale;
47
- const vscode = __importStar(require("vscode"));
48
- const cacheDir_1 = require("./cacheDir");
49
- const CACHE_VERSION = 1;
50
- const CACHE_FILE = 'validation-results.json';
51
- /**
52
- * Get the workspace root folder
53
- */
54
- function getWorkspaceRoot() {
55
- const workspaceFolders = vscode.workspace.workspaceFolders;
56
- if (workspaceFolders && workspaceFolders.length > 0) {
57
- return workspaceFolders[0].uri.fsPath;
58
- }
59
- return undefined;
60
- }
61
- /**
62
- * Get the path to the cache file
63
- */
64
- function getCachePath() {
65
- const root = getWorkspaceRoot();
66
- if (!root) {
67
- return undefined;
68
- }
69
- return (0, cacheDir_1.getNornCacheFilePath)(root, CACHE_FILE);
70
- }
71
- /**
72
- * Ensure the cache directory exists
73
- */
74
- function ensureCacheDir() {
75
- const root = getWorkspaceRoot();
76
- if (!root) {
77
- return false;
78
- }
79
- return !!(0, cacheDir_1.ensureNornCacheDir)(root);
80
- }
81
- /**
82
- * Load the validation cache from disk
83
- */
84
- function loadCache() {
85
- return (0, cacheDir_1.loadVersionedJsonCache)({
86
- cachePath: getCachePath(),
87
- version: CACHE_VERSION,
88
- createDefault: () => ({ version: CACHE_VERSION, results: {} }),
89
- isValid: cache => typeof cache.results === 'object' && cache.results !== null
90
- });
91
- }
92
- /**
93
- * Save the cache to disk
94
- */
95
- function saveCache(cache) {
96
- return (0, cacheDir_1.saveVersionedJsonCache)(getCachePath(), cache, ensureCacheDir);
97
- }
98
- /**
99
- * Generate a cache key from source file and line number
100
- */
101
- function getCacheKey(sourceFile, line) {
102
- // Normalize to workspace-relative path
103
- const root = getWorkspaceRoot();
104
- let relativePath = sourceFile;
105
- if (root && sourceFile.startsWith(root)) {
106
- relativePath = sourceFile.slice(root.length + 1);
107
- }
108
- return `${relativePath}:${line}`;
109
- }
110
- /**
111
- * Save a validation result to the cache
112
- */
113
- function saveValidationResult(result) {
114
- const cache = loadCache();
115
- const key = getCacheKey(result.sourceFile, result.assertionLine);
116
- // Normalize paths
117
- const root = getWorkspaceRoot();
118
- if (root) {
119
- if (result.sourceFile.startsWith(root)) {
120
- result.sourceFile = result.sourceFile.slice(root.length + 1);
121
- }
122
- if (result.schemaPath.startsWith(root)) {
123
- result.schemaPath = result.schemaPath.slice(root.length + 1);
124
- }
125
- }
126
- cache.results[key] = result;
127
- saveCache(cache);
128
- }
129
- /**
130
- * Get validation result for a specific assertion
131
- * @param sourceFile Absolute path to the .norn file
132
- * @param line Line number (0-based)
133
- */
134
- function getResultForAssertion(sourceFile, line) {
135
- const cache = loadCache();
136
- const key = getCacheKey(sourceFile, line);
137
- return cache.results[key];
138
- }
139
- /**
140
- * Get all validation results for a source file
141
- * @param sourceFile Absolute path to the .norn file
142
- */
143
- function getResultsForFile(sourceFile) {
144
- const cache = loadCache();
145
- const results = [];
146
- // Normalize path for comparison
147
- const root = getWorkspaceRoot();
148
- let normalizedPath = sourceFile;
149
- if (root && sourceFile.startsWith(root)) {
150
- normalizedPath = sourceFile.slice(root.length + 1);
151
- }
152
- for (const [key, result] of Object.entries(cache.results)) {
153
- const [filePath] = key.split(':');
154
- if (filePath === normalizedPath) {
155
- results.push(result);
156
- }
157
- }
158
- return results;
159
- }
160
- /**
161
- * Clear all cached results for a specific file
162
- */
163
- function clearResultsForFile(sourceFile) {
164
- const cache = loadCache();
165
- // Normalize path for comparison
166
- const root = getWorkspaceRoot();
167
- let normalizedPath = sourceFile;
168
- if (root && sourceFile.startsWith(root)) {
169
- normalizedPath = sourceFile.slice(root.length + 1);
170
- }
171
- const keysToDelete = [];
172
- for (const key of Object.keys(cache.results)) {
173
- const [filePath] = key.split(':');
174
- if (filePath === normalizedPath) {
175
- keysToDelete.push(key);
176
- }
177
- }
178
- keysToDelete.forEach(key => delete cache.results[key]);
179
- saveCache(cache);
180
- }
181
- /**
182
- * Clear all cached results
183
- */
184
- function clearAllResults() {
185
- const cache = { version: CACHE_VERSION, results: {} };
186
- saveCache(cache);
187
- }
188
- /**
189
- * Mark all results for a file as stale (used when file changes)
190
- */
191
- function markResultsAsStale(sourceFile) {
192
- const cache = loadCache();
193
- // Normalize path for comparison
194
- const root = getWorkspaceRoot();
195
- let normalizedPath = sourceFile;
196
- if (root && sourceFile.startsWith(root)) {
197
- normalizedPath = sourceFile.slice(root.length + 1);
198
- }
199
- let modified = false;
200
- for (const [key, result] of Object.entries(cache.results)) {
201
- const [filePath] = key.split(':');
202
- if (filePath === normalizedPath && result.status !== 'stale') {
203
- result.status = 'stale';
204
- modified = true;
205
- }
206
- }
207
- if (modified) {
208
- saveCache(cache);
209
- }
210
- }
211
- //# sourceMappingURL=validationCache.js.map