@spirobel/monero-wallet-api 0.5.4 → 0.6.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 (91) hide show
  1. package/dist/actionlog/actionLogOpened.d.ts +96 -1
  2. package/dist/actionlog/actionLogOpened.js +386 -1
  3. package/dist/actionlog/actionLogTypes.d.ts +114 -0
  4. package/dist/actionlog/actionLogTypes.js +198 -0
  5. package/dist/actionlog/backend/idbBackend.d.ts +13 -0
  6. package/dist/actionlog/backend/idbBackend.js +109 -0
  7. package/dist/actionlog/backend/jsonlBackend.d.ts +19 -0
  8. package/dist/actionlog/backend/jsonlBackend.js +110 -0
  9. package/dist/actionlog/backend/memoryBackend.d.ts +11 -0
  10. package/dist/actionlog/backend/memoryBackend.js +31 -0
  11. package/dist/actionlog/backend/sqliteBackend.d.ts +14 -0
  12. package/dist/actionlog/backend/sqliteBackend.js +96 -0
  13. package/dist/actionlog/backend.d.ts +12 -0
  14. package/dist/actionlog/backend.js +1 -0
  15. package/dist/actionlog/idbBackend.d.ts +19 -0
  16. package/dist/actionlog/idbBackend.js +98 -0
  17. package/dist/actionlog/jsonlBackend.d.ts +19 -0
  18. package/dist/actionlog/jsonlBackend.js +75 -0
  19. package/dist/actionlog/memoryBackend.d.ts +14 -0
  20. package/dist/actionlog/memoryBackend.js +38 -0
  21. package/dist/actionlog/openMaps.d.ts +11 -0
  22. package/dist/actionlog/openMaps.js +32 -0
  23. package/dist/actionlog/sqliteBackend.d.ts +18 -0
  24. package/dist/actionlog/sqliteBackend.js +105 -0
  25. package/dist/actionlog/toolContext.d.ts +36 -0
  26. package/dist/actionlog/toolContext.js +1 -0
  27. package/dist/actionlog/types.d.ts +62 -0
  28. package/dist/actionlog/types.js +62 -0
  29. package/dist/api.d.ts +4 -0
  30. package/dist/api.js +3 -0
  31. package/dist/io/sleep.d.ts +1 -1
  32. package/dist/io/sleep.js +16 -1
  33. package/dist/scanning-syncing/backgroundWorker.d.ts +2 -0
  34. package/dist/scanning-syncing/backgroundWorker.js +92 -10
  35. package/dist/scanning-syncing/blocksbuffer/blocksBufferFetchLoop.js +33 -2
  36. package/dist/scanning-syncing/blocksbuffer/blocksbufferCoordination.js +2 -2
  37. package/dist/scanning-syncing/connectionStatus.d.ts +8 -0
  38. package/dist/scanning-syncing/connectionStatus.js +50 -0
  39. package/dist/scanning-syncing/connectionStatusOpened.d.ts +3 -1
  40. package/dist/scanning-syncing/connectionStatusOpened.js +22 -14
  41. package/dist/scanning-syncing/openWallet.d.ts +4 -1
  42. package/dist/scanning-syncing/openWallet.js +3 -0
  43. package/dist/scanning-syncing/scanresult/scanCache.d.ts +5 -1
  44. package/dist/scanning-syncing/scanresult/scanCache.js +11 -2
  45. package/dist/scanning-syncing/scanresult/scanCacheOpened.d.ts +56 -5
  46. package/dist/scanning-syncing/scanresult/scanCacheOpened.js +422 -83
  47. package/dist/scanning-syncing/scanresult/scanCoordination.d.ts +7 -3
  48. package/dist/scanning-syncing/scanresult/scanCoordination.js +126 -28
  49. package/dist/scanning-syncing/scanresult/scanLoop.d.ts +1 -2
  50. package/dist/scanning-syncing/scanresult/scanLoop.js +0 -13
  51. package/dist/scanning-syncing/scanresult/scanResult.js +17 -12
  52. package/dist/scanning-syncing/scanresult/scanStats.js +8 -5
  53. package/dist/scanning-syncing/worker-entrypoints/worker.js +1 -1
  54. package/dist/scanning-syncing/worker-mains/coordinator-main.d.ts +1 -0
  55. package/dist/scanning-syncing/worker-mains/coordinator-main.js +16 -1
  56. package/dist/scanning-syncing/worker-mains/cpubound-main.js +3 -2
  57. package/dist/scanning-syncing/worker-mains/worker.js +45 -2
  58. package/dist/tools/calls/001.d.ts +20 -0
  59. package/dist/tools/calls/001.js +236 -0
  60. package/dist/tools/calls/002-content.d.ts +46 -0
  61. package/dist/tools/calls/002-content.js +135 -0
  62. package/dist/tools/calls/002-fail-cleanup.d.ts +27 -0
  63. package/dist/tools/calls/002-fail-cleanup.js +60 -0
  64. package/dist/tools/calls/002.d.ts +64 -0
  65. package/dist/tools/calls/002.js +353 -0
  66. package/dist/tools/content.d.ts +22 -0
  67. package/dist/tools/content.js +41 -0
  68. package/dist/tools/counterparty.d.ts +3 -0
  69. package/dist/tools/counterparty.js +1 -0
  70. package/dist/tools/download-public-suffix.d.ts +1 -0
  71. package/dist/tools/download-public-suffix.js +20 -0
  72. package/dist/tools/globals.d.ts +196 -0
  73. package/dist/tools/globals.js +14 -0
  74. package/dist/tools/monero-tools-content.d.ts +29 -0
  75. package/dist/tools/monero-tools-content.js +80 -0
  76. package/dist/tools/monero-tools.d.ts +27 -52
  77. package/dist/tools/monero-tools.js +127 -222
  78. package/dist/tools/public-suffix-list.d.ts +1 -0
  79. package/dist/tools/public-suffix-list.js +10336 -0
  80. package/dist/tools/runtimeMessages.d.ts +4 -0
  81. package/dist/tools/runtimeMessages.js +18 -0
  82. package/dist/tools/toolActionLogContext.d.ts +33 -0
  83. package/dist/tools/toolActionLogContext.js +1 -0
  84. package/dist/tools/toolArm.d.ts +47 -0
  85. package/dist/tools/toolArm.js +1 -0
  86. package/dist/tools/ui.d.ts +2 -0
  87. package/dist/tools/ui.js +1 -0
  88. package/dist/tools/worker.d.ts +1 -0
  89. package/dist/tools/worker.js +1 -0
  90. package/dist/wasm-processing/wasmFile.js +2 -2
  91. package/package.json +8 -1
