@mulmoclaude/google-plugin 0.2.1 → 0.3.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.
package/dist/args.d.ts CHANGED
@@ -1,8 +1,13 @@
1
1
  import { z } from 'zod';
2
2
  export declare const GoogleArgs: z.ZodDiscriminatedUnion<[z.ZodObject<{
3
3
  kind: z.ZodLiteral<"status">;
4
+ }, z.core.$strip>, z.ZodObject<{
5
+ kind: z.ZodLiteral<"calendarListCalendars">;
6
+ }, z.core.$strip>, z.ZodObject<{
7
+ kind: z.ZodLiteral<"calendarColors">;
4
8
  }, z.core.$strip>, z.ZodObject<{
5
9
  kind: z.ZodLiteral<"calendarListEvents">;
10
+ calendarId: z.ZodOptional<z.ZodString>;
6
11
  timeMin: z.ZodOptional<z.ZodString>;
7
12
  maxResults: z.ZodOptional<z.ZodNumber>;
8
13
  }, z.core.$strip>, z.ZodObject<{
@@ -11,6 +16,8 @@ export declare const GoogleArgs: z.ZodDiscriminatedUnion<[z.ZodObject<{
11
16
  start: z.ZodString;
12
17
  end: z.ZodString;
13
18
  description: z.ZodOptional<z.ZodString>;
19
+ calendarId: z.ZodOptional<z.ZodString>;
20
+ colorId: z.ZodOptional<z.ZodString>;
14
21
  }, z.core.$strip>, z.ZodObject<{
15
22
  kind: z.ZodLiteral<"taskListsList">;
16
23
  }, z.core.$strip>, z.ZodObject<{
@@ -10,6 +10,14 @@ export declare const TOOL_DEFINITION: {
10
10
  type: string;
11
11
  enum: string[];
12
12
  };
13
+ calendarId: {
14
+ type: string;
15
+ description: string;
16
+ };
17
+ colorId: {
18
+ type: string;
19
+ description: string;
20
+ };
13
21
  timeMin: {
14
22
  type: string;
15
23
  description: string;
package/dist/index.d.ts CHANGED
@@ -13,6 +13,14 @@ declare const _default: (runtime: import('gui-chat-protocol').PluginRuntime) =>
13
13
  type: string;
14
14
  enum: string[];
15
15
  };
16
+ calendarId: {
17
+ type: string;
18
+ description: string;
19
+ };
20
+ colorId: {
21
+ type: string;
22
+ description: string;
23
+ };
16
24
  timeMin: {
17
25
  type: string;
18
26
  description: string;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { DEFAULT_LIST_MAX_RESULTS, MAX_LIST_RESULTS, clientSecretPresence, completeTask, createCalendarEvent, createDriveFile, createTask, getGoogleAccessToken, isIsoDateTimeWithOffset, listCalendarEvents, listDriveFiles, listTaskLists, listTasks, loadGoogleTokens, readDriveFile } from "@mulmoclaude/core/google";
1
+ import { DEFAULT_LIST_MAX_RESULTS, MAX_LIST_RESULTS, clientSecretPresence, completeTask, createCalendarEvent, createDriveFile, createTask, getCalendarColors, getGoogleAccessToken, isIsoDateTimeWithOffset, listCalendarEvents, listCalendars, listDriveFiles, listTaskLists, listTasks, loadGoogleTokens, readDriveFile } from "@mulmoclaude/core/google";
2
2
  //#region ../../../node_modules/gui-chat-protocol/dist/index.js
3
3
  function definePlugin(setup) {
4
4
  return setup;
@@ -4117,10 +4117,14 @@ function superRefine(fn, params) {
4117
4117
  var IsoDateTimeWithOffset = string().refine(isIsoDateTimeWithOffset, { error: "must be an ISO 8601 date-time with a timezone offset (e.g. 2026-07-17T09:00:00+09:00)" });
4118
4118
  var MaxResults = number().int().min(1).max(MAX_LIST_RESULTS).optional();
4119
4119
  var NonEmpty = string().min(1);
4120
+ var OptionalNonEmpty = string().trim().min(1).optional();
4120
4121
  var GoogleArgs = discriminatedUnion("kind", [
4121
4122
  object({ kind: literal("status") }),
4123
+ object({ kind: literal("calendarListCalendars") }),
4124
+ object({ kind: literal("calendarColors") }),
4122
4125
  object({
4123
4126
  kind: literal("calendarListEvents"),
4127
+ calendarId: OptionalNonEmpty,
4124
4128
  timeMin: IsoDateTimeWithOffset.optional(),
4125
4129
  maxResults: MaxResults
4126
4130
  }),
@@ -4129,7 +4133,9 @@ var GoogleArgs = discriminatedUnion("kind", [
4129
4133
  summary: NonEmpty,
4130
4134
  start: IsoDateTimeWithOffset,
4131
4135
  end: IsoDateTimeWithOffset,
4132
- description: string().optional()
4136
+ description: string().optional(),
4137
+ calendarId: OptionalNonEmpty,
4138
+ colorId: OptionalNonEmpty
4133
4139
  }),
4134
4140
  object({ kind: literal("taskListsList") }),
4135
4141
  object({
@@ -4171,7 +4177,7 @@ var TOOL_DEFINITION = {
4171
4177
  type: "function",
4172
4178
  name: "google",
4173
4179
  prompt: "The user's Google account is linked LOCALLY on this machine — the refresh token lives in ~/.config/mulmo/ and never reaches any cloud. This is independent of claude.ai Google connectors; the tool works without them. If a call fails with 'Google account not linked', ask the user to link their Google account in this app's settings, then retry the original call.",
4174
- description: "Operate the user's Google services through the locally linked Google account: Calendar (primary calendar), Tasks, and Drive. Supported kinds:\n - `status`: report whether the Google account is linked on this machine — call this first when unsure.\n\nCalendar:\n - `calendarListEvents`: list upcoming events. Optional `timeMin` (ISO 8601 date-time with timezone offset; default now) and `maxResults` (1-50, default 10).\n - `calendarCreateEvent`: create an event. Requires `summary`, `start`, `end` — ISO 8601 date-times WITH a timezone offset (e.g. 2026-07-17T09:00:00+09:00); optional `description`.\n\nTasks:\n - `taskListsList`: list the user's task lists (`id`, `title`). Only needed when the user means a list other than their default one.\n - `tasksList`: list tasks. Optional `taskListId` (default: the user's default list), `maxResults` (1-50, default 10), `showCompleted` (default false).\n - `tasksCreate`: add a task. Requires `title`; optional `notes`, `due` (ISO 8601 with offset — Google keeps the DATE only, so do not promise a time of day), `taskListId`.\n - `tasksComplete`: mark a task done. Requires `taskId` (from `tasksList`); optional `taskListId`.\n\nDrive — IMPORTANT: this app can only see files IT created, never the user's wider Drive. Never claim you searched their whole Drive:\n - `driveList`: list files this app created. Optional `maxResults` (1-50, default 10).\n - `driveCreate`: create a text file. Requires `name` and `content`; optional `mimeType` (default text/plain).\n - `driveRead`: read one of this app's files. Requires `fileId` (from `driveList` or `driveCreate`). Text files only.",
4180
+ description: "Operate the user's Google services through the locally linked Google account: Calendar, Tasks, and Drive. Supported kinds:\n - `status`: report whether the Google account is linked on this machine — call this first when unsure.\n\nCalendar (events default to the primary calendar; pass `calendarId` — from `calendarListCalendars` — to target another):\n - `calendarListCalendars`: list the calendars the user has added/subscribed to (`id`, `summary`, `primary`, `backgroundColor`/`foregroundColor` hex, `colorId`, `accessRole`). Call this to work with a non-primary calendar.\n - `calendarColors`: palettes that map an event/calendar `colorId` to hex — `event` for per-event colours, `calendar` for calendar colours.\n - `calendarListEvents`: list upcoming events (each carries `colorId`, empty when it inherits the calendar colour). Optional `calendarId`, `timeMin` (ISO 8601 date-time with timezone offset; default now), `maxResults` (1-50, default 10).\n - `calendarCreateEvent`: create an event. Requires `summary`, `start`, `end` — ISO 8601 date-times WITH a timezone offset (e.g. 2026-07-17T09:00:00+09:00); optional `description`, `calendarId`, `colorId` (event palette id \"1\"-\"11\").\n\nTasks:\n - `taskListsList`: list the user's task lists (`id`, `title`). Only needed when the user means a list other than their default one.\n - `tasksList`: list tasks. Optional `taskListId` (default: the user's default list), `maxResults` (1-50, default 10), `showCompleted` (default false).\n - `tasksCreate`: add a task. Requires `title`; optional `notes`, `due` (ISO 8601 with offset — Google keeps the DATE only, so do not promise a time of day), `taskListId`.\n - `tasksComplete`: mark a task done. Requires `taskId` (from `tasksList`); optional `taskListId`.\n\nDrive — IMPORTANT: this app can only see files IT created, never the user's wider Drive. Never claim you searched their whole Drive:\n - `driveList`: list files this app created. Optional `maxResults` (1-50, default 10).\n - `driveCreate`: create a text file. Requires `name` and `content`; optional `mimeType` (default text/plain).\n - `driveRead`: read one of this app's files. Requires `fileId` (from `driveList` or `driveCreate`). Text files only.",
4175
4181
  parameters: {
4176
4182
  type: "object",
4177
4183
  properties: {
@@ -4179,6 +4185,8 @@ var TOOL_DEFINITION = {
4179
4185
  type: "string",
4180
4186
  enum: [
4181
4187
  "status",
4188
+ "calendarListCalendars",
4189
+ "calendarColors",
4182
4190
  "calendarListEvents",
4183
4191
  "calendarCreateEvent",
4184
4192
  "taskListsList",
@@ -4190,6 +4198,14 @@ var TOOL_DEFINITION = {
4190
4198
  "driveRead"
4191
4199
  ]
4192
4200
  },
4201
+ calendarId: {
4202
+ type: "string",
4203
+ description: "calendar kinds: target calendar id from calendarListCalendars (default: the user's primary)"
4204
+ },
4205
+ colorId: {
4206
+ type: "string",
4207
+ description: "calendarCreateEvent: optional event palette colour id \"1\"-\"11\""
4208
+ },
4193
4209
  timeMin: {
4194
4210
  type: "string",
4195
4211
  description: "calendarListEvents: lower bound, ISO 8601 with timezone offset (default: now)"
@@ -4274,9 +4290,18 @@ var src_default = definePlugin(({ log }) => {
4274
4290
  ...linked ? {} : { guidance: LINK_GUIDANCE }
4275
4291
  };
4276
4292
  }
4293
+ case "calendarListCalendars": return {
4294
+ ok: true,
4295
+ calendars: await listCalendars(await getGoogleAccessToken())
4296
+ };
4297
+ case "calendarColors": return {
4298
+ ok: true,
4299
+ colors: await getCalendarColors(await getGoogleAccessToken())
4300
+ };
4277
4301
  case "calendarListEvents": return {
4278
4302
  ok: true,
4279
4303
  events: await listCalendarEvents(await getGoogleAccessToken(), {
4304
+ calendarId: args.calendarId,
4280
4305
  timeMin: args.timeMin,
4281
4306
  maxResults: args.maxResults ?? DEFAULT_LIST_MAX_RESULTS
4282
4307
  })
@@ -4286,7 +4311,9 @@ var src_default = definePlugin(({ log }) => {
4286
4311
  summary: args.summary,
4287
4312
  startDateTime: args.start,
4288
4313
  endDateTime: args.end,
4289
- description: args.description
4314
+ description: args.description,
4315
+ calendarId: args.calendarId,
4316
+ colorId: args.colorId
4290
4317
  });
4291
4318
  log.info("calendar event created", { id: event.id });
4292
4319
  return {