@oh-my-pi/pi-coding-agent 14.8.0 → 14.9.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 +38 -0
- package/package.json +16 -7
- package/src/config/model-resolver.ts +92 -35
- package/src/config/prompt-templates.ts +1 -1
- package/src/debug/index.ts +21 -0
- package/src/debug/raw-sse-buffer.ts +229 -0
- package/src/debug/raw-sse.ts +213 -0
- package/src/edit/index.ts +9 -10
- package/src/edit/streaming.ts +6 -5
- package/src/eval/js/context-manager.ts +91 -47
- package/src/extensibility/extensions/loader.ts +9 -3
- package/src/extensibility/extensions/types.ts +10 -3
- package/src/extensibility/plugins/legacy-pi-compat.ts +99 -20
- package/src/hashline/anchors.ts +113 -0
- package/src/hashline/apply.ts +732 -0
- package/src/hashline/bigrams.json +649 -0
- package/src/hashline/constants.ts +8 -0
- package/src/hashline/diff-preview.ts +43 -0
- package/src/hashline/diff.ts +56 -0
- package/src/hashline/execute.ts +268 -0
- package/src/{edit/modes/hashline.lark → hashline/grammar.lark} +1 -1
- package/src/{edit/line-hash.ts → hashline/hash.ts} +5 -651
- package/src/hashline/index.ts +14 -0
- package/src/hashline/input.ts +110 -0
- package/src/hashline/parser.ts +220 -0
- package/src/hashline/prefixes.ts +101 -0
- package/src/hashline/recovery.ts +72 -0
- package/src/hashline/stream.ts +123 -0
- package/src/hashline/types.ts +69 -0
- package/src/hashline/utils.ts +3 -0
- package/src/index.ts +1 -1
- package/src/lsp/index.ts +1 -1
- package/src/lsp/render.ts +4 -0
- package/src/memories/index.ts +13 -4
- package/src/modes/components/assistant-message.ts +55 -9
- package/src/modes/components/welcome.ts +114 -38
- package/src/modes/controllers/event-controller.ts +3 -1
- package/src/modes/controllers/extension-ui-controller.ts +1 -1
- package/src/modes/controllers/input-controller.ts +8 -1
- package/src/modes/interactive-mode.ts +50 -11
- package/src/modes/prompt-action-autocomplete.ts +3 -0
- package/src/modes/rpc/rpc-client.ts +53 -2
- package/src/modes/rpc/rpc-mode.ts +67 -1
- package/src/modes/rpc/rpc-types.ts +17 -2
- package/src/modes/types.ts +4 -1
- package/src/modes/utils/ui-helpers.ts +3 -1
- package/src/prompts/agents/reviewer.md +14 -0
- package/src/prompts/tools/hashline.md +57 -10
- package/src/sdk.ts +4 -3
- package/src/session/agent-session.ts +195 -30
- package/src/session/compaction/branch-summarization.ts +4 -2
- package/src/session/compaction/compaction.ts +22 -3
- package/src/task/executor.ts +21 -2
- package/src/task/index.ts +4 -1
- package/src/tools/ast-edit.ts +1 -1
- package/src/tools/match-line-format.ts +1 -1
- package/src/tools/read.ts +1 -1
- package/src/utils/file-mentions.ts +1 -1
- package/src/utils/title-generator.ts +11 -0
- package/src/edit/modes/hashline.ts +0 -2039
|
@@ -36,6 +36,11 @@ function getTitleModel(registry: ModelRegistry, settings: Settings, currentModel
|
|
|
36
36
|
* @param registry Model registry
|
|
37
37
|
* @param settings Settings used to resolve the smol role
|
|
38
38
|
* @param sessionId Optional session id for sticky API key selection
|
|
39
|
+
* @param currentModel Current model (used to derive title model)
|
|
40
|
+
* @param metadataResolver Optional resolver evaluated after credential selection
|
|
41
|
+
* to produce request metadata (e.g. user_id for session attribution). Using a
|
|
42
|
+
* resolver instead of a pre-evaluated value ensures the metadata's account_uuid
|
|
43
|
+
* reflects the credential actually selected for this request.
|
|
39
44
|
*/
|
|
40
45
|
export async function generateSessionTitle(
|
|
41
46
|
firstMessage: string,
|
|
@@ -43,6 +48,7 @@ export async function generateSessionTitle(
|
|
|
43
48
|
settings: Settings,
|
|
44
49
|
sessionId?: string,
|
|
45
50
|
currentModel?: Model<Api>,
|
|
51
|
+
metadataResolver?: (provider: string) => Record<string, unknown> | undefined,
|
|
46
52
|
): Promise<string | null> {
|
|
47
53
|
const model = getTitleModel(registry, settings, currentModel);
|
|
48
54
|
if (!model) {
|
|
@@ -65,6 +71,10 @@ ${truncatedMessage}
|
|
|
65
71
|
});
|
|
66
72
|
return null;
|
|
67
73
|
}
|
|
74
|
+
// Resolve metadata after getApiKey so the session-sticky credential for this
|
|
75
|
+
// request is already recorded; metadataResolver can then return the correct
|
|
76
|
+
// account_uuid rather than the snapshot-at-call-site value.
|
|
77
|
+
const metadata = metadataResolver?.(model.provider);
|
|
68
78
|
|
|
69
79
|
// Title generation is a 3-6 word task; force reasoning off so reasoning models
|
|
70
80
|
// don't burn the entire output budget on internal thinking and return an empty
|
|
@@ -88,6 +98,7 @@ ${truncatedMessage}
|
|
|
88
98
|
apiKey,
|
|
89
99
|
maxTokens: 30,
|
|
90
100
|
disableReasoning: true,
|
|
101
|
+
metadata,
|
|
91
102
|
},
|
|
92
103
|
);
|
|
93
104
|
|