@alva-ai/toolkit 0.36.0-beta.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/index.cjs CHANGED
@@ -5290,6 +5290,39 @@ async function thesisReturn(client, id, params = {}) {
5290
5290
  thesisReturn: value
5291
5291
  };
5292
5292
  }
5293
+ var WATCHPOINTS_QUERY = `query ToolkitThesisWatchpoints($id: ID!) {
5294
+ node(id: $id) { ... on Playbook { latestRelease { thesisPublication {
5295
+ watchpoints { label text origin }
5296
+ } } } }
5297
+ }`;
5298
+ async function thesisWatchpoints(client, id) {
5299
+ if (!isPositiveInt64(id))
5300
+ throw argument("id must be an internal positive int64 Playbook ID");
5301
+ client._requireAuth();
5302
+ const data = await graphql(client, WATCHPOINTS_QUERY, {
5303
+ id: `Playbook:${id}`
5304
+ });
5305
+ if (data.node === null) throw notFound();
5306
+ if (!record2(data.node)) throw invalid3();
5307
+ const release = data.node.latestRelease;
5308
+ if (release === null || release === void 0)
5309
+ return { playbookId: id, watchpoints: [] };
5310
+ if (!record2(release)) throw invalid3();
5311
+ const publication = release.thesisPublication;
5312
+ if (publication === null) return { playbookId: id, watchpoints: [] };
5313
+ if (!record2(publication) || !Array.isArray(publication.watchpoints))
5314
+ throw invalid3();
5315
+ const watchpoints = publication.watchpoints.map((item) => {
5316
+ if (!record2(item) || !nonempty(item.label) || !nonempty(item.text) || !["stated", "inferred", "agent"].includes(item.origin))
5317
+ throw invalid3();
5318
+ return {
5319
+ label: item.label,
5320
+ text: item.text,
5321
+ origin: item.origin
5322
+ };
5323
+ });
5324
+ return { playbookId: id, watchpoints };
5325
+ }
5293
5326
  function validThesisReturn(value) {
5294
5327
  if (!record2(value) || typeof value.live !== "boolean" || typeof value.value !== "number" || typeof value.stale !== "boolean" || typeof value.computedAtMs !== "number" || !Array.isArray(value.updates))
5295
5328
  return false;
@@ -5452,6 +5485,13 @@ var ThesesResource = class {
5452
5485
  thesisReturn(id, params = {}) {
5453
5486
  return thesisReturn(this.client, id, params);
5454
5487
  }
5488
+ /**
5489
+ * List every watchpoint of a Thesis (its current set, in number order): the
5490
+ * things the Thesis depends on, or that would show it right or wrong.
5491
+ */
5492
+ watchpoints(id) {
5493
+ return thesisWatchpoints(this.client, id);
5494
+ }
5455
5495
  async create(params) {
5456
5496
  this.client._requireAuth();
5457
5497
  const body = createBody(params);
@@ -5550,7 +5590,11 @@ var ThesesResource = class {
5550
5590
  }
5551
5591
  return response;
5552
5592
  }
5553
- /** Archive or restore the current version without asking callers to resend its body. */
5593
+ /**
5594
+ * Archive or unarchive the current version without asking callers to resend
5595
+ * its body. Unarchiving publishes the current content as a new Update; an
5596
+ * archived Thesis takes no other Update.
5597
+ */
5554
5598
  async setArchived(id, params) {
5555
5599
  this.client._requireAuth();
5556
5600
  if (!isRecord2(params)) throw invalidArgument("params is required");
@@ -7226,7 +7270,7 @@ var installPlaybookRuntime = (targetWindow) => {
7226
7270
  };
7227
7271
 
7228
7272
  // src/index.ts
7229
- var VERSION = true ? "0.36.0-beta.0" : "dev";
7273
+ var VERSION = true ? "0.37.0-beta.0" : "dev";
7230
7274
  // Annotate the CommonJS export names for ESM import in node:
7231
7275
  0 && (module.exports = {
7232
7276
  AlertsResource,