crow-central-agency 0.26.12 → 0.26.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/_shared/index.js +1 -1
  2. package/dist/_shared/schemas/artifact.schema.js +24 -3
  3. package/dist/mcp/gmail/create-gmail-draft.js +9 -3
  4. package/dist/mcp/gmail/reply-to-gmail-message.js +8 -5
  5. package/dist/mcp/gmail/send-gmail-message.js +8 -5
  6. package/dist/mcp/gmail/update-gmail-draft.js +10 -1
  7. package/dist/public/assets/{architectureDiagram-3BPJPVTR-CRUuaJq5.js → architectureDiagram-3BPJPVTR-Bt4tuNX8.js} +1 -1
  8. package/dist/public/assets/{chunk-727SXJPM-3bCxa2Zq.js → chunk-727SXJPM-BjjXmWC5.js} +1 -1
  9. package/dist/public/assets/{chunk-AQP2D5EJ-Dom7ZjX5.js → chunk-AQP2D5EJ-DjJ_-SOd.js} +1 -1
  10. package/dist/public/assets/{classDiagram-v2-Q7XG4LA2-BX_yaOCo.js → classDiagram-4FO5ZUOK-DVPqtO0x.js} +1 -1
  11. package/dist/public/assets/{classDiagram-4FO5ZUOK-BX_yaOCo.js → classDiagram-v2-Q7XG4LA2-DVPqtO0x.js} +1 -1
  12. package/dist/public/assets/{dagre-BM42HDAG-KKbmsGYT.js → dagre-BM42HDAG-CZBf8H9_.js} +1 -1
  13. package/dist/public/assets/{diagram-2AECGRRQ-BY_4cf4J.js → diagram-2AECGRRQ-C_U6a4go.js} +1 -1
  14. package/dist/public/assets/{diagram-5GNKFQAL-CS0SCo68.js → diagram-5GNKFQAL-Bk-3tHvA.js} +1 -1
  15. package/dist/public/assets/{diagram-LMA3HP47-DWPp9bbA.js → diagram-LMA3HP47-JxZtWEor.js} +1 -1
  16. package/dist/public/assets/{diagram-OG6HWLK6-BLYKu1nE.js → diagram-OG6HWLK6-BJ1F3Sxu.js} +1 -1
  17. package/dist/public/assets/{erDiagram-TEJ5UH35--mqF2IH-.js → erDiagram-TEJ5UH35-BJBHxTf8.js} +1 -1
  18. package/dist/public/assets/{flowDiagram-I6XJVG4X-BplDzcPA.js → flowDiagram-I6XJVG4X-DJ3nm5z7.js} +1 -1
  19. package/dist/public/assets/{index-C0F6g385.js → index-BJmLehUe.js} +66 -66
  20. package/dist/public/assets/index-BqakLGSS.css +1 -0
  21. package/dist/public/assets/{infoDiagram-5YYISTIA-77oXRmwj.js → infoDiagram-5YYISTIA-Cc1k7k1c.js} +1 -1
  22. package/dist/public/assets/{ishikawaDiagram-YF4QCWOH-DVFwKp8q.js → ishikawaDiagram-YF4QCWOH-DrDraHBD.js} +1 -1
  23. package/dist/public/assets/{kanban-definition-UN3LZRKU-DY8-KN2p.js → kanban-definition-UN3LZRKU-CNUMfAVC.js} +1 -1
  24. package/dist/public/assets/{mindmap-definition-RKZ34NQL-DCtZO5l6.js → mindmap-definition-RKZ34NQL-DOeL-Iu4.js} +1 -1
  25. package/dist/public/assets/{pieDiagram-4H26LBE5-B4uOAUWj.js → pieDiagram-4H26LBE5-DCP9wuZK.js} +1 -1
  26. package/dist/public/assets/{requirementDiagram-4Y6WPE33-DYN368AR.js → requirementDiagram-4Y6WPE33-7UzZpq-C.js} +1 -1
  27. package/dist/public/assets/{sequenceDiagram-3UESZ5HK-BbfY7AeW.js → sequenceDiagram-3UESZ5HK-D5alEu9E.js} +1 -1
  28. package/dist/public/assets/{stateDiagram-AJRCARHV-B_BzBqT7.js → stateDiagram-AJRCARHV-EkSeb-RA.js} +1 -1
  29. package/dist/public/assets/{stateDiagram-v2-BHNVJYJU-DZ4qVD8V.js → stateDiagram-v2-BHNVJYJU-DmpUDd8s.js} +1 -1
  30. package/dist/public/assets/{timeline-definition-PNZ67QCA-Ba8WPvkl.js → timeline-definition-PNZ67QCA-B4oLmMT1.js} +1 -1
  31. package/dist/public/assets/{vennDiagram-CIIHVFJN-wcxj086h.js → vennDiagram-CIIHVFJN-DgiGQ7rE.js} +1 -1
  32. package/dist/public/assets/{wardleyDiagram-YWT4CUSO-CfpyXdPF.js → wardleyDiagram-YWT4CUSO-dDWLWZoc.js} +1 -1
  33. package/dist/public/assets/{xychartDiagram-2RQKCTM6-EgqIcFwJ.js → xychartDiagram-2RQKCTM6-TOELm0t1.js} +1 -1
  34. package/dist/public/index.html +2 -2
  35. package/dist/routes/artifact.routes.js +24 -19
  36. package/dist/services/artifact/artifact-manager.js +3 -0
  37. package/dist/services/google/google-client.js +15 -10
  38. package/dist/services/google/google-client.types.js +4 -0
  39. package/dist/services/google/resolve-email-body-parts.js +15 -0
  40. package/package.json +2 -2
  41. package/dist/public/assets/index-DwcUOyrO.css +0 -1
