pi-advisor-flow 0.2.1 → 0.2.2
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/commands.ts +2 -32
- package/src/config.ts +23 -0
package/package.json
CHANGED
package/src/commands.ts
CHANGED
|
@@ -5,25 +5,12 @@ import {
|
|
|
5
5
|
} from "@earendil-works/pi-coding-agent";
|
|
6
6
|
import { Box, Markdown, Text } from "@earendil-works/pi-tui";
|
|
7
7
|
import {
|
|
8
|
-
advisorAutoLoopGateRef,
|
|
9
|
-
advisorBlockOnBlockedRef,
|
|
10
|
-
advisorCollapseResponsesRef,
|
|
11
|
-
advisorCompletionGateRef,
|
|
12
|
-
advisorCustomInvocationRef,
|
|
13
8
|
advisorEffortRef,
|
|
14
|
-
advisorFailureGateRef,
|
|
15
|
-
advisorFailureModeRef,
|
|
16
|
-
advisorHerdrIntegrationRef,
|
|
17
|
-
advisorLoopThresholdRef,
|
|
18
9
|
advisorMaxCallsPerSessionRef,
|
|
19
|
-
advisorPlanGateRef,
|
|
20
10
|
advisorRef,
|
|
21
|
-
advisorSessionSummaryRef,
|
|
22
|
-
advisorToolResultMaxBytesRef,
|
|
23
|
-
advisorToolResultMaxLinesRef,
|
|
24
|
-
contextMaxCharsRef,
|
|
25
11
|
executorEffortRef,
|
|
26
12
|
executorRef,
|
|
13
|
+
getAdvisorSettings,
|
|
27
14
|
loadConfig,
|
|
28
15
|
parseArgs,
|
|
29
16
|
saveConfig,
|
|
@@ -406,24 +393,7 @@ export const registerCommands = (
|
|
|
406
393
|
return;
|
|
407
394
|
}
|
|
408
395
|
|
|
409
|
-
const initial: AdvisorSettings =
|
|
410
|
-
autoLoopGate: advisorAutoLoopGateRef,
|
|
411
|
-
blockOnBlocked: advisorBlockOnBlockedRef,
|
|
412
|
-
collapseResponses: advisorCollapseResponsesRef,
|
|
413
|
-
completionGate: advisorCompletionGateRef,
|
|
414
|
-
contextMaxChars: contextMaxCharsRef,
|
|
415
|
-
customRule: advisorCustomInvocationRef,
|
|
416
|
-
effort: advisorEffortRef,
|
|
417
|
-
failureGate: advisorFailureGateRef,
|
|
418
|
-
failureMode: advisorFailureModeRef,
|
|
419
|
-
herdrIntegration: advisorHerdrIntegrationRef,
|
|
420
|
-
loopThreshold: advisorLoopThresholdRef,
|
|
421
|
-
maxCallsPerSession: advisorMaxCallsPerSessionRef,
|
|
422
|
-
planGate: advisorPlanGateRef,
|
|
423
|
-
sessionSummary: advisorSessionSummaryRef,
|
|
424
|
-
toolResultMaxBytes: advisorToolResultMaxBytesRef,
|
|
425
|
-
toolResultMaxLines: advisorToolResultMaxLinesRef,
|
|
426
|
-
};
|
|
396
|
+
const initial: AdvisorSettings = getAdvisorSettings();
|
|
427
397
|
const settings = await ctx.ui.custom<AdvisorSettings | undefined>(
|
|
428
398
|
(tui, theme, _keybindings, done) =>
|
|
429
399
|
new AdvisorSettingsSelector({
|
package/src/config.ts
CHANGED
|
@@ -120,6 +120,29 @@ export const setAdvisorToolResultMaxBytesRef = (value: number) => {
|
|
|
120
120
|
advisorToolResultMaxBytesRef = value;
|
|
121
121
|
};
|
|
122
122
|
|
|
123
|
+
/**
|
|
124
|
+
* Returns the current live settings state. Use this at UI boundaries instead of
|
|
125
|
+
* imported mutable bindings, which can be snapshotted by extension loaders.
|
|
126
|
+
*/
|
|
127
|
+
export const getAdvisorSettings = () => ({
|
|
128
|
+
autoLoopGate: advisorAutoLoopGateRef,
|
|
129
|
+
blockOnBlocked: advisorBlockOnBlockedRef,
|
|
130
|
+
collapseResponses: advisorCollapseResponsesRef,
|
|
131
|
+
completionGate: advisorCompletionGateRef,
|
|
132
|
+
contextMaxChars: contextMaxCharsRef,
|
|
133
|
+
customRule: advisorCustomInvocationRef,
|
|
134
|
+
effort: advisorEffortRef,
|
|
135
|
+
failureGate: advisorFailureGateRef,
|
|
136
|
+
failureMode: advisorFailureModeRef,
|
|
137
|
+
herdrIntegration: advisorHerdrIntegrationRef,
|
|
138
|
+
loopThreshold: advisorLoopThresholdRef,
|
|
139
|
+
maxCallsPerSession: advisorMaxCallsPerSessionRef,
|
|
140
|
+
planGate: advisorPlanGateRef,
|
|
141
|
+
sessionSummary: advisorSessionSummaryRef,
|
|
142
|
+
toolResultMaxBytes: advisorToolResultMaxBytesRef,
|
|
143
|
+
toolResultMaxLines: advisorToolResultMaxLinesRef,
|
|
144
|
+
});
|
|
145
|
+
|
|
123
146
|
export const splitRef = (ref: string): [string, string] => {
|
|
124
147
|
const i = ref.indexOf("/");
|
|
125
148
|
return i === -1 ? ["aikeys", ref] : [ref.slice(0, i), ref.slice(i + 1)];
|