@alva-ai/toolkit 0.33.1 → 0.34.0-beta.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 +56 -46
- package/dist/browser.global.js.map +1 -1
- package/dist/cli.d.ts +53 -4
- package/dist/cli.js +460 -20
- package/dist/cli.js.map +1 -1
- package/dist/dispatch.d.ts +53 -4
- package/dist/dispatch.js +186 -9
- package/dist/dispatch.js.map +1 -1
- package/dist/index.cjs +309 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +54 -5
- package/dist/index.d.ts +54 -5
- package/dist/index.js +309 -15
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/dispatch.d.ts
CHANGED
|
@@ -697,7 +697,8 @@ interface PortfolioAsset {
|
|
|
697
697
|
allocation?: number;
|
|
698
698
|
}
|
|
699
699
|
interface TradingPortfolio {
|
|
700
|
-
|
|
700
|
+
/** Null when one or more holdings could not be valued. */
|
|
701
|
+
equity: number | null;
|
|
701
702
|
cash: number;
|
|
702
703
|
unrealizedPnl?: number;
|
|
703
704
|
assets: PortfolioAsset[];
|
|
@@ -2421,6 +2422,7 @@ interface StewardPendingItem {
|
|
|
2421
2422
|
};
|
|
2422
2423
|
decisionReason: string;
|
|
2423
2424
|
consumedAtMs: number;
|
|
2425
|
+
alertSnapshot?: string | null;
|
|
2424
2426
|
}
|
|
2425
2427
|
interface StewardPendingPage {
|
|
2426
2428
|
items: StewardPendingItem[];
|
|
@@ -2558,7 +2560,7 @@ interface RelatedThesesPage {
|
|
|
2558
2560
|
|
|
2559
2561
|
/** Thesis IDs are signed int64 values represented losslessly as decimal strings. */
|
|
2560
2562
|
type ThesisID = string;
|
|
2561
|
-
type ThesisVisibility = 'public' | 'private';
|
|
2563
|
+
type ThesisVisibility = 'public' | 'private' | 'paid';
|
|
2562
2564
|
type ThesisAssetStance = 'unknown' | 'bullish' | 'bearish';
|
|
2563
2565
|
interface ThesisEntityStance {
|
|
2564
2566
|
entity_id: ThesisID;
|
|
@@ -2582,6 +2584,11 @@ interface ThesisAssetCandidatesResponse {
|
|
|
2582
2584
|
}
|
|
2583
2585
|
/** Canonical server-supported candidate rewrite operation. */
|
|
2584
2586
|
type ThesisRewriteMode = 'reformat' | 'shorten' | 'enrich';
|
|
2587
|
+
interface ThesisMedia {
|
|
2588
|
+
type: 'image' | 'price_chart' | 'audio' | 'video';
|
|
2589
|
+
cover_url: string;
|
|
2590
|
+
url?: string | null;
|
|
2591
|
+
}
|
|
2585
2592
|
interface Thesis {
|
|
2586
2593
|
id: ThesisID;
|
|
2587
2594
|
author_version_id: ThesisID;
|
|
@@ -2591,10 +2598,14 @@ interface Thesis {
|
|
|
2591
2598
|
entity_ids: ThesisID[];
|
|
2592
2599
|
entity_stances?: ThesisEntityStance[];
|
|
2593
2600
|
visibility: ThesisVisibility;
|
|
2601
|
+
medias?: ThesisMedia[];
|
|
2594
2602
|
closed: boolean;
|
|
2595
2603
|
closing_note: string;
|
|
2596
2604
|
author_kind: string;
|
|
2597
2605
|
author_ref: string;
|
|
2606
|
+
archived: boolean;
|
|
2607
|
+
version_archived?: boolean;
|
|
2608
|
+
note?: string;
|
|
2598
2609
|
}
|
|
2599
2610
|
interface ThesisResponse {
|
|
2600
2611
|
thesis: Thesis;
|
|
@@ -2660,6 +2671,8 @@ interface ThesisSignalsResponse {
|
|
|
2660
2671
|
next_cursor: string;
|
|
2661
2672
|
}
|
|
2662
2673
|
interface CreateThesisParams {
|
|
2674
|
+
/** Public images already uploaded with the existing upload tool, in display order. */
|
|
2675
|
+
images?: string[];
|
|
2663
2676
|
/** Caller-supplied, stable non-zero UUID. Reuse it only to resolve ambiguity. */
|
|
2664
2677
|
request_id: string;
|
|
2665
2678
|
body: string;
|
|
@@ -2670,9 +2683,11 @@ interface CreateThesisParams {
|
|
|
2670
2683
|
/** Exact STOCK ticker symbols resolved by Backend during creation. */
|
|
2671
2684
|
tickers?: string[];
|
|
2672
2685
|
/** Omitted means public, as defined by the REST contract. */
|
|
2673
|
-
visibility?:
|
|
2686
|
+
visibility?: 'public' | 'private';
|
|
2674
2687
|
}
|
|
2675
2688
|
interface UpdateThesisParams {
|
|
2689
|
+
/** Full media replacement; pass current medias for a text-only update. */
|
|
2690
|
+
medias?: ThesisMedia[];
|
|
2676
2691
|
/** Caller-supplied, stable non-zero UUID. Reuse it only to resolve ambiguity. */
|
|
2677
2692
|
request_id: string;
|
|
2678
2693
|
expected_author_version_id: ThesisID;
|
|
@@ -2684,9 +2699,29 @@ interface UpdateThesisParams {
|
|
|
2684
2699
|
/** Required so an update cannot inadvertently publish a private thesis. */
|
|
2685
2700
|
visibility: ThesisVisibility;
|
|
2686
2701
|
editorial?: boolean;
|
|
2702
|
+
archived?: boolean;
|
|
2703
|
+
note?: string;
|
|
2704
|
+
}
|
|
2705
|
+
interface SetThesisArchivedParams {
|
|
2706
|
+
/** Caller-supplied, stable non-zero UUID for this archive transition. */
|
|
2707
|
+
request_id: string;
|
|
2708
|
+
archived: boolean;
|
|
2709
|
+
note?: string;
|
|
2710
|
+
}
|
|
2711
|
+
interface ThesisStarredResponse {
|
|
2712
|
+
thesis_id: ThesisID;
|
|
2713
|
+
star_count: number;
|
|
2714
|
+
is_starred: boolean;
|
|
2715
|
+
}
|
|
2716
|
+
interface ThesisSignalEnabledResponse {
|
|
2717
|
+
thesis_id: ThesisID;
|
|
2718
|
+
author_version_id: ThesisID;
|
|
2719
|
+
archived: boolean;
|
|
2720
|
+
research_paused: boolean;
|
|
2721
|
+
enabled: boolean;
|
|
2687
2722
|
}
|
|
2688
2723
|
interface SetThesisVisibilityParams {
|
|
2689
|
-
visibility:
|
|
2724
|
+
visibility: 'public' | 'private';
|
|
2690
2725
|
}
|
|
2691
2726
|
interface CloseThesisParams {
|
|
2692
2727
|
expected_author_version_id: ThesisID;
|
|
@@ -2715,8 +2750,22 @@ declare class ThesesResource {
|
|
|
2715
2750
|
create(params: CreateThesisParams): Promise<ThesisResponse>;
|
|
2716
2751
|
get(id: ThesisID): Promise<ThesisGetResponse>;
|
|
2717
2752
|
getVersion(id: ThesisID, authorVersionID: ThesisID): Promise<ThesisResponse>;
|
|
2753
|
+
/** Lists reader-visible Updates, with editorial revisions folded together. */
|
|
2754
|
+
listUpdates(id: ThesisID, params?: {
|
|
2755
|
+
first?: number;
|
|
2756
|
+
cursor?: string;
|
|
2757
|
+
}): Promise<{
|
|
2758
|
+
versions: Thesis[];
|
|
2759
|
+
next_cursor: string;
|
|
2760
|
+
}>;
|
|
2761
|
+
/** Deletes only the selected Update; never falls back to whole-Thesis deletion. */
|
|
2762
|
+
deleteUpdate(id: ThesisID, authorVersionID: ThesisID, expectedAuthorVersionID: ThesisID): Promise<ThesisResponse>;
|
|
2718
2763
|
signals(id: ThesisID, params?: ListThesisSignalsParams): Promise<ThesisSignalsResponse>;
|
|
2719
2764
|
update(id: ThesisID, params: UpdateThesisParams): Promise<ThesisResponse>;
|
|
2765
|
+
/** Archive or restore the current version without asking callers to resend its body. */
|
|
2766
|
+
setArchived(id: ThesisID, params: SetThesisArchivedParams): Promise<ThesisResponse>;
|
|
2767
|
+
setStarred(id: ThesisID, isStarred: boolean): Promise<ThesisStarredResponse>;
|
|
2768
|
+
setSignalEnabled(id: ThesisID, enabled: boolean): Promise<ThesisSignalEnabledResponse>;
|
|
2720
2769
|
setVisibility(id: ThesisID, params: SetThesisVisibilityParams): Promise<ThesisResponse>;
|
|
2721
2770
|
close(id: ThesisID, params: CloseThesisParams): Promise<ThesisResponse>;
|
|
2722
2771
|
delete(id: ThesisID): Promise<Record<string, never>>;
|
package/dist/dispatch.js
CHANGED
|
@@ -6057,6 +6057,7 @@ var EMBEDDED_COMMAND_DEFINITIONS = [
|
|
|
6057
6057
|
route("thesis create", "thesis create", {
|
|
6058
6058
|
values: [
|
|
6059
6059
|
"request-id",
|
|
6060
|
+
"images",
|
|
6060
6061
|
"body",
|
|
6061
6062
|
"title",
|
|
6062
6063
|
"entity-ids",
|
|
@@ -6084,6 +6085,12 @@ var EMBEDDED_COMMAND_DEFINITIONS = [
|
|
|
6084
6085
|
values: ["id", "first", "cursor"]
|
|
6085
6086
|
}),
|
|
6086
6087
|
route("thesis get", "thesis get", { values: ["id"] }),
|
|
6088
|
+
route("thesis version list", "thesis version list", {
|
|
6089
|
+
values: ["id", "first", "cursor"]
|
|
6090
|
+
}),
|
|
6091
|
+
route("thesis version delete", "thesis version delete", {
|
|
6092
|
+
values: ["id", "author-version-id", "expected-author-version-id"]
|
|
6093
|
+
}),
|
|
6087
6094
|
route("thesis version get", "thesis version get", {
|
|
6088
6095
|
values: ["id", "author-version-id"]
|
|
6089
6096
|
}),
|
|
@@ -6093,6 +6100,17 @@ var EMBEDDED_COMMAND_DEFINITIONS = [
|
|
|
6093
6100
|
route("thesis set-visibility", "thesis set-visibility", {
|
|
6094
6101
|
values: ["id", "visibility"]
|
|
6095
6102
|
}),
|
|
6103
|
+
route("thesis archive", "thesis archive", {
|
|
6104
|
+
values: ["id", "request-id", "note"]
|
|
6105
|
+
}),
|
|
6106
|
+
route("thesis restore", "thesis restore", {
|
|
6107
|
+
values: ["id", "request-id", "note"]
|
|
6108
|
+
}),
|
|
6109
|
+
route("thesis star", "thesis star", { values: ["id"] }),
|
|
6110
|
+
route("thesis unstar", "thesis unstar", { values: ["id"] }),
|
|
6111
|
+
route("thesis set-signal-enabled", "thesis set-signal-enabled", {
|
|
6112
|
+
values: ["id", "enabled"]
|
|
6113
|
+
}),
|
|
6096
6114
|
route("thesis update", "thesis update", {
|
|
6097
6115
|
values: [
|
|
6098
6116
|
"id",
|
|
@@ -6102,6 +6120,7 @@ var EMBEDDED_COMMAND_DEFINITIONS = [
|
|
|
6102
6120
|
"title",
|
|
6103
6121
|
"entity-ids",
|
|
6104
6122
|
"entity-stances",
|
|
6123
|
+
"medias",
|
|
6105
6124
|
"visibility"
|
|
6106
6125
|
],
|
|
6107
6126
|
booleans: ["editorial"]
|
|
@@ -6628,7 +6647,7 @@ Examples:
|
|
|
6628
6647
|
alva for-you theses --cursor '<nextCursor>'`,
|
|
6629
6648
|
thesis: `Usage: alva thesis <subcommand> [options]
|
|
6630
6649
|
|
|
6631
|
-
Subcommands: list, related, asset-candidates, create, get, version get, signals, set-visibility, update, close, delete, rewrite.
|
|
6650
|
+
Subcommands: list, related, asset-candidates, create, get, version get, signals, set-visibility, archive, restore, star, unstar, set-signal-enabled, update, close, delete, rewrite.
|
|
6632
6651
|
|
|
6633
6652
|
list --person <slug> | --person-name <name> | --user <username>
|
|
6634
6653
|
| --ticker <ticker> | --entity-id <id>
|
|
@@ -6657,10 +6676,22 @@ local filesystem or stdin adapter. Rewrite accepts --mode reformat|shorten|enric
|
|
|
6657
6676
|
only omission defaults to canonical reformat, which is sent to the API. Create defaults --visibility to public.
|
|
6658
6677
|
Set-visibility changes current access without publishing a new author version.
|
|
6659
6678
|
It requires --id and --visibility public|private and never uses a request ID.
|
|
6679
|
+
Archive and restore preserve the current Thesis fields and use the current
|
|
6680
|
+
author version for optimistic concurrency. They require --id and a caller-supplied
|
|
6681
|
+
non-zero --request-id; an optional --note is stored on the new author version.
|
|
6682
|
+
star and unstar set the viewer's bookmark without changing the Thesis or alert
|
|
6683
|
+
subscriptions. set-signal-enabled --id <id> --enabled true|false pauses or
|
|
6684
|
+
resumes managed Signal research and returns the resulting research state.
|
|
6685
|
+
Archive and restore preserve the current Thesis fields and use the current
|
|
6686
|
+
author version for optimistic concurrency. A repeated request in the requested
|
|
6687
|
+
state is an idempotent read; stale content, incomplete directions, mismatched
|
|
6688
|
+
IDs, and noncanonical GraphQL errors fail closed. The returned state is the
|
|
6689
|
+
authority for archive, bookmark, and research results.
|
|
6660
6690
|
Update requires both --expected-author-version-id and --visibility, preventing
|
|
6661
6691
|
inadvertent publication, and replaces the document's body, title, and entity
|
|
6662
6692
|
IDs and directions as a full author-version update. Update accepts --entity-stances <json>.
|
|
6663
|
-
Only editing the body? Resubmit the existing entity IDs and
|
|
6693
|
+
Only editing the body? Resubmit the existing entity IDs, directions, and medias.
|
|
6694
|
+
Pass current medias unchanged with --medias; omission clears attachments.
|
|
6664
6695
|
Omitted directions become unknown; explicit unknown clears a direction.
|
|
6665
6696
|
Create and update require a caller-supplied non-zero
|
|
6666
6697
|
UUID in --request-id; the dispatcher never creates request IDs or retries.
|
|
@@ -7317,7 +7348,7 @@ query ToolkitStewardPending($inboxPath: String!, $input: StewardDigestPendingInp
|
|
|
7317
7348
|
stewardDigestPending(inboxPath: $inboxPath, input: $input) {
|
|
7318
7349
|
edges {
|
|
7319
7350
|
cursor
|
|
7320
|
-
node { deliveryId feedEntryId source { kind id } decisionReason consumedAtMs }
|
|
7351
|
+
node { deliveryId feedEntryId source { kind id } decisionReason consumedAtMs alertSnapshot }
|
|
7321
7352
|
}
|
|
7322
7353
|
pageInfo { hasNextPage endCursor }
|
|
7323
7354
|
windowSinceMs
|
|
@@ -7607,6 +7638,7 @@ var COMMAND_DEFINITIONS = [
|
|
|
7607
7638
|
command("thesis create", {
|
|
7608
7639
|
values: [
|
|
7609
7640
|
"request-id",
|
|
7641
|
+
"images",
|
|
7610
7642
|
"body",
|
|
7611
7643
|
"body-file",
|
|
7612
7644
|
"title",
|
|
@@ -7632,11 +7664,20 @@ var COMMAND_DEFINITIONS = [
|
|
|
7632
7664
|
}),
|
|
7633
7665
|
command("thesis related", { values: ["id", "first", "cursor"] }),
|
|
7634
7666
|
command("thesis get", { values: ["id"] }),
|
|
7667
|
+
command("thesis version list", { values: ["id", "first", "cursor"] }),
|
|
7668
|
+
command("thesis version delete", {
|
|
7669
|
+
values: ["id", "author-version-id", "expected-author-version-id"]
|
|
7670
|
+
}),
|
|
7635
7671
|
command("thesis version get", {
|
|
7636
7672
|
values: ["id", "author-version-id"]
|
|
7637
7673
|
}),
|
|
7638
7674
|
command("thesis signals", { values: ["id", "first", "cursor"] }),
|
|
7639
7675
|
command("thesis set-visibility", { values: ["id", "visibility"] }),
|
|
7676
|
+
command("thesis archive", { values: ["id", "request-id", "note"] }),
|
|
7677
|
+
command("thesis restore", { values: ["id", "request-id", "note"] }),
|
|
7678
|
+
command("thesis star", { values: ["id"] }),
|
|
7679
|
+
command("thesis unstar", { values: ["id"] }),
|
|
7680
|
+
command("thesis set-signal-enabled", { values: ["id", "enabled"] }),
|
|
7640
7681
|
command("thesis update", {
|
|
7641
7682
|
values: [
|
|
7642
7683
|
"id",
|
|
@@ -7647,6 +7688,7 @@ var COMMAND_DEFINITIONS = [
|
|
|
7647
7688
|
"title",
|
|
7648
7689
|
"entity-ids",
|
|
7649
7690
|
"entity-stances",
|
|
7691
|
+
"medias",
|
|
7650
7692
|
"visibility"
|
|
7651
7693
|
],
|
|
7652
7694
|
booleans: ["body-stdin", "editorial"]
|
|
@@ -11787,7 +11829,7 @@ function formatTradingPairResolved(result) {
|
|
|
11787
11829
|
}
|
|
11788
11830
|
|
|
11789
11831
|
// src/cli/dispatch.ts
|
|
11790
|
-
var CLI_VERSION = true ? "0.
|
|
11832
|
+
var CLI_VERSION = true ? "0.34.0-beta.0" : "dev";
|
|
11791
11833
|
var DEFAULT_RUN_TIMEOUT_MS = 6e5;
|
|
11792
11834
|
var RUN_TIMEOUT_ENV = "ALVA_RUN_TIMEOUT_MS";
|
|
11793
11835
|
var GLOBAL_VALUE_FLAGS = Object.entries(GLOBAL_FLAG_DEFINITIONS).filter(([, kind]) => kind === "value").map(([name]) => `--${name}`);
|
|
@@ -13171,8 +13213,15 @@ Subcommands:
|
|
|
13171
13213
|
related Read related current publications
|
|
13172
13214
|
get Get one thesis
|
|
13173
13215
|
version get Get one exact author version
|
|
13216
|
+
version list List visible Updates with editorial revisions folded together
|
|
13217
|
+
version delete Delete one Update; restore prior content if it is current
|
|
13174
13218
|
signals Read published Signal history
|
|
13175
13219
|
set-visibility Change current access without publishing a version
|
|
13220
|
+
archive Archive the current author version
|
|
13221
|
+
restore Restore an archived Thesis
|
|
13222
|
+
star Add the Thesis to your bookmarks
|
|
13223
|
+
unstar Remove the Thesis from your bookmarks
|
|
13224
|
+
set-signal-enabled Enable or disable managed Signal research
|
|
13176
13225
|
update Replaces document fields: body, title, entities, visibility (all sent in full)
|
|
13177
13226
|
close Close the current author version with an optional note
|
|
13178
13227
|
delete Delete a thesis
|
|
@@ -13190,7 +13239,10 @@ the backend; do not send a fresh ID. Create defaults --visibility to public.
|
|
|
13190
13239
|
Update requires --visibility explicitly so it cannot inadvertently publish.
|
|
13191
13240
|
|
|
13192
13241
|
Other flags:
|
|
13193
|
-
create --request-id <uuid> --body ... [--title <text>] [--tickers <ticker,ticker>] [--entity-ids <id,id>] [--entity-stances <json>] [--visibility <value>]
|
|
13242
|
+
create --request-id <uuid> --body ... [--images <json-array-of-https-urls>] [--title <text>] [--tickers <ticker,ticker>] [--entity-ids <id,id>] [--entity-stances <json>] [--visibility <value>]
|
|
13243
|
+
Images: public creation only, at most 20 in display order. Upload selected files
|
|
13244
|
+
with the existing host upload tool after publication confirmation. Private
|
|
13245
|
+
images and local/ALFS paths are not supported; this flag does not upload.
|
|
13194
13246
|
list --person <slug> | --person-name <name> | --user <username>
|
|
13195
13247
|
| --ticker <ticker> | --entity-id <id>
|
|
13196
13248
|
[--status ACTIVE|ARCHIVED] [--first 10] [--cursor <nextCursor>]
|
|
@@ -13208,9 +13260,32 @@ Other flags:
|
|
|
13208
13260
|
asset-candidates --text <unsaved thesis text>
|
|
13209
13261
|
get --id <signed-int64-decimal>
|
|
13210
13262
|
version get --id <signed-int64-decimal> --author-version-id <signed-int64-decimal>
|
|
13263
|
+
version list --id <id> [--first <1-100>] [--cursor <next_cursor>]
|
|
13264
|
+
version delete --id <id> --author-version-id <selected> --expected-author-version-id <current>
|
|
13265
|
+
Cannot remove the last Update. Never falls back to whole-Thesis deletion.
|
|
13211
13266
|
signals --id <id> [--first <1-50>] [--cursor <opaque-cursor>]
|
|
13212
13267
|
set-visibility --id <id> --visibility public|private
|
|
13213
|
-
|
|
13268
|
+
archive --id <id> --request-id <uuid> [--note <text>]
|
|
13269
|
+
restore --id <id> --request-id <uuid> [--note <text>]
|
|
13270
|
+
star|unstar --id <id>
|
|
13271
|
+
set-signal-enabled --id <id> --enabled true|false
|
|
13272
|
+
|
|
13273
|
+
Maintenance behavior:
|
|
13274
|
+
archive/restore read the current Thesis first, preserve its body, title,
|
|
13275
|
+
entities, directions, and visibility, then publish the state change against
|
|
13276
|
+
the current author version. They require a caller-supplied request UUID.
|
|
13277
|
+
A repeated request in the requested state is an idempotent read; a version
|
|
13278
|
+
conflict or incomplete directions fails without sending a stale update.
|
|
13279
|
+
--note is optional and belongs to the new author version.
|
|
13280
|
+
star/unstar change only the signed-in viewer's bookmark and return the
|
|
13281
|
+
authoritative bookmark state and count. They do not change Thesis content or
|
|
13282
|
+
Signal subscriptions.
|
|
13283
|
+
set-signal-enabled changes managed Signal research without deleting history.
|
|
13284
|
+
The command returns enabled, research_paused, archived, and author version
|
|
13285
|
+
state; GraphQL errors and noncanonical error codes fail closed.
|
|
13286
|
+
update --id <id> --request-id <uuid> --expected-author-version-id <id> --body ... --visibility <value> [--title <text>] [--entity-ids <id,id>] [--entity-stances <json>] [--medias <json-array>] [--editorial]
|
|
13287
|
+
For text edits, pass current medias unchanged; omission clears media.
|
|
13288
|
+
|
|
13214
13289
|
Only editing the body? Resubmit the existing entity IDs and directions.
|
|
13215
13290
|
Omitted directions become unknown; explicit unknown clears a direction.
|
|
13216
13291
|
close --id <id> --expected-author-version-id <id> [--note <text>]
|
|
@@ -13595,12 +13670,37 @@ function feedVisibility(val) {
|
|
|
13595
13670
|
);
|
|
13596
13671
|
}
|
|
13597
13672
|
function thesisVisibility(value) {
|
|
13673
|
+
if (value === "public" || value === "private" || value === "paid")
|
|
13674
|
+
return value;
|
|
13675
|
+
throw new CliUsageError(
|
|
13676
|
+
"--visibility must be public, private or paid for thesis, got " + value,
|
|
13677
|
+
"thesis"
|
|
13678
|
+
);
|
|
13679
|
+
}
|
|
13680
|
+
function thesisCreateVisibility(value) {
|
|
13598
13681
|
if (value === "public" || value === "private") return value;
|
|
13599
13682
|
throw new CliUsageError(
|
|
13600
|
-
|
|
13683
|
+
"--visibility must be public or private for thesis create, got " + value,
|
|
13601
13684
|
"thesis"
|
|
13602
13685
|
);
|
|
13603
13686
|
}
|
|
13687
|
+
function thesisAccessVisibility(value) {
|
|
13688
|
+
if (value === "public" || value === "private") return value;
|
|
13689
|
+
throw new CliUsageError(
|
|
13690
|
+
"--visibility must be public or private for thesis set-visibility, got " + value,
|
|
13691
|
+
"thesis"
|
|
13692
|
+
);
|
|
13693
|
+
}
|
|
13694
|
+
function thesisBooleanFlag(value, command2) {
|
|
13695
|
+
const parsed = boolFlag(value);
|
|
13696
|
+
if (parsed === void 0) {
|
|
13697
|
+
throw new CliUsageError(
|
|
13698
|
+
"--enabled must be true or false for " + command2,
|
|
13699
|
+
"thesis"
|
|
13700
|
+
);
|
|
13701
|
+
}
|
|
13702
|
+
return parsed;
|
|
13703
|
+
}
|
|
13604
13704
|
function thesisRewriteMode(value) {
|
|
13605
13705
|
if (value === "reformat" || value === "shorten" || value === "enrich") {
|
|
13606
13706
|
return value;
|
|
@@ -13926,6 +14026,28 @@ function thesisTickers(flags) {
|
|
|
13926
14026
|
}
|
|
13927
14027
|
return tickers;
|
|
13928
14028
|
}
|
|
14029
|
+
function thesisMedias(flags) {
|
|
14030
|
+
if (flags.medias === void 0) return void 0;
|
|
14031
|
+
try {
|
|
14032
|
+
const value = JSON.parse(flags.medias);
|
|
14033
|
+
if (Array.isArray(value)) return value;
|
|
14034
|
+
} catch {
|
|
14035
|
+
}
|
|
14036
|
+
throw new CliUsageError("--medias must be a JSON array", "thesis update");
|
|
14037
|
+
}
|
|
14038
|
+
function thesisImages(flags) {
|
|
14039
|
+
if (flags.images === void 0) return void 0;
|
|
14040
|
+
try {
|
|
14041
|
+
const value = JSON.parse(flags.images);
|
|
14042
|
+
if (Array.isArray(value) && value.every((item) => typeof item === "string"))
|
|
14043
|
+
return value;
|
|
14044
|
+
} catch {
|
|
14045
|
+
}
|
|
14046
|
+
throw new CliUsageError(
|
|
14047
|
+
"--images must be a JSON array of uploaded HTTPS image URLs",
|
|
14048
|
+
"thesis"
|
|
14049
|
+
);
|
|
14050
|
+
}
|
|
13929
14051
|
function thesisEntityStances(flags) {
|
|
13930
14052
|
const raw = flags["entity-stances"];
|
|
13931
14053
|
if (raw === void 0) return void 0;
|
|
@@ -14551,12 +14673,13 @@ async function executeParsedCommand(client, parsedCommand, meta, deps) {
|
|
|
14551
14673
|
case "create":
|
|
14552
14674
|
return client.theses.create({
|
|
14553
14675
|
request_id: requireFlag(flags, "request-id", "thesis create"),
|
|
14676
|
+
images: thesisImages(flags),
|
|
14554
14677
|
body: await thesisBodyFromFlags(flags, "thesis create", deps),
|
|
14555
14678
|
title: flags.title ?? "",
|
|
14556
14679
|
entity_ids: thesisEntityIDs(flags),
|
|
14557
14680
|
entity_stances: thesisEntityStances(flags),
|
|
14558
14681
|
tickers: thesisTickers(flags),
|
|
14559
|
-
visibility: flags.visibility === void 0 ? "public" :
|
|
14682
|
+
visibility: flags.visibility === void 0 ? "public" : thesisCreateVisibility(flags.visibility)
|
|
14560
14683
|
});
|
|
14561
14684
|
case "asset-candidates":
|
|
14562
14685
|
return client.theses.assetCandidates(
|
|
@@ -14598,6 +14721,26 @@ async function executeParsedCommand(client, parsedCommand, meta, deps) {
|
|
|
14598
14721
|
case "get":
|
|
14599
14722
|
return client.theses.get(requireFlag(flags, "id", "thesis get"));
|
|
14600
14723
|
case "version":
|
|
14724
|
+
if (parsedCommand.path[2] === "list") {
|
|
14725
|
+
return client.theses.listUpdates(
|
|
14726
|
+
requireFlag(flags, "id", "thesis version list"),
|
|
14727
|
+
{
|
|
14728
|
+
first: flags.first === void 0 ? void 0 : Number(flags.first),
|
|
14729
|
+
cursor: flags.cursor
|
|
14730
|
+
}
|
|
14731
|
+
);
|
|
14732
|
+
}
|
|
14733
|
+
if (parsedCommand.path[2] === "delete") {
|
|
14734
|
+
return client.theses.deleteUpdate(
|
|
14735
|
+
requireFlag(flags, "id", "thesis version delete"),
|
|
14736
|
+
requireFlag(flags, "author-version-id", "thesis version delete"),
|
|
14737
|
+
requireFlag(
|
|
14738
|
+
flags,
|
|
14739
|
+
"expected-author-version-id",
|
|
14740
|
+
"thesis version delete"
|
|
14741
|
+
)
|
|
14742
|
+
);
|
|
14743
|
+
}
|
|
14601
14744
|
return client.theses.getVersion(
|
|
14602
14745
|
requireFlag(flags, "id", "thesis version get"),
|
|
14603
14746
|
requireFlag(flags, "author-version-id", "thesis version get")
|
|
@@ -14614,11 +14757,44 @@ async function executeParsedCommand(client, parsedCommand, meta, deps) {
|
|
|
14614
14757
|
return client.theses.setVisibility(
|
|
14615
14758
|
requireFlag(flags, "id", "thesis set-visibility"),
|
|
14616
14759
|
{
|
|
14617
|
-
visibility:
|
|
14760
|
+
visibility: thesisAccessVisibility(
|
|
14618
14761
|
requireFlag(flags, "visibility", "thesis set-visibility")
|
|
14619
14762
|
)
|
|
14620
14763
|
}
|
|
14621
14764
|
);
|
|
14765
|
+
case "archive":
|
|
14766
|
+
return client.theses.setArchived(
|
|
14767
|
+
requireFlag(flags, "id", "thesis archive"),
|
|
14768
|
+
{
|
|
14769
|
+
request_id: requireFlag(flags, "request-id", "thesis archive"),
|
|
14770
|
+
archived: true,
|
|
14771
|
+
note: flags.note
|
|
14772
|
+
}
|
|
14773
|
+
);
|
|
14774
|
+
case "restore":
|
|
14775
|
+
return client.theses.setArchived(
|
|
14776
|
+
requireFlag(flags, "id", "thesis restore"),
|
|
14777
|
+
{
|
|
14778
|
+
request_id: requireFlag(flags, "request-id", "thesis restore"),
|
|
14779
|
+
archived: false,
|
|
14780
|
+
note: flags.note
|
|
14781
|
+
}
|
|
14782
|
+
);
|
|
14783
|
+
case "star":
|
|
14784
|
+
return client.theses.setStarred(
|
|
14785
|
+
requireFlag(flags, "id", "thesis star"),
|
|
14786
|
+
true
|
|
14787
|
+
);
|
|
14788
|
+
case "unstar":
|
|
14789
|
+
return client.theses.setStarred(
|
|
14790
|
+
requireFlag(flags, "id", "thesis unstar"),
|
|
14791
|
+
false
|
|
14792
|
+
);
|
|
14793
|
+
case "set-signal-enabled":
|
|
14794
|
+
return client.theses.setSignalEnabled(
|
|
14795
|
+
requireFlag(flags, "id", "thesis set-signal-enabled"),
|
|
14796
|
+
thesisBooleanFlag(flags.enabled, "thesis set-signal-enabled")
|
|
14797
|
+
);
|
|
14622
14798
|
case "update":
|
|
14623
14799
|
return client.theses.update(
|
|
14624
14800
|
requireFlag(flags, "id", "thesis update"),
|
|
@@ -14633,6 +14809,7 @@ async function executeParsedCommand(client, parsedCommand, meta, deps) {
|
|
|
14633
14809
|
title: flags.title ?? "",
|
|
14634
14810
|
entity_ids: thesisEntityIDs(flags),
|
|
14635
14811
|
entity_stances: thesisEntityStances(flags),
|
|
14812
|
+
medias: thesisMedias(flags),
|
|
14636
14813
|
visibility: thesisVisibility(
|
|
14637
14814
|
requireFlag(flags, "visibility", "thesis update")
|
|
14638
14815
|
),
|