@getstackrun/sdk 4.0.0 → 4.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (240) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +326 -10
  3. package/dist/agent-auth.d.ts.map +1 -1
  4. package/dist/agent-auth.js +3 -4
  5. package/dist/agent-auth.js.map +1 -1
  6. package/dist/browser-bootstrap.js +1 -1
  7. package/dist/browser-bootstrap.js.map +1 -1
  8. package/dist/client.d.ts +86 -1
  9. package/dist/client.d.ts.map +1 -1
  10. package/dist/client.js +235 -40
  11. package/dist/client.js.map +1 -1
  12. package/dist/control-socket-server.d.ts +134 -0
  13. package/dist/control-socket-server.d.ts.map +1 -0
  14. package/dist/control-socket-server.js +108 -0
  15. package/dist/control-socket-server.js.map +1 -0
  16. package/dist/credentials-file.d.ts +7 -0
  17. package/dist/credentials-file.d.ts.map +1 -1
  18. package/dist/credentials-file.js +57 -2
  19. package/dist/credentials-file.js.map +1 -1
  20. package/dist/errors.d.ts +316 -0
  21. package/dist/errors.d.ts.map +1 -1
  22. package/dist/errors.js +572 -0
  23. package/dist/errors.js.map +1 -1
  24. package/dist/index.d.ts +126 -24
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +150 -22
  27. package/dist/index.js.map +1 -1
  28. package/dist/network-install-key.d.ts +56 -0
  29. package/dist/network-install-key.d.ts.map +1 -0
  30. package/dist/network-install-key.js +92 -0
  31. package/dist/network-install-key.js.map +1 -0
  32. package/dist/network-install.d.ts +134 -0
  33. package/dist/network-install.d.ts.map +1 -0
  34. package/dist/network-install.js +70 -0
  35. package/dist/network-install.js.map +1 -0
  36. package/dist/service-mcp.d.ts +49 -0
  37. package/dist/service-mcp.d.ts.map +1 -0
  38. package/dist/service-mcp.js +122 -0
  39. package/dist/service-mcp.js.map +1 -0
  40. package/dist/services/accounts.d.ts +1548 -0
  41. package/dist/services/accounts.d.ts.map +1 -0
  42. package/dist/services/accounts.js +724 -0
  43. package/dist/services/accounts.js.map +1 -0
  44. package/dist/services/agent-identity.d.ts +58 -0
  45. package/dist/services/agent-identity.d.ts.map +1 -0
  46. package/dist/services/agent-identity.js +50 -0
  47. package/dist/services/agent-identity.js.map +1 -0
  48. package/dist/services/agents.d.ts +78 -3
  49. package/dist/services/agents.d.ts.map +1 -1
  50. package/dist/services/agents.js +29 -2
  51. package/dist/services/agents.js.map +1 -1
  52. package/dist/services/audit.d.ts +5 -0
  53. package/dist/services/audit.d.ts.map +1 -1
  54. package/dist/services/audit.js +5 -0
  55. package/dist/services/audit.js.map +1 -1
  56. package/dist/services/billing.d.ts +67 -0
  57. package/dist/services/billing.d.ts.map +1 -0
  58. package/dist/services/billing.js +42 -0
  59. package/dist/services/billing.js.map +1 -0
  60. package/dist/services/brain.d.ts +122 -0
  61. package/dist/services/brain.d.ts.map +1 -0
  62. package/dist/services/brain.js +40 -0
  63. package/dist/services/brain.js.map +1 -0
  64. package/dist/services/calendar.d.ts +256 -0
  65. package/dist/services/calendar.d.ts.map +1 -0
  66. package/dist/services/calendar.js +75 -0
  67. package/dist/services/calendar.js.map +1 -0
  68. package/dist/services/catalogue.d.ts +185 -0
  69. package/dist/services/catalogue.d.ts.map +1 -0
  70. package/dist/services/catalogue.js +31 -0
  71. package/dist/services/catalogue.js.map +1 -0
  72. package/dist/services/chat-channels.d.ts +82 -0
  73. package/dist/services/chat-channels.d.ts.map +1 -0
  74. package/dist/services/chat-channels.js +42 -0
  75. package/dist/services/chat-channels.js.map +1 -0
  76. package/dist/services/control-policies.d.ts +409 -0
  77. package/dist/services/control-policies.d.ts.map +1 -0
  78. package/dist/services/control-policies.js +101 -0
  79. package/dist/services/control-policies.js.map +1 -0
  80. package/dist/services/control-socket.d.ts +201 -0
  81. package/dist/services/control-socket.d.ts.map +1 -0
  82. package/dist/services/control-socket.js +165 -0
  83. package/dist/services/control-socket.js.map +1 -0
  84. package/dist/services/credentials.d.ts +2 -1
  85. package/dist/services/credentials.d.ts.map +1 -1
  86. package/dist/services/credentials.js +3 -2
  87. package/dist/services/credentials.js.map +1 -1
  88. package/dist/services/detector-config.d.ts +13 -12
  89. package/dist/services/detector-config.d.ts.map +1 -1
  90. package/dist/services/detector-config.js +13 -12
  91. package/dist/services/detector-config.js.map +1 -1
  92. package/dist/services/drive.d.ts +257 -0
  93. package/dist/services/drive.d.ts.map +1 -0
  94. package/dist/services/drive.js +167 -0
  95. package/dist/services/drive.js.map +1 -0
  96. package/dist/services/dropoffs.d.ts +5 -1
  97. package/dist/services/dropoffs.d.ts.map +1 -1
  98. package/dist/services/dropoffs.js +3 -1
  99. package/dist/services/dropoffs.js.map +1 -1
  100. package/dist/services/evidence-packs.d.ts +4 -2
  101. package/dist/services/evidence-packs.d.ts.map +1 -1
  102. package/dist/services/evidence-packs.js +4 -2
  103. package/dist/services/evidence-packs.js.map +1 -1
  104. package/dist/services/flagged-content.d.ts +30 -0
  105. package/dist/services/flagged-content.d.ts.map +1 -0
  106. package/dist/services/flagged-content.js +24 -0
  107. package/dist/services/flagged-content.js.map +1 -0
  108. package/dist/services/governance.d.ts +69 -0
  109. package/dist/services/governance.d.ts.map +1 -0
  110. package/dist/services/governance.js +39 -0
  111. package/dist/services/governance.js.map +1 -0
  112. package/dist/services/identity.d.ts +44 -4
  113. package/dist/services/identity.d.ts.map +1 -1
  114. package/dist/services/identity.js +54 -6
  115. package/dist/services/identity.js.map +1 -1
  116. package/dist/services/inbound-webhooks.d.ts +12 -1
  117. package/dist/services/inbound-webhooks.d.ts.map +1 -1
  118. package/dist/services/inbound-webhooks.js +7 -0
  119. package/dist/services/inbound-webhooks.js.map +1 -1
  120. package/dist/services/intents.d.ts +8 -2
  121. package/dist/services/intents.d.ts.map +1 -1
  122. package/dist/services/intents.js +7 -3
  123. package/dist/services/intents.js.map +1 -1
  124. package/dist/services/llm.d.ts +73 -1
  125. package/dist/services/llm.d.ts.map +1 -1
  126. package/dist/services/llm.js +62 -0
  127. package/dist/services/llm.js.map +1 -1
  128. package/dist/services/making.d.ts +263 -0
  129. package/dist/services/making.d.ts.map +1 -0
  130. package/dist/services/making.js +114 -0
  131. package/dist/services/making.js.map +1 -0
  132. package/dist/services/meetings.d.ts +183 -0
  133. package/dist/services/meetings.d.ts.map +1 -0
  134. package/dist/services/meetings.js +148 -0
  135. package/dist/services/meetings.js.map +1 -0
  136. package/dist/services/memory.d.ts +288 -0
  137. package/dist/services/memory.d.ts.map +1 -0
  138. package/dist/services/memory.js +116 -0
  139. package/dist/services/memory.js.map +1 -0
  140. package/dist/services/message-access.d.ts +50 -0
  141. package/dist/services/message-access.d.ts.map +1 -0
  142. package/dist/services/message-access.js +36 -0
  143. package/dist/services/message-access.js.map +1 -0
  144. package/dist/services/missions.d.ts +93 -7
  145. package/dist/services/missions.d.ts.map +1 -1
  146. package/dist/services/missions.js +29 -1
  147. package/dist/services/missions.js.map +1 -1
  148. package/dist/services/network.d.ts +266 -0
  149. package/dist/services/network.d.ts.map +1 -0
  150. package/dist/services/network.js +209 -0
  151. package/dist/services/network.js.map +1 -0
  152. package/dist/services/partner-accounts.d.ts +215 -0
  153. package/dist/services/partner-accounts.d.ts.map +1 -0
  154. package/dist/services/partner-accounts.js +133 -0
  155. package/dist/services/partner-accounts.js.map +1 -0
  156. package/dist/services/passports.d.ts +3 -2
  157. package/dist/services/passports.d.ts.map +1 -1
  158. package/dist/services/passports.js +3 -2
  159. package/dist/services/passports.js.map +1 -1
  160. package/dist/services/payments.d.ts +126 -0
  161. package/dist/services/payments.d.ts.map +1 -0
  162. package/dist/services/payments.js +66 -0
  163. package/dist/services/payments.js.map +1 -0
  164. package/dist/services/pii-config.d.ts +7 -17
  165. package/dist/services/pii-config.d.ts.map +1 -1
  166. package/dist/services/pii-config.js +9 -19
  167. package/dist/services/pii-config.js.map +1 -1
  168. package/dist/services/post.d.ts +240 -0
  169. package/dist/services/post.d.ts.map +1 -0
  170. package/dist/services/post.js +99 -0
  171. package/dist/services/post.js.map +1 -0
  172. package/dist/services/proxy.d.ts +20 -2
  173. package/dist/services/proxy.d.ts.map +1 -1
  174. package/dist/services/proxy.js +31 -1
  175. package/dist/services/proxy.js.map +1 -1
  176. package/dist/services/rentahuman.d.ts +92 -0
  177. package/dist/services/rentahuman.d.ts.map +1 -0
  178. package/dist/services/rentahuman.js +53 -0
  179. package/dist/services/rentahuman.js.map +1 -0
  180. package/dist/services/scan.d.ts +1 -1
  181. package/dist/services/scan.d.ts.map +1 -1
  182. package/dist/services/scan.js +1 -1
  183. package/dist/services/scan.js.map +1 -1
  184. package/dist/services/services.d.ts +28 -2
  185. package/dist/services/services.d.ts.map +1 -1
  186. package/dist/services/services.js +49 -1
  187. package/dist/services/services.js.map +1 -1
  188. package/dist/services/team.d.ts +13 -1
  189. package/dist/services/team.d.ts.map +1 -1
  190. package/dist/services/team.js +12 -0
  191. package/dist/services/team.js.map +1 -1
  192. package/dist/services/trust.d.ts +39 -0
  193. package/dist/services/trust.d.ts.map +1 -0
  194. package/dist/services/trust.js +35 -0
  195. package/dist/services/trust.js.map +1 -0
  196. package/dist/services/usage.d.ts +1 -1
  197. package/dist/services/usage.js +1 -1
  198. package/dist/services/wake.d.ts +257 -0
  199. package/dist/services/wake.d.ts.map +1 -0
  200. package/dist/services/wake.js +80 -0
  201. package/dist/services/wake.js.map +1 -0
  202. package/dist/services/website.d.ts +188 -0
  203. package/dist/services/website.d.ts.map +1 -0
  204. package/dist/services/website.js +135 -0
  205. package/dist/services/website.js.map +1 -0
  206. package/dist/types.d.ts +259 -25
  207. package/dist/types.d.ts.map +1 -1
  208. package/dist/verify-agent-identity.d.ts +73 -0
  209. package/dist/verify-agent-identity.d.ts.map +1 -0
  210. package/dist/verify-agent-identity.js +106 -0
  211. package/dist/verify-agent-identity.js.map +1 -0
  212. package/dist/verify-network.d.ts +159 -0
  213. package/dist/verify-network.d.ts.map +1 -0
  214. package/dist/verify-network.js +153 -0
  215. package/dist/verify-network.js.map +1 -0
  216. package/dist/wake-webhook.d.ts +57 -0
  217. package/dist/wake-webhook.d.ts.map +1 -0
  218. package/dist/wake-webhook.js +60 -0
  219. package/dist/wake-webhook.js.map +1 -0
  220. package/dist/wallet-key.d.ts +30 -0
  221. package/dist/wallet-key.d.ts.map +1 -0
  222. package/dist/wallet-key.js +108 -0
  223. package/dist/wallet-key.js.map +1 -0
  224. package/dist/webhook.d.ts +63 -0
  225. package/dist/webhook.d.ts.map +1 -0
  226. package/dist/webhook.js +136 -0
  227. package/dist/webhook.js.map +1 -0
  228. package/dist/x402-pay.d.ts +139 -0
  229. package/dist/x402-pay.d.ts.map +1 -0
  230. package/dist/x402-pay.js +235 -0
  231. package/dist/x402-pay.js.map +1 -0
  232. package/package.json +2 -1
  233. package/dist/services/partner-connect.d.ts +0 -64
  234. package/dist/services/partner-connect.d.ts.map +0 -1
  235. package/dist/services/partner-connect.js +0 -42
  236. package/dist/services/partner-connect.js.map +0 -1
  237. package/dist/services/partner-tenants.d.ts +0 -126
  238. package/dist/services/partner-tenants.d.ts.map +0 -1
  239. package/dist/services/partner-tenants.js +0 -79
  240. package/dist/services/partner-tenants.js.map +0 -1
