crow-central-agency 0.26.4 → 0.26.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_shared/index.js +1 -1
- package/dist/_shared/schemas/artifact.schema.js +8 -0
- package/dist/mcp/artifacts/artifacts-mcp-server.js +2 -0
- package/dist/mcp/artifacts/move-artifact.js +77 -0
- package/dist/public/assets/{architectureDiagram-3BPJPVTR-Bz06JFon.js → architectureDiagram-3BPJPVTR-D4gq8Wb9.js} +1 -1
- package/dist/public/assets/{chunk-727SXJPM-5GKwh6fT.js → chunk-727SXJPM-CmnVWGyO.js} +1 -1
- package/dist/public/assets/{chunk-AQP2D5EJ-wMWKOYIc.js → chunk-AQP2D5EJ-BBWkGV1t.js} +1 -1
- package/dist/public/assets/{classDiagram-v2-Q7XG4LA2-DeakRfbI.js → classDiagram-4FO5ZUOK-DfXxvMeX.js} +1 -1
- package/dist/public/assets/{classDiagram-4FO5ZUOK-DeakRfbI.js → classDiagram-v2-Q7XG4LA2-DfXxvMeX.js} +1 -1
- package/dist/public/assets/{dagre-BM42HDAG-BaqEK3sM.js → dagre-BM42HDAG-DpSouqdY.js} +1 -1
- package/dist/public/assets/{diagram-2AECGRRQ-BFC7UJOh.js → diagram-2AECGRRQ-CJ4mwAFH.js} +1 -1
- package/dist/public/assets/{diagram-5GNKFQAL-C0jqgvuM.js → diagram-5GNKFQAL-CwX7Xrh6.js} +1 -1
- package/dist/public/assets/{diagram-LMA3HP47-KRJXH1WK.js → diagram-LMA3HP47-B-wCEVXf.js} +1 -1
- package/dist/public/assets/{diagram-OG6HWLK6-CbGXtbWC.js → diagram-OG6HWLK6-hdADVjh2.js} +1 -1
- package/dist/public/assets/{erDiagram-TEJ5UH35-dMSRMTue.js → erDiagram-TEJ5UH35-H0BpYtyr.js} +1 -1
- package/dist/public/assets/{flowDiagram-I6XJVG4X-CKHf79Nb.js → flowDiagram-I6XJVG4X-CjWJXyC4.js} +1 -1
- package/dist/public/assets/{index-R4E59YNF.js → index-B4mAdsYc.js} +66 -66
- package/dist/public/assets/{infoDiagram-5YYISTIA-BvsQpC6d.js → infoDiagram-5YYISTIA-CqB6BNnQ.js} +1 -1
- package/dist/public/assets/{ishikawaDiagram-YF4QCWOH-z1LNiCtm.js → ishikawaDiagram-YF4QCWOH-YaxwBlxO.js} +1 -1
- package/dist/public/assets/{kanban-definition-UN3LZRKU-m2MPOiiM.js → kanban-definition-UN3LZRKU-BzR9eb3K.js} +1 -1
- package/dist/public/assets/{mindmap-definition-RKZ34NQL-zOLQH8v9.js → mindmap-definition-RKZ34NQL-CndqgpJa.js} +1 -1
- package/dist/public/assets/{pieDiagram-4H26LBE5-CsM1jwJk.js → pieDiagram-4H26LBE5-CuGkjlbL.js} +1 -1
- package/dist/public/assets/{requirementDiagram-4Y6WPE33-aMN3gWn2.js → requirementDiagram-4Y6WPE33-CefmH72B.js} +1 -1
- package/dist/public/assets/{sequenceDiagram-3UESZ5HK-DwgLNsZa.js → sequenceDiagram-3UESZ5HK-B98RLt0W.js} +1 -1
- package/dist/public/assets/{stateDiagram-AJRCARHV-BWU7pHby.js → stateDiagram-AJRCARHV-CIzC_iBb.js} +1 -1
- package/dist/public/assets/{stateDiagram-v2-BHNVJYJU-BZV-KXVr.js → stateDiagram-v2-BHNVJYJU-Bx4RQKL8.js} +1 -1
- package/dist/public/assets/{timeline-definition-PNZ67QCA-Cqw5PUrr.js → timeline-definition-PNZ67QCA-CdHJHFsN.js} +1 -1
- package/dist/public/assets/{vennDiagram-CIIHVFJN-6ZJ8KTO8.js → vennDiagram-CIIHVFJN-BQW-KKWz.js} +1 -1
- package/dist/public/assets/{wardleyDiagram-YWT4CUSO-DML2A9_-.js → wardleyDiagram-YWT4CUSO-3McUDNO_.js} +1 -1
- package/dist/public/assets/{xychartDiagram-2RQKCTM6-DMJqgVoY.js → xychartDiagram-2RQKCTM6-D1-Y-k5g.js} +1 -1
- package/dist/public/index.html +1 -1
- package/dist/routes/artifact.routes.js +30 -1
- package/dist/routines/inter-agent-task-routine.js +2 -1
- package/dist/runner/claude-code-agent-runner.js +10 -4
- package/dist/runner/github-copilot-agent-runner.js +27 -1
- package/dist/services/artifact/artifact-manager.js +28 -1
- package/package.json +1 -1
package/dist/_shared/index.js
CHANGED
|
@@ -5,7 +5,7 @@ export { SessionUsageSchema, PendingPermissionInfoSchema, PendingInstructionRemi
|
|
|
5
5
|
export { ClientMessageSchema, ServerMessageSchema, SendMessageSchema, InjectMessageSchema, PermissionResponseWsSchema, AgentTextWsMessageSchema, AgentActivityWsMessageSchema, AgentResultWsMessageSchema, AgentStatusWsMessageSchema, AgentCreatedWsMessageSchema, AgentUpdatedWsMessageSchema, AgentDeletedWsMessageSchema, AgentUsageWsMessageSchema, PermissionRequestWsMessageSchema, PermissionCancelledWsMessageSchema, ErrorWsMessageSchema, AgentMessageWsMessageSchema, AgentToolProgressWsMessageSchema, TaskAddedWsMessageSchema, TaskUpdatedWsMessageSchema, TaskAssignedWsMessageSchema, TaskStateChangedWsMessageSchema, TaskDeletedWsMessageSchema, CircleCreatedWsMessageSchema, CircleUpdatedWsMessageSchema, CircleDeletedWsMessageSchema, RelationshipCreatedWsMessageSchema, RelationshipDeletedWsMessageSchema, 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, } from "./schemas/artifact.schema.js";
|
|
8
|
+
export { ARTIFACT_TYPE, ARTIFACT_CONTENT_TYPE, ArtifactTypeSchema, ArtifactContentTypeSchema, ArtifactMetadataSchema, ArtifactTagsUpdateSchema, } 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";
|
|
@@ -48,4 +48,12 @@ export const ArtifactMetadataSchema = z.object({
|
|
|
48
48
|
updatedTimestamp: z.number(),
|
|
49
49
|
createdBy: AgentTaskSourceSchema,
|
|
50
50
|
});
|
|
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.
|
|
54
|
+
*/
|
|
55
|
+
export const ArtifactTagsUpdateSchema = z.object({
|
|
56
|
+
addTags: z.array(z.string()).optional(),
|
|
57
|
+
removeTags: z.array(z.string()).optional(),
|
|
58
|
+
});
|
|
51
59
|
//# sourceMappingURL=artifact.schema.js.map
|
|
@@ -11,6 +11,7 @@ import { getReadCircleArtifactToolConfig } from "./read-circle-artifact.js";
|
|
|
11
11
|
import { getListCircleArtifactsToolConfig } from "./list-circle-artifacts.js";
|
|
12
12
|
import { getDeleteCircleArtifactToolConfig } from "./delete-circle-artifact.js";
|
|
13
13
|
import { getFindContentInCircleArtifactToolConfig } from "./find-content-in-circle-artifact.js";
|
|
14
|
+
import { getMoveArtifactToolConfig } from "./move-artifact.js";
|
|
14
15
|
export const ARTIFACTS_MCP_SERVER_NAME = "crow-artifacts";
|
|
15
16
|
export function getArtifactsMcpServerDefinition(artifactManager, registry, circleManager, sensorManager) {
|
|
16
17
|
return {
|
|
@@ -28,6 +29,7 @@ export function getArtifactsMcpServerDefinition(artifactManager, registry, circl
|
|
|
28
29
|
defineMcpTool(getListCircleArtifactsToolConfig(agentId, artifactManager, sensorManager)),
|
|
29
30
|
defineMcpTool(getDeleteCircleArtifactToolConfig(agentId, artifactManager)),
|
|
30
31
|
defineMcpTool(getFindContentInCircleArtifactToolConfig(agentId, artifactManager)),
|
|
32
|
+
defineMcpTool(getMoveArtifactToolConfig(agentId, artifactManager)),
|
|
31
33
|
],
|
|
32
34
|
};
|
|
33
35
|
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { AGENT_TASK_SOURCE_TYPE, ENTITY_TYPE } from "../../_shared/index.js";
|
|
3
|
+
import { getErrorToolResult, textToolResult } from "../tool-utils.js";
|
|
4
|
+
export const MOVE_ARTIFACT_TOOL_NAME = "move_artifact";
|
|
5
|
+
export function getMoveArtifactToolConfig(agentId, artifactManager) {
|
|
6
|
+
const inputSchema = {
|
|
7
|
+
filename: z
|
|
8
|
+
.string()
|
|
9
|
+
.describe("Exact source filename to move, as returned by list_artifacts or list_circle_artifacts."),
|
|
10
|
+
source_circle_id: z
|
|
11
|
+
.string()
|
|
12
|
+
.optional()
|
|
13
|
+
.describe("Circle the artifact currently lives in. Omit to move from your own artifacts folder."),
|
|
14
|
+
destination_circle_id: z
|
|
15
|
+
.string()
|
|
16
|
+
.optional()
|
|
17
|
+
.describe("Circle to move the artifact into. Omit to move into your own artifacts folder."),
|
|
18
|
+
destination_filename: z
|
|
19
|
+
.string()
|
|
20
|
+
.optional()
|
|
21
|
+
.describe("Filename at the destination. Defaults to the source filename."),
|
|
22
|
+
};
|
|
23
|
+
const handler = async ({ filename, source_circle_id, destination_circle_id, destination_filename, }) => {
|
|
24
|
+
const source = source_circle_id
|
|
25
|
+
? { entityType: ENTITY_TYPE.AGENT_CIRCLE, entityId: source_circle_id }
|
|
26
|
+
: { entityType: ENTITY_TYPE.AGENT, entityId: agentId };
|
|
27
|
+
const destination = destination_circle_id
|
|
28
|
+
? { entityType: ENTITY_TYPE.AGENT_CIRCLE, entityId: destination_circle_id }
|
|
29
|
+
: { entityType: ENTITY_TYPE.AGENT, entityId: agentId };
|
|
30
|
+
if (source.entityType === destination.entityType && source.entityId === destination.entityId) {
|
|
31
|
+
return textToolResult(["Error: source and destination are the same location; nothing to move."], true);
|
|
32
|
+
}
|
|
33
|
+
if (source_circle_id && !artifactManager.isDirectCircleMember(source_circle_id, agentId)) {
|
|
34
|
+
return textToolResult(["You are not a direct member of the source circle."], true);
|
|
35
|
+
}
|
|
36
|
+
if (destination_circle_id && !artifactManager.isDirectCircleMember(destination_circle_id, agentId)) {
|
|
37
|
+
return textToolResult(["You are not a direct member of the destination circle."], true);
|
|
38
|
+
}
|
|
39
|
+
try {
|
|
40
|
+
// Source-removal author guard — mirror the delete tools so move can't bypass them.
|
|
41
|
+
const sourceMetadata = source_circle_id
|
|
42
|
+
? await artifactManager.getCircleArtifactMetadata(source_circle_id, filename)
|
|
43
|
+
: await artifactManager.getArtifactMetadata(agentId, filename);
|
|
44
|
+
const { createdBy } = sourceMetadata;
|
|
45
|
+
const canRemoveSource = source_circle_id
|
|
46
|
+
? createdBy.sourceType === AGENT_TASK_SOURCE_TYPE.AGENT
|
|
47
|
+
: createdBy.sourceType === AGENT_TASK_SOURCE_TYPE.AGENT && createdBy.agentId === agentId;
|
|
48
|
+
if (!canRemoveSource) {
|
|
49
|
+
return textToolResult([`Error: cannot move ${filename} - it is not yours to move (created by: ${createdBy.sourceType}).`], true);
|
|
50
|
+
}
|
|
51
|
+
const metadata = await artifactManager.moveArtifact(source, destination, filename, {
|
|
52
|
+
destinationFilename: destination_filename,
|
|
53
|
+
movedBy: { sourceType: AGENT_TASK_SOURCE_TYPE.AGENT, agentId },
|
|
54
|
+
});
|
|
55
|
+
const sourceLabel = source_circle_id ? `circle ${source_circle_id}` : "your artifacts";
|
|
56
|
+
const destinationLabel = destination_circle_id ? `circle ${destination_circle_id}` : "your artifacts";
|
|
57
|
+
const requestedFilename = destination_filename ?? sourceMetadata.filename;
|
|
58
|
+
const normalizedNote = metadata.filename !== requestedFilename
|
|
59
|
+
? ` (normalized from "${requestedFilename}" - use this exact filename on subsequent reads)`
|
|
60
|
+
: "";
|
|
61
|
+
return textToolResult([
|
|
62
|
+
`Moved ${filename} from ${sourceLabel} to ${destinationLabel} as ${metadata.filename}${normalizedNote}`,
|
|
63
|
+
]);
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
return getErrorToolResult(error, "Failed to move artifact.");
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
const config = {
|
|
70
|
+
name: MOVE_ARTIFACT_TOOL_NAME,
|
|
71
|
+
description: "Move one of your artifacts between your own folder and a circle you are a direct member of (own↔circle, or circle↔circle). Omit source_circle_id/destination_circle_id to use your own folder. You can only move artifacts you authored from your own folder, or agent-authored artifacts from a circle. Fails if an artifact with the destination name already exists; move it under a different destination_filename or delete the existing one first.",
|
|
72
|
+
inputSchema,
|
|
73
|
+
handler,
|
|
74
|
+
};
|
|
75
|
+
return config;
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=move-artifact.js.map
|