pi-advisor-flow 0.5.6 → 0.6.0
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 +13 -0
- package/dist/index.js +1371 -1128
- package/extensions/index.ts +9 -9
- package/package.json +3 -1
- package/src/{untracked.ts → attachments.ts} +2 -5
- package/src/commands/activation-preparation.ts +6 -6
- package/src/commands/activation.ts +7 -7
- package/src/commands/lifecycle.ts +5 -5
- package/src/commands/manual-command.ts +13 -9
- package/src/commands/manual-consultation.ts +8 -8
- package/src/commands/manual-progress.ts +3 -3
- package/src/commands/model-commands.ts +6 -6
- package/src/commands/model-options.ts +4 -4
- package/src/commands/model-picker.ts +2 -2
- package/src/commands/registration.ts +8 -8
- package/src/commands/renderers.ts +5 -5
- package/src/commands/runtime.ts +8 -8
- package/src/commands/settings-commands.ts +8 -8
- package/src/commands/settings-persistence.ts +4 -4
- package/src/commands/types.ts +5 -13
- package/src/commands.ts +2 -2
- package/src/config/args.ts +3 -3
- package/src/config/defaults.ts +3 -3
- package/src/config/schema.ts +322 -0
- package/src/config/state.ts +2 -2
- package/src/config/storage.ts +20 -117
- package/src/config/types.ts +1 -1
- package/src/config/validation.ts +61 -181
- package/src/config.ts +7 -7
- package/src/content-utils.ts +30 -0
- package/src/conversation.ts +13 -168
- package/src/git.ts +4 -18
- package/src/herdr.ts +6 -8
- package/src/model-stream.ts +5 -8
- package/src/outcomes.ts +2 -5
- package/src/pi-settings.ts +59 -0
- package/src/preferences.ts +2 -2
- package/src/redaction.ts +50 -0
- package/src/scout-context.ts +121 -485
- package/src/scout-curation.ts +84 -0
- package/src/scout-groups.ts +485 -0
- package/src/scout-protocol.ts +122 -0
- package/src/scout-reconstruct.ts +44 -0
- package/src/scout-types.ts +66 -0
- package/src/scout.ts +53 -63
- package/src/session-state.ts +119 -76
- package/src/tool-result-cap.ts +88 -0
- package/src/tools/consult-context.ts +155 -0
- package/src/tools/consultation.ts +71 -220
- package/src/tools/gate-policy.ts +5 -5
- package/src/tools/gate-protocol.ts +2 -2
- package/src/tools/loop-gate.ts +70 -61
- package/src/tools/prompts.ts +4 -7
- package/src/tools/register-ask-advisor.ts +9 -14
- package/src/tools/register-lifecycle.ts +7 -7
- package/src/tools/register-outcome.ts +5 -5
- package/src/tools/register-renderers.ts +5 -5
- package/src/tools/registration.ts +10 -10
- package/src/tools/render-advisor-result.ts +11 -8
- package/src/tools/render-common.ts +25 -13
- package/src/tools/scout-status.ts +5 -5
- package/src/tools/session.ts +1 -1
- package/src/tools/types.ts +7 -7
- package/src/tools.ts +9 -9
- package/src/ui/manual-dialog-render.ts +2 -2
- package/src/ui/manual-dialog.ts +4 -9
- package/src/ui/model-selector.ts +1 -1
- package/src/ui/settings-formatting.ts +2 -2
- package/src/ui/settings-items.ts +4 -4
- package/src/ui/settings-mutations.ts +2 -2
- package/src/ui/settings-selector.ts +5 -5
- package/src/ui/text-setting-submenu.ts +1 -1
- package/src/ui/types.ts +2 -2
- package/src/ui.ts +4 -4
- package/src/usage.ts +1 -6
|
@@ -8,15 +8,15 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
rainbowGradient,
|
|
10
10
|
SIMPLE_MODE_GRADIENT_INTERVAL_MS,
|
|
11
|
-
} from "./settings-formatting.
|
|
12
|
-
import { createSettingsItems } from "./settings-items.
|
|
13
|
-
import { SettingsListAdapter } from "./settings-list-adapter.
|
|
14
|
-
import { mutateAdvisorSettings } from "./settings-mutations.
|
|
11
|
+
} from "./settings-formatting.ts";
|
|
12
|
+
import { createSettingsItems } from "./settings-items.ts";
|
|
13
|
+
import { SettingsListAdapter } from "./settings-list-adapter.ts";
|
|
14
|
+
import { mutateAdvisorSettings } from "./settings-mutations.ts";
|
|
15
15
|
import type {
|
|
16
16
|
AdvisorSettings,
|
|
17
17
|
AdvisorSettingsSelectorOptions,
|
|
18
18
|
ContextPreset,
|
|
19
|
-
} from "./types.
|
|
19
|
+
} from "./types.ts";
|
|
20
20
|
|
|
21
21
|
export class AdvisorSettingsSelector implements Component, Focusable {
|
|
22
22
|
private readonly options: AdvisorSettingsSelectorOptions;
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
Input,
|
|
5
5
|
truncateToWidth,
|
|
6
6
|
} from "@earendil-works/pi-tui";
|
|
7
|
-
import type { TextSettingSubmenuOptions } from "./types.
|
|
7
|
+
import type { TextSettingSubmenuOptions } from "./types.ts";
|
|
8
8
|
|
|
9
9
|
/** Small inline editor used by SettingsList for the two free-form settings. */
|
|
10
10
|
export class TextSettingSubmenu implements Component, Focusable {
|
package/src/ui/types.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Theme } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
import type { KeybindingsManager, TUI } from "@earendil-works/pi-tui";
|
|
3
|
-
import type { GateFailureMode } from "../config/types.
|
|
4
|
-
import type { GitContextLevel } from "../git.
|
|
3
|
+
import type { GateFailureMode } from "../config/types.ts";
|
|
4
|
+
import type { GitContextLevel } from "../git.ts";
|
|
5
5
|
|
|
6
6
|
export interface RenderRequester {
|
|
7
7
|
requestRender: () => void;
|
package/src/ui.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// biome-ignore lint/performance/noBarrelFile: this facade intentionally preserves the public UI module contract.
|
|
2
|
-
export { ManualAdvisorDialog } from "./ui/manual-dialog.
|
|
3
|
-
export { SearchableModelSelector } from "./ui/model-selector.
|
|
4
|
-
export { AdvisorSettingsSelector } from "./ui/settings-selector.
|
|
2
|
+
export { ManualAdvisorDialog } from "./ui/manual-dialog.ts";
|
|
3
|
+
export { SearchableModelSelector } from "./ui/model-selector.ts";
|
|
4
|
+
export { AdvisorSettingsSelector } from "./ui/settings-selector.ts";
|
|
5
5
|
export type {
|
|
6
6
|
AdvisorSettings,
|
|
7
7
|
ContextPreset,
|
|
8
8
|
ManualAdvisorRequest,
|
|
9
|
-
} from "./ui/types.
|
|
9
|
+
} from "./ui/types.ts";
|
package/src/usage.ts
CHANGED
|
@@ -10,7 +10,6 @@ export interface AdvisorUsageSnapshot {
|
|
|
10
10
|
totalTokens?: number;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
/** Session-local totals for direct Advisor model requests. */
|
|
14
13
|
export interface AdvisorUsageTotals {
|
|
15
14
|
cacheRead?: number;
|
|
16
15
|
cacheWrite?: number;
|
|
@@ -31,8 +30,7 @@ const finite = (value: unknown) =>
|
|
|
31
30
|
const add = (left: number | undefined, right: number | undefined) =>
|
|
32
31
|
left === undefined || right === undefined ? (left ?? right) : left + right;
|
|
33
32
|
|
|
34
|
-
|
|
35
|
-
Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
33
|
+
import { isRecord } from "./content-utils.ts";
|
|
36
34
|
|
|
37
35
|
const costFields = ["input", "output", "cacheRead", "cacheWrite", "total"];
|
|
38
36
|
|
|
@@ -165,13 +163,11 @@ const formatUsageFields = (usage: AdvisorUsageSnapshot): string | undefined => {
|
|
|
165
163
|
return tokens.join(" · ") || undefined;
|
|
166
164
|
};
|
|
167
165
|
|
|
168
|
-
/** Formats one response for an Advisor or Scout result renderer. */
|
|
169
166
|
export const formatAdvisorUsage = (usage: unknown): string | undefined => {
|
|
170
167
|
const snapshot = snapshotAdvisorUsage(usage);
|
|
171
168
|
return snapshot ? formatUsageFields(snapshot) : undefined;
|
|
172
169
|
};
|
|
173
170
|
|
|
174
|
-
/** Formats cumulative direct Advisor usage for a footer or session summary. */
|
|
175
171
|
export const formatAdvisorUsageTotals = (
|
|
176
172
|
totals: AdvisorUsageTotals
|
|
177
173
|
): string => {
|
|
@@ -187,7 +183,6 @@ export const formatAdvisorUsageTotals = (
|
|
|
187
183
|
);
|
|
188
184
|
};
|
|
189
185
|
|
|
190
|
-
/** Formats the current direct Advisor usage status for the Pi footer. */
|
|
191
186
|
export const formatAdvisorUsageStatus = (
|
|
192
187
|
totals: AdvisorUsageTotals
|
|
193
188
|
): string | undefined => {
|