@alook/cli 0.0.45 → 0.0.46
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/index.js +37 -26
- package/dist/session-runner.js +27 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -14861,9 +14861,18 @@ var UpdateIssueRequestSchema = exports_external.object({
|
|
|
14861
14861
|
description: exports_external.string().max(20000).optional(),
|
|
14862
14862
|
status: IssueStatusSchema.optional()
|
|
14863
14863
|
}).refine((v) => v.title !== undefined || v.description !== undefined || v.status !== undefined, { message: "at least one field is required" });
|
|
14864
|
-
var
|
|
14864
|
+
var CreateIssueCommentBodySchema = exports_external.object({
|
|
14865
14865
|
content: exports_external.string().min(1, "content is required").max(20000)
|
|
14866
14866
|
});
|
|
14867
|
+
var IssueCommentApiSchema = exports_external.object({
|
|
14868
|
+
id: exports_external.string(),
|
|
14869
|
+
issue_id: exports_external.string(),
|
|
14870
|
+
workspace_id: exports_external.string(),
|
|
14871
|
+
author_type: exports_external.enum(["user", "agent"]),
|
|
14872
|
+
author_id: exports_external.string(),
|
|
14873
|
+
content: exports_external.string(),
|
|
14874
|
+
created_at: exports_external.string()
|
|
14875
|
+
});
|
|
14867
14876
|
var IssueApiSchema = exports_external.object({
|
|
14868
14877
|
id: exports_external.string(),
|
|
14869
14878
|
workspace_id: exports_external.string(),
|
|
@@ -16685,6 +16694,18 @@ var issue2 = sqliteTable("issue", {
|
|
|
16685
16694
|
foreignColumns: [agent.id, agent.workspaceId]
|
|
16686
16695
|
}).onDelete("cascade")
|
|
16687
16696
|
]);
|
|
16697
|
+
var issueComment = sqliteTable("issue_comment", {
|
|
16698
|
+
id: text("id").primaryKey().$defaultFn(() => "ic_" + nanoid3()),
|
|
16699
|
+
issueId: text("issue_id").notNull().references(() => issue2.id, { onDelete: "cascade" }),
|
|
16700
|
+
workspaceId: text("workspace_id").notNull().references(() => workspace.id, { onDelete: "cascade" }),
|
|
16701
|
+
authorType: text("author_type").notNull().default("user"),
|
|
16702
|
+
authorId: text("author_id").notNull(),
|
|
16703
|
+
content: text("content").notNull(),
|
|
16704
|
+
createdAt: text("created_at").notNull().$defaultFn(() => new Date().toISOString())
|
|
16705
|
+
}, (t) => [
|
|
16706
|
+
index("idx_issue_comment_issue").on(t.issueId, t.createdAt),
|
|
16707
|
+
index("idx_issue_comment_workspace").on(t.workspaceId, t.issueId)
|
|
16708
|
+
]);
|
|
16688
16709
|
var taskMessage = sqliteTable("task_message", {
|
|
16689
16710
|
id: text("id").primaryKey().$defaultFn(() => nanoid3()),
|
|
16690
16711
|
taskId: text("task_id").notNull().references(() => agentTaskQueue.id, { onDelete: "cascade" }),
|
|
@@ -19240,7 +19261,7 @@ function readBody(opts) {
|
|
|
19240
19261
|
function printIssue(issue3) {
|
|
19241
19262
|
console.log(`${issue3.id} ${issue3.status.padEnd(11)} ${issue3.title}`);
|
|
19242
19263
|
}
|
|
19243
|
-
function printIssueDetail(issue3, messages) {
|
|
19264
|
+
function printIssueDetail(issue3, messages, comments) {
|
|
19244
19265
|
console.log(`id: ${issue3.id}`);
|
|
19245
19266
|
console.log(`agent_id: ${issue3.agent_id}`);
|
|
19246
19267
|
console.log(`status: ${issue3.status}`);
|
|
@@ -19250,11 +19271,19 @@ function printIssueDetail(issue3, messages) {
|
|
|
19250
19271
|
console.log(`title: ${issue3.title}`);
|
|
19251
19272
|
console.log("description:");
|
|
19252
19273
|
console.log(issue3.description || "(no description)");
|
|
19253
|
-
|
|
19274
|
+
const events = messages?.filter((m) => m.role === "event") ?? [];
|
|
19275
|
+
if (events.length > 0) {
|
|
19254
19276
|
console.log(`
|
|
19255
|
-
|
|
19256
|
-
for (const m of
|
|
19257
|
-
console.log(`[${m.
|
|
19277
|
+
events:`);
|
|
19278
|
+
for (const m of events) {
|
|
19279
|
+
console.log(` [${m.created_at}] ${m.content}`);
|
|
19280
|
+
}
|
|
19281
|
+
}
|
|
19282
|
+
if (comments && comments.length > 0) {
|
|
19283
|
+
console.log(`
|
|
19284
|
+
comments:`);
|
|
19285
|
+
for (const c of comments) {
|
|
19286
|
+
console.log(` [${c.created_at}] (${c.author_type}) ${c.content}`);
|
|
19258
19287
|
}
|
|
19259
19288
|
}
|
|
19260
19289
|
}
|
|
@@ -19305,24 +19334,6 @@ function issueCommand() {
|
|
|
19305
19334
|
process.exit(1);
|
|
19306
19335
|
}
|
|
19307
19336
|
});
|
|
19308
|
-
cmd.command("pull").description("Show the next active issue for an agent").requiredOption("--agent_id <id>", "Agent ID").option("--json", "Output as JSON").action(async (opts, command) => {
|
|
19309
|
-
const { serverUrl, token, workspaceId } = resolveClientOpts3(command, opts.agent_id);
|
|
19310
|
-
const client = new APIClient(serverUrl, token, workspaceId);
|
|
19311
|
-
try {
|
|
19312
|
-
const issues = await client.getJSON(`/api/issues?agentId=${encodeURIComponent(opts.agent_id)}&terminal=false`);
|
|
19313
|
-
const issue3 = issues[0] ?? null;
|
|
19314
|
-
if (opts.json)
|
|
19315
|
-
return printJSON(issue3);
|
|
19316
|
-
if (!issue3) {
|
|
19317
|
-
console.log("No active issues.");
|
|
19318
|
-
return;
|
|
19319
|
-
}
|
|
19320
|
-
printIssueDetail(issue3);
|
|
19321
|
-
} catch (err) {
|
|
19322
|
-
console.error(`Error: ${err instanceof Error ? err.message : err}`);
|
|
19323
|
-
process.exit(1);
|
|
19324
|
-
}
|
|
19325
|
-
});
|
|
19326
19337
|
cmd.command("show").description("Show issue details and conversation").requiredOption("--agent_id <id>", "Agent ID").requiredOption("--issue_id <id>", "Issue ID").option("--json", "Output as JSON").action(async (opts, command) => {
|
|
19327
19338
|
const { serverUrl, token, workspaceId } = resolveClientOpts3(command, opts.agent_id);
|
|
19328
19339
|
const client = new APIClient(serverUrl, token, workspaceId);
|
|
@@ -19334,7 +19345,7 @@ function issueCommand() {
|
|
|
19334
19345
|
}
|
|
19335
19346
|
if (opts.json)
|
|
19336
19347
|
return printJSON(res);
|
|
19337
|
-
printIssueDetail(res.issue, res.messages);
|
|
19348
|
+
printIssueDetail(res.issue, res.messages, res.comments);
|
|
19338
19349
|
} catch (err) {
|
|
19339
19350
|
console.error(`Error: ${err instanceof Error ? err.message : err}`);
|
|
19340
19351
|
process.exit(1);
|
|
@@ -19378,7 +19389,7 @@ function issueCommand() {
|
|
|
19378
19389
|
const { serverUrl, token, workspaceId } = resolveClientOpts3(command, opts.agent_id);
|
|
19379
19390
|
const client = new APIClient(serverUrl, token, workspaceId);
|
|
19380
19391
|
try {
|
|
19381
|
-
const res = await client.postJSON(`/api/issues/${opts.issue_id}?agentId=${encodeURIComponent(opts.agent_id)}`, { content });
|
|
19392
|
+
const res = await client.postJSON(`/api/issues/${opts.issue_id}/comments?agentId=${encodeURIComponent(opts.agent_id)}`, { content });
|
|
19382
19393
|
if (opts.json)
|
|
19383
19394
|
return printJSON(res);
|
|
19384
19395
|
console.log(`Commented on ${opts.issue_id}`);
|
package/dist/session-runner.js
CHANGED
|
@@ -14578,9 +14578,18 @@ var UpdateIssueRequestSchema = exports_external.object({
|
|
|
14578
14578
|
description: exports_external.string().max(20000).optional(),
|
|
14579
14579
|
status: IssueStatusSchema.optional()
|
|
14580
14580
|
}).refine((v) => v.title !== undefined || v.description !== undefined || v.status !== undefined, { message: "at least one field is required" });
|
|
14581
|
-
var
|
|
14581
|
+
var CreateIssueCommentBodySchema = exports_external.object({
|
|
14582
14582
|
content: exports_external.string().min(1, "content is required").max(20000)
|
|
14583
14583
|
});
|
|
14584
|
+
var IssueCommentApiSchema = exports_external.object({
|
|
14585
|
+
id: exports_external.string(),
|
|
14586
|
+
issue_id: exports_external.string(),
|
|
14587
|
+
workspace_id: exports_external.string(),
|
|
14588
|
+
author_type: exports_external.enum(["user", "agent"]),
|
|
14589
|
+
author_id: exports_external.string(),
|
|
14590
|
+
content: exports_external.string(),
|
|
14591
|
+
created_at: exports_external.string()
|
|
14592
|
+
});
|
|
14584
14593
|
var IssueApiSchema = exports_external.object({
|
|
14585
14594
|
id: exports_external.string(),
|
|
14586
14595
|
workspace_id: exports_external.string(),
|
|
@@ -16402,6 +16411,18 @@ var issue2 = sqliteTable("issue", {
|
|
|
16402
16411
|
foreignColumns: [agent.id, agent.workspaceId]
|
|
16403
16412
|
}).onDelete("cascade")
|
|
16404
16413
|
]);
|
|
16414
|
+
var issueComment = sqliteTable("issue_comment", {
|
|
16415
|
+
id: text("id").primaryKey().$defaultFn(() => "ic_" + nanoid3()),
|
|
16416
|
+
issueId: text("issue_id").notNull().references(() => issue2.id, { onDelete: "cascade" }),
|
|
16417
|
+
workspaceId: text("workspace_id").notNull().references(() => workspace.id, { onDelete: "cascade" }),
|
|
16418
|
+
authorType: text("author_type").notNull().default("user"),
|
|
16419
|
+
authorId: text("author_id").notNull(),
|
|
16420
|
+
content: text("content").notNull(),
|
|
16421
|
+
createdAt: text("created_at").notNull().$defaultFn(() => new Date().toISOString())
|
|
16422
|
+
}, (t) => [
|
|
16423
|
+
index("idx_issue_comment_issue").on(t.issueId, t.createdAt),
|
|
16424
|
+
index("idx_issue_comment_workspace").on(t.workspaceId, t.issueId)
|
|
16425
|
+
]);
|
|
16405
16426
|
var taskMessage = sqliteTable("task_message", {
|
|
16406
16427
|
id: text("id").primaryKey().$defaultFn(() => nanoid3()),
|
|
16407
16428
|
taskId: text("task_id").notNull().references(() => agentTaskQueue.id, { onDelete: "cascade" }),
|
|
@@ -18332,7 +18353,7 @@ function clearKillIntent(baseDir, taskId) {
|
|
|
18332
18353
|
// daemon/prompt.ts
|
|
18333
18354
|
var DM_RESPONSE_NOTICE = "IMPORTANT: Only your final text response is visible to the user." + " Tool calls, intermediate reasoning, and mid-process outputs are NOT displayed." + " Put all key information, answers, and conclusions in your final response — that is the only thing the user will read.";
|
|
18334
18355
|
var EMAIL_NOTICE = "This task was triggered automatically by an incoming email. There is no human in this session." + " If you need to communicate with a human, you MUST send an email using the email sending tool." + " If you need more information or confirmation from the human, send them an email asking for it and then exit." + " Do not wait — when the human replies, a new task will be triggered automatically and you will be woken up with their response.";
|
|
18335
|
-
var ISSUE_NOTICE = "This task was triggered by an assigned issue. Use `alook issue show
|
|
18356
|
+
var ISSUE_NOTICE = "This task was triggered by an assigned issue. The issue_id is provided in this message." + " Use `alook issue show --agent_id <your_agent_id> --issue_id <issue_id>` to read full context." + " Use `alook issue update --agent_id <your_agent_id> --issue_id <issue_id> --status <status>` to change status." + " Use `alook issue comment --agent_id <your_agent_id> --issue_id <issue_id> --body <text>` to leave a comment." + " You are responsible for setting the issue status: move to in_progress when working, review when awaiting user feedback, done/closed when finished." + " Always leave a comment summarizing what you did before changing status.";
|
|
18336
18357
|
function buildDmNotice(name, email3) {
|
|
18337
18358
|
return `This task was triggered by an incoming email on a conversation with ${name} (${email3}).` + ` ${name} is present in this session — reply to them directly.` + ` If you need to communicate with anyone else, use the email sending tool.`;
|
|
18338
18359
|
}
|
|
@@ -18352,6 +18373,10 @@ function buildPrompt(task, attachments) {
|
|
|
18352
18373
|
}
|
|
18353
18374
|
if (task.type === "issue_event") {
|
|
18354
18375
|
obj.notice = ISSUE_NOTICE;
|
|
18376
|
+
const ctx = task.context;
|
|
18377
|
+
if (ctx?.issue_id) {
|
|
18378
|
+
obj.issue_id = ctx.issue_id;
|
|
18379
|
+
}
|
|
18355
18380
|
}
|
|
18356
18381
|
if (task.sender) {
|
|
18357
18382
|
obj.sender = {
|