@alva-ai/toolkit 0.28.1-beta.0 → 0.29.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 +2 -1
- package/dist/browser.global.js +24 -24
- package/dist/browser.global.js.map +1 -1
- package/dist/cli.d.ts +52 -0
- package/dist/cli.js +247 -8
- package/dist/cli.js.map +1 -1
- package/dist/dispatch.d.ts +52 -0
- package/dist/dispatch.js +80 -8
- package/dist/dispatch.js.map +1 -1
- package/dist/index.cjs +188 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +53 -1
- package/dist/index.d.ts +53 -1
- package/dist/index.js +188 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/dispatch.d.ts
CHANGED
|
@@ -549,6 +549,8 @@ interface PlaybookDraftResponse {
|
|
|
549
549
|
playbook_path: string;
|
|
550
550
|
}
|
|
551
551
|
interface PlaybookReleaseRequest {
|
|
552
|
+
/** Explicit consent to deliver bundled non-public Feeds to the Playbook audience. */
|
|
553
|
+
confirm_bundled_feed_exposure?: boolean;
|
|
552
554
|
name: string;
|
|
553
555
|
version: string;
|
|
554
556
|
feeds: Array<{
|
|
@@ -2351,12 +2353,56 @@ interface ThesisGetResponse extends ThesisResponse {
|
|
|
2351
2353
|
author: ThesisAuthor;
|
|
2352
2354
|
entities: ThesisEntity[];
|
|
2353
2355
|
}
|
|
2356
|
+
interface ThesisResearchStatus {
|
|
2357
|
+
state: string;
|
|
2358
|
+
pending_work: number;
|
|
2359
|
+
read_complete: boolean;
|
|
2360
|
+
last_attempt_ms?: number;
|
|
2361
|
+
last_completed_ms?: number;
|
|
2362
|
+
}
|
|
2363
|
+
interface ThesisSignalEvidenceExcerpt {
|
|
2364
|
+
text: string;
|
|
2365
|
+
omitted_before: boolean;
|
|
2366
|
+
omitted_after: boolean;
|
|
2367
|
+
}
|
|
2368
|
+
interface ThesisSignalSource {
|
|
2369
|
+
title: string;
|
|
2370
|
+
url?: string;
|
|
2371
|
+
published_at_ms?: number;
|
|
2372
|
+
}
|
|
2373
|
+
interface ThesisSignal {
|
|
2374
|
+
id: ThesisID;
|
|
2375
|
+
thesis_id: ThesisID;
|
|
2376
|
+
author_version_id: ThesisID;
|
|
2377
|
+
statement_snapshot: string;
|
|
2378
|
+
stance: string;
|
|
2379
|
+
explanation: string;
|
|
2380
|
+
information_kind: string;
|
|
2381
|
+
evidence_excerpt?: ThesisSignalEvidenceExcerpt;
|
|
2382
|
+
source: ThesisSignalSource;
|
|
2383
|
+
}
|
|
2384
|
+
interface ThesisSignalEntry {
|
|
2385
|
+
feed_entry_id: ThesisID;
|
|
2386
|
+
cursor: string;
|
|
2387
|
+
signal: ThesisSignal;
|
|
2388
|
+
}
|
|
2389
|
+
interface ListThesisSignalsParams {
|
|
2390
|
+
first?: number;
|
|
2391
|
+
cursor?: string;
|
|
2392
|
+
}
|
|
2393
|
+
interface ThesisSignalsResponse {
|
|
2394
|
+
research: ThesisResearchStatus;
|
|
2395
|
+
entries: ThesisSignalEntry[];
|
|
2396
|
+
next_cursor: string;
|
|
2397
|
+
}
|
|
2354
2398
|
interface CreateThesisParams {
|
|
2355
2399
|
/** Caller-supplied, stable non-zero UUID. Reuse it only to resolve ambiguity. */
|
|
2356
2400
|
request_id: string;
|
|
2357
2401
|
body: string;
|
|
2358
2402
|
title?: string;
|
|
2359
2403
|
entity_ids?: ThesisID[];
|
|
2404
|
+
/** Exact STOCK ticker symbols resolved by Backend during creation. */
|
|
2405
|
+
tickers?: string[];
|
|
2360
2406
|
/** Omitted means public, as defined by the REST contract. */
|
|
2361
2407
|
visibility?: ThesisVisibility;
|
|
2362
2408
|
}
|
|
@@ -2371,6 +2417,9 @@ interface UpdateThesisParams {
|
|
|
2371
2417
|
visibility: ThesisVisibility;
|
|
2372
2418
|
editorial?: boolean;
|
|
2373
2419
|
}
|
|
2420
|
+
interface SetThesisVisibilityParams {
|
|
2421
|
+
visibility: ThesisVisibility;
|
|
2422
|
+
}
|
|
2374
2423
|
interface CloseThesisParams {
|
|
2375
2424
|
expected_author_version_id: ThesisID;
|
|
2376
2425
|
note?: string;
|
|
@@ -2392,7 +2441,10 @@ declare class ThesesResource {
|
|
|
2392
2441
|
constructor(client: AlvaClient);
|
|
2393
2442
|
create(params: CreateThesisParams): Promise<ThesisResponse>;
|
|
2394
2443
|
get(id: ThesisID): Promise<ThesisGetResponse>;
|
|
2444
|
+
getVersion(id: ThesisID, authorVersionID: ThesisID): Promise<ThesisResponse>;
|
|
2445
|
+
signals(id: ThesisID, params?: ListThesisSignalsParams): Promise<ThesisSignalsResponse>;
|
|
2395
2446
|
update(id: ThesisID, params: UpdateThesisParams): Promise<ThesisResponse>;
|
|
2447
|
+
setVisibility(id: ThesisID, params: SetThesisVisibilityParams): Promise<ThesisResponse>;
|
|
2396
2448
|
close(id: ThesisID, params: CloseThesisParams): Promise<ThesisResponse>;
|
|
2397
2449
|
delete(id: ThesisID): Promise<Record<string, never>>;
|
|
2398
2450
|
rewrite(params: RewriteThesisParams): Promise<RewriteThesisResponse>;
|
package/dist/dispatch.js
CHANGED
|
@@ -6052,9 +6052,25 @@ var EMBEDDED_COMMAND_DEFINITIONS = [
|
|
|
6052
6052
|
"steward-self"
|
|
6053
6053
|
),
|
|
6054
6054
|
route("thesis create", "thesis create", {
|
|
6055
|
-
values: [
|
|
6055
|
+
values: [
|
|
6056
|
+
"request-id",
|
|
6057
|
+
"body",
|
|
6058
|
+
"title",
|
|
6059
|
+
"entity-ids",
|
|
6060
|
+
"tickers",
|
|
6061
|
+
"visibility"
|
|
6062
|
+
]
|
|
6056
6063
|
}),
|
|
6057
6064
|
route("thesis get", "thesis get", { values: ["id"] }),
|
|
6065
|
+
route("thesis version get", "thesis version get", {
|
|
6066
|
+
values: ["id", "author-version-id"]
|
|
6067
|
+
}),
|
|
6068
|
+
route("thesis signals", "thesis signals", {
|
|
6069
|
+
values: ["id", "first", "cursor"]
|
|
6070
|
+
}),
|
|
6071
|
+
route("thesis set-visibility", "thesis set-visibility", {
|
|
6072
|
+
values: ["id", "visibility"]
|
|
6073
|
+
}),
|
|
6058
6074
|
route("thesis update", "thesis update", {
|
|
6059
6075
|
values: [
|
|
6060
6076
|
"id",
|
|
@@ -6303,7 +6319,7 @@ var EMBEDDED_COMMAND_DEFINITIONS = [
|
|
|
6303
6319
|
}),
|
|
6304
6320
|
route("playbooks release", "release playbook", {
|
|
6305
6321
|
values: ["name", "version", "feeds", "changelog", "readme-url"],
|
|
6306
|
-
booleans: ["bypass-lint"]
|
|
6322
|
+
booleans: ["bypass-lint", "confirm-bundled-feed-exposure"]
|
|
6307
6323
|
}),
|
|
6308
6324
|
route("playbooks lint", "lint playbook", {
|
|
6309
6325
|
values: ["format"],
|
|
@@ -6536,12 +6552,14 @@ Examples:
|
|
|
6536
6552
|
alva for-you list --limit 20 --cursor '<endCursor>' --newer-than '<watermark>'`,
|
|
6537
6553
|
thesis: `Usage: alva thesis <subcommand> [options]
|
|
6538
6554
|
|
|
6539
|
-
Subcommands: create, get, update, close, delete, rewrite.
|
|
6555
|
+
Subcommands: create, get, version get, signals, set-visibility, update, close, delete, rewrite.
|
|
6540
6556
|
|
|
6541
6557
|
Embedded thesis commands accept literal --body text only; file and stdin body
|
|
6542
6558
|
transports are intentionally unavailable because this runtime has no verified
|
|
6543
6559
|
local filesystem or stdin adapter. Rewrite accepts --mode reformat|shorten|enrich;
|
|
6544
6560
|
only omission defaults to canonical reformat, which is sent to the API. Create defaults --visibility to public.
|
|
6561
|
+
Set-visibility changes current access without publishing a new author version.
|
|
6562
|
+
It requires --id and --visibility public|private and never uses a request ID.
|
|
6545
6563
|
Update requires both --expected-author-version-id and --visibility, preventing
|
|
6546
6564
|
inadvertent publication, and replaces the document's body, title, and entity
|
|
6547
6565
|
IDs as a full author-version update. Create and update require a caller-supplied non-zero
|
|
@@ -7306,11 +7324,17 @@ var COMMAND_DEFINITIONS = [
|
|
|
7306
7324
|
"body-file",
|
|
7307
7325
|
"title",
|
|
7308
7326
|
"entity-ids",
|
|
7327
|
+
"tickers",
|
|
7309
7328
|
"visibility"
|
|
7310
7329
|
],
|
|
7311
7330
|
booleans: ["body-stdin"]
|
|
7312
7331
|
}),
|
|
7313
7332
|
command("thesis get", { values: ["id"] }),
|
|
7333
|
+
command("thesis version get", {
|
|
7334
|
+
values: ["id", "author-version-id"]
|
|
7335
|
+
}),
|
|
7336
|
+
command("thesis signals", { values: ["id", "first", "cursor"] }),
|
|
7337
|
+
command("thesis set-visibility", { values: ["id", "visibility"] }),
|
|
7314
7338
|
command("thesis update", {
|
|
7315
7339
|
values: [
|
|
7316
7340
|
"id",
|
|
@@ -7464,7 +7488,7 @@ var COMMAND_DEFINITIONS = [
|
|
|
7464
7488
|
}),
|
|
7465
7489
|
command("release playbook", {
|
|
7466
7490
|
values: ["name", "version", "feeds", "changelog", "readme-url"],
|
|
7467
|
-
booleans: ["bypass-lint"]
|
|
7491
|
+
booleans: ["bypass-lint", "confirm-bundled-feed-exposure"]
|
|
7468
7492
|
}),
|
|
7469
7493
|
command("lint playbook", {
|
|
7470
7494
|
values: ["format"],
|
|
@@ -11455,7 +11479,7 @@ function formatTradingPairResolved(result) {
|
|
|
11455
11479
|
}
|
|
11456
11480
|
|
|
11457
11481
|
// src/cli/dispatch.ts
|
|
11458
|
-
var CLI_VERSION = true ? "0.
|
|
11482
|
+
var CLI_VERSION = true ? "0.29.0" : "dev";
|
|
11459
11483
|
var DEFAULT_RUN_TIMEOUT_MS = 6e5;
|
|
11460
11484
|
var RUN_TIMEOUT_ENV = "ALVA_RUN_TIMEOUT_MS";
|
|
11461
11485
|
var GLOBAL_VALUE_FLAGS = Object.entries(GLOBAL_FLAG_DEFINITIONS).filter(([, kind]) => kind === "value").map(([name]) => `--${name}`);
|
|
@@ -12276,6 +12300,9 @@ Playbook-draft flags:
|
|
|
12276
12300
|
with skill tags; re-draft replaces the tag set.
|
|
12277
12301
|
|
|
12278
12302
|
Playbook flags:
|
|
12303
|
+
--confirm-bundled-feed-exposure
|
|
12304
|
+
Confirm delivery of bundled non-public Feeds to
|
|
12305
|
+
the Playbook audience. Defaults to unconfirmed.
|
|
12279
12306
|
--name <name> Playbook name, must already exist as draft (required)
|
|
12280
12307
|
--version <version> Semantic version, e.g. "v1.0.0" (required)
|
|
12281
12308
|
--feeds <json> JSON array of {feed_id, feed_major?} (required)
|
|
@@ -12768,13 +12795,16 @@ Examples:
|
|
|
12768
12795
|
alva arrays token status`,
|
|
12769
12796
|
thesis: `Usage: alva thesis <subcommand> [options]
|
|
12770
12797
|
|
|
12771
|
-
Create, read, update, close, delete, or explicitly rewrite an authored thesis.
|
|
12798
|
+
Create, read, inspect Signals and exact author versions, update, close, delete, or explicitly rewrite an authored thesis.
|
|
12772
12799
|
Backend owns Signal/Alert setup; the CLI never starts them separately.
|
|
12773
12800
|
Create and update never rewrite text automatically.
|
|
12774
12801
|
|
|
12775
12802
|
Subcommands:
|
|
12776
12803
|
create Create a thesis
|
|
12777
12804
|
get Get one thesis
|
|
12805
|
+
version get Get one exact author version
|
|
12806
|
+
signals Read published Signal history
|
|
12807
|
+
set-visibility Change current access without publishing a version
|
|
12778
12808
|
update Replaces document fields: body, title, entities, visibility (all sent in full)
|
|
12779
12809
|
close Close the current author version with an optional note
|
|
12780
12810
|
delete Delete a thesis
|
|
@@ -12792,8 +12822,11 @@ the backend; do not send a fresh ID. Create defaults --visibility to public.
|
|
|
12792
12822
|
Update requires --visibility explicitly so it cannot inadvertently publish.
|
|
12793
12823
|
|
|
12794
12824
|
Other flags:
|
|
12795
|
-
create --request-id <uuid> --body ... [--title <text>] [--entity-ids <id,id>] [--visibility <value>]
|
|
12825
|
+
create --request-id <uuid> --body ... [--title <text>] [--tickers <ticker,ticker>] [--entity-ids <id,id>] [--visibility <value>]
|
|
12796
12826
|
get --id <signed-int64-decimal>
|
|
12827
|
+
version get --id <signed-int64-decimal> --author-version-id <signed-int64-decimal>
|
|
12828
|
+
signals --id <id> [--first <1-50>] [--cursor <opaque-cursor>]
|
|
12829
|
+
set-visibility --id <id> --visibility public|private
|
|
12797
12830
|
update --id <id> --request-id <uuid> --expected-author-version-id <id> --body ... --visibility <value> [--title <text>] [--entity-ids <id,id>] [--editorial]
|
|
12798
12831
|
close --id <id> --expected-author-version-id <id> [--note <text>]
|
|
12799
12832
|
delete --id <id>
|
|
@@ -12813,6 +12846,7 @@ valid Unicode, and at most 65536 UTF-8 bytes; title is optional and at most
|
|
|
12813
12846
|
|
|
12814
12847
|
Examples:
|
|
12815
12848
|
alva thesis create --request-id 123e4567-e89b-42d3-a456-426614174000 --body $'line one\\r\\nline two'
|
|
12849
|
+
alva thesis set-visibility --id 9223372036854775807 --visibility private
|
|
12816
12850
|
alva thesis update --id 9223372036854775807 --request-id 123e4567-e89b-42d3-a456-426614174000 --expected-author-version-id 9223372036854775806 --body-file ./thesis.md --visibility private
|
|
12817
12851
|
printf '%s' 'Draft body' | alva thesis rewrite --body-stdin --mode shorten`
|
|
12818
12852
|
};
|
|
@@ -13467,6 +13501,18 @@ function thesisEntityIDs(flags) {
|
|
|
13467
13501
|
}
|
|
13468
13502
|
return entityIDs;
|
|
13469
13503
|
}
|
|
13504
|
+
function thesisTickers(flags) {
|
|
13505
|
+
const raw = flags.tickers;
|
|
13506
|
+
if (raw === void 0) return void 0;
|
|
13507
|
+
const tickers = raw.split(",").map((ticker) => ticker.trim());
|
|
13508
|
+
if (tickers.some((ticker) => ticker === "")) {
|
|
13509
|
+
throw new CliUsageError(
|
|
13510
|
+
"--tickers must not contain empty tickers",
|
|
13511
|
+
"thesis"
|
|
13512
|
+
);
|
|
13513
|
+
}
|
|
13514
|
+
return tickers;
|
|
13515
|
+
}
|
|
13470
13516
|
function strictThesisUTF8(value, command2, flag) {
|
|
13471
13517
|
const bytes = toByteView(value);
|
|
13472
13518
|
if (bytes === void 0) {
|
|
@@ -14044,10 +14090,33 @@ async function executeParsedCommand(client, parsedCommand, meta, deps) {
|
|
|
14044
14090
|
body: await thesisBodyFromFlags(flags, "thesis create", deps),
|
|
14045
14091
|
title: flags.title ?? "",
|
|
14046
14092
|
entity_ids: thesisEntityIDs(flags),
|
|
14093
|
+
tickers: thesisTickers(flags),
|
|
14047
14094
|
visibility: flags.visibility === void 0 ? "public" : thesisVisibility(flags.visibility)
|
|
14048
14095
|
});
|
|
14049
14096
|
case "get":
|
|
14050
14097
|
return client.theses.get(requireFlag(flags, "id", "thesis get"));
|
|
14098
|
+
case "version":
|
|
14099
|
+
return client.theses.getVersion(
|
|
14100
|
+
requireFlag(flags, "id", "thesis version get"),
|
|
14101
|
+
requireFlag(flags, "author-version-id", "thesis version get")
|
|
14102
|
+
);
|
|
14103
|
+
case "signals":
|
|
14104
|
+
return client.theses.signals(
|
|
14105
|
+
requireFlag(flags, "id", "thesis signals"),
|
|
14106
|
+
{
|
|
14107
|
+
first: flags.first === void 0 ? void 0 : Number(flags.first),
|
|
14108
|
+
cursor: flags.cursor
|
|
14109
|
+
}
|
|
14110
|
+
);
|
|
14111
|
+
case "set-visibility":
|
|
14112
|
+
return client.theses.setVisibility(
|
|
14113
|
+
requireFlag(flags, "id", "thesis set-visibility"),
|
|
14114
|
+
{
|
|
14115
|
+
visibility: thesisVisibility(
|
|
14116
|
+
requireFlag(flags, "visibility", "thesis set-visibility")
|
|
14117
|
+
)
|
|
14118
|
+
}
|
|
14119
|
+
);
|
|
14051
14120
|
case "update":
|
|
14052
14121
|
return client.theses.update(
|
|
14053
14122
|
requireFlag(flags, "id", "thesis update"),
|
|
@@ -14569,7 +14638,10 @@ async function executeParsedCommand(client, parsedCommand, meta, deps) {
|
|
|
14569
14638
|
version,
|
|
14570
14639
|
feeds: jsonParse(feedsRaw),
|
|
14571
14640
|
changelog,
|
|
14572
|
-
readme_url: readmeUrl
|
|
14641
|
+
readme_url: readmeUrl,
|
|
14642
|
+
confirm_bundled_feed_exposure: boolFlag(
|
|
14643
|
+
flags["confirm-bundled-feed-exposure"]
|
|
14644
|
+
)
|
|
14573
14645
|
});
|
|
14574
14646
|
}
|
|
14575
14647
|
default:
|