@oh-my-pi/pi-coding-agent 15.5.15 → 15.7.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 +81 -0
- package/dist/types/capability/rule-buckets.d.ts +30 -0
- package/dist/types/capability/rule.d.ts +7 -0
- package/dist/types/cli/classify-install-target.d.ts +0 -10
- package/dist/types/cli/completion-gen.d.ts +80 -0
- package/dist/types/cli/initial-message.d.ts +1 -1
- package/dist/types/cli/tiny-models-cli.d.ts +9 -0
- package/dist/types/commands/complete.d.ts +6 -0
- package/dist/types/commands/completions.d.ts +13 -0
- package/dist/types/commands/setup.d.ts +10 -1
- package/dist/types/commands/tiny-models.d.ts +22 -0
- package/dist/types/commit/analysis/conventional.d.ts +1 -1
- package/dist/types/commit/analysis/summary.d.ts +1 -1
- package/dist/types/commit/changelog/generate.d.ts +1 -1
- package/dist/types/commit/changelog/index.d.ts +2 -2
- package/dist/types/commit/map-reduce/map-phase.d.ts +1 -1
- package/dist/types/commit/map-reduce/reduce-phase.d.ts +1 -1
- package/dist/types/config/model-id-affixes.d.ts +10 -0
- package/dist/types/config/settings-schema.d.ts +402 -17
- package/dist/types/discovery/builtin-defaults.d.ts +1 -0
- package/dist/types/discovery/builtin-rules/index.d.ts +7 -0
- package/dist/types/discovery/helpers.d.ts +1 -1
- package/dist/types/discovery/index.d.ts +1 -0
- package/dist/types/discovery/substitute-plugin-root.d.ts +0 -4
- package/dist/types/edit/hashline/block-resolver.d.ts +9 -0
- package/dist/types/edit/hashline/index.d.ts +1 -0
- package/dist/types/eval/js/shared/rewrite-imports.d.ts +16 -1
- package/dist/types/eval/py/kernel.d.ts +3 -0
- package/dist/types/eval/py/runtime.d.ts +11 -1
- package/dist/types/export/html/template.generated.d.ts +1 -1
- package/dist/types/internal-urls/agent-protocol.d.ts +2 -1
- package/dist/types/internal-urls/artifact-protocol.d.ts +2 -1
- package/dist/types/internal-urls/local-protocol.d.ts +2 -1
- package/dist/types/internal-urls/memory-protocol.d.ts +2 -1
- package/dist/types/internal-urls/omp-protocol.d.ts +2 -1
- package/dist/types/internal-urls/router.d.ts +8 -1
- package/dist/types/internal-urls/rule-protocol.d.ts +2 -1
- package/dist/types/internal-urls/skill-protocol.d.ts +2 -1
- package/dist/types/internal-urls/types.d.ts +26 -0
- package/dist/types/main.d.ts +1 -0
- package/dist/types/memory-backend/index.d.ts +1 -0
- package/dist/types/memory-backend/resolve.d.ts +2 -1
- package/dist/types/memory-backend/types.d.ts +7 -1
- package/dist/types/mnemosyne/backend.d.ts +4 -0
- package/dist/types/mnemosyne/config.d.ts +29 -0
- package/dist/types/mnemosyne/index.d.ts +3 -0
- package/dist/types/mnemosyne/state.d.ts +72 -0
- package/dist/types/modes/components/custom-editor.d.ts +2 -3
- package/dist/types/modes/components/hook-selector.d.ts +27 -0
- package/dist/types/modes/components/index.d.ts +2 -0
- package/dist/types/modes/components/segment-track.d.ts +22 -0
- package/dist/types/modes/components/status-line/context-thresholds.d.ts +6 -0
- package/dist/types/modes/components/tiny-title-download-progress.d.ts +11 -0
- package/dist/types/modes/components/welcome.d.ts +22 -0
- package/dist/types/modes/controllers/extension-ui-controller.d.ts +4 -1
- package/dist/types/modes/gradient-highlight.d.ts +23 -0
- package/dist/types/modes/interactive-mode.d.ts +7 -4
- package/dist/types/modes/internal-url-autocomplete.d.ts +43 -0
- package/dist/types/modes/orchestrate.d.ts +10 -0
- package/dist/types/modes/setup-wizard/index.d.ts +16 -0
- package/dist/types/modes/setup-wizard/scenes/glyph.d.ts +2 -0
- package/dist/types/modes/setup-wizard/scenes/outro.d.ts +2 -0
- package/dist/types/modes/setup-wizard/scenes/providers.d.ts +2 -0
- package/dist/types/modes/setup-wizard/scenes/sign-in.d.ts +19 -0
- package/dist/types/modes/setup-wizard/scenes/splash.d.ts +11 -0
- package/dist/types/modes/setup-wizard/scenes/theme.d.ts +2 -0
- package/dist/types/modes/setup-wizard/scenes/types.d.ts +43 -0
- package/dist/types/modes/setup-wizard/scenes/web-search.d.ts +19 -0
- package/dist/types/modes/setup-wizard/wizard-overlay.d.ts +14 -0
- package/dist/types/modes/theme/defaults/index.d.ts +8406 -8406
- package/dist/types/modes/theme/shimmer.d.ts +2 -0
- package/dist/types/modes/theme/theme.d.ts +11 -0
- package/dist/types/modes/types.d.ts +5 -1
- package/dist/types/modes/ultrathink.d.ts +3 -3
- package/dist/types/modes/utils/keybinding-matchers.d.ts +5 -0
- package/dist/types/sdk.d.ts +3 -0
- package/dist/types/session/agent-session.d.ts +33 -0
- package/dist/types/system-prompt.d.ts +2 -0
- package/dist/types/task/executor.d.ts +2 -0
- package/dist/types/task/render.d.ts +5 -1
- package/dist/types/tiny/device.d.ts +78 -0
- package/dist/types/tiny/dtype.d.ts +85 -0
- package/dist/types/tiny/models.d.ts +185 -0
- package/dist/types/tiny/text.d.ts +19 -0
- package/dist/types/tiny/title-client.d.ts +32 -0
- package/dist/types/tiny/title-protocol.d.ts +74 -0
- package/dist/types/tiny/worker.d.ts +2 -0
- package/dist/types/tools/bash.d.ts +3 -2
- package/dist/types/tools/eval.d.ts +1 -1
- package/dist/types/tools/index.d.ts +7 -4
- package/dist/types/tools/memory-edit.d.ts +40 -0
- package/dist/types/tools/{hindsight-recall.d.ts → memory-recall.d.ts} +6 -6
- package/dist/types/tools/{hindsight-reflect.d.ts → memory-reflect.d.ts} +6 -6
- package/dist/types/tools/memory-render.d.ts +60 -0
- package/dist/types/tools/{hindsight-retain.d.ts → memory-retain.d.ts} +6 -6
- package/dist/types/tools/todo-write.d.ts +8 -0
- package/dist/types/tools/tool-result.d.ts +2 -0
- package/dist/types/tui/code-cell.d.ts +2 -0
- package/dist/types/tui/output-block.d.ts +17 -0
- package/dist/types/utils/title-generator.d.ts +3 -0
- package/package.json +18 -14
- package/scripts/build-binary.ts +1 -0
- package/src/capability/rule-buckets.ts +64 -0
- package/src/capability/rule.ts +8 -0
- package/src/cli/completion-gen.ts +550 -0
- package/src/cli/setup-cli.ts +5 -3
- package/src/cli/tiny-models-cli.ts +127 -0
- package/src/cli-commands.ts +3 -0
- package/src/cli.ts +9 -15
- package/src/commands/complete.ts +66 -0
- package/src/commands/completions.ts +60 -0
- package/src/commands/setup.ts +29 -4
- package/src/commands/tiny-models.ts +36 -0
- package/src/config/model-equivalence.ts +43 -2
- package/src/config/model-id-affixes.ts +64 -0
- package/src/config/model-registry.ts +84 -10
- package/src/config/settings-schema.ts +275 -15
- package/src/discovery/builtin-defaults.ts +39 -0
- package/src/discovery/builtin-rules/index.ts +48 -0
- package/src/discovery/builtin-rules/rs-box-leak.md +48 -0
- package/src/discovery/builtin-rules/rs-future-prelude.md +23 -0
- package/src/discovery/builtin-rules/rs-lazylock.md +51 -0
- package/src/discovery/builtin-rules/rs-match-ergonomics.md +67 -0
- package/src/discovery/builtin-rules/rs-parking-lot.md +44 -0
- package/src/discovery/builtin-rules/rs-result-type.md +19 -0
- package/src/discovery/builtin-rules/ts-bare-catch.md +38 -0
- package/src/discovery/builtin-rules/ts-import-type.md +42 -0
- package/src/discovery/builtin-rules/ts-no-any.md +56 -0
- package/src/discovery/builtin-rules/ts-no-dynamic-import.md +39 -0
- package/src/discovery/builtin-rules/ts-no-return-type.md +45 -0
- package/src/discovery/builtin-rules/ts-no-tiny-functions.md +50 -0
- package/src/discovery/builtin-rules/ts-promise-with-resolvers.md +65 -0
- package/src/discovery/builtin-rules/ts-set-map.md +28 -0
- package/src/discovery/index.ts +1 -0
- package/src/edit/hashline/block-resolver.ts +14 -0
- package/src/edit/hashline/diff.ts +9 -8
- package/src/edit/hashline/execute.ts +2 -1
- package/src/edit/hashline/index.ts +1 -0
- package/src/eval/__tests__/shared-executors.test.ts +36 -0
- package/src/eval/js/shared/local-module-loader.ts +13 -1
- package/src/eval/js/shared/rewrite-imports.ts +31 -26
- package/src/eval/py/kernel.ts +37 -15
- package/src/eval/py/runtime.ts +57 -28
- package/src/export/html/template.generated.ts +1 -1
- package/src/export/html/template.js +0 -12
- package/src/export/ttsr.ts +2 -0
- package/src/internal-urls/agent-protocol.ts +18 -1
- package/src/internal-urls/artifact-protocol.ts +19 -1
- package/src/internal-urls/docs-index.generated.ts +8 -7
- package/src/internal-urls/local-protocol.ts +14 -1
- package/src/internal-urls/memory-protocol.ts +6 -1
- package/src/internal-urls/omp-protocol.ts +5 -1
- package/src/internal-urls/router.ts +20 -1
- package/src/internal-urls/rule-protocol.ts +8 -1
- package/src/internal-urls/skill-protocol.ts +8 -1
- package/src/internal-urls/types.ts +27 -0
- package/src/lsp/render.ts +1 -1
- package/src/main.ts +18 -1
- package/src/mcp/oauth-flow.ts +2 -2
- package/src/memory-backend/index.ts +1 -0
- package/src/memory-backend/resolve.ts +4 -1
- package/src/memory-backend/types.ts +8 -1
- package/src/mnemosyne/backend.ts +374 -0
- package/src/mnemosyne/config.ts +160 -0
- package/src/mnemosyne/index.ts +3 -0
- package/src/mnemosyne/state.ts +548 -0
- package/src/modes/acp/acp-agent.ts +11 -6
- package/src/modes/components/agent-dashboard.ts +4 -4
- package/src/modes/components/custom-editor.ts +3 -2
- package/src/modes/components/diff.ts +2 -2
- package/src/modes/components/extensions/extension-list.ts +3 -2
- package/src/modes/components/footer.ts +5 -6
- package/src/modes/components/history-search.ts +3 -3
- package/src/modes/components/hook-selector.ts +92 -8
- package/src/modes/components/index.ts +2 -0
- package/src/modes/components/mcp-add-wizard.ts +3 -3
- package/src/modes/components/model-selector.ts +5 -4
- package/src/modes/components/oauth-selector.ts +3 -3
- package/src/modes/components/segment-track.ts +52 -0
- package/src/modes/components/session-observer-overlay.ts +19 -13
- package/src/modes/components/session-selector.ts +3 -3
- package/src/modes/components/settings-defs.ts +7 -0
- package/src/modes/components/status-line/context-thresholds.ts +11 -0
- package/src/modes/components/status-line/segments.ts +2 -2
- package/src/modes/components/tiny-title-download-progress.ts +90 -0
- package/src/modes/components/tips.txt +13 -0
- package/src/modes/components/tool-execution.ts +72 -4
- package/src/modes/components/tree-selector.ts +3 -3
- package/src/modes/components/user-message-selector.ts +3 -3
- package/src/modes/components/welcome.ts +102 -43
- package/src/modes/controllers/command-controller.ts +16 -1
- package/src/modes/controllers/extension-ui-controller.ts +3 -1
- package/src/modes/controllers/input-controller.ts +69 -21
- package/src/modes/gradient-highlight.ts +70 -0
- package/src/modes/interactive-mode.ts +75 -114
- package/src/modes/internal-url-autocomplete.ts +143 -0
- package/src/modes/orchestrate.ts +36 -0
- package/src/modes/prompt-action-autocomplete.ts +12 -0
- package/src/modes/setup-wizard/index.ts +88 -0
- package/src/modes/setup-wizard/scenes/glyph.ts +96 -0
- package/src/modes/setup-wizard/scenes/outro.ts +35 -0
- package/src/modes/setup-wizard/scenes/providers.ts +69 -0
- package/src/modes/setup-wizard/scenes/sign-in.ts +193 -0
- package/src/modes/setup-wizard/scenes/splash.ts +201 -0
- package/src/modes/setup-wizard/scenes/theme.ts +299 -0
- package/src/modes/setup-wizard/scenes/types.ts +48 -0
- package/src/modes/setup-wizard/scenes/web-search.ts +128 -0
- package/src/modes/setup-wizard/wizard-overlay.ts +275 -0
- package/src/modes/theme/shimmer.ts +5 -0
- package/src/modes/theme/theme.ts +44 -20
- package/src/modes/types.ts +6 -1
- package/src/modes/ultrathink.ts +9 -53
- package/src/modes/utils/keybinding-matchers.ts +11 -0
- package/src/prompts/system/memory-consolidation-system.md +8 -0
- package/src/prompts/system/memory-extraction-system.md +26 -0
- package/src/prompts/{commands/orchestrate.md → system/orchestrate-notice.md} +6 -17
- package/src/prompts/system/system-prompt.md +2 -0
- package/src/prompts/system/tiny-title-system.md +8 -0
- package/src/prompts/tools/memory-edit.md +8 -0
- package/src/prompts/tools/read.md +4 -0
- package/src/prompts/tools/task.md +4 -7
- package/src/sdk.ts +13 -21
- package/src/session/agent-session.ts +128 -44
- package/src/slash-commands/builtin-registry.ts +18 -1
- package/src/system-prompt.ts +4 -0
- package/src/task/commands.ts +1 -5
- package/src/task/executor.ts +8 -0
- package/src/task/index.ts +2 -0
- package/src/task/render.ts +69 -26
- package/src/tiny/device.ts +117 -0
- package/src/tiny/dtype.ts +101 -0
- package/src/tiny/models.ts +218 -0
- package/src/tiny/text.ts +54 -0
- package/src/tiny/title-client.ts +395 -0
- package/src/tiny/title-protocol.ts +51 -0
- package/src/tiny/worker.ts +587 -0
- package/src/tools/bash.ts +74 -29
- package/src/tools/browser/tab-worker.ts +1 -1
- package/src/tools/eval.ts +9 -4
- package/src/tools/index.ts +17 -22
- package/src/tools/memory-edit.ts +59 -0
- package/src/tools/memory-recall.ts +100 -0
- package/src/tools/memory-reflect.ts +88 -0
- package/src/tools/memory-render.ts +185 -0
- package/src/tools/memory-retain.ts +91 -0
- package/src/tools/read.ts +1 -0
- package/src/tools/renderers.ts +4 -2
- package/src/tools/todo-write.ts +128 -29
- package/src/tools/tool-result.ts +8 -0
- package/src/tui/code-cell.ts +6 -1
- package/src/tui/output-block.ts +199 -38
- package/src/utils/title-generator.ts +115 -13
- package/dist/types/tools/recipe/index.d.ts +0 -46
- package/dist/types/tools/recipe/render.d.ts +0 -36
- package/dist/types/tools/recipe/runner.d.ts +0 -60
- package/dist/types/tools/recipe/runners/cargo.d.ts +0 -16
- package/dist/types/tools/recipe/runners/index.d.ts +0 -2
- package/dist/types/tools/recipe/runners/just.d.ts +0 -2
- package/dist/types/tools/recipe/runners/make.d.ts +0 -2
- package/dist/types/tools/recipe/runners/pkg.d.ts +0 -2
- package/dist/types/tools/recipe/runners/task.d.ts +0 -2
- package/src/prompts/tools/recipe.md +0 -16
- package/src/tools/hindsight-recall.ts +0 -69
- package/src/tools/hindsight-reflect.ts +0 -58
- package/src/tools/hindsight-retain.ts +0 -57
- package/src/tools/recipe/index.ts +0 -81
- package/src/tools/recipe/render.ts +0 -19
- package/src/tools/recipe/runner.ts +0 -219
- package/src/tools/recipe/runners/cargo.ts +0 -131
- package/src/tools/recipe/runners/index.ts +0 -8
- package/src/tools/recipe/runners/just.ts +0 -73
- package/src/tools/recipe/runners/make.ts +0 -101
- package/src/tools/recipe/runners/pkg.ts +0 -167
- package/src/tools/recipe/runners/task.ts +0 -72
|
@@ -20,6 +20,8 @@ export interface ShimmerSegment {
|
|
|
20
20
|
palette?: ShimmerPalette;
|
|
21
21
|
}
|
|
22
22
|
export declare const DEFAULT_SHIMMER_PALETTE: ShimmerPalette;
|
|
23
|
+
/** Whether shimmer animations are active (any mode other than `disabled`). */
|
|
24
|
+
export declare function shimmerEnabled(): boolean;
|
|
23
25
|
/**
|
|
24
26
|
* Apply a shimmer sweep across one or more segments, treating them as a
|
|
25
27
|
* single continuous string for band positioning. Each segment can supply
|
|
@@ -27,6 +27,17 @@ export declare class Theme {
|
|
|
27
27
|
inverse(text: string): string;
|
|
28
28
|
getFgAnsi(color: ThemeColor): string;
|
|
29
29
|
getBgAnsi(color: ThemeBg): string;
|
|
30
|
+
/**
|
|
31
|
+
* Foreground ANSI for text drawn **on top of** `fillColor` used as a solid
|
|
32
|
+
* background (e.g. a powerline chip). Picks near-black or near-white by the
|
|
33
|
+
* fill's perceived luminance (Rec. 601 luma) so the label stays legible on
|
|
34
|
+
* both bright and dark fills, across light and dark themes.
|
|
35
|
+
*
|
|
36
|
+
* Reads the RGB out of the already-resolved truecolor escape; when the fill
|
|
37
|
+
* is encoded as a 256-palette index (limited terminals) the RGB is
|
|
38
|
+
* unavailable, so it falls back to the theme `text` color.
|
|
39
|
+
*/
|
|
40
|
+
getContrastFgAnsi(fillColor: ThemeColor): string;
|
|
30
41
|
getColorMode(): ColorMode;
|
|
31
42
|
getThinkingBorderColor(level: ThinkingLevel | Effort): (str: string) => string;
|
|
32
43
|
getBashModeBorderColor(): (str: string) => string;
|
|
@@ -47,6 +47,9 @@ export type TodoPhase = {
|
|
|
47
47
|
name: string;
|
|
48
48
|
tasks: TodoItem[];
|
|
49
49
|
};
|
|
50
|
+
export interface InteractiveModeInitOptions {
|
|
51
|
+
suppressWelcomeIntro?: boolean;
|
|
52
|
+
}
|
|
50
53
|
export interface InteractiveModeContext {
|
|
51
54
|
ui: TUI;
|
|
52
55
|
chatContainer: Container;
|
|
@@ -111,7 +114,8 @@ export interface InteractiveModeContext {
|
|
|
111
114
|
skillCommands: Map<string, string>;
|
|
112
115
|
oauthManualInput: OAuthManualInputManager;
|
|
113
116
|
todoPhases: TodoPhase[];
|
|
114
|
-
init(): Promise<void>;
|
|
117
|
+
init(options?: InteractiveModeInitOptions): Promise<void>;
|
|
118
|
+
playWelcomeIntro(): void;
|
|
115
119
|
shutdown(): Promise<void>;
|
|
116
120
|
checkShutdownRequested(): Promise<void>;
|
|
117
121
|
setToolUIContext(uiContext: ExtensionUIContext, hasUI: boolean): void;
|
|
@@ -4,7 +4,7 @@ export declare const ULTRATHINK_NOTICE: string;
|
|
|
4
4
|
export declare function containsUltrathink(text: string): boolean;
|
|
5
5
|
/**
|
|
6
6
|
* Rainbow-highlight every standalone "ultrathink" in `text` for editor display.
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* Sweeps red→violet (hue 0..330), stopping short of the wrap back to red so the
|
|
8
|
+
* gradient resolves smoothly regardless of casing or match length.
|
|
9
9
|
*/
|
|
10
|
-
export declare
|
|
10
|
+
export declare const highlightUltrathink: (text: string) => string;
|
|
@@ -6,5 +6,10 @@
|
|
|
6
6
|
* keybindings registered. In that case, fall back to raw Escape matching.
|
|
7
7
|
*/
|
|
8
8
|
export declare function matchesAppInterrupt(data: string): boolean;
|
|
9
|
+
/** Match the generic selector cancel keybinding. */
|
|
9
10
|
export declare function matchesSelectCancel(data: string): boolean;
|
|
11
|
+
/** Match the generic selector up-navigation keybinding. */
|
|
12
|
+
export declare function matchesSelectUp(data: string): boolean;
|
|
13
|
+
/** Match the generic selector down-navigation keybinding. */
|
|
14
|
+
export declare function matchesSelectDown(data: string): boolean;
|
|
10
15
|
export declare function matchesAppExternalEditor(data: string): boolean;
|
package/dist/types/sdk.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ import { type FileSlashCommand } from "./extensibility/slash-commands";
|
|
|
13
13
|
import type { HindsightSessionState } from "./hindsight/state";
|
|
14
14
|
import { type LocalProtocolOptions } from "./internal-urls";
|
|
15
15
|
import { MCPManager, type MCPToolsLoadResult } from "./mcp";
|
|
16
|
+
import { type MnemosyneSessionState } from "./mnemosyne/state";
|
|
16
17
|
import { AgentRegistry } from "./registry/agent-registry";
|
|
17
18
|
import { AgentSession } from "./session/agent-session";
|
|
18
19
|
import { AuthStorage } from "./session/auth-storage";
|
|
@@ -97,6 +98,8 @@ export interface CreateAgentSessionOptions {
|
|
|
97
98
|
taskDepth?: number;
|
|
98
99
|
/** Parent Hindsight state to alias for subagent memory tools. */
|
|
99
100
|
parentHindsightSessionState?: HindsightSessionState;
|
|
101
|
+
/** Parent Mnemosyne state to alias for subagent memory tools. */
|
|
102
|
+
parentMnemosyneSessionState?: MnemosyneSessionState;
|
|
100
103
|
/** Pre-allocated agent identity for IRC routing. Default: "0-Main" for top-level, parentTaskPrefix-derived for sub. */
|
|
101
104
|
agentId?: string;
|
|
102
105
|
/** Display name for the agent in IRC. Default: "main" or "sub". */
|
|
@@ -35,6 +35,7 @@ import { type FileSlashCommand } from "../extensibility/slash-commands";
|
|
|
35
35
|
import { GoalRuntime } from "../goals/runtime";
|
|
36
36
|
import type { Goal, GoalModeState } from "../goals/state";
|
|
37
37
|
import type { HindsightSessionState } from "../hindsight/state";
|
|
38
|
+
import { type MnemosyneSessionState } from "../mnemosyne/state";
|
|
38
39
|
import type { PlanModeState } from "../plan-mode/state";
|
|
39
40
|
import { type AgentRegistry } from "../registry/agent-registry";
|
|
40
41
|
import { type SecretObfuscator } from "../secrets/obfuscator";
|
|
@@ -243,6 +244,20 @@ export interface RoleModelCycleResult {
|
|
|
243
244
|
thinkingLevel: ThinkingLevel | undefined;
|
|
244
245
|
role: string;
|
|
245
246
|
}
|
|
247
|
+
/** A configured role resolved to a concrete model, used by role cycling and
|
|
248
|
+
* the plan-approval model slider. */
|
|
249
|
+
export interface ResolvedRoleModel {
|
|
250
|
+
role: string;
|
|
251
|
+
model: Model;
|
|
252
|
+
thinkingLevel?: ThinkingLevel;
|
|
253
|
+
explicitThinkingLevel: boolean;
|
|
254
|
+
}
|
|
255
|
+
/** The set of resolvable role models plus the index of the currently active
|
|
256
|
+
* one within {@link ResolvedRoleModel.role} order. */
|
|
257
|
+
export interface RoleModelCycle {
|
|
258
|
+
models: ResolvedRoleModel[];
|
|
259
|
+
currentIndex: number;
|
|
260
|
+
}
|
|
246
261
|
/** Session statistics for /session command */
|
|
247
262
|
export interface SessionStats {
|
|
248
263
|
sessionFile: string | undefined;
|
|
@@ -294,6 +309,7 @@ export declare class AgentSession {
|
|
|
294
309
|
get providerSessionState(): Map<string, ProviderSessionState>;
|
|
295
310
|
getHindsightSessionState(): HindsightSessionState | undefined;
|
|
296
311
|
setHindsightSessionState(state: HindsightSessionState | undefined): HindsightSessionState | undefined;
|
|
312
|
+
getMnemosyneSessionState(): MnemosyneSessionState | undefined;
|
|
297
313
|
/** TTSR manager for time-traveling stream rules */
|
|
298
314
|
get ttsrManager(): TtsrManager | undefined;
|
|
299
315
|
/** Whether a TTSR abort is pending (stream was aborted to inject rules) */
|
|
@@ -607,6 +623,23 @@ export declare class AgentSession {
|
|
|
607
623
|
* @returns The new model info, or undefined if only one model available
|
|
608
624
|
*/
|
|
609
625
|
cycleModel(direction?: "forward" | "backward"): Promise<ModelCycleResult | undefined>;
|
|
626
|
+
/**
|
|
627
|
+
* Resolve the configured role models in the given order plus the index of
|
|
628
|
+
* the currently active one. Roles that have no configured model, or whose
|
|
629
|
+
* configured model is not currently available, are skipped. The `default`
|
|
630
|
+
* role falls back to the active model when no explicit assignment exists.
|
|
631
|
+
*
|
|
632
|
+
* Returns `undefined` only when there is no current model or no available
|
|
633
|
+
* models at all; an empty `models` array is never returned (callers should
|
|
634
|
+
* still guard on `models.length`).
|
|
635
|
+
*/
|
|
636
|
+
getRoleModelCycle(roleOrder: readonly string[]): RoleModelCycle | undefined;
|
|
637
|
+
/**
|
|
638
|
+
* Apply a resolved role model as the active model, persisting the choice to
|
|
639
|
+
* settings under its role. Mirrors the non-temporary branch of
|
|
640
|
+
* {@link cycleRoleModels} and is shared with the plan-approval model slider.
|
|
641
|
+
*/
|
|
642
|
+
applyRoleModel(entry: ResolvedRoleModel): Promise<void>;
|
|
610
643
|
/**
|
|
611
644
|
* Cycle through configured role models in a fixed order.
|
|
612
645
|
* Skips missing roles.
|
|
@@ -82,6 +82,8 @@ export interface BuildSystemPromptOptions {
|
|
|
82
82
|
secretsEnabled?: boolean;
|
|
83
83
|
/** Pre-loaded workspace tree (skips discovery if provided). May be a Promise to allow early kick-off. */
|
|
84
84
|
workspaceTree?: WorkspaceTree | Promise<WorkspaceTree>;
|
|
85
|
+
/** Whether the local memory://root summary is active. */
|
|
86
|
+
memoryRootEnabled?: boolean;
|
|
85
87
|
}
|
|
86
88
|
/** Result of building provider-facing system prompt messages. */
|
|
87
89
|
export interface BuildSystemPromptResult {
|
|
@@ -11,6 +11,7 @@ import { type Skill } from "../extensibility/skills";
|
|
|
11
11
|
import type { HindsightSessionState } from "../hindsight/state";
|
|
12
12
|
import type { LocalProtocolOptions } from "../internal-urls";
|
|
13
13
|
import type { MCPManager } from "../mcp/manager";
|
|
14
|
+
import type { MnemosyneSessionState } from "../mnemosyne/state";
|
|
14
15
|
import type { ArtifactManager } from "../session/artifacts";
|
|
15
16
|
import type { AuthStorage } from "../session/auth-storage";
|
|
16
17
|
import type { ContextFileEntry } from "../tools";
|
|
@@ -64,6 +65,7 @@ export interface ExecutorOptions {
|
|
|
64
65
|
*/
|
|
65
66
|
parentArtifactManager?: ArtifactManager;
|
|
66
67
|
parentHindsightSessionState?: HindsightSessionState;
|
|
68
|
+
parentMnemosyneSessionState?: MnemosyneSessionState;
|
|
67
69
|
/** Parent agent's eval executor session id. Subagents reuse it so eval state is shared. */
|
|
68
70
|
parentEvalSessionId?: string;
|
|
69
71
|
/**
|
|
@@ -5,7 +5,11 @@ import type { TaskParams, TaskToolDetails } from "./types";
|
|
|
5
5
|
/**
|
|
6
6
|
* Render the tool call arguments.
|
|
7
7
|
*/
|
|
8
|
-
export declare function renderCall(args: TaskParams,
|
|
8
|
+
export declare function renderCall(args: TaskParams, options: RenderResultOptions & {
|
|
9
|
+
renderContext?: {
|
|
10
|
+
hasResult?: boolean;
|
|
11
|
+
};
|
|
12
|
+
}, theme: Theme): Component;
|
|
9
13
|
/**
|
|
10
14
|
* Render the tool result.
|
|
11
15
|
*/
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { DeviceType } from "@huggingface/transformers";
|
|
2
|
+
export type TinyModelDevice = DeviceType;
|
|
3
|
+
export interface TinyModelDevicePreference {
|
|
4
|
+
device: TinyModelDevice;
|
|
5
|
+
raw: string | undefined;
|
|
6
|
+
}
|
|
7
|
+
export declare function normalizeTinyModelDevice(value: string | undefined): TinyModelDevice | undefined;
|
|
8
|
+
export declare function resolveTinyModelDevicePreference(value?: string | undefined): TinyModelDevicePreference;
|
|
9
|
+
export declare function tinyModelDeviceLoadOrder(preference: TinyModelDevicePreference): readonly TinyModelDevice[];
|
|
10
|
+
/** Sentinel `providers.tinyModelDevice` value meaning "use the built-in platform default". */
|
|
11
|
+
export declare const TINY_MODEL_DEVICE_DEFAULT = "default";
|
|
12
|
+
/** Accepted values for the `providers.tinyModelDevice` setting (validation + UI). */
|
|
13
|
+
export declare const TINY_MODEL_DEVICE_SETTING_VALUES: readonly ["default", "gpu", "cpu", "metal", "webgpu", "cuda", "dml", "coreml", "auto", "wasm", "webnn", "webnn-gpu", "webnn-cpu", "webnn-npu"];
|
|
14
|
+
/** Submenu metadata for the `providers.tinyModelDevice` setting. */
|
|
15
|
+
export declare const TINY_MODEL_DEVICE_SETTING_OPTIONS: readonly [{
|
|
16
|
+
readonly value: "default";
|
|
17
|
+
readonly label: "Default";
|
|
18
|
+
readonly description: "DirectML on Windows, CUDA on Linux x64, CPU elsewhere";
|
|
19
|
+
}, {
|
|
20
|
+
readonly value: "gpu";
|
|
21
|
+
readonly label: "GPU";
|
|
22
|
+
readonly description: "Accelerated provider (WebGPU/Metal, CUDA, or DirectML)";
|
|
23
|
+
}, {
|
|
24
|
+
readonly value: "cpu";
|
|
25
|
+
readonly label: "CPU";
|
|
26
|
+
readonly description: "CPU-only inference";
|
|
27
|
+
}, {
|
|
28
|
+
readonly value: "metal";
|
|
29
|
+
readonly label: "Metal";
|
|
30
|
+
readonly description: "WebGPU alias for Apple GPUs";
|
|
31
|
+
}, {
|
|
32
|
+
readonly value: "webgpu";
|
|
33
|
+
readonly label: "WebGPU";
|
|
34
|
+
readonly description: "WebGPU/Metal backend";
|
|
35
|
+
}, {
|
|
36
|
+
readonly value: "cuda";
|
|
37
|
+
readonly label: "CUDA";
|
|
38
|
+
readonly description: "NVIDIA CUDA (Linux x64)";
|
|
39
|
+
}, {
|
|
40
|
+
readonly value: "dml";
|
|
41
|
+
readonly label: "DirectML";
|
|
42
|
+
readonly description: "DirectML backend (Windows)";
|
|
43
|
+
}, {
|
|
44
|
+
readonly value: "coreml";
|
|
45
|
+
readonly label: "CoreML";
|
|
46
|
+
readonly description: "Apple CoreML (opt-in; can fail to load)";
|
|
47
|
+
}, {
|
|
48
|
+
readonly value: "auto";
|
|
49
|
+
readonly label: "Auto";
|
|
50
|
+
readonly description: "Let ONNX Runtime choose a provider";
|
|
51
|
+
}, {
|
|
52
|
+
readonly value: "wasm";
|
|
53
|
+
readonly label: "WASM";
|
|
54
|
+
readonly description: "WebAssembly backend";
|
|
55
|
+
}, {
|
|
56
|
+
readonly value: "webnn";
|
|
57
|
+
readonly label: "WebNN";
|
|
58
|
+
readonly description: "WebNN backend";
|
|
59
|
+
}, {
|
|
60
|
+
readonly value: "webnn-gpu";
|
|
61
|
+
readonly label: "WebNN GPU";
|
|
62
|
+
readonly description: "WebNN GPU device";
|
|
63
|
+
}, {
|
|
64
|
+
readonly value: "webnn-cpu";
|
|
65
|
+
readonly label: "WebNN CPU";
|
|
66
|
+
readonly description: "WebNN CPU device";
|
|
67
|
+
}, {
|
|
68
|
+
readonly value: "webnn-npu";
|
|
69
|
+
readonly label: "WebNN NPU";
|
|
70
|
+
readonly description: "WebNN NPU device";
|
|
71
|
+
}];
|
|
72
|
+
/**
|
|
73
|
+
* Map a `providers.tinyModelDevice` setting value onto a `PI_TINY_DEVICE` env
|
|
74
|
+
* value for the worker. Returns `undefined` for the default sentinel so the
|
|
75
|
+
* worker keeps its built-in platform default; the worker still validates the
|
|
76
|
+
* forwarded value via {@link normalizeTinyModelDevice}.
|
|
77
|
+
*/
|
|
78
|
+
export declare function tinyModelDeviceSettingToEnv(value: string | undefined): string | undefined;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { DataType } from "@huggingface/transformers";
|
|
2
|
+
/** ONNX quantization / precision for local tiny models (transformers.js `dtype`). */
|
|
3
|
+
export type TinyModelDtype = DataType;
|
|
4
|
+
/**
|
|
5
|
+
* Validate and canonicalize a `PI_TINY_DTYPE` value. Returns `undefined` when
|
|
6
|
+
* unset/blank so callers fall back to the per-model spec dtype, and throws on an
|
|
7
|
+
* unrecognized value so a misconfiguration fails loudly instead of silently
|
|
8
|
+
* loading a different precision than requested.
|
|
9
|
+
*/
|
|
10
|
+
export declare function normalizeTinyModelDtype(value: string | undefined): TinyModelDtype | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Resolve the `PI_TINY_DTYPE` override. `undefined` means "use the per-model spec
|
|
13
|
+
* dtype" (currently `q4` for every shipped model); a concrete value overrides the
|
|
14
|
+
* precision for whichever local tiny model loads.
|
|
15
|
+
*/
|
|
16
|
+
export declare function resolveTinyModelDtypeOverride(value?: string | undefined): TinyModelDtype | undefined;
|
|
17
|
+
/** Sentinel `providers.tinyModelDtype` value meaning "use each model's shipped dtype". */
|
|
18
|
+
export declare const TINY_MODEL_DTYPE_DEFAULT = "default";
|
|
19
|
+
/** Accepted values for the `providers.tinyModelDtype` setting (validation + UI). */
|
|
20
|
+
export declare const TINY_MODEL_DTYPE_SETTING_VALUES: readonly ["default", "q4", "q4f16", "q8", "fp16", "fp32", "int8", "uint8", "bnb4", "q2", "q2f16", "q1", "q1f16", "auto"];
|
|
21
|
+
/** Submenu metadata for the `providers.tinyModelDtype` setting. */
|
|
22
|
+
export declare const TINY_MODEL_DTYPE_SETTING_OPTIONS: readonly [{
|
|
23
|
+
readonly value: "default";
|
|
24
|
+
readonly label: "Default";
|
|
25
|
+
readonly description: "Each model's shipped dtype (currently q4)";
|
|
26
|
+
}, {
|
|
27
|
+
readonly value: "q4";
|
|
28
|
+
readonly label: "q4";
|
|
29
|
+
readonly description: "4-bit weights; smallest and fastest";
|
|
30
|
+
}, {
|
|
31
|
+
readonly value: "q4f16";
|
|
32
|
+
readonly label: "q4f16";
|
|
33
|
+
readonly description: "4-bit weights with fp16 activations";
|
|
34
|
+
}, {
|
|
35
|
+
readonly value: "q8";
|
|
36
|
+
readonly label: "q8";
|
|
37
|
+
readonly description: "8-bit quantization";
|
|
38
|
+
}, {
|
|
39
|
+
readonly value: "fp16";
|
|
40
|
+
readonly label: "fp16";
|
|
41
|
+
readonly description: "16-bit float; higher fidelity, larger";
|
|
42
|
+
}, {
|
|
43
|
+
readonly value: "fp32";
|
|
44
|
+
readonly label: "fp32";
|
|
45
|
+
readonly description: "Full precision; largest and slowest";
|
|
46
|
+
}, {
|
|
47
|
+
readonly value: "int8";
|
|
48
|
+
readonly label: "int8";
|
|
49
|
+
readonly description: "Signed 8-bit integer";
|
|
50
|
+
}, {
|
|
51
|
+
readonly value: "uint8";
|
|
52
|
+
readonly label: "uint8";
|
|
53
|
+
readonly description: "Unsigned 8-bit integer";
|
|
54
|
+
}, {
|
|
55
|
+
readonly value: "bnb4";
|
|
56
|
+
readonly label: "bnb4";
|
|
57
|
+
readonly description: "bitsandbytes 4-bit";
|
|
58
|
+
}, {
|
|
59
|
+
readonly value: "q2";
|
|
60
|
+
readonly label: "q2";
|
|
61
|
+
readonly description: "2-bit weights";
|
|
62
|
+
}, {
|
|
63
|
+
readonly value: "q2f16";
|
|
64
|
+
readonly label: "q2f16";
|
|
65
|
+
readonly description: "2-bit weights with fp16 activations";
|
|
66
|
+
}, {
|
|
67
|
+
readonly value: "q1";
|
|
68
|
+
readonly label: "q1";
|
|
69
|
+
readonly description: "1-bit weights";
|
|
70
|
+
}, {
|
|
71
|
+
readonly value: "q1f16";
|
|
72
|
+
readonly label: "q1f16";
|
|
73
|
+
readonly description: "1-bit weights with fp16 activations";
|
|
74
|
+
}, {
|
|
75
|
+
readonly value: "auto";
|
|
76
|
+
readonly label: "Auto";
|
|
77
|
+
readonly description: "Let transformers.js choose per device";
|
|
78
|
+
}];
|
|
79
|
+
/**
|
|
80
|
+
* Map a `providers.tinyModelDtype` setting value onto a `PI_TINY_DTYPE` env value
|
|
81
|
+
* for the worker. Returns `undefined` for the default sentinel so the worker keeps
|
|
82
|
+
* each model's shipped dtype; the worker still validates the forwarded value via
|
|
83
|
+
* {@link normalizeTinyModelDtype}.
|
|
84
|
+
*/
|
|
85
|
+
export declare function tinyModelDtypeSettingToEnv(value: string | undefined): string | undefined;
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
/** Default session-title model: the online pi/smol path (no local download / on-device inference). */
|
|
2
|
+
export declare const ONLINE_TINY_TITLE_MODEL_KEY = "online";
|
|
3
|
+
/** Local model the `tiny-models` CLI downloads when none is named. Not the session-title default — that is {@link ONLINE_TINY_TITLE_MODEL_KEY}. */
|
|
4
|
+
export declare const DEFAULT_TINY_TITLE_LOCAL_MODEL_KEY = "lfm2-700m";
|
|
5
|
+
export interface TinyTitleLocalModelSpec {
|
|
6
|
+
key: string;
|
|
7
|
+
repo: string;
|
|
8
|
+
dtype: "q4";
|
|
9
|
+
label: string;
|
|
10
|
+
description: string;
|
|
11
|
+
contextNote: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const TINY_TITLE_LOCAL_MODELS: readonly [{
|
|
14
|
+
readonly key: "lfm2-350m";
|
|
15
|
+
readonly repo: "onnx-community/LFM2-350M-ONNX";
|
|
16
|
+
readonly dtype: "q4";
|
|
17
|
+
readonly label: "LFM2 350M";
|
|
18
|
+
readonly description: "Recommended local model; best speed/quality balance, about 212 MB cached.";
|
|
19
|
+
readonly contextNote: "Best local default from the title-generation spike.";
|
|
20
|
+
}, {
|
|
21
|
+
readonly key: "qwen3-0.6b";
|
|
22
|
+
readonly repo: "onnx-community/Qwen3-0.6B-ONNX";
|
|
23
|
+
readonly dtype: "q4";
|
|
24
|
+
readonly label: "Qwen3 0.6B";
|
|
25
|
+
readonly description: "Most robust local option; slower first load, about 500 MB cached.";
|
|
26
|
+
readonly contextNote: "Use when title quality matters more than local startup cost.";
|
|
27
|
+
}, {
|
|
28
|
+
readonly key: "gemma-270m";
|
|
29
|
+
readonly repo: "onnx-community/gemma-3-270m-it-ONNX";
|
|
30
|
+
readonly dtype: "q4";
|
|
31
|
+
readonly label: "Gemma 270M";
|
|
32
|
+
readonly description: "Smallest viable local option; lower quality, lowest cache footprint.";
|
|
33
|
+
readonly contextNote: "Use on constrained machines that still need local titles.";
|
|
34
|
+
}, {
|
|
35
|
+
readonly key: "qwen2.5-0.5b";
|
|
36
|
+
readonly repo: "onnx-community/Qwen2.5-0.5B-Instruct";
|
|
37
|
+
readonly dtype: "q4";
|
|
38
|
+
readonly label: "Qwen2.5 0.5B";
|
|
39
|
+
readonly description: "Balanced local fallback; moderate quality and cache footprint.";
|
|
40
|
+
readonly contextNote: "Useful when Qwen3 is too heavy but Gemma quality is insufficient.";
|
|
41
|
+
}, {
|
|
42
|
+
readonly key: "lfm2-700m";
|
|
43
|
+
readonly repo: "onnx-community/LFM2-700M-ONNX";
|
|
44
|
+
readonly dtype: "q4";
|
|
45
|
+
readonly label: "LFM2 700M";
|
|
46
|
+
readonly description: "Highest-quality local option; larger and slower than LFM2 350M.";
|
|
47
|
+
readonly contextNote: "Use when local title quality is preferred over startup cost.";
|
|
48
|
+
}];
|
|
49
|
+
export declare const TINY_TITLE_MODEL_VALUES: readonly ["online", "lfm2-350m", "qwen3-0.6b", "gemma-270m", "qwen2.5-0.5b", "lfm2-700m"];
|
|
50
|
+
export type TinyTitleModelKey = (typeof TINY_TITLE_MODEL_VALUES)[number];
|
|
51
|
+
export type TinyTitleLocalModelKey = (typeof TINY_TITLE_LOCAL_MODELS)[number]["key"];
|
|
52
|
+
export declare const TINY_TITLE_MODEL_OPTIONS: ({
|
|
53
|
+
value: "online";
|
|
54
|
+
label: string;
|
|
55
|
+
description: string;
|
|
56
|
+
} | {
|
|
57
|
+
value: "gemma-270m" | "lfm2-350m" | "lfm2-700m" | "qwen2.5-0.5b" | "qwen3-0.6b";
|
|
58
|
+
label: "Gemma 270M" | "LFM2 350M" | "LFM2 700M" | "Qwen2.5 0.5B" | "Qwen3 0.6B";
|
|
59
|
+
description: "Balanced local fallback; moderate quality and cache footprint." | "Highest-quality local option; larger and slower than LFM2 350M." | "Most robust local option; slower first load, about 500 MB cached." | "Recommended local model; best speed/quality balance, about 212 MB cached." | "Smallest viable local option; lower quality, lowest cache footprint.";
|
|
60
|
+
})[];
|
|
61
|
+
export declare function isTinyTitleLocalModelKey(value: string): value is TinyTitleLocalModelKey;
|
|
62
|
+
export declare function getTinyTitleModelSpec(key: TinyTitleLocalModelKey): (typeof TINY_TITLE_LOCAL_MODELS)[number];
|
|
63
|
+
/** Default memory model: the online path (the configured smol / remote LLM; no local download). */
|
|
64
|
+
export declare const ONLINE_MEMORY_MODEL_KEY = "online";
|
|
65
|
+
/** Recommended local model for memory tasks when none is named. */
|
|
66
|
+
export declare const DEFAULT_MEMORY_LOCAL_MODEL_KEY = "qwen3-1.7b";
|
|
67
|
+
/**
|
|
68
|
+
* Local models for Mnemosyne memory tasks (fact extraction + consolidation).
|
|
69
|
+
* These are larger (1B-1.7B) than the title models: structured extraction and
|
|
70
|
+
* faithful summarization need more capacity than 3-6 word titles. All q4.
|
|
71
|
+
* Ranking/recipe rationale lives in docs/local-models.md.
|
|
72
|
+
*/
|
|
73
|
+
export declare const TINY_MEMORY_LOCAL_MODELS: readonly [{
|
|
74
|
+
readonly key: "qwen3-1.7b";
|
|
75
|
+
readonly repo: "onnx-community/Qwen3-1.7B-ONNX";
|
|
76
|
+
readonly dtype: "q4";
|
|
77
|
+
readonly label: "Qwen3 1.7B";
|
|
78
|
+
readonly description: "Recommended; most disciplined extraction (ignores chit-chat), good consolidation, about 1.1 GB cached.";
|
|
79
|
+
readonly contextNote: "Best single-model pick for memory from the local experiment.";
|
|
80
|
+
}, {
|
|
81
|
+
readonly key: "gemma-3-1b";
|
|
82
|
+
readonly repo: "onnx-community/gemma-3-1b-it-ONNX";
|
|
83
|
+
readonly dtype: "q4";
|
|
84
|
+
readonly label: "Gemma 3 1B";
|
|
85
|
+
readonly description: "Best consolidation/dedup; lighter footprint, but leaks small talk during extraction.";
|
|
86
|
+
readonly contextNote: "Use when consolidation quality and size matter most.";
|
|
87
|
+
}, {
|
|
88
|
+
readonly key: "qwen2.5-1.5b";
|
|
89
|
+
readonly repo: "onnx-community/Qwen2.5-1.5B-Instruct";
|
|
90
|
+
readonly dtype: "q4";
|
|
91
|
+
readonly label: "Qwen2.5 1.5B";
|
|
92
|
+
readonly description: "Best extraction granularity (atomic facts); weaker consolidation.";
|
|
93
|
+
readonly contextNote: "Use when fine-grained, deduplicatable facts matter more than summaries.";
|
|
94
|
+
}, {
|
|
95
|
+
readonly key: "lfm2-1.2b";
|
|
96
|
+
readonly repo: "onnx-community/LFM2-1.2B-ONNX";
|
|
97
|
+
readonly dtype: "q4";
|
|
98
|
+
readonly label: "LFM2 1.2B";
|
|
99
|
+
readonly description: "Fastest load; solid all-rounder, slightly noisier extraction labels.";
|
|
100
|
+
readonly contextNote: "Use when local startup cost is the priority.";
|
|
101
|
+
}];
|
|
102
|
+
export declare const TINY_MEMORY_MODEL_VALUES: readonly ["online", "qwen3-1.7b", "gemma-3-1b", "qwen2.5-1.5b", "lfm2-1.2b"];
|
|
103
|
+
export type TinyMemoryModelKey = (typeof TINY_MEMORY_MODEL_VALUES)[number];
|
|
104
|
+
export type TinyMemoryLocalModelKey = (typeof TINY_MEMORY_LOCAL_MODELS)[number]["key"];
|
|
105
|
+
export declare const TINY_MEMORY_MODEL_OPTIONS: ({
|
|
106
|
+
value: "online";
|
|
107
|
+
label: string;
|
|
108
|
+
description: string;
|
|
109
|
+
} | {
|
|
110
|
+
value: "gemma-3-1b" | "lfm2-1.2b" | "qwen2.5-1.5b" | "qwen3-1.7b";
|
|
111
|
+
label: "Gemma 3 1B" | "LFM2 1.2B" | "Qwen2.5 1.5B" | "Qwen3 1.7B";
|
|
112
|
+
description: "Best consolidation/dedup; lighter footprint, but leaks small talk during extraction." | "Best extraction granularity (atomic facts); weaker consolidation." | "Fastest load; solid all-rounder, slightly noisier extraction labels." | "Recommended; most disciplined extraction (ignores chit-chat), good consolidation, about 1.1 GB cached.";
|
|
113
|
+
})[];
|
|
114
|
+
export declare function isTinyMemoryLocalModelKey(value: string): value is TinyMemoryLocalModelKey;
|
|
115
|
+
export declare function getTinyMemoryModelSpec(key: TinyMemoryLocalModelKey): (typeof TINY_MEMORY_LOCAL_MODELS)[number];
|
|
116
|
+
/** Any local model key (title or memory), used by the shared inference worker. */
|
|
117
|
+
export type TinyLocalModelKey = TinyTitleLocalModelKey | TinyMemoryLocalModelKey;
|
|
118
|
+
/** Resolve a local model spec by key across both the title and memory registries. */
|
|
119
|
+
export declare function getTinyLocalModelSpec(key: string): TinyTitleLocalModelSpec | undefined;
|
|
120
|
+
export declare function isTinyLocalModelKey(value: string): value is TinyLocalModelKey;
|
|
121
|
+
/** Combined local model registry (title + memory) for the shared tiny-models CLI. */
|
|
122
|
+
export declare const TINY_LOCAL_MODELS: readonly [{
|
|
123
|
+
readonly key: "lfm2-350m";
|
|
124
|
+
readonly repo: "onnx-community/LFM2-350M-ONNX";
|
|
125
|
+
readonly dtype: "q4";
|
|
126
|
+
readonly label: "LFM2 350M";
|
|
127
|
+
readonly description: "Recommended local model; best speed/quality balance, about 212 MB cached.";
|
|
128
|
+
readonly contextNote: "Best local default from the title-generation spike.";
|
|
129
|
+
}, {
|
|
130
|
+
readonly key: "qwen3-0.6b";
|
|
131
|
+
readonly repo: "onnx-community/Qwen3-0.6B-ONNX";
|
|
132
|
+
readonly dtype: "q4";
|
|
133
|
+
readonly label: "Qwen3 0.6B";
|
|
134
|
+
readonly description: "Most robust local option; slower first load, about 500 MB cached.";
|
|
135
|
+
readonly contextNote: "Use when title quality matters more than local startup cost.";
|
|
136
|
+
}, {
|
|
137
|
+
readonly key: "gemma-270m";
|
|
138
|
+
readonly repo: "onnx-community/gemma-3-270m-it-ONNX";
|
|
139
|
+
readonly dtype: "q4";
|
|
140
|
+
readonly label: "Gemma 270M";
|
|
141
|
+
readonly description: "Smallest viable local option; lower quality, lowest cache footprint.";
|
|
142
|
+
readonly contextNote: "Use on constrained machines that still need local titles.";
|
|
143
|
+
}, {
|
|
144
|
+
readonly key: "qwen2.5-0.5b";
|
|
145
|
+
readonly repo: "onnx-community/Qwen2.5-0.5B-Instruct";
|
|
146
|
+
readonly dtype: "q4";
|
|
147
|
+
readonly label: "Qwen2.5 0.5B";
|
|
148
|
+
readonly description: "Balanced local fallback; moderate quality and cache footprint.";
|
|
149
|
+
readonly contextNote: "Useful when Qwen3 is too heavy but Gemma quality is insufficient.";
|
|
150
|
+
}, {
|
|
151
|
+
readonly key: "lfm2-700m";
|
|
152
|
+
readonly repo: "onnx-community/LFM2-700M-ONNX";
|
|
153
|
+
readonly dtype: "q4";
|
|
154
|
+
readonly label: "LFM2 700M";
|
|
155
|
+
readonly description: "Highest-quality local option; larger and slower than LFM2 350M.";
|
|
156
|
+
readonly contextNote: "Use when local title quality is preferred over startup cost.";
|
|
157
|
+
}, {
|
|
158
|
+
readonly key: "qwen3-1.7b";
|
|
159
|
+
readonly repo: "onnx-community/Qwen3-1.7B-ONNX";
|
|
160
|
+
readonly dtype: "q4";
|
|
161
|
+
readonly label: "Qwen3 1.7B";
|
|
162
|
+
readonly description: "Recommended; most disciplined extraction (ignores chit-chat), good consolidation, about 1.1 GB cached.";
|
|
163
|
+
readonly contextNote: "Best single-model pick for memory from the local experiment.";
|
|
164
|
+
}, {
|
|
165
|
+
readonly key: "gemma-3-1b";
|
|
166
|
+
readonly repo: "onnx-community/gemma-3-1b-it-ONNX";
|
|
167
|
+
readonly dtype: "q4";
|
|
168
|
+
readonly label: "Gemma 3 1B";
|
|
169
|
+
readonly description: "Best consolidation/dedup; lighter footprint, but leaks small talk during extraction.";
|
|
170
|
+
readonly contextNote: "Use when consolidation quality and size matter most.";
|
|
171
|
+
}, {
|
|
172
|
+
readonly key: "qwen2.5-1.5b";
|
|
173
|
+
readonly repo: "onnx-community/Qwen2.5-1.5B-Instruct";
|
|
174
|
+
readonly dtype: "q4";
|
|
175
|
+
readonly label: "Qwen2.5 1.5B";
|
|
176
|
+
readonly description: "Best extraction granularity (atomic facts); weaker consolidation.";
|
|
177
|
+
readonly contextNote: "Use when fine-grained, deduplicatable facts matter more than summaries.";
|
|
178
|
+
}, {
|
|
179
|
+
readonly key: "lfm2-1.2b";
|
|
180
|
+
readonly repo: "onnx-community/LFM2-1.2B-ONNX";
|
|
181
|
+
readonly dtype: "q4";
|
|
182
|
+
readonly label: "LFM2 1.2B";
|
|
183
|
+
readonly description: "Fastest load; solid all-rounder, slightly noisier extraction labels.";
|
|
184
|
+
readonly contextNote: "Use when local startup cost is the priority.";
|
|
185
|
+
}];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const MAX_TITLE_INPUT_CHARS = 2000;
|
|
2
|
+
export declare function truncateTitleInput(message: string): string;
|
|
3
|
+
/**
|
|
4
|
+
* Strip fenced code blocks from a message before titling.
|
|
5
|
+
*
|
|
6
|
+
* Small title models latch onto literal text inside code blocks — e.g. a pasted
|
|
7
|
+
* UI mockup containing "Welcome to Claude Code v2.1.158" yields that string as
|
|
8
|
+
* the title instead of the surrounding intent. Removing fenced blocks leaves the
|
|
9
|
+
* prose that actually describes the task. Inline code (single backticks) is kept
|
|
10
|
+
* — it is short, high-signal context like `/login`.
|
|
11
|
+
*
|
|
12
|
+
* Falls back to the original message when stripping leaves too little to title
|
|
13
|
+
* (a message that is essentially just a code block).
|
|
14
|
+
*/
|
|
15
|
+
export declare function stripCodeBlocks(message: string): string;
|
|
16
|
+
/** Prepare a raw user message for titling: drop code blocks, then bound length. */
|
|
17
|
+
export declare function prepareTitleInput(message: string): string;
|
|
18
|
+
export declare function formatTitleUserMessage(message: string): string;
|
|
19
|
+
export declare function normalizeGeneratedTitle(value: string | null | undefined): string | null;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { TinyTitleProgressEvent } from "./title-protocol";
|
|
2
|
+
export interface TinyTitleDownloadOptions {
|
|
3
|
+
signal?: AbortSignal;
|
|
4
|
+
onProgress?: (event: TinyTitleProgressEvent) => void;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Decide which `PI_TINY_DEVICE` / `PI_TINY_DTYPE` vars to overlay onto the worker
|
|
8
|
+
* env. A present env var wins (left untouched); otherwise the mapped persisted
|
|
9
|
+
* setting is used. Returns only the keys to add — never the default sentinel.
|
|
10
|
+
* Pure for testability; see {@link tinyWorkerEnv} for the spawn-time glue.
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export declare function tinyWorkerEnvOverlay(env: Record<string, string | undefined>, deviceSetting: string | undefined, dtypeSetting: string | undefined): Record<string, string>;
|
|
14
|
+
export declare function createTinyTitleWorker(): Worker;
|
|
15
|
+
export declare class TinyTitleClient {
|
|
16
|
+
#private;
|
|
17
|
+
onProgress(listener: (event: TinyTitleProgressEvent) => void): () => void;
|
|
18
|
+
generate(modelKey: string, message: string, signal?: AbortSignal): Promise<string | null>;
|
|
19
|
+
complete(modelKey: string, prompt: string, options?: {
|
|
20
|
+
maxTokens?: number;
|
|
21
|
+
signal?: AbortSignal;
|
|
22
|
+
}): Promise<string | null>;
|
|
23
|
+
downloadModel(modelKey: string, options?: TinyTitleDownloadOptions): Promise<boolean>;
|
|
24
|
+
terminate(): Promise<void>;
|
|
25
|
+
}
|
|
26
|
+
export declare const tinyTitleClient: TinyTitleClient;
|
|
27
|
+
/** Alias for the shared tiny-model worker client (titles + memory completions). */
|
|
28
|
+
export declare const tinyModelClient: TinyTitleClient;
|
|
29
|
+
export declare function shutdownTinyTitleClient(): Promise<void>;
|
|
30
|
+
export declare function smokeTestTinyTitleWorker({ timeoutMs, }?: {
|
|
31
|
+
timeoutMs?: number;
|
|
32
|
+
}): Promise<void>;
|