@@ -0,0 +1,4 @@
1
+ export declare const CORE_MESSAGE_KINDS: readonly ["toolCall", "execute", "dismiss", "dismissNotice", "openSidebar", "actionLogChanged", "walletCacheChanged", "worker.setNodeUrl", "worker.setStartHeight", "worker.changeNodeUrlAndStartHeight", "worker.buildWallets", "worker.wipeWorkers"];
2
+ export type CoreMessageKind = (typeof CORE_MESSAGE_KINDS)[number];
3
+ export declare const CONTENT_MESSAGE_KINDS: readonly ["toolCall", "openSidebar"];
4
+ export type ContentMessageKind = (typeof CONTENT_MESSAGE_KINDS)[number];
@@ -0,0 +1,18 @@
1
+ export const CORE_MESSAGE_KINDS = [
2
+ "toolCall",
3
+ "execute",
4
+ "dismiss",
5
+ "dismissNotice",
6
+ "openSidebar",
7
+ "actionLogChanged",
8
+ "walletCacheChanged",
9
+ "worker.setNodeUrl",
10
+ "worker.setStartHeight",
11
+ "worker.changeNodeUrlAndStartHeight",
12
+ "worker.buildWallets",
13
+ "worker.wipeWorkers",
14
+ ];
15
+ export const CONTENT_MESSAGE_KINDS = [
16
+ "toolCall",
17
+ "openSidebar",
18
+ ];
@@ -0,0 +1,33 @@
1
+ import type { ActionLogEvent, ActionLogOpened } from "../actionlog/actionLogOpened";
2
+ import type { ToolPermission } from "../actionlog/types";
3
+ /** durable plate notice — title/message are tool-owned STE text */
4
+ export type ToolNotice = {
5
+ id: string;
6
+ permission: ToolPermission;
7
+ /** short STE title for the notice plate hole */
8
+ title: string;
9
+ /** full STE body for the notice plate hole */
10
+ message: string;
11
+ context_domain?: string;
12
+ context_href?: string;
13
+ wallet_slot?: number;
14
+ timestamp?: number | string;
15
+ };
16
+ /** static STE strings for open-invocation plate holes */
17
+ export type ToolUiCopy = {
18
+ openTitle: string;
19
+ acceptLabel?: string;
20
+ dismissLabel?: string;
21
+ };
22
+ /** passed into per-tool actionlog writers — no wallet host types */
23
+ export type ToolActionLogContext = {
24
+ log: ActionLogOpened;
25
+ getWallets?: () => unknown;
26
+ /** host reopens wallets after tool changes scan settings */
27
+ reloadWallets?: () => void | Promise<void>;
28
+ getPort: (invocationId: string) => {
29
+ postMessage: (msg: unknown) => void;
30
+ } | undefined;
31
+ postToPort: (invocationId: string, msg: unknown) => void;
32
+ broadcast: (events: ActionLogEvent[]) => void;
33
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,47 @@
1
+ import type { ToolActionLogContext } from "../actionlog/types";
2
+ import type { ToolInvocationValidity, ToolNotice, ToolPermission, ToolUiCopy } from "./globals";
3
+ export type ToolInvocationForValidate = {
4
+ tool: {
5
+ tool_id: string;
6
+ payload: unknown;
7
+ };
8
+ destination_domain: string;
9
+ context_domain: string;
10
+ found_in: "link" | "linkText";
11
+ link: string;
12
+ linkText: string;
13
+ timestamp: number;
14
+ invocation_id: string;
15
+ context_href: string;
16
+ valid: ToolInvocationValidity;
17
+ };
18
+ export type ToolContentZone<TPayload = unknown> = {
19
+ parse: (args: string[]) => {
20
+ tool_id: string;
21
+ payload: TPayload;
22
+ } | null;
23
+ validate?: (invo: ToolInvocationForValidate) => Promise<ToolInvocationValidity> | ToolInvocationValidity;
24
+ afterValidate?: (invo: ToolInvocationForValidate) => void;
25
+ };
26
+ export type ToolWorkerZone = Record<string, unknown>;
27
+ export type ToolCounterpartyZone<TPayload = unknown, TExtra extends object = {}> = {
28
+ make: (payload: TPayload) => string;
29
+ } & TExtra;
30
+ export type ToolActionLogZone = {
31
+ onToolCall?: (ctx: ToolActionLogContext, invo: ToolInvocationForValidate) => Promise<void>;
32
+ onExecute?: (ctx: ToolActionLogContext, invocationId: string, args: Record<string, unknown>) => Promise<void>;
33
+ onDismiss?: (ctx: ToolActionLogContext, invocationId: string) => Promise<void>;
34
+ onPortDisconnect?: (ctx: ToolActionLogContext, invocationId: string) => Promise<void>;
35
+ getNotices?: (ctx: ToolActionLogContext) => Promise<ToolNotice[]>;
36
+ clearNotice?: (ctx: ToolActionLogContext, noticeId: string) => Promise<void>;
37
+ messageKinds?: Record<string, (ctx: ToolActionLogContext, payload: any) => Promise<void>>;
38
+ [key: string]: unknown;
39
+ };
40
+ export type ToolArm<TPayload = unknown, TCounterpartyExtra extends object = {}> = {
41
+ permissions: readonly ToolPermission[];
42
+ ui: ToolUiCopy;
43
+ content: ToolContentZone<TPayload>;
44
+ worker: ToolWorkerZone;
45
+ counterparty: ToolCounterpartyZone<TPayload, TCounterpartyExtra>;
46
+ actionlog: ToolActionLogZone;
47
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export type { ToolUiCopy, ToolNotice } from "./globals";
2
+ export { tools, TOOL_IDS, type ToolId } from "./monero-tools";
@@ -0,0 +1 @@
1
+ export { tools, TOOL_IDS } from "./monero-tools";
@@ -0,0 +1 @@
1
+ export { tools, TOOL_IDS, type ToolId } from "./monero-tools";
@@ -0,0 +1 @@
1
+ export { tools, TOOL_IDS } from "./monero-tools";
@@ -8,6 +8,6 @@ var frost_dkg_wasm = new Uint8Array(atob(dkg_source).split("").map(function(c) {
8
8
  return c.charCodeAt(0);
9
9
  }));
10
10
  export {
11
- monero_wallet_api_wasm,
12
- frost_dkg_wasm
11
+ frost_dkg_wasm,
12
+ monero_wallet_api_wasm
13
13
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spirobel/monero-wallet-api",
3
- "version": "0.5.4",
3
+ "version": "0.6.0",
4
4
  "main": "dist/api.js",
5
5
  "module": "dist/api.js",
6
6
  "devDependencies": {
@@ -17,8 +17,15 @@
17
17
  "./tools": {
18
18
  "types": "./dist/tools/monero-tools.d.ts",
19
19
  "import": "./dist/tools/monero-tools.js"
20
+ },
21
+ "./tools/content": {
22
+ "types": "./dist/tools/content.d.ts",
23
+ "import": "./dist/tools/content.js"
20
24
  }
21
25
  },
26
+ "browser": {
27
+ "./dist/actionlog/backend/sqliteBackend.js": false
28
+ },
22
29
  "files": ["dist"],
23
30
  "license": "MIT",
24
31
  "publishConfig": {