codebuff 1.0.233 → 1.0.234

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 (130) hide show
  1. package/dist/code-map/tsconfig.tsbuildinfo +1 -1
  2. package/dist/common/json-config/__tests__/__snapshots__/stringify-schema.test.js.snap +66 -0
  3. package/dist/common/types/usage.d.ts +4 -4
  4. package/package.json +1 -1
  5. package/dist/background-process-manager.d.ts +0 -50
  6. package/dist/background-process-manager.js +0 -320
  7. package/dist/background-process-manager.js.map +0 -1
  8. package/dist/browser-runner.d.ts +0 -35
  9. package/dist/browser-runner.js +0 -680
  10. package/dist/browser-runner.js.map +0 -1
  11. package/dist/chat-storage.d.ts +0 -2
  12. package/dist/chat-storage.js +0 -93
  13. package/dist/chat-storage.js.map +0 -1
  14. package/dist/checkpoints/checkpoint-manager.d.ts +0 -94
  15. package/dist/checkpoints/checkpoint-manager.js +0 -280
  16. package/dist/checkpoints/checkpoint-manager.js.map +0 -1
  17. package/dist/checkpoints/file-manager.d.ts +0 -72
  18. package/dist/checkpoints/file-manager.js +0 -311
  19. package/dist/checkpoints/file-manager.js.map +0 -1
  20. package/dist/cli-handlers/api-key.d.ts +0 -25
  21. package/dist/cli-handlers/api-key.js +0 -66
  22. package/dist/cli-handlers/api-key.js.map +0 -1
  23. package/dist/cli-handlers/checkpoint.d.ts +0 -18
  24. package/dist/cli-handlers/checkpoint.js +0 -195
  25. package/dist/cli-handlers/checkpoint.js.map +0 -1
  26. package/dist/cli-handlers/diff.d.ts +0 -2
  27. package/dist/cli-handlers/diff.js +0 -31
  28. package/dist/cli-handlers/diff.js.map +0 -1
  29. package/dist/cli-handlers/easter-egg.d.ts +0 -1
  30. package/dist/cli-handlers/easter-egg.js +0 -126
  31. package/dist/cli-handlers/easter-egg.js.map +0 -1
  32. package/dist/cli-handlers/inititalization-flow.d.ts +0 -1
  33. package/dist/cli-handlers/inititalization-flow.js +0 -24
  34. package/dist/cli-handlers/inititalization-flow.js.map +0 -1
  35. package/dist/cli.d.ts +0 -42
  36. package/dist/cli.js +0 -451
  37. package/dist/cli.js.map +0 -1
  38. package/dist/client.d.ts +0 -139
  39. package/dist/client.js +0 -791
  40. package/dist/client.js.map +0 -1
  41. package/dist/common/billing/quota-manager.d.ts +0 -29
  42. package/dist/common/billing/quota-manager.js +0 -251
  43. package/dist/common/billing/quota-manager.js.map +0 -1
  44. package/dist/common/logger.d.ts +0 -1
  45. package/dist/common/logger.js +0 -7
  46. package/dist/common/logger.js.map +0 -1
  47. package/dist/common/util/constants.d.ts +0 -1
  48. package/dist/common/util/constants.js +0 -7
  49. package/dist/common/util/constants.js.map +0 -1
  50. package/dist/common/util/helpers.d.ts +0 -1
  51. package/dist/common/util/helpers.js +0 -6
  52. package/dist/common/util/helpers.js.map +0 -1
  53. package/dist/common/util/token-counter.d.ts +0 -3
  54. package/dist/common/util/token-counter.js +0 -27
  55. package/dist/common/util/token-counter.js.map +0 -1
  56. package/dist/common/util/tools.d.ts +0 -2
  57. package/dist/common/util/tools.js +0 -13
  58. package/dist/common/util/tools.js.map +0 -1
  59. package/dist/config.d.ts +0 -4
  60. package/dist/config.js +0 -12
  61. package/dist/config.js.map +0 -1
  62. package/dist/create-template-project.d.ts +0 -1
  63. package/dist/create-template-project.js +0 -107
  64. package/dist/create-template-project.js.map +0 -1
  65. package/dist/credentials.d.ts +0 -4
  66. package/dist/credentials.js +0 -38
  67. package/dist/credentials.js.map +0 -1
  68. package/dist/dev-process-manager.d.ts +0 -10
  69. package/dist/dev-process-manager.js +0 -54
  70. package/dist/dev-process-manager.js.map +0 -1
  71. package/dist/fingerprint.d.ts +0 -1
  72. package/dist/fingerprint.js +0 -48
  73. package/dist/fingerprint.js.map +0 -1
  74. package/dist/index.d.ts +0 -2
  75. package/dist/index.js +0 -106
  76. package/dist/index.js.map +0 -1
  77. package/dist/menu.d.ts +0 -3
  78. package/dist/menu.js +0 -124
  79. package/dist/menu.js.map +0 -1
  80. package/dist/project-files.d.ts +0 -114
  81. package/dist/project-files.js +0 -513
  82. package/dist/project-files.js.map +0 -1
  83. package/dist/startup-process-handler.d.ts +0 -2
  84. package/dist/startup-process-handler.js +0 -21
  85. package/dist/startup-process-handler.js.map +0 -1
  86. package/dist/tool-handlers.d.ts +0 -28
  87. package/dist/tool-handlers.js +0 -240
  88. package/dist/tool-handlers.js.map +0 -1
  89. package/dist/types.d.ts +0 -8
  90. package/dist/types.js +0 -3
  91. package/dist/types.js.map +0 -1
  92. package/dist/update-codebuff.d.ts +0 -1
  93. package/dist/update-codebuff.js +0 -158
  94. package/dist/update-codebuff.js.map +0 -1
  95. package/dist/utils/__tests__/background-process-manager.test.d.ts +0 -1
  96. package/dist/utils/__tests__/background-process-manager.test.js +0 -289
  97. package/dist/utils/__tests__/background-process-manager.test.js.map +0 -1
  98. package/dist/utils/__tests__/tool-renderers.test.d.ts +0 -1
  99. package/dist/utils/__tests__/tool-renderers.test.js +0 -51
  100. package/dist/utils/__tests__/tool-renderers.test.js.map +0 -1
  101. package/dist/utils/__tests__/xml-stream-parser.test.d.ts +0 -1
  102. package/dist/utils/__tests__/xml-stream-parser.test.js +0 -229
  103. package/dist/utils/__tests__/xml-stream-parser.test.js.map +0 -1
  104. package/dist/utils/detect-shell.d.ts +0 -1
  105. package/dist/utils/detect-shell.js +0 -60
  106. package/dist/utils/detect-shell.js.map +0 -1
  107. package/dist/utils/spinner.d.ts +0 -11
  108. package/dist/utils/spinner.js +0 -87
  109. package/dist/utils/spinner.js.map +0 -1
  110. package/dist/utils/system-info.d.ts +0 -8
  111. package/dist/utils/system-info.js +0 -22
  112. package/dist/utils/system-info.js.map +0 -1
  113. package/dist/utils/terminal.d.ts +0 -38
  114. package/dist/utils/terminal.js +0 -459
  115. package/dist/utils/terminal.js.map +0 -1
  116. package/dist/utils/tool-renderers.d.ts +0 -16
  117. package/dist/utils/tool-renderers.js +0 -145
  118. package/dist/utils/tool-renderers.js.map +0 -1
  119. package/dist/utils/xml-stream-parser.d.ts +0 -9
  120. package/dist/utils/xml-stream-parser.js +0 -128
  121. package/dist/utils/xml-stream-parser.js.map +0 -1
  122. package/dist/web-scraper.d.ts +0 -3
  123. package/dist/web-scraper.js +0 -57
  124. package/dist/web-scraper.js.map +0 -1
  125. package/dist/workers/checkpoint-worker.d.ts +0 -1
  126. package/dist/workers/checkpoint-worker.js +0 -48
  127. package/dist/workers/checkpoint-worker.js.map +0 -1
  128. package/dist/workers/project-context.d.ts +0 -1
  129. package/dist/workers/project-context.js +0 -17
  130. package/dist/workers/project-context.js.map +0 -1
