norn-cli 2.3.0 → 2.4.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 (92) hide show
  1. package/.claude/skills/norn-social-campaign/SKILL.md +70 -0
  2. package/CHANGELOG.md +6 -0
  3. package/demos/nornenv-region-refactor/README.md +64 -0
  4. package/dist/cli.js +360 -1
  5. package/out/apiResponseIntellisenseCache.js +394 -0
  6. package/out/assertionRunner.js +567 -0
  7. package/out/cacheDir.js +136 -0
  8. package/out/chatParticipant.js +763 -0
  9. package/out/cli/colors.js +127 -0
  10. package/out/cli/formatters/assertion.js +102 -0
  11. package/out/cli/formatters/index.js +23 -0
  12. package/out/cli/formatters/response.js +106 -0
  13. package/out/cli/formatters/summary.js +246 -0
  14. package/out/cli/redaction.js +237 -0
  15. package/out/cli/reporters/html.js +689 -0
  16. package/out/cli/reporters/index.js +22 -0
  17. package/out/cli/reporters/junit.js +226 -0
  18. package/out/codeLensProvider.js +351 -0
  19. package/out/compareContentProvider.js +85 -0
  20. package/out/completionProvider.js +3739 -0
  21. package/out/contractAssertionSummary.js +225 -0
  22. package/out/contractDecorationProvider.js +243 -0
  23. package/out/coverageCalculator.js +879 -0
  24. package/out/coveragePanel.js +597 -0
  25. package/out/debug/breakpointResolver.js +84 -0
  26. package/out/debug/breakpoints.js +52 -0
  27. package/out/debug/nornDebugAdapter.js +166 -0
  28. package/out/debug/nornDebugSession.js +613 -0
  29. package/out/debug/sequenceLocationIndex.js +77 -0
  30. package/out/debug/types.js +3 -0
  31. package/out/deepClone.js +21 -0
  32. package/out/diagnosticProvider.js +2554 -0
  33. package/out/environmentParser.js +736 -0
  34. package/out/environmentProvider.js +544 -0
  35. package/out/environmentTemplates.js +146 -0
  36. package/out/errors/formatError.js +113 -0
  37. package/out/errors/nornError.js +29 -0
  38. package/out/formUrlEncoded.js +89 -0
  39. package/out/httpClient.js +348 -0
  40. package/out/httpRuntimeOptions.js +16 -0
  41. package/out/importErrors.js +31 -0
  42. package/out/inlayHintResolver.js +70 -0
  43. package/out/jsonFileReader.js +323 -0
  44. package/out/mcpClient.js +193 -0
  45. package/out/mcpConfig.js +184 -0
  46. package/out/mcpToolIntellisenseCache.js +96 -0
  47. package/out/mcpToolSchema.js +50 -0
  48. package/out/nornConfig.js +132 -0
  49. package/out/nornHoverProvider.js +124 -0
  50. package/out/nornInlayHintsProvider.js +191 -0
  51. package/out/nornPrompt.js +755 -0
  52. package/out/nornSqlParser.js +286 -0
  53. package/out/nornapiHoverProvider.js +135 -0
  54. package/out/nornapiInlayHintsProvider.js +94 -0
  55. package/out/nornapiParser.js +324 -0
  56. package/out/nornenvCodeActionProvider.js +101 -0
  57. package/out/nornenvDecorationProvider.js +239 -0
  58. package/out/nornenvFoldingProvider.js +63 -0
  59. package/out/nornenvHoverProvider.js +114 -0
  60. package/out/nornenvInlayHintsProvider.js +99 -0
  61. package/out/nornenvLanguageModel.js +187 -0
  62. package/out/nornenvRegionRefactor.js +267 -0
  63. package/out/nornsqlHoverProvider.js +95 -0
  64. package/out/nornsqlInlayHintsProvider.js +114 -0
  65. package/out/parser.js +839 -0
  66. package/out/pathAccess.js +28 -0
  67. package/out/postmanImportPanel.js +732 -0
  68. package/out/postmanImportPlanner.js +1155 -0
  69. package/out/postmanImportSidebarView.js +532 -0
  70. package/out/quotedString.js +35 -0
  71. package/out/requestPreparation.js +179 -0
  72. package/out/requestValidation.js +146 -0
  73. package/out/responsePanel.js +7754 -0
  74. package/out/schemaGenerator.js +562 -0
  75. package/out/scriptRunner.js +419 -0
  76. package/out/secrets/cliSecrets.js +415 -0
  77. package/out/secrets/crypto.js +105 -0
  78. package/out/secrets/envFileSecrets.js +177 -0
  79. package/out/secrets/keyStore.js +259 -0
  80. package/out/sequenceDeclaration.js +15 -0
  81. package/out/sequenceRunner.js +3590 -0
  82. package/out/sqlAdapterRunner.js +122 -0
  83. package/out/sqlBuiltInAdapters.js +604 -0
  84. package/out/sqlConfig.js +184 -0
  85. package/out/starterCatalog.js +554 -0
  86. package/out/stringUtils.js +25 -0
  87. package/out/swaggerBodyIntellisenseCache.js +114 -0
  88. package/out/swaggerParser.js +464 -0
  89. package/out/testProvider.js +767 -0
  90. package/out/theoryCaseLoader.js +113 -0
  91. package/out/validationCache.js +211 -0
  92. package/package.json +6 -1
