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,225 +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.buildContractAssertionDisplay = buildContractAssertionDisplay;
37
- exports.buildContractValidationList = buildContractValidationList;
38
- const path = __importStar(require("path"));
39
- function buildContractAssertionDisplay(assertion, maxIssues = 3, maxValidatedItems = 24) {
40
- if (assertion.operator !== 'matchesSchema') {
41
- return undefined;
42
- }
43
- const issueCount = assertion.schemaSummary?.issueCount ?? assertion.schemaErrors?.length ?? (assertion.error ? 1 : 0);
44
- const schemaPath = assertion.schemaPath || (typeof assertion.rightValue === 'string' ? assertion.rightValue : undefined);
45
- const schemaName = schemaPath ? path.basename(schemaPath) : undefined;
46
- const issueTexts = (assertion.schemaErrors || [])
47
- .slice(0, maxIssues)
48
- .map(formatSchemaIssue);
49
- const validationList = buildContractValidationList(assertion.schema, assertion.schemaErrors || [], maxValidatedItems);
50
- const failedValidationCount = validationList.failedCount || (!assertion.passed && issueCount > 0 ? 1 : 0);
51
- const totalValidations = validationList.totalCount + failedValidationCount;
52
- const passedValidations = assertion.passed ? totalValidations : validationList.totalCount;
53
- let summaryText;
54
- if (totalValidations > 0) {
55
- summaryText = `${passedValidations}/${totalValidations} validations passed`;
56
- }
57
- else {
58
- summaryText = assertion.passed ? 'contract passed' : 'contract validation failed';
59
- }
60
- if (issueCount > 0) {
61
- summaryText += `, ${issueCount} issue${issueCount === 1 ? '' : 's'}`;
62
- }
63
- const titleText = schemaName
64
- ? `${schemaName}: ${summaryText}`
65
- : `Contract: ${summaryText}`;
66
- const validationText = totalValidations > 0
67
- ? `${passedValidations}/${totalValidations} validations`
68
- : (assertion.passed ? 'validated' : `${issueCount} issue${issueCount === 1 ? '' : 's'}`);
69
- const severity = getContractDisplaySeverity(assertion);
70
- return {
71
- titleText,
72
- summaryText,
73
- validationText,
74
- severity,
75
- schemaPath,
76
- schemaName,
77
- issueTexts,
78
- remainingIssueCount: Math.max(issueCount - issueTexts.length, 0),
79
- validatedItems: validationList.items,
80
- remainingValidatedCount: validationList.remainingCount,
81
- totalValidatedCount: validationList.totalCount
82
- };
83
- }
84
- function buildContractValidationList(schema, errors = [], maxItems = 24) {
85
- const failedPaths = new Set(errors.map(getComparableErrorPath));
86
- const allItems = collectContractValidationItems(schema)
87
- .filter(item => !isFailedValidationPath(item.comparablePath, failedPaths));
88
- const items = allItems.slice(0, maxItems).map(({ comparablePath: _comparablePath, ...item }) => item);
89
- return {
90
- items,
91
- totalCount: allItems.length,
92
- remainingCount: Math.max(allItems.length - items.length, 0),
93
- failedCount: failedPaths.size
94
- };
95
- }
96
- const RULE_LABELS = {
97
- type: value => `type: ${Array.isArray(value) ? value.join(' | ') : String(value)}`,
98
- format: value => `format: ${String(value)}`,
99
- enum: () => 'enum',
100
- const: () => 'const',
101
- pattern: () => 'pattern',
102
- minimum: value => `min: ${String(value)}`,
103
- exclusiveMinimum: value => `exclusive min: ${String(value)}`,
104
- maximum: value => `max: ${String(value)}`,
105
- exclusiveMaximum: value => `exclusive max: ${String(value)}`,
106
- minLength: value => `min length: ${String(value)}`,
107
- maxLength: value => `max length: ${String(value)}`,
108
- minItems: value => `min items: ${String(value)}`,
109
- maxItems: value => `max items: ${String(value)}`,
110
- uniqueItems: () => 'unique items',
111
- minProperties: value => `min properties: ${String(value)}`,
112
- maxProperties: value => `max properties: ${String(value)}`,
113
- multipleOf: value => `multiple of: ${String(value)}`
114
- };
115
- function collectContractValidationItems(schema, comparablePath = '', inheritedRules = []) {
116
- if (!isRecord(schema)) {
117
- return [];
118
- }
119
- const items = [];
120
- const ownRules = getSchemaRuleLabels(schema);
121
- const rules = [...inheritedRules, ...ownRules];
122
- if (comparablePath && rules.length > 0) {
123
- items.push({
124
- comparablePath,
125
- path: formatComparablePath(comparablePath),
126
- rules
127
- });
128
- }
129
- else if (!comparablePath && rules.length > 0 && !schema.properties && !schema.items) {
130
- items.push({
131
- comparablePath: '/',
132
- path: '(root)',
133
- rules
134
- });
135
- }
136
- if (isRecord(schema.properties)) {
137
- const required = Array.isArray(schema.required) ? new Set(schema.required.map(String)) : new Set();
138
- for (const [propertyName, propertySchema] of Object.entries(schema.properties)) {
139
- const childPath = appendPropertyPath(comparablePath, propertyName);
140
- const childRules = required.has(propertyName) ? ['required'] : [];
141
- items.push(...collectContractValidationItems(propertySchema, childPath, childRules));
142
- }
143
- }
144
- if (isRecord(schema.items)) {
145
- items.push(...collectContractValidationItems(schema.items, appendArrayPath(comparablePath), []));
146
- }
147
- return items;
148
- }
149
- function getSchemaRuleLabels(schema) {
150
- const rules = [];
151
- for (const [keyword, formatter] of Object.entries(RULE_LABELS)) {
152
- if (schema[keyword] !== undefined) {
153
- rules.push(formatter(schema[keyword]));
154
- }
155
- }
156
- if (schema.additionalProperties === false) {
157
- rules.push('no extra properties');
158
- }
159
- return rules;
160
- }
161
- function appendPropertyPath(basePath, propertyName) {
162
- return `${basePath || ''}/${propertyName.replace(/~/g, '~0').replace(/\//g, '~1')}`;
163
- }
164
- function appendArrayPath(basePath) {
165
- return `${basePath || ''}/[]`;
166
- }
167
- function formatComparablePath(comparablePath) {
168
- return comparablePath.replace(/\/\[\]/g, '[]').replace(/~1/g, '/').replace(/~0/g, '~');
169
- }
170
- function getComparableErrorPath(error) {
171
- let instancePath = error.instancePath && error.instancePath !== '(root)'
172
- ? error.instancePath
173
- : '';
174
- if (error.keyword === 'required' && typeof error.params?.missingProperty === 'string') {
175
- instancePath = appendErrorPropertyPath(instancePath, error.params.missingProperty);
176
- }
177
- else if (error.keyword === 'additionalProperties' && typeof error.params?.additionalProperty === 'string') {
178
- instancePath = appendErrorPropertyPath(instancePath, error.params.additionalProperty);
179
- }
180
- return normalizeComparablePath(instancePath || '/');
181
- }
182
- function appendErrorPropertyPath(instancePath, propertyName) {
183
- const normalizedPath = instancePath && instancePath !== '(root)' && instancePath !== '/' ? instancePath : '';
184
- const escapedPropertyName = propertyName.replace(/~/g, '~0').replace(/\//g, '~1');
185
- const lastSegment = normalizedPath.split('/').pop();
186
- return lastSegment === escapedPropertyName
187
- ? normalizedPath
188
- : `${normalizedPath}/${escapedPropertyName}`;
189
- }
190
- function normalizeComparablePath(instancePath) {
191
- if (!instancePath || instancePath === '(root)' || instancePath === '/') {
192
- return '/';
193
- }
194
- return instancePath
195
- .split('/')
196
- .map(segment => (/^\d+$/.test(segment) ? '[]' : segment))
197
- .join('/');
198
- }
199
- function isFailedValidationPath(comparablePath, failedPaths) {
200
- for (const failedPath of failedPaths) {
201
- if (comparablePath === failedPath || comparablePath.startsWith(`${failedPath}/`)) {
202
- return true;
203
- }
204
- }
205
- return false;
206
- }
207
- function isRecord(value) {
208
- return typeof value === 'object' && value !== null && !Array.isArray(value);
209
- }
210
- function formatSchemaIssue(error) {
211
- const location = error.instancePath && error.instancePath !== '(root)'
212
- ? error.instancePath
213
- : '';
214
- return location ? `${location}: ${error.message}` : error.message;
215
- }
216
- function getContractDisplaySeverity(assertion) {
217
- if (assertion.passed) {
218
- return 'success';
219
- }
220
- const schemaErrors = assertion.schemaErrors || [];
221
- return schemaErrors.length > 0 && schemaErrors.every(error => error.severity === 'warning')
222
- ? 'warning'
223
- : 'error';
224
- }
225
- //# sourceMappingURL=contractAssertionSummary.js.map
@@ -1,243 +0,0 @@
1
- "use strict";
2
- /**
3
- * Contract Decoration Provider - Visual indicators for schema assertion lines
4
- * Shows pass/fail/stale status as colored decorations in the editor gutter
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.ContractDecorationProvider = void 0;
41
- exports.createContractHoverProvider = createContractHoverProvider;
42
- const vscode = __importStar(require("vscode"));
43
- const validationCache_1 = require("./validationCache");
44
- /**
45
- * Creates decoration types with appropriate colors and icons
46
- */
47
- function createDecorationTypes() {
48
- return {
49
- pass: vscode.window.createTextEditorDecorationType({
50
- gutterIconPath: vscode.Uri.parse('data:image/svg+xml,' + encodeURIComponent(`
51
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="#4ec9b0">
52
- <path d="M4 2a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1H4zm1 2h6v1H5V4zm0 2h6v1H5V6zm0 2h4v1H5V8z"/>
53
- <path d="M10.5 10l-2 2-1-1-.7.7 1.7 1.7 2.7-2.7-.7-.7z"/>
54
- </svg>
55
- `)),
56
- gutterIconSize: 'contain',
57
- backgroundColor: 'rgba(78, 201, 176, 0.08)',
58
- isWholeLine: true,
59
- overviewRulerColor: '#4ec9b0',
60
- overviewRulerLane: vscode.OverviewRulerLane.Right
61
- }),
62
- fail: vscode.window.createTextEditorDecorationType({
63
- gutterIconPath: vscode.Uri.parse('data:image/svg+xml,' + encodeURIComponent(`
64
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="#f14c4c">
65
- <path d="M4 2a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1H4zm1 2h6v1H5V4zm0 2h6v1H5V6zm0 2h4v1H5V8z"/>
66
- <path d="M9.5 10l1.5 1.5-1 1-1.5-1.5-1.5 1.5-1-1 1.5-1.5-1.5-1.5 1-1 1.5 1.5 1.5-1.5 1 1-1.5 1.5z"/>
67
- </svg>
68
- `)),
69
- gutterIconSize: 'contain',
70
- backgroundColor: 'rgba(241, 76, 76, 0.1)',
71
- isWholeLine: true,
72
- overviewRulerColor: '#f14c4c',
73
- overviewRulerLane: vscode.OverviewRulerLane.Right
74
- }),
75
- warn: vscode.window.createTextEditorDecorationType({
76
- gutterIconPath: vscode.Uri.parse('data:image/svg+xml,' + encodeURIComponent(`
77
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="#cca700">
78
- <path d="M4 2a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1H4zm1 2h6v1H5V4zm0 2h6v1H5V6zm0 2h4v1H5V8z"/>
79
- <path d="M10.5 10.5a.5.5 0 0 1-1 0v-1a.5.5 0 0 1 1 0v1zm-.5 2a.5.5 0 1 1 0-1 .5.5 0 0 1 0 1z"/>
80
- </svg>
81
- `)),
82
- gutterIconSize: 'contain',
83
- backgroundColor: 'rgba(204, 167, 0, 0.08)',
84
- isWholeLine: true,
85
- overviewRulerColor: '#cca700',
86
- overviewRulerLane: vscode.OverviewRulerLane.Right
87
- }),
88
- stale: vscode.window.createTextEditorDecorationType({
89
- gutterIconPath: vscode.Uri.parse('data:image/svg+xml,' + encodeURIComponent(`
90
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="#808080">
91
- <path d="M4 2a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1H4zm1 2h6v1H5V4zm0 2h6v1H5V6zm0 2h4v1H5V8z"/>
92
- <path d="M10.5 10.5a.5.5 0 0 1-1 0v-1a.5.5 0 0 1 1 0v1zm-.5 2a.5.5 0 1 1 0-1 .5.5 0 0 1 0 1z"/>
93
- </svg>
94
- `)),
95
- gutterIconSize: 'contain',
96
- backgroundColor: 'rgba(128, 128, 128, 0.05)',
97
- isWholeLine: true,
98
- overviewRulerColor: '#808080',
99
- overviewRulerLane: vscode.OverviewRulerLane.Right
100
- }),
101
- unknown: vscode.window.createTextEditorDecorationType({
102
- gutterIconPath: vscode.Uri.parse('data:image/svg+xml,' + encodeURIComponent(`
103
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="#808080" opacity="0.5">
104
- <path d="M4 2a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1H4zm1 2h6v1H5V4zm0 2h6v1H5V6zm0 2h4v1H5V8z" stroke="#808080" stroke-dasharray="2,2" fill="none"/>
105
- </svg>
106
- `)),
107
- gutterIconSize: 'contain'
108
- })
109
- };
110
- }
111
- /**
112
- * Pattern to match matchesSchema assertions
113
- */
114
- const MATCHES_SCHEMA_PATTERN = /^\s*assert\s+.+\s+matchesSchema\s+/i;
115
- /**
116
- * Find all matchesSchema assertion lines in a document
117
- */
118
- function findSchemaAssertionLines(document) {
119
- const lines = [];
120
- for (let i = 0; i < document.lineCount; i++) {
121
- const lineText = document.lineAt(i).text;
122
- if (MATCHES_SCHEMA_PATTERN.test(lineText)) {
123
- lines.push(i);
124
- }
125
- }
126
- return lines;
127
- }
128
- /**
129
- * Contract Decoration Provider class
130
- */
131
- class ContractDecorationProvider {
132
- decorationTypes;
133
- disposables = [];
134
- constructor() {
135
- this.decorationTypes = createDecorationTypes();
136
- // Update decorations when active editor changes
137
- this.disposables.push(vscode.window.onDidChangeActiveTextEditor(editor => {
138
- if (editor?.document.languageId === 'norn') {
139
- this.updateDecorations(editor);
140
- }
141
- }));
142
- // Update decorations when document changes (with debounce)
143
- let updateTimeout;
144
- this.disposables.push(vscode.workspace.onDidChangeTextDocument(event => {
145
- const editor = vscode.window.activeTextEditor;
146
- if (editor && event.document === editor.document && editor.document.languageId === 'norn') {
147
- if (updateTimeout) {
148
- clearTimeout(updateTimeout);
149
- }
150
- updateTimeout = setTimeout(() => {
151
- this.updateDecorations(editor);
152
- }, 300);
153
- }
154
- }));
155
- // Initial decoration for active editor
156
- const activeEditor = vscode.window.activeTextEditor;
157
- if (activeEditor?.document.languageId === 'norn') {
158
- this.updateDecorations(activeEditor);
159
- }
160
- }
161
- /**
162
- * Update decorations for a text editor
163
- * Disabled - no gutter icons or line highlights for contract assertions
164
- */
165
- updateDecorations(editor) {
166
- // Contract decorations disabled - user requested clean editor without gutter icons/highlights
167
- // Clear any existing decorations
168
- editor.setDecorations(this.decorationTypes.pass, []);
169
- editor.setDecorations(this.decorationTypes.fail, []);
170
- editor.setDecorations(this.decorationTypes.warn, []);
171
- editor.setDecorations(this.decorationTypes.stale, []);
172
- editor.setDecorations(this.decorationTypes.unknown, []);
173
- }
174
- /**
175
- * Refresh decorations on all visible editors
176
- */
177
- refreshAllDecorations() {
178
- for (const editor of vscode.window.visibleTextEditors) {
179
- if (editor.document.languageId === 'norn') {
180
- this.updateDecorations(editor);
181
- }
182
- }
183
- }
184
- dispose() {
185
- // Dispose decoration types
186
- Object.values(this.decorationTypes).forEach(dt => dt.dispose());
187
- // Dispose other subscriptions
188
- this.disposables.forEach(d => d.dispose());
189
- }
190
- }
191
- exports.ContractDecorationProvider = ContractDecorationProvider;
192
- /**
193
- * Create a hover provider for schema assertion decorations
194
- */
195
- function createContractHoverProvider() {
196
- return {
197
- provideHover(document, position) {
198
- const line = document.lineAt(position.line);
199
- if (!MATCHES_SCHEMA_PATTERN.test(line.text)) {
200
- return undefined;
201
- }
202
- const result = (0, validationCache_1.getResultForAssertion)(document.uri.fsPath, position.line);
203
- if (!result) {
204
- return new vscode.Hover([
205
- new vscode.MarkdownString('**Contract Status:** ⚪ Not validated\n\nRun the sequence to validate this assertion.')
206
- ]);
207
- }
208
- const statusIcon = {
209
- pass: '🟢',
210
- fail: '🔴',
211
- warn: '🟡',
212
- stale: '⚪'
213
- }[result.status] || '⚪';
214
- const statusText = {
215
- pass: 'Passed',
216
- fail: 'Failed',
217
- warn: 'Warning',
218
- stale: 'Stale (re-run to update)'
219
- }[result.status] || 'Unknown';
220
- const md = new vscode.MarkdownString();
221
- md.appendMarkdown(`**Contract Status:** ${statusIcon} ${statusText}\n\n`);
222
- md.appendMarkdown(`**Schema:** \`${result.schemaPath}\`\n\n`);
223
- if (result.lastRunTime) {
224
- const date = new Date(result.lastRunTime);
225
- md.appendMarkdown(`**Last Run:** ${date.toLocaleString()}\n\n`);
226
- }
227
- if (result.environment) {
228
- md.appendMarkdown(`**Environment:** ${result.environment}\n\n`);
229
- }
230
- if (result.status === 'fail' && result.errorCount) {
231
- md.appendMarkdown(`**Errors:** ${result.errorCount}\n\n`);
232
- if (result.errorSummary) {
233
- md.appendMarkdown(`> ${result.errorSummary}\n\n`);
234
- }
235
- }
236
- // Add action link
237
- md.appendMarkdown(`[Open Contract View](command:norn.openContractView?${encodeURIComponent(JSON.stringify({ schemaPath: result.schemaPath }))})`);
238
- md.isTrusted = true;
239
- return new vscode.Hover(md);
240
- }
241
- };
242
- }
243
- //# sourceMappingURL=contractDecorationProvider.js.map