ework-daemon 0.4.52 → 0.4.53
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/gitea.ts +9 -0
- package/src/opencode.ts +4 -0
- package/src/trackers/gitea-tracker.ts +6 -0
- package/src/trackers/types.ts +1 -0
package/package.json
CHANGED
package/src/gitea.ts
CHANGED
|
@@ -134,6 +134,15 @@ export class GiteaClient {
|
|
|
134
134
|
);
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
+
async setCommentModel(owner: string, repo: string, commentId: number, model: string) {
|
|
138
|
+
return this.request(
|
|
139
|
+
"POST",
|
|
140
|
+
`/repos/${owner}/${repo}/issues/comments/${commentId}/model`,
|
|
141
|
+
{ model },
|
|
142
|
+
true
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
|
|
137
146
|
async addCommentReaction(owner: string, repo: string, commentId: number, content: string) {
|
|
138
147
|
return this.request(
|
|
139
148
|
"POST",
|
package/src/opencode.ts
CHANGED
|
@@ -1363,6 +1363,10 @@ export class Engine {
|
|
|
1363
1363
|
if (hasRecent) {
|
|
1364
1364
|
const matched = commentsNow.find(c => tracker.isBotUser(c.author) && !this.isSystemComment(c) && c.createdAt && new Date(c.createdAt).getTime() > (started ?? 0));
|
|
1365
1365
|
log.info(`engine: [bot] reply found for ${k} after prompt (comment ${matched?.id ?? "?"} createdAt ${matched?.createdAt ?? "?"}), marking done`);
|
|
1366
|
+
const usedModel = this.currentModel.get(k) ?? "";
|
|
1367
|
+
if (matched && usedModel) {
|
|
1368
|
+
void tracker.setCommentModel(ref, matched.id, usedModel).catch(() => { /* display-only */ });
|
|
1369
|
+
}
|
|
1366
1370
|
this.nudgeRounds.delete(k);
|
|
1367
1371
|
this.emptyResponseRounds.delete(k);
|
|
1368
1372
|
await this.persistRuntimeState(session.id);
|
|
@@ -71,6 +71,12 @@ export class GiteaTracker implements IssueTracker {
|
|
|
71
71
|
);
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
+
async setCommentModel(ref: TrackerRef, commentId: string, model: string) {
|
|
75
|
+
await this.client.setCommentModel(
|
|
76
|
+
this.owner(ref), this.repo(ref), Number(commentId), model
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
|
|
74
80
|
async setReaction(ref: TrackerRef, commentId: string, content: string, remove = false) {
|
|
75
81
|
if (remove) {
|
|
76
82
|
await this.client.removeCommentReaction(
|
package/src/trackers/types.ts
CHANGED
|
@@ -138,6 +138,7 @@ export interface IssueTracker {
|
|
|
138
138
|
updateStatus(ref: TrackerRef, status: string, detail?: string): Promise<void>;
|
|
139
139
|
|
|
140
140
|
setReaction(ref: TrackerRef, commentId: string, content: string, remove?: boolean): Promise<void>;
|
|
141
|
+
setCommentModel(ref: TrackerRef, commentId: string, model: string): Promise<void>;
|
|
141
142
|
|
|
142
143
|
getTrackerInstructions(ref: TrackerRef): TrackerInstructions;
|
|
143
144
|
|