@poncho-ai/cli 0.20.0 → 0.20.1

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @poncho-ai/cli@0.20.0 build /home/runner/work/poncho-ai/poncho-ai/packages/cli
2
+ > @poncho-ai/cli@0.20.1 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
  CLI Building entry: src/cli.ts, src/index.ts
@@ -8,11 +8,11 @@
8
8
  CLI Target: es2022
9
9
  ESM Build start
10
10
  ESM dist/cli.js 94.00 B
11
+ ESM dist/run-interactive-ink-S3D42QQY.js 55.30 KB
12
+ ESM dist/chunk-J4OZUXG5.js 383.23 KB
11
13
  ESM dist/index.js 857.00 B
12
- ESM dist/run-interactive-ink-6OB3RT32.js 55.30 KB
13
- ESM dist/chunk-RWLTBPVI.js 382.88 KB
14
- ESM ⚡️ Build success in 65ms
14
+ ESM ⚡️ Build success in 60ms
15
15
  DTS Build start
16
- DTS ⚡️ Build success in 3728ms
16
+ DTS ⚡️ Build success in 3870ms
17
17
  DTS dist/cli.d.ts 20.00 B
18
18
  DTS dist/index.d.ts 3.59 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @poncho-ai/cli
2
2
 
3
+ ## 0.20.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`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.
8
+
3
9
  ## 0.20.0
4
10
 
5
11
  ### Minor Changes
@@ -7890,11 +7890,19 @@ var createRequestHandler = async (options) => {
7890
7890
  }
7891
7891
  conv.runtimeRunId = latestRunId || conv.runtimeRunId;
7892
7892
  conv.pendingApprovals = [];
7893
+ conv.runStatus = "idle";
7893
7894
  if (runContextTokens > 0) conv.contextTokens = runContextTokens;
7894
7895
  if (runContextWindow > 0) conv.contextWindow = runContextWindow;
7895
7896
  conv.updatedAt = Date.now();
7896
7897
  await conversationStore.update(conv);
7897
7898
  }
7899
+ } else {
7900
+ const conv = await conversationStore.get(conversationId);
7901
+ if (conv) {
7902
+ conv.runStatus = "idle";
7903
+ conv.updatedAt = Date.now();
7904
+ await conversationStore.update(conv);
7905
+ }
7898
7906
  }
7899
7907
  finishConversationStream(conversationId);
7900
7908
  activeConversationRuns.delete(conversationId);
@@ -8115,20 +8123,20 @@ var createRequestHandler = async (options) => {
8115
8123
  return { response };
8116
8124
  }
8117
8125
  };
8126
+ let waitUntilHook;
8127
+ if (process.env.VERCEL) {
8128
+ try {
8129
+ const modName = "@vercel/functions";
8130
+ const mod = await import(
8131
+ /* webpackIgnore: true */
8132
+ modName
8133
+ );
8134
+ waitUntilHook = mod.waitUntil;
8135
+ } catch {
8136
+ }
8137
+ }
8118
8138
  const messagingBridges = [];
8119
8139
  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
8140
  for (const channelConfig of config.messaging) {
8133
8141
  if (channelConfig.platform === "slack") {
8134
8142
  const adapter = new SlackAdapter({
@@ -8578,9 +8586,10 @@ data: ${JSON.stringify(data)}
8578
8586
  return;
8579
8587
  }
8580
8588
  foundConversation.pendingApprovals = [];
8589
+ foundConversation.runStatus = "running";
8581
8590
  await conversationStore.update(foundConversation);
8582
8591
  const checkpointRef = allApprovals[0];
8583
- void (async () => {
8592
+ const resumeWork = (async () => {
8584
8593
  const toolContext = {
8585
8594
  runId: checkpointRef.runId,
8586
8595
  agentId: identity.id,
@@ -8621,6 +8630,9 @@ data: ${JSON.stringify(data)}
8621
8630
  toolResults
8622
8631
  );
8623
8632
  })();
8633
+ if (waitUntilHook) {
8634
+ waitUntilHook(resumeWork);
8635
+ }
8624
8636
  writeJson(response, 200, { ok: true, approvalId, approved, batchComplete: true });
8625
8637
  return;
8626
8638
  }
@@ -9649,7 +9661,7 @@ var runInteractive = async (workingDir, params) => {
9649
9661
  await harness.initialize();
9650
9662
  const identity = await ensureAgentIdentity2(workingDir);
9651
9663
  try {
9652
- const { runInteractiveInk } = await import("./run-interactive-ink-6OB3RT32.js");
9664
+ const { runInteractiveInk } = await import("./run-interactive-ink-S3D42QQY.js");
9653
9665
  await runInteractiveInk({
9654
9666
  harness,
9655
9667
  params,
package/dist/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  main
4
- } from "./chunk-RWLTBPVI.js";
4
+ } from "./chunk-J4OZUXG5.js";
5
5
 
6
6
  // src/cli.ts
7
7
  void main();
package/dist/index.js CHANGED
@@ -23,7 +23,7 @@ import {
23
23
  runTests,
24
24
  startDevServer,
25
25
  updateAgentGuidance
26
- } from "./chunk-RWLTBPVI.js";
26
+ } from "./chunk-J4OZUXG5.js";
27
27
  export {
28
28
  addSkill,
29
29
  buildCli,
@@ -2,7 +2,7 @@ import {
2
2
  consumeFirstRunIntro,
3
3
  inferConversationTitle,
4
4
  resolveHarnessEnvironment
5
- } from "./chunk-RWLTBPVI.js";
5
+ } from "./chunk-J4OZUXG5.js";
6
6
 
7
7
  // src/run-interactive-ink.ts
8
8
  import * as readline from "readline";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@poncho-ai/cli",
3
- "version": "0.20.0",
3
+ "version": "0.20.1",
4
4
  "description": "CLI for building and deploying AI agents",
5
5
  "repository": {
6
6
  "type": "git",
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
- const messagingBridges: AgentBridge[] = [];
2344
- if (config?.messaging && config.messaging.length > 0) {
2345
- let waitUntilHook: ((promise: Promise<unknown>) => void) | undefined;
2346
- if (process.env.VERCEL) {
2347
- try {
2348
- // Dynamic require via variable so TypeScript doesn't attempt static
2349
- // resolution of @vercel/functions (only present in Vercel deployments).
2350
- const modName = "@vercel/functions";
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
- void (async () => {
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;