@miramarket/cli 1.8.0 → 1.9.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.
- package/README.md +1 -0
- package/dist/{chunk-UCB7XSQE.js → chunk-CUQEGUAG.js} +726 -264
- package/dist/{chunk-NKZGADKF.js → chunk-GVMZCXYH.js} +2 -2
- package/dist/commands/account/accept-policies.js +17 -17
- package/dist/commands/account/capital.js +7 -7
- package/dist/commands/account/policies.js +7 -7
- package/dist/commands/account/setup.js +10 -10
- package/dist/commands/account/status.js +5 -5
- package/dist/commands/account/withdraw.js +12 -12
- package/dist/commands/auth/status.js +7 -7
- package/dist/commands/balance.js +8 -8
- package/dist/commands/bridge/execute.js +9 -9
- package/dist/commands/bridge/quote.js +5 -5
- package/dist/commands/bridge/status.js +5 -5
- package/dist/commands/edit.js +5 -5
- package/dist/commands/init.js +22 -22
- package/dist/commands/login.js +7 -7
- package/dist/commands/logout.js +4 -4
- package/dist/commands/markets/list.js +5 -5
- package/dist/commands/markets/orderbook.js +5 -5
- package/dist/commands/markets/prices-history.js +6 -6
- package/dist/commands/markets/resolve.js +5 -5
- package/dist/commands/markets/search.js +5 -5
- package/dist/commands/markets/show.js +5 -5
- package/dist/commands/order/cancel.js +7 -7
- package/dist/commands/order/status.js +9 -9
- package/dist/commands/perps/history.js +5 -5
- package/dist/commands/perps/list.js +5 -5
- package/dist/commands/perps/positions.js +5 -5
- package/dist/commands/perps/show.js +5 -5
- package/dist/commands/portfolio.js +9 -9
- package/dist/commands/post.js +6 -6
- package/dist/commands/preview.js +5 -5
- package/dist/commands/schema.js +3 -3
- package/dist/commands/status.js +6 -6
- package/dist/commands/stocks/history.js +5 -5
- package/dist/commands/stocks/list.js +5 -5
- package/dist/commands/stocks/show.js +5 -5
- package/dist/commands/strategies/approval.js +5 -5
- package/dist/commands/strategies/cancel.js +6 -6
- package/dist/commands/strategies/delete.js +7 -7
- package/dist/commands/strategies/exit.js +7 -7
- package/dist/commands/strategies/generate.js +13 -13
- package/dist/commands/strategies/list.js +6 -6
- package/dist/commands/strategies/pull.js +5 -5
- package/dist/commands/strategies/rename.js +6 -6
- package/dist/commands/strategies/runs.js +7 -7
- package/dist/commands/strategies/show.js +22 -13
- package/dist/commands/strategies/update.js +7 -7
- package/dist/commands/strategies/watch.js +10 -8
- package/dist/commands/trade.js +49 -14
- package/dist/commands/update.js +8 -8
- package/dist/commands/validate.js +7 -7
- package/oclif.manifest.json +1 -1
- package/package.json +3 -3
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkCUQEGUAGjs = require('../../chunk-CUQEGUAG.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunkQGM4M3NIjs = require('../../chunk-QGM4M3NI.js');
|
|
10
10
|
|
|
11
11
|
// src/commands/perps/show.ts
|
|
12
12
|
var _core = require('@oclif/core');
|
|
13
|
-
var import_miramarket_client = _chunkQGM4M3NIjs.__toESM.call(void 0,
|
|
14
|
-
var PerpsShow = class _PerpsShow extends
|
|
13
|
+
var import_miramarket_client = _chunkQGM4M3NIjs.__toESM.call(void 0, _chunkCUQEGUAGjs.require_dist2.call(void 0, ));
|
|
14
|
+
var PerpsShow = class _PerpsShow extends _chunkCUQEGUAGjs.BaseCommand {
|
|
15
15
|
static {
|
|
16
16
|
this.description = "Show one Hyperliquid perp (main dex or HIP-3), with the exact action target to paste into a strategy.";
|
|
17
17
|
}
|
|
@@ -47,12 +47,12 @@ var PerpsShow = class _PerpsShow extends _chunkUCB7XSQEjs.BaseCommand {
|
|
|
47
47
|
}
|
|
48
48
|
async run() {
|
|
49
49
|
const { args, flags } = await this.parse(_PerpsShow);
|
|
50
|
-
const { asset, actionTarget, actionTargets, change24hPct, resolution } = await
|
|
50
|
+
const { asset, actionTarget, actionTargets, change24hPct, resolution } = await _chunkCUQEGUAGjs.withSpinner.call(void 0,
|
|
51
51
|
`Fetching ${args.coin}...`,
|
|
52
52
|
() => (0, import_miramarket_client.getPerp)(args.coin, { side: flags.side, leverage: flags.leverage }),
|
|
53
53
|
{ json: flags.json }
|
|
54
54
|
);
|
|
55
|
-
|
|
55
|
+
_chunkCUQEGUAGjs.printResult.call(void 0,
|
|
56
56
|
{
|
|
57
57
|
ok: true,
|
|
58
58
|
command: "perps show",
|
|
@@ -3,21 +3,21 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkCUQEGUAGjs = require('../chunk-CUQEGUAG.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunkQGM4M3NIjs = require('../chunk-QGM4M3NI.js');
|
|
10
10
|
|
|
11
11
|
// src/commands/portfolio.ts
|
|
12
12
|
var _core = require('@oclif/core');
|
|
13
|
-
var import_miramarket_client = _chunkQGM4M3NIjs.__toESM.call(void 0,
|
|
14
|
-
var import_miramarket_client2 = _chunkQGM4M3NIjs.__toESM.call(void 0,
|
|
15
|
-
var import_miramarket_client3 = _chunkQGM4M3NIjs.__toESM.call(void 0,
|
|
16
|
-
var import_miramarket_client4 = _chunkQGM4M3NIjs.__toESM.call(void 0,
|
|
17
|
-
var import_miramarket_client5 = _chunkQGM4M3NIjs.__toESM.call(void 0,
|
|
13
|
+
var import_miramarket_client = _chunkQGM4M3NIjs.__toESM.call(void 0, _chunkCUQEGUAGjs.require_dist2.call(void 0, ));
|
|
14
|
+
var import_miramarket_client2 = _chunkQGM4M3NIjs.__toESM.call(void 0, _chunkCUQEGUAGjs.require_dist2.call(void 0, ));
|
|
15
|
+
var import_miramarket_client3 = _chunkQGM4M3NIjs.__toESM.call(void 0, _chunkCUQEGUAGjs.require_dist2.call(void 0, ));
|
|
16
|
+
var import_miramarket_client4 = _chunkQGM4M3NIjs.__toESM.call(void 0, _chunkCUQEGUAGjs.require_dist2.call(void 0, ));
|
|
17
|
+
var import_miramarket_client5 = _chunkQGM4M3NIjs.__toESM.call(void 0, _chunkCUQEGUAGjs.require_dist2.call(void 0, ));
|
|
18
18
|
var EMPTY_POLYMARKET = { ok: true, openOrders: [], settledPositions: [] };
|
|
19
19
|
var EMPTY_STOCKS = { ok: true, positions: [], totalValueUsd: 0, unreadable: 0 };
|
|
20
|
-
var PortfolioCommand = class _PortfolioCommand extends
|
|
20
|
+
var PortfolioCommand = class _PortfolioCommand extends _chunkCUQEGUAGjs.BaseCommand {
|
|
21
21
|
static {
|
|
22
22
|
this.description = "Show wallet balances and open positions.";
|
|
23
23
|
}
|
|
@@ -37,7 +37,7 @@ var PortfolioCommand = class _PortfolioCommand extends _chunkUCB7XSQEjs.BaseComm
|
|
|
37
37
|
const client = await (0, import_miramarket_client3.getConvexClient)();
|
|
38
38
|
const wantsPolymarket = flags.venue === "all" || flags.venue === "polymarket";
|
|
39
39
|
const wantsStocks = flags.venue === "all" || flags.venue === "base-stocks";
|
|
40
|
-
const [bal, poly, stocks, summary] = await
|
|
40
|
+
const [bal, poly, stocks, summary] = await _chunkCUQEGUAGjs.withSpinner.call(void 0,
|
|
41
41
|
"Fetching portfolio...",
|
|
42
42
|
() => Promise.all([
|
|
43
43
|
(0, import_miramarket_client.getWalletBalance)(),
|
|
@@ -54,7 +54,7 @@ var PortfolioCommand = class _PortfolioCommand extends _chunkUCB7XSQEjs.BaseComm
|
|
|
54
54
|
]),
|
|
55
55
|
{ json: flags.json }
|
|
56
56
|
);
|
|
57
|
-
|
|
57
|
+
_chunkCUQEGUAGjs.printResult.call(void 0,
|
|
58
58
|
{
|
|
59
59
|
ok: true,
|
|
60
60
|
command: "portfolio",
|
package/dist/commands/post.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkGVMZCXYHjs = require('../chunk-GVMZCXYH.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkCUQEGUAGjs = require('../chunk-CUQEGUAG.js');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
var _chunkQGM4M3NIjs = require('../chunk-QGM4M3NI.js');
|
|
12
12
|
|
|
13
13
|
// src/commands/post.ts
|
|
14
14
|
var _core = require('@oclif/core');
|
|
15
|
-
var import_miramarket_client = _chunkQGM4M3NIjs.__toESM.call(void 0,
|
|
16
|
-
var Post = class _Post extends
|
|
15
|
+
var import_miramarket_client = _chunkQGM4M3NIjs.__toESM.call(void 0, _chunkCUQEGUAGjs.require_dist2.call(void 0, ));
|
|
16
|
+
var Post = class _Post extends _chunkCUQEGUAGjs.BaseCommand {
|
|
17
17
|
static {
|
|
18
18
|
this.description = "Validate and post a strategy to the Convex backend using your Privy session.";
|
|
19
19
|
}
|
|
@@ -66,8 +66,8 @@ var Post = class _Post extends _chunkUCB7XSQEjs.BaseCommand {
|
|
|
66
66
|
source: "cli",
|
|
67
67
|
idempotencyKey: flags["idempotency-key"]
|
|
68
68
|
});
|
|
69
|
-
const approval = result.approval ?
|
|
70
|
-
|
|
69
|
+
const approval = result.approval ? _chunkGVMZCXYHjs.describeApproval.call(void 0, result.approval, result.runId) : void 0;
|
|
70
|
+
_chunkCUQEGUAGjs.printResult.call(void 0,
|
|
71
71
|
{
|
|
72
72
|
ok: true,
|
|
73
73
|
command: "post",
|
package/dist/commands/preview.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkCUQEGUAGjs = require('../chunk-CUQEGUAG.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
var _chunkQGM4M3NIjs = require('../chunk-QGM4M3NI.js');
|
|
@@ -10,9 +10,9 @@ var _chunkQGM4M3NIjs = require('../chunk-QGM4M3NI.js');
|
|
|
10
10
|
// src/commands/preview.ts
|
|
11
11
|
var _core = require('@oclif/core');
|
|
12
12
|
var _fs = require('fs'); var fs = _interopRequireWildcard(_fs);
|
|
13
|
-
var import_miramarket_client = _chunkQGM4M3NIjs.__toESM.call(void 0,
|
|
14
|
-
var import_miramarket_client2 = _chunkQGM4M3NIjs.__toESM.call(void 0,
|
|
15
|
-
var Preview = class _Preview extends
|
|
13
|
+
var import_miramarket_client = _chunkQGM4M3NIjs.__toESM.call(void 0, _chunkCUQEGUAGjs.require_dist2.call(void 0, ));
|
|
14
|
+
var import_miramarket_client2 = _chunkQGM4M3NIjs.__toESM.call(void 0, _chunkCUQEGUAGjs.require_dist2.call(void 0, ));
|
|
15
|
+
var Preview = class _Preview extends _chunkCUQEGUAGjs.BaseCommand {
|
|
16
16
|
static {
|
|
17
17
|
this.description = "Show a summary of a strategy before posting.";
|
|
18
18
|
}
|
|
@@ -45,7 +45,7 @@ var Preview = class _Preview extends _chunkUCB7XSQEjs.BaseCommand {
|
|
|
45
45
|
throw (0, import_miramarket_client.inputError)(`Failed to parse JSON: ${err.message}`);
|
|
46
46
|
}
|
|
47
47
|
const result = (0, import_miramarket_client2.buildPreview)(strategy);
|
|
48
|
-
|
|
48
|
+
_chunkCUQEGUAGjs.printResult.call(void 0,
|
|
49
49
|
{ ok: result.valid, command: "preview", strategyPath: args.file, ...result },
|
|
50
50
|
flags.json
|
|
51
51
|
);
|
package/dist/commands/schema.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkCUQEGUAGjs = require('../chunk-CUQEGUAG.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunkQGM4M3NIjs = require('../chunk-QGM4M3NI.js');
|
|
8
8
|
|
|
9
9
|
// src/commands/schema.ts
|
|
10
10
|
var _core = require('@oclif/core');
|
|
11
|
-
var import_miramarket_client = _chunkQGM4M3NIjs.__toESM.call(void 0,
|
|
12
|
-
var Schema = class _Schema extends
|
|
11
|
+
var import_miramarket_client = _chunkQGM4M3NIjs.__toESM.call(void 0, _chunkCUQEGUAGjs.require_dist2.call(void 0, ));
|
|
12
|
+
var Schema = class _Schema extends _chunkCUQEGUAGjs.BaseCommand {
|
|
13
13
|
static {
|
|
14
14
|
this.description = "Print the ConditionalAction strategy schema for agent authoring.";
|
|
15
15
|
}
|
package/dist/commands/status.js
CHANGED
|
@@ -3,18 +3,18 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkCUQEGUAGjs = require('../chunk-CUQEGUAG.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunkQGM4M3NIjs = require('../chunk-QGM4M3NI.js');
|
|
10
10
|
|
|
11
11
|
// src/commands/status.ts
|
|
12
12
|
var _core = require('@oclif/core');
|
|
13
|
-
var import_miramarket_client = _chunkQGM4M3NIjs.__toESM.call(void 0,
|
|
14
|
-
var import_miramarket_client2 = _chunkQGM4M3NIjs.__toESM.call(void 0,
|
|
15
|
-
var import_shared = _chunkQGM4M3NIjs.__toESM.call(void 0,
|
|
13
|
+
var import_miramarket_client = _chunkQGM4M3NIjs.__toESM.call(void 0, _chunkCUQEGUAGjs.require_dist2.call(void 0, ));
|
|
14
|
+
var import_miramarket_client2 = _chunkQGM4M3NIjs.__toESM.call(void 0, _chunkCUQEGUAGjs.require_dist2.call(void 0, ));
|
|
15
|
+
var import_shared = _chunkQGM4M3NIjs.__toESM.call(void 0, _chunkCUQEGUAGjs.require_dist.call(void 0, ));
|
|
16
16
|
var _fs = require('fs'); var fs = _interopRequireWildcard(_fs);
|
|
17
|
-
var Status = class _Status extends
|
|
17
|
+
var Status = class _Status extends _chunkCUQEGUAGjs.BaseCommand {
|
|
18
18
|
static {
|
|
19
19
|
this.description = "Show the current CLI workflow state.";
|
|
20
20
|
}
|
|
@@ -48,7 +48,7 @@ var Status = class _Status extends _chunkUCB7XSQEjs.BaseCommand {
|
|
|
48
48
|
if (!state.currentStrategyPath) remainingActions.push("Point to a strategy file");
|
|
49
49
|
if (currentStrategyValid === false) remainingActions.push("Fix validation errors");
|
|
50
50
|
if (authenticated && currentStrategyValid) remainingActions.push("Run `miramarket-cli post <file>` when ready");
|
|
51
|
-
|
|
51
|
+
_chunkCUQEGUAGjs.printResult.call(void 0,
|
|
52
52
|
{
|
|
53
53
|
ok: true,
|
|
54
54
|
command: "status",
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkCUQEGUAGjs = require('../../chunk-CUQEGUAG.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunkQGM4M3NIjs = require('../../chunk-QGM4M3NI.js');
|
|
10
10
|
|
|
11
11
|
// src/commands/stocks/history.ts
|
|
12
12
|
var _core = require('@oclif/core');
|
|
13
|
-
var import_miramarket_client = _chunkQGM4M3NIjs.__toESM.call(void 0,
|
|
14
|
-
var StocksHistory = class _StocksHistory extends
|
|
13
|
+
var import_miramarket_client = _chunkQGM4M3NIjs.__toESM.call(void 0, _chunkCUQEGUAGjs.require_dist2.call(void 0, ));
|
|
14
|
+
var StocksHistory = class _StocksHistory extends _chunkCUQEGUAGjs.BaseCommand {
|
|
15
15
|
static {
|
|
16
16
|
this.description = "Pool price history for one tokenized stock, in dollars per token.";
|
|
17
17
|
}
|
|
@@ -43,7 +43,7 @@ var StocksHistory = class _StocksHistory extends _chunkUCB7XSQEjs.BaseCommand {
|
|
|
43
43
|
async run() {
|
|
44
44
|
const { args, flags } = await this.parse(_StocksHistory);
|
|
45
45
|
const range = flags.range;
|
|
46
|
-
const result = await
|
|
46
|
+
const result = await _chunkCUQEGUAGjs.withSpinner.call(void 0,
|
|
47
47
|
`Fetching ${range} price history for ${args.stock}...`,
|
|
48
48
|
() => (0, import_miramarket_client.getBaseStockHistory)(args.stock, range),
|
|
49
49
|
{ json: flags.json }
|
|
@@ -51,7 +51,7 @@ var StocksHistory = class _StocksHistory extends _chunkUCB7XSQEjs.BaseCommand {
|
|
|
51
51
|
const points = _nullishCoalesce(result.points, () => ( []));
|
|
52
52
|
const first = points[0];
|
|
53
53
|
const last = points[points.length - 1];
|
|
54
|
-
|
|
54
|
+
_chunkCUQEGUAGjs.printResult.call(void 0,
|
|
55
55
|
{
|
|
56
56
|
ok: true,
|
|
57
57
|
command: "stocks history",
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkCUQEGUAGjs = require('../../chunk-CUQEGUAG.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunkQGM4M3NIjs = require('../../chunk-QGM4M3NI.js');
|
|
10
10
|
|
|
11
11
|
// src/commands/stocks/list.ts
|
|
12
12
|
var _core = require('@oclif/core');
|
|
13
|
-
var import_miramarket_client = _chunkQGM4M3NIjs.__toESM.call(void 0,
|
|
14
|
-
var StocksList = class _StocksList extends
|
|
13
|
+
var import_miramarket_client = _chunkQGM4M3NIjs.__toESM.call(void 0, _chunkCUQEGUAGjs.require_dist2.call(void 0, ));
|
|
14
|
+
var StocksList = class _StocksList extends _chunkCUQEGUAGjs.BaseCommand {
|
|
15
15
|
static {
|
|
16
16
|
this.description = "List tradable B20 tokenized stocks on Base with live Aerodrome pool prices.";
|
|
17
17
|
}
|
|
@@ -28,12 +28,12 @@ var StocksList = class _StocksList extends _chunkUCB7XSQEjs.BaseCommand {
|
|
|
28
28
|
}
|
|
29
29
|
async run() {
|
|
30
30
|
const { flags } = await this.parse(_StocksList);
|
|
31
|
-
const response = await
|
|
31
|
+
const response = await _chunkCUQEGUAGjs.withSpinner.call(void 0,
|
|
32
32
|
"Fetching tokenized stocks...",
|
|
33
33
|
() => (0, import_miramarket_client.listBaseStocks)(),
|
|
34
34
|
{ json: flags.json }
|
|
35
35
|
);
|
|
36
|
-
|
|
36
|
+
_chunkCUQEGUAGjs.printResult.call(void 0,
|
|
37
37
|
{
|
|
38
38
|
ok: true,
|
|
39
39
|
command: "stocks list",
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkCUQEGUAGjs = require('../../chunk-CUQEGUAG.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunkQGM4M3NIjs = require('../../chunk-QGM4M3NI.js');
|
|
10
10
|
|
|
11
11
|
// src/commands/stocks/show.ts
|
|
12
12
|
var _core = require('@oclif/core');
|
|
13
|
-
var import_miramarket_client = _chunkQGM4M3NIjs.__toESM.call(void 0,
|
|
14
|
-
var StocksShow = class _StocksShow extends
|
|
13
|
+
var import_miramarket_client = _chunkQGM4M3NIjs.__toESM.call(void 0, _chunkCUQEGUAGjs.require_dist2.call(void 0, ));
|
|
14
|
+
var StocksShow = class _StocksShow extends _chunkCUQEGUAGjs.BaseCommand {
|
|
15
15
|
static {
|
|
16
16
|
this.description = "Show one tokenized stock, with the exact action target to paste into a strategy.";
|
|
17
17
|
}
|
|
@@ -37,12 +37,12 @@ var StocksShow = class _StocksShow extends _chunkUCB7XSQEjs.BaseCommand {
|
|
|
37
37
|
}
|
|
38
38
|
async run() {
|
|
39
39
|
const { args, flags } = await this.parse(_StocksShow);
|
|
40
|
-
const { stock, actionTarget } = await
|
|
40
|
+
const { stock, actionTarget } = await _chunkCUQEGUAGjs.withSpinner.call(void 0,
|
|
41
41
|
`Fetching ${args.stock}...`,
|
|
42
42
|
() => (0, import_miramarket_client.getBaseStock)(args.stock),
|
|
43
43
|
{ json: flags.json }
|
|
44
44
|
);
|
|
45
|
-
|
|
45
|
+
_chunkCUQEGUAGjs.printResult.call(void 0,
|
|
46
46
|
{
|
|
47
47
|
ok: true,
|
|
48
48
|
command: "stocks show",
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkCUQEGUAGjs = require('../../chunk-CUQEGUAG.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunkQGM4M3NIjs = require('../../chunk-QGM4M3NI.js');
|
|
10
10
|
|
|
11
11
|
// src/commands/strategies/approval.ts
|
|
12
12
|
var _core = require('@oclif/core');
|
|
13
|
-
var import_miramarket_client = _chunkQGM4M3NIjs.__toESM.call(void 0,
|
|
14
|
-
var StrategiesApproval = class _StrategiesApproval extends
|
|
13
|
+
var import_miramarket_client = _chunkQGM4M3NIjs.__toESM.call(void 0, _chunkCUQEGUAGjs.require_dist2.call(void 0, ));
|
|
14
|
+
var StrategiesApproval = class _StrategiesApproval extends _chunkCUQEGUAGjs.BaseCommand {
|
|
15
15
|
static {
|
|
16
16
|
this.description = "Check a live start waiting for the account owner's approval: pending, started (with its runId), denied, expired or failed.";
|
|
17
17
|
}
|
|
@@ -31,7 +31,7 @@ var StrategiesApproval = class _StrategiesApproval extends _chunkUCB7XSQEjs.Base
|
|
|
31
31
|
async run() {
|
|
32
32
|
const { args, flags } = await this.parse(_StrategiesApproval);
|
|
33
33
|
(0, import_miramarket_client.requireAuth)();
|
|
34
|
-
const approval = await
|
|
34
|
+
const approval = await _chunkCUQEGUAGjs.withSpinner.call(void 0,
|
|
35
35
|
"Checking the approval...",
|
|
36
36
|
async () => (0, import_miramarket_client.getLiveStart)(await (0, import_miramarket_client.getConvexClient)(), args.approvalId),
|
|
37
37
|
{ json: flags.json }
|
|
@@ -40,7 +40,7 @@ var StrategiesApproval = class _StrategiesApproval extends _chunkUCB7XSQEjs.Base
|
|
|
40
40
|
throw (0, import_miramarket_client.inputError)(`No live start ${args.approvalId} from this login.`, "APPROVAL_NOT_FOUND");
|
|
41
41
|
}
|
|
42
42
|
const waiting = approval.status === "pending" || approval.status === "approved";
|
|
43
|
-
|
|
43
|
+
_chunkCUQEGUAGjs.printResult.call(void 0,
|
|
44
44
|
{
|
|
45
45
|
ok: true,
|
|
46
46
|
command: "strategies approval",
|
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkCUQEGUAGjs = require('../../chunk-CUQEGUAG.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunkQGM4M3NIjs = require('../../chunk-QGM4M3NI.js');
|
|
10
10
|
|
|
11
11
|
// src/commands/strategies/cancel.ts
|
|
12
12
|
var _core = require('@oclif/core');
|
|
13
|
-
var import_miramarket_client = _chunkQGM4M3NIjs.__toESM.call(void 0,
|
|
14
|
-
var import_miramarket_client2 = _chunkQGM4M3NIjs.__toESM.call(void 0,
|
|
15
|
-
var StrategiesCancel = class _StrategiesCancel extends
|
|
13
|
+
var import_miramarket_client = _chunkQGM4M3NIjs.__toESM.call(void 0, _chunkCUQEGUAGjs.require_dist2.call(void 0, ));
|
|
14
|
+
var import_miramarket_client2 = _chunkQGM4M3NIjs.__toESM.call(void 0, _chunkCUQEGUAGjs.require_dist2.call(void 0, ));
|
|
15
|
+
var StrategiesCancel = class _StrategiesCancel extends _chunkCUQEGUAGjs.BaseCommand {
|
|
16
16
|
static {
|
|
17
17
|
this.description = "Cancel an active strategy run by run ID.";
|
|
18
18
|
}
|
|
@@ -32,12 +32,12 @@ var StrategiesCancel = class _StrategiesCancel extends _chunkUCB7XSQEjs.BaseComm
|
|
|
32
32
|
async run() {
|
|
33
33
|
const { args, flags } = await this.parse(_StrategiesCancel);
|
|
34
34
|
(0, import_miramarket_client2.requireAuth)();
|
|
35
|
-
const result = await
|
|
35
|
+
const result = await _chunkCUQEGUAGjs.withSpinner.call(void 0,
|
|
36
36
|
"Cancelling strategy run...",
|
|
37
37
|
async () => (0, import_miramarket_client.cancelStrategyRun)(await (0, import_miramarket_client.getConvexClient)(), args.runId, flags["strategy-id"]),
|
|
38
38
|
{ json: flags.json }
|
|
39
39
|
);
|
|
40
|
-
|
|
40
|
+
_chunkCUQEGUAGjs.printResult.call(void 0,
|
|
41
41
|
{
|
|
42
42
|
ok: true,
|
|
43
43
|
command: "strategies cancel",
|
|
@@ -3,17 +3,17 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkCUQEGUAGjs = require('../../chunk-CUQEGUAG.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunkQGM4M3NIjs = require('../../chunk-QGM4M3NI.js');
|
|
10
10
|
|
|
11
11
|
// src/commands/strategies/delete.ts
|
|
12
12
|
var _core = require('@oclif/core');
|
|
13
|
-
var import_miramarket_client = _chunkQGM4M3NIjs.__toESM.call(void 0,
|
|
14
|
-
var import_miramarket_client2 = _chunkQGM4M3NIjs.__toESM.call(void 0,
|
|
15
|
-
var import_miramarket_client3 = _chunkQGM4M3NIjs.__toESM.call(void 0,
|
|
16
|
-
var StrategiesDelete = class _StrategiesDelete extends
|
|
13
|
+
var import_miramarket_client = _chunkQGM4M3NIjs.__toESM.call(void 0, _chunkCUQEGUAGjs.require_dist2.call(void 0, ));
|
|
14
|
+
var import_miramarket_client2 = _chunkQGM4M3NIjs.__toESM.call(void 0, _chunkCUQEGUAGjs.require_dist2.call(void 0, ));
|
|
15
|
+
var import_miramarket_client3 = _chunkQGM4M3NIjs.__toESM.call(void 0, _chunkCUQEGUAGjs.require_dist2.call(void 0, ));
|
|
16
|
+
var StrategiesDelete = class _StrategiesDelete extends _chunkCUQEGUAGjs.BaseCommand {
|
|
17
17
|
static {
|
|
18
18
|
this.description = "Delete a draft strategy. Only strategies that have never been started can be deleted.";
|
|
19
19
|
}
|
|
@@ -40,12 +40,12 @@ var StrategiesDelete = class _StrategiesDelete extends _chunkUCB7XSQEjs.BaseComm
|
|
|
40
40
|
throw (0, import_miramarket_client3.inputError)("Pass --confirm to permanently delete this draft strategy.");
|
|
41
41
|
}
|
|
42
42
|
(0, import_miramarket_client2.requireAuth)();
|
|
43
|
-
await
|
|
43
|
+
await _chunkCUQEGUAGjs.withSpinner.call(void 0,
|
|
44
44
|
"Deleting draft strategy...",
|
|
45
45
|
async () => (0, import_miramarket_client.deleteDraftStrategy)(await (0, import_miramarket_client.getConvexClient)(), args.strategyId),
|
|
46
46
|
{ json: flags.json }
|
|
47
47
|
);
|
|
48
|
-
|
|
48
|
+
_chunkCUQEGUAGjs.printResult.call(void 0,
|
|
49
49
|
{
|
|
50
50
|
ok: true,
|
|
51
51
|
command: "strategies delete",
|
|
@@ -3,18 +3,18 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkCUQEGUAGjs = require('../../chunk-CUQEGUAG.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunkQGM4M3NIjs = require('../../chunk-QGM4M3NI.js');
|
|
10
10
|
|
|
11
11
|
// src/commands/strategies/exit.ts
|
|
12
12
|
var _core = require('@oclif/core');
|
|
13
|
-
var import_miramarket_client = _chunkQGM4M3NIjs.__toESM.call(void 0,
|
|
14
|
-
var import_miramarket_client2 = _chunkQGM4M3NIjs.__toESM.call(void 0,
|
|
15
|
-
var StrategiesExit = class _StrategiesExit extends
|
|
13
|
+
var import_miramarket_client = _chunkQGM4M3NIjs.__toESM.call(void 0, _chunkCUQEGUAGjs.require_dist2.call(void 0, ));
|
|
14
|
+
var import_miramarket_client2 = _chunkQGM4M3NIjs.__toESM.call(void 0, _chunkCUQEGUAGjs.require_dist2.call(void 0, ));
|
|
15
|
+
var StrategiesExit = class _StrategiesExit extends _chunkCUQEGUAGjs.BaseCommand {
|
|
16
16
|
static {
|
|
17
|
-
this.description = "
|
|
17
|
+
this.description = "Archive a completed strategy and close whatever positions it still holds. (A running strategy is cancelled with `strategies cancel`, not exited.)";
|
|
18
18
|
}
|
|
19
19
|
static {
|
|
20
20
|
this.args = {
|
|
@@ -29,12 +29,12 @@ var StrategiesExit = class _StrategiesExit extends _chunkUCB7XSQEjs.BaseCommand
|
|
|
29
29
|
async run() {
|
|
30
30
|
const { args, flags } = await this.parse(_StrategiesExit);
|
|
31
31
|
(0, import_miramarket_client2.requireAuth)();
|
|
32
|
-
const result = await
|
|
32
|
+
const result = await _chunkCUQEGUAGjs.withSpinner.call(void 0,
|
|
33
33
|
"Exiting completed strategy...",
|
|
34
34
|
async () => (0, import_miramarket_client.exitCompletedStrategy)(await (0, import_miramarket_client.getConvexClient)(), args.strategyId),
|
|
35
35
|
{ json: flags.json }
|
|
36
36
|
);
|
|
37
|
-
|
|
37
|
+
_chunkCUQEGUAGjs.printResult.call(void 0,
|
|
38
38
|
{
|
|
39
39
|
ok: true,
|
|
40
40
|
command: "strategies exit",
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkCUQEGUAGjs = require('../../chunk-CUQEGUAG.js');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
var _chunkQGM4M3NIjs = require('../../chunk-QGM4M3NI.js');
|
|
@@ -15,8 +15,8 @@ var _core = require('@oclif/core');
|
|
|
15
15
|
var _prompts = require('@clack/prompts'); var clack = _interopRequireWildcard(_prompts);
|
|
16
16
|
var _fs = require('fs'); var fs = _interopRequireWildcard(_fs);
|
|
17
17
|
var _crypto = require('crypto');
|
|
18
|
-
var import_miramarket_client = _chunkQGM4M3NIjs.__toESM.call(void 0,
|
|
19
|
-
var import_shared = _chunkQGM4M3NIjs.__toESM.call(void 0,
|
|
18
|
+
var import_miramarket_client = _chunkQGM4M3NIjs.__toESM.call(void 0, _chunkCUQEGUAGjs.require_dist2.call(void 0, ));
|
|
19
|
+
var import_shared = _chunkQGM4M3NIjs.__toESM.call(void 0, _chunkCUQEGUAGjs.require_dist.call(void 0, ));
|
|
20
20
|
var numberedCandidates = (candidates) => candidates.map((c, i) => ({
|
|
21
21
|
choice: i + 1,
|
|
22
22
|
marketId: c.marketId,
|
|
@@ -27,7 +27,7 @@ var numberedCandidates = (candidates) => candidates.map((c, i) => ({
|
|
|
27
27
|
currentPrice: c.currentPrice,
|
|
28
28
|
score: c.score
|
|
29
29
|
}));
|
|
30
|
-
var StrategiesGenerate = class _StrategiesGenerate extends
|
|
30
|
+
var StrategiesGenerate = class _StrategiesGenerate extends _chunkCUQEGUAGjs.BaseCommand {
|
|
31
31
|
static {
|
|
32
32
|
this.description = "Describe a strategy in plain English and get authoring JSON back -- the same text-to-strategy pipeline as the web assistant.";
|
|
33
33
|
}
|
|
@@ -102,7 +102,7 @@ var StrategiesGenerate = class _StrategiesGenerate extends _chunkUCB7XSQEjs.Base
|
|
|
102
102
|
}
|
|
103
103
|
(0, import_miramarket_client.saveState)({ pendingMarketSelection: void 0 });
|
|
104
104
|
}
|
|
105
|
-
let response = await
|
|
105
|
+
let response = await _chunkCUQEGUAGjs.withSpinner.call(void 0,
|
|
106
106
|
flags.choose !== void 0 ? "Building from your choice..." : "Generating strategy...",
|
|
107
107
|
() => (0, import_miramarket_client.strategyChat)(request),
|
|
108
108
|
{ json: flags.json }
|
|
@@ -110,7 +110,7 @@ var StrategiesGenerate = class _StrategiesGenerate extends _chunkUCB7XSQEjs.Base
|
|
|
110
110
|
while (response.result === "market_selection" && this.canPromptInteractively(flags.json) && !(0, import_miramarket_client.continuationBlocker)({ editedStrategyPath: flags.strategy, continuation: response.continuation })) {
|
|
111
111
|
const chosen = await this.promptForCandidate(response.question, response.candidates);
|
|
112
112
|
const pending = toPending(prompt, response, flags.strategy);
|
|
113
|
-
response = await
|
|
113
|
+
response = await _chunkCUQEGUAGjs.withSpinner.call(void 0,
|
|
114
114
|
"Building from your choice...",
|
|
115
115
|
() => (0, import_miramarket_client.strategyChat)((0, import_miramarket_client.continuationRequest)(pending, chosen)),
|
|
116
116
|
{ json: flags.json }
|
|
@@ -146,7 +146,7 @@ var StrategiesGenerate = class _StrategiesGenerate extends _chunkUCB7XSQEjs.Base
|
|
|
146
146
|
const pending = toPending(prompt, response, flags.strategy);
|
|
147
147
|
const blocker = (0, import_miramarket_client.continuationBlocker)(pending);
|
|
148
148
|
(0, import_miramarket_client.saveState)({ pendingMarketSelection: pending });
|
|
149
|
-
|
|
149
|
+
_chunkCUQEGUAGjs.printResult.call(void 0,
|
|
150
150
|
{
|
|
151
151
|
...base,
|
|
152
152
|
result: "market_selection",
|
|
@@ -165,7 +165,7 @@ var StrategiesGenerate = class _StrategiesGenerate extends _chunkUCB7XSQEjs.Base
|
|
|
165
165
|
return;
|
|
166
166
|
}
|
|
167
167
|
case "clarification": {
|
|
168
|
-
|
|
168
|
+
_chunkCUQEGUAGjs.printResult.call(void 0,
|
|
169
169
|
{
|
|
170
170
|
...base,
|
|
171
171
|
result: "clarification",
|
|
@@ -177,7 +177,7 @@ var StrategiesGenerate = class _StrategiesGenerate extends _chunkUCB7XSQEjs.Base
|
|
|
177
177
|
return;
|
|
178
178
|
}
|
|
179
179
|
case "answer": {
|
|
180
|
-
|
|
180
|
+
_chunkCUQEGUAGjs.printResult.call(void 0, { ...base, result: "answer", answer: response.answer }, flags.json);
|
|
181
181
|
return;
|
|
182
182
|
}
|
|
183
183
|
}
|
|
@@ -193,12 +193,12 @@ var StrategiesGenerate = class _StrategiesGenerate extends _chunkUCB7XSQEjs.Base
|
|
|
193
193
|
fs.writeFileSync(flags.out, JSON.stringify(strategy, null, 2), "utf8");
|
|
194
194
|
(0, import_miramarket_client.saveState)({ currentStrategyPath: flags.out });
|
|
195
195
|
}
|
|
196
|
-
if (preview.thesis)
|
|
196
|
+
if (preview.thesis) _chunkCUQEGUAGjs.cliNote.call(void 0, (0, import_shared.describeStrategyThesis)(preview.thesis), "Why these markets");
|
|
197
197
|
const unmatched = _nullishCoalesce(preview.unmatched, () => ( []));
|
|
198
198
|
const caveats = (0, import_shared.describeUnmatchedReferences)(unmatched);
|
|
199
|
-
if (caveats)
|
|
200
|
-
if (_optionalChain([preview, 'access', _4 => _4.notices, 'optionalAccess', _5 => _5.length]))
|
|
201
|
-
|
|
199
|
+
if (caveats) _chunkCUQEGUAGjs.cliNote.call(void 0, caveats, "Could not match everything");
|
|
200
|
+
if (_optionalChain([preview, 'access', _4 => _4.notices, 'optionalAccess', _5 => _5.length])) _chunkCUQEGUAGjs.cliNote.call(void 0, preview.notices.join("\n"), "Notices");
|
|
201
|
+
_chunkCUQEGUAGjs.printResult.call(void 0,
|
|
202
202
|
{
|
|
203
203
|
...base,
|
|
204
204
|
result: "strategy",
|
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkCUQEGUAGjs = require('../../chunk-CUQEGUAG.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunkQGM4M3NIjs = require('../../chunk-QGM4M3NI.js');
|
|
10
10
|
|
|
11
11
|
// src/commands/strategies/list.ts
|
|
12
12
|
var _core = require('@oclif/core');
|
|
13
|
-
var import_miramarket_client = _chunkQGM4M3NIjs.__toESM.call(void 0,
|
|
14
|
-
var import_miramarket_client2 = _chunkQGM4M3NIjs.__toESM.call(void 0,
|
|
15
|
-
var StrategiesList = class _StrategiesList extends
|
|
13
|
+
var import_miramarket_client = _chunkQGM4M3NIjs.__toESM.call(void 0, _chunkCUQEGUAGjs.require_dist2.call(void 0, ));
|
|
14
|
+
var import_miramarket_client2 = _chunkQGM4M3NIjs.__toESM.call(void 0, _chunkCUQEGUAGjs.require_dist2.call(void 0, ));
|
|
15
|
+
var StrategiesList = class _StrategiesList extends _chunkCUQEGUAGjs.BaseCommand {
|
|
16
16
|
static {
|
|
17
17
|
this.description = "List your strategies.";
|
|
18
18
|
}
|
|
@@ -24,12 +24,12 @@ var StrategiesList = class _StrategiesList extends _chunkUCB7XSQEjs.BaseCommand
|
|
|
24
24
|
async run() {
|
|
25
25
|
const { flags } = await this.parse(_StrategiesList);
|
|
26
26
|
(0, import_miramarket_client2.requireAuth)();
|
|
27
|
-
const strategies = await
|
|
27
|
+
const strategies = await _chunkCUQEGUAGjs.withSpinner.call(void 0,
|
|
28
28
|
"Fetching strategies...",
|
|
29
29
|
async () => (0, import_miramarket_client.getUserStrategies)(await (0, import_miramarket_client.getConvexClient)()),
|
|
30
30
|
{ json: flags.json }
|
|
31
31
|
);
|
|
32
|
-
|
|
32
|
+
_chunkCUQEGUAGjs.printResult.call(void 0,
|
|
33
33
|
{
|
|
34
34
|
ok: true,
|
|
35
35
|
command: "strategies list",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkCUQEGUAGjs = require('../../chunk-CUQEGUAG.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunkQGM4M3NIjs = require('../../chunk-QGM4M3NI.js');
|
|
@@ -11,8 +11,8 @@ var _chunkQGM4M3NIjs = require('../../chunk-QGM4M3NI.js');
|
|
|
11
11
|
// src/commands/strategies/pull.ts
|
|
12
12
|
var _core = require('@oclif/core');
|
|
13
13
|
var _fs = require('fs'); var fs = _interopRequireWildcard(_fs);
|
|
14
|
-
var import_miramarket_client = _chunkQGM4M3NIjs.__toESM.call(void 0,
|
|
15
|
-
var StrategiesPull = class _StrategiesPull extends
|
|
14
|
+
var import_miramarket_client = _chunkQGM4M3NIjs.__toESM.call(void 0, _chunkCUQEGUAGjs.require_dist2.call(void 0, ));
|
|
15
|
+
var StrategiesPull = class _StrategiesPull extends _chunkCUQEGUAGjs.BaseCommand {
|
|
16
16
|
static {
|
|
17
17
|
this.description = "Download a posted strategy as authoring JSON, with the node keys that are locked by its active run.";
|
|
18
18
|
}
|
|
@@ -38,7 +38,7 @@ var StrategiesPull = class _StrategiesPull extends _chunkUCB7XSQEjs.BaseCommand
|
|
|
38
38
|
async run() {
|
|
39
39
|
const { args, flags } = await this.parse(_StrategiesPull);
|
|
40
40
|
(0, import_miramarket_client.requireAuth)();
|
|
41
|
-
const state = await
|
|
41
|
+
const state = await _chunkCUQEGUAGjs.withSpinner.call(void 0,
|
|
42
42
|
"Fetching strategy...",
|
|
43
43
|
async () => (0, import_miramarket_client.getStrategyEditState)(await (0, import_miramarket_client.getConvexClient)(), args.strategyId),
|
|
44
44
|
{ json: flags.json }
|
|
@@ -50,7 +50,7 @@ var StrategiesPull = class _StrategiesPull extends _chunkUCB7XSQEjs.BaseCommand
|
|
|
50
50
|
if (flags.out) {
|
|
51
51
|
fs.writeFileSync(flags.out, JSON.stringify(pulled.strategy, null, 2), "utf8");
|
|
52
52
|
}
|
|
53
|
-
|
|
53
|
+
_chunkCUQEGUAGjs.printResult.call(void 0,
|
|
54
54
|
{
|
|
55
55
|
ok: true,
|
|
56
56
|
command: "strategies pull",
|