@avow-finance/sdk 0.0.0-stage → 0.2.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 (267) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +122 -2
  3. package/dist/agent-entry.d.ts +15 -0
  4. package/dist/agent-entry.d.ts.map +1 -0
  5. package/dist/agent-entry.js +11 -0
  6. package/dist/agent-entry.js.map +1 -0
  7. package/dist/agent-key.d.ts +34 -0
  8. package/dist/agent-key.d.ts.map +1 -0
  9. package/dist/agent-key.js +33 -0
  10. package/dist/agent-key.js.map +1 -0
  11. package/dist/agent.d.ts +261 -0
  12. package/dist/agent.d.ts.map +1 -0
  13. package/dist/agent.js +493 -0
  14. package/dist/agent.js.map +1 -0
  15. package/dist/avow-api.d.ts +78 -0
  16. package/dist/avow-api.d.ts.map +1 -0
  17. package/dist/avow-api.js +2 -0
  18. package/dist/avow-api.js.map +1 -0
  19. package/dist/contest.d.ts +135 -0
  20. package/dist/contest.d.ts.map +1 -0
  21. package/dist/contest.js +186 -0
  22. package/dist/contest.js.map +1 -0
  23. package/dist/http.d.ts +161 -0
  24. package/dist/http.d.ts.map +1 -0
  25. package/dist/http.js +311 -0
  26. package/dist/http.js.map +1 -0
  27. package/dist/index.d.ts +38 -0
  28. package/dist/index.d.ts.map +1 -0
  29. package/dist/index.js +38 -0
  30. package/dist/index.js.map +1 -0
  31. package/dist/job/accept.d.ts +84 -0
  32. package/dist/job/accept.d.ts.map +1 -0
  33. package/dist/job/accept.js +136 -0
  34. package/dist/job/accept.js.map +1 -0
  35. package/dist/job/customer.d.ts +43 -0
  36. package/dist/job/customer.d.ts.map +1 -0
  37. package/dist/job/customer.js +83 -0
  38. package/dist/job/customer.js.map +1 -0
  39. package/dist/job/quote.d.ts +34 -0
  40. package/dist/job/quote.d.ts.map +1 -0
  41. package/dist/job/quote.js +37 -0
  42. package/dist/job/quote.js.map +1 -0
  43. package/dist/lock.d.ts +269 -0
  44. package/dist/lock.d.ts.map +1 -0
  45. package/dist/lock.js +283 -0
  46. package/dist/lock.js.map +1 -0
  47. package/dist/moderato.d.ts +27 -0
  48. package/dist/moderato.d.ts.map +1 -0
  49. package/dist/moderato.js +34 -0
  50. package/dist/moderato.js.map +1 -0
  51. package/dist/node/cli.d.ts +3 -0
  52. package/dist/node/cli.d.ts.map +1 -0
  53. package/dist/node/cli.js +346 -0
  54. package/dist/node/cli.js.map +1 -0
  55. package/dist/node/connect.d.ts +15 -0
  56. package/dist/node/connect.d.ts.map +1 -0
  57. package/dist/node/connect.js +91 -0
  58. package/dist/node/connect.js.map +1 -0
  59. package/dist/node/eval.d.ts +3 -0
  60. package/dist/node/eval.d.ts.map +1 -0
  61. package/dist/node/eval.js +67 -0
  62. package/dist/node/eval.js.map +1 -0
  63. package/dist/node/first-run.d.ts +50 -0
  64. package/dist/node/first-run.d.ts.map +1 -0
  65. package/dist/node/first-run.js +149 -0
  66. package/dist/node/first-run.js.map +1 -0
  67. package/dist/node/job.d.ts +50 -0
  68. package/dist/node/job.d.ts.map +1 -0
  69. package/dist/node/job.js +176 -0
  70. package/dist/node/job.js.map +1 -0
  71. package/dist/node/mailbox.d.ts +19 -0
  72. package/dist/node/mailbox.d.ts.map +1 -0
  73. package/dist/node/mailbox.js +81 -0
  74. package/dist/node/mailbox.js.map +1 -0
  75. package/dist/node/mcp.d.ts +74 -0
  76. package/dist/node/mcp.d.ts.map +1 -0
  77. package/dist/node/mcp.js +367 -0
  78. package/dist/node/mcp.js.map +1 -0
  79. package/dist/node/platform.d.ts +35 -0
  80. package/dist/node/platform.d.ts.map +1 -0
  81. package/dist/node/platform.js +102 -0
  82. package/dist/node/platform.js.map +1 -0
  83. package/dist/node/runner-session.d.ts +41 -0
  84. package/dist/node/runner-session.d.ts.map +1 -0
  85. package/dist/node/runner-session.js +100 -0
  86. package/dist/node/runner-session.js.map +1 -0
  87. package/dist/node/runner.d.ts +63 -0
  88. package/dist/node/runner.d.ts.map +1 -0
  89. package/dist/node/runner.js +341 -0
  90. package/dist/node/runner.js.map +1 -0
  91. package/dist/node/service-child.d.ts +2 -0
  92. package/dist/node/service-child.d.ts.map +1 -0
  93. package/dist/node/service-child.js +40 -0
  94. package/dist/node/service-child.js.map +1 -0
  95. package/dist/node/service-excerpt.d.ts +21 -0
  96. package/dist/node/service-excerpt.d.ts.map +1 -0
  97. package/dist/node/service-excerpt.js +32 -0
  98. package/dist/node/service-excerpt.js.map +1 -0
  99. package/dist/node/service-process.d.ts +12 -0
  100. package/dist/node/service-process.d.ts.map +1 -0
  101. package/dist/node/service-process.js +132 -0
  102. package/dist/node/service-process.js.map +1 -0
  103. package/dist/node/session-input.d.ts +12 -0
  104. package/dist/node/session-input.d.ts.map +1 -0
  105. package/dist/node/session-input.js +42 -0
  106. package/dist/node/session-input.js.map +1 -0
  107. package/dist/node/session-view.d.ts +20 -0
  108. package/dist/node/session-view.d.ts.map +1 -0
  109. package/dist/node/session-view.js +198 -0
  110. package/dist/node/session-view.js.map +1 -0
  111. package/dist/node-agent.d.ts +2 -0
  112. package/dist/node-agent.d.ts.map +1 -0
  113. package/dist/node-agent.js +6 -0
  114. package/dist/node-agent.js.map +1 -0
  115. package/dist/node.d.ts +2 -0
  116. package/dist/node.d.ts.map +1 -0
  117. package/dist/node.js +9 -0
  118. package/dist/node.js.map +1 -0
  119. package/dist/sandbox/agent.d.ts +187 -0
  120. package/dist/sandbox/agent.d.ts.map +1 -0
  121. package/dist/sandbox/agent.js +468 -0
  122. package/dist/sandbox/agent.js.map +1 -0
  123. package/dist/sandbox/business-store.d.ts +19 -0
  124. package/dist/sandbox/business-store.d.ts.map +1 -0
  125. package/dist/sandbox/business-store.js +19 -0
  126. package/dist/sandbox/business-store.js.map +1 -0
  127. package/dist/sandbox/business.d.ts +70 -0
  128. package/dist/sandbox/business.d.ts.map +1 -0
  129. package/dist/sandbox/business.js +115 -0
  130. package/dist/sandbox/business.js.map +1 -0
  131. package/dist/sandbox/connect.d.ts +64 -0
  132. package/dist/sandbox/connect.d.ts.map +1 -0
  133. package/dist/sandbox/connect.js +182 -0
  134. package/dist/sandbox/connect.js.map +1 -0
  135. package/dist/sandbox/deployment.d.ts +14 -0
  136. package/dist/sandbox/deployment.d.ts.map +1 -0
  137. package/dist/sandbox/deployment.js +38 -0
  138. package/dist/sandbox/deployment.js.map +1 -0
  139. package/dist/sandbox/keys.d.ts +45 -0
  140. package/dist/sandbox/keys.d.ts.map +1 -0
  141. package/dist/sandbox/keys.js +132 -0
  142. package/dist/sandbox/keys.js.map +1 -0
  143. package/dist/sandbox/mailbox.d.ts +90 -0
  144. package/dist/sandbox/mailbox.d.ts.map +1 -0
  145. package/dist/sandbox/mailbox.js +400 -0
  146. package/dist/sandbox/mailbox.js.map +1 -0
  147. package/dist/sandbox/mandate.d.ts +84 -0
  148. package/dist/sandbox/mandate.d.ts.map +1 -0
  149. package/dist/sandbox/mandate.js +107 -0
  150. package/dist/sandbox/mandate.js.map +1 -0
  151. package/dist/sandbox/namespace.d.ts +16 -0
  152. package/dist/sandbox/namespace.d.ts.map +1 -0
  153. package/dist/sandbox/namespace.js +16 -0
  154. package/dist/sandbox/namespace.js.map +1 -0
  155. package/dist/sandbox/session.d.ts +60 -0
  156. package/dist/sandbox/session.d.ts.map +1 -0
  157. package/dist/sandbox/session.js +94 -0
  158. package/dist/sandbox/session.js.map +1 -0
  159. package/dist/sandbox/setup.d.ts +136 -0
  160. package/dist/sandbox/setup.d.ts.map +1 -0
  161. package/dist/sandbox/setup.js +490 -0
  162. package/dist/sandbox/setup.js.map +1 -0
  163. package/dist/sandbox/store.d.ts +69 -0
  164. package/dist/sandbox/store.d.ts.map +1 -0
  165. package/dist/sandbox/store.js +115 -0
  166. package/dist/sandbox/store.js.map +1 -0
  167. package/dist/sandbox/supplier-key.d.ts +73 -0
  168. package/dist/sandbox/supplier-key.d.ts.map +1 -0
  169. package/dist/sandbox/supplier-key.js +180 -0
  170. package/dist/sandbox/supplier-key.js.map +1 -0
  171. package/dist/sandbox/suppliers.d.ts +7 -0
  172. package/dist/sandbox/suppliers.d.ts.map +1 -0
  173. package/dist/sandbox/suppliers.js +29 -0
  174. package/dist/sandbox/suppliers.js.map +1 -0
  175. package/dist/sandbox/terms.d.ts +32 -0
  176. package/dist/sandbox/terms.d.ts.map +1 -0
  177. package/dist/sandbox/terms.js +58 -0
  178. package/dist/sandbox/terms.js.map +1 -0
  179. package/dist/sandbox/vault.d.ts +24 -0
  180. package/dist/sandbox/vault.d.ts.map +1 -0
  181. package/dist/sandbox/vault.js +54 -0
  182. package/dist/sandbox/vault.js.map +1 -0
  183. package/dist/send.d.ts +122 -0
  184. package/dist/send.d.ts.map +1 -0
  185. package/dist/send.js +328 -0
  186. package/dist/send.js.map +1 -0
  187. package/dist/service-entry.d.ts +6 -0
  188. package/dist/service-entry.d.ts.map +1 -0
  189. package/dist/service-entry.js +6 -0
  190. package/dist/service-entry.js.map +1 -0
  191. package/dist/session/anthropic.d.ts +17 -0
  192. package/dist/session/anthropic.d.ts.map +1 -0
  193. package/dist/session/anthropic.js +215 -0
  194. package/dist/session/anthropic.js.map +1 -0
  195. package/dist/session/charge.d.ts +13 -0
  196. package/dist/session/charge.d.ts.map +1 -0
  197. package/dist/session/charge.js +33 -0
  198. package/dist/session/charge.js.map +1 -0
  199. package/dist/session/data.d.ts +8 -0
  200. package/dist/session/data.d.ts.map +1 -0
  201. package/dist/session/data.js +20 -0
  202. package/dist/session/data.js.map +1 -0
  203. package/dist/session/eval.d.ts +41 -0
  204. package/dist/session/eval.d.ts.map +1 -0
  205. package/dist/session/eval.js +281 -0
  206. package/dist/session/eval.js.map +1 -0
  207. package/dist/session/executor.d.ts +80 -0
  208. package/dist/session/executor.d.ts.map +1 -0
  209. package/dist/session/executor.js +381 -0
  210. package/dist/session/executor.js.map +1 -0
  211. package/dist/session/fixture-world.d.ts +29 -0
  212. package/dist/session/fixture-world.d.ts.map +1 -0
  213. package/dist/session/fixture-world.js +708 -0
  214. package/dist/session/fixture-world.js.map +1 -0
  215. package/dist/session/live-world.d.ts +22 -0
  216. package/dist/session/live-world.d.ts.map +1 -0
  217. package/dist/session/live-world.js +329 -0
  218. package/dist/session/live-world.js.map +1 -0
  219. package/dist/session/ollama.d.ts +29 -0
  220. package/dist/session/ollama.d.ts.map +1 -0
  221. package/dist/session/ollama.js +177 -0
  222. package/dist/session/ollama.js.map +1 -0
  223. package/dist/session/provider.d.ts +79 -0
  224. package/dist/session/provider.d.ts.map +1 -0
  225. package/dist/session/provider.js +19 -0
  226. package/dist/session/provider.js.map +1 -0
  227. package/dist/session/scripted.d.ts +45 -0
  228. package/dist/session/scripted.d.ts.map +1 -0
  229. package/dist/session/scripted.js +236 -0
  230. package/dist/session/scripted.js.map +1 -0
  231. package/dist/session/selection.d.ts +37 -0
  232. package/dist/session/selection.d.ts.map +1 -0
  233. package/dist/session/selection.js +104 -0
  234. package/dist/session/selection.js.map +1 -0
  235. package/dist/session/service-check.d.ts +48 -0
  236. package/dist/session/service-check.d.ts.map +1 -0
  237. package/dist/session/service-check.js +86 -0
  238. package/dist/session/service-check.js.map +1 -0
  239. package/dist/session/service.d.ts +128 -0
  240. package/dist/session/service.d.ts.map +1 -0
  241. package/dist/session/service.js +150 -0
  242. package/dist/session/service.js.map +1 -0
  243. package/dist/session/session.d.ts +95 -0
  244. package/dist/session/session.d.ts.map +1 -0
  245. package/dist/session/session.js +312 -0
  246. package/dist/session/session.js.map +1 -0
  247. package/dist/session/toolbox.d.ts +69 -0
  248. package/dist/session/toolbox.d.ts.map +1 -0
  249. package/dist/session/toolbox.js +391 -0
  250. package/dist/session/toolbox.js.map +1 -0
  251. package/dist/session/tools.d.ts +45 -0
  252. package/dist/session/tools.d.ts.map +1 -0
  253. package/dist/session/tools.js +137 -0
  254. package/dist/session/tools.js.map +1 -0
  255. package/dist/session/world.d.ts +188 -0
  256. package/dist/session/world.d.ts.map +1 -0
  257. package/dist/session/world.js +2 -0
  258. package/dist/session/world.js.map +1 -0
  259. package/dist/sign.d.ts +19 -0
  260. package/dist/sign.d.ts.map +1 -0
  261. package/dist/sign.js +33 -0
  262. package/dist/sign.js.map +1 -0
  263. package/dist/supplier.d.ts +41 -0
  264. package/dist/supplier.d.ts.map +1 -0
  265. package/dist/supplier.js +57 -0
  266. package/dist/supplier.js.map +1 -0
  267. package/package.json +56 -3
