@chipschat/acp 1.0.39 → 1.0.40
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/THIRD-PARTY-NOTICES.md +1 -1
- package/dist/main.js +23 -6
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -27995,7 +27995,11 @@ var CODEX_MODES = [
|
|
|
27995
27995
|
var ANTIGRAVITY_MODES = [
|
|
27996
27996
|
{ id: "default", name: "Default", words: "Asks before edits and commands its settings don't allow." },
|
|
27997
27997
|
{ id: "accept-edits", name: "Accept edits", words: "Edits files in its folder without asking. Commands still ask." },
|
|
27998
|
-
{
|
|
27998
|
+
{
|
|
27999
|
+
id: "auto",
|
|
28000
|
+
name: "Auto",
|
|
28001
|
+
words: "Edits files and runs commands in its sandbox without asking. Asks before a command outside it that it can't undo."
|
|
28002
|
+
}
|
|
27999
28003
|
];
|
|
28000
28004
|
var GOOSE_MODES = [
|
|
28001
28005
|
{ id: "approve", name: "Approve", words: "Asks before every tool call its own permission list doesn't settle." },
|
|
@@ -31510,7 +31514,10 @@ ${files.join("\n")}`;
|
|
|
31510
31514
|
const input2 = call["rawInput"];
|
|
31511
31515
|
const asked = turn.run.approval({
|
|
31512
31516
|
action: { kind: `acp.${slugOf(kind2)}`, input: input2 ?? {} },
|
|
31513
|
-
question: questionFor(title2, input2
|
|
31517
|
+
question: questionFor(title2, input2, {
|
|
31518
|
+
...typeof call["name"] === "string" ? { tool: call["name"] } : {},
|
|
31519
|
+
...typeof call["kind"] === "string" ? { kind: call["kind"] } : {}
|
|
31520
|
+
}),
|
|
31514
31521
|
lasts: "once",
|
|
31515
31522
|
risk: riskOf(kind2),
|
|
31516
31523
|
...input2 === void 0 ? {} : { preview: { format: "json", body: JSON.stringify(input2, null, 2).slice(0, 2e5) } },
|
|
@@ -31659,16 +31666,26 @@ function lowerFirst(text) {
|
|
|
31659
31666
|
return text.length === 0 ? text : `${text[0]?.toLowerCase() ?? ""}${text.slice(1)}`;
|
|
31660
31667
|
}
|
|
31661
31668
|
var QUESTION_MAX = 200;
|
|
31662
|
-
function questionFor(title2, input2) {
|
|
31669
|
+
function questionFor(title2, input2, call = {}) {
|
|
31663
31670
|
const fields = typeof input2 === "object" && input2 !== null ? input2 : {};
|
|
31664
|
-
const said = oneLine(fields["description"])?.replace(/[\s.?!:;,]+$/, "");
|
|
31665
|
-
|
|
31671
|
+
const said = (oneLine(fields["description"]) ?? oneLine(fields["toolSummary"]))?.replace(/[\s.?!:;,]+$/, "");
|
|
31672
|
+
const given = fields["command"] ?? fields["CommandLine"];
|
|
31673
|
+
const command = oneLine(Array.isArray(given) ? given.join(" ") : given);
|
|
31674
|
+
if (said === void 0 || said === "") return `Allow it to ${titleSaid(title2, command, call)}?`.slice(0, QUESTION_MAX);
|
|
31666
31675
|
const asked = `${clip2(said, QUESTION_MAX - 1)}?`;
|
|
31667
|
-
const command = oneLine(Array.isArray(fields["command"]) ? fields["command"].join(" ") : fields["command"]);
|
|
31668
31676
|
const room = QUESTION_MAX - asked.length - 3;
|
|
31669
31677
|
if (command === void 0 || command.includes("`") || room < 12) return asked;
|
|
31670
31678
|
return `${asked} \`${clip2(command, room)}\``;
|
|
31671
31679
|
}
|
|
31680
|
+
var FILE_VERBS = { read: "read", edit: "edit", delete: "delete", move: "move" };
|
|
31681
|
+
function titleSaid(title2, command, call) {
|
|
31682
|
+
const bare = title2.replace(/^`(.*)`$/s, "$1").trim();
|
|
31683
|
+
if (command !== void 0 && bare === command && !command.includes("`")) return `run \`${command}\``;
|
|
31684
|
+
const file3 = /^File\s+(\S.*)$/s.exec(title2);
|
|
31685
|
+
const verb = /^([a-z]+)_file$/.exec(call.tool ?? "")?.[1] ?? FILE_VERBS[call.kind ?? ""];
|
|
31686
|
+
if (file3 !== null && verb !== void 0) return `${verb} ${file3[1]}`;
|
|
31687
|
+
return lowerFirst(title2);
|
|
31688
|
+
}
|
|
31672
31689
|
function oneLine(value) {
|
|
31673
31690
|
const line = typeof value === "string" ? value.replace(/\s+/g, " ").trim() : "";
|
|
31674
31691
|
return line === "" ? void 0 : line;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chipschat/acp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.40",
|
|
4
4
|
"description": "An agent that speaks the Agent Client Protocol, as a Chips harness of its kind: agents made from Chips, each in a folder of its own, each room a session.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|