@chipschat/acp 1.0.8 → 1.0.10
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/README.md +6 -3
- package/dist/THIRD-PARTY-NOTICES.md +1 -1
- package/dist/main.js +19 -1
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -147,7 +147,7 @@ minutes and loaded again with its memory. Fourteen runs, none failed, $0.35, all
|
|
|
147
147
|
| Context gauge, cost | `usage_update` (`used`/`size`; `cost` in USD, the turn's share) |
|
|
148
148
|
| The reply | `agent_message_chunk`s gathered into one message; `NO_REPLY` alone is the turn passed |
|
|
149
149
|
| Files in the reply | each `MEDIA:<path>` line of the reply sent as an upload with its words, only from the agent's folder (`sendAnswer`); the post says why one could not go |
|
|
150
|
-
| Approval card | `session/request_permission
|
|
150
|
+
| Approval card | `session/request_permission`, asked in the agent's own words where the call has a `description` (Claude Code's commands: "Syntax-check game.js? `node --check game.js`"), else "Allow it to" and the call's title; allowed always picks `allow_always`, except for a command, which picks `allow_once` since Chips remembers it by how each part starts (Chips ADR 0239); no picks `reject_once`; Stop answers `cancelled`; the card hears how the call went |
|
|
151
151
|
| Question card | `elicitation/create` form of up to four choice or yes/no fields; anything else is declined |
|
|
152
152
|
| Stop | `session/cancel` |
|
|
153
153
|
| Steer | the next prompt of the same run, after `session/cancel` when it interrupts |
|
|
@@ -216,7 +216,10 @@ it kept. The scratch Chips, the link and the run come from Chips's `tools/connec
|
|
|
216
216
|
## Release
|
|
217
217
|
|
|
218
218
|
`npm run release` builds `dist/main.js`, one file with the SDK and everything else bundled in, and
|
|
219
|
-
`dist/THIRD-PARTY-NOTICES.md` beside it; runs the tests; and packs `chipschat-acp-<version>.tgz`.
|
|
220
|
-
|
|
219
|
+
`dist/THIRD-PARTY-NOTICES.md` beside it; runs the tests; and packs `chipschat-acp-<version>.tgz`. To
|
|
220
|
+
publish, put the new version in `package.json` (`npm version <version> --no-git-tag-version`), commit
|
|
221
|
+
it and push to `main`: GitHub's Publish workflow (`.github/workflows/publish.yml`) tests it and
|
|
222
|
+
publishes it to npm, which trusts that workflow, so nobody signs in. Don't also run `npm publish`:
|
|
223
|
+
the two race. A version's major is the Chips protocol it speaks, and Chips's card names that major
|
|
221
224
|
(Chips ADR 0218): a fix is a minor or a patch, and reaches every card of its major the day it is
|
|
222
225
|
published.
|
package/dist/main.js
CHANGED
|
@@ -27938,7 +27938,7 @@ ${files.join("\n")}`;
|
|
|
27938
27938
|
const input2 = call["rawInput"];
|
|
27939
27939
|
const asked = turn.run.approval({
|
|
27940
27940
|
action: { kind: `acp.${slugOf(kind2)}`, input: input2 ?? {} },
|
|
27941
|
-
question:
|
|
27941
|
+
question: questionFor(title2, input2),
|
|
27942
27942
|
lasts: "once",
|
|
27943
27943
|
risk: riskOf(kind2),
|
|
27944
27944
|
...input2 === void 0 ? {} : { preview: { format: "json", body: JSON.stringify(input2, null, 2).slice(0, 2e5) } },
|
|
@@ -28055,6 +28055,24 @@ function slugOf(word) {
|
|
|
28055
28055
|
function lowerFirst(text) {
|
|
28056
28056
|
return text.length === 0 ? text : `${text[0]?.toLowerCase() ?? ""}${text.slice(1)}`;
|
|
28057
28057
|
}
|
|
28058
|
+
var QUESTION_MAX = 200;
|
|
28059
|
+
function questionFor(title2, input2) {
|
|
28060
|
+
const fields = typeof input2 === "object" && input2 !== null ? input2 : {};
|
|
28061
|
+
const said = oneLine(fields["description"])?.replace(/[\s.?!:;,]+$/, "");
|
|
28062
|
+
if (said === void 0 || said === "") return `Allow it to ${lowerFirst(title2)}?`.slice(0, QUESTION_MAX);
|
|
28063
|
+
const asked = `${clip(said, QUESTION_MAX - 1)}?`;
|
|
28064
|
+
const command = oneLine(Array.isArray(fields["command"]) ? fields["command"].join(" ") : fields["command"]);
|
|
28065
|
+
const room = QUESTION_MAX - asked.length - 3;
|
|
28066
|
+
if (command === void 0 || command.includes("`") || room < 12) return asked;
|
|
28067
|
+
return `${asked} \`${clip(command, room)}\``;
|
|
28068
|
+
}
|
|
28069
|
+
function oneLine(value) {
|
|
28070
|
+
const line = typeof value === "string" ? value.replace(/\s+/g, " ").trim() : "";
|
|
28071
|
+
return line === "" ? void 0 : line;
|
|
28072
|
+
}
|
|
28073
|
+
function clip(text, max) {
|
|
28074
|
+
return text.length <= max ? text : `${text.slice(0, max - 1)}\u2026`;
|
|
28075
|
+
}
|
|
28058
28076
|
function riskOf(kind2) {
|
|
28059
28077
|
if (kind2 === "delete") return ["destructive"];
|
|
28060
28078
|
if (kind2 === "fetch") return ["external"];
|
package/package.json
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chipschat/acp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
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
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/arjungupta99/chips-acp.git"
|
|
9
|
+
},
|
|
6
10
|
"type": "module",
|
|
7
11
|
"engines": {
|
|
8
12
|
"node": ">=22.19.0"
|