@alva-ai/toolkit 0.28.1-beta.0 → 0.28.1-beta.1

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.
@@ -2357,6 +2357,8 @@ interface CreateThesisParams {
2357
2357
  body: string;
2358
2358
  title?: string;
2359
2359
  entity_ids?: ThesisID[];
2360
+ /** Exact STOCK ticker symbols resolved by Backend during creation. */
2361
+ tickers?: string[];
2360
2362
  /** Omitted means public, as defined by the REST contract. */
2361
2363
  visibility?: ThesisVisibility;
2362
2364
  }
@@ -2371,6 +2373,9 @@ interface UpdateThesisParams {
2371
2373
  visibility: ThesisVisibility;
2372
2374
  editorial?: boolean;
2373
2375
  }
2376
+ interface SetThesisVisibilityParams {
2377
+ visibility: ThesisVisibility;
2378
+ }
2374
2379
  interface CloseThesisParams {
2375
2380
  expected_author_version_id: ThesisID;
2376
2381
  note?: string;
@@ -2393,6 +2398,7 @@ declare class ThesesResource {
2393
2398
  create(params: CreateThesisParams): Promise<ThesisResponse>;
2394
2399
  get(id: ThesisID): Promise<ThesisGetResponse>;
2395
2400
  update(id: ThesisID, params: UpdateThesisParams): Promise<ThesisResponse>;
2401
+ setVisibility(id: ThesisID, params: SetThesisVisibilityParams): Promise<ThesisResponse>;
2396
2402
  close(id: ThesisID, params: CloseThesisParams): Promise<ThesisResponse>;
2397
2403
  delete(id: ThesisID): Promise<Record<string, never>>;
2398
2404
  rewrite(params: RewriteThesisParams): Promise<RewriteThesisResponse>;
package/dist/dispatch.js CHANGED
@@ -6052,9 +6052,19 @@ var EMBEDDED_COMMAND_DEFINITIONS = [
6052
6052
  "steward-self"
6053
6053
  ),
6054
6054
  route("thesis create", "thesis create", {
6055
- values: ["request-id", "body", "title", "entity-ids", "visibility"]
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 set-visibility", "thesis set-visibility", {
6066
+ values: ["id", "visibility"]
6067
+ }),
6058
6068
  route("thesis update", "thesis update", {
6059
6069
  values: [
6060
6070
  "id",
@@ -6536,12 +6546,14 @@ Examples:
6536
6546
  alva for-you list --limit 20 --cursor '<endCursor>' --newer-than '<watermark>'`,
6537
6547
  thesis: `Usage: alva thesis <subcommand> [options]
6538
6548
 
6539
- Subcommands: create, get, update, close, delete, rewrite.
6549
+ Subcommands: create, get, set-visibility, update, close, delete, rewrite.
6540
6550
 
6541
6551
  Embedded thesis commands accept literal --body text only; file and stdin body
6542
6552
  transports are intentionally unavailable because this runtime has no verified
6543
6553
  local filesystem or stdin adapter. Rewrite accepts --mode reformat|shorten|enrich;
6544
6554
  only omission defaults to canonical reformat, which is sent to the API. Create defaults --visibility to public.
6555
+ Set-visibility changes current access without publishing a new author version.
6556
+ It requires --id and --visibility public|private and never uses a request ID.
6545
6557
  Update requires both --expected-author-version-id and --visibility, preventing
6546
6558
  inadvertent publication, and replaces the document's body, title, and entity
6547
6559
  IDs as a full author-version update. Create and update require a caller-supplied non-zero
@@ -7306,11 +7318,13 @@ var COMMAND_DEFINITIONS = [
7306
7318
  "body-file",
7307
7319
  "title",
7308
7320
  "entity-ids",
7321
+ "tickers",
7309
7322
  "visibility"
7310
7323
  ],
7311
7324
  booleans: ["body-stdin"]
7312
7325
  }),
7313
7326
  command("thesis get", { values: ["id"] }),
7327
+ command("thesis set-visibility", { values: ["id", "visibility"] }),
7314
7328
  command("thesis update", {
7315
7329
  values: [
7316
7330
  "id",
@@ -11455,7 +11469,7 @@ function formatTradingPairResolved(result) {
11455
11469
  }
11456
11470
 
11457
11471
  // src/cli/dispatch.ts
11458
- var CLI_VERSION = true ? "0.28.1-beta.0" : "dev";
11472
+ var CLI_VERSION = true ? "0.28.1-beta.1" : "dev";
11459
11473
  var DEFAULT_RUN_TIMEOUT_MS = 6e5;
11460
11474
  var RUN_TIMEOUT_ENV = "ALVA_RUN_TIMEOUT_MS";
11461
11475
  var GLOBAL_VALUE_FLAGS = Object.entries(GLOBAL_FLAG_DEFINITIONS).filter(([, kind]) => kind === "value").map(([name]) => `--${name}`);
@@ -12775,6 +12789,7 @@ Create and update never rewrite text automatically.
12775
12789
  Subcommands:
12776
12790
  create Create a thesis
12777
12791
  get Get one thesis
12792
+ set-visibility Change current access without publishing a version
12778
12793
  update Replaces document fields: body, title, entities, visibility (all sent in full)
12779
12794
  close Close the current author version with an optional note
12780
12795
  delete Delete a thesis
@@ -12792,8 +12807,9 @@ the backend; do not send a fresh ID. Create defaults --visibility to public.
12792
12807
  Update requires --visibility explicitly so it cannot inadvertently publish.
12793
12808
 
12794
12809
  Other flags:
12795
- create --request-id <uuid> --body ... [--title <text>] [--entity-ids <id,id>] [--visibility <value>]
12810
+ create --request-id <uuid> --body ... [--title <text>] [--tickers <ticker,ticker>] [--entity-ids <id,id>] [--visibility <value>]
12796
12811
  get --id <signed-int64-decimal>
12812
+ set-visibility --id <id> --visibility public|private
12797
12813
  update --id <id> --request-id <uuid> --expected-author-version-id <id> --body ... --visibility <value> [--title <text>] [--entity-ids <id,id>] [--editorial]
12798
12814
  close --id <id> --expected-author-version-id <id> [--note <text>]
12799
12815
  delete --id <id>
@@ -12813,6 +12829,7 @@ valid Unicode, and at most 65536 UTF-8 bytes; title is optional and at most
12813
12829
 
12814
12830
  Examples:
12815
12831
  alva thesis create --request-id 123e4567-e89b-42d3-a456-426614174000 --body $'line one\\r\\nline two'
12832
+ alva thesis set-visibility --id 9223372036854775807 --visibility private
12816
12833
  alva thesis update --id 9223372036854775807 --request-id 123e4567-e89b-42d3-a456-426614174000 --expected-author-version-id 9223372036854775806 --body-file ./thesis.md --visibility private
12817
12834
  printf '%s' 'Draft body' | alva thesis rewrite --body-stdin --mode shorten`
12818
12835
  };
@@ -13467,6 +13484,18 @@ function thesisEntityIDs(flags) {
13467
13484
  }
13468
13485
  return entityIDs;
13469
13486
  }
13487
+ function thesisTickers(flags) {
13488
+ const raw = flags.tickers;
13489
+ if (raw === void 0) return void 0;
13490
+ const tickers = raw.split(",").map((ticker) => ticker.trim());
13491
+ if (tickers.some((ticker) => ticker === "")) {
13492
+ throw new CliUsageError(
13493
+ "--tickers must not contain empty tickers",
13494
+ "thesis"
13495
+ );
13496
+ }
13497
+ return tickers;
13498
+ }
13470
13499
  function strictThesisUTF8(value, command2, flag) {
13471
13500
  const bytes = toByteView(value);
13472
13501
  if (bytes === void 0) {
@@ -14044,10 +14073,20 @@ async function executeParsedCommand(client, parsedCommand, meta, deps) {
14044
14073
  body: await thesisBodyFromFlags(flags, "thesis create", deps),
14045
14074
  title: flags.title ?? "",
14046
14075
  entity_ids: thesisEntityIDs(flags),
14076
+ tickers: thesisTickers(flags),
14047
14077
  visibility: flags.visibility === void 0 ? "public" : thesisVisibility(flags.visibility)
14048
14078
  });
14049
14079
  case "get":
14050
14080
  return client.theses.get(requireFlag(flags, "id", "thesis get"));
14081
+ case "set-visibility":
14082
+ return client.theses.setVisibility(
14083
+ requireFlag(flags, "id", "thesis set-visibility"),
14084
+ {
14085
+ visibility: thesisVisibility(
14086
+ requireFlag(flags, "visibility", "thesis set-visibility")
14087
+ )
14088
+ }
14089
+ );
14051
14090
  case "update":
14052
14091
  return client.theses.update(
14053
14092
  requireFlag(flags, "id", "thesis update"),