@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.
package/dist/cli.d.ts CHANGED
@@ -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/cli.js CHANGED
@@ -10061,6 +10061,27 @@ var ThesesResource = class {
10061
10061
  )
10062
10062
  );
10063
10063
  }
10064
+ async setVisibility(id, params) {
10065
+ this.client._requireAuth();
10066
+ if (!params) {
10067
+ throw invalidArgument("params is required");
10068
+ }
10069
+ const thesisID = requireID(id, "id");
10070
+ const visibility = requireVisibility(params.visibility);
10071
+ const response = thesisResponse(
10072
+ await this.client._request(
10073
+ "POST",
10074
+ `/api/v1/theses/${thesisID}/visibility`,
10075
+ { body: { visibility } }
10076
+ )
10077
+ );
10078
+ if (response.thesis.id !== thesisID || response.thesis.visibility !== visibility) {
10079
+ throw invalidResponse2(
10080
+ "visibility response must match the requested thesis and visibility"
10081
+ );
10082
+ }
10083
+ return response;
10084
+ }
10064
10085
  async close(id, params) {
10065
10086
  this.client._requireAuth();
10066
10087
  const body = {
@@ -10108,13 +10129,16 @@ var ThesesResource = class {
10108
10129
  }
10109
10130
  };
10110
10131
  function createBody(params) {
10111
- return {
10132
+ const body = {
10112
10133
  request_id: requireRequestID(params.request_id),
10113
10134
  body: requireBody(params.body),
10114
10135
  title: requireTitle(params.title ?? ""),
10115
10136
  entity_ids: requireIDs(params.entity_ids ?? [], "entity_ids"),
10116
10137
  visibility: requireVisibility(params.visibility ?? "public")
10117
10138
  };
10139
+ if (params.tickers !== void 0)
10140
+ body.tickers = requireTickers(params.tickers);
10141
+ return body;
10118
10142
  }
10119
10143
  function updateBody(params) {
10120
10144
  return {
@@ -10218,6 +10242,19 @@ function requireIDs(value, field) {
10218
10242
  }
10219
10243
  return value.map((item, index) => requireID(item, `${field}[${index}]`));
10220
10244
  }
10245
+ function requireTickers(value) {
10246
+ if (!Array.isArray(value)) throw invalidArgument("tickers must be an array");
10247
+ if (value.length > 100) {
10248
+ throw invalidArgument("tickers must contain at most 100 values");
10249
+ }
10250
+ return value.map((item, index) => {
10251
+ const ticker = requireText2(item, `tickers[${index}]`);
10252
+ if (ticker.trim() === "" || ticker.includes("\0")) {
10253
+ throw invalidArgument(`tickers[${index}] must be non-empty`);
10254
+ }
10255
+ return ticker;
10256
+ });
10257
+ }
10221
10258
  function requireBody(value) {
10222
10259
  const body = requireText2(value, "body");
10223
10260
  if (body.trim().length === 0) throw invalidArgument("body must not be blank");
@@ -11018,11 +11055,13 @@ var COMMAND_DEFINITIONS = [
11018
11055
  "body-file",
11019
11056
  "title",
11020
11057
  "entity-ids",
11058
+ "tickers",
11021
11059
  "visibility"
11022
11060
  ],
11023
11061
  booleans: ["body-stdin"]
11024
11062
  }),
11025
11063
  command("thesis get", { values: ["id"] }),
11064
+ command("thesis set-visibility", { values: ["id", "visibility"] }),
11026
11065
  command("thesis update", {
11027
11066
  values: [
11028
11067
  "id",
@@ -15712,7 +15751,7 @@ function formatTradingPairResolved(result) {
15712
15751
  }
15713
15752
 
15714
15753
  // src/cli/dispatch.ts
15715
- var CLI_VERSION = true ? "0.28.1-beta.0" : "dev";
15754
+ var CLI_VERSION = true ? "0.28.1-beta.1" : "dev";
15716
15755
  var DEFAULT_RUN_TIMEOUT_MS = 6e5;
15717
15756
  var RUN_TIMEOUT_ENV = "ALVA_RUN_TIMEOUT_MS";
15718
15757
  var GLOBAL_VALUE_FLAGS = Object.entries(GLOBAL_FLAG_DEFINITIONS).filter(([, kind]) => kind === "value").map(([name]) => `--${name}`);
@@ -15756,7 +15795,7 @@ Commands:
15756
15795
  deploy Cronjob management (create, list, get, update, delete, pause, resume, runs, run-logs)
15757
15796
  schedule Agent-owned named schedules (list, put, pause, resume, delete)
15758
15797
  steward Push steward reports for a Session Inbox (decide, forward, send, pending, briefed)
15759
- thesis Authored thesis lifecycle (create, get, update, close, delete, rewrite)
15798
+ thesis Authored thesis lifecycle (create, get, set-visibility, update, close, delete, rewrite)
15760
15799
  service-account Restricted run-as identities (create, list, delete, grant, revoke)
15761
15800
  release Feed and playbook releases (feed, playbook-draft, playbook)
15762
15801
  lint Design-system lint (playbook)
@@ -17088,6 +17127,7 @@ Create and update never rewrite text automatically.
17088
17127
  Subcommands:
17089
17128
  create Create a thesis
17090
17129
  get Get one thesis
17130
+ set-visibility Change current access without publishing a version
17091
17131
  update Replaces document fields: body, title, entities, visibility (all sent in full)
17092
17132
  close Close the current author version with an optional note
17093
17133
  delete Delete a thesis
@@ -17105,8 +17145,9 @@ the backend; do not send a fresh ID. Create defaults --visibility to public.
17105
17145
  Update requires --visibility explicitly so it cannot inadvertently publish.
17106
17146
 
17107
17147
  Other flags:
17108
- create --request-id <uuid> --body ... [--title <text>] [--entity-ids <id,id>] [--visibility <value>]
17148
+ create --request-id <uuid> --body ... [--title <text>] [--tickers <ticker,ticker>] [--entity-ids <id,id>] [--visibility <value>]
17109
17149
  get --id <signed-int64-decimal>
17150
+ set-visibility --id <id> --visibility public|private
17110
17151
  update --id <id> --request-id <uuid> --expected-author-version-id <id> --body ... --visibility <value> [--title <text>] [--entity-ids <id,id>] [--editorial]
17111
17152
  close --id <id> --expected-author-version-id <id> [--note <text>]
17112
17153
  delete --id <id>
@@ -17126,6 +17167,7 @@ valid Unicode, and at most 65536 UTF-8 bytes; title is optional and at most
17126
17167
 
17127
17168
  Examples:
17128
17169
  alva thesis create --request-id 123e4567-e89b-42d3-a456-426614174000 --body $'line one\\r\\nline two'
17170
+ alva thesis set-visibility --id 9223372036854775807 --visibility private
17129
17171
  alva thesis update --id 9223372036854775807 --request-id 123e4567-e89b-42d3-a456-426614174000 --expected-author-version-id 9223372036854775806 --body-file ./thesis.md --visibility private
17130
17172
  printf '%s' 'Draft body' | alva thesis rewrite --body-stdin --mode shorten`
17131
17173
  };
@@ -17808,6 +17850,18 @@ function thesisEntityIDs(flags) {
17808
17850
  }
17809
17851
  return entityIDs;
17810
17852
  }
17853
+ function thesisTickers(flags) {
17854
+ const raw = flags.tickers;
17855
+ if (raw === void 0) return void 0;
17856
+ const tickers = raw.split(",").map((ticker) => ticker.trim());
17857
+ if (tickers.some((ticker) => ticker === "")) {
17858
+ throw new CliUsageError(
17859
+ "--tickers must not contain empty tickers",
17860
+ "thesis"
17861
+ );
17862
+ }
17863
+ return tickers;
17864
+ }
17811
17865
  function strictThesisUTF8(value, command2, flag) {
17812
17866
  const bytes = toByteView(value);
17813
17867
  if (bytes === void 0) {
@@ -18410,10 +18464,20 @@ async function executeParsedCommand(client, parsedCommand, meta, deps) {
18410
18464
  body: await thesisBodyFromFlags(flags, "thesis create", deps),
18411
18465
  title: flags.title ?? "",
18412
18466
  entity_ids: thesisEntityIDs(flags),
18467
+ tickers: thesisTickers(flags),
18413
18468
  visibility: flags.visibility === void 0 ? "public" : thesisVisibility(flags.visibility)
18414
18469
  });
18415
18470
  case "get":
18416
18471
  return client.theses.get(requireFlag(flags, "id", "thesis get"));
18472
+ case "set-visibility":
18473
+ return client.theses.setVisibility(
18474
+ requireFlag(flags, "id", "thesis set-visibility"),
18475
+ {
18476
+ visibility: thesisVisibility(
18477
+ requireFlag(flags, "visibility", "thesis set-visibility")
18478
+ )
18479
+ }
18480
+ );
18417
18481
  case "update":
18418
18482
  return client.theses.update(
18419
18483
  requireFlag(flags, "id", "thesis update"),