@astroanywhere/agent 0.1.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/LICENSE +76 -0
- package/README.md +178 -0
- package/dist/cli.d.ts +15 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +401 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/index.d.ts +9 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +9 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/mcp.d.ts +16 -0
- package/dist/commands/mcp.d.ts.map +1 -0
- package/dist/commands/mcp.js +19 -0
- package/dist/commands/mcp.js.map +1 -0
- package/dist/commands/setup.d.ts +20 -0
- package/dist/commands/setup.d.ts.map +1 -0
- package/dist/commands/setup.js +585 -0
- package/dist/commands/setup.js.map +1 -0
- package/dist/commands/start.d.ts +16 -0
- package/dist/commands/start.d.ts.map +1 -0
- package/dist/commands/start.js +638 -0
- package/dist/commands/start.js.map +1 -0
- package/dist/commands/status.d.ts +5 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +63 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/stop.d.ts +5 -0
- package/dist/commands/stop.d.ts.map +1 -0
- package/dist/commands/stop.js +85 -0
- package/dist/commands/stop.js.map +1 -0
- package/dist/execution/direct-strategy.d.ts +18 -0
- package/dist/execution/direct-strategy.d.ts.map +1 -0
- package/dist/execution/direct-strategy.js +156 -0
- package/dist/execution/direct-strategy.js.map +1 -0
- package/dist/execution/docker-strategy.d.ts +26 -0
- package/dist/execution/docker-strategy.d.ts.map +1 -0
- package/dist/execution/docker-strategy.js +222 -0
- package/dist/execution/docker-strategy.js.map +1 -0
- package/dist/execution/index.d.ts +14 -0
- package/dist/execution/index.d.ts.map +1 -0
- package/dist/execution/index.js +13 -0
- package/dist/execution/index.js.map +1 -0
- package/dist/execution/kubernetes-exec-strategy.d.ts +23 -0
- package/dist/execution/kubernetes-exec-strategy.d.ts.map +1 -0
- package/dist/execution/kubernetes-exec-strategy.js +232 -0
- package/dist/execution/kubernetes-exec-strategy.js.map +1 -0
- package/dist/execution/registry.d.ts +41 -0
- package/dist/execution/registry.d.ts.map +1 -0
- package/dist/execution/registry.js +84 -0
- package/dist/execution/registry.js.map +1 -0
- package/dist/execution/slurm-strategy.d.ts +22 -0
- package/dist/execution/slurm-strategy.d.ts.map +1 -0
- package/dist/execution/slurm-strategy.js +219 -0
- package/dist/execution/slurm-strategy.js.map +1 -0
- package/dist/execution/types.d.ts +72 -0
- package/dist/execution/types.d.ts.map +1 -0
- package/dist/execution/types.js +10 -0
- package/dist/execution/types.js.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/api-client.d.ts +35 -0
- package/dist/lib/api-client.d.ts.map +1 -0
- package/dist/lib/api-client.js +126 -0
- package/dist/lib/api-client.js.map +1 -0
- package/dist/lib/config.d.ts +174 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +399 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/copy-worktree.d.ts +73 -0
- package/dist/lib/copy-worktree.d.ts.map +1 -0
- package/dist/lib/copy-worktree.js +374 -0
- package/dist/lib/copy-worktree.js.map +1 -0
- package/dist/lib/git-pr.d.ts +63 -0
- package/dist/lib/git-pr.d.ts.map +1 -0
- package/dist/lib/git-pr.js +224 -0
- package/dist/lib/git-pr.js.map +1 -0
- package/dist/lib/hardware-id.d.ts +25 -0
- package/dist/lib/hardware-id.d.ts.map +1 -0
- package/dist/lib/hardware-id.js +186 -0
- package/dist/lib/hardware-id.js.map +1 -0
- package/dist/lib/hpc-context.d.ts +35 -0
- package/dist/lib/hpc-context.d.ts.map +1 -0
- package/dist/lib/hpc-context.js +167 -0
- package/dist/lib/hpc-context.js.map +1 -0
- package/dist/lib/prompt-templates.d.ts +195 -0
- package/dist/lib/prompt-templates.d.ts.map +1 -0
- package/dist/lib/prompt-templates.js +353 -0
- package/dist/lib/prompt-templates.js.map +1 -0
- package/dist/lib/providers.d.ts +27 -0
- package/dist/lib/providers.d.ts.map +1 -0
- package/dist/lib/providers.js +372 -0
- package/dist/lib/providers.js.map +1 -0
- package/dist/lib/repo-context.d.ts +18 -0
- package/dist/lib/repo-context.d.ts.map +1 -0
- package/dist/lib/repo-context.js +61 -0
- package/dist/lib/repo-context.js.map +1 -0
- package/dist/lib/repo-utils.d.ts +35 -0
- package/dist/lib/repo-utils.d.ts.map +1 -0
- package/dist/lib/repo-utils.js +222 -0
- package/dist/lib/repo-utils.js.map +1 -0
- package/dist/lib/resources.d.ts +17 -0
- package/dist/lib/resources.d.ts.map +1 -0
- package/dist/lib/resources.js +227 -0
- package/dist/lib/resources.js.map +1 -0
- package/dist/lib/slurm-detect.d.ts +15 -0
- package/dist/lib/slurm-detect.d.ts.map +1 -0
- package/dist/lib/slurm-detect.js +148 -0
- package/dist/lib/slurm-detect.js.map +1 -0
- package/dist/lib/slurm-executor.d.ts +70 -0
- package/dist/lib/slurm-executor.d.ts.map +1 -0
- package/dist/lib/slurm-executor.js +402 -0
- package/dist/lib/slurm-executor.js.map +1 -0
- package/dist/lib/slurm-job-monitor.d.ts +52 -0
- package/dist/lib/slurm-job-monitor.d.ts.map +1 -0
- package/dist/lib/slurm-job-monitor.js +212 -0
- package/dist/lib/slurm-job-monitor.js.map +1 -0
- package/dist/lib/ssh-discovery.d.ts +17 -0
- package/dist/lib/ssh-discovery.d.ts.map +1 -0
- package/dist/lib/ssh-discovery.js +287 -0
- package/dist/lib/ssh-discovery.js.map +1 -0
- package/dist/lib/ssh-installer.d.ts +69 -0
- package/dist/lib/ssh-installer.d.ts.map +1 -0
- package/dist/lib/ssh-installer.js +230 -0
- package/dist/lib/ssh-installer.js.map +1 -0
- package/dist/lib/streaming-prompt.d.ts +48 -0
- package/dist/lib/streaming-prompt.d.ts.map +1 -0
- package/dist/lib/streaming-prompt.js +91 -0
- package/dist/lib/streaming-prompt.js.map +1 -0
- package/dist/lib/task-executor.d.ts +114 -0
- package/dist/lib/task-executor.d.ts.map +1 -0
- package/dist/lib/task-executor.js +753 -0
- package/dist/lib/task-executor.js.map +1 -0
- package/dist/lib/websocket-client.d.ts +200 -0
- package/dist/lib/websocket-client.d.ts.map +1 -0
- package/dist/lib/websocket-client.js +781 -0
- package/dist/lib/websocket-client.js.map +1 -0
- package/dist/lib/workdir-safety.d.ts +63 -0
- package/dist/lib/workdir-safety.d.ts.map +1 -0
- package/dist/lib/workdir-safety.js +247 -0
- package/dist/lib/workdir-safety.js.map +1 -0
- package/dist/lib/worktree-include.d.ts +14 -0
- package/dist/lib/worktree-include.d.ts.map +1 -0
- package/dist/lib/worktree-include.js +68 -0
- package/dist/lib/worktree-include.js.map +1 -0
- package/dist/lib/worktree-setup.d.ts +18 -0
- package/dist/lib/worktree-setup.d.ts.map +1 -0
- package/dist/lib/worktree-setup.js +60 -0
- package/dist/lib/worktree-setup.js.map +1 -0
- package/dist/lib/worktree.d.ts +37 -0
- package/dist/lib/worktree.d.ts.map +1 -0
- package/dist/lib/worktree.js +411 -0
- package/dist/lib/worktree.js.map +1 -0
- package/dist/mcp/index.d.ts +8 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +8 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/server.d.ts +45 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +153 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/session-bridge.d.ts +87 -0
- package/dist/mcp/session-bridge.d.ts.map +1 -0
- package/dist/mcp/session-bridge.js +317 -0
- package/dist/mcp/session-bridge.js.map +1 -0
- package/dist/mcp/tools.d.ts +70 -0
- package/dist/mcp/tools.d.ts.map +1 -0
- package/dist/mcp/tools.js +234 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/mcp/types.d.ts +197 -0
- package/dist/mcp/types.d.ts.map +1 -0
- package/dist/mcp/types.js +16 -0
- package/dist/mcp/types.js.map +1 -0
- package/dist/providers/base-adapter.d.ts +56 -0
- package/dist/providers/base-adapter.d.ts.map +1 -0
- package/dist/providers/base-adapter.js +5 -0
- package/dist/providers/base-adapter.js.map +1 -0
- package/dist/providers/claude-code-adapter.d.ts +27 -0
- package/dist/providers/claude-code-adapter.d.ts.map +1 -0
- package/dist/providers/claude-code-adapter.js +298 -0
- package/dist/providers/claude-code-adapter.js.map +1 -0
- package/dist/providers/claude-sdk-adapter.d.ts +60 -0
- package/dist/providers/claude-sdk-adapter.d.ts.map +1 -0
- package/dist/providers/claude-sdk-adapter.js +632 -0
- package/dist/providers/claude-sdk-adapter.js.map +1 -0
- package/dist/providers/codex-adapter.d.ts +21 -0
- package/dist/providers/codex-adapter.d.ts.map +1 -0
- package/dist/providers/codex-adapter.js +197 -0
- package/dist/providers/codex-adapter.js.map +1 -0
- package/dist/providers/index.d.ts +26 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/index.js +58 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/providers/slurm-adapter.d.ts +26 -0
- package/dist/providers/slurm-adapter.d.ts.map +1 -0
- package/dist/providers/slurm-adapter.js +146 -0
- package/dist/providers/slurm-adapter.js.map +1 -0
- package/dist/types.d.ts +592 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/package.json +77 -0
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prompt Templates for Agent Runner
|
|
3
|
+
*
|
|
4
|
+
* System prompts and schemas for plan generation, chat, task execution,
|
|
5
|
+
* and summarization. Copied from server/lib/prompt-templates.ts so
|
|
6
|
+
* the agent runner can operate standalone without server-provided prompts.
|
|
7
|
+
*/
|
|
8
|
+
export const PLAN_GRAPH_SCHEMA = {
|
|
9
|
+
type: "object",
|
|
10
|
+
properties: {
|
|
11
|
+
projectName: { type: "string", description: "A concise name for the project" },
|
|
12
|
+
nodes: {
|
|
13
|
+
type: "array",
|
|
14
|
+
items: {
|
|
15
|
+
type: "object",
|
|
16
|
+
properties: {
|
|
17
|
+
id: { type: "string", description: "Unique node ID (e.g. n1, n2)" },
|
|
18
|
+
type: { type: "string", enum: ["milestone", "task", "branch", "decision"] },
|
|
19
|
+
title: { type: "string", description: "Short title for the task/milestone" },
|
|
20
|
+
description: { type: "string", description: "Detailed description of what needs to be done" },
|
|
21
|
+
status: { type: "string", enum: ["planned"] },
|
|
22
|
+
parentId: { type: ["string", "null"] },
|
|
23
|
+
dependencies: { type: "array", items: { type: "string" }, description: "Array of node IDs this depends on" },
|
|
24
|
+
verification: { type: "string", enum: ["auto", "human"] },
|
|
25
|
+
position: {
|
|
26
|
+
type: "object",
|
|
27
|
+
properties: {
|
|
28
|
+
x: { type: "number" },
|
|
29
|
+
y: { type: "number" },
|
|
30
|
+
},
|
|
31
|
+
required: ["x", "y"],
|
|
32
|
+
},
|
|
33
|
+
startDate: { type: "string", description: "Start date in YYYY-MM-DD format. Only for milestones." },
|
|
34
|
+
endDate: { type: "string", description: "End date in YYYY-MM-DD format. Only for milestones." },
|
|
35
|
+
priority: { type: "string", enum: ["urgent", "high", "medium", "low", "none"], description: "Task priority. Default medium." },
|
|
36
|
+
estimate: { type: "string", enum: ["XS", "S", "M", "L", "XL"], description: "T-shirt effort estimate." },
|
|
37
|
+
dueDate: { type: "string", description: "Due date YYYY-MM-DD. Optional for tasks." },
|
|
38
|
+
milestoneId: { type: "string", description: "REQUIRED for tasks. Node ID of the milestone this task belongs to. Every task must reference a milestone." },
|
|
39
|
+
},
|
|
40
|
+
required: ["id", "type", "title", "description", "status", "parentId", "dependencies", "verification", "position"],
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
edges: {
|
|
44
|
+
type: "array",
|
|
45
|
+
items: {
|
|
46
|
+
type: "object",
|
|
47
|
+
properties: {
|
|
48
|
+
id: { type: "string" },
|
|
49
|
+
source: { type: "string" },
|
|
50
|
+
target: { type: "string" },
|
|
51
|
+
type: { type: "string", enum: ["dependency", "branch"] },
|
|
52
|
+
},
|
|
53
|
+
required: ["id", "source", "target", "type"],
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
required: ["projectName", "nodes", "edges"],
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Build the system prompt for plan generation.
|
|
61
|
+
*
|
|
62
|
+
* SECURITY NOTE: Vision documents and repository context are user-provided
|
|
63
|
+
* and could contain prompt injection attempts. We use delimiters to separate
|
|
64
|
+
* user content from instructions.
|
|
65
|
+
*/
|
|
66
|
+
export function buildPlanSystemPrompt(visionDoc, repoContext) {
|
|
67
|
+
const visionSection = visionDoc
|
|
68
|
+
? `\n\n## Project Vision Document\n<user_vision>\n${visionDoc}\n</user_vision>\n`
|
|
69
|
+
: "";
|
|
70
|
+
let repoSection = "";
|
|
71
|
+
if (repoContext) {
|
|
72
|
+
const parts = [];
|
|
73
|
+
if (repoContext.claudeMd) {
|
|
74
|
+
parts.push(`## CLAUDE.md (Project Instructions)\n<user_content>\n${repoContext.claudeMd}\n</user_content>`);
|
|
75
|
+
}
|
|
76
|
+
if (repoContext.readmeMd) {
|
|
77
|
+
parts.push(`## README.md\n<user_content>\n${repoContext.readmeMd}\n</user_content>`);
|
|
78
|
+
}
|
|
79
|
+
if (repoContext.packageInfo) {
|
|
80
|
+
parts.push(`## Package Metadata\n<user_content>\n${repoContext.packageInfo}\n</user_content>`);
|
|
81
|
+
}
|
|
82
|
+
if (repoContext.fileTreeSummary) {
|
|
83
|
+
parts.push(`## File Tree\n<user_content>\n${repoContext.fileTreeSummary}\n</user_content>`);
|
|
84
|
+
}
|
|
85
|
+
if (parts.length > 0) {
|
|
86
|
+
repoSection = '\n\n' + parts.join('\n\n') + '\n';
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
const hasRepo = repoSection.length > 0;
|
|
90
|
+
const outputInstructions = hasRepo
|
|
91
|
+
? `You are a project planning assistant with access to the repository. The key files and file tree are provided above.
|
|
92
|
+
You may use tools (Read, Glob, Grep) to explore the codebase for additional context before generating the plan.
|
|
93
|
+
When you are done exploring, output your final plan as a single JSON object.
|
|
94
|
+
Your FINAL message must contain ONLY the JSON object — no prose before or after.
|
|
95
|
+
|
|
96
|
+
You decompose the project into a directed acyclic graph of tasks and milestones.`
|
|
97
|
+
: `You are a JSON-only project planning API. You receive a project description and output ONLY a JSON object — no prose, no explanation, no markdown fences.
|
|
98
|
+
|
|
99
|
+
You decompose the project into a directed acyclic graph of tasks and milestones.`;
|
|
100
|
+
return `${outputInstructions}
|
|
101
|
+
${visionSection}${repoSection}
|
|
102
|
+
## Node rules
|
|
103
|
+
- Each node has a unique id: "n1", "n2", etc.
|
|
104
|
+
- type: "milestone" for checkpoints, "task" for work items, "decision" for human-judgment points.
|
|
105
|
+
- All status: "planned".
|
|
106
|
+
- verification: "auto" if programmatically verifiable, "human" otherwise.
|
|
107
|
+
- position: top-to-bottom layout starting at {x:40,y:40}, increment y by 100. Parallel branches offset x by 260.
|
|
108
|
+
- parentId: null for all nodes.
|
|
109
|
+
- dependencies: array of prerequisite node ids.
|
|
110
|
+
- Tasks do NOT have startDate or endDate — they are agent-solvable work items without time estimates.
|
|
111
|
+
- Milestones MUST have startDate and endDate (both equal, zero duration). Use ISO "YYYY-MM-DD" format. A milestone's date should be after all its dependencies.
|
|
112
|
+
- priority: "urgent" | "high" | "medium" | "low" | "none". Default "medium" for most tasks, "high" for critical path items.
|
|
113
|
+
- estimate: "XS" | "S" | "M" | "L" | "XL". T-shirt estimate for effort. Target each task at ~20 minutes of expert work time or <1000 lines of code changed. Tasks should be ≤ M.
|
|
114
|
+
- milestoneId: REQUIRED for tasks. Every task MUST have a milestoneId pointing to the milestone it contributes toward. This is how tasks are grouped under milestones in the UI.
|
|
115
|
+
|
|
116
|
+
## Edge rules
|
|
117
|
+
- type: "dependency" for sequential, "branch" for parallel paths from a common node.
|
|
118
|
+
|
|
119
|
+
## Constraints
|
|
120
|
+
- 6–15 nodes. Valid DAG (no cycles).
|
|
121
|
+
- Every task node MUST have a milestoneId set. Group related tasks under milestones.
|
|
122
|
+
- Output MUST be a single JSON object with keys: projectName (string), nodes (array), edges (array).
|
|
123
|
+
- Do NOT include any text before or after the JSON. Do NOT wrap in markdown code fences.
|
|
124
|
+
|
|
125
|
+
Example structure:
|
|
126
|
+
{"projectName":"...","nodes":[{"id":"n1","type":"task","title":"...","description":"...","status":"planned","parentId":null,"dependencies":[],"verification":"auto","position":{"x":40,"y":40},"priority":"medium","estimate":"M","milestoneId":"n2"},{"id":"n2","type":"milestone","title":"MVP Complete","description":"...","status":"planned","parentId":null,"dependencies":["n1"],"verification":"human","position":{"x":40,"y":140},"startDate":"2026-02-10","endDate":"2026-02-10"}],"edges":[{"id":"e1","source":"n1","target":"n2","type":"dependency"}]}`;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Build the system prompt for plan refinement chat.
|
|
130
|
+
*/
|
|
131
|
+
export function buildChatSystemPrompt(visionDoc, planNodes, planEdges) {
|
|
132
|
+
const visionSection = visionDoc
|
|
133
|
+
? `\n\n## Project Vision Document\n<user_vision>\n${visionDoc}\n</user_vision>\n`
|
|
134
|
+
: "";
|
|
135
|
+
let planSection = "";
|
|
136
|
+
if (planNodes && planNodes.length > 0) {
|
|
137
|
+
const milestoneMap = new Map();
|
|
138
|
+
for (const n of planNodes) {
|
|
139
|
+
if (n.type === "milestone")
|
|
140
|
+
milestoneMap.set(n.id, n.title);
|
|
141
|
+
}
|
|
142
|
+
const nodeNameMap = new Map();
|
|
143
|
+
for (const n of planNodes)
|
|
144
|
+
nodeNameMap.set(n.id, n.title);
|
|
145
|
+
const nodeList = planNodes.map((n) => {
|
|
146
|
+
const milestoneName = n.milestoneId ? milestoneMap.get(n.milestoneId) : undefined;
|
|
147
|
+
const deps = (n.dependencies ?? []).map((d) => `${nodeNameMap.get(d) ?? d} [${d}]`).join(", ");
|
|
148
|
+
const parts = [
|
|
149
|
+
`${n.type}, ${n.status}`,
|
|
150
|
+
n.priority ? `priority: ${n.priority}` : "",
|
|
151
|
+
n.estimate ? `estimate: ${n.estimate}` : "",
|
|
152
|
+
n.verification ? `verification: ${n.verification}` : "",
|
|
153
|
+
n.dueDate ? `due: ${n.dueDate}` : "",
|
|
154
|
+
milestoneName ? `milestone: ${milestoneName} [${n.milestoneId}]` : (n.type !== "milestone" ? "milestone: NONE" : ""),
|
|
155
|
+
deps ? `depends on: ${deps}` : "",
|
|
156
|
+
].filter(Boolean);
|
|
157
|
+
return `- **[${n.id}]** ${n.title} (${parts.join(", ")})\n ${n.description}`;
|
|
158
|
+
}).join("\n");
|
|
159
|
+
const milestoneList = planNodes
|
|
160
|
+
.filter((n) => n.type === "milestone")
|
|
161
|
+
.map((n) => ` - **[${n.id}]** ${n.title}`)
|
|
162
|
+
.join("\n");
|
|
163
|
+
const milestoneSection = milestoneList
|
|
164
|
+
? `\n\n## Available Milestones\n${milestoneList}\n`
|
|
165
|
+
: "";
|
|
166
|
+
let edgeSection = "";
|
|
167
|
+
if (planEdges && planEdges.length > 0) {
|
|
168
|
+
const edgeList = planEdges.map((e) => {
|
|
169
|
+
const srcName = nodeNameMap.get(e.source) ?? e.source;
|
|
170
|
+
const tgtName = nodeNameMap.get(e.target) ?? e.target;
|
|
171
|
+
return ` - ${srcName} [${e.source}] → ${tgtName} [${e.target}] (${e.type})`;
|
|
172
|
+
}).join("\n");
|
|
173
|
+
edgeSection = `\n\n## Current Edges (Dependencies)\n${edgeList}\n`;
|
|
174
|
+
}
|
|
175
|
+
planSection = `\n\n## Current Plan Nodes\n${nodeList}\n${milestoneSection}${edgeSection}`;
|
|
176
|
+
}
|
|
177
|
+
return `You are a project planning assistant for Astro. Help the user refine their project plan through conversation. You can modify any task property, manage dependencies/edges between nodes, and restructure the plan graph.
|
|
178
|
+
|
|
179
|
+
IMPORTANT: This is a conversational chat. Do NOT use any tools (bash, shell, file read/write, grep, ls, etc.). Do NOT attempt to run commands or access the filesystem. You have all the information you need in this prompt. Respond with plain text only.
|
|
180
|
+
|
|
181
|
+
Be concise and actionable.
|
|
182
|
+
${visionSection}${planSection}
|
|
183
|
+
## Modifying the Plan
|
|
184
|
+
|
|
185
|
+
When the user asks to update, modify, or change anything in the plan, you MUST:
|
|
186
|
+
1. Identify the relevant tasks/edges from the plan above.
|
|
187
|
+
2. Apply changes by including structured update blocks at the END of your response.
|
|
188
|
+
3. Explain what you changed conversationally BEFORE the update blocks.
|
|
189
|
+
|
|
190
|
+
### Updating Node Properties
|
|
191
|
+
|
|
192
|
+
Use a fenced code block with language \`astro-updates\` containing a JSON array:
|
|
193
|
+
|
|
194
|
+
\`\`\`astro-updates
|
|
195
|
+
[
|
|
196
|
+
{ "nodeId": "n1", "title": "New title", "priority": "high" }
|
|
197
|
+
]
|
|
198
|
+
\`\`\`
|
|
199
|
+
|
|
200
|
+
Each object must have "nodeId" (required) plus any fields to change:
|
|
201
|
+
- "title" (string) — node title
|
|
202
|
+
- "description" (string) — detailed description
|
|
203
|
+
- "type" (string) — "milestone" | "task" | "decision"
|
|
204
|
+
- "status" (string) — "planned" | "dispatched" | "in_progress" | "auto_verified" | "awaiting_judgment" | "completed" | "pruned"
|
|
205
|
+
- "priority" (string) — "urgent" | "high" | "medium" | "low" | "none"
|
|
206
|
+
- "estimate" (string) — "XS" | "S" | "M" | "L" | "XL"
|
|
207
|
+
- "milestoneId" (string) — ID of the milestone this task belongs to
|
|
208
|
+
- "dueDate" (string) — ISO YYYY-MM-DD or null to clear
|
|
209
|
+
- "startDate" (string) — ISO YYYY-MM-DD (milestones only) or null to clear
|
|
210
|
+
- "endDate" (string) — ISO YYYY-MM-DD (milestones only) or null to clear
|
|
211
|
+
- "verification" (string) — "auto" | "human"
|
|
212
|
+
- "dependencies" (string[]) — array of node IDs this node depends on (replaces the full list; edges are auto-reconciled)
|
|
213
|
+
|
|
214
|
+
### Adding or Removing Edges
|
|
215
|
+
|
|
216
|
+
Use a fenced code block with language \`astro-edges\` containing a JSON array:
|
|
217
|
+
|
|
218
|
+
\`\`\`astro-edges
|
|
219
|
+
[
|
|
220
|
+
{ "action": "add", "source": "n1", "target": "n3", "type": "dependency" },
|
|
221
|
+
{ "action": "remove", "source": "n2", "target": "n3" }
|
|
222
|
+
]
|
|
223
|
+
\`\`\`
|
|
224
|
+
|
|
225
|
+
Edge fields:
|
|
226
|
+
- "action" (required) — "add" or "remove"
|
|
227
|
+
- "source" (required) — source node ID
|
|
228
|
+
- "target" (required) — target node ID
|
|
229
|
+
- "type" (for add) — "dependency" or "branch". Defaults to "dependency".
|
|
230
|
+
|
|
231
|
+
### Decomposing / Exploding a Task into Sub-tasks
|
|
232
|
+
|
|
233
|
+
When the user asks to decompose, explode, or break down a task, use a fenced code block with language \`astro-add-nodes\`:
|
|
234
|
+
|
|
235
|
+
\`\`\`astro-add-nodes
|
|
236
|
+
[
|
|
237
|
+
{ "id": "sub1", "title": "Sub-task 1", "description": "...", "milestoneId": "m1", "dependencies": ["parent_id"], "priority": "medium", "estimate": "S" },
|
|
238
|
+
{ "id": "sub2", "title": "Sub-task 2", "description": "...", "milestoneId": "m1", "dependencies": ["sub1"], "priority": "medium", "estimate": "S" }
|
|
239
|
+
]
|
|
240
|
+
\`\`\`
|
|
241
|
+
|
|
242
|
+
Fields:
|
|
243
|
+
- "id" (string, optional) — temporary ID for referencing between new nodes in the same block
|
|
244
|
+
- "title" (required) — task title
|
|
245
|
+
- "description" (required) — detailed description of what needs to be done
|
|
246
|
+
- "type" (string) — defaults to "task"
|
|
247
|
+
- "milestoneId" (string) — inherit from the parent task being decomposed
|
|
248
|
+
- "dependencies" (string[]) — can reference other new node IDs from the same block, or existing node IDs
|
|
249
|
+
- "priority", "estimate", "verification" — same as node properties
|
|
250
|
+
|
|
251
|
+
When decomposing, also use \`astro-updates\` to mark the original task as "completed" or "pruned" (since it's been replaced by sub-tasks), and use \`astro-edges\` if the sub-tasks need to connect to other existing nodes.
|
|
252
|
+
|
|
253
|
+
Decomposition rules:
|
|
254
|
+
- Prioritize orthogonal sub-tasks that can be independently verified — each sub-task should touch a distinct area of the codebase or concern so that one failing does not block or invalidate the others.
|
|
255
|
+
- Target each sub-task at roughly 20 minutes of expert work time, or < 1000 lines of code expected. Use estimate "XS" (~5 min / <100 LOC), "S" (~15 min / <500 LOC), or "M" (~30 min / <1000 LOC). Never larger than "M".
|
|
256
|
+
- Preserve the original task's milestone assignment
|
|
257
|
+
- Wire dependencies so sub-tasks form a clear sequence or parallel branches; prefer parallel branches when sub-tasks are truly independent
|
|
258
|
+
|
|
259
|
+
### Rules
|
|
260
|
+
- Only include fields that should change. Omit unchanged fields.
|
|
261
|
+
- You can combine \`astro-updates\`, \`astro-edges\`, and \`astro-add-nodes\` in the same response.
|
|
262
|
+
- Do NOT include update blocks if no changes are needed.
|
|
263
|
+
- ALWAYS include update blocks when the user asks to change something — never just describe what to do manually.
|
|
264
|
+
- When modifying dependencies via "dependencies" in astro-updates, edges are automatically synchronized. Alternatively use astro-edges for individual add/remove.`;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Build the system prompt for task-level chat.
|
|
268
|
+
*/
|
|
269
|
+
export function buildTaskChatSystemPrompt(context) {
|
|
270
|
+
const parts = [];
|
|
271
|
+
parts.push(`You are a task-focused AI assistant for Astro. You help users understand, analyze, and refine individual tasks within their project plan.
|
|
272
|
+
|
|
273
|
+
You have context about the current task and can help with:
|
|
274
|
+
- Explaining agent reasoning and approach
|
|
275
|
+
- Evaluating task output and results
|
|
276
|
+
- Suggesting task modifications or refinements
|
|
277
|
+
- Answering questions about the task
|
|
278
|
+
|
|
279
|
+
Be concise and helpful. Focus on the specific task at hand.`);
|
|
280
|
+
if (context.visionDoc) {
|
|
281
|
+
parts.push(`## Project Vision\n\n<user_vision>\n${context.visionDoc}\n</user_vision>`);
|
|
282
|
+
}
|
|
283
|
+
parts.push(`## Current Task\n\n<user_task>\n**${context.taskTitle}**\n\n${context.taskDescription}\n</user_task>`);
|
|
284
|
+
if (context.taskOutput) {
|
|
285
|
+
const truncatedOutput = context.taskOutput.length > 10000
|
|
286
|
+
? context.taskOutput.slice(0, 10000) + '\n\n[... output truncated ...]'
|
|
287
|
+
: context.taskOutput;
|
|
288
|
+
parts.push(`## Task Output (Agent Execution Results)\n\n<agent_output>\n${truncatedOutput}\n</agent_output>`);
|
|
289
|
+
}
|
|
290
|
+
return parts.join('\n\n---\n\n');
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Build the execution prompt for task dispatch.
|
|
294
|
+
*/
|
|
295
|
+
export function buildTaskExecutionPrompt(context) {
|
|
296
|
+
const parts = [];
|
|
297
|
+
if (context.visionDoc) {
|
|
298
|
+
parts.push(`## Project Vision\n\n<user_vision>\n${context.visionDoc}\n</user_vision>`);
|
|
299
|
+
}
|
|
300
|
+
if (context.dependencyOutputs) {
|
|
301
|
+
parts.push(`## Previous Task Outputs\n\nThe following tasks have already been completed. Use their outputs as context:\n\n<dependency_outputs>\n${context.dependencyOutputs}\n</dependency_outputs>`);
|
|
302
|
+
}
|
|
303
|
+
if (context.workingDirectory) {
|
|
304
|
+
parts.push(`## Working Directory\n\n${context.workingDirectory}`);
|
|
305
|
+
}
|
|
306
|
+
if (context.originalProjectDirectory) {
|
|
307
|
+
parts.push(`## Data Access\n\nYour working directory is a git worktree (isolated branch) inside .astro-tasks/ in the project.\nThe original project directory is: ${context.originalProjectDirectory}\nLarge untracked files (training data, model caches, datasets) remain in the original directory. Use absolute paths to reference them. Always use absolute paths when writing code that accesses data files.`);
|
|
308
|
+
}
|
|
309
|
+
parts.push(`## Current Task\n\n<user_task>\n**${context.taskTitle}**\n\n${context.taskDescription}\n</user_task>`);
|
|
310
|
+
parts.push(`## Instructions
|
|
311
|
+
|
|
312
|
+
Execute the task described above. Focus on completing the task thoroughly and correctly.
|
|
313
|
+
- Use appropriate tools to accomplish the task
|
|
314
|
+
- Report progress and any issues encountered
|
|
315
|
+
- Verify your work when possible
|
|
316
|
+
- Be thorough but efficient`);
|
|
317
|
+
return parts.join('\n\n---\n\n');
|
|
318
|
+
}
|
|
319
|
+
/**
|
|
320
|
+
* Build a prompt for summarizing execution results.
|
|
321
|
+
* Single-turn, no tools, returns structured JSON.
|
|
322
|
+
*/
|
|
323
|
+
export function buildSummaryPrompt(context) {
|
|
324
|
+
const maxLen = 15000;
|
|
325
|
+
const output = context.executionOutput.length > maxLen
|
|
326
|
+
? '...\n' + context.executionOutput.slice(-maxLen)
|
|
327
|
+
: context.executionOutput;
|
|
328
|
+
const fileList = context.fileChanges.length > 0
|
|
329
|
+
? context.fileChanges.map((f) => `- ${f.action}: ${f.path}`).join('\n')
|
|
330
|
+
: 'No file changes recorded.';
|
|
331
|
+
return `You are a task execution summarizer. Analyze the following task execution and produce a structured JSON summary.
|
|
332
|
+
|
|
333
|
+
## Task
|
|
334
|
+
**${context.taskTitle}**
|
|
335
|
+
${context.taskDescription}
|
|
336
|
+
|
|
337
|
+
## Execution Output (last ${Math.min(context.executionOutput.length, maxLen)} chars)
|
|
338
|
+
${output}
|
|
339
|
+
|
|
340
|
+
## Files Changed
|
|
341
|
+
${fileList}
|
|
342
|
+
|
|
343
|
+
## Execution Status: ${context.status}
|
|
344
|
+
|
|
345
|
+
Respond with ONLY a JSON object in this exact format (no markdown fences, no extra text):
|
|
346
|
+
{
|
|
347
|
+
"workCompleted": "1-2 sentence summary of what was accomplished",
|
|
348
|
+
"filesChanged": ["list", "of", "changed", "file", "paths"],
|
|
349
|
+
"status": "${context.status === 'success' ? 'success' : 'failure'}",
|
|
350
|
+
"followUps": ["suggested follow-up task if any"]
|
|
351
|
+
}`;
|
|
352
|
+
}
|
|
353
|
+
//# sourceMappingURL=prompt-templates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-templates.js","sourceRoot":"","sources":["../../src/lib/prompt-templates.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,CAAC,MAAM,iBAAiB,GAAG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;;;;;4BAMe,CAAC,CAAA;IAE3B,OAAO,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;AAClC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAMlC;IACC,MAAM,MAAM,GAAG,KAAK,CAAA;IACpB,MAAM,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,MAAM,GAAG,MAAM;QACpD,CAAC,CAAC,OAAO,GAAG,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC;QAClD,CAAC,CAAC,OAAO,CAAC,eAAe,CAAA;IAE3B,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC;QAC7C,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QACvE,CAAC,CAAC,2BAA2B,CAAA;IAE/B,OAAO;;;IAGL,OAAO,CAAC,SAAS;EACnB,OAAO,CAAC,eAAe;;4BAEG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC;EAC1E,MAAM;;;EAGN,QAAQ;;uBAEa,OAAO,CAAC,MAAM;;;;;;eAMtB,OAAO,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;;EAEjE,CAAA;AACF,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent provider detection and management
|
|
3
|
+
*/
|
|
4
|
+
import type { ProviderInfo, ProviderType } from '../types.js';
|
|
5
|
+
/**
|
|
6
|
+
* Detect all available providers on the system.
|
|
7
|
+
* Slurm is no longer a standalone provider — when detected, it annotates
|
|
8
|
+
* the Claude provider with hpcCapability metadata instead.
|
|
9
|
+
*/
|
|
10
|
+
export declare function detectProviders(): Promise<ProviderInfo[]>;
|
|
11
|
+
/**
|
|
12
|
+
* Get a specific provider by type
|
|
13
|
+
*/
|
|
14
|
+
export declare function getProvider(type: ProviderType): Promise<ProviderInfo | null>;
|
|
15
|
+
/**
|
|
16
|
+
* Check if a specific provider is available
|
|
17
|
+
*/
|
|
18
|
+
export declare function isProviderAvailable(type: ProviderType): Promise<boolean>;
|
|
19
|
+
/**
|
|
20
|
+
* Format provider info for display
|
|
21
|
+
*/
|
|
22
|
+
export declare function formatProviderInfo(provider: ProviderInfo): string;
|
|
23
|
+
/**
|
|
24
|
+
* Format all providers summary
|
|
25
|
+
*/
|
|
26
|
+
export declare function formatProvidersSummary(providers: ProviderInfo[]): string;
|
|
27
|
+
//# sourceMappingURL=providers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../src/lib/providers.ts"],"names":[],"mappings":"AAAA;;GAEG;AAOH,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAuC,MAAM,aAAa,CAAC;AAsUnG;;;;GAIG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC,CAkC/D;AAED;;GAEG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAGlF;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,CAG9E;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,YAAY,GAAG,MAAM,CAIjE;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,YAAY,EAAE,GAAG,MAAM,CAaxE"}
|