annotask 0.0.4 → 0.0.6
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 +11 -1
- package/dist/{chunk-JPNMDGZN.js → chunk-4IZECCVO.js} +2 -2
- package/dist/{chunk-JLOSPIJ4.js → chunk-KB74TUGE.js} +68 -15
- package/dist/chunk-KB74TUGE.js.map +1 -0
- package/dist/{chunk-O73PGHAA.js → chunk-YZ7UIZNB.js} +37 -1
- package/dist/{chunk-O73PGHAA.js.map → chunk-YZ7UIZNB.js.map} +1 -1
- package/dist/cli.js +82 -0
- package/dist/index.js +2 -2
- package/dist/server.d.ts +1 -0
- package/dist/server.js +1 -1
- package/dist/shell/assets/index-Dko9s8T0.js +59 -0
- package/dist/shell/assets/index-En0AXNAK.css +1 -0
- package/dist/shell/index.html +2 -2
- package/dist/standalone.js +2 -2
- package/dist/webpack.js +3 -3
- package/package.json +1 -1
- package/skills/annotask-apply/SKILL.md +27 -31
- package/skills/annotask-init/SKILL.md +42 -6
- package/skills/annotask-watch/SKILL.md +9 -7
- package/dist/chunk-JLOSPIJ4.js.map +0 -1
- package/dist/shell/assets/index-2wHGkDAz.css +0 -1
- package/dist/shell/assets/index-DuKNjQaz.js +0 -59
- /package/dist/{chunk-JPNMDGZN.js.map → chunk-4IZECCVO.js.map} +0 -0
package/dist/cli.js
CHANGED
|
@@ -46,6 +46,12 @@ if (command === "watch") {
|
|
|
46
46
|
checkStatus();
|
|
47
47
|
} else if (command === "init-skills") {
|
|
48
48
|
initSkills();
|
|
49
|
+
} else if (command === "screenshot") {
|
|
50
|
+
fetchScreenshot();
|
|
51
|
+
} else if (command === "tasks") {
|
|
52
|
+
fetchTasks();
|
|
53
|
+
} else if (command === "update-task") {
|
|
54
|
+
updateTask();
|
|
49
55
|
} else if (command === "help" || command === "--help") {
|
|
50
56
|
printHelp();
|
|
51
57
|
} else {
|
|
@@ -150,6 +156,82 @@ async function checkStatus() {
|
|
|
150
156
|
process.exit(1);
|
|
151
157
|
}
|
|
152
158
|
}
|
|
159
|
+
async function fetchScreenshot() {
|
|
160
|
+
const taskId = args[1];
|
|
161
|
+
if (!taskId) {
|
|
162
|
+
console.error("\x1B[31m[Annotask]\x1B[0m Usage: annotask screenshot <task-id> [--output=path.png]");
|
|
163
|
+
process.exit(1);
|
|
164
|
+
}
|
|
165
|
+
try {
|
|
166
|
+
const tasksRes = await fetch(`${apiUrl}/tasks`);
|
|
167
|
+
const tasksData = await tasksRes.json();
|
|
168
|
+
const task = tasksData.tasks.find((t) => t.id === taskId);
|
|
169
|
+
if (!task) {
|
|
170
|
+
console.error(`\x1B[31m[Annotask]\x1B[0m Task not found: ${taskId}`);
|
|
171
|
+
process.exit(1);
|
|
172
|
+
}
|
|
173
|
+
if (!task.screenshot) {
|
|
174
|
+
console.error(`\x1B[31m[Annotask]\x1B[0m Task has no screenshot`);
|
|
175
|
+
process.exit(1);
|
|
176
|
+
}
|
|
177
|
+
const screenshotUrl = `${baseUrl}/__annotask/screenshots/${task.screenshot}`;
|
|
178
|
+
const res = await fetch(screenshotUrl);
|
|
179
|
+
if (!res.ok) {
|
|
180
|
+
console.error(`\x1B[31m[Annotask]\x1B[0m Screenshot not found: ${task.screenshot}`);
|
|
181
|
+
process.exit(1);
|
|
182
|
+
}
|
|
183
|
+
const buffer = Buffer.from(await res.arrayBuffer());
|
|
184
|
+
const outputArg = args.find((a) => a.startsWith("--output="));
|
|
185
|
+
const outputPath = outputArg ? outputArg.split("=")[1] : resolve(".annotask", "screenshots", task.screenshot);
|
|
186
|
+
const dir = dirname(outputPath);
|
|
187
|
+
if (!existsSync(dir)) mkdirSync(dir, { recursive: true });
|
|
188
|
+
const { writeFileSync } = await import("fs");
|
|
189
|
+
writeFileSync(outputPath, buffer);
|
|
190
|
+
console.log(`\x1B[32m[Annotask]\x1B[0m Screenshot saved to ${outputPath}`);
|
|
191
|
+
} catch (err) {
|
|
192
|
+
console.error(`\x1B[31m[Annotask]\x1B[0m Failed to fetch screenshot: ${err.message}`);
|
|
193
|
+
process.exit(1);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
async function fetchTasks() {
|
|
197
|
+
try {
|
|
198
|
+
const tasksUrl = mfeFilter ? `${apiUrl}/tasks?mfe=${encodeURIComponent(mfeFilter)}` : `${apiUrl}/tasks`;
|
|
199
|
+
const res = await fetch(tasksUrl);
|
|
200
|
+
const data = await res.json();
|
|
201
|
+
console.log(JSON.stringify(data, null, 2));
|
|
202
|
+
} catch (err) {
|
|
203
|
+
console.error(`\x1B[31m[Annotask]\x1B[0m Failed to fetch tasks: ${err.message}`);
|
|
204
|
+
process.exit(1);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
async function updateTask() {
|
|
208
|
+
const taskId = args[1];
|
|
209
|
+
const statusArg = args.find((a) => a.startsWith("--status="))?.split("=")[1];
|
|
210
|
+
const feedbackArg = args.find((a) => a.startsWith("--feedback="))?.split("=")[1];
|
|
211
|
+
if (!taskId || !statusArg) {
|
|
212
|
+
console.error("\x1B[31m[Annotask]\x1B[0m Usage: annotask update-task <task-id> --status=<status> [--feedback=<text>]");
|
|
213
|
+
console.error(" Valid statuses: pending, applied, review, accepted, denied");
|
|
214
|
+
process.exit(1);
|
|
215
|
+
}
|
|
216
|
+
try {
|
|
217
|
+
const body = { status: statusArg };
|
|
218
|
+
if (feedbackArg) body.feedback = feedbackArg;
|
|
219
|
+
const res = await fetch(`${apiUrl}/tasks/${taskId}`, {
|
|
220
|
+
method: "PATCH",
|
|
221
|
+
headers: { "Content-Type": "application/json" },
|
|
222
|
+
body: JSON.stringify(body)
|
|
223
|
+
});
|
|
224
|
+
const data = await res.json();
|
|
225
|
+
if (data.error) {
|
|
226
|
+
console.error(`\x1B[31m[Annotask]\x1B[0m ${data.error}`);
|
|
227
|
+
process.exit(1);
|
|
228
|
+
}
|
|
229
|
+
console.log(JSON.stringify(data, null, 2));
|
|
230
|
+
} catch (err) {
|
|
231
|
+
console.error(`\x1B[31m[Annotask]\x1B[0m Failed to update task: ${err.message}`);
|
|
232
|
+
process.exit(1);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
153
235
|
function initSkills() {
|
|
154
236
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
155
237
|
const srcSkills = resolve(__dirname, "..", "skills");
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
bridgeClientScript
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YZ7UIZNB.js";
|
|
4
4
|
import {
|
|
5
5
|
writeMfeServerInfo,
|
|
6
6
|
writeServerInfo
|
|
7
7
|
} from "./chunk-XLNGAH3S.js";
|
|
8
8
|
import {
|
|
9
9
|
createAnnotaskServer
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-KB74TUGE.js";
|
|
11
11
|
import {
|
|
12
12
|
transformFile,
|
|
13
13
|
transformHTML
|
package/dist/server.d.ts
CHANGED