@polyester/sdk 0.36.0-devnet-20261115165158 → 0.36.0-devnet-20261116010019

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.
Files changed (283) hide show
  1. package/CHANGELOG.md +42 -4
  2. package/dist/client.d.ts +4 -0
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +4 -0
  5. package/dist/client.js.map +1 -1
  6. package/dist/gen/ai/v1/assistant_pb.d.ts +82 -4
  7. package/dist/gen/ai/v1/assistant_pb.d.ts.map +1 -1
  8. package/dist/gen/ai/v1/assistant_pb.js +66 -10
  9. package/dist/gen/ai/v1/assistant_pb.js.map +1 -1
  10. package/dist/gen/auth/v1/api_keys_pb.d.ts +4 -4
  11. package/dist/gen/auth/v1/api_keys_pb.js +4 -4
  12. package/dist/gen/auth/v1/api_keys_pb.js.map +1 -1
  13. package/dist/gen/auth/v1/auth_pb.d.ts +26 -1
  14. package/dist/gen/auth/v1/auth_pb.d.ts.map +1 -1
  15. package/dist/gen/auth/v1/auth_pb.js +18 -1
  16. package/dist/gen/auth/v1/auth_pb.js.map +1 -1
  17. package/dist/gen/auth/v1/policies_pb.d.ts +18 -1
  18. package/dist/gen/auth/v1/policies_pb.d.ts.map +1 -1
  19. package/dist/gen/auth/v1/policies_pb.js +18 -1
  20. package/dist/gen/auth/v1/policies_pb.js.map +1 -1
  21. package/dist/gen/auth/v1/profile_pb.d.ts +7 -11
  22. package/dist/gen/auth/v1/profile_pb.d.ts.map +1 -1
  23. package/dist/gen/auth/v1/profile_pb.js +1 -1
  24. package/dist/gen/auth/v1/profile_pb.js.map +1 -1
  25. package/dist/gen/auth/v1/social_verification_pb.d.ts +44 -10
  26. package/dist/gen/auth/v1/social_verification_pb.d.ts.map +1 -1
  27. package/dist/gen/auth/v1/social_verification_pb.js +1 -1
  28. package/dist/gen/auth/v1/social_verification_pb.js.map +1 -1
  29. package/dist/gen/auth/v1/subaccounts_pb.d.ts +17 -1
  30. package/dist/gen/auth/v1/subaccounts_pb.d.ts.map +1 -1
  31. package/dist/gen/auth/v1/subaccounts_pb.js +15 -1
  32. package/dist/gen/auth/v1/subaccounts_pb.js.map +1 -1
  33. package/dist/gen/chain/lifecycle/v1/lifecycle_read_pb.d.ts +228 -38
  34. package/dist/gen/chain/lifecycle/v1/lifecycle_read_pb.d.ts.map +1 -1
  35. package/dist/gen/chain/lifecycle/v1/lifecycle_read_pb.js +34 -10
  36. package/dist/gen/chain/lifecycle/v1/lifecycle_read_pb.js.map +1 -1
  37. package/dist/gen/chain/lifecycle/v1/types_pb.d.ts +12 -0
  38. package/dist/gen/chain/lifecycle/v1/types_pb.d.ts.map +1 -1
  39. package/dist/gen/chain/lifecycle/v1/types_pb.js +13 -1
  40. package/dist/gen/chain/lifecycle/v1/types_pb.js.map +1 -1
  41. package/dist/gen/chain/withdraw/v1/auto_withdraw_pb.d.ts +6 -3
  42. package/dist/gen/chain/withdraw/v1/auto_withdraw_pb.d.ts.map +1 -1
  43. package/dist/gen/chain/withdraw/v1/auto_withdraw_pb.js.map +1 -1
  44. package/dist/gen/chain/withdraw/v1/withdraw_pb.d.ts +10 -1
  45. package/dist/gen/chain/withdraw/v1/withdraw_pb.d.ts.map +1 -1
  46. package/dist/gen/chain/withdraw/v1/withdraw_pb.js +10 -1
  47. package/dist/gen/chain/withdraw/v1/withdraw_pb.js.map +1 -1
  48. package/dist/gen/chain/zipper/v1/zipper_pb.d.ts +10 -6
  49. package/dist/gen/chain/zipper/v1/zipper_pb.d.ts.map +1 -1
  50. package/dist/gen/chain/zipper/v1/zipper_pb.js +2 -2
  51. package/dist/gen/chain/zipper/v1/zipper_pb.js.map +1 -1
  52. package/dist/gen/index.d.ts +3 -1
  53. package/dist/gen/index.js +4 -2
  54. package/dist/gen/ledger/read/v1/ledger_read_pb.d.ts +57 -16
  55. package/dist/gen/ledger/read/v1/ledger_read_pb.d.ts.map +1 -1
  56. package/dist/gen/ledger/read/v1/ledger_read_pb.js +32 -1
  57. package/dist/gen/ledger/read/v1/ledger_read_pb.js.map +1 -1
  58. package/dist/gen/ledger/read/v1/statement_export_pb.d.ts +424 -0
  59. package/dist/gen/ledger/read/v1/statement_export_pb.d.ts.map +1 -0
  60. package/dist/gen/ledger/read/v1/statement_export_pb.js +154 -0
  61. package/dist/gen/ledger/read/v1/statement_export_pb.js.map +1 -0
  62. package/dist/gen/orders/v1/orders_pb.d.ts +28 -4
  63. package/dist/gen/orders/v1/orders_pb.d.ts.map +1 -1
  64. package/dist/gen/orders/v1/orders_pb.js +1 -1
  65. package/dist/gen/orders/v1/orders_pb.js.map +1 -1
  66. package/dist/gen/orders/v1/orders_read_pb.d.ts +2 -1
  67. package/dist/gen/orders/v1/orders_read_pb.d.ts.map +1 -1
  68. package/dist/gen/orders/v1/orders_read_pb.js.map +1 -1
  69. package/dist/gen/ratelimit/v1/ratelimit_pb.d.ts +12 -7
  70. package/dist/gen/ratelimit/v1/ratelimit_pb.d.ts.map +1 -1
  71. package/dist/gen/ratelimit/v1/ratelimit_pb.js.map +1 -1
  72. package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.d.ts +22 -10
  73. package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.d.ts.map +1 -1
  74. package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.js +4 -2
  75. package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.js.map +1 -1
  76. package/dist/gen/swap/quickswap/v1/quickswap_pb.d.ts +47 -11
  77. package/dist/gen/swap/quickswap/v1/quickswap_pb.d.ts.map +1 -1
  78. package/dist/gen/swap/quickswap/v1/quickswap_pb.js +35 -6
  79. package/dist/gen/swap/quickswap/v1/quickswap_pb.js.map +1 -1
  80. package/dist/gen/transfer/v1/dust_conversion_pb.d.ts +741 -0
  81. package/dist/gen/transfer/v1/dust_conversion_pb.d.ts.map +1 -0
  82. package/dist/gen/transfer/v1/dust_conversion_pb.js +235 -0
  83. package/dist/gen/transfer/v1/dust_conversion_pb.js.map +1 -0
  84. package/dist/gen/transfer/v1/internal_transfer_pb.d.ts +367 -3
  85. package/dist/gen/transfer/v1/internal_transfer_pb.d.ts.map +1 -1
  86. package/dist/gen/transfer/v1/internal_transfer_pb.js +166 -4
  87. package/dist/gen/transfer/v1/internal_transfer_pb.js.map +1 -1
  88. package/dist/gen/triggers/v1/triggers_pb.d.ts +10 -5
  89. package/dist/gen/triggers/v1/triggers_pb.d.ts.map +1 -1
  90. package/dist/gen/triggers/v1/triggers_pb.js +4 -2
  91. package/dist/gen/triggers/v1/triggers_pb.js.map +1 -1
  92. package/dist/index.d.ts +13 -7
  93. package/dist/services/address-book/address-book.schemas.d.ts +2 -2
  94. package/dist/services/assistant/assistant-events.schemas.d.ts +66 -66
  95. package/dist/services/assistant/assistant.codecs.d.ts +7 -1
  96. package/dist/services/assistant/assistant.codecs.d.ts.map +1 -1
  97. package/dist/services/assistant/assistant.codecs.js +5 -1
  98. package/dist/services/assistant/assistant.codecs.js.map +1 -1
  99. package/dist/services/assistant/assistant.d.ts +4 -3
  100. package/dist/services/assistant/assistant.d.ts.map +1 -1
  101. package/dist/services/assistant/assistant.js +6 -4
  102. package/dist/services/assistant/assistant.js.map +1 -1
  103. package/dist/services/assistant/assistant.schemas.d.ts +40 -3
  104. package/dist/services/assistant/assistant.schemas.d.ts.map +1 -1
  105. package/dist/services/assistant/assistant.schemas.js +18 -4
  106. package/dist/services/assistant/assistant.schemas.js.map +1 -1
  107. package/dist/services/assistant/assistant.types.d.ts +3 -3
  108. package/dist/services/auth/profile/profile.d.ts +1 -1
  109. package/dist/services/auth/profile/profile.js +1 -1
  110. package/dist/services/auth/profile/profile.js.map +1 -1
  111. package/dist/services/auth/profile/profile.schemas.d.ts +0 -1
  112. package/dist/services/auth/profile/profile.schemas.d.ts.map +1 -1
  113. package/dist/services/auth/profile/profile.schemas.js +0 -1
  114. package/dist/services/auth/profile/profile.schemas.js.map +1 -1
  115. package/dist/services/auto-withdraw/auto-withdraw.codecs.d.ts +3 -1
  116. package/dist/services/auto-withdraw/auto-withdraw.codecs.d.ts.map +1 -1
  117. package/dist/services/auto-withdraw/auto-withdraw.codecs.js.map +1 -1
  118. package/dist/services/auto-withdraw/auto-withdraw.schemas.d.ts +19 -19
  119. package/dist/services/auto-withdraw/auto-withdraw.schemas.js +1 -1
  120. package/dist/services/balances/balances.d.ts +4 -3
  121. package/dist/services/balances/balances.d.ts.map +1 -1
  122. package/dist/services/balances/balances.js +12 -4
  123. package/dist/services/balances/balances.js.map +1 -1
  124. package/dist/services/balances/balances.schemas.d.ts +30 -5
  125. package/dist/services/balances/balances.schemas.d.ts.map +1 -1
  126. package/dist/services/balances/balances.schemas.js +6 -10
  127. package/dist/services/balances/balances.schemas.js.map +1 -1
  128. package/dist/services/balances/balances.types.d.ts +2 -2
  129. package/dist/services/checkpoints/checkpoints.schemas.d.ts +2 -2
  130. package/dist/services/claims/claims.schemas.js +1 -1
  131. package/dist/services/dust-conversion/dust-conversion.codecs.d.ts +22 -0
  132. package/dist/services/dust-conversion/dust-conversion.codecs.d.ts.map +1 -0
  133. package/dist/services/dust-conversion/dust-conversion.codecs.js +22 -0
  134. package/dist/services/dust-conversion/dust-conversion.codecs.js.map +1 -0
  135. package/dist/services/dust-conversion/dust-conversion.d.ts +59 -0
  136. package/dist/services/dust-conversion/dust-conversion.d.ts.map +1 -0
  137. package/dist/services/dust-conversion/dust-conversion.js +87 -0
  138. package/dist/services/dust-conversion/dust-conversion.js.map +1 -0
  139. package/dist/services/dust-conversion/dust-conversion.schemas.d.ts +561 -0
  140. package/dist/services/dust-conversion/dust-conversion.schemas.d.ts.map +1 -0
  141. package/dist/services/dust-conversion/dust-conversion.schemas.js +190 -0
  142. package/dist/services/dust-conversion/dust-conversion.schemas.js.map +1 -0
  143. package/dist/services/dust-conversion/dust-conversion.types.d.ts +3 -0
  144. package/dist/services/dust-conversion/service.d.ts +8 -0
  145. package/dist/services/dust-conversion/service.d.ts.map +1 -0
  146. package/dist/services/dust-conversion/service.js +9 -0
  147. package/dist/services/dust-conversion/service.js.map +1 -0
  148. package/dist/services/heatmap/heatmap.schemas.d.ts +3 -3
  149. package/dist/services/internal-transfers/internal-transfers.codecs.d.ts +13 -1
  150. package/dist/services/internal-transfers/internal-transfers.codecs.d.ts.map +1 -1
  151. package/dist/services/internal-transfers/internal-transfers.codecs.js +22 -2
  152. package/dist/services/internal-transfers/internal-transfers.codecs.js.map +1 -1
  153. package/dist/services/internal-transfers/internal-transfers.d.ts +14 -2
  154. package/dist/services/internal-transfers/internal-transfers.d.ts.map +1 -1
  155. package/dist/services/internal-transfers/internal-transfers.js +29 -3
  156. package/dist/services/internal-transfers/internal-transfers.js.map +1 -1
  157. package/dist/services/internal-transfers/internal-transfers.schemas.d.ts +265 -5
  158. package/dist/services/internal-transfers/internal-transfers.schemas.d.ts.map +1 -1
  159. package/dist/services/internal-transfers/internal-transfers.schemas.js +63 -5
  160. package/dist/services/internal-transfers/internal-transfers.schemas.js.map +1 -1
  161. package/dist/services/internal-transfers/internal-transfers.types.d.ts +3 -3
  162. package/dist/services/lifecycle/lifecycle.codecs.d.ts +1 -1
  163. package/dist/services/lifecycle/lifecycle.codecs.d.ts.map +1 -1
  164. package/dist/services/lifecycle/lifecycle.codecs.js +1 -0
  165. package/dist/services/lifecycle/lifecycle.codecs.js.map +1 -1
  166. package/dist/services/lifecycle/lifecycle.d.ts +26 -8
  167. package/dist/services/lifecycle/lifecycle.d.ts.map +1 -1
  168. package/dist/services/lifecycle/lifecycle.js +39 -7
  169. package/dist/services/lifecycle/lifecycle.js.map +1 -1
  170. package/dist/services/lifecycle/lifecycle.schemas.d.ts +160 -136
  171. package/dist/services/lifecycle/lifecycle.schemas.d.ts.map +1 -1
  172. package/dist/services/lifecycle/lifecycle.schemas.js +44 -45
  173. package/dist/services/lifecycle/lifecycle.schemas.js.map +1 -1
  174. package/dist/services/lifecycle/lifecycle.types.d.ts +2 -2
  175. package/dist/services/lifecycle/service.js +1 -1
  176. package/dist/services/lifecycle/service.js.map +1 -1
  177. package/dist/services/orderbook/orderbook.d.ts.map +1 -1
  178. package/dist/services/orderbook/orderbook.js +2 -1
  179. package/dist/services/orderbook/orderbook.js.map +1 -1
  180. package/dist/services/orderbook/orderbook.schemas.d.ts +10 -0
  181. package/dist/services/orderbook/orderbook.schemas.d.ts.map +1 -1
  182. package/dist/services/orderbook/orderbook.schemas.js +4 -1
  183. package/dist/services/orderbook/orderbook.schemas.js.map +1 -1
  184. package/dist/services/orders/order-errors.schemas.d.ts +11 -1
  185. package/dist/services/orders/order-errors.schemas.d.ts.map +1 -1
  186. package/dist/services/orders/order-errors.schemas.js +11 -1
  187. package/dist/services/orders/order-errors.schemas.js.map +1 -1
  188. package/dist/services/orders/orders-batch.schemas.d.ts +67 -27
  189. package/dist/services/orders/orders-batch.schemas.d.ts.map +1 -1
  190. package/dist/services/orders/orders-identifiers.schemas.js +2 -1
  191. package/dist/services/orders/orders-identifiers.schemas.js.map +1 -1
  192. package/dist/services/orders/orders-input.schemas.d.ts +11 -4
  193. package/dist/services/orders/orders-input.schemas.d.ts.map +1 -1
  194. package/dist/services/orders/orders-input.schemas.js +1 -0
  195. package/dist/services/orders/orders-input.schemas.js.map +1 -1
  196. package/dist/services/orders/orders-output.schemas.d.ts +17 -17
  197. package/dist/services/orders/orders-output.schemas.js +1 -1
  198. package/dist/services/policies/api-key-policies/api-key-policies.schemas.d.ts +15 -15
  199. package/dist/services/policies/shared.codecs.js +9 -3
  200. package/dist/services/policies/shared.codecs.js.map +1 -1
  201. package/dist/services/policies/shared.d.ts +1 -1
  202. package/dist/services/policies/subaccount-policies/subaccount-policies.schemas.d.ts +5 -5
  203. package/dist/services/policies/subaccount-policies/subaccount-policies.schemas.d.ts.map +1 -1
  204. package/dist/services/policies/subaccount-policies/subaccount-policies.schemas.js +2 -3
  205. package/dist/services/policies/subaccount-policies/subaccount-policies.schemas.js.map +1 -1
  206. package/dist/services/price-alerts/price-alerts.schemas.d.ts +10 -10
  207. package/dist/services/rate-limits/rate-limits.d.ts +4 -1
  208. package/dist/services/rate-limits/rate-limits.d.ts.map +1 -1
  209. package/dist/services/rate-limits/rate-limits.js +4 -1
  210. package/dist/services/rate-limits/rate-limits.js.map +1 -1
  211. package/dist/services/rate-limits/rate-limits.schemas.d.ts +1 -0
  212. package/dist/services/rate-limits/rate-limits.schemas.d.ts.map +1 -1
  213. package/dist/services/rate-limits/rate-limits.schemas.js +1 -0
  214. package/dist/services/rate-limits/rate-limits.schemas.js.map +1 -1
  215. package/dist/services/rewards/rewards.schemas.d.ts +4 -4
  216. package/dist/services/social-verification/social-verification.codecs.js +6 -2
  217. package/dist/services/social-verification/social-verification.codecs.js.map +1 -1
  218. package/dist/services/social-verification/social-verification.d.ts +14 -3
  219. package/dist/services/social-verification/social-verification.d.ts.map +1 -1
  220. package/dist/services/social-verification/social-verification.js +14 -3
  221. package/dist/services/social-verification/social-verification.js.map +1 -1
  222. package/dist/services/social-verification/social-verification.schemas.d.ts +13 -3
  223. package/dist/services/social-verification/social-verification.schemas.d.ts.map +1 -1
  224. package/dist/services/social-verification/social-verification.schemas.js +12 -4
  225. package/dist/services/social-verification/social-verification.schemas.js.map +1 -1
  226. package/dist/services/statement-exports/service.d.ts +8 -0
  227. package/dist/services/statement-exports/service.d.ts.map +1 -0
  228. package/dist/services/statement-exports/service.js +9 -0
  229. package/dist/services/statement-exports/service.js.map +1 -0
  230. package/dist/services/statement-exports/statement-exports.codecs.d.ts +17 -0
  231. package/dist/services/statement-exports/statement-exports.codecs.d.ts.map +1 -0
  232. package/dist/services/statement-exports/statement-exports.codecs.js +19 -0
  233. package/dist/services/statement-exports/statement-exports.codecs.js.map +1 -0
  234. package/dist/services/statement-exports/statement-exports.d.ts +34 -0
  235. package/dist/services/statement-exports/statement-exports.d.ts.map +1 -0
  236. package/dist/services/statement-exports/statement-exports.js +53 -0
  237. package/dist/services/statement-exports/statement-exports.js.map +1 -0
  238. package/dist/services/statement-exports/statement-exports.schemas.d.ts +269 -0
  239. package/dist/services/statement-exports/statement-exports.schemas.d.ts.map +1 -0
  240. package/dist/services/statement-exports/statement-exports.schemas.js +98 -0
  241. package/dist/services/statement-exports/statement-exports.schemas.js.map +1 -0
  242. package/dist/services/statement-exports/statement-exports.types.d.ts +3 -0
  243. package/dist/services/subaccounts/subaccounts.codecs.js +3 -1
  244. package/dist/services/subaccounts/subaccounts.codecs.js.map +1 -1
  245. package/dist/services/subaccounts/subaccounts.schemas.d.ts +22 -22
  246. package/dist/services/system/system.schemas.d.ts +7 -7
  247. package/dist/services/trades/trades.schemas.d.ts +2 -2
  248. package/dist/services/trades/trades.schemas.js +1 -1
  249. package/dist/services/trading-withdraws/trading-withdraws.schemas.js +1 -1
  250. package/dist/services/transfers/transfers.schemas.js +1 -1
  251. package/dist/services/triggers/trigger-input.schemas.d.ts +5 -4
  252. package/dist/services/triggers/trigger-input.schemas.d.ts.map +1 -1
  253. package/dist/services/triggers/trigger-input.schemas.js +2 -2
  254. package/dist/services/triggers/trigger-input.schemas.js.map +1 -1
  255. package/dist/services/triggers/triggers-output.schemas.d.ts +45 -35
  256. package/dist/services/triggers/triggers-output.schemas.d.ts.map +1 -1
  257. package/dist/services/zipper/zipper.schemas.d.ts.map +1 -1
  258. package/dist/services/zipper/zipper.schemas.js +10 -0
  259. package/dist/services/zipper/zipper.schemas.js.map +1 -1
  260. package/dist/shared/account-scope.js +4 -1
  261. package/dist/shared/account-scope.js.map +1 -1
  262. package/dist/shared/connect-error-mapping.d.ts.map +1 -1
  263. package/dist/shared/connect-error-mapping.js +3 -0
  264. package/dist/shared/connect-error-mapping.js.map +1 -1
  265. package/dist/shared/decimal-surface.d.ts.map +1 -1
  266. package/dist/shared/decimal-surface.js +4 -1
  267. package/dist/shared/decimal-surface.js.map +1 -1
  268. package/dist/shared/error-detail.d.ts +5 -0
  269. package/dist/shared/error-detail.d.ts.map +1 -1
  270. package/dist/shared/error-detail.js.map +1 -1
  271. package/dist/shared/error-details/auth.js +7 -2
  272. package/dist/shared/error-details/auth.js.map +1 -1
  273. package/dist/shared/error-details/withdraw.js +1 -1
  274. package/dist/shared/schemas.js +2 -2
  275. package/dist/shared/schemas.js.map +1 -1
  276. package/dist/utils/numbers.js +1 -10
  277. package/dist/utils/numbers.js.map +1 -1
  278. package/dist/utils/u128.js +1 -1
  279. package/dist/utils/u128.js.map +1 -1
  280. package/dist/wired-services.d.ts.map +1 -1
  281. package/dist/wired-services.js +5 -1
  282. package/dist/wired-services.js.map +1 -1
  283. package/package.json +1 -1
