openmates 0.15.0-alpha.23 → 0.15.0-alpha.25

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.
@@ -3853,7 +3853,8 @@ function normalizeUnixSeconds(value, fallback) {
3853
3853
  }
3854
3854
  function getClientMessagesVersionForSync(cached) {
3855
3855
  if (cached.messages.length === 0) return 0;
3856
- return typeof cached.details.messages_v === "number" ? cached.details.messages_v : 0;
3856
+ const messagesVersion = typeof cached.details.messages_v === "number" ? cached.details.messages_v : 0;
3857
+ return Math.min(messagesVersion, cached.messages.length);
3857
3858
  }
3858
3859
  var INTEREST_TAG_IDS = [
3859
3860
  "software_development",
@@ -5595,7 +5596,7 @@ var OpenMatesClient = class _OpenMatesClient {
5595
5596
  * @param query Full UUID, 8-char short ID, or chat title.
5596
5597
  */
5597
5598
  async getChatMessages(query) {
5598
- const cache = await this.ensureSynced();
5599
+ const cache = await this.ensureSynced(true);
5599
5600
  const masterKey = this.getMasterKeyBytes();
5600
5601
  const normalized = query.trim().toLowerCase();
5601
5602
  let found;
@@ -43125,7 +43126,7 @@ Only output the final Markdown table. Do NOT include explanations, notes, or any
43125
43126
  text: "@skill:tasks:create Do not ask follow-up questions. Create exactly these three tasks for a public OpenMates demo release checklist. Task 1 title: Review transcript for private data. Description: Confirm the source chat does not contain secrets, personal data, or private account details before publishing. Assign to me. Task 2 title: Verify Tasks and Workflows embeds. Description: Open the public example pages and confirm both parent embeds and child previews render and open fullscreen. Assign to me. Task 3 title: Write public release note. Description: Draft a short release note for developers explaining that the examples come from real CLI-created app-skill chats. Assign to OpenMates."
43126
43127
  },
43127
43128
  message_2: {
43128
- text: '```json\n{"type": "app_skill_use", "embed_id": "7996e3b5-8d25-46bd-b527-8da6f9c65ecf", "app_id": "tasks", "skill_id": "create"}\n```\n\nI\'ve created the three tasks for the OpenMates demo release checklist:\n\n1. **Review transcript for private data** (Assigned to you)\n2. **Verify Tasks and Workflows embeds** (Assigned to you)\n3. **Write public release note** (Assigned to OpenMates)'
43129
+ text: '```json\n{"type": "app_skill_use", "embed_id": "7996e3b5-8d25-46bd-b527-8da6f9c65ecf", "app_id": "tasks", "skill_id": "create"}\n```\n\nIch habe die drei Aufgaben f\xFCr die OpenMates-Demo-Release-Checkliste erstellt:\n\n1. **Transkript auf private Daten pr\xFCfen** (dir zugewiesen)\n2. **Tasks- und Workflows-Embeds pr\xFCfen** (dir zugewiesen)\n3. **\xD6ffentliche Release-Notiz schreiben** (OpenMates zugewiesen)'
43129
43130
  }
43130
43131
  },
43131
43132
  family_stays_kyoto: {
@@ -43509,7 +43510,7 @@ How are you leaning personally on this issue heading into the dinner? Are you ho
43509
43510
  text: "@skill:workflows:create-or-modify Do not ask follow-up questions. Create a simple manual workflow titled Library Book Return Checklist. It should have a manual trigger and three manual steps: gather borrowed books from the shelf, check due dates in the library account, and pack books in a tote bag before leaving home. Keep it concise and suitable for a public demo."
43510
43511
  },
43511
43512
  message_2: {
43512
- text: '```json\n{"type": "app_skill_use", "embed_id": "cda4695f-7f68-42d7-9cfe-d719aa08dc3e", "app_id": "workflows", "skill_id": "create-or-modify"}\n```\n\nI have created the **Library Book Return Checklist** workflow. This manual automation includes the following steps:\n\n1. **Gather books**: Gather borrowed books from the shelf.\n2. **Check due dates**: Check due dates in the library account.\n3. **Pack tote bag**: Pack books in a tote bag before leaving home.\n\nYou can view and manage this checklist in the [Workflows app](/#settings/apps/workflows).'
43513
+ text: '```json\n{"type": "app_skill_use", "embed_id": "cda4695f-7f68-42d7-9cfe-d719aa08dc3e", "app_id": "workflows", "skill_id": "create-or-modify"}\n```\n\nIch habe den Workflow **Bibliotheksb\xFCcher-R\xFCckgabe-Checkliste** erstellt. Diese manuelle Automatisierung enth\xE4lt die folgenden Schritte:\n\n1. **B\xFCcher zusammensuchen**: Ausgeliehene B\xFCcher aus dem Regal nehmen.\n2. **F\xE4lligkeitsdaten pr\xFCfen**: F\xE4lligkeitsdaten im Bibliothekskonto pr\xFCfen.\n3. **Stofftasche packen**: B\xFCcher vor dem Verlassen des Hauses in eine Stofftasche packen.\n\nDu kannst diese Checkliste in der [Workflows-App](/#settings/apps/workflows) ansehen und verwalten.'
43513
43514
  }
43514
43515
  },
