openmates 0.15.0-alpha.95 → 0.15.0-alpha.97

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.
@@ -15624,6 +15624,11 @@ Note: The 'id' field is auto-generated if not provided - you don't need to inclu
15624
15624
  "type": "integer",
15625
15625
  "description": "Maximum total duration for the first leg, in minutes."
15626
15626
  },
15627
+ "min_transfer_minutes": {
15628
+ "type": "integer",
15629
+ "description": "Minimum acceptable layover or transfer duration, in minutes. Defaults to 10.",
15630
+ "default": 10
15631
+ },
15627
15632
  "max_layover_minutes": {
15628
15633
  "type": "integer",
15629
15634
  "description": "Maximum allowed layover or transfer duration, in minutes."
@@ -68156,7 +68161,7 @@ async function handleTasks(client, subcommand, rest, flags, redactor) {
68156
68161
  if (exactAsk) {
68157
68162
  const result2 = await client.askUserTasks({ instruction, ...exactAsk });
68158
68163
  if (await handleWorkspaceAskFallbackChat(client, "task", instruction, result2, flags, redactor)) return;
68159
- printAskApplyResult("task", result2, flags);
68164
+ printAskApplyResult("task", await prepareTaskAskOutput(result2, masterKey), flags);
68160
68165
  return;
68161
68166
  }
68162
68167
  const proposals = await proposeTasksForAsk(client, instruction, flags);
@@ -68177,7 +68182,7 @@ async function handleTasks(client, subcommand, rest, flags, redactor) {
68177
68182
  }
68178
68183
  const result = await client.askUserTasks({ instruction, encryptedCreates });
68179
68184
  if (await handleWorkspaceAskFallbackChat(client, "task", instruction, result, flags, redactor)) return;
68180
- printAskApplyResult("task", result, flags);
68185
+ printAskApplyResult("task", await prepareTaskAskOutput(result, masterKey), flags);
68181
68186
  return;
68182
68187
  }
68183
68188
  if (subcommand === "create") {
@@ -68340,6 +68345,42 @@ function splitTaskAskInstruction(instruction) {
68340
68345
  const suffix = instruction.includes(":") ? instruction.split(":").slice(1).join(":") : instruction;
68341
68346
  return suffix.split(/[,;]\s*/).map((title) => title.trim()).filter(Boolean).map((title) => ({ title }));
68342
68347
  }
68348
+ function isRecord2(value) {
68349
+ return typeof value === "object" && value !== null && !Array.isArray(value);
68350
+ }
68351
+ function isPrivateCliOutputKey(key) {
68352
+ return key === "linked_project_hashes" || key.startsWith("encrypted_") || key.startsWith("hashed_");
68353
+ }
68354
+ function sanitizeWorkspaceAskOutput(value) {
68355
+ if (Array.isArray(value)) return value.map((item) => sanitizeWorkspaceAskOutput(item));
68356
+ if (!isRecord2(value)) return value;
68357
+ const sanitized = {};
68358
+ for (const [key, nested] of Object.entries(value)) {
68359
+ if (isPrivateCliOutputKey(key)) continue;
68360
+ sanitized[key] = sanitizeWorkspaceAskOutput(nested);
68361
+ }
68362
+ return sanitized;
68363
+ }
68364
+ async function prepareTaskAskOutput(result, masterKey) {
68365
+ const output = sanitizeWorkspaceAskOutput(result);
68366
+ if (isRecord2(result.task)) {
68367
+ output.task = taskToJson(await decryptUserTask(result.task, masterKey));
68368
+ }
68369
+ if (Array.isArray(result.tasks) && result.tasks.every(isRecord2)) {
68370
+ output.tasks = (await decryptUserTasks(result.tasks, masterKey)).map(taskToJson);
68371
+ }
68372
+ return output;
68373
+ }
68374
+ async function preparePlanAskOutput(result, masterKey) {
68375
+ const output = sanitizeWorkspaceAskOutput(result);
68376
+ if (isRecord2(result.plan)) {
68377
+ output.plan = planToJson(await decryptUserPlan(result.plan, masterKey));
68378
+ }
68379
+ if (Array.isArray(result.plans) && result.plans.every(isRecord2)) {
68380
+ output.plans = (await decryptUserPlans(result.plans, masterKey)).map(planToJson);
68381
+ }
68382
+ return output;
68383
+ }
68343
68384
  function printHistoryCommands(history) {
68344
68385
  if (!history) return;
68345
68386
  const changeSetId = typeof history.change_set?.change_set_id === "string" ? history.change_set.change_set_id : void 0;
@@ -68880,7 +68921,7 @@ async function handlePlans(client, subcommand, rest, flags, redactor) {
68880
68921
  if (exactAsk) {
68881
68922
  const result2 = await client.askUserPlans({ instruction, ...exactAsk });
68882
68923
  if (await handleWorkspaceAskFallbackChat(client, "plan", instruction, result2, flags, redactor)) return;
68883
- printAskApplyResult("plan", result2, flags);
68924
+ printAskApplyResult("plan", await preparePlanAskOutput(result2, masterKey), flags);
68884
68925
  return;
68885
68926
  }
68886
68927
  const proposal = isShortWorkspaceAsk(instruction) ? { title: instruction, summary: "", goal: instruction } : extractRecord(await client.planUserPlanAsk({ instruction }), "proposed_plan");
@@ -68901,7 +68942,7 @@ async function handlePlans(client, subcommand, rest, flags, redactor) {
68901
68942
  });
68902
68943
  const result = await client.askUserPlans({ instruction, encryptedCreate: input });
68903
68944
  if (await handleWorkspaceAskFallbackChat(client, "plan", instruction, result, flags, redactor)) return;
68904
- printAskApplyResult("plan", result, flags);
68945
+ printAskApplyResult("plan", await preparePlanAskOutput(result, masterKey), flags);
68905
68946
  return;
68906
68947
  }
68907
68948
  if (subcommand === "create") {
@@ -69030,7 +69071,7 @@ async function handlePlans(client, subcommand, rest, flags, redactor) {
69030
69071
  }
69031
69072
  if (subcommand === "complete" || subcommand === "done") {
69032
69073
  const plan = await requiredResolvedPlan(client, masterKey, rest[0], scope, subcommand);
69033
- const completed = await client.completeUserPlan(plan.planId, { version: plan.version });
69074
+ const completed = await client.completeUserPlan(plan.planId, { version: plan.version, updated_at: Math.floor(Date.now() / 1e3) });
69034
69075
  printPlanOutput(await decryptUserPlan(completed, masterKey), flags);
69035
69076
  return;
69036
69077
  }
@@ -71791,8 +71832,10 @@ function buildTravelConnectionsRequest(positionals, flags) {
71791
71832
  const request = {
71792
71833
  legs: [{ origin, destination, date }]
71793
71834
  };
71835
+ const transportMethods = csvFlag(flags, "transport_methods") ?? csvFlag(flags, "transport-methods");
71794
71836
  const transport = stringFlag2(flags, "transport") ?? stringFlag2(flags, "transport-method");
71795
- if (transport) request.transport_methods = [transport];
71837
+ if (transportMethods) request.transport_methods = transportMethods;
71838
+ else if (transport) request.transport_methods = [transport];
71796
71839
  const providers = csvFlag(flags, "providers") ?? csvFlag(flags, "provider");
71797
71840
  if (providers) request.providers = providers;
71798
71841
  const ownedPasses = csvFlag(flags, "owned_passes") ?? csvFlag(flags, "owned-passes");
@@ -71801,6 +71844,10 @@ function buildTravelConnectionsRequest(positionals, flags) {
71801
71844
  if (railProducts) request.rail_products = railProducts;
71802
71845
  const passOnly = booleanFlag(flags, "pass_only") ?? booleanFlag(flags, "pass-only");
71803
71846
  if (passOnly !== void 0) request.pass_only = passOnly;
71847
+ const minTransferMinutes = integerFlag(flags, "min_transfer_minutes") ?? integerFlag(flags, "min-transfer-minutes");
71848
+ if (minTransferMinutes !== void 0) request.min_transfer_minutes = minTransferMinutes;
71849
+ const maxResults = integerFlag(flags, "max_results") ?? integerFlag(flags, "max-results");
71850
+ if (maxResults !== void 0) request.max_results = maxResults;
71804
71851
  return request;
71805
71852
  }
71806
71853
  function buildCodeImageToHtmlRequest(positionals, flags) {
@@ -71872,6 +71919,14 @@ function booleanFlag(flags, name) {
71872
71919
  if (["0", "false", "no", "off"].includes(normalized)) return false;
71873
71920
  return true;
71874
71921
  }
71922
+ function integerFlag(flags, name) {
71923
+ const raw = readFlag(flags, name);
71924
+ if (raw === void 0) return void 0;
71925
+ if (typeof raw !== "string") throw new Error(`--${kebabCase(name)} requires an integer value`);
71926
+ const parsed = Number.parseInt(raw, 10);
71927
+ if (!Number.isInteger(parsed)) throw new Error(`--${kebabCase(name)} must be an integer`);
71928
+ return parsed;
71929
+ }
71875
71930
  function coerceAppSkillFlagValue(name, raw, schema) {
71876
71931
  if (schema.type === "boolean") return raw === true || raw === "true";
71877
71932
  if (schema.type === "integer") {
package/dist/cli.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  buildTravelConnectionsRequest,
4
4
  getExtForLang,
5
5
  serializeToYaml
6
- } from "./chunk-PQIB3PTD.js";
6
+ } from "./chunk-YRIKOMBJ.js";
7
7
  import "./chunk-MLWBMJEN.js";
8
8
  export {
9
9
  buildTravelConnectionsRequest,
package/dist/index.d.ts CHANGED
@@ -4807,6 +4807,11 @@ declare const APP_SKILL_METADATA: readonly [{
4807
4807
  readonly type: "integer";
4808
4808
  readonly description: "Maximum total duration for the first leg, in minutes.";
4809
4809
  };
4810
+ readonly min_transfer_minutes: {
4811
+ readonly type: "integer";
4812
+ readonly description: "Minimum acceptable layover or transfer duration, in minutes. Defaults to 10.";
4813
+ readonly default: 10;
4814
+ };
4810
4815
  readonly max_layover_minutes: {
4811
4816
  readonly type: "integer";
4812
4817
  readonly description: "Maximum allowed layover or transfer duration, in minutes.";
package/dist/index.js CHANGED
@@ -36,7 +36,7 @@ import {
36
36
  renderPlanList,
37
37
  renderSupportInfo,
38
38
  serializeToYaml
39
- } from "./chunk-PQIB3PTD.js";
39
+ } from "./chunk-YRIKOMBJ.js";
40
40
  import "./chunk-MLWBMJEN.js";
41
41
  export {
42
42
  APP_SKILL_METADATA,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openmates",
3
- "version": "0.15.0-alpha.95",
3
+ "version": "0.15.0-alpha.97",
4
4
  "description": "OpenMates CLI and SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",