openmates 0.18.0-alpha.29 → 0.18.0-alpha.30

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.
@@ -13021,7 +13021,9 @@ var OpenMatesClient = class _OpenMatesClient {
13021
13021
  if (filters.externalChatProvider) params.set("external_chat_provider", filters.externalChatProvider);
13022
13022
  if (filters.externalChatLookupHash) params.set("external_chat_lookup_hash", filters.externalChatLookupHash);
13023
13023
  if (filters.priority !== void 0) params.set("priority", String(filters.priority));
13024
- const limit = filters.limit;
13024
+ const maximumTaskListPage = 500;
13025
+ const limit = Math.min(filters.limit ?? maximumTaskListPage, maximumTaskListPage);
13026
+ if (!Number.isSafeInteger(limit) || limit <= 0) throw new Error("Invalid task list limit");
13025
13027
  if (Number.isSafeInteger(limit) && limit !== void 0 && limit > 0) params.set("limit", String(limit));
13026
13028
  const teamId = this.resolveTeamContext({ teamId: filters.teamId, personal: filters.personal });
13027
13029
  if (teamId) params.set("team_id", teamId);
@@ -13033,7 +13035,11 @@ var OpenMatesClient = class _OpenMatesClient {
13033
13035
  if (!response.ok) {
13034
13036
  throw new Error(`User task list failed with HTTP ${response.status}`);
13035
13037
  }
13036
- return response.data.tasks ?? [];
13038
+ const tasks = response.data.tasks ?? [];
13039
+ if (tasks.length >= limit) {
13040
+ throw new Error(`TASK_LIST_INCOMPLETE: server limit ${limit} reached; refusing a truncated task inventory.`);
13041
+ }
13042
+ return tasks;
13037
13043
  }
13038
13044
  async createUserTask(input, context = {}) {
13039
13045
  this.requireSession();
@@ -75097,13 +75103,13 @@ async function handleTasks(client, subcommand, rest, flags, redactor) {
75097
75103
  return;
75098
75104
  }
75099
75105
  const tasks = await loadTasks(client, masterKey, scope);
75100
- if (flags.json === true) printJson2({ tasks: tasks.map(taskToJson) });
75106
+ if (flags.json === true) printJson2({ tasks: tasks.map(taskToJson), complete: true });
75101
75107
  else console.log(renderTaskList(tasks));
75102
75108
  return;
75103
75109
  }
75104
75110
  if (subcommand === "board") {
75105
75111
  const tasks = await loadTasks(client, masterKey, scope);
75106
- if (flags.json === true) printJson2({ tasks: tasks.map(taskToJson) });
75112
+ if (flags.json === true) printJson2({ tasks: tasks.map(taskToJson), complete: true });
75107
75113
  else console.log(renderTaskBoard(tasks));
75108
75114
  return;
75109
75115
  }
@@ -75331,6 +75337,7 @@ async function resolveTaskUpdateOptions(client, masterKey, flags, input) {
75331
75337
  async function loadTasks(client, masterKey, scope, limit) {
75332
75338
  const records = await client.listUserTasks({ status: scope.status, chatId: scope.chatId, projectId: scope.projectId, labelHashes: scope.labelHashes, externalChatProvider: scope.externalChatProvider, externalChatLookupHash: scope.externalChatLookupHash, priority: scope.priority, teamId: scope.teamId, personal: scope.personal, limit });
75333
75339
  const tasks = await decryptUserTasksForCli(records, masterKey, console.error);
75340
+ if (tasks.length !== records.length) throw new Error("TASK_LIST_INCOMPLETE: one or more records could not be decrypted.");
75334
75341
  return scope.planId ? tasks.filter((task) => task.planId === scope.planId) : tasks;
75335
75342
  }
75336
75343
  async function resolveTask(client, masterKey, id, scope) {
package/dist/cli.js CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  resolveProjectContext,
13
13
  serializeToYaml,
14
14
  shouldRequireTrustedAccountGuard
15
- } from "./chunk-DL2SX5XG.js";
15
+ } from "./chunk-QLI5D3XI.js";
16
16
  import "./chunk-IWKP55ZB.js";
17
17
  import "./chunk-BBKJZ23O.js";
18
18
  export {
package/dist/index.js CHANGED
@@ -42,7 +42,7 @@ import {
42
42
  selectAssistantMessagesForSpeech,
43
43
  serializeToYaml,
44
44
  summarizeAssistantSpeech
45
- } from "./chunk-DL2SX5XG.js";
45
+ } from "./chunk-QLI5D3XI.js";
46
46
  import "./chunk-IWKP55ZB.js";
47
47
  import "./chunk-BBKJZ23O.js";
48
48
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openmates",
3
- "version": "0.18.0-alpha.29",
3
+ "version": "0.18.0-alpha.30",
4
4
  "description": "OpenMates CLI and SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",