@alva-ai/toolkit 0.36.0-beta.0 → 0.36.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);
@@ -7226,7 +7266,7 @@ var installPlaybookRuntime = (targetWindow) => {
7226
7266
  };
7227
7267
 
7228
7268
  // src/index.ts
7229
- var VERSION = true ? "0.36.0-beta.0" : "dev";
7269
+ var VERSION = true ? "0.36.0" : "dev";
7230
7270
  // Annotate the CommonJS export names for ESM import in node:
7231
7271
  0 && (module.exports = {
7232
7272
  AlertsResource,