@firfi/huly-mcp 0.9.2 → 0.10.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/README.md +3 -3
- package/dist/index.cjs +148 -44
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -295,12 +295,13 @@ MCP_TRANSPORT=http MCP_HTTP_PORT=8080 MCP_HTTP_HOST=0.0.0.0 npx -y @firfi/huly-m
|
|
|
295
295
|
| Tool | Description |
|
|
296
296
|
|------|-------------|
|
|
297
297
|
| `list_events` | List calendar events. Returns events sorted by date. Supports filtering by date range. |
|
|
298
|
+
| `list_calendars` | List writable, non-hidden calendars that can be used as create_event or create_recurring_event targets. Use this before creating events when you need to choose a target calendarId explicitly. |
|
|
298
299
|
| `get_event` | Retrieve full details for a calendar event including description. Use this to view event content and metadata. |
|
|
299
|
-
| `create_event` | Create a new calendar event. Description supports markdown formatting. Returns the created event ID. |
|
|
300
|
+
| `create_event` | Create a new calendar event. Description supports markdown formatting. Optional calendarId targets a specific calendar; when omitted, the event uses the authenticated user's primary personal calendar. Returns the created event ID. |
|
|
300
301
|
| `update_event` | Update fields on an existing calendar event. Only provided fields are modified. Description updates support markdown. |
|
|
301
302
|
| `delete_event` | Permanently delete a calendar event. This action cannot be undone. |
|
|
302
303
|
| `list_recurring_events` | List recurring event definitions. Returns recurring events sorted by modification date (newest first). |
|
|
303
|
-
| `create_recurring_event` | Create a new recurring calendar event with RFC5545 RRULE rules. Description supports markdown. Returns the created event ID. |
|
|
304
|
+
| `create_recurring_event` | Create a new recurring calendar event with RFC5545 RRULE rules. Description supports markdown. Optional calendarId targets a specific calendar; when omitted, the event uses the authenticated user's primary personal calendar. Returns the created event ID. |
|
|
304
305
|
| `list_event_instances` | List instances of a recurring event. Returns instances sorted by date. Supports filtering by date range. Use includeParticipants=true to fetch full participant info (extra lookups). |
|
|
305
306
|
|
|
306
307
|
### Time Tracking
|
|
@@ -523,4 +524,3 @@ The CockroachDB credentials can be found in your Huly `compose.yml` or via `dock
|
|
|
523
524
|
|
|
524
525
|
- **Bash wrapper scripts** (sourcing `.env` files) may not work reliably when launched by MCP clients on Windows. Prefer setting env vars directly in the MCP config JSON.
|
|
525
526
|
- **Docker pulls over SSH** may fail on Windows due to credential manager issues. Pull images from the server desktop if needed.
|
|
526
|
-
|
package/dist/index.cjs
CHANGED
|
@@ -114648,7 +114648,7 @@ var require_utils15 = __commonJS({
|
|
|
114648
114648
|
generateEventId: () => generateEventId3,
|
|
114649
114649
|
generateRecurringValues: () => generateRecurringValues,
|
|
114650
114650
|
getAllEvents: () => getAllEvents,
|
|
114651
|
-
getPrimaryCalendar: () =>
|
|
114651
|
+
getPrimaryCalendar: () => getPrimaryCalendar2,
|
|
114652
114652
|
getWeekday: () => getWeekday
|
|
114653
114653
|
});
|
|
114654
114654
|
module2.exports = __toCommonJS2(utils_exports);
|
|
@@ -115004,7 +115004,7 @@ var require_utils15 = __commonJS({
|
|
|
115004
115004
|
return result;
|
|
115005
115005
|
}
|
|
115006
115006
|
__name(encodeToBase32Hex, "encodeToBase32Hex");
|
|
115007
|
-
function
|
|
115007
|
+
function getPrimaryCalendar2(calendars, preference, acc) {
|
|
115008
115008
|
if (preference?.attachedTo !== void 0) {
|
|
115009
115009
|
const pref = calendars.find((p) => p._id === preference.attachedTo && p);
|
|
115010
115010
|
if (pref !== void 0) return pref._id;
|
|
@@ -115016,7 +115016,7 @@ var require_utils15 = __commonJS({
|
|
|
115016
115016
|
}
|
|
115017
115017
|
return `${acc}_calendar`;
|
|
115018
115018
|
}
|
|
115019
|
-
__name(
|
|
115019
|
+
__name(getPrimaryCalendar2, "getPrimaryCalendar");
|
|
115020
115020
|
}
|
|
115021
115021
|
});
|
|
115022
115022
|
|
|
@@ -115044,7 +115044,7 @@ var require_lib25 = __commonJS({
|
|
|
115044
115044
|
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
115045
115045
|
var index_exports2 = {};
|
|
115046
115046
|
__export2(index_exports2, {
|
|
115047
|
-
AccessLevel: () =>
|
|
115047
|
+
AccessLevel: () => AccessLevel5,
|
|
115048
115048
|
caldavIntegrationKind: () => caldavIntegrationKind,
|
|
115049
115049
|
calendarId: () => calendarId,
|
|
115050
115050
|
calendarIntegrationKind: () => calendarIntegrationKind,
|
|
@@ -115053,13 +115053,13 @@ var require_lib25 = __commonJS({
|
|
|
115053
115053
|
module2.exports = __toCommonJS2(index_exports2);
|
|
115054
115054
|
var import_platform3 = require_lib();
|
|
115055
115055
|
__reExport2(index_exports2, require_utils15(), module2.exports);
|
|
115056
|
-
var
|
|
115056
|
+
var AccessLevel5 = /* @__PURE__ */ ((AccessLevel22) => {
|
|
115057
115057
|
AccessLevel22["FreeBusyReader"] = "freeBusyReader";
|
|
115058
115058
|
AccessLevel22["Reader"] = "reader";
|
|
115059
115059
|
AccessLevel22["Writer"] = "writer";
|
|
115060
115060
|
AccessLevel22["Owner"] = "owner";
|
|
115061
115061
|
return AccessLevel22;
|
|
115062
|
-
})(
|
|
115062
|
+
})(AccessLevel5 || {});
|
|
115063
115063
|
var calendarIntegrationKind = "google-calendar";
|
|
115064
115064
|
var caldavIntegrationKind = "caldav";
|
|
115065
115065
|
var calendarId = "calendar";
|
|
@@ -150577,6 +150577,7 @@ var TeamspaceId = HulyRef("TeamspaceId");
|
|
|
150577
150577
|
var NotificationId = HulyRef("NotificationId");
|
|
150578
150578
|
var NotificationContextId = HulyRef("NotificationContextId");
|
|
150579
150579
|
var EventId = HulyRef("EventId");
|
|
150580
|
+
var CalendarId = HulyRef("CalendarId");
|
|
150580
150581
|
var TodoId = HulyRef("TodoId");
|
|
150581
150582
|
var SpaceId = HulyRef("SpaceId");
|
|
150582
150583
|
var CommentId = HulyRef("CommentId");
|
|
@@ -150602,6 +150603,7 @@ var Email = Schema_exports.NonEmptyString.pipe(
|
|
|
150602
150603
|
);
|
|
150603
150604
|
var StatusName = NonEmptyString2.pipe(Schema_exports.brand("StatusName"));
|
|
150604
150605
|
var PersonName = NonEmptyString2.pipe(Schema_exports.brand("PersonName"));
|
|
150606
|
+
var PersonRefInput = Schema_exports.Union(Email, PersonName);
|
|
150605
150607
|
var ComponentLabel = NonEmptyString2.pipe(Schema_exports.brand("ComponentLabel"));
|
|
150606
150608
|
var MilestoneLabel = NonEmptyString2.pipe(Schema_exports.brand("MilestoneLabel"));
|
|
150607
150609
|
var ChannelName = NonEmptyString2.pipe(Schema_exports.brand("ChannelName"));
|
|
@@ -151042,8 +151044,8 @@ var ListLeadsParamsBase = Schema_exports.Struct({
|
|
|
151042
151044
|
status: Schema_exports.optional(StatusName.annotations({
|
|
151043
151045
|
description: "Filter by status name"
|
|
151044
151046
|
})),
|
|
151045
|
-
assignee: Schema_exports.optional(
|
|
151046
|
-
description: "Filter by assignee email"
|
|
151047
|
+
assignee: Schema_exports.optional(PersonRefInput.annotations({
|
|
151048
|
+
description: "Filter by assignee email or display name"
|
|
151047
151049
|
})),
|
|
151048
151050
|
titleSearch: Schema_exports.optional(Schema_exports.String.annotations({
|
|
151049
151051
|
description: "Search leads by title substring (case-insensitive)"
|
|
@@ -151526,7 +151528,15 @@ var HulyClient = class _HulyClient extends Context_exports.Tag("@hulymcp/HulyCli
|
|
|
151526
151528
|
Effect_exports.gen(function* () {
|
|
151527
151529
|
const config3 = yield* HulyConfigService;
|
|
151528
151530
|
const sdk = yield* HulySdk;
|
|
151529
|
-
const {
|
|
151531
|
+
const {
|
|
151532
|
+
accountUuid,
|
|
151533
|
+
client,
|
|
151534
|
+
imageUrl,
|
|
151535
|
+
markupOps,
|
|
151536
|
+
primarySocialId,
|
|
151537
|
+
refUrl,
|
|
151538
|
+
workspaceUrlSlug
|
|
151539
|
+
} = yield* connectRestWithRetry({
|
|
151530
151540
|
url: config3.url,
|
|
151531
151541
|
auth: config3.auth,
|
|
151532
151542
|
workspace: config3.workspace
|
|
@@ -151548,6 +151558,7 @@ var HulyClient = class _HulyClient extends Context_exports.Tag("@hulymcp/HulyCli
|
|
|
151548
151558
|
});
|
|
151549
151559
|
const operations = {
|
|
151550
151560
|
getAccountUuid: () => accountUuid,
|
|
151561
|
+
getPrimarySocialId: () => primarySocialId,
|
|
151551
151562
|
documentUrlConfig,
|
|
151552
151563
|
markupUrlConfig,
|
|
151553
151564
|
findAll: (_class, query, options) => withClient(
|
|
@@ -151629,6 +151640,9 @@ var HulyClient = class _HulyClient extends Context_exports.Tag("@hulymcp/HulyCli
|
|
|
151629
151640
|
// AccountUuid is a double-branded string type with no public constructor
|
|
151630
151641
|
// eslint-disable-next-line no-restricted-syntax -- see above
|
|
151631
151642
|
getAccountUuid: () => "test-account-uuid",
|
|
151643
|
+
// PersonId is a branded string type with no public constructor
|
|
151644
|
+
// eslint-disable-next-line no-restricted-syntax -- see above
|
|
151645
|
+
getPrimarySocialId: () => "test-primary-social-id",
|
|
151632
151646
|
documentUrlConfig: {
|
|
151633
151647
|
baseUrl: UrlString.make("https://test.huly.local"),
|
|
151634
151648
|
workspaceUrlSlug: WorkspaceUrlSlug.make("test-workspace")
|
|
@@ -151695,6 +151709,7 @@ var connectRest = async (config3, sdk) => {
|
|
|
151695
151709
|
return {
|
|
151696
151710
|
client,
|
|
151697
151711
|
accountUuid: account.uuid,
|
|
151712
|
+
primarySocialId: account.primarySocialId,
|
|
151698
151713
|
workspaceUrlSlug: WorkspaceUrlSlug.make(info.workspaceUrl),
|
|
151699
151714
|
markupOps,
|
|
151700
151715
|
refUrl,
|
|
@@ -171275,7 +171290,7 @@ var PostHog = class extends PostHogBackendClient {
|
|
|
171275
171290
|
};
|
|
171276
171291
|
|
|
171277
171292
|
// src/version.ts
|
|
171278
|
-
var VERSION = true ? "0.
|
|
171293
|
+
var VERSION = true ? "0.10.0" : "0.0.0-dev";
|
|
171279
171294
|
|
|
171280
171295
|
// src/telemetry/posthog.ts
|
|
171281
171296
|
var POSTHOG_API_KEY = "phc_TGfFqCGdnF0p68wuFzd5WSw1IsBvOJW0YgoMJDyZPjm";
|
|
@@ -171705,6 +171720,7 @@ var tracker = require_lib36().default;
|
|
|
171705
171720
|
var optionalTimestamp = (value3) => value3 === void 0 ? void 0 : Timestamp.make(value3);
|
|
171706
171721
|
var optionalNullableTimestamp = (value3) => value3 === void 0 || value3 === null ? value3 : Timestamp.make(value3);
|
|
171707
171722
|
var optionalActivityCount = (value3) => value3 === void 0 ? void 0 : ActivityCount.make(value3);
|
|
171723
|
+
var optionalPersonId = (value3) => value3 === void 0 || value3 === "" ? void 0 : PersonId.make(value3);
|
|
171708
171724
|
var serverPopulatedCreateBy = "";
|
|
171709
171725
|
var listActivity = (params) => Effect_exports.gen(function* () {
|
|
171710
171726
|
const client = yield* HulyClient;
|
|
@@ -171800,7 +171816,7 @@ var listReactions = (params) => Effect_exports.gen(function* () {
|
|
|
171800
171816
|
id: ReactionId.make(r._id),
|
|
171801
171817
|
messageId: ActivityMessageId.make(r.attachedTo),
|
|
171802
171818
|
emoji: EmojiCode.make(r.emoji),
|
|
171803
|
-
createdBy:
|
|
171819
|
+
createdBy: optionalPersonId(r.createBy)
|
|
171804
171820
|
}));
|
|
171805
171821
|
return result;
|
|
171806
171822
|
});
|
|
@@ -173562,6 +173578,10 @@ var GetEventParamsSchema = Schema_exports.Struct({
|
|
|
173562
173578
|
title: "GetEventParams",
|
|
173563
173579
|
description: "Parameters for getting a single event"
|
|
173564
173580
|
});
|
|
173581
|
+
var ListCalendarsParamsSchema = EmptyParamsSchema.annotations({
|
|
173582
|
+
title: "ListCalendarsParams",
|
|
173583
|
+
description: "Parameters for listing writable calendar targets"
|
|
173584
|
+
});
|
|
173565
173585
|
var CreateEventParamsSchema = Schema_exports.Struct({
|
|
173566
173586
|
title: NonEmptyString2.annotations({
|
|
173567
173587
|
description: "Event title"
|
|
@@ -173588,6 +173608,9 @@ var CreateEventParamsSchema = Schema_exports.Struct({
|
|
|
173588
173608
|
),
|
|
173589
173609
|
visibility: Schema_exports.optional(VisibilitySchema.annotations({
|
|
173590
173610
|
description: "Event visibility (public, freeBusy, private)"
|
|
173611
|
+
})),
|
|
173612
|
+
calendarId: Schema_exports.optional(CalendarId.annotations({
|
|
173613
|
+
description: "Target writable calendar ID. If omitted, uses the authenticated user's primary personal calendar. Use list_calendars to discover valid calendar IDs."
|
|
173591
173614
|
}))
|
|
173592
173615
|
}).annotations({
|
|
173593
173616
|
title: "CreateEventParams",
|
|
@@ -173672,6 +173695,9 @@ var CreateRecurringEventParamsSchema = Schema_exports.Struct({
|
|
|
173672
173695
|
})),
|
|
173673
173696
|
visibility: Schema_exports.optional(VisibilitySchema.annotations({
|
|
173674
173697
|
description: "Event visibility (public, freeBusy, private)"
|
|
173698
|
+
})),
|
|
173699
|
+
calendarId: Schema_exports.optional(CalendarId.annotations({
|
|
173700
|
+
description: "Target writable calendar ID. If omitted, uses the authenticated user's primary personal calendar. Use list_calendars to discover valid calendar IDs."
|
|
173675
173701
|
}))
|
|
173676
173702
|
}).annotations({
|
|
173677
173703
|
title: "CreateRecurringEventParams",
|
|
@@ -173701,6 +173727,7 @@ var ListEventInstancesParamsSchema = Schema_exports.Struct({
|
|
|
173701
173727
|
});
|
|
173702
173728
|
var listEventsParamsJsonSchema = JSONSchema_exports.make(ListEventsParamsSchema);
|
|
173703
173729
|
var getEventParamsJsonSchema = JSONSchema_exports.make(GetEventParamsSchema);
|
|
173730
|
+
var listCalendarsParamsJsonSchema = JSONSchema_exports.make(ListCalendarsParamsSchema);
|
|
173704
173731
|
var createEventParamsJsonSchema = JSONSchema_exports.make(CreateEventParamsSchema);
|
|
173705
173732
|
var updateEventParamsJsonSchema = JSONSchema_exports.make(UpdateEventParamsSchema);
|
|
173706
173733
|
var deleteEventParamsJsonSchema = JSONSchema_exports.make(DeleteEventParamsSchema);
|
|
@@ -173709,6 +173736,7 @@ var createRecurringEventParamsJsonSchema = JSONSchema_exports.make(CreateRecurri
|
|
|
173709
173736
|
var listEventInstancesParamsJsonSchema = JSONSchema_exports.make(ListEventInstancesParamsSchema);
|
|
173710
173737
|
var parseListEventsParams = Schema_exports.decodeUnknown(ListEventsParamsSchema);
|
|
173711
173738
|
var parseGetEventParams = Schema_exports.decodeUnknown(GetEventParamsSchema);
|
|
173739
|
+
var parseListCalendarsParams = Schema_exports.decodeUnknown(ListCalendarsParamsSchema);
|
|
173712
173740
|
var parseCreateEventParams = Schema_exports.decodeUnknown(CreateEventParamsSchema);
|
|
173713
173741
|
var parseUpdateEventParams = Schema_exports.decodeUnknown(UpdateEventParamsSchema);
|
|
173714
173742
|
var parseDeleteEventParams = Schema_exports.decodeUnknown(DeleteEventParamsSchema);
|
|
@@ -173717,10 +173745,11 @@ var parseCreateRecurringEventParams = Schema_exports.decodeUnknown(CreateRecurri
|
|
|
173717
173745
|
var parseListEventInstancesParams = Schema_exports.decodeUnknown(ListEventInstancesParamsSchema);
|
|
173718
173746
|
|
|
173719
173747
|
// src/huly/operations/calendar.ts
|
|
173720
|
-
var
|
|
173748
|
+
var import_calendar3 = __toESM(require_lib25(), 1);
|
|
173721
173749
|
var import_core25 = __toESM(require_lib4(), 1);
|
|
173722
173750
|
|
|
173723
173751
|
// src/huly/operations/calendar-shared.ts
|
|
173752
|
+
var import_calendar = __toESM(require_lib25(), 1);
|
|
173724
173753
|
var descriptionAsMarkupRef = (desc) => desc;
|
|
173725
173754
|
var markupRefAsDescription = (ref) => ref ?? "";
|
|
173726
173755
|
var emptyEventDescription = "";
|
|
@@ -173745,10 +173774,46 @@ var findPersonsByEmails = (client, emails) => Effect_exports.gen(function* () {
|
|
|
173745
173774
|
);
|
|
173746
173775
|
return persons;
|
|
173747
173776
|
});
|
|
173748
|
-
var
|
|
173777
|
+
var findWritablePersonalCalendars = (client) => client.findAll(
|
|
173749
173778
|
calendar.class.Calendar,
|
|
173750
|
-
{
|
|
173779
|
+
{
|
|
173780
|
+
user: client.getPrimarySocialId(),
|
|
173781
|
+
hidden: false,
|
|
173782
|
+
access: { $in: [import_calendar.AccessLevel.Owner, import_calendar.AccessLevel.Writer] }
|
|
173783
|
+
}
|
|
173751
173784
|
);
|
|
173785
|
+
var findWritableCalendars = (client) => client.findAll(
|
|
173786
|
+
calendar.class.Calendar,
|
|
173787
|
+
{
|
|
173788
|
+
hidden: false,
|
|
173789
|
+
access: { $in: [import_calendar.AccessLevel.Owner, import_calendar.AccessLevel.Writer] }
|
|
173790
|
+
}
|
|
173791
|
+
);
|
|
173792
|
+
var getDefaultCalendarRef = (client) => Effect_exports.gen(function* () {
|
|
173793
|
+
const calendars = yield* findWritablePersonalCalendars(client);
|
|
173794
|
+
const preference = yield* client.findOne(
|
|
173795
|
+
calendar.class.PrimaryCalendar,
|
|
173796
|
+
{}
|
|
173797
|
+
);
|
|
173798
|
+
return (0, import_calendar.getPrimaryCalendar)(calendars, preference, client.getAccountUuid());
|
|
173799
|
+
});
|
|
173800
|
+
var resolveCalendarRef = (client, calendarId) => Effect_exports.gen(function* () {
|
|
173801
|
+
if (calendarId === void 0) {
|
|
173802
|
+
return yield* getDefaultCalendarRef(client);
|
|
173803
|
+
}
|
|
173804
|
+
const cal = yield* client.findOne(
|
|
173805
|
+
calendar.class.Calendar,
|
|
173806
|
+
{
|
|
173807
|
+
_id: toRef(calendarId),
|
|
173808
|
+
hidden: false,
|
|
173809
|
+
access: { $in: [import_calendar.AccessLevel.Owner, import_calendar.AccessLevel.Writer] }
|
|
173810
|
+
}
|
|
173811
|
+
);
|
|
173812
|
+
if (cal === void 0) {
|
|
173813
|
+
return yield* new HulyError({ message: `Calendar '${calendarId}' not found or not accessible` });
|
|
173814
|
+
}
|
|
173815
|
+
return cal._id;
|
|
173816
|
+
});
|
|
173752
173817
|
var buildParticipants = (client, participantRefs) => Effect_exports.gen(function* () {
|
|
173753
173818
|
if (participantRefs.length === 0) return [];
|
|
173754
173819
|
const persons = yield* client.findAll(
|
|
@@ -173761,8 +173826,7 @@ var buildParticipants = (client, participantRefs) => Effect_exports.gen(function
|
|
|
173761
173826
|
}));
|
|
173762
173827
|
});
|
|
173763
173828
|
var resolveEventInputs = (client, params, eventClass, eventId) => Effect_exports.gen(function* () {
|
|
173764
|
-
const
|
|
173765
|
-
const calendarRef = cal?._id ?? toRef("");
|
|
173829
|
+
const calendarRef = yield* resolveCalendarRef(client, params.calendarId);
|
|
173766
173830
|
const participantRefs = params.participants && params.participants.length > 0 ? (yield* findPersonsByEmails(client, params.participants)).map((p) => p._id) : [];
|
|
173767
173831
|
const descriptionRef = params.description && params.description.trim() !== "" ? yield* client.uploadMarkup(
|
|
173768
173832
|
eventClass,
|
|
@@ -173775,7 +173839,7 @@ var resolveEventInputs = (client, params, eventClass, eventId) => Effect_exports
|
|
|
173775
173839
|
});
|
|
173776
173840
|
|
|
173777
173841
|
// src/huly/operations/calendar-recurring.ts
|
|
173778
|
-
var
|
|
173842
|
+
var import_calendar2 = __toESM(require_lib25(), 1);
|
|
173779
173843
|
var import_core24 = __toESM(require_lib4(), 1);
|
|
173780
173844
|
var hulyRuleToRule = (rule) => ({
|
|
173781
173845
|
freq: rule.freq,
|
|
@@ -173825,7 +173889,7 @@ var listRecurringEvents = (params) => Effect_exports.gen(function* () {
|
|
|
173825
173889
|
});
|
|
173826
173890
|
var createRecurringEvent = (params) => Effect_exports.gen(function* () {
|
|
173827
173891
|
const client = yield* HulyClient;
|
|
173828
|
-
const eventId = (0,
|
|
173892
|
+
const eventId = (0, import_calendar2.generateEventId)();
|
|
173829
173893
|
const dueDate = params.dueDate ?? params.startDate + ONE_HOUR_MS;
|
|
173830
173894
|
const { calendarRef, descriptionRef, participantRefs } = yield* resolveEventInputs(
|
|
173831
173895
|
client,
|
|
@@ -173844,7 +173908,7 @@ var createRecurringEvent = (params) => Effect_exports.gen(function* () {
|
|
|
173844
173908
|
calendar: calendarRef,
|
|
173845
173909
|
participants: participantRefs,
|
|
173846
173910
|
externalParticipants: [],
|
|
173847
|
-
access:
|
|
173911
|
+
access: import_calendar2.AccessLevel.Owner,
|
|
173848
173912
|
user: serverPopulatedUser,
|
|
173849
173913
|
blockTime: false,
|
|
173850
173914
|
rules: hulyRules,
|
|
@@ -173934,6 +173998,17 @@ var listEventInstances = (params) => Effect_exports.gen(function* () {
|
|
|
173934
173998
|
});
|
|
173935
173999
|
|
|
173936
174000
|
// src/huly/operations/calendar.ts
|
|
174001
|
+
var toWritableCalendarAccess = (access) => {
|
|
174002
|
+
switch (access) {
|
|
174003
|
+
case import_calendar3.AccessLevel.Writer:
|
|
174004
|
+
return "writer";
|
|
174005
|
+
case import_calendar3.AccessLevel.Owner:
|
|
174006
|
+
return "owner";
|
|
174007
|
+
case import_calendar3.AccessLevel.FreeBusyReader:
|
|
174008
|
+
case import_calendar3.AccessLevel.Reader:
|
|
174009
|
+
return void 0;
|
|
174010
|
+
}
|
|
174011
|
+
};
|
|
173937
174012
|
var listEvents = (params) => Effect_exports.gen(function* () {
|
|
173938
174013
|
const client = yield* HulyClient;
|
|
173939
174014
|
const query = {};
|
|
@@ -173963,6 +174038,24 @@ var listEvents = (params) => Effect_exports.gen(function* () {
|
|
|
173963
174038
|
}));
|
|
173964
174039
|
return summaries;
|
|
173965
174040
|
});
|
|
174041
|
+
var listCalendars = (_params) => Effect_exports.gen(function* () {
|
|
174042
|
+
const client = yield* HulyClient;
|
|
174043
|
+
const calendars = yield* findWritableCalendars(client);
|
|
174044
|
+
const primaryCalendarRef = yield* getDefaultCalendarRef(client);
|
|
174045
|
+
return calendars.flatMap((cal) => {
|
|
174046
|
+
const access = toWritableCalendarAccess(cal.access);
|
|
174047
|
+
if (access === void 0) return [];
|
|
174048
|
+
return [{
|
|
174049
|
+
calendarId: CalendarId.make(cal._id),
|
|
174050
|
+
name: cal.name,
|
|
174051
|
+
hidden: cal.hidden,
|
|
174052
|
+
visibility: visibilityToString(cal.visibility) ?? "private",
|
|
174053
|
+
user: PersonId.make(cal.user),
|
|
174054
|
+
access,
|
|
174055
|
+
isPrimary: cal._id === primaryCalendarRef
|
|
174056
|
+
}];
|
|
174057
|
+
});
|
|
174058
|
+
});
|
|
173966
174059
|
var getEvent = (params) => Effect_exports.gen(function* () {
|
|
173967
174060
|
const client = yield* HulyClient;
|
|
173968
174061
|
const event = yield* client.findOne(
|
|
@@ -173991,7 +174084,7 @@ var getEvent = (params) => Effect_exports.gen(function* () {
|
|
|
173991
174084
|
visibility: visibilityToString(event.visibility),
|
|
173992
174085
|
participants,
|
|
173993
174086
|
externalParticipants: (event.externalParticipants || []).map((p) => Email.make(p)),
|
|
173994
|
-
calendarId: event.calendar,
|
|
174087
|
+
calendarId: CalendarId.make(event.calendar),
|
|
173995
174088
|
modifiedOn: event.modifiedOn,
|
|
173996
174089
|
createdOn: event.createdOn
|
|
173997
174090
|
};
|
|
@@ -173999,7 +174092,7 @@ var getEvent = (params) => Effect_exports.gen(function* () {
|
|
|
173999
174092
|
});
|
|
174000
174093
|
var createEvent = (params) => Effect_exports.gen(function* () {
|
|
174001
174094
|
const client = yield* HulyClient;
|
|
174002
|
-
const eventId = (0,
|
|
174095
|
+
const eventId = (0, import_calendar3.generateEventId)();
|
|
174003
174096
|
const dueDate = params.dueDate ?? params.date + ONE_HOUR_MS;
|
|
174004
174097
|
const { calendarRef, descriptionRef, participantRefs } = yield* resolveEventInputs(
|
|
174005
174098
|
client,
|
|
@@ -174017,7 +174110,7 @@ var createEvent = (params) => Effect_exports.gen(function* () {
|
|
|
174017
174110
|
calendar: calendarRef,
|
|
174018
174111
|
participants: participantRefs,
|
|
174019
174112
|
externalParticipants: [],
|
|
174020
|
-
access:
|
|
174113
|
+
access: import_calendar3.AccessLevel.Owner,
|
|
174021
174114
|
user: serverPopulatedUser,
|
|
174022
174115
|
blockTime: false
|
|
174023
174116
|
};
|
|
@@ -174139,6 +174232,17 @@ var calendarTools = [
|
|
|
174139
174232
|
listEvents
|
|
174140
174233
|
)
|
|
174141
174234
|
},
|
|
174235
|
+
{
|
|
174236
|
+
name: "list_calendars",
|
|
174237
|
+
description: "List writable, non-hidden calendars that can be used as create_event or create_recurring_event targets. Use this before creating events when you need to choose a target calendarId explicitly.",
|
|
174238
|
+
category: CATEGORY3,
|
|
174239
|
+
inputSchema: listCalendarsParamsJsonSchema,
|
|
174240
|
+
handler: createToolHandler(
|
|
174241
|
+
"list_calendars",
|
|
174242
|
+
parseListCalendarsParams,
|
|
174243
|
+
listCalendars
|
|
174244
|
+
)
|
|
174245
|
+
},
|
|
174142
174246
|
{
|
|
174143
174247
|
name: "get_event",
|
|
174144
174248
|
description: "Retrieve full details for a calendar event including description. Use this to view event content and metadata.",
|
|
@@ -174152,7 +174256,7 @@ var calendarTools = [
|
|
|
174152
174256
|
},
|
|
174153
174257
|
{
|
|
174154
174258
|
name: "create_event",
|
|
174155
|
-
description: "Create a new calendar event. Description supports markdown formatting. Returns the created event ID.",
|
|
174259
|
+
description: "Create a new calendar event. Description supports markdown formatting. Optional calendarId targets a specific calendar; when omitted, the event uses the authenticated user's primary personal calendar. Returns the created event ID.",
|
|
174156
174260
|
category: CATEGORY3,
|
|
174157
174261
|
inputSchema: createEventParamsJsonSchema,
|
|
174158
174262
|
handler: createToolHandler(
|
|
@@ -174196,7 +174300,7 @@ var calendarTools = [
|
|
|
174196
174300
|
},
|
|
174197
174301
|
{
|
|
174198
174302
|
name: "create_recurring_event",
|
|
174199
|
-
description: "Create a new recurring calendar event with RFC5545 RRULE rules. Description supports markdown. Returns the created event ID.",
|
|
174303
|
+
description: "Create a new recurring calendar event with RFC5545 RRULE rules. Description supports markdown. Optional calendarId targets a specific calendar; when omitted, the event uses the authenticated user's primary personal calendar. Returns the created event ID.",
|
|
174200
174304
|
category: CATEGORY3,
|
|
174201
174305
|
inputSchema: createRecurringEventParamsJsonSchema,
|
|
174202
174306
|
handler: createToolHandler(
|
|
@@ -174751,8 +174855,8 @@ var ListIssuesParamsBase = Schema_exports.Struct({
|
|
|
174751
174855
|
status: Schema_exports.optional(StatusName.annotations({
|
|
174752
174856
|
description: "Filter by status name"
|
|
174753
174857
|
})),
|
|
174754
|
-
assignee: Schema_exports.optional(
|
|
174755
|
-
description: "Filter by assignee email"
|
|
174858
|
+
assignee: Schema_exports.optional(PersonRefInput.annotations({
|
|
174859
|
+
description: "Filter by assignee email or display name"
|
|
174756
174860
|
})),
|
|
174757
174861
|
parentIssue: Schema_exports.optional(IssueIdentifier.annotations({
|
|
174758
174862
|
description: "Filter to children of this parent issue (e.g., 'HULY-42')"
|
|
@@ -174831,8 +174935,8 @@ var CreateIssueParamsSchema = Schema_exports.Struct({
|
|
|
174831
174935
|
priority: Schema_exports.optional(IssuePrioritySchema.annotations({
|
|
174832
174936
|
description: "Issue priority (urgent, high, medium, low, no-priority)"
|
|
174833
174937
|
})),
|
|
174834
|
-
assignee: Schema_exports.optional(
|
|
174835
|
-
description: "Assignee email address"
|
|
174938
|
+
assignee: Schema_exports.optional(PersonRefInput.annotations({
|
|
174939
|
+
description: "Assignee email address or display name"
|
|
174836
174940
|
})),
|
|
174837
174941
|
status: Schema_exports.optional(StatusName.annotations({
|
|
174838
174942
|
description: "Initial status (uses project default if not specified)"
|
|
@@ -174869,8 +174973,8 @@ var UpdateIssueParamsSchema = Schema_exports.Struct({
|
|
|
174869
174973
|
description: "New issue priority"
|
|
174870
174974
|
})),
|
|
174871
174975
|
assignee: Schema_exports.optional(
|
|
174872
|
-
Schema_exports.NullOr(
|
|
174873
|
-
description: "New assignee email (null to unassign)"
|
|
174976
|
+
Schema_exports.NullOr(PersonRefInput).annotations({
|
|
174977
|
+
description: "New assignee email or display name (null to unassign)"
|
|
174874
174978
|
})
|
|
174875
174979
|
),
|
|
174876
174980
|
status: Schema_exports.optional(StatusName.annotations({
|
|
@@ -175023,8 +175127,8 @@ var CreateComponentParamsSchema = Schema_exports.Struct({
|
|
|
175023
175127
|
description: Schema_exports.optional(Schema_exports.String.annotations({
|
|
175024
175128
|
description: "Component description (markdown supported)"
|
|
175025
175129
|
})),
|
|
175026
|
-
lead: Schema_exports.optional(
|
|
175027
|
-
description: "Lead person email address"
|
|
175130
|
+
lead: Schema_exports.optional(PersonRefInput.annotations({
|
|
175131
|
+
description: "Lead person email address or display name"
|
|
175028
175132
|
}))
|
|
175029
175133
|
}).annotations({
|
|
175030
175134
|
title: "CreateComponentParams",
|
|
@@ -175044,8 +175148,8 @@ var UpdateComponentParamsSchema = Schema_exports.Struct({
|
|
|
175044
175148
|
description: "New component description (markdown supported)"
|
|
175045
175149
|
})),
|
|
175046
175150
|
lead: Schema_exports.optional(
|
|
175047
|
-
Schema_exports.NullOr(
|
|
175048
|
-
description: "New lead person email (null to unassign)"
|
|
175151
|
+
Schema_exports.NullOr(PersonRefInput).annotations({
|
|
175152
|
+
description: "New lead person email or display name (null to unassign)"
|
|
175049
175153
|
})
|
|
175050
175154
|
)
|
|
175051
175155
|
}).annotations({
|
|
@@ -175307,8 +175411,8 @@ var ChildTemplateFieldsSchema = Schema_exports.Struct({
|
|
|
175307
175411
|
priority: Schema_exports.optional(IssuePrioritySchema.annotations({
|
|
175308
175412
|
description: "Child default priority"
|
|
175309
175413
|
})),
|
|
175310
|
-
assignee: Schema_exports.optional(
|
|
175311
|
-
description: "Child default assignee email"
|
|
175414
|
+
assignee: Schema_exports.optional(PersonRefInput.annotations({
|
|
175415
|
+
description: "Child default assignee email or display name"
|
|
175312
175416
|
})),
|
|
175313
175417
|
component: Schema_exports.optional(ComponentIdentifier.annotations({
|
|
175314
175418
|
description: "Child default component ID or label"
|
|
@@ -175384,8 +175488,8 @@ var CreateIssueTemplateParamsSchema = Schema_exports.Struct({
|
|
|
175384
175488
|
priority: Schema_exports.optional(IssuePrioritySchema.annotations({
|
|
175385
175489
|
description: "Default priority for issues created from this template"
|
|
175386
175490
|
})),
|
|
175387
|
-
assignee: Schema_exports.optional(
|
|
175388
|
-
description: "Default assignee email address"
|
|
175491
|
+
assignee: Schema_exports.optional(PersonRefInput.annotations({
|
|
175492
|
+
description: "Default assignee email address or display name"
|
|
175389
175493
|
})),
|
|
175390
175494
|
component: Schema_exports.optional(ComponentIdentifier.annotations({
|
|
175391
175495
|
description: "Default component ID or label"
|
|
@@ -175418,8 +175522,8 @@ var CreateIssueFromTemplateParamsSchema = Schema_exports.Struct({
|
|
|
175418
175522
|
priority: Schema_exports.optional(IssuePrioritySchema.annotations({
|
|
175419
175523
|
description: "Override priority"
|
|
175420
175524
|
})),
|
|
175421
|
-
assignee: Schema_exports.optional(
|
|
175422
|
-
description: "Override assignee email"
|
|
175525
|
+
assignee: Schema_exports.optional(PersonRefInput.annotations({
|
|
175526
|
+
description: "Override assignee email or display name"
|
|
175423
175527
|
})),
|
|
175424
175528
|
status: Schema_exports.optional(StatusName.annotations({
|
|
175425
175529
|
description: "Initial status (uses project default if not specified)"
|
|
@@ -175448,8 +175552,8 @@ var UpdateIssueTemplateParamsSchema = Schema_exports.Struct({
|
|
|
175448
175552
|
description: "New default priority"
|
|
175449
175553
|
})),
|
|
175450
175554
|
assignee: Schema_exports.optional(
|
|
175451
|
-
Schema_exports.NullOr(
|
|
175452
|
-
description: "New default assignee email (null to unassign)"
|
|
175555
|
+
Schema_exports.NullOr(PersonRefInput).annotations({
|
|
175556
|
+
description: "New default assignee email or display name (null to unassign)"
|
|
175453
175557
|
})
|
|
175454
175558
|
),
|
|
175455
175559
|
component: Schema_exports.optional(
|
|
@@ -184343,7 +184447,7 @@ var testManagementPlansTools = [
|
|
|
184343
184447
|
];
|
|
184344
184448
|
|
|
184345
184449
|
// src/huly/operations/time.ts
|
|
184346
|
-
var
|
|
184450
|
+
var import_calendar7 = __toESM(require_lib25(), 1);
|
|
184347
184451
|
var import_core48 = __toESM(require_lib4(), 1);
|
|
184348
184452
|
var import_tracker7 = __toESM(require_lib36(), 1);
|
|
184349
184453
|
var serverPopulatedCalendar = toRef("");
|
|
@@ -184573,7 +184677,7 @@ var createWorkSlot = (params) => Effect_exports.gen(function* () {
|
|
|
184573
184677
|
description: "",
|
|
184574
184678
|
allDay: false,
|
|
184575
184679
|
participants: [],
|
|
184576
|
-
access:
|
|
184680
|
+
access: import_calendar7.AccessLevel.Owner,
|
|
184577
184681
|
reminders: [],
|
|
184578
184682
|
visibility: "public",
|
|
184579
184683
|
eventId: "",
|