codebuff 1.0.274 → 1.0.275

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 (124) hide show
  1. package/dist/cli-handlers/initialization-flow.d.ts +1 -0
  2. package/dist/cli-handlers/initialization-flow.js +24 -0
  3. package/dist/cli-handlers/initialization-flow.js.map +1 -0
  4. package/dist/cli-modules/command-processor.d.ts +12 -0
  5. package/dist/cli-modules/command-processor.js +129 -0
  6. package/dist/cli-modules/command-processor.js.map +1 -0
  7. package/dist/cli-modules/input-handler.d.ts +20 -0
  8. package/dist/cli-modules/input-handler.js +98 -0
  9. package/dist/cli-modules/input-handler.js.map +1 -0
  10. package/dist/cli-modules/readline-handler.d.ts +17 -0
  11. package/dist/cli-modules/readline-handler.js +134 -0
  12. package/dist/cli-modules/readline-handler.js.map +1 -0
  13. package/dist/cli-modules/signal-handler.d.ts +13 -0
  14. package/dist/cli-modules/signal-handler.js +69 -0
  15. package/dist/cli-modules/signal-handler.js.map +1 -0
  16. package/dist/cli-modules/types.d.ts +51 -0
  17. package/dist/cli-modules/types.js +3 -0
  18. package/dist/cli-modules/types.js.map +1 -0
  19. package/dist/cli-modules/websocket-handler.d.ts +16 -0
  20. package/dist/cli-modules/websocket-handler.js +53 -0
  21. package/dist/cli-modules/websocket-handler.js.map +1 -0
  22. package/dist/code-map/__mocks__/tree-sitter-typescript.d.ts +12 -0
  23. package/dist/code-map/__mocks__/tree-sitter-typescript.d.ts.map +1 -0
  24. package/dist/code-map/__mocks__/tree-sitter-typescript.js +14 -0
  25. package/dist/code-map/__mocks__/tree-sitter-typescript.js.map +1 -0
  26. package/dist/code-map/__mocks__/wasm-mock.d.ts +2 -0
  27. package/dist/code-map/__mocks__/wasm-mock.d.ts.map +1 -0
  28. package/dist/code-map/__mocks__/wasm-mock.js +3 -0
  29. package/dist/code-map/__mocks__/wasm-mock.js.map +1 -0
  30. package/dist/code-map/__tests__/parse.test.d.ts +2 -0
  31. package/dist/code-map/__tests__/parse.test.d.ts.map +1 -0
  32. package/dist/code-map/__tests__/parse.test.js +231 -0
  33. package/dist/code-map/__tests__/parse.test.js.map +1 -0
  34. package/dist/code-map/__tests__/test-langs/consumer.d.ts +2 -0
  35. package/dist/code-map/__tests__/test-langs/consumer.d.ts.map +1 -0
  36. package/dist/code-map/__tests__/test-langs/consumer.js +6 -0
  37. package/dist/code-map/__tests__/test-langs/consumer.js.map +1 -0
  38. package/dist/code-map/__tests__/test-langs/empty.d.ts +1 -0
  39. package/dist/code-map/__tests__/test-langs/empty.d.ts.map +1 -0
  40. package/dist/code-map/__tests__/test-langs/empty.js +2 -0
  41. package/dist/code-map/__tests__/test-langs/empty.js.map +1 -0
  42. package/dist/code-map/__tests__/test-langs/test.d.ts +12 -0
  43. package/dist/code-map/__tests__/test-langs/test.d.ts.map +1 -0
  44. package/dist/code-map/__tests__/test-langs/test.js +23 -0
  45. package/dist/code-map/__tests__/test-langs/test.js.map +1 -0
  46. package/dist/code-map/__tests__/test-langs/unused.d.ts +2 -0
  47. package/dist/code-map/__tests__/test-langs/unused.d.ts.map +1 -0
  48. package/dist/code-map/__tests__/test-langs/unused.js +7 -0
  49. package/dist/code-map/__tests__/test-langs/unused.js.map +1 -0
  50. package/dist/code-map/__tests__/test-langs/utils1.d.ts +2 -0
  51. package/dist/code-map/__tests__/test-langs/utils1.d.ts.map +1 -0
  52. package/dist/code-map/__tests__/test-langs/utils1.js +7 -0
  53. package/dist/code-map/__tests__/test-langs/utils1.js.map +1 -0
  54. package/dist/code-map/__tests__/test-langs/utils2.d.ts +2 -0
  55. package/dist/code-map/__tests__/test-langs/utils2.d.ts.map +1 -0
  56. package/dist/code-map/__tests__/test-langs/utils2.js +8 -0
  57. package/dist/code-map/__tests__/test-langs/utils2.js.map +1 -0
  58. package/dist/code-map/__tests__/tree-sitter-minimal.test.d.ts +2 -0
  59. package/dist/code-map/__tests__/tree-sitter-minimal.test.d.ts.map +1 -0
  60. package/dist/code-map/__tests__/tree-sitter-minimal.test.js +79 -0
  61. package/dist/code-map/__tests__/tree-sitter-minimal.test.js.map +1 -0
  62. package/dist/code-map/jest.config.d.ts +4 -0
  63. package/dist/code-map/jest.config.d.ts.map +1 -0
  64. package/dist/code-map/jest.config.js +18 -0
  65. package/dist/code-map/jest.config.js.map +1 -0
  66. package/dist/code-map/parse.test.d.ts +2 -0
  67. package/dist/code-map/parse.test.d.ts.map +1 -0
  68. package/dist/code-map/parse.test.js +218 -0
  69. package/dist/code-map/parse.test.js.map +1 -0
  70. package/dist/code-map/scripts/tree-sitter-test.cjs +27 -0
  71. package/dist/code-map/scripts/tree-sitter-test.cjs.map +1 -0
  72. package/dist/code-map/scripts/tree-sitter-test.d.cts +2 -0
  73. package/dist/code-map/scripts/tree-sitter-test.d.cts.map +1 -0
  74. package/dist/code-map/scripts/tree-sitter-test.d.ts +2 -0
  75. package/dist/code-map/scripts/tree-sitter-test.d.ts.map +1 -0
  76. package/dist/code-map/scripts/tree-sitter-test.js +54 -0
  77. package/dist/code-map/scripts/tree-sitter-test.js.map +1 -0
  78. package/dist/code-map/test-parser.d.ts +2 -0
  79. package/dist/code-map/test-parser.d.ts.map +1 -0
  80. package/dist/code-map/test-parser.js +42 -0
  81. package/dist/code-map/test-parser.js.map +1 -0
  82. package/dist/code-map/tsconfig.tsbuildinfo +1 -1
  83. package/dist/common/actions.d.ts +28 -28
  84. package/dist/common/bigquery/client.d.ts +15 -0
  85. package/dist/common/bigquery/client.js +265 -0
  86. package/dist/common/bigquery/client.js.map +1 -0
  87. package/dist/common/bigquery/schema.d.ts +55 -0
  88. package/dist/common/bigquery/schema.js +24 -0
  89. package/dist/common/bigquery/schema.js.map +1 -0
  90. package/dist/common/constants/tools.d.ts +1 -0
  91. package/dist/common/constants/tools.js +1 -0
  92. package/dist/common/constants/tools.js.map +1 -1
  93. package/dist/common/util/file-metadata.d.ts +9 -0
  94. package/dist/common/util/file-metadata.js +24 -0
  95. package/dist/common/util/file-metadata.js.map +1 -0
  96. package/dist/common/util/promise.js +1 -1
  97. package/dist/common/util/promise.js.map +1 -1
  98. package/dist/common/websockets/websocket-schema.d.ts +48 -48
  99. package/dist/index.js +2 -8
  100. package/dist/tool-handlers.js +3 -0
  101. package/dist/tool-handlers.js.map +1 -1
  102. package/dist/utils/tool-renderers.js +3 -0
  103. package/dist/utils/tool-renderers.js.map +1 -1
  104. package/package.json +1 -1
  105. package/dist/common/__tests__/project-file-tree.test.d.ts +0 -1
  106. package/dist/common/__tests__/project-file-tree.test.js +0 -251
  107. package/dist/common/__tests__/project-file-tree.test.js.map +0 -1
  108. package/dist/common/json-config/__tests__/__snapshots__/stringify-schema.test.js.snap +0 -119
  109. package/dist/common/util/process-stream.d.ts +0 -7
  110. package/dist/common/util/process-stream.js +0 -162
  111. package/dist/common/util/process-stream.js.map +0 -1
  112. package/dist/utils/__tests__/__snapshots__/background-process-manager.test.js.snap +0 -137
  113. package/dist/utils/__tests__/file-paths.test.d.ts +0 -1
  114. package/dist/utils/__tests__/file-paths.test.js +0 -37
  115. package/dist/utils/__tests__/file-paths.test.js.map +0 -1
  116. package/dist/utils/__tests__/path.test.d.ts +0 -1
  117. package/dist/utils/__tests__/path.test.js +0 -37
  118. package/dist/utils/__tests__/path.test.js.map +0 -1
  119. package/dist/utils/file-paths.d.ts +0 -9
  120. package/dist/utils/file-paths.js +0 -24
  121. package/dist/utils/file-paths.js.map +0 -1
  122. package/dist/utils/path.d.ts +0 -9
  123. package/dist/utils/path.js +0 -27
  124. package/dist/utils/path.js.map +0 -1