43515
43516
  mastodon_account_recent_posts: {
@@ -58327,7 +58328,7 @@ async function handleTasks(client, subcommand, rest, flags) {
58327
58328
  return;
58328
58329
  }
58329
58330
  const masterKey = client.getMasterKeyBytes();
58330
- const scope = taskScopeFromFlags(flags);
58331
+ const scope = taskScopeFromFlags(flags, masterKey);
58331
58332
  if (subcommand === "list" || subcommand === "status") {
58332
58333
  if (subcommand === "status" && rest[0]) {
58333
58334
  const task = await resolveTask(client, masterKey, rest[0], scope);
@@ -58357,12 +58358,14 @@ async function handleTasks(client, subcommand, rest, flags) {
58357
58358
  const input = await buildCreateUserTaskInput(masterKey, {
58358
58359
  title,
58359
58360
  description: typeof flags.description === "string" ? flags.description : "",
58361
+ labels: labelFlags(flags),
58360
58362
  status: normalizeTaskStatus(typeof flags.status === "string" ? flags.status : void 0),
58361
58363
  assign: taskAssignFlag(flags),
58362
58364
  chatId: typeof flags.chat === "string" ? flags.chat : null,
58363
58365
  projectIds: splitCsvFlag(flags.project ?? flags.projects),
58364
58366
  planId: typeof flags.plan === "string" ? flags.plan : null,
58365
- dueAt: parseDueAt(flags.due)
58367
+ dueAt: parseDueAt(flags.due),
58368
+ priority: typeof flags.priority === "string" ? normalizeTaskPriority(flags.priority) : void 0
58366
58369
  });
58367
58370
  const created = await client.createUserTask(input);
58368
58371
  printTaskOutput(await decryptUserTask(created, masterKey), flags);
@@ -58375,11 +58378,15 @@ async function handleTasks(client, subcommand, rest, flags) {
58375
58378
  const patch = await buildUpdateUserTaskInput(task, masterKey, {
58376
58379
  title: typeof flags.title === "string" ? flags.title : void 0,
58377
58380
  description: typeof flags.description === "string" ? flags.description : void 0,
58381
+ labels: flags.label || flags.labels || flags.tag || flags.tags ? labelFlags(flags) : void 0,
58382
+ addLabels: labelFlags(flags, "add-label", "add-labels", "add-tag", "add-tags"),
58383
+ removeLabels: labelFlags(flags, "remove-label", "remove-labels", "remove-tag", "remove-tags"),
58378
58384
  status: normalizeTaskStatus(typeof flags.status === "string" ? flags.status : void 0),
58379
58385
  assign: taskAssignFlag(flags),
58380
58386
  chatId: flags.chat === true ? null : typeof flags.chat === "string" ? flags.chat : void 0,
58381
58387
  projectIds: flags.project || flags.projects ? splitCsvFlag(flags.project ?? flags.projects) : void 0,
58382
- planId: flags.plan === true ? null : typeof flags.plan === "string" ? flags.plan : void 0
58388
+ planId: flags.plan === true ? null : typeof flags.plan === "string" ? flags.plan : void 0,
58389
+ priority: typeof flags.priority === "string" ? normalizeTaskPriority(flags.priority) : void 0
58383
58390
  });
58384
58391
  const updated = await client.updateUserTask(task.taskId, patch);
58385
58392
  printTaskOutput(await decryptUserTask(updated, masterKey), flags);
@@ -58432,16 +58439,18 @@ async function handleTasks(client, subcommand, rest, flags) {
58432
58439
  }
58433
58440
  throw new Error(`Unknown tasks command '${subcommand}'. Run 'openmates tasks --help'.`);
58434
58441
  }
58435
- function taskScopeFromFlags(flags) {
58442
+ function taskScopeFromFlags(flags, masterKey) {
58436
58443
  return {
58437
58444
  status: normalizeTaskStatus(typeof flags.status === "string" ? flags.status : void 0),
58438
58445
  chatId: typeof flags.chat === "string" ? flags.chat : void 0,
58439
58446
  projectId: typeof flags.project === "string" ? flags.project : void 0,
58440
- planId: typeof flags.plan === "string" ? flags.plan : void 0
58447
+ planId: typeof flags.plan === "string" ? flags.plan : void 0,
58448
+ labelHashes: labelHashes(masterKey, labelFlags(flags)),
58449
+ priority: typeof flags.priority === "string" ? normalizeTaskPriority(flags.priority) : void 0
58441
58450
  };
58442
58451
  }
58443
58452
  async function loadTasks(client, masterKey, scope) {
58444
- const records = await client.listUserTasks({ status: scope.status, chatId: scope.chatId, projectId: scope.projectId });
58453
+ const records = await client.listUserTasks({ status: scope.status, chatId: scope.chatId, projectId: scope.projectId, labelHashes: scope.labelHashes, priority: scope.priority });
58445
58454
  const tasks = await decryptUserTasks(records, masterKey);
58446
58455
  return scope.planId ? tasks.filter((task) => task.planId === scope.planId) : tasks;
58447
58456
  }
@@ -58462,6 +58471,7 @@ function taskToJson(task) {
58462
58471
  short_id: task.shortId,
58463
58472
  title: task.title,
58464
58473
  description: task.description,
58474
+ labels: task.labels,
58465
58475
  tags: task.tags,
58466
58476
  latest_instruction: task.latestInstruction,
58467
58477
  status: task.status,
@@ -58472,6 +58482,7 @@ function taskToJson(task) {
58472
58482
  plan_id: task.planId,
58473
58483
  due_at: task.dueAt,
58474
58484
  priority: task.priority,
58485
+ priority_level: task.priorityLevel,
58475
58486
  position: task.position,
58476
58487
  queue_state: task.queueState,
58477
58488
  blocked_reason_code: task.blockedReasonCode,
@@ -58487,6 +58498,10 @@ function taskTitleFromFlagsOrRest(flags, rest) {
58487
58498
  function taskAssignFlag(flags) {
58488
58499
  return typeof flags.assign === "string" ? flags.assign : typeof flags.assignee === "string" ? flags.assignee : void 0;
58489
58500
  }
58501
+ function labelFlags(flags, ...names) {
58502
+ const keys = names.length > 0 ? names : ["label", "labels", "tag", "tags"];
58503
+ return normalizeLabels(keys.flatMap((key) => splitCsvFlag(flags[key])));
58504
+ }
58490
58505
  async function handleRemoteAccess(client, subcommand, rest, flags) {
58491
58506
  if (!subcommand || subcommand === "help" || flags.help === true) {
58492
58507
  printRemoteAccessHelp();
@@ -62591,7 +62606,7 @@ async function sendMessageStreaming(client, params, redactor) {
62591
62606
  uploadResult,
62592
62607
  fe.displayName,
62593
62608
  session,
62594
- { chatId: params.chatId, requestId: uploadResult.embed_id }
62609
+ { chatId: params.chatId, requestId: fe.embed.embedId }
62595
62610
  ) : null;
62596
62611
  const embedRef = fe.embed.embedRef ?? createEmbedRef(embedType, uploadResult.embed_id);
62597
62612
  fe.embed.embedRef = embedRef;
@@ -62644,7 +62659,6 @@ async function sendMessageStreaming(client, params, redactor) {
62644
62659
  fe.embed.content = toonEncodeContent(uploadedContent);
62645
62660
  fe.embed.status = embedType === "pdf" ? "processing" : "finished";
62646
62661
  fe.embed.contentHash = uploadResult.content_hash;
62647
- fe.embed.embedId = uploadResult.embed_id;
62648
62662
  fe.referenceBlock = createEmbedReferenceBlock(embedRef);
62649
62663
  if (!params.json) {
62650
62664
  process.stderr.write(
@@ -64517,11 +64531,11 @@ Examples:
64517
64531
  }
64518
64532
  function printTasksHelp() {
64519
64533
  console.log(`Tasks commands:
64520
- openmates tasks list [--status <status>] [--chat <id>] [--project <id>] [--json]
64521
- openmates tasks board [--chat <id>] [--project <id>] [--json]
64534
+ openmates tasks list [--status <status>] [--chat <id>] [--project <id>] [--label <label>] [--priority <level>] [--json]
64535
+ openmates tasks board [--chat <id>] [--project <id>] [--label <label>] [--priority <level>] [--json]
64522
64536
  openmates tasks show <task-id|short-id> [--json]
64523
- openmates tasks create --title <title> [--description <text>] [--assign user|ai] [--chat <id>] [--project <id>] [--status <status>] [--due <date>] [--json]
64524
- openmates tasks edit <task-id|short-id> [--title <title>] [--description <text>] [--assign user|ai] [--status <status>] [--json]
64537
+ openmates tasks create --title <title> [--description <text>] [--assign user|ai] [--chat <id>] [--project <id>] [--label <label>] [--priority <level>] [--status <status>] [--due <date>] [--json]
64538
+ openmates tasks edit <task-id|short-id> [--title <title>] [--description <text>] [--label <label>] [--add-label <label>] [--remove-label <label>] [--priority <level>] [--assign user|ai] [--status <status>] [--json]
64525
64539
  openmates tasks delete <task-id|short-id> --confirm [--json]
64526
64540
  openmates tasks start <task-id|short-id> [--json]
64527
64541
  openmates tasks status [<task-id|short-id>] [--json]
@@ -64539,9 +64553,13 @@ Chat-scoped aliases:
64539
64553
  Statuses:
64540
64554
  backlog, todo, in_progress, blocked, done
64541
64555
 
64556
+ Priority levels:
64557
+ none, low, medium, high, urgent
64558
+
64542
64559
  Notes:
64543
64560
  Task IDs accept full task_id or human short IDs such as OM-6.
64544
- Normal output decrypts task title and description locally; use --json for machine-readable plaintext fields.`);
64561
+ Labels organize tasks privately. --tag, --tags, --add-tag, and --remove-tag are accepted aliases.
64562
+ Normal output decrypts task title, description, and labels locally; use --json for machine-readable plaintext fields.`);
64545
64563
  }
64546
64564
  function printDraftsHelp() {
64547
64565
  console.log(`Draft commands:
package/dist/cli.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  getExtForLang,
4
4
  serializeToYaml
5
- } from "./chunk-7ONUJGJ2.js";
5
+ } from "./chunk-SK2NK7LX.js";
6
6
  import "./chunk-AXNRPVLE.js";
7
7
  export {
8
8
  getExtForLang,
package/dist/index.js CHANGED
@@ -18,7 +18,7 @@ import {
18
18
  reconcileAuthoritativeChats,
19
19
  renderSupportInfo,
20
20
  serializeToYaml
21
- } from "./chunk-7ONUJGJ2.js";
21
+ } from "./chunk-SK2NK7LX.js";
22
22
  import "./chunk-AXNRPVLE.js";
23
23
  export {
24
24
  APP_SKILL_METADATA,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openmates",
3
- "version": "0.15.0-alpha.23",
3
+ "version": "0.15.0-alpha.25",
4
4
  "description": "OpenMates CLI and SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",