@openeryc/pi-coding-agent 0.75.56 → 0.75.58
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/CHANGELOG.md +18 -0
- package/dist/core/keybindings.d.ts +10 -0
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +8 -0
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/model-registry.d.ts +6 -0
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +38 -0
- package/dist/core/model-registry.js.map +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts +7 -1
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/dist/modes/interactive/components/login-dialog.js +14 -4
- package/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/dist/modes/interactive/components/model-hub.d.ts +2 -0
- package/dist/modes/interactive/components/model-hub.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-hub.js +30 -8
- package/dist/modes/interactive/components/model-hub.js.map +1 -1
- package/dist/modes/interactive/goal-runner-utils.d.ts +11 -0
- package/dist/modes/interactive/goal-runner-utils.d.ts.map +1 -0
- package/dist/modes/interactive/goal-runner-utils.js +39 -0
- package/dist/modes/interactive/goal-runner-utils.js.map +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts +4 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +77 -29
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/docs/models.md +1 -1
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/npm-shrinkwrap.json +12 -12
- package/package.json +4 -4
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helpers for the /goal auto-continuation runner.
|
|
3
|
+
*/
|
|
4
|
+
/** Collapse whitespace and lowercase for comparison. */
|
|
5
|
+
export declare function normalizeGoalOutput(text: string): string;
|
|
6
|
+
/**
|
|
7
|
+
* True when two assistant outputs look like near-duplicates (stuck loop).
|
|
8
|
+
* Uses exact match, long-substring inclusion, and word-set Jaccard.
|
|
9
|
+
*/
|
|
10
|
+
export declare function isNearDuplicateGoalOutput(a: string, b: string): boolean;
|
|
11
|
+
//# sourceMappingURL=goal-runner-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"goal-runner-utils.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/goal-runner-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,wDAAwD;AACxD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAExD;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAyBvE","sourcesContent":["/**\n * Helpers for the /goal auto-continuation runner.\n */\n\n/** Collapse whitespace and lowercase for comparison. */\nexport function normalizeGoalOutput(text: string): string {\n\treturn text.toLowerCase().replace(/\\s+/g, \" \").trim();\n}\n\n/**\n * True when two assistant outputs look like near-duplicates (stuck loop).\n * Uses exact match, long-substring inclusion, and word-set Jaccard.\n */\nexport function isNearDuplicateGoalOutput(a: string, b: string): boolean {\n\tif (!a || !b) return false;\n\tif (a === b) return true;\n\n\tconst maxCompare = 4000;\n\tconst left = a.length > maxCompare ? a.slice(0, maxCompare) : a;\n\tconst right = b.length > maxCompare ? b.slice(0, maxCompare) : b;\n\n\tconst shorter = left.length <= right.length ? left : right;\n\tconst longer = left.length <= right.length ? right : left;\n\tif (shorter.length >= 80 && longer.includes(shorter.slice(0, Math.min(600, shorter.length)))) {\n\t\treturn true;\n\t}\n\n\tconst wordsA = new Set(left.split(\" \").filter((w) => w.length > 2));\n\tconst wordsB = new Set(right.split(\" \").filter((w) => w.length > 2));\n\tif (wordsA.size === 0 || wordsB.size === 0) return false;\n\n\tlet inter = 0;\n\tfor (const w of wordsA) {\n\t\tif (wordsB.has(w)) inter++;\n\t}\n\tconst union = wordsA.size + wordsB.size - inter;\n\tif (union === 0) return false;\n\treturn inter / union >= 0.85;\n}\n"]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helpers for the /goal auto-continuation runner.
|
|
3
|
+
*/
|
|
4
|
+
/** Collapse whitespace and lowercase for comparison. */
|
|
5
|
+
export function normalizeGoalOutput(text) {
|
|
6
|
+
return text.toLowerCase().replace(/\s+/g, " ").trim();
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* True when two assistant outputs look like near-duplicates (stuck loop).
|
|
10
|
+
* Uses exact match, long-substring inclusion, and word-set Jaccard.
|
|
11
|
+
*/
|
|
12
|
+
export function isNearDuplicateGoalOutput(a, b) {
|
|
13
|
+
if (!a || !b)
|
|
14
|
+
return false;
|
|
15
|
+
if (a === b)
|
|
16
|
+
return true;
|
|
17
|
+
const maxCompare = 4000;
|
|
18
|
+
const left = a.length > maxCompare ? a.slice(0, maxCompare) : a;
|
|
19
|
+
const right = b.length > maxCompare ? b.slice(0, maxCompare) : b;
|
|
20
|
+
const shorter = left.length <= right.length ? left : right;
|
|
21
|
+
const longer = left.length <= right.length ? right : left;
|
|
22
|
+
if (shorter.length >= 80 && longer.includes(shorter.slice(0, Math.min(600, shorter.length)))) {
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
const wordsA = new Set(left.split(" ").filter((w) => w.length > 2));
|
|
26
|
+
const wordsB = new Set(right.split(" ").filter((w) => w.length > 2));
|
|
27
|
+
if (wordsA.size === 0 || wordsB.size === 0)
|
|
28
|
+
return false;
|
|
29
|
+
let inter = 0;
|
|
30
|
+
for (const w of wordsA) {
|
|
31
|
+
if (wordsB.has(w))
|
|
32
|
+
inter++;
|
|
33
|
+
}
|
|
34
|
+
const union = wordsA.size + wordsB.size - inter;
|
|
35
|
+
if (union === 0)
|
|
36
|
+
return false;
|
|
37
|
+
return inter / union >= 0.85;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=goal-runner-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"goal-runner-utils.js","sourceRoot":"","sources":["../../../src/modes/interactive/goal-runner-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,wDAAwD;AACxD,MAAM,UAAU,mBAAmB,CAAC,IAAY,EAAU;IACzD,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;AAAA,CACtD;AAED;;;GAGG;AACH,MAAM,UAAU,yBAAyB,CAAC,CAAS,EAAE,CAAS,EAAW;IACxE,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;QAAE,OAAO,KAAK,CAAC;IAC3B,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAEzB,MAAM,UAAU,GAAG,IAAI,CAAC;IACxB,MAAM,IAAI,GAAG,CAAC,CAAC,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAChE,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAEjE,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;IAC3D,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;IAC1D,IAAI,OAAO,CAAC,MAAM,IAAI,EAAE,IAAI,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9F,OAAO,IAAI,CAAC;IACb,CAAC;IAED,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;IACpE,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;IACrE,IAAI,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,MAAM,CAAC,IAAI,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAEzD,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE,CAAC;QACxB,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;YAAE,KAAK,EAAE,CAAC;IAC5B,CAAC;IACD,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,GAAG,KAAK,CAAC;IAChD,IAAI,KAAK,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAC9B,OAAO,KAAK,GAAG,KAAK,IAAI,IAAI,CAAC;AAAA,CAC7B","sourcesContent":["/**\n * Helpers for the /goal auto-continuation runner.\n */\n\n/** Collapse whitespace and lowercase for comparison. */\nexport function normalizeGoalOutput(text: string): string {\n\treturn text.toLowerCase().replace(/\\s+/g, \" \").trim();\n}\n\n/**\n * True when two assistant outputs look like near-duplicates (stuck loop).\n * Uses exact match, long-substring inclusion, and word-set Jaccard.\n */\nexport function isNearDuplicateGoalOutput(a: string, b: string): boolean {\n\tif (!a || !b) return false;\n\tif (a === b) return true;\n\n\tconst maxCompare = 4000;\n\tconst left = a.length > maxCompare ? a.slice(0, maxCompare) : a;\n\tconst right = b.length > maxCompare ? b.slice(0, maxCompare) : b;\n\n\tconst shorter = left.length <= right.length ? left : right;\n\tconst longer = left.length <= right.length ? right : left;\n\tif (shorter.length >= 80 && longer.includes(shorter.slice(0, Math.min(600, shorter.length)))) {\n\t\treturn true;\n\t}\n\n\tconst wordsA = new Set(left.split(\" \").filter((w) => w.length > 2));\n\tconst wordsB = new Set(right.split(\" \").filter((w) => w.length > 2));\n\tif (wordsA.size === 0 || wordsB.size === 0) return false;\n\n\tlet inter = 0;\n\tfor (const w of wordsA) {\n\t\tif (wordsB.has(w)) inter++;\n\t}\n\tconst union = wordsA.size + wordsB.size - inter;\n\tif (union === 0) return false;\n\treturn inter / union >= 0.85;\n}\n"]}
|
|
@@ -80,9 +80,13 @@ export declare class InteractiveMode {
|
|
|
80
80
|
private goalRunnerAbortController;
|
|
81
81
|
private goalRunnerRetryAttempt;
|
|
82
82
|
private goalRunnerStatusDisplayed;
|
|
83
|
+
/** Normalized assistant texts from recent goal turns (for duplicate detection). */
|
|
84
|
+
private goalRunnerRecentOutputs;
|
|
83
85
|
private readonly GOAL_RUNNER_MAX_RETRIES;
|
|
84
86
|
private readonly GOAL_RUNNER_BASE_DELAY_MS;
|
|
85
87
|
private readonly GOAL_RUNNER_TURN_DELAY_MS;
|
|
88
|
+
/** Pause when this many consecutive turns look like near-duplicates. */
|
|
89
|
+
private readonly GOAL_RUNNER_MAX_DUPLICATE_STREAK;
|
|
86
90
|
private extensionSelector;
|
|
87
91
|
private extensionInput;
|
|
88
92
|
private extensionEditor;
|