@helm-ai/cli 1.2.0 → 1.4.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.
Files changed (2) hide show
  1. package/dist/cli.js +37 -3
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -25,7 +25,7 @@ function renderSplash(ctx) {
25
25
  }
26
26
 
27
27
  // src/version.ts
28
- var version = "1.2.0";
28
+ var version = "1.4.0";
29
29
 
30
30
  // src/commands/auth.ts
31
31
  import prompts from "prompts";
@@ -67,6 +67,16 @@ var HelmModuleDisabledError = class extends HelmError {
67
67
  }
68
68
  module;
69
69
  };
70
+ var HelmAccessDeniedError = class extends HelmError {
71
+ constructor(area, level, message) {
72
+ super(message);
73
+ this.area = area;
74
+ this.level = level;
75
+ this.name = "HelmAccessDeniedError";
76
+ }
77
+ area;
78
+ level;
79
+ };
70
80
  var HelmValidationError = class extends HelmError {
71
81
  constructor(message) {
72
82
  super(message);
@@ -81,6 +91,14 @@ var HelmNetworkError = class extends HelmError {
81
91
  };
82
92
  function parseApiError(status, body) {
83
93
  const errMsg = body?.error || body?.message || `Request failed with status ${status}`;
94
+ const accessMatch = errMsg.match(/^ACCESS_DENIED:(\w+):(\w+)(?: - (.*))?/s);
95
+ if (accessMatch) {
96
+ return new HelmAccessDeniedError(
97
+ accessMatch[1],
98
+ accessMatch[2],
99
+ accessMatch[3] || "You don't have access to that part of this workspace."
100
+ );
101
+ }
84
102
  if (status === 401 || status === 403) {
85
103
  return new HelmAuthError(errMsg);
86
104
  }
@@ -3476,7 +3494,10 @@ function registerCalendarCommands(parent) {
3476
3494
  return;
3477
3495
  }
3478
3496
  });
3479
- cmd.command("create").description("Create a calendar event").requiredOption("-t, --title <title>").requiredOption("--start <date>", "ISO 8601 start time").requiredOption("--end <date>", "ISO 8601 end time").option("-d, --description <text>").option("--location <text>").option("--all-day").option("--meet", "auto-create Google Meet link").option("--zoom <url>", "attach a Zoom URL").option("--project <id>").option("--company <id>").option("-p, --profile <name>").action(async (opts) => {
3497
+ cmd.command("create").description("Create a calendar event").requiredOption("-t, --title <title>").requiredOption("--start <date>", "ISO 8601 start time").requiredOption("--end <date>", "ISO 8601 end time").option("-d, --description <text>").option("--location <text>").option("--all-day").option("--meet", "auto-create Google Meet link").option("--zoom <url>", "attach a Zoom URL").option("--project <id>").option("--company <id>").option("--timezone <iana>", "IANA zone, e.g. America/Los_Angeles: --start/--end without an offset are read as wall-clock time there, and a repeating event keeps that local time across daylight saving (default: UTC)").option(
3498
+ "--repeat <rule>",
3499
+ "repeat it: daily, weekly, monthly or yearly (from the start date), or an RRULE line such as 'FREQ=WEEKLY;BYDAY=MO,WE;COUNT=10'. Needs Google Calendar connected"
3500
+ ).option("-p, --profile <name>").action(async (opts) => {
3480
3501
  try {
3481
3502
  const client = HelmClient.fromProfile(resolveProfile(opts.profile));
3482
3503
  const event = await client.calendar.create({
@@ -3489,7 +3510,9 @@ function registerCalendarCommands(parent) {
3489
3510
  conference_provider: opts.meet ? "google_meet" : opts.zoom ? "zoom" : void 0,
3490
3511
  conference_url: opts.zoom,
3491
3512
  project_id: opts.project,
3492
- company_id: opts.company
3513
+ company_id: opts.company,
3514
+ timezone: opts.timezone,
3515
+ recurrence: repeatRule(opts.repeat)
3493
3516
  });
3494
3517
  console.log(JSON.stringify(event, null, 2));
3495
3518
  } catch (err) {
@@ -3510,6 +3533,17 @@ function registerCalendarCommands(parent) {
3510
3533
  }
3511
3534
  });
3512
3535
  }
3536
+ function repeatRule(value) {
3537
+ if (!value) return void 0;
3538
+ const word = value.trim().toLowerCase();
3539
+ const presets = {
3540
+ daily: "RRULE:FREQ=DAILY",
3541
+ weekly: "RRULE:FREQ=WEEKLY",
3542
+ monthly: "RRULE:FREQ=MONTHLY",
3543
+ yearly: "RRULE:FREQ=YEARLY"
3544
+ };
3545
+ return presets[word] ?? value.trim();
3546
+ }
3513
3547
 
3514
3548
  // src/commands/doc.ts
3515
3549
  import { InvalidArgumentError as InvalidArgumentError3 } from "commander";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@helm-ai/cli",
3
- "version": "1.2.0",
3
+ "version": "1.4.0",
4
4
  "description": "Command line interface for Helm",
5
5
  "type": "module",
6
6
  "main": "dist/cli.js",