approval-box 0.1.22 → 0.1.23
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/cli.mjs +16 -16
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -12089,7 +12089,9 @@ async function runDaemon() {
|
|
|
12089
12089
|
async function deliver(item) {
|
|
12090
12090
|
const existing = journal[item.decision_id];
|
|
12091
12091
|
if (existing) return;
|
|
12092
|
-
const
|
|
12092
|
+
const verify = `
|
|
12093
|
+
\u78BA\u304B\u3081\u308B\u6642\u306F\u3001Approval Box\u306E get_decision \u3092 decision_id="${item.decision_id}" \u3067\u547C\u3076\u3068\u3001\u540C\u3058\u7B54\u3048\u304C\u8FD4\u308A\u307E\u3059\u3002`;
|
|
12094
|
+
const text2 = (item.attachments?.length ? item.text + await saveAll(api, item.decision_id, item.attachments) : item.text) + verify;
|
|
12093
12095
|
journal[item.decision_id] = { delivery_id: item.delivery_id, channel_id: item.route.channel_id, harness: item.route.harness, state: "sending", at: (/* @__PURE__ */ new Date()).toISOString() };
|
|
12094
12096
|
save();
|
|
12095
12097
|
const entry = journal[item.decision_id];
|
|
@@ -15905,7 +15907,7 @@ function claudeChannelIsCurrent(profile, channelId, parent) {
|
|
|
15905
15907
|
}
|
|
15906
15908
|
|
|
15907
15909
|
// src/version.ts
|
|
15908
|
-
var VERSION = true ? "0.1.
|
|
15910
|
+
var VERSION = true ? "0.1.23" : "0.0.0-dev";
|
|
15909
15911
|
function osName() {
|
|
15910
15912
|
return process.platform === "darwin" ? "macos" : process.platform === "win32" ? "windows" : process.platform;
|
|
15911
15913
|
}
|
|
@@ -16080,6 +16082,7 @@ async function channelFor(harness, clientName, meta) {
|
|
|
16080
16082
|
remember(key, channel.channel_id, false);
|
|
16081
16083
|
return channel.channel_id;
|
|
16082
16084
|
}
|
|
16085
|
+
var ARRIVAL = "\u7B54\u3048\u306F\u3001\u3042\u3068\u3067\u3053\u306E\u4F1A\u8A71\u3078\u300C[Approval Box]\u300D\u3067\u59CB\u307E\u308B\u6587\u3068\u3057\u3066\u81EA\u52D5\u3067\u5C4A\u304D\u307E\u3059\u3002\u4F5C\u696D\u306E\u9014\u4E2D\u306A\u3089\u3001\u307B\u304B\u306E\u9053\u5177\u306E\u7D50\u679C\u3084 hook \u306E\u901A\u77E5\u3068\u4E00\u7DD2\u306B\u5C4A\u304F\u3053\u3068\u304C\u3042\u308A\u307E\u3059\u3002\u5C4A\u3044\u305F\u7B54\u3048\u306F get_decision \u3067\u78BA\u304B\u3081\u3089\u308C\u307E\u3059\u3002";
|
|
16083
16086
|
function receiveGuide(harness, channelId) {
|
|
16084
16087
|
if (harness === "codex" || harness === "claude") return "";
|
|
16085
16088
|
const line = waitProcessCommandLine(channelReceiveProcess(runtimeEntry("receive"), channelId));
|
|
@@ -16092,6 +16095,11 @@ function receiveGuide(harness, channelId) {
|
|
|
16092
16095
|
);
|
|
16093
16096
|
return lines.join("\n");
|
|
16094
16097
|
}
|
|
16098
|
+
function announced(message, decision, channelId) {
|
|
16099
|
+
return text(`${message}
|
|
16100
|
+
|
|
16101
|
+
${JSON.stringify(decision)}`, { ...decision, steer_channel: { channel_id: channelId }, guide: message });
|
|
16102
|
+
}
|
|
16095
16103
|
function text(value, structured, isError = false) {
|
|
16096
16104
|
return { content: [{ type: "text", text: value }], ...structured ? { structuredContent: structured } : {}, ...isError ? { isError: true } : {} };
|
|
16097
16105
|
}
|
|
@@ -16138,10 +16146,8 @@ ${JSON.stringify({ items })}`, { items });
|
|
|
16138
16146
|
};
|
|
16139
16147
|
try {
|
|
16140
16148
|
const decision = await api.call("POST", "/decisions", body);
|
|
16141
|
-
const message = `\u7533\u8ACB\u3057\u307E\u3057\u305F: ${decision.decision_id}\u300C${decision.title}\u300D\u3002\
|
|
16142
|
-
return
|
|
16143
|
-
|
|
16144
|
-
${JSON.stringify(decision)}`, { ...decision, steer_channel: { channel_id: channelId } });
|
|
16149
|
+
const message = `\u7533\u8ACB\u3057\u307E\u3057\u305F: ${decision.decision_id}\u300C${decision.title}\u300D\u3002${ARRIVAL}\u5F85\u3063\u3066\u547C\u3073\u76F4\u3055\u305A\u3001\u4ED6\u306E\u4F5C\u696D\u3092\u7D9A\u3051\u308B\u304B\u30BF\u30FC\u30F3\u3092\u7D42\u3048\u3066\u304F\u3060\u3055\u3044\u3002`;
|
|
16150
|
+
return announced(`${message}${receiveGuide(harness, channelId)}`, decision, channelId);
|
|
16145
16151
|
} catch (error) {
|
|
16146
16152
|
if (error instanceof ServerError && error.code === "confirm_required") {
|
|
16147
16153
|
const decisions = error.body.decisions ?? [];
|
|
@@ -16179,18 +16185,14 @@ ${JSON.stringify({ error: "duplicate_suspected", existing })}`, { error: "duplic
|
|
|
16179
16185
|
const channelId = await channelFor(harness, clientName, request.params._meta);
|
|
16180
16186
|
const decision = await api.call("POST", `/decisions/${encodeURIComponent(String(decision_id))}/amend`, { ...rest, route: { channel_id: channelId, harness } });
|
|
16181
16187
|
lastChannel = channelId;
|
|
16182
|
-
return
|
|
16183
|
-
|
|
16184
|
-
${JSON.stringify(decision)}`, { ...decision, steer_channel: { channel_id: channelId } });
|
|
16188
|
+
return announced(`\u76F4\u3057\u307E\u3057\u305F: ${decision.decision_id} version=${decision.version}${receiveGuide(harness, channelId)}`, decision, channelId);
|
|
16185
16189
|
}
|
|
16186
16190
|
if (name === "resume_decision") {
|
|
16187
16191
|
const channelId = await channelFor(harness, clientName, request.params._meta);
|
|
16188
16192
|
const decision = await api.call("POST", `/decisions/${encodeURIComponent(String(args.decision_id))}/resume`, { channel_id: channelId, harness });
|
|
16189
16193
|
lastChannel = channelId;
|
|
16190
|
-
const head = decision.answer_text ? String(decision.answer_text) : `\u518D\u958B\u3057\u307E\u3057\u305F: ${decision.decision_id}\u3002
|
|
16191
|
-
return
|
|
16192
|
-
|
|
16193
|
-
${JSON.stringify(decision)}`, { ...decision, steer_channel: { channel_id: channelId } });
|
|
16194
|
+
const head = decision.answer_text ? String(decision.answer_text) : `\u518D\u958B\u3057\u307E\u3057\u305F: ${decision.decision_id}\u3002${ARRIVAL}`;
|
|
16195
|
+
return announced(`${head}${decision.answer_text ? "" : receiveGuide(harness, channelId)}`, decision, channelId);
|
|
16194
16196
|
}
|
|
16195
16197
|
if (name === "cancel_decision") {
|
|
16196
16198
|
const decision = await api.call("POST", `/decisions/${encodeURIComponent(String(args.decision_id))}/cancel`, { reason: args.reason });
|
|
@@ -16232,9 +16234,7 @@ ${JSON.stringify(decision)}`, decision);
|
|
|
16232
16234
|
route: { channel_id: channelId, harness }
|
|
16233
16235
|
});
|
|
16234
16236
|
const message = `\u63A5\u7D9A\u30C6\u30B9\u30C8\u306E\u7533\u8ACB\u3092\u9001\u308A\u307E\u3057\u305F\uFF08${decision.decision_id}\uFF09\u3002\u5229\u7528\u8005\u306B\u30A2\u30D7\u30EA\u304BWeb\u7248\u3067\u7B54\u3048\u308B\u3088\u3046\u4F1D\u3048\u3066\u304F\u3060\u3055\u3044\u3002\u7B54\u3048\u304C\u3053\u306E\u4F1A\u8A71\u3078\u5C4A\u3044\u305F\u3089\u3001\u305D\u3053\u306B\u66F8\u304B\u308C\u305F\u78BA\u8A8D\u30B3\u30FC\u30C9\u3067 confirm_setup_test \u3092\u547C\u3093\u3067\u304F\u3060\u3055\u3044\u3002`;
|
|
16235
|
-
return
|
|
16236
|
-
|
|
16237
|
-
${JSON.stringify(decision)}`, { ...decision, steer_channel: { channel_id: channelId } });
|
|
16237
|
+
return announced(`${message}${receiveGuide(harness, channelId)}`, decision, channelId);
|
|
16238
16238
|
}
|
|
16239
16239
|
if (name === "confirm_setup_test") {
|
|
16240
16240
|
const result = await api.call("POST", "/setup-test/confirm", { decision_id: args.decision_id, code: String(args.code) });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "approval-box",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.23",
|
|
4
4
|
"description": "Approval Box connector: lets Claude Code, Codex, Cursor and Grok ask you for a decision, and steers your answer back into the same session.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://approval-box.kitepon.dev",
|