@@ -1,251 +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 (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- // @ts-ignore
30
- const bun_test_1 = require("bun:test");
31
- const path_1 = __importDefault(require("path"));
32
- const memfs_1 = require("memfs");
33
- // Mock fs to use memfs's vol directly
34
- bun_test_1.mock.module('fs', () => ({
35
- existsSync: (path) => memfs_1.vol.existsSync(path),
36
- readFileSync: (path, options) => memfs_1.vol.readFileSync(path, options),
37
- }));
38
- // Import fs after mocking to get the mocked version
39
- const fs_1 = __importDefault(require("fs"));
40
- const projectFileTreeModule = __importStar(require("../project-file-tree"));
41
- const project_file_tree_1 = require("../project-file-tree");
42
- // Basic memfs check
43
- (0, bun_test_1.it)('memfs basic check', () => {
44
- memfs_1.vol.reset();
45
- memfs_1.vol.fromJSON({ '/testfile.txt': 'content' });
46
- (0, bun_test_1.expect)(fs_1.default.existsSync('/testfile.txt')).toBe(true);
47
- (0, bun_test_1.expect)(fs_1.default.readFileSync('/testfile.txt', 'utf8')).toBe('content');
48
- });
49
- (0, bun_test_1.describe)('parseGitignore', () => {
50
- const projectRoot = '/project';
51
- (0, bun_test_1.it)('handles empty .gitignore', () => {
52
- memfs_1.vol.reset();
53
- memfs_1.vol.fromJSON({
54
- '/project/.gitignore': '',
55
- });
56
- const ig = (0, project_file_tree_1.parseGitignore)(projectRoot, projectRoot);
57
- (0, bun_test_1.expect)(ig.ignores('file.txt')).toBe(false);
58
- });
59
- (0, bun_test_1.it)('ignores comments and blank lines', () => {
60
- memfs_1.vol.reset();
61
- memfs_1.vol.fromJSON({
62
- '/project/.gitignore': `
63
- # This is a comment
64
-
65
- # Another comment
66
- `,
67
- });
68
- const ig = (0, project_file_tree_1.parseGitignore)(projectRoot, projectRoot);
69
- (0, bun_test_1.expect)(ig.ignores('file.txt')).toBe(false);
70
- });
71
- (0, bun_test_1.it)('handles simple file patterns', () => {
72
- memfs_1.vol.reset();
73
- memfs_1.vol.fromJSON({
74
- '/project/.gitignore': `
75
- file.txt
76
- *.log
77
- `,
78
- });
79
- const ig = (0, project_file_tree_1.parseGitignore)(projectRoot, projectRoot);
80
- (0, bun_test_1.expect)(ig.ignores('file.txt')).toBe(true);
81
- (0, bun_test_1.expect)(ig.ignores('debug.log')).toBe(true);
82
- (0, bun_test_1.expect)(ig.ignores('src/error.log')).toBe(true);
83
- (0, bun_test_1.expect)(ig.ignores('other.txt')).toBe(false);
84
- });
85
- (0, bun_test_1.it)('handles directory patterns', () => {
86
- memfs_1.vol.reset();
87
- memfs_1.vol.fromJSON({
88
- '/project/.gitignore': 'build/',
89
- });
90
- const ig = (0, project_file_tree_1.parseGitignore)(projectRoot, projectRoot);
91
- (0, bun_test_1.expect)(ig.ignores('build/output.js')).toBe(true);
92
- (0, bun_test_1.expect)(ig.ignores('src/build/output.js')).toBe(true);
93
- (0, bun_test_1.expect)(ig.ignores('building.js')).toBe(false);
94
- });
95
- (0, bun_test_1.it)('handles root-anchored patterns in root .gitignore', () => {
96
- memfs_1.vol.reset();
97
- memfs_1.vol.fromJSON({
98
- '/project/.gitignore': '/config.js',
99
- });
100
- const ig = (0, project_file_tree_1.parseGitignore)(projectRoot, projectRoot);
101
- (0, bun_test_1.expect)(ig.ignores('config.js')).toBe(true);
102
- (0, bun_test_1.expect)(ig.ignores('src/config.js')).toBe(false);
103
- });
104
- (0, bun_test_1.it)('handles root-anchored patterns in subdirectory .gitignore', () => {
105
- memfs_1.vol.reset();
106
- memfs_1.vol.fromJSON({
107
- '/project/src/.gitignore': '/config.js',
108
- });
109
- const ig = (0, project_file_tree_1.parseGitignore)(path_1.default.join(projectRoot, 'src'), projectRoot);
110
- (0, bun_test_1.expect)(ig.ignores('config.js')).toBe(true);
111
- (0, bun_test_1.expect)(ig.ignores('src/config.js')).toBe(false);
112
- });
113
- (0, bun_test_1.it)('handles negation patterns', () => {
114
- memfs_1.vol.reset();
115
- memfs_1.vol.fromJSON({
116
- '/project/.gitignore': `
117
- *.log
118
- !important.log
119
- `,
120
- });
121
- const ig = (0, project_file_tree_1.parseGitignore)(projectRoot, projectRoot);
122
- (0, bun_test_1.expect)(ig.ignores('debug.log')).toBe(true);
123
- (0, bun_test_1.expect)(ig.ignores('important.log')).toBe(false);
124
- });
125
- (0, bun_test_1.it)('handles patterns with leading/trailing whitespace', () => {
126
- memfs_1.vol.reset();
127
- memfs_1.vol.fromJSON({
128
- '/project/.gitignore': `
129
- \t file.txt \t
130
- \t *.log \t
131
- `,
132
- });
133
- const ig = (0, project_file_tree_1.parseGitignore)(projectRoot, projectRoot);
134
- (0, bun_test_1.expect)(ig.ignores('file.txt')).toBe(true);
135
- (0, bun_test_1.expect)(ig.ignores('debug.log')).toBe(true);
136
- });
137
- (0, bun_test_1.it)('handles .codebuffignore and .manicodeignore', () => {
138
- memfs_1.vol.reset();
139
- memfs_1.vol.fromJSON({
140
- '/project/.codebuffignore': 'codebuff.log',
141
- '/project/.manicodeignore': 'manicode.log',
142
- });
143
- const ig = (0, project_file_tree_1.parseGitignore)(projectRoot, projectRoot);
144
- (0, bun_test_1.expect)(ig.ignores('codebuff.log')).toBe(true);
145
- (0, bun_test_1.expect)(ig.ignores('manicode.log')).toBe(true);
146
- (0, bun_test_1.expect)(ig.ignores('other.log')).toBe(false);
147
- });
148
- (0, bun_test_1.it)('handles multiple ignore files in the same directory', () => {
149
- memfs_1.vol.reset();
150
- memfs_1.vol.fromJSON({
151
- '/project/.gitignore': 'git.log',
152
- '/project/.codebuffignore': 'codebuff.log',
153
- '/project/.manicodeignore': '!git.log', // Should not un-ignore git.log
154
- });
155
- const ig = (0, project_file_tree_1.parseGitignore)(projectRoot, projectRoot);
156
- (0, bun_test_1.expect)(ig.ignores('git.log')).toBe(true);
157
- (0, bun_test_1.expect)(ig.ignores('codebuff.log')).toBe(true);
158
- });
159
- (0, bun_test_1.it)('handles Windows-style backslashes', () => {
160
- memfs_1.vol.reset();
161
- memfs_1.vol.fromJSON({
162
- '/project/.gitignore': 'src\\build\\output.js',
163
- });
164
- const ig = (0, project_file_tree_1.parseGitignore)(projectRoot, projectRoot);
165
- (0, bun_test_1.expect)(ig.ignores('src/build/output.js')).toBe(true);
166
- });
167
- (0, bun_test_1.it)('handles patterns relative to subdirectory .gitignore', () => {
168
- memfs_1.vol.reset();
169
- memfs_1.vol.fromJSON({
170
- '/project/src/.gitignore': 'build/',
171
- });
172
- const ig = (0, project_file_tree_1.parseGitignore)(path_1.default.join(projectRoot, 'src'), projectRoot);
173
- (0, bun_test_1.expect)(ig.ignores('src/build/output.js')).toBe(true);
174
- (0, bun_test_1.expect)(ig.ignores('build/output.js')).toBe(false);
175
- });
176
- (0, bun_test_1.it)('calls fs.existsSync and fs.readFileSync for each ignore file', () => {
177
- memfs_1.vol.reset();
178
- memfs_1.vol.fromJSON({
179
- '/project/.gitignore': 'git.log',
180
- '/project/.codebuffignore': 'codebuff.log',
181
- });
182
- const existsSpy = bun_test_1.mock.spyOn(fs_1.default, 'existsSync');
183
- const readSpy = bun_test_1.mock.spyOn(fs_1.default, 'readFileSync');
184
- (0, project_file_tree_1.parseGitignore)(projectRoot, projectRoot);
185
- // Should check for all three possible ignore files
186
- (0, bun_test_1.expect)(existsSpy).toHaveBeenCalledTimes(3);
187
- (0, bun_test_1.expect)(existsSpy).toHaveBeenCalledWith(path_1.default.join(projectRoot, '.gitignore'));
188
- (0, bun_test_1.expect)(existsSpy).toHaveBeenCalledWith(path_1.default.join(projectRoot, '.codebuffignore'));
189
- (0, bun_test_1.expect)(existsSpy).toHaveBeenCalledWith(path_1.default.join(projectRoot, '.manicodeignore'));
190
- // Should read the two files that exist
191
- (0, bun_test_1.expect)(readSpy).toHaveBeenCalledTimes(2);
192
- (0, bun_test_1.expect)(readSpy).toHaveBeenCalledWith(path_1.default.join(projectRoot, '.gitignore'), 'utf8');
193
- (0, bun_test_1.expect)(readSpy).toHaveBeenCalledWith(path_1.default.join(projectRoot, '.codebuffignore'), 'utf8');
194
- existsSpy.mockRestore();
195
- readSpy.mockRestore();
196
- });
197
- });
198
- (0, bun_test_1.describe)('isFileIgnored', () => {
199
- const projectRoot = '/project';
200
- (0, bun_test_1.it)('aggregates ignore rules from parent directories', () => {
201
- memfs_1.vol.reset();
202
- memfs_1.vol.fromJSON({
203
- '/project/.gitignore': '*.log',
204
- '/project/src/.gitignore': 'build/',
205
- '/project/src/frontend/.gitignore': '*.min.js',
206
- });
207
- const parseGitignoreSpy = bun_test_1.mock.spyOn(projectFileTreeModule, 'parseGitignore');
208
- // Root .gitignore pattern
209
- (0, bun_test_1.expect)((0, project_file_tree_1.isFileIgnored)('debug.log', projectRoot)).toBe(true);
210
- (0, bun_test_1.expect)((0, project_file_tree_1.isFileIgnored)('src/error.log', projectRoot)).toBe(true);
211
- // src/.gitignore pattern
212
- (0, bun_test_1.expect)((0, project_file_tree_1.isFileIgnored)('src/build/output.js', projectRoot)).toBe(true);
213
- (0, bun_test_1.expect)((0, project_file_tree_1.isFileIgnored)('other/build/output.js', projectRoot)).toBe(false);
214
- // src/frontend/.gitignore pattern
215
- (0, bun_test_1.expect)((0, project_file_tree_1.isFileIgnored)('src/frontend/app.min.js', projectRoot)).toBe(true);
216
- (0, bun_test_1.expect)((0, project_file_tree_1.isFileIgnored)('src/frontend/app.js', projectRoot)).toBe(false);
217
- // Should call parseGitignore for each directory up to root
218
- (0, bun_test_1.expect)(parseGitignoreSpy).toHaveBeenCalledTimes(3);
219
- parseGitignoreSpy.mockRestore();
220
- });
221
- (0, bun_test_1.it)('handles root-anchored patterns in subdirectories', () => {
222
- memfs_1.vol.reset();
223
- memfs_1.vol.fromJSON({
224
- '/project/src/.gitignore': '/config.js',
225
- });
226
- (0, bun_test_1.expect)((0, project_file_tree_1.isFileIgnored)('config.js', projectRoot)).toBe(true);
227
- (0, bun_test_1.expect)((0, project_file_tree_1.isFileIgnored)('src/config.js', projectRoot)).toBe(false);
228
- });
229
- (0, bun_test_1.it)('handles negation patterns across directories', () => {
230
- memfs_1.vol.reset();
231
- memfs_1.vol.fromJSON({
232
- '/project/.gitignore': '*.log',
233
- '/project/src/.gitignore': '!important.log',
234
- });
235
- (0, bun_test_1.expect)((0, project_file_tree_1.isFileIgnored)('debug.log', projectRoot)).toBe(true);
236
- (0, bun_test_1.expect)((0, project_file_tree_1.isFileIgnored)('src/important.log', projectRoot)).toBe(false);
237
- });
238
- (0, bun_test_1.it)('handles multiple ignore files in the same directory', () => {
239
- memfs_1.vol.reset();
240
- memfs_1.vol.fromJSON({
241
- '/project/src/.gitignore': 'git.log',
242
- '/project/src/.codebuffignore': 'codebuff.log',
243
- '/project/src/.manicodeignore': 'manicode.log',
244
- });
245
- (0, bun_test_1.expect)((0, project_file_tree_1.isFileIgnored)('src/git.log', projectRoot)).toBe(true);
246
- (0, bun_test_1.expect)((0, project_file_tree_1.isFileIgnored)('src/codebuff.log', projectRoot)).toBe(true);
247
- (0, bun_test_1.expect)((0, project_file_tree_1.isFileIgnored)('src/manicode.log', projectRoot)).toBe(true);
248
- (0, bun_test_1.expect)((0, project_file_tree_1.isFileIgnored)('src/other.log', projectRoot)).toBe(false);
249
- });
250
- });
251
- //# sourceMappingURL=project-file-tree.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"project-file-tree.test.js","sourceRoot":"","sources":["../../src/__tests__/project-file-tree.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,aAAa;AACb,uCAAqD;AACrD,g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
- {
6
- // A user-friendly name for the process. Should be one word and unique.
7
- "name": string,
8
-
9
- // The actual shell command to execute.
10
- "command": string,
11
-
12
- // (optional): The working directory from which to run the command.
13
- "cwd": string | undefined,
14
-
15
- // (optional): Whether this process should be run, default: true
16
- "enabled": boolean | undefined,
17
-
18
- // (optional): Path to write the process's stdout. If not specified, stderr is not stored.
19
- "stdoutFile": string | undefined,
20
-
21
- // (optional): Path to write the process's stderr. If not specified, stderr will be put into the stdoutFile.
22
- "stderrFile": string | undefined
23
- }"
24
- `;
25
-
26
- exports[`stringifySchema should correctly stringify CodebuffConfigSchema 1`] = `
27
- "// Defines the overall Codebuff configuration file (e.g., codebuff.json). This schema defines the top-level structure of the configuration.
28
- {
29
- // (optional): Does nothing. Put any thing you want here!
30
- "description": any | undefined,
31
-
32
- // (optional): An array of startup processes.
33
- "startupProcesses": [
34
-
35
- // Defines a single startup process.
36
- {
37
- // A user-friendly name for the process. Should be one word and unique.
38
- "name": string,
39
-
40
- // The actual shell command to execute.
41
- "command": string,
42
-
43
- // (optional): The working directory from which to run the command.
44
- "cwd": string | undefined,
45
-
46
- // (optional): Whether this process should be run, default: true
47
- "enabled": boolean | undefined,
48
-
49
- // (optional): Path to write the process's stdout. If not specified, stderr is not stored.
50
- "stdoutFile": string | undefined,
51
-
52
- // (optional): Path to write the process's stderr. If not specified, stderr will be put into the stdoutFile.
53
- "stderrFile": string | undefined
54
- }
55
- ] | undefined
56
- }"
57
- `;
58
-
59
- exports[`stringifySchema should handle a more complex schema 1`] = `
60
- "// A complex test schema
61
- {
62
- // Unique identifier
63
- "id": string,
64
-
65
- // A positive integer count
66
- "count": number,
67
-
68
- // Activity status
69
- "isActive": boolean,
70
-
71
- // (optional): Optional list of tags
72
- "tags": [
73
-
74
- string
75
- ] | undefined,
76
-
77
- // A nested object structure
78
- "nested": {
79
- "value": string,
80
-
81
- // Nested configuration
82
- "config": {
83
- // (optional): Number of retries, default: 3
84
- "retries": number
85
- }
86
- }
87
- }"
88
- `;
89
-
90
- exports[`stringifySchema should handle an empty object schema 1`] = `
91
- "// An empty schema
92
- {
93
- }"
94
- `;
95
-
96
- exports[`stringifySchema should handle schema with only optional fields 1`] = `
97
- "// Schema with only optional fields
98
- {
99
- // (optional): Optional field 1
100
- "field1": string | undefined,
101
-
102
- // (optional): Optional field 2
103
- "field2": number | undefined
104
- }"
105
- `;
106
-
107
- exports[`stringifySchema should handle schema with default values 1`] = `
108
- "// Schema demonstrating default values
109
- {
110
- // (optional): Name with default, default: "anonymous"
111
- "name": string,
112
-
113
- // (optional): Level with default, default: 1
114
- "level": number,
115
-
116
- // (optional): Enabled with default, default: false
117
- "enabled": boolean
118
- }"
119
- `;
@@ -1,7 +0,0 @@
1
- export declare function processStreamWithTags<T extends string>(stream: AsyncGenerator<T>, tags: {
2
- [tagName: string]: {
3
- attributeNames: string[];
4
- onTagStart: (attributes: Record<string, string>) => void;
5
- onTagEnd: (content: string, attributes: Record<string, string>) => boolean;
6
- };
7
- }): AsyncGenerator<string, void, unknown>;
@@ -1,162 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.processStreamWithTags = processStreamWithTags;
4
- const saxy_1 = require("./saxy");
5
- async function* processStreamWithTags(stream, tags) {
6
- const saxyParser = new saxy_1.Saxy();
7
- let currentTagName = null;
8
- let currentTagAttributes = {};
9
- let currentTagContentBuffer = '';
10
- let shouldStopProcessing = false;
11
- const outputQueue = [];
12
- const enqueueOutput = (str) => {
13
- if (str) {
14
- // Only enqueue non-empty strings
15
- outputQueue.push(str);
16
- }
17
- };
18
- saxyParser.on('tagopen', (node) => {
19
- if (shouldStopProcessing)
20
- return;
21
- if (currentTagName === null) {
22
- // Not currently inside a tracked tag
23
- if (tags[node.name]) {
24
- // This is a tag we want to track
25
- currentTagName = node.name;
26
- try {
27
- currentTagAttributes = saxy_1.Saxy.parseAttrs(node.attrs);
28
- }
29
- catch (e) {
30
- // If attributes are malformed, default to empty or handle as error
31
- // console.error(`Error parsing attributes for tag ${node.name}: "${node.attrs}"`, e);
32
- currentTagAttributes = {}; // Default to empty attributes on parsing error
33
- }
34
- tags[currentTagName].onTagStart(currentTagAttributes);
35
- currentTagContentBuffer = '';
36
- if (node.isSelfClosing) {
37
- const stop = tags[currentTagName].onTagEnd(currentTagContentBuffer, currentTagAttributes);
38
- currentTagName = null;
39
- currentTagAttributes = {};
40
- if (stop) {
41
- shouldStopProcessing = true;
42
- }
43
- }
44
- }
45
- else {
46
- // A non-tracked tag, pass it through
47
- enqueueOutput(`<${node.name}${node.attrs ? ' ' + node.attrs : ''}${node.isSelfClosing ? ' /' : ''}>`);
48
- }
49
- }
50
- else {
51
- // Inside a tracked tag, so this is nested content
52
- currentTagContentBuffer += `<${node.name}${node.attrs ? ' ' + node.attrs : ''}${node.isSelfClosing ? ' /' : ''}>`;
53
- }
54
- });
55
- saxyParser.on('text', (node) => {
56
- if (shouldStopProcessing)
57
- return;
58
- if (currentTagName !== null) {
59
- currentTagContentBuffer += node.contents;
60
- }
61
- else {
62
- enqueueOutput(node.contents);
63
- }
64
- });
65
- saxyParser.on('tagclose', (node) => {
66
- if (shouldStopProcessing)
67
- return;
68
- if (currentTagName === node.name) {
69
- const stop = tags[currentTagName].onTagEnd(currentTagContentBuffer, currentTagAttributes);
70
- currentTagName = null;
71
- currentTagAttributes = {};
72
- currentTagContentBuffer = '';
73
- if (stop) {
74
- shouldStopProcessing = true;
75
- }
76
- }
77
- else if (currentTagName !== null) {
78
- // Closing a nested tag inside a tracked tag
79
- currentTagContentBuffer += `</${node.name}>`;
80
- }
81
- else {
82
- // Closing a non-tracked tag, pass it through
83
- enqueueOutput(`</${node.name}>`);
84
- }
85
- });
86
- saxyParser.on('cdata', (node) => {
87
- if (shouldStopProcessing)
88
- return;
89
- const cdataStr = `<![CDATA[${node.contents}]]>`;
90
- if (currentTagName !== null) {
91
- currentTagContentBuffer += cdataStr;
92
- }
93
- else {
94
- enqueueOutput(cdataStr);
95
- }
96
- });
97
- saxyParser.on('comment', (node) => {
98
- if (shouldStopProcessing)
99
- return;
100
- const commentStr = `<!--${node.contents}-->`;
101
- if (currentTagName !== null) {
102
- currentTagContentBuffer += commentStr;
103
- }
104
- else {
105
- enqueueOutput(commentStr);
106
- }
107
- });
108
- saxyParser.on('processinginstruction', (node) => {
109
- if (shouldStopProcessing)
110
- return;
111
- const piStr = `<?${node.contents}?>`;
112
- if (currentTagName !== null) {
113
- currentTagContentBuffer += piStr;
114
- }
115
- else {
116
- enqueueOutput(piStr);
117
- }
118
- });
119
- saxyParser.on('error', (err) => {
120
- // Saxy might emit 'error' for issues not causing write/end to throw.
121
- // This flag helps stop processing in such cases.
122
- // console.error("Saxy parser emitted an error:", err);
123
- shouldStopProcessing = true;
124
- // The error might need to be explicitly thrown here if it's critical
125
- // and not otherwise surfaced to the generator's caller.
126
- // For now, this ensures processing stops.
127
- });
128
- try {
129
- for await (const chunk of stream) {
130
- if (shouldStopProcessing)
131
- break;
132
- saxyParser.write(chunk); // Saxy events fill outputQueue
133
- while (outputQueue.length > 0) {
134
- // If stopping and not inside a tracked tag, clear queue to prevent further passthrough.
135
- if (shouldStopProcessing && currentTagName === null) {
136
- outputQueue.length = 0;
137
- break;
138
- }
139
- yield outputQueue.shift();
140
- }
141
- // Re-check stop condition after yielding, as an event during write might have set it.
142
- if (shouldStopProcessing)
143
- break;
144
- }
145
- if (!shouldStopProcessing) {
146
- saxyParser.end(); // Finalize parsing
147
- while (outputQueue.length > 0) {
148
- if (shouldStopProcessing && currentTagName === null) {
149
- outputQueue.length = 0;
150
- break;
151
- }
152
- yield outputQueue.shift();
153
- }
154
- }
155
- }
156
- catch (error) {
157
- // Catches errors from saxyParser.write() or saxyParser.end()
158
- // console.error("Error during Saxy stream processing in generator:", error);
159
- throw error; // Propagate error to the caller
160
- }
161
- }
162
- //# sourceMappingURL=process-stream.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"process-stream.js","sourceRoot":"","sources":["../../src/util/process-stream.ts"],"names":[],"mappings":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