@assemblyline-agents/google-calendar 2.0.0 → 3.0.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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2026 OpenEve contributors
3
+ Copyright (c) 2026 Assembly Line contributors
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Official Assembly Line Google Calendar connection plugin.
4
4
 
5
- It exposes calendars, events, and availability through a dedicated MCP connection. Calendar authorization stays independent from Gmail and Google Drive. The package exports `defineGoogleCalendarConnection(options)` and bundles focused Calendar guidance under `skills/`.
5
+ It exposes calendars, events, availability, and scheduling through a reviewed direct Google Calendar REST API connection. Calendar authorization is stored independently from Gmail and Google Drive. The package exports `defineGoogleCalendarConnection(options)`.
6
6
 
7
7
  ## Install
8
8
 
@@ -10,7 +10,7 @@ It exposes calendars, events, and availability through a dedicated MCP connectio
10
10
  npm install @assemblyline-agents/google-calendar
11
11
  ```
12
12
 
13
- Configure `GOOGLE_CALENDAR_MCP_URL` and `GOOGLE_CALENDAR_MCP_TOKEN`, or pass the connection URL and authentication resolver directly. New connections scaffold read-only; event changes require explicit write access and the configured approval policy.
13
+ Create a Google OAuth web client, enable the Google Calendar API, and set `GOOGLE_CLIENT_ID` and `GOOGLE_CLIENT_SECRET`. Optionally set `GOOGLE_REDIRECT_URI` or `GOOGLE_CALENDAR_API_BASE_URL`. Assembly Line runs Authorization Code + PKCE, requests offline access, and stores the refreshable grant host-side. New connections enable reviewed Calendar tools without requiring an approval surface. Set `access: "approval-required"` if event changes should pause for approval, or `access: "read-only"` to omit event mutations and their OAuth scope.
14
14
 
15
15
  ## Part of Assembly Line
16
16
 
package/dist/auth.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import { type ConnectionAuthDefinition, type ConnectionPluginAccessSelection } from "@assemblyline-agents/core";
2
+ export declare function googleCalendarOAuth(access: ConnectionPluginAccessSelection | undefined): ConnectionAuthDefinition;
3
+ //# sourceMappingURL=auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,wBAAwB,EAC7B,KAAK,+BAA+B,EACrC,MAAM,2BAA2B,CAAC;AAKnC,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,+BAA+B,GAAG,SAAS,GAAG,wBAAwB,CAoBjH"}
package/dist/auth.js ADDED
@@ -0,0 +1,30 @@
1
+ import { defineOAuthAuthorization } from "@assemblyline-agents/core";
2
+ const READ_SCOPES = ["https://www.googleapis.com/auth/calendar.readonly"];
3
+ const WRITE_SCOPES = ["https://www.googleapis.com/auth/calendar.events"];
4
+ export function googleCalendarOAuth(access) {
5
+ return ({ env }) => {
6
+ const clientId = env.GOOGLE_CLIENT_ID?.trim();
7
+ const clientSecret = env.GOOGLE_CLIENT_SECRET?.trim();
8
+ const redirectUri = env.GOOGLE_REDIRECT_URI?.trim();
9
+ if (!clientId || !clientSecret) {
10
+ throw new Error("Google Calendar OAuth requires GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET.");
11
+ }
12
+ return defineOAuthAuthorization({
13
+ displayName: "Google Calendar",
14
+ authorizeUrl: "https://accounts.google.com/o/oauth2/v2/auth",
15
+ tokenUrl: "https://oauth2.googleapis.com/token",
16
+ clientId,
17
+ clientSecret,
18
+ scopes: writesEnabled(access) ? [...READ_SCOPES, ...WRITE_SCOPES] : [...READ_SCOPES],
19
+ ...(redirectUri ? { redirectUri } : {}),
20
+ authorizationParams: { access_type: "offline", prompt: "consent" },
21
+ pkce: true
22
+ });
23
+ };
24
+ }
25
+ function writesEnabled(access) {
26
+ if (access === "read-only")
27
+ return false;
28
+ return typeof access !== "object" || access.write !== false;
29
+ }
30
+ //# sourceMappingUR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AAW;QAAE,OAAO,KAAK,CAAC;IACzC,OAAO,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,KAAK,KAAK,KAAK,CAAC;AAC9D,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { type ConnectionPluginEventAdapter } from "@assemblyline-agents/core";
2
+ export declare const googleCalendarEvents: ConnectionPluginEventAdapter;
3
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AACA,OAAO,EAKL,KAAK,4BAA4B,EAGlC,MAAM,2BAA2B,CAAC;AAInC,eAAO,MAAM,oBAAoB,EAAE,4BAoDlC,CAAC"}
package/dist/events.js ADDED
@@ -0,0 +1,78 @@
1
+ import { randomBytes, randomUUID } from "node:crypto";
2
+ import { ConnectionEventError, headerValue, providerJson, stringField } from "@assemblyline-agents/core";
3
+ export const googleCalendarEvents = {
4
+ prepare(context) {
5
+ const key = JSON.stringify([context.callbackUrl, context.resources]);
6
+ if (stringField(context.state ?? {}, "desiredKey") === key)
7
+ return context.state;
8
+ const calendars = context.resources.length ? context.resources : [{ calendarId: "primary" }];
9
+ return {
10
+ desiredKey: key,
11
+ channels: calendars.map((resource) => ({
12
+ id: randomUUID(), token: randomBytes(32).toString("base64url"), calendarId: stringField(resource, "calendarId") ?? "primary"
13
+ })),
14
+ previous: channels(context.state, "channels")
15
+ };
16
+ },
17
+ async reconcile(context) {
18
+ const token = (await context.getToken()).token;
19
+ for (const prior of channels(context.state, "previous"))
20
+ await stop(context.fetch, token, prior);
21
+ const desired = channels(context.state, "channels");
22
+ if (desired.every((channel) => channel.resourceId))
23
+ return activeResult(context.state, desired);
24
+ const active = [];
25
+ for (const channel of desired) {
26
+ const value = await providerJson(context.fetch, `https://www.googleapis.com/calendar/v3/calendars/${encodeURIComponent(channel.calendarId)}/events/watch`, {
27
+ method: "POST",
28
+ headers: auth(token),
29
+ body: JSON.stringify({ id: channel.id, type: "web_hook", address: context.callbackUrl, token: channel.token })
30
+ });
31
+ active.push({ ...channel, resourceId: required(value, "resourceId"), ...(value.expiration ? { expiration: new Date(Number(value.expiration)).toISOString() } : {}) });
32
+ }
33
+ return activeResult({ desiredKey: stringField(context.state ?? {}, "desiredKey") ?? "", channels: active, previous: [] }, active);
34
+ },
35
+ async remove(context) {
36
+ const token = (await context.getToken()).token;
37
+ for (const channel of channels(context.state, "channels"))
38
+ await stop(context.fetch, token, channel);
39
+ },
40
+ check(context) {
41
+ const active = channels(context.state, "channels");
42
+ if (!active.length || active.some((channel) => !channel.resourceId))
43
+ return { status: "needs_setup", detail: "Google Calendar watch channel is not active." };
44
+ const expiration = earliestExpiration(active);
45
+ return expiration && Date.parse(expiration) <= Date.now()
46
+ ? { status: "degraded", detail: "Google Calendar watch channel expired.", expiresAt: expiration }
47
+ : { status: "active", detail: `${active.length} Google Calendar watch channel${active.length === 1 ? " is" : "s are"} active.`, ...(expiration ? { expiresAt: expiration } : {}) };
48
+ },
49
+ ingress(request, context) {
50
+ const channelId = headerValue(request.headers, "x-goog-channel-id");
51
+ const channelToken = headerValue(request.headers, "x-goog-channel-token");
52
+ const channel = channels(context.state, "channels").find((candidate) => candidate.id === channelId && candidate.token === channelToken);
53
+ if (!channel)
54
+ throw new ConnectionEventError("Google Calendar channel token is invalid.", 401);
55
+ const resourceState = headerValue(request.headers, "x-goog-resource-state") ?? "change";
56
+ if (resourceState === "sync")
57
+ return { events: [], response: { status: 200, body: { ok: true } }, audit: { challenge: true } };
58
+ const messageNumber = headerValue(request.headers, "x-goog-message-number") ?? "unknown";
59
+ const payload = { calendarId: channel.calendarId, resourceState, resourceId: headerValue(request.headers, "x-goog-resource-id") ?? "", messageNumber };
60
+ return { events: [{ event: "calendar.changed", eventId: `${channel.id}:${messageNumber}`, payload }], response: { status: 200, body: { ok: true } }, audit: { event: "calendar.changed" } };
61
+ }
62
+ };
63
+ function channels(state, key) {
64
+ const value = state?.[key];
65
+ if (!Array.isArray(value))
66
+ return [];
67
+ return value.flatMap((item) => { if (!item || typeof item !== "object" || Array.isArray(item))
68
+ return []; const record = item; const id = stringField(record, "id"); const token = stringField(record, "token"); const calendarId = stringField(record, "calendarId"); if (!id || !token || !calendarId)
69
+ return []; const resourceId = stringField(record, "resourceId"); const expiration = stringField(record, "expiration"); return [{ id, token, calendarId, ...(resourceId ? { resourceId } : {}), ...(expiration ? { expiration } : {}) }]; });
70
+ }
71
+ function auth(token) { return { authorization: `Bearer ${token}`, "content-type": "application/json" }; }
72
+ async function stop(fetchImpl, token, channel) { if (!channel.resourceId)
73
+ return; await providerJson(fetchImpl, "https://www.googleapis.com/calendar/v3/channels/stop", { method: "POST", headers: auth(token), body: JSON.stringify({ id: channel.id, resourceId: channel.resourceId }) }, [200, 204, 404]); }
74
+ function required(value, name) { const result = stringField(value, name); if (!result)
75
+ throw new Error(`Google Calendar watch response omitted ${name}.`); return result; }
76
+ function earliestExpiration(value) { return value.map((channel) => channel.expiration).filter((item) => Boolean(item)).sort()[0]; }
77
+ function activeResult(state, active) { const expiresAt = earliestExpiration(active); return { status: "active", state, detail: `${active.length} Google Calendar watch channel${active.length === 1 ? " is" : "s are"} active.`, ...(expiresAt ? { expiresAt } : {}) }; }
78
+ //# sourceMappingURL=events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.js","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EACL,oBAAoB,EACpB,WAAW,EACX,YAAY,EACZ,WAAW,EAIZ,MAAM,2BAA2B,CAAC;AAInC,MAAM,CAAC,MAAM,oBAAoB,GAAiC;IAChE,OAAO,CAAC,OAAO;QACb,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;QACrE,IAAI,WAAW,CAAC,OAAO,CAAC,K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= McpPluginConnectionOptions;
3
- export declare function defineGoogleCalendarConnection(options: GoogleCalendarConnectionOptions): import("@assemblyline-agents/core").McpHttpClientConnectionDefinition;
1
+ import { type ConnectionAuthDefinition, type HttpApiPluginConnectionOptions } from "@assemblyline-agents/core";
2
+ export interface GoogleCalendarConnectionOptions extends Omit<HttpApiPluginConnectionOptions, "auth" | "operations"> {
3
+ auth?: ConnectionAuthDefinition | false;
4
+ }
5
+ export declare function defineGoogleCalendarConnection(options?: GoogleCalendarConnectionOptions): import("@assemblyline-agents/core").HttpApiConnectionDefinition;
4
6
  export declare const assemblyLinePlugin: import("@assemblyline-agents/core").PluginModule;
5
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,0BAA0B,EAChC,MAAM,2BAA2B,CAAC;AAInC,MAAM,MAAM,+BAA+B,GAAG,0BAA0B,CAAC;AAEzE,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,+BAA+B,yEAEtF;AAED,eAAO,MAAM,kBAAkB,kDAA0C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,wBAAwB,EAC7B,KAAK,8BAA8B,EACpC,MAAM,2BAA2B,CAAC;AAOnC,MAAM,WAAW,+BAAgC,SAAQ,IAAI,CAAC,8BAA8B,EAAE,MAAM,GAAG,YAAY,CAAC;IAClH,IAAI,CAAC,EAAE,wBAAwB,GAAG,KAAK,CAAC;CACzC;AAED,wBAAgB,8BAA8B,CAAC,OAAO,GAAE,+BAAoC,mEAU3F;AAED,eAAO,MAAM,kBAAkB,kDAA0C,CAAC"}
package/dist/index.js CHANGED
@@ -1,7 +1,19 @@
1
- import { connectionPluginMetadata, defineMcpPluginConnection, definePlugin } from "@assemblyline-agents/core";
1
+ import { connectionPluginMetadata, defineConnectionPluginEvents, defineHttpApiPluginConnection, definePlugin } from "@assemblyline-agents/core";
2
+ import { googleCalendarOAuth } from "./auth.js";
3
+ import { googleCalendarEvents } from "./events.js";
4
+ import { GOOGLE_CALENDAR_OPERATIONS } from "./operations.js";
2
5
  const PLUGIN = connectionPluginMetadata("google-calendar");
3
- export function defineGoogleCalendarConnection(options) {
4
- return defineMcpPluginConnection(PLUGIN, options);
6
+ export function defineGoogleCalendarConnection(options = {}) {
7
+ const { auth, ...connection } = options;
8
+ const definition = defineHttpApiPluginConnection(PLUGIN, {
9
+ ...connection,
10
+ operations: GOOGLE_CALENDAR_OPERATIONS,
11
+ auth: auth === false ? false : auth ?? googleCalendarOAuth(options.access)
12
+ });
13
+ const events = defineConnectionPluginEvents(PLUGIN, options.events, googleCalendarEvents);
14
+ if (events)
15
+ definition.events = events;
16
+ return definition;
5
17
  }
6
18
  export const assemblyLinePlugin = definePlugin({ connections: [PLUGIN] });
7
19
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EACzB,YAAY,EAEb,MAAM,2BAA2B,CAAC;AAEnC,MAAM,MAAM,GAAG,wBAAwB,CAAC,iBAAiB,CAAE,CAAC;AAI5D,MAAM,UAAU,8BAA8B,CAAC,OAAwC;IACrF,OAAO,yBAAyB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACpD,CAAC;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,4BAA4B,EAC5B,6BAA6B,EAC7B,YAAY,EAGb,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAE7D,MAAM,MAAM,GAAG,wBAAwB,CAAC,iBAAiB,CAAE,CAAC;AAM5D,MAAM,UAAU,8BAA8B,CAAC,UAA2C,EAAE;IAC1F,MAAM,EAAE,IAAI,EAAE,GAAG,UAAU,EAAE,GAAG,OAAO,CAAC;IACxC,MAAM,UAAU,GAAG,6BAA6B,CAAC,MAAM,EAAE;QACvD,GAAG,UAAU;QACb,UAAU,EAAE,0BAA0B;QACtC,IAAI,EAAE,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,mBAAmB,CAAC,OAAO,CAAC,MAAM,CAAC;KAC3E,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,4BAA4B,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC;IAC1F,IAAI,MAAM;QAAE,UAAU,CAAC,MAAM,GAAG,MAAM,CAAC;IACvC,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { HttpApiOperationDefinition } from "@assemblyline-agents/core";
2
+ export declare const GOOGLE_CALENDAR_OPERATIONS: HttpApiOperationDefinition[];
3
+ //# sourceMappingURL=operations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../src/operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAc,MAAM,2BAA2B,CAAC;AAsBxF,eAAO,MAAM,0BAA0B,EAAE,0BAA0B,EAgClE,CAAC"}
@@ -0,0 +1,62 @@
1
+ const string = (description) => ({ type: "string", minLength: 1, description });
2
+ const path = (name, description) => ({ name, in: "path", required: true, schema: string(description) });
3
+ const query = (name, schema, required = false) => ({ name, in: "query", required, schema });
4
+ const pageToken = string("Opaque next-page token returned by Google Calendar.");
5
+ const maxResults = { type: "integer", minimum: 1, maximum: 2500 };
6
+ const dateTime = (description) => ({ type: "string", format: "date-time", description });
7
+ const calendarId = () => path("calendarId", "Calendar identifier; use primary for the connected user's primary calendar.");
8
+ const eventId = () => path("eventId", "Google Calendar event id.");
9
+ const eventBody = {
10
+ type: "object",
11
+ description: "Google Calendar Event resource. Preserve explicit date/dateTime and timeZone fields.",
12
+ additionalProperties: true
13
+ };
14
+ const sendParameters = [
15
+ query("sendUpdates", { type: "string", enum: ["all", "externalOnly", "none"] }),
16
+ query("conferenceDataVersion", { type: "integer", enum: [0, 1] }),
17
+ query("supportsAttachments", { type: "boolean" }),
18
+ query("maxAttendees", { type: "integer", minimum: 1 })
19
+ ];
20
+ export const GOOGLE_CALENDAR_OPERATIONS = [
21
+ read("google_calendar_list_calendars", "List calendars in the connected user's calendar list.", "/users/me/calendarList", [
22
+ query("maxResults", { type: "integer", minimum: 1, maximum: 250 }), query("pageToken", pageToken),
23
+ query("minAccessRole", { type: "string", enum: ["freeBusyReader", "reader", "writer", "owner"] }),
24
+ query("showDeleted", { type: "boolean" }), query("showHidden", { type: "boolean" }), query("syncToken", string("Calendar-list sync token."))
25
+ ]),
26
+ read("google_calendar_get_calendar", "Get one calendar-list entry, including access role and display settings.", "/users/me/calendarList/{calendarId}", [calendarId()]),
27
+ read("google_calendar_list_events", "List or search events in one calendar over an explicit time range.", "/calendars/{calendarId}/events", [
28
+ calendarId(), query("timeMin", dateTime("Inclusive lower bound for event end time.")), query("timeMax", dateTime("Exclusive upper bound for event start time.")),
29
+ query("q", string("Free-text event search query.")), query("singleEvents", { type: "boolean" }),
30
+ query("orderBy", { type: "string", enum: ["startTime", "updated"] }), query("timeZone", string("IANA response time zone.")),
31
+ query("showDeleted", { type: "boolean" }), query("maxResults", maxResults), query("pageToken", pageToken),
32
+ query("iCalUID", string("Exact iCalendar UID.")), query("updatedMin", dateTime("Lower bound for last modification time.")),
33
+ query("eventTypes", { type: "array", items: { type: "string" } }),
34
+ query("privateExtendedProperty", { type: "array", items: { type: "string" } }),
35
+ query("sharedExtendedProperty", { type: "array", items: { type: "string" } })
36
+ ]),
37
+ read("google_calendar_get_event", "Get one event by calendar id and event id.", "/calendars/{calendarId}/events/{eventId}", [calendarId(), eventId(), query("timeZone", string("IANA response time zone.")), query("maxAttendees", { type: "integer", minimum: 1 })]),
38
+ read("google_calendar_list_instances", "List instances of one recurring event.", "/calendars/{calendarId}/events/{eventId}/instances", [
39
+ calendarId(), eventId(), query("timeMin", dateTime("Lower bound for instance end time.")), query("timeMax", dateTime("Upper bound for instance start time.")),
40
+ query("timeZone", string("IANA response time zone.")), query("maxResults", maxResults), query("pageToken", pageToken)
41
+ ]),
42
+ write("google_calendar_query_freebusy", "Query busy intervals for calendars or groups without reading event details.", "POST", "/freeBusy", object({
43
+ timeMin: dateTime("Start of the query interval."), timeMax: dateTime("End of the query interval."),
44
+ timeZone: string("IANA response time zone."), calendarExpansionMax: { type: "integer", minimum: 1, maximum: 50 },
45
+ groupExpansionMax: { type: "integer", minimum: 1, maximum: 100 },
46
+ items: { type: "array", minItems: 1, items: object({ id: string("Calendar or group id.") }, ["id"]) }
47
+ }, ["timeMin", "timeMax", "items"])),
48
+ write("google_calendar_create_event", "Create an event in one calendar.", "POST", "/calendars/{calendarId}/events", eventBody, [calendarId(), ...sendParameters]),
49
+ write("google_calendar_update_event", "Patch selected fields of an existing event.", "PATCH", "/calendars/{calendarId}/events/{eventId}", eventBody, [calendarId(), eventId(), ...sendParameters]),
50
+ { name: "google_calendar_delete_event", description: "Delete one event from a calendar.", method: "DELETE", path: "/calendars/{calendarId}/events/{eventId}", parameters: [calendarId(), eventId(), query("sendUpdates", { type: "string", enum: ["all", "externalOnly", "none"] })] },
51
+ { name: "google_calendar_move_event", description: "Move an event to another calendar.", method: "POST", path: "/calendars/{calendarId}/events/{eventId}/move", parameters: [calendarId(), eventId(), query("destination", string("Destination calendar id."), true), query("sendUpdates", { type: "string", enum: ["all", "externalOnly", "none"] })] }
52
+ ];
53
+ function read(name, description, operationPath, parameters) {
54
+ return { name, description, method: "GET", path: operationPath, ...(parameters ? { parameters } : {}) };
55
+ }
56
+ function write(name, description, method, operationPath, schema, parameters) {
57
+ return { name, description, method, path: operationPath, ...(parameters ? { parameters } : {}), body: { contentType: "application/json", field: "body", schema, required: true } };
58
+ }
59
+ function object(properties, required = []) {
60
+ return { type: "object", properties, ...(required.length ? { required } : {}), additionalProperties: false };
61
+ }
62
+ //# sourceMappingURL=operations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operations.js","sourceRoot":"","sources":["../src/operations.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,GAAG,CAAC,WAAmB,EAAc,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC;AACpG,MAAM,IAAI,GAAG,CAAC,IAAY,EAAE,WAAmB,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,MAAe,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;AACjI,MAAM,KAAK,GAAG,CAAC,IAAY,EAAE,MAAkB,EAAE,QAAQ,GAAG,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,OAAgB,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;AACzH,MAAM,SAAS,GAAG,MAAM,CAAC,qDAAqD,CAAC,CAAC;AAChF,MAAM,UAAU,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAuB,CAAC;AACvF,MAAM,QAAQ,GAAG,CAA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AAK,EAAE,cAAc,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE;CACzV,CAAC;AAEF,SAAS,IAAI,CAAC,IAAY,EAAE,WAAmB,EAAE,aAAqB,EAAE,UAAqD;IAC3H,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;AAC1G,CAAC;AAED,SAAS,KAAK,CAAC,IAAY,EAAE,WAAmB,EAAE,MAAwB,EAAE,aAAqB,EAAE,MAAkB,EAAE,UAAqD;IAC1K,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,WAAW,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,CAAC;AACrL,CAAC;AAED,SAAS,MAAM,CAAC,UAAsC,EAAE,WAAqB,EAAE;IAC7E,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC;AAC/G,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@assemblyline-agents/google-calendar",
3
- "version": "2.0.0",
3
+ "version": "3.0.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -9,12 +9,11 @@
9
9
  }
10
10
  },
11
11
  "dependencies": {
12
- "@assemblyline-agents/core": "2.0.0"
12
+ "@assemblyline-agents/core": "3.0.0"
13
13
  },
14
- "description": "Official Assembly Line Google Calendar connection plugin.",
14
+ "description": "Official Assembly Line direct Google Calendar API connection plugin.",
15
15
  "files": [
16
- "dist",
17
- "skills"
16
+ "dist"
18
17
  ],
19
18
  "engines": {
20
19
  "node": ">=22.19.0"
@@ -1,13 +0,0 @@
1
- ---
2
- name: google-calendar
3
- description: Use a configured, independently authorized Google Calendar connection for events, availability, invitations, and scheduling.
4
- ---
5
- # Google Calendar
6
-
7
- Use the `google-calendar` connection only for Calendar work. Its authorization is independent from Gmail and Google Drive; never assume either service is connected because Calendar is connected.
8
-
9
- Read the exact calendar and event state before proposing a change. Interpret relative dates in the user's timezone, preserve timezone information, and resolve ambiguous matching events before editing. The deployment owner configures the Calendar OAuth grant or MCP bridge. Never request, print, or store tokens or client secrets.
10
-
11
- The scaffold is read-only. Creating, updating, moving, deleting, or inviting through Calendar requires explicit write access and the configured approval gate. Attendee changes send real notifications, so never add attendees unless that intent is clear.
12
-
13
- Read `references/calendar.md` when the task needs event shapes, all-day rules, timezone handling, update safety, or confirmation details.
@@ -1,45 +0,0 @@
1
- # Google Calendar
2
-
3
- Use the configured `google-calendar` connection for calendars, events, availability, event creation, and event updates.
4
-
5
- Official documentation:
6
-
7
- - https://developers.google.com/workspace/calendar/api/v3/reference
8
- - https://developers.google.com/workspace/calendar/api/v3/reference/events/insert
9
- - https://developers.google.com/workspace/calendar/api/guides/create-events
10
-
11
- ## Event Reads
12
-
13
- For agenda questions, set an explicit time range when possible, use the user's local timezone, expand recurring instances when supported, and keep the result compact unless the user asks for a detailed agenda. The default calendar id is commonly `primary`.
14
-
15
- Important fields include the event id, title, status, start and end, timezone, location, organizer, attendees, recurrence, conference data, attachments, link, and event type.
16
-
17
- ## Event Creation
18
-
19
- Create events only when the intent, date, start, duration or end, timezone, calendar, and attendee behavior are clear. A timed event body commonly includes:
20
-
21
- ```json
22
- {
23
- "summary": "Call with Maya",
24
- "start": {
25
- "dateTime": "2026-05-25T10:00:00-05:00",
26
- "timeZone": "America/Chicago"
27
- },
28
- "end": {
29
- "dateTime": "2026-05-25T10:30:00-05:00",
30
- "timeZone": "America/Chicago"
31
- }
32
- }
33
- ```
34
-
35
- For all-day events, `end.date` is exclusive. A one-day event starts on the requested date and ends on the next date.
36
-
37
- ## Event Updates
38
-
39
- Resolve the exact event id before an update. Preserve fields not being changed, and be careful with attendee, recurrence, and attachment arrays because including them can replace existing values.
40
-
41
- Do not clear calendars or mass-edit, delete, move, import, or quick-add events unless the user requested that exact action and the connection exposes a reviewed, approval-gated operation.
42
-
43
- ## Timezones And Invitations
44
-
45
- Interpret “today,” “tomorrow,” and weekday names relative to the user's local date rather than UTC. Include the timezone in write confirmations. Attendee edits can send invitations or updates; do not silently invite people.