@clocknext/sdk 0.16.0 → 0.17.0

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/README.md CHANGED
@@ -727,7 +727,7 @@ const credit = await cnk.credits.create({
727
727
  agentKey: "deep_research",
728
728
  marginPercent: 20,
729
729
  modelBundle: [
730
- { orgModelId: "cm_model_01", averageTokensPerLLMCall: 100000, input: 60, output: 30, cache: 5, cacheWrite: 5 },
730
+ { modelId: "claude-sonnet-4-5", averageTokensPerLLMCall: 100000, input: 60, output: 30, cache: 5, cacheWrite: 5 },
731
731
  ],
732
732
  });
733
733
 
@@ -737,7 +737,7 @@ const outcome = await cnk.outcomes.create({
737
737
  marginPercent: 100,
738
738
  steps: [
739
739
  { name: "Extract clauses", agentKey: "contract_review.extract",
740
- modelBundle: [{ orgModelId: "cm_model_01", averageTokensPerLLMCall: 50000, input: 70, output: 30, cache: 0 }] },
740
+ modelBundle: [{ modelId: "claude-sonnet-4-5", averageTokensPerLLMCall: 50000, input: 70, output: 30, cache: 0 }] },
741
741
  ],
742
742
  });
743
743
 
@@ -771,8 +771,8 @@ await cnk.units.archive(unit.id); // retire it
771
771
  await cnk.units.unarchive(unit.id); // and bring it back
772
772
  ```
773
773
 
774
- Models are enabled in the ClockNext dashboard; a bundle line's `orgModelId` is
775
- the workspace's id for the model.
774
+ Models are enabled in the ClockNext dashboard. A bundle line names its model by
775
+ `modelId` — the same id you send as `usage.model` on a signal.
776
776
 
777
777
  ## Customer portal
778
778
 
package/dist/index.cjs CHANGED
@@ -333,7 +333,7 @@ function sleep(ms) {
333
333
  }
334
334
 
335
335
  // src/http.ts
336
- var SDK_VERSION = "0.16.0" ;
336
+ var SDK_VERSION = "0.17.0" ;
337
337
  var Transport = class {
338
338
  constructor(cfg) {
339
339
  this.cfg = cfg;
package/dist/index.d.cts CHANGED
@@ -713,8 +713,10 @@ interface CreatePlanInput {
713
713
  type UpdatePlanInput = Partial<CreatePlanInput>;
714
714
  /** One model line of a credit's / outcome step's pricing bundle, as returned. */
715
715
  interface ModelBundleLine {
716
- /** The workspace's model row id (`id` from the Models API). */
717
- orgModelId: string;
716
+ /** The model's id — the same one a usage signal sends as `usage.model`.
717
+ * `null` only when the model was removed from the workspace after this
718
+ * bundle was saved (the line keeps its name and stored price). */
719
+ modelId: string | null;
718
720
  /** The model's display name, filled in by the server. */
719
721
  modelName: string;
720
722
  /** Average tokens one LLM call uses on this model. */
@@ -730,7 +732,10 @@ interface ModelBundleLine {
730
732
  * the price is the sum of their costs, worked out on the server from the
731
733
  * models' live prices. */
732
734
  interface ModelBundleLineInput {
733
- orgModelId: string;
735
+ /** The model's id, e.g. `"gpt-4o"` — the same one a usage signal sends as
736
+ * `usage.model`. Matched ignoring case; it must be enabled in your
737
+ * workspace. */
738
+ modelId: string;
734
739
  /** Above 0. */
735
740
  averageTokensPerLLMCall: number;
736
741
  input: number;
package/dist/index.d.ts CHANGED
@@ -713,8 +713,10 @@ interface CreatePlanInput {
713
713
  type UpdatePlanInput = Partial<CreatePlanInput>;
714
714
  /** One model line of a credit's / outcome step's pricing bundle, as returned. */
715
715
  interface ModelBundleLine {
716
- /** The workspace's model row id (`id` from the Models API). */
717
- orgModelId: string;
716
+ /** The model's id — the same one a usage signal sends as `usage.model`.
717
+ * `null` only when the model was removed from the workspace after this
718
+ * bundle was saved (the line keeps its name and stored price). */
719
+ modelId: string | null;
718
720
  /** The model's display name, filled in by the server. */
719
721
  modelName: string;
720
722
  /** Average tokens one LLM call uses on this model. */
@@ -730,7 +732,10 @@ interface ModelBundleLine {
730
732
  * the price is the sum of their costs, worked out on the server from the
731
733
  * models' live prices. */
732
734
  interface ModelBundleLineInput {
733
- orgModelId: string;
735
+ /** The model's id, e.g. `"gpt-4o"` — the same one a usage signal sends as
736
+ * `usage.model`. Matched ignoring case; it must be enabled in your
737
+ * workspace. */
738
+ modelId: string;
734
739
  /** Above 0. */
735
740
  averageTokensPerLLMCall: number;
736
741
  input: number;
package/dist/index.js CHANGED
@@ -331,7 +331,7 @@ function sleep(ms) {
331
331
  }
332
332
 
333
333
  // src/http.ts
334
- var SDK_VERSION = "0.16.0" ;
334
+ var SDK_VERSION = "0.17.0" ;
335
335
  var Transport = class {
336
336
  constructor(cfg) {
337
337
  this.cfg = cfg;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clocknext/sdk",
3
- "version": "0.16.0",
3
+ "version": "0.17.0",
4
4
  "description": "Official ClockNext SDK — record usage signals and manage plans, purchases, invoices, customers, and billing from your backend.",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/src/types.ts CHANGED
@@ -785,8 +785,10 @@ export type UpdatePlanInput = Partial<CreatePlanInput>;
785
785
 
786
786
  /** One model line of a credit's / outcome step's pricing bundle, as returned. */
787
787
  export interface ModelBundleLine {
788
- /** The workspace's model row id (`id` from the Models API). */
789
- orgModelId: string;
788
+ /** The model's id — the same one a usage signal sends as `usage.model`.
789
+ * `null` only when the model was removed from the workspace after this
790
+ * bundle was saved (the line keeps its name and stored price). */
791
+ modelId: string | null;
790
792
  /** The model's display name, filled in by the server. */
791
793
  modelName: string;
792
794
  /** Average tokens one LLM call uses on this model. */
@@ -803,7 +805,10 @@ export interface ModelBundleLine {
803
805
  * the price is the sum of their costs, worked out on the server from the
804
806
  * models' live prices. */
805
807
  export interface ModelBundleLineInput {
806
- orgModelId: string;
808
+ /** The model's id, e.g. `"gpt-4o"` — the same one a usage signal sends as
809
+ * `usage.model`. Matched ignoring case; it must be enabled in your
810
+ * workspace. */
811
+ modelId: string;
807
812
  /** Above 0. */
808
813
  averageTokensPerLLMCall: number;
809
814
  input: number;