moneyos 0.3.0 → 0.3.3
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.
- package/README.md +4 -7
- package/dist/cli/index.js +25 -16
- package/dist/cli/index.js.map +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -3
- package/dist/index.d.ts +2 -3
- package/dist/index.js.map +1 -1
- package/package.json +2 -9
package/README.md
CHANGED
|
@@ -12,7 +12,6 @@ but the repo is structured so each major surface can evolve independently.
|
|
|
12
12
|
- `moneyos`: the root SDK + CLI package
|
|
13
13
|
- `@moneyos/core`: runtime interfaces, shared types, chain/token registries
|
|
14
14
|
- `@moneyos/tool-swap`: swap execution tool and provider surface
|
|
15
|
-
- `@moneyos/executor-particle`: Particle AA smart-account executor
|
|
16
15
|
|
|
17
16
|
## CLI
|
|
18
17
|
|
|
@@ -66,10 +65,10 @@ plug in.
|
|
|
66
65
|
|
|
67
66
|
## Published npm package
|
|
68
67
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
`moneyos` is published on npm. `npm install moneyos` and `npx moneyos` give
|
|
69
|
+
you the latest tagged release, not unreleased commits on `main`. If you want
|
|
70
|
+
work that has not shipped in a tagged release yet, clone the repo and build
|
|
71
|
+
from source.
|
|
73
72
|
|
|
74
73
|
## Current wallet model
|
|
75
74
|
|
|
@@ -186,7 +185,6 @@ What still needs more hands-on validation:
|
|
|
186
185
|
- live session-backed ETH send
|
|
187
186
|
- live session-backed ERC-20 send
|
|
188
187
|
- live session-backed swap
|
|
189
|
-
- Particle executor against real infrastructure
|
|
190
188
|
- more live usage of the encrypted-wallet/auth/backup flow in a real terminal
|
|
191
189
|
|
|
192
190
|
## Development
|
|
@@ -195,7 +193,6 @@ What still needs more hands-on validation:
|
|
|
195
193
|
npm install
|
|
196
194
|
npm run build:core
|
|
197
195
|
npm run build:tool-swap
|
|
198
|
-
npm run build:executor-particle
|
|
199
196
|
npm run typecheck
|
|
200
197
|
npm test
|
|
201
198
|
npm run lint
|
package/dist/cli/index.js
CHANGED
|
@@ -486,7 +486,7 @@ async function promptHidden(question) {
|
|
|
486
486
|
"This action requires a local terminal. Run it directly in your terminal, not through a non-interactive agent session."
|
|
487
487
|
);
|
|
488
488
|
}
|
|
489
|
-
return new Promise((
|
|
489
|
+
return new Promise((resolve3, reject) => {
|
|
490
490
|
const stdin = process.stdin;
|
|
491
491
|
const stdout = process.stdout;
|
|
492
492
|
let value = "";
|
|
@@ -504,7 +504,7 @@ async function promptHidden(question) {
|
|
|
504
504
|
reject(error);
|
|
505
505
|
return;
|
|
506
506
|
}
|
|
507
|
-
|
|
507
|
+
resolve3(result ?? "");
|
|
508
508
|
};
|
|
509
509
|
const onData = (chunk) => {
|
|
510
510
|
const text = chunk.toString("utf8");
|
|
@@ -836,7 +836,7 @@ async function waitForSessionShutdown(socketPath, tokenPath, timeoutMs = SESSION
|
|
|
836
836
|
"Timed out waiting for the previous MoneyOS session to shut down cleanly."
|
|
837
837
|
);
|
|
838
838
|
}
|
|
839
|
-
await new Promise((
|
|
839
|
+
await new Promise((resolve3) => setTimeout(resolve3, 25));
|
|
840
840
|
}
|
|
841
841
|
}
|
|
842
842
|
function tokensMatch(expectedToken, receivedToken) {
|
|
@@ -845,7 +845,7 @@ function tokensMatch(expectedToken, receivedToken) {
|
|
|
845
845
|
return expected.length === received.length && timingSafeEqual(expected, received);
|
|
846
846
|
}
|
|
847
847
|
function readLine(socket) {
|
|
848
|
-
return new Promise((
|
|
848
|
+
return new Promise((resolve3, reject) => {
|
|
849
849
|
let buffer = "";
|
|
850
850
|
const onData = (chunk) => {
|
|
851
851
|
buffer += chunk.toString("utf8");
|
|
@@ -857,7 +857,7 @@ function readLine(socket) {
|
|
|
857
857
|
const index = buffer.indexOf("\n");
|
|
858
858
|
if (index >= 0) {
|
|
859
859
|
cleanup();
|
|
860
|
-
|
|
860
|
+
resolve3(buffer.slice(0, index));
|
|
861
861
|
}
|
|
862
862
|
};
|
|
863
863
|
const onError = (error) => {
|
|
@@ -884,7 +884,7 @@ async function sendSessionRequest(socketPath, tokenPath, request, timeoutMs = SE
|
|
|
884
884
|
token: loadSessionToken(tokenPath)
|
|
885
885
|
};
|
|
886
886
|
const socket = net.createConnection(socketPath);
|
|
887
|
-
return new Promise((
|
|
887
|
+
return new Promise((resolve3, reject) => {
|
|
888
888
|
let settled = false;
|
|
889
889
|
const timer = setTimeout(() => {
|
|
890
890
|
settled = true;
|
|
@@ -902,7 +902,7 @@ async function sendSessionRequest(socketPath, tokenPath, request, timeoutMs = SE
|
|
|
902
902
|
settled = true;
|
|
903
903
|
cleanup();
|
|
904
904
|
socket.end();
|
|
905
|
-
|
|
905
|
+
resolve3(JSON.parse(line));
|
|
906
906
|
} catch (error) {
|
|
907
907
|
settled = true;
|
|
908
908
|
cleanup();
|
|
@@ -1015,12 +1015,12 @@ async function startSessionServer(start, hooks = {}) {
|
|
|
1015
1015
|
const close = async () => {
|
|
1016
1016
|
if (closed) return;
|
|
1017
1017
|
closed = true;
|
|
1018
|
-
await new Promise((
|
|
1018
|
+
await new Promise((resolve3) => {
|
|
1019
1019
|
server.close(() => {
|
|
1020
1020
|
removeFileIfPresent(start.socketPath);
|
|
1021
1021
|
removeFileIfPresent(start.tokenPath);
|
|
1022
1022
|
hooks.onExit?.();
|
|
1023
|
-
|
|
1023
|
+
resolve3();
|
|
1024
1024
|
});
|
|
1025
1025
|
});
|
|
1026
1026
|
};
|
|
@@ -1120,7 +1120,7 @@ async function startSessionServer(start, hooks = {}) {
|
|
|
1120
1120
|
}
|
|
1121
1121
|
});
|
|
1122
1122
|
});
|
|
1123
|
-
await new Promise((
|
|
1123
|
+
await new Promise((resolve3, reject) => {
|
|
1124
1124
|
server.once("error", (error) => {
|
|
1125
1125
|
hooks.onError?.(error instanceof Error ? error : new Error(String(error)));
|
|
1126
1126
|
reject(error);
|
|
@@ -1129,7 +1129,7 @@ async function startSessionServer(start, hooks = {}) {
|
|
|
1129
1129
|
if (!isWindowsPipe(start.socketPath)) {
|
|
1130
1130
|
chmodSync2(start.socketPath, SECURE_FILE_MODE2);
|
|
1131
1131
|
}
|
|
1132
|
-
|
|
1132
|
+
resolve3();
|
|
1133
1133
|
});
|
|
1134
1134
|
});
|
|
1135
1135
|
const timer = setTimeout(() => {
|
|
@@ -1158,7 +1158,7 @@ async function startDetachedSessionDaemon(params) {
|
|
|
1158
1158
|
removeFileIfPresent(params.socketPath);
|
|
1159
1159
|
removeFileIfPresent(params.tokenPath);
|
|
1160
1160
|
}
|
|
1161
|
-
return new Promise((
|
|
1161
|
+
return new Promise((resolve3, reject) => {
|
|
1162
1162
|
const child = spawn(
|
|
1163
1163
|
process.execPath,
|
|
1164
1164
|
[...process.execArgv, process.argv[1], "__session-daemon"],
|
|
@@ -1176,7 +1176,7 @@ async function startDetachedSessionDaemon(params) {
|
|
|
1176
1176
|
reject(error);
|
|
1177
1177
|
return;
|
|
1178
1178
|
}
|
|
1179
|
-
|
|
1179
|
+
resolve3(status);
|
|
1180
1180
|
};
|
|
1181
1181
|
child.once("error", (error) => finish(error));
|
|
1182
1182
|
child.once("exit", (code) => {
|
|
@@ -1208,7 +1208,7 @@ async function runSessionDaemonProcess() {
|
|
|
1208
1208
|
if (!process.send) {
|
|
1209
1209
|
throw new Error("Session daemon must be started through MoneyOS.");
|
|
1210
1210
|
}
|
|
1211
|
-
const start = await new Promise((
|
|
1211
|
+
const start = await new Promise((resolve3, reject) => {
|
|
1212
1212
|
const timeout = setTimeout(() => {
|
|
1213
1213
|
reject(new Error("Session daemon did not receive startup parameters."));
|
|
1214
1214
|
}, 1e3);
|
|
@@ -1219,7 +1219,7 @@ async function runSessionDaemonProcess() {
|
|
|
1219
1219
|
reject(new Error("Session daemon received invalid startup message."));
|
|
1220
1220
|
return;
|
|
1221
1221
|
}
|
|
1222
|
-
|
|
1222
|
+
resolve3(payload);
|
|
1223
1223
|
});
|
|
1224
1224
|
});
|
|
1225
1225
|
const shutdown = (code = 0) => {
|
|
@@ -2141,7 +2141,16 @@ backupCommand.command("status").description("Show the local wallet backup status
|
|
|
2141
2141
|
});
|
|
2142
2142
|
|
|
2143
2143
|
// src/cli/version.ts
|
|
2144
|
-
|
|
2144
|
+
import { readFileSync as readFileSync4 } from "fs";
|
|
2145
|
+
import { fileURLToPath } from "url";
|
|
2146
|
+
import { dirname as dirname4, resolve as resolve2 } from "path";
|
|
2147
|
+
var packageJsonPath = resolve2(
|
|
2148
|
+
dirname4(fileURLToPath(import.meta.url)),
|
|
2149
|
+
"../../package.json"
|
|
2150
|
+
);
|
|
2151
|
+
var version = JSON.parse(
|
|
2152
|
+
readFileSync4(packageJsonPath, "utf8")
|
|
2153
|
+
).version;
|
|
2145
2154
|
|
|
2146
2155
|
// src/cli/index.ts
|
|
2147
2156
|
var program = new Command8();
|