ework-daemon 0.4.48 → 0.4.50
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/package.json +1 -1
- package/src/opencode.ts +13 -6
- package/src/trackers/gitea-tracker.ts +1 -1
- package/src/trackers/types.ts +2 -1
package/package.json
CHANGED
package/src/opencode.ts
CHANGED
|
@@ -717,7 +717,7 @@ export class Engine {
|
|
|
717
717
|
|
|
718
718
|
if (event.type === "comment_created" && event.comment?.author) {
|
|
719
719
|
const author = event.comment.author;
|
|
720
|
-
const authorKind = event.comment.
|
|
720
|
+
const authorKind = event.comment.authorKind ?? "human";
|
|
721
721
|
const d = this.cfg.daemon;
|
|
722
722
|
const noWake = [...d.nonWakingAuthors, ...d.noWakeLogins];
|
|
723
723
|
if (noWake.includes(author)) {
|
|
@@ -894,7 +894,7 @@ export class Engine {
|
|
|
894
894
|
const instructions = tracker.getTrackerInstructions(ref);
|
|
895
895
|
const prompt = this.buildForwardPrompt(
|
|
896
896
|
session.name, this.handleLargeContent(workdir, comment.body, `comment-${comment.id}.txt`),
|
|
897
|
-
comment.author, issueData.title, workdir, instructions
|
|
897
|
+
comment.author, comment.authorKind, issueData.title, workdir, instructions
|
|
898
898
|
);
|
|
899
899
|
|
|
900
900
|
// Immediate ack
|
|
@@ -945,7 +945,7 @@ export class Engine {
|
|
|
945
945
|
const instructions = tracker.getTrackerInstructions(ref);
|
|
946
946
|
const prompt = this.buildForwardPrompt(
|
|
947
947
|
session.name, this.handleLargeContent(workdir, comment.body, `comment-${comment.id}.txt`),
|
|
948
|
-
comment.author, issueData.title, workdir, instructions
|
|
948
|
+
comment.author, comment.authorKind, issueData.title, workdir, instructions
|
|
949
949
|
);
|
|
950
950
|
await tracker.createComment(ref, `[system] ✓ Message forwarded to **${session.name}**${this.running.has(this.sessionKey(session, issue)) ? " (running)" : ""}.\n> session: ${this.sessionRef(session)} | workdir: ${this.workdirLink(workdir)}`);
|
|
951
951
|
await this.enqueueOrRun(session, issue, prompt, comment.id, model);
|
|
@@ -1490,7 +1490,10 @@ export class Engine {
|
|
|
1490
1490
|
instructions: { clone: string; issueRef: string; closeIssue?: string }
|
|
1491
1491
|
): string {
|
|
1492
1492
|
return [
|
|
1493
|
-
`You are ${opName},
|
|
1493
|
+
`You are ${opName}, the AI agent for this project on ework (a self-hosted, issue-driven dev platform).`,
|
|
1494
|
+
`Who's who: issue comments come from the project's users (humans like @${author}; bots are labelled "bot") and are forwarded to you verbatim. Your \`reply\` tool posts a comment they read (prefixed \`[bot]\`). Lines starting with \`[system]\` are platform plumbing, not user speech.`,
|
|
1495
|
+
`The working directory below is your own clone of the repo. Only claim actions you actually performed — verify with tools (git status/log) before asserting any push, merge, or change.`,
|
|
1496
|
+
``,
|
|
1494
1497
|
`A new issue needs your attention:`,
|
|
1495
1498
|
`- Issue: "${title}" (${instructions.issueRef})`,
|
|
1496
1499
|
`- Author: @${author}`,
|
|
@@ -1510,12 +1513,16 @@ export class Engine {
|
|
|
1510
1513
|
opName: string,
|
|
1511
1514
|
commentBody: string,
|
|
1512
1515
|
commentUser: string,
|
|
1516
|
+
authorKind: string | undefined,
|
|
1513
1517
|
issueTitle: string,
|
|
1514
1518
|
workdir: string,
|
|
1515
1519
|
instructions: { issueRef: string }
|
|
1516
1520
|
): string {
|
|
1521
|
+
const who = authorKind === "bot" ? `@${commentUser} (bot)` : `@${commentUser} (user)`;
|
|
1517
1522
|
return [
|
|
1518
|
-
`[SYSTEM FORWARD] User
|
|
1523
|
+
`[SYSTEM FORWARD] User ${who} posted a new comment on ${instructions.issueRef} "${issueTitle}".`,
|
|
1524
|
+
`The platform forwarded it to you; the user cannot see your terminal output —`,
|
|
1525
|
+
`your reply tool posts a \`[bot]\` comment into the thread they read.`,
|
|
1519
1526
|
``,
|
|
1520
1527
|
`---`,
|
|
1521
1528
|
commentBody,
|
|
@@ -1523,7 +1530,7 @@ export class Engine {
|
|
|
1523
1530
|
``,
|
|
1524
1531
|
`Working directory: ${workdir}`,
|
|
1525
1532
|
``,
|
|
1526
|
-
`Reply using the \`reply\` tool
|
|
1533
|
+
`Reply using the \`reply\` tool.`,
|
|
1527
1534
|
].join("\n");
|
|
1528
1535
|
}
|
|
1529
1536
|
|
|
@@ -177,7 +177,7 @@ export class GiteaTracker implements IssueTracker {
|
|
|
177
177
|
id: String(comment.id),
|
|
178
178
|
body: comment.body as string,
|
|
179
179
|
author: commentUser?.login ?? "",
|
|
180
|
-
|
|
180
|
+
authorKind: (comment as Record<string, unknown>).author_kind as string | undefined,
|
|
181
181
|
},
|
|
182
182
|
model,
|
|
183
183
|
cloneUrl,
|
package/src/trackers/types.ts
CHANGED
|
@@ -30,7 +30,7 @@ export interface TrackerEvent {
|
|
|
30
30
|
id: string;
|
|
31
31
|
body: string;
|
|
32
32
|
author: string;
|
|
33
|
-
|
|
33
|
+
authorKind?: string;
|
|
34
34
|
};
|
|
35
35
|
// Resolved "provider/model" string from ework-web (project override or
|
|
36
36
|
// global default). Empty/undefined = no override; engine omits --model
|
|
@@ -50,6 +50,7 @@ export interface TrackerComment {
|
|
|
50
50
|
id: string;
|
|
51
51
|
body: string;
|
|
52
52
|
author: string;
|
|
53
|
+
authorKind?: string;
|
|
53
54
|
createdAt?: string; // ISO timestamp
|
|
54
55
|
}
|
|
55
56
|
|