@oh-my-pi/pi-coding-agent 15.7.1 → 15.7.3
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 +95 -6
- package/dist/types/auto-thinking/classifier.d.ts +35 -0
- package/dist/types/cli/args.d.ts +1 -1
- package/dist/types/cli/extension-flags.d.ts +36 -0
- package/dist/types/config/config-file.d.ts +4 -0
- package/dist/types/config/file-lock.d.ts +23 -0
- package/dist/types/config/keybindings.d.ts +2 -1
- package/dist/types/config/model-registry.d.ts +6 -0
- package/dist/types/config/settings-schema.d.ts +112 -69
- package/dist/types/edit/hashline/diff.d.ts +9 -3
- package/dist/types/eval/__tests__/agent-bridge.test.d.ts +1 -0
- package/dist/types/eval/__tests__/budget-bridge.test.d.ts +1 -0
- package/dist/types/eval/__tests__/idle-timeout.test.d.ts +1 -0
- package/dist/types/eval/agent-bridge.d.ts +25 -0
- package/dist/types/eval/backend.d.ts +17 -2
- package/dist/types/eval/budget-bridge.d.ts +29 -0
- package/dist/types/eval/idle-timeout.d.ts +28 -0
- package/dist/types/eval/js/executor.d.ts +8 -0
- package/dist/types/eval/js/tool-bridge.d.ts +2 -1
- package/dist/types/eval/py/executor.d.ts +13 -0
- package/dist/types/exec/bash-executor.d.ts +1 -0
- package/dist/types/extensibility/custom-tools/types.d.ts +2 -2
- package/dist/types/extensibility/extensions/runner.d.ts +7 -0
- package/dist/types/extensibility/plugins/git-url.d.ts +11 -1
- package/dist/types/extensibility/plugins/manager.d.ts +12 -1
- package/dist/types/extensibility/shared-events.d.ts +2 -2
- package/dist/types/memory-backend/index.d.ts +1 -1
- package/dist/types/memory-backend/resolve.d.ts +1 -1
- package/dist/types/memory-backend/types.d.ts +3 -3
- package/dist/types/mnemopi/backend.d.ts +4 -0
- package/dist/types/mnemopi/config.d.ts +29 -0
- package/dist/types/mnemopi/state.d.ts +72 -0
- package/dist/types/modes/components/custom-editor.d.ts +2 -2
- package/dist/types/modes/components/model-selector.d.ts +3 -2
- package/dist/types/modes/components/omfg-panel.d.ts +19 -0
- package/dist/types/modes/controllers/command-controller.d.ts +7 -0
- package/dist/types/modes/controllers/input-controller.d.ts +1 -3
- package/dist/types/modes/controllers/omfg-controller.d.ts +10 -0
- package/dist/types/modes/controllers/omfg-rule.d.ts +26 -0
- package/dist/types/modes/gradient-highlight.d.ts +5 -1
- package/dist/types/modes/interactive-mode.d.ts +7 -3
- package/dist/types/modes/magic-keywords.d.ts +14 -0
- package/dist/types/modes/markdown-prose.d.ts +27 -0
- package/dist/types/modes/orchestrate.d.ts +7 -2
- package/dist/types/modes/shared.d.ts +1 -1
- package/dist/types/modes/theme/theme.d.ts +2 -1
- package/dist/types/modes/turn-budget.d.ts +18 -0
- package/dist/types/modes/types.d.ts +7 -3
- package/dist/types/modes/ultrathink.d.ts +7 -2
- package/dist/types/modes/workflow.d.ts +15 -0
- package/dist/types/sdk.d.ts +15 -4
- package/dist/types/session/agent-session.d.ts +59 -23
- package/dist/types/session/session-manager.d.ts +18 -0
- package/dist/types/session/session-storage.d.ts +6 -0
- package/dist/types/session/shake-types.d.ts +24 -0
- package/dist/types/task/executor.d.ts +2 -2
- package/dist/types/thinking.d.ts +39 -1
- package/dist/types/tiny/device.d.ts +3 -3
- package/dist/types/tiny/models.d.ts +34 -1
- package/dist/types/tiny/title-protocol.d.ts +4 -0
- package/dist/types/tools/index.d.ts +19 -3
- package/dist/types/tools/memory-edit.d.ts +1 -1
- package/examples/sdk/09-api-keys-and-oauth.ts +2 -2
- package/package.json +10 -10
- package/src/auto-thinking/classifier.ts +180 -0
- package/src/autoresearch/tools/run-experiment.ts +45 -113
- package/src/cli/args.ts +39 -16
- package/src/cli/extension-flags.ts +48 -0
- package/src/cli/plugin-cli.ts +11 -2
- package/src/config/config-file.ts +98 -13
- package/src/config/file-lock.ts +60 -17
- package/src/config/keybindings.ts +78 -27
- package/src/config/model-registry.ts +7 -1
- package/src/config/settings-schema.ts +118 -71
- package/src/config/settings.ts +12 -0
- package/src/edit/hashline/diff.ts +87 -22
- package/src/edit/renderer.ts +16 -12
- package/src/edit/streaming.ts +17 -6
- package/src/eval/__tests__/agent-bridge.test.ts +433 -0
- package/src/eval/__tests__/budget-bridge.test.ts +69 -0
- package/src/eval/__tests__/idle-timeout.test.ts +66 -0
- package/src/eval/__tests__/shared-executors.test.ts +53 -0
- package/src/eval/agent-bridge.ts +295 -0
- package/src/eval/backend.ts +17 -2
- package/src/eval/budget-bridge.ts +48 -0
- package/src/eval/idle-timeout.ts +80 -0
- package/src/eval/js/executor.ts +35 -7
- package/src/eval/js/index.ts +2 -1
- package/src/eval/js/shared/local-module-loader.ts +75 -10
- package/src/eval/js/shared/prelude.txt +85 -1
- package/src/eval/js/tool-bridge.ts +9 -0
- package/src/eval/py/executor.ts +41 -14
- package/src/eval/py/index.ts +2 -1
- package/src/eval/py/prelude.py +132 -1
- package/src/exec/bash-executor.ts +2 -3
- package/src/extensibility/custom-tools/types.ts +2 -2
- package/src/extensibility/extensions/runner.ts +12 -2
- package/src/extensibility/plugins/git-url.ts +90 -4
- package/src/extensibility/plugins/manager.ts +103 -7
- package/src/extensibility/shared-events.ts +2 -2
- package/src/internal-urls/docs-index.generated.ts +88 -88
- package/src/main.ts +50 -56
- package/src/memory-backend/index.ts +1 -1
- package/src/memory-backend/resolve.ts +3 -3
- package/src/memory-backend/types.ts +3 -3
- package/src/{mnemosyne → mnemopi}/backend.ts +70 -70
- package/src/{mnemosyne → mnemopi}/config.ts +36 -36
- package/src/{mnemosyne → mnemopi}/state.ts +67 -67
- package/src/modes/acp/acp-agent.ts +13 -3
- package/src/modes/components/agent-dashboard.ts +6 -6
- package/src/modes/components/custom-editor.ts +4 -11
- package/src/modes/components/extensions/state-manager.ts +3 -4
- package/src/modes/components/footer.ts +18 -12
- package/src/modes/components/hook-selector.ts +86 -20
- package/src/modes/components/model-selector.ts +20 -11
- package/src/modes/components/oauth-selector.ts +93 -21
- package/src/modes/components/omfg-panel.ts +141 -0
- package/src/modes/components/settings-defs.ts +9 -2
- package/src/modes/components/settings-selector.ts +4 -1
- package/src/modes/components/status-line/segments.ts +13 -5
- package/src/modes/components/tips.txt +2 -1
- package/src/modes/components/tool-execution.ts +38 -19
- package/src/modes/components/tree-selector.ts +4 -3
- package/src/modes/components/user-message-selector.ts +94 -19
- package/src/modes/components/user-message.ts +8 -1
- package/src/modes/controllers/command-controller.ts +57 -0
- package/src/modes/controllers/event-controller.ts +65 -3
- package/src/modes/controllers/input-controller.ts +14 -11
- package/src/modes/controllers/omfg-controller.ts +283 -0
- package/src/modes/controllers/omfg-rule.ts +647 -0
- package/src/modes/controllers/selector-controller.ts +21 -6
- package/src/modes/gradient-highlight.ts +23 -6
- package/src/modes/interactive-mode.ts +41 -7
- package/src/modes/magic-keywords.ts +20 -0
- package/src/modes/markdown-prose.ts +247 -0
- package/src/modes/orchestrate.ts +17 -11
- package/src/modes/shared.ts +3 -11
- package/src/modes/theme/theme.ts +6 -0
- package/src/modes/turn-budget.ts +31 -0
- package/src/modes/types.ts +7 -1
- package/src/modes/ultrathink.ts +16 -10
- package/src/modes/utils/hotkeys-markdown.ts +1 -1
- package/src/modes/workflow.ts +42 -0
- package/src/prompts/system/auto-thinking-difficulty-local.md +14 -0
- package/src/prompts/system/auto-thinking-difficulty.md +12 -0
- package/src/prompts/system/omfg-user.md +51 -0
- package/src/prompts/system/system-prompt.md +1 -0
- package/src/prompts/system/workflow-notice.md +70 -0
- package/src/prompts/tools/eval.md +13 -1
- package/src/prompts/tools/memory-edit.md +1 -1
- package/src/sdk.ts +86 -38
- package/src/session/agent-session.ts +558 -80
- package/src/session/session-manager.ts +32 -0
- package/src/session/session-storage.ts +68 -8
- package/src/session/shake-types.ts +44 -0
- package/src/slash-commands/builtin-registry.ts +41 -16
- package/src/task/executor.ts +3 -3
- package/src/task/index.ts +6 -6
- package/src/thinking.ts +73 -1
- package/src/tiny/device.ts +4 -10
- package/src/tiny/models.ts +54 -2
- package/src/tiny/title-protocol.ts +11 -1
- package/src/tiny/worker.ts +19 -7
- package/src/tools/eval.ts +202 -26
- package/src/tools/grouped-file-output.ts +9 -2
- package/src/tools/index.ts +17 -5
- package/src/tools/memory-edit.ts +4 -4
- package/src/tools/memory-recall.ts +5 -5
- package/src/tools/memory-reflect.ts +5 -5
- package/src/tools/memory-retain.ts +4 -4
- package/src/tools/render-utils.ts +2 -1
- package/src/tools/search.ts +480 -76
- package/dist/types/mnemosyne/backend.d.ts +0 -4
- package/dist/types/mnemosyne/config.d.ts +0 -29
- package/dist/types/mnemosyne/state.d.ts +0 -72
- /package/dist/types/{mnemosyne → mnemopi}/index.d.ts +0 -0
- /package/src/{mnemosyne → mnemopi}/index.ts +0 -0
|
@@ -19,10 +19,14 @@ export type GitSource = {
|
|
|
19
19
|
* Parse git source into a GitSource.
|
|
20
20
|
*
|
|
21
21
|
* Rules:
|
|
22
|
-
* -
|
|
22
|
+
* - Namespaced shorthand (`github:user/repo`, `gitlab:`, `bitbucket:`,
|
|
23
|
+
* `codeberg:`, `sourcehut:`/`srht:`) is accepted directly; installers should
|
|
24
|
+
* normalize entries that bun does not understand natively.
|
|
25
|
+
* - With `git:` prefix, accept generic shorthand forms.
|
|
23
26
|
* - Without `git:` prefix, only accept explicit protocol URLs.
|
|
24
27
|
*
|
|
25
28
|
* Handles:
|
|
29
|
+
* - `github:user/repo[#ref]`-style namespaced shorthand
|
|
26
30
|
* - `git:` prefixed URLs (`git:github.com/user/repo`)
|
|
27
31
|
* - SSH SCP-like URLs (`git:git@github.com:user/repo`)
|
|
28
32
|
* - HTTPS/HTTP/SSH/git protocol URLs
|
|
@@ -32,3 +36,9 @@ export type GitSource = {
|
|
|
32
36
|
* Falls back to generic URL parsing for other hosts.
|
|
33
37
|
*/
|
|
34
38
|
export declare function parseGitUrl(source: string): GitSource | null;
|
|
39
|
+
/**
|
|
40
|
+
* Returns true if the spec is parseable as a git source (protocol URL,
|
|
41
|
+
* scp-like SSH wrapped in `git:`, plain `git:` shorthand, or namespaced
|
|
42
|
+
* shorthand like `github:user/repo`). The inverse of "this is an npm spec".
|
|
43
|
+
*/
|
|
44
|
+
export declare function isGitSpec(spec: string): boolean;
|
|
@@ -3,7 +3,18 @@ export declare class PluginManager {
|
|
|
3
3
|
#private;
|
|
4
4
|
constructor(cwd?: string);
|
|
5
5
|
/**
|
|
6
|
-
* Install a plugin
|
|
6
|
+
* Install a plugin with optional feature selection.
|
|
7
|
+
*
|
|
8
|
+
* Accepts:
|
|
9
|
+
* - npm specs: `pkg`, `pkg@1.2.3`, `@scope/pkg`, `pkg[features]`
|
|
10
|
+
* - namespaced git shorthand: `github:user/repo[#ref]`, `gitlab:`, `bitbucket:`,
|
|
11
|
+
* `codeberg:`, `sourcehut:`/`srht:`
|
|
12
|
+
* - full git URLs: `https://github.com/user/repo`, `git@github.com:user/repo`,
|
|
13
|
+
* `ssh://…`, `git+https://…`
|
|
14
|
+
*
|
|
15
|
+
* For git specs the package name is not knowable from the spec, so the
|
|
16
|
+
* installer diffs `plugins/package.json` `dependencies` before and after
|
|
17
|
+
* to find the newly added key.
|
|
7
18
|
*
|
|
8
19
|
* @param specString - Package specifier with optional features: "pkg", "pkg[feat]", "pkg[*]", "pkg[]"
|
|
9
20
|
* @param options - Install options
|
|
@@ -160,12 +160,12 @@ export interface TurnEndEvent {
|
|
|
160
160
|
export interface AutoCompactionStartEvent {
|
|
161
161
|
type: "auto_compaction_start";
|
|
162
162
|
reason: "threshold" | "overflow" | "idle" | "incomplete";
|
|
163
|
-
action: "context-full" | "handoff";
|
|
163
|
+
action: "context-full" | "handoff" | "shake" | "shake-summary";
|
|
164
164
|
}
|
|
165
165
|
/** Fired when auto-compaction ends */
|
|
166
166
|
export interface AutoCompactionEndEvent {
|
|
167
167
|
type: "auto_compaction_end";
|
|
168
|
-
action: "context-full" | "handoff";
|
|
168
|
+
action: "context-full" | "handoff" | "shake" | "shake-summary";
|
|
169
169
|
result: CompactionResult | undefined;
|
|
170
170
|
aborted: boolean;
|
|
171
171
|
willRetry: boolean;
|
|
@@ -6,7 +6,7 @@ import type { MemoryBackend } from "./types";
|
|
|
6
6
|
* Selection rules (single source of truth — every memory consumer routes
|
|
7
7
|
* through this):
|
|
8
8
|
* - `memory.backend === "hindsight"` → Hindsight remote memory
|
|
9
|
-
* - `memory.backend === "
|
|
9
|
+
* - `memory.backend === "mnemopi"` → local Mnemopi SQLite memory
|
|
10
10
|
* - `memory.backend === "local"` → local rollout summary pipeline
|
|
11
11
|
* - everything else → no-op
|
|
12
12
|
*
|
|
@@ -9,9 +9,9 @@ import type { AgentMessage } from "@oh-my-pi/pi-agent-core";
|
|
|
9
9
|
import type { ModelRegistry } from "../config/model-registry";
|
|
10
10
|
import type { Settings } from "../config/settings";
|
|
11
11
|
import type { HindsightSessionState } from "../hindsight/state";
|
|
12
|
-
import type {
|
|
12
|
+
import type { MnemopiSessionState } from "../mnemopi/state";
|
|
13
13
|
import type { AgentSession } from "../session/agent-session";
|
|
14
|
-
export type MemoryBackendId = "off" | "local" | "hindsight" | "
|
|
14
|
+
export type MemoryBackendId = "off" | "local" | "hindsight" | "mnemopi";
|
|
15
15
|
export interface MemoryBackendStartOptions {
|
|
16
16
|
session: AgentSession;
|
|
17
17
|
settings: Settings;
|
|
@@ -19,7 +19,7 @@ export interface MemoryBackendStartOptions {
|
|
|
19
19
|
agentDir: string;
|
|
20
20
|
taskDepth: number;
|
|
21
21
|
parentHindsightSessionState?: HindsightSessionState;
|
|
22
|
-
|
|
22
|
+
parentMnemopiSessionState?: MnemopiSessionState;
|
|
23
23
|
}
|
|
24
24
|
export interface MemoryBackend {
|
|
25
25
|
readonly id: MemoryBackendId;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { MnemopiOptions } from "@oh-my-pi/pi-mnemopi";
|
|
2
|
+
import type { Settings } from "../config/settings";
|
|
3
|
+
export type MnemopiLlmMode = "none" | "smol" | "remote";
|
|
4
|
+
export type MnemopiScoping = "global" | "per-project" | "per-project-tagged";
|
|
5
|
+
export type MnemopiProviderOptions = Pick<MnemopiOptions, "noEmbeddings" | "embeddingModel" | "embeddingApiUrl" | "embeddingApiKey" | "llm">;
|
|
6
|
+
export interface MnemopiBackendConfig {
|
|
7
|
+
dbPath: string;
|
|
8
|
+
baseBank?: string;
|
|
9
|
+
bank: string;
|
|
10
|
+
globalBank?: string;
|
|
11
|
+
retainBank?: string;
|
|
12
|
+
recallBanks?: readonly string[];
|
|
13
|
+
scoping?: MnemopiScoping;
|
|
14
|
+
autoRecall: boolean;
|
|
15
|
+
autoRetain: boolean;
|
|
16
|
+
retainEveryNTurns: number;
|
|
17
|
+
recallLimit: number;
|
|
18
|
+
recallContextTurns: number;
|
|
19
|
+
recallMaxQueryChars: number;
|
|
20
|
+
injectionTokenLimit: number;
|
|
21
|
+
debug: boolean;
|
|
22
|
+
providerOptions: MnemopiProviderOptions;
|
|
23
|
+
llmMode: MnemopiLlmMode;
|
|
24
|
+
llmBaseUrl?: string;
|
|
25
|
+
llmApiKey?: string;
|
|
26
|
+
llmModel?: string;
|
|
27
|
+
}
|
|
28
|
+
export declare function loadMnemopiConfig(settings: Settings, agentDir: string): MnemopiBackendConfig;
|
|
29
|
+
export declare function truncateApproxTokens(text: string, tokenLimit: number): string;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { AgentMessage } from "@oh-my-pi/pi-agent-core";
|
|
2
|
+
import { Mnemopi, type RecallResult } from "@oh-my-pi/pi-mnemopi";
|
|
3
|
+
import type { AgentSession } from "../session/agent-session";
|
|
4
|
+
import type { MnemopiBackendConfig } from "./config";
|
|
5
|
+
interface MnemopiScopedMemory {
|
|
6
|
+
bank: string;
|
|
7
|
+
memory: Mnemopi;
|
|
8
|
+
}
|
|
9
|
+
type MnemopiRememberInput = Parameters<Mnemopi["remember"]>[0];
|
|
10
|
+
type MnemopiRememberOptions = Parameters<Mnemopi["remember"]>[1];
|
|
11
|
+
export type MnemopiMemoryEditOperation = "update" | "forget" | "invalidate";
|
|
12
|
+
export interface MnemopiMemoryEditOptions {
|
|
13
|
+
content?: string;
|
|
14
|
+
importance?: number;
|
|
15
|
+
replacementId?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface MnemopiMemoryEditResult {
|
|
18
|
+
status: "updated" | "deleted" | "invalidated" | "not_found";
|
|
19
|
+
bank?: string;
|
|
20
|
+
store?: "working" | "episodic";
|
|
21
|
+
}
|
|
22
|
+
export declare function getMnemopiSessionState(session: AgentSession | undefined): MnemopiSessionState | undefined;
|
|
23
|
+
export declare function setMnemopiSessionState(session: AgentSession, state: MnemopiSessionState | undefined): MnemopiSessionState | undefined;
|
|
24
|
+
export interface MnemopiSessionStateOptions {
|
|
25
|
+
sessionId: string;
|
|
26
|
+
config: MnemopiBackendConfig;
|
|
27
|
+
session: AgentSession;
|
|
28
|
+
aliasOf?: MnemopiSessionState;
|
|
29
|
+
lastRetainedTurn?: number;
|
|
30
|
+
hasRecalledForFirstTurn?: boolean;
|
|
31
|
+
}
|
|
32
|
+
export declare class MnemopiSessionState {
|
|
33
|
+
sessionId: string;
|
|
34
|
+
readonly config: MnemopiBackendConfig;
|
|
35
|
+
readonly session: AgentSession;
|
|
36
|
+
readonly memory: Mnemopi;
|
|
37
|
+
readonly globalMemory?: Mnemopi;
|
|
38
|
+
readonly aliasOf?: MnemopiSessionState;
|
|
39
|
+
private readonly scoped;
|
|
40
|
+
lastRetainedTurn: number;
|
|
41
|
+
hasRecalledForFirstTurn: boolean;
|
|
42
|
+
lastRecallSnippet?: string;
|
|
43
|
+
unsubscribe?: () => void;
|
|
44
|
+
constructor(options: MnemopiSessionStateOptions);
|
|
45
|
+
setSessionId(sessionId: string): void;
|
|
46
|
+
resetConversationTracking(): void;
|
|
47
|
+
getScopedRecallTargets(): readonly MnemopiScopedMemory[];
|
|
48
|
+
getScopedRetainTarget(): MnemopiScopedMemory;
|
|
49
|
+
editScopedMemory(op: MnemopiMemoryEditOperation, id: string, options?: MnemopiMemoryEditOptions): MnemopiMemoryEditResult;
|
|
50
|
+
formatScopedRecallWithIds(results: readonly RecallResult[]): string;
|
|
51
|
+
collectScopedRecallResults(query: string): RecallResult[];
|
|
52
|
+
recallResultsScoped(query: string): RecallResult[];
|
|
53
|
+
formatScopedRecallContext(results: readonly RecallResult[], format?: "bullet" | "json"): string | undefined;
|
|
54
|
+
formatContextScoped(results: readonly RecallResult[], format?: "bullet" | "json"): string;
|
|
55
|
+
rememberInScope(memory: MnemopiRememberInput, options?: MnemopiRememberOptions): string | undefined;
|
|
56
|
+
rememberScoped(memory: MnemopiRememberInput, options?: MnemopiRememberOptions): string | undefined;
|
|
57
|
+
recallForContext(query: string): Promise<string | undefined>;
|
|
58
|
+
beforeAgentStartPrompt(promptText: string): Promise<string | undefined>;
|
|
59
|
+
recallForCompaction(messages: AgentMessage[]): Promise<string | undefined>;
|
|
60
|
+
maybeRetainOnAgentEnd(_messages: AgentMessage[]): Promise<void>;
|
|
61
|
+
forceRetainCurrentSession(): Promise<void>;
|
|
62
|
+
retainMessages(messages: Array<{
|
|
63
|
+
role: string;
|
|
64
|
+
content: string;
|
|
65
|
+
}>, sourceId: string): Promise<void>;
|
|
66
|
+
attachSessionListeners(): void;
|
|
67
|
+
maybeRecallOnAgentStart(): Promise<void>;
|
|
68
|
+
dispose(): void;
|
|
69
|
+
}
|
|
70
|
+
export declare function getMnemopiScopedDbPaths(config: MnemopiBackendConfig): readonly string[];
|
|
71
|
+
export declare function getMnemopiScopedBanks(config: MnemopiBackendConfig): readonly string[];
|
|
72
|
+
export {};
|
|
@@ -6,7 +6,8 @@ type ConfigurableEditorAction = Extract<AppKeybinding, "app.interrupt" | "app.cl
|
|
|
6
6
|
*/
|
|
7
7
|
export declare class CustomEditor extends Editor {
|
|
8
8
|
#private;
|
|
9
|
-
/** Gradient-highlight the "ultrathink" / "orchestrate" keywords as the user types
|
|
9
|
+
/** Gradient-highlight the "ultrathink" / "orchestrate" / "workflow" keywords as the user types
|
|
10
|
+
* them, skipping any occurrence inside code spans, fenced blocks, or XML sections. */
|
|
10
11
|
decorateText: (text: string) => string;
|
|
11
12
|
onEscape?: () => void;
|
|
12
13
|
shouldBypassAutocompleteOnEscape?: () => boolean;
|
|
@@ -21,7 +22,6 @@ export declare class CustomEditor extends Editor {
|
|
|
21
22
|
onExternalEditor?: () => void;
|
|
22
23
|
onHistorySearch?: () => void;
|
|
23
24
|
onSuspend?: () => void;
|
|
24
|
-
onShowHotkeys?: () => void;
|
|
25
25
|
onSelectModelTemporary?: () => void;
|
|
26
26
|
/** Called when the configured copy-prompt shortcut is pressed. */
|
|
27
27
|
onCopyPrompt?: () => void;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { ThinkingLevel } from "@oh-my-pi/pi-agent-core";
|
|
2
1
|
import { type Model } from "@oh-my-pi/pi-ai";
|
|
3
2
|
import { Container, Input, type TUI } from "@oh-my-pi/pi-tui";
|
|
4
3
|
import type { ModelRegistry } from "../../config/model-registry";
|
|
5
4
|
import type { Settings } from "../../config/settings";
|
|
5
|
+
import { type ConfiguredThinkingLevel } from "../../thinking";
|
|
6
6
|
interface ScopedModelItem {
|
|
7
7
|
model: Model;
|
|
8
8
|
thinkingLevel?: string;
|
|
9
9
|
}
|
|
10
|
+
type RoleSelectCallback = (model: Model, role: string | null, thinkingLevel?: ConfiguredThinkingLevel, selector?: string) => void;
|
|
10
11
|
/**
|
|
11
12
|
* Component that renders a model selector with provider tabs and context menu.
|
|
12
13
|
* - Tab/Arrow Left/Right: Switch between provider tabs
|
|
@@ -16,7 +17,7 @@ interface ScopedModelItem {
|
|
|
16
17
|
*/
|
|
17
18
|
export declare class ModelSelectorComponent extends Container {
|
|
18
19
|
#private;
|
|
19
|
-
constructor(tui: TUI, _currentModel: Model | undefined, settings: Settings, modelRegistry: ModelRegistry, scopedModels: ReadonlyArray<ScopedModelItem>, onSelect:
|
|
20
|
+
constructor(tui: TUI, _currentModel: Model | undefined, settings: Settings, modelRegistry: ModelRegistry, scopedModels: ReadonlyArray<ScopedModelItem>, onSelect: RoleSelectCallback, onCancel: () => void, options?: {
|
|
20
21
|
temporaryOnly?: boolean;
|
|
21
22
|
initialSearchInput?: string;
|
|
22
23
|
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Container, type TUI } from "@oh-my-pi/pi-tui";
|
|
2
|
+
export type OmfgPanelState = "generating" | "validating" | "confirming" | "saving" | "saved" | "rejected" | "aborted" | "error";
|
|
3
|
+
interface OmfgPanelComponentOptions {
|
|
4
|
+
complaint: string;
|
|
5
|
+
tui: TUI;
|
|
6
|
+
}
|
|
7
|
+
export declare class OmfgPanelComponent extends Container {
|
|
8
|
+
#private;
|
|
9
|
+
constructor(options: OmfgPanelComponentOptions);
|
|
10
|
+
appendDraft(delta: string): void;
|
|
11
|
+
setRule(text: string): void;
|
|
12
|
+
setStatus(state: OmfgPanelState, status: string): void;
|
|
13
|
+
markSaved(path: string): void;
|
|
14
|
+
markRejected(): void;
|
|
15
|
+
markAborted(): void;
|
|
16
|
+
markError(message: string): void;
|
|
17
|
+
close(): void;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -3,6 +3,7 @@ import { type ProviderDetails, type UsageReport } from "@oh-my-pi/pi-ai";
|
|
|
3
3
|
import type { CompactOptions } from "../../extensibility/extensions/types";
|
|
4
4
|
import { theme } from "../../modes/theme/theme";
|
|
5
5
|
import type { InteractiveModeContext } from "../../modes/types";
|
|
6
|
+
import { type ShakeMode } from "../../session/shake-types";
|
|
6
7
|
export declare class CommandController {
|
|
7
8
|
#private;
|
|
8
9
|
private readonly ctx;
|
|
@@ -29,6 +30,12 @@ export declare class CommandController {
|
|
|
29
30
|
handleBashCommand(command: string, excludeFromContext?: boolean): Promise<void>;
|
|
30
31
|
handlePythonCommand(code: string, excludeFromContext?: boolean): Promise<void>;
|
|
31
32
|
handleCompactCommand(customInstructions?: string): Promise<CompactionOutcome>;
|
|
33
|
+
/**
|
|
34
|
+
* TUI handler for `/shake`. `elide`/`images` are instant structural drops;
|
|
35
|
+
* `summary` runs the local on-device compressor behind a cancelable loader
|
|
36
|
+
* (Esc aborts via `abortCompaction`). Rebuilds the chat and reports counts.
|
|
37
|
+
*/
|
|
38
|
+
handleShakeCommand(mode: ShakeMode): Promise<void>;
|
|
32
39
|
handleSkillCommand(skillPath: string, args: string): Promise<void>;
|
|
33
40
|
executeCompaction(customInstructionsOrOptions?: string | CompactOptions, isAuto?: boolean): Promise<CompactionOutcome>;
|
|
34
41
|
handleHandoffCommand(customInstructions?: string): Promise<void>;
|
|
@@ -24,9 +24,7 @@ export declare class InputController {
|
|
|
24
24
|
/** Copy current prompt text to system clipboard. */
|
|
25
25
|
handleCopyPrompt(): void;
|
|
26
26
|
cycleThinkingLevel(): void;
|
|
27
|
-
cycleRoleModel(
|
|
28
|
-
temporary?: boolean;
|
|
29
|
-
}): Promise<void>;
|
|
27
|
+
cycleRoleModel(direction?: "forward" | "backward"): Promise<void>;
|
|
30
28
|
toggleToolOutputExpansion(): void;
|
|
31
29
|
setToolsExpanded(expanded: boolean): void;
|
|
32
30
|
toggleThinkingBlockVisibility(): void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { InteractiveModeContext } from "../types";
|
|
2
|
+
export declare class OmfgController {
|
|
3
|
+
#private;
|
|
4
|
+
private readonly ctx;
|
|
5
|
+
constructor(ctx: InteractiveModeContext);
|
|
6
|
+
hasActiveRequest(): boolean;
|
|
7
|
+
handleEscape(): boolean;
|
|
8
|
+
dispose(): void;
|
|
9
|
+
start(complaint: string): Promise<void>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { AgentMessage } from "@oh-my-pi/pi-agent-core";
|
|
2
|
+
import type { Rule } from "../../capability/rule";
|
|
3
|
+
export interface ParsedGeneratedRule {
|
|
4
|
+
rule: Rule;
|
|
5
|
+
fileContent: string;
|
|
6
|
+
}
|
|
7
|
+
export type GeneratedRuleParseResult = ParsedGeneratedRule | {
|
|
8
|
+
error: string;
|
|
9
|
+
};
|
|
10
|
+
export interface RuleHistoryValidation {
|
|
11
|
+
matched: boolean;
|
|
12
|
+
feedback?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface ParsedRuleHistoryValidation {
|
|
15
|
+
candidate: ParsedGeneratedRule;
|
|
16
|
+
validation: RuleHistoryValidation;
|
|
17
|
+
repairedCondition: boolean;
|
|
18
|
+
}
|
|
19
|
+
export type OmfgRuleSourceLevel = "project" | "user";
|
|
20
|
+
export declare function extractGeneratedRuleJson(text: string): string | null;
|
|
21
|
+
export declare function sanitizeRuleName(rawName: string): string;
|
|
22
|
+
export declare function buildOmfgRuleForPath(ruleName: string, fileContent: string, filePath: string, level: OmfgRuleSourceLevel): Rule;
|
|
23
|
+
export declare function parseGeneratedRule(text: string): GeneratedRuleParseResult;
|
|
24
|
+
export declare function validateRuleAgainstAssistantHistory(rule: Rule, messages: readonly AgentMessage[]): RuleHistoryValidation;
|
|
25
|
+
export declare function validateParsedRuleAgainstAssistantHistory(candidate: ParsedGeneratedRule, messages: readonly AgentMessage[]): ParsedRuleHistoryValidation;
|
|
26
|
+
export declare function ruleMatchesAssistantHistory(rule: Rule, messages: readonly AgentMessage[]): boolean;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/** A gradient keyword highlighter. `resetTo` is the SGR foreground sequence
|
|
2
|
+
* re-emitted after each painted keyword so surrounding text keeps its color;
|
|
3
|
+
* it defaults to a plain foreground reset (editor / default-colored text). */
|
|
4
|
+
export type KeywordHighlighter = (text: string, resetTo?: string) => string;
|
|
1
5
|
/** Declarative spec for {@link createGradientHighlighter}. */
|
|
2
6
|
export interface GradientHighlightSpec {
|
|
3
7
|
/** Cheap, stateless presence probe used to skip the boundary regex on most lines. Must be non-global. */
|
|
@@ -20,4 +24,4 @@ export interface GradientHighlightSpec {
|
|
|
20
24
|
* untouched when `probe` does not match. The palette is compiled lazily and
|
|
21
25
|
* memoized per active color mode.
|
|
22
26
|
*/
|
|
23
|
-
export declare function createGradientHighlighter(spec: GradientHighlightSpec):
|
|
27
|
+
export declare function createGradientHighlighter(spec: GradientHighlightSpec): KeywordHighlighter;
|
|
@@ -11,6 +11,7 @@ import { type PlanApprovalDetails } from "../plan-mode/approved-plan";
|
|
|
11
11
|
import type { AgentSession, AgentSessionEvent } from "../session/agent-session";
|
|
12
12
|
import { HistoryStorage } from "../session/history-storage";
|
|
13
13
|
import type { SessionContext, SessionManager } from "../session/session-manager";
|
|
14
|
+
import type { ShakeMode } from "../session/shake-types";
|
|
14
15
|
import type { LspStartupServerInfo } from "../tools";
|
|
15
16
|
import type { EventBus } from "../utils/event-bus";
|
|
16
17
|
import type { AssistantMessageComponent } from "./components/assistant-message";
|
|
@@ -53,6 +54,7 @@ export declare class InteractiveMode implements InteractiveModeContext {
|
|
|
53
54
|
statusContainer: Container;
|
|
54
55
|
todoContainer: Container;
|
|
55
56
|
btwContainer: Container;
|
|
57
|
+
omfgContainer: Container;
|
|
56
58
|
editor: CustomEditor;
|
|
57
59
|
editorContainer: Container;
|
|
58
60
|
hookWidgetContainerAbove: Container;
|
|
@@ -207,6 +209,7 @@ export declare class InteractiveMode implements InteractiveModeContext {
|
|
|
207
209
|
handleSSHCommand(text: string): Promise<void>;
|
|
208
210
|
handleCompactCommand(customInstructions?: string): Promise<CompactionOutcome>;
|
|
209
211
|
handleHandoffCommand(customInstructions?: string): Promise<void>;
|
|
212
|
+
handleShakeCommand(mode: ShakeMode): Promise<void>;
|
|
210
213
|
executeCompaction(customInstructionsOrOptions?: string | CompactOptions, isAuto?: boolean): Promise<CompactionOutcome>;
|
|
211
214
|
openInBrowser(urlOrPath: string): void;
|
|
212
215
|
showSettingsSelector(): void;
|
|
@@ -233,10 +236,11 @@ export declare class InteractiveMode implements InteractiveModeContext {
|
|
|
233
236
|
handleBtwCommand(question: string): Promise<void>;
|
|
234
237
|
hasActiveBtw(): boolean;
|
|
235
238
|
handleBtwEscape(): boolean;
|
|
239
|
+
handleOmfgCommand(complaint: string): Promise<void>;
|
|
240
|
+
hasActiveOmfg(): boolean;
|
|
241
|
+
handleOmfgEscape(): boolean;
|
|
236
242
|
cycleThinkingLevel(): void;
|
|
237
|
-
cycleRoleModel(
|
|
238
|
-
temporary?: boolean;
|
|
239
|
-
}): Promise<void>;
|
|
243
|
+
cycleRoleModel(direction?: "forward" | "backward"): Promise<void>;
|
|
240
244
|
toggleToolOutputExpansion(): void;
|
|
241
245
|
setToolsExpanded(expanded: boolean): void;
|
|
242
246
|
toggleThinkingBlockVisibility(): void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gradient-highlight every magic keyword ("ultrathink", "orchestrate",
|
|
3
|
+
* "workflow") that appears as standalone prose, skipping any occurrence inside a
|
|
4
|
+
* code block, inline code span, or XML/HTML section. Each highlighter paints its
|
|
5
|
+
* own keyword with its own gradient, so chaining is order-independent — the
|
|
6
|
+
* earlier passes only inject zero-width SGR escapes (no backticks or angle
|
|
7
|
+
* brackets), which never confuse the later passes' markdown masking.
|
|
8
|
+
*
|
|
9
|
+
* `resetTo` is the SGR foreground sequence restored after each painted keyword;
|
|
10
|
+
* pass the surrounding text color when decorating already-colored content (e.g.
|
|
11
|
+
* a themed message bubble) so the gradient does not bleed into the rest of the
|
|
12
|
+
* line. Defaults to a plain foreground reset for default-colored editor text.
|
|
13
|
+
*/
|
|
14
|
+
export declare function highlightMagicKeywords(text: string, resetTo?: string): string;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Markdown structure awareness for the magic-keyword affordances
|
|
3
|
+
* ("ultrathink"/"orchestrate"/"workflow").
|
|
4
|
+
*
|
|
5
|
+
* Keyword detection and editor/transcript highlighting must fire only on prose
|
|
6
|
+
* the user is actually addressing to the model — never on a word that happens to
|
|
7
|
+
* live inside a fenced code block, an inline code span, or an HTML/XML section.
|
|
8
|
+
* {@link maskNonProse} returns a length-preserving copy of the text where every
|
|
9
|
+
* such region is blanked to spaces, so a word-bounded match run against the mask
|
|
10
|
+
* never lands inside code/markup while its indices still address the original
|
|
11
|
+
* text for painting.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Return a copy of `text` with identical length (indices map 1:1) where every
|
|
15
|
+
* character inside a non-prose region is replaced by a space. Non-prose regions
|
|
16
|
+
* are markdown fenced code blocks, inline code spans, and HTML/XML tags together
|
|
17
|
+
* with the content they enclose. Newlines are preserved. Text with no construct
|
|
18
|
+
* that could open such a region is returned unchanged.
|
|
19
|
+
*/
|
|
20
|
+
export declare function maskNonProse(text: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* Whether `text` contains a standalone keyword match (per the non-global,
|
|
23
|
+
* word-bounded `word` regex) that lives in prose rather than inside a code
|
|
24
|
+
* block, inline code span, or HTML/XML section. `word` MUST be non-global so
|
|
25
|
+
* `.test` stays stateless.
|
|
26
|
+
*/
|
|
27
|
+
export declare function keywordInProse(text: string, word: RegExp): boolean;
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
+
import { type KeywordHighlighter } from "./gradient-highlight";
|
|
1
2
|
/** Hidden system notice appended after a user message that mentions "orchestrate". */
|
|
2
3
|
export declare const ORCHESTRATE_NOTICE: string;
|
|
3
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* Whether `text` contains the standalone keyword "orchestrate" (lowercase,
|
|
6
|
+
* whitespace-delimited) in prose — never inside a code block, inline code span,
|
|
7
|
+
* or XML/HTML section.
|
|
8
|
+
*/
|
|
4
9
|
export declare function containsOrchestrate(text: string): boolean;
|
|
5
10
|
/**
|
|
6
11
|
* Highlight every standalone "orchestrate" in `text` for editor display with a
|
|
7
12
|
* cool teal→violet gradient (hue 150..280), visually distinct from ultrathink's
|
|
8
13
|
* full-spectrum rainbow.
|
|
9
14
|
*/
|
|
10
|
-
export declare const highlightOrchestrate:
|
|
15
|
+
export declare const highlightOrchestrate: KeywordHighlighter;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TabBarTheme } from "@oh-my-pi/pi-tui";
|
|
2
|
-
/** Sanitize text for display in a single-line status. Strips ANSI escape sequences, C0/C1 control characters, collapses whitespace, trims. */
|
|
2
|
+
/** Sanitize text for display in a single-line status. Strips ANSI/VT escape sequences, maps remaining C0/C1 control characters to spaces, collapses whitespace, trims. */
|
|
3
3
|
export declare function sanitizeStatusText(text: string): string;
|
|
4
4
|
/** Shared tab bar theme used by model-selector and settings-selector. */
|
|
5
5
|
export declare function getTabBarTheme(): TabBarTheme;
|
|
@@ -6,7 +6,7 @@ export type SymbolPreset = "unicode" | "nerd" | "ascii";
|
|
|
6
6
|
/**
|
|
7
7
|
* All available symbol keys organized by category.
|
|
8
8
|
*/
|
|
9
|
-
export type SymbolKey = "status.success" | "status.error" | "status.warning" | "status.info" | "status.pending" | "status.disabled" | "status.enabled" | "status.running" | "status.shadowed" | "status.aborted" | "nav.cursor" | "nav.selected" | "nav.expand" | "nav.collapse" | "nav.back" | "tree.branch" | "tree.last" | "tree.vertical" | "tree.horizontal" | "tree.hook" | "boxRound.topLeft" | "boxRound.topRight" | "boxRound.bottomLeft" | "boxRound.bottomRight" | "boxRound.horizontal" | "boxRound.vertical" | "boxSharp.topLeft" | "boxSharp.topRight" | "boxSharp.bottomLeft" | "boxSharp.bottomRight" | "boxSharp.horizontal" | "boxSharp.vertical" | "boxSharp.cross" | "boxSharp.teeDown" | "boxSharp.teeUp" | "boxSharp.teeRight" | "boxSharp.teeLeft" | "sep.powerline" | "sep.powerlineThin" | "sep.powerlineLeft" | "sep.powerlineRight" | "sep.powerlineThinLeft" | "sep.powerlineThinRight" | "sep.block" | "sep.space" | "sep.asciiLeft" | "sep.asciiRight" | "sep.dot" | "sep.slash" | "sep.pipe" | "icon.model" | "icon.plan" | "icon.goal" | "icon.pause" | "icon.loop" | "icon.folder" | "icon.scratchFolder" | "icon.file" | "icon.git" | "icon.branch" | "icon.pr" | "icon.tokens" | "icon.context" | "icon.cost" | "icon.time" | "icon.pi" | "icon.agents" | "icon.cache" | "icon.input" | "icon.output" | "icon.host" | "icon.session" | "icon.package" | "icon.warning" | "icon.rewind" | "icon.auto" | "icon.fast" | "icon.extensionSkill" | "icon.extensionTool" | "icon.extensionSlashCommand" | "icon.extensionMcp" | "icon.extensionRule" | "icon.extensionHook" | "icon.extensionPrompt" | "icon.extensionContextFile" | "icon.extensionInstruction" | "icon.mic" | "thinking.minimal" | "thinking.low" | "thinking.medium" | "thinking.high" | "thinking.xhigh" | "checkbox.checked" | "checkbox.unchecked" | "format.bullet" | "format.dash" | "format.bracketLeft" | "format.bracketRight" | "md.quoteBorder" | "md.hrChar" | "md.bullet" | "md.colorSwatch" | "lang.default" | "lang.typescript" | "lang.javascript" | "lang.python" | "lang.rust" | "lang.go" | "lang.java" | "lang.c" | "lang.cpp" | "lang.csharp" | "lang.ruby" | "lang.php" | "lang.swift" | "lang.kotlin" | "lang.shell" | "lang.html" | "lang.css" | "lang.json" | "lang.yaml" | "lang.markdown" | "lang.sql" | "lang.docker" | "lang.lua" | "lang.text" | "lang.env" | "lang.toml" | "lang.xml" | "lang.ini" | "lang.conf" | "lang.log" | "lang.csv" | "lang.tsv" | "lang.image" | "lang.pdf" | "lang.archive" | "lang.binary" | "tab.appearance" | "tab.model" | "tab.interaction" | "tab.context" | "tab.editing" | "tab.tools" | "tab.memory" | "tab.tasks" | "tab.providers";
|
|
9
|
+
export type SymbolKey = "status.success" | "status.error" | "status.warning" | "status.info" | "status.pending" | "status.disabled" | "status.enabled" | "status.running" | "status.shadowed" | "status.aborted" | "nav.cursor" | "nav.selected" | "nav.expand" | "nav.collapse" | "nav.back" | "tree.branch" | "tree.last" | "tree.vertical" | "tree.horizontal" | "tree.hook" | "boxRound.topLeft" | "boxRound.topRight" | "boxRound.bottomLeft" | "boxRound.bottomRight" | "boxRound.horizontal" | "boxRound.vertical" | "boxSharp.topLeft" | "boxSharp.topRight" | "boxSharp.bottomLeft" | "boxSharp.bottomRight" | "boxSharp.horizontal" | "boxSharp.vertical" | "boxSharp.cross" | "boxSharp.teeDown" | "boxSharp.teeUp" | "boxSharp.teeRight" | "boxSharp.teeLeft" | "sep.powerline" | "sep.powerlineThin" | "sep.powerlineLeft" | "sep.powerlineRight" | "sep.powerlineThinLeft" | "sep.powerlineThinRight" | "sep.block" | "sep.space" | "sep.asciiLeft" | "sep.asciiRight" | "sep.dot" | "sep.slash" | "sep.pipe" | "icon.model" | "icon.plan" | "icon.goal" | "icon.pause" | "icon.loop" | "icon.folder" | "icon.scratchFolder" | "icon.file" | "icon.git" | "icon.branch" | "icon.pr" | "icon.tokens" | "icon.context" | "icon.cost" | "icon.time" | "icon.pi" | "icon.agents" | "icon.cache" | "icon.input" | "icon.output" | "icon.host" | "icon.session" | "icon.package" | "icon.warning" | "icon.rewind" | "icon.auto" | "icon.fast" | "icon.extensionSkill" | "icon.extensionTool" | "icon.extensionSlashCommand" | "icon.extensionMcp" | "icon.extensionRule" | "icon.extensionHook" | "icon.extensionPrompt" | "icon.extensionContextFile" | "icon.extensionInstruction" | "icon.mic" | "thinking.minimal" | "thinking.low" | "thinking.medium" | "thinking.high" | "thinking.xhigh" | "thinking.autoPending" | "checkbox.checked" | "checkbox.unchecked" | "format.bullet" | "format.dash" | "format.bracketLeft" | "format.bracketRight" | "md.quoteBorder" | "md.hrChar" | "md.bullet" | "md.colorSwatch" | "lang.default" | "lang.typescript" | "lang.javascript" | "lang.python" | "lang.rust" | "lang.go" | "lang.java" | "lang.c" | "lang.cpp" | "lang.csharp" | "lang.ruby" | "lang.php" | "lang.swift" | "lang.kotlin" | "lang.shell" | "lang.html" | "lang.css" | "lang.json" | "lang.yaml" | "lang.markdown" | "lang.sql" | "lang.docker" | "lang.lua" | "lang.text" | "lang.env" | "lang.toml" | "lang.xml" | "lang.ini" | "lang.conf" | "lang.log" | "lang.csv" | "lang.tsv" | "lang.image" | "lang.pdf" | "lang.archive" | "lang.binary" | "tab.appearance" | "tab.model" | "tab.interaction" | "tab.context" | "tab.editing" | "tab.tools" | "tab.memory" | "tab.tasks" | "tab.providers";
|
|
10
10
|
export type SpinnerType = "status" | "activity";
|
|
11
11
|
export type ThemeColor = "accent" | "border" | "borderAccent" | "borderMuted" | "success" | "error" | "warning" | "muted" | "dim" | "text" | "thinkingText" | "userMessageText" | "customMessageText" | "customMessageLabel" | "toolTitle" | "toolOutput" | "mdHeading" | "mdLink" | "mdLinkUrl" | "mdCode" | "mdCodeBlock" | "mdCodeBlockBorder" | "mdQuote" | "mdQuoteBorder" | "mdHr" | "mdListBullet" | "toolDiffAdded" | "toolDiffRemoved" | "toolDiffContext" | "syntaxComment" | "syntaxKeyword" | "syntaxFunction" | "syntaxVariable" | "syntaxString" | "syntaxNumber" | "syntaxType" | "syntaxOperator" | "syntaxPunctuation" | "thinkingOff" | "thinkingMinimal" | "thinkingLow" | "thinkingMedium" | "thinkingHigh" | "thinkingXhigh" | "bashMode" | "pythonMode" | "statusLineSep" | "statusLineModel" | "statusLinePath" | "statusLineGitClean" | "statusLineGitDirty" | "statusLineContext" | "statusLineSpend" | "statusLineStaged" | "statusLineDirty" | "statusLineUntracked" | "statusLineOutput" | "statusLineCost" | "statusLineSubagents";
|
|
12
12
|
/** Check if a string is a valid ThemeColor value */
|
|
@@ -161,6 +161,7 @@ export declare class Theme {
|
|
|
161
161
|
medium: string;
|
|
162
162
|
high: string;
|
|
163
163
|
xhigh: string;
|
|
164
|
+
autoPending: string;
|
|
164
165
|
};
|
|
165
166
|
get checkbox(): {
|
|
166
167
|
checked: string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "+Nk" turn token-budget directive.
|
|
3
|
+
*
|
|
4
|
+
* A standalone `+<number>[k|m]` token in the user's message sets a per-turn
|
|
5
|
+
* output-token budget surfaced by the `eval` `budget` helper. By default it is
|
|
6
|
+
* ADVISORY — the model self-limits via `budget.remaining()`. Append `!`
|
|
7
|
+
* (`+500k!`) to make it a HARD ceiling: eval `agent()` refuses to spawn once the
|
|
8
|
+
* turn's spend reaches it. Matching is anchored to token boundaries so it does
|
|
9
|
+
* not fire on prices or version strings embedded in prose.
|
|
10
|
+
*/
|
|
11
|
+
export interface TurnBudget {
|
|
12
|
+
/** Output-token ceiling for the turn. */
|
|
13
|
+
total: number;
|
|
14
|
+
/** Whether the ceiling is enforced (eval `agent()` throws past it) vs advisory. */
|
|
15
|
+
hard: boolean;
|
|
16
|
+
}
|
|
17
|
+
/** Parse a `+Nk`/`+N`/`+Nm`(`!`) turn-budget directive from `text`, or null when absent. */
|
|
18
|
+
export declare function parseTurnBudget(text: string): TurnBudget | null;
|
|
@@ -11,6 +11,7 @@ import type { PlanApprovalDetails } from "../plan-mode/approved-plan";
|
|
|
11
11
|
import type { AgentSession, AgentSessionEvent } from "../session/agent-session";
|
|
12
12
|
import type { HistoryStorage } from "../session/history-storage";
|
|
13
13
|
import type { SessionContext, SessionManager } from "../session/session-manager";
|
|
14
|
+
import type { ShakeMode } from "../session/shake-types";
|
|
14
15
|
import type { LspStartupServerInfo } from "../tools";
|
|
15
16
|
import type { AssistantMessageComponent } from "./components/assistant-message";
|
|
16
17
|
import type { BashExecutionComponent } from "./components/bash-execution";
|
|
@@ -57,6 +58,7 @@ export interface InteractiveModeContext {
|
|
|
57
58
|
statusContainer: Container;
|
|
58
59
|
todoContainer: Container;
|
|
59
60
|
btwContainer: Container;
|
|
61
|
+
omfgContainer: Container;
|
|
60
62
|
editor: CustomEditor;
|
|
61
63
|
editorContainer: Container;
|
|
62
64
|
hookWidgetContainerAbove: Container;
|
|
@@ -207,6 +209,7 @@ export interface InteractiveModeContext {
|
|
|
207
209
|
handleSSHCommand(text: string): Promise<void>;
|
|
208
210
|
handleCompactCommand(customInstructions?: string): Promise<CompactionOutcome>;
|
|
209
211
|
handleHandoffCommand(customInstructions?: string): Promise<void>;
|
|
212
|
+
handleShakeCommand(mode: ShakeMode): Promise<void>;
|
|
210
213
|
handleMoveCommand(targetPath: string): Promise<void>;
|
|
211
214
|
handleRenameCommand(title: string): Promise<void>;
|
|
212
215
|
handleMemoryCommand(text: string): Promise<void>;
|
|
@@ -241,10 +244,11 @@ export interface InteractiveModeContext {
|
|
|
241
244
|
handleBtwCommand(question: string): Promise<void>;
|
|
242
245
|
hasActiveBtw(): boolean;
|
|
243
246
|
handleBtwEscape(): boolean;
|
|
247
|
+
handleOmfgCommand(complaint: string): Promise<void>;
|
|
248
|
+
hasActiveOmfg(): boolean;
|
|
249
|
+
handleOmfgEscape(): boolean;
|
|
244
250
|
cycleThinkingLevel(): void;
|
|
245
|
-
cycleRoleModel(
|
|
246
|
-
temporary?: boolean;
|
|
247
|
-
}): Promise<void>;
|
|
251
|
+
cycleRoleModel(direction?: "forward" | "backward"): Promise<void>;
|
|
248
252
|
toggleToolOutputExpansion(): void;
|
|
249
253
|
setToolsExpanded(expanded: boolean): void;
|
|
250
254
|
toggleThinkingBlockVisibility(): void;
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
+
import { type KeywordHighlighter } from "./gradient-highlight";
|
|
1
2
|
/** Hidden system notice appended after a user message that mentions "ultrathink". */
|
|
2
3
|
export declare const ULTRATHINK_NOTICE: string;
|
|
3
|
-
/**
|
|
4
|
+
/**
|
|
5
|
+
* Whether `text` contains the standalone keyword "ultrathink" (lowercase,
|
|
6
|
+
* whitespace-delimited) in prose — never inside a code block, inline code span,
|
|
7
|
+
* or XML/HTML section.
|
|
8
|
+
*/
|
|
4
9
|
export declare function containsUltrathink(text: string): boolean;
|
|
5
10
|
/**
|
|
6
11
|
* Rainbow-highlight every standalone "ultrathink" in `text` for editor display.
|
|
7
12
|
* Sweeps red→violet (hue 0..330), stopping short of the wrap back to red so the
|
|
8
13
|
* gradient resolves smoothly regardless of casing or match length.
|
|
9
14
|
*/
|
|
10
|
-
export declare const highlightUltrathink:
|
|
15
|
+
export declare const highlightUltrathink: KeywordHighlighter;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type KeywordHighlighter } from "./gradient-highlight";
|
|
2
|
+
/** Hidden system notice appended after a user message that mentions "workflow". */
|
|
3
|
+
export declare const WORKFLOW_NOTICE: string;
|
|
4
|
+
/**
|
|
5
|
+
* Whether `text` contains the standalone keyword "workflow"/"workflows"
|
|
6
|
+
* (lowercase, whitespace-delimited) in prose — never inside a code block, inline
|
|
7
|
+
* code span, or XML/HTML section.
|
|
8
|
+
*/
|
|
9
|
+
export declare function containsWorkflow(text: string): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Highlight every standalone "workflow"/"workflows" in `text` for editor display
|
|
12
|
+
* with a warm amber→green gradient (hue 30..150), visually distinct from
|
|
13
|
+
* ultrathink's rainbow and orchestrate's teal→violet.
|
|
14
|
+
*/
|
|
15
|
+
export declare const highlightWorkflow: KeywordHighlighter;
|