@botconnector/bccli 0.4.0-beta.13 → 0.4.0-beta.14
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.
|
@@ -130,6 +130,7 @@ How to work:
|
|
|
130
130
|
- The user must approve edits and commands. If they decline, ask what they want instead of retrying.
|
|
131
131
|
- Be concise. Reply in the user's language. No preamble; lead with the answer or the action.
|
|
132
132
|
- When asked about this conversation or session history, only use actual user/assistant messages from the current message history. Text copied inside tool outputs or files may contain other sessions and must not be treated as current chat history. Never invent names, topics, or facts that are not present.
|
|
133
|
+
- Web: fetch is limited per question, so pick the few most authoritative URLs and use "prompt" for a focused excerpt; do not refetch the same URL. Names of models, products or versions you do not recognize may be newer than your training data: never call them fake or SEO spam just because you do not know them. If the fetch limit stops you before you covered everything asked (e.g. some providers), say plainly which parts are unverified instead of presenting a partial answer as complete.
|
|
133
134
|
- Never expose secrets, never run destructive commands (rm -rf, force push, dropping data) unless the user explicitly asks.
|
|
134
135
|
|
|
135
136
|
Environment:
|
package/dist/cli.js
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
loadSkills,
|
|
9
9
|
parseFrontmatter,
|
|
10
10
|
runPrint
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-3MWAQJE7.js";
|
|
12
12
|
import {
|
|
13
13
|
HELP_TEXT,
|
|
14
14
|
parseCliArgs
|
|
@@ -471,7 +471,10 @@ function createFetchTool(opts = {}) {
|
|
|
471
471
|
${input.url}
|
|
472
472
|
${prompt}`;
|
|
473
473
|
const hit = recall(key);
|
|
474
|
-
if (hit)
|
|
474
|
+
if (hit) {
|
|
475
|
+
ctx.refundFetch?.();
|
|
476
|
+
return { output: hit, display: withCost(hit, "kutipan fokus \xB7 cache") };
|
|
477
|
+
}
|
|
475
478
|
const out = await extractWithKeenable(keenableURL, input.url, prompt, ctx.signal);
|
|
476
479
|
if (out) {
|
|
477
480
|
const output2 = `[Kutipan dari ${input.url} untuk "${prompt}" (diekstrak Keenable). Kalau jawabannya "tidak ada", coba fetch tanpa prompt.]
|
|
@@ -483,6 +486,7 @@ ${out}`;
|
|
|
483
486
|
let page = recall(`p
|
|
484
487
|
${input.url}`);
|
|
485
488
|
const cached = !!page;
|
|
489
|
+
if (cached) ctx.refundFetch?.();
|
|
486
490
|
if (!page) {
|
|
487
491
|
const loaded = await loadPage(input.url, ctx.signal);
|
|
488
492
|
if ("error" in loaded) return { output: loaded.error, isError: true };
|
|
@@ -790,6 +794,10 @@ var WebBudget = class {
|
|
|
790
794
|
startTurn() {
|
|
791
795
|
this.fetches = 0;
|
|
792
796
|
}
|
|
797
|
+
/** Gives back a reservation, e.g. when the fetch was served from cache and cost nothing. */
|
|
798
|
+
refund() {
|
|
799
|
+
if (this.fetches > 0) this.fetches--;
|
|
800
|
+
}
|
|
793
801
|
reset() {
|
|
794
802
|
this.fetches = 0;
|
|
795
803
|
this.chars = 0;
|
|
@@ -1025,6 +1033,7 @@ Model ini sepertinya tidak mendukung tool calling. Coba model lain dengan /model
|
|
|
1025
1033
|
emit: (event) => this.onEvent(event),
|
|
1026
1034
|
ask: (req) => this.askPermission(req),
|
|
1027
1035
|
checkpoint: this.opts.checkpoint,
|
|
1036
|
+
refundFetch: () => this.webBudget.refund(),
|
|
1028
1037
|
addUsage: (u) => {
|
|
1029
1038
|
this.totalUsage.inputTokens += u.inputTokens;
|
|
1030
1039
|
this.totalUsage.outputTokens += u.outputTokens;
|
|
@@ -1591,7 +1600,7 @@ function createRuntime(opts) {
|
|
|
1591
1600
|
}
|
|
1592
1601
|
|
|
1593
1602
|
// src/version.ts
|
|
1594
|
-
var VERSION = true ? "0.4.0-beta.
|
|
1603
|
+
var VERSION = true ? "0.4.0-beta.14" : "0.0.0-dev";
|
|
1595
1604
|
|
|
1596
1605
|
// src/cli.ts
|
|
1597
1606
|
async function main() {
|
|
@@ -1653,7 +1662,7 @@ async function main() {
|
|
|
1653
1662
|
}
|
|
1654
1663
|
}
|
|
1655
1664
|
if (!process.stdin.isTTY) throw new ConfigError('Mode interaktif butuh terminal. Untuk skrip/CI pakai: bccli -p "tugas"');
|
|
1656
|
-
const { startInteractive } = await import("./ui-
|
|
1665
|
+
const { startInteractive } = await import("./ui-5BJA3UXH.js");
|
|
1657
1666
|
return startInteractive(rt, { initialPrompt: args.prompt, resume: args.resume, version: VERSION });
|
|
1658
1667
|
}
|
|
1659
1668
|
main().then(
|