@@ -0,0 +1,16 @@
1
+ import { sandboxAgent } from './agent.js';
2
+ import { loadSandboxDeployment } from './deployment.js';
3
+ import { prepareSandboxBusiness } from './setup.js';
4
+ import { memoryStore } from './store.js';
5
+ /**
6
+ * Avow's sandbox on Tempo's Moderato testnet. `sandbox.business` is the business's side, which
7
+ * holds the root key and signs the agent's mandate, and only the runner calls it. `sandbox.agent`
8
+ * is the agent's side, which acts with only the agent's key.
9
+ */
10
+ export declare const sandbox: {
11
+ readonly agent: typeof sandboxAgent;
12
+ readonly business: typeof prepareSandboxBusiness;
13
+ readonly deployment: typeof loadSandboxDeployment;
14
+ readonly memoryStore: typeof memoryStore;
15
+ };
16
+ //# sourceMappingURL=namespace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"namespace.d.ts","sourceRoot":"","sources":["../../src/sandbox/namespace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAA;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAExC;;;;GAIG;AACH,eAAO,MAAM,OAAO;;;;;CAKV,CAAA"}
@@ -0,0 +1,16 @@
1
+ import { sandboxAgent } from './agent.js';
2
+ import { loadSandboxDeployment } from './deployment.js';
3
+ import { prepareSandboxBusiness } from './setup.js';
4
+ import { memoryStore } from './store.js';
5
+ /**
6
+ * Avow's sandbox on Tempo's Moderato testnet. `sandbox.business` is the business's side, which
7
+ * holds the root key and signs the agent's mandate, and only the runner calls it. `sandbox.agent`
8
+ * is the agent's side, which acts with only the agent's key.
9
+ */
10
+ export const sandbox = {
11
+ agent: sandboxAgent,
12
+ business: prepareSandboxBusiness,
13
+ deployment: loadSandboxDeployment,
14
+ memoryStore,
15
+ };
16
+ //# sourceMappingURL=namespace.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"namespace.js","sourceRoot":"","sources":["../../src/sandbox/namespace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAA;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAExC;;;;GAIG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,KAAK,EAAE,YAAY;IACnB,QAAQ,EAAE,sBAAsB;IAChC,UAAU,EAAE,qBAAqB;IACjC,WAAW;CACH,CAAA"}
@@ -0,0 +1,60 @@
1
+ import { type AvowDomain, type CommitmentReference, type RequestKey, type SessionEvent, type SessionEventAnswer } from '@avow-finance/spec';
2
+ import { type Address } from 'viem';
3
+ import { type AvowRequestConfig } from '../http.js';
4
+ /** The testnet sandbox's screen, which shows a session's events and checks a shared commitment. */
5
+ export declare const SANDBOX_SCREEN_URL = "https://try.testnet.avow.finance";
6
+ /** The link to the screen that shows a session's events as they arrive. */
7
+ export declare function sessionUrl(sessionId: string, screenUrl?: string): string;
8
+ /**
9
+ * The link anyone can open to check a commitment against the lock it names. Its fragment carries
10
+ * the commitment reference as `encodeCommitmentReference` writes it, and never reaches a server.
11
+ */
12
+ export declare function verifyUrl(reference: CommitmentReference, screenUrl?: string): string;
13
+ export interface SessionRelayConfig extends Omit<AvowRequestConfig, 'key'> {
14
+ /** The session the screen at `sessionUrl(sessionId)` shows. */
15
+ sessionId: string;
16
+ /**
17
+ * The key that signs each event, so Avow's API can tell it comes from a registered sandbox
18
+ * business before it relays it to the screen. The agent's process signs with the agent's key,
19
+ * through `agentRequestKey`, and only the runner signs an authority change with the business's
20
+ * root key, through `rootRequestKey`.
21
+ */
22
+ key: RequestKey;
23
+ /** The chain and the business's lock, which each event's request is signed under. */
24
+ domain: AvowDomain;
25
+ }
26
+ /** Posts a sandbox business's events to one session. */
27
+ export interface SessionRelay {
28
+ readonly sessionId: string;
29
+ /** Posts one event and gives its place in the session, counting from 1. */
30
+ post(event: SessionEvent): Promise<SessionEventAnswer>;
31
+ }
32
+ /**
33
+ * Avow's relay for one session's events. Each event is one request through `avowRequests`, signed
34
+ * by `key` under the business's lock, so a lost answer never posts the same event twice. It stops resending after 20 seconds by default, since a screen that shows an event late
35
+ * helps no one, and a refusal throws an `AvowApiError` with Avow's reason.
36
+ */
37
+ export declare function sessionRelay(config: SessionRelayConfig): SessionRelay;
38
+ /** Where a session stands with Avow's relay. */
39
+ export interface SessionStanding {
40
+ /** The business the session is bound to, or null while no event has reached it. */
41
+ business: {
42
+ businessId: string;
43
+ account: Address;
44
+ lock: Address;
45
+ } | null;
46
+ /** When the relay stops taking the session's events, in unix seconds, or null while unbound. */
47
+ endsAt: bigint | null;
48
+ /** The highest run number among the session's events, or 0 when it has none. */
49
+ lastRun: number;
50
+ }
51
+ /**
52
+ * Where a session stands with Avow's relay, read from the route the screen reads, which needs no
53
+ * signature. It reads the session's events a page at a time for the last run number in it.
54
+ */
55
+ export declare function readSessionStanding(m: {
56
+ apiUrl: string;
57
+ sessionId: string;
58
+ fetch?: typeof fetch;
59
+ }): Promise<SessionStanding>;
60
+ //# sourceMappingURL=session.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/sandbox/session.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,UAAU,EACf,KAAK,mBAAmB,EAIxB,KAAK,UAAU,EAEf,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACxB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAA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AM,CAAA;IACjB,KAAK,CAAC,EAAE,OAAO,KAAK,CAAA;CACrB,GAAG,OAAO,CAAC,eAAe,CAAC,CAoB3B"}
@@ -0,0 +1,94 @@
1
+ import { encodeCommitmentReference, isSessionId, parseSessionEventAnswer, SANDBOX_PATHS, } from '@avow-finance/spec';
2
+ import { isAddress } from 'viem';
3
+ import { avowRequests } from '../http.js';
4
+ /** The testnet sandbox's screen, which shows a session's events and checks a shared commitment. */
5
+ export const SANDBOX_SCREEN_URL = 'https://try.testnet.avow.finance';
6
+ /** The screen's own origin, without the trailing slash a pasted URL may carry. */
7
+ const screenOrigin = (screenUrl) => new URL(screenUrl).origin;
8
+ /** The link to the screen that shows a session's events as they arrive. */
9
+ export function sessionUrl(sessionId, screenUrl = SANDBOX_SCREEN_URL) {
10
+ if (!isSessionId(sessionId))
11
+ throw new RangeError(`${sessionId} isn't a session id`);
12
+ return `${screenOrigin(screenUrl)}/#session=${sessionId}`;
13
+ }
14
+ /**
15
+ * The link anyone can open to check a commitment against the lock it names. Its fragment carries
16
+ * the commitment reference as `encodeCommitmentReference` writes it, and never reaches a server.
17
+ */
18
+ export function verifyUrl(reference, screenUrl = SANDBOX_SCREEN_URL) {
19
+ return `${screenOrigin(screenUrl)}/#verify=${encodeCommitmentReference(reference)}`;
20
+ }
21
+ /**
22
+ * Avow's relay for one session's events. Each event is one request through `avowRequests`, signed
23
+ * by `key` under the business's lock, so a lost answer never posts the same event twice. It stops resending after 20 seconds by default, since a screen that shows an event late
24
+ * helps no one, and a refusal throws an `AvowApiError` with Avow's reason.
25
+ */
26
+ export function sessionRelay(config) {
27
+ const { sessionId, key, domain, ...request } = config;
28
+ const path = SANDBOX_PATHS.sessionEvents(sessionId);
29
+ const send = avowRequests({ retryFor: 20n, ...request, key });
30
+ return {
31
+ sessionId,
32
+ post: (event) => send({ domain, path, body: { event }, read: parseSessionEventAnswer }),
33
+ };
34
+ }
35
+ /** One page of a session's events, as the relay's events route answers. */
36
+ function readPage(json) {
37
+ if (typeof json !== 'object' || json === null)
38
+ return null;
39
+ const page = json;
40
+ const b = page.business;
41
+ const business = b === null
42
+ ? null
43
+ : typeof b === 'object' &&
44
+ typeof b.businessId === 'string' &&
45
+ typeof b.account === 'string' &&
46
+ isAddress(b.account) &&
47
+ typeof b.lock === 'string' &&
48
+ isAddress(b.lock)
49
+ ? { businessId: b.businessId, account: b.account, lock: b.lock }
50
+ : undefined;
51
+ const endsAt = page.expiresAt === null
52
+ ? null
53
+ : (typeof page.expiresAt === 'string' && /^[0-9]{1,20}$/.test(page.expiresAt)) ||
54
+ (typeof page.expiresAt === 'number' && Number.isSafeInteger(page.expiresAt))
55
+ ? BigInt(page.expiresAt)
56
+ : undefined;
57
+ if (business === undefined || endsAt === undefined || !Array.isArray(page.events))
58
+ return null;
59
+ const events = page.events.flatMap((e) => {
60
+ const row = e;
61
+ return typeof row?.sequence === 'number' && typeof row.event?.run === 'number'
62
+ ? [{ sequence: row.sequence, run: row.event.run }]
63
+ : [];
64
+ });
65
+ return { business, endsAt, events };
66
+ }
67
+ /**
68
+ * Where a session stands with Avow's relay, read from the route the screen reads, which needs no
69
+ * signature. It reads the session's events a page at a time for the last run number in it.
70
+ */
71
+ export async function readSessionStanding(m) {
72
+ const send = m.fetch ?? ((input, init) => fetch(input, init));
73
+ const url = `${m.apiUrl.replace(/\/+$/, '')}${SANDBOX_PATHS.sessionEvents(m.sessionId)}`;
74
+ let standing = { business: null, endsAt: null, lastRun: 0 };
75
+ let after = 0;
76
+ // A session holds a few hundred events at most, so this reads all of them well within the bound.
77
+ for (let pages = 0; pages < 100; pages++) {
78
+ const answer = await send(`${url}?after=${after}`);
79
+ if (!answer.ok)
80
+ throw new Error(`Avow's relay answered ${answer.status} for the session`);
81
+ const page = readPage(await answer.json());
82
+ if (!page)
83
+ throw new Error("Avow's relay answered for the session in a form the SDK doesn't read");
84
+ standing = { ...standing, business: page.business, endsAt: page.endsAt };
85
+ if (page.events.length === 0)
86
+ break;
87
+ for (const e of page.events) {
88
+ standing.lastRun = Math.max(standing.lastRun, e.run);
89
+ after = Math.max(after, e.sequence);
90
+ }
91
+ }
92
+ return standing;
93
+ }
94
+ //# sourceMappingURL=session.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/sandbox/session.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,yBAAyB,EACzB,WAAW,EACX,uBAAuB,EAEvB,aAAa,GAGd,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAgB,SAAS,EAAE,MAAM,MAAM,CAAA;AAC9C,OAAO,EAA0B,YAAY,EAAE,MAAM,YAAY,CAAA;AAEjE,mGAAmG;AACnG,MAAM,CAAC,MAAM,kBAAkB,GAAG,kCAAkC,CAAA;AAEpE,kFAAkF;AAClF,MAAM,YAAY,GAAG,CAAC,SAAiB,EAAE,EAAE,CAAC,IAAI,GAAG,CAAC,SAAS,CAAC,CAAC,MAAM,CAAA;AAErE,2EAA2E;AAC3E,MAAM,UAAU,UAAU,CAAC,SAAiB,EAAE,SAAS,GAAW,kBAAkB;IAClF,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC;QAAE,MAAM,IAAI,UAAU,CAAC,GAAG,SAAS,qBAAqB,CAAC,CAAA;IACpF,OAAO,GAAG,YAAY,CAAC,SAAS,CAAC,aAAa,SAAS,EAAE,CAAA;AAC3D,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,SAAS,CACvB,SAA8B,EAC9B,SAAS,GAAW,kBAAkB;IAEtC,OAAO,GAAG,YAAY,CAAC,SAAS,CAAC,YAAY,yBAAyB,CAAC,SAAS,CAAC,EAAE,CAAA;AACrF,CAAC;AAuBD;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,MAA0B;IACrD,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,GAAG,MAAM,CAAA;IACrD,MAAM,IAAI,GAAG,aAAa,CAAC,aAAa,CAAC,SAAS,CAAC,CA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M,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,CAAA;IAC5E,IAAI,KAAK,GAAG,CAAC,CAAA;IACb,iGAAiG;IACjG,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC;QACzC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,GAAG,GAAG,UAAU,KAAK,EAAE,CAAC,CAAA;QAClD,IAAI,CAAC,MAAM,CAAC,EAAE;YAAE,MAAM,IAAI,KAAK,CAAC,yBAAyB,MAAM,CAAC,MAAM,kBAAkB,CAAC,CAAA;QACzF,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC,CAAA;QAC1C,IAAI,CAAC,IAAI;YACP,MAAM,IAAI,KAAK,CAAC,sEAAsE,CAAC,CAAA;QACzF,QAAQ,GAAG,EAAE,GAAG,QAAQ,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAA;QACxE,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC;YAAE,MAAK;QACnC,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAC5B,QAAQ,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,CAAC,CAAA;YACpD,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAA;QACrC,CAAC;IACH,CAAC;IACD,OAAO,QAAQ,CAAA;AACjB,CAAC"}
@@ -0,0 +1,136 @@
1
+ import { type SandboxDeployment } from '@avow-finance/spec';
2
+ import { type Address, type Hex } from 'viem';
3
+ import { type SandboxSession } from './agent.js';
4
+ import { type SandboxClient } from './business.js';
5
+ import { type SandboxStore, type SandboxSupplier } from './store.js';
6
+ /** What a business gives its agent, as `business.ts` in the starter says it. */
7
+ export interface SandboxBusinessConfig {
8
+ /** The name the business registers under. */
9
+ name: string;
10
+ /** Two capital letters, `US` when left out. */
11
+ country?: string;
12
+ /**
13
+ * The most the agent can hold in bookings at once, in dollars. Avow refuses a booking past it, and
14
+ * the lock checks each reserve against the caps in Avow's approval.
15
+ */
16
+ authority: number;
17
+ /**
18
+ * The most the agent's key can move in a day, in dollars, which the business sets on chain and the
19
+ * account's keychain holds whatever Avow approves. $1,000 when left out.
20
+ */
21
+ dailyLimit?: number;
22
+ /** The suppliers the agent may book with, and no others. */
23
+ suppliers: readonly SandboxSupplier[];
24
+ }
25
+ /** How the business's side asks the person running it. */
26
+ export interface SandboxPrompts {
27
+ /** Asks for a new passphrase the first time, which seals the business's key. */
28
+ newPassphrase(): Promise<string>;
29
+ /** Asks for the passphrase that opens the business's key. */
30
+ passphrase(): Promise<string>;
31
+ /**
32
+ * Asks a yes or no question, before the business signs anything new. The details say what a yes
33
+ * does, a sentence each.
34
+ */
35
+ confirm(question: string, details?: readonly string[]): Promise<boolean>;
36
+ }
37
+ /**
38
+ * What a line setup reports is: a stage starting, a step done, something under way until the next
39
+ * line, or a sentence to read. A log that ignores it still reads in order.
40
+ */
41
+ /**
42
+ * How a setup line draws. A first setup runs as numbered steps: `step` starts one, its title and a
43
+ * sentence on why it matters on two lines, and `step_done` ends it with what it left. A `detail`
44
+ * line, such as an address, shows only when the developer asks for details.
45
+ */
46
+ export type SetupLineKind = 'stage' | 'done' | 'wait' | 'note' | 'step' | 'step_done' | 'detail';
47
+ export interface PrepareSandboxBusinessOptions {
48
+ config: SandboxBusinessConfig;
49
+ prompts: SandboxPrompts;
50
+ /** Where the business keeps its sealed key and its agent's item. The `.avow` folder in Node. */
51
+ store?: SandboxStore;
52
+ screenUrl?: string;
53
+ deployment?: SandboxDeployment;
54
+ /** The chain, through the deployment's node when left out. */
55
+ client?: SandboxClient;
56
+ /** The session an authority change is reported to, signed by the business's root key. */
57
+ session?: SandboxSession | null;
58
+ /**
59
+ * Whether the job chapter needs the business registered as a supplier with a signing key of its
60
+ * own. A registration that fails doesn't stop setup, and the result says why.
61
+ */
62
+ supplier?: boolean;
63
+ /**
64
+ * Whether the session hasn't had the agent's authority yet, as on a first run, after `npm run
65
+ * fresh` or once a session has ended. Then the business's key signs the current authority into
66
+ * it even when nothing changed, which takes the passphrase once.
67
+ */
68
+ announce?: boolean;
69
+ /** Where setup says what it's doing, each line with what kind of line it is. */
70
+ log?: (line: string, kind?: SetupLineKind) => void;
71
+ fetch?: typeof fetch;
72
+ }
73
+ /** Where the business stands once it's prepared. */
74
+ export interface PreparedSandboxBusiness {
75
+ businessId: string;
76
+ account: Address;
77
+ lock: Address;
78
+ /** The authority the agent holds now, in dollars. */
79
+ authority: number;
80
+ suppliers: string[];
81
+ mandateHash: Hex;
82
+ /** Whether this call signed a new mandate. */
83
+ signed: boolean;
84
+ /**
85
+ * Whether this call gave the session the agent's authority, as it does whenever it signs a
86
+ * mandate, and with `announce` when nothing changed.
87
+ */
88
+ announced: boolean;
89
+ /**
90
+ * The business as a supplier of jobs when `supplier` asked for it: registered with its signing
91
+ * key, or why it couldn't be. Null when nothing asked.
92
+ */
93
+ supplier: {
94
+ ok: true;
95
+ signingKey: Address;
96
+ } | {
97
+ ok: false;
98
+ why: string;
99
+ } | null;
100
+ }
101
+ /**
102
+ * The business's side of the sandbox, which only the runner calls. The first time, it asks for a
103
+ * passphrase and seals a new root key under it, registers the business with Avow's sandbox, waits
104
+ * for its test dollars and creates its lock. It takes whether the business is set up, and which
105
+ * mandate the agent holds, from the chain, since anything running as the developer can write the
106
+ * .avow folder, and it sets a business up again only after a yes to a question that says what that
107
+ * replaces. Whenever the authority or the suppliers in the config differ from the mandate the chain
108
+ * holds, or the mandate is about to expire, it asks before signing a new mandate, then asks for the
109
+ * passphrase. A transaction of its own revokes every other key the account's keychain still
110
+ * authorizes, access or admin, read from the chain from the lock's creation, so nothing the agent
111
+ * can write keeps a key live. Then a new agent key goes on the account, and each supplier the lock
112
+ * approves that the new mandate doesn't name comes off, each in its own transaction. The root key
113
+ * is opened only for those signatures, and never stored or passed on in the clear.
114
+ */
115
+ export declare function prepareSandboxBusiness(options: PrepareSandboxBusinessOptions): Promise<PreparedSandboxBusiness>;
116
+ /**
117
+ * Has the agent try to hold a dollar more than its business just allowed, and says who refused
118
+ * it. A first setup doesn't stop for a try that couldn't run, such as one whose supplier didn't
119
+ * answer, so that gives null and the step ends without it.
120
+ */
121
+ export declare function limitTry(authority: bigint, book: (reserve: number) => Promise<unknown>): Promise<string | null>;
122
+ /**
123
+ * Cancels one of the agent's commitments on the lock before free cancellation ends, which gives
124
+ * the whole reserve back. It's the business's call, signed by its root key once the person types
125
+ * the passphrase, since the agent's key can't cancel on the lock.
126
+ */
127
+ export declare function cancelSandboxCommitment(options: {
128
+ commitmentId: Hex;
129
+ prompts: Pick<SandboxPrompts, 'passphrase'>;
130
+ store?: SandboxStore;
131
+ screenUrl?: string;
132
+ deployment?: SandboxDeployment;
133
+ client?: SandboxClient;
134
+ fetch?: typeof fetch;
135
+ }): Promise<Hex>;
136
+ //# sourceMappingURL=setup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/sandbox/setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,iBAAiB,EACvB,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,GAAG,EAAkB,MAAM,MAAM,CAAA;AAO7D,OAAO,EAML,KAAK,cAAc,EAEpB,MAAM,YAAY,CAAA;AACnB,OAAO,EAAmD,KAAK,aAAa,EAAE,MAAM,eAAe,CAAA;AAMnG,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,eAAe,EAGrB,MAAM,YAAY,CAAA;AAMnB,gFAAgF;AAChF,MAAM,WAAW,qBAAqB;IACpC,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAA;IACZ,+CAA+C;I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