everything-dev 1.26.1 → 1.28.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 (166) hide show
  1. package/dist/api-contract.cjs.map +1 -1
  2. package/dist/api-contract.mjs.map +1 -1
  3. package/dist/cli/catalog.cjs.map +1 -1
  4. package/dist/cli/catalog.mjs.map +1 -1
  5. package/dist/cli/framework-version.cjs.map +1 -1
  6. package/dist/cli/framework-version.mjs.map +1 -1
  7. package/dist/cli/infra.cjs +1 -1
  8. package/dist/cli/infra.cjs.map +1 -1
  9. package/dist/cli/infra.mjs +1 -1
  10. package/dist/cli/infra.mjs.map +1 -1
  11. package/dist/cli/init.cjs +127 -121
  12. package/dist/cli/init.cjs.map +1 -1
  13. package/dist/cli/init.d.cts +6 -6
  14. package/dist/cli/init.d.cts.map +1 -1
  15. package/dist/cli/init.d.mts +6 -6
  16. package/dist/cli/init.d.mts.map +1 -1
  17. package/dist/cli/init.mjs +125 -121
  18. package/dist/cli/init.mjs.map +1 -1
  19. package/dist/cli/parse.cjs.map +1 -1
  20. package/dist/cli/parse.mjs.map +1 -1
  21. package/dist/cli/prompts.cjs +29 -25
  22. package/dist/cli/prompts.cjs.map +1 -1
  23. package/dist/cli/prompts.mjs +28 -25
  24. package/dist/cli/prompts.mjs.map +1 -1
  25. package/dist/cli/status.cjs.map +1 -1
  26. package/dist/cli/status.mjs.map +1 -1
  27. package/dist/cli/sync.cjs +46 -93
  28. package/dist/cli/sync.cjs.map +1 -1
  29. package/dist/cli/sync.mjs +49 -96
  30. package/dist/cli/sync.mjs.map +1 -1
  31. package/dist/cli/timing.cjs.map +1 -1
  32. package/dist/cli/timing.mjs.map +1 -1
  33. package/dist/cli/upgrade.cjs +41 -20
  34. package/dist/cli/upgrade.cjs.map +1 -1
  35. package/dist/cli/upgrade.mjs +43 -22
  36. package/dist/cli/upgrade.mjs.map +1 -1
  37. package/dist/cli.cjs +187 -12
  38. package/dist/cli.cjs.map +1 -1
  39. package/dist/cli.mjs +187 -12
  40. package/dist/cli.mjs.map +1 -1
  41. package/dist/components/dev-view.cjs.map +1 -1
  42. package/dist/components/dev-view.mjs.map +1 -1
  43. package/dist/components/streaming-view.cjs.map +1 -1
  44. package/dist/components/streaming-view.mjs.map +1 -1
  45. package/dist/config.cjs.map +1 -1
  46. package/dist/config.mjs.map +1 -1
  47. package/dist/contract.cjs +174 -173
  48. package/dist/contract.cjs.map +1 -1
  49. package/dist/contract.d.cts +48 -44
  50. package/dist/contract.d.cts.map +1 -1
  51. package/dist/contract.d.mts +48 -44
  52. package/dist/contract.d.mts.map +1 -1
  53. package/dist/contract.mjs +3 -1
  54. package/dist/contract.mjs.map +1 -1
  55. package/dist/dev-logs.cjs.map +1 -1
  56. package/dist/dev-logs.mjs.map +1 -1
  57. package/dist/dev-session.cjs +0 -1
  58. package/dist/dev-session.mjs +1 -1
  59. package/dist/fastkv.cjs.map +1 -1
  60. package/dist/fastkv.mjs.map +1 -1
  61. package/dist/index.cjs +2 -4
  62. package/dist/index.d.cts +3 -3
  63. package/dist/index.d.mts +3 -3
  64. package/dist/index.mjs +1 -2
  65. package/dist/integrity.cjs.map +1 -1
  66. package/dist/integrity.mjs.map +1 -1
  67. package/dist/internal/manifest-normalizer.cjs.map +1 -1
  68. package/dist/internal/manifest-normalizer.mjs.map +1 -1
  69. package/dist/merge.cjs.map +1 -1
  70. package/dist/merge.mjs.map +1 -1
  71. package/dist/near-cli.cjs +1 -1
  72. package/dist/near-cli.cjs.map +1 -1
  73. package/dist/near-cli.mjs +1 -1
  74. package/dist/near-cli.mjs.map +1 -1
  75. package/dist/orchestrator.cjs +1 -1
  76. package/dist/orchestrator.cjs.map +1 -1
  77. package/dist/orchestrator.mjs +1 -1
  78. package/dist/orchestrator.mjs.map +1 -1
  79. package/dist/plugin.cjs +182 -171
  80. package/dist/plugin.cjs.map +1 -1
  81. package/dist/plugin.d.cts +72 -39
  82. package/dist/plugin.d.cts.map +1 -1
  83. package/dist/plugin.d.mts +71 -39
  84. package/dist/plugin.d.mts.map +1 -1
  85. package/dist/plugin.mjs +170 -160
  86. package/dist/plugin.mjs.map +1 -1
  87. package/dist/sdk.cjs +2 -2
  88. package/dist/sdk.d.cts +1 -1
  89. package/dist/sdk.d.mts +1 -1
  90. package/dist/sdk.mjs +1 -1
  91. package/dist/service-descriptor.d.cts +34 -0
  92. package/dist/service-descriptor.d.cts.map +1 -0
  93. package/dist/service-descriptor.d.mts +36 -0
  94. package/dist/service-descriptor.d.mts.map +1 -0
  95. package/dist/shared.cjs.map +1 -1
  96. package/dist/shared.mjs.map +1 -1
  97. package/dist/types.cjs +184 -184
  98. package/dist/types.cjs.map +1 -1
  99. package/dist/types.d.cts +5 -5
  100. package/dist/types.d.mts +5 -5
  101. package/dist/types.mjs +1 -1
  102. package/dist/types.mjs.map +1 -1
  103. package/dist/ui/types.d.cts +1 -0
  104. package/dist/ui/types.d.cts.map +1 -1
  105. package/dist/ui/types.d.mts +1 -0
  106. package/dist/ui/types.d.mts.map +1 -1
  107. package/dist/utils/banner.cjs.map +1 -1
  108. package/dist/utils/banner.mjs.map +1 -1
  109. package/dist/utils/run.cjs.map +1 -1
  110. package/dist/utils/run.mjs.map +1 -1
  111. package/package.json +3 -3
  112. package/skills/init-upgrade/SKILL.md +22 -16
  113. package/skills/publish-sync/SKILL.md +7 -18
  114. package/dist/utils/path-match.cjs +0 -18
  115. package/dist/utils/path-match.cjs.map +0 -1
  116. package/dist/utils/path-match.mjs +0 -17
  117. package/dist/utils/path-match.mjs.map +0 -1
  118. package/src/api-contract.ts +0 -623
  119. package/src/app.ts +0 -193
  120. package/src/cli/catalog.ts +0 -49
  121. package/src/cli/framework-version.ts +0 -61
  122. package/src/cli/help.ts +0 -13
  123. package/src/cli/infra.ts +0 -190
  124. package/src/cli/init.ts +0 -1202
  125. package/src/cli/parse.ts +0 -147
  126. package/src/cli/prompts.ts +0 -135
  127. package/src/cli/snapshot.ts +0 -46
  128. package/src/cli/status.ts +0 -99
  129. package/src/cli/sync.ts +0 -518
  130. package/src/cli/timing.ts +0 -63
  131. package/src/cli/upgrade.ts +0 -828
  132. package/src/cli.ts +0 -516
  133. package/src/components/dev-view.tsx +0 -352
  134. package/src/components/streaming-view.ts +0 -177
  135. package/src/config.ts +0 -893
  136. package/src/contract.meta.ts +0 -140
  137. package/src/contract.ts +0 -325
  138. package/src/dev-logs.ts +0 -92
  139. package/src/dev-session.ts +0 -283
  140. package/src/fastkv.ts +0 -181
  141. package/src/index.ts +0 -8
  142. package/src/integrity.ts +0 -138
  143. package/src/internal/manifest-normalizer.ts +0 -290
  144. package/src/merge.ts +0 -187
  145. package/src/mf.ts +0 -147
  146. package/src/near-cli.ts +0 -259
  147. package/src/network.ts +0 -3
  148. package/src/orchestrator.ts +0 -493
  149. package/src/plugin.ts +0 -1821
  150. package/src/sdk.ts +0 -14
  151. package/src/service-descriptor.ts +0 -281
  152. package/src/shared.ts +0 -249
  153. package/src/sidebar.ts +0 -140
  154. package/src/types.ts +0 -330
  155. package/src/ui/head.ts +0 -83
  156. package/src/ui/index.ts +0 -5
  157. package/src/ui/metadata.ts +0 -95
  158. package/src/ui/router.ts +0 -88
  159. package/src/ui/runtime.ts +0 -42
  160. package/src/ui/types.ts +0 -64
  161. package/src/utils/banner.ts +0 -21
  162. package/src/utils/linkify.ts +0 -11
  163. package/src/utils/path-match.ts +0 -16
  164. package/src/utils/run.ts +0 -31
  165. package/src/utils/save-config.ts +0 -20
  166. package/src/utils/theme.ts +0 -39
package/src/near-cli.ts DELETED
@@ -1,259 +0,0 @@
1
- import { generateKeyPairSync } from "node:crypto";
2
- import { Effect } from "effect";
3
- import { execa } from "execa";
4
-
5
- export interface NearTransactionConfig {
6
- account: string;
7
- contract: string;
8
- method: string;
9
- argsBase64: string;
10
- network?: "mainnet" | "testnet";
11
- privateKey?: string;
12
- gas?: string;
13
- deposit?: string;
14
- }
15
-
16
- export interface NearTransactionResult {
17
- success: boolean;
18
- txHash?: string;
19
- error?: string;
20
- }
21
-
22
- export interface NearKeyPair {
23
- publicKey: string;
24
- privateKey: string;
25
- }
26
-
27
- export interface FunctionCallAccessKeyConfig {
28
- account: string;
29
- contract: string;
30
- allowance: string;
31
- functionNames: string[];
32
- network?: "mainnet" | "testnet";
33
- }
34
-
35
- const NEAR_CLI_VERSION = "0.23.5";
36
- const INSTALLER_URL = `https://github.com/near/near-cli-rs/releases/download/v${NEAR_CLI_VERSION}/near-cli-rs-installer.sh`;
37
- const BASE58_ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
38
-
39
- export class NearCliNotFoundError extends Error {
40
- readonly _tag = "NearCliNotFoundError";
41
- constructor() {
42
- super("NEAR CLI not found");
43
- }
44
- }
45
-
46
- export class NearCliInstallError extends Error {
47
- readonly _tag = "NearCliInstallError";
48
- constructor(message: string) {
49
- super(`Failed to install NEAR CLI: ${message}`);
50
- }
51
- }
52
-
53
- export class NearTransactionError extends Error {
54
- readonly _tag = "NearTransactionError";
55
- }
56
-
57
- function base64UrlToBytes(input: string): Uint8Array {
58
- const normalized = input.replace(/-/g, "+").replace(/_/g, "/");
59
- return new Uint8Array(Buffer.from(normalized, "base64"));
60
- }
61
-
62
- function base58Encode(input: Uint8Array): string {
63
- if (input.length === 0) return "";
64
-
65
- const digits: number[] = [0];
66
- for (const byte of input) {
67
- let carry = byte;
68
- for (let i = 0; i < digits.length; i++) {
69
- carry += digits[i]! << 8;
70
- digits[i] = carry % 58;
71
- carry = Math.floor(carry / 58);
72
- }
73
- while (carry > 0) {
74
- digits.push(carry % 58);
75
- carry = Math.floor(carry / 58);
76
- }
77
- }
78
-
79
- let output = "";
80
- for (const byte of input) {
81
- if (byte === 0) output += BASE58_ALPHABET[0];
82
- else break;
83
- }
84
-
85
- for (let i = digits.length - 1; i >= 0; i--) {
86
- output += BASE58_ALPHABET[digits[i]!]!;
87
- }
88
-
89
- return output;
90
- }
91
-
92
- export function generateNearKeyPair(): NearKeyPair {
93
- const { publicKey, privateKey } = generateKeyPairSync("ed25519");
94
- const publicJwk = publicKey.export({ format: "jwk" }) as JsonWebKey;
95
- const privateJwk = privateKey.export({ format: "jwk" }) as JsonWebKey;
96
-
97
- if (!publicJwk.x || !privateJwk.d) {
98
- throw new Error("Failed to generate NEAR keypair");
99
- }
100
-
101
- const publicBytes = base64UrlToBytes(publicJwk.x);
102
- const privateSeed = base64UrlToBytes(privateJwk.d);
103
- const secretBytes = new Uint8Array(privateSeed.length + publicBytes.length);
104
- secretBytes.set(privateSeed, 0);
105
- secretBytes.set(publicBytes, privateSeed.length);
106
-
107
- return {
108
- publicKey: `ed25519:${base58Encode(publicBytes)}`,
109
- privateKey: `ed25519:${base58Encode(secretBytes)}`,
110
- };
111
- }
112
-
113
- const checkNearCliInstalled = Effect.tryPromise({
114
- try: async () => {
115
- try {
116
- await execa("near", ["--version"], { stdio: "pipe" });
117
- return true;
118
- } catch {
119
- return false;
120
- }
121
- },
122
- catch: () => new Error("Failed to check NEAR CLI"),
123
- });
124
-
125
- const installNearCli = Effect.tryPromise({
126
- try: async () => {
127
- await execa("sh", ["-c", `curl --proto '=https' --tlsv1.2 -LsSf ${INSTALLER_URL} | sh`], {
128
- stdio: "inherit",
129
- });
130
- },
131
- catch: (error) => {
132
- if (error instanceof Error && "exitCode" in error) {
133
- return new NearCliInstallError(
134
- `Installer exited with code ${(error as { exitCode: number }).exitCode}`,
135
- );
136
- }
137
- return new NearCliInstallError(error instanceof Error ? error.message : String(error));
138
- },
139
- });
140
-
141
- async function runNearCommand(args: string[]): Promise<void> {
142
- await execa("near", args, { stdio: "inherit" });
143
- }
144
-
145
- export const ensureNearCli = Effect.gen(function* () {
146
- const isInstalled = yield* checkNearCliInstalled;
147
- if (isInstalled) return;
148
-
149
- if (process.env.BOS_INSTALL_NEAR_CLI === "true") {
150
- yield* installNearCli;
151
- return;
152
- }
153
-
154
- console.log();
155
- console.log(" NEAR CLI not found");
156
-
157
- console.log();
158
- console.log(` To install manually: curl --proto '=https' --tlsv1.2 -LsSf ${INSTALLER_URL} | sh`);
159
- console.log();
160
- yield* Effect.fail(new NearCliNotFoundError());
161
- });
162
-
163
- export const executeTransaction = (
164
- config: NearTransactionConfig,
165
- ): Effect.Effect<NearTransactionResult, Error> =>
166
- Effect.gen(function* () {
167
- const gas = (config.gas || "300Tgas").replace(/\s+/g, "");
168
- const deposit = (config.deposit || "0NEAR").replace(/\s+/g, "");
169
- const network = config.network || (config.account.endsWith(".testnet") ? "testnet" : "mainnet");
170
-
171
- const args = [
172
- "contract",
173
- "call-function",
174
- "as-transaction",
175
- config.contract,
176
- config.method,
177
- "base64-args",
178
- config.argsBase64,
179
- "prepaid-gas",
180
- gas,
181
- "attached-deposit",
182
- deposit,
183
- "sign-as",
184
- config.account,
185
- "network-config",
186
- network,
187
- ];
188
-
189
- if (config.privateKey) {
190
- args.push("sign-with-plaintext-private-key", config.privateKey, "send");
191
- } else {
192
- args.push("sign-with-keychain", "send");
193
- }
194
-
195
- const output = yield* Effect.tryPromise({
196
- try: async () => {
197
- const result = await execa("near", args, {
198
- stdin: "inherit",
199
- stdout: "pipe",
200
- stderr: "pipe",
201
- reject: false,
202
- });
203
-
204
- process.stdout.write(result.stdout);
205
- const combined = `${result.stdout}\n${result.stderr}`;
206
- const txHashMatch = combined.match(/Transaction ID:\s*([A-Za-z0-9]+)/i);
207
- const hasCodeDoesNotExist = /CodeDoesNotExist/i.test(combined);
208
- const hasTransactionFailed = /Transaction failed/i.test(combined);
209
- const softSuccess =
210
- Boolean(txHashMatch?.[1]) && hasCodeDoesNotExist && hasTransactionFailed;
211
-
212
- if (result.exitCode === 0 || softSuccess) {
213
- if (softSuccess) {
214
- console.log(` ${txHashMatch?.[1]} — FastDATA CodeDoesNotExist (expected)`);
215
- }
216
- return combined;
217
- }
218
-
219
- throw new NearTransactionError(
220
- result.stderr || `Transaction failed with code ${result.exitCode}`,
221
- );
222
- },
223
- catch: (error) => error as Error,
224
- });
225
-
226
- const txHashMatch = output.match(/Transaction ID:\s*([A-Za-z0-9]+)/i);
227
-
228
- return {
229
- success: true,
230
- txHash: txHashMatch?.[1],
231
- };
232
- });
233
-
234
- export async function addFunctionCallAccessKey(
235
- config: FunctionCallAccessKeyConfig,
236
- ): Promise<NearKeyPair> {
237
- const keyPair = generateNearKeyPair();
238
- const args = [
239
- "account",
240
- "add-key",
241
- config.account,
242
- "grant-function-call-access",
243
- "--allowance",
244
- config.allowance,
245
- "--contract-account-id",
246
- config.contract,
247
- "--function-names",
248
- config.functionNames.join(", "),
249
- "use-manually-provided-public-key",
250
- keyPair.publicKey,
251
- "network-config",
252
- config.network || (config.account.endsWith(".testnet") ? "testnet" : "mainnet"),
253
- "sign-with-keychain",
254
- "send",
255
- ];
256
-
257
- await runNearCommand(args);
258
- return keyPair;
259
- }
package/src/network.ts DELETED
@@ -1,3 +0,0 @@
1
- export function getNetworkIdForAccount(account: string): "mainnet" | "testnet" {
2
- return account.endsWith(".testnet") ? "testnet" : "mainnet";
3
- }