opencode-gitbutler 0.1.6 → 0.1.7
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/cli.d.ts +6 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cmd.js +3 -1
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/index.js +248 -26
- package/dist/plugin.d.ts.map +1 -1
- package/dist/reword.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/cli.d.ts
CHANGED
|
@@ -22,7 +22,9 @@ export type FileBranchResult = {
|
|
|
22
22
|
branchCliId?: string;
|
|
23
23
|
branchName?: string;
|
|
24
24
|
unassignedCliId?: string;
|
|
25
|
+
confidence?: BranchInferenceConfidence;
|
|
25
26
|
};
|
|
27
|
+
export type BranchInferenceConfidence = "high" | "medium" | "ambiguous";
|
|
26
28
|
export type ButStatusBranch = {
|
|
27
29
|
cliId: string;
|
|
28
30
|
name: string;
|
|
@@ -81,5 +83,8 @@ export type Cli = {
|
|
|
81
83
|
hasMultiBranchHunks: (filePath: string, statusData?: ButStatusFull | null) => boolean;
|
|
82
84
|
toRelativePath: (absPath: string) => string;
|
|
83
85
|
};
|
|
84
|
-
export
|
|
86
|
+
export type CliOptions = {
|
|
87
|
+
inferenceEnabled?: boolean;
|
|
88
|
+
};
|
|
89
|
+
export declare function createCli(cwd: string, log: Logger, options?: CliOptions): Cli;
|
|
85
90
|
//# sourceMappingURL=cli.d.ts.map
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAA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E,UAAU,CAAC,EAAE,aAAa,GAAG,IAAI,KAAK,OAAO,CAAC;IACtF,cAAc,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAOF,wBAAgB,SAAS,CACvB,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,UAAe,GACvB,GAAG,CAwiBL"}
|
package/dist/cmd.js
CHANGED
|
@@ -29052,7 +29052,8 @@ var DEFAULT_CONFIG = {
|
|
|
29052
29052
|
stale_lock_ms: 300000,
|
|
29053
29053
|
edit_debounce_ms: 200,
|
|
29054
29054
|
gc_on_session_start: false,
|
|
29055
|
-
notification_max_age_ms: 300000
|
|
29055
|
+
notification_max_age_ms: 300000,
|
|
29056
|
+
inference_enabled: true
|
|
29056
29057
|
};
|
|
29057
29058
|
var CONFIG_FILE_NAME = ".opencode/gitbutler.json";
|
|
29058
29059
|
function stripJsonComments(input) {
|
|
@@ -29129,6 +29130,7 @@ async function loadConfig(cwd) {
|
|
|
29129
29130
|
edit_debounce_ms: typeof parsed.edit_debounce_ms === "number" && parsed.edit_debounce_ms >= 0 ? parsed.edit_debounce_ms : DEFAULT_CONFIG.edit_debounce_ms,
|
|
29130
29131
|
gc_on_session_start: typeof parsed.gc_on_session_start === "boolean" ? parsed.gc_on_session_start : DEFAULT_CONFIG.gc_on_session_start,
|
|
29131
29132
|
notification_max_age_ms: typeof parsed.notification_max_age_ms === "number" && parsed.notification_max_age_ms >= 0 ? parsed.notification_max_age_ms : DEFAULT_CONFIG.notification_max_age_ms,
|
|
29133
|
+
inference_enabled: typeof parsed.inference_enabled === "boolean" ? parsed.inference_enabled : DEFAULT_CONFIG.inference_enabled,
|
|
29132
29134
|
...typeof parsed.branch_target === "string" && parsed.branch_target.length > 0 ? { branch_target: parsed.branch_target } : {}
|
|
29133
29135
|
};
|
|
29134
29136
|
} catch (err) {
|
package/dist/config.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ export type GitButlerPluginConfig = {
|
|
|
25
25
|
notification_max_age_ms: number;
|
|
26
26
|
/** When set, all sessions use this value for conversation_id instead of rootSessionID */
|
|
27
27
|
branch_target?: string;
|
|
28
|
+
inference_enabled: boolean;
|
|
28
29
|
};
|
|
29
30
|
export declare const DEFAULT_CONFIG: Readonly<GitButlerPluginConfig>;
|
|
30
31
|
/**
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,qBAAqB,GAAG;IAClC,yDAAyD;IACzD,WAAW,EAAE,OAAO,CAAC;IACrB,iDAAiD;IACjD,oBAAoB,EAAE,MAAM,CAAC;IAC7B,oDAAoD;IACpD,uBAAuB,EAAE,MAAM,CAAC;IAChC,sDAAsD;IACtD,cAAc,EAAE,MAAM,CAAC;IACvB,gDAAgD;IAChD,cAAc,EAAE,MAAM,CAAC;IACvB,8CAA8C;IAC9C,sBAAsB,EAAE,MAAM,CAAC;IAC/B,6CAA6C;IAC7C,WAAW,EAAE,OAAO,CAAC;IACrB,iFAAiF;IACjF,sBAAsB,EAAE,MAAM,CAAC;IAC/B,0DAA0D;IAC1D,aAAa,EAAE,MAAM,CAAC;IACtB,mEAAmE;IACnE,gBAAgB,EAAE,MAAM,CAAC;IACzB,8EAA8E;IAC9E,mBAAmB,EAAE,OAAO,CAAC;IAC7B,gGAAgG;IAChG,uBAAuB,EAAE,MAAM,CAAC;IAChC,yFAAyF;IACzF,aAAa,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,qBAAqB,GAAG;IAClC,yDAAyD;IACzD,WAAW,EAAE,OAAO,CAAC;IACrB,iDAAiD;IACjD,oBAAoB,EAAE,MAAM,CAAC;IAC7B,oDAAoD;IACpD,uBAAuB,EAAE,MAAM,CAAC;IAChC,sDAAsD;IACtD,cAAc,EAAE,MAAM,CAAC;IACvB,gDAAgD;IAChD,cAAc,EAAE,MAAM,CAAC;IACvB,8CAA8C;IAC9C,sBAAsB,EAAE,MAAM,CAAC;IAC/B,6CAA6C;IAC7C,WAAW,EAAE,OAAO,CAAC;IACrB,iFAAiF;IACjF,sBAAsB,EAAE,MAAM,CAAC;IAC/B,0DAA0D;IAC1D,aAAa,EAAE,MAAM,CAAC;IACtB,mEAAmE;IACnE,gBAAgB,EAAE,MAAM,CAAC;IACzB,8EAA8E;IAC9E,mBAAmB,EAAE,OAAO,CAAC;IAC7B,gGAAgG;IAChG,uBAAuB,EAAE,MAAM,CAAC;IAChC,yFAAyF;IACzF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,qBAAqB,CAc1D,CAAC;AAIF;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CA6CvD;AAYD,wBAAsB,UAAU,CAC9B,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,qBAAqB,CAAC,CA+DhC"}
|
package/dist/index.js
CHANGED
|
@@ -13,7 +13,8 @@ var DEFAULT_CONFIG = {
|
|
|
13
13
|
stale_lock_ms: 300000,
|
|
14
14
|
edit_debounce_ms: 200,
|
|
15
15
|
gc_on_session_start: false,
|
|
16
|
-
notification_max_age_ms: 300000
|
|
16
|
+
notification_max_age_ms: 300000,
|
|
17
|
+
inference_enabled: true
|
|
17
18
|
};
|
|
18
19
|
var CONFIG_FILE_NAME = ".opencode/gitbutler.json";
|
|
19
20
|
function stripJsonComments(input) {
|
|
@@ -90,6 +91,7 @@ async function loadConfig(cwd) {
|
|
|
90
91
|
edit_debounce_ms: typeof parsed.edit_debounce_ms === "number" && parsed.edit_debounce_ms >= 0 ? parsed.edit_debounce_ms : DEFAULT_CONFIG.edit_debounce_ms,
|
|
91
92
|
gc_on_session_start: typeof parsed.gc_on_session_start === "boolean" ? parsed.gc_on_session_start : DEFAULT_CONFIG.gc_on_session_start,
|
|
92
93
|
notification_max_age_ms: typeof parsed.notification_max_age_ms === "number" && parsed.notification_max_age_ms >= 0 ? parsed.notification_max_age_ms : DEFAULT_CONFIG.notification_max_age_ms,
|
|
94
|
+
inference_enabled: typeof parsed.inference_enabled === "boolean" ? parsed.inference_enabled : DEFAULT_CONFIG.inference_enabled,
|
|
93
95
|
...typeof parsed.branch_target === "string" && parsed.branch_target.length > 0 ? { branch_target: parsed.branch_target } : {}
|
|
94
96
|
};
|
|
95
97
|
} catch (err) {
|
|
@@ -127,8 +129,117 @@ var CURSOR_RETRY_PARAMS = {
|
|
|
127
129
|
stop: { maxRetries: 5, baseMs: 500 },
|
|
128
130
|
default: { maxRetries: 3, baseMs: 200 }
|
|
129
131
|
};
|
|
130
|
-
function createCli(cwd, log) {
|
|
132
|
+
function createCli(cwd, log, options = {}) {
|
|
131
133
|
const resolvedCwd = resolve2(cwd);
|
|
134
|
+
const inferenceEnabled = options.inferenceEnabled ?? true;
|
|
135
|
+
function toPathSegments(filePath) {
|
|
136
|
+
return filePath.replace(/\\/g, "/").split("/").filter(Boolean);
|
|
137
|
+
}
|
|
138
|
+
function sharedPrefixDepth(a, b) {
|
|
139
|
+
const limit = Math.min(a.length, b.length);
|
|
140
|
+
let depth = 0;
|
|
141
|
+
while (depth < limit && a[depth] === b[depth]) {
|
|
142
|
+
depth++;
|
|
143
|
+
}
|
|
144
|
+
return depth;
|
|
145
|
+
}
|
|
146
|
+
function scoreBranchByDirectoryPrefix(filePath, branch) {
|
|
147
|
+
const targetSegments = toPathSegments(filePath);
|
|
148
|
+
let maxScore = 0;
|
|
149
|
+
for (const commit of branch.commits ?? []) {
|
|
150
|
+
for (const change of commit.changes ?? []) {
|
|
151
|
+
if (!change.filePath)
|
|
152
|
+
continue;
|
|
153
|
+
const candidateSegments = toPathSegments(change.filePath);
|
|
154
|
+
const score = sharedPrefixDepth(targetSegments, candidateSegments);
|
|
155
|
+
if (score > maxScore) {
|
|
156
|
+
maxScore = score;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return maxScore;
|
|
161
|
+
}
|
|
162
|
+
function inferAssignedBranch(filePath, stackBranches, unassignedCliId) {
|
|
163
|
+
if (!inferenceEnabled) {
|
|
164
|
+
log.info("inference-disabled", {
|
|
165
|
+
file: filePath,
|
|
166
|
+
branchCount: stackBranches.length
|
|
167
|
+
});
|
|
168
|
+
return {
|
|
169
|
+
inBranch: true,
|
|
170
|
+
unassignedCliId,
|
|
171
|
+
confidence: "ambiguous"
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
if (stackBranches.length === 0) {
|
|
175
|
+
log.warn("inference-no-branches", {
|
|
176
|
+
file: filePath
|
|
177
|
+
});
|
|
178
|
+
return {
|
|
179
|
+
inBranch: true,
|
|
180
|
+
unassignedCliId,
|
|
181
|
+
confidence: "ambiguous"
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
if (stackBranches.length === 1) {
|
|
185
|
+
const [branch] = stackBranches;
|
|
186
|
+
if (!branch) {
|
|
187
|
+
return {
|
|
188
|
+
inBranch: true,
|
|
189
|
+
unassignedCliId,
|
|
190
|
+
confidence: "ambiguous"
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
log.info("inference-single-branch", {
|
|
194
|
+
file: filePath,
|
|
195
|
+
branchCliId: branch.cliId,
|
|
196
|
+
branchName: branch.name
|
|
197
|
+
});
|
|
198
|
+
return {
|
|
199
|
+
inBranch: true,
|
|
200
|
+
branchCliId: branch.cliId,
|
|
201
|
+
branchName: branch.name,
|
|
202
|
+
unassignedCliId,
|
|
203
|
+
confidence: "high"
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
const scoredBranches = stackBranches.map((branch) => ({
|
|
207
|
+
branch,
|
|
208
|
+
score: scoreBranchByDirectoryPrefix(filePath, branch)
|
|
209
|
+
})).sort((a, b) => b.score - a.score);
|
|
210
|
+
const best = scoredBranches[0];
|
|
211
|
+
const second = scoredBranches[1];
|
|
212
|
+
if (best?.branch && second && best.score >= 2 && best.score > second.score) {
|
|
213
|
+
log.info("inference-directory-match", {
|
|
214
|
+
file: filePath,
|
|
215
|
+
branchCliId: best.branch.cliId,
|
|
216
|
+
branchName: best.branch.name,
|
|
217
|
+
score: best.score,
|
|
218
|
+
margin: best.score - second.score,
|
|
219
|
+
branchCount: stackBranches.length
|
|
220
|
+
});
|
|
221
|
+
return {
|
|
222
|
+
inBranch: true,
|
|
223
|
+
branchCliId: best.branch.cliId,
|
|
224
|
+
branchName: best.branch.name,
|
|
225
|
+
unassignedCliId,
|
|
226
|
+
confidence: "medium"
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
log.warn("inference-ambiguous", {
|
|
230
|
+
file: filePath,
|
|
231
|
+
branchCount: stackBranches.length,
|
|
232
|
+
scores: scoredBranches.map((entry) => ({
|
|
233
|
+
branchCliId: entry.branch.cliId,
|
|
234
|
+
score: entry.score
|
|
235
|
+
}))
|
|
236
|
+
});
|
|
237
|
+
return {
|
|
238
|
+
inBranch: true,
|
|
239
|
+
unassignedCliId,
|
|
240
|
+
confidence: "ambiguous"
|
|
241
|
+
};
|
|
242
|
+
}
|
|
132
243
|
function toRelativePath(absPath) {
|
|
133
244
|
const resolved = resolve2(absPath);
|
|
134
245
|
const rel = relative(resolvedCwd, resolved);
|
|
@@ -159,9 +270,10 @@ function createCli(cwd, log) {
|
|
|
159
270
|
}
|
|
160
271
|
const normalized = toRelativePath(filePath);
|
|
161
272
|
const unassigned = data.unassignedChanges?.find((ch) => ch.filePath === normalized);
|
|
273
|
+
const assignedStacks = [];
|
|
162
274
|
for (const stack of data.stacks ?? []) {
|
|
163
275
|
if (stack.assignedChanges?.some((ch) => ch.filePath === normalized)) {
|
|
164
|
-
|
|
276
|
+
assignedStacks.push(stack);
|
|
165
277
|
}
|
|
166
278
|
for (const branch of stack.branches ?? []) {
|
|
167
279
|
for (const commit of branch.commits ?? []) {
|
|
@@ -170,12 +282,40 @@ function createCli(cwd, log) {
|
|
|
170
282
|
inBranch: true,
|
|
171
283
|
branchCliId: branch.cliId,
|
|
172
284
|
branchName: branch.name,
|
|
173
|
-
unassignedCliId: unassigned?.cliId
|
|
285
|
+
unassignedCliId: unassigned?.cliId,
|
|
286
|
+
confidence: "high"
|
|
174
287
|
};
|
|
175
288
|
}
|
|
176
289
|
}
|
|
177
290
|
}
|
|
178
291
|
}
|
|
292
|
+
if (assignedStacks.length === 1) {
|
|
293
|
+
const [stack] = assignedStacks;
|
|
294
|
+
if (stack) {
|
|
295
|
+
return inferAssignedBranch(normalized, stack.branches ?? [], unassigned?.cliId);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
if (assignedStacks.length > 1) {
|
|
299
|
+
const uniqueBranches = new Set;
|
|
300
|
+
for (const stack of assignedStacks) {
|
|
301
|
+
for (const branch of stack.branches ?? []) {
|
|
302
|
+
if (branch.cliId) {
|
|
303
|
+
uniqueBranches.add(branch.cliId);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
log.warn("inference-ambiguous", {
|
|
308
|
+
file: normalized,
|
|
309
|
+
reason: "multiple-assigned-stacks",
|
|
310
|
+
stackCount: assignedStacks.length,
|
|
311
|
+
branchCount: uniqueBranches.size
|
|
312
|
+
});
|
|
313
|
+
return {
|
|
314
|
+
inBranch: true,
|
|
315
|
+
unassignedCliId: unassigned?.cliId,
|
|
316
|
+
confidence: "ambiguous"
|
|
317
|
+
};
|
|
318
|
+
}
|
|
179
319
|
return { inBranch: false };
|
|
180
320
|
} catch {
|
|
181
321
|
return { inBranch: false };
|
|
@@ -835,39 +975,65 @@ function createRewordManager(deps) {
|
|
|
835
975
|
});
|
|
836
976
|
}
|
|
837
977
|
reapStaleLocks();
|
|
978
|
+
const statusForSweep = cli.getFullStatus();
|
|
838
979
|
const editedFiles = editedFilesPerConversation.get(conversationId);
|
|
839
980
|
let sweepRubCount = 0;
|
|
981
|
+
let sweepSkippedAmbiguous = 0;
|
|
982
|
+
let sweepSkippedMultiBranch = 0;
|
|
983
|
+
let sweepNoTarget = 0;
|
|
840
984
|
if (editedFiles && editedFiles.size > 0) {
|
|
841
985
|
for (const filePath of editedFiles) {
|
|
842
986
|
try {
|
|
843
|
-
const branchInfo = cli.findFileBranch(filePath);
|
|
987
|
+
const branchInfo = cli.findFileBranch(filePath, statusForSweep);
|
|
844
988
|
if (branchInfo.unassignedCliId && branchInfo.branchCliId) {
|
|
845
|
-
if (!cli.hasMultiBranchHunks(filePath)) {
|
|
989
|
+
if (!cli.hasMultiBranchHunks(filePath, statusForSweep)) {
|
|
846
990
|
const rubOk = cli.butRub(branchInfo.unassignedCliId, branchInfo.branchCliId);
|
|
847
991
|
if (rubOk) {
|
|
848
992
|
sweepRubCount++;
|
|
849
993
|
log.info("post-stop-sweep-rub", {
|
|
850
994
|
file: filePath,
|
|
851
995
|
source: branchInfo.unassignedCliId,
|
|
852
|
-
dest: branchInfo.branchCliId
|
|
996
|
+
dest: branchInfo.branchCliId,
|
|
997
|
+
confidence: branchInfo.confidence
|
|
853
998
|
});
|
|
854
999
|
}
|
|
1000
|
+
} else {
|
|
1001
|
+
sweepSkippedMultiBranch++;
|
|
1002
|
+
log.warn("post-stop-sweep-skip-multi-branch", {
|
|
1003
|
+
file: filePath,
|
|
1004
|
+
source: branchInfo.unassignedCliId,
|
|
1005
|
+
dest: branchInfo.branchCliId,
|
|
1006
|
+
confidence: branchInfo.confidence
|
|
1007
|
+
});
|
|
855
1008
|
}
|
|
1009
|
+
} else if (branchInfo.inBranch && !branchInfo.branchCliId) {
|
|
1010
|
+
sweepSkippedAmbiguous++;
|
|
1011
|
+
log.warn("post-stop-sweep-skip-ambiguous", {
|
|
1012
|
+
file: filePath,
|
|
1013
|
+
confidence: branchInfo.confidence
|
|
1014
|
+
});
|
|
1015
|
+
} else {
|
|
1016
|
+
sweepNoTarget++;
|
|
1017
|
+
log.info("post-stop-sweep-no-target", {
|
|
1018
|
+
file: filePath,
|
|
1019
|
+
inBranch: branchInfo.inBranch
|
|
1020
|
+
});
|
|
856
1021
|
}
|
|
857
1022
|
} catch {}
|
|
858
1023
|
}
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
1024
|
+
log.info("post-stop-sweep-summary", {
|
|
1025
|
+
conversationId,
|
|
1026
|
+
filesChecked: editedFiles.size,
|
|
1027
|
+
rubbed: sweepRubCount,
|
|
1028
|
+
skippedAmbiguous: sweepSkippedAmbiguous,
|
|
1029
|
+
skippedMultiBranch: sweepSkippedMultiBranch,
|
|
1030
|
+
noTarget: sweepNoTarget
|
|
1031
|
+
});
|
|
866
1032
|
}
|
|
867
1033
|
const prompt = await fetchUserPrompt(rootSessionID);
|
|
868
1034
|
if (!prompt)
|
|
869
1035
|
return;
|
|
870
|
-
const status = cli.getFullStatus();
|
|
1036
|
+
const status = statusForSweep ?? cli.getFullStatus();
|
|
871
1037
|
if (!status?.stacks)
|
|
872
1038
|
return;
|
|
873
1039
|
const ownershipSnapshot = [];
|
|
@@ -902,13 +1068,47 @@ function createRewordManager(deps) {
|
|
|
902
1068
|
});
|
|
903
1069
|
}
|
|
904
1070
|
const candidateBranchCliIds = new Set;
|
|
1071
|
+
const candidateConfidenceByBranch = new Map;
|
|
1072
|
+
let candidateAmbiguousCount = 0;
|
|
1073
|
+
const confidenceRank = {
|
|
1074
|
+
ambiguous: 0,
|
|
1075
|
+
medium: 1,
|
|
1076
|
+
high: 2
|
|
1077
|
+
};
|
|
905
1078
|
if (ownershipMatches && editedFiles && editedFiles.size > 0) {
|
|
906
1079
|
for (const filePath of editedFiles) {
|
|
907
1080
|
const branchInfo = cli.findFileBranch(filePath, status);
|
|
908
1081
|
if (branchInfo.branchCliId) {
|
|
909
1082
|
candidateBranchCliIds.add(branchInfo.branchCliId);
|
|
1083
|
+
const nextConfidence = branchInfo.confidence ?? "high";
|
|
1084
|
+
const existingConfidence = candidateConfidenceByBranch.get(branchInfo.branchCliId);
|
|
1085
|
+
const mergedConfidence = existingConfidence ? confidenceRank[nextConfidence] < confidenceRank[existingConfidence.confidence] ? nextConfidence : existingConfidence.confidence : nextConfidence;
|
|
1086
|
+
candidateConfidenceByBranch.set(branchInfo.branchCliId, {
|
|
1087
|
+
confidence: mergedConfidence,
|
|
1088
|
+
fileCount: (existingConfidence?.fileCount ?? 0) + 1,
|
|
1089
|
+
branchName: branchInfo.branchName ?? existingConfidence?.branchName ?? branchInfo.branchCliId
|
|
1090
|
+
});
|
|
1091
|
+
} else if (branchInfo.inBranch) {
|
|
1092
|
+
candidateAmbiguousCount++;
|
|
1093
|
+
log.warn("post-stop-candidate-skip-ambiguous", {
|
|
1094
|
+
conversationId,
|
|
1095
|
+
file: filePath,
|
|
1096
|
+
confidence: branchInfo.confidence
|
|
1097
|
+
});
|
|
910
1098
|
}
|
|
911
1099
|
}
|
|
1100
|
+
if (candidateConfidenceByBranch.size > 0 || candidateAmbiguousCount > 0) {
|
|
1101
|
+
log.info("post-stop-candidate-confidence", {
|
|
1102
|
+
conversationId,
|
|
1103
|
+
candidates: [...candidateConfidenceByBranch.entries()].map(([branchCliId, info]) => ({
|
|
1104
|
+
branchCliId,
|
|
1105
|
+
branchName: info.branchName,
|
|
1106
|
+
confidence: info.confidence,
|
|
1107
|
+
fileCount: info.fileCount
|
|
1108
|
+
})),
|
|
1109
|
+
skippedAmbiguous: candidateAmbiguousCount
|
|
1110
|
+
});
|
|
1111
|
+
}
|
|
912
1112
|
}
|
|
913
1113
|
if (ownershipMatches && owner?.branchName && !owner.branchName.startsWith("conversation-")) {
|
|
914
1114
|
for (const stack of status.stacks) {
|
|
@@ -1086,7 +1286,9 @@ function createGitButlerPlugin(config = { ...DEFAULT_CONFIG }) {
|
|
|
1086
1286
|
return async ({ client, directory, worktree }) => {
|
|
1087
1287
|
const cwd = worktree ?? directory;
|
|
1088
1288
|
const log = createLogger(config.log_enabled, cwd);
|
|
1089
|
-
const cli = createCli(cwd, log
|
|
1289
|
+
const cli = createCli(cwd, log, {
|
|
1290
|
+
inferenceEnabled: config.inference_enabled
|
|
1291
|
+
});
|
|
1090
1292
|
const state = createStateManager(cwd, log);
|
|
1091
1293
|
const diskSessionMap = await state.loadSessionMap();
|
|
1092
1294
|
for (const [k, v] of diskSessionMap) {
|
|
@@ -1279,44 +1481,64 @@ function createGitButlerPlugin(config = { ...DEFAULT_CONFIG }) {
|
|
|
1279
1481
|
}
|
|
1280
1482
|
const relativePath = cli.toRelativePath(filePath);
|
|
1281
1483
|
try {
|
|
1484
|
+
const rootSessionID = state.resolveSessionRoot(input.sessionID);
|
|
1282
1485
|
const cached = assignmentCache.get(relativePath);
|
|
1283
|
-
const cacheHit = cached && Date.now() - cached.timestamp < ASSIGNMENT_CACHE_TTL_MS;
|
|
1486
|
+
const cacheHit = cached && Date.now() - cached.timestamp < ASSIGNMENT_CACHE_TTL_MS && cached.rootSessionID === rootSessionID;
|
|
1284
1487
|
if (!cacheHit) {
|
|
1285
1488
|
const statusSnapshot = cli.getFullStatus();
|
|
1489
|
+
if (!statusSnapshot) {
|
|
1490
|
+
log.warn("after-edit-skip-no-status", {
|
|
1491
|
+
file: relativePath,
|
|
1492
|
+
sessionID: input.sessionID
|
|
1493
|
+
});
|
|
1494
|
+
return;
|
|
1495
|
+
}
|
|
1286
1496
|
const branchInfo = cli.findFileBranch(relativePath, statusSnapshot);
|
|
1287
1497
|
if (branchInfo.inBranch) {
|
|
1288
1498
|
if (branchInfo.unassignedCliId && branchInfo.branchCliId) {
|
|
1289
1499
|
if (cli.hasMultiBranchHunks(relativePath, statusSnapshot)) {
|
|
1290
1500
|
log.warn("rub-skip-multi-branch", {
|
|
1291
|
-
file: relativePath
|
|
1501
|
+
file: relativePath,
|
|
1502
|
+
confidence: branchInfo.confidence
|
|
1292
1503
|
});
|
|
1293
1504
|
} else {
|
|
1294
1505
|
log.info("rub-check", {
|
|
1295
1506
|
file: relativePath,
|
|
1296
1507
|
multiBranch: false,
|
|
1297
1508
|
source: branchInfo.unassignedCliId,
|
|
1298
|
-
dest: branchInfo.branchCliId
|
|
1509
|
+
dest: branchInfo.branchCliId,
|
|
1510
|
+
confidence: branchInfo.confidence
|
|
1299
1511
|
});
|
|
1300
1512
|
const rubOk = cli.butRub(branchInfo.unassignedCliId, branchInfo.branchCliId);
|
|
1301
1513
|
if (rubOk) {
|
|
1302
1514
|
log.info("rub-ok", {
|
|
1303
1515
|
source: branchInfo.unassignedCliId,
|
|
1304
1516
|
dest: branchInfo.branchCliId,
|
|
1305
|
-
file: relativePath
|
|
1517
|
+
file: relativePath,
|
|
1518
|
+
confidence: branchInfo.confidence
|
|
1306
1519
|
});
|
|
1307
1520
|
} else {
|
|
1308
1521
|
log.error("rub-failed", {
|
|
1309
1522
|
source: branchInfo.unassignedCliId,
|
|
1310
1523
|
dest: branchInfo.branchCliId,
|
|
1311
|
-
file: relativePath
|
|
1524
|
+
file: relativePath,
|
|
1525
|
+
confidence: branchInfo.confidence
|
|
1312
1526
|
});
|
|
1313
1527
|
}
|
|
1314
1528
|
}
|
|
1529
|
+
} else if (!branchInfo.branchCliId) {
|
|
1530
|
+
log.warn("after-edit-ambiguous-assignment", {
|
|
1531
|
+
file: relativePath,
|
|
1532
|
+
sessionID: input.sessionID,
|
|
1533
|
+
confidence: branchInfo.confidence
|
|
1534
|
+
});
|
|
1315
1535
|
} else {
|
|
1316
1536
|
log.info("after-edit-already-assigned", {
|
|
1317
1537
|
file: relativePath,
|
|
1318
1538
|
sessionID: input.sessionID,
|
|
1319
|
-
branch: branchInfo.branchName
|
|
1539
|
+
branch: branchInfo.branchName ?? branchInfo.branchCliId,
|
|
1540
|
+
branchCliId: branchInfo.branchCliId,
|
|
1541
|
+
confidence: branchInfo.confidence ?? "high"
|
|
1320
1542
|
});
|
|
1321
1543
|
}
|
|
1322
1544
|
return;
|
|
@@ -1324,11 +1546,12 @@ function createGitButlerPlugin(config = { ...DEFAULT_CONFIG }) {
|
|
|
1324
1546
|
} else {
|
|
1325
1547
|
log.info("assignment-cache-hit", {
|
|
1326
1548
|
file: relativePath,
|
|
1327
|
-
|
|
1549
|
+
conversationId: cached.conversationId,
|
|
1550
|
+
rootSessionID: cached.rootSessionID,
|
|
1328
1551
|
ageMs: Date.now() - cached.timestamp
|
|
1329
1552
|
});
|
|
1330
1553
|
}
|
|
1331
|
-
const branchSeed = config.branch_target ??
|
|
1554
|
+
const branchSeed = config.branch_target ?? rootSessionID;
|
|
1332
1555
|
const conversationId = cacheHit ? cached.conversationId : await toUUID(branchSeed);
|
|
1333
1556
|
log.info("after-edit", {
|
|
1334
1557
|
file: relativePath,
|
|
@@ -1345,8 +1568,8 @@ function createGitButlerPlugin(config = { ...DEFAULT_CONFIG }) {
|
|
|
1345
1568
|
workspace_roots: [cwd]
|
|
1346
1569
|
});
|
|
1347
1570
|
assignmentCache.set(relativePath, {
|
|
1348
|
-
branchCliId: conversationId,
|
|
1349
1571
|
conversationId,
|
|
1572
|
+
rootSessionID,
|
|
1350
1573
|
timestamp: Date.now()
|
|
1351
1574
|
});
|
|
1352
1575
|
} catch (err) {
|
|
@@ -1360,7 +1583,6 @@ function createGitButlerPlugin(config = { ...DEFAULT_CONFIG }) {
|
|
|
1360
1583
|
editedFilesPerConversation.set(conversationId, new Set);
|
|
1361
1584
|
}
|
|
1362
1585
|
editedFilesPerConversation.get(conversationId).add(relativePath);
|
|
1363
|
-
const rootSessionID = state.resolveSessionRoot(input.sessionID);
|
|
1364
1586
|
const existingOwner = branchOwnership.get(conversationId);
|
|
1365
1587
|
if (existingOwner && existingOwner.rootSessionID !== rootSessionID) {
|
|
1366
1588
|
log.error("branch-collision", {
|
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAUzD,wBAAgB,qBAAqB,CACnC,MAAM,GAAE,qBAA6C,GACpD,MAAM,
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAUzD,wBAAgB,qBAAqB,CACnC,MAAM,GAAE,qBAA6C,GACpD,MAAM,CA2pBR"}
|
package/dist/reword.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reword.d.ts","sourceRoot":"","sources":["../src/reword.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,GAAG,EAAiB,MAAM,UAAU,CAAC;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEzD,MAAM,MAAM,UAAU,GAAG;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,GAAG,CAAC;IACT,MAAM,EAAE,qBAAqB,CAAC;IAC9B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,eAAe,EAAE,mBAAmB,CAAC,iBAAiB,CAAC,CAAC;IACxD,kBAAkB,EAAE,CA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