openmates 0.27.0-alpha.38 → 0.27.0-alpha.39

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.
@@ -91093,33 +91093,59 @@ async function handleTuiSettingsKey(ctx, chunk, key) {
91093
91093
  }
91094
91094
  return true;
91095
91095
  }
91096
- function displayValue(key, value) {
91097
- if (isSecret(key)) return "[hidden]";
91098
- if (value === null || value === void 0 || value === "") return "\u2014";
91096
+ var summaryFields = {
91097
+ "account/info": [["username", "Username"], ["email", "Email"], ["timezone", "Timezone"], ["language", "Language"]],
91098
+ "account/storage": [["used_bytes", "Used bytes"], ["total_bytes", "Total bytes"], ["file_count", "Files"]],
91099
+ "account/chats": [["chat_count", "Chats"], ["message_count", "Messages"]],
91100
+ "billing/overview": [["credits", "Credits"], ["balance", "Balance"], ["currency", "Currency"]],
91101
+ "billing/usage": [["total_credits", "Credits used"], ["total_cost", "Total cost"], ["currency", "Currency"]]
91102
+ };
91103
+ var listFields = {
91104
+ "account/storage/files": { key: "files", fields: [["filename", "File"], ["id", "File ID"], ["size", "Bytes"]] },
91105
+ "billing/invoices": { key: "invoices", fields: [["id", "Invoice ID"], ["date", "Date"], ["status", "Status"], ["amount", "Amount"], ["currency", "Currency"]] },
91106
+ "billing/bank-transfer": { key: "orders", fields: [["id", "Order ID"], ["status", "Status"], ["credits", "Credits"], ["amount", "Amount"], ["currency", "Currency"]] },
91107
+ "billing/gift-cards": { key: "gift_cards", fields: [["id", "Gift card ID"], ["credits", "Credits"], ["status", "Status"]] },
91108
+ "billing/gift-cards/bank-transfer": { key: "orders", fields: [["id", "Order ID"], ["status", "Status"], ["credits", "Credits"]] },
91109
+ "developers/api-keys": { key: "api_keys", fields: [["name", "Name"], ["id", "Key ID"], ["full_access", "Full access"], ["expires_at", "Expires"]] },
91110
+ "settings_memories/list": { key: "memories", fields: [["title", "Title"], ["id", "Memory ID"]] }
91111
+ };
91112
+ var resultFields = {
91113
+ "billing/bank-transfer": [["order_id", "Order ID"], ["payment_reference", "Reference"], ["iban", "IBAN"], ["recipient", "Recipient"], ["amount", "Amount"], ["currency", "Currency"]],
91114
+ "billing/gift-cards/bank-transfer": [["order_id", "Order ID"], ["payment_reference", "Reference"], ["iban", "IBAN"], ["recipient", "Recipient"], ["amount", "Amount"], ["currency", "Currency"]],
91115
+ "billing/gift-cards": [["credits", "Credits redeemed"]]
91116
+ };
91117
+ function scalarValue(value) {
91099
91118
  if (typeof value === "boolean") return value ? "Yes" : "No";
91100
- if (typeof value === "number" || typeof value === "string") return safeText2(value);
91101
- if (Array.isArray(value)) return `${value.length} item${value.length === 1 ? "" : "s"}`;
91102
- return `${Object.keys(asObject(value)).length} fields`;
91103
- }
91104
- function dataLines(value, width, depth = 0) {
91105
- const entries = Array.isArray(value) ? value.slice(0, 30).map((item, index) => [String(index + 1), item]) : Object.entries(asObject(value)).slice(0, 30);
91106
- if (!entries.length) return [" No values yet."];
91107
- return entries.flatMap(([key, item]) => {
91108
- if (isSecret(key)) return [];
91109
- const label3 = safeText2(key).replaceAll("_", " ");
91110
- if (Array.isArray(item) && depth < 1) return [
91111
- ` ${label3}: ${item.length} item${item.length === 1 ? "" : "s"}`,
91112
- ...dataLines(item, width, depth + 1)
91113
- ];
91114
- if (item && typeof item === "object" && !Array.isArray(item)) {
91115
- const row3 = asObject(item);
91116
- const nested = asObject(row3.data);
91117
- const name = row3.name ?? row3.title ?? nested.name ?? nested.title ?? row3.filename ?? row3.id ?? `Item ${key}`;
91118
- return wrapCells(` ${safeText2(name)} \xB7 ${Object.entries(row3).filter(([k, v]) => !isSecret(k) && k !== "name" && k !== "title" && (typeof v === "string" || typeof v === "number" || typeof v === "boolean")).slice(0, 3).map(([k, v]) => `${k.replaceAll("_", " ")}: ${displayValue(k, v)}`).join(" \xB7 ")}`, width);
91119
- }
91120
- return wrapCells(` ${label3}: ${displayValue(key, item)}`, width);
91119
+ if (typeof value === "string" || typeof value === "number") return safeText2(value) || null;
91120
+ return null;
91121
+ }
91122
+ function allowedRows(value, fields, width) {
91123
+ const record10 = asObject(value);
91124
+ return fields.flatMap(([key, label3]) => {
91125
+ const shown = scalarValue(record10[key]);
91126
+ return shown === null ? [] : wrapCells(` ${label3}: ${shown}`, width);
91121
91127
  });
91122
91128
  }
91129
+ function settingsDataLines(page, value, width, result = false) {
91130
+ if (result) return allowedRows(value, resultFields[page.route] ?? [], width);
91131
+ if (page.save && page.defaults && page.fields) {
91132
+ const defaults = page.defaults(value);
91133
+ return allowedRows(defaults, page.fields.map(({ id, label: label3 }) => [id, label3]), width);
91134
+ }
91135
+ const summary = summaryFields[page.route];
91136
+ if (summary) return allowedRows(value, summary, width);
91137
+ const list = listFields[page.route];
91138
+ if (!list) return [];
91139
+ const collection = Array.isArray(value) ? value : asObject(value)[list.key];
91140
+ if (!Array.isArray(collection)) return [];
91141
+ return [
91142
+ ` ${collection.length} item${collection.length === 1 ? "" : "s"}`,
91143
+ ...collection.slice(0, 20).flatMap((item, index) => {
91144
+ const detail = allowedRows(item, list.fields, width);
91145
+ return detail.length ? [` ${index + 1}.`, ...detail] : [];
91146
+ })
91147
+ ];
91148
+ }
91123
91149
  function line(text7, action2, selected = false) {
91124
91150
  return { text: text7, ...action2 ? { action: { kind: "command", command: `/settings-action ${action2}` } } : {}, ...selected ? { bold: true, color: "#89c4ff" } : {} };
91125
91151
  }
@@ -91179,8 +91205,14 @@ function renderTuiSettings(state, width) {
91179
91205
  const index = ids.indexOf("web");
91180
91206
  lines.push(line(`${index + 1}. Open web destination`, "web", state.selection === index), ...wrapCells(settingsWebDestination(state.webUrl, page.webOnly), width));
91181
91207
  }
91182
- if (state.data[page.route] !== void 0 && !page.webOnly) lines.push("", "Current values:", ...dataLines(state.data[page.route], width));
91183
- if (state.lastResult[page.route] !== void 0) lines.push("", "Operation details:", ...dataLines(state.lastResult[page.route], width));
91208
+ if (state.data[page.route] !== void 0 && !page.webOnly) {
91209
+ const values = settingsDataLines(page, state.data[page.route], width);
91210
+ if (values.length) lines.push("", "Current values:", ...values);
91211
+ }
91212
+ if (state.lastResult[page.route] !== void 0) {
91213
+ const values = settingsDataLines(page, state.lastResult[page.route], width, true);
91214
+ if (values.length) lines.push("", "Operation details:", ...values);
91215
+ }
91184
91216
  if (state.oneTimeSecret) {
91185
91217
  const index = ids.indexOf("reveal-secret");
91186
91218
  lines.push("", line(`${index + 1}. ${state.secretRevealed ? "Hide" : "Reveal"} new API key`, "reveal-secret", state.selection === index));
@@ -96109,7 +96141,7 @@ function isRequired(schema, path2) {
96109
96141
  }
96110
96142
  return true;
96111
96143
  }
96112
- function displayValue2(value) {
96144
+ function displayValue(value) {
96113
96145
  return value === void 0 || value === null ? "" : typeof value === "string" ? value : JSON.stringify(value);
96114
96146
  }
96115
96147
  function buildTuiAppsSkillForm(skill) {
@@ -96122,7 +96154,7 @@ function buildTuiAppsSkillForm(skill) {
96122
96154
  fields: paths.map((path2) => ({
96123
96155
  name: path2,
96124
96156
  label: `${path2}${isRequired(skill.schema, path2) ? " *" : ""}`,
96125
- value: displayValue2(getSkillPath(skill.defaults, path2)),
96157
+ value: displayValue(getSkillPath(skill.defaults, path2)),
96126
96158
  multiline: /(?:query|prompt|message|body|text|code)$/i.test(path2)
96127
96159
  }))
96128
96160
  };
package/dist/cli.js CHANGED
@@ -21,7 +21,7 @@ import {
21
21
  shouldRequireTrustedAccountGuard,
22
22
  waitForSafeE2ETotpWindow,
23
23
  waitForWorkflowRun
24
- } from "./chunk-OTAPHPFZ.js";
24
+ } from "./chunk-K5RCVM2I.js";
25
25
  import "./chunk-B4UXKGH3.js";
26
26
  import "./chunk-IWKP55ZB.js";
27
27
  import "./chunk-FC27KZIW.js";
package/dist/index.js CHANGED
@@ -44,7 +44,7 @@ import {
44
44
  selectAssistantMessagesForSpeech,
45
45
  serializeToYaml,
46
46
  summarizeAssistantSpeech
47
- } from "./chunk-OTAPHPFZ.js";
47
+ } from "./chunk-K5RCVM2I.js";
48
48
  import "./chunk-B4UXKGH3.js";
49
49
  import "./chunk-IWKP55ZB.js";
50
50
  import "./chunk-FC27KZIW.js";
@@ -17,47 +17,47 @@
17
17
  {
18
18
  "name": "libggml-base.so",
19
19
  "bytes": 1110088,
20
- "sha256": "6a82f73cb609ff76b4bc234908daf5137fe0f9e633f3432951d7387da656a56b"
20
+ "sha256": "396036633407ea7d9a42d9f954b0747252387a0324999cde60c195c1a6d7c249"
21
21
  },
22
22
  {
23
23
  "name": "libggml-base.so.0",
24
24
  "bytes": 1110088,
25
- "sha256": "6a82f73cb609ff76b4bc234908daf5137fe0f9e633f3432951d7387da656a56b"
25
+ "sha256": "396036633407ea7d9a42d9f954b0747252387a0324999cde60c195c1a6d7c249"
26
26
  },
27
27
  {
28
28
  "name": "libggml-base.so.0.15.1",
29
29
  "bytes": 1110088,
30
- "sha256": "6a82f73cb609ff76b4bc234908daf5137fe0f9e633f3432951d7387da656a56b"
30
+ "sha256": "396036633407ea7d9a42d9f954b0747252387a0324999cde60c195c1a6d7c249"
31
31
  },
32
32
  {
33
33
  "name": "libggml-cpu.so",
34
34
  "bytes": 869800,
35
- "sha256": "c3fdd931eb7ca2236bb6b8614683efc6d74bc451b722d0dda2c316f23c2cd82f"
35
+ "sha256": "48fa0bf3a6985921060e2ab4096b444d04be0b1ccc0ce30001cb4b536b4c3aef"
36
36
  },
37
37
  {
38
38
  "name": "libggml-cpu.so.0",
39
39
  "bytes": 869800,
40
- "sha256": "c3fdd931eb7ca2236bb6b8614683efc6d74bc451b722d0dda2c316f23c2cd82f"
40
+ "sha256": "48fa0bf3a6985921060e2ab4096b444d04be0b1ccc0ce30001cb4b536b4c3aef"
41
41
  },
42
42
  {
43
43
  "name": "libggml-cpu.so.0.15.1",
44
44
  "bytes": 869800,
45
- "sha256": "c3fdd931eb7ca2236bb6b8614683efc6d74bc451b722d0dda2c316f23c2cd82f"
45
+ "sha256": "48fa0bf3a6985921060e2ab4096b444d04be0b1ccc0ce30001cb4b536b4c3aef"
46
46
  },
47
47
  {
48
48
  "name": "libggml.so",
49
49
  "bytes": 1899104,
50
- "sha256": "1099c9ae201c8b3038618afae7e8d01583f8949942045e61585bc9c28598e921"
50
+ "sha256": "7639f2e621c3824626a4fc2433544d93202bad2020cc045cfaf630e8a049ecbc"
51
51
  },
52
52
  {
53
53
  "name": "libggml.so.0",
54
54
  "bytes": 1899104,
55
- "sha256": "1099c9ae201c8b3038618afae7e8d01583f8949942045e61585bc9c28598e921"
55
+ "sha256": "7639f2e621c3824626a4fc2433544d93202bad2020cc045cfaf630e8a049ecbc"
56
56
  },
57
57
  {
58
58
  "name": "libggml.so.0.15.1",
59
59
  "bytes": 1899104,
60
- "sha256": "1099c9ae201c8b3038618afae7e8d01583f8949942045e61585bc9c28598e921"
60
+ "sha256": "7639f2e621c3824626a4fc2433544d93202bad2020cc045cfaf630e8a049ecbc"
61
61
  },
62
62
  {
63
63
  "name": "openmates-pii-worker",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openmates",
3
- "version": "0.27.0-alpha.38",
3
+ "version": "0.27.0-alpha.39",
4
4
  "description": "OpenMates CLI and SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",