@deepraxis/sdk 0.1.1-dev.b176367 → 0.1.1-dev.d25d171

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.
@@ -102,7 +102,7 @@ export declare const unblockEndUser: <ThrowOnError extends boolean = false>(opti
102
102
  *
103
103
  * Sign your logged-in customer in to a service agent from your backend with a one-time grant code that Agent Kit exchanges for a customer access token.
104
104
  *
105
- * Call this from your backend with your API key after your own login succeeds, then pass the returned code to Agent Kit in the browser; never call it from the browser. Customer authorization follows Shopify Storefront customer access tokens (Multipass-style sign-in, a short-lived token, renewal and logout), so that experience applies. customer_id is your own identifier for the customer: use an opaque id such as your database user id, not an email address or phone number. The value auth is reserved, and ids starting with anon_ are reserved for anonymous customers. The code works once and expires after expires_in seconds (default 900). The sign-in it starts lasts max_session_seconds (default 7 days); version, budget_cents, system_message, agent_override and metadata apply to every token of the sign-in. Unlike Shopify, origin binds the whole sign-in to one page origin, and anonymous_access_token merges the conversations of the anonymous visitor who chatted before signing in into this customer. Example body: {"customer_id":"cus_8f2a91","origin":"https://shop.example.com"}.
105
+ * Call this from your backend with your API key after your own login succeeds, then pass the returned code to Agent Kit in the browser; never call it from the browser. Customer authorization follows Shopify Storefront customer access tokens (Multipass-style sign-in, a short-lived token, renewal and logout), so that experience applies. customer_id is your own identifier for the customer: use an opaque id such as your database user id, not an email address or phone number. The value auth is reserved, and ids starting with anon_ are reserved for anonymous customers. The code works once and expires after expires_in seconds (default 900). The sign-in it starts lasts max_session_seconds (default 7 days); version, budget (US dollars, at most 2 decimals), system_message, agent_override and metadata apply to every token of the sign-in. Unlike Shopify, origin binds the whole sign-in to one page origin, and anonymous_access_token merges the conversations of the anonymous visitor who chatted before signing in into this customer. Example body: {"customer_id":"cus_8f2a91","origin":"https://shop.example.com"}.
106
106
  */
107
107
  export declare const createCustomerGrantCode: <ThrowOnError extends boolean = false>(options: Options<CreateCustomerGrantCodeData, ThrowOnError>) => RequestResult<CreateCustomerGrantCodeResponses, CreateCustomerGrantCodeErrors, ThrowOnError>;
108
108
  /**
@@ -226,7 +226,7 @@ export const unblockEndUser = (options) => (options.client ?? client).post({
226
226
  *
227
227
  * Sign your logged-in customer in to a service agent from your backend with a one-time grant code that Agent Kit exchanges for a customer access token.
228
228
  *
229
- * Call this from your backend with your API key after your own login succeeds, then pass the returned code to Agent Kit in the browser; never call it from the browser. Customer authorization follows Shopify Storefront customer access tokens (Multipass-style sign-in, a short-lived token, renewal and logout), so that experience applies. customer_id is your own identifier for the customer: use an opaque id such as your database user id, not an email address or phone number. The value auth is reserved, and ids starting with anon_ are reserved for anonymous customers. The code works once and expires after expires_in seconds (default 900). The sign-in it starts lasts max_session_seconds (default 7 days); version, budget_cents, system_message, agent_override and metadata apply to every token of the sign-in. Unlike Shopify, origin binds the whole sign-in to one page origin, and anonymous_access_token merges the conversations of the anonymous visitor who chatted before signing in into this customer. Example body: {"customer_id":"cus_8f2a91","origin":"https://shop.example.com"}.
229
+ * Call this from your backend with your API key after your own login succeeds, then pass the returned code to Agent Kit in the browser; never call it from the browser. Customer authorization follows Shopify Storefront customer access tokens (Multipass-style sign-in, a short-lived token, renewal and logout), so that experience applies. customer_id is your own identifier for the customer: use an opaque id such as your database user id, not an email address or phone number. The value auth is reserved, and ids starting with anon_ are reserved for anonymous customers. The code works once and expires after expires_in seconds (default 900). The sign-in it starts lasts max_session_seconds (default 7 days); version, budget (US dollars, at most 2 decimals), system_message, agent_override and metadata apply to every token of the sign-in. Unlike Shopify, origin binds the whole sign-in to one page origin, and anonymous_access_token merges the conversations of the anonymous visitor who chatted before signing in into this customer. Example body: {"customer_id":"cus_8f2a91","origin":"https://shop.example.com"}.
230
230
  */
231
231
  export const createCustomerGrantCode = (options) => (options.client ?? client).post({
232
232
  security: [{
@@ -4215,7 +4215,7 @@ export type AgentManaged57 = {
4215
4215
  type: 'custom';
4216
4216
  };
4217
4217
  /**
4218
- * Session spending limit, {type: "limit", max_list_cost: {amount, currency}}; null when unlimited. Creation defaults to a limit of 2000 US cents (USD 20.00) when omitted. amount is a positive integer string of US cents; removing the limit with null prevents setting it again for that session.
4218
+ * Session spending limit, {type: "limit", max_list_cost: {amount, currency}}; null when unlimited. amount is in US dollars: send an integer or up to 2 decimals ("0.50"), and responses carry exactly 2 decimals ("20.00"). Creation defaults to USD 20.00 when omitted. More decimals, zero or a number return 400. Removing the limit with null prevents setting it again for that session.
4219
4219
  */
4220
4220
  export type AgentManaged76 = {
4221
4221
  /**
@@ -4408,6 +4408,19 @@ export type AgentManaged179 = {
4408
4408
  * Cumulative count of server-executed tool invocations, broken down by tool.
4409
4409
  */
4410
4410
  server_tool_use?: null | AgentManaged181;
4411
+ /**
4412
+ * Praxis extension: priced runtime of this session (the time it was running), billed separately from list_cost and not counted against the budget. amount is in US dollars as a decimal string with exactly 6 decimals, e.g. "0.000280". Each thread's runtime is reported on that thread. /agent/v1 only.
4413
+ */
4414
+ runtime_cost?: {
4415
+ /**
4416
+ * Runtime cost in US dollars, decimal string with exactly 6 decimals.
4417
+ */
4418
+ amount: string;
4419
+ /**
4420
+ * Always USD.
4421
+ */
4422
+ currency: 'USD';
4423
+ };
4411
4424
  };
4412
4425
  export type AgentManaged183 = {
4413
4426
  [key: string]: null | string;
@@ -18102,11 +18115,11 @@ export type AgentManaged33 = {
18102
18115
  [key: string]: unknown;
18103
18116
  };
18104
18117
  /**
18105
- * Largest list-price cost the session may reach, as {amount, currency}. amount is a string of US cents, not dollars.
18118
+ * Largest list-price cost the session may reach, as {amount, currency}. amount is in US dollars with at most 2 decimals, not cents.
18106
18119
  */
18107
18120
  export type AgentManaged77 = {
18108
18121
  /**
18109
- * Cost ceiling in US cents, as a positive integer string with no leading zeros: "2000" is USD 20.00 and "50" is fifty cents. Decimals and JSON numbers return 400.
18122
+ * Amount in US dollars as a decimal string. Costs (usage.list_cost) carry exactly 6 decimals, e.g. "0.000345"; budgets (budget.max_list_cost) carry exactly 2 decimals, e.g. "20.00", and accept an integer or up to 2 decimals on input.
18110
18123
  */
18111
18124
  amount: string;
18112
18125
  /**
@@ -29819,9 +29832,18 @@ export type ListEndUsersResponses = {
29819
29832
  */
29820
29833
  session_count: number;
29821
29834
  /**
29822
- * Accumulated recorded session cost in millionths of a US dollar; zero when no cost has been recorded.
29835
+ * Accumulated recorded cost of this customer's sessions on this agent: model usage (threads included) plus session runtime; amount "0.000000" when nothing has been recorded.
29823
29836
  */
29824
- cost_micro_usd: number;
29837
+ cost: {
29838
+ /**
29839
+ * Amount in US dollars, as a decimal string with exactly 6 decimals and no exponent, e.g. "0.000345" or "12.500000".
29840
+ */
29841
+ amount: string;
29842
+ /**
29843
+ * Always USD.
29844
+ */
29845
+ currency: 'USD';
29846
+ };
29825
29847
  /**
29826
29848
  * Whether the embed policy currently prevents this user from receiving tokens and creating sessions.
29827
29849
  */
@@ -29945,9 +29967,18 @@ export type GetEndUserResponses = {
29945
29967
  */
29946
29968
  session_count: number;
29947
29969
  /**
29948
- * Accumulated recorded session cost in millionths of a US dollar; zero when no cost has been recorded.
29970
+ * Accumulated recorded cost of this customer's sessions on this agent: model usage (threads included) plus session runtime; amount "0.000000" when nothing has been recorded.
29949
29971
  */
29950
- cost_micro_usd: number;
29972
+ cost: {
29973
+ /**
29974
+ * Amount in US dollars, as a decimal string with exactly 6 decimals and no exponent, e.g. "0.000345" or "12.500000".
29975
+ */
29976
+ amount: string;
29977
+ /**
29978
+ * Always USD.
29979
+ */
29980
+ currency: 'USD';
29981
+ };
29951
29982
  /**
29952
29983
  * Whether the embed policy currently prevents this user from receiving tokens and creating sessions.
29953
29984
  */
@@ -30185,9 +30216,18 @@ export type BlockEndUserResponses = {
30185
30216
  */
30186
30217
  session_count: number;
30187
30218
  /**
30188
- * Accumulated recorded session cost in millionths of a US dollar; zero when no cost has been recorded.
30219
+ * Accumulated recorded cost of this customer's sessions on this agent: model usage (threads included) plus session runtime; amount "0.000000" when nothing has been recorded.
30189
30220
  */
30190
- cost_micro_usd: number;
30221
+ cost: {
30222
+ /**
30223
+ * Amount in US dollars, as a decimal string with exactly 6 decimals and no exponent, e.g. "0.000345" or "12.500000".
30224
+ */
30225
+ amount: string;
30226
+ /**
30227
+ * Always USD.
30228
+ */
30229
+ currency: 'USD';
30230
+ };
30191
30231
  /**
30192
30232
  * Whether the embed policy currently prevents this user from receiving tokens and creating sessions.
30193
30233
  */
@@ -30255,9 +30295,18 @@ export type UnblockEndUserResponses = {
30255
30295
  */
30256
30296
  session_count: number;
30257
30297
  /**
30258
- * Accumulated recorded session cost in millionths of a US dollar; zero when no cost has been recorded.
30298
+ * Accumulated recorded cost of this customer's sessions on this agent: model usage (threads included) plus session runtime; amount "0.000000" when nothing has been recorded.
30259
30299
  */
30260
- cost_micro_usd: number;
30300
+ cost: {
30301
+ /**
30302
+ * Amount in US dollars, as a decimal string with exactly 6 decimals and no exponent, e.g. "0.000345" or "12.500000".
30303
+ */
30304
+ amount: string;
30305
+ /**
30306
+ * Always USD.
30307
+ */
30308
+ currency: 'USD';
30309
+ };
30261
30310
  /**
30262
30311
  * Whether the embed policy currently prevents this user from receiving tokens and creating sessions.
30263
30312
  */
@@ -30276,9 +30325,27 @@ export type CreateCustomerGrantCodeData = {
30276
30325
  */
30277
30326
  version?: number;
30278
30327
  /**
30279
- * Budget in cents for each session the customer starts. Defaults to the embed policy session budget and cannot exceed its maximum.
30328
+ * Budget for each session the customer starts, in the same shape as a session budget. Defaults to the embed policy session budget and cannot exceed its maximum.
30280
30329
  */
30281
- budget_cents?: number;
30330
+ budget?: {
30331
+ /**
30332
+ * Budget kind; always limit.
30333
+ */
30334
+ type: 'limit';
30335
+ /**
30336
+ * Spending limit of each session the customer starts.
30337
+ */
30338
+ max_list_cost: {
30339
+ /**
30340
+ * Largest list cost of each session, in US dollars, as a decimal string with at most 2 fraction digits, e.g. "0.50". "0" lets the customer sign in without spending.
30341
+ */
30342
+ amount: string;
30343
+ /**
30344
+ * Always USD.
30345
+ */
30346
+ currency: 'USD';
30347
+ };
30348
+ };
30282
30349
  /**
30283
30350
  * Optional context the agent receives at the start of each session, as text blocks, limited to 8192 UTF-8 bytes in total.
30284
30351
  */
@@ -36159,6 +36226,19 @@ export type ForkSessionResponses = {
36159
36226
  */
36160
36227
  web_search_requests?: number;
36161
36228
  };
36229
+ /**
36230
+ * Praxis extension: priced runtime of this session (the time it was running), billed separately from list_cost and not counted against the budget. amount is in US dollars as a decimal string with exactly 6 decimals, e.g. "0.000280". Each thread's runtime is reported on that thread. /agent/v1 only.
36231
+ */
36232
+ runtime_cost?: {
36233
+ /**
36234
+ * Runtime cost in US dollars, decimal string with exactly 6 decimals.
36235
+ */
36236
+ amount: string;
36237
+ /**
36238
+ * Always USD.
36239
+ */
36240
+ currency: 'USD';
36241
+ };
36162
36242
  };
36163
36243
  /**
36164
36244
  * Vault IDs attached to the session at creation. Empty when no vaults were
@@ -406,7 +406,7 @@ export declare const operations: readonly [{
406
406
  readonly resource: "agent.agents.customers.auth.grantCodes";
407
407
  readonly method: "create";
408
408
  readonly summary: "Create customer grant code";
409
- readonly description: "Sign your logged-in customer in to a service agent from your backend with a one-time grant code that Agent Kit exchanges for a customer access token.\n\nCall this from your backend with your API key after your own login succeeds, then pass the returned code to Agent Kit in the browser; never call it from the browser. Customer authorization follows Shopify Storefront customer access tokens (Multipass-style sign-in, a short-lived token, renewal and logout), so that experience applies. customer_id is your own identifier for the customer: use an opaque id such as your database user id, not an email address or phone number. The value auth is reserved, and ids starting with anon_ are reserved for anonymous customers. The code works once and expires after expires_in seconds (default 900). The sign-in it starts lasts max_session_seconds (default 7 days); version, budget_cents, system_message, agent_override and metadata apply to every token of the sign-in. Unlike Shopify, origin binds the whole sign-in to one page origin, and anonymous_access_token merges the conversations of the anonymous visitor who chatted before signing in into this customer. Example body: {\"customer_id\":\"cus_8f2a91\",\"origin\":\"https://shop.example.com\"}.";
409
+ readonly description: "Sign your logged-in customer in to a service agent from your backend with a one-time grant code that Agent Kit exchanges for a customer access token.\n\nCall this from your backend with your API key after your own login succeeds, then pass the returned code to Agent Kit in the browser; never call it from the browser. Customer authorization follows Shopify Storefront customer access tokens (Multipass-style sign-in, a short-lived token, renewal and logout), so that experience applies. customer_id is your own identifier for the customer: use an opaque id such as your database user id, not an email address or phone number. The value auth is reserved, and ids starting with anon_ are reserved for anonymous customers. The code works once and expires after expires_in seconds (default 900). The sign-in it starts lasts max_session_seconds (default 7 days); version, budget (US dollars, at most 2 decimals), system_message, agent_override and metadata apply to every token of the sign-in. Unlike Shopify, origin binds the whole sign-in to one page origin, and anonymous_access_token merges the conversations of the anonymous visitor who chatted before signing in into this customer. Example body: {\"customer_id\":\"cus_8f2a91\",\"origin\":\"https://shop.example.com\"}.";
410
410
  readonly http: "POST";
411
411
  readonly path: "/agent/v1/agents/{agent_id}/customers/auth/grant_codes";
412
412
  readonly streaming: "no";
@@ -430,10 +430,10 @@ export declare const operations: readonly [{
430
430
  readonly required: false;
431
431
  readonly description: "Existing agent version that every token of this sign-in pins. Defaults to the agent's active_version when the code is issued.";
432
432
  }, {
433
- readonly name: "budget_cents";
434
- readonly type: "integer";
433
+ readonly name: "budget";
434
+ readonly type: "object";
435
435
  readonly required: false;
436
- readonly description: "Budget in cents for each session the customer starts. Defaults to the embed policy session budget and cannot exceed its maximum.";
436
+ readonly description: "Budget for each session the customer starts, in the same shape as a session budget. Defaults to the embed policy session budget and cannot exceed its maximum.";
437
437
  }, {
438
438
  readonly name: "system_message";
439
439
  readonly type: "array";
@@ -1692,7 +1692,7 @@ export declare const operations: readonly [{
1692
1692
  readonly name: "budget";
1693
1693
  readonly type: "object";
1694
1694
  readonly required: false;
1695
- readonly description: "Session spending limit, {type: \"limit\", max_list_cost: {amount, currency}}; null when unlimited. Creation defaults to a limit of 2000 US cents (USD 20.00) when omitted. amount is a positive integer string of US cents; removing the limit with null prevents setting it again for that session.";
1695
+ readonly description: "Session spending limit, {type: \"limit\", max_list_cost: {amount, currency}}; null when unlimited. amount is in US dollars: send an integer or up to 2 decimals (\"0.50\"), and responses carry exactly 2 decimals (\"20.00\"). Creation defaults to USD 20.00 when omitted. More decimals, zero or a number return 400. Removing the limit with null prevents setting it again for that session.";
1696
1696
  }, {
1697
1697
  readonly name: "initial_events";
1698
1698
  readonly type: "array";
@@ -504,7 +504,7 @@ export const operations = [
504
504
  "resource": "agent.agents.customers.auth.grantCodes",
505
505
  "method": "create",
506
506
  "summary": "Create customer grant code",
507
- "description": "Sign your logged-in customer in to a service agent from your backend with a one-time grant code that Agent Kit exchanges for a customer access token.\n\nCall this from your backend with your API key after your own login succeeds, then pass the returned code to Agent Kit in the browser; never call it from the browser. Customer authorization follows Shopify Storefront customer access tokens (Multipass-style sign-in, a short-lived token, renewal and logout), so that experience applies. customer_id is your own identifier for the customer: use an opaque id such as your database user id, not an email address or phone number. The value auth is reserved, and ids starting with anon_ are reserved for anonymous customers. The code works once and expires after expires_in seconds (default 900). The sign-in it starts lasts max_session_seconds (default 7 days); version, budget_cents, system_message, agent_override and metadata apply to every token of the sign-in. Unlike Shopify, origin binds the whole sign-in to one page origin, and anonymous_access_token merges the conversations of the anonymous visitor who chatted before signing in into this customer. Example body: {\"customer_id\":\"cus_8f2a91\",\"origin\":\"https://shop.example.com\"}.",
507
+ "description": "Sign your logged-in customer in to a service agent from your backend with a one-time grant code that Agent Kit exchanges for a customer access token.\n\nCall this from your backend with your API key after your own login succeeds, then pass the returned code to Agent Kit in the browser; never call it from the browser. Customer authorization follows Shopify Storefront customer access tokens (Multipass-style sign-in, a short-lived token, renewal and logout), so that experience applies. customer_id is your own identifier for the customer: use an opaque id such as your database user id, not an email address or phone number. The value auth is reserved, and ids starting with anon_ are reserved for anonymous customers. The code works once and expires after expires_in seconds (default 900). The sign-in it starts lasts max_session_seconds (default 7 days); version, budget (US dollars, at most 2 decimals), system_message, agent_override and metadata apply to every token of the sign-in. Unlike Shopify, origin binds the whole sign-in to one page origin, and anonymous_access_token merges the conversations of the anonymous visitor who chatted before signing in into this customer. Example body: {\"customer_id\":\"cus_8f2a91\",\"origin\":\"https://shop.example.com\"}.",
508
508
  "http": "POST",
509
509
  "path": "/agent/v1/agents/{agent_id}/customers/auth/grant_codes",
510
510
  "streaming": "no",
@@ -533,10 +533,10 @@ export const operations = [
533
533
  "description": "Existing agent version that every token of this sign-in pins. Defaults to the agent's active_version when the code is issued."
534
534
  },
535
535
  {
536
- "name": "budget_cents",
537
- "type": "integer",
536
+ "name": "budget",
537
+ "type": "object",
538
538
  "required": false,
539
- "description": "Budget in cents for each session the customer starts. Defaults to the embed policy session budget and cannot exceed its maximum."
539
+ "description": "Budget for each session the customer starts, in the same shape as a session budget. Defaults to the embed policy session budget and cannot exceed its maximum."
540
540
  },
541
541
  {
542
542
  "name": "system_message",
@@ -2076,7 +2076,7 @@ export const operations = [
2076
2076
  "name": "budget",
2077
2077
  "type": "object",
2078
2078
  "required": false,
2079
- "description": "Session spending limit, {type: \"limit\", max_list_cost: {amount, currency}}; null when unlimited. Creation defaults to a limit of 2000 US cents (USD 20.00) when omitted. amount is a positive integer string of US cents; removing the limit with null prevents setting it again for that session."
2079
+ "description": "Session spending limit, {type: \"limit\", max_list_cost: {amount, currency}}; null when unlimited. amount is in US dollars: send an integer or up to 2 decimals (\"0.50\"), and responses carry exactly 2 decimals (\"20.00\"). Creation defaults to USD 20.00 when omitted. More decimals, zero or a number return 400. Removing the limit with null prevents setting it again for that session."
2080
2080
  },
2081
2081
  {
2082
2082
  "name": "initial_events",
@@ -360,7 +360,10 @@ export declare function createAgent(transport: Transport): {
360
360
  first_seen_at: string | null;
361
361
  last_active_at: string | null;
362
362
  session_count: number;
363
- cost_micro_usd: number;
363
+ cost: {
364
+ amount: string;
365
+ currency: "USD";
366
+ };
364
367
  blocked: boolean;
365
368
  }>;
366
369
  };
@@ -374,7 +377,10 @@ export declare function createAgent(transport: Transport): {
374
377
  first_seen_at: string | null;
375
378
  last_active_at: string | null;
376
379
  session_count: number;
377
- cost_micro_usd: number;
380
+ cost: {
381
+ amount: string;
382
+ currency: "USD";
383
+ };
378
384
  blocked: boolean;
379
385
  }>;
380
386
  next_page: string | null;
@@ -384,7 +390,10 @@ export declare function createAgent(transport: Transport): {
384
390
  first_seen_at: string | null;
385
391
  last_active_at: string | null;
386
392
  session_count: number;
387
- cost_micro_usd: number;
393
+ cost: {
394
+ amount: string;
395
+ currency: "USD";
396
+ };
388
397
  blocked: boolean;
389
398
  recent_sessions: Array<{
390
399
  id: string;
@@ -420,7 +429,10 @@ export declare function createAgent(transport: Transport): {
420
429
  first_seen_at: string | null;
421
430
  last_active_at: string | null;
422
431
  session_count: number;
423
- cost_micro_usd: number;
432
+ cost: {
433
+ amount: string;
434
+ currency: "USD";
435
+ };
424
436
  blocked: boolean;
425
437
  }>;
426
438
  };
@@ -3213,6 +3225,10 @@ export declare function createAgent(transport: Transport): {
3213
3225
  web_fetch_requests?: number;
3214
3226
  web_search_requests?: number;
3215
3227
  };
3228
+ runtime_cost?: {
3229
+ amount: string;
3230
+ currency: "USD";
3231
+ };
3216
3232
  };
3217
3233
  vault_ids: Array<string>;
3218
3234
  deployment_id?: null | string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deepraxis/sdk",
3
- "version": "0.1.1-dev.b176367",
3
+ "version": "0.1.1-dev.d25d171",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "exports": {