@pouchy_ai/companion-sdk 0.18.0 → 0.18.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.
package/CHANGELOG.md CHANGED
@@ -12,6 +12,20 @@ a protocol bump is always called out explicitly here.
12
12
 
13
13
  ## [Unreleased]
14
14
 
15
+ ## [0.18.1] - 2026-07-08
16
+
17
+ ### Changed
18
+
19
+ - `confirmAction()` return type widened: `status` may now be `'exec_failed'` and
20
+ the response carries an optional `retryable` flag. When an approved **idempotent**
21
+ action (a wallet payment) fails on a transient error, the server no longer burns
22
+ the confirmation — it returns `{ status: 'exec_failed', retryable: true }`, and
23
+ you MAY re-call `confirmAction(sameConfirmId, true)` to re-run it (the server
24
+ dedupes a partial first attempt on the confirmId). Non-idempotent actions (a
25
+ friend message, a skill POST) stay strictly single-use and are never retryable.
26
+ Additive + backwards-compatible: existing `'approved' | 'denied'` handling is
27
+ unaffected. No wire-protocol change.
28
+
15
29
  ## [0.18.0] - 2026-07-08
16
30
 
17
31
  ### Added
package/dist/client.d.ts CHANGED
@@ -438,12 +438,19 @@ export declare class CompanionClient {
438
438
  * approval the recorded action runs server-side; its result comes back as
439
439
  * `outcome` in this response (render it where the user tapped) AND as a
440
440
  * normal companion.message on the stream (so the conversation shows it).
441
- * A denial returns/emits a brief decline the same way. One-time:
442
- * re-resolving a settled confirmId fails with 409. */
441
+ * A denial returns/emits a brief decline the same way. Single-use:
442
+ * re-resolving a settled confirmId fails with 409.
443
+ *
444
+ * RETRY: if an approved IDEMPOTENT action (a wallet payment) flakes on a
445
+ * transient error, `status` is `'exec_failed'` and `retryable` is true — you
446
+ * MAY call `confirmAction(sameConfirmId, true)` again to re-run it (the server
447
+ * dedupes a partial first attempt). A non-idempotent action (a message / skill)
448
+ * stays terminal and is never retryable. */
443
449
  confirmAction(confirmId: string, approve: boolean): Promise<{
444
450
  ok: boolean;
445
- status: 'approved' | 'denied';
451
+ status: 'approved' | 'denied' | 'exec_failed';
446
452
  outcome?: string;
453
+ retryable?: boolean;
447
454
  }>;
448
455
  /** The session's still-pending confirmations (display-safe: id, summary,
449
456
  * scope, timestamps — never raw args). Use it to rebuild your confirm card
package/dist/client.js CHANGED
@@ -678,8 +678,14 @@ export class CompanionClient {
678
678
  * approval the recorded action runs server-side; its result comes back as
679
679
  * `outcome` in this response (render it where the user tapped) AND as a
680
680
  * normal companion.message on the stream (so the conversation shows it).
681
- * A denial returns/emits a brief decline the same way. One-time:
682
- * re-resolving a settled confirmId fails with 409. */
681
+ * A denial returns/emits a brief decline the same way. Single-use:
682
+ * re-resolving a settled confirmId fails with 409.
683
+ *
684
+ * RETRY: if an approved IDEMPOTENT action (a wallet payment) flakes on a
685
+ * transient error, `status` is `'exec_failed'` and `retryable` is true — you
686
+ * MAY call `confirmAction(sameConfirmId, true)` again to re-run it (the server
687
+ * dedupes a partial first attempt). A non-idempotent action (a message / skill)
688
+ * stays terminal and is never retryable. */
683
689
  async confirmAction(confirmId, approve) {
684
690
  const sessionId = this.requireSession();
685
691
  return this.postJson(`/api/companion/session/${encodeURIComponent(sessionId)}/confirm`, { confirmId, approve });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pouchy_ai/companion-sdk",
3
- "version": "0.18.0",
3
+ "version": "0.18.1",
4
4
  "description": "Embed the Pouchy companion — chat, voice, tools, memory, live world-state, instant UI, and agent-to-agent messaging — in any app, game, or site.",
5
5
  "type": "module",
6
6
  "license": "SEE LICENSE IN LICENSE",