@lyy0709/contextweaver 1.0.3 → 1.0.4
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.
- package/dist/{SearchService-R7UMDQ6T.js → SearchService-P5C5QXMP.js} +5 -4
- package/dist/{browser-VC5772XM.js → browser-BCGLGKKF.js} +3 -2
- package/dist/{chunk-LPFRFKFW.js → chunk-53ESQDZT.js} +2 -1
- package/dist/{chunk-CKN7LWEA.js → chunk-7MWEWZ7J.js} +5 -4
- package/dist/{chunk-ECEVTSSZ.js → chunk-BGKNHLHY.js} +4 -3
- package/dist/{chunk-XVKMTPCT.js → chunk-CACJOY3O.js} +7 -6
- package/dist/{chunk-6HF343R7.js → chunk-PZTRC7VF.js} +6 -5
- package/dist/{chunk-YVLGQTLG.js → chunk-QCUCU74R.js} +2 -1
- package/dist/{chunk-V2USKRIC.js → chunk-YVMNY2OU.js} +1 -0
- package/dist/{claude-IKIA62JA.js → claude-YONOS6YG.js} +1 -0
- package/dist/codebaseRetrieval-N6ABFZ24.js +12 -0
- package/dist/{config-WTC56Y2R.js → config-VZD37BMJ.js} +2 -1
- package/dist/enhancer-PO6KKYUT.js +9 -0
- package/dist/{gemini-Q37K5XA5.js → gemini-54NRBSPH.js} +1 -0
- package/dist/index.js +11 -10
- package/dist/{lock-K4TS4ENC.js → lock-AQIUW3N3.js} +3 -2
- package/dist/logger-REOCZNEY.js +10 -0
- package/dist/mcp/main.js +3 -2
- package/dist/{openai-MOPZNA5I.js → openai-VRQNTJQZ.js} +1 -0
- package/dist/scanner-QUWFCQUV.js +11 -0
- package/dist/{server-DENFYPME.js → server-JOJGOORY.js} +40 -8
- package/dist/{server-MLTGGZFP.js → server-TGCR7VVZ.js} +10 -5
- package/package.json +2 -2
- package/dist/codebaseRetrieval-SCN3YIPM.js +0 -11
- package/dist/enhancer-QHNMR35J.js +0 -8
- package/dist/logger-SF6S6GVR.js +0 -9
- package/dist/scanner-T7MGYXQV.js +0 -10
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getIndexer,
|
|
3
3
|
getVectorStore
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-BGKNHLHY.js";
|
|
5
5
|
import {
|
|
6
6
|
initDb,
|
|
7
7
|
isChunksFtsInitialized,
|
|
@@ -9,15 +9,15 @@ import {
|
|
|
9
9
|
searchChunksFts,
|
|
10
10
|
searchFilesFts,
|
|
11
11
|
segmentQuery
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-53ESQDZT.js";
|
|
13
13
|
import {
|
|
14
14
|
isDebugEnabled,
|
|
15
15
|
logger
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-QCUCU74R.js";
|
|
17
17
|
import {
|
|
18
18
|
getEmbeddingConfig,
|
|
19
19
|
getRerankerConfig
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-YVMNY2OU.js";
|
|
21
21
|
|
|
22
22
|
// src/api/reranker.ts
|
|
23
23
|
var RerankerClient = class {
|
|
@@ -1621,3 +1621,4 @@ ${code}`;
|
|
|
1621
1621
|
export {
|
|
1622
1622
|
SearchService
|
|
1623
1623
|
};
|
|
1624
|
+
//# sourceMappingURL=SearchService-P5C5QXMP.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
logger
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-QCUCU74R.js";
|
|
4
|
+
import "./chunk-YVMNY2OU.js";
|
|
5
5
|
|
|
6
6
|
// src/enhancer/browser.ts
|
|
7
7
|
import { exec } from "child_process";
|
|
@@ -28,3 +28,4 @@ function openBrowser(url) {
|
|
|
28
28
|
export {
|
|
29
29
|
openBrowser
|
|
30
30
|
};
|
|
31
|
+
//# sourceMappingURL=browser-BCGLGKKF.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
logger
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QCUCU74R.js";
|
|
4
4
|
|
|
5
5
|
// src/search/fts.ts
|
|
6
6
|
var tokenizerCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -541,3 +541,4 @@ export {
|
|
|
541
541
|
getStoredEmbeddingDimensions,
|
|
542
542
|
setStoredEmbeddingDimensions
|
|
543
543
|
};
|
|
544
|
+
//# sourceMappingURL=chunk-53ESQDZT.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
closeAllIndexers,
|
|
3
3
|
closeAllVectorStores,
|
|
4
4
|
getIndexer
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-BGKNHLHY.js";
|
|
6
6
|
import {
|
|
7
7
|
batchDelete,
|
|
8
8
|
batchUpdateMtime,
|
|
@@ -16,14 +16,14 @@ import {
|
|
|
16
16
|
getStoredEmbeddingDimensions,
|
|
17
17
|
initDb,
|
|
18
18
|
setStoredEmbeddingDimensions
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-53ESQDZT.js";
|
|
20
20
|
import {
|
|
21
21
|
logger
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-QCUCU74R.js";
|
|
23
23
|
import {
|
|
24
24
|
getEmbeddingConfig,
|
|
25
25
|
getExcludePatterns
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-YVMNY2OU.js";
|
|
27
27
|
|
|
28
28
|
// src/scanner/index.ts
|
|
29
29
|
import path3 from "path";
|
|
@@ -1335,3 +1335,4 @@ async function scan(rootPath, options = {}) {
|
|
|
1335
1335
|
export {
|
|
1336
1336
|
scan
|
|
1337
1337
|
};
|
|
1338
|
+
//# sourceMappingURL=chunk-7MWEWZ7J.js.map
|
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
batchUpsertChunkFts,
|
|
5
5
|
clearVectorIndexHash,
|
|
6
6
|
isChunksFtsInitialized
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-53ESQDZT.js";
|
|
8
8
|
import {
|
|
9
9
|
logger
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-QCUCU74R.js";
|
|
11
11
|
import {
|
|
12
12
|
getEmbeddingConfig
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-YVMNY2OU.js";
|
|
14
14
|
|
|
15
15
|
// src/vectorStore/index.ts
|
|
16
16
|
import fs from "fs";
|
|
@@ -892,3 +892,4 @@ export {
|
|
|
892
892
|
getIndexer,
|
|
893
893
|
closeAllIndexers
|
|
894
894
|
};
|
|
895
|
+
//# sourceMappingURL=chunk-BGKNHLHY.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
generateProjectId
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-53ESQDZT.js";
|
|
4
4
|
import {
|
|
5
5
|
logger
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-QCUCU74R.js";
|
|
7
7
|
|
|
8
8
|
// src/mcp/tools/codebaseRetrieval.ts
|
|
9
9
|
import fs from "fs";
|
|
@@ -75,8 +75,8 @@ function isProjectIndexed(projectId) {
|
|
|
75
75
|
return fs.existsSync(dbPath);
|
|
76
76
|
}
|
|
77
77
|
async function ensureIndexed(repoPath, projectId, onProgress) {
|
|
78
|
-
const { withLock } = await import("./lock-
|
|
79
|
-
const { scan } = await import("./scanner-
|
|
78
|
+
const { withLock } = await import("./lock-AQIUW3N3.js");
|
|
79
|
+
const { scan } = await import("./scanner-QUWFCQUV.js");
|
|
80
80
|
await withLock(projectId, "index", async () => {
|
|
81
81
|
const wasIndexed = isProjectIndexed(projectId);
|
|
82
82
|
if (!wasIndexed) {
|
|
@@ -116,7 +116,7 @@ async function handleCodebaseRetrieval(args, configOverride = ZEN_CONFIG_OVERRID
|
|
|
116
116
|
},
|
|
117
117
|
"MCP codebase-retrieval \u8C03\u7528\u5F00\u59CB"
|
|
118
118
|
);
|
|
119
|
-
const { checkEmbeddingEnv, checkRerankerEnv } = await import("./config-
|
|
119
|
+
const { checkEmbeddingEnv, checkRerankerEnv } = await import("./config-VZD37BMJ.js");
|
|
120
120
|
const embeddingCheck = checkEmbeddingEnv();
|
|
121
121
|
const rerankerCheck = checkRerankerEnv();
|
|
122
122
|
const allMissingVars = [...embeddingCheck.missingVars, ...rerankerCheck.missingVars];
|
|
@@ -136,7 +136,7 @@ async function handleCodebaseRetrieval(args, configOverride = ZEN_CONFIG_OVERRID
|
|
|
136
136
|
},
|
|
137
137
|
"MCP \u67E5\u8BE2\u6784\u5EFA"
|
|
138
138
|
);
|
|
139
|
-
const { SearchService } = await import("./SearchService-
|
|
139
|
+
const { SearchService } = await import("./SearchService-P5C5QXMP.js");
|
|
140
140
|
const service = new SearchService(projectId, repo_path, configOverride);
|
|
141
141
|
await service.init();
|
|
142
142
|
logger.debug("SearchService \u521D\u59CB\u5316\u5B8C\u6210");
|
|
@@ -295,3 +295,4 @@ export {
|
|
|
295
295
|
codebaseRetrievalSchema,
|
|
296
296
|
handleCodebaseRetrieval
|
|
297
297
|
};
|
|
298
|
+
//# sourceMappingURL=chunk-CACJOY3O.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
logger
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QCUCU74R.js";
|
|
4
4
|
import {
|
|
5
5
|
checkEnhancerEnv,
|
|
6
6
|
getEnhancerConfig
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-YVMNY2OU.js";
|
|
8
8
|
|
|
9
9
|
// src/enhancer/detect.ts
|
|
10
10
|
function detectLanguage(text) {
|
|
@@ -34,13 +34,13 @@ async function createLlmClient(config) {
|
|
|
34
34
|
};
|
|
35
35
|
let client;
|
|
36
36
|
if (endpoint === "openai") {
|
|
37
|
-
const { OpenAiAdapter } = await import("./openai-
|
|
37
|
+
const { OpenAiAdapter } = await import("./openai-VRQNTJQZ.js");
|
|
38
38
|
client = new OpenAiAdapter(clientConfig);
|
|
39
39
|
} else if (endpoint === "claude") {
|
|
40
|
-
const { ClaudeAdapter } = await import("./claude-
|
|
40
|
+
const { ClaudeAdapter } = await import("./claude-YONOS6YG.js");
|
|
41
41
|
client = new ClaudeAdapter(clientConfig);
|
|
42
42
|
} else {
|
|
43
|
-
const { GeminiAdapter } = await import("./gemini-
|
|
43
|
+
const { GeminiAdapter } = await import("./gemini-54NRBSPH.js");
|
|
44
44
|
client = new GeminiAdapter(clientConfig);
|
|
45
45
|
}
|
|
46
46
|
clientCache.set(cacheKey, client);
|
|
@@ -184,3 +184,4 @@ async function enhancePrompt(options) {
|
|
|
184
184
|
export {
|
|
185
185
|
enhancePrompt
|
|
186
186
|
};
|
|
187
|
+
//# sourceMappingURL=chunk-PZTRC7VF.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isDev,
|
|
3
3
|
isMcpMode
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YVMNY2OU.js";
|
|
5
5
|
|
|
6
6
|
// src/utils/logger.ts
|
|
7
7
|
import fs from "fs";
|
|
@@ -168,3 +168,4 @@ export {
|
|
|
168
168
|
logger,
|
|
169
169
|
isDebugEnabled
|
|
170
170
|
};
|
|
171
|
+
//# sourceMappingURL=chunk-QCUCU74R.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
codebaseRetrievalSchema,
|
|
3
|
+
handleCodebaseRetrieval
|
|
4
|
+
} from "./chunk-CACJOY3O.js";
|
|
5
|
+
import "./chunk-53ESQDZT.js";
|
|
6
|
+
import "./chunk-QCUCU74R.js";
|
|
7
|
+
import "./chunk-YVMNY2OU.js";
|
|
8
|
+
export {
|
|
9
|
+
codebaseRetrievalSchema,
|
|
10
|
+
handleCodebaseRetrieval
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=codebaseRetrieval-N6ABFZ24.js.map
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
getRerankerConfig,
|
|
9
9
|
isDev,
|
|
10
10
|
isMcpMode
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-YVMNY2OU.js";
|
|
12
12
|
export {
|
|
13
13
|
checkEmbeddingEnv,
|
|
14
14
|
checkEnhancerEnv,
|
|
@@ -20,3 +20,4 @@ export {
|
|
|
20
20
|
isDev,
|
|
21
21
|
isMcpMode
|
|
22
22
|
};
|
|
23
|
+
//# sourceMappingURL=config-VZD37BMJ.js.map
|
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
scan
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-7MWEWZ7J.js";
|
|
5
|
+
import "./chunk-BGKNHLHY.js";
|
|
6
6
|
import {
|
|
7
7
|
generateProjectId
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-53ESQDZT.js";
|
|
9
9
|
import {
|
|
10
10
|
logger
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-QCUCU74R.js";
|
|
12
|
+
import "./chunk-YVMNY2OU.js";
|
|
13
13
|
|
|
14
14
|
// src/index.ts
|
|
15
15
|
import { promises as fs } from "fs";
|
|
@@ -121,7 +121,7 @@ cli.command("index [path]", "\u626B\u63CF\u4EE3\u7801\u5E93\u5E76\u5EFA\u7ACB\u7
|
|
|
121
121
|
}
|
|
122
122
|
});
|
|
123
123
|
cli.command("mcp", "\u542F\u52A8 MCP \u670D\u52A1\u5668").action(async () => {
|
|
124
|
-
const { startMcpServer } = await import("./server-
|
|
124
|
+
const { startMcpServer } = await import("./server-JOJGOORY.js");
|
|
125
125
|
try {
|
|
126
126
|
await startMcpServer();
|
|
127
127
|
} catch (err) {
|
|
@@ -138,7 +138,7 @@ cli.command("enhance <prompt>", "\u589E\u5F3A\u63D0\u793A\u8BCD").option("--no-b
|
|
|
138
138
|
const endpointRaw = options.endpoint?.toLowerCase();
|
|
139
139
|
const endpointOverride = endpointRaw === "openai" || endpointRaw === "claude" || endpointRaw === "gemini" ? endpointRaw : void 0;
|
|
140
140
|
if (options.browser === false) {
|
|
141
|
-
const { enhancePrompt } = await import("./enhancer-
|
|
141
|
+
const { enhancePrompt } = await import("./enhancer-PO6KKYUT.js");
|
|
142
142
|
try {
|
|
143
143
|
const result = await enhancePrompt({ prompt, endpointOverride });
|
|
144
144
|
process.stdout.write(`${result.enhanced}
|
|
@@ -153,8 +153,8 @@ cli.command("enhance <prompt>", "\u589E\u5F3A\u63D0\u793A\u8BCD").option("--no-b
|
|
|
153
153
|
}
|
|
154
154
|
return;
|
|
155
155
|
}
|
|
156
|
-
const { startEnhanceServer } = await import("./server-
|
|
157
|
-
const { openBrowser } = await import("./browser-
|
|
156
|
+
const { startEnhanceServer } = await import("./server-TGCR7VVZ.js");
|
|
157
|
+
const { openBrowser } = await import("./browser-BCGLGKKF.js");
|
|
158
158
|
try {
|
|
159
159
|
const result = await startEnhanceServer(prompt, {
|
|
160
160
|
endpointOverride,
|
|
@@ -184,7 +184,7 @@ cli.command("search", "\u672C\u5730\u68C0\u7D22\uFF08\u53C2\u6570\u5BF9\u9F50 MC
|
|
|
184
184
|
}
|
|
185
185
|
const technicalTerms = (options.technicalTerms || "").split(",").map((t) => t.trim()).filter(Boolean);
|
|
186
186
|
const useZen = options.zen !== false;
|
|
187
|
-
const { handleCodebaseRetrieval } = await import("./codebaseRetrieval-
|
|
187
|
+
const { handleCodebaseRetrieval } = await import("./codebaseRetrieval-N6ABFZ24.js");
|
|
188
188
|
const response = await handleCodebaseRetrieval(
|
|
189
189
|
{
|
|
190
190
|
repo_path: repoPath,
|
|
@@ -200,3 +200,4 @@ cli.command("search", "\u672C\u5730\u68C0\u7D22\uFF08\u53C2\u6570\u5BF9\u9F50 MC
|
|
|
200
200
|
);
|
|
201
201
|
cli.help();
|
|
202
202
|
cli.parse();
|
|
203
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
logger
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-QCUCU74R.js";
|
|
4
|
+
import "./chunk-YVMNY2OU.js";
|
|
5
5
|
|
|
6
6
|
// src/utils/lock.ts
|
|
7
7
|
import fs from "fs";
|
|
@@ -104,3 +104,4 @@ async function withLock(projectId, operation, fn, timeoutMs = 3e4) {
|
|
|
104
104
|
export {
|
|
105
105
|
withLock
|
|
106
106
|
};
|
|
107
|
+
//# sourceMappingURL=lock-AQIUW3N3.js.map
|
package/dist/mcp/main.js
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
if (!process.argv.includes("mcp")) {
|
|
5
5
|
process.argv.push("mcp");
|
|
6
6
|
}
|
|
7
|
-
var { logger } = await import("../logger-
|
|
8
|
-
var { startMcpServer } = await import("../server-
|
|
7
|
+
var { logger } = await import("../logger-REOCZNEY.js");
|
|
8
|
+
var { startMcpServer } = await import("../server-JOJGOORY.js");
|
|
9
9
|
try {
|
|
10
10
|
await startMcpServer();
|
|
11
11
|
} catch (err) {
|
|
@@ -16,3 +16,4 @@ try {
|
|
|
16
16
|
);
|
|
17
17
|
process.exit(1);
|
|
18
18
|
}
|
|
19
|
+
//# sourceMappingURL=main.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
codebaseRetrievalSchema,
|
|
3
3
|
handleCodebaseRetrieval
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-CACJOY3O.js";
|
|
5
|
+
import "./chunk-53ESQDZT.js";
|
|
6
6
|
import {
|
|
7
7
|
logger
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-QCUCU74R.js";
|
|
9
|
+
import "./chunk-YVMNY2OU.js";
|
|
10
10
|
|
|
11
11
|
// src/mcp/server.ts
|
|
12
12
|
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
@@ -20,7 +20,10 @@ var enhancePromptSchema = z.object({
|
|
|
20
20
|
conversation_history: z.string().optional().describe(
|
|
21
21
|
"Recent conversation history for context. Format: 'User: ...\\nAssistant: ...'"
|
|
22
22
|
),
|
|
23
|
-
project_root_path: z.string().optional().describe("Project root path for context")
|
|
23
|
+
project_root_path: z.string().optional().describe("Project root path for context"),
|
|
24
|
+
webui: z.boolean().optional().default(true).describe(
|
|
25
|
+
"When true (default), opens a Web UI in the browser for interactive review/editing. When false, returns the enhanced prompt directly."
|
|
26
|
+
)
|
|
24
27
|
});
|
|
25
28
|
function formatEnvMissingResponse(missingVars) {
|
|
26
29
|
const configPath = "~/.contextweaver/.env";
|
|
@@ -56,15 +59,38 @@ PROMPT_ENHANCER_TOKEN=your-api-key-here
|
|
|
56
59
|
};
|
|
57
60
|
}
|
|
58
61
|
async function handleEnhancePrompt(args) {
|
|
59
|
-
|
|
60
|
-
|
|
62
|
+
const useWebUi = args.webui !== false;
|
|
63
|
+
logger.info(
|
|
64
|
+
{ hasHistory: Boolean(args.conversation_history), webui: useWebUi },
|
|
65
|
+
"MCP enhance-prompt \u8C03\u7528\u5F00\u59CB"
|
|
66
|
+
);
|
|
67
|
+
const { checkEnhancerEnv } = await import("./config-VZD37BMJ.js");
|
|
61
68
|
const envCheck = checkEnhancerEnv();
|
|
62
69
|
if (!envCheck.isValid) {
|
|
63
70
|
logger.warn({ missingVars: envCheck.missingVars }, "Prompt Enhancer \u73AF\u5883\u53D8\u91CF\u672A\u914D\u7F6E");
|
|
64
71
|
return formatEnvMissingResponse(envCheck.missingVars);
|
|
65
72
|
}
|
|
66
73
|
try {
|
|
67
|
-
|
|
74
|
+
if (useWebUi) {
|
|
75
|
+
const { startEnhanceServer } = await import("./server-TGCR7VVZ.js");
|
|
76
|
+
const { openBrowser } = await import("./browser-BCGLGKKF.js");
|
|
77
|
+
const result2 = await startEnhanceServer(args.prompt, {
|
|
78
|
+
conversationHistory: args.conversation_history,
|
|
79
|
+
projectRootPath: args.project_root_path,
|
|
80
|
+
onStarted: (url) => {
|
|
81
|
+
openBrowser(url);
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
return {
|
|
85
|
+
content: [
|
|
86
|
+
{
|
|
87
|
+
type: "text",
|
|
88
|
+
text: result2.enhanced
|
|
89
|
+
}
|
|
90
|
+
]
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
const { enhancePrompt } = await import("./enhancer-PO6KKYUT.js");
|
|
68
94
|
const result = await enhancePrompt({
|
|
69
95
|
prompt: args.prompt,
|
|
70
96
|
conversationHistory: args.conversation_history,
|
|
@@ -184,6 +210,11 @@ Features:
|
|
|
184
210
|
project_root_path: {
|
|
185
211
|
type: "string",
|
|
186
212
|
description: "Project root path for context"
|
|
213
|
+
},
|
|
214
|
+
webui: {
|
|
215
|
+
type: "boolean",
|
|
216
|
+
description: "When true (default), opens a Web UI in the browser for interactive review/editing. When false, returns the enhanced prompt directly.",
|
|
217
|
+
default: true
|
|
187
218
|
}
|
|
188
219
|
},
|
|
189
220
|
required: ["prompt"]
|
|
@@ -261,3 +292,4 @@ async function startMcpServer() {
|
|
|
261
292
|
export {
|
|
262
293
|
startMcpServer
|
|
263
294
|
};
|
|
295
|
+
//# sourceMappingURL=server-JOJGOORY.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
enhancePrompt
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-PZTRC7VF.js";
|
|
4
4
|
import {
|
|
5
5
|
logger
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-QCUCU74R.js";
|
|
7
|
+
import "./chunk-YVMNY2OU.js";
|
|
8
8
|
|
|
9
9
|
// src/enhancer/server.ts
|
|
10
10
|
import { randomUUID } from "crypto";
|
|
@@ -562,7 +562,9 @@ async function startEnhanceServer(prompt, options = {}) {
|
|
|
562
562
|
const port = await findAvailablePort();
|
|
563
563
|
const initial = await enhancePrompt({
|
|
564
564
|
prompt,
|
|
565
|
-
endpointOverride: options.endpointOverride
|
|
565
|
+
endpointOverride: options.endpointOverride,
|
|
566
|
+
conversationHistory: options.conversationHistory,
|
|
567
|
+
projectRootPath: options.projectRootPath
|
|
566
568
|
});
|
|
567
569
|
const session = {
|
|
568
570
|
id: randomUUID(),
|
|
@@ -644,7 +646,9 @@ async function startEnhanceServer(prompt, options = {}) {
|
|
|
644
646
|
}
|
|
645
647
|
const next = await enhancePrompt({
|
|
646
648
|
prompt: nextPrompt,
|
|
647
|
-
endpointOverride: options.endpointOverride
|
|
649
|
+
endpointOverride: options.endpointOverride,
|
|
650
|
+
conversationHistory: options.conversationHistory,
|
|
651
|
+
projectRootPath: options.projectRootPath
|
|
648
652
|
});
|
|
649
653
|
session.original = nextPrompt;
|
|
650
654
|
session.enhanced = next.enhanced;
|
|
@@ -706,3 +710,4 @@ async function startEnhanceServer(prompt, options = {}) {
|
|
|
706
710
|
export {
|
|
707
711
|
startEnhanceServer
|
|
708
712
|
};
|
|
713
|
+
//# sourceMappingURL=server-TGCR7VVZ.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lyy0709/contextweaver",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "A context weaving tool for LLMs — with Prompt Enhancer",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "lyy0709",
|
|
@@ -79,4 +79,4 @@
|
|
|
79
79
|
"tree-sitter-typescript"
|
|
80
80
|
]
|
|
81
81
|
}
|
|
82
|
-
}
|
|
82
|
+
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
codebaseRetrievalSchema,
|
|
3
|
-
handleCodebaseRetrieval
|
|
4
|
-
} from "./chunk-XVKMTPCT.js";
|
|
5
|
-
import "./chunk-LPFRFKFW.js";
|
|
6
|
-
import "./chunk-YVLGQTLG.js";
|
|
7
|
-
import "./chunk-V2USKRIC.js";
|
|
8
|
-
export {
|
|
9
|
-
codebaseRetrievalSchema,
|
|
10
|
-
handleCodebaseRetrieval
|
|
11
|
-
};
|
package/dist/logger-SF6S6GVR.js
DELETED