@firfi/huly-mcp 0.35.0 → 0.36.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 +6 -1
- package/dist/index.cjs +844 -329
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -295,7 +295,7 @@ Planned feature surfaces:
|
|
|
295
295
|
- Calendar: calendar CRUD/config, external calendar sync metadata, primary calendar management, schedule objects, participant mutations, and RSVP/status support when stable.
|
|
296
296
|
- Team planner and schedule reporting: team agendas, workload/capacity summaries, and visibility-aware free/busy views across members/projects.
|
|
297
297
|
- Virtual office and meetings: offices, floors, rooms, access/language/default recording/transcription settings, meeting schedules, active participants, room info, meeting notes/transcript records (minutes), recordings, and device preferences.
|
|
298
|
-
- Chat and communication: request-access flows if Huly exposes a stable model, pinned messages,
|
|
298
|
+
- Chat and communication: request-access flows if Huly exposes a stable model, pinned messages, translation, applets, in-message polls, guest communication settings, and external Gmail/Telegram/Huly Mail surfaces plus provider-specific attachments once compatible packages/APIs are proven.
|
|
299
299
|
- Notifications and activity: browser/push subscription internals, provider defaults, UI presenter/viewlet metadata, and activity control/extension metadata.
|
|
300
300
|
- Attachments and media: previews/preview metadata and friendly wrappers for additional object types beyond issue/document/inventory product.
|
|
301
301
|
- Core schema and workspace administration: attribute/property create/update/delete/hide, enum CRUD/options, sequence management, role/permission definition writes, generic space creation, global space admins, integrations registry, invite settings, role capability settings, and workspace setting metadata.
|
|
@@ -503,6 +503,11 @@ SDK upgrade revisit:
|
|
|
503
503
|
| `add_thread_reply` | Add a reply to a message thread. Reply body supports markdown formatting. |
|
|
504
504
|
| `update_thread_reply` | Update a thread reply. Only the body can be modified. |
|
|
505
505
|
| `delete_thread_reply` | Permanently delete a thread reply. This action cannot be undone. |
|
|
506
|
+
| `list_chat_message_attachments` | List files attached directly to a Huly chat message target. target.kind supports channel_message, dm_message, and thread_reply; the tool resolves channel names and one-to-one DM participant display names for you. |
|
|
507
|
+
| `get_chat_message_attachment` | Get one file attached directly to a Huly channel message, direct-message message, or thread reply. The attachmentId must belong to the resolved target. |
|
|
508
|
+
| `add_chat_message_attachment` | Attach a file directly to a Huly channel message, direct-message message, or thread reply. Provide filename, contentType, and exactly one of filePath, fileUrl, or data. |
|
|
509
|
+
| `update_chat_message_attachment` | Update description and/or pinned state for a file attached directly to a Huly channel message, direct-message message, or thread reply. The attachmentId must belong to the resolved target. |
|
|
510
|
+
| `delete_chat_message_attachment` | Delete one file attached directly to a Huly channel message, direct-message message, or thread reply. The attachmentId must belong to the resolved target. |
|
|
506
511
|
|
|
507
512
|
### Calendar
|
|
508
513
|
|
package/dist/index.cjs
CHANGED
|
@@ -154405,6 +154405,17 @@ var ThreadReplyNotFoundError = class extends Schema_exports.TaggedError()(
|
|
|
154405
154405
|
return `Thread reply '${this.replyId}' not found on message '${this.messageId}'`;
|
|
154406
154406
|
}
|
|
154407
154407
|
};
|
|
154408
|
+
var ChatMessageAttachmentNotFoundError = class extends Schema_exports.TaggedError()(
|
|
154409
|
+
"ChatMessageAttachmentNotFoundError",
|
|
154410
|
+
{
|
|
154411
|
+
target: NonEmptyString2,
|
|
154412
|
+
attachmentId: AttachmentId
|
|
154413
|
+
}
|
|
154414
|
+
) {
|
|
154415
|
+
get message() {
|
|
154416
|
+
return `Attachment '${this.attachmentId}' not found on ${this.target}`;
|
|
154417
|
+
}
|
|
154418
|
+
};
|
|
154408
154419
|
var ActivityMessageNotFoundError = class extends Schema_exports.TaggedError()(
|
|
154409
154420
|
"ActivityMessageNotFoundError",
|
|
154410
154421
|
{
|
|
@@ -155913,6 +155924,7 @@ var HulyDomainError = Schema_exports.Union(
|
|
|
155913
155924
|
DirectMessageNotFoundError,
|
|
155914
155925
|
DirectMessageParticipantCountError,
|
|
155915
155926
|
MessageNotFoundError,
|
|
155927
|
+
ChatMessageAttachmentNotFoundError,
|
|
155916
155928
|
PersonNotAnEmployeeError,
|
|
155917
155929
|
ThreadReplyNotFoundError,
|
|
155918
155930
|
CalendarNotAccessibleError,
|
|
@@ -166927,6 +166939,7 @@ var INVALID_PARAMS_TAGS = /* @__PURE__ */ new Set([
|
|
|
166927
166939
|
"PersonNotAnEmployeeError",
|
|
166928
166940
|
"MessageNotFoundError",
|
|
166929
166941
|
"ThreadReplyNotFoundError",
|
|
166942
|
+
"ChatMessageAttachmentNotFoundError",
|
|
166930
166943
|
"CalendarNotAccessibleError",
|
|
166931
166944
|
"EventNotFoundError",
|
|
166932
166945
|
"RecurringEventNotFoundError",
|
|
@@ -171254,6 +171267,559 @@ var parseAddThreadReplyParams = Schema_exports.decodeUnknown(AddThreadReplyParam
|
|
|
171254
171267
|
var parseUpdateThreadReplyParams = Schema_exports.decodeUnknown(UpdateThreadReplyParamsSchema);
|
|
171255
171268
|
var parseDeleteThreadReplyParams = Schema_exports.decodeUnknown(DeleteThreadReplyParamsSchema);
|
|
171256
171269
|
|
|
171270
|
+
// src/domain/schemas/domain-values.ts
|
|
171271
|
+
var LocalFilePath = Schema_exports.String.pipe(Schema_exports.brand("LocalFilePath")).annotations({
|
|
171272
|
+
identifier: "LocalFilePath",
|
|
171273
|
+
title: "LocalFilePath",
|
|
171274
|
+
description: "Host-local file path used only as an upload transport input. It is not a Huly domain identifier and may be OS-specific."
|
|
171275
|
+
});
|
|
171276
|
+
var Base64FileData = Schema_exports.String.pipe(Schema_exports.brand("Base64FileData")).annotations({
|
|
171277
|
+
identifier: "Base64FileData",
|
|
171278
|
+
title: "Base64FileData",
|
|
171279
|
+
description: "Base64-encoded upload payload. It is transport data rather than a Huly domain value, but is branded to avoid arbitrary text confusion."
|
|
171280
|
+
});
|
|
171281
|
+
var AttachmentFileName = NonEmptyString2.pipe(Schema_exports.brand("AttachmentFileName")).annotations({
|
|
171282
|
+
identifier: "AttachmentFileName",
|
|
171283
|
+
title: "AttachmentFileName",
|
|
171284
|
+
description: "Non-empty attachment filename as stored by Huly."
|
|
171285
|
+
});
|
|
171286
|
+
var AttachmentDescription = Schema_exports.String.pipe(Schema_exports.brand("AttachmentDescription")).annotations({
|
|
171287
|
+
identifier: "AttachmentDescription",
|
|
171288
|
+
title: "AttachmentDescription",
|
|
171289
|
+
description: "Free-form attachment description. Empty string is valid because Huly uses it to clear descriptions."
|
|
171290
|
+
});
|
|
171291
|
+
var AttachmentByteSize = NonNegativeInteger.pipe(Schema_exports.brand("AttachmentByteSize")).annotations({
|
|
171292
|
+
identifier: "AttachmentByteSize",
|
|
171293
|
+
title: "AttachmentByteSize",
|
|
171294
|
+
description: "Attachment size in bytes. Must be a non-negative integer, never a fraction or negative value."
|
|
171295
|
+
});
|
|
171296
|
+
var AttachmentMetadataKey = Schema_exports.String.pipe(Schema_exports.brand("AttachmentMetadataKey")).annotations({
|
|
171297
|
+
identifier: "AttachmentMetadataKey",
|
|
171298
|
+
title: "AttachmentMetadataKey",
|
|
171299
|
+
description: "Open attachment metadata record key supplied by the Huly SDK. It is not a closed MCP domain enum."
|
|
171300
|
+
});
|
|
171301
|
+
var DisplayText = NonEmptyString2.pipe(Schema_exports.brand("DisplayText")).annotations({
|
|
171302
|
+
identifier: "DisplayText",
|
|
171303
|
+
title: "DisplayText",
|
|
171304
|
+
description: "Human-readable display text from Huly model metadata or user-authored content."
|
|
171305
|
+
});
|
|
171306
|
+
var ActivityMarkup = Schema_exports.String.pipe(Schema_exports.brand("ActivityMarkup")).annotations({
|
|
171307
|
+
identifier: "ActivityMarkup",
|
|
171308
|
+
title: "ActivityMarkup",
|
|
171309
|
+
description: "Huly activity markup payload. Empty string is valid when the SDK stores cleared content."
|
|
171310
|
+
});
|
|
171311
|
+
var ActivityMarkdown = Schema_exports.String.pipe(Schema_exports.brand("ActivityMarkdown")).annotations({
|
|
171312
|
+
identifier: "ActivityMarkdown",
|
|
171313
|
+
title: "ActivityMarkdown",
|
|
171314
|
+
description: "Markdown projection of a Huly activity markup payload for MCP responses."
|
|
171315
|
+
});
|
|
171316
|
+
var MentionContent = Schema_exports.String.pipe(Schema_exports.brand("MentionContent")).annotations({
|
|
171317
|
+
identifier: "MentionContent",
|
|
171318
|
+
title: "MentionContent",
|
|
171319
|
+
description: "User-authored activity mention snippet returned by Huly."
|
|
171320
|
+
});
|
|
171321
|
+
var DrawingContent = Schema_exports.String.pipe(Schema_exports.brand("DrawingContent")).annotations({
|
|
171322
|
+
identifier: "DrawingContent",
|
|
171323
|
+
title: "DrawingContent",
|
|
171324
|
+
description: "Opaque drawing content payload stored by Huly."
|
|
171325
|
+
});
|
|
171326
|
+
var ActivityFilterPosition = Integer.pipe(Schema_exports.brand("ActivityFilterPosition")).annotations({
|
|
171327
|
+
identifier: "ActivityFilterPosition",
|
|
171328
|
+
title: "ActivityFilterPosition",
|
|
171329
|
+
description: "Integer display order for an activity filter."
|
|
171330
|
+
});
|
|
171331
|
+
var NotificationProviderOrder = Integer.pipe(Schema_exports.brand("NotificationProviderOrder")).annotations({
|
|
171332
|
+
identifier: "NotificationProviderOrder",
|
|
171333
|
+
title: "NotificationProviderOrder",
|
|
171334
|
+
description: "Integer display order for a notification provider."
|
|
171335
|
+
});
|
|
171336
|
+
var NotificationFieldName = NonEmptyString2.pipe(Schema_exports.brand("NotificationFieldName")).annotations({
|
|
171337
|
+
identifier: "NotificationFieldName",
|
|
171338
|
+
title: "NotificationFieldName",
|
|
171339
|
+
description: "Huly document field name associated with a notification type."
|
|
171340
|
+
});
|
|
171341
|
+
|
|
171342
|
+
// src/domain/schemas/attachments.ts
|
|
171343
|
+
var DEFAULT_ATTACHMENT_PINNED = false;
|
|
171344
|
+
var AttachmentKindSchema = Schema_exports.Literal("attachment", "embedding", "photo").annotations({
|
|
171345
|
+
title: "AttachmentKind",
|
|
171346
|
+
description: "Attachment class to create: attachment, embedding, or photo. Defaults to attachment."
|
|
171347
|
+
});
|
|
171348
|
+
var AttachmentMetadataSchema = Schema_exports.Record({ key: AttachmentMetadataKey, value: Schema_exports.Unknown });
|
|
171349
|
+
var ListAttachmentsParamsSchema = Schema_exports.Struct({
|
|
171350
|
+
objectId: DocId.annotations({
|
|
171351
|
+
description: "ID of the parent object (issue, document, etc.)"
|
|
171352
|
+
}),
|
|
171353
|
+
objectClass: ObjectClassName.annotations({
|
|
171354
|
+
description: "Class of the parent object (e.g., 'tracker:class:Issue', 'document:class:Document')"
|
|
171355
|
+
}),
|
|
171356
|
+
limit: Schema_exports.optional(
|
|
171357
|
+
LimitParam.annotations({
|
|
171358
|
+
description: `Maximum number of attachments to return (default: ${DEFAULT_LIMIT})`
|
|
171359
|
+
})
|
|
171360
|
+
)
|
|
171361
|
+
}).annotations({
|
|
171362
|
+
title: "ListAttachmentsParams",
|
|
171363
|
+
description: "Parameters for listing attachments on an object"
|
|
171364
|
+
});
|
|
171365
|
+
var GetAttachmentParamsSchema = Schema_exports.Struct({
|
|
171366
|
+
attachmentId: AttachmentId.annotations({
|
|
171367
|
+
description: "Attachment ID"
|
|
171368
|
+
})
|
|
171369
|
+
}).annotations({
|
|
171370
|
+
title: "GetAttachmentParams",
|
|
171371
|
+
description: "Parameters for getting a single attachment"
|
|
171372
|
+
});
|
|
171373
|
+
var FileSourceFields = {
|
|
171374
|
+
filename: AttachmentFileName.annotations({
|
|
171375
|
+
description: "Name of the file"
|
|
171376
|
+
}),
|
|
171377
|
+
contentType: MimeType.annotations({
|
|
171378
|
+
description: "MIME type of the file (e.g., 'image/png', 'application/pdf')"
|
|
171379
|
+
}),
|
|
171380
|
+
filePath: Schema_exports.optional(LocalFilePath.annotations({
|
|
171381
|
+
description: "Local file path to upload (preferred - avoids context flooding)"
|
|
171382
|
+
})),
|
|
171383
|
+
fileUrl: Schema_exports.optional(UrlString.annotations({
|
|
171384
|
+
description: "URL to fetch file from (for remote files)"
|
|
171385
|
+
})),
|
|
171386
|
+
data: Schema_exports.optional(Base64FileData.annotations({
|
|
171387
|
+
description: "Base64-encoded file data (fallback for small files <10KB)"
|
|
171388
|
+
})),
|
|
171389
|
+
description: Schema_exports.optional(AttachmentDescription.annotations({
|
|
171390
|
+
description: "Attachment description"
|
|
171391
|
+
})),
|
|
171392
|
+
pinned: Schema_exports.optional(Schema_exports.Boolean.annotations({
|
|
171393
|
+
description: `Whether to pin the attachment (default: ${DEFAULT_ATTACHMENT_PINNED})`
|
|
171394
|
+
})),
|
|
171395
|
+
kind: Schema_exports.optional(AttachmentKindSchema.annotations({
|
|
171396
|
+
description: "Attachment subclass to create: attachment, embedding, or photo (default: attachment)."
|
|
171397
|
+
}))
|
|
171398
|
+
};
|
|
171399
|
+
var hasFileSource = (params) => {
|
|
171400
|
+
const hasSource = params.filePath || params.fileUrl || params.data;
|
|
171401
|
+
return hasSource ? true : "Must provide filePath, fileUrl, or data";
|
|
171402
|
+
};
|
|
171403
|
+
var AddAttachmentParamsBase = Schema_exports.Struct({
|
|
171404
|
+
objectId: DocId.annotations({
|
|
171405
|
+
description: "ID of the parent object (issue, document, etc.)"
|
|
171406
|
+
}),
|
|
171407
|
+
objectClass: ObjectClassName.annotations({
|
|
171408
|
+
description: "Class of the parent object (e.g., 'tracker:class:Issue', 'document:class:Document')"
|
|
171409
|
+
}),
|
|
171410
|
+
space: SpaceId.annotations({
|
|
171411
|
+
description: "Space ID where the parent object resides"
|
|
171412
|
+
}),
|
|
171413
|
+
...FileSourceFields
|
|
171414
|
+
});
|
|
171415
|
+
var AddAttachmentParamsSchema = AddAttachmentParamsBase.pipe(
|
|
171416
|
+
Schema_exports.filter(hasFileSource)
|
|
171417
|
+
).annotations({
|
|
171418
|
+
title: "AddAttachmentParams",
|
|
171419
|
+
description: "Parameters for adding an attachment. Provide ONE of: filePath, fileUrl, or data"
|
|
171420
|
+
});
|
|
171421
|
+
var UPDATE_ATTACHMENT_FIELDS = ["description", "pinned"];
|
|
171422
|
+
var UpdateAttachmentParamsSchema = Schema_exports.Struct({
|
|
171423
|
+
attachmentId: AttachmentId.annotations({
|
|
171424
|
+
description: "Attachment ID"
|
|
171425
|
+
}),
|
|
171426
|
+
description: Schema_exports.optional(
|
|
171427
|
+
Schema_exports.NullOr(AttachmentDescription).annotations({
|
|
171428
|
+
description: "New description (null to clear)"
|
|
171429
|
+
})
|
|
171430
|
+
),
|
|
171431
|
+
pinned: Schema_exports.optional(Schema_exports.Boolean.annotations({
|
|
171432
|
+
description: "Pin or unpin the attachment"
|
|
171433
|
+
}))
|
|
171434
|
+
}).pipe(
|
|
171435
|
+
Schema_exports.filter(
|
|
171436
|
+
(params) => hasAtLeastOneDefined(params, UPDATE_ATTACHMENT_FIELDS) ? void 0 : atLeastOneUpdateFieldMessage(UPDATE_ATTACHMENT_FIELDS)
|
|
171437
|
+
)
|
|
171438
|
+
).annotations({
|
|
171439
|
+
title: "UpdateAttachmentParams",
|
|
171440
|
+
description: `Parameters for updating an attachment. ${atLeastOneUpdateFieldMessage(UPDATE_ATTACHMENT_FIELDS)}`
|
|
171441
|
+
});
|
|
171442
|
+
assertUpdateFields()(["attachmentId"], UPDATE_ATTACHMENT_FIELDS);
|
|
171443
|
+
var DeleteAttachmentParamsSchema = Schema_exports.Struct({
|
|
171444
|
+
attachmentId: AttachmentId.annotations({
|
|
171445
|
+
description: "Attachment ID to delete"
|
|
171446
|
+
})
|
|
171447
|
+
}).annotations({
|
|
171448
|
+
title: "DeleteAttachmentParams",
|
|
171449
|
+
description: "Parameters for deleting an attachment"
|
|
171450
|
+
});
|
|
171451
|
+
var PinAttachmentParamsSchema = Schema_exports.Struct({
|
|
171452
|
+
attachmentId: AttachmentId.annotations({
|
|
171453
|
+
description: "Attachment ID"
|
|
171454
|
+
}),
|
|
171455
|
+
pinned: Schema_exports.Boolean.annotations({
|
|
171456
|
+
description: "Whether to pin (true) or unpin (false)"
|
|
171457
|
+
})
|
|
171458
|
+
}).annotations({
|
|
171459
|
+
title: "PinAttachmentParams",
|
|
171460
|
+
description: "Parameters for pinning/unpinning an attachment"
|
|
171461
|
+
});
|
|
171462
|
+
var DownloadAttachmentParamsSchema = Schema_exports.Struct({
|
|
171463
|
+
attachmentId: AttachmentId.annotations({
|
|
171464
|
+
description: "Attachment ID"
|
|
171465
|
+
})
|
|
171466
|
+
}).annotations({
|
|
171467
|
+
title: "DownloadAttachmentParams",
|
|
171468
|
+
description: "Parameters for getting attachment download URL"
|
|
171469
|
+
});
|
|
171470
|
+
var AddIssueAttachmentParamsBase = Schema_exports.Struct({
|
|
171471
|
+
project: ProjectIdentifier.annotations({
|
|
171472
|
+
description: "Project identifier (e.g., 'HULY')"
|
|
171473
|
+
}),
|
|
171474
|
+
identifier: IssueIdentifier.annotations({
|
|
171475
|
+
description: "Issue identifier (e.g., 'HULY-123')"
|
|
171476
|
+
}),
|
|
171477
|
+
...FileSourceFields
|
|
171478
|
+
});
|
|
171479
|
+
var AddIssueAttachmentParamsSchema = AddIssueAttachmentParamsBase.pipe(
|
|
171480
|
+
Schema_exports.filter(hasFileSource)
|
|
171481
|
+
).annotations({
|
|
171482
|
+
title: "AddIssueAttachmentParams",
|
|
171483
|
+
description: "Parameters for adding an attachment to an issue"
|
|
171484
|
+
});
|
|
171485
|
+
var AddDocumentAttachmentParamsBase = Schema_exports.Struct({
|
|
171486
|
+
teamspace: TeamspaceIdentifier.annotations({
|
|
171487
|
+
description: "Teamspace name or ID"
|
|
171488
|
+
}),
|
|
171489
|
+
document: DocumentIdentifier.annotations({
|
|
171490
|
+
description: "Document title or ID"
|
|
171491
|
+
}),
|
|
171492
|
+
...FileSourceFields
|
|
171493
|
+
});
|
|
171494
|
+
var AddDocumentAttachmentParamsSchema = AddDocumentAttachmentParamsBase.pipe(
|
|
171495
|
+
Schema_exports.filter(hasFileSource)
|
|
171496
|
+
).annotations({
|
|
171497
|
+
title: "AddDocumentAttachmentParams",
|
|
171498
|
+
description: "Parameters for adding an attachment to a document"
|
|
171499
|
+
});
|
|
171500
|
+
var listAttachmentsParamsJsonSchema = JSONSchema_exports.make(ListAttachmentsParamsSchema);
|
|
171501
|
+
var getAttachmentParamsJsonSchema = JSONSchema_exports.make(GetAttachmentParamsSchema);
|
|
171502
|
+
var addAttachmentParamsJsonSchema = JSONSchema_exports.make(AddAttachmentParamsSchema);
|
|
171503
|
+
var updateAttachmentParamsJsonSchema = withAtLeastOneRequired(
|
|
171504
|
+
JSONSchema_exports.make(UpdateAttachmentParamsSchema),
|
|
171505
|
+
UPDATE_ATTACHMENT_FIELDS
|
|
171506
|
+
);
|
|
171507
|
+
var deleteAttachmentParamsJsonSchema = JSONSchema_exports.make(DeleteAttachmentParamsSchema);
|
|
171508
|
+
var pinAttachmentParamsJsonSchema = JSONSchema_exports.make(PinAttachmentParamsSchema);
|
|
171509
|
+
var downloadAttachmentParamsJsonSchema = JSONSchema_exports.make(DownloadAttachmentParamsSchema);
|
|
171510
|
+
var addIssueAttachmentParamsJsonSchema = JSONSchema_exports.make(AddIssueAttachmentParamsSchema);
|
|
171511
|
+
var addDocumentAttachmentParamsJsonSchema = JSONSchema_exports.make(AddDocumentAttachmentParamsSchema);
|
|
171512
|
+
var parseListAttachmentsParams = Schema_exports.decodeUnknown(ListAttachmentsParamsSchema);
|
|
171513
|
+
var parseGetAttachmentParams = Schema_exports.decodeUnknown(GetAttachmentParamsSchema);
|
|
171514
|
+
var parseAddAttachmentParams = Schema_exports.decodeUnknown(AddAttachmentParamsSchema);
|
|
171515
|
+
var parseUpdateAttachmentParams = Schema_exports.decodeUnknown(UpdateAttachmentParamsSchema);
|
|
171516
|
+
var parseDeleteAttachmentParams = Schema_exports.decodeUnknown(DeleteAttachmentParamsSchema);
|
|
171517
|
+
var parsePinAttachmentParams = Schema_exports.decodeUnknown(PinAttachmentParamsSchema);
|
|
171518
|
+
var parseDownloadAttachmentParams = Schema_exports.decodeUnknown(DownloadAttachmentParamsSchema);
|
|
171519
|
+
var parseAddIssueAttachmentParams = Schema_exports.decodeUnknown(AddIssueAttachmentParamsSchema);
|
|
171520
|
+
var parseAddDocumentAttachmentParams = Schema_exports.decodeUnknown(AddDocumentAttachmentParamsSchema);
|
|
171521
|
+
var AttachmentSummaryWireSchema = Schema_exports.Struct({
|
|
171522
|
+
id: AttachmentId,
|
|
171523
|
+
class: ObjectClassName,
|
|
171524
|
+
name: AttachmentFileName,
|
|
171525
|
+
type: MimeType,
|
|
171526
|
+
size: AttachmentByteSize,
|
|
171527
|
+
pinned: Schema_exports.optional(Schema_exports.Boolean),
|
|
171528
|
+
description: Schema_exports.optional(AttachmentDescription),
|
|
171529
|
+
metadata: Schema_exports.optional(AttachmentMetadataSchema),
|
|
171530
|
+
modifiedOn: Schema_exports.optional(Timestamp)
|
|
171531
|
+
});
|
|
171532
|
+
var AttachmentWireSchema = Schema_exports.Struct({
|
|
171533
|
+
id: AttachmentId,
|
|
171534
|
+
class: ObjectClassName,
|
|
171535
|
+
name: AttachmentFileName,
|
|
171536
|
+
type: MimeType,
|
|
171537
|
+
size: AttachmentByteSize,
|
|
171538
|
+
pinned: Schema_exports.optional(Schema_exports.Boolean),
|
|
171539
|
+
readonly: Schema_exports.optional(Schema_exports.Boolean),
|
|
171540
|
+
description: Schema_exports.optional(AttachmentDescription),
|
|
171541
|
+
metadata: Schema_exports.optional(AttachmentMetadataSchema),
|
|
171542
|
+
url: Schema_exports.optional(UrlString),
|
|
171543
|
+
modifiedOn: Schema_exports.optional(Timestamp),
|
|
171544
|
+
createdOn: Schema_exports.optional(Timestamp)
|
|
171545
|
+
});
|
|
171546
|
+
var ListAttachmentsResultSchema = Schema_exports.Array(AttachmentSummaryWireSchema);
|
|
171547
|
+
|
|
171548
|
+
// src/domain/schemas/json-schema.ts
|
|
171549
|
+
var withJsonSchemaPropertyDescriptions = (schema, descriptions) => {
|
|
171550
|
+
const properties = Predicate_exports.isRecord(schema) ? schema.properties : void 0;
|
|
171551
|
+
if (!Predicate_exports.isRecord(properties)) return schema;
|
|
171552
|
+
return {
|
|
171553
|
+
...schema,
|
|
171554
|
+
properties: Object.fromEntries(
|
|
171555
|
+
Object.entries(properties).map(([key, value3]) => {
|
|
171556
|
+
const description = descriptions[key];
|
|
171557
|
+
return [
|
|
171558
|
+
key,
|
|
171559
|
+
description === void 0 || !Predicate_exports.isRecord(value3) ? value3 : { ...value3, description }
|
|
171560
|
+
];
|
|
171561
|
+
})
|
|
171562
|
+
)
|
|
171563
|
+
};
|
|
171564
|
+
};
|
|
171565
|
+
var withExactlyOneRequired = (schema, fields) => ({
|
|
171566
|
+
...schema,
|
|
171567
|
+
oneOf: fields.map((field) => ({ required: [field] }))
|
|
171568
|
+
});
|
|
171569
|
+
|
|
171570
|
+
// src/domain/schemas/chat-message-attachment-results.ts
|
|
171571
|
+
var ResolvedTargetBaseSchema = {
|
|
171572
|
+
space: SpaceId,
|
|
171573
|
+
objectId: DocId,
|
|
171574
|
+
objectClass: ObjectClassName,
|
|
171575
|
+
collection: Schema_exports.Literal("attachments")
|
|
171576
|
+
};
|
|
171577
|
+
var ChatMessageAttachmentResolvedTargetSchema = Schema_exports.Union(
|
|
171578
|
+
Schema_exports.Struct({
|
|
171579
|
+
kind: Schema_exports.Literal("channel_message"),
|
|
171580
|
+
channelId: ChannelId,
|
|
171581
|
+
channelName: ChannelName,
|
|
171582
|
+
messageId: MessageId,
|
|
171583
|
+
display: NonEmptyString2,
|
|
171584
|
+
...ResolvedTargetBaseSchema
|
|
171585
|
+
}),
|
|
171586
|
+
Schema_exports.Struct({
|
|
171587
|
+
kind: Schema_exports.Literal("dm_message"),
|
|
171588
|
+
dmId: ChannelId,
|
|
171589
|
+
messageId: MessageId,
|
|
171590
|
+
display: NonEmptyString2,
|
|
171591
|
+
...ResolvedTargetBaseSchema
|
|
171592
|
+
}),
|
|
171593
|
+
Schema_exports.Struct({
|
|
171594
|
+
kind: Schema_exports.Literal("thread_reply"),
|
|
171595
|
+
channelId: ChannelId,
|
|
171596
|
+
channelName: ChannelName,
|
|
171597
|
+
messageId: MessageId,
|
|
171598
|
+
replyId: ThreadReplyId,
|
|
171599
|
+
display: NonEmptyString2,
|
|
171600
|
+
...ResolvedTargetBaseSchema
|
|
171601
|
+
})
|
|
171602
|
+
).annotations({
|
|
171603
|
+
title: "ChatMessageAttachmentResolvedTarget",
|
|
171604
|
+
description: "Resolved Huly chat message attachment target. objectId/objectClass/space identify the exact object whose attachments collection is being read or mutated."
|
|
171605
|
+
});
|
|
171606
|
+
var ListChatMessageAttachmentsResultSchema = Schema_exports.Struct({
|
|
171607
|
+
target: ChatMessageAttachmentResolvedTargetSchema,
|
|
171608
|
+
attachments: Schema_exports.Array(AttachmentSummaryWireSchema),
|
|
171609
|
+
total: Count
|
|
171610
|
+
});
|
|
171611
|
+
var GetChatMessageAttachmentResultSchema = Schema_exports.Struct({
|
|
171612
|
+
target: ChatMessageAttachmentResolvedTargetSchema,
|
|
171613
|
+
attachment: AttachmentWireSchema
|
|
171614
|
+
});
|
|
171615
|
+
var AddChatMessageAttachmentResultSchema = Schema_exports.Struct({
|
|
171616
|
+
target: ChatMessageAttachmentResolvedTargetSchema,
|
|
171617
|
+
attachmentId: AttachmentId,
|
|
171618
|
+
blobId: BlobId,
|
|
171619
|
+
url: UrlString
|
|
171620
|
+
});
|
|
171621
|
+
var UpdateChatMessageAttachmentResultSchema = Schema_exports.Struct({
|
|
171622
|
+
target: ChatMessageAttachmentResolvedTargetSchema,
|
|
171623
|
+
attachmentId: AttachmentId,
|
|
171624
|
+
updated: Schema_exports.Boolean
|
|
171625
|
+
});
|
|
171626
|
+
var DeleteChatMessageAttachmentResultSchema = Schema_exports.Struct({
|
|
171627
|
+
target: ChatMessageAttachmentResolvedTargetSchema,
|
|
171628
|
+
attachmentId: AttachmentId,
|
|
171629
|
+
deleted: Schema_exports.Boolean
|
|
171630
|
+
});
|
|
171631
|
+
|
|
171632
|
+
// src/domain/schemas/chat-message-attachments.ts
|
|
171633
|
+
var ChannelMessageTargetSchema = Schema_exports.Struct({
|
|
171634
|
+
kind: Schema_exports.Literal("channel_message"),
|
|
171635
|
+
channel: ChannelIdentifier.annotations({
|
|
171636
|
+
description: "Channel name or ID containing the message."
|
|
171637
|
+
}),
|
|
171638
|
+
messageId: MessageId.annotations({
|
|
171639
|
+
description: "Channel message ID."
|
|
171640
|
+
})
|
|
171641
|
+
});
|
|
171642
|
+
var DmMessageTargetSchema = Schema_exports.Struct({
|
|
171643
|
+
kind: Schema_exports.Literal("dm_message"),
|
|
171644
|
+
dm: DirectMessageIdentifier.annotations({
|
|
171645
|
+
description: "Direct-message conversation: either the DM `_id` or a one-to-one participant display name."
|
|
171646
|
+
}),
|
|
171647
|
+
messageId: MessageId.annotations({
|
|
171648
|
+
description: "Direct-message message ID."
|
|
171649
|
+
})
|
|
171650
|
+
});
|
|
171651
|
+
var ThreadReplyTargetSchema = Schema_exports.Struct({
|
|
171652
|
+
kind: Schema_exports.Literal("thread_reply"),
|
|
171653
|
+
channel: ChannelIdentifier.annotations({
|
|
171654
|
+
description: "Channel name or ID containing the parent message."
|
|
171655
|
+
}),
|
|
171656
|
+
messageId: MessageId.annotations({
|
|
171657
|
+
description: "Parent channel message ID."
|
|
171658
|
+
}),
|
|
171659
|
+
replyId: ThreadReplyId.annotations({
|
|
171660
|
+
description: "Thread reply ID."
|
|
171661
|
+
})
|
|
171662
|
+
});
|
|
171663
|
+
var ChatMessageAttachmentTargetSchema = Schema_exports.Union(
|
|
171664
|
+
ChannelMessageTargetSchema,
|
|
171665
|
+
DmMessageTargetSchema,
|
|
171666
|
+
ThreadReplyTargetSchema
|
|
171667
|
+
);
|
|
171668
|
+
var ChatMessageAttachmentFileFields = {
|
|
171669
|
+
filename: AttachmentFileName.annotations({
|
|
171670
|
+
description: "Name of the file to attach to the chat message or thread reply."
|
|
171671
|
+
}),
|
|
171672
|
+
contentType: MimeType.annotations({
|
|
171673
|
+
description: "MIME type of the file, such as image/png or application/pdf."
|
|
171674
|
+
}),
|
|
171675
|
+
filePath: Schema_exports.optional(LocalFilePath.annotations({
|
|
171676
|
+
description: "Local file path to upload. Mutually exclusive with fileUrl and data."
|
|
171677
|
+
})),
|
|
171678
|
+
fileUrl: Schema_exports.optional(UrlString.annotations({
|
|
171679
|
+
description: "Remote URL to fetch and upload. Mutually exclusive with filePath and data."
|
|
171680
|
+
})),
|
|
171681
|
+
data: Schema_exports.optional(Base64FileData.annotations({
|
|
171682
|
+
description: "Base64-encoded file data. Mutually exclusive with filePath and fileUrl."
|
|
171683
|
+
})),
|
|
171684
|
+
description: Schema_exports.optional(AttachmentDescription.annotations({
|
|
171685
|
+
description: "Optional attachment description."
|
|
171686
|
+
})),
|
|
171687
|
+
pinned: Schema_exports.optional(Schema_exports.Boolean.annotations({
|
|
171688
|
+
description: "Whether the attachment should be pinned."
|
|
171689
|
+
}))
|
|
171690
|
+
};
|
|
171691
|
+
var CHAT_MESSAGE_ATTACHMENT_FILE_SOURCE_FIELDS = ["filePath", "fileUrl", "data"];
|
|
171692
|
+
var chatMessageAttachmentExactlyOneFileSourceMessage = `Provide exactly one of ${CHAT_MESSAGE_ATTACHMENT_FILE_SOURCE_FIELDS.join(", ")}.`;
|
|
171693
|
+
var requireExactlyOneAttachmentFileSource = (params) => CHAT_MESSAGE_ATTACHMENT_FILE_SOURCE_FIELDS.filter((field) => params[field] !== void 0).length === 1 || chatMessageAttachmentExactlyOneFileSourceMessage;
|
|
171694
|
+
var ListChatMessageAttachmentsParamsSchema = Schema_exports.Struct({
|
|
171695
|
+
target: ChatMessageAttachmentTargetSchema,
|
|
171696
|
+
limit: Schema_exports.optional(LimitParam.annotations({
|
|
171697
|
+
description: `Maximum number of attachments to return (default: ${DEFAULT_LIMIT}).`
|
|
171698
|
+
}))
|
|
171699
|
+
}).annotations({
|
|
171700
|
+
title: "ListChatMessageAttachmentsParams",
|
|
171701
|
+
description: "Parameters for listing files attached directly to a Huly chat message or thread reply."
|
|
171702
|
+
});
|
|
171703
|
+
var GetChatMessageAttachmentParamsSchema = Schema_exports.Struct({
|
|
171704
|
+
target: ChatMessageAttachmentTargetSchema,
|
|
171705
|
+
attachmentId: AttachmentId.annotations({
|
|
171706
|
+
description: "Attachment ID. Must belong directly to the resolved chat message target."
|
|
171707
|
+
})
|
|
171708
|
+
}).annotations({
|
|
171709
|
+
title: "GetChatMessageAttachmentParams",
|
|
171710
|
+
description: "Parameters for retrieving one file attached directly to a Huly chat message or thread reply."
|
|
171711
|
+
});
|
|
171712
|
+
var AddChatMessageAttachmentParamsSchema = Schema_exports.Struct({
|
|
171713
|
+
target: ChatMessageAttachmentTargetSchema,
|
|
171714
|
+
...ChatMessageAttachmentFileFields
|
|
171715
|
+
}).pipe(
|
|
171716
|
+
Schema_exports.filter(requireExactlyOneAttachmentFileSource)
|
|
171717
|
+
).annotations({
|
|
171718
|
+
title: "AddChatMessageAttachmentParams",
|
|
171719
|
+
description: `Parameters for adding a file to a Huly chat message or thread reply. ${chatMessageAttachmentExactlyOneFileSourceMessage}`
|
|
171720
|
+
});
|
|
171721
|
+
var UPDATE_CHAT_MESSAGE_ATTACHMENT_FIELDS = UPDATE_ATTACHMENT_FIELDS;
|
|
171722
|
+
var UpdateChatMessageAttachmentParamsSchema = Schema_exports.Struct({
|
|
171723
|
+
target: ChatMessageAttachmentTargetSchema,
|
|
171724
|
+
attachmentId: AttachmentId.annotations({
|
|
171725
|
+
description: "Attachment ID. Must belong directly to the resolved chat message target."
|
|
171726
|
+
}),
|
|
171727
|
+
description: Schema_exports.optional(
|
|
171728
|
+
Schema_exports.NullOr(AttachmentDescription).annotations({
|
|
171729
|
+
description: "New description; use null to clear it."
|
|
171730
|
+
})
|
|
171731
|
+
),
|
|
171732
|
+
pinned: Schema_exports.optional(Schema_exports.Boolean.annotations({
|
|
171733
|
+
description: "Pin or unpin the attachment."
|
|
171734
|
+
}))
|
|
171735
|
+
}).pipe(
|
|
171736
|
+
Schema_exports.filter(
|
|
171737
|
+
(params) => hasAtLeastOneDefined(params, UPDATE_CHAT_MESSAGE_ATTACHMENT_FIELDS) ? void 0 : atLeastOneUpdateFieldMessage(UPDATE_CHAT_MESSAGE_ATTACHMENT_FIELDS)
|
|
171738
|
+
)
|
|
171739
|
+
).annotations({
|
|
171740
|
+
title: "UpdateChatMessageAttachmentParams",
|
|
171741
|
+
description: `Parameters for updating chat message attachment metadata. ${atLeastOneUpdateFieldMessage(UPDATE_CHAT_MESSAGE_ATTACHMENT_FIELDS)}`
|
|
171742
|
+
});
|
|
171743
|
+
assertUpdateFields()(
|
|
171744
|
+
["target", "attachmentId"],
|
|
171745
|
+
UPDATE_CHAT_MESSAGE_ATTACHMENT_FIELDS
|
|
171746
|
+
);
|
|
171747
|
+
var DeleteChatMessageAttachmentParamsSchema = GetChatMessageAttachmentParamsSchema.annotations({
|
|
171748
|
+
title: "DeleteChatMessageAttachmentParams",
|
|
171749
|
+
description: "Parameters for permanently deleting a file attached directly to a Huly chat message or thread reply."
|
|
171750
|
+
});
|
|
171751
|
+
var CHAT_MESSAGE_ATTACHMENT_FIELD_DESCRIPTIONS = {
|
|
171752
|
+
target: "Chat attachment target. Use channel_message for a channel message, dm_message for a direct-message message, or thread_reply for a thread reply.",
|
|
171753
|
+
limit: `Maximum number of matching attachments to return (default: ${DEFAULT_LIMIT}).`,
|
|
171754
|
+
attachmentId: "Attachment ID. Must belong directly to the resolved chat message target.",
|
|
171755
|
+
filename: "Name of the file to attach to the chat message or thread reply.",
|
|
171756
|
+
contentType: "MIME type of the file, such as image/png or application/pdf.",
|
|
171757
|
+
filePath: "Local file path to upload. Mutually exclusive with fileUrl and data.",
|
|
171758
|
+
fileUrl: "Remote URL to fetch and upload. Mutually exclusive with filePath and data.",
|
|
171759
|
+
data: "Base64-encoded file data. Mutually exclusive with filePath and fileUrl.",
|
|
171760
|
+
description: "Optional attachment description. Use null on update to clear it.",
|
|
171761
|
+
pinned: "Whether the attachment should be pinned."
|
|
171762
|
+
};
|
|
171763
|
+
var CHAT_MESSAGE_ATTACHMENT_TARGET_FIELD_DESCRIPTIONS = {
|
|
171764
|
+
kind: "Target kind: channel_message, dm_message, or thread_reply.",
|
|
171765
|
+
channel: "Channel name or ID. Required for channel_message and thread_reply targets.",
|
|
171766
|
+
dm: "Direct-message conversation ID or one-to-one participant display name.",
|
|
171767
|
+
messageId: "Existing message ID. For thread_reply, this is the parent channel message ID.",
|
|
171768
|
+
replyId: "Existing thread reply ID."
|
|
171769
|
+
};
|
|
171770
|
+
var withRootSchemaMetadata = (schema, title, description) => ({
|
|
171771
|
+
...schema,
|
|
171772
|
+
title,
|
|
171773
|
+
description
|
|
171774
|
+
});
|
|
171775
|
+
var withChatMessageAttachmentTargetVariantDescriptions = (schema) => {
|
|
171776
|
+
const properties = Predicate_exports.isRecord(schema) ? schema.properties : void 0;
|
|
171777
|
+
if (!Predicate_exports.isRecord(properties)) return schema;
|
|
171778
|
+
const target = properties.target;
|
|
171779
|
+
if (!Predicate_exports.isRecord(target) || !Array.isArray(target.anyOf)) return schema;
|
|
171780
|
+
return {
|
|
171781
|
+
...schema,
|
|
171782
|
+
properties: {
|
|
171783
|
+
...properties,
|
|
171784
|
+
target: {
|
|
171785
|
+
...target,
|
|
171786
|
+
anyOf: target.anyOf.map(
|
|
171787
|
+
(variant) => Predicate_exports.isRecord(variant) ? withJsonSchemaPropertyDescriptions(variant, CHAT_MESSAGE_ATTACHMENT_TARGET_FIELD_DESCRIPTIONS) : variant
|
|
171788
|
+
)
|
|
171789
|
+
}
|
|
171790
|
+
}
|
|
171791
|
+
};
|
|
171792
|
+
};
|
|
171793
|
+
var chatMessageAttachmentJsonSchema = (schema) => withChatMessageAttachmentTargetVariantDescriptions(
|
|
171794
|
+
withJsonSchemaPropertyDescriptions(JSONSchema_exports.make(schema), CHAT_MESSAGE_ATTACHMENT_FIELD_DESCRIPTIONS)
|
|
171795
|
+
);
|
|
171796
|
+
var withExactlyOneChatMessageAttachmentFileSource = (schema) => withExactlyOneRequired(schema, CHAT_MESSAGE_ATTACHMENT_FILE_SOURCE_FIELDS);
|
|
171797
|
+
var listChatMessageAttachmentsParamsJsonSchema = chatMessageAttachmentJsonSchema(
|
|
171798
|
+
ListChatMessageAttachmentsParamsSchema
|
|
171799
|
+
);
|
|
171800
|
+
var getChatMessageAttachmentParamsJsonSchema = chatMessageAttachmentJsonSchema(
|
|
171801
|
+
GetChatMessageAttachmentParamsSchema
|
|
171802
|
+
);
|
|
171803
|
+
var addChatMessageAttachmentParamsJsonSchema = withExactlyOneChatMessageAttachmentFileSource(
|
|
171804
|
+
withRootSchemaMetadata(
|
|
171805
|
+
chatMessageAttachmentJsonSchema(AddChatMessageAttachmentParamsSchema),
|
|
171806
|
+
"AddChatMessageAttachmentParams",
|
|
171807
|
+
`Parameters for adding a file to a Huly chat message or thread reply. ${chatMessageAttachmentExactlyOneFileSourceMessage}`
|
|
171808
|
+
)
|
|
171809
|
+
);
|
|
171810
|
+
var updateChatMessageAttachmentParamsJsonSchema = withAtLeastOneRequired(
|
|
171811
|
+
chatMessageAttachmentJsonSchema(UpdateChatMessageAttachmentParamsSchema),
|
|
171812
|
+
UPDATE_CHAT_MESSAGE_ATTACHMENT_FIELDS
|
|
171813
|
+
);
|
|
171814
|
+
var deleteChatMessageAttachmentParamsJsonSchema = chatMessageAttachmentJsonSchema(
|
|
171815
|
+
DeleteChatMessageAttachmentParamsSchema
|
|
171816
|
+
);
|
|
171817
|
+
var parseListChatMessageAttachmentsParams = Schema_exports.decodeUnknown(ListChatMessageAttachmentsParamsSchema);
|
|
171818
|
+
var parseGetChatMessageAttachmentParams = Schema_exports.decodeUnknown(GetChatMessageAttachmentParamsSchema);
|
|
171819
|
+
var parseAddChatMessageAttachmentParams = Schema_exports.decodeUnknown(AddChatMessageAttachmentParamsSchema);
|
|
171820
|
+
var parseUpdateChatMessageAttachmentParams = Schema_exports.decodeUnknown(UpdateChatMessageAttachmentParamsSchema);
|
|
171821
|
+
var parseDeleteChatMessageAttachmentParams = Schema_exports.decodeUnknown(DeleteChatMessageAttachmentParamsSchema);
|
|
171822
|
+
|
|
171257
171823
|
// src/domain/schemas/direct-messages.ts
|
|
171258
171824
|
var ListDmMessagesParamsSchema = Schema_exports.Struct({
|
|
171259
171825
|
dm: DirectMessageIdentifier.annotations({
|
|
@@ -172831,78 +173397,6 @@ var UNKNOWN_SEARCH_TOTAL = UNKNOWN_TOTAL;
|
|
|
172831
173397
|
var fulltextSearchParamsJsonSchema = JSONSchema_exports.make(FulltextSearchParamsSchema);
|
|
172832
173398
|
var parseFulltextSearchParams = Schema_exports.decodeUnknown(FulltextSearchParamsSchema);
|
|
172833
173399
|
|
|
172834
|
-
// src/domain/schemas/domain-values.ts
|
|
172835
|
-
var LocalFilePath = Schema_exports.String.pipe(Schema_exports.brand("LocalFilePath")).annotations({
|
|
172836
|
-
identifier: "LocalFilePath",
|
|
172837
|
-
title: "LocalFilePath",
|
|
172838
|
-
description: "Host-local file path used only as an upload transport input. It is not a Huly domain identifier and may be OS-specific."
|
|
172839
|
-
});
|
|
172840
|
-
var Base64FileData = Schema_exports.String.pipe(Schema_exports.brand("Base64FileData")).annotations({
|
|
172841
|
-
identifier: "Base64FileData",
|
|
172842
|
-
title: "Base64FileData",
|
|
172843
|
-
description: "Base64-encoded upload payload. It is transport data rather than a Huly domain value, but is branded to avoid arbitrary text confusion."
|
|
172844
|
-
});
|
|
172845
|
-
var AttachmentFileName = NonEmptyString2.pipe(Schema_exports.brand("AttachmentFileName")).annotations({
|
|
172846
|
-
identifier: "AttachmentFileName",
|
|
172847
|
-
title: "AttachmentFileName",
|
|
172848
|
-
description: "Non-empty attachment filename as stored by Huly."
|
|
172849
|
-
});
|
|
172850
|
-
var AttachmentDescription = Schema_exports.String.pipe(Schema_exports.brand("AttachmentDescription")).annotations({
|
|
172851
|
-
identifier: "AttachmentDescription",
|
|
172852
|
-
title: "AttachmentDescription",
|
|
172853
|
-
description: "Free-form attachment description. Empty string is valid because Huly uses it to clear descriptions."
|
|
172854
|
-
});
|
|
172855
|
-
var AttachmentByteSize = NonNegativeInteger.pipe(Schema_exports.brand("AttachmentByteSize")).annotations({
|
|
172856
|
-
identifier: "AttachmentByteSize",
|
|
172857
|
-
title: "AttachmentByteSize",
|
|
172858
|
-
description: "Attachment size in bytes. Must be a non-negative integer, never a fraction or negative value."
|
|
172859
|
-
});
|
|
172860
|
-
var AttachmentMetadataKey = Schema_exports.String.pipe(Schema_exports.brand("AttachmentMetadataKey")).annotations({
|
|
172861
|
-
identifier: "AttachmentMetadataKey",
|
|
172862
|
-
title: "AttachmentMetadataKey",
|
|
172863
|
-
description: "Open attachment metadata record key supplied by the Huly SDK. It is not a closed MCP domain enum."
|
|
172864
|
-
});
|
|
172865
|
-
var DisplayText = NonEmptyString2.pipe(Schema_exports.brand("DisplayText")).annotations({
|
|
172866
|
-
identifier: "DisplayText",
|
|
172867
|
-
title: "DisplayText",
|
|
172868
|
-
description: "Human-readable display text from Huly model metadata or user-authored content."
|
|
172869
|
-
});
|
|
172870
|
-
var ActivityMarkup = Schema_exports.String.pipe(Schema_exports.brand("ActivityMarkup")).annotations({
|
|
172871
|
-
identifier: "ActivityMarkup",
|
|
172872
|
-
title: "ActivityMarkup",
|
|
172873
|
-
description: "Huly activity markup payload. Empty string is valid when the SDK stores cleared content."
|
|
172874
|
-
});
|
|
172875
|
-
var ActivityMarkdown = Schema_exports.String.pipe(Schema_exports.brand("ActivityMarkdown")).annotations({
|
|
172876
|
-
identifier: "ActivityMarkdown",
|
|
172877
|
-
title: "ActivityMarkdown",
|
|
172878
|
-
description: "Markdown projection of a Huly activity markup payload for MCP responses."
|
|
172879
|
-
});
|
|
172880
|
-
var MentionContent = Schema_exports.String.pipe(Schema_exports.brand("MentionContent")).annotations({
|
|
172881
|
-
identifier: "MentionContent",
|
|
172882
|
-
title: "MentionContent",
|
|
172883
|
-
description: "User-authored activity mention snippet returned by Huly."
|
|
172884
|
-
});
|
|
172885
|
-
var DrawingContent = Schema_exports.String.pipe(Schema_exports.brand("DrawingContent")).annotations({
|
|
172886
|
-
identifier: "DrawingContent",
|
|
172887
|
-
title: "DrawingContent",
|
|
172888
|
-
description: "Opaque drawing content payload stored by Huly."
|
|
172889
|
-
});
|
|
172890
|
-
var ActivityFilterPosition = Integer.pipe(Schema_exports.brand("ActivityFilterPosition")).annotations({
|
|
172891
|
-
identifier: "ActivityFilterPosition",
|
|
172892
|
-
title: "ActivityFilterPosition",
|
|
172893
|
-
description: "Integer display order for an activity filter."
|
|
172894
|
-
});
|
|
172895
|
-
var NotificationProviderOrder = Integer.pipe(Schema_exports.brand("NotificationProviderOrder")).annotations({
|
|
172896
|
-
identifier: "NotificationProviderOrder",
|
|
172897
|
-
title: "NotificationProviderOrder",
|
|
172898
|
-
description: "Integer display order for a notification provider."
|
|
172899
|
-
});
|
|
172900
|
-
var NotificationFieldName = NonEmptyString2.pipe(Schema_exports.brand("NotificationFieldName")).annotations({
|
|
172901
|
-
identifier: "NotificationFieldName",
|
|
172902
|
-
title: "NotificationFieldName",
|
|
172903
|
-
description: "Huly document field name associated with a notification type."
|
|
172904
|
-
});
|
|
172905
|
-
|
|
172906
173400
|
// src/domain/schemas/activity.ts
|
|
172907
173401
|
var ActivityCount = Count.pipe(Schema_exports.brand("ActivityCount")).annotations({
|
|
172908
173402
|
identifier: "ActivityCount",
|
|
@@ -173310,212 +173804,6 @@ var ListActivityFiltersResultSchema = Schema_exports.Array(ActivityFilterWireSch
|
|
|
173310
173804
|
var ListActivityReferencesResultSchema = Schema_exports.Array(ActivityReferenceWireSchema);
|
|
173311
173805
|
var ListActivityRepliesResultSchema = Schema_exports.Array(ActivityMessageWireSchema);
|
|
173312
173806
|
|
|
173313
|
-
// src/domain/schemas/attachments.ts
|
|
173314
|
-
var DEFAULT_ATTACHMENT_PINNED = false;
|
|
173315
|
-
var AttachmentKindSchema = Schema_exports.Literal("attachment", "embedding", "photo").annotations({
|
|
173316
|
-
title: "AttachmentKind",
|
|
173317
|
-
description: "Attachment class to create: attachment, embedding, or photo. Defaults to attachment."
|
|
173318
|
-
});
|
|
173319
|
-
var AttachmentMetadataSchema = Schema_exports.Record({ key: AttachmentMetadataKey, value: Schema_exports.Unknown });
|
|
173320
|
-
var ListAttachmentsParamsSchema = Schema_exports.Struct({
|
|
173321
|
-
objectId: DocId.annotations({
|
|
173322
|
-
description: "ID of the parent object (issue, document, etc.)"
|
|
173323
|
-
}),
|
|
173324
|
-
objectClass: ObjectClassName.annotations({
|
|
173325
|
-
description: "Class of the parent object (e.g., 'tracker:class:Issue', 'document:class:Document')"
|
|
173326
|
-
}),
|
|
173327
|
-
limit: Schema_exports.optional(
|
|
173328
|
-
LimitParam.annotations({
|
|
173329
|
-
description: `Maximum number of attachments to return (default: ${DEFAULT_LIMIT})`
|
|
173330
|
-
})
|
|
173331
|
-
)
|
|
173332
|
-
}).annotations({
|
|
173333
|
-
title: "ListAttachmentsParams",
|
|
173334
|
-
description: "Parameters for listing attachments on an object"
|
|
173335
|
-
});
|
|
173336
|
-
var GetAttachmentParamsSchema = Schema_exports.Struct({
|
|
173337
|
-
attachmentId: AttachmentId.annotations({
|
|
173338
|
-
description: "Attachment ID"
|
|
173339
|
-
})
|
|
173340
|
-
}).annotations({
|
|
173341
|
-
title: "GetAttachmentParams",
|
|
173342
|
-
description: "Parameters for getting a single attachment"
|
|
173343
|
-
});
|
|
173344
|
-
var FileSourceFields = {
|
|
173345
|
-
filename: AttachmentFileName.annotations({
|
|
173346
|
-
description: "Name of the file"
|
|
173347
|
-
}),
|
|
173348
|
-
contentType: MimeType.annotations({
|
|
173349
|
-
description: "MIME type of the file (e.g., 'image/png', 'application/pdf')"
|
|
173350
|
-
}),
|
|
173351
|
-
filePath: Schema_exports.optional(LocalFilePath.annotations({
|
|
173352
|
-
description: "Local file path to upload (preferred - avoids context flooding)"
|
|
173353
|
-
})),
|
|
173354
|
-
fileUrl: Schema_exports.optional(UrlString.annotations({
|
|
173355
|
-
description: "URL to fetch file from (for remote files)"
|
|
173356
|
-
})),
|
|
173357
|
-
data: Schema_exports.optional(Base64FileData.annotations({
|
|
173358
|
-
description: "Base64-encoded file data (fallback for small files <10KB)"
|
|
173359
|
-
})),
|
|
173360
|
-
description: Schema_exports.optional(AttachmentDescription.annotations({
|
|
173361
|
-
description: "Attachment description"
|
|
173362
|
-
})),
|
|
173363
|
-
pinned: Schema_exports.optional(Schema_exports.Boolean.annotations({
|
|
173364
|
-
description: `Whether to pin the attachment (default: ${DEFAULT_ATTACHMENT_PINNED})`
|
|
173365
|
-
})),
|
|
173366
|
-
kind: Schema_exports.optional(AttachmentKindSchema.annotations({
|
|
173367
|
-
description: "Attachment subclass to create: attachment, embedding, or photo (default: attachment)."
|
|
173368
|
-
}))
|
|
173369
|
-
};
|
|
173370
|
-
var hasFileSource = (params) => {
|
|
173371
|
-
const hasSource = params.filePath || params.fileUrl || params.data;
|
|
173372
|
-
return hasSource ? true : "Must provide filePath, fileUrl, or data";
|
|
173373
|
-
};
|
|
173374
|
-
var AddAttachmentParamsBase = Schema_exports.Struct({
|
|
173375
|
-
objectId: DocId.annotations({
|
|
173376
|
-
description: "ID of the parent object (issue, document, etc.)"
|
|
173377
|
-
}),
|
|
173378
|
-
objectClass: ObjectClassName.annotations({
|
|
173379
|
-
description: "Class of the parent object (e.g., 'tracker:class:Issue', 'document:class:Document')"
|
|
173380
|
-
}),
|
|
173381
|
-
space: SpaceId.annotations({
|
|
173382
|
-
description: "Space ID where the parent object resides"
|
|
173383
|
-
}),
|
|
173384
|
-
...FileSourceFields
|
|
173385
|
-
});
|
|
173386
|
-
var AddAttachmentParamsSchema = AddAttachmentParamsBase.pipe(
|
|
173387
|
-
Schema_exports.filter(hasFileSource)
|
|
173388
|
-
).annotations({
|
|
173389
|
-
title: "AddAttachmentParams",
|
|
173390
|
-
description: "Parameters for adding an attachment. Provide ONE of: filePath, fileUrl, or data"
|
|
173391
|
-
});
|
|
173392
|
-
var UPDATE_ATTACHMENT_FIELDS = ["description", "pinned"];
|
|
173393
|
-
var UpdateAttachmentParamsSchema = Schema_exports.Struct({
|
|
173394
|
-
attachmentId: AttachmentId.annotations({
|
|
173395
|
-
description: "Attachment ID"
|
|
173396
|
-
}),
|
|
173397
|
-
description: Schema_exports.optional(
|
|
173398
|
-
Schema_exports.NullOr(AttachmentDescription).annotations({
|
|
173399
|
-
description: "New description (null to clear)"
|
|
173400
|
-
})
|
|
173401
|
-
),
|
|
173402
|
-
pinned: Schema_exports.optional(Schema_exports.Boolean.annotations({
|
|
173403
|
-
description: "Pin or unpin the attachment"
|
|
173404
|
-
}))
|
|
173405
|
-
}).pipe(
|
|
173406
|
-
Schema_exports.filter(
|
|
173407
|
-
(params) => hasAtLeastOneDefined(params, UPDATE_ATTACHMENT_FIELDS) ? void 0 : atLeastOneUpdateFieldMessage(UPDATE_ATTACHMENT_FIELDS)
|
|
173408
|
-
)
|
|
173409
|
-
).annotations({
|
|
173410
|
-
title: "UpdateAttachmentParams",
|
|
173411
|
-
description: `Parameters for updating an attachment. ${atLeastOneUpdateFieldMessage(UPDATE_ATTACHMENT_FIELDS)}`
|
|
173412
|
-
});
|
|
173413
|
-
assertUpdateFields()(["attachmentId"], UPDATE_ATTACHMENT_FIELDS);
|
|
173414
|
-
var DeleteAttachmentParamsSchema = Schema_exports.Struct({
|
|
173415
|
-
attachmentId: AttachmentId.annotations({
|
|
173416
|
-
description: "Attachment ID to delete"
|
|
173417
|
-
})
|
|
173418
|
-
}).annotations({
|
|
173419
|
-
title: "DeleteAttachmentParams",
|
|
173420
|
-
description: "Parameters for deleting an attachment"
|
|
173421
|
-
});
|
|
173422
|
-
var PinAttachmentParamsSchema = Schema_exports.Struct({
|
|
173423
|
-
attachmentId: AttachmentId.annotations({
|
|
173424
|
-
description: "Attachment ID"
|
|
173425
|
-
}),
|
|
173426
|
-
pinned: Schema_exports.Boolean.annotations({
|
|
173427
|
-
description: "Whether to pin (true) or unpin (false)"
|
|
173428
|
-
})
|
|
173429
|
-
}).annotations({
|
|
173430
|
-
title: "PinAttachmentParams",
|
|
173431
|
-
description: "Parameters for pinning/unpinning an attachment"
|
|
173432
|
-
});
|
|
173433
|
-
var DownloadAttachmentParamsSchema = Schema_exports.Struct({
|
|
173434
|
-
attachmentId: AttachmentId.annotations({
|
|
173435
|
-
description: "Attachment ID"
|
|
173436
|
-
})
|
|
173437
|
-
}).annotations({
|
|
173438
|
-
title: "DownloadAttachmentParams",
|
|
173439
|
-
description: "Parameters for getting attachment download URL"
|
|
173440
|
-
});
|
|
173441
|
-
var AddIssueAttachmentParamsBase = Schema_exports.Struct({
|
|
173442
|
-
project: ProjectIdentifier.annotations({
|
|
173443
|
-
description: "Project identifier (e.g., 'HULY')"
|
|
173444
|
-
}),
|
|
173445
|
-
identifier: IssueIdentifier.annotations({
|
|
173446
|
-
description: "Issue identifier (e.g., 'HULY-123')"
|
|
173447
|
-
}),
|
|
173448
|
-
...FileSourceFields
|
|
173449
|
-
});
|
|
173450
|
-
var AddIssueAttachmentParamsSchema = AddIssueAttachmentParamsBase.pipe(
|
|
173451
|
-
Schema_exports.filter(hasFileSource)
|
|
173452
|
-
).annotations({
|
|
173453
|
-
title: "AddIssueAttachmentParams",
|
|
173454
|
-
description: "Parameters for adding an attachment to an issue"
|
|
173455
|
-
});
|
|
173456
|
-
var AddDocumentAttachmentParamsBase = Schema_exports.Struct({
|
|
173457
|
-
teamspace: TeamspaceIdentifier.annotations({
|
|
173458
|
-
description: "Teamspace name or ID"
|
|
173459
|
-
}),
|
|
173460
|
-
document: DocumentIdentifier.annotations({
|
|
173461
|
-
description: "Document title or ID"
|
|
173462
|
-
}),
|
|
173463
|
-
...FileSourceFields
|
|
173464
|
-
});
|
|
173465
|
-
var AddDocumentAttachmentParamsSchema = AddDocumentAttachmentParamsBase.pipe(
|
|
173466
|
-
Schema_exports.filter(hasFileSource)
|
|
173467
|
-
).annotations({
|
|
173468
|
-
title: "AddDocumentAttachmentParams",
|
|
173469
|
-
description: "Parameters for adding an attachment to a document"
|
|
173470
|
-
});
|
|
173471
|
-
var listAttachmentsParamsJsonSchema = JSONSchema_exports.make(ListAttachmentsParamsSchema);
|
|
173472
|
-
var getAttachmentParamsJsonSchema = JSONSchema_exports.make(GetAttachmentParamsSchema);
|
|
173473
|
-
var addAttachmentParamsJsonSchema = JSONSchema_exports.make(AddAttachmentParamsSchema);
|
|
173474
|
-
var updateAttachmentParamsJsonSchema = withAtLeastOneRequired(
|
|
173475
|
-
JSONSchema_exports.make(UpdateAttachmentParamsSchema),
|
|
173476
|
-
UPDATE_ATTACHMENT_FIELDS
|
|
173477
|
-
);
|
|
173478
|
-
var deleteAttachmentParamsJsonSchema = JSONSchema_exports.make(DeleteAttachmentParamsSchema);
|
|
173479
|
-
var pinAttachmentParamsJsonSchema = JSONSchema_exports.make(PinAttachmentParamsSchema);
|
|
173480
|
-
var downloadAttachmentParamsJsonSchema = JSONSchema_exports.make(DownloadAttachmentParamsSchema);
|
|
173481
|
-
var addIssueAttachmentParamsJsonSchema = JSONSchema_exports.make(AddIssueAttachmentParamsSchema);
|
|
173482
|
-
var addDocumentAttachmentParamsJsonSchema = JSONSchema_exports.make(AddDocumentAttachmentParamsSchema);
|
|
173483
|
-
var parseListAttachmentsParams = Schema_exports.decodeUnknown(ListAttachmentsParamsSchema);
|
|
173484
|
-
var parseGetAttachmentParams = Schema_exports.decodeUnknown(GetAttachmentParamsSchema);
|
|
173485
|
-
var parseAddAttachmentParams = Schema_exports.decodeUnknown(AddAttachmentParamsSchema);
|
|
173486
|
-
var parseUpdateAttachmentParams = Schema_exports.decodeUnknown(UpdateAttachmentParamsSchema);
|
|
173487
|
-
var parseDeleteAttachmentParams = Schema_exports.decodeUnknown(DeleteAttachmentParamsSchema);
|
|
173488
|
-
var parsePinAttachmentParams = Schema_exports.decodeUnknown(PinAttachmentParamsSchema);
|
|
173489
|
-
var parseDownloadAttachmentParams = Schema_exports.decodeUnknown(DownloadAttachmentParamsSchema);
|
|
173490
|
-
var parseAddIssueAttachmentParams = Schema_exports.decodeUnknown(AddIssueAttachmentParamsSchema);
|
|
173491
|
-
var parseAddDocumentAttachmentParams = Schema_exports.decodeUnknown(AddDocumentAttachmentParamsSchema);
|
|
173492
|
-
var AttachmentSummaryWireSchema = Schema_exports.Struct({
|
|
173493
|
-
id: AttachmentId,
|
|
173494
|
-
class: ObjectClassName,
|
|
173495
|
-
name: AttachmentFileName,
|
|
173496
|
-
type: MimeType,
|
|
173497
|
-
size: AttachmentByteSize,
|
|
173498
|
-
pinned: Schema_exports.optional(Schema_exports.Boolean),
|
|
173499
|
-
description: Schema_exports.optional(AttachmentDescription),
|
|
173500
|
-
metadata: Schema_exports.optional(AttachmentMetadataSchema),
|
|
173501
|
-
modifiedOn: Schema_exports.optional(Timestamp)
|
|
173502
|
-
});
|
|
173503
|
-
var AttachmentWireSchema = Schema_exports.Struct({
|
|
173504
|
-
id: AttachmentId,
|
|
173505
|
-
class: ObjectClassName,
|
|
173506
|
-
name: AttachmentFileName,
|
|
173507
|
-
type: MimeType,
|
|
173508
|
-
size: AttachmentByteSize,
|
|
173509
|
-
pinned: Schema_exports.optional(Schema_exports.Boolean),
|
|
173510
|
-
readonly: Schema_exports.optional(Schema_exports.Boolean),
|
|
173511
|
-
description: Schema_exports.optional(AttachmentDescription),
|
|
173512
|
-
metadata: Schema_exports.optional(AttachmentMetadataSchema),
|
|
173513
|
-
url: Schema_exports.optional(UrlString),
|
|
173514
|
-
modifiedOn: Schema_exports.optional(Timestamp),
|
|
173515
|
-
createdOn: Schema_exports.optional(Timestamp)
|
|
173516
|
-
});
|
|
173517
|
-
var ListAttachmentsResultSchema = Schema_exports.Array(AttachmentSummaryWireSchema);
|
|
173518
|
-
|
|
173519
173807
|
// src/domain/schemas/attachment-extras.ts
|
|
173520
173808
|
var SaveAttachmentParamsSchema = Schema_exports.Struct({
|
|
173521
173809
|
attachmentId: AttachmentId.annotations({
|
|
@@ -175168,28 +175456,6 @@ var parseCreateRecruitingOpinionParams = Schema_exports.decodeUnknown(CreateRecr
|
|
|
175168
175456
|
var parseUpdateRecruitingOpinionParams = Schema_exports.decodeUnknown(UpdateRecruitingOpinionParamsSchema);
|
|
175169
175457
|
var parseDeleteRecruitingOpinionParams = Schema_exports.decodeUnknown(DeleteRecruitingOpinionParamsSchema);
|
|
175170
175458
|
|
|
175171
|
-
// src/domain/schemas/json-schema.ts
|
|
175172
|
-
var withJsonSchemaPropertyDescriptions = (schema, descriptions) => {
|
|
175173
|
-
const properties = Predicate_exports.isRecord(schema) ? schema.properties : void 0;
|
|
175174
|
-
if (!Predicate_exports.isRecord(properties)) return schema;
|
|
175175
|
-
return {
|
|
175176
|
-
...schema,
|
|
175177
|
-
properties: Object.fromEntries(
|
|
175178
|
-
Object.entries(properties).map(([key, value3]) => {
|
|
175179
|
-
const description = descriptions[key];
|
|
175180
|
-
return [
|
|
175181
|
-
key,
|
|
175182
|
-
description === void 0 || !Predicate_exports.isRecord(value3) ? value3 : { ...value3, description }
|
|
175183
|
-
];
|
|
175184
|
-
})
|
|
175185
|
-
)
|
|
175186
|
-
};
|
|
175187
|
-
};
|
|
175188
|
-
var withExactlyOneRequired = (schema, fields) => ({
|
|
175189
|
-
...schema,
|
|
175190
|
-
oneOf: fields.map((field) => ({ required: [field] }))
|
|
175191
|
-
});
|
|
175192
|
-
|
|
175193
175459
|
// src/domain/schemas/recruiting-media-results.ts
|
|
175194
175460
|
var RecruitingTargetBaseSchema = {
|
|
175195
175461
|
objectClass: ObjectClassName,
|
|
@@ -175397,7 +175663,7 @@ var RecruitingAttachmentFileFields = {
|
|
|
175397
175663
|
};
|
|
175398
175664
|
var RECRUITING_ATTACHMENT_FILE_SOURCE_FIELDS = ["filePath", "fileUrl", "data"];
|
|
175399
175665
|
var recruitingAttachmentExactlyOneFileSourceMessage = `Provide exactly one of ${RECRUITING_ATTACHMENT_FILE_SOURCE_FIELDS.join(", ")}.`;
|
|
175400
|
-
var
|
|
175666
|
+
var requireExactlyOneAttachmentFileSource2 = (params) => RECRUITING_ATTACHMENT_FILE_SOURCE_FIELDS.filter((field) => params[field] !== void 0).length === 1 || recruitingAttachmentExactlyOneFileSourceMessage;
|
|
175401
175667
|
var ListRecruitingCommentsParamsSchema = Schema_exports.Struct({
|
|
175402
175668
|
target: RecruitingCommentTargetSchema,
|
|
175403
175669
|
limit: Schema_exports.optional(LimitParam.annotations({
|
|
@@ -175440,7 +175706,7 @@ var GetRecruitingAttachmentParamsSchema = Schema_exports.Struct({
|
|
|
175440
175706
|
var AddRecruitingAttachmentParamsSchema = Schema_exports.Struct({
|
|
175441
175707
|
target: RecruitingAttachmentTargetSchema,
|
|
175442
175708
|
...RecruitingAttachmentFileFields
|
|
175443
|
-
}).pipe(Schema_exports.filter(
|
|
175709
|
+
}).pipe(Schema_exports.filter(requireExactlyOneAttachmentFileSource2));
|
|
175444
175710
|
var UPDATE_RECRUITING_ATTACHMENT_FIELDS = UPDATE_ATTACHMENT_FIELDS;
|
|
175445
175711
|
var UpdateRecruitingAttachmentParamsSchema = Schema_exports.Struct({
|
|
175446
175712
|
target: RecruitingAttachmentTargetSchema,
|
|
@@ -176335,7 +176601,7 @@ var makeDiagnosticsScope = Effect_exports.gen(function* () {
|
|
|
176335
176601
|
});
|
|
176336
176602
|
|
|
176337
176603
|
// src/version.ts
|
|
176338
|
-
var VERSION = true ? "0.
|
|
176604
|
+
var VERSION = true ? "0.36.0" : "0.0.0-dev";
|
|
176339
176605
|
|
|
176340
176606
|
// src/mcp/tool-output-schema.ts
|
|
176341
176607
|
var toolWarningCodeEnum = [...ToolWarningCodeSchema.literals];
|
|
@@ -176470,6 +176736,23 @@ var findActivityMessage = (client, messageId) => findOneOrFail(
|
|
|
176470
176736
|
);
|
|
176471
176737
|
|
|
176472
176738
|
// src/huly/operations/thread-replies-shared.ts
|
|
176739
|
+
var findThreadReply = (client, channel, message, replyId) => Effect_exports.gen(function* () {
|
|
176740
|
+
const reply = yield* client.findOne(
|
|
176741
|
+
chunter.class.ThreadMessage,
|
|
176742
|
+
hulyQuery({
|
|
176743
|
+
_id: toRef(replyId),
|
|
176744
|
+
attachedTo: toRef(message._id),
|
|
176745
|
+
space: channel._id
|
|
176746
|
+
})
|
|
176747
|
+
);
|
|
176748
|
+
if (reply === void 0) {
|
|
176749
|
+
return yield* new ThreadReplyNotFoundError({
|
|
176750
|
+
replyId,
|
|
176751
|
+
messageId: message._id
|
|
176752
|
+
});
|
|
176753
|
+
}
|
|
176754
|
+
return reply;
|
|
176755
|
+
});
|
|
176473
176756
|
var removeThreadReply = (client, reply) => Effect_exports.gen(function* () {
|
|
176474
176757
|
const removeCollection = client.removeCollection;
|
|
176475
176758
|
if (removeCollection === void 0) {
|
|
@@ -177524,7 +177807,8 @@ var listChannelMessages = (params) => Effect_exports.gen(function* () {
|
|
|
177524
177807
|
createdOn: msg.createdOn,
|
|
177525
177808
|
modifiedOn: msg.modifiedOn,
|
|
177526
177809
|
editedOn: msg.editedOn,
|
|
177527
|
-
replies: optionalCount(msg.replies)
|
|
177810
|
+
replies: optionalCount(msg.replies),
|
|
177811
|
+
attachments: optionalCount(msg.attachments)
|
|
177528
177812
|
};
|
|
177529
177813
|
});
|
|
177530
177814
|
return { messages: summaries, total: listTotal(total) };
|
|
@@ -181427,7 +181711,8 @@ var listDirectMessageMessages = (params) => Effect_exports.gen(function* () {
|
|
|
181427
181711
|
createdOn: msg.createdOn,
|
|
181428
181712
|
modifiedOn: msg.modifiedOn,
|
|
181429
181713
|
editedOn: msg.editedOn,
|
|
181430
|
-
replies: optionalCount(msg.replies)
|
|
181714
|
+
replies: optionalCount(msg.replies),
|
|
181715
|
+
attachments: optionalCount(msg.attachments)
|
|
181431
181716
|
};
|
|
181432
181717
|
});
|
|
181433
181718
|
return { messages: summaries, total: listTotal(total) };
|
|
@@ -181502,6 +181787,192 @@ var createDirectMessage = (params) => Effect_exports.gen(function* () {
|
|
|
181502
181787
|
return { id: ChannelId.make(dmId), created: true };
|
|
181503
181788
|
});
|
|
181504
181789
|
|
|
181790
|
+
// src/huly/operations/chat-message-attachments.ts
|
|
181791
|
+
var chatMessageScope = (target) => ({
|
|
181792
|
+
classRef: attachment.class.Attachment,
|
|
181793
|
+
attachedTo: target.objectId,
|
|
181794
|
+
attachedToClass: target.objectClass,
|
|
181795
|
+
collection: target.collection
|
|
181796
|
+
});
|
|
181797
|
+
var channelMessageDisplay = (messageId, channelName) => NonEmptyString2.make(`channel message '${messageId}' in channel '${channelName}'`);
|
|
181798
|
+
var dmMessageDisplay = (messageId, dmId) => NonEmptyString2.make(`DM message '${messageId}' in direct message '${dmId}'`);
|
|
181799
|
+
var threadReplyDisplay = (replyId, messageId, channelName) => NonEmptyString2.make(`thread reply '${replyId}' on message '${messageId}' in channel '${channelName}'`);
|
|
181800
|
+
var targetCoordinates = (space, objectId, objectClass) => ({
|
|
181801
|
+
space,
|
|
181802
|
+
objectId,
|
|
181803
|
+
objectClass,
|
|
181804
|
+
collection: "attachments",
|
|
181805
|
+
spaceId: SpaceId.make(space),
|
|
181806
|
+
docId: DocId.make(objectId),
|
|
181807
|
+
className: ObjectClassName.make(objectClass)
|
|
181808
|
+
});
|
|
181809
|
+
var resolveChannelMessageTarget = (target) => Effect_exports.gen(function* () {
|
|
181810
|
+
const { channel, client, message } = yield* findChannelMessage(target);
|
|
181811
|
+
const messageId = MessageId.make(message._id);
|
|
181812
|
+
const coordinates2 = targetCoordinates(
|
|
181813
|
+
message.space,
|
|
181814
|
+
toRef(DocId.make(message._id)),
|
|
181815
|
+
toRef(chunter.class.ChatMessage)
|
|
181816
|
+
);
|
|
181817
|
+
return {
|
|
181818
|
+
client,
|
|
181819
|
+
space: coordinates2.space,
|
|
181820
|
+
objectId: coordinates2.objectId,
|
|
181821
|
+
objectClass: coordinates2.objectClass,
|
|
181822
|
+
collection: coordinates2.collection,
|
|
181823
|
+
target: {
|
|
181824
|
+
kind: "channel_message",
|
|
181825
|
+
channelId: ChannelId.make(channel._id),
|
|
181826
|
+
channelName: ChannelName.make(channel.name),
|
|
181827
|
+
messageId,
|
|
181828
|
+
display: channelMessageDisplay(messageId, channel.name),
|
|
181829
|
+
space: coordinates2.spaceId,
|
|
181830
|
+
objectId: coordinates2.docId,
|
|
181831
|
+
objectClass: coordinates2.className,
|
|
181832
|
+
collection: coordinates2.collection
|
|
181833
|
+
}
|
|
181834
|
+
};
|
|
181835
|
+
});
|
|
181836
|
+
var resolveDmMessageTarget = (target) => Effect_exports.gen(function* () {
|
|
181837
|
+
const { client, dm, message } = yield* findDirectMessageMessage(target);
|
|
181838
|
+
const messageId = MessageId.make(message._id);
|
|
181839
|
+
const dmId = ChannelId.make(dm._id);
|
|
181840
|
+
const coordinates2 = targetCoordinates(
|
|
181841
|
+
message.space,
|
|
181842
|
+
toRef(DocId.make(message._id)),
|
|
181843
|
+
toRef(chunter.class.ChatMessage)
|
|
181844
|
+
);
|
|
181845
|
+
return {
|
|
181846
|
+
client,
|
|
181847
|
+
space: coordinates2.space,
|
|
181848
|
+
objectId: coordinates2.objectId,
|
|
181849
|
+
objectClass: coordinates2.objectClass,
|
|
181850
|
+
collection: coordinates2.collection,
|
|
181851
|
+
target: {
|
|
181852
|
+
kind: "dm_message",
|
|
181853
|
+
dmId,
|
|
181854
|
+
messageId,
|
|
181855
|
+
display: dmMessageDisplay(messageId, dmId),
|
|
181856
|
+
space: coordinates2.spaceId,
|
|
181857
|
+
objectId: coordinates2.docId,
|
|
181858
|
+
objectClass: coordinates2.className,
|
|
181859
|
+
collection: coordinates2.collection
|
|
181860
|
+
}
|
|
181861
|
+
};
|
|
181862
|
+
});
|
|
181863
|
+
var resolveThreadReplyTarget = (target) => Effect_exports.gen(function* () {
|
|
181864
|
+
const { channel, client, message } = yield* findChannelMessage(target);
|
|
181865
|
+
const reply = yield* findThreadReply(client, channel, message, target.replyId);
|
|
181866
|
+
const messageId = MessageId.make(message._id);
|
|
181867
|
+
const replyId = ThreadReplyId.make(reply._id);
|
|
181868
|
+
const coordinates2 = targetCoordinates(
|
|
181869
|
+
reply.space,
|
|
181870
|
+
toRef(DocId.make(reply._id)),
|
|
181871
|
+
toRef(chunter.class.ThreadMessage)
|
|
181872
|
+
);
|
|
181873
|
+
return {
|
|
181874
|
+
client,
|
|
181875
|
+
space: coordinates2.space,
|
|
181876
|
+
objectId: coordinates2.objectId,
|
|
181877
|
+
objectClass: coordinates2.objectClass,
|
|
181878
|
+
collection: coordinates2.collection,
|
|
181879
|
+
target: {
|
|
181880
|
+
kind: "thread_reply",
|
|
181881
|
+
channelId: ChannelId.make(channel._id),
|
|
181882
|
+
channelName: ChannelName.make(channel.name),
|
|
181883
|
+
messageId,
|
|
181884
|
+
replyId,
|
|
181885
|
+
display: threadReplyDisplay(replyId, messageId, channel.name),
|
|
181886
|
+
space: coordinates2.spaceId,
|
|
181887
|
+
objectId: coordinates2.docId,
|
|
181888
|
+
objectClass: coordinates2.className,
|
|
181889
|
+
collection: coordinates2.collection
|
|
181890
|
+
}
|
|
181891
|
+
};
|
|
181892
|
+
});
|
|
181893
|
+
var resolveChatAttachmentTarget = (target) => {
|
|
181894
|
+
switch (target.kind) {
|
|
181895
|
+
case "channel_message":
|
|
181896
|
+
return resolveChannelMessageTarget(target);
|
|
181897
|
+
case "dm_message":
|
|
181898
|
+
return resolveDmMessageTarget(target);
|
|
181899
|
+
case "thread_reply":
|
|
181900
|
+
return resolveThreadReplyTarget(target);
|
|
181901
|
+
}
|
|
181902
|
+
};
|
|
181903
|
+
var scopedAttachmentNotFound = (target, attachmentId) => new ChatMessageAttachmentNotFoundError({
|
|
181904
|
+
target: target.target.display,
|
|
181905
|
+
attachmentId
|
|
181906
|
+
});
|
|
181907
|
+
var removeChatAttachment = (target, attachmentId) => Effect_exports.gen(function* () {
|
|
181908
|
+
const media = yield* findAttachmentForScope(target.client, attachmentId, chatMessageScope(target)).pipe(
|
|
181909
|
+
Effect_exports.catchTag("AttachmentNotFoundError", () => scopedAttachmentNotFound(target, attachmentId))
|
|
181910
|
+
);
|
|
181911
|
+
const removeCollection = target.client.removeCollection;
|
|
181912
|
+
if (removeCollection === void 0) {
|
|
181913
|
+
return yield* new HulyError({ message: "Huly client does not support removeCollection" });
|
|
181914
|
+
}
|
|
181915
|
+
yield* removeCollection(
|
|
181916
|
+
attachment.class.Attachment,
|
|
181917
|
+
media.space,
|
|
181918
|
+
media._id,
|
|
181919
|
+
target.objectId,
|
|
181920
|
+
target.objectClass,
|
|
181921
|
+
target.collection
|
|
181922
|
+
);
|
|
181923
|
+
});
|
|
181924
|
+
var listChatMessageAttachments = (params) => Effect_exports.gen(function* () {
|
|
181925
|
+
const target = yield* resolveChatAttachmentTarget(params.target);
|
|
181926
|
+
const page = yield* listAttachmentPageForScope(target.client, chatMessageScope(target), params.limit);
|
|
181927
|
+
return { target: target.target, attachments: page.attachments, total: page.total };
|
|
181928
|
+
});
|
|
181929
|
+
var getChatMessageAttachment = (params) => Effect_exports.gen(function* () {
|
|
181930
|
+
const storageClient = yield* HulyStorageClient;
|
|
181931
|
+
const target = yield* resolveChatAttachmentTarget(params.target);
|
|
181932
|
+
const attachmentResult = yield* getAttachmentForScope(
|
|
181933
|
+
target.client,
|
|
181934
|
+
storageClient,
|
|
181935
|
+
params.attachmentId,
|
|
181936
|
+
chatMessageScope(target)
|
|
181937
|
+
).pipe(
|
|
181938
|
+
Effect_exports.catchTag("AttachmentNotFoundError", () => scopedAttachmentNotFound(target, params.attachmentId))
|
|
181939
|
+
);
|
|
181940
|
+
return { target: target.target, attachment: attachmentResult };
|
|
181941
|
+
});
|
|
181942
|
+
var addChatMessageAttachment = (params) => Effect_exports.gen(function* () {
|
|
181943
|
+
const target = yield* resolveChatAttachmentTarget(params.target);
|
|
181944
|
+
const result = yield* uploadAndAttach(params, {
|
|
181945
|
+
spaceRef: target.space,
|
|
181946
|
+
objectRef: target.objectId,
|
|
181947
|
+
objectClassRef: target.objectClass,
|
|
181948
|
+
attachmentClassRef: attachment.class.Attachment,
|
|
181949
|
+
collection: target.collection
|
|
181950
|
+
});
|
|
181951
|
+
return {
|
|
181952
|
+
target: target.target,
|
|
181953
|
+
attachmentId: result.attachmentId,
|
|
181954
|
+
blobId: result.blobId,
|
|
181955
|
+
url: result.url
|
|
181956
|
+
};
|
|
181957
|
+
});
|
|
181958
|
+
var updateChatMessageAttachment = (params) => Effect_exports.gen(function* () {
|
|
181959
|
+
const target = yield* resolveChatAttachmentTarget(params.target);
|
|
181960
|
+
yield* updateAttachmentForScope(
|
|
181961
|
+
target.client,
|
|
181962
|
+
params.attachmentId,
|
|
181963
|
+
params,
|
|
181964
|
+
chatMessageScope(target)
|
|
181965
|
+
).pipe(
|
|
181966
|
+
Effect_exports.catchTag("AttachmentNotFoundError", () => scopedAttachmentNotFound(target, params.attachmentId))
|
|
181967
|
+
);
|
|
181968
|
+
return { target: target.target, attachmentId: params.attachmentId, updated: true };
|
|
181969
|
+
});
|
|
181970
|
+
var deleteChatMessageAttachment = (params) => Effect_exports.gen(function* () {
|
|
181971
|
+
const target = yield* resolveChatAttachmentTarget(params.target);
|
|
181972
|
+
yield* removeChatAttachment(target, params.attachmentId);
|
|
181973
|
+
return { target: target.target, attachmentId: params.attachmentId, deleted: true };
|
|
181974
|
+
});
|
|
181975
|
+
|
|
181505
181976
|
// src/huly/operations/external-channel-messages.ts
|
|
181506
181977
|
var EXTERNAL_CHANNEL_PACKAGE_INCOMPATIBLE_REASON = "package-incompatible: package.json and pnpm-lock.yaml include @hcengineering/contact provider refs for email/telegram, but no compatible Huly Gmail or Telegram message SDK package/model is installed; local platform-api examples only expose contact.class.Channel provider values, not external message documents";
|
|
181507
181978
|
var listExternalChannelMessages = (params) => Effect_exports.sync(
|
|
@@ -181517,23 +181988,6 @@ var listExternalChannelMessages = (params) => Effect_exports.sync(
|
|
|
181517
181988
|
|
|
181518
181989
|
// src/huly/operations/threads.ts
|
|
181519
181990
|
var import_core32 = __toESM(require_lib4(), 1);
|
|
181520
|
-
var findReply = (client, channel, message, replyId) => Effect_exports.gen(function* () {
|
|
181521
|
-
const reply = yield* client.findOne(
|
|
181522
|
-
chunter.class.ThreadMessage,
|
|
181523
|
-
{
|
|
181524
|
-
_id: toRef(replyId),
|
|
181525
|
-
attachedTo: toRef(message._id),
|
|
181526
|
-
space: channel._id
|
|
181527
|
-
}
|
|
181528
|
-
);
|
|
181529
|
-
if (reply === void 0) {
|
|
181530
|
-
return yield* new ThreadReplyNotFoundError({
|
|
181531
|
-
replyId,
|
|
181532
|
-
messageId: message._id
|
|
181533
|
-
});
|
|
181534
|
-
}
|
|
181535
|
-
return reply;
|
|
181536
|
-
});
|
|
181537
181991
|
var listThreadReplies = (params) => Effect_exports.gen(function* () {
|
|
181538
181992
|
const { channel, client, message } = yield* findChannelMessage(params);
|
|
181539
181993
|
const markupUrlConfig = client.markupUrlConfig;
|
|
@@ -181567,7 +182021,8 @@ var listThreadReplies = (params) => Effect_exports.gen(function* () {
|
|
|
181567
182021
|
senderId: msg.modifiedBy,
|
|
181568
182022
|
createdOn: msg.createdOn,
|
|
181569
182023
|
modifiedOn: msg.modifiedOn,
|
|
181570
|
-
editedOn: msg.editedOn
|
|
182024
|
+
editedOn: msg.editedOn,
|
|
182025
|
+
attachments: optionalCount(msg.attachments)
|
|
181571
182026
|
};
|
|
181572
182027
|
});
|
|
181573
182028
|
return { replies: threadMessages, total: listTotal(total) };
|
|
@@ -181600,7 +182055,7 @@ var addThreadReply = (params) => Effect_exports.gen(function* () {
|
|
|
181600
182055
|
});
|
|
181601
182056
|
var updateThreadReply = (params) => Effect_exports.gen(function* () {
|
|
181602
182057
|
const { channel, client, message } = yield* findChannelMessage(params);
|
|
181603
|
-
const reply = yield*
|
|
182058
|
+
const reply = yield* findThreadReply(client, channel, message, params.replyId);
|
|
181604
182059
|
const markupUrlConfig = client.markupUrlConfig;
|
|
181605
182060
|
const markup = markdownToMarkupString(params.body, markupUrlConfig);
|
|
181606
182061
|
const now2 = yield* Clock_exports.currentTimeMillis;
|
|
@@ -181618,7 +182073,7 @@ var updateThreadReply = (params) => Effect_exports.gen(function* () {
|
|
|
181618
182073
|
});
|
|
181619
182074
|
var deleteThreadReply = (params) => Effect_exports.gen(function* () {
|
|
181620
182075
|
const { channel, client, message } = yield* findChannelMessage(params);
|
|
181621
|
-
const reply = yield*
|
|
182076
|
+
const reply = yield* findThreadReply(client, channel, message, params.replyId);
|
|
181622
182077
|
yield* removeThreadReply(client, reply);
|
|
181623
182078
|
return { id: ThreadReplyId.make(reply._id), deleted: true };
|
|
181624
182079
|
});
|
|
@@ -181961,6 +182416,66 @@ var channelTools = [
|
|
|
181961
182416
|
parseDeleteThreadReplyParams,
|
|
181962
182417
|
deleteThreadReply
|
|
181963
182418
|
)
|
|
182419
|
+
},
|
|
182420
|
+
{
|
|
182421
|
+
name: "list_chat_message_attachments",
|
|
182422
|
+
description: "List files attached directly to a Huly chat message target. target.kind supports channel_message, dm_message, and thread_reply; the tool resolves channel names and one-to-one DM participant display names for you.",
|
|
182423
|
+
category: CATEGORY6,
|
|
182424
|
+
inputSchema: listChatMessageAttachmentsParamsJsonSchema,
|
|
182425
|
+
handler: createEncodedToolHandler(
|
|
182426
|
+
"list_chat_message_attachments",
|
|
182427
|
+
parseListChatMessageAttachmentsParams,
|
|
182428
|
+
listChatMessageAttachments,
|
|
182429
|
+
ListChatMessageAttachmentsResultSchema
|
|
182430
|
+
)
|
|
182431
|
+
},
|
|
182432
|
+
{
|
|
182433
|
+
name: "get_chat_message_attachment",
|
|
182434
|
+
description: "Get one file attached directly to a Huly channel message, direct-message message, or thread reply. The attachmentId must belong to the resolved target.",
|
|
182435
|
+
category: CATEGORY6,
|
|
182436
|
+
inputSchema: getChatMessageAttachmentParamsJsonSchema,
|
|
182437
|
+
handler: createEncodedCombinedToolHandler(
|
|
182438
|
+
"get_chat_message_attachment",
|
|
182439
|
+
parseGetChatMessageAttachmentParams,
|
|
182440
|
+
getChatMessageAttachment,
|
|
182441
|
+
GetChatMessageAttachmentResultSchema
|
|
182442
|
+
)
|
|
182443
|
+
},
|
|
182444
|
+
{
|
|
182445
|
+
name: "add_chat_message_attachment",
|
|
182446
|
+
description: "Attach a file directly to a Huly channel message, direct-message message, or thread reply. Provide filename, contentType, and exactly one of filePath, fileUrl, or data.",
|
|
182447
|
+
category: CATEGORY6,
|
|
182448
|
+
inputSchema: addChatMessageAttachmentParamsJsonSchema,
|
|
182449
|
+
handler: createEncodedCombinedToolHandler(
|
|
182450
|
+
"add_chat_message_attachment",
|
|
182451
|
+
parseAddChatMessageAttachmentParams,
|
|
182452
|
+
addChatMessageAttachment,
|
|
182453
|
+
AddChatMessageAttachmentResultSchema
|
|
182454
|
+
)
|
|
182455
|
+
},
|
|
182456
|
+
{
|
|
182457
|
+
name: "update_chat_message_attachment",
|
|
182458
|
+
description: "Update description and/or pinned state for a file attached directly to a Huly channel message, direct-message message, or thread reply. The attachmentId must belong to the resolved target.",
|
|
182459
|
+
category: CATEGORY6,
|
|
182460
|
+
inputSchema: updateChatMessageAttachmentParamsJsonSchema,
|
|
182461
|
+
handler: createEncodedToolHandler(
|
|
182462
|
+
"update_chat_message_attachment",
|
|
182463
|
+
parseUpdateChatMessageAttachmentParams,
|
|
182464
|
+
updateChatMessageAttachment,
|
|
182465
|
+
UpdateChatMessageAttachmentResultSchema
|
|
182466
|
+
)
|
|
182467
|
+
},
|
|
182468
|
+
{
|
|
182469
|
+
name: "delete_chat_message_attachment",
|
|
182470
|
+
description: "Delete one file attached directly to a Huly channel message, direct-message message, or thread reply. The attachmentId must belong to the resolved target.",
|
|
182471
|
+
category: CATEGORY6,
|
|
182472
|
+
inputSchema: deleteChatMessageAttachmentParamsJsonSchema,
|
|
182473
|
+
handler: createEncodedToolHandler(
|
|
182474
|
+
"delete_chat_message_attachment",
|
|
182475
|
+
parseDeleteChatMessageAttachmentParams,
|
|
182476
|
+
deleteChatMessageAttachment,
|
|
182477
|
+
DeleteChatMessageAttachmentResultSchema
|
|
182478
|
+
)
|
|
181964
182479
|
}
|
|
181965
182480
|
];
|
|
181966
182481
|
|
|
@@ -194698,13 +195213,13 @@ var scopedCommentNotFound = (target, commentId) => new RecruitingCommentNotFound
|
|
|
194698
195213
|
target: target.display,
|
|
194699
195214
|
commentId
|
|
194700
195215
|
});
|
|
194701
|
-
var
|
|
195216
|
+
var scopedAttachmentNotFound2 = (target, attachmentId) => new RecruitingAttachmentNotFoundError({
|
|
194702
195217
|
target: target.display,
|
|
194703
195218
|
attachmentId
|
|
194704
195219
|
});
|
|
194705
195220
|
var removeRecruitingAttachment = (target, attachmentId) => Effect_exports.gen(function* () {
|
|
194706
195221
|
const media = yield* findAttachmentForScope(target.client, attachmentId, attachmentScope(target)).pipe(
|
|
194707
|
-
Effect_exports.catchTag("AttachmentNotFoundError", () =>
|
|
195222
|
+
Effect_exports.catchTag("AttachmentNotFoundError", () => scopedAttachmentNotFound2(target, attachmentId))
|
|
194708
195223
|
);
|
|
194709
195224
|
const removeCollection = target.client.removeCollection;
|
|
194710
195225
|
if (removeCollection === void 0) {
|
|
@@ -194770,7 +195285,7 @@ var getRecruitingAttachment = (params) => Effect_exports.gen(function* () {
|
|
|
194770
195285
|
params.attachmentId,
|
|
194771
195286
|
attachmentScope(target)
|
|
194772
195287
|
).pipe(
|
|
194773
|
-
Effect_exports.catchTag("AttachmentNotFoundError", () =>
|
|
195288
|
+
Effect_exports.catchTag("AttachmentNotFoundError", () => scopedAttachmentNotFound2(target, params.attachmentId))
|
|
194774
195289
|
);
|
|
194775
195290
|
return { target: target.target, attachment: attachmentResult };
|
|
194776
195291
|
});
|
|
@@ -194800,7 +195315,7 @@ var updateRecruitingAttachment = (params) => Effect_exports.gen(function* () {
|
|
|
194800
195315
|
params,
|
|
194801
195316
|
attachmentScope(target)
|
|
194802
195317
|
).pipe(
|
|
194803
|
-
Effect_exports.catchTag("AttachmentNotFoundError", () =>
|
|
195318
|
+
Effect_exports.catchTag("AttachmentNotFoundError", () => scopedAttachmentNotFound2(target, params.attachmentId))
|
|
194804
195319
|
);
|
|
194805
195320
|
return { target: target.target, attachmentId: params.attachmentId, updated: true };
|
|
194806
195321
|
});
|