crow-central-agency 0.26.9 → 0.26.11
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 +2 -0
- package/dist/_shared/index.js +2 -2
- package/dist/_shared/schemas/agent-runtime-state.schema.js +4 -0
- package/dist/_shared/schemas/agent.schema.js +83 -54
- package/dist/agents/crow-agent.js +21 -6
- package/dist/agents/crow-narrative-architect-agent.js +4 -3
- package/dist/agents/crow-task-dispatcher-agent.js +4 -3
- package/dist/agents/crow-world-builder-agent.js +4 -3
- package/dist/agents/system-agent-provider.js +26 -0
- package/dist/config/env.js +2 -0
- package/dist/mcp/artifacts/artifacts-mcp-server-utils.js +2 -0
- package/dist/mcp/artifacts/read-artifact.js +7 -3
- package/dist/mcp/artifacts/read-circle-artifact.js +7 -3
- package/dist/mcp/feed/get-feed-item-content.js +8 -2
- package/dist/mcp/gmail/get-gmail-message-content.js +8 -2
- package/dist/mcp/tool-utils.js +3 -0
- package/dist/public/assets/{architectureDiagram-3BPJPVTR-DeXG4IF1.js → architectureDiagram-3BPJPVTR-Dfu4mDxF.js} +1 -1
- package/dist/public/assets/{chunk-727SXJPM-ClhCvSxl.js → chunk-727SXJPM-DRdyIpFH.js} +1 -1
- package/dist/public/assets/{chunk-AQP2D5EJ-S71PlnyF.js → chunk-AQP2D5EJ-CxdFOJqZ.js} +1 -1
- package/dist/public/assets/{classDiagram-v2-Q7XG4LA2-t2EdfGSJ.js → classDiagram-4FO5ZUOK-LI64xNQq.js} +1 -1
- package/dist/public/assets/{classDiagram-4FO5ZUOK-t2EdfGSJ.js → classDiagram-v2-Q7XG4LA2-LI64xNQq.js} +1 -1
- package/dist/public/assets/{dagre-BM42HDAG-BUN2v9KO.js → dagre-BM42HDAG-BejrWpgw.js} +1 -1
- package/dist/public/assets/{diagram-2AECGRRQ-BsEdgIXV.js → diagram-2AECGRRQ-CYSDU7Es.js} +1 -1
- package/dist/public/assets/{diagram-5GNKFQAL-DkDNM-w8.js → diagram-5GNKFQAL-CWqg_--c.js} +1 -1
- package/dist/public/assets/{diagram-LMA3HP47-bemQvtc4.js → diagram-LMA3HP47-DVIh9QtC.js} +1 -1
- package/dist/public/assets/{diagram-OG6HWLK6-DTt1CSKj.js → diagram-OG6HWLK6-B5AgbZto.js} +1 -1
- package/dist/public/assets/{erDiagram-TEJ5UH35-Ctez1ZUQ.js → erDiagram-TEJ5UH35-C_nNA82y.js} +1 -1
- package/dist/public/assets/{flowDiagram-I6XJVG4X-6cl55wrS.js → flowDiagram-I6XJVG4X-By2qp00o.js} +1 -1
- package/dist/public/assets/index-BsTDVaFe.js +505 -0
- package/dist/public/assets/{infoDiagram-5YYISTIA-DJG5GveT.js → infoDiagram-5YYISTIA-CVHdXYSW.js} +1 -1
- package/dist/public/assets/{ishikawaDiagram-YF4QCWOH-BiRWZQoC.js → ishikawaDiagram-YF4QCWOH-BL-2W-LS.js} +1 -1
- package/dist/public/assets/{kanban-definition-UN3LZRKU--LGs8j1A.js → kanban-definition-UN3LZRKU-xSoJwokp.js} +1 -1
- package/dist/public/assets/{mindmap-definition-RKZ34NQL-CBTeUNeJ.js → mindmap-definition-RKZ34NQL-DqGauYKP.js} +1 -1
- package/dist/public/assets/{pieDiagram-4H26LBE5-Bj8lCWKM.js → pieDiagram-4H26LBE5-Cem-YV-o.js} +1 -1
- package/dist/public/assets/{requirementDiagram-4Y6WPE33-DNbmiPTP.js → requirementDiagram-4Y6WPE33-B9aiHS8X.js} +1 -1
- package/dist/public/assets/{sequenceDiagram-3UESZ5HK-DOZcdL-V.js → sequenceDiagram-3UESZ5HK-yWsOSX3M.js} +1 -1
- package/dist/public/assets/{stateDiagram-AJRCARHV-BCpPGAsz.js → stateDiagram-AJRCARHV-DukGMuPG.js} +1 -1
- package/dist/public/assets/{stateDiagram-v2-BHNVJYJU-hUzXDK6m.js → stateDiagram-v2-BHNVJYJU-D9OyrL7B.js} +1 -1
- package/dist/public/assets/{timeline-definition-PNZ67QCA-BsNHIWNc.js → timeline-definition-PNZ67QCA-BsTDDrEU.js} +1 -1
- package/dist/public/assets/{vennDiagram-CIIHVFJN-DCZMeVJ8.js → vennDiagram-CIIHVFJN-s98Cc7wd.js} +1 -1
- package/dist/public/assets/{wardleyDiagram-YWT4CUSO-B15lhDxS.js → wardleyDiagram-YWT4CUSO-Y4ycH63u.js} +1 -1
- package/dist/public/assets/{xychartDiagram-2RQKCTM6-u23J3wWJ.js → xychartDiagram-2RQKCTM6-DZ5QZsxL.js} +1 -1
- package/dist/public/index.html +1 -1
- package/dist/runner/github-copilot-agent-runner.js +30 -4
- package/dist/runner/stream-processor.js +3 -0
- package/dist/services/runtime/agent-runtime-manager.js +15 -1
- package/package.json +5 -5
- package/dist/public/assets/index-ISMoAJEC.js +0 -478
package/README.md
CHANGED
|
@@ -97,6 +97,8 @@ See `.env.example` for the full list, including:
|
|
|
97
97
|
- `LOG_LEVEL` — log verbosity (defaults to `debug` in development, `info` otherwise).
|
|
98
98
|
- `CROW_SYSTEM_PATH` — directory for Crow's file-based storage. Defaults to `~/.crow`.
|
|
99
99
|
- `CROW_SYSTEM_AGENT_NAME` — display name for the built-in Crow system agent (default: `Crow`).
|
|
100
|
+
- `CROW_SYSTEM_AGENT_PROVIDER` — provider backing the built-in system agents: `claude` or `copilot` (default: `claude`). Forced to `claude` when `DISABLE_GITHUB_COPILOT` is set.
|
|
101
|
+
- `CROW_SYSTEM_AGENT_COPILOT_MODEL` — model for system agents when `CROW_SYSTEM_AGENT_PROVIDER=copilot` (default: `auto`).
|
|
100
102
|
- `STATIC_PATH` — override the directory served as frontend assets (auto-detected from the published bundle).
|
|
101
103
|
- `CLAUDE_CLI_PATH` — explicit path to the Claude Code CLI binary when it is not on `PATH`.
|
|
102
104
|
- `DISABLE_GITHUB_COPILOT` — set to `true` (or `1`) to skip starting the Copilot SDK client at boot, so GitHub Copilot is reported unavailable everywhere. Defaults to `false`.
|
package/dist/_shared/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { CLAUDE_MODELS, GITHUB_COPILOT_MODELS, CLAUDE_CODE_MODEL_OPTIONS, ModelOptionSchema, REASONING_EFFORT, ReasoningEffortSchema, CLAUDE_DEFAULT_MODEL, COPILOT_DEFAULT_MODEL, AgentIdSchema, AgentConfigSchema, AgentConfigTemplateSchema, CreateAgentInputSchema, UpdateAgentInputSchema, ToolConfigSchema, PermissionModeSchema, SettingSourceSchema, DiscoveredSkillSchema, LoopConfigSchema, ConfiguredFeedSchema, MAX_LOOP_TIMES, PERMISSION_MODE, SETTING_SOURCE, DEFAULT_SETTING_SOURCES, TOOL_MODE, DEFAULT_CLAUDE_CODE_AVAILABLE_TOOLS, DEFAULT_GITHUB_COPILOT_AVAILABLE_TOOLS, DEFAULT_AVAILABLE_TOOLS_BY_TYPE, SUBAGENT_TOOL_NAME, AGENT_TYPE, AgentTypeSchema, DEFAULT_AGENT_TYPE, AGENT_NAME_MAX_LENGTH, } from "./schemas/agent.schema.js";
|
|
1
|
+
export { CLAUDE_MODELS, GITHUB_COPILOT_MODELS, CLAUDE_CODE_MODEL_OPTIONS, ModelOptionSchema, REASONING_EFFORT, ReasoningEffortSchema, CLAUDE_DEFAULT_MODEL, COPILOT_DEFAULT_MODEL, AgentIdSchema, AgentConfigSchema, AgentConfigTemplateSchema, CreateAgentInputSchema, UpdateAgentInputSchema, ToolConfigSchema, PermissionModeSchema, SettingSourceSchema, DiscoveredSkillSchema, LoopConfigSchema, ConfiguredFeedSchema, MAX_LOOP_TIMES, PERMISSION_MODE, SETTING_SOURCE, DEFAULT_SETTING_SOURCES, TOOL_MODE, CLAUDE_CODE_TOOL, GITHUB_COPILOT_TOOL, DEFAULT_CLAUDE_CODE_AVAILABLE_TOOLS, DEFAULT_GITHUB_COPILOT_AVAILABLE_TOOLS, DEFAULT_AVAILABLE_TOOLS_BY_TYPE, SUBAGENT_TOOL_NAME, AGENT_TYPE, AgentTypeSchema, DEFAULT_AGENT_TYPE, AGENT_NAME_MAX_LENGTH, } from "./schemas/agent.schema.js";
|
|
2
2
|
export { SchedulerTimeSchema, DAY_OF_WEEK, DayOfWeekSchema, TimeModeSchema, TIME_MODE, } from "./schemas/scheduler.schema.js";
|
|
3
3
|
export { createApiSuccessSchema, ApiErrorSchema, } from "./schemas/api-response.schema.js";
|
|
4
|
-
export { SessionUsageSchema, PendingPermissionInfoSchema, PendingInstructionReminderSchema, AgentRuntimeStateSchema, AgentActivitySchema, AGENT_ACTIVITY_TYPE, AGENT_STATUS, } from "./schemas/agent-runtime-state.schema.js";
|
|
4
|
+
export { SessionUsageSchema, PendingPermissionInfoSchema, PendingInstructionReminderSchema, AgentRuntimeStateSchema, AgentActivitySchema, AGENT_ACTIVITY_TYPE, AGENT_STATUS, MAX_INPUT_HISTORY, } from "./schemas/agent-runtime-state.schema.js";
|
|
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";
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { MessageSourceSchema } from "./message-source.schema.js";
|
|
3
|
+
/** Maximum number of recent user inputs retained per agent for compose-box recall. */
|
|
4
|
+
export const MAX_INPUT_HISTORY = 30;
|
|
3
5
|
export const AGENT_STATUS = {
|
|
4
6
|
IDLE: "idle",
|
|
5
7
|
ACTIVATING: "activating",
|
|
@@ -81,5 +83,7 @@ export const AgentRuntimeStateSchema = z.object({
|
|
|
81
83
|
lastError: z.string().optional(),
|
|
82
84
|
pendingPermissions: z.array(PendingPermissionInfoSchema).optional(),
|
|
83
85
|
pendingInstructionReminder: PendingInstructionReminderSchema.optional(),
|
|
86
|
+
/** Recent user message inputs (oldest first) for compose-box Up/Down recall; survives new sessions. */
|
|
87
|
+
inputHistory: z.array(z.string()).optional(),
|
|
84
88
|
});
|
|
85
89
|
//# sourceMappingURL=agent-runtime-state.schema.js.map
|
|
@@ -3,7 +3,8 @@ import { DiscordConfigSchema } from "./discord-config.schema.js";
|
|
|
3
3
|
import { DayOfWeekSchema, SchedulerTimeSchema, TIME_MODE, TimeModeSchema } from "./scheduler.schema.js";
|
|
4
4
|
export const CLAUDE_MODELS = {
|
|
5
5
|
HAIKU: "claude-haiku-4-5",
|
|
6
|
-
SONNET: "claude-sonnet-
|
|
6
|
+
SONNET: "claude-sonnet-5",
|
|
7
|
+
SONNET_4_6: "claude-sonnet-4-6",
|
|
7
8
|
SONNET_4_5: "claude-sonnet-4-5",
|
|
8
9
|
OPUS: "claude-opus-4-8",
|
|
9
10
|
OPUS_4_7: "claude-opus-4-7",
|
|
@@ -46,6 +47,11 @@ export const ModelOptionSchema = z.object({
|
|
|
46
47
|
export const CLAUDE_CODE_MODEL_OPTIONS = [
|
|
47
48
|
{
|
|
48
49
|
value: CLAUDE_MODELS.SONNET,
|
|
50
|
+
label: "Claude Sonnet 5",
|
|
51
|
+
supportedEfforts: [REASONING_EFFORT.LOW, REASONING_EFFORT.MEDIUM, REASONING_EFFORT.HIGH, REASONING_EFFORT.MAX],
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
value: CLAUDE_MODELS.SONNET_4_6,
|
|
49
55
|
label: "Claude Sonnet 4.6",
|
|
50
56
|
supportedEfforts: [REASONING_EFFORT.LOW, REASONING_EFFORT.MEDIUM, REASONING_EFFORT.HIGH, REASONING_EFFORT.MAX],
|
|
51
57
|
},
|
|
@@ -98,65 +104,88 @@ export const TOOL_MODE = {
|
|
|
98
104
|
};
|
|
99
105
|
/** The SDK tool name used to launch a subagent */
|
|
100
106
|
export const SUBAGENT_TOOL_NAME = "Agent";
|
|
107
|
+
/**
|
|
108
|
+
* Builtin tool names for Claude Code agents.
|
|
109
|
+
*/
|
|
110
|
+
export const CLAUDE_CODE_TOOL = {
|
|
111
|
+
ASK_USER_QUESTION: "AskUserQuestion",
|
|
112
|
+
BASH: "Bash",
|
|
113
|
+
CRON_CREATE: "CronCreate",
|
|
114
|
+
CRON_DELETE: "CronDelete",
|
|
115
|
+
CRON_LIST: "CronList",
|
|
116
|
+
EDIT: "Edit",
|
|
117
|
+
ENTER_PLAN_MODE: "EnterPlanMode",
|
|
118
|
+
ENTER_WORKTREE: "EnterWorktree",
|
|
119
|
+
EXIT_PLAN_MODE: "ExitPlanMode",
|
|
120
|
+
EXIT_WORKTREE: "ExitWorktree",
|
|
121
|
+
GLOB: "Glob",
|
|
122
|
+
GREP: "Grep",
|
|
123
|
+
LSP: "LSP",
|
|
124
|
+
MONITOR: "Monitor",
|
|
125
|
+
NOTEBOOK_EDIT: "NotebookEdit",
|
|
126
|
+
POWER_SHELL: "PowerShell",
|
|
127
|
+
PUSH_NOTIFICATION: "PushNotification",
|
|
128
|
+
READ: "Read",
|
|
129
|
+
REMOTE_TRIGGER: "RemoteTrigger",
|
|
130
|
+
SCHEDULE_WAKEUP: "ScheduleWakeup",
|
|
131
|
+
SKILL: "Skill",
|
|
132
|
+
TASK: "Task",
|
|
133
|
+
TASK_CREATE: "TaskCreate",
|
|
134
|
+
TASK_GET: "TaskGet",
|
|
135
|
+
TASK_LIST: "TaskList",
|
|
136
|
+
TASK_OUTPUT: "TaskOutput",
|
|
137
|
+
TASK_STOP: "TaskStop",
|
|
138
|
+
TASK_UPDATE: "TaskUpdate",
|
|
139
|
+
TOOL_SEARCH: "ToolSearch",
|
|
140
|
+
WEB_FETCH: "WebFetch",
|
|
141
|
+
WEB_SEARCH: "WebSearch",
|
|
142
|
+
WORKFLOW: "Workflow",
|
|
143
|
+
WRITE: "Write",
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* Builtin tool names for GitHub Copilot agents. Superset across platforms, models, and config:
|
|
147
|
+
* the runtime swaps the shell family (bash on Linux/macOS, powershell on Windows) and the file-edit
|
|
148
|
+
* tools (str_replace_editor vs create/edit/view vs apply_patch) per model, and surfaces web_search
|
|
149
|
+
* only when config discovery is enabled. Agents may run on any of these, so all known names are listed.
|
|
150
|
+
*/
|
|
151
|
+
export const GITHUB_COPILOT_TOOL = {
|
|
152
|
+
BASH: "bash",
|
|
153
|
+
WRITE_BASH: "write_bash",
|
|
154
|
+
READ_BASH: "read_bash",
|
|
155
|
+
STOP_BASH: "stop_bash",
|
|
156
|
+
LIST_BASH: "list_bash",
|
|
157
|
+
POWER_SHELL: "powershell",
|
|
158
|
+
WRITE_POWER_SHELL: "write_powershell",
|
|
159
|
+
READ_POWER_SHELL: "read_powershell",
|
|
160
|
+
STOP_POWER_SHELL: "stop_powershell",
|
|
161
|
+
LIST_POWER_SHELL: "list_powershell",
|
|
162
|
+
STR_REPLACE_EDITOR: "str_replace_editor",
|
|
163
|
+
APPLY_PATCH: "apply_patch",
|
|
164
|
+
VIEW: "view",
|
|
165
|
+
CREATE: "create",
|
|
166
|
+
EDIT: "edit",
|
|
167
|
+
GREP: "grep",
|
|
168
|
+
RG: "rg",
|
|
169
|
+
GLOB: "glob",
|
|
170
|
+
WEB_FETCH: "web_fetch",
|
|
171
|
+
WEB_SEARCH: "web_search",
|
|
172
|
+
READ_AGENT: "read_agent",
|
|
173
|
+
LIST_AGENTS: "list_agents",
|
|
174
|
+
SKILL: "skill",
|
|
175
|
+
TASK: "task",
|
|
176
|
+
SQL: "sql",
|
|
177
|
+
REPORT_INTENT: "report_intent",
|
|
178
|
+
ASK_USER: "ask_user",
|
|
179
|
+
FETCH_COPILOT_CLI_DOCUMENTATION: "fetch_copilot_cli_documentation",
|
|
180
|
+
};
|
|
101
181
|
/**
|
|
102
182
|
* Default builtin tool catalog for Claude Code agents.
|
|
103
183
|
*/
|
|
104
|
-
export const DEFAULT_CLAUDE_CODE_AVAILABLE_TOOLS =
|
|
105
|
-
"AskUserQuestion",
|
|
106
|
-
"Bash",
|
|
107
|
-
"CronCreate",
|
|
108
|
-
"CronDelete",
|
|
109
|
-
"CronList",
|
|
110
|
-
"Edit",
|
|
111
|
-
"EnterPlanMode",
|
|
112
|
-
"EnterWorktree",
|
|
113
|
-
"ExitPlanMode",
|
|
114
|
-
"ExitWorktree",
|
|
115
|
-
"Glob",
|
|
116
|
-
"Grep",
|
|
117
|
-
"LSP",
|
|
118
|
-
"Monitor",
|
|
119
|
-
"NotebookEdit",
|
|
120
|
-
"PowerShell",
|
|
121
|
-
"PushNotification",
|
|
122
|
-
"Read",
|
|
123
|
-
"RemoteTrigger",
|
|
124
|
-
"ScheduleWakeup",
|
|
125
|
-
"Skill",
|
|
126
|
-
"Task",
|
|
127
|
-
"TaskCreate",
|
|
128
|
-
"TaskGet",
|
|
129
|
-
"TaskList",
|
|
130
|
-
"TaskOutput",
|
|
131
|
-
"TaskStop",
|
|
132
|
-
"TaskUpdate",
|
|
133
|
-
"ToolSearch",
|
|
134
|
-
"WebFetch",
|
|
135
|
-
"WebSearch",
|
|
136
|
-
"Workflow",
|
|
137
|
-
"Write",
|
|
138
|
-
];
|
|
184
|
+
export const DEFAULT_CLAUDE_CODE_AVAILABLE_TOOLS = Object.values(CLAUDE_CODE_TOOL);
|
|
139
185
|
/**
|
|
140
186
|
* Default builtin tool catalog for GitHub Copilot agents.
|
|
141
187
|
*/
|
|
142
|
-
export const DEFAULT_GITHUB_COPILOT_AVAILABLE_TOOLS =
|
|
143
|
-
"bash",
|
|
144
|
-
"write_bash",
|
|
145
|
-
"read_bash",
|
|
146
|
-
"stop_bash",
|
|
147
|
-
"list_bash",
|
|
148
|
-
"view",
|
|
149
|
-
"create",
|
|
150
|
-
"edit",
|
|
151
|
-
"web_fetch",
|
|
152
|
-
"report_intent",
|
|
153
|
-
"fetch_copilot_cli_documentation",
|
|
154
|
-
"skill",
|
|
155
|
-
"ask_user",
|
|
156
|
-
"grep",
|
|
157
|
-
"glob",
|
|
158
|
-
"task",
|
|
159
|
-
];
|
|
188
|
+
export const DEFAULT_GITHUB_COPILOT_AVAILABLE_TOOLS = Object.values(GITHUB_COPILOT_TOOL);
|
|
160
189
|
/**
|
|
161
190
|
* Setting sources matching SDK SettingSource type.
|
|
162
191
|
* Controls which SDK configuration sources are included in agent queries.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { PERMISSION_MODE, TOOL_MODE, CLAUDE_MODELS,
|
|
1
|
+
import { PERMISSION_MODE, TOOL_MODE, CLAUDE_MODELS, CLAUDE_CODE_TOOL, GITHUB_COPILOT_TOOL, AGENT_TYPE, CROW_SYSTEM_AGENT_ID, } from "../_shared/index.js";
|
|
2
2
|
import { env } from "../config/env.js";
|
|
3
|
+
import { SYSTEM_AGENT_TYPE, resolveSystemAgentModel } from "./system-agent-provider.js";
|
|
3
4
|
import { createMessageContentFromTemplate, getDefaultPromptContext } from "../utils/message-template.js";
|
|
4
5
|
import path from "node:path";
|
|
5
6
|
import { SYSTEM_AGENTS_PROJECT_DIR_NAME } from "../config/constants.js";
|
|
@@ -36,25 +37,39 @@ const CROW_SYSTEM_AGENT_PERSONA = {
|
|
|
36
37
|
],
|
|
37
38
|
};
|
|
38
39
|
const SUPER_CROW_BIRTHDAY = "1970-01-01T00:00:00Z";
|
|
39
|
-
const SUPER_CROW_TOOLS = [
|
|
40
|
+
const SUPER_CROW_TOOLS = [
|
|
41
|
+
CLAUDE_CODE_TOOL.GLOB,
|
|
42
|
+
CLAUDE_CODE_TOOL.GREP,
|
|
43
|
+
CLAUDE_CODE_TOOL.READ,
|
|
44
|
+
CLAUDE_CODE_TOOL.WEB_FETCH,
|
|
45
|
+
CLAUDE_CODE_TOOL.WEB_SEARCH,
|
|
46
|
+
];
|
|
47
|
+
const SUPER_CROW_TOOLS_COPILOT = [
|
|
48
|
+
GITHUB_COPILOT_TOOL.GLOB,
|
|
49
|
+
GITHUB_COPILOT_TOOL.GREP,
|
|
50
|
+
GITHUB_COPILOT_TOOL.VIEW,
|
|
51
|
+
GITHUB_COPILOT_TOOL.WEB_FETCH,
|
|
52
|
+
GITHUB_COPILOT_TOOL.WEB_SEARCH,
|
|
53
|
+
];
|
|
40
54
|
/** Build the Crow system agent config - built-in, immutable, not persisted */
|
|
41
55
|
export function getCrowAgent() {
|
|
42
56
|
const persona = createMessageContentFromTemplate(CROW_SYSTEM_AGENT_PERSONA, getDefaultPromptContext());
|
|
57
|
+
const tools = SYSTEM_AGENT_TYPE === AGENT_TYPE.GITHUB_COPILOT ? SUPER_CROW_TOOLS_COPILOT : SUPER_CROW_TOOLS;
|
|
43
58
|
return {
|
|
44
59
|
id: CROW_SYSTEM_AGENT_ID,
|
|
45
|
-
type:
|
|
60
|
+
type: SYSTEM_AGENT_TYPE,
|
|
46
61
|
name: CROW_SYSTEM_AGENT_NAME,
|
|
47
62
|
description: "Chief of staff agent acts as the ultimate coordinator for all agents and primary interfacing with the user.",
|
|
48
63
|
workspace: path.join(env.CROW_SYSTEM_PATH, SYSTEM_AGENTS_PROJECT_DIR_NAME),
|
|
49
64
|
persona,
|
|
50
|
-
model: CLAUDE_MODELS.SONNET,
|
|
65
|
+
model: resolveSystemAgentModel(CLAUDE_MODELS.SONNET),
|
|
51
66
|
permissionMode: PERMISSION_MODE.DEFAULT,
|
|
52
67
|
settingSources: [],
|
|
53
68
|
availableTools: [],
|
|
54
69
|
toolConfig: {
|
|
55
70
|
mode: TOOL_MODE.RESTRICTED,
|
|
56
|
-
tools
|
|
57
|
-
autoApprovedTools:
|
|
71
|
+
tools,
|
|
72
|
+
autoApprovedTools: tools,
|
|
58
73
|
},
|
|
59
74
|
mcpServerIds: [],
|
|
60
75
|
sensorIds: [GEOLOCATION_SENSOR_ID, WEATHER_SENSOR_ID],
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { PERMISSION_MODE, TOOL_MODE, CLAUDE_MODELS, CROW_NARRATIVE_ARCHITECT_AGENT_ID,
|
|
1
|
+
import { PERMISSION_MODE, TOOL_MODE, CLAUDE_MODELS, CROW_NARRATIVE_ARCHITECT_AGENT_ID, } from "../_shared/index.js";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { env } from "../config/env.js";
|
|
4
|
+
import { SYSTEM_AGENT_TYPE, resolveSystemAgentModel } from "./system-agent-provider.js";
|
|
4
5
|
import { createMessageContentFromTemplate, getDefaultPromptContext } from "../utils/message-template.js";
|
|
5
6
|
import { SYSTEM_AGENTS_PROJECT_DIR_NAME } from "../config/constants.js";
|
|
6
7
|
import { WORLD_BUILDER_BEGIN, WORLD_BUILDER_END } from "../services/world-builder/world-builder.constants.js";
|
|
@@ -67,12 +68,12 @@ export function getNarrativeArchitectAgent() {
|
|
|
67
68
|
const persona = createMessageContentFromTemplate(CROW_NARRATIVE_ARCHITECT_AGENT_PERSONA, getDefaultPromptContext());
|
|
68
69
|
return {
|
|
69
70
|
id: CROW_NARRATIVE_ARCHITECT_AGENT_ID,
|
|
70
|
-
type:
|
|
71
|
+
type: SYSTEM_AGENT_TYPE,
|
|
71
72
|
name: CROW_NARRATIVE_ARCHITECT_AGENT_NAME,
|
|
72
73
|
description: "Internal generation specialist. Authors agent personas and generates/reinforces AGENT.md.",
|
|
73
74
|
workspace: path.join(env.CROW_SYSTEM_PATH, SYSTEM_AGENTS_PROJECT_DIR_NAME),
|
|
74
75
|
persona,
|
|
75
|
-
model: CLAUDE_MODELS.SONNET,
|
|
76
|
+
model: resolveSystemAgentModel(CLAUDE_MODELS.SONNET),
|
|
76
77
|
permissionMode: PERMISSION_MODE.DEFAULT,
|
|
77
78
|
settingSources: [],
|
|
78
79
|
availableTools: [],
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { PERMISSION_MODE, TOOL_MODE, CLAUDE_MODELS, CROW_TASK_DISPATCHER_AGENT_ID, CROW_SYSTEM_AGENT_ID,
|
|
1
|
+
import { PERMISSION_MODE, TOOL_MODE, CLAUDE_MODELS, CROW_TASK_DISPATCHER_AGENT_ID, CROW_SYSTEM_AGENT_ID, } from "../_shared/index.js";
|
|
2
2
|
import { env } from "../config/env.js";
|
|
3
|
+
import { SYSTEM_AGENT_TYPE, resolveSystemAgentModel } from "./system-agent-provider.js";
|
|
3
4
|
import { createMessageContentFromTemplate, getDefaultPromptContext } from "../utils/message-template.js";
|
|
4
5
|
import path from "node:path";
|
|
5
6
|
import { SYSTEM_AGENTS_PROJECT_DIR_NAME } from "../config/constants.js";
|
|
@@ -39,12 +40,12 @@ export function getTaskDispatcherAgent() {
|
|
|
39
40
|
const persona = createMessageContentFromTemplate(CROW_TASK_DISPATCHER_AGENT_PERSONA, getDefaultPromptContext({ crowSystemAgentId: CROW_SYSTEM_AGENT_ID }));
|
|
40
41
|
return {
|
|
41
42
|
id: CROW_TASK_DISPATCHER_AGENT_ID,
|
|
42
|
-
type:
|
|
43
|
+
type: SYSTEM_AGENT_TYPE,
|
|
43
44
|
name: CROW_TASK_DISPATCHER_AGENT_NAME,
|
|
44
45
|
description: "Routes unassigned tasks to the most appropriate agent or user. Does not execute tasks.",
|
|
45
46
|
workspace: path.join(env.CROW_SYSTEM_PATH, SYSTEM_AGENTS_PROJECT_DIR_NAME),
|
|
46
47
|
persona,
|
|
47
|
-
model: CLAUDE_MODELS.HAIKU,
|
|
48
|
+
model: resolveSystemAgentModel(CLAUDE_MODELS.HAIKU),
|
|
48
49
|
permissionMode: PERMISSION_MODE.DEFAULT,
|
|
49
50
|
settingSources: [],
|
|
50
51
|
availableTools: [],
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { PERMISSION_MODE, TOOL_MODE, CLAUDE_MODELS, CROW_WORLD_BUILDER_AGENT_ID,
|
|
1
|
+
import { PERMISSION_MODE, TOOL_MODE, CLAUDE_MODELS, CROW_WORLD_BUILDER_AGENT_ID, AGENT_NAME_MAX_LENGTH, } from "../_shared/index.js";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { env } from "../config/env.js";
|
|
4
|
+
import { SYSTEM_AGENT_TYPE, resolveSystemAgentModel } from "./system-agent-provider.js";
|
|
4
5
|
import { createMessageContentFromTemplate, getDefaultPromptContext } from "../utils/message-template.js";
|
|
5
6
|
import { SYSTEM_AGENTS_PROJECT_DIR_NAME } from "../config/constants.js";
|
|
6
7
|
import { WORLD_BUILDER_BEGIN, WORLD_BUILDER_END } from "../services/world-builder/world-builder.constants.js";
|
|
@@ -72,12 +73,12 @@ export function getWorldBuilderAgent() {
|
|
|
72
73
|
const persona = createMessageContentFromTemplate(CROW_WORLD_BUILDER_AGENT_PERSONA, getDefaultPromptContext());
|
|
73
74
|
return {
|
|
74
75
|
id: CROW_WORLD_BUILDER_AGENT_ID,
|
|
75
|
-
type:
|
|
76
|
+
type: SYSTEM_AGENT_TYPE,
|
|
76
77
|
name: CROW_WORLD_BUILDER_AGENT_NAME,
|
|
77
78
|
description: "Internal fleet architect. Designs a set of agents from a requirement as directional briefs.",
|
|
78
79
|
workspace: path.join(env.CROW_SYSTEM_PATH, SYSTEM_AGENTS_PROJECT_DIR_NAME),
|
|
79
80
|
persona,
|
|
80
|
-
model: CLAUDE_MODELS.SONNET,
|
|
81
|
+
model: resolveSystemAgentModel(CLAUDE_MODELS.SONNET),
|
|
81
82
|
permissionMode: PERMISSION_MODE.DEFAULT,
|
|
82
83
|
settingSources: [],
|
|
83
84
|
availableTools: [],
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { AGENT_TYPE, GITHUB_COPILOT_MODELS } from "../_shared/index.js";
|
|
2
|
+
import { env } from "../config/env.js";
|
|
3
|
+
/** Accepted CROW_SYSTEM_AGENT_PROVIDER values. */
|
|
4
|
+
const SYSTEM_AGENT_PROVIDER = {
|
|
5
|
+
CLAUDE: "claude",
|
|
6
|
+
COPILOT: "copilot",
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Provider backing the built-in system agents, controlled by CROW_SYSTEM_AGENT_PROVIDER
|
|
10
|
+
* (claude | copilot), defaulting to Claude Code. Forced back to Claude Code when
|
|
11
|
+
* DISABLE_GITHUB_COPILOT is set, so system agents never point at a runtime that never starts.
|
|
12
|
+
*/
|
|
13
|
+
export const SYSTEM_AGENT_TYPE = !env.DISABLE_GITHUB_COPILOT && env.CROW_SYSTEM_AGENT_PROVIDER === SYSTEM_AGENT_PROVIDER.COPILOT
|
|
14
|
+
? AGENT_TYPE.GITHUB_COPILOT
|
|
15
|
+
: AGENT_TYPE.CLAUDE_CODE;
|
|
16
|
+
/**
|
|
17
|
+
* Resolve the model a system agent runs on for the active provider. Claude Code keeps the agent's
|
|
18
|
+
* per-tier Claude model; Copilot defaults every system agent to `auto`, overridable in one place via
|
|
19
|
+
* CROW_SYSTEM_AGENT_COPILOT_MODEL.
|
|
20
|
+
*/
|
|
21
|
+
export function resolveSystemAgentModel(claudeModel) {
|
|
22
|
+
return SYSTEM_AGENT_TYPE === AGENT_TYPE.GITHUB_COPILOT
|
|
23
|
+
? (env.CROW_SYSTEM_AGENT_COPILOT_MODEL ?? GITHUB_COPILOT_MODELS.AUTO)
|
|
24
|
+
: claudeModel;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=system-agent-provider.js.map
|
package/dist/config/env.js
CHANGED
|
@@ -54,6 +54,8 @@ export const env = {
|
|
|
54
54
|
CROW_SYSTEM_PATH: expandPath(crowSysPath),
|
|
55
55
|
STATIC_PATH: expandPath(getOptional("STATIC_PATH") ?? DEFAULT_STATIC_DIR),
|
|
56
56
|
CROW_SYSTEM_AGENT_NAME: getOptional("CROW_SYSTEM_AGENT_NAME"),
|
|
57
|
+
CROW_SYSTEM_AGENT_PROVIDER: getOptional("CROW_SYSTEM_AGENT_PROVIDER")?.trim().toLowerCase(),
|
|
58
|
+
CROW_SYSTEM_AGENT_COPILOT_MODEL: getOptional("CROW_SYSTEM_AGENT_COPILOT_MODEL"),
|
|
57
59
|
CLAUDE_CLI_PATH: getOptional("CLAUDE_CLI_PATH"),
|
|
58
60
|
DISABLE_GITHUB_COPILOT: getBoolean("DISABLE_GITHUB_COPILOT"),
|
|
59
61
|
CLOSED_TASK_RETENTION_DAYS: getOptionalNumber("CLOSED_TASK_RETENTION_DAYS", 30),
|
|
@@ -5,6 +5,8 @@ import { processTextContent, textToolResult } from "../tool-utils.js";
|
|
|
5
5
|
import { last } from "es-toolkit";
|
|
6
6
|
export const ARTIFACT_TYPE_VALUES = Object.values(ARTIFACT_TYPE);
|
|
7
7
|
export const ARTIFACT_CONTENT_TYPE_VALUES = Object.values(ARTIFACT_CONTENT_TYPE);
|
|
8
|
+
/** Default cap on lines returned by read artifact tools to avoid flooding the context with large text artifacts. */
|
|
9
|
+
export const DEFAULT_READ_ARTIFACT_LINE_LIMIT = 100;
|
|
8
10
|
export const EDIT_ARTIFACT_MODE = {
|
|
9
11
|
INSERT: "insert",
|
|
10
12
|
REPLACE: "replace",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { getErrorToolResult, textToolResult } from "../tool-utils.js";
|
|
3
|
-
import { buildReadArtifactResult } from "./artifacts-mcp-server-utils.js";
|
|
3
|
+
import { buildReadArtifactResult, DEFAULT_READ_ARTIFACT_LINE_LIMIT } from "./artifacts-mcp-server-utils.js";
|
|
4
4
|
export const READ_ARTIFACT_TOOL_NAME = "read_artifact";
|
|
5
5
|
export function getReadArtifactToolConfig(agentId, artifactManager, registry, circleManager, sensorManager) {
|
|
6
6
|
const inputSchema = {
|
|
@@ -16,7 +16,7 @@ export function getReadArtifactToolConfig(agentId, artifactManager, registry, ci
|
|
|
16
16
|
.number()
|
|
17
17
|
.min(1)
|
|
18
18
|
.optional()
|
|
19
|
-
.describe(
|
|
19
|
+
.describe(`Optional. Maximum number of lines to return starting from startLine (default: ${DEFAULT_READ_ARTIFACT_LINE_LIMIT}).`),
|
|
20
20
|
};
|
|
21
21
|
const handler = async ({ agent_id, filename, showLineNumber, startLine, limit }) => {
|
|
22
22
|
try {
|
|
@@ -33,7 +33,11 @@ export function getReadArtifactToolConfig(agentId, artifactManager, registry, ci
|
|
|
33
33
|
artifactManager.readArtifact(agent_id, filename, { useAdapter: true }),
|
|
34
34
|
sensorManager.getUserTimezone(),
|
|
35
35
|
]);
|
|
36
|
-
return buildReadArtifactResult(content, metadata, userTimezone, {
|
|
36
|
+
return buildReadArtifactResult(content, metadata, userTimezone, {
|
|
37
|
+
showLineNumber,
|
|
38
|
+
startLine,
|
|
39
|
+
limit: limit ?? DEFAULT_READ_ARTIFACT_LINE_LIMIT,
|
|
40
|
+
});
|
|
37
41
|
}
|
|
38
42
|
catch (error) {
|
|
39
43
|
return getErrorToolResult(error, "Failed to read artifact.");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { getErrorToolResult, textToolResult } from "../tool-utils.js";
|
|
3
|
-
import { buildReadArtifactResult } from "./artifacts-mcp-server-utils.js";
|
|
3
|
+
import { buildReadArtifactResult, DEFAULT_READ_ARTIFACT_LINE_LIMIT } from "./artifacts-mcp-server-utils.js";
|
|
4
4
|
export const READ_CIRCLE_ARTIFACT_TOOL_NAME = "read_circle_artifact";
|
|
5
5
|
export function getReadCircleArtifactToolConfig(agentId, artifactManager, sensorManager) {
|
|
6
6
|
const inputSchema = {
|
|
@@ -16,7 +16,7 @@ export function getReadCircleArtifactToolConfig(agentId, artifactManager, sensor
|
|
|
16
16
|
.number()
|
|
17
17
|
.min(1)
|
|
18
18
|
.optional()
|
|
19
|
-
.describe(
|
|
19
|
+
.describe(`Optional. Maximum number of lines to return starting from startLine (default: ${DEFAULT_READ_ARTIFACT_LINE_LIMIT}).`),
|
|
20
20
|
};
|
|
21
21
|
const handler = async ({ circle_id, filename, showLineNumber, startLine, limit, }) => {
|
|
22
22
|
if (!artifactManager.isDirectCircleMember(circle_id, agentId)) {
|
|
@@ -27,7 +27,11 @@ export function getReadCircleArtifactToolConfig(agentId, artifactManager, sensor
|
|
|
27
27
|
artifactManager.readCircleArtifact(circle_id, filename, { useAdapter: true }),
|
|
28
28
|
sensorManager.getUserTimezone(),
|
|
29
29
|
]);
|
|
30
|
-
return buildReadArtifactResult(content, metadata, userTimezone, {
|
|
30
|
+
return buildReadArtifactResult(content, metadata, userTimezone, {
|
|
31
|
+
showLineNumber,
|
|
32
|
+
startLine,
|
|
33
|
+
limit: limit ?? DEFAULT_READ_ARTIFACT_LINE_LIMIT,
|
|
34
|
+
});
|
|
31
35
|
}
|
|
32
36
|
catch (error) {
|
|
33
37
|
return getErrorToolResult(error, "Failed to read circle artifact.");
|
|
@@ -3,6 +3,8 @@ import { getErrorToolResult, processTextContent, textToolResult } from "../tool-
|
|
|
3
3
|
import { formatLocalDateTime } from "../../utils/date-utils.js";
|
|
4
4
|
import { resolveVisibleFeedIds } from "./feed-tool-utils.js";
|
|
5
5
|
export const GET_FEED_ITEM_CONTENT_TOOL_NAME = "get_feed_item_content";
|
|
6
|
+
/** Default cap on lines returned for a feed item to avoid flooding the context with long article bodies. */
|
|
7
|
+
export const DEFAULT_FEED_ITEM_CONTENT_LINE_LIMIT = 100;
|
|
6
8
|
export function getFeedItemContentToolConfig(agentId, registry, feedManager, sensorManager, systemSettingsManager) {
|
|
7
9
|
const inputSchema = {
|
|
8
10
|
feedId: z.string().describe("The news/RSS feed ID that owns the item."),
|
|
@@ -17,7 +19,7 @@ export function getFeedItemContentToolConfig(agentId, registry, feedManager, sen
|
|
|
17
19
|
.number()
|
|
18
20
|
.min(1)
|
|
19
21
|
.optional()
|
|
20
|
-
.describe(
|
|
22
|
+
.describe(`Optional. Maximum number of lines to return starting from startLine (default: ${DEFAULT_FEED_ITEM_CONTENT_LINE_LIMIT}).`),
|
|
21
23
|
};
|
|
22
24
|
const handler = async ({ feedId, id, showLineNumber, startLine, limit }) => {
|
|
23
25
|
try {
|
|
@@ -39,7 +41,11 @@ export function getFeedItemContentToolConfig(agentId, registry, feedManager, sen
|
|
|
39
41
|
header.push(`[Enclosure URL: ${feedItem.enclosureUrl}]`);
|
|
40
42
|
}
|
|
41
43
|
const contentText = feedItem.content || feedItem.description;
|
|
42
|
-
const processedContent = processTextContent(contentText, {
|
|
44
|
+
const processedContent = processTextContent(contentText, {
|
|
45
|
+
showLineNumber,
|
|
46
|
+
startLine,
|
|
47
|
+
limit: limit ?? DEFAULT_FEED_ITEM_CONTENT_LINE_LIMIT,
|
|
48
|
+
});
|
|
43
49
|
return textToolResult(header.concat(processedContent.headerParts).concat(["", processedContent.text]));
|
|
44
50
|
}
|
|
45
51
|
catch (error) {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { getErrorToolResult, processTextContent, textToolResult } from "../tool-utils.js";
|
|
3
3
|
export const GET_GMAIL_MESSAGE_CONTENT_TOOL_NAME = "get_gmail_message_content";
|
|
4
|
+
/** Default cap on lines returned for a Gmail message body to avoid flooding the context with long emails. */
|
|
5
|
+
export const DEFAULT_GMAIL_MESSAGE_CONTENT_LINE_LIMIT = 100;
|
|
4
6
|
export function getGetGmailMessageContentToolConfig(googleClient) {
|
|
5
7
|
const inputSchema = {
|
|
6
8
|
messageId: z.string().describe("Gmail message ID (from list_gmail_messages or get_gmail_thread results)."),
|
|
@@ -14,13 +16,17 @@ export function getGetGmailMessageContentToolConfig(googleClient) {
|
|
|
14
16
|
.number()
|
|
15
17
|
.min(1)
|
|
16
18
|
.optional()
|
|
17
|
-
.describe(
|
|
19
|
+
.describe(`Optional. Maximum number of lines to return starting from startLine (default: ${DEFAULT_GMAIL_MESSAGE_CONTENT_LINE_LIMIT}).`),
|
|
18
20
|
};
|
|
19
21
|
const handler = async ({ messageId, showLineNumber, startLine, limit }) => {
|
|
20
22
|
try {
|
|
21
23
|
const message = await googleClient.getGmailMessage(messageId);
|
|
22
24
|
const rawContent = message.content ?? message.snippet ?? "(no body)";
|
|
23
|
-
const processed = processTextContent(rawContent, {
|
|
25
|
+
const processed = processTextContent(rawContent, {
|
|
26
|
+
showLineNumber,
|
|
27
|
+
startLine,
|
|
28
|
+
limit: limit ?? DEFAULT_GMAIL_MESSAGE_CONTENT_LINE_LIMIT,
|
|
29
|
+
});
|
|
24
30
|
return textToolResult([...processed.headerParts, "", processed.text]);
|
|
25
31
|
}
|
|
26
32
|
catch (error) {
|
package/dist/mcp/tool-utils.js
CHANGED
|
@@ -96,6 +96,9 @@ export function processTextContent(text, options) {
|
|
|
96
96
|
headerParts.push("Lines are prefixed with [LNNN] markers. These markers are NOT part of the line content.");
|
|
97
97
|
}
|
|
98
98
|
const hasRange = options.startLine !== undefined || options.limit !== undefined;
|
|
99
|
+
if (clampedEnd < totalLines) {
|
|
100
|
+
headerParts.push(`[More available: use startLine=${clampedEnd + 1} to continue]`);
|
|
101
|
+
}
|
|
99
102
|
headerParts.push(`--- CONTENT${hasRange ? ` (lines ${start + 1} - ${clampedEnd})` : ""} ---`);
|
|
100
103
|
const processedText = options.showLineNumber
|
|
101
104
|
? sliced.map((line, index) => `[L${start + index + 1}] ${line}`).join("\n")
|