@@ -1,128 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createXMLStreamParser = createXMLStreamParser;
4
- const tools_1 = require("../common/constants/tools");
5
- const saxy_1 = require("../common/util/saxy");
6
- const tool_renderers_1 = require("./tool-renderers");
7
- /**
8
- * Creates a transform stream that processes XML tool calls
9
- * @param renderer Custom renderer for tool calls or a map of renderers per tool
10
- * @param callback Optional callback function to receive processed chunks
11
- * @returns Transform stream
12
- */
13
- function createXMLStreamParser(renderer, callback) {
14
- // Create parser with tool schema validation
15
- const parser = new saxy_1.Saxy(tools_1.toolSchema);
16
- // Current state
17
- let currentTool = null;
18
- let currentParam = null;
19
- let params = {};
20
- let paramContent = '';
21
- // Helper to get the appropriate renderer for the current tool
22
- const getRenderer = (toolName) => {
23
- if (!renderer)
24
- return tool_renderers_1.defaultToolCallRenderer;
25
- // If renderer is a map of tool-specific renderers
26
- if (typeof renderer === 'object' && !('onToolStart' in renderer)) {
27
- return (renderer[toolName] ||
28
- tool_renderers_1.defaultToolCallRenderer);
29
- }
30
- // If renderer is a single renderer
31
- return renderer;
32
- };
33
- // Set up event handlers
34
- parser.on('tagopen', (tag) => {
35
- const { name } = tag;
36
- // Check if this is a tool tag
37
- if (tools_1.TOOL_LIST.includes(name)) {
38
- currentTool = name;
39
- params = {};
40
- // Call renderer if available
41
- const toolRenderer = getRenderer(name);
42
- if (toolRenderer.onToolStart) {
43
- const output = toolRenderer.onToolStart(name, saxy_1.Saxy.parseAttrs(tag.attrs));
44
- if (output !== null) {
45
- parser.push(output);
46
- if (callback)
47
- callback(output);
48
- }
49
- }
50
- }
51
- // Check if this is a parameter tag inside a tool
52
- else if (currentTool && !currentParam) {
53
- currentParam = name;
54
- paramContent = '';
55
- // Call renderer if available
56
- const toolRenderer = getRenderer(currentTool);
57
- if (toolRenderer.onParamStart) {
58
- const output = toolRenderer.onParamStart(name, currentTool);
59
- if (output !== null) {
60
- parser.push(output);
61
- if (callback)
62
- callback(output);
63
- }
64
- }
65
- }
66
- });
67
- parser.on('text', (data) => {
68
- if (currentTool && currentParam) {
69
- paramContent += data.contents;
70
- // Call renderer if available
71
- const toolRenderer = getRenderer(currentTool);
72
- if (toolRenderer.onParamChunk) {
73
- const output = toolRenderer.onParamChunk(data.contents, currentParam, currentTool);
74
- if (output !== null) {
75
- parser.push(output);
76
- if (callback)
77
- callback(output);
78
- }
79
- }
80
- }
81
- else {
82
- // Text outside of tool tags
83
- parser.push(data.contents);
84
- if (callback)
85
- callback(data.contents);
86
- }
87
- });
88
- parser.on('tagclose', (tag) => {
89
- const { name } = tag;
90
- // Check if this is a parameter tag closing
91
- if (currentTool && currentParam && name === currentParam) {
92
- // Store parameter content
93
- params[currentParam] = paramContent;
94
- // Call renderer if available
95
- const toolRenderer = getRenderer(currentTool);
96
- if (toolRenderer.onParamEnd) {
97
- const output = toolRenderer.onParamEnd(currentParam, currentTool, paramContent);
98
- if (output !== null) {
99
- parser.push(output);
100
- if (callback)
101
- callback(output);
102
- }
103
- }
104
- currentParam = null;
105
- paramContent = '';
106
- }
107
- // Check if this is a tool tag closing
108
- else if (currentTool && name === currentTool) {
109
- // Call renderer if available
110
- const toolRenderer = getRenderer(currentTool);
111
- if (toolRenderer.onToolEnd) {
112
- const output = toolRenderer.onToolEnd(currentTool, params);
113
- if (output !== null) {
114
- parser.push(output);
115
- if (callback)
116
- callback(output);
117
- }
118
- }
119
- currentTool = null;
120
- params = {};
121
- }
122
- });
123
- parser.on('end', () => {
124
- parser.end();
125
- });
126
- return parser;
127
- }
128
- //# sourceMappingURL=xml-stream-parser.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"xml-stream-parser.js","sourceRoot":"","sources":["../../src/utils/xml-stream-parser.ts"],"names":[],"mappings":";;AAUA,sDA2IC;AArJD,kDAAwE;AACxE,2CAAuC;AACvC,qDAA4E;AAE5E;;;;;GAKG;AACH,SAAgB,qBAAqB,CACnC,QAA0C,EAC1C,QAAkC;IAElC,4CAA4C;IAC5C,MAAM,MAAM,GAAG,IAAI,WAAI,CAAC,kBAAU,CAAC,CAAA;IAEnC,gBAAgB;IAChB,IAAI,WAAW,GAAkB,IAAI,CAAA;IACrC,IAAI,YAAY,GAAkB,IAAI,CAAA;IACtC,IAAI,MAAM,GAA2B,EAAE,CAAA;IACvC,IAAI,YAAY,GAAG,EAAE,CAAA;IAErB,8DAA8D;IAC9D,MAAM,WAAW,GAAG,CAAC,QAAgB,EAAoB,EAAE;QACzD,IAAI,CAAC,QAAQ;YAAE,OAAO,wCAAuB,CAAA;QAE7C,kDAAkD;QAClD,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,CAAC,CAAC,aAAa,IAAI,QAAQ,CAAC,EAAE,CAAC;YACjE,OAAO,CACJ,QAA6C,CAAC,QAAQ,CAAC;gBACxD,wCAAuB,CACxB,CAAA;QACH,CAAC;QAED,mCAAmC;QACnC,OAAO,QAA4B,CAAA;IACrC,CAAC,CAAA;IAED,wBAAwB;IACxB,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,EAAE;QAC3B,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,CAAA;QAEpB,8BAA8B;QAC9B,IAAI,iBAAS,CAAC,QAAQ,CAAC,IAAgB,CAAC,EAAE,CAAC;YACzC,WAAW,GAAG,IAAI,CAAA;YAClB,MAAM,GAAG,EAAE,CAAA;YAEX,6BAA6B;YAC7B,MAAM,YA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;YAC7B,MAAM,YAAY,GAAG,WAAW,CAAC,WAAW,CAAC,CAAA;YAC7C,IAAI,YAAY,CAAC,SAAS,EAAE,CAAC;gBAC3B,MAAM,MAAM,GAAG,YAAY,CAAC,SAAS,CAAC,WAAW,EAAE,MAAM,CAAC,CAAA;gBAC1D,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;oBACpB,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;oBACnB,IAAI,QAAQ;wBAAE,QAAQ,CAAC,MAAM,CAAC,CAAA;gBAChC,CAAC;YACH,CAAC;YAED,WAAW,GAAG,IAAI,CAAA;YAClB,MAAM,GAAG,EAAE,CAAA;QACb,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;QACpB,MAAM,CAAC,GAAG,EAAE,CAAA;IACd,CAAC,CAAC,CAAA;IAEF,OAAO,MAAM,CAAA;AACf,CAAC"}
@@ -1,3 +0,0 @@
1
- export declare function scrapeWebPage(url: string): Promise<string>;
2
- export declare function parseUrlsFromContent(content: string): string[];
3
- export declare function getScrapedContentBlocks(urls: string[]): Promise<string[]>;
@@ -1,57 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.scrapeWebPage = scrapeWebPage;
4
- exports.parseUrlsFromContent = parseUrlsFromContent;
5
- exports.getScrapedContentBlocks = getScrapedContentBlocks;
6
- const string_1 = require("./common/util/string");
7
- // Global cache for scraped web pages
8
- const scrapedPagesCache = {};
9
- async function scrapeWebPage(url) {
10
- // Check if the page is already in the cache
11
- if (scrapedPagesCache[url] !== undefined) {
12
- return scrapedPagesCache[url];
13
- }
14
- try {
15
- let content = '';
16
- const fullUrl = (0, string_1.ensureUrlProtocol)(url);
17
- if (fullUrl.startsWith('https://raw.githubusercontent.com/')) {
18
- const response = await fetch(url);
19
- content = await response.text();
20
- }
21
- else {
22
- const response = await fetch(`https://r.jina.ai/${url}`);
23
- content = await response.text();
24
- }
25
- // Store the scraped content in the cache
26
- scrapedPagesCache[url] = content;
27
- return content;
28
- }
29
- catch (error) {
30
- // console.error(
31
- // `Error scraping web page ${url}:`,
32
- // error instanceof Error ? error.message : error
33
- // )
34
- scrapedPagesCache[url] = '';
35
- return '';
36
- }
37
- }
38
- function parseUrlsFromContent(content) {
39
- const urlRegex = /https?:\/\/[^\s]+/g;
40
- return content.match(urlRegex) || [];
41
- }
42
- const MAX_SCRAPED_CONTENT_LENGTH = 75_000;
43
- async function getScrapedContentBlocks(urls) {
44
- const blocks = [];
45
- for (const url of urls) {
46
- const scrapedContent = await scrapeWebPage(url);
47
- const truncatedScrapedContent = scrapedContent.length > MAX_SCRAPED_CONTENT_LENGTH
48
- ? scrapedContent.slice(0, MAX_SCRAPED_CONTENT_LENGTH) +
49
- '[...TRUNCATED: WEB PAGE CONTENT TOO LONG...]'
50
- : scrapedContent;
51
- if (truncatedScrapedContent) {
52
- blocks.push(`<web_scraped_content url="${url}">\n${truncatedScrapedContent}\n</web_scraped_content>`);
53
- }
54
- }
55
- return blocks;
56
- }
57
- //# sourceMappingURL=web-scraper.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"web-scraper.js","sourceRoot":"","sources":["../src/web-scraper.ts"],"names":[],"mappings":";;AAKA,sCA4BC;AAED,oDAGC;AAGD,0DAgBC;AAzDD,+CAAsD;AAEtD,qCAAqC;AACrC,MAAM,iBAAiB,GAA2B,EAAE,CAAA;AAE7C,KAAK,UAAU,aAAa,CAAC,GAAW;IAC7C,4CAA4C;IAC5C,IAAI,iBAAiB,CAAC,GAAG,CAAC,KAAK,SAAS,EAAE,CAAC;QACzC,OAAO,iBAAiB,CAAC,GAAG,CAAC,CAAA;IAC/B,CAAC;IAED,IAAI,CAAC;QACH,IAAI,OAAO,GAAG,EAAE,CAAA;QAChB,MAAM,OAAO,GAAG,IAAA,0BAAiB,EAAC,GAAG,CAAC,CAAA;QACtC,IAAI,OAAO,CAAC,UAAU,CAAC,o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,0BAA0B,CACzF,CAAA;QACH,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC"}
@@ -1 +0,0 @@
1
- export {};
@@ -1,48 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const worker_threads_1 = require("worker_threads");
4
- const file_manager_1 = require("../checkpoints/file-manager");
5
- if (worker_threads_1.parentPort) {
6
- const parentPort = worker_threads_1.parentPort;
7
- /**
8
- * Handle incoming messages from the main thread.
9
- * Executes git operations for storing or restoring checkpoints.
10
- */
11
- parentPort.on('message', async (message) => {
12
- const { id, type, projectDir, bareRepoPath, commit, message: commitMessage, relativeFilepaths, } = message;
13
- try {
14
- let result;
15
- if (type === 'store') {
16
- // Store the current state as a git commit
17
- result = await (0, file_manager_1.storeFileState)({
18
- projectDir,
19
- bareRepoPath,
20
- message: commitMessage,
21
- relativeFilepaths,
22
- });
23
- }
24
- else if (type === 'restore') {
25
- // Restore files to a previous git commit state
26
- await (0, file_manager_1.restoreFileState)({
27
- projectDir,
28
- bareRepoPath,
29
- commit: commit,
30
- relativeFilepaths,
31
- });
32
- result = true;
33
- }
34
- else {
35
- throw new Error(`Unknown operation type: ${type}`);
36
- }
37
- parentPort.postMessage({ id, success: true, result });
38
- }
39
- catch (error) {
40
- parentPort.postMessage({
41
- id,
42
- success: false,
43
- error: error instanceof Error ? error.message : String(error),
44
- });
45
- }
46
- });
47
- }
48
- //# sourceMappingURL=checkpoint-worker.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"checkpoint-worker.js","sourceRoot":"","sources":["../../src/workers/checkpoint-worker.ts"],"names":[],"mappings":";;AAAA,mDAA8D;AAC9D,8DAA8E;AAoB9E,IAAI,2BAAe,EAAE,CAAC;IACpB,MAAM,UAAU,GAAG,2BAAe,CAAA;IAElC;;;OAGG;IACH,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,OAAsB,EAAE,EAAE;QACxD,MAAM,EACJ,EAAE,EACF,IAAI,EACJ,UAAU,EACV,YAAY,EACZ,MAAM,EACN,OAAO,EAAE,aAAa,EACtB,iBAAiB,GAClB,GAAG,OAAO,CAAA;QACX,IAAI,CAAC;YACH,IAAI,MAAwB,CAAA;YAC5B,IAAI,IAAI,KAAK,OAAO,EAAE,CAAC;gBACrB,0CAA0C;gBAC1C,MAAM,GAAG,MAAM,IAAA,6BAAc,EAAC;oBAC5B,UAAU;oBACV,YAAY;oBACZ,OAAO,EAAE,aAAc;oBACvB,iBAAiB;iBAClB,CAAC,CAAA;YACJ,CAAC;iBAAM,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;gBAC9B,+CAA+C;gBAC/C,MAAM,IAAA,+BAAgB,EAAC;oBACrB,UAAU;oBACV,YAAY;oBACZ,MAAM,EAAE,MAAO;oBACf,iBAAiB;iBAClB,CAAC,CAAA;gBACF,MAAM,GAAG,IAAI,CAAA;YACf,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,KAAK,CAAC,2BAA2B,IAAI,EAAE,CAAC,CAAA;YACpD,CAAC;YAED,UAAU,CAAC,WAAW,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAA;QACvD,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,UAAU,CAAC,WAAW,CAAC;gBACrB,EAAE;gBACF,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;aAC9D,CAAC,CAAA;QACJ,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC"}
@@ -1 +0,0 @@
1
- export {};
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const worker_threads_1 = require("worker_threads");
4
- const project_files_1 = require("../project-files");
5
- const file_manager_1 = require("../checkpoints/file-manager");
6
- const project_file_tree_1 = require("../common/project-file-tree");
7
- if (worker_threads_1.parentPort) {
8
- const parentPort = worker_threads_1.parentPort;
9
- parentPort.on('message', async ({ dir }) => {
10
- (0, project_files_1.setProjectRoot)(dir);
11
- const initFileContext = await (0, project_files_1.getProjectFileContext)(dir, {});
12
- const relativeFilepaths = (0, project_file_tree_1.getAllFilePaths)(initFileContext.fileTree);
13
- await (0, file_manager_1.initializeCheckpointFileManager)({ projectDir: dir, relativeFilepaths });
14
- parentPort.postMessage(initFileContext);
15
- });
16
- }
17
- //# sourceMappingURL=project-context.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"project-context.js","sourceRoot":"","sources":["../../src/workers/project-context.ts"],"names":[],"mappings":";;AAAA,mDAA8D;AAC9D,oDAAwE;AACxE,8DAA6E;AAC7E,gEAA0D;AAE1D,IAAI,2BAAe,EAAE,CAAC;IACpB,MAAM,UAAU,GAAG,2BAAe,CAAA;IAElC,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;QACzC,IAAA,8BAAc,EAAC,GAAG,CAAC,CAAA;QACnB,MAAM,eAAe,GAAG,MAAM,IAAA,qCAAqB,EAAC,GAAG,EAAE,EAAE,CAAC,CAAA;QAE5D,MAAM,iBAAiB,GAAG,IAAA,mCAAe,EAAC,eAAe,CAAC,QAAQ,CAAC,CAAA;QACnE,MAAM,IAAA,8CAA+B,EAAC,EAAE,UAAU,EAAE,GAAG,EAAE,iBAAiB,EAAE,CAAC,CAAA;QAE7E,UAAU,CAAC,WAAW,CAAC,eAAe,CAAC,CAAA;IACzC,CAAC,CAAC,CAAA;AACJ,CAAC"}