@@ -0,0 +1,122 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.runSqlAdapter = runSqlAdapter;
4
+ const child_process_1 = require("child_process");
5
+ const sqlBuiltInAdapters_1 = require("./sqlBuiltInAdapters");
6
+ function isRowsResult(value) {
7
+ if (!value || typeof value !== 'object' || Array.isArray(value)) {
8
+ return false;
9
+ }
10
+ const candidate = value;
11
+ return candidate.kind === 'rows' && Array.isArray(candidate.rows);
12
+ }
13
+ function isExecResult(value) {
14
+ if (!value || typeof value !== 'object' || Array.isArray(value)) {
15
+ return false;
16
+ }
17
+ const candidate = value;
18
+ return candidate.kind === 'exec';
19
+ }
20
+ function isSqlAdapterResponse(value) {
21
+ if (!value || typeof value !== 'object' || Array.isArray(value)) {
22
+ return false;
23
+ }
24
+ const candidate = value;
25
+ if (candidate.success === true) {
26
+ return isRowsResult(candidate.result) || isExecResult(candidate.result);
27
+ }
28
+ return candidate.success === false && typeof candidate.error === 'string';
29
+ }
30
+ function buildAdapterError(message, stderr, stdout) {
31
+ const details = [message];
32
+ if (stderr.trim()) {
33
+ details.push(`stderr: ${stderr.trim()}`);
34
+ }
35
+ if (stdout.trim()) {
36
+ details.push(`stdout: ${stdout.trim()}`);
37
+ }
38
+ return new Error(details.join('\n'));
39
+ }
40
+ async function runExternalSqlAdapter(command, request, workingDir) {
41
+ if (!command.length) {
42
+ throw new Error('SQL adapter command is empty');
43
+ }
44
+ return new Promise((resolve, reject) => {
45
+ const child = (0, child_process_1.spawn)(command[0], command.slice(1), {
46
+ cwd: workingDir,
47
+ env: process.env,
48
+ shell: false
49
+ });
50
+ let stdout = '';
51
+ let stderr = '';
52
+ let settled = false;
53
+ const fail = (error) => {
54
+ if (settled) {
55
+ return;
56
+ }
57
+ settled = true;
58
+ reject(error);
59
+ };
60
+ const succeed = (response) => {
61
+ if (settled) {
62
+ return;
63
+ }
64
+ settled = true;
65
+ resolve(response);
66
+ };
67
+ child.stdout.on('data', chunk => {
68
+ stdout += chunk.toString();
69
+ });
70
+ child.stderr.on('data', chunk => {
71
+ stderr += chunk.toString();
72
+ });
73
+ child.on('error', error => {
74
+ fail(new Error(`Failed to start SQL adapter '${command[0]}': ${error.message}`));
75
+ });
76
+ child.on('close', code => {
77
+ if (settled) {
78
+ return;
79
+ }
80
+ let parsed;
81
+ if (stdout.trim()) {
82
+ try {
83
+ parsed = JSON.parse(stdout);
84
+ }
85
+ catch (error) {
86
+ fail(buildAdapterError(`SQL adapter returned invalid JSON${code && code !== 0 ? ` (exit ${code})` : ''}`, stderr, stdout));
87
+ return;
88
+ }
89
+ }
90
+ if (!isSqlAdapterResponse(parsed)) {
91
+ fail(buildAdapterError(`SQL adapter returned an invalid response${code && code !== 0 ? ` (exit ${code})` : ''}`, stderr, stdout));
92
+ return;
93
+ }
94
+ if (!parsed.success) {
95
+ fail(buildAdapterError(parsed.error, stderr, stdout));
96
+ return;
97
+ }
98
+ if (code !== 0) {
99
+ fail(buildAdapterError(`SQL adapter exited with code ${code}`, stderr, stdout));
100
+ return;
101
+ }
102
+ succeed(parsed);
103
+ });
104
+ child.stdin.on('error', error => {
105
+ fail(new Error(`Failed to write SQL adapter input: ${error.message}`));
106
+ });
107
+ try {
108
+ child.stdin.write(JSON.stringify(request));
109
+ child.stdin.end();
110
+ }
111
+ catch (error) {
112
+ fail(new Error(`Failed to serialize SQL adapter input: ${error instanceof Error ? error.message : String(error)}`));
113
+ }
114
+ });
115
+ }
116
+ async function runSqlAdapter(target, request, workingDir) {
117
+ if (target.kind === 'builtin') {
118
+ return (0, sqlBuiltInAdapters_1.runBuiltInSqlAdapter)(target.adapterId, request);
119
+ }
120
+ return runExternalSqlAdapter(target.command, request, workingDir);
121
+ }
122
+ //# sourceMappingURL=sqlAdapterRunner.js.map