@alva-ai/toolkit 0.17.1-beta.1 → 0.18.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/dist/browser.global.js +1 -1
- package/dist/browser.global.js.map +1 -1
- package/dist/cli.js +1 -142
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -13671,7 +13671,7 @@ import * as fs2 from "fs";
|
|
|
13671
13671
|
import * as os2 from "os";
|
|
13672
13672
|
import * as fsPromises2 from "fs/promises";
|
|
13673
13673
|
import { Agent, setGlobalDispatcher } from "undici";
|
|
13674
|
-
var CLI_VERSION = true ? "0.
|
|
13674
|
+
var CLI_VERSION = true ? "0.18.0" : "dev";
|
|
13675
13675
|
var DEFAULT_RUN_TIMEOUT_MS = 6e5;
|
|
13676
13676
|
var RUN_TIMEOUT_ENV = "ALVA_RUN_TIMEOUT_MS";
|
|
13677
13677
|
var configuredRunFetchTimeoutMs;
|
|
@@ -13720,7 +13720,6 @@ Commands:
|
|
|
13720
13720
|
notification-preferences Notification preferences (list, enable-session-completed, disable-session-completed)
|
|
13721
13721
|
feedback Submit user-confirmed Alva platform feedback (submit)
|
|
13722
13722
|
subscriptions Playbook follows and feed alert subscriptions
|
|
13723
|
-
channel Deprecated group-alert compatibility commands
|
|
13724
13723
|
remix Save playbook remix lineage
|
|
13725
13724
|
portfolio Connected-account portfolio (accounts, summary, activities)
|
|
13726
13725
|
trading Trading operations (accounts, portfolio, orders, subscriptions, equity-history, risk-rules, subscribe, unsubscribe, execute, update-risk-rules)
|
|
@@ -14702,34 +14701,6 @@ Examples:
|
|
|
14702
14701
|
alva subscriptions unsubscribe --feed-ids 13292,13293
|
|
14703
14702
|
alva subscriptions list --first 200
|
|
14704
14703
|
alva subscriptions follows`,
|
|
14705
|
-
channel: `Usage: alva channel group-subscriptions <subcommand> [options]
|
|
14706
|
-
|
|
14707
|
-
Deprecated compatibility surface. Normal alva alert list/enable/disable
|
|
14708
|
-
commands remain personal-channel operations. Use alva alert group
|
|
14709
|
-
list/enable/disable for the current external group. This alias remains available
|
|
14710
|
-
for existing scripts.
|
|
14711
|
-
|
|
14712
|
-
Manage alerts delivered into the external group chat attached to a channel
|
|
14713
|
-
session. The group can subscribe to feeds the group admin may read.
|
|
14714
|
-
Subscribe/unsubscribe are idempotent no-ops unless the authenticated caller
|
|
14715
|
-
is that group's Alva admin.
|
|
14716
|
-
|
|
14717
|
-
Subcommands:
|
|
14718
|
-
context Show group admin status and current subscriptions
|
|
14719
|
-
list List active subscriptions for the group
|
|
14720
|
-
subscribe Subscribe the group to a feed the admin may read
|
|
14721
|
-
unsubscribe Unsubscribe the group from a feed
|
|
14722
|
-
|
|
14723
|
-
Subscribe/unsubscribe flags:
|
|
14724
|
-
--feed-id <id> Numeric feed_id (required)
|
|
14725
|
-
|
|
14726
|
-
Examples:
|
|
14727
|
-
alva channel group-subscriptions context
|
|
14728
|
-
alva channel group-subscriptions list
|
|
14729
|
-
alva channel group-subscriptions subscribe --feed-id 8169
|
|
14730
|
-
alva channel group-subscriptions unsubscribe --feed-id 8169
|
|
14731
|
-
|
|
14732
|
-
These commands use the current sandbox session from ALVA_SESSION_ID.`,
|
|
14733
14704
|
remix: `Usage: alva remix --child-username <u> --child-name <n> --parents <json>
|
|
14734
14705
|
|
|
14735
14706
|
Record remix lineage when creating a playbook based on existing playbooks.
|
|
@@ -15098,46 +15069,6 @@ function configureRunFetchTimeout(timeoutMs, deps) {
|
|
|
15098
15069
|
);
|
|
15099
15070
|
configuredRunFetchTimeoutMs = timeoutMs;
|
|
15100
15071
|
}
|
|
15101
|
-
function requireGroupSubscriptionTargetType(flags, command) {
|
|
15102
|
-
const val = flags["target-type"]?.trim().toLowerCase() ?? "feed";
|
|
15103
|
-
if (val === "feed") return val;
|
|
15104
|
-
throw new CliUsageError(
|
|
15105
|
-
`--target-type must be feed for '${command}', got '${val}'`,
|
|
15106
|
-
command.split(" ")[0]
|
|
15107
|
-
);
|
|
15108
|
-
}
|
|
15109
|
-
function requireGroupSubscriptionSessionID(client, flags, command) {
|
|
15110
|
-
const val = flags["session-id"] ?? client.originSessionId;
|
|
15111
|
-
if (val === void 0) {
|
|
15112
|
-
throw new CliUsageError(
|
|
15113
|
-
`current group session is unavailable for '${command}'; run inside an Alva sandbox with ALVA_SESSION_ID`,
|
|
15114
|
-
"channel"
|
|
15115
|
-
);
|
|
15116
|
-
}
|
|
15117
|
-
if (!/^[1-9]\d*$/.test(val)) {
|
|
15118
|
-
throw new CliUsageError(
|
|
15119
|
-
`current group session must be a positive integer for '${command}', got '${val}'`,
|
|
15120
|
-
"channel"
|
|
15121
|
-
);
|
|
15122
|
-
}
|
|
15123
|
-
return val;
|
|
15124
|
-
}
|
|
15125
|
-
function requireGroupSubscriptionFeedID(flags, command) {
|
|
15126
|
-
const val = flags["feed-id"] ?? flags["target-id"];
|
|
15127
|
-
if (val === void 0) {
|
|
15128
|
-
throw new CliUsageError(
|
|
15129
|
-
`--feed-id is required for '${command}'`,
|
|
15130
|
-
"channel"
|
|
15131
|
-
);
|
|
15132
|
-
}
|
|
15133
|
-
if (!/^[1-9]\d*$/.test(val)) {
|
|
15134
|
-
throw new CliUsageError(
|
|
15135
|
-
`--feed-id must be a positive integer for '${command}', got '${val}'`,
|
|
15136
|
-
"channel"
|
|
15137
|
-
);
|
|
15138
|
-
}
|
|
15139
|
-
return val;
|
|
15140
|
-
}
|
|
15141
15072
|
function requireCurrentGroupAlertSessionID(client, command) {
|
|
15142
15073
|
if (client.originSessionKind !== "channel_group") {
|
|
15143
15074
|
throw new CliUsageError(
|
|
@@ -16833,78 +16764,6 @@ async function dispatch(client, args, meta, deps) {
|
|
|
16833
16764
|
);
|
|
16834
16765
|
}
|
|
16835
16766
|
}
|
|
16836
|
-
case "channel": {
|
|
16837
|
-
if (!subcommand || subcommand === "--help" || subcommand === "-h") {
|
|
16838
|
-
return { _help: true, text: COMMAND_HELP.channel };
|
|
16839
|
-
}
|
|
16840
|
-
if (subcommand !== "group-subscriptions") {
|
|
16841
|
-
throw new CliUsageError(
|
|
16842
|
-
`Unknown subcommand: channel ${subcommand}`,
|
|
16843
|
-
"channel"
|
|
16844
|
-
);
|
|
16845
|
-
}
|
|
16846
|
-
const leaf = args[2];
|
|
16847
|
-
if (!leaf || leaf === "--help" || leaf === "-h") {
|
|
16848
|
-
return { _help: true, text: COMMAND_HELP.channel };
|
|
16849
|
-
}
|
|
16850
|
-
const channelFlags = parseFlags2(args.slice(3));
|
|
16851
|
-
const commandName = `channel group-subscriptions ${leaf}`;
|
|
16852
|
-
switch (leaf) {
|
|
16853
|
-
case "context":
|
|
16854
|
-
return client.channelGroupSubscriptions.context({
|
|
16855
|
-
session_id: requireGroupSubscriptionSessionID(
|
|
16856
|
-
client,
|
|
16857
|
-
channelFlags,
|
|
16858
|
-
commandName
|
|
16859
|
-
)
|
|
16860
|
-
});
|
|
16861
|
-
case "list":
|
|
16862
|
-
return client.channelGroupSubscriptions.list({
|
|
16863
|
-
session_id: requireGroupSubscriptionSessionID(
|
|
16864
|
-
client,
|
|
16865
|
-
channelFlags,
|
|
16866
|
-
commandName
|
|
16867
|
-
)
|
|
16868
|
-
});
|
|
16869
|
-
case "subscribe":
|
|
16870
|
-
return client.channelGroupSubscriptions.subscribe({
|
|
16871
|
-
session_id: requireGroupSubscriptionSessionID(
|
|
16872
|
-
client,
|
|
16873
|
-
channelFlags,
|
|
16874
|
-
commandName
|
|
16875
|
-
),
|
|
16876
|
-
target_type: requireGroupSubscriptionTargetType(
|
|
16877
|
-
channelFlags,
|
|
16878
|
-
commandName
|
|
16879
|
-
),
|
|
16880
|
-
target_id: requireGroupSubscriptionFeedID(
|
|
16881
|
-
channelFlags,
|
|
16882
|
-
commandName
|
|
16883
|
-
)
|
|
16884
|
-
});
|
|
16885
|
-
case "unsubscribe":
|
|
16886
|
-
return client.channelGroupSubscriptions.unsubscribe({
|
|
16887
|
-
session_id: requireGroupSubscriptionSessionID(
|
|
16888
|
-
client,
|
|
16889
|
-
channelFlags,
|
|
16890
|
-
commandName
|
|
16891
|
-
),
|
|
16892
|
-
target_type: requireGroupSubscriptionTargetType(
|
|
16893
|
-
channelFlags,
|
|
16894
|
-
commandName
|
|
16895
|
-
),
|
|
16896
|
-
target_id: requireGroupSubscriptionFeedID(
|
|
16897
|
-
channelFlags,
|
|
16898
|
-
commandName
|
|
16899
|
-
)
|
|
16900
|
-
});
|
|
16901
|
-
default:
|
|
16902
|
-
throw new CliUsageError(
|
|
16903
|
-
`Unknown subcommand: channel group-subscriptions ${leaf}`,
|
|
16904
|
-
"channel"
|
|
16905
|
-
);
|
|
16906
|
-
}
|
|
16907
|
-
}
|
|
16908
16767
|
case "remix":
|
|
16909
16768
|
return client.remix.save({
|
|
16910
16769
|
child: {
|