@dakota-xyz/ts-sdk 2.2.0 → 2.2.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/README.md CHANGED
@@ -764,11 +764,11 @@ once and every drafting turn narrates in your nouns instead of the platform's.
764
764
 
765
765
  | Method | Description |
766
766
  |--------|-------------|
767
- | `agenticPolicy.get(clientId)` | Read your registered policy (404 = none, which is the default) |
768
- | `agenticPolicy.set(clientId, policy)` | Register or fully replace it (`{}` clears it) |
767
+ | `agenticPolicy.get()` | Read your registered policy (404 = none, which is the default) |
768
+ | `agenticPolicy.set(policy)` | Register or fully replace it (`{}` clears it) |
769
769
 
770
770
  ```typescript
771
- await client.agenticPolicy.set(clientId, {
771
+ await client.agenticPolicy.set({
772
772
  payee_model: 'flat',
773
773
  payout_assets: ['USDC', 'USDT'],
774
774
  labels: { limit: 'spending limit', payee: 'recipient', limit_unit: 'USD' },
package/dist/index.d.mts CHANGED
@@ -678,9 +678,9 @@ type components = {
678
678
  /**
679
679
  * @description ALPHA — how THIS client's product speaks, and what the agent may propose for it. It reshapes what the drafting model SEES (tool results, tool descriptions, prompt sections) and constrains what it may PROPOSE, so the agent narrates in the client's own nouns instead of platform ones.
680
680
  *
681
- * SCOPE: this is a per-CLIENT policy — it belongs to the `client_id` behind the API key, never to a key (api keys are N:1 to clients, so a per-key policy would fragment for a client running one service key per deployment). REGISTER IT ONCE at `PUT /clients/{client_id}/agentic-policy`.
681
+ * SCOPE: this is a per-CLIENT policy — it belongs to the `client_id` behind the API key, never to a key (api keys are N:1 to clients, so a per-key policy would fragment for a client running one service key per deployment). REGISTER IT at `PUT /agentic-policy`, which resolves the client from the API key: there is no id to pass and no other client's policy to address.
682
682
  *
683
- * DELIVERY: sent in a `POST .../proposals` body this object is a DEVELOPMENT OVERRIDE — it wins for that one turn and the server logs that it did. Prefer the registration: forgetting to send the body copy fails SILENTLY, and the agent simply starts narrating in platform's nouns again with no error anywhere. Resolution per request is: a non-empty body policy, else this client's registration, else nothing at all.
683
+ * DELIVERY: registration only. A request body never carries this object — a conversation is two calls (draft, then accept) judged independently, and a per-request policy let them disagree, so a draft that was legal under one could be refused at the customer's approval click.
684
684
  *
685
685
  * STRICT: an unknown key, an unknown value, or a label for a concept the server does not implement is a 400 — "accepted" always means "enforced". Absent (or every field empty) ⇒ platform defaults, byte-for-byte the behaviour of a request that never mentioned it.
686
686
  */
@@ -21834,173 +21834,6 @@ interface operations {
21834
21834
  };
21835
21835
  };
21836
21836
  };
21837
- readonly getClientAgenticPolicy: {
21838
- readonly parameters: {
21839
- readonly query?: never;
21840
- readonly header?: never;
21841
- readonly path: {
21842
- readonly client_id: components["schemas"]["KSUID"];
21843
- };
21844
- readonly cookie?: never;
21845
- };
21846
- readonly requestBody?: never;
21847
- readonly responses: {
21848
- /** @description The client's registered agentic policy, normalized. */
21849
- readonly 200: {
21850
- headers: {
21851
- readonly [name: string]: unknown;
21852
- };
21853
- content: {
21854
- /**
21855
- * @example {
21856
- * "policy": {
21857
- * "payee_model": "flat",
21858
- * "mandate_strategy": "external_only",
21859
- * "payout_route": "bank_only",
21860
- * "labels": {
21861
- * "limit": "spending limit",
21862
- * "limit_unit": "USD",
21863
- * "payee": "recipient"
21864
- * }
21865
- * },
21866
- * "created_at": 1761600000,
21867
- * "updated_at": 1761686400
21868
- * }
21869
- */
21870
- readonly "application/json": components["schemas"]["RegisteredAgenticClientPolicy"];
21871
- };
21872
- };
21873
- /** @description Bad Request */
21874
- readonly 400: {
21875
- headers: {
21876
- readonly [name: string]: unknown;
21877
- };
21878
- content: {
21879
- readonly "application/problem+json": components["schemas"]["ProblemDetails"];
21880
- };
21881
- };
21882
- /** @description Unauthorized */
21883
- readonly 401: {
21884
- headers: {
21885
- readonly [name: string]: unknown;
21886
- };
21887
- content: {
21888
- readonly "application/problem+json": components["schemas"]["ProblemDetails"];
21889
- };
21890
- };
21891
- /** @description Forbidden */
21892
- readonly 403: {
21893
- headers: {
21894
- readonly [name: string]: unknown;
21895
- };
21896
- content: {
21897
- readonly "application/problem+json": components["schemas"]["ProblemDetails"];
21898
- };
21899
- };
21900
- /** @description This client has no registered policy. */
21901
- readonly 404: {
21902
- headers: {
21903
- readonly [name: string]: unknown;
21904
- };
21905
- content: {
21906
- readonly "application/problem+json": components["schemas"]["ProblemDetails"];
21907
- };
21908
- };
21909
- };
21910
- };
21911
- readonly updateClientAgenticPolicy: {
21912
- readonly parameters: {
21913
- readonly query?: never;
21914
- readonly header: {
21915
- /** @description Unique key to ensure request idempotency. If the same key is used within a certain time window, the original response will be returned instead of executing the request again. */
21916
- readonly "x-idempotency-key": components["parameters"]["IdempotencyKeyHeader"];
21917
- };
21918
- readonly path: {
21919
- readonly client_id: components["schemas"]["KSUID"];
21920
- };
21921
- readonly cookie?: never;
21922
- };
21923
- readonly requestBody: {
21924
- readonly content: {
21925
- /**
21926
- * @example {
21927
- * "payee_model": "flat",
21928
- * "mandate_strategy": "external_only",
21929
- * "payout_route": "bank_only",
21930
- * "labels": {
21931
- * "limit": "spending limit",
21932
- * "limit_unit": "USD",
21933
- * "payee": "recipient"
21934
- * }
21935
- * }
21936
- */
21937
- readonly "application/json": components["schemas"]["AgenticClientPolicy"];
21938
- };
21939
- };
21940
- readonly responses: {
21941
- /** @description The registered policy, normalized as it will be applied. */
21942
- readonly 200: {
21943
- headers: {
21944
- readonly [name: string]: unknown;
21945
- };
21946
- content: {
21947
- /**
21948
- * @example {
21949
- * "policy": {
21950
- * "payee_model": "flat",
21951
- * "mandate_strategy": "external_only",
21952
- * "payout_route": "bank_only",
21953
- * "labels": {
21954
- * "limit": "spending limit",
21955
- * "limit_unit": "USD",
21956
- * "payee": "recipient"
21957
- * }
21958
- * },
21959
- * "created_at": 1761600000,
21960
- * "updated_at": 1761686400
21961
- * }
21962
- */
21963
- readonly "application/json": components["schemas"]["RegisteredAgenticClientPolicy"];
21964
- };
21965
- };
21966
- /** @description The policy is not one this server can enforce — an unknown key, an unsupported value, or a label for an unimplemented concept. */
21967
- readonly 400: {
21968
- headers: {
21969
- readonly [name: string]: unknown;
21970
- };
21971
- content: {
21972
- readonly "application/problem+json": components["schemas"]["ProblemDetails"];
21973
- };
21974
- };
21975
- /** @description Unauthorized */
21976
- readonly 401: {
21977
- headers: {
21978
- readonly [name: string]: unknown;
21979
- };
21980
- content: {
21981
- readonly "application/problem+json": components["schemas"]["ProblemDetails"];
21982
- };
21983
- };
21984
- /** @description Forbidden */
21985
- readonly 403: {
21986
- headers: {
21987
- readonly [name: string]: unknown;
21988
- };
21989
- content: {
21990
- readonly "application/problem+json": components["schemas"]["ProblemDetails"];
21991
- };
21992
- };
21993
- /** @description Not Found */
21994
- readonly 404: {
21995
- headers: {
21996
- readonly [name: string]: unknown;
21997
- };
21998
- content: {
21999
- readonly "application/problem+json": components["schemas"]["ProblemDetails"];
22000
- };
22001
- };
22002
- };
22003
- };
22004
21837
  readonly getPaymentAgent: {
22005
21838
  readonly parameters: {
22006
21839
  readonly query?: never;
@@ -23769,6 +23602,151 @@ interface operations {
23769
23602
  };
23770
23603
  };
23771
23604
  };
23605
+ readonly getClientAgenticPolicy: {
23606
+ readonly parameters: {
23607
+ readonly query?: never;
23608
+ readonly header?: never;
23609
+ readonly path?: never;
23610
+ readonly cookie?: never;
23611
+ };
23612
+ readonly requestBody?: never;
23613
+ readonly responses: {
23614
+ /** @description The client's registered agentic policy, normalized. */
23615
+ readonly 200: {
23616
+ headers: {
23617
+ readonly [name: string]: unknown;
23618
+ };
23619
+ content: {
23620
+ /**
23621
+ * @example {
23622
+ * "policy": {
23623
+ * "payee_model": "flat",
23624
+ * "mandate_strategy": "external_only",
23625
+ * "payout_route": "bank_only",
23626
+ * "labels": {
23627
+ * "limit": "spending limit",
23628
+ * "limit_unit": "USD",
23629
+ * "payee": "recipient"
23630
+ * }
23631
+ * },
23632
+ * "created_at": 1761600000,
23633
+ * "updated_at": 1761686400
23634
+ * }
23635
+ */
23636
+ readonly "application/json": components["schemas"]["RegisteredAgenticClientPolicy"];
23637
+ };
23638
+ };
23639
+ /** @description Bad Request */
23640
+ readonly 400: {
23641
+ headers: {
23642
+ readonly [name: string]: unknown;
23643
+ };
23644
+ content: {
23645
+ readonly "application/problem+json": components["schemas"]["ProblemDetails"];
23646
+ };
23647
+ };
23648
+ /** @description Unauthorized */
23649
+ readonly 401: {
23650
+ headers: {
23651
+ readonly [name: string]: unknown;
23652
+ };
23653
+ content: {
23654
+ readonly "application/problem+json": components["schemas"]["ProblemDetails"];
23655
+ };
23656
+ };
23657
+ /** @description This client has no registered policy. */
23658
+ readonly 404: {
23659
+ headers: {
23660
+ readonly [name: string]: unknown;
23661
+ };
23662
+ content: {
23663
+ readonly "application/problem+json": components["schemas"]["ProblemDetails"];
23664
+ };
23665
+ };
23666
+ };
23667
+ };
23668
+ readonly updateClientAgenticPolicy: {
23669
+ readonly parameters: {
23670
+ readonly query?: never;
23671
+ readonly header: {
23672
+ /** @description Unique key to ensure request idempotency. If the same key is used within a certain time window, the original response will be returned instead of executing the request again. */
23673
+ readonly "x-idempotency-key": components["parameters"]["IdempotencyKeyHeader"];
23674
+ };
23675
+ readonly path?: never;
23676
+ readonly cookie?: never;
23677
+ };
23678
+ readonly requestBody: {
23679
+ readonly content: {
23680
+ /**
23681
+ * @example {
23682
+ * "payee_model": "flat",
23683
+ * "mandate_strategy": "external_only",
23684
+ * "payout_route": "bank_only",
23685
+ * "labels": {
23686
+ * "limit": "spending limit",
23687
+ * "limit_unit": "USD",
23688
+ * "payee": "recipient"
23689
+ * }
23690
+ * }
23691
+ */
23692
+ readonly "application/json": components["schemas"]["AgenticClientPolicy"];
23693
+ };
23694
+ };
23695
+ readonly responses: {
23696
+ /** @description The registered policy, normalized as it will be applied. */
23697
+ readonly 200: {
23698
+ headers: {
23699
+ readonly [name: string]: unknown;
23700
+ };
23701
+ content: {
23702
+ /**
23703
+ * @example {
23704
+ * "policy": {
23705
+ * "payee_model": "flat",
23706
+ * "mandate_strategy": "external_only",
23707
+ * "payout_route": "bank_only",
23708
+ * "labels": {
23709
+ * "limit": "spending limit",
23710
+ * "limit_unit": "USD",
23711
+ * "payee": "recipient"
23712
+ * }
23713
+ * },
23714
+ * "created_at": 1761600000,
23715
+ * "updated_at": 1761686400
23716
+ * }
23717
+ */
23718
+ readonly "application/json": components["schemas"]["RegisteredAgenticClientPolicy"];
23719
+ };
23720
+ };
23721
+ /** @description The policy is not one this server can enforce — an unknown key, an unsupported value, or a label for an unimplemented concept. */
23722
+ readonly 400: {
23723
+ headers: {
23724
+ readonly [name: string]: unknown;
23725
+ };
23726
+ content: {
23727
+ readonly "application/problem+json": components["schemas"]["ProblemDetails"];
23728
+ };
23729
+ };
23730
+ /** @description Unauthorized */
23731
+ readonly 401: {
23732
+ headers: {
23733
+ readonly [name: string]: unknown;
23734
+ };
23735
+ content: {
23736
+ readonly "application/problem+json": components["schemas"]["ProblemDetails"];
23737
+ };
23738
+ };
23739
+ /** @description Not Found */
23740
+ readonly 404: {
23741
+ headers: {
23742
+ readonly [name: string]: unknown;
23743
+ };
23744
+ content: {
23745
+ readonly "application/problem+json": components["schemas"]["ProblemDetails"];
23746
+ };
23747
+ };
23748
+ };
23749
+ };
23772
23750
  }
23773
23751
 
23774
23752
  /**
@@ -24606,7 +24584,7 @@ type AgenticBlockerCode = NonNullable<AgenticBlocker['code']>;
24606
24584
  *
24607
24585
  * Reshapes what the drafting model sees and constrains what it may propose,
24608
24586
  * so the agent narrates in your nouns instead of the platform's. Register it
24609
- * ONCE via `client.agenticPolicy.set(clientId, policy)`; sending it per
24587
+ * ONCE via `client.agenticPolicy.set(policy)`; sending it per
24610
24588
  * request is a development override that wins for that turn only.
24611
24589
  *
24612
24590
  * STRICT — an unknown key, an unknown value, or a label for a concept the
@@ -26900,27 +26878,27 @@ declare class InsightsResource extends BaseResource {
26900
26878
  /**
26901
26879
  * Agentic Client Policy API resource (ALPHA).
26902
26880
  *
26903
- * The policy is per CLIENT — it belongs to the `client_id` behind your API
26904
- * key, never to a key, since API keys are N:1 to clients and a per-key policy
26881
+ * The policy is per CLIENT — it belongs to the client behind your API key,
26882
+ * never to a key, since API keys are N:1 to clients and a per-key policy
26905
26883
  * would fragment for anyone running one service key per deployment.
26906
26884
  *
26907
- * You may read and write your OWN policy; another client's is a 403.
26885
+ * There is no client id to pass. The route resolves the client from the API
26886
+ * key, so you cannot address another client's policy even to be refused.
26908
26887
  */
26909
26888
  declare class AgenticPolicyResource extends BaseResource {
26910
26889
  /**
26911
- * Get the policy registered for this client.
26890
+ * Get the policy registered for the client behind your API key.
26912
26891
  *
26913
26892
  * A 404 here is the DEFAULT, not an error condition: with no registration
26914
26893
  * and no per-request policy the agent drafts on platform defaults, exactly
26915
26894
  * as it did before registration existed.
26916
26895
  *
26917
- * @param clientId - Your client ID
26918
26896
  * @returns The normalized registered policy + its timestamps
26919
26897
  *
26920
26898
  * @example
26921
26899
  * ```typescript
