@poncho-ai/cli 0.20.0 → 0.20.2
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/.turbo/turbo-build.log +5 -5
- package/CHANGELOG.md +12 -0
- package/dist/{chunk-RWLTBPVI.js → chunk-VRLHV23J.js} +45 -15
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/{run-interactive-ink-6OB3RT32.js → run-interactive-ink-2YFB7AEJ.js} +1 -1
- package/package.json +1 -1
- package/src/index.ts +24 -14
- package/src/web-ui-client.ts +19 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @poncho-ai/cli@0.20.
|
|
2
|
+
> @poncho-ai/cli@0.20.2 build /home/runner/work/poncho-ai/poncho-ai/packages/cli
|
|
3
3
|
> tsup src/index.ts src/cli.ts --format esm --dts
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/cli.ts, src/index.ts
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
[34mESM[39m Build start
|
|
10
10
|
[32mESM[39m [1mdist/cli.js [22m[32m94.00 B[39m
|
|
11
11
|
[32mESM[39m [1mdist/index.js [22m[32m857.00 B[39m
|
|
12
|
-
[32mESM[39m [1mdist/run-interactive-ink-
|
|
13
|
-
[32mESM[39m [1mdist/chunk-
|
|
14
|
-
[32mESM[39m ⚡️ Build success in
|
|
12
|
+
[32mESM[39m [1mdist/run-interactive-ink-2YFB7AEJ.js [22m[32m55.30 KB[39m
|
|
13
|
+
[32mESM[39m [1mdist/chunk-VRLHV23J.js [22m[32m384.02 KB[39m
|
|
14
|
+
[32mESM[39m ⚡️ Build success in 62ms
|
|
15
15
|
[34mDTS[39m Build start
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 3793ms
|
|
17
17
|
[32mDTS[39m [1mdist/cli.d.ts [22m[32m20.00 B[39m
|
|
18
18
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m3.59 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @poncho-ai/cli
|
|
2
2
|
|
|
3
|
+
## 0.20.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`dcb1b51`](https://github.com/cesr/poncho-ai/commit/dcb1b51ed3be9147c982ed75e3784de38e77bc2f) Thanks [@cesr](https://github.com/cesr)! - Fix polling fallback wiping approval buttons: hydrate pending approvals on each poll cycle so the approve/deny UI stays visible.
|
|
8
|
+
|
|
9
|
+
## 0.20.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`a9563b0`](https://github.com/cesr/poncho-ai/commit/a9563b03dfbdb6eb8cc9536be72b2bfd76c042ef) Thanks [@cesr](https://github.com/cesr)! - Fix approval resume dying on Vercel: wrap the post-approval tool execution and run resumption in waitUntil so the serverless function stays alive until the work completes.
|
|
14
|
+
|
|
3
15
|
## 0.20.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -2567,7 +2567,25 @@ var getWebUiClientScript = (markedSource2) => `
|
|
|
2567
2567
|
var payload = await api("/api/conversations/" + encodeURIComponent(conversationId));
|
|
2568
2568
|
if (state.activeConversationId !== conversationId) return;
|
|
2569
2569
|
if (payload.conversation) {
|
|
2570
|
-
|
|
2570
|
+
var allPending = [].concat(
|
|
2571
|
+
payload.conversation.pendingApprovals || [],
|
|
2572
|
+
);
|
|
2573
|
+
if (Array.isArray(payload.subagentPendingApprovals)) {
|
|
2574
|
+
payload.subagentPendingApprovals.forEach(function(sa) {
|
|
2575
|
+
var subIdShort = sa.subagentId && sa.subagentId.length > 12 ? sa.subagentId.slice(0, 12) + "..." : (sa.subagentId || "");
|
|
2576
|
+
allPending.push({
|
|
2577
|
+
approvalId: sa.approvalId,
|
|
2578
|
+
tool: sa.tool,
|
|
2579
|
+
input: sa.input,
|
|
2580
|
+
_subagentId: sa.subagentId,
|
|
2581
|
+
_subagentLabel: "subagent " + subIdShort,
|
|
2582
|
+
});
|
|
2583
|
+
});
|
|
2584
|
+
}
|
|
2585
|
+
state.activeMessages = hydratePendingApprovals(
|
|
2586
|
+
payload.conversation.messages || [],
|
|
2587
|
+
allPending,
|
|
2588
|
+
);
|
|
2571
2589
|
renderMessages(state.activeMessages, payload.hasActiveRun);
|
|
2572
2590
|
}
|
|
2573
2591
|
if (payload.hasActiveRun) {
|
|
@@ -7890,11 +7908,19 @@ var createRequestHandler = async (options) => {
|
|
|
7890
7908
|
}
|
|
7891
7909
|
conv.runtimeRunId = latestRunId || conv.runtimeRunId;
|
|
7892
7910
|
conv.pendingApprovals = [];
|
|
7911
|
+
conv.runStatus = "idle";
|
|
7893
7912
|
if (runContextTokens > 0) conv.contextTokens = runContextTokens;
|
|
7894
7913
|
if (runContextWindow > 0) conv.contextWindow = runContextWindow;
|
|
7895
7914
|
conv.updatedAt = Date.now();
|
|
7896
7915
|
await conversationStore.update(conv);
|
|
7897
7916
|
}
|
|
7917
|
+
} else {
|
|
7918
|
+
const conv = await conversationStore.get(conversationId);
|
|
7919
|
+
if (conv) {
|
|
7920
|
+
conv.runStatus = "idle";
|
|
7921
|
+
conv.updatedAt = Date.now();
|
|
7922
|
+
await conversationStore.update(conv);
|
|
7923
|
+
}
|
|
7898
7924
|
}
|
|
7899
7925
|
finishConversationStream(conversationId);
|
|
7900
7926
|
activeConversationRuns.delete(conversationId);
|
|
@@ -8115,20 +8141,20 @@ var createRequestHandler = async (options) => {
|
|
|
8115
8141
|
return { response };
|
|
8116
8142
|
}
|
|
8117
8143
|
};
|
|
8144
|
+
let waitUntilHook;
|
|
8145
|
+
if (process.env.VERCEL) {
|
|
8146
|
+
try {
|
|
8147
|
+
const modName = "@vercel/functions";
|
|
8148
|
+
const mod = await import(
|
|
8149
|
+
/* webpackIgnore: true */
|
|
8150
|
+
modName
|
|
8151
|
+
);
|
|
8152
|
+
waitUntilHook = mod.waitUntil;
|
|
8153
|
+
} catch {
|
|
8154
|
+
}
|
|
8155
|
+
}
|
|
8118
8156
|
const messagingBridges = [];
|
|
8119
8157
|
if (config?.messaging && config.messaging.length > 0) {
|
|
8120
|
-
let waitUntilHook;
|
|
8121
|
-
if (process.env.VERCEL) {
|
|
8122
|
-
try {
|
|
8123
|
-
const modName = "@vercel/functions";
|
|
8124
|
-
const mod = await import(
|
|
8125
|
-
/* webpackIgnore: true */
|
|
8126
|
-
modName
|
|
8127
|
-
);
|
|
8128
|
-
waitUntilHook = mod.waitUntil;
|
|
8129
|
-
} catch {
|
|
8130
|
-
}
|
|
8131
|
-
}
|
|
8132
8158
|
for (const channelConfig of config.messaging) {
|
|
8133
8159
|
if (channelConfig.platform === "slack") {
|
|
8134
8160
|
const adapter = new SlackAdapter({
|
|
@@ -8578,9 +8604,10 @@ data: ${JSON.stringify(data)}
|
|
|
8578
8604
|
return;
|
|
8579
8605
|
}
|
|
8580
8606
|
foundConversation.pendingApprovals = [];
|
|
8607
|
+
foundConversation.runStatus = "running";
|
|
8581
8608
|
await conversationStore.update(foundConversation);
|
|
8582
8609
|
const checkpointRef = allApprovals[0];
|
|
8583
|
-
|
|
8610
|
+
const resumeWork = (async () => {
|
|
8584
8611
|
const toolContext = {
|
|
8585
8612
|
runId: checkpointRef.runId,
|
|
8586
8613
|
agentId: identity.id,
|
|
@@ -8621,6 +8648,9 @@ data: ${JSON.stringify(data)}
|
|
|
8621
8648
|
toolResults
|
|
8622
8649
|
);
|
|
8623
8650
|
})();
|
|
8651
|
+
if (waitUntilHook) {
|
|
8652
|
+
waitUntilHook(resumeWork);
|
|
8653
|
+
}
|
|
8624
8654
|
writeJson(response, 200, { ok: true, approvalId, approved, batchComplete: true });
|
|
8625
8655
|
return;
|
|
8626
8656
|
}
|
|
@@ -9649,7 +9679,7 @@ var runInteractive = async (workingDir, params) => {
|
|
|
9649
9679
|
await harness.initialize();
|
|
9650
9680
|
const identity = await ensureAgentIdentity2(workingDir);
|
|
9651
9681
|
try {
|
|
9652
|
-
const { runInteractiveInk } = await import("./run-interactive-ink-
|
|
9682
|
+
const { runInteractiveInk } = await import("./run-interactive-ink-2YFB7AEJ.js");
|
|
9653
9683
|
await runInteractiveInk({
|
|
9654
9684
|
harness,
|
|
9655
9685
|
params,
|
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -2081,11 +2081,19 @@ export const createRequestHandler = async (options?: {
|
|
|
2081
2081
|
}
|
|
2082
2082
|
conv.runtimeRunId = latestRunId || conv.runtimeRunId;
|
|
2083
2083
|
conv.pendingApprovals = [];
|
|
2084
|
+
conv.runStatus = "idle";
|
|
2084
2085
|
if (runContextTokens > 0) conv.contextTokens = runContextTokens;
|
|
2085
2086
|
if (runContextWindow > 0) conv.contextWindow = runContextWindow;
|
|
2086
2087
|
conv.updatedAt = Date.now();
|
|
2087
2088
|
await conversationStore.update(conv);
|
|
2088
2089
|
}
|
|
2090
|
+
} else {
|
|
2091
|
+
const conv = await conversationStore.get(conversationId);
|
|
2092
|
+
if (conv) {
|
|
2093
|
+
conv.runStatus = "idle";
|
|
2094
|
+
conv.updatedAt = Date.now();
|
|
2095
|
+
await conversationStore.update(conv);
|
|
2096
|
+
}
|
|
2089
2097
|
}
|
|
2090
2098
|
|
|
2091
2099
|
finishConversationStream(conversationId);
|
|
@@ -2340,21 +2348,19 @@ export const createRequestHandler = async (options?: {
|
|
|
2340
2348
|
},
|
|
2341
2349
|
};
|
|
2342
2350
|
|
|
2343
|
-
|
|
2344
|
-
if (
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
const mod = await import(/* webpackIgnore: true */ modName);
|
|
2352
|
-
waitUntilHook = mod.waitUntil;
|
|
2353
|
-
} catch {
|
|
2354
|
-
// @vercel/functions not installed -- fall through to no-op.
|
|
2355
|
-
}
|
|
2351
|
+
let waitUntilHook: ((promise: Promise<unknown>) => void) | undefined;
|
|
2352
|
+
if (process.env.VERCEL) {
|
|
2353
|
+
try {
|
|
2354
|
+
const modName = "@vercel/functions";
|
|
2355
|
+
const mod = await import(/* webpackIgnore: true */ modName);
|
|
2356
|
+
waitUntilHook = mod.waitUntil;
|
|
2357
|
+
} catch {
|
|
2358
|
+
// @vercel/functions not installed -- fall through to no-op.
|
|
2356
2359
|
}
|
|
2360
|
+
}
|
|
2357
2361
|
|
|
2362
|
+
const messagingBridges: AgentBridge[] = [];
|
|
2363
|
+
if (config?.messaging && config.messaging.length > 0) {
|
|
2358
2364
|
for (const channelConfig of config.messaging) {
|
|
2359
2365
|
if (channelConfig.platform === "slack") {
|
|
2360
2366
|
const adapter = new SlackAdapter({
|
|
@@ -2896,12 +2902,13 @@ export const createRequestHandler = async (options?: {
|
|
|
2896
2902
|
|
|
2897
2903
|
// All approvals in the batch are decided — execute and resume
|
|
2898
2904
|
foundConversation.pendingApprovals = [];
|
|
2905
|
+
foundConversation.runStatus = "running";
|
|
2899
2906
|
await conversationStore.update(foundConversation);
|
|
2900
2907
|
|
|
2901
2908
|
// Use the first approval as the checkpoint reference (all share the same checkpoint data)
|
|
2902
2909
|
const checkpointRef = allApprovals[0]!;
|
|
2903
2910
|
|
|
2904
|
-
|
|
2911
|
+
const resumeWork = (async () => {
|
|
2905
2912
|
const toolContext = {
|
|
2906
2913
|
runId: checkpointRef.runId,
|
|
2907
2914
|
agentId: identity.id,
|
|
@@ -2949,6 +2956,9 @@ export const createRequestHandler = async (options?: {
|
|
|
2949
2956
|
toolResults,
|
|
2950
2957
|
);
|
|
2951
2958
|
})();
|
|
2959
|
+
if (waitUntilHook) {
|
|
2960
|
+
waitUntilHook(resumeWork);
|
|
2961
|
+
}
|
|
2952
2962
|
|
|
2953
2963
|
writeJson(response, 200, { ok: true, approvalId, approved, batchComplete: true });
|
|
2954
2964
|
return;
|
package/src/web-ui-client.ts
CHANGED
|
@@ -1036,7 +1036,25 @@ export const getWebUiClientScript = (markedSource: string): string => `
|
|
|
1036
1036
|
var payload = await api("/api/conversations/" + encodeURIComponent(conversationId));
|
|
1037
1037
|
if (state.activeConversationId !== conversationId) return;
|
|
1038
1038
|
if (payload.conversation) {
|
|
1039
|
-
|
|
1039
|
+
var allPending = [].concat(
|
|
1040
|
+
payload.conversation.pendingApprovals || [],
|
|
1041
|
+
);
|
|
1042
|
+
if (Array.isArray(payload.subagentPendingApprovals)) {
|
|
1043
|
+
payload.subagentPendingApprovals.forEach(function(sa) {
|
|
1044
|
+
var subIdShort = sa.subagentId && sa.subagentId.length > 12 ? sa.subagentId.slice(0, 12) + "..." : (sa.subagentId || "");
|
|
1045
|
+
allPending.push({
|
|
1046
|
+
approvalId: sa.approvalId,
|
|
1047
|
+
tool: sa.tool,
|
|
1048
|
+
input: sa.input,
|
|
1049
|
+
_subagentId: sa.subagentId,
|
|
1050
|
+
_subagentLabel: "subagent " + subIdShort,
|
|
1051
|
+
});
|
|
1052
|
+
});
|
|
1053
|
+
}
|
|
1054
|
+
state.activeMessages = hydratePendingApprovals(
|
|
1055
|
+
payload.conversation.messages || [],
|
|
1056
|
+
allPending,
|
|
1057
|
+
);
|
|
1040
1058
|
renderMessages(state.activeMessages, payload.hasActiveRun);
|
|
1041
1059
|
}
|
|
1042
1060
|
if (payload.hasActiveRun) {
|