@alva-ai/toolkit 0.36.0 → 0.37.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/cli.d.ts CHANGED
@@ -3043,7 +3043,11 @@ declare class ThesesResource {
3043
3043
  }>;
3044
3044
  signals(id: ThesisID, params?: ListThesisSignalsParams): Promise<ThesisSignalsResponse>;
3045
3045
  update(id: ThesisID, params: UpdateThesisParams): Promise<ThesisResponse>;
3046
- /** Archive or restore the current version without asking callers to resend its body. */
3046
+ /**
3047
+ * Archive or unarchive the current version without asking callers to resend
3048
+ * its body. Unarchiving publishes the current content as a new Update; an
3049
+ * archived Thesis takes no other Update.
3050
+ */
3047
3051
  setArchived(id: ThesisID, params: SetThesisArchivedParams): Promise<ThesisResponse>;
3048
3052
  setStarred(id: ThesisID, isStarred: boolean): Promise<ThesisStarredResponse>;
3049
3053
  setSignalEnabled(id: ThesisID, enabled: boolean): Promise<ThesisSignalEnabledResponse>;
package/dist/cli.js CHANGED
@@ -11489,7 +11489,11 @@ var ThesesResource = class {
11489
11489
  }
11490
11490
  return response;
11491
11491
  }
11492
- /** Archive or restore the current version without asking callers to resend its body. */
11492
+ /**
11493
+ * Archive or unarchive the current version without asking callers to resend
11494
+ * its body. Unarchiving publishes the current content as a new Update; an
11495
+ * archived Thesis takes no other Update.
11496
+ */
11493
11497
  async setArchived(id, params) {
11494
11498
  this.client._requireAuth();
11495
11499
  if (!isRecord2(params)) throw invalidArgument("params is required");
@@ -13054,7 +13058,6 @@ var COMMAND_DEFINITIONS = [
13054
13058
  command("thesis signals", { values: ["id", "first", "cursor"] }),
13055
13059
  command("thesis set-visibility", { values: ["id", "visibility"] }),
13056
13060
  command("thesis archive", { values: ["id", "request-id", "note"] }),
13057
- command("thesis restore", { values: ["id", "request-id", "note"] }),
13058
13061
  command("thesis star", { values: ["id"] }),
13059
13062
  command("thesis unstar", { values: ["id"] }),
13060
13063
  command("thesis set-signal-enabled", { values: ["id", "enabled"] }),
@@ -13070,7 +13073,8 @@ var COMMAND_DEFINITIONS = [
13070
13073
  "entity-stances",
13071
13074
  "medias",
13072
13075
  "visibility",
13073
- "track-return"
13076
+ "track-return",
13077
+ "archived"
13074
13078
  ],
13075
13079
  booleans: ["body-stdin"]
13076
13080
  }),
@@ -17760,7 +17764,7 @@ function formatTradingPairResolved(result) {
17760
17764
  }
17761
17765
 
17762
17766
  // src/cli/dispatch.ts
17763
- var CLI_VERSION = true ? "0.36.0" : "dev";
17767
+ var CLI_VERSION = true ? "0.37.0-beta.0" : "dev";
17764
17768
  var DEFAULT_RUN_TIMEOUT_MS = 6e5;
17765
17769
  var RUN_TIMEOUT_ENV = "ALVA_RUN_TIMEOUT_MS";
17766
17770
  var GLOBAL_VALUE_FLAGS = Object.entries(GLOBAL_FLAG_DEFINITIONS).filter(([, kind]) => kind === "value").map(([name]) => `--${name}`);
@@ -19249,11 +19253,11 @@ Subcommands:
19249
19253
  watchpoints List a Thesis's current watchpoints
19250
19254
  set-visibility Change current access without publishing a version
19251
19255
  archive Archive the current author version
19252
- restore Restore an archived Thesis
19253
19256
  star Add the Thesis to your bookmarks
19254
19257
  unstar Remove the Thesis from your bookmarks
19255
19258
  set-signal-enabled Enable or disable managed Signal research
19256
- update Publish a new Update replacing body, title, entities, visibility (all sent in full)
19259
+ update Publish a new Update replacing body, title, entities, visibility (all sent in full);
19260
+ with --archived false it also unarchives the Thesis
19257
19261
  rewrite Explicitly request a candidate body rewrite; never called by another command
19258
19262
 
19259
19263
  Body input (create, update, rewrite): choose exactly one:
@@ -19307,29 +19311,32 @@ Other flags:
19307
19311
  Empty when none is stored yet.
19308
19312
  set-visibility --id <id> --visibility public|private
19309
19313
  archive --id <id> --request-id <uuid> [--note <text>]
19310
- restore --id <id> --request-id <uuid> [--note <text>]
19311
19314
  star|unstar --id <id>
19312
19315
  set-signal-enabled --id <id> --enabled true|false
19313
19316
 
19314
19317
  Maintenance behavior:
19315
- archive/restore read the current Thesis first, preserve its body, title,
19316
- entities, directions, and visibility, then publish the state change against
19317
- the current author version. They require a caller-supplied request UUID.
19318
- A repeated request in the requested state is an idempotent read; a version
19319
- conflict or incomplete directions fails without sending a stale update.
19320
- --note is optional and belongs to the new author version.
19318
+ archive reads the current Thesis first, preserves its body, title,
19319
+ entities, directions, and visibility, then archives it against the current
19320
+ author version. It requires a caller-supplied request UUID. A repeated
19321
+ request in the requested state is an idempotent read; a version conflict or
19322
+ incomplete directions fails without sending a stale update. --note is the
19323
+ archive note shown while the Thesis is archived.
19324
+ An archived Thesis takes no Update except the one that unarchives it:
19325
+ update --archived false publishes this Update and unarchives the Thesis,
19326
+ also when the content is unchanged.
19321
19327
  star/unstar change only the signed-in viewer's bookmark and return the
19322
19328
  authoritative bookmark state and count. They do not change Thesis content or
19323
19329
  Signal subscriptions.
19324
19330
  set-signal-enabled changes managed Signal research without deleting history.
19325
19331
  The command returns enabled, research_paused, archived, and author version
19326
19332
  state; GraphQL errors and noncanonical error codes fail closed.
19327
- 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>] [--track-return true|false]
19333
+ 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>] [--track-return true|false] [--archived false]
19328
19334
  For text edits, pass current medias unchanged; omission clears media.
19329
19335
 
19330
19336
  Only editing the body? Resubmit the existing entity IDs and directions.
19331
19337
  On an Update, an omitted or unknown direction of a carried ticker keeps its
19332
- previous direction; none is an exit.
19338
+ previous direction; none is an exit, also for the last long or short. An
19339
+ Update identical to the current one writes nothing: unchanged is true.
19333
19340
  rewrite --body ... [--mode reformat|shorten|enrich]
19334
19341
 
19335
19342
  Rewrite mode defaults only when omitted, and the toolkit always sends the
@@ -20232,6 +20239,15 @@ function thesisTrackReturn(flags, command2) {
20232
20239
  );
20233
20240
  return parsed;
20234
20241
  }
20242
+ function thesisUnarchive(flags, command2) {
20243
+ const raw = flags["archived"];
20244
+ if (raw === void 0) return void 0;
20245
+ if (boolFlag(raw) === false) return false;
20246
+ throw new CliUsageError(
20247
+ `--archived only accepts false for ${command2} (publish and unarchive); use thesis archive to archive`,
20248
+ "thesis"
20249
+ );
20250
+ }
20235
20251
  function thesisEntityStances(flags) {
20236
20252
  const raw = flags["entity-stances"];
20237
20253
  if (raw === void 0) return void 0;
@@ -21006,15 +21022,6 @@ async function executeParsedCommand(client, parsedCommand, meta, deps) {
21006
21022
  note: flags.note
21007
21023
  }
21008
21024
  );
21009
- case "restore":
21010
- return client.theses.setArchived(
21011
- requireFlag(flags, "id", "thesis restore"),
21012
- {
21013
- request_id: requireFlag(flags, "request-id", "thesis restore"),
21014
- archived: false,
21015
- note: flags.note
21016
- }
21017
- );
21018
21025
  case "star":
21019
21026
  return client.theses.setStarred(
21020
21027
  requireFlag(flags, "id", "thesis star"),
@@ -21030,27 +21037,32 @@ async function executeParsedCommand(client, parsedCommand, meta, deps) {
21030
21037
  requireFlag(flags, "id", "thesis set-signal-enabled"),
21031
21038
  thesisBooleanFlag(flags.enabled, "thesis set-signal-enabled")
21032
21039
  );
21033
- case "update":
21034
- return client.theses.update(
21035
- requireFlag(flags, "id", "thesis update"),
21036
- {
21037
- request_id: requireFlag(flags, "request-id", "thesis update"),
21038
- expected_author_version_id: requireFlag(
21039
- flags,
21040
- "expected-author-version-id",
21041
- "thesis update"
21042
- ),
21043
- body: await thesisBodyFromFlags(flags, "thesis update", deps),
21044
- title: flags.title ?? "",
21045
- entity_ids: thesisEntityIDs(flags),
21046
- entity_stances: thesisEntityStances(flags),
21047
- medias: thesisMedias(flags),
21048
- visibility: thesisVisibility(
21049
- requireFlag(flags, "visibility", "thesis update")
21050
- ),
21051
- track_return: thesisTrackReturn(flags, "thesis update")
21052
- }
21053
- );
21040
+ case "update": {
21041
+ const id = requireFlag(flags, "id", "thesis update");
21042
+ const params = {
21043
+ request_id: requireFlag(flags, "request-id", "thesis update"),
21044
+ expected_author_version_id: requireFlag(
21045
+ flags,
21046
+ "expected-author-version-id",
21047
+ "thesis update"
21048
+ ),
21049
+ body: await thesisBodyFromFlags(flags, "thesis update", deps),
21050
+ title: flags.title ?? "",
21051
+ entity_ids: thesisEntityIDs(flags),
21052
+ entity_stances: thesisEntityStances(flags),
21053
+ medias: thesisMedias(flags),
21054
+ visibility: thesisVisibility(
21055
+ requireFlag(flags, "visibility", "thesis update")
21056
+ ),
21057
+ track_return: thesisTrackReturn(flags, "thesis update"),
21058
+ archived: thesisUnarchive(flags, "thesis update")
21059
+ };
21060
+ const response = await client.theses.update(id, params);
21061
+ return {
21062
+ ...response,
21063
+ unchanged: response.thesis.author_version_id === params.expected_author_version_id
21064
+ };
21065
+ }
21054
21066
  case "rewrite":
21055
21067
  return client.theses.rewrite({
21056
21068
  body: await thesisBodyFromFlags(flags, "thesis rewrite", deps),