26922
26900
  * try {
26923
- * const { policy } = await client.agenticPolicy.get(clientId);
26901
+ * const { policy } = await client.agenticPolicy.get();
26924
26902
  * console.log(policy.labels);
26925
26903
  * } catch (e) {
26926
26904
  * if (e instanceof APIError && e.statusCode === 404) {
@@ -26929,7 +26907,7 @@ declare class AgenticPolicyResource extends BaseResource {
26929
26907
  * }
26930
26908
  * ```
26931
26909
  */
26932
- get(clientId: string): Promise<RegisteredAgenticClientPolicy>;
26910
+ get(): Promise<RegisteredAgenticClientPolicy>;
26933
26911
  /**
26934
26912
  * Register — or fully replace — this client's agentic policy.
26935
26913
  *
@@ -26947,14 +26925,15 @@ declare class AgenticPolicyResource extends BaseResource {
26947
26925
  * unsupported value, or a label for an unimplemented concept is a 400 HERE,
26948
26926
  * at registration — not a surprise on a customer's first conversation.
26949
26927
  *
26950
- * @param clientId - Your client ID
26928
+ * The client comes from your API key; there is no id to pass.
26929
+ *
26951
26930
  * @param policy - The complete policy (`{}` clears it)
26952
26931
  * @param options - Request options (e.g., custom idempotency key)
26953
26932
  * @returns The normalized stored policy + its timestamps
26954
26933
  *
26955
26934
  * @example
26956
26935
  * ```typescript
26957
- * await client.agenticPolicy.set(clientId, {
26936
+ * await client.agenticPolicy.set({
26958
26937
  * payee_model: 'flat',
26959
26938
  * payout_assets: ['USDC', 'USDT'],
26960
26939
  * labels: { limit: 'spending limit', payee: 'recipient', limit_unit: 'USD' },
@@ -26963,7 +26942,7 @@ declare class AgenticPolicyResource extends BaseResource {
26963
26942
  * });
26964
26943
  * ```
26965
26944
  */
26966
- set(clientId: string, policy: AgenticClientPolicy, options?: RequestOptions): Promise<RegisteredAgenticClientPolicy>;
26945
+ set(policy: AgenticClientPolicy, options?: RequestOptions): Promise<RegisteredAgenticClientPolicy>;
26967
26946
  }
26968
26947
 
26969
26948
  /**
@@ -27084,7 +27063,7 @@ interface AgentConversationOptions {
27084
27063
  *
27085
27064
  * This is a DEVELOPMENT override. It wins for the turns of this
27086
27065
  * conversation and the server logs that it did. For production, register
27087
- * the policy once with `client.agenticPolicy.set(clientId, policy)`
27066
+ * the policy once with `client.agenticPolicy.set(policy)`
27088
27067
  * instead: forgetting to pass it here fails SILENTLY — the agent simply
27089
27068
  * narrates in the platform's nouns again, with no error anywhere.
27090
27069
  *