ework-daemon 0.4.36 → 0.4.37

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ework-daemon",
3
- "version": "0.4.36",
3
+ "version": "0.4.37",
4
4
  "description": "Issue-driven AI development daemon. Spawns opencode subprocesses to resolve Gitea issues.",
5
5
  "module": "src/index.ts",
6
6
  "type": "module",
package/src/config.ts CHANGED
@@ -26,6 +26,9 @@ export const configSchema = z.object({
26
26
  host: z.string().default("0.0.0.0"),
27
27
  endpoint: z.string().default(""),
28
28
  nonWakingAuthors: z.array(z.string()).default([]),
29
+ wakeKinds: z.array(z.string()).default(["human"]),
30
+ wakeLogins: z.array(z.string()).default([]),
31
+ noWakeLogins: z.array(z.string()).default([]),
29
32
  }),
30
33
  opencode: z.object({
31
34
  binary: z.string().default("opencode"),
@@ -144,6 +147,9 @@ export function loadConfig(): Config {
144
147
  host: process.env.DAEMON_HOST ?? TEST_DEFAULTS.daemon.host,
145
148
  endpoint: process.env.DAEMON_ENDPOINT ?? "",
146
149
  nonWakingAuthors: (process.env.WORK_NON_WAKING_AUTHORS ?? "").split(",").map((s) => s.trim()).filter(Boolean),
150
+ wakeKinds: (process.env.WORK_WAKE_KINDS ?? "human").split(",").map((s) => s.trim()).filter(Boolean),
151
+ wakeLogins: (process.env.WORK_WAKE_LOGINS ?? "").split(",").map((s) => s.trim()).filter(Boolean),
152
+ noWakeLogins: (process.env.WORK_NO_WAKE_LOGINS ?? "").split(",").map((s) => s.trim()).filter(Boolean),
147
153
  },
148
154
  opencode: {
149
155
  binary: process.env.OPENCODE_BINARY ?? TEST_DEFAULTS.opencode.binary,
package/src/opencode.ts CHANGED
@@ -669,10 +669,21 @@ export class Engine {
669
669
 
670
670
  if (event.type === "comment_created" && event.comment?.author) {
671
671
  const author = event.comment.author;
672
- if (this.cfg.daemon.nonWakingAuthors.includes(author)) {
672
+ const authorKind = event.comment.author_kind ?? "human";
673
+ const d = this.cfg.daemon;
674
+ const noWake = [...d.nonWakingAuthors, ...d.noWakeLogins];
675
+ if (noWake.includes(author)) {
673
676
  log.info(`engine: non-waking author ${author} — skipping comment_created for ${ref.trackerType}:${scopeKey}#${ref.issueId}`);
674
677
  return;
675
678
  }
679
+ if (d.wakeLogins.length > 0 && !d.wakeLogins.includes(author)) {
680
+ log.info(`engine: author ${author} not in wakeLogins — skipping comment_created for ${ref.trackerType}:${scopeKey}#${ref.issueId}`);
681
+ return;
682
+ }
683
+ if (!d.wakeKinds.includes(authorKind)) {
684
+ log.info(`engine: author kind ${authorKind} not in wakeKinds [${d.wakeKinds.join(",")}] — skipping comment_created for ${ref.trackerType}:${scopeKey}#${ref.issueId}`);
685
+ return;
686
+ }
676
687
  }
677
688
 
678
689
  const issueMapKey = `${ref.trackerType}:${scopeKey}#${ref.issueId}`;
@@ -175,6 +175,7 @@ export class GiteaTracker implements IssueTracker {
175
175
  id: String(comment.id),
176
176
  body: comment.body as string,
177
177
  author: commentUser?.login ?? "",
178
+ author_kind: (comment as Record<string, unknown>).author_kind as string | undefined,
178
179
  },
179
180
  model,
180
181
  cloneUrl,
@@ -29,6 +29,7 @@ export interface TrackerEvent {
29
29
  id: string;
30
30
  body: string;
31
31
  author: string;
32
+ author_kind?: string;
32
33
  };
33
34
  // Resolved "provider/model" string from ework-web (project override or
34
35
  // global default). Empty/undefined = no override; engine omits --model