@run402/sdk 4.97.0 → 4.99.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 (138) hide show
  1. package/README.md +2 -2
  2. package/core-dist/binding-file.d.ts +14 -0
  3. package/core-dist/binding-file.js +28 -1
  4. package/core-dist/wallet.js +3 -3
  5. package/dist/errors.d.ts +24 -2
  6. package/dist/errors.d.ts.map +1 -1
  7. package/dist/errors.js +44 -2
  8. package/dist/errors.js.map +1 -1
  9. package/dist/index.d.ts +18 -3
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +12 -1
  12. package/dist/index.js.map +1 -1
  13. package/dist/kernel.d.ts +34 -0
  14. package/dist/kernel.d.ts.map +1 -1
  15. package/dist/kernel.js +15 -1
  16. package/dist/kernel.js.map +1 -1
  17. package/dist/namespaces/admin.d.ts.map +1 -1
  18. package/dist/namespaces/admin.js +8 -0
  19. package/dist/namespaces/admin.js.map +1 -1
  20. package/dist/namespaces/agent.d.ts +2 -2
  21. package/dist/namespaces/agent.d.ts.map +1 -1
  22. package/dist/namespaces/agent.js +4 -0
  23. package/dist/namespaces/agent.js.map +1 -1
  24. package/dist/namespaces/agent.types.d.ts +5 -0
  25. package/dist/namespaces/agent.types.d.ts.map +1 -1
  26. package/dist/namespaces/apps.d.ts.map +1 -1
  27. package/dist/namespaces/apps.js +2 -0
  28. package/dist/namespaces/apps.js.map +1 -1
  29. package/dist/namespaces/auth.d.ts.map +1 -1
  30. package/dist/namespaces/auth.js +9 -0
  31. package/dist/namespaces/auth.js.map +1 -1
  32. package/dist/namespaces/branches.d.ts.map +1 -1
  33. package/dist/namespaces/branches.js +2 -0
  34. package/dist/namespaces/branches.js.map +1 -1
  35. package/dist/namespaces/ci.d.ts.map +1 -1
  36. package/dist/namespaces/ci.js +2 -0
  37. package/dist/namespaces/ci.js.map +1 -1
  38. package/dist/namespaces/credentials.d.ts +0 -23
  39. package/dist/namespaces/credentials.d.ts.map +1 -1
  40. package/dist/namespaces/credentials.js +29 -0
  41. package/dist/namespaces/credentials.js.map +1 -1
  42. package/dist/namespaces/escalations.d.ts.map +1 -1
  43. package/dist/namespaces/escalations.js +2 -0
  44. package/dist/namespaces/escalations.js.map +1 -1
  45. package/dist/namespaces/grants.d.ts.map +1 -1
  46. package/dist/namespaces/grants.js +4 -0
  47. package/dist/namespaces/grants.js.map +1 -1
  48. package/dist/namespaces/live.d.ts +0 -16
  49. package/dist/namespaces/live.d.ts.map +1 -1
  50. package/dist/namespaces/live.js +19 -0
  51. package/dist/namespaces/live.js.map +1 -1
  52. package/dist/namespaces/me.d.ts.map +1 -1
  53. package/dist/namespaces/me.js +3 -0
  54. package/dist/namespaces/me.js.map +1 -1
  55. package/dist/namespaces/org.d.ts.map +1 -1
  56. package/dist/namespaces/org.js +3 -0
  57. package/dist/namespaces/org.js.map +1 -1
  58. package/dist/namespaces/projects.d.ts.map +1 -1
  59. package/dist/namespaces/projects.js +5 -0
  60. package/dist/namespaces/projects.js.map +1 -1
  61. package/dist/namespaces/repos.d.ts.map +1 -1
  62. package/dist/namespaces/repos.js +5 -0
  63. package/dist/namespaces/repos.js.map +1 -1
  64. package/dist/namespaces/rooms.d.ts.map +1 -1
  65. package/dist/namespaces/rooms.js +3 -0
  66. package/dist/namespaces/rooms.js.map +1 -1
  67. package/dist/namespaces/session.d.ts.map +1 -1
  68. package/dist/namespaces/session.js +18 -0
  69. package/dist/namespaces/session.js.map +1 -1
  70. package/dist/namespaces/transfers.d.ts.map +1 -1
  71. package/dist/namespaces/transfers.js +3 -0
  72. package/dist/namespaces/transfers.js.map +1 -1
  73. package/dist/namespaces/wallets.d.ts.map +1 -1
  74. package/dist/namespaces/wallets.js +2 -0
  75. package/dist/namespaces/wallets.js.map +1 -1
  76. package/dist/namespaces/write-approval.d.ts.map +1 -1
  77. package/dist/namespaces/write-approval.js +3 -0
  78. package/dist/namespaces/write-approval.js.map +1 -1
  79. package/dist/node/actions-node.d.ts.map +1 -1
  80. package/dist/node/actions-node.js +3 -0
  81. package/dist/node/actions-node.js.map +1 -1
  82. package/dist/node/buzz-doctor-contract.d.ts +155 -0
  83. package/dist/node/buzz-doctor-contract.d.ts.map +1 -0
  84. package/dist/node/buzz-doctor-contract.js +385 -0
  85. package/dist/node/buzz-doctor-contract.js.map +1 -0
  86. package/dist/node/buzz-doctor.d.ts +155 -0
  87. package/dist/node/buzz-doctor.d.ts.map +1 -0
  88. package/dist/node/buzz-doctor.js +810 -0
  89. package/dist/node/buzz-doctor.js.map +1 -0
  90. package/dist/node/credentials.d.ts +9 -4
  91. package/dist/node/credentials.d.ts.map +1 -1
  92. package/dist/node/credentials.js +1 -1
  93. package/dist/node/credentials.js.map +1 -1
  94. package/dist/node/diagnostics.d.ts +45 -0
  95. package/dist/node/diagnostics.d.ts.map +1 -0
  96. package/dist/node/diagnostics.js +67 -0
  97. package/dist/node/diagnostics.js.map +1 -0
  98. package/dist/node/doctor.d.ts +101 -0
  99. package/dist/node/doctor.d.ts.map +1 -0
  100. package/dist/node/doctor.js +618 -0
  101. package/dist/node/doctor.js.map +1 -0
  102. package/dist/node/index.d.ts +57 -5
  103. package/dist/node/index.d.ts.map +1 -1
  104. package/dist/node/index.js +36 -1
  105. package/dist/node/index.js.map +1 -1
  106. package/dist/node/init.d.ts +137 -0
  107. package/dist/node/init.d.ts.map +1 -0
  108. package/dist/node/init.js +507 -0
  109. package/dist/node/init.js.map +1 -0
  110. package/dist/node/lightning-wallet.d.ts +61 -0
  111. package/dist/node/lightning-wallet.d.ts.map +1 -0
  112. package/dist/node/lightning-wallet.js +126 -0
  113. package/dist/node/lightning-wallet.js.map +1 -0
  114. package/dist/node/local-actions.d.ts +23 -0
  115. package/dist/node/local-actions.d.ts.map +1 -0
  116. package/dist/node/local-actions.js +38 -0
  117. package/dist/node/local-actions.js.map +1 -0
  118. package/dist/node/org-context.d.ts +169 -0
  119. package/dist/node/org-context.d.ts.map +1 -0
  120. package/dist/node/org-context.js +403 -0
  121. package/dist/node/org-context.js.map +1 -0
  122. package/dist/node/status.d.ts +62 -0
  123. package/dist/node/status.d.ts.map +1 -0
  124. package/dist/node/status.js +132 -0
  125. package/dist/node/status.js.map +1 -0
  126. package/dist/node/vault-target.d.ts +49 -0
  127. package/dist/node/vault-target.d.ts.map +1 -0
  128. package/dist/node/vault-target.js +109 -0
  129. package/dist/node/vault-target.js.map +1 -0
  130. package/dist/node/wallets.d.ts +242 -0
  131. package/dist/node/wallets.d.ts.map +1 -0
  132. package/dist/node/wallets.js +484 -0
  133. package/dist/node/wallets.js.map +1 -0
  134. package/dist/secret-gate.d.ts +377 -0
  135. package/dist/secret-gate.d.ts.map +1 -0
  136. package/dist/secret-gate.js +273 -0
  137. package/dist/secret-gate.js.map +1 -0
  138. package/package.json +2 -1
@@ -0,0 +1,155 @@
1
+ /**
2
+ * `r.buzz.doctor()` — the zero-mutation Buzz setup preflight
3
+ * (`run402.buzz-doctor.v1`), owned by the Node SDK: the managed session's
4
+ * shell and Node runtime, the Run402 CLI, the managed Buzz CLI sidecar and
5
+ * its capabilities, the public agent identity, the Run402 API and console
6
+ * origins (measured with `r.diagnostics.probeOrigin`), the Buzz relay (a
7
+ * DNS-pinned NIP-11 read), and the explicit wallet profile. Every check's
8
+ * status is `ok | warning | blocked`; a blocked or warning check carries
9
+ * exactly one repair action from the frozen matrix below.
10
+ *
11
+ * `run402 doctor --buzz` is a shim over this. The Run402 CLI facts (its
12
+ * version, how it was installed, whether it is current) are the calling
13
+ * program's own, supplied as hooks; without them the `run402_cli` check
14
+ * reports the CLI unavailable.
15
+ */
16
+ import { Buzz } from "../namespaces/buzz.js";
17
+ import type { Client } from "../kernel.js";
18
+ import { Diagnostics, type OriginProbeResult } from "./diagnostics.js";
19
+ export declare const BUZZ_DOCTOR_TIMEOUT_MS = 3000;
20
+ export declare const BUZZ_DOCTOR_MAX_RESPONSE_BYTES: number;
21
+ export declare const BUZZ_DOCTOR_MIN_NODE_MAJOR = 22;
22
+ export declare const BUZZ_DOCTOR_MIN_RUN402_VERSION = "4.17.2";
23
+ export declare const BUZZ_DOCTOR_REPAIR_MATRIX: Readonly<{
24
+ BUZZ_PREFLIGHT_SHELL_UNAVAILABLE: {
25
+ type: string;
26
+ surface: string;
27
+ };
28
+ BUZZ_PREFLIGHT_NODE_UNAVAILABLE: {
29
+ type: string;
30
+ surface: string;
31
+ };
32
+ BUZZ_PREFLIGHT_NODE_INCOMPATIBLE: {
33
+ type: string;
34
+ surface: string;
35
+ };
36
+ BUZZ_PREFLIGHT_RUN402_UNAVAILABLE: {
37
+ type: string;
38
+ surface: string;
39
+ };
40
+ BUZZ_PREFLIGHT_RUN402_INCOMPATIBLE: {
41
+ type: string[];
42
+ surface: string;
43
+ };
44
+ BUZZ_PREFLIGHT_RUN402_UPDATE_AVAILABLE: {
45
+ type: string;
46
+ surface: string;
47
+ };
48
+ BUZZ_PREFLIGHT_BUZZ_CLI_UNAVAILABLE: {
49
+ type: string;
50
+ surface: string;
51
+ };
52
+ BUZZ_PREFLIGHT_BUZZ_CLI_INCOMPATIBLE: {
53
+ type: string;
54
+ surface: string;
55
+ };
56
+ BUZZ_AGENT_TARGET_REQUIRED: {
57
+ type: string;
58
+ surface: string;
59
+ };
60
+ BUZZ_AGENT_TARGET_UNVERIFIED: {
61
+ type: string[];
62
+ surface: string[];
63
+ };
64
+ BUZZ_AGENT_TARGET_MISMATCH: {
65
+ type: string;
66
+ surface: string;
67
+ };
68
+ BUZZ_PREFLIGHT_API_UNREACHABLE: {
69
+ type: string;
70
+ surface: string;
71
+ };
72
+ BUZZ_PREFLIGHT_CONSOLE_UNREACHABLE: {
73
+ type: string;
74
+ surface: string;
75
+ };
76
+ BUZZ_PREFLIGHT_RELAY_UNSAFE: {
77
+ type: string;
78
+ surface: string;
79
+ };
80
+ BUZZ_PREFLIGHT_RELAY_UNREACHABLE: {
81
+ type: string[];
82
+ surface: string;
83
+ };
84
+ BUZZ_PREFLIGHT_WALLET_PROFILE_REQUIRED: {
85
+ type: string;
86
+ surface: string;
87
+ };
88
+ BUZZ_PREFLIGHT_WALLET_PROFILE_NOT_FOUND: {
89
+ type: string;
90
+ surface: string;
91
+ };
92
+ BUZZ_PREFLIGHT_WALLET_PROFILE_MISMATCH: {
93
+ type: string;
94
+ surface: string;
95
+ };
96
+ }>;
97
+ export declare function normalizeNostrSubject(value: any): string | null;
98
+ /** What the Run402 CLI knows about itself, supplied by the CLI when it runs the preflight. */
99
+ export interface BuzzDoctorRun402CliHooks {
100
+ /** The executing CLI's version. */
101
+ currentVersion: () => string;
102
+ /** How the executing CLI was installed: `{ kind, confidence, package_manager }`. */
103
+ detectInstall: (ctx: {
104
+ cwd: string;
105
+ env: Record<string, string | undefined>;
106
+ argv: string[];
107
+ execPath: string;
108
+ }) => any;
109
+ /** The CLI's own update check (a doctor check; `status: "warning"` offers an upgrade). */
110
+ updateCheck?: (opts: Record<string, unknown>) => Promise<any>;
111
+ }
112
+ export interface BuzzDoctorOptions {
113
+ /** The intended managed agent's public key, hex (see {@link normalizeNostrSubject}). */
114
+ expectedSubjectHex?: string | null;
115
+ /** The Run402 CLI's facts; absent, the `run402_cli` check reports the CLI unavailable. */
116
+ run402Cli?: BuzzDoctorRun402CliHooks;
117
+ env?: Record<string, string | undefined>;
118
+ argv?: string[];
119
+ execPath?: string;
120
+ cliExecutable?: string | null;
121
+ cwd?: string;
122
+ platform?: NodeJS.Platform;
123
+ now?: number;
124
+ runCommand?: (command: string, args: string[], options?: Record<string, unknown>) => any;
125
+ lookup?: (hostname: string, options: any) => Promise<any>;
126
+ pinnedRelayRead?: (relay: any, record: any, options: {
127
+ timeoutMs: number;
128
+ maxBytes: number;
129
+ }) => Promise<any>;
130
+ /** Measures an origin; defaults to `r.diagnostics.probeOrigin`. */
131
+ originProbe?: (url: URL, options: {
132
+ timeoutMs: number;
133
+ maxBytes: number;
134
+ }) => Promise<OriginProbeResult>;
135
+ getActiveProfile?: () => string;
136
+ profileExistsImpl?: (name: string) => boolean;
137
+ readMetaImpl?: (name: string) => any;
138
+ apiOrigin?: string;
139
+ consoleOrigin?: string;
140
+ }
141
+ export declare function buildBuzzDoctorReport({ expectedSubjectHex, run402Cli, env, argv, execPath, cliExecutable, cwd, platform, now, runCommand, lookup, pinnedRelayRead, originProbe, getActiveProfile, profileExistsImpl, readMetaImpl, apiOrigin, consoleOrigin, }?: BuzzDoctorOptions): Promise<any>;
142
+ export declare function defaultPinnedRelayRead(relay: any, record: any, { timeoutMs, maxBytes }?: any): Promise<unknown>;
143
+ export declare function isPublicAddress(address: any): boolean;
144
+ export declare function pinnedLookup(record: any, expectedHostname: any): (hostname: any, options: any, callback: any) => void;
145
+ /**
146
+ * `r.buzz` on the Node entry: the isomorphic Buzz workflows plus the
147
+ * zero-mutation setup preflight.
148
+ */
149
+ export declare class NodeBuzz extends Buzz {
150
+ #private;
151
+ constructor(client: Client, diagnostics: Diagnostics);
152
+ /** The `run402.buzz-doctor.v1` report. Read-only: nothing is created, signed, or published. */
153
+ doctor(opts?: BuzzDoctorOptions): Promise<any>;
154
+ }
155
+ //# sourceMappingURL=buzz-doctor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buzz-doctor.d.ts","sourceRoot":"","sources":["../../src/node/buzz-doctor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAcH,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAO3C,OAAO,EAAE,WAAW,EAAE,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAIvE,eAAO,MAAM,sBAAsB,OAAQ,CAAC;AAC5C,eAAO,MAAM,8BAA8B,QAAY,CAAC;AACxD,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAI7C,eAAO,MAAM,8BAA8B,WAAW,CAAC;AAKvD,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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