@@ -21,6 +21,12 @@ type AssistantKeyState = (typeof ASSISTANT_KEY_STATE_VALUES)[number];
21
21
  */
22
22
  declare const ASSISTANT_DISPLAY_SETTING_VALUES: readonly ["appearance", "language", "currency", "date_format", "time_format", "number_format", "week_start", "sounds"];
23
23
  type AssistantDisplaySetting = (typeof ASSISTANT_DISPLAY_SETTING_VALUES)[number];
24
+ declare const ASSISTANT_ACCOUNT_SELECTION_VALUES: readonly ["none"];
25
+ /** `"none"`: the run reads no account and answers about the markets and Polyester only. */
26
+ type AssistantAccountSelection = (typeof ASSISTANT_ACCOUNT_SELECTION_VALUES)[number];
27
+ declare const ASSISTANT_KEY_VIEW_VALUES: readonly ["full"];
28
+ /** `"full"` adds each key's account name (`label`). */
29
+ type AssistantKeyView = (typeof ASSISTANT_KEY_VIEW_VALUES)[number];
24
30
  type AssistantReferencePriceSource = "best_bid" | "best_ask" | "last_price" | "index_price";
25
31
  type AssistantTriggerDirection = "at_or_above" | "at_or_below";
26
32
  type AssistantOrderPriceField = "limit_price" | "trigger_price" | "activation_price" | "ladder_low_price" | "ladder_high_price" | "take_profit_trigger_price" | "take_profit_limit_price" | "stop_loss_trigger_price" | "stop_loss_limit_price" | "trailing_stop_activation_price" | "trailing_stop_limit_price";
@@ -29,5 +35,5 @@ type AssistantPriceRounding = "down" | "up";
29
35
  type AssistantUnfilledSlicePolicy = "cancel_before_next";
30
36
  type AssistantTriggerChangeAction = "modify" | "pause" | "resume";
31
37
  //#endregion
32
- export { ASSISTANT_APPROVAL_DECISION_VALUES, ASSISTANT_APPROVAL_STATUS_VALUES, ASSISTANT_DISPLAY_SETTING_VALUES, ASSISTANT_FAILURE_CATEGORY_VALUES, ASSISTANT_KEY_STATE_VALUES, ASSISTANT_MEMORY_KIND_VALUES, ASSISTANT_MESSAGE_ROLE_VALUES, AssistantApprovalDecision, AssistantApprovalStatus, AssistantDisplaySetting, AssistantFailureCategory, AssistantKeyState, AssistantMemoryKind, AssistantMessageRole, AssistantOrderPriceField, AssistantPriceOffsetDirection, AssistantPriceRounding, AssistantReferencePriceSource, AssistantTriggerChangeAction, AssistantTriggerDirection, AssistantUnfilledSlicePolicy };
38
+ export { ASSISTANT_ACCOUNT_SELECTION_VALUES, ASSISTANT_APPROVAL_DECISION_VALUES, ASSISTANT_APPROVAL_STATUS_VALUES, ASSISTANT_DISPLAY_SETTING_VALUES, ASSISTANT_FAILURE_CATEGORY_VALUES, ASSISTANT_KEY_STATE_VALUES, ASSISTANT_KEY_VIEW_VALUES, ASSISTANT_MEMORY_KIND_VALUES, ASSISTANT_MESSAGE_ROLE_VALUES, AssistantAccountSelection, AssistantApprovalDecision, AssistantApprovalStatus, AssistantDisplaySetting, AssistantFailureCategory, AssistantKeyState, AssistantKeyView, AssistantMemoryKind, AssistantMessageRole, AssistantOrderPriceField, AssistantPriceOffsetDirection, AssistantPriceRounding, AssistantReferencePriceSource, AssistantTriggerChangeAction, AssistantTriggerDirection, AssistantUnfilledSlicePolicy };
33
39
  //# sourceMappingURL=assistant.codecs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"assistant.codecs.d.ts","names":[],"sources":["../../../src/services/assistant/assistant.codecs.ts"],"mappings":";;cAGa;KACD,+BAA+B;cAE9B;KAOD,mCAAmC;cAElC;KACD,oCAAoC;cAEnC;KAMD,kCAAkC;cAEjC;KACD,8BAA8B;cAE7B;KACD,4BAA4B;;;;;;;;cAS3B;KAUD,kCAAkC;KA0BlC;KACA;KACA;KAYA;KACA;KACA;KACA"}
1
+ {"version":3,"file":"assistant.codecs.d.ts","names":[],"sources":["../../../src/services/assistant/assistant.codecs.ts"],"mappings":";;cAGa;KACD,+BAA+B;cAE9B;KAOD,mCAAmC;cAElC;KACD,oCAAoC;cAEnC;KAMD,kCAAkC;cAEjC;KACD,8BAA8B;cAE7B;KACD,4BAA4B;;;;;;;;cAS3B;KAUD,kCAAkC;cAEjC;;KAED,oCAAoC;cAQnC;;KAED,2BAA2B;KAgC3B;KACA;KACA;KAYA;KACA;KACA;KACA"}
@@ -18,6 +18,10 @@ const ASSISTANT_DISPLAY_SETTING_VALUES = [
18
18
  "week_start",
19
19
  "sounds"
20
20
  ];
21
+ const ASSISTANT_ACCOUNT_SELECTION_VALUES = ["none"];
22
+ const AccountSelectionCodec = { inputToProto: { none: 1 } };
23
+ const ASSISTANT_KEY_VIEW_VALUES = ["full"];
24
+ const AssistantKeyViewCodec = { inputToProto: { full: 1 } };
21
25
  const DisplaySettingCodec = {
22
26
  inputToProto: {
23
27
  appearance: 1,
@@ -123,6 +127,6 @@ const TriggerChangeActionCodec = { protoToOutput: {
123
127
  [3]: "resume"
124
128
  } };
125
129
  //#endregion
126
- export { ASSISTANT_APPROVAL_DECISION_VALUES, ASSISTANT_DISPLAY_SETTING_VALUES, ApprovalDecisionCodec, ApprovalStatusCodec, AssistantKeyStateCodec, DisplaySettingCodec, FailureCategoryCodec, MemoryKindCodec, MessageRoleCodec, OrderPriceFieldCodec, PriceOffsetDirectionCodec, PriceRoundingCodec, ReferencePriceSourceCodec, TriggerChangeActionCodec, TriggerDirectionCodec, UnfilledSlicePolicyCodec };
130
+ export { ASSISTANT_ACCOUNT_SELECTION_VALUES, ASSISTANT_APPROVAL_DECISION_VALUES, ASSISTANT_DISPLAY_SETTING_VALUES, ASSISTANT_KEY_VIEW_VALUES, AccountSelectionCodec, ApprovalDecisionCodec, ApprovalStatusCodec, AssistantKeyStateCodec, AssistantKeyViewCodec, DisplaySettingCodec, FailureCategoryCodec, MemoryKindCodec, MessageRoleCodec, OrderPriceFieldCodec, PriceOffsetDirectionCodec, PriceRoundingCodec, ReferencePriceSourceCodec, TriggerChangeActionCodec, TriggerDirectionCodec, UnfilledSlicePolicyCodec };
127
131
 
128
132
  //# sourceMappingURL=assistant.codecs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"assistant.codecs.js","names":[],"sources":["../../../src/services/assistant/assistant.codecs.ts"],"sourcesContent":["import * as Proto from \"../../gen/ai/v1/assistant_pb.js\";\nimport type { InputToProto, ProtoToOutput } from \"../../utils/types.js\";\n\nexport const ASSISTANT_MESSAGE_ROLE_VALUES = [\"user\", \"assistant\"] as const;\nexport type AssistantMessageRole = (typeof ASSISTANT_MESSAGE_ROLE_VALUES)[number];\n\nexport const ASSISTANT_FAILURE_CATEGORY_VALUES = [\n \"canceled\",\n \"budget_exceeded\",\n \"permission_denied\",\n \"model_unavailable\",\n \"unexpected_error\",\n] as const;\nexport type AssistantFailureCategory = (typeof ASSISTANT_FAILURE_CATEGORY_VALUES)[number];\n\nexport const ASSISTANT_APPROVAL_DECISION_VALUES = [\"approve\", \"reject\"] as const;\nexport type AssistantApprovalDecision = (typeof ASSISTANT_APPROVAL_DECISION_VALUES)[number];\n\nexport const ASSISTANT_APPROVAL_STATUS_VALUES = [\n \"pending\",\n \"approved\",\n \"rejected\",\n \"expired\",\n] as const;\nexport type AssistantApprovalStatus = (typeof ASSISTANT_APPROVAL_STATUS_VALUES)[number];\n\nexport const ASSISTANT_MEMORY_KIND_VALUES = [\"fact\", \"planning_figure\", \"profile\"] as const;\nexport type AssistantMemoryKind = (typeof ASSISTANT_MEMORY_KIND_VALUES)[number];\n\nexport const ASSISTANT_KEY_STATE_VALUES = [\"active\", \"disabled\"] as const;\nexport type AssistantKeyState = (typeof ASSISTANT_KEY_STATE_VALUES)[number];\n\n/**\n * Display preferences a client lets the assistant change: `appearance` (`light`, `dark`,\n * `system`), `language` (`en`, `fr`, `zh-CN`), `currency` (a fiat code such as `EUR`),\n * `date_format` (a pattern such as `yyyy-MM-dd`), `time_format` (`12h`, `24h`), `number_format`\n * (`US`, `EU`, `SPACE`, `CH`, `IN`, `NONE`), `week_start` (`0` Sunday to `6` Saturday) and\n * `sounds` (`on`, `off`).\n */\nexport const ASSISTANT_DISPLAY_SETTING_VALUES = [\n \"appearance\",\n \"language\",\n \"currency\",\n \"date_format\",\n \"time_format\",\n \"number_format\",\n \"week_start\",\n \"sounds\",\n] as const;\nexport type AssistantDisplaySetting = (typeof ASSISTANT_DISPLAY_SETTING_VALUES)[number];\n\nexport const DisplaySettingCodec = {\n inputToProto: {\n appearance: Proto.DisplaySetting.APPEARANCE,\n language: Proto.DisplaySetting.LANGUAGE,\n currency: Proto.DisplaySetting.CURRENCY,\n date_format: Proto.DisplaySetting.DATE_FORMAT,\n time_format: Proto.DisplaySetting.TIME_FORMAT,\n number_format: Proto.DisplaySetting.NUMBER_FORMAT,\n week_start: Proto.DisplaySetting.WEEK_START,\n sounds: Proto.DisplaySetting.SOUNDS,\n } satisfies InputToProto<AssistantDisplaySetting, Proto.DisplaySetting>,\n protoToOutput: {\n [Proto.DisplaySetting.SETTING_UNSPECIFIED]: \"unspecified\",\n [Proto.DisplaySetting.APPEARANCE]: \"appearance\",\n [Proto.DisplaySetting.LANGUAGE]: \"language\",\n [Proto.DisplaySetting.CURRENCY]: \"currency\",\n [Proto.DisplaySetting.DATE_FORMAT]: \"date_format\",\n [Proto.DisplaySetting.TIME_FORMAT]: \"time_format\",\n [Proto.DisplaySetting.NUMBER_FORMAT]: \"number_format\",\n [Proto.DisplaySetting.WEEK_START]: \"week_start\",\n [Proto.DisplaySetting.SOUNDS]: \"sounds\",\n } satisfies ProtoToOutput<Proto.DisplaySetting, AssistantDisplaySetting>,\n} as const;\n\nexport type AssistantReferencePriceSource = \"best_bid\" | \"best_ask\" | \"last_price\" | \"index_price\";\nexport type AssistantTriggerDirection = \"at_or_above\" | \"at_or_below\";\nexport type AssistantOrderPriceField =\n | \"limit_price\"\n | \"trigger_price\"\n | \"activation_price\"\n | \"ladder_low_price\"\n | \"ladder_high_price\"\n | \"take_profit_trigger_price\"\n | \"take_profit_limit_price\"\n | \"stop_loss_trigger_price\"\n | \"stop_loss_limit_price\"\n | \"trailing_stop_activation_price\"\n | \"trailing_stop_limit_price\";\nexport type AssistantPriceOffsetDirection = \"above\" | \"below\";\nexport type AssistantPriceRounding = \"down\" | \"up\";\nexport type AssistantUnfilledSlicePolicy = \"cancel_before_next\";\nexport type AssistantTriggerChangeAction = \"modify\" | \"pause\" | \"resume\";\n\nexport const MessageRoleCodec = {\n protoToOutput: {\n [Proto.MessageRole.ROLE_UNSPECIFIED]: \"unspecified\",\n [Proto.MessageRole.USER]: \"user\",\n [Proto.MessageRole.ASSISTANT]: \"assistant\",\n } satisfies ProtoToOutput<Proto.MessageRole, AssistantMessageRole>,\n} as const;\n\nexport const FailureCategoryCodec = {\n protoToOutput: {\n [Proto.FailureCategory.FAILURE_UNSPECIFIED]: \"unspecified\",\n [Proto.FailureCategory.CANCELLED]: \"canceled\",\n [Proto.FailureCategory.BUDGET_EXCEEDED]: \"budget_exceeded\",\n [Proto.FailureCategory.PERMISSION_DENIED]: \"permission_denied\",\n [Proto.FailureCategory.MODEL_UNAVAILABLE]: \"model_unavailable\",\n [Proto.FailureCategory.UNEXPECTED_ERROR]: \"unexpected_error\",\n } satisfies ProtoToOutput<Proto.FailureCategory, AssistantFailureCategory>,\n} as const;\n\nexport const ApprovalDecisionCodec = {\n inputToProto: {\n approve: Proto.ApprovalDecision.APPROVE,\n reject: Proto.ApprovalDecision.REJECT,\n } satisfies InputToProto<AssistantApprovalDecision, Proto.ApprovalDecision>,\n} as const;\n\nexport const ApprovalStatusCodec = {\n protoToOutput: {\n [Proto.ApprovalStatus.APPROVAL_UNSPECIFIED]: \"unspecified\",\n [Proto.ApprovalStatus.PENDING]: \"pending\",\n [Proto.ApprovalStatus.APPROVED]: \"approved\",\n [Proto.ApprovalStatus.REJECTED]: \"rejected\",\n [Proto.ApprovalStatus.EXPIRED]: \"expired\",\n } satisfies ProtoToOutput<Proto.ApprovalStatus, AssistantApprovalStatus>,\n} as const;\n\nexport const MemoryKindCodec = {\n protoToOutput: {\n [Proto.MemoryKind.KIND_UNSPECIFIED]: \"unspecified\",\n [Proto.MemoryKind.FACT]: \"fact\",\n [Proto.MemoryKind.PLANNING_FIGURE]: \"planning_figure\",\n [Proto.MemoryKind.PROFILE]: \"profile\",\n } satisfies ProtoToOutput<Proto.MemoryKind, AssistantMemoryKind>,\n} as const;\n\nexport const AssistantKeyStateCodec = {\n protoToOutput: {\n [Proto.AssistantKeyState.KEY_STATE_UNSPECIFIED]: \"unspecified\",\n [Proto.AssistantKeyState.ACTIVE]: \"active\",\n [Proto.AssistantKeyState.DISABLED]: \"disabled\",\n } satisfies ProtoToOutput<Proto.AssistantKeyState, AssistantKeyState>,\n} as const;\n\nexport const ReferencePriceSourceCodec = {\n protoToOutput: {\n [Proto.ReferencePriceSource.PRICE_SOURCE_UNSPECIFIED]: \"unspecified\",\n [Proto.ReferencePriceSource.BEST_BID]: \"best_bid\",\n [Proto.ReferencePriceSource.BEST_ASK]: \"best_ask\",\n [Proto.ReferencePriceSource.LAST_PRICE]: \"last_price\",\n [Proto.ReferencePriceSource.INDEX_PRICE]: \"index_price\",\n } satisfies ProtoToOutput<Proto.ReferencePriceSource, AssistantReferencePriceSource>,\n} as const;\n\nexport const TriggerDirectionCodec = {\n protoToOutput: {\n [Proto.TriggerDirection.DIRECTION_UNSPECIFIED]: \"unspecified\",\n [Proto.TriggerDirection.AT_OR_ABOVE]: \"at_or_above\",\n [Proto.TriggerDirection.AT_OR_BELOW]: \"at_or_below\",\n } satisfies ProtoToOutput<Proto.TriggerDirection, AssistantTriggerDirection>,\n} as const;\n\nexport const OrderPriceFieldCodec = {\n protoToOutput: {\n [Proto.OrderPriceField.PRICE_FIELD_UNSPECIFIED]: \"unspecified\",\n [Proto.OrderPriceField.LIMIT_PRICE]: \"limit_price\",\n [Proto.OrderPriceField.TRIGGER_PRICE]: \"trigger_price\",\n [Proto.OrderPriceField.ACTIVATION_PRICE]: \"activation_price\",\n [Proto.OrderPriceField.LADDER_LOW_PRICE]: \"ladder_low_price\",\n [Proto.OrderPriceField.LADDER_HIGH_PRICE]: \"ladder_high_price\",\n [Proto.OrderPriceField.TAKE_PROFIT_TRIGGER_PRICE]: \"take_profit_trigger_price\",\n [Proto.OrderPriceField.TAKE_PROFIT_LIMIT_PRICE]: \"take_profit_limit_price\",\n [Proto.OrderPriceField.STOP_LOSS_TRIGGER_PRICE]: \"stop_loss_trigger_price\",\n [Proto.OrderPriceField.STOP_LOSS_LIMIT_PRICE]: \"stop_loss_limit_price\",\n [Proto.OrderPriceField.TRAILING_STOP_ACTIVATION_PRICE]: \"trailing_stop_activation_price\",\n [Proto.OrderPriceField.TRAILING_STOP_LIMIT_PRICE]: \"trailing_stop_limit_price\",\n } satisfies ProtoToOutput<Proto.OrderPriceField, AssistantOrderPriceField>,\n} as const;\n\nexport const PriceOffsetDirectionCodec = {\n protoToOutput: {\n [Proto.PriceOffsetDirection.OFFSET_DIRECTION_UNSPECIFIED]: \"unspecified\",\n [Proto.PriceOffsetDirection.ABOVE]: \"above\",\n [Proto.PriceOffsetDirection.BELOW]: \"below\",\n } satisfies ProtoToOutput<Proto.PriceOffsetDirection, AssistantPriceOffsetDirection>,\n} as const;\n\nexport const PriceRoundingCodec = {\n protoToOutput: {\n [Proto.PriceRounding.ROUNDING_UNSPECIFIED]: \"unspecified\",\n [Proto.PriceRounding.DOWN]: \"down\",\n [Proto.PriceRounding.UP]: \"up\",\n } satisfies ProtoToOutput<Proto.PriceRounding, AssistantPriceRounding>,\n} as const;\n\nexport const UnfilledSlicePolicyCodec = {\n protoToOutput: {\n [Proto.UnfilledSlicePolicy.UNFILLED_SLICE_UNSPECIFIED]: \"unspecified\",\n [Proto.UnfilledSlicePolicy.CANCEL_BEFORE_NEXT]: \"cancel_before_next\",\n } satisfies ProtoToOutput<Proto.UnfilledSlicePolicy, AssistantUnfilledSlicePolicy>,\n} as const;\n\nexport const TriggerChangeActionCodec = {\n protoToOutput: {\n [Proto.TriggerChangeAction.TRIGGER_CHANGE_UNSPECIFIED]: \"unspecified\",\n [Proto.TriggerChangeAction.MODIFY]: \"modify\",\n [Proto.TriggerChangeAction.PAUSE]: \"pause\",\n [Proto.TriggerChangeAction.RESUME]: \"resume\",\n } satisfies ProtoToOutput<Proto.TriggerChangeAction, AssistantTriggerChangeAction>,\n} as const;\n"],"mappings":";;AAeA,MAAa,qCAAqC,CAAC,WAAW,QAAQ;;;;;;;;AAwBtE,MAAa,mCAAmC;CAC5C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACJ;AAGA,MAAa,sBAAsB;CAC/B,cAAc;EACV,YAAA;EACA,UAAA;EACA,UAAA;EACA,aAAA;EACA,aAAA;EACA,eAAA;EACA,YAAA;EACA,QAAA;CACJ;CACA,eAAe;GACiC,IAAA;GACT,IAAA;GACF,IAAA;GACA,IAAA;GACG,IAAA;GACA,IAAA;GACE,IAAA;GACH,IAAA;GACJ,IAAA;CACnC;AACJ;AAqBA,MAAa,mBAAmB,EAC5B,eAAe;EAC2B,IAAA;EACZ,IAAA;EACK,IAAA;AACnC,EACJ;AAEA,MAAa,uBAAuB,EAChC,eAAe;EACkC,IAAA;EACV,IAAA;EACM,IAAA;EACE,IAAA;EACA,IAAA;EACD,IAAA;AAC9C,EACJ;AAEA,MAAa,wBAAwB,EACjC,cAAc;CACV,SAAA;CACA,QAAA;AACJ,EACJ;AAEA,MAAa,sBAAsB,EAC/B,eAAe;EACkC,IAAA;EACb,IAAA;EACC,IAAA;EACA,IAAA;EACD,IAAA;AACpC,EACJ;AAEA,MAAa,kBAAkB,EAC3B,eAAe;EAC0B,IAAA;EACZ,IAAA;EACW,IAAA;EACR,IAAA;AAChC,EACJ;AAEA,MAAa,yBAAyB,EAClC,eAAe;EACsC,IAAA;EACf,IAAA;EACE,IAAA;AACxC,EACJ;AAEA,MAAa,4BAA4B,EACrC,eAAe;EAC4C,IAAA;EAChB,IAAA;EACA,IAAA;EACE,IAAA;EACC,IAAA;AAC9C,EACJ;AAEA,MAAa,wBAAwB,EACjC,eAAe;EACqC,IAAA;EACV,IAAA;EACA,IAAA;AAC1C,EACJ;AAEA,MAAa,uBAAuB,EAChC,eAAe;EACsC,IAAA;EACZ,IAAA;EACE,IAAA;EACG,IAAA;EACA,IAAA;EACC,IAAA;EACQ,IAAA;EACF,IAAA;EACA,IAAA;EACF,IAAA;EACS,KAAA;EACL,KAAA;AACvD,EACJ;AAEA,MAAa,4BAA4B,EACrC,eAAe;EACgD,IAAA;EACvB,IAAA;EACA,IAAA;AACxC,EACJ;AAEA,MAAa,qBAAqB,EAC9B,eAAe;EACiC,IAAA;EAChB,IAAA;EACF,IAAA;AAC9B,EACJ;AAEA,MAAa,2BAA2B,EACpC,eAAe;EAC6C,IAAA;EACR,IAAA;AACpD,EACJ;AAEA,MAAa,2BAA2B,EACpC,eAAe;EAC6C,IAAA;EACpB,IAAA;EACD,IAAA;EACC,IAAA;AACxC,EACJ"}
1
+ {"version":3,"file":"assistant.codecs.js","names":[],"sources":["../../../src/services/assistant/assistant.codecs.ts"],"sourcesContent":["import * as Proto from \"../../gen/ai/v1/assistant_pb.js\";\nimport type { InputToProto, ProtoToOutput } from \"../../utils/types.js\";\n\nexport const ASSISTANT_MESSAGE_ROLE_VALUES = [\"user\", \"assistant\"] as const;\nexport type AssistantMessageRole = (typeof ASSISTANT_MESSAGE_ROLE_VALUES)[number];\n\nexport const ASSISTANT_FAILURE_CATEGORY_VALUES = [\n \"canceled\",\n \"budget_exceeded\",\n \"permission_denied\",\n \"model_unavailable\",\n \"unexpected_error\",\n] as const;\nexport type AssistantFailureCategory = (typeof ASSISTANT_FAILURE_CATEGORY_VALUES)[number];\n\nexport const ASSISTANT_APPROVAL_DECISION_VALUES = [\"approve\", \"reject\"] as const;\nexport type AssistantApprovalDecision = (typeof ASSISTANT_APPROVAL_DECISION_VALUES)[number];\n\nexport const ASSISTANT_APPROVAL_STATUS_VALUES = [\n \"pending\",\n \"approved\",\n \"rejected\",\n \"expired\",\n] as const;\nexport type AssistantApprovalStatus = (typeof ASSISTANT_APPROVAL_STATUS_VALUES)[number];\n\nexport const ASSISTANT_MEMORY_KIND_VALUES = [\"fact\", \"planning_figure\", \"profile\"] as const;\nexport type AssistantMemoryKind = (typeof ASSISTANT_MEMORY_KIND_VALUES)[number];\n\nexport const ASSISTANT_KEY_STATE_VALUES = [\"active\", \"disabled\"] as const;\nexport type AssistantKeyState = (typeof ASSISTANT_KEY_STATE_VALUES)[number];\n\n/**\n * Display preferences a client lets the assistant change: `appearance` (`light`, `dark`,\n * `system`), `language` (`en`, `fr`, `zh-CN`), `currency` (a fiat code such as `EUR`),\n * `date_format` (a pattern such as `yyyy-MM-dd`), `time_format` (`12h`, `24h`), `number_format`\n * (`US`, `EU`, `SPACE`, `CH`, `IN`, `NONE`), `week_start` (`0` Sunday to `6` Saturday) and\n * `sounds` (`on`, `off`).\n */\nexport const ASSISTANT_DISPLAY_SETTING_VALUES = [\n \"appearance\",\n \"language\",\n \"currency\",\n \"date_format\",\n \"time_format\",\n \"number_format\",\n \"week_start\",\n \"sounds\",\n] as const;\nexport type AssistantDisplaySetting = (typeof ASSISTANT_DISPLAY_SETTING_VALUES)[number];\n\nexport const ASSISTANT_ACCOUNT_SELECTION_VALUES = [\"none\"] as const;\n/** `\"none\"`: the run reads no account and answers about the markets and Polyester only. */\nexport type AssistantAccountSelection = (typeof ASSISTANT_ACCOUNT_SELECTION_VALUES)[number];\n\nexport const AccountSelectionCodec = {\n inputToProto: {\n none: Proto.AccountSelection.NONE,\n } satisfies InputToProto<AssistantAccountSelection, Proto.AccountSelection>,\n} as const;\n\nexport const ASSISTANT_KEY_VIEW_VALUES = [\"full\"] as const;\n/** `\"full\"` adds each key's account name (`label`). */\nexport type AssistantKeyView = (typeof ASSISTANT_KEY_VIEW_VALUES)[number];\n\nexport const AssistantKeyViewCodec = {\n inputToProto: {\n full: Proto.AssistantKeyView.FULL,\n } satisfies InputToProto<AssistantKeyView, Proto.AssistantKeyView>,\n} as const;\n\nexport const DisplaySettingCodec = {\n inputToProto: {\n appearance: Proto.DisplaySetting.APPEARANCE,\n language: Proto.DisplaySetting.LANGUAGE,\n currency: Proto.DisplaySetting.CURRENCY,\n date_format: Proto.DisplaySetting.DATE_FORMAT,\n time_format: Proto.DisplaySetting.TIME_FORMAT,\n number_format: Proto.DisplaySetting.NUMBER_FORMAT,\n week_start: Proto.DisplaySetting.WEEK_START,\n sounds: Proto.DisplaySetting.SOUNDS,\n } satisfies InputToProto<AssistantDisplaySetting, Proto.DisplaySetting>,\n protoToOutput: {\n [Proto.DisplaySetting.SETTING_UNSPECIFIED]: \"unspecified\",\n [Proto.DisplaySetting.APPEARANCE]: \"appearance\",\n [Proto.DisplaySetting.LANGUAGE]: \"language\",\n [Proto.DisplaySetting.CURRENCY]: \"currency\",\n [Proto.DisplaySetting.DATE_FORMAT]: \"date_format\",\n [Proto.DisplaySetting.TIME_FORMAT]: \"time_format\",\n [Proto.DisplaySetting.NUMBER_FORMAT]: \"number_format\",\n [Proto.DisplaySetting.WEEK_START]: \"week_start\",\n [Proto.DisplaySetting.SOUNDS]: \"sounds\",\n } satisfies ProtoToOutput<Proto.DisplaySetting, AssistantDisplaySetting>,\n} as const;\n\nexport type AssistantReferencePriceSource = \"best_bid\" | \"best_ask\" | \"last_price\" | \"index_price\";\nexport type AssistantTriggerDirection = \"at_or_above\" | \"at_or_below\";\nexport type AssistantOrderPriceField =\n | \"limit_price\"\n | \"trigger_price\"\n | \"activation_price\"\n | \"ladder_low_price\"\n | \"ladder_high_price\"\n | \"take_profit_trigger_price\"\n | \"take_profit_limit_price\"\n | \"stop_loss_trigger_price\"\n | \"stop_loss_limit_price\"\n | \"trailing_stop_activation_price\"\n | \"trailing_stop_limit_price\";\nexport type AssistantPriceOffsetDirection = \"above\" | \"below\";\nexport type AssistantPriceRounding = \"down\" | \"up\";\nexport type AssistantUnfilledSlicePolicy = \"cancel_before_next\";\nexport type AssistantTriggerChangeAction = \"modify\" | \"pause\" | \"resume\";\n\nexport const MessageRoleCodec = {\n protoToOutput: {\n [Proto.MessageRole.ROLE_UNSPECIFIED]: \"unspecified\",\n [Proto.MessageRole.USER]: \"user\",\n [Proto.MessageRole.ASSISTANT]: \"assistant\",\n } satisfies ProtoToOutput<Proto.MessageRole, AssistantMessageRole>,\n} as const;\n\nexport const FailureCategoryCodec = {\n protoToOutput: {\n [Proto.FailureCategory.FAILURE_UNSPECIFIED]: \"unspecified\",\n [Proto.FailureCategory.CANCELLED]: \"canceled\",\n [Proto.FailureCategory.BUDGET_EXCEEDED]: \"budget_exceeded\",\n [Proto.FailureCategory.PERMISSION_DENIED]: \"permission_denied\",\n [Proto.FailureCategory.MODEL_UNAVAILABLE]: \"model_unavailable\",\n [Proto.FailureCategory.UNEXPECTED_ERROR]: \"unexpected_error\",\n } satisfies ProtoToOutput<Proto.FailureCategory, AssistantFailureCategory>,\n} as const;\n\nexport const ApprovalDecisionCodec = {\n inputToProto: {\n approve: Proto.ApprovalDecision.APPROVE,\n reject: Proto.ApprovalDecision.REJECT,\n } satisfies InputToProto<AssistantApprovalDecision, Proto.ApprovalDecision>,\n} as const;\n\nexport const ApprovalStatusCodec = {\n protoToOutput: {\n [Proto.ApprovalStatus.APPROVAL_UNSPECIFIED]: \"unspecified\",\n [Proto.ApprovalStatus.PENDING]: \"pending\",\n [Proto.ApprovalStatus.APPROVED]: \"approved\",\n [Proto.ApprovalStatus.REJECTED]: \"rejected\",\n [Proto.ApprovalStatus.EXPIRED]: \"expired\",\n } satisfies ProtoToOutput<Proto.ApprovalStatus, AssistantApprovalStatus>,\n} as const;\n\nexport const MemoryKindCodec = {\n protoToOutput: {\n [Proto.MemoryKind.KIND_UNSPECIFIED]: \"unspecified\",\n [Proto.MemoryKind.FACT]: \"fact\",\n [Proto.MemoryKind.PLANNING_FIGURE]: \"planning_figure\",\n [Proto.MemoryKind.PROFILE]: \"profile\",\n } satisfies ProtoToOutput<Proto.MemoryKind, AssistantMemoryKind>,\n} as const;\n\nexport const AssistantKeyStateCodec = {\n protoToOutput: {\n [Proto.AssistantKeyState.KEY_STATE_UNSPECIFIED]: \"unspecified\",\n [Proto.AssistantKeyState.ACTIVE]: \"active\",\n [Proto.AssistantKeyState.DISABLED]: \"disabled\",\n } satisfies ProtoToOutput<Proto.AssistantKeyState, AssistantKeyState>,\n} as const;\n\nexport const ReferencePriceSourceCodec = {\n protoToOutput: {\n [Proto.ReferencePriceSource.PRICE_SOURCE_UNSPECIFIED]: \"unspecified\",\n [Proto.ReferencePriceSource.BEST_BID]: \"best_bid\",\n [Proto.ReferencePriceSource.BEST_ASK]: \"best_ask\",\n [Proto.ReferencePriceSource.LAST_PRICE]: \"last_price\",\n [Proto.ReferencePriceSource.INDEX_PRICE]: \"index_price\",\n } satisfies ProtoToOutput<Proto.ReferencePriceSource, AssistantReferencePriceSource>,\n} as const;\n\nexport const TriggerDirectionCodec = {\n protoToOutput: {\n [Proto.TriggerDirection.DIRECTION_UNSPECIFIED]: \"unspecified\",\n [Proto.TriggerDirection.AT_OR_ABOVE]: \"at_or_above\",\n [Proto.TriggerDirection.AT_OR_BELOW]: \"at_or_below\",\n } satisfies ProtoToOutput<Proto.TriggerDirection, AssistantTriggerDirection>,\n} as const;\n\nexport const OrderPriceFieldCodec = {\n protoToOutput: {\n [Proto.OrderPriceField.PRICE_FIELD_UNSPECIFIED]: \"unspecified\",\n [Proto.OrderPriceField.LIMIT_PRICE]: \"limit_price\",\n [Proto.OrderPriceField.TRIGGER_PRICE]: \"trigger_price\",\n [Proto.OrderPriceField.ACTIVATION_PRICE]: \"activation_price\",\n [Proto.OrderPriceField.LADDER_LOW_PRICE]: \"ladder_low_price\",\n [Proto.OrderPriceField.LADDER_HIGH_PRICE]: \"ladder_high_price\",\n [Proto.OrderPriceField.TAKE_PROFIT_TRIGGER_PRICE]: \"take_profit_trigger_price\",\n [Proto.OrderPriceField.TAKE_PROFIT_LIMIT_PRICE]: \"take_profit_limit_price\",\n [Proto.OrderPriceField.STOP_LOSS_TRIGGER_PRICE]: \"stop_loss_trigger_price\",\n [Proto.OrderPriceField.STOP_LOSS_LIMIT_PRICE]: \"stop_loss_limit_price\",\n [Proto.OrderPriceField.TRAILING_STOP_ACTIVATION_PRICE]: \"trailing_stop_activation_price\",\n [Proto.OrderPriceField.TRAILING_STOP_LIMIT_PRICE]: \"trailing_stop_limit_price\",\n } satisfies ProtoToOutput<Proto.OrderPriceField, AssistantOrderPriceField>,\n} as const;\n\nexport const PriceOffsetDirectionCodec = {\n protoToOutput: {\n [Proto.PriceOffsetDirection.OFFSET_DIRECTION_UNSPECIFIED]: \"unspecified\",\n [Proto.PriceOffsetDirection.ABOVE]: \"above\",\n [Proto.PriceOffsetDirection.BELOW]: \"below\",\n } satisfies ProtoToOutput<Proto.PriceOffsetDirection, AssistantPriceOffsetDirection>,\n} as const;\n\nexport const PriceRoundingCodec = {\n protoToOutput: {\n [Proto.PriceRounding.ROUNDING_UNSPECIFIED]: \"unspecified\",\n [Proto.PriceRounding.DOWN]: \"down\",\n [Proto.PriceRounding.UP]: \"up\",\n } satisfies ProtoToOutput<Proto.PriceRounding, AssistantPriceRounding>,\n} as const;\n\nexport const UnfilledSlicePolicyCodec = {\n protoToOutput: {\n [Proto.UnfilledSlicePolicy.UNFILLED_SLICE_UNSPECIFIED]: \"unspecified\",\n [Proto.UnfilledSlicePolicy.CANCEL_BEFORE_NEXT]: \"cancel_before_next\",\n } satisfies ProtoToOutput<Proto.UnfilledSlicePolicy, AssistantUnfilledSlicePolicy>,\n} as const;\n\nexport const TriggerChangeActionCodec = {\n protoToOutput: {\n [Proto.TriggerChangeAction.TRIGGER_CHANGE_UNSPECIFIED]: \"unspecified\",\n [Proto.TriggerChangeAction.MODIFY]: \"modify\",\n [Proto.TriggerChangeAction.PAUSE]: \"pause\",\n [Proto.TriggerChangeAction.RESUME]: \"resume\",\n } satisfies ProtoToOutput<Proto.TriggerChangeAction, AssistantTriggerChangeAction>,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e;EACqC,IAAA;EACV,IAAA;EACA,IAAA;AAC1C,EACJ;AAEA,MAAa,uBAAuB,EAChC,eAAe;EACsC,IAAA;EACZ,IAAA;EACE,IAAA;EACG,IAAA;EACA,IAAA;EACC,IAAA;EACQ,IAAA;EACF,IAAA;EACA,IAAA;EACF,IAAA;EACS,KAAA;EACL,KAAA;AACvD,EACJ;AAEA,MAAa,4BAA4B,EACrC,eAAe;EACgD,IAAA;EACvB,IAAA;EACA,IAAA;AACxC,EACJ;AAEA,MAAa,qBAAqB,EAC9B,eAAe;EACiC,IAAA;EAChB,IAAA;EACF,IAAA;AAC9B,EACJ;AAEA,MAAa,2BAA2B,EACpC,eAAe;EAC6C,IAAA;EACR,IAAA;AACpD,EACJ;AAEA,MAAa,2BAA2B,EACpC,eAAe;EAC6C,IAAA;EACpB,IAAA;EACD,IAAA;EACC,IAAA;AACxC,EACJ"}
@@ -3,7 +3,7 @@ import { PolyesterRequestOptions } from "../../shared/request-options.js";
3
3
  import { SdkScales } from "../../shared/decimal-surface.js";
4
4
  import { AssistantRunEvent } from "./assistant-events.schemas.js";
5
5
  import { AssistantApprovalStatus } from "./assistant.codecs.js";
6
- import { AssistantKey, AssistantRunIdInput, CompleteAssistantKeysInput, DecideAssistantApprovalInput, DeleteAssistantMemoryInput, ListAssistantConversationsInput, ListAssistantConversationsResult, ListAssistantMemoriesInput, ListAssistantMemoriesResult, ListAssistantMessagesInput, ListAssistantMessagesResult, PrepareAssistantKeysInput, PrepareAssistantKeysResult, SendAssistantMessageInput, SetTelegramApprovalLimitsInput, TelegramApprovalLimits, WatchAssistantRunInput } from "./assistant.schemas.js";
6
+ import { AssistantKey, AssistantRunIdInput, CompleteAssistantKeysInput, DecideAssistantApprovalInput, DeleteAssistantMemoryInput, ListAssistantConversationsInput, ListAssistantConversationsResult, ListAssistantKeysInput, ListAssistantMemoriesInput, ListAssistantMemoriesResult, ListAssistantMessagesInput, ListAssistantMessagesResult, PrepareAssistantKeysInput, PrepareAssistantKeysResult, SendAssistantMessageInput, SetTelegramApprovalLimitsInput, TelegramApprovalLimits, WatchAssistantRunInput } from "./assistant.schemas.js";
7
7
  //#region src/services/assistant/assistant.d.ts
8
8
  /**
9
9
  * The Polyester trading assistant. `sendMessage` starts a run that answers the message;
@@ -67,9 +67,10 @@ declare class AssistantService {
67
67
  completeKeys(input: CompleteAssistantKeysInput, options?: PolyesterRequestOptions): Promise<AssistantKey[]>;
68
68
  /**
69
69
  * Lists the keys the assistant holds, at most one per account. An account without one has
70
- * no account tools. Revoke them with `apiKeys.deleteAssistantKeys`.
70
+ * no account tools. Pass `view: "full"` for each key's account name as `label`. Revoke them
71
+ * with `apiKeys.deleteAssistantKeys`.
71
72
  */
72
- listKeys(options?: PolyesterRequestOptions): Promise<AssistantKey[]>;
73
+ listKeys(input?: ListAssistantKeysInput, options?: PolyesterRequestOptions): Promise<AssistantKey[]>;
73
74
  /**
74
75
  * Returns the caller's limits on what they may approve from Telegram, in US dollars of
75
76
  * notional value, and the value approved from Telegram in the last 24 hours while a limit
@@ -1 +1 @@
1
- {"version":3,"file":"assistant.d.ts","names":[],"sources":["../../../src/services/assistant/assistant.ts"],"mappings":";;;;;;;;;;;;;;cA0Da;;EAIG,YAAA,YAAY,mBAAmB,QAAQ;;;;;;EAU7C,YACF,OAAO,2BACP,UAAU,0BACX;IAAU;IAAe;;;;;;;;EAkBrB,SACH,OAAO,wBACP,UAAU,0BACX,eAAe;;;;;EAeZ,UAAU,OAAO,qBAAqB,UAAU,0BAA0B;;;;;;EAU1E,eACF,OAAO,8BACP,UAAU,0BACX,QAAQ;;EAOL,kBACF,QAAO,iCACP,UAAU,0BACX,QAAQ;;EAaL,aACF,OAAO,4BACP,UAAU,0BACX,QAAQ;;;;;EAgBL,aACF,QAAO,4BACP,UAAU,0BACX,QAAQ;;EAaL,aACF,OAAO,4BACP,UAAU,0BACX;;;;;;;EAWG,YACF,OAAO,2BACP,UAAU,0BACX,QAAQ;;;;;EAaL,aACF,OAAO,4BACP,UAAU,0BACX,QAAQ;;;;;EAaL,SAAS,UAAU,0BAA0B,QAAQ;;;;;;;EAWrD,0BACF,UAAU,0BACX,QAAQ;IAA2B;;;;;;;EAgBhC,0BACF,OAAO,gCACP,UAAU,0BACX,QAAQ"}
1
+ {"version":3,"file":"assistant.d.ts","names":[],"sources":["../../../src/services/assistant/assistant.ts"],"mappings":";;;;;;;;;;;;;;cA4Da;;EAIG,YAAA,YAAY,mBAAmB,QAAQ;;;;;;EAU7C,YACF,OAAO,2BACP,UAAU,0BACX;IAAU;IAAe;;;;;;;;EAkBrB,SACH,OAAO,wBACP,UAAU,0BACX,eAAe;;;;;EAeZ,UAAU,OAAO,qBAAqB,UAAU,0BAA0B;;;;;;EAU1E,eACF,OAAO,8BACP,UAAU,0BACX,QAAQ;;EAOL,kBACF,QAAO,iCACP,UAAU,0BACX,QAAQ;;EAaL,aACF,OAAO,4BACP,UAAU,0BACX,QAAQ;;;;;EAgBL,aACF,QAAO,4BACP,UAAU,0BACX,QAAQ;;EAaL,aACF,OAAO,4BACP,UAAU,0BACX;;;;;;;EAWG,YACF,OAAO,2BACP,UAAU,0BACX,QAAQ;;;;;EAaL,aACF,OAAO,4BACP,UAAU,0BACX,QAAQ;;;;;;EAcL,SACF,QAAO,wBACP,UAAU,0BACX,QAAQ;;;;;;;EAeL,0BACF,UAAU,0BACX,QAAQ;IAA2B;;;;;;;EAgBhC,0BACF,OAAO,gCACP,UAAU,0BACX,QAAQ"}
@@ -6,7 +6,7 @@ import { formatId } from "../../utils/base58-id.js";
6
6
  import { enumLabel } from "../../shared/proto-enum-codec.js";
7
7
  import { ApprovalStatusCodec } from "./assistant.codecs.js";
8
8
  import { formatRunEvent } from "./assistant-events.schemas.js";
9
- import { AssistantRunIdInputSchema, CompleteAssistantKeysInputSchema, DecideAssistantApprovalInputSchema, DeleteAssistantMemoryInputSchema, ListAssistantConversationsInputSchema, ListAssistantMemoriesInputSchema, ListAssistantMessagesInputSchema, PrepareAssistantKeysInputSchema, SendAssistantMessageInputSchema, SetTelegramApprovalLimitsInputSchema, WatchAssistantRunInputSchema, formatAssistantKey, formatConversation, formatMemory, formatMessage, formatPrepareAssistantKeysResult, formatTelegramApprovalLimits } from "./assistant.schemas.js";
9
+ import { AssistantRunIdInputSchema, CompleteAssistantKeysInputSchema, DecideAssistantApprovalInputSchema, DeleteAssistantMemoryInputSchema, ListAssistantConversationsInputSchema, ListAssistantKeysInputSchema, ListAssistantMemoriesInputSchema, ListAssistantMessagesInputSchema, PrepareAssistantKeysInputSchema, SendAssistantMessageInputSchema, SetTelegramApprovalLimitsInputSchema, WatchAssistantRunInputSchema, formatAssistantKey, formatConversation, formatMemory, formatMessage, formatPrepareAssistantKeysResult, formatTelegramApprovalLimits } from "./assistant.schemas.js";
10
10
  import { createClient } from "@connectrpc/connect";
11
11
  //#region src/services/assistant/assistant.ts
12
12
  /**
@@ -121,10 +121,12 @@ var AssistantService = class {
121
121
  }
122
122
  /**
123
123
  * Lists the keys the assistant holds, at most one per account. An account without one has
124
- * no account tools. Revoke them with `apiKeys.deleteAssistantKeys`.
124
+ * no account tools. Pass `view: "full"` for each key's account name as `label`. Revoke them
125
+ * with `apiKeys.deleteAssistantKeys`.
125
126
  */
126
- async listKeys(options) {
127
- return (await this.#client.listAssistantKeys({}, toConnectCallOptions(options))).keys.map(formatAssistantKey);
127
+ async listKeys(input = {}, options) {
128
+ const request = parse(ListAssistantKeysInputSchema, input);
129
+ return (await this.#client.listAssistantKeys(removeUndefined(request), toConnectCallOptions(options))).keys.map(formatAssistantKey);
128
130
  }
129
131
  /**
130
132
  * Returns the caller's limits on what they may approve from Telegram, in US dollars of
@@ -1 +1 @@
1
- {"version":3,"file":"assistant.js","names":["#client","Proto.AssistantService","#scales"],"sources":["../../../src/services/assistant/assistant.ts"],"sourcesContent":["import { createClient, type Client } from \"@connectrpc/connect\";\nimport * as Proto from \"../../gen/ai/v1/assistant_pb.js\";\nimport type { SdkScales } from \"../../shared/decimal-surface.js\";\nimport { enumLabel } from \"../../shared/proto-enum-codec.js\";\nimport {\n toConnectCallOptions,\n type PolyesterRequestOptions,\n} from \"../../shared/request-options.js\";\nimport type { AuthApiTransports } from \"../../shared/transports.js\";\nimport { parse } from \"../../shared/validation.js\";\nimport { formatId } from \"../../utils/base58-id.js\";\nimport { removeUndefined } from \"../../utils/remove-undefined.js\";\nimport { formatRunEvent, type AssistantRunEvent } from \"./assistant-events.schemas.js\";\nimport { ApprovalStatusCodec, type AssistantApprovalStatus } from \"./assistant.codecs.js\";\nimport {\n AssistantRunIdInputSchema,\n CompleteAssistantKeysInputSchema,\n DecideAssistantApprovalInputSchema,\n DeleteAssistantMemoryInputSchema,\n formatAssistantKey,\n formatConversation,\n formatMemory,\n formatMessage,\n formatPrepareAssistantKeysResult,\n formatTelegramApprovalLimits,\n ListAssistantConversationsInputSchema,\n ListAssistantMemoriesInputSchema,\n ListAssistantMessagesInputSchema,\n PrepareAssistantKeysInputSchema,\n SendAssistantMessageInputSchema,\n SetTelegramApprovalLimitsInputSchema,\n WatchAssistantRunInputSchema,\n type AssistantKey,\n type AssistantRunIdInput,\n type CompleteAssistantKeysInput,\n type DecideAssistantApprovalInput,\n type DeleteAssistantMemoryInput,\n type ListAssistantConversationsInput,\n type ListAssistantConversationsResult,\n type ListAssistantMemoriesInput,\n type ListAssistantMemoriesResult,\n type ListAssistantMessagesInput,\n type ListAssistantMessagesResult,\n type PrepareAssistantKeysInput,\n type PrepareAssistantKeysResult,\n type SendAssistantMessageInput,\n type SetTelegramApprovalLimitsInput,\n type TelegramApprovalLimits,\n type WatchAssistantRunInput,\n} from \"./assistant.schemas.js\";\n\n/**\n * The Polyester trading assistant. `sendMessage` starts a run that answers the message;\n * follow it with `watchRun`. A run continues on the server when nobody watches it. Actions that\n * change the account wait for `decideApproval`. Needs a session login; every conversation, run,\n * approval and memory belongs to the signed-in user. Errors carry\n * `detail: { service: \"assistant\", code }`.\n */\nexport class AssistantService {\n #client: Client<typeof Proto.AssistantService>;\n #scales: SdkScales;\n\n constructor(transports: AuthApiTransports, scales: SdkScales) {\n this.#client = createClient(Proto.AssistantService, transports.authApi);\n this.#scales = scales;\n }\n\n /**\n * Records the message and starts a run that answers it; returns once the run is recorded.\n * Idempotent per `idempotencyKey`: repeat the request unchanged to resolve an unknown\n * outcome. A conversation runs one run at a time (`RUN_ACTIVE`).\n */\n async sendMessage(\n input: SendAssistantMessageInput,\n options?: PolyesterRequestOptions,\n ): Promise<{ runId: string; conversationId: string }> {\n const request = parse(SendAssistantMessageInputSchema, input);\n const response = await this.#client.sendMessage(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return {\n runId: formatId(response.runId),\n conversationId: formatId(response.conversationId),\n };\n }\n\n /**\n * Streams a run's events in `seq` order: the recorded events after `afterSeq`, then new ones\n * as they are recorded. Ends after `run_completed` or `run_failed`; watching an ended run\n * replays it. The server may end the stream early: call again with the last `seq` received\n * as `afterSeq` to continue without gaps or repeats. Abort with `options.signal`.\n */\n async *watchRun(\n input: WatchAssistantRunInput,\n options?: PolyesterRequestOptions,\n ): AsyncGenerator<AssistantRunEvent, void, undefined> {\n const request = parse(WatchAssistantRunInputSchema, input);\n await this.#scales.ready();\n for await (const response of this.#client.watchRun(\n request,\n toConnectCallOptions(options),\n )) {\n if (response.event) yield formatRunEvent(response.event, this.#scales);\n }\n }\n\n /**\n * Asks an active run to stop; it then ends with `run_failed` category `canceled`.\n * Canceling an ended run succeeds and changes nothing.\n */\n async cancelRun(input: AssistantRunIdInput, options?: PolyesterRequestOptions): Promise<void> {\n const request = parse(AssistantRunIdInputSchema, input);\n await this.#client.cancelRun(request, toConnectCallOptions(options));\n }\n\n /**\n * Approves or rejects a pending approval from an `approval_requested` event. An approved\n * action runs exactly as its summary says, at most once. Repeating the same decision returns\n * the recorded status.\n */\n async decideApproval(\n input: DecideAssistantApprovalInput,\n options?: PolyesterRequestOptions,\n ): Promise<AssistantApprovalStatus | \"unspecified\"> {\n const request = parse(DecideAssistantApprovalInputSchema, input);\n const response = await this.#client.decideApproval(request, toConnectCallOptions(options));\n return enumLabel(ApprovalStatusCodec.protoToOutput, response.status);\n }\n\n /** Lists the caller's conversations, most recently updated first. */\n async listConversations(\n input: ListAssistantConversationsInput = {},\n options?: PolyesterRequestOptions,\n ): Promise<ListAssistantConversationsResult> {\n const request = parse(ListAssistantConversationsInputSchema, input);\n const response = await this.#client.listConversations(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return {\n conversations: response.conversations.map(formatConversation),\n nextPageToken: response.nextPageToken,\n };\n }\n\n /** Lists one conversation's messages, newest first. */\n async listMessages(\n input: ListAssistantMessagesInput,\n options?: PolyesterRequestOptions,\n ): Promise<ListAssistantMessagesResult> {\n const request = parse(ListAssistantMessagesInputSchema, input);\n const response = await this.#client.listMessages(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return {\n messages: response.messages.map(formatMessage),\n nextPageToken: response.nextPageToken,\n };\n }\n\n /**\n * Lists what the assistant remembers about the caller, newest first. A `profile` memory\n * applies to every answer; the others are used when relevant.\n */\n async listMemories(\n input: ListAssistantMemoriesInput = {},\n options?: PolyesterRequestOptions,\n ): Promise<ListAssistantMemoriesResult> {\n const request = parse(ListAssistantMemoriesInputSchema, input);\n const response = await this.#client.listMemories(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return {\n memories: response.memories.map(formatMemory),\n nextPageToken: response.nextPageToken,\n };\n }\n\n /** Makes the assistant forget one memory. Deleting a deleted memory succeeds. */\n async deleteMemory(\n input: DeleteAssistantMemoryInput,\n options?: PolyesterRequestOptions,\n ): Promise<void> {\n const request = parse(DeleteAssistantMemoryInputSchema, input);\n await this.#client.deleteMemory(request, toConnectCallOptions(options));\n }\n\n /**\n * Step 1 of giving the assistant keys: the assistant generates one Ed25519 key pair per\n * account and returns the public keys with their registration proofs. Register them with\n * `apiKeys.setAssistantKeys` (with a fresh `stepUpToken`) before `expiresAt`, then call\n * `completeKeys`. The step-up token goes to `setAssistantKeys` only, never to the assistant.\n */\n async prepareKeys(\n input: PrepareAssistantKeysInput,\n options?: PolyesterRequestOptions,\n ): Promise<PrepareAssistantKeysResult> {\n const request = parse(PrepareAssistantKeysInputSchema, input);\n const response = await this.#client.prepareAssistantKeys(\n { accounts: request.accounts.map((account) => removeUndefined(account)) },\n toConnectCallOptions(options),\n );\n return formatPrepareAssistantKeysResult(response);\n }\n\n /**\n * Finishes a key setup once `apiKeys.setAssistantKeys` registered its keys; returns the keys\n * the assistant now holds. Completing a completed setup returns the keys again.\n */\n async completeKeys(\n input: CompleteAssistantKeysInput,\n options?: PolyesterRequestOptions,\n ): Promise<AssistantKey[]> {\n const request = parse(CompleteAssistantKeysInputSchema, input);\n const response = await this.#client.completeAssistantKeys(\n request,\n toConnectCallOptions(options),\n );\n return response.keys.map(formatAssistantKey);\n }\n\n /**\n * Lists the keys the assistant holds, at most one per account. An account without one has\n * no account tools. Revoke them with `apiKeys.deleteAssistantKeys`.\n */\n async listKeys(options?: PolyesterRequestOptions): Promise<AssistantKey[]> {\n const response = await this.#client.listAssistantKeys({}, toConnectCallOptions(options));\n return response.keys.map(formatAssistantKey);\n }\n\n /**\n * Returns the caller's limits on what they may approve from Telegram, in US dollars of\n * notional value, and the value approved from Telegram in the last 24 hours while a limit\n * was set. Limits apply to placing, swapping, modifying and resuming; canceling, pausing\n * and rejecting are never limited.\n */\n async getTelegramApprovalLimits(\n options?: PolyesterRequestOptions,\n ): Promise<TelegramApprovalLimits & { approvedLast24hUsd: string }> {\n const response = await this.#client.getTelegramApprovalLimits(\n {},\n toConnectCallOptions(options),\n );\n return {\n ...formatTelegramApprovalLimits(response.limits),\n approvedLast24hUsd: response.approvedLast24hUsd,\n };\n }\n\n /**\n * Replaces both Telegram approval limits: a limit left out is turned off. Only a signed-in\n * session sets them; they apply to the next approval from Telegram. Returns the limits as\n * recorded.\n */\n async setTelegramApprovalLimits(\n input: SetTelegramApprovalLimitsInput,\n options?: PolyesterRequestOptions,\n ): Promise<TelegramApprovalLimits> {\n const limits = parse(SetTelegramApprovalLimitsInputSchema, input);\n const response = await this.#client.setTelegramApprovalLimits(\n { limits: removeUndefined(limits) },\n toConnectCallOptions(options),\n );\n return formatTelegramApprovalLimits(response.limits);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AA0DA,IAAa,mBAAb,MAA8B;CAC1B;CACA;CAEA,YAAY,YAA+B,QAAmB;EAC1D,KAAKA,UAAU,aAAaC,oBAAwB,WAAW,OAAO;EACtE,KAAKC,UAAU;CACnB;;;;;;CAOA,MAAM,YACF,OACA,SACkD;EAClD,MAAM,UAAU,MAAM,iCAAiC,KAAK;EAC5D,MAAM,WAAW,MAAM,KAAKF,QAAQ,YAChC,gBAAgB,OAAO,GACvB,qBAAqB,OAAO,CAChC;EACA,OAAO;GACH,OAAO,SAAS,SAAS,KAAK;GAC9B,gBAAgB,SAAS,SAAS,cAAc;EACpD;CACJ;;;;;;;CAQA,OAAO,SACH,OACA,SACkD;EAClD,MAAM,UAAU,MAAM,8BAA8B,KAAK;EACzD,MAAM,KAAKE,QAAQ,MAAM;EACzB,WAAW,MAAM,YAAY,KAAKF,QAAQ,SACtC,SACA,qBAAqB,OAAO,CAChC,GACI,IAAI,SAAS,OAAO,MAAM,eAAe,SAAS,OAAO,KAAKE,OAAO;CAE7E;;;;;CAMA,MAAM,UAAU,OAA4B,SAAkD;EAC1F,MAAM,UAAU,MAAM,2BAA2B,KAAK;EACtD,MAAM,KAAKF,QAAQ,UAAU,SAAS,qBAAqB,OAAO,CAAC;CACvE;;;;;;CAOA,MAAM,eACF,OACA,SACgD;EAChD,MAAM,UAAU,MAAM,oCAAoC,KAAK;EAC/D,MAAM,WAAW,MAAM,KAAKA,QAAQ,eAAe,SAAS,qBAAqB,OAAO,CAAC;EACzF,OAAO,UAAU,oBAAoB,eAAe,SAAS,MAAM;CACvE;;CAGA,MAAM,kBACF,QAAyC,CAAC,GAC1C,SACyC;EACzC,MAAM,UAAU,MAAM,uCAAuC,KAAK;EAClE,MAAM,WAAW,MAAM,KAAKA,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Q,kBAAkB,CAAC,GAAG,qBAAqB,OAAO,CAAC,EAAA,CACvE,KAAK,IAAI,kBAAkB;CAC/C;;;;;;;CAQA,MAAM,0BACF,SACgE;EAChE,MAAM,WAAW,MAAM,KAAKA,QAAQ,0BAChC,CAAC,GACD,qBAAqB,OAAO,CAChC;EACA,OAAO;GACH,GAAG,6BAA6B,SAAS,MAAM;GAC/C,oBAAoB,SAAS;EACjC;CACJ;;;;;;CAOA,MAAM,0BACF,OACA,SAC+B;EAC/B,MAAM,SAAS,MAAM,sCAAsC,KAAK;EAChE,MAAM,WAAW,MAAM,KAAKA,QAAQ,0BAChC,EAAE,QAAQ,gBAAgB,MAAM,EAAE,GAClC,qBAAqB,OAAO,CAChC;EACA,OAAO,6BAA6B,SAAS,MAAM;CACvD;AACJ"}
1
+ {"version":3,"file":"assistant.js","names":["#client","Proto.AssistantService","#scales"],"sources":["../../../src/services/assistant/assistant.ts"],"sourcesContent":["import { createClient, type Client } from \"@connectrpc/connect\";\nimport * as Proto from \"../../gen/ai/v1/assistant_pb.js\";\nimport type { SdkScales } from \"../../shared/decimal-surface.js\";\nimport { enumLabel } from \"../../shared/proto-enum-codec.js\";\nimport {\n toConnectCallOptions,\n type PolyesterRequestOptions,\n} from \"../../shared/request-options.js\";\nimport type { AuthApiTransports } from \"../../shared/transports.js\";\nimport { parse } from \"../../shared/validation.js\";\nimport { formatId } from \"../../utils/base58-id.js\";\nimport { removeUndefined } from \"../../utils/remove-undefined.js\";\nimport { formatRunEvent, type AssistantRunEvent } from \"./assistant-events.schemas.js\";\nimport { ApprovalStatusCodec, type AssistantApprovalStatus } from \"./assistant.codecs.js\";\nimport {\n AssistantRunIdInputSchema,\n CompleteAssistantKeysInputSchema,\n DecideAssistantApprovalInputSchema,\n DeleteAssistantMemoryInputSchema,\n formatAssistantKey,\n formatConversation,\n formatMemory,\n formatMessage,\n formatPrepareAssistantKeysResult,\n formatTelegramApprovalLimits,\n ListAssistantConversationsInputSchema,\n ListAssistantMemoriesInputSchema,\n ListAssistantMessagesInputSchema,\n PrepareAssistantKeysInputSchema,\n SendAssistantMessageInputSchema,\n SetTelegramApprovalLimitsInputSchema,\n WatchAssistantRunInputSchema,\n type AssistantKey,\n type AssistantRunIdInput,\n type CompleteAssistantKeysInput,\n ListAssistantKeysInputSchema,\n type ListAssistantKeysInput,\n type DecideAssistantApprovalInput,\n type DeleteAssistantMemoryInput,\n type ListAssistantConversationsInput,\n type ListAssistantConversationsResult,\n type ListAssistantMemoriesInput,\n type ListAssistantMemoriesResult,\n type ListAssistantMessagesInput,\n type ListAssistantMessagesResult,\n type PrepareAssistantKeysInput,\n type PrepareAssistantKeysResult,\n type SendAssistantMessageInput,\n type SetTelegramApprovalLimitsInput,\n type TelegramApprovalLimits,\n type WatchAssistantRunInput,\n} from \"./assistant.schemas.js\";\n\n/**\n * The Polyester trading assistant. `sendMessage` starts a run that answers the message;\n * follow it with `watchRun`. A run continues on the server when nobody watches it. Actions that\n * change the account wait for `decideApproval`. Needs a session login; every conversation, run,\n * approval and memory belongs to the signed-in user. Errors carry\n * `detail: { service: \"assistant\", code }`.\n */\nexport class AssistantService {\n #client: Client<typeof Proto.AssistantService>;\n #scales: SdkScales;\n\n constructor(transports: AuthApiTransports, scales: SdkScales) {\n this.#client = createClient(Proto.AssistantService, transports.authApi);\n this.#scales = scales;\n }\n\n /**\n * Records the message and starts a run that answers it; returns once the run is recorded.\n * Idempotent per `idempotencyKey`: repeat the request unchanged to resolve an unknown\n * outcome. A conversation runs one run at a time (`RUN_ACTIVE`).\n */\n async sendMessage(\n input: SendAssistantMessageInput,\n options?: PolyesterRequestOptions,\n ): Promise<{ runId: string; conversationId: string }> {\n const request = parse(SendAssistantMessageInputSchema, input);\n const response = await this.#client.sendMessage(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return {\n runId: formatId(response.runId),\n conversationId: formatId(response.conversationId),\n };\n }\n\n /**\n * Streams a run's events in `seq` order: the recorded events after `afterSeq`, then new ones\n * as they are recorded. Ends after `run_completed` or `run_failed`; watching an ended run\n * replays it. The server may end the stream early: call again with the last `seq` received\n * as `afterSeq` to continue without gaps or repeats. Abort with `options.signal`.\n */\n async *watchRun(\n input: WatchAssistantRunInput,\n options?: PolyesterRequestOptions,\n ): AsyncGenerator<AssistantRunEvent, void, undefined> {\n const request = parse(WatchAssistantRunInputSchema, input);\n await this.#scales.ready();\n for await (const response of this.#client.watchRun(\n request,\n toConnectCallOptions(options),\n )) {\n if (response.event) yield formatRunEvent(response.event, this.#scales);\n }\n }\n\n /**\n * Asks an active run to stop; it then ends with `run_failed` category `canceled`.\n * Canceling an ended run succeeds and changes nothing.\n */\n async cancelRun(input: AssistantRunIdInput, options?: PolyesterRequestOptions): Promise<void> {\n const request = parse(AssistantRunIdInputSchema, input);\n await this.#client.cancelRun(request, toConnectCallOptions(options));\n }\n\n /**\n * Approves or rejects a pending approval from an `approval_requested` event. An approved\n * action runs exactly as its summary says, at most once. Repeating the same decision returns\n * the recorded status.\n */\n async decideApproval(\n input: DecideAssistantApprovalInput,\n options?: PolyesterRequestOptions,\n ): Promise<AssistantApprovalStatus | \"unspecified\"> {\n const request = parse(DecideAssistantApprovalInputSchema, input);\n const response = await this.#client.decideApproval(request, toConnectCallOptions(options));\n return enumLabel(ApprovalStatusCodec.protoToOutput, response.status);\n }\n\n /** Lists the caller's conversations, most recently updated first. */\n async listConversations(\n input: ListAssistantConversationsInput = {},\n options?: PolyesterRequestOptions,\n ): Promise<ListAssistantConversationsResult> {\n const request = parse(ListAssistantConversationsInputSchema, input);\n const response = await this.#client.listConversations(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return {\n conversations: response.conversations.map(formatConversation),\n nextPageToken: response.nextPageToken,\n };\n }\n\n /** Lists one conversation's messages, newest first. */\n async listMessages(\n input: ListAssistantMessagesInput,\n options?: PolyesterRequestOptions,\n ): Promise<ListAssistantMessagesResult> {\n const request = parse(ListAssistantMessagesInputSchema, input);\n const response = await this.#client.listMessages(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return {\n messages: response.messages.map(formatMessage),\n nextPageToken: response.nextPageToken,\n };\n }\n\n /**\n * Lists what the assistant remembers about the caller, newest first. A `profile` memory\n * applies to every answer; the others are used when relevant.\n */\n async listMemories(\n input: ListAssistantMemoriesInput = {},\n options?: PolyesterRequestOptions,\n ): Promise<ListAssistantMemoriesResult> {\n const request = parse(ListAssistantMemoriesInputSchema, input);\n const response = await this.#client.listMemories(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return {\n memories: response.memories.map(formatMemory),\n nextPageToken: response.nextPageToken,\n };\n }\n\n /** Makes the assistant forget one memory. Deleting a deleted memory succeeds. */\n async deleteMemory(\n input: DeleteAssistantMemoryInput,\n options?: PolyesterRequestOptions,\n ): Promise<void> {\n const request = parse(DeleteAssistantMemoryInputSchema, input);\n await this.#client.deleteMemory(request, toConnectCallOptions(options));\n }\n\n /**\n * Step 1 of giving the assistant keys: the assistant generates one Ed25519 key pair per\n * account and returns the public keys with their registration proofs. Register them with\n * `apiKeys.setAssistantKeys` (with a fresh `stepUpToken`) before `expiresAt`, then call\n * `completeKeys`. The step-up token goes to `setAssistantKeys` only, never to the assistant.\n */\n async prepareKeys(\n input: PrepareAssistantKeysInput,\n options?: PolyesterRequestOptions,\n ): Promise<PrepareAssistantKeysResult> {\n const request = parse(PrepareAssistantKeysInputSchema, input);\n const response = await this.#client.prepareAssistantKeys(\n { accounts: request.accounts.map((account) => removeUndefined(account)) },\n toConnectCallOptions(options),\n );\n return formatPrepareAssistantKeysResult(response);\n }\n\n /**\n * Finishes a key setup once `apiKeys.setAssistantKeys` registered its keys; returns the keys\n * the assistant now holds. Completing a completed setup returns the keys again.\n */\n async completeKeys(\n input: CompleteAssistantKeysInput,\n options?: PolyesterRequestOptions,\n ): Promise<AssistantKey[]> {\n const request = parse(CompleteAssistantKeysInputSchema, input);\n const response = await this.#client.completeAssistantKeys(\n request,\n toConnectCallOptions(options),\n );\n return response.keys.map(formatAssistantKey);\n }\n\n /**\n * Lists the keys the assistant holds, at most one per account. An account without one has\n * no account tools. Pass `view: \"full\"` for each key's account name as `label`. Revoke them\n * with `apiKeys.deleteAssistantKeys`.\n */\n async listKeys(\n input: ListAssistantKeysInput = {},\n options?: PolyesterRequestOptions,\n ): Promise<AssistantKey[]> {\n const request = parse(ListAssistantKeysInputSchema, input);\n const response = await this.#client.listAssistantKeys(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return response.keys.map(formatAssistantKey);\n }\n\n /**\n * Returns the caller's limits on what they may approve from Telegram, in US dollars of\n * notional value, and the value approved from Telegram in the last 24 hours while a limit\n * was set. Limits apply to placing, swapping, modifying and resuming; canceling, pausing\n * and rejecting are never limited.\n */\n async getTelegramApprovalLimits(\n options?: PolyesterRequestOptions,\n ): Promise<TelegramApprovalLimits & { approvedLast24hUsd: string }> {\n const response = await this.#client.getTelegramApprovalLimits(\n {},\n toConnectCallOptions(options),\n );\n return {\n ...formatTelegramApprovalLimits(response.limits),\n approvedLast24hUsd: response.approvedLast24hUsd,\n };\n }\n\n /**\n * Replaces both Telegram approval limits: a limit left out is turned off. Only a signed-in\n * session sets them; they apply to the next approval from Telegram. Returns the limits as\n * recorded.\n */\n async setTelegramApprovalLimits(\n input: SetTelegramApprovalLimitsInput,\n options?: PolyesterRequestOptions,\n ): Promise<TelegramApprovalLimits> {\n const limits = parse(SetTelegramApprovalLimitsInputSchema, input);\n const response = await this.#client.setTelegramApprovalLimits(\n { limits: removeUndefined(limits) },\n toConnectCallOptions(options),\n );\n return formatTelegramApprovalLimits(response.limits);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AA4DA,IAAa,mBAAb,MAA8B;CAC1B;CACA;CAEA,YAAY,YAA+B,QAAmB;EAC1D,KAAKA,UAAU,aAAaC,oBAAwB,WAAW,OAAO;EACtE,KAAKC,UAAU;CACnB;;;;;;CAOA,MAAM,YACF,OACA,SACkD;EAClD,MAAM,UAAU,MAAM,iCAAiC,KAAK;EAC5D,MAAM,WAAW,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AAS,MAAM,sCAAsC,KAAK;EAChE,MAAM,WAAW,MAAM,KAAKA,QAAQ,0BAChC,EAAE,QAAQ,gBAAgB,MAAM,EAAE,GAClC,qBAAqB,OAAO,CAChC;EACA,OAAO,6BAA6B,SAAS,MAAM;CACvD;AACJ"}
@@ -1,4 +1,4 @@
1
- import { ApprovalDecision, AssistantKey as AssistantKey$1, Conversation, DisplaySetting, Memory, Message, PrepareAssistantKeysResponse, PreparedAssistantKey as PreparedAssistantKey$1 } from "../../gen/ai/v1/assistant_pb.js";
1
+ import { AccountSelection, ApprovalDecision, AssistantKey as AssistantKey$1, AssistantKeyView, Conversation, DisplaySetting, Memory, Message, PrepareAssistantKeysResponse, PreparedAssistantKey as PreparedAssistantKey$1 } from "../../gen/ai/v1/assistant_pb.js";
2
2
  import * as v from "valibot";
3
3
  //#region src/services/assistant/assistant.schemas.d.ts
4
4
  declare const SendAssistantMessageInputSchema: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
@@ -14,6 +14,12 @@ declare const SendAssistantMessageInputSchema: v.SchemaWithPipe<readonly [v.Stri
14
14
  * but places, changes and cancels nothing, and asks the user to pick a trading account.
15
15
  */
16
16
  readonly subaccountId: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>, v.TransformAction<string | undefined, bigint | undefined>]>;
17
+ /**
18
+ * `"none"` for a run that reads no account, such as when the user has given the
19
+ * assistant access to no account; `subaccountId` must then be omitted. Omit to read the
20
+ * `subaccountId` account or the main account. Covered by `idempotencyKey`.
21
+ */
22
+ readonly accountSelection: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<readonly ["none"], undefined>, undefined>, v.TransformAction<"none" | undefined, AccountSelection.NONE | undefined>]>;
17
23
  /** Places in the client the run may suggest, at most 100, each id once. */
18
24
  readonly destinations: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.StrictObjectSchema<{
19
25
  /** The client's id for the place, e.g. `"page-subaccounts"`: lowercase letters, digits and hyphens. */
@@ -48,7 +54,24 @@ declare const SendAssistantMessageInputSchema: v.SchemaWithPipe<readonly [v.Stri
48
54
  * `display_setting_action` asks, each once. Omit for none.
49
55
  */
50
56
  readonly displaySettings: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.PicklistSchema<readonly ["appearance", "language", "currency", "date_format", "time_format", "number_format", "week_start", "sounds"], undefined>, undefined>, v.CheckAction<("appearance" | "language" | "currency" | "date_format" | "time_format" | "number_format" | "week_start" | "sounds")[], "Display settings must be distinct.">, v.TransformAction<("appearance" | "language" | "currency" | "date_format" | "time_format" | "number_format" | "week_start" | "sounds")[], (DisplaySetting.APPEARANCE | DisplaySetting.LANGUAGE | DisplaySetting.CURRENCY | DisplaySetting.DATE_FORMAT | DisplaySetting.TIME_FORMAT | DisplaySetting.NUMBER_FORMAT | DisplaySetting.WEEK_START | DisplaySetting.SOUNDS)[]>]>, undefined>;
51
- }, undefined>]>;
57
+ }, undefined>, v.CheckAction<{
58
+ conversationId?: bigint | undefined;
59
+ text: string;
60
+ idempotencyKey: string;
61
+ subaccountId?: bigint | undefined;
62
+ accountSelection?: AccountSelection.NONE | undefined;
63
+ destinations?: {
64
+ id: string;
65
+ title: string;
66
+ description: string;
67
+ }[] | undefined;
68
+ page?: {
69
+ destinationId?: string | undefined;
70
+ route: string;
71
+ title: string;
72
+ } | undefined;
73
+ displaySettings?: (DisplaySetting.APPEARANCE | DisplaySetting.LANGUAGE | DisplaySetting.CURRENCY | DisplaySetting.DATE_FORMAT | DisplaySetting.TIME_FORMAT | DisplaySetting.NUMBER_FORMAT | DisplaySetting.WEEK_START | DisplaySetting.SOUNDS)[] | undefined;
74
+ }, "Omit subaccountId when accountSelection is \"none\".">]>;
52
75
  type SendAssistantMessageInput = v.InferInput<typeof SendAssistantMessageInputSchema>;
53
76
  declare const AssistantRunIdInputSchema: v.StrictObjectSchema<{
54
77
  readonly runId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.TransformAction<string, bigint>]>;
@@ -154,7 +177,21 @@ declare function formatAssistantKey(k: AssistantKey$1): {
154
177
  publicKeyEd25519: Uint8Array<ArrayBufferLike>;
155
178
  publicKeyHex: string;
156
179
  state: "unspecified" | "active" | "disabled";
180
+ /**
181
+ * The subaccount's name; only from `listKeys({ view: "full" })`. Empty for the main
182
+ * account, an unnamed subaccount, or a name that could not be read.
183
+ */
184
+ label: string;
157
185
  };
186
+ declare const ListAssistantKeysInputSchema: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
187
+ /** `"full"` adds each key's account name as `label`. */
188
+ readonly view: v.OptionalSchema<v.PicklistSchema<readonly ["full"], undefined>, undefined>;
189
+ }, undefined>, v.TransformAction<{
190
+ view?: "full" | undefined;
191
+ }, {
192
+ view: AssistantKeyView.FULL | undefined;
193
+ }>]>;
194
+ type ListAssistantKeysInput = v.InferInput<typeof ListAssistantKeysInputSchema>;
158
195
  type AssistantKey = ReturnType<typeof formatAssistantKey>;
159
196
  declare function formatPreparedAssistantKey(k: PreparedAssistantKey$1): {
160
197
  /** Omitted for the main account. */
@@ -210,5 +247,5 @@ type TelegramApprovalLimits = {
210
247
  dailyUsd: string | null;
211
248
  };
212
249
  //#endregion
213
- export { AssistantConversation, AssistantKey, AssistantMemory, AssistantMessage, AssistantRunIdInput, AssistantRunIdInputSchema, CompleteAssistantKeysInput, CompleteAssistantKeysInputSchema, DecideAssistantApprovalInput, DecideAssistantApprovalInputSchema, DeleteAssistantMemoryInput, DeleteAssistantMemoryInputSchema, ListAssistantConversationsInput, ListAssistantConversationsInputSchema, ListAssistantConversationsResult, ListAssistantMemoriesInput, ListAssistantMemoriesInputSchema, ListAssistantMemoriesResult, ListAssistantMessagesInput, ListAssistantMessagesInputSchema, ListAssistantMessagesResult, PrepareAssistantKeysInput, PrepareAssistantKeysInputSchema, PrepareAssistantKeysResult, PreparedAssistantKey, SendAssistantMessageInput, SendAssistantMessageInputSchema, SetTelegramApprovalLimitsInput, SetTelegramApprovalLimitsInputSchema, TelegramApprovalLimits, WatchAssistantRunInput, WatchAssistantRunInputSchema, formatAssistantKey, formatConversation, formatMemory, formatMessage, formatPrepareAssistantKeysResult, formatPreparedAssistantKey };
250
+ export { AssistantConversation, AssistantKey, AssistantMemory, AssistantMessage, AssistantRunIdInput, AssistantRunIdInputSchema, CompleteAssistantKeysInput, CompleteAssistantKeysInputSchema, DecideAssistantApprovalInput, DecideAssistantApprovalInputSchema, DeleteAssistantMemoryInput, DeleteAssistantMemoryInputSchema, ListAssistantConversationsInput, ListAssistantConversationsInputSchema, ListAssistantConversationsResult, ListAssistantKeysInput, ListAssistantKeysInputSchema, ListAssistantMemoriesInput, ListAssistantMemoriesInputSchema, ListAssistantMemoriesResult, ListAssistantMessagesInput, ListAssistantMessagesInputSchema, ListAssistantMessagesResult, PrepareAssistantKeysInput, PrepareAssistantKeysInputSchema, PrepareAssistantKeysResult, PreparedAssistantKey, SendAssistantMessageInput, SendAssistantMessageInputSchema, SetTelegramApprovalLimitsInput, SetTelegramApprovalLimitsInputSchema, TelegramApprovalLimits, WatchAssistantRunInput, WatchAssistantRunInputSchema, formatAssistantKey, formatConversation, formatMemory, formatMessage, formatPrepareAssistantKeysResult, formatPreparedAssistantKey };
214
251
  //# sourceMappingURL=assistant.schemas.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"assistant.schemas.d.ts","names":[],"sources":["../../../src/services/assistant/assistant.schemas.ts"],"mappings":";;;cAgEa,iCAA+B,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+ChC,4BAA4B,EAAE,kBAAkB;cAE/C,2BAAyB,EAAA;;;KAE1B,sBAAsB,EAAE,kBAAkB;cAEzC,8BAA4B,EAAA,yBAAA,EAAA;;;;;;;;;;;KAY7B,yBAAyB,EAAE,kBAAkB;cAE5C,oCAAkC,EAAA,yBAAA,EA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Y7B,yBAAyB,EAAE,kBAAkB;cAE5C,oCAAkC,EAAA,yBAAA,EAAA;;;;;;;;;;KAWnC,+BAA+B,EAAE,kBAAkB;cAElD,uCAAqC,EAAA;;;;;;KAEtC,kCAAkC,EAAE,kBACrC;cAGE,kCAAgC,EAAA;;;;;KAKjC,6BAA6B,EAAE,kBAAkB;cAEhD,kCAAgC,EAAA;;;;;;KAEjC,6BAA6B,EAAE,kBAAkB;cAEhD,kCAAgC,EAAA;;;KAIjC,6BAA6B,EAAE,kBAAkB;cAEhD,iCAA+B,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;KAgBhC,4BAA4B,EAAE,kBAAkB;cAE/C,kCAAgC,EAAA;;;KAIjC,6BAA6B,EAAE,kBAAkB;iBAQ7C,mBAAmB,GAAG;;;;;;;KAU1B,wBAAwB,kBAAkB;iBAEtC,cAAc,GAAG;;;;;;;;;KAYrB,mBAAmB,kBAAkB;iBAEjC,aAAa,GAAG;;;;;;;;KAWpB,kBAAkB,kBAAkB;iBAEhC,mBAAmB,GAAG;;;;;;;;;;;;;cAgBzB,8BAA4B,EAAA,yBAAA,EAAA;;;;;;;;KAU7B,yBAAyB,EAAE,kBAAkB;KAE7C,eAAe,kBAAkB;iBAE7B,2BAA2B,GAAG;;;;;;;;;;KAalC,uBAAuB,kBAAkB;iBAErC,iCAAiC,GAAG;;;;;;;;;;;;;;;;KAUxC,6BAA6B,kBAAkB;;KAG/C;EACR,eAAe;EACf;;KAEQ;EAAgC,UAAU;EAAoB;;KAC9D;EAAgC,UAAU;EAAmB;;cAS5D,sCAAoC,EAAA;;;;;;KAOrC,iCAAiC,EAAE,kBACpC;;KAIC;EACR;EACA"}
@@ -2,7 +2,7 @@ import { formatId } from "../../utils/base58-id.js";
2
2
  import { tsObjToMs } from "../../utils/time.js";
3
3
  import { idInputSchema, optionalSubaccountIdInputSchema } from "../../shared/schemas.js";
4
4
  import { enumLabel } from "../../shared/proto-enum-codec.js";
5
- import { ASSISTANT_APPROVAL_DECISION_VALUES, ASSISTANT_DISPLAY_SETTING_VALUES, ApprovalDecisionCodec, AssistantKeyStateCodec, DisplaySettingCodec, MemoryKindCodec, MessageRoleCodec } from "./assistant.codecs.js";
5
+ import { ASSISTANT_ACCOUNT_SELECTION_VALUES, ASSISTANT_APPROVAL_DECISION_VALUES, ASSISTANT_DISPLAY_SETTING_VALUES, ASSISTANT_KEY_VIEW_VALUES, AccountSelectionCodec, ApprovalDecisionCodec, AssistantKeyStateCodec, AssistantKeyViewCodec, DisplaySettingCodec, MemoryKindCodec, MessageRoleCodec } from "./assistant.codecs.js";
6
6
  import * as v from "valibot";
7
7
  import { bytesToHex } from "@noble/hashes/utils.js";
8
8
  //#region src/services/assistant/assistant.schemas.ts
@@ -48,6 +48,12 @@ const SendAssistantMessageInputSchema = v.pipe(v.strictObject({
48
48
  * but places, changes and cancels nothing, and asks the user to pick a trading account.
49
49
  */
50
50
  subaccountId: optionalSubaccountIdInputSchema(),
51
+ /**
52
+ * `"none"` for a run that reads no account, such as when the user has given the
53
+ * assistant access to no account; `subaccountId` must then be omitted. Omit to read the
54
+ * `subaccountId` account or the main account. Covered by `idempotencyKey`.
55
+ */
56
+ accountSelection: v.pipe(v.optional(v.picklist(ASSISTANT_ACCOUNT_SELECTION_VALUES)), v.transform((value) => value ? AccountSelectionCodec.inputToProto[value] : void 0)),
51
57
  /** Places in the client the run may suggest, at most 100, each id once. */
52
58
  destinations: v.optional(v.pipe(v.array(DestinationInputSchema), v.maxLength(100, "At most 100 destinations are allowed."), v.check((items) => new Set(items.map((d) => d.id)).size === items.length, "Destination ids must be distinct."))),
53
59
  /**
@@ -60,7 +66,7 @@ const SendAssistantMessageInputSchema = v.pipe(v.strictObject({
60
66
  * `display_setting_action` asks, each once. Omit for none.
61
67
  */
62
68
  displaySettings: v.optional(v.pipe(v.array(v.picklist(ASSISTANT_DISPLAY_SETTING_VALUES)), v.check((items) => new Set(items).size === items.length, "Display settings must be distinct."), v.transform((items) => items.map((item) => DisplaySettingCodec.inputToProto[item]))))
63
- }));
69
+ }), v.check((input) => input.accountSelection === void 0 || input.subaccountId === void 0, "Omit subaccountId when accountSelection is \"none\"."));
64
70
  const AssistantRunIdInputSchema = v.strictObject({ runId: idInputSchema("runId") });
65
71
  const WatchAssistantRunInputSchema = v.pipe(v.strictObject({
66
72
  runId: idInputSchema("runId"),
@@ -128,9 +134,17 @@ function formatAssistantKey(k) {
128
134
  keyId: k.keyId,
129
135
  publicKeyEd25519: k.publicKeyEd25519,
130
136
  publicKeyHex: bytesToHex(k.publicKeyEd25519),
131
- state: enumLabel(AssistantKeyStateCodec.protoToOutput, k.state)
137
+ state: enumLabel(AssistantKeyStateCodec.protoToOutput, k.state),
138
+ /**
139
+ * The subaccount's name; only from `listKeys({ view: "full" })`. Empty for the main
140
+ * account, an unnamed subaccount, or a name that could not be read.
141
+ */
142
+ label: k.label
132
143
  };
133
144
  }
145
+ const ListAssistantKeysInputSchema = v.pipe(v.strictObject({
146
+ /** `"full"` adds each key's account name as `label`. */
147
+ view: v.optional(v.picklist(ASSISTANT_KEY_VIEW_VALUES)) }), v.transform(({ view }) => ({ view: view ? AssistantKeyViewCodec.inputToProto[view] : void 0 })));
134
148
  function formatPreparedAssistantKey(k) {
135
149
  return {
136
150
  /** Omitted for the main account. */
@@ -167,6 +181,6 @@ function formatTelegramApprovalLimits(limits) {
167
181
  };
168
182
  }
169
183
  //#endregion
170
- export { AssistantRunIdInputSchema, CompleteAssistantKeysInputSchema, DecideAssistantApprovalInputSchema, DeleteAssistantMemoryInputSchema, ListAssistantConversationsInputSchema, ListAssistantMemoriesInputSchema, ListAssistantMessagesInputSchema, PrepareAssistantKeysInputSchema, SendAssistantMessageInputSchema, SetTelegramApprovalLimitsInputSchema, WatchAssistantRunInputSchema, formatAssistantKey, formatConversation, formatMemory, formatMessage, formatPrepareAssistantKeysResult, formatPreparedAssistantKey, formatTelegramApprovalLimits };
184
+ export { AssistantRunIdInputSchema, CompleteAssistantKeysInputSchema, DecideAssistantApprovalInputSchema, DeleteAssistantMemoryInputSchema, ListAssistantConversationsInputSchema, ListAssistantKeysInputSchema, ListAssistantMemoriesInputSchema, ListAssistantMessagesInputSchema, PrepareAssistantKeysInputSchema, SendAssistantMessageInputSchema, SetTelegramApprovalLimitsInputSchema, WatchAssistantRunInputSchema, formatAssistantKey, formatConversation, formatMemory, formatMessage, formatPrepareAssistantKeysResult, formatPreparedAssistantKey, formatTelegramApprovalLimits };
171
185
 
172
186
  //# sourceMappingURL=assistant.schemas.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"assistant.schemas.js","names":[],"sources":["../../../src/services/assistant/assistant.schemas.ts"],"sourcesContent":["import * as v from \"valibot\";\nimport { bytesToHex } from \"@noble/hashes/utils.js\";\nimport type * as Proto from \"../../gen/ai/v1/assistant_pb.js\";\nimport { enumLabel } from \"../../shared/proto-enum-codec.js\";\nimport { idInputSchema, optionalSubaccountIdInputSchema } from \"../../shared/schemas.js\";\nimport { formatId } from \"../../utils/base58-id.js\";\nimport { tsObjToMs } from \"../../utils/time.js\";\nimport {\n ASSISTANT_APPROVAL_DECISION_VALUES,\n ASSISTANT_DISPLAY_SETTING_VALUES,\n ApprovalDecisionCodec,\n AssistantKeyStateCodec,\n DisplaySettingCodec,\n MemoryKindCodec,\n MessageRoleCodec,\n} from \"./assistant.codecs.js\";\n\nconst IdempotencyKeySchema = v.pipe(v.string(), v.trim(), v.minLength(1));\n\nfunction pageInputEntries(maxLimit: number) {\n return {\n /** Page size; omit for the server default. */\n limit: v.optional(v.pipe(v.number(), v.integer(), v.minValue(1), v.maxValue(maxLimit))),\n /** The previous page's `nextPageToken`. */\n pageToken: v.optional(v.pipe(v.string(), v.trim())),\n };\n}\n\nconst DestinationInputSchema = v.strictObject({\n /** The client's id for the place, e.g. `\"page-subaccounts\"`: lowercase letters, digits and hyphens. */\n id: v.pipe(\n v.string(),\n v.regex(/^[a-z0-9-]{1,64}$/, \"destination id must be 1-64 of a-z, 0-9, -\"),\n ),\n /** Its name as the client shows it, 1 to 80 characters. */\n title: v.pipe(v.string(), v.minLength(1), v.maxLength(80)),\n /** What the user does there, at most 200 characters. */\n description: v.optional(v.pipe(v.string(), v.maxLength(200)), \"\"),\n});\n\n/**\n * The page the user is on, named by its template and title, never by its address: never send the\n * URL, its query or fragment, or any id or symbol taken from the path.\n */\nconst CurrentPageInputSchema = v.strictObject({\n /** The page's `destinations` id, when it is one of them. */\n destinationId: v.optional(\n v.pipe(\n v.string(),\n v.regex(/^[a-z0-9-]{1,64}$/, \"destinationId must be 1-64 of a-z, 0-9, -\"),\n ),\n ),\n /** Route template with bracketed parameters, e.g. `\"/account/settings/[section]\"`. */\n route: v.pipe(\n v.string(),\n v.regex(\n /^\\/[A-Za-z0-9/\\-_.[\\]]{0,199}$/,\n \"route must start with / and use at most 200 of A-Z, a-z, 0-9, /, -, _, ., [, ]\",\n ),\n ),\n /** The page's title as the client shows it, 1 to 80 characters; never the user's own data. */\n title: v.pipe(v.string(), v.minLength(1), v.maxLength(80)),\n});\n\nexport const SendAssistantMessageInputSchema = v.pipe(\n v.strictObject({\n /** Conversation to continue; omit to start a new one. */\n conversationId: v.optional(idInputSchema(\"conversationId\")),\n /** Message text, plain text or Markdown, 1 to 16000 characters. */\n text: v.pipe(v.string(), v.minLength(1), v.maxLength(16_000)),\n /** Client-chosen key, unique per caller. Repeat the request unchanged to resolve an unknown outcome. */\n idempotencyKey: IdempotencyKeySchema,\n /**\n * Trading account the run reads and acts on. Omit for the main account: the run then\n * reads it (balances, trading accounts, API keys, price alerts, fees and permissions)\n * but places, changes and cancels nothing, and asks the user to pick a trading account.\n */\n subaccountId: optionalSubaccountIdInputSchema(),\n /** Places in the client the run may suggest, at most 100, each id once. */\n destinations: v.optional(\n v.pipe(\n v.array(DestinationInputSchema),\n v.maxLength(100, \"At most 100 destinations are allowed.\"),\n v.check(\n (items) => new Set(items.map((d) => d.id)).size === items.length,\n \"Destination ids must be distinct.\",\n ),\n ),\n ),\n /**\n * The page the user is on as they send the message; omit for a client without pages.\n * Covered by `idempotencyKey`: a retry must send the page the first attempt sent.\n */\n page: v.optional(CurrentPageInputSchema),\n /**\n * Display settings the client offers now and will change when a run's\n * `display_setting_action` asks, each once. Omit for none.\n */\n displaySettings: v.optional(\n v.pipe(\n v.array(v.picklist(ASSISTANT_DISPLAY_SETTING_VALUES)),\n v.check(\n (items) => new Set(items).size === items.length,\n \"Display settings must be distinct.\",\n ),\n v.transform((items) => items.map((item) => DisplaySettingCodec.inputToProto[item])),\n ),\n ),\n }),\n);\n\nexport type SendAssistantMessageInput = v.InferInput<typeof SendAssistantMessageInputSchema>;\n\nexport const AssistantRunIdInputSchema = v.strictObject({ runId: idInputSchema(\"runId\") });\n\nexport type AssistantRunIdInput = v.InferInput<typeof AssistantRunIdInputSchema>;\n\nexport const WatchAssistantRunInputSchema = v.pipe(\n v.strictObject({\n runId: idInputSchema(\"runId\"),\n /** Return events after this seq. 0 (default) replays the run; pass the last seq received to resume. */\n afterSeq: v.optional(\n v.pipe(v.number(), v.integer(), v.minValue(0), v.maxValue(Number.MAX_SAFE_INTEGER)),\n 0,\n ),\n }),\n v.transform(({ runId, afterSeq }) => ({ runId, afterSeq: BigInt(afterSeq) })),\n);\n\nexport type WatchAssistantRunInput = v.InferInput<typeof WatchAssistantRunInputSchema>;\n\nexport const DecideAssistantApprovalInputSchema = v.pipe(\n v.strictObject({\n approvalId: idInputSchema(\"approvalId\"),\n decision: v.picklist(ASSISTANT_APPROVAL_DECISION_VALUES),\n }),\n v.transform(({ approvalId, decision }) => ({\n approvalId,\n decision: ApprovalDecisionCodec.inputToProto[decision],\n })),\n);\n\nexport type DecideAssistantApprovalInput = v.InferInput<typeof DecideAssistantApprovalInputSchema>;\n\nexport const ListAssistantConversationsInputSchema = v.strictObject(pageInputEntries(100));\n\nexport type ListAssistantConversationsInput = v.InferInput<\n typeof ListAssistantConversationsInputSchema\n>;\n\nexport const ListAssistantMessagesInputSchema = v.strictObject({\n conversationId: idInputSchema(\"conversationId\"),\n ...pageInputEntries(200),\n});\n\nexport type ListAssistantMessagesInput = v.InferInput<typeof ListAssistantMessagesInputSchema>;\n\nexport const ListAssistantMemoriesInputSchema = v.strictObject(pageInputEntries(200));\n\nexport type ListAssistantMemoriesInput = v.InferInput<typeof ListAssistantMemoriesInputSchema>;\n\nexport const DeleteAssistantMemoryInputSchema = v.strictObject({\n memoryId: idInputSchema(\"memoryId\"),\n});\n\nexport type DeleteAssistantMemoryInput = v.InferInput<typeof DeleteAssistantMemoryInputSchema>;\n\nexport const PrepareAssistantKeysInputSchema = v.pipe(\n v.strictObject({\n /** 1 to 64 accounts, each once. An entry without `subaccountId` is the main account. */\n accounts: v.pipe(\n v.array(v.strictObject({ subaccountId: optionalSubaccountIdInputSchema() })),\n v.minLength(1, \"At least one account is required.\"),\n v.maxLength(64, \"At most 64 accounts are allowed.\"),\n ),\n }),\n v.check(\n ({ accounts }) =>\n new Set(accounts.map((a) => a.subaccountId ?? 0n)).size === accounts.length,\n \"Each account may be named only once.\",\n ),\n);\n\nexport type PrepareAssistantKeysInput = v.InferInput<typeof PrepareAssistantKeysInputSchema>;\n\nexport const CompleteAssistantKeysInputSchema = v.strictObject({\n setupId: idInputSchema(\"setupId\"),\n});\n\nexport type CompleteAssistantKeysInput = v.InferInput<typeof CompleteAssistantKeysInputSchema>;\n\n/* ---------- outputs ---------- */\n\nfunction optionalId(id: bigint | undefined): string | undefined {\n return id ? formatId(id) : undefined;\n}\n\nexport function formatConversation(c: Proto.Conversation) {\n return {\n conversationId: formatId(c.conversationId),\n /** Empty until a title is available. */\n title: c.title,\n createdAt: tsObjToMs(c.createdAt),\n updatedAt: tsObjToMs(c.updatedAt),\n };\n}\n\nexport type AssistantConversation = ReturnType<typeof formatConversation>;\n\nexport function formatMessage(m: Proto.Message) {\n return {\n messageId: formatId(m.messageId),\n role: enumLabel(MessageRoleCodec.protoToOutput, m.role),\n /** Markdown. For an assistant message, its run's final text. */\n text: m.text,\n createdAt: tsObjToMs(m.createdAt),\n /** Replay this run with `watchRun` from `afterSeq: 0` to show its tool activity and views. */\n runId: formatId(m.runId),\n };\n}\n\nexport type AssistantMessage = ReturnType<typeof formatMessage>;\n\nexport function formatMemory(m: Proto.Memory) {\n return {\n memoryId: formatId(m.memoryId),\n text: m.text,\n createdAt: tsObjToMs(m.createdAt),\n /** Omitted when the conversation it was learned in is unknown. */\n conversationId: optionalId(m.conversationId),\n kind: enumLabel(MemoryKindCodec.protoToOutput, m.kind),\n };\n}\n\nexport type AssistantMemory = ReturnType<typeof formatMemory>;\n\nexport function formatAssistantKey(k: Proto.AssistantKey) {\n return {\n /** Omitted for the main account. */\n subaccountId: optionalId(k.subaccountId),\n keyId: k.keyId,\n publicKeyEd25519: k.publicKeyEd25519,\n publicKeyHex: bytesToHex(k.publicKeyEd25519),\n state: enumLabel(AssistantKeyStateCodec.protoToOutput, k.state),\n };\n}\n\nexport type AssistantKey = ReturnType<typeof formatAssistantKey>;\n\nexport function formatPreparedAssistantKey(k: Proto.PreparedAssistantKey) {\n return {\n /** Omitted for the main account. */\n subaccountId: optionalId(k.subaccountId),\n publicKeyEd25519: k.publicKeyEd25519,\n publicKeyHex: bytesToHex(k.publicKeyEd25519),\n /** Pass unchanged to `apiKeys.setAssistantKeys`. */\n registrationProof: k.registrationProof,\n /** Epoch ms; pass unchanged to `apiKeys.setAssistantKeys`. */\n registrationDeadline: tsObjToMs(k.registrationDeadline),\n };\n}\n\nexport type PreparedAssistantKey = ReturnType<typeof formatPreparedAssistantKey>;\n\nexport function formatPrepareAssistantKeysResult(r: Proto.PrepareAssistantKeysResponse) {\n return {\n setupId: formatId(r.setupId),\n /** One key per requested account, in request order. */\n keys: r.keys.map(formatPreparedAssistantKey),\n /** Epoch ms after which the keys can no longer be registered. */\n expiresAt: tsObjToMs(r.expiresAt),\n };\n}\n\nexport type PrepareAssistantKeysResult = ReturnType<typeof formatPrepareAssistantKeysResult>;\n\n/** `nextPageToken` is empty when no more results exist. */\nexport type ListAssistantConversationsResult = {\n conversations: AssistantConversation[];\n nextPageToken: string;\n};\nexport type ListAssistantMessagesResult = { messages: AssistantMessage[]; nextPageToken: string };\nexport type ListAssistantMemoriesResult = { memories: AssistantMemory[]; nextPageToken: string };\n\n/** US dollars as a decimal string with at most 2 decimal places, e.g. `\"5000\"` or `\"250.50\"`. */\nconst UsdLimitInputSchema = v.pipe(\n v.string(),\n v.trim(),\n v.regex(/^\\d+(\\.\\d{1,2})?$/, \"limit must be US dollars with at most 2 decimal places\"),\n);\n\nexport const SetTelegramApprovalLimitsInputSchema = v.strictObject({\n /** Largest notional value of one approval from Telegram. `\"0\"` allows none; omit for no limit. */\n perApprovalUsd: v.optional(UsdLimitInputSchema),\n /** Largest total notional value approved from Telegram in any rolling 24 hours; omit for no limit. */\n dailyUsd: v.optional(UsdLimitInputSchema),\n});\n\nexport type SetTelegramApprovalLimitsInput = v.InferInput<\n typeof SetTelegramApprovalLimitsInputSchema\n>;\n\n/** Limits on what the caller may approve from Telegram, in US dollars; `null` is no limit. */\nexport type TelegramApprovalLimits = {\n perApprovalUsd: string | null;\n dailyUsd: string | null;\n};\n\nexport function formatTelegramApprovalLimits(\n limits: Proto.TelegramApprovalLimits | undefined,\n): TelegramApprovalLimits {\n return {\n perApprovalUsd: limits?.perApprovalUsd ?? null,\n dailyUsd: limits?.dailyUsd ?? null,\n };\n}\n"],"mappings":";;;;;;;;AAiBA,MAAM,uBAAuB,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,KAAK,GAAG,EAAE,UAAU,CAAC,CAAC;AAExE,SAAS,iBAAiB,UAAkB;CACxC,OAAO;;EAEH,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,QAAQ,GAAG,EAAE,SAAS,CAAC,GAAG,EAAE,SAAS,QAAQ,CAAC,CAAC;;EAEtF,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,KAAK,CAAC,CAAC;CACtD;AACJ;AAEA,MAAM,yBAAyB,EAAE,aAAa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,SAAS,EAAE,OAAO;;EAE3B,MAAM,EAAE,KAAK,IAAI,0BAA0B;;EAE3C,WAAW,UAAU,EAAE,SAAS;CACpC;AACJ;;AAaA,MAAM,sBAAsB,EAAE,KAC1B,EAAE,OAAO,GACT,EAAE,KAAK,GACP,EAAE,MAAM,qBAAqB,wDAAwD,CACzF;AAEA,MAAa,uCAAuC,EAAE,aAAa;;CAE/D,gBAAgB,EAAE,SAAS,mBAAmB;;CAE9C,UAAU,EAAE,SAAS,mBAAmB;AAC5C,CAAC;AAYD,SAAgB,6BACZ,QACsB;CACtB,OAAO;EACH,gBAAgB,QAAQ,kBAAkB;EAC1C,UAAU,QAAQ,YAAY;CAClC;AACJ"}
1
+ {"version":3,"file":"assistant.schemas.js","names":[],"sources":["../../../src/services/assistant/assistant.schemas.ts"],"sourcesContent":["import * as v from \"valibot\";\nimport { bytesToHex } from \"@noble/hashes/utils.js\";\nimport type * as Proto from \"../../gen/ai/v1/assistant_pb.js\";\nimport { enumLabel } from \"../../shared/proto-enum-codec.js\";\nimport { idInputSchema, optionalSubaccountIdInputSchema } from \"../../shared/schemas.js\";\nimport { formatId } from \"../../utils/base58-id.js\";\nimport { tsObjToMs } from \"../../utils/time.js\";\nimport {\n ASSISTANT_ACCOUNT_SELECTION_VALUES,\n ASSISTANT_KEY_VIEW_VALUES,\n AccountSelectionCodec,\n AssistantKeyViewCodec,\n ASSISTANT_APPROVAL_DECISION_VALUES,\n ASSISTANT_DISPLAY_SETTING_VALUES,\n ApprovalDecisionCodec,\n AssistantKeyStateCodec,\n DisplaySettingCodec,\n MemoryKindCodec,\n MessageRoleCodec,\n} from \"./assistant.codecs.js\";\n\nconst IdempotencyKeySchema = v.pipe(v.string(), v.trim(), v.minLength(1));\n\nfunction pageInputEntries(maxLimit: number) {\n return {\n /** Page size; omit for the server default. */\n limit: v.optional(v.pipe(v.number(), v.integer(), v.minValue(1), v.maxValue(maxLimit))),\n /** The previous page's `nextPageToken`. */\n pageToken: v.optional(v.pipe(v.string(), v.trim())),\n };\n}\n\nconst DestinationInputSchema = v.strictObject({\n /** The client's id for the place, e.g. `\"page-subaccounts\"`: lowercase letters, digits and hyphens. */\n id: v.pipe(\n v.string(),\n v.regex(/^[a-z0-9-]{1,64}$/, \"destination id must be 1-64 of a-z, 0-9, -\"),\n ),\n /** Its name as the client shows it, 1 to 80 characters. */\n title: v.pipe(v.string(), v.minLength(1), v.maxLength(80)),\n /** What the user does there, at most 200 characters. */\n description: v.optional(v.pipe(v.string(), v.maxLength(200)), \"\"),\n});\n\n/**\n * The page the user is on, named by its template and title, never by its address: never send the\n * URL, its query or fragment, or any id or symbol taken from the path.\n */\nconst CurrentPageInputSchema = v.strictObject({\n /** The page's `destinations` id, when it is one of them. */\n destinationId: v.optional(\n v.pipe(\n v.string(),\n v.regex(/^[a-z0-9-]{1,64}$/, \"destinationId must be 1-64 of a-z, 0-9, -\"),\n ),\n ),\n /** Route template with bracketed parameters, e.g. `\"/account/settings/[section]\"`. */\n route: v.pipe(\n v.string(),\n v.regex(\n /^\\/[A-Za-z0-9/\\-_.[\\]]{0,199}$/,\n \"route must start with / and use at most 200 of A-Z, a-z, 0-9, /, -, _, ., [, ]\",\n ),\n ),\n /** The page's title as the client shows it, 1 to 80 characters; never the user's own data. */\n title: v.pipe(v.string(), v.minLength(1), v.maxLength(80)),\n});\n\nexport const SendAssistantMessageInputSchema = v.pipe(\n v.strictObject({\n /** Conversation to continue; omit to start a new one. */\n conversationId: v.optional(idInputSchema(\"conversationId\")),\n /** Message text, plain text or Markdown, 1 to 16000 characters. */\n text: v.pipe(v.string(), v.minLength(1), v.maxLength(16_000)),\n /** Client-chosen key, unique per caller. Repeat the request unchanged to resolve an unknown outcome. */\n idempotencyKey: IdempotencyKeySchema,\n /**\n * Trading account the run reads and acts on. Omit for the main account: the run then\n * reads it (balances, trading accounts, API keys, price alerts, fees and permissions)\n * but places, changes and cancels nothing, and asks the user to pick a trading account.\n */\n subaccountId: optionalSubaccountIdInputSchema(),\n /**\n * `\"none\"` for a run that reads no account, such as when the user has given the\n * assistant access to no account; `subaccountId` must then be omitted. Omit to read the\n * `subaccountId` account or the main account. Covered by `idempotencyKey`.\n */\n accountSelection: v.pipe(\n v.optional(v.picklist(ASSISTANT_ACCOUNT_SELECTION_VALUES)),\n v.transform((value) => (value ? AccountSelectionCodec.inputToProto[value] : undefined)),\n ),\n /** Places in the client the run may suggest, at most 100, each id once. */\n destinations: v.optional(\n v.pipe(\n v.array(DestinationInputSchema),\n v.maxLength(100, \"At most 100 destinations are allowed.\"),\n v.check(\n (items) => new Set(items.map((d) => d.id)).size === items.length,\n \"Destination ids must be distinct.\",\n ),\n ),\n ),\n /**\n * The page the user is on as they send the message; omit for a client without pages.\n * Covered by `idempotencyKey`: a retry must send the page the first attempt sent.\n */\n page: v.optional(CurrentPageInputSchema),\n /**\n * Display settings the client offers now and will change when a run's\n * `display_setting_action` asks, each once. Omit for none.\n */\n displaySettings: v.optional(\n v.pipe(\n v.array(v.picklist(ASSISTANT_DISPLAY_SETTING_VALUES)),\n v.check(\n (items) => new Set(items).size === items.length,\n \"Display settings must be distinct.\",\n ),\n v.transform((items) => items.map((item) => DisplaySettingCodec.inputToProto[item])),\n ),\n ),\n }),\n v.check(\n (input) => input.accountSelection === undefined || input.subaccountId === undefined,\n 'Omit subaccountId when accountSelection is \"none\".',\n ),\n);\n\nexport type SendAssistantMessageInput = v.InferInput<typeof SendAssistantMessageInputSchema>;\n\nexport const AssistantRunIdInputSchema = v.strictObject({ runId: idInputSchema(\"runId\") });\n\nexport type AssistantRunIdInput = v.InferInput<typeof AssistantRunIdInputSchema>;\n\nexport const WatchAssistantRunInputSchema = v.pipe(\n v.strictObject({\n runId: idInputSchema(\"runId\"),\n /** Return events after this seq. 0 (default) replays the run; pass the last seq received to resume. */\n afterSeq: v.optional(\n v.pipe(v.number(), v.integer(), v.minValue(0), v.maxValue(Number.MAX_SAFE_INTEGER)),\n 0,\n ),\n }),\n v.transform(({ runId, afterSeq }) => ({ runId, afterSeq: BigInt(afterSeq) })),\n);\n\nexport type WatchAssistantRunInput = v.InferInput<typeof WatchAssistantRunInputSchema>;\n\nexport const DecideAssistantApprovalInputSchema = v.pipe(\n v.strictObject({\n approvalId: idInputSchema(\"approvalId\"),\n decision: v.picklist(ASSISTANT_APPROVAL_DECISION_VALUES),\n }),\n v.transform(({ approvalId, decision }) => ({\n approvalId,\n decision: ApprovalDecisionCodec.inputToProto[decision],\n })),\n);\n\nexport type DecideAssistantApprovalInput = v.InferInput<typeof DecideAssistantApprovalInputSchema>;\n\nexport const ListAssistantConversationsInputSchema = v.strictObject(pageInputEntries(100));\n\nexport type ListAssistantConversationsInput = v.InferInput<\n typeof ListAssistantConversationsInputSchema\n>;\n\nexport const ListAssistantMessagesInputSchema = v.strictObject({\n conversationId: idInputSchema(\"conversationId\"),\n ...pageInputEntries(200),\n});\n\nexport type ListAssistantMessagesInput = v.InferInput<typeof ListAssistantMessagesInputSchema>;\n\nexport const ListAssistantMemoriesInputSchema = v.strictObject(pageInputEntries(200));\n\nexport type ListAssistantMemoriesInput = v.InferInput<typeof ListAssistantMemoriesInputSchema>;\n\nexport const DeleteAssistantMemoryInputSchema = v.strictObject({\n memoryId: idInputSchema(\"memoryId\"),\n});\n\nexport type DeleteAssistantMemoryInput = v.InferInput<typeof DeleteAssistantMemoryInputSchema>;\n\nexport const PrepareAssistantKeysInputSchema = v.pipe(\n v.strictObject({\n /** 1 to 64 accounts, each once. An entry without `subaccountId` is the main account. */\n accounts: v.pipe(\n v.array(v.strictObject({ subaccountId: optionalSubaccountIdInputSchema() })),\n v.minLength(1, \"At least one account is required.\"),\n v.maxLength(64, \"At most 64 accounts are allowed.\"),\n ),\n }),\n v.check(\n ({ accounts }) =>\n new Set(accounts.map((a) => a.subaccountId ?? 0n)).size === accounts.length,\n \"Each account may be named only once.\",\n ),\n);\n\nexport type PrepareAssistantKeysInput = v.InferInput<typeof PrepareAssistantKeysInputSchema>;\n\nexport const CompleteAssistantKeysInputSchema = v.strictObject({\n setupId: idInputSchema(\"setupId\"),\n});\n\nexport type CompleteAssistantKeysInput = v.InferInput<typeof CompleteAssistantKeysInputSchema>;\n\n/* ---------- outputs ---------- */\n\nfunction optionalId(id: bigint | undefined): string | undefined {\n return id ? formatId(id) : undefined;\n}\n\nexport function formatConversation(c: Proto.Conversation) {\n return {\n conversationId: formatId(c.conversationId),\n /** Empty until a title is available. */\n title: c.title,\n createdAt: tsObjToMs(c.createdAt),\n updatedAt: tsObjToMs(c.updatedAt),\n };\n}\n\nexport type AssistantConversation = ReturnType<typeof formatConversation>;\n\nexport function formatMessage(m: Proto.Message) {\n return {\n messageId: formatId(m.messageId),\n role: enumLabel(MessageRoleCodec.protoToOutput, m.role),\n /** Markdown. For an assistant message, its run's final text. */\n text: m.text,\n createdAt: tsObjToMs(m.createdAt),\n /** Replay this run with `watchRun` from `afterSeq: 0` to show its tool activity and views. */\n runId: formatId(m.runId),\n };\n}\n\nexport type AssistantMessage = ReturnType<typeof formatMessage>;\n\nexport function formatMemory(m: Proto.Memory) {\n return {\n memoryId: formatId(m.memoryId),\n text: m.text,\n createdAt: tsObjToMs(m.createdAt),\n /** Omitted when the conversation it was learned in is unknown. */\n conversationId: optionalId(m.conversationId),\n kind: enumLabel(MemoryKindCodec.protoToOutput, m.kind),\n };\n}\n\nexport type AssistantMemory = ReturnType<typeof formatMemory>;\n\nexport function formatAssistantKey(k: Proto.AssistantKey) {\n return {\n /** Omitted for the main account. */\n subaccountId: optionalId(k.subaccountId),\n keyId: k.keyId,\n publicKeyEd25519: k.publicKeyEd25519,\n publicKeyHex: bytesToHex(k.publicKeyEd25519),\n state: enumLabel(AssistantKeyStateCodec.protoToOutput, k.state),\n /**\n * The subaccount's name; only from `listKeys({ view: \"full\" })`. Empty for the main\n * account, an unnamed subaccount, or a name that could not be read.\n */\n label: k.label,\n };\n}\n\nexport const ListAssistantKeysInputSchema = v.pipe(\n v.strictObject({\n /** `\"full\"` adds each key's account name as `label`. */\n view: v.optional(v.picklist(ASSISTANT_KEY_VIEW_VALUES)),\n }),\n v.transform(({ view }) => ({\n view: view ? AssistantKeyViewCodec.inputToProto[view] : undefined,\n })),\n);\n\nexport type ListAssistantKeysInput = v.InferInput<typeof ListAssistantKeysInputSchema>;\n\nexport type AssistantKey = ReturnType<typeof formatAssistantKey>;\n\nexport function formatPreparedAssistantKey(k: Proto.PreparedAssistantKey) {\n return {\n /** Omitted for the main account. */\n subaccountId: optionalId(k.subaccountId),\n publicKeyEd25519: k.publicKeyEd25519,\n publicKeyHex: bytesToHex(k.publicKeyEd25519),\n /** Pass unchanged to `apiKeys.setAssistantKeys`. */\n registrationProof: k.registrationProof,\n /** Epoch ms; pass unchanged to `apiKeys.setAssistantKeys`. */\n registrationDeadline: tsObjToMs(k.registrationDeadline),\n };\n}\n\nexport type PreparedAssistantKey = ReturnType<typeof formatPreparedAssistantKey>;\n\nexport function formatPrepareAssistantKeysResult(r: Proto.PrepareAssistantKeysResponse) {\n return {\n setupId: formatId(r.setupId),\n /** One key per requested account, in request order. */\n keys: r.keys.map(formatPreparedAssistantKey),\n /** Epoch ms after which the keys can no longer be registered. */\n expiresAt: tsObjToMs(r.expiresAt),\n };\n}\n\nexport type PrepareAssistantKeysResult = ReturnType<typeof formatPrepareAssistantKeysResult>;\n\n/** `nextPageToken` is empty when no more results exist. */\nexport type ListAssistantConversationsResult = {\n conversations: AssistantConversation[];\n nextPageToken: string;\n};\nexport type ListAssistantMessagesResult = { messages: AssistantMessage[]; nextPageToken: string };\nexport type ListAssistantMemoriesResult = { memories: AssistantMemory[]; nextPageToken: string };\n\n/** US dollars as a decimal string with at most 2 decimal places, e.g. `\"5000\"` or `\"250.50\"`. */\nconst UsdLimitInputSchema = v.pipe(\n v.string(),\n v.trim(),\n v.regex(/^\\d+(\\.\\d{1,2})?$/, \"limit must be US dollars with at most 2 decimal places\"),\n);\n\nexport const SetTelegramApprovalLimitsInputSchema = v.strictObject({\n /** Largest notional value of one approval from Telegram. `\"0\"` allows none; omit for no limit. */\n perApprovalUsd: v.optional(UsdLimitInputSchema),\n /** Largest total notional value approved from Telegram in any rolling 24 hours; omit for no limit. */\n dailyUsd: v.optional(UsdLimitInputSchema),\n});\n\nexport type SetTelegramApprovalLimitsInput = v.InferInput<\n typeof SetTelegramApprovalLimitsInputSchema\n>;\n\n/** Limits on what the caller may approve from Telegram, in US dollars; `null` is no limit. */\nexport type TelegramApprovalLimits = {\n perApprovalUsd: string | null;\n dailyUsd: string | null;\n};\n\nexport function formatTelegramApprovalLimits(\n limits: Proto.TelegramApprovalLimits | undefined,\n): TelegramApprovalLimits {\n return {\n perApprovalUsd: limits?.perApprovalUsd ?? null,\n dailyUsd: limits?.dailyUsd ?? null,\n };\n}\n"],"mappings":";;;;;;;;AAqBA,MAAM,uBAAuB,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,KAAK,GAAG,EAAE,UAAU,CAAC,CAAC;AAExE,SAAS,iBAAiB,UAAkB;CACxC,OAAO;;EAEH,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,QAAQ,GAAG,EAAE,SAAS,CAAC,GAAG,EAAE,SAAS,QAAQ,CAAC,CAAC;;EAEtF,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,KAAK,CAAC,CAAC;CACtD;AACJ;AAEA,MAAM,yBAAyB,EAAE,aAAa;;CAE1C,IAAI,EAAE,KACF,EAAE,OAAO,GACT,EAAE,MAAM,qBAAqB,4CAA4C,CAC7E;;CAEA,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,UAAU,CAAC,GAAG,EAAE,UAAU,EAAE,CAAC;;CAEzD,aAAa,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,UAAU,GAAG,CAAC,GAAG,EAAE;AACpE,CAAC;;;;;AAMD,MAAM,yBAAyB,EAAE,aAAa;;CAE1C,eAAe,EAAE,SACb,EAAE,KACE,EAAE,OAAO,GACT,EAAE,MAAM,qBAAq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AoB;CAC1D;AACJ;AAIA,SAAgB,iCAAiC,GAAuC;CACpF,OAAO;EACH,SAAS,SAAS,EAAE,OAAO;;EAE3B,MAAM,EAAE,KAAK,IAAI,0BAA0B;;EAE3C,WAAW,UAAU,EAAE,SAAS;CACpC;AACJ;;AAaA,MAAM,sBAAsB,EAAE,KAC1B,EAAE,OAAO,GACT,EAAE,KAAK,GACP,EAAE,MAAM,qBAAqB,wDAAwD,CACzF;AAEA,MAAa,uCAAuC,EAAE,aAAa;;CAE/D,gBAAgB,EAAE,SAAS,mBAAmB;;CAE9C,UAAU,EAAE,SAAS,mBAAmB;AAC5C,CAAC;AAYD,SAAgB,6BACZ,QACsB;CACtB,OAAO;EACH,gBAAgB,QAAQ,kBAAkB;EAC1C,UAAU,QAAQ,YAAY;CAClC;AACJ"}
@@ -1,4 +1,4 @@
1
1
  import { AssistantApprovalPreview, AssistantOrderPreview, AssistantRunEvent, AssistantView } from "./assistant-events.schemas.js";
2
- import { AssistantApprovalDecision, AssistantApprovalStatus, AssistantDisplaySetting, AssistantFailureCategory, AssistantKeyState, AssistantMemoryKind, AssistantMessageRole, AssistantOrderPriceField, AssistantPriceOffsetDirection, AssistantPriceRounding, AssistantReferencePriceSource, AssistantTriggerChangeAction, AssistantTriggerDirection, AssistantUnfilledSlicePolicy } from "./assistant.codecs.js";
3
- import { AssistantConversation, AssistantKey, AssistantMemory, AssistantMessage, AssistantRunIdInput, CompleteAssistantKeysInput, DecideAssistantApprovalInput, DeleteAssistantMemoryInput, ListAssistantConversationsInput, ListAssistantConversationsResult, ListAssistantMemoriesInput, ListAssistantMemoriesResult, ListAssistantMessagesInput, ListAssistantMessagesResult, PrepareAssistantKeysInput, PrepareAssistantKeysResult, PreparedAssistantKey, SendAssistantMessageInput, SetTelegramApprovalLimitsInput, TelegramApprovalLimits, WatchAssistantRunInput } from "./assistant.schemas.js";
4
- export type { AssistantApprovalDecision, AssistantApprovalPreview, AssistantApprovalStatus, AssistantConversation, AssistantDisplaySetting, AssistantFailureCategory, AssistantKey, AssistantKeyState, AssistantMemory, AssistantMemoryKind, AssistantMessage, AssistantMessageRole, AssistantOrderPreview, AssistantOrderPriceField, AssistantPriceOffsetDirection, AssistantPriceRounding, AssistantReferencePriceSource, AssistantRunEvent, AssistantRunIdInput, AssistantTriggerChangeAction, AssistantTriggerDirection, AssistantUnfilledSlicePolicy, AssistantView, CompleteAssistantKeysInput, DecideAssistantApprovalInput, DeleteAssistantMemoryInput, ListAssistantConversationsInput, ListAssistantConversationsResult, ListAssistantMemoriesInput, ListAssistantMemoriesResult, ListAssistantMessagesInput, ListAssistantMessagesResult, PrepareAssistantKeysInput, PrepareAssistantKeysResult, PreparedAssistantKey, SendAssistantMessageInput, SetTelegramApprovalLimitsInput, TelegramApprovalLimits, WatchAssistantRunInput };
2
+ import { AssistantAccountSelection, AssistantApprovalDecision, AssistantApprovalStatus, AssistantDisplaySetting, AssistantFailureCategory, AssistantKeyState, AssistantKeyView, AssistantMemoryKind, AssistantMessageRole, AssistantOrderPriceField, AssistantPriceOffsetDirection, AssistantPriceRounding, AssistantReferencePriceSource, AssistantTriggerChangeAction, AssistantTriggerDirection, AssistantUnfilledSlicePolicy } from "./assistant.codecs.js";
3
+ import { AssistantConversation, AssistantKey, AssistantMemory, AssistantMessage, AssistantRunIdInput, CompleteAssistantKeysInput, DecideAssistantApprovalInput, DeleteAssistantMemoryInput, ListAssistantConversationsInput, ListAssistantConversationsResult, ListAssistantKeysInput, ListAssistantMemoriesInput, ListAssistantMemoriesResult, ListAssistantMessagesInput, ListAssistantMessagesResult, PrepareAssistantKeysInput, PrepareAssistantKeysResult, PreparedAssistantKey, SendAssistantMessageInput, SetTelegramApprovalLimitsInput, TelegramApprovalLimits, WatchAssistantRunInput } from "./assistant.schemas.js";
4
+ export type { AssistantAccountSelection, AssistantApprovalDecision, AssistantApprovalPreview, AssistantApprovalStatus, AssistantConversation, AssistantDisplaySetting, AssistantFailureCategory, AssistantKey, AssistantKeyState, AssistantKeyView, AssistantMemory, AssistantMemoryKind, AssistantMessage, AssistantMessageRole, AssistantOrderPreview, AssistantOrderPriceField, AssistantPriceOffsetDirection, AssistantPriceRounding, AssistantReferencePriceSource, AssistantRunEvent, AssistantRunIdInput, AssistantTriggerChangeAction, AssistantTriggerDirection, AssistantUnfilledSlicePolicy, AssistantView, CompleteAssistantKeysInput, DecideAssistantApprovalInput, DeleteAssistantMemoryInput, ListAssistantConversationsInput, ListAssistantConversationsResult, ListAssistantKeysInput, ListAssistantMemoriesInput, ListAssistantMemoriesResult, ListAssistantMessagesInput, ListAssistantMessagesResult, PrepareAssistantKeysInput, PrepareAssistantKeysResult, PreparedAssistantKey, SendAssistantMessageInput, SetTelegramApprovalLimitsInput, TelegramApprovalLimits, WatchAssistantRunInput };
@@ -18,7 +18,7 @@ declare class ProfileService {
18
18
  */
19
19
  get(options?: PolyesterRequestOptions): Promise<Profile>;
20
20
  /**
21
- * Updates only the provided mutable profile fields; omitted fields are unchanged, while present empty strings clear optional text fields such as bio, website, Twitter, and avatar URL.
21
+ * Updates only the provided mutable profile fields; omitted fields are unchanged, while present empty strings clear optional text fields such as bio, website, and avatar URL. The X handle is set only through X verification.
22
22
  */
23
23
  update(input: v.InferInput<typeof UpdateProfileInputSchema>, options?: PolyesterMutationOptions): Promise<Profile>;
24
24
  /**
@@ -25,7 +25,7 @@ var ProfileService = class {
25
25
  return parse(ProfileSchema, res);
26
26
  }
27
27
  /**
28
- * Updates only the provided mutable profile fields; omitted fields are unchanged, while present empty strings clear optional text fields such as bio, website, Twitter, and avatar URL.
28
+ * Updates only the provided mutable profile fields; omitted fields are unchanged, while present empty strings clear optional text fields such as bio, website, and avatar URL. The X handle is set only through X verification.
29
29
  */
30
30
  async update(input, options) {
31
31
  const validatedInput = parse(UpdateProfileInputSchema, input);
@@ -1 +1 @@
1
- {"version":3,"file":"profile.js","names":["#client","Proto.ProfileService","#realtime","Proto.AccountIdentitySchema","AccountIdentitySchema"],"sources":["../../../../src/services/auth/profile/profile.ts"],"sourcesContent":["import { createClient, type Client } from \"@connectrpc/connect\";\nimport * as Proto from \"../../../gen/auth/v1/profile_pb.js\";\nimport type { AuthApiTransports } from \"../../../shared/transports.js\";\nimport * as v from \"valibot\";\nimport { parse } from \"../../../shared/validation.js\";\nimport { removeUndefined } from \"../../../utils/remove-undefined.js\";\nimport {\n toConnectCallOptions,\n type PolyesterMutationOptions,\n type PolyesterRequestOptions,\n} from \"../../../shared/request-options.js\";\nimport {\n AccountIdentitySchema,\n ClaimGeneratedUsernameInputSchema,\n GeneratedUsernameOfferSchema,\n ProfileSchema,\n UpdateProfileInputSchema,\n UsernameHistoryEntrySchema,\n type AccountIdentity,\n type GeneratedUsernameOffer,\n type Profile,\n type UsernameHistoryEntry,\n} from \"./profile.schemas.js\";\nimport type { BaseSubscribeInput } from \"../../../shared/types.js\";\nimport type { PolyesterRealtime } from \"../../../realtime/index.js\";\n\ninterface SubscribeIdentityInput extends BaseSubscribeInput<AccountIdentity> {}\n\n/**\n * Manages the authenticated account's public profile and realtime identity updates.\n */\nexport class ProfileService {\n #client: Client<typeof Proto.ProfileService>;\n #realtime: PolyesterRealtime;\n\n constructor(transports: AuthApiTransports, realtime: PolyesterRealtime) {\n this.#client = createClient(Proto.ProfileService, transports.authApi);\n this.#realtime = realtime;\n }\n\n /**\n * Fetches the caller's public profile, including username eligibility/cooldown, verified social handles, avatar, VIP tier, and account creation timestamp. API keys need `read-profile` and must be scoped to the main account.\n */\n async get(options?: PolyesterRequestOptions): Promise<Profile> {\n const res = await this.#client.getProfile({}, toConnectCallOptions(options));\n if (!res) throw new Error(\"Profile not found\");\n return parse(ProfileSchema, res);\n }\n\n /**\n * Updates only the provided mutable profile fields; omitted fields are unchanged, while present empty strings clear optional text fields such as bio, website, Twitter, and avatar URL.\n */\n async update(\n input: v.InferInput<typeof UpdateProfileInputSchema>,\n options?: PolyesterMutationOptions,\n ): Promise<Profile> {\n const validatedInput = parse(UpdateProfileInputSchema, input);\n const res = await this.#client.updateProfile(\n removeUndefined(validatedInput),\n toConnectCallOptions(options),\n );\n return parse(ProfileSchema, res);\n }\n\n /**\n * Returns the caller's recent username changes, newest first, capped at 20 entries. API keys need `read-profile` and must be scoped to the main account.\n */\n async getUsernameHistory(options?: PolyesterRequestOptions): Promise<UsernameHistoryEntry[]> {\n const res = await this.#client.getUsernameHistory({}, toConnectCallOptions(options));\n return parse(v.array(UsernameHistoryEntrySchema), res.history);\n }\n\n /**\n * Returns five generated username options and the short-lived offer token required to claim one of them.\n */\n async generateUsernameOptions(\n options?: PolyesterRequestOptions,\n ): Promise<GeneratedUsernameOffer> {\n const res = await this.#client.generateUsernameOptions({}, toConnectCallOptions(options));\n return parse(GeneratedUsernameOfferSchema, res);\n }\n\n /**\n * Claims one username from a generated offer by its zero-based option index.\n */\n async claimGeneratedUsername(\n input: v.InferInput<typeof ClaimGeneratedUsernameInputSchema>,\n options?: PolyesterMutationOptions,\n ): Promise<Profile> {\n const validatedInput = parse(ClaimGeneratedUsernameInputSchema, input);\n const res = await this.#client.claimGeneratedUsername(\n validatedInput,\n toConnectCallOptions(options),\n );\n return parse(ProfileSchema, res);\n }\n\n /**\n * Subscribes to public identity updates and emits normalized account identity records with base58 account IDs, username, avatar URL, and root smart-account address.\n */\n subscribeIdentity(input: SubscribeIdentityInput): () => void {\n const channel = \"public:identity:updates:proto\";\n return this.#realtime.connectProtoChannel({\n channel,\n schema: Proto.AccountIdentitySchema,\n onPublication: (data) => {\n const identity = parse(AccountIdentitySchema, data);\n input.onEvent(identity);\n },\n onConnected: () => input.onOpen?.(),\n onDisconnected: () => input.onClose?.(),\n onError: input.onError,\n });\n }\n}\n"],"mappings":";;;;;;;;;;;AA+BA,IAAa,iBAAb,MAA4B;CACxB;CACA;CAEA,YAAY,YAA+B,UAA6B;EACpE,KAAKA,UAAU,aAAaC,kBAAsB,WAAW,OAAO;EACpE,KAAKC,YAAY;CACrB;;;;CAKA,MAAM,IAAI,SAAqD;EAC3D,MAAM,MAAM,MAAM,KAAKF,QAAQ,WAAW,CAAC,GAAG,qBAAqB,OAAO,CAAC;EAC3E,IAAI,CAAC,KAAK,MAAM,IAAI,MAAM,mBAAmB;EAC7C,OAAO,MAAM,eAAe,GAAG;CACnC;;;;CAKA,MAAM,OACF,OACA,SACgB;EAChB,MAAM,iBAAiB,MAAM,0BAA0B,KAAK;EAC5D,MAAM,MAAM,MAAM,KAAKA,QAAQ,cAC3B,gBAAgB,cAAc,GAC9B,qBAAqB,OAAO,CAChC;EACA,OAAO,MAAM,eAAe,GAAG;CACnC;;;;CAKA,MAAM,mBAAmB,SAAoE;EACzF,MAAM,MAAM,MAAM,KAAKA,QAAQ,mBAAmB,CAAC,GAAG,qBAAqB,OAAO,CAAC;EACnF,OAAO,MAAM,EAAE,MAAM,0BAA0B,GAAG,IAAI,OAAO;CACjE;;;;CAKA,MAAM,wBACF,SAC+B;EAC/B,MAAM,MAAM,MAAM,KAAKA,QAAQ,wBAAwB,CAAC,GAAG,qBAAqB,OAAO,CAAC;EACxF,OAAO,MAAM,8BAA8B,GAAG;CAClD;;;;CAKA,MAAM,uBACF,OACA,SACgB;EAChB,MAAM,iBAAiB,MAAM,mCAAmC,KAAK;EACrE,MAAM,MAAM,MAAM,KAAKA,QAAQ,uBAC3B,gBACA,qBAAqB,OAAO,CAChC;EACA,OAAO,MAAM,eAAe,GAAG;CACnC;;;;CAKA,kBAAkB,OAA2C;EAEzD,OAAO,KAAKE,UAAU,oBAAoB;GACtC,SAAA;GACA,QAAQC;GACR,gBAAgB,SAAS;IACrB,MAAM,WAAW,MAAMC,yBAAuB,IAAI;IAClD,MAAM,QAAQ,QAAQ;GAC1B;GACA,mBAAmB,MAAM,SAAS;GAClC,sBAAsB,MAAM,UAAU;GACtC,SAAS,MAAM;EACnB,CAAC;CACL;AACJ"}
1
+ {"version":3,"file":"profile.js","names":["#client","Proto.ProfileService","#realtime","Proto.AccountIdentitySchema","AccountIdentitySchema"],"sources":["../../../../src/services/auth/profile/profile.ts"],"sourcesContent":["import { createClient, type Client } from \"@connectrpc/connect\";\nimport * as Proto from \"../../../gen/auth/v1/profile_pb.js\";\nimport type { AuthApiTransports } from \"../../../shared/transports.js\";\nimport * as v from \"valibot\";\nimport { parse } from \"../../../shared/validation.js\";\nimport { removeUndefined } from \"../../../utils/remove-undefined.js\";\nimport {\n toConnectCallOptions,\n type PolyesterMutationOptions,\n type PolyesterRequestOptions,\n} from \"../../../shared/request-options.js\";\nimport {\n AccountIdentitySchema,\n ClaimGeneratedUsernameInputSchema,\n GeneratedUsernameOfferSchema,\n ProfileSchema,\n UpdateProfileInputSchema,\n UsernameHistoryEntrySchema,\n type AccountIdentity,\n type GeneratedUsernameOffer,\n type Profile,\n type UsernameHistoryEntry,\n} from \"./profile.schemas.js\";\nimport type { BaseSubscribeInput } from \"../../../shared/types.js\";\nimport type { PolyesterRealtime } from \"../../../realtime/index.js\";\n\ninterface SubscribeIdentityInput extends BaseSubscribeInput<AccountIdentity> {}\n\n/**\n * Manages the authenticated account's public profile and realtime identity updates.\n */\nexport class ProfileService {\n #client: Client<typeof Proto.ProfileService>;\n #realtime: PolyesterRealtime;\n\n constructor(transports: AuthApiTransports, realtime: PolyesterRealtime) {\n this.#client = createClient(Proto.ProfileService, transports.authApi);\n this.#realtime = realtime;\n }\n\n /**\n * Fetches the caller's public profile, including username eligibility/cooldown, verified social handles, avatar, VIP tier, and account creation timestamp. API keys need `read-profile` and must be scoped to the main account.\n */\n async get(options?: PolyesterRequestOptions): Promise<Profile> {\n const res = await this.#client.getProfile({}, toConnectCallOptions(options));\n if (!res) throw new Error(\"Profile not found\");\n return parse(ProfileSchema, res);\n }\n\n /**\n * Updates only the provided mutable profile fields; omitted fields are unchanged, while present empty strings clear optional text fields such as bio, website, and avatar URL. The X handle is set only through X verification.\n */\n async update(\n input: v.InferInput<typeof UpdateProfileInputSchema>,\n options?: PolyesterMutationOptions,\n ): Promise<Profile> {\n const validatedInput = parse(UpdateProfileInputSchema, input);\n const res = await this.#client.updateProfile(\n removeUndefined(validatedInput),\n toConnectCallOptions(options),\n );\n return parse(ProfileSchema, res);\n }\n\n /**\n * Returns the caller's recent username changes, newest first, capped at 20 entries. API keys need `read-profile` and must be scoped to the main account.\n */\n async getUsernameHistory(options?: PolyesterRequestOptions): Promise<UsernameHistoryEntry[]> {\n const res = await this.#client.getUsernameHistory({}, toConnectCallOptions(options));\n return parse(v.array(UsernameHistoryEntrySchema), res.history);\n }\n\n /**\n * Returns five generated username options and the short-lived offer token required to claim one of them.\n */\n async generateUsernameOptions(\n options?: PolyesterRequestOptions,\n ): Promise<GeneratedUsernameOffer> {\n const res = await this.#client.generateUsernameOptions({}, toConnectCallOptions(options));\n return parse(GeneratedUsernameOfferSchema, res);\n }\n\n /**\n * Claims one username from a generated offer by its zero-based option index.\n */\n async claimGeneratedUsername(\n input: v.InferInput<typeof ClaimGeneratedUsernameInputSchema>,\n options?: PolyesterMutationOptions,\n ): Promise<Profile> {\n const validatedInput = parse(ClaimGeneratedUsernameInputSchema, input);\n const res = await this.#client.claimGeneratedUsername(\n validatedInput,\n toConnectCallOptions(options),\n );\n return parse(ProfileSchema, res);\n }\n\n /**\n * Subscribes to public identity updates and emits normalized account identity records with base58 account IDs, username, avatar URL, and root smart-account address.\n */\n subscribeIdentity(input: SubscribeIdentityInput): () => void {\n const channel = \"public:identity:updates:proto\";\n return this.#realtime.connectProtoChannel({\n channel,\n schema: Proto.AccountIdentitySchema,\n onPublication: (data) => {\n const identity = parse(AccountIdentitySchema, data);\n input.onEvent(identity);\n },\n onConnected: () => input.onOpen?.(),\n onDisconnected: () => input.onClose?.(),\n onError: input.onError,\n });\n }\n}\n"],"mappings":";;;;;;;;;;;AA+BA,IAAa,iBAAb,MAA4B;CACxB;CACA;CAEA,YAAY,YAA+B,UAA6B;EACpE,KAAKA,UAAU,aAAaC,kBAAsB,WAAW,OAAO;EACpE,KAAKC,YAAY;CACrB;;;;CAKA,MAAM,IAAI,SAAqD;EAC3D,MAAM,MAAM,MAAM,KAAKF,QAAQ,WAAW,CAAC,GAAG,qBAAqB,OAAO,CAAC;EAC3E,IAAI,CAAC,KAAK,MAAM,IAAI,MAAM,mBAAmB;EAC7C,OAAO,MAAM,eAAe,GAAG;CACnC;;;;CAKA,MAAM,OACF,OACA,SACgB;EAChB,MAAM,iBAAiB,MAAM,0BAA0B,KAAK;EAC5D,MAAM,MAAM,MAAM,KAAKA,QAAQ,cAC3B,gBAAgB,cAAc,GAC9B,qBAAqB,OAAO,CAChC;EACA,OAAO,MAAM,eAAe,GAAG;CACnC;;;;CAKA,MAAM,mBAAmB,SAAoE;EACzF,MAAM,MAAM,MAAM,KAAKA,QAAQ,mBAAmB,CAAC,GAAG,qBAAqB,OAAO,CAAC;EACnF,OAAO,MAAM,EAAE,MAAM,0BAA0B,GAAG,IAAI,OAAO;CACjE;;;;CAKA,MAAM,wBACF,SAC+B;EAC/B,MAAM,MAAM,MAAM,KAAKA,QAAQ,wBAAwB,CAAC,GAAG,qBAAqB,OAAO,CAAC;EACxF,OAAO,MAAM,8BAA8B,GAAG;CAClD;;;;CAKA,MAAM,uBACF,OACA,SACgB;EAChB,MAAM,iBAAiB,MAAM,mCAAmC,KAAK;EACrE,MAAM,MAAM,MAAM,KAAKA,QAAQ,uBAC3B,gBACA,qBAAqB,OAAO,CAChC;EACA,OAAO,MAAM,eAAe,GAAG;CACnC;;;;CAKA,kBAAkB,OAA2C;EAEzD,OAAO,KAAKE,UAAU,oBAAoB;GACtC,SAAA;GACA,QAAQC;GACR,gBAAgB,SAAS;IACrB,MAAM,WAAW,MAAMC,yBAAuB,IAAI;IAClD,MAAM,QAAQ,QAAQ;GAC1B;GACA,mBAAmB,MAAM,SAAS;GAClC,sBAAsB,MAAM,UAAU;GACtC,SAAS,MAAM;EACnB,CAAC;CACL;AACJ"}
@@ -32,7 +32,6 @@ declare const UpdateProfileInputSchema: v.ObjectSchema<{
32
32
  readonly username: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
33
33
  readonly bio: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
34
34
  readonly website: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
35
- readonly twitter: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
36
35
  readonly avatarUrl: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
37
36
  }, undefined>;
38
37
  type UpdateProfileInput = v.InferInput<typeof UpdateProfileInputSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"profile.schemas.d.ts","names":[],"sources":["../../../../src/services/auth/profile/profile.schemas.ts"],"mappings":";;cASa,eAAa,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;KAsBd,UAAU,EAAE,mBAAmB;cAG9B,0BAAwB,EAAA;;;;;;;KAOzB,qBAAqB,EAAE,kBAAkB;cAExC,4BAA0B,EAAA;;;;;;;;;;KAQ3B,uBAAuB,EAAE,mBAAmB;cAE3C,8BAA4B,EAAA;;;;;;;;;;;KAM7B,yBAAyB,EAAE,mBAAmB;cAE7C,mCAAiC,EAAA;;;;KAKlC,8BAA8B,EAAE,kBAAkB;cAEjD,uBAAqB,EAAA;;;;;;KAOtB,kBAAkB,EAAE,mBAAmB"}
1
+ {"version":3,"file":"profile.schemas.d.ts","names":[],"sources":["../../../../src/services/auth/profile/profile.schemas.ts"],"mappings":";;cASa,eAAa,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;KAsBd,UAAU,EAAE,mBAAmB;cAI9B,0BAAwB,EAAA;;;;;;KAMzB,qBAAqB,EAAE,kBAAkB;cAExC,4BAA0B,EAAA;;;;;;;;;;KAQ3B,uBAAuB,EAAE,mBAAmB;cAE3C,8BAA4B,EAAA;;;;;;;;;;;KAM7B,yBAAyB,EAAE,mBAAmB;cAE7C,mCAAiC,EAAA;;;;KAKlC,8BAA8B,EAAE,kBAAkB;cAEjD,uBAAqB,EAAA;;;;;;KAOtB,kBAAkB,EAAE,mBAAmB"}
@@ -22,7 +22,6 @@ const UpdateProfileInputSchema = v.object({
22
22
  username: v.optional(v.string()),
23
23
  bio: v.optional(v.string()),
24
24
  website: v.optional(v.string()),
25
- twitter: v.optional(v.string()),
26
25
  avatarUrl: v.optional(v.string())
27
26
  });
28
27
  const UsernameHistoryEntrySchema = v.object({