@lotics/cli 0.261.0 → 0.263.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/src/cli.js CHANGED
@@ -52,7 +52,7 @@ var __toESM = (mod2, isNodeMode, target) => (target = mod2 != null ? __create(__
52
52
  var define_LOTICS_KIT_VERSIONS_default;
53
53
  var init_define_LOTICS_KIT_VERSIONS = __esm({
54
54
  "<define:__LOTICS_KIT_VERSIONS__>"() {
55
- define_LOTICS_KIT_VERSIONS_default = { runtime: "0.43.0" };
55
+ define_LOTICS_KIT_VERSIONS_default = { runtime: "0.45.0" };
56
56
  }
57
57
  });
58
58
 
@@ -30145,17 +30145,24 @@ var LoticsClient = class {
30145
30145
  async appWriteModel(app_id) {
30146
30146
  return this.request("GET", `/v1/apps/${encodeURIComponent(app_id)}/write_model`);
30147
30147
  }
30148
+ /**
30149
+ * Where the app's SDK drew a write the server then stored differently, counted by workflow, field and kind.
30150
+ * Mirrors POST /v1/apps/{app_id}/prediction_misses; the server checks the report's shape.
30151
+ */
30152
+ async appPredictionMisses(app_id, report) {
30153
+ return this.request("POST", `/v1/apps/${encodeURIComponent(app_id)}/prediction_misses`, report);
30154
+ }
30148
30155
  /**
30149
30156
  * Execute a workflow by alias declared in package.json#lotics.workflows.
30150
30157
  * Mirrors POST /v1/apps/{app_id}/workflows/{alias}/execute.
30151
30158
  */
30152
- async appWorkflow(app_id, alias2, inputs) {
30159
+ async appWorkflow(app_id, alias2, inputs, minted_ids) {
30153
30160
  const url2 = `${this.baseUrl}/v1/apps/${encodeURIComponent(app_id)}/workflows/${encodeURIComponent(alias2)}/execute`;
30154
30161
  const headers = this.buildHeaders();
30155
30162
  headers["Content-Type"] = "application/json";
30156
30163
  let response;
30157
30164
  try {
30158
- response = await fetch(url2, { method: "POST", headers, body: JSON.stringify({ inputs }) });
30165
+ response = await fetch(url2, { method: "POST", headers, body: JSON.stringify({ inputs, ...minted_ids === void 0 ? {} : { minted_ids } }) });
30159
30166
  } catch (err) {
30160
30167
  return { status: "error", message: err instanceof Error ? err.message : "The workflow request failed." };
30161
30168
  }
@@ -64304,7 +64311,7 @@ function resultSideEffects(result) {
64304
64311
 
64305
64312
  // src/version.ts
64306
64313
  init_define_LOTICS_KIT_VERSIONS();
64307
- var VERSION = "0.261.0";
64314
+ var VERSION = "0.263.0";
64308
64315
 
64309
64316
  // src/timezone.ts
64310
64317
  init_define_LOTICS_KIT_VERSIONS();
@@ -81357,7 +81364,6 @@ function createSource(plan) {
81357
81364
  const opening = [
81358
81365
  `const made = await create_records({`,
81359
81366
  ` table_id: ${str(plan.table.id)},`,
81360
- ` ids: isNull(i.${RECORD_INPUT}) ? null : [i.${RECORD_INPUT}],`,
81361
81367
  ` records: [`,
81362
81368
  ` {`,
81363
81369
  ...cells.map((cell) => ` ${cell}`),
@@ -82468,7 +82474,7 @@ function fieldInput(ctx, bf, required2) {
82468
82474
  }
82469
82475
  }
82470
82476
  function createInputs(ctx, alias2, writes) {
82471
- const inputs = { [RECORD_INPUT]: { type: "text", required: false } };
82477
+ const inputs = {};
82472
82478
  if (writes.parent !== void 0) {
82473
82479
  const via = fieldOf2(ctx, alias2, writes.parent);
82474
82480
  if (via.field.type !== "select_record_link") fail(`"${alias2}.${via.alias}" files a row under its record, so it must be a link`);
@@ -86718,6 +86724,8 @@ var READ_OPS = /* @__PURE__ */ new Set([
86718
86724
  "query",
86719
86725
  "field_options",
86720
86726
  "write_model",
86727
+ // A report the server logs; it writes nothing a session could be kept from.
86728
+ "prediction_miss",
86721
86729
  "members",
86722
86730
  "agentRuns",
86723
86731
  "agentRun.get",
@@ -86751,6 +86759,7 @@ var SUPPORTED_OPS = /* @__PURE__ */ new Set([
86751
86759
  "query",
86752
86760
  "field_options",
86753
86761
  "write_model",
86762
+ "prediction_miss",
86754
86763
  "workflow",
86755
86764
  "members",
86756
86765
  "context",
@@ -86808,12 +86817,15 @@ async function dispatchRpc(client, body, opts) {
86808
86817
  }
86809
86818
  case "write_model":
86810
86819
  return client.appWriteModel(body.app_id);
86820
+ case "prediction_miss":
86821
+ return client.appPredictionMisses(body.app_id, body.payload);
86811
86822
  case "workflow": {
86812
86823
  const p = body.payload;
86813
86824
  if (!p || typeof p.alias !== "string") {
86814
86825
  throw new Error("workflow payload must include `alias`");
86815
86826
  }
86816
- return client.appWorkflow(body.app_id, p.alias, p.inputs);
86827
+ const minted = Array.isArray(p.minted_ids) && p.minted_ids.every((id) => typeof id === "string") ? p.minted_ids : void 0;
86828
+ return client.appWorkflow(body.app_id, p.alias, p.inputs, minted);
86817
86829
  }
86818
86830
  case "members": {
86819
86831
  const p = body.payload;
@@ -89260,6 +89272,8 @@ function modelAnswer(data) {
89260
89272
  return typeof alias2 === "string" ? { fields: data.field_options[alias2] ?? {}, units: data.field_units[alias2] ?? {} } : { fields: {}, units: {} };
89261
89273
  case "write_model":
89262
89274
  return { workflows: {}, queries: {}, tables: [] };
89275
+ case "prediction_miss":
89276
+ return { ok: true };
89263
89277
  case "query": {
89264
89278
  if (typeof alias2 !== "string") throw new Error("a query names its alias; this call named none");
89265
89279
  const params = stated2(payload, "params");
@@ -1432,11 +1432,16 @@ export declare class LoticsClient {
1432
1432
  * the app's SDK whole, so its parts stay opaque here.
1433
1433
  */
1434
1434
  appWriteModel(app_id: string): Promise<unknown>;
1435
+ /**
1436
+ * Where the app's SDK drew a write the server then stored differently, counted by workflow, field and kind.
1437
+ * Mirrors POST /v1/apps/{app_id}/prediction_misses; the server checks the report's shape.
1438
+ */
1439
+ appPredictionMisses(app_id: string, report: unknown): Promise<unknown>;
1435
1440
  /**
1436
1441
  * Execute a workflow by alias declared in package.json#lotics.workflows.
1437
1442
  * Mirrors POST /v1/apps/{app_id}/workflows/{alias}/execute.
1438
1443
  */
1439
- appWorkflow(app_id: string, alias: string, inputs: unknown): Promise<unknown>;
1444
+ appWorkflow(app_id: string, alias: string, inputs: unknown, minted_ids?: readonly string[]): Promise<unknown>;
1440
1445
  /**
1441
1446
  * Bind (create or replace) an app workflow by alias via the `set_app_workflow`
1442
1447
  * tool — the SINGLE author of `apps.workflows` + the workflow row. `source` is
@@ -891,17 +891,24 @@ var LoticsClient = class {
891
891
  async appWriteModel(app_id) {
892
892
  return this.request("GET", `/v1/apps/${encodeURIComponent(app_id)}/write_model`);
893
893
  }
894
+ /**
895
+ * Where the app's SDK drew a write the server then stored differently, counted by workflow, field and kind.
896
+ * Mirrors POST /v1/apps/{app_id}/prediction_misses; the server checks the report's shape.
897
+ */
898
+ async appPredictionMisses(app_id, report) {
899
+ return this.request("POST", `/v1/apps/${encodeURIComponent(app_id)}/prediction_misses`, report);
900
+ }
894
901
  /**
895
902
  * Execute a workflow by alias declared in package.json#lotics.workflows.
896
903
  * Mirrors POST /v1/apps/{app_id}/workflows/{alias}/execute.
897
904
  */
898
- async appWorkflow(app_id, alias, inputs) {
905
+ async appWorkflow(app_id, alias, inputs, minted_ids) {
899
906
  const url = `${this.baseUrl}/v1/apps/${encodeURIComponent(app_id)}/workflows/${encodeURIComponent(alias)}/execute`;
900
907
  const headers = this.buildHeaders();
901
908
  headers["Content-Type"] = "application/json";
902
909
  let response;
903
910
  try {
904
- response = await fetch(url, { method: "POST", headers, body: JSON.stringify({ inputs }) });
911
+ response = await fetch(url, { method: "POST", headers, body: JSON.stringify({ inputs, ...minted_ids === void 0 ? {} : { minted_ids } }) });
905
912
  } catch (err) {
906
913
  return { status: "error", message: err instanceof Error ? err.message : "The workflow request failed." };
907
914
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lotics/cli",
3
- "version": "0.261.0",
3
+ "version": "0.263.0",
4
4
  "description": "Lotics SDK and CLI for AI agents",
5
5
  "type": "module",
6
6
  "bin": {