@oh-my-pi/pi-coding-agent 16.1.7 → 16.1.8
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 +46 -0
- package/dist/cli.js +3390 -3377
- package/dist/types/cli/session-picker.d.ts +0 -1
- package/dist/types/cli/tiny-models-cli.d.ts +2 -0
- package/dist/types/collab/protocol.d.ts +20 -1
- package/dist/types/config/settings-schema.d.ts +57 -6
- package/dist/types/extensibility/legacy-pi-ai-shim.d.ts +5 -1
- package/dist/types/internal-urls/filesystem-resource.d.ts +9 -0
- package/dist/types/mcp/loader.d.ts +3 -2
- package/dist/types/mcp/manager.d.ts +4 -3
- package/dist/types/mcp/startup-events.d.ts +21 -4
- package/dist/types/mnemopi/config.d.ts +1 -0
- package/dist/types/modes/components/agent-hub.d.ts +1 -0
- package/dist/types/modes/components/agent-transcript-viewer.d.ts +1 -0
- package/dist/types/modes/components/assistant-message.d.ts +5 -1
- package/dist/types/modes/components/btw-panel.d.ts +2 -0
- package/dist/types/modes/components/chat-transcript-builder.d.ts +1 -0
- package/dist/types/modes/components/session-selector.d.ts +0 -2
- package/dist/types/modes/controllers/btw-controller.d.ts +2 -0
- package/dist/types/modes/controllers/selector-controller.d.ts +1 -0
- package/dist/types/modes/controllers/streaming-reveal.d.ts +3 -2
- package/dist/types/modes/interactive-mode.d.ts +3 -0
- package/dist/types/modes/types.d.ts +3 -0
- package/dist/types/session/agent-session.d.ts +5 -3
- package/dist/types/session/session-history-format.d.ts +25 -0
- package/dist/types/session/snapcompact-inline.d.ts +1 -1
- package/dist/types/slash-commands/builtin-registry.d.ts +7 -4
- package/dist/types/slash-commands/types.d.ts +2 -0
- package/dist/types/system-prompt.d.ts +1 -0
- package/dist/types/tiny/models.d.ts +11 -7
- package/dist/types/tools/todo.d.ts +1 -0
- package/dist/types/utils/thinking-display.d.ts +2 -0
- package/package.json +12 -12
- package/src/advisor/__tests__/advisor.test.ts +104 -0
- package/src/advisor/runtime.ts +38 -2
- package/src/cli/session-picker.ts +1 -2
- package/src/cli/tiny-models-cli.ts +7 -2
- package/src/collab/guest.ts +172 -20
- package/src/collab/host.ts +47 -5
- package/src/collab/protocol.ts +16 -1
- package/src/config/settings-schema.ts +59 -5
- package/src/edit/renderer.ts +8 -12
- package/src/extensibility/legacy-pi-ai-shim.ts +16 -4
- package/src/internal-urls/docs-index.generated.txt +1 -1
- package/src/internal-urls/filesystem-resource.ts +34 -0
- package/src/internal-urls/local-protocol.ts +7 -1
- package/src/internal-urls/memory-protocol.ts +5 -1
- package/src/internal-urls/skill-protocol.ts +20 -4
- package/src/internal-urls/vault-protocol.ts +5 -2
- package/src/main.ts +8 -8
- package/src/mcp/loader.ts +4 -3
- package/src/mcp/manager.ts +35 -15
- package/src/mcp/startup-events.ts +106 -11
- package/src/mnemopi/config.ts +2 -0
- package/src/mnemopi/state.ts +3 -1
- package/src/modes/components/agent-hub.ts +4 -0
- package/src/modes/components/agent-transcript-viewer.ts +2 -0
- package/src/modes/components/assistant-message.ts +217 -18
- package/src/modes/components/btw-panel.ts +15 -3
- package/src/modes/components/chat-transcript-builder.ts +8 -2
- package/src/modes/components/model-selector.ts +72 -9
- package/src/modes/components/omfg-panel.ts +1 -1
- package/src/modes/components/session-selector.ts +4 -9
- package/src/modes/components/snapcompact-shape-preview.ts +1 -1
- package/src/modes/components/tool-execution.ts +10 -2
- package/src/modes/controllers/btw-controller.ts +32 -7
- package/src/modes/controllers/event-controller.ts +24 -4
- package/src/modes/controllers/input-controller.ts +43 -21
- package/src/modes/controllers/selector-controller.ts +23 -13
- package/src/modes/controllers/streaming-reveal.ts +78 -20
- package/src/modes/controllers/todo-command-controller.ts +9 -10
- package/src/modes/interactive-mode.ts +83 -8
- package/src/modes/types.ts +3 -0
- package/src/modes/utils/ui-helpers.ts +1 -0
- package/src/prompts/advisor/system.md +1 -1
- package/src/prompts/system/side-channel-no-tools.md +3 -0
- package/src/sdk.ts +12 -8
- package/src/session/agent-session.ts +349 -84
- package/src/session/history-storage.ts +15 -16
- package/src/session/session-history-format.ts +41 -1
- package/src/session/snapcompact-inline.ts +9 -6
- package/src/slash-commands/builtin-registry.ts +147 -21
- package/src/slash-commands/helpers/todo.ts +12 -6
- package/src/slash-commands/types.ts +2 -0
- package/src/system-prompt.ts +6 -11
- package/src/tiny/models.ts +7 -3
- package/src/tiny/title-client.ts +8 -2
- package/src/tiny/worker.ts +1 -0
- package/src/tools/search.ts +10 -1
- package/src/tools/sqlite-reader.ts +59 -3
- package/src/tools/todo.ts +6 -0
- package/src/tools/write.ts +4 -6
- package/src/utils/thinking-display.ts +78 -0
package/src/collab/protocol.ts
CHANGED
|
@@ -65,12 +65,27 @@ export type CollabFrame =
|
|
|
65
65
|
t: "welcome";
|
|
66
66
|
proto: number;
|
|
67
67
|
header: SessionHeader;
|
|
68
|
-
entries: SessionEntry[];
|
|
69
68
|
state: CollabSessionState;
|
|
70
69
|
agents: AgentSnapshot[];
|
|
70
|
+
/**
|
|
71
|
+
* Total number of `SessionEntry` items the host will deliver in the
|
|
72
|
+
* `snapshot-chunk` frames that follow. The guest stays in the
|
|
73
|
+
* snapshot-loading phase until it has accumulated that many entries
|
|
74
|
+
* (or a chunk arrives with `final: true`).
|
|
75
|
+
*/
|
|
76
|
+
entryCount: number;
|
|
71
77
|
/** True when this peer joined through a read-only (view) link. */
|
|
72
78
|
readOnly?: boolean;
|
|
73
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* Targeted snapshot fragment delivered after `welcome`. Splits a large
|
|
82
|
+
* transcript across many small frames so the guest's per-chunk progress
|
|
83
|
+
* timeout resets each time the relay delivers another batch; without
|
|
84
|
+
* chunking, a multi-MB session has to fit one giant frame inside the
|
|
85
|
+
* 30 s first-welcome budget. The last chunk carries `final: true` so the
|
|
86
|
+
* guest can finalize the replica session.
|
|
87
|
+
*/
|
|
88
|
+
| { t: "snapshot-chunk"; entries: SessionEntry[]; final: boolean }
|
|
74
89
|
| { t: "entry"; entry: SessionEntry }
|
|
75
90
|
| { t: "event"; event: AgentSessionEvent }
|
|
76
91
|
| { t: "state"; state: CollabSessionState }
|
|
@@ -134,7 +134,7 @@ export const TAB_GROUPS: Record<SettingTab, readonly string[]> = {
|
|
|
134
134
|
"Developer",
|
|
135
135
|
],
|
|
136
136
|
tasks: ["Modes", "Subagents", "Isolation", "Commands & Skills"],
|
|
137
|
-
providers: ["Services", "Tiny Model", "Protocol", "Privacy"],
|
|
137
|
+
providers: ["Services", "Fireworks", "Tiny Model", "Protocol", "Privacy"],
|
|
138
138
|
};
|
|
139
139
|
|
|
140
140
|
/** Status line segment identifiers */
|
|
@@ -413,7 +413,7 @@ export const SETTINGS_SCHEMA = {
|
|
|
413
413
|
},
|
|
414
414
|
"advisor.immuneTurns": {
|
|
415
415
|
type: "number",
|
|
416
|
-
default:
|
|
416
|
+
default: 3,
|
|
417
417
|
ui: {
|
|
418
418
|
tab: "model",
|
|
419
419
|
group: "Advisor",
|
|
@@ -422,9 +422,9 @@ export const SETTINGS_SCHEMA = {
|
|
|
422
422
|
"After an advisor concern or blocker interrupts, route further concerns/blockers non-interruptingly for this many primary turns.",
|
|
423
423
|
options: [
|
|
424
424
|
{ value: "0", label: "0 turns", description: "Allow every concern/blocker to interrupt." },
|
|
425
|
-
{ value: "1", label: "1 turn"
|
|
425
|
+
{ value: "1", label: "1 turn" },
|
|
426
426
|
{ value: "2", label: "2 turns" },
|
|
427
|
-
{ value: "3", label: "3 turns" },
|
|
427
|
+
{ value: "3", label: "3 turns", description: "Default." },
|
|
428
428
|
{ value: "4", label: "4 turns" },
|
|
429
429
|
{ value: "5", label: "5 turns" },
|
|
430
430
|
],
|
|
@@ -899,6 +899,28 @@ export const SETTINGS_SCHEMA = {
|
|
|
899
899
|
description: "Hide thinking blocks in assistant responses",
|
|
900
900
|
},
|
|
901
901
|
},
|
|
902
|
+
proseOnlyThinking: {
|
|
903
|
+
type: "boolean",
|
|
904
|
+
default: true,
|
|
905
|
+
ui: {
|
|
906
|
+
tab: "model",
|
|
907
|
+
group: "Thinking",
|
|
908
|
+
label: "Prose Only Thinking",
|
|
909
|
+
description: "Omit code blocks from thinking summaries and replace them with an ellipsis",
|
|
910
|
+
},
|
|
911
|
+
},
|
|
912
|
+
|
|
913
|
+
omitThinking: {
|
|
914
|
+
type: "boolean",
|
|
915
|
+
default: false,
|
|
916
|
+
ui: {
|
|
917
|
+
tab: "model",
|
|
918
|
+
group: "Thinking",
|
|
919
|
+
label: "Omit Thinking summaries",
|
|
920
|
+
description:
|
|
921
|
+
"Instruct upstream providers to completely omit thinking summaries from responses (where supported)",
|
|
922
|
+
},
|
|
923
|
+
},
|
|
902
924
|
|
|
903
925
|
"model.loopGuard.enabled": {
|
|
904
926
|
type: "boolean",
|
|
@@ -1631,7 +1653,7 @@ export const SETTINGS_SCHEMA = {
|
|
|
1631
1653
|
"compaction.strategy": {
|
|
1632
1654
|
type: "enum",
|
|
1633
1655
|
values: ["context-full", "handoff", "shake", "snapcompact", "off"] as const,
|
|
1634
|
-
default: "
|
|
1656
|
+
default: "snapcompact",
|
|
1635
1657
|
ui: {
|
|
1636
1658
|
tab: "context",
|
|
1637
1659
|
group: "Compaction",
|
|
@@ -2235,6 +2257,18 @@ export const SETTINGS_SCHEMA = {
|
|
|
2235
2257
|
condition: "mnemopiActive",
|
|
2236
2258
|
},
|
|
2237
2259
|
},
|
|
2260
|
+
"mnemopi.proactiveLinking": {
|
|
2261
|
+
type: "boolean",
|
|
2262
|
+
default: false,
|
|
2263
|
+
ui: {
|
|
2264
|
+
tab: "memory",
|
|
2265
|
+
group: "Mnemopi",
|
|
2266
|
+
label: "Mnemopi Proactive Linking",
|
|
2267
|
+
description:
|
|
2268
|
+
"Ingest new memories into the episodic graph as they are stored, linking them to related entities and memories",
|
|
2269
|
+
condition: "mnemopiActive",
|
|
2270
|
+
},
|
|
2271
|
+
},
|
|
2238
2272
|
"mnemopi.noEmbeddings": {
|
|
2239
2273
|
type: "boolean",
|
|
2240
2274
|
default: false,
|
|
@@ -4020,6 +4054,26 @@ export const SETTINGS_SCHEMA = {
|
|
|
4020
4054
|
],
|
|
4021
4055
|
},
|
|
4022
4056
|
},
|
|
4057
|
+
"providers.fireworksTier": {
|
|
4058
|
+
type: "enum",
|
|
4059
|
+
values: ["standard", "priority"] as const,
|
|
4060
|
+
default: "standard",
|
|
4061
|
+
ui: {
|
|
4062
|
+
tab: "providers",
|
|
4063
|
+
group: "Fireworks",
|
|
4064
|
+
label: "Fireworks Tier",
|
|
4065
|
+
description:
|
|
4066
|
+
'Serving path for Fireworks requests. Priority sends `service_tier: "priority"` for higher reliability during peak traffic at a higher price; Standard omits it. Fast (`-fast`) models ignore this — Fast is its own serving path.',
|
|
4067
|
+
options: [
|
|
4068
|
+
{ value: "standard", label: "Standard", description: "Default serving path (no service_tier)" },
|
|
4069
|
+
{
|
|
4070
|
+
value: "priority",
|
|
4071
|
+
label: "Priority",
|
|
4072
|
+
description: "Priority serving path: higher reliability, premium per-token pricing",
|
|
4073
|
+
},
|
|
4074
|
+
],
|
|
4075
|
+
},
|
|
4076
|
+
},
|
|
4023
4077
|
"providers.tts": {
|
|
4024
4078
|
type: "enum",
|
|
4025
4079
|
values: ["auto", "local", "xai"] as const,
|
package/src/edit/renderer.ts
CHANGED
|
@@ -283,7 +283,7 @@ function renderEditHeader(
|
|
|
283
283
|
width: number,
|
|
284
284
|
uiTheme: Theme,
|
|
285
285
|
options: {
|
|
286
|
-
icon
|
|
286
|
+
icon?: "pending" | "success" | "error";
|
|
287
287
|
iconOverride?: string;
|
|
288
288
|
op?: Operation;
|
|
289
289
|
rawPath: string;
|
|
@@ -614,14 +614,12 @@ export const editToolRenderer = {
|
|
|
614
614
|
}
|
|
615
615
|
const callPreviewCaches: RenderedStringCache[] = [];
|
|
616
616
|
return framedBlock(uiTheme, width => {
|
|
617
|
-
//
|
|
618
|
-
//
|
|
619
|
-
//
|
|
620
|
-
//
|
|
621
|
-
// mid-stream. The liveness cue rides the trailing "(preview)" /
|
|
617
|
+
// No status icon on the head row: it's the head of the framed block,
|
|
618
|
+
// and native-scrollback commits are prefix-only — an animated glyph
|
|
619
|
+
// would pin the commit boundary at the top, and the pending hourglass
|
|
620
|
+
// just adds noise. The liveness cue rides the trailing "(preview)" /
|
|
622
621
|
// "(streaming)" line instead.
|
|
623
622
|
const header = renderEditHeader(width, uiTheme, {
|
|
624
|
-
icon: "pending",
|
|
625
623
|
op,
|
|
626
624
|
rawPath,
|
|
627
625
|
rename,
|
|
@@ -796,20 +794,18 @@ function renderMultiFileResult(
|
|
|
796
794
|
if (allLines.length > 0) allLines.push("");
|
|
797
795
|
const spinnerFrame = options.spinnerFrame;
|
|
798
796
|
const spinner = spinnerFrame !== undefined ? formatStatusIcon("running", uiTheme, spinnerFrame) : "";
|
|
797
|
+
// Spinner while actively rendering, otherwise no icon — never the
|
|
798
|
+
// pending hourglass on the head row.
|
|
799
799
|
allLines.push(
|
|
800
800
|
renderStatusLine(
|
|
801
801
|
{
|
|
802
|
-
|
|
802
|
+
iconOverride: spinner,
|
|
803
803
|
title: "Edit",
|
|
804
804
|
description: uiTheme.fg("dim", `${remaining} more file${remaining > 1 ? "s" : ""} pending…`),
|
|
805
805
|
},
|
|
806
806
|
uiTheme,
|
|
807
807
|
),
|
|
808
808
|
);
|
|
809
|
-
if (spinner) {
|
|
810
|
-
// Replace the pending icon with spinner on the last line
|
|
811
|
-
allLines[allLines.length - 1] = allLines[allLines.length - 1].replace(/^(?:\x1b\[[^m]*m)*./u, spinner);
|
|
812
|
-
}
|
|
813
809
|
}
|
|
814
810
|
|
|
815
811
|
cached = { key, lines: allLines };
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
* `types.ts` via the `export *` below — pi-ai still exports both as types,
|
|
20
20
|
* only the runtime `Type` builder and `StringEnum()` helper were removed.
|
|
21
21
|
*/
|
|
22
|
+
import { getBundledModel, getBundledModels } from "@oh-my-pi/pi-catalog/models";
|
|
22
23
|
import { type TSchema, Type } from "./typebox";
|
|
23
24
|
|
|
24
25
|
export interface StringEnumOptions<T extends string> {
|
|
@@ -28,10 +29,14 @@ export interface StringEnumOptions<T extends string> {
|
|
|
28
29
|
[key: string]: unknown;
|
|
29
30
|
}
|
|
30
31
|
|
|
31
|
-
function stringEnumWireSchema<T extends string
|
|
32
|
+
function stringEnumWireSchema<T extends string | number>(
|
|
33
|
+
values: readonly T[] | Record<string, T>,
|
|
34
|
+
options: StringEnumOptions<any> | undefined,
|
|
35
|
+
) {
|
|
36
|
+
const enumValues = Array.isArray(values) ? [...values] : Object.values(values);
|
|
32
37
|
const schema: Record<string, unknown> = {
|
|
33
38
|
type: "string",
|
|
34
|
-
enum:
|
|
39
|
+
enum: enumValues,
|
|
35
40
|
};
|
|
36
41
|
if (!options) return schema;
|
|
37
42
|
for (const key in options) {
|
|
@@ -42,12 +47,15 @@ function stringEnumWireSchema<T extends string>(values: readonly T[], options: S
|
|
|
42
47
|
return schema;
|
|
43
48
|
}
|
|
44
49
|
|
|
45
|
-
export function StringEnum<T extends string
|
|
50
|
+
export function StringEnum<T extends string | number>(
|
|
51
|
+
values: readonly T[] | Record<string, T>,
|
|
52
|
+
options?: StringEnumOptions<any>,
|
|
53
|
+
): TSchema {
|
|
46
54
|
const opts = {
|
|
47
55
|
description: options?.description ?? "Legacy string enum compatibility schema",
|
|
48
56
|
...options,
|
|
49
57
|
};
|
|
50
|
-
const schema: TSchema = values.length === 0 ? Type.Never(opts) : Type.Enum(values, opts);
|
|
58
|
+
const schema: TSchema = Array.isArray(values) && values.length === 0 ? Type.Never(opts) : Type.Enum(values, opts);
|
|
51
59
|
Object.defineProperty(schema, "toJSON", {
|
|
52
60
|
value: () => stringEnumWireSchema(values, options),
|
|
53
61
|
enumerable: false,
|
|
@@ -59,3 +67,7 @@ export function StringEnum<T extends string>(values: readonly T[], options?: Str
|
|
|
59
67
|
|
|
60
68
|
export * from "@oh-my-pi/pi-ai";
|
|
61
69
|
export { Type };
|
|
70
|
+
|
|
71
|
+
/** Compatibility aliases for renamed catalog functions */
|
|
72
|
+
export const getModel = getBundledModel;
|
|
73
|
+
export const getModels = getBundledModels;
|