@@ -5,7 +5,7 @@ export { SessionUsageSchema, PendingPermissionInfoSchema, PendingInstructionRemi
5
5
  export { ClientMessageSchema, ServerMessageSchema, SendMessageSchema, InjectMessageSchema, PermissionResponseWsSchema, CommandMessageSchema, AgentTextWsMessageSchema, AgentActivityWsMessageSchema, AgentResultWsMessageSchema, AgentStatusWsMessageSchema, AgentCreatedWsMessageSchema, AgentUpdatedWsMessageSchema, AgentDeletedWsMessageSchema, AgentUsageWsMessageSchema, PermissionRequestWsMessageSchema, PermissionCancelledWsMessageSchema, ErrorWsMessageSchema, AgentMessageWsMessageSchema, AgentToolProgressWsMessageSchema, TaskAddedWsMessageSchema, TaskUpdatedWsMessageSchema, TaskAssignedWsMessageSchema, TaskStateChangedWsMessageSchema, TaskDeletedWsMessageSchema, CircleCreatedWsMessageSchema, CircleUpdatedWsMessageSchema, CircleDeletedWsMessageSchema, RelationshipCreatedWsMessageSchema, RelationshipDeletedWsMessageSchema, AgentBuilderDraftUpdatedWsMessageSchema, isAgentServerMessage, CLIENT_MESSAGE_TYPE, SERVER_MESSAGE_TYPE, } from "./schemas/websocket.schema.js";
6
6
  export { PERMISSION_DECISION, PermissionRequestSchema, PermissionResponseSchema, } from "./schemas/permission.schema.js";
7
7
  export { AgentMessageSchema, MessageAnnotationSchema, AGENT_MESSAGE_ROLE, AGENT_MESSAGE_TYPE, } from "./schemas/agent-message.schema.js";
8
- export { ARTIFACT_TYPE, ARTIFACT_CONTENT_TYPE, ArtifactTypeSchema, ArtifactContentTypeSchema, ArtifactMetadataSchema, ArtifactTagsUpdateSchema, } from "./schemas/artifact.schema.js";
8
+ export { ARTIFACT_TYPE, ARTIFACT_CONTENT_TYPE, ArtifactTypeSchema, ArtifactContentTypeSchema, ArtifactMetadataSchema, ArtifactUpdateSchema, } from "./schemas/artifact.schema.js";
9
9
  export { AGENT_TASK_STATE, AGENT_TASK_SOURCE_TYPE, AgentTaskStateSchema, AgentTaskSourceSchema, AgentTaskItemSchema, AgentTaskDatabaseSchema, CreateTaskInputSchema, UpdateTaskInputSchema, UpdateTaskStateInputSchema, AssignTaskInputSchema, } from "./schemas/agent-task.schema.js";
10
10
  export { MCP_CONFIG_TYPE, InternalMcpConfigSchema, McpServerConfigSchema, CreateMcpConfigInputSchema, UpdateMcpConfigInputSchema, } from "./schemas/mcp-config.schema.js";
11
11
  export { SensorInfoSchema } from "./schemas/sensor.schema.js";
@@ -49,11 +49,32 @@ export const ArtifactMetadataSchema = z.object({
49
49
  createdBy: AgentTaskSourceSchema,
50
50
  });
51
51
  /**
52
- * Request body for updating an artifact's tags. Applies a remove-then-add delta to the
53
- * current tag set; at least one of addTags/removeTags must be non-empty.
52
+ * Request body for a PATCH artifact update. Tag changes apply a remove-then-add delta to the current
53
+ * set; `content` replaces the raw text. `expectedUpdatedTimestamp` guards against clobbering a
54
+ * concurrent edit — the update is rejected with a conflict when it no longer matches the stored
55
+ * timestamp. At least one of addTags/removeTags/content must be present, and a content replacement
56
+ * must carry the expected timestamp.
54
57
  */
55
- export const ArtifactTagsUpdateSchema = z.object({
58
+ export const ArtifactUpdateSchema = z
59
+ .object({
56
60
  addTags: z.array(z.string()).optional(),
57
61
  removeTags: z.array(z.string()).optional(),
62
+ content: z.string().optional(),
63
+ expectedUpdatedTimestamp: z.number().optional(),
64
+ })
65
+ .superRefine((update, ctx) => {
66
+ if ((update.addTags?.length ?? 0) === 0 && (update.removeTags?.length ?? 0) === 0 && update.content === undefined) {
67
+ ctx.addIssue({
68
+ code: "custom",
69
+ message: "At least one of addTags, removeTags, or content is required",
70
+ });
71
+ }
72
+ if (update.content !== undefined && update.expectedUpdatedTimestamp === undefined) {
73
+ ctx.addIssue({
74
+ code: "custom",
75
+ message: "expectedUpdatedTimestamp is required when content is provided",
76
+ path: ["expectedUpdatedTimestamp"],
77
+ });
78
+ }
58
79
  });
59
80
  //# sourceMappingURL=artifact.schema.js.map
@@ -1,6 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { RequestError } from "../../core/error/request-error.js";
3
- import { GOOGLE_SERVICE_NAME } from "../../services/google/google-client.types.js";
3
+ import { EMAIL_BODY_FORMAT, GOOGLE_SERVICE_NAME } from "../../services/google/google-client.types.js";
4
4
  import { getErrorToolResult, textToolResult } from "../tool-utils.js";
5
5
  export const CREATE_GMAIL_DRAFT_TOOL_NAME = "create_gmail_draft";
6
6
  export function getCreateGmailDraftToolConfig(googleClient) {
@@ -20,7 +20,11 @@ export function getCreateGmailDraftToolConfig(googleClient) {
20
20
  cc: z.array(z.string()).optional().describe("New-draft mode: optional Cc recipients."),
21
21
  bcc: z.array(z.string()).optional().describe("New-draft mode: optional Bcc recipients."),
22
22
  subject: z.string().optional().describe("New-draft mode: subject line. Required without parentMessageId."),
23
- body: z.string().min(1).describe("Draft body in markdown."),
23
+ body: z.string().min(1).describe('Draft body. Defaults to markdown; pass raw HTML when bodyFormat is "html".'),
24
+ bodyFormat: z
25
+ .enum([EMAIL_BODY_FORMAT.MARKDOWN, EMAIL_BODY_FORMAT.HTML])
26
+ .optional()
27
+ .describe('Body format. Defaults to "markdown"; set to "html" to supply raw HTML.'),
24
28
  };
25
29
  const handler = async (args) => {
26
30
  try {
@@ -28,6 +32,7 @@ export function getCreateGmailDraftToolConfig(googleClient) {
28
32
  const result = await googleClient.createGmailReplyDraft({
29
33
  parentMessageId: args.parentMessageId,
30
34
  body: args.body,
35
+ bodyFormat: args.bodyFormat,
31
36
  replyAll: args.replyAll,
32
37
  });
33
38
  return textToolResult([
@@ -46,6 +51,7 @@ export function getCreateGmailDraftToolConfig(googleClient) {
46
51
  bcc: args.bcc,
47
52
  subject: args.subject,
48
53
  body: args.body,
54
+ bodyFormat: args.bodyFormat,
49
55
  });
50
56
  return textToolResult([
51
57
  "Draft created.",
@@ -60,7 +66,7 @@ export function getCreateGmailDraftToolConfig(googleClient) {
60
66
  };
61
67
  const config = {
62
68
  name: CREATE_GMAIL_DRAFT_TOOL_NAME,
63
- description: "Create a draft email in the Drafts folder. Two modes: new draft or reply draft (parentMessageId required, recipients/subject/threading derived from parent, replyAll optional). Body is markdown.",
69
+ description: 'Create a draft email in the Drafts folder. Two modes: new draft or reply draft (parentMessageId required, recipients/subject/threading derived from parent, replyAll optional). Body defaults to markdown; set bodyFormat to "html" to supply raw HTML.',
64
70
  inputSchema,
65
71
  handler,
66
72
  };
@@ -1,4 +1,5 @@
1
1
  import { z } from "zod";
2
+ import { EMAIL_BODY_FORMAT } from "../../services/google/google-client.types.js";
2
3
  import { getErrorToolResult, textToolResult } from "../tool-utils.js";
3
4
  export const REPLY_TO_GMAIL_MESSAGE_TOOL_NAME = "reply_to_gmail_message";
4
5
  export function getReplyToGmailMessageToolConfig(googleClient) {
@@ -6,10 +7,11 @@ export function getReplyToGmailMessageToolConfig(googleClient) {
6
7
  messageId: z
7
8
  .string()
8
9
  .describe("ID of the message being replied to (from list_gmail_messages or get_gmail_thread). Recipients, subject, and threading headers are derived from this parent."),
9
- body: z
10
- .string()
11
- .min(1)
12
- .describe("Reply body in markdown. Recipients will receive both a plain-text version (the markdown source) and an HTML version (rendered)."),
10
+ body: z.string().min(1).describe('Reply body. Defaults to markdown; pass raw HTML when bodyFormat is "html".'),
11
+ bodyFormat: z
12
+ .enum([EMAIL_BODY_FORMAT.MARKDOWN, EMAIL_BODY_FORMAT.HTML])
13
+ .optional()
14
+ .describe('Body format. Defaults to "markdown"; set to "html" to supply raw HTML.'),
13
15
  replyAll: z
14
16
  .boolean()
15
17
  .optional()
@@ -20,6 +22,7 @@ export function getReplyToGmailMessageToolConfig(googleClient) {
20
22
  const result = await googleClient.replyToGmailMessage({
21
23
  parentMessageId: args.messageId,
22
24
  body: args.body,
25
+ bodyFormat: args.bodyFormat,
23
26
  replyAll: args.replyAll,
24
27
  });
25
28
  return textToolResult(["Reply sent.", `Message ID: ${result.id}`, `Thread ID: ${result.threadId}`]);
@@ -30,7 +33,7 @@ export function getReplyToGmailMessageToolConfig(googleClient) {
30
33
  };
31
34
  const config = {
32
35
  name: REPLY_TO_GMAIL_MESSAGE_TOOL_NAME,
33
- description: "Reply to a Gmail message by ID. Recipients (To/Cc), subject (Re: prefix), and threading headers (In-Reply-To, References, threadId) are all derived from the parent - you only supply the body and an optional replyAll flag. Body is markdown; sent as multipart/alternative.",
36
+ description: 'Reply to a Gmail message by ID. Recipients (To/Cc), subject (Re: prefix), and threading headers (In-Reply-To, References, threadId) are all derived from the parent - you only supply the body and an optional replyAll flag. Body defaults to markdown; set bodyFormat to "html" to supply raw HTML.',
34
37
  inputSchema,
35
38
  handler,
36
39
  };
@@ -1,4 +1,5 @@
1
1
  import { z } from "zod";
2
+ import { EMAIL_BODY_FORMAT } from "../../services/google/google-client.types.js";
2
3
  import { getErrorToolResult, textToolResult } from "../tool-utils.js";
3
4
  export const SEND_GMAIL_MESSAGE_TOOL_NAME = "send_gmail_message";
4
5
  export function getSendGmailMessageToolConfig(googleClient) {
@@ -10,10 +11,11 @@ export function getSendGmailMessageToolConfig(googleClient) {
10
11
  cc: z.array(z.string()).optional().describe("Optional Cc recipients (same address format as 'to')."),
11
12
  bcc: z.array(z.string()).optional().describe("Optional Bcc recipients (same address format as 'to')."),
12
13
  subject: z.string().min(1).describe("Email subject line."),
13
- body: z
14
- .string()
15
- .min(1)
16
- .describe("Email body in markdown. Recipients will receive both a plain-text version (the markdown source) and an HTML version (rendered)."),
14
+ body: z.string().min(1).describe('Email body. Defaults to markdown; pass raw HTML when bodyFormat is "html".'),
15
+ bodyFormat: z
16
+ .enum([EMAIL_BODY_FORMAT.MARKDOWN, EMAIL_BODY_FORMAT.HTML])
17
+ .optional()
18
+ .describe('Body format. Defaults to "markdown"; set to "html" to supply raw HTML.'),
17
19
  };
18
20
  const handler = async (args) => {
19
21
  try {
@@ -23,6 +25,7 @@ export function getSendGmailMessageToolConfig(googleClient) {
23
25
  bcc: args.bcc,
24
26
  subject: args.subject,
25
27
  body: args.body,
28
+ bodyFormat: args.bodyFormat,
26
29
  });
27
30
  return textToolResult(["Message sent.", `Message ID: ${result.id}`, `Thread ID: ${result.threadId}`]);
28
31
  }
@@ -32,7 +35,7 @@ export function getSendGmailMessageToolConfig(googleClient) {
32
35
  };
33
36
  const config = {
34
37
  name: SEND_GMAIL_MESSAGE_TOOL_NAME,
35
- description: "Send a new email via the connected Google account. Body is provided as markdown and delivered as multipart/alternative (text/plain + text/html). For replies, use reply_to_gmail_message instead so threading headers are set correctly.",
38
+ description: 'Send a new email via the connected Google account. Body defaults to markdown; set bodyFormat to "html" to supply raw HTML. For replies, use reply_to_gmail_message instead so threading headers are set correctly.',
36
39
  inputSchema,
37
40
  handler,
38
41
  };
@@ -1,4 +1,5 @@
1
1
  import { z } from "zod";
2
+ import { EMAIL_BODY_FORMAT } from "../../services/google/google-client.types.js";
2
3
  import { getErrorToolResult, textToolResult } from "../tool-utils.js";
3
4
  export const UPDATE_GMAIL_DRAFT_TOOL_NAME = "update_gmail_draft";
4
5
  export function getUpdateGmailDraftToolConfig(googleClient) {
@@ -8,7 +9,14 @@ export function getUpdateGmailDraftToolConfig(googleClient) {
8
9
  cc: z.array(z.string()).optional().describe("Replaces Cc; preserved if omitted."),
9
10
  bcc: z.array(z.string()).optional().describe("Replaces Bcc; preserved if omitted."),
10
11
  subject: z.string().optional().describe("Replaces subject; preserved if omitted."),
11
- body: z.string().optional().describe("Markdown. Replaces body; preserved if omitted."),
12
+ body: z
13
+ .string()
14
+ .optional()
15
+ .describe('Replaces body; preserved if omitted. Defaults to markdown; pass raw HTML when bodyFormat is "html".'),
16
+ bodyFormat: z
17
+ .enum([EMAIL_BODY_FORMAT.MARKDOWN, EMAIL_BODY_FORMAT.HTML])
18
+ .optional()
19
+ .describe('Body format for `body`; only meaningful when body is also provided. Defaults to "markdown"; set to "html" to supply raw HTML.'),
12
20
  };
13
21
  const handler = async (args) => {
14
22
  try {
@@ -19,6 +27,7 @@ export function getUpdateGmailDraftToolConfig(googleClient) {
19
27
  bcc: args.bcc,
20
28
  subject: args.subject,
21
29
  body: args.body,
30
+ bodyFormat: args.bodyFormat,
22
31
  });
23
32
  return textToolResult([
24
33
  "Draft updated.",