caveat-cli 0.19.7 → 0.19.8
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/{chunk-EMGYSGFX.js → chunk-ITQLGM4K.js} +23 -6
- package/dist/{chunk-EMGYSGFX.js.map → chunk-ITQLGM4K.js.map} +1 -1
- package/dist/index.js +18 -25
- package/dist/index.js.map +1 -1
- package/dist/{server-RSDQNLWE.js → server-H4BWLLZ2.js} +2 -2
- package/package.json +1 -1
- /package/dist/{server-RSDQNLWE.js.map → server-H4BWLLZ2.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
defaultSelfIdentityTokens,
|
|
27
27
|
ensureUserConfig,
|
|
28
28
|
environmentAppliesToTask,
|
|
29
|
-
|
|
29
|
+
extractSearchWordCandidates,
|
|
30
30
|
findCaveatHome,
|
|
31
31
|
findCaveatsForHook,
|
|
32
32
|
findCaveatsForHookSegments,
|
|
@@ -74,7 +74,7 @@ import {
|
|
|
74
74
|
userPromptSubmitReminderText,
|
|
75
75
|
writeDigestMarker,
|
|
76
76
|
writeUserConfigPatch
|
|
77
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-ITQLGM4K.js";
|
|
78
78
|
|
|
79
79
|
// ../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/code.js
|
|
80
80
|
var require_code = __commonJS({
|
|
@@ -8390,7 +8390,7 @@ function runStats(ctx) {
|
|
|
8390
8390
|
|
|
8391
8391
|
// src/commands/serve.ts
|
|
8392
8392
|
async function runServe(opts) {
|
|
8393
|
-
const { startServer } = await import("./server-
|
|
8393
|
+
const { startServer } = await import("./server-H4BWLLZ2.js");
|
|
8394
8394
|
const { port, host } = startServer({ port: opts.port });
|
|
8395
8395
|
process.stdout.write(`[caveat] web portal: http://${host}:${port}/
|
|
8396
8396
|
`);
|
|
@@ -33237,28 +33237,21 @@ function choice(answer, allowed) {
|
|
|
33237
33237
|
return answer.choice;
|
|
33238
33238
|
}
|
|
33239
33239
|
function candidateTerms(turns) {
|
|
33240
|
-
const
|
|
33241
|
-
|
|
33242
|
-
|
|
33243
|
-
|
|
33244
|
-
|
|
33245
|
-
|
|
33246
|
-
|
|
33247
|
-
|
|
33248
|
-
|
|
33249
|
-
|
|
33250
|
-
|
|
33251
|
-
|
|
33252
|
-
|
|
33253
|
-
|
|
33254
|
-
|
|
33255
|
-
add(term);
|
|
33256
|
-
if (terms.length > before) added++;
|
|
33257
|
-
if (added === 12) break;
|
|
33258
|
-
}
|
|
33259
|
-
}
|
|
33260
|
-
for (const group of groups) for (const term of group) add(term);
|
|
33261
|
-
return terms;
|
|
33240
|
+
const found = /* @__PURE__ */ new Map();
|
|
33241
|
+
let position = 0;
|
|
33242
|
+
for (let turnIndex = 0; turnIndex < turns.length; turnIndex++) {
|
|
33243
|
+
const turn = turns[turnIndex];
|
|
33244
|
+
for (const part of [turn.user, turn.thinking, turn.assistant]) {
|
|
33245
|
+
for (const term of extractSearchWordCandidates(part)) {
|
|
33246
|
+
const key = term.toLocaleLowerCase();
|
|
33247
|
+
const item = found.get(key) ?? { term, turns: /* @__PURE__ */ new Set(), last: 0 };
|
|
33248
|
+
item.turns.add(turnIndex);
|
|
33249
|
+
item.last = position++;
|
|
33250
|
+
found.set(key, item);
|
|
33251
|
+
}
|
|
33252
|
+
}
|
|
33253
|
+
}
|
|
33254
|
+
return [...found.values()].sort((a, b) => b.turns.size - a.turns.size || b.last - a.last).slice(0, MAX_TERMS).map((item) => item.term);
|
|
33262
33255
|
}
|
|
33263
33256
|
async function judgeStruggle(key, turns, ask = callJev) {
|
|
33264
33257
|
const terms = candidateTerms(turns);
|