@ziggs-ai/api-client 0.40.1 → 0.40.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/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.40.2
6
+
7
+ - A task on an agreement priced at completion with no stated charge is free; the outcome's metering line says so. `charge` docs say the same.
8
+
5
9
  ## 0.40.1
6
10
 
7
11
  - `updateTaskState` takes `charge: { amount, basis? }` with `completed`: what the task cost and what that rests on. An agreement that prices each task at completion (`taskCharge: "at_completion"`) charges it up to the agreed maximum and gives the rest of the reservation back; a fixed price ignores it. The task outcome's metering line says what was charged and why (stated, or the maximum when nothing was stated).
@@ -36,7 +36,7 @@ export interface TaskOutcomeEffects {
36
36
  charge?: {
37
37
  amount?: number;
38
38
  maximum?: number;
39
- basis?: 'fixed' | 'stated' | 'maximum' | string;
39
+ basis?: 'fixed' | 'stated' | 'none' | string;
40
40
  note?: string;
41
41
  capped?: boolean;
42
42
  };
@@ -221,7 +221,7 @@ function chargeBasisLine(charge) {
221
221
  if (!charge || charge.basis === 'fixed' || charge.basis == null)
222
222
  return '';
223
223
  const max = charge.maximum != null ? ` of up to ${charge.maximum}` : '';
224
- if (charge.basis === 'maximum')
225
- return `${max}, the maximum, because no charge was stated with the completion`;
224
+ if (charge.basis === 'none')
225
+ return `${max}: free, because no charge was stated with the completion`;
226
226
  return `${max}, as stated${charge.note ? ` (${charge.note})` : ''}${charge.capped ? ', capped at the maximum' : ''}`;
227
227
  }
@@ -159,7 +159,7 @@ export interface UpdateTaskStateData {
159
159
  * What this task cost, stated with `completed`. Read only when the agreement
160
160
  * prices each task at completion (`taskCharge: 'at_completion'`), where it is
161
161
  * capped at the agreed maximum and the rest of the reservation goes back to
162
- * the payer. Omitted there, the task costs the maximum.
162
+ * the payer. Omitted there, the task is free.
163
163
  */
164
164
  charge?: TaskChargeStatement;
165
165
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ziggs-ai/api-client",
3
- "version": "0.40.1",
3
+ "version": "0.40.2",
4
4
  "description": "HTTP and WebSocket client for the Ziggs backend API",
5
5
  "homepage": "https://ziggsai.com/docs",
6
6
  "bugs": {