@@ -0,0 +1,92 @@
1
+ import type { HttpClient } from '../client.js';
2
+ import { type AgentWalletKey } from '../wallet-key.js';
3
+ import type { AccountAgentCallOptions } from './accounts.js';
4
+ /** The payment the agent signs, and what to sign it with. */
5
+ interface PaymentToSign {
6
+ /** What RentAHuman asks, in US cents (USDC on Base). Look at it before signing. */
7
+ amount_cents: number;
8
+ /** The address RentAHuman is paid at. */
9
+ pay_to: string;
10
+ /** The EIP-712 TransferWithAuthorization, as the wallet takes it. */
11
+ typed_data: Record<string, unknown>;
12
+ /** The account's wallet at Privy: with `typed_data` it makes the string the agent signs. */
13
+ wallet: {
14
+ privy_app_id: string;
15
+ wallet_id: string;
16
+ };
17
+ /** Sign before this time. */
18
+ expires_at: string;
19
+ }
20
+ export interface RentAHumanJoinInput {
21
+ /** The country the agent works in: an ISO code ("US") or a name. */
22
+ country: string;
23
+ city?: string;
24
+ /** The display name of the new account at RentAHuman (at least 2 characters; RentAHuman refuses one it will not take). */
25
+ agent_name?: string;
26
+ /** The customer accepting RentAHuman's terms of service and privacy policy through its agent. */
27
+ accept_terms: true;
28
+ }
29
+ export interface RentAHumanJoinStart extends PaymentToSign {
30
+ join_id: string;
31
+ }
32
+ export interface RentAHumanFundStart extends PaymentToSign {
33
+ fund_id: string;
34
+ }
35
+ export type RentAHumanFlowStatus = 'awaiting_signature' | 'paying' | 'completed' | 'unconfirmed' | 'failed' | 'expired';
36
+ export interface RentAHumanJoinResult {
37
+ join_id: string;
38
+ status: RentAHumanFlowStatus;
39
+ /** The customer's `rentahuman` connection, now holding the new account's key (never returned). */
40
+ connection_id: string;
41
+ agent_id: string;
42
+ /** Whether the account's events wake the agent. False: call `completeJoin` again with the same `join_id` to register them. */
43
+ wake_registered: boolean;
44
+ }
45
+ export interface RentAHumanFundResult {
46
+ fund_id: string;
47
+ status: RentAHumanFlowStatus;
48
+ amount_cents: number;
49
+ }
50
+ export interface RentAHumanConnection {
51
+ connection_id: string;
52
+ origin: 'owner_key' | 'joined';
53
+ wake_registered: boolean;
54
+ created_at: string;
55
+ }
56
+ /** What the agent signs for a payment `join` or `fund` returned: Privy's authorization payload for the wallet's signing request. */
57
+ export declare function signRentAHumanPayment(key: AgentWalletKey, start: PaymentToSign): string;
58
+ export declare class RentAHumanService {
59
+ private readonly client;
60
+ constructor(client: HttpClient);
61
+ /**
62
+ * Step one of opening a RentAHuman account for the customer, paid from the agent's wallet: asks RentAHuman what it costs and returns
63
+ * the payment to sign. Takes nothing. One metered action. `accept_terms: true` is the customer accepting RentAHuman's terms.
64
+ */
65
+ join(accountId: string, input: RentAHumanJoinInput, options?: AccountAgentCallOptions): Promise<RentAHumanJoinStart>;
66
+ /**
67
+ * Step two: `signed` is the agent's signature (`signRentAHumanPayment`). Only the account's own agent, under its Passport. The
68
+ * payment goes through the wallet's per-payment and daily caps, the account's budget and the customer's decider; RentAHuman's key goes
69
+ * into the vault. Called again with the same `join_id` it answers the same and, when the account's events were not registered, tries again.
70
+ */
71
+ completeJoin(accountId: string, input: {
72
+ join_id: string;
73
+ signed: string;
74
+ }, options: AccountAgentCallOptions): Promise<RentAHumanJoinResult>;
75
+ /** Both steps: ask, sign with the agent's wallet key, and send the signature. */
76
+ joinWithKey(accountId: string, key: AgentWalletKey, input: RentAHumanJoinInput, options: AccountAgentCallOptions): Promise<RentAHumanJoinResult>;
77
+ /** Step one of topping up the customer's RentAHuman wallet with USDC from the agent's wallet (`amount_cents` from 100 to 1,000,000). */
78
+ fund(accountId: string, amountCents: number, options?: AccountAgentCallOptions): Promise<RentAHumanFundStart>;
79
+ /** Step two of a top-up: the agent's signature of the payment `fund` returned. */
80
+ completeFund(accountId: string, input: {
81
+ fund_id: string;
82
+ signed: string;
83
+ }, options: AccountAgentCallOptions): Promise<RentAHumanFundResult>;
84
+ /** Both steps of a top-up. */
85
+ fundWithKey(accountId: string, key: AgentWalletKey, amountCents: number, options: AccountAgentCallOptions): Promise<RentAHumanFundResult>;
86
+ /** The customer's RentAHuman connection, or null when there is none. It shows no key. */
87
+ get(accountId: string, options?: AccountAgentCallOptions): Promise<{
88
+ connection: RentAHumanConnection | null;
89
+ }>;
90
+ }
91
+ export {};
92
+ //# sourceMappingURL=rentahuman.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rentahuman.d.ts","sourceRoot":"","sources":["../../src/services/rentahuman.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAqC,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC1F,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAgB7D,6DAA6D;AAC7D,UAAU,aAAa;IACrB,mFAAmF;IACnF,YAAY,EAAE,MAAM,CAAC;IACrB,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,qEAAqE;IACrE,UAAU,EAAE,MAAM,CAAC,M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E,oBAAoB,GAAG,IAAI,CAAA;KAAE,CAAC;CAGtH"}
@@ -0,0 +1,53 @@
1
+ import { walletPaymentAuthorizationPayload } from '../wallet-key.js';
2
+ const seg = encodeURIComponent;
3
+ function passport(options) {
4
+ return options?.passportToken ? { headers: { 'X-Passport-Token': options.passportToken } } : undefined;
5
+ }
6
+ /** What the agent signs for a payment `join` or `fund` returned: Privy's authorization payload for the wallet's signing request. */
7
+ export function signRentAHumanPayment(key, start) {
8
+ return key.sign(walletPaymentAuthorizationPayload({ appId: start.wallet.privy_app_id, walletId: start.wallet.wallet_id, typedData: start.typed_data }));
9
+ }
10
+ export class RentAHumanService {
11
+ client;
12
+ constructor(client) {
13
+ this.client = client;
14
+ }
15
+ /**
16
+ * Step one of opening a RentAHuman account for the customer, paid from the agent's wallet: asks RentAHuman what it costs and returns
17
+ * the payment to sign. Takes nothing. One metered action. `accept_terms: true` is the customer accepting RentAHuman's terms.
18
+ */
19
+ async join(accountId, input, options) {
20
+ return this.client.post(`/v1/accounts/${seg(accountId)}/rentahuman/join`, input, passport(options));
21
+ }
22
+ /**
23
+ * Step two: `signed` is the agent's signature (`signRentAHumanPayment`). Only the account's own agent, under its Passport. The
24
+ * payment goes through the wallet's per-payment and daily caps, the account's budget and the customer's decider; RentAHuman's key goes
25
+ * into the vault. Called again with the same `join_id` it answers the same and, when the account's events were not registered, tries again.
26
+ */
27
+ async completeJoin(accountId, input, options) {
28
+ return this.client.post(`/v1/accounts/${seg(accountId)}/rentahuman/join/complete`, input, passport(options));
29
+ }
30
+ /** Both steps: ask, sign with the agent's wallet key, and send the signature. */
31
+ async joinWithKey(accountId, key, input, options) {
32
+ const start = await this.join(accountId, input, options);
33
+ return this.completeJoin(accountId, { join_id: start.join_id, signed: signRentAHumanPayment(key, start) }, options);
34
+ }
35
+ /** Step one of topping up the customer's RentAHuman wallet with USDC from the agent's wallet (`amount_cents` from 100 to 1,000,000). */
36
+ async fund(accountId, amountCents, options) {
37
+ return this.client.post(`/v1/accounts/${seg(accountId)}/rentahuman/fund`, { amount_cents: amountCents }, passport(options));
38
+ }
39
+ /** Step two of a top-up: the agent's signature of the payment `fund` returned. */
40
+ async completeFund(accountId, input, options) {
41
+ return this.client.post(`/v1/accounts/${seg(accountId)}/rentahuman/fund/complete`, input, passport(options));
42
+ }
43
+ /** Both steps of a top-up. */
44
+ async fundWithKey(accountId, key, amountCents, options) {
45
+ const start = await this.fund(accountId, amountCents, options);
46
+ return this.completeFund(accountId, { fund_id: start.fund_id, signed: signRentAHumanPayment(key, start) }, options);
47
+ }
48
+ /** The customer's RentAHuman connection, or null when there is none. It shows no key. */
49
+ async get(accountId, options) {
50
+ return this.client.get(`/v1/accounts/${seg(accountId)}/rentahuman`, undefined, passport(options));
51
+ }
52
+ }
53
+ //# sourceMappingURL=rentahuman.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rentahuman.js","sourceRoot":"","sources":["../../src/services/rentahuman.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iCAAiC,EAAuB,MAAM,kBAAkB,CAAC;AA0E1F,MAAM,GAAG,GAAG,kBAAkB,CAAC;AAE/B,SAAS,QAAQ,CAAC,OAAiC;IACjD,OAAO,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,kBAAkB,EAAE,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AACzG,CAAC;AAED,oIAAoI;AACpI,MAAM,UAAU,qBAAqB,CAAC,GAAmB,EAAE,KAAoB;IAC7E,OAAO,GAAG,CAAC,IAAI,CACb,iCAAiC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,YAAY,EAAE,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC,UAAU,EAAE,CAAC,CACvI,CAAC;AACJ,CAAC;AAED,MAAM,OAAO,iBAAiB;IACC;IAA7B,YAA6B,MAAkB;QAAlB,WAA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C,MAAM,CAAC,IAAI,CAAuB,gBAAgB,GAAG,CAAC,SAAS,CAAC,2BAA2B,EAAE,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;IACrI,CAAC;IAED,8BAA8B;IAC9B,KAAK,CAAC,WAAW,CAAC,SAAiB,EAAE,GAAmB,EAAE,WAAmB,EAAE,OAAgC;QAC7G,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;QAC/D,OAAO,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,qBAAqB,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IACtH,CAAC;IAED,yFAAyF;IACzF,KAAK,CAAC,GAAG,CAAC,SAAiB,EAAE,OAAiC;QAC5D,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAA8C,gBAAgB,GAAG,CAAC,SAAS,CAAC,aAAa,EAAE,SAAS,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;IACjJ,CAAC;CACF"}
@@ -29,7 +29,7 @@ export declare class ScanService {
29
29
  scan(input: ScanRequest, options?: {
30
30
  passportToken?: string;
31
31
  }): Promise<ScanResponse>;
32
- /** Current month's scan usage against the operator's tier allowance. */
32
+ /** Current month's scan usage against the account's allowance; `plan` names the plan it is on. */
33
33
  usage(): Promise<ScanUsage>;
34
34
  }
35
35
  //# sourceMappingURL=scan.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"scan.d.ts","sourceRoot":"","sources":["../../src/services/scan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,WAAW;IACV,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEtC,2DAA2D;IACrD,IAAI,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE;QAAE,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,YAAY,CAAC;IAQ3F,wEAAwE;IAClE,KAAK,IAAI,OAAO,CAAC,SAAS,CAAC;CAGlC"}
1
+ {"version":3,"file":"scan.d.ts","sourceRoot":"","sources":["../../src/services/scan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,WAAW;IACV,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEtC,2DAA2D;IACrD,IAAI,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE;QAAE,aAAa,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,YAAY,CAAC;IAQ3F,kGAAkG;IAC5F,KAAK,IAAI,OAAO,CAAC,SAAS,CAAC;CAGlC"}
@@ -33,7 +33,7 @@ export class ScanService {
33
33
  }
34
34
  return this.client.post('/v1/scan', input, { headers });
35
35
  }
36
- /** Current month's scan usage against the operator's tier allowance. */
36
+ /** Current month's scan usage against the account's allowance; `plan` names the plan it is on. */
37
37
  async usage() {
38
38
  return this.client.get('/v1/scan/usage');
39
39
  }
@@ -1 +1 @@
1
- {"version":3,"file":"scan.js","sourceRoot":"","sources":["../../src/services/scan.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,OAAO,WAAW;IACF;IAApB,YAAoB,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAE1C,2DAA2D;IAC3D,KAAK,CAAC,IAAI,CAAC,KAAkB,EAAE,OAAoC;QACjE,MAAM,OAAO,GAA2B,EAAE,CAAC;QAC3C,IAAI,OAAO,EAAE,aAAa,EAAE,CAAC;YAC3B,OAAO,CAAC,kBAAkB,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC;QACtD,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAe,UAAU,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IACxE,CAAC;IAED,wEAAwE;IACxE,KAAK,CAAC,KAAK;QACT,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAY,gBAAgB,CAAC,CAAC;IACtD,CAAC;CACF"}
1
+ {"version":3,"file":"scan.js","sourceRoot":"","sources":["../../src/services/scan.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,OAAO,WAAW;IACF;IAApB,YAAoB,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAE1C,2DAA2D;IAC3D,KAAK,CAAC,IAAI,CAAC,KAAkB,EAAE,OAAoC;QACjE,MAAM,OAAO,GAA2B,EAAE,CAAC;QAC3C,IAAI,OAAO,EAAE,aAAa,EAAE,CAAC;YAC3B,OAAO,CAAC,kBAAkB,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC;QACtD,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAe,UAAU,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IACxE,CAAC;IAED,kGAAkG;IAClG,KAAK,CAAC,KAAK;QACT,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAY,gBAAgB,CAAC,CAAC;IACtD,CAAC;CACF"}
@@ -1,5 +1,6 @@
1
1
  import type { HttpClient } from '../client.js';
2
- import type { Service, ServiceConnection, ConnectServiceInput, ConnectCustomServiceInput, GrantAgentAccessInput } from '../types.js';
2
+ import type { Service, ServiceConnection, ConnectServiceInput, ConnectCustomServiceInput, GrantAgentAccessInput, ConnectLink, CreateConnectLinkInput, CreatedConnectLink } from '../types.js';
3
+ import type { GrantAgentAccessResult } from './control-policies.js';
3
4
  export declare class ServiceService {
4
5
  private client;
5
6
  constructor(client: HttpClient);
@@ -7,11 +8,36 @@ export declare class ServiceService {
7
8
  listConnected(): Promise<ServiceConnection[]>;
8
9
  /** The API reads the credential from `oauth_token`; `provider` is not sent. */
9
10
  connect(input: ConnectServiceInput): Promise<ServiceConnection>;
11
+ /** Rename a connection (owner or admin). Calls name it by the new name from then on; the id never changes. */
12
+ rename(connectionId: string, connectionName: string): Promise<ServiceConnection>;
13
+ /**
14
+ * Connect a service without the credential passing through this program or
15
+ * a chat: create a one-time link the person opens in their own browser,
16
+ * signed in to STACK. It is bound to this account and member, works once,
17
+ * expires after 10 minutes, and any number can be open at once. The returned `url` is the only copy; read the
18
+ * outcome with {@link ServiceService.getConnectLink}. Pass `custom` instead
19
+ * of `service_id` for the customer's own API that takes a key or token: its
20
+ * name and the hosts the key may be sent to, which the page shows and the
21
+ * owner may correct there. Pass `connect` for a key of one of the customer's own supplier accounts (a print-on-demand
22
+ * supplier, an agent's Telegram bot, the street address's mailbox.bot key): the owner or an admin enters it on the page,
23
+ * so it never passes through this program or a chat. An agent context is refused: an agent never adds credentials.
24
+ */
25
+ createConnectLink(input: CreateConnectLinkInput): Promise<CreatedConnectLink>;
26
+ /** The state of a connect link: pending, connected (with the connection id) or expired. Never the URL. */
27
+ getConnectLink(linkId: string): Promise<ConnectLink>;
28
+ /** The connect links still waiting for the person: pending and not yet expired, newest first, at most 50. Never a URL or a token. */
29
+ listConnectLinks(): Promise<ConnectLink[]>;
10
30
  connectCustom(input: ConnectCustomServiceInput): Promise<ServiceConnection>;
11
31
  disconnect(connectionId: string): Promise<{
12
32
  disconnected: boolean;
13
33
  }>;
14
- grantAgentAccess(input: GrantAgentAccessInput): Promise<unknown>;
34
+ /**
35
+ * Create or replace an agent's grant on a connection. With hosted controls on
36
+ * and a policy that lists connections, the answer carries `control_policy`:
37
+ * the connection is not callable until a revision of that policy lists it,
38
+ * a loosening a person approves in a browser (`controlPolicies.set`).
39
+ */
40
+ grantAgentAccess(input: GrantAgentAccessInput): Promise<GrantAgentAccessResult>;
15
41
  revokeAgentAccess(agentId: string): Promise<{
16
42
  success: boolean;
17
43
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../src/services/services.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EACV,OAAO,EACP,iBAAiB,EACjB,mBAAmB,EACnB,yBAAyB,EACzB,qBAAqB,EACtB,MAAM,aAAa,CAAC;AAErB,qBAAa,cAAc;IACb,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEhC,aAAa,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;IAInC,aAAa,IAAI,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAInD,+EAA+E;IACzE,OAAO,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAS/D,aAAa,CAAC,KAAK,EAAE,yBAAyB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAI3E,UAAU,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,YAAY,EAAE,OAAO,CAAA;KAAE,CAAC;IAIpE,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,OAAO,CAAC;IAIhE,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAIjE,MAAM,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAIzD,aAAa,IAAI,OAAO,CAAC;QAAE,SAAS,EAAE,OAAO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AC;IAI/E,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAIjE,MAAM,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAIzD,aAAa,IAAI,OAAO,CAAC;QAAE,SAAS,EAAE,OAAO,EAAE,CAAA;KAAE,CAAC;CAGzD"}
@@ -11,19 +11,67 @@ export class ServiceService {
11
11
  }
12
12
  /** The API reads the credential from `oauth_token`; `provider` is not sent. */
13
13
  async connect(input) {
14
- const { service_id, scopes, credential } = input;
14
+ const { service_id, scopes, credential, mcp_url, connection_name } = input;
15
15
  return this.client.post('/v1/services/connect', {
16
16
  service_id,
17
17
  scopes,
18
18
  oauth_token: credential,
19
+ ...(mcp_url !== undefined ? { mcp_url } : {}),
20
+ ...(connection_name !== undefined ? { connection_name } : {}),
19
21
  });
20
22
  }
23
+ /** Rename a connection (owner or admin). Calls name it by the new name from then on; the id never changes. */
24
+ async rename(connectionId, connectionName) {
25
+ return this.client.patch(`/v1/services/${encodeURIComponent(connectionId)}`, { connection_name: connectionName });
26
+ }
27
+ /**
28
+ * Connect a service without the credential passing through this program or
29
+ * a chat: create a one-time link the person opens in their own browser,
30
+ * signed in to STACK. It is bound to this account and member, works once,
31
+ * expires after 10 minutes, and any number can be open at once. The returned `url` is the only copy; read the
32
+ * outcome with {@link ServiceService.getConnectLink}. Pass `custom` instead
33
+ * of `service_id` for the customer's own API that takes a key or token: its
34
+ * name and the hosts the key may be sent to, which the page shows and the
35
+ * owner may correct there. Pass `connect` for a key of one of the customer's own supplier accounts (a print-on-demand
36
+ * supplier, an agent's Telegram bot, the street address's mailbox.bot key): the owner or an admin enters it on the page,
37
+ * so it never passes through this program or a chat. An agent context is refused: an agent never adds credentials.
38
+ */
39
+ async createConnectLink(input) {
40
+ // The API takes the name at the top level for a catalog link, inside `custom` for a custom one, and not at all for a key link.
41
+ if ('custom' in input) {
42
+ return this.client.post('/v1/services/connect-links', { custom: input.custom });
43
+ }
44
+ if ('connect' in input) {
45
+ return this.client.post('/v1/services/connect-links', { connect: input.connect });
46
+ }
47
+ const { service_id, scopes, connection_name } = input;
48
+ return this.client.post('/v1/services/connect-links', {
49
+ service_id,
50
+ ...(scopes ? { scopes } : {}),
51
+ ...(connection_name !== undefined ? { connection_name } : {}),
52
+ });
53
+ }
54
+ /** The state of a connect link: pending, connected (with the connection id) or expired. Never the URL. */
55
+ async getConnectLink(linkId) {
56
+ return this.client.get(`/v1/services/connect-links/${encodeURIComponent(linkId)}`);
57
+ }
58
+ /** The connect links still waiting for the person: pending and not yet expired, newest first, at most 50. Never a URL or a token. */
59
+ async listConnectLinks() {
60
+ const answer = await this.client.get('/v1/services/connect-links');
61
+ return answer.links;
62
+ }
21
63
  async connectCustom(input) {
22
64
  return this.client.post('/v1/services/custom', input);
23
65
  }
24
66
  async disconnect(connectionId) {
25
67
  return this.client.delete(`/v1/services/${connectionId}/disconnect`);
26
68
  }
69
+ /**
70
+ * Create or replace an agent's grant on a connection. With hosted controls on
71
+ * and a policy that lists connections, the answer carries `control_policy`:
72
+ * the connection is not callable until a revision of that policy lists it,
73
+ * a loosening a person approves in a browser (`controlPolicies.set`).
74
+ */
27
75
  async grantAgentAccess(input) {
28
76
  return this.client.post('/v1/services/grant', input);
29
77
  }
@@ -1 +1 @@
1
- {"version":3,"file":"services.js","sourceRoot":"","sources":["../../src/services/services.ts"],"names":[],"mappings":"AASA,MAAM,OAAO,cAAc;IACL;IAApB,YAAoB,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAE1C,KAAK,CAAC,aAAa;QACjB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAY,cAAc,CAAC,CAAC;IACpD,CAAC;IAED,KAAK,CAAC,aAAa;QACjB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAsB,wBAAwB,CAAC,CAAC;IACx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,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,uBAAuB,OAAO,SAAS,CAAC,CAAC;IACrE,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,YAAoB;QAC/B,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,YAAY,SAAS,CAAC,CAAC;IACjE,CAAC;IAED,KAAK,CAAC,aAAa;QACjB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;IACnD,CAAC;CACF"}
@@ -1,5 +1,5 @@
1
1
  import type { HttpClient } from '../client.js';
2
- import type { TeamMember, InviteMemberInput, UpdateMemberInput } from '../types.js';
2
+ import type { TeamMember, InviteMemberInput, UpdateMemberInput, ClearSsoBindingsInput, ClearSsoBindingsResult } from '../types.js';
3
3
  export declare class TeamService {
4
4
  private client;
5
5
  constructor(client: HttpClient);
@@ -9,5 +9,17 @@ export declare class TeamService {
9
9
  revoke(id: string): Promise<{
10
10
  success: boolean;
11
11
  }>;
12
+ /**
13
+ * Forget the single sign-on binding of one member (`{ member_id }`) or of every member bound to one issuer
14
+ * (`{ issuer }`, the `iss` of the provider that was replaced), so the next verified sign-in with the provider in
15
+ * use binds them again. A person bound to the old provider's subject is refused under the new one, so replacing
16
+ * the provider locks out everyone who had signed in until this is called. Owner or admin only; an agent is
17
+ * refused. It needs a person in a signed-in browser: without a dashboard session the call throws
18
+ * `GovernanceApprovalRequiredError` first, and once they approve at its link, send the same call again with its
19
+ * `governanceApprovalId`. The role, status and sessions of a member are untouched.
20
+ */
21
+ clearSsoBindings(input: ClearSsoBindingsInput, options?: {
22
+ governanceApprovalId?: string;
23
+ }): Promise<ClearSsoBindingsResult>;
12
24
  }
13
25
  //# sourceMappingURL=team.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"team.d.ts","sourceRoot":"","sources":["../../src/services/team.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,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BAAsB,CAAC;CAOnC"}
@@ -15,5 +15,17 @@ export class TeamService {
15
15
  async revoke(id) {
16
16
  return this.client.delete(`/v1/team/members/${id}`);
17
17
  }
18
+ /**
19
+ * Forget the single sign-on binding of one member (`{ member_id }`) or of every member bound to one issuer
20
+ * (`{ issuer }`, the `iss` of the provider that was replaced), so the next verified sign-in with the provider in
21
+ * use binds them again. A person bound to the old provider's subject is refused under the new one, so replacing
22
+ * the provider locks out everyone who had signed in until this is called. Owner or admin only; an agent is
23
+ * refused. It needs a person in a signed-in browser: without a dashboard session the call throws
24
+ * `GovernanceApprovalRequiredError` first, and once they approve at its link, send the same call again with its
25
+ * `governanceApprovalId`. The role, status and sessions of a member are untouched.
26
+ */
27
+ async clearSsoBindings(input, options) {
28
+ return this.client.post('/v1/team/sso-bindings/clear', input, options?.governanceApprovalId ? { headers: { 'X-Governance-Approval': options.governanceApprovalId } } : undefined);
29
+ }
18
30
  }
19
31
  //# sourceMappingURL=team.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"team.js","sourceRoot":"","sources":["../../src/services/team.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,WAAW;IACF;IAApB,YAAoB,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAE1C,KAAK,CAAC,MAAM,CAAC,KAAwB;QACnC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAa,kBAAkB,EAAE,KAAK,CAAC,CAAC;IACjE,CAAC;IAED,KAAK,CAAC,IAAI;QACR,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAe,kBAAkB,CAAC,CAAC;IAC3D,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAU,EAAE,KAAwB;QAC/C,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAa,oBAAoB,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;IACxE,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAU;QACrB,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAuB,oBAAoB,EAAE,EAAE,CAAC,CAAC;IAC5E,CAAC;CACF"}
1
+ {"version":3,"file":"team.js","sourceRoot":"","sources":["../../src/services/team.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,WAAW;IACF;IAApB,YAAoB,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAE1C,KAAK,CAAC,MAAM,CAAC,KAAwB;QACnC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAa,kBAAkB,EAAE,KAAK,CAAC,CAAC;IACjE,CAAC;IAED,KAAK,CAAC,IAAI;QACR,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAe,kBAAkB,CAAC,CAAC;IAC3D,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAU,EAAE,KAAwB;QAC/C,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAa,oBAAoB,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;IACxE,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAU;QACrB,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAuB,oBAAoB,EAAE,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,gBAAgB,CACpB,KAA4B,EAC5B,OAA2C;QAE3C,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CACrB,6BAA6B,EAC7B,KAAK,EACL,OAAO,EAAE,oBAAoB,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,uBAAuB,EAAE,OAAO,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CACnH,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,39 @@
1
+ import type { HttpClient } from '../client.js';
2
+ /** `ask_first`: what needs a person waits for one. `trust_agents`: nothing waits for a person. */
3
+ export type TrustValue = 'ask_first' | 'trust_agents';
4
+ /** What is set at one scope, and what is in force there. */
5
+ export interface TrustSetting {
6
+ /** The agent this is for, or null for the account. */
7
+ agent_id: string | null;
8
+ /** What is set at this scope: null when it has no value of its own (an agent following its account, an account on STACK's default). */
9
+ trust: TrustValue | null;
10
+ /** What is in force here: the agent's value, else the account's, else STACK's default (`trust_agents`). */
11
+ effective: TrustValue;
12
+ /** Which of those the effective value is. */
13
+ source: 'agent' | 'account' | 'default';
14
+ }
15
+ /**
16
+ * The trust switch: whether the account's agents ask first or are trusted to act. With `trust_agents` nothing waits for
17
+ * a person on card purchases, orders on the customer's own supplier account, and governance changes made with the
18
+ * owner's own API key; with `ask_first` they wait, as they always have. In both, a wallet balance or spend limit, a
19
+ * revoked or suspended agent, a control policy's review rule and the browser-only actions still apply. A new account
20
+ * starts on `trust_agents`. Owner or admin only; an agent is refused. It is not part of any control policy. A change that
21
+ * makes a scope trust where it asked first before needs a person's approval (`trust_widen`: 403
22
+ * `GOVERNANCE_APPROVAL_REQUIRED` with the approval link; retry with `governanceApprovalId` once it is approved); a
23
+ * change to `ask_first` applies at once. Every change is recorded in the audit log.
24
+ */
25
+ export declare class TrustService {
26
+ private readonly client;
27
+ constructor(client: HttpClient);
28
+ /** The account's value, or one agent's own value over the account's. */
29
+ get(agentId?: string): Promise<TrustSetting>;
30
+ /** Set the account's value, or one agent's (it wins over the account's). */
31
+ set(trust: TrustValue, agentId?: string, opts?: {
32
+ governanceApprovalId?: string;
33
+ }): Promise<TrustSetting>;
34
+ /** Remove an agent's own value, so it follows the account again. */
35
+ clear(agentId: string, opts?: {
36
+ governanceApprovalId?: string;
37
+ }): Promise<TrustSetting>;
38
+ }
39
+ //# sourceMappingURL=trust.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trust.d.ts","sourceRoot":"","sources":["../../src/services/trust.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,kGAAkG;AAClG,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG,cAAc,CAAC;AAEtD,4DAA4D;AAC5D,MAAM,WAAW,YAAY;IAC3B,sDAAsD;IACtD,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,uIAAuI;IACvI,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;IACzB,2GAA2G;IAC3G,SAAS,EAAE,UAAU,CAAC;IACtB,6CAA6C;IAC7C,MAAM,EAAE,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC;CACzC;AAED;;;;;;;;;GASG;AACH,qBAAa,YAAY;IACX,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAE/C,wEAAwE;IAClE,GAAG,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAIlD,4EAA4E;IACtE,GAAG,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,oBAAoB,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,YAAY,CAAC;IAI/G,oEAAoE;IAC9D,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,oBAAoB,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,YAAY,CAAC;CAG9F"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * The trust switch: whether the account's agents ask first or are trusted to act. With `trust_agents` nothing waits for
3
+ * a person on card purchases, orders on the customer's own supplier account, and governance changes made with the
4
+ * owner's own API key; with `ask_first` they wait, as they always have. In both, a wallet balance or spend limit, a
5
+ * revoked or suspended agent, a control policy's review rule and the browser-only actions still apply. A new account
6
+ * starts on `trust_agents`. Owner or admin only; an agent is refused. It is not part of any control policy. A change that
7
+ * makes a scope trust where it asked first before needs a person's approval (`trust_widen`: 403
8
+ * `GOVERNANCE_APPROVAL_REQUIRED` with the approval link; retry with `governanceApprovalId` once it is approved); a
9
+ * change to `ask_first` applies at once. Every change is recorded in the audit log.
10
+ */
11
+ export class TrustService {
12
+ client;
13
+ constructor(client) {
14
+ this.client = client;
15
+ }
16
+ /** The account's value, or one agent's own value over the account's. */
17
+ async get(agentId) {
18
+ return this.client.get(trustPath(agentId));
19
+ }
20
+ /** Set the account's value, or one agent's (it wins over the account's). */
21
+ async set(trust, agentId, opts) {
22
+ return this.client.put(trustPath(agentId), { trust }, approvalHeaders(opts));
23
+ }
24
+ /** Remove an agent's own value, so it follows the account again. */
25
+ async clear(agentId, opts) {
26
+ return this.client.put(trustPath(agentId), { trust: null }, approvalHeaders(opts));
27
+ }
28
+ }
29
+ function trustPath(agentId) {
30
+ return agentId === undefined ? '/v1/trust' : `/v1/agents/${encodeURIComponent(agentId)}/trust`;
31
+ }
32
+ function approvalHeaders(opts) {
33
+ return opts?.governanceApprovalId ? { headers: { 'X-Governance-Approval': opts.governanceApprovalId } } : undefined;
34
+ }
35
+ //# sourceMappingURL=trust.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trust.js","sourceRoot":"","sources":["../../src/services/trust.ts"],"names":[],"mappings":"AAiBA;;;;;;;;;GASG;AACH,MAAM,OAAO,YAAY;IACM;IAA7B,YAA6B,MAAkB;QAAlB,WAAM,GAAN,MAAM,CAAY;IAAG,CAAC;IAEnD,wEAAwE;IACxE,KAAK,CAAC,GAAG,CAAC,OAAgB;QACxB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAe,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3D,CAAC;IAED,4EAA4E;IAC5E,KAAK,CAAC,GAAG,CAAC,KAAiB,EAAE,OAAgB,EAAE,IAAwC;QACrF,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAe,SAAS,CAAC,OAAO,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC;IAC7F,CAAC;IAED,oEAAoE;IACpE,KAAK,CAAC,KAAK,CAAC,OAAe,EAAE,IAAwC;QACnE,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAe,SAAS,CAAC,OAAO,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC;IACnG,CAAC;CACF;AAED,SAAS,SAAS,CAAC,OAA2B;IAC5C,OAAO,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,cAAc,kBAAkB,CAAC,OAAO,CAAC,QAAQ,CAAC;AACjG,CAAC;AAED,SAAS,eAAe,CAAC,IAAmD;IAC1E,OAAO,IAAI,EAAE,oBAAoB,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,uBAAuB,EAAE,IAAI,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AACtH,CAAC"}
@@ -11,7 +11,7 @@ import type { UsageResponse } from '../types.js';
11
11
  * `consumption.activity` is every audit event. `consumption.actions` is only
12
12
  * the published allowance meter. Its `allowance_coverage` states whether the
13
13
  * limit belongs to that exact UTC month. An old unknown month never borrows
14
- * the current tier. Pass `since` / `until` (ISO-8601 or unix-ms) to scope the
14
+ * the current plan. Pass `since` / `until` (ISO-8601 or unix-ms) to scope the
15
15
  * flow metrics to a window. Inventory metrics always report the current count,
16
16
  * plus `created_in_window` when a window is set.
17
17
  *
@@ -9,7 +9,7 @@
9
9
  * `consumption.activity` is every audit event. `consumption.actions` is only
10
10
  * the published allowance meter. Its `allowance_coverage` states whether the
11
11
  * limit belongs to that exact UTC month. An old unknown month never borrows
12
- * the current tier. Pass `since` / `until` (ISO-8601 or unix-ms) to scope the
12
+ * the current plan. Pass `since` / `until` (ISO-8601 or unix-ms) to scope the
13
13
  * flow metrics to a window. Inventory metrics always report the current count,
14
14
  * plus `created_in_window` when a window is set.
15
15
  *