stelagent 0.0.3 → 0.0.4
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/dist/index.mjs +5 -4
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -201,7 +201,7 @@ function formatError(e) {
|
|
|
201
201
|
if (e instanceof Error) return e.message;
|
|
202
202
|
return String(e);
|
|
203
203
|
}
|
|
204
|
-
async function runApp(command, fn, format = "json") {
|
|
204
|
+
async function runApp(command, fn, format = "json", options) {
|
|
205
205
|
const start = Date.now();
|
|
206
206
|
try {
|
|
207
207
|
const result = await fn();
|
|
@@ -210,6 +210,7 @@ async function runApp(command, fn, format = "json") {
|
|
|
210
210
|
ok: true,
|
|
211
211
|
durationMs: Date.now() - start
|
|
212
212
|
});
|
|
213
|
+
if (!options?.silent) printResult(Result.ok(result), format);
|
|
213
214
|
return result;
|
|
214
215
|
} catch (e) {
|
|
215
216
|
writeAuditEntry({
|
|
@@ -1666,7 +1667,7 @@ const monitorTransactions = defineCommand({
|
|
|
1666
1667
|
error: `Stream error: ${message}`
|
|
1667
1668
|
}));
|
|
1668
1669
|
});
|
|
1669
|
-
}, format);
|
|
1670
|
+
}, format, { silent: true });
|
|
1670
1671
|
} catch (e) {
|
|
1671
1672
|
const message = e instanceof Error ? e.message : String(e);
|
|
1672
1673
|
printResult(Result.err(`Failed to stream transactions: ${message}`), "json");
|
|
@@ -1743,7 +1744,7 @@ const monitorPayments = defineCommand({
|
|
|
1743
1744
|
error: `Stream error: ${message}`
|
|
1744
1745
|
}));
|
|
1745
1746
|
});
|
|
1746
|
-
}, format);
|
|
1747
|
+
}, format, { silent: true });
|
|
1747
1748
|
} catch (e) {
|
|
1748
1749
|
const message = e instanceof Error ? e.message : String(e);
|
|
1749
1750
|
printResult(Result.err(`Failed to stream payments: ${message}`), "json");
|
|
@@ -1830,7 +1831,7 @@ const monitorCommand = defineCommand({
|
|
|
1830
1831
|
error: `Stream error: ${message}`
|
|
1831
1832
|
}));
|
|
1832
1833
|
});
|
|
1833
|
-
}, format);
|
|
1834
|
+
}, format, { silent: true });
|
|
1834
1835
|
} catch (e) {
|
|
1835
1836
|
const message = e instanceof Error ? e.message : String(e);
|
|
1836
1837
|
printResult(Result.err(`Failed to stream effects: ${message}`), "json");
|