@oh-my-pi/pi-coding-agent 16.2.8 → 16.2.11
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 +59 -0
- package/dist/cli.js +3160 -3096
- package/dist/types/config/settings-schema.d.ts +41 -13
- package/dist/types/extensibility/skills.d.ts +29 -0
- package/dist/types/modes/components/mcp-add-wizard.d.ts +8 -0
- package/dist/types/modes/components/todo-reminder.d.ts +3 -1
- package/dist/types/modes/controllers/mcp-command-controller.d.ts +9 -0
- package/dist/types/modes/controllers/tool-args-reveal.d.ts +5 -0
- package/dist/types/modes/interactive-mode.d.ts +0 -1
- package/dist/types/modes/skill-command.d.ts +1 -1
- package/dist/types/modes/types.d.ts +0 -1
- package/dist/types/session/agent-session.d.ts +1 -1
- package/dist/types/stt/asr-client.d.ts +7 -3
- package/dist/types/stt/index.d.ts +1 -0
- package/dist/types/stt/stt-controller.d.ts +2 -0
- package/dist/types/stt/submit-trigger.d.ts +30 -0
- package/dist/types/task/index.d.ts +1 -1
- package/dist/types/task/types.d.ts +6 -6
- package/dist/types/tiny/models.d.ts +22 -8
- package/package.json +14 -13
- package/scripts/bundle-dist.ts +23 -4
- package/scripts/generate-docs-index.ts +116 -24
- package/src/async/job-manager.ts +27 -3
- package/src/cli/grep-cli.ts +1 -1
- package/src/commit/agentic/agent.ts +1 -1
- package/src/commit/agentic/prompts/system.md +1 -1
- package/src/commit/agentic/tools/analyze-file.ts +2 -2
- package/src/config/model-discovery.ts +118 -76
- package/src/config/settings-schema.ts +15 -1
- package/src/debug/profiler.ts +7 -1
- package/src/extensibility/skills.ts +77 -0
- package/src/internal-urls/docs-index.generated.txt +2 -2
- package/src/lsp/config.ts +17 -3
- package/src/mcp/oauth-flow.ts +35 -8
- package/src/modes/acp/acp-agent.ts +6 -9
- package/src/modes/components/mcp-add-wizard.ts +43 -3
- package/src/modes/components/model-selector.ts +21 -9
- package/src/modes/components/todo-reminder.ts +5 -1
- package/src/modes/controllers/event-controller.ts +40 -15
- package/src/modes/controllers/mcp-command-controller.ts +84 -3
- package/src/modes/controllers/selector-controller.ts +57 -35
- package/src/modes/controllers/tool-args-reveal.ts +12 -0
- package/src/modes/interactive-mode.ts +5 -10
- package/src/modes/rpc/rpc-mode.ts +5 -8
- package/src/modes/skill-command.ts +8 -20
- package/src/modes/types.ts +0 -1
- package/src/prompts/agents/tester.md +107 -0
- package/src/prompts/system/orchestrate-notice.md +2 -2
- package/src/prompts/system/system-prompt.md +2 -5
- package/src/prompts/system/thinking-loop-redirect.md +10 -0
- package/src/prompts/system/workflow-notice.md +1 -1
- package/src/prompts/tools/task.md +2 -9
- package/src/session/agent-session.ts +53 -18
- package/src/stt/asr-client.ts +87 -27
- package/src/stt/downloader.ts +8 -2
- package/src/stt/index.ts +1 -0
- package/src/stt/stt-controller.ts +31 -2
- package/src/stt/submit-trigger.ts +74 -0
- package/src/task/agents.ts +4 -4
- package/src/task/executor.ts +2 -4
- package/src/task/index.ts +32 -10
- package/src/task/types.ts +5 -5
- package/src/tiny/models.ts +10 -0
- package/src/tools/ast-grep.ts +34 -12
- package/src/tools/grep.ts +11 -8
- package/src/utils/git.ts +22 -1
- package/src/prompts/agents/oracle.md +0 -54
|
@@ -1813,6 +1813,34 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
1813
1813
|
}[];
|
|
1814
1814
|
};
|
|
1815
1815
|
};
|
|
1816
|
+
readonly "stt.submitTrigger": {
|
|
1817
|
+
readonly type: "enum";
|
|
1818
|
+
readonly values: readonly ["never", "release", "release-complete", "say-submit"];
|
|
1819
|
+
readonly default: "never";
|
|
1820
|
+
readonly ui: {
|
|
1821
|
+
readonly tab: "interaction";
|
|
1822
|
+
readonly group: "Speech";
|
|
1823
|
+
readonly label: "Speech-to-Text Submit Trigger";
|
|
1824
|
+
readonly description: "Choose when speech dictation automatically submits: Never, Release (2+ words), Release with complete sentence, or When I Say Submit.";
|
|
1825
|
+
readonly options: ({
|
|
1826
|
+
value: "never";
|
|
1827
|
+
label: string;
|
|
1828
|
+
description: string;
|
|
1829
|
+
} | {
|
|
1830
|
+
value: "release";
|
|
1831
|
+
label: string;
|
|
1832
|
+
description: string;
|
|
1833
|
+
} | {
|
|
1834
|
+
value: "release-complete";
|
|
1835
|
+
label: string;
|
|
1836
|
+
description: string;
|
|
1837
|
+
} | {
|
|
1838
|
+
value: "say-submit";
|
|
1839
|
+
label: string;
|
|
1840
|
+
description: string;
|
|
1841
|
+
})[];
|
|
1842
|
+
};
|
|
1843
|
+
};
|
|
1816
1844
|
readonly "contextPromotion.enabled": {
|
|
1817
1845
|
readonly type: "boolean";
|
|
1818
1846
|
readonly default: false;
|
|
@@ -4228,7 +4256,7 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
4228
4256
|
readonly tab: "tasks";
|
|
4229
4257
|
readonly group: "Subagents";
|
|
4230
4258
|
readonly label: "Soft Subagent Request Budget";
|
|
4231
|
-
readonly description: "Soft per-subagent request budget (assistant requests per run). Crossing it injects one steering notice asking the subagent to wrap up; at 1.5x the budget the run is aborted gracefully, salvaging partial output. 0 disables the guard. Bundled explore/
|
|
4259
|
+
readonly description: "Soft per-subagent request budget (assistant requests per run). Crossing it injects one steering notice asking the subagent to wrap up; at 1.5x the budget the run is aborted gracefully, salvaging partial output. 0 disables the guard. Bundled explore/sonic agents use a lower built-in budget.";
|
|
4232
4260
|
readonly options: readonly [{
|
|
4233
4261
|
readonly value: "0";
|
|
4234
4262
|
readonly label: "Disabled";
|
|
@@ -4847,7 +4875,7 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
4847
4875
|
};
|
|
4848
4876
|
readonly "providers.memoryModel": {
|
|
4849
4877
|
readonly type: "enum";
|
|
4850
|
-
readonly values: readonly ["online", "qwen3-1.7b", "gemma-3-1b", "qwen2.5-1.5b", "lfm2-1.2b"];
|
|
4878
|
+
readonly values: readonly ["online", "qwen3-1.7b", "llama3.2:3b", "gemma-3-1b", "qwen2.5-1.5b", "lfm2-1.2b"];
|
|
4851
4879
|
readonly default: "online";
|
|
4852
4880
|
readonly ui: {
|
|
4853
4881
|
readonly tab: "memory";
|
|
@@ -4860,15 +4888,15 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
4860
4888
|
label: string;
|
|
4861
4889
|
description: string;
|
|
4862
4890
|
} | {
|
|
4863
|
-
value: "gemma-3-1b" | "lfm2-1.2b" | "qwen2.5-1.5b" | "qwen3-1.7b";
|
|
4864
|
-
label: "Gemma 3 1B" | "LFM2 1.2B" | "Qwen2.5 1.5B" | "Qwen3 1.7B";
|
|
4865
|
-
description: "Best consolidation/dedup; lighter footprint, but leaks small talk during extraction." | "Best extraction granularity (atomic facts); weaker consolidation." | "Disabled for local inference: onnxruntime-node cannot run this ONNX export's RotaryEmbedding cache updates." | "Fastest load; solid all-rounder, slightly noisier extraction labels.";
|
|
4891
|
+
value: "gemma-3-1b" | "lfm2-1.2b" | "llama3.2:3b" | "qwen2.5-1.5b" | "qwen3-1.7b";
|
|
4892
|
+
label: "Gemma 3 1B" | "LFM2 1.2B" | "Llama 3.2 3B" | "Qwen2.5 1.5B" | "Qwen3 1.7B";
|
|
4893
|
+
description: "Best consolidation/dedup; lighter footprint, but leaks small talk during extraction." | "Best extraction granularity (atomic facts); weaker consolidation." | "Disabled for local inference: onnxruntime-node cannot run this ONNX export's RotaryEmbedding cache updates." | "Fastest load; solid all-rounder, slightly noisier extraction labels." | "Larger Llama 3.2 option for local memory/classifier tasks; higher quality potential at higher disk/RAM/latency cost.";
|
|
4866
4894
|
})[];
|
|
4867
4895
|
};
|
|
4868
4896
|
};
|
|
4869
4897
|
readonly "providers.autoThinkingModel": {
|
|
4870
4898
|
readonly type: "enum";
|
|
4871
|
-
readonly values: readonly ["online", "qwen3-1.7b", "gemma-3-1b", "qwen2.5-1.5b", "lfm2-1.2b"];
|
|
4899
|
+
readonly values: readonly ["online", "qwen3-1.7b", "llama3.2:3b", "gemma-3-1b", "qwen2.5-1.5b", "lfm2-1.2b"];
|
|
4872
4900
|
readonly default: "online";
|
|
4873
4901
|
readonly ui: {
|
|
4874
4902
|
readonly tab: "model";
|
|
@@ -4881,9 +4909,9 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
4881
4909
|
label: string;
|
|
4882
4910
|
description: string;
|
|
4883
4911
|
} | {
|
|
4884
|
-
value: "gemma-3-1b" | "lfm2-1.2b" | "qwen2.5-1.5b" | "qwen3-1.7b";
|
|
4885
|
-
label: "Gemma 3 1B" | "LFM2 1.2B" | "Qwen2.5 1.5B" | "Qwen3 1.7B";
|
|
4886
|
-
description: "Best consolidation/dedup; lighter footprint, but leaks small talk during extraction." | "Best extraction granularity (atomic facts); weaker consolidation." | "Disabled for local inference: onnxruntime-node cannot run this ONNX export's RotaryEmbedding cache updates." | "Fastest load; solid all-rounder, slightly noisier extraction labels.";
|
|
4912
|
+
value: "gemma-3-1b" | "lfm2-1.2b" | "llama3.2:3b" | "qwen2.5-1.5b" | "qwen3-1.7b";
|
|
4913
|
+
label: "Gemma 3 1B" | "LFM2 1.2B" | "Llama 3.2 3B" | "Qwen2.5 1.5B" | "Qwen3 1.7B";
|
|
4914
|
+
description: "Best consolidation/dedup; lighter footprint, but leaks small talk during extraction." | "Best extraction granularity (atomic facts); weaker consolidation." | "Disabled for local inference: onnxruntime-node cannot run this ONNX export's RotaryEmbedding cache updates." | "Fastest load; solid all-rounder, slightly noisier extraction labels." | "Larger Llama 3.2 option for local memory/classifier tasks; higher quality potential at higher disk/RAM/latency cost.";
|
|
4887
4915
|
})[];
|
|
4888
4916
|
};
|
|
4889
4917
|
};
|
|
@@ -4899,7 +4927,7 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
4899
4927
|
};
|
|
4900
4928
|
readonly "providers.unexpectedStopModel": {
|
|
4901
4929
|
readonly type: "enum";
|
|
4902
|
-
readonly values: readonly ["online", "qwen3-1.7b", "gemma-3-1b", "qwen2.5-1.5b", "lfm2-1.2b"];
|
|
4930
|
+
readonly values: readonly ["online", "qwen3-1.7b", "llama3.2:3b", "gemma-3-1b", "qwen2.5-1.5b", "lfm2-1.2b"];
|
|
4903
4931
|
readonly default: "online";
|
|
4904
4932
|
readonly ui: {
|
|
4905
4933
|
readonly tab: "providers";
|
|
@@ -4912,9 +4940,9 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
4912
4940
|
label: string;
|
|
4913
4941
|
description: string;
|
|
4914
4942
|
} | {
|
|
4915
|
-
value: "gemma-3-1b" | "lfm2-1.2b" | "qwen2.5-1.5b" | "qwen3-1.7b";
|
|
4916
|
-
label: "Gemma 3 1B" | "LFM2 1.2B" | "Qwen2.5 1.5B" | "Qwen3 1.7B";
|
|
4917
|
-
description: "Best consolidation/dedup; lighter footprint, but leaks small talk during extraction." | "Best extraction granularity (atomic facts); weaker consolidation." | "Disabled for local inference: onnxruntime-node cannot run this ONNX export's RotaryEmbedding cache updates." | "Fastest load; solid all-rounder, slightly noisier extraction labels.";
|
|
4943
|
+
value: "gemma-3-1b" | "lfm2-1.2b" | "llama3.2:3b" | "qwen2.5-1.5b" | "qwen3-1.7b";
|
|
4944
|
+
label: "Gemma 3 1B" | "LFM2 1.2B" | "Llama 3.2 3B" | "Qwen2.5 1.5B" | "Qwen3 1.7B";
|
|
4945
|
+
description: "Best consolidation/dedup; lighter footprint, but leaks small talk during extraction." | "Best extraction granularity (atomic facts); weaker consolidation." | "Disabled for local inference: onnxruntime-node cannot run this ONNX export's RotaryEmbedding cache updates." | "Fastest load; solid all-rounder, slightly noisier extraction labels." | "Larger Llama 3.2 option for local memory/classifier tasks; higher quality potential at higher disk/RAM/latency cost.";
|
|
4918
4946
|
})[];
|
|
4919
4947
|
};
|
|
4920
4948
|
};
|
|
@@ -64,4 +64,33 @@ export interface BuiltSkillPromptMessage {
|
|
|
64
64
|
details: SkillPromptDetails;
|
|
65
65
|
}
|
|
66
66
|
export declare function getSkillSlashCommandName(skill: Pick<Skill, "name">): string;
|
|
67
|
+
/**
|
|
68
|
+
* Parsed `/skill:<name>` invocation: either at the start of the draft (the
|
|
69
|
+
* traditional slash-command position) or as a `/skill:<name>` token embedded
|
|
70
|
+
* mid-prompt. For the mid-prompt form the surrounding prose is threaded
|
|
71
|
+
* through as `args` so the skill sees the full user request.
|
|
72
|
+
*/
|
|
73
|
+
export interface ParsedSkillInvocation {
|
|
74
|
+
/** Bare skill name without the leading `skill:` prefix. */
|
|
75
|
+
name: string;
|
|
76
|
+
/** User-supplied arguments (everything outside the `/skill:<name>` token). */
|
|
77
|
+
args: string;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Detect a `/skill:<name>` invocation in a user draft.
|
|
81
|
+
*
|
|
82
|
+
* Returns `undefined` when the text contains no skill token. Otherwise:
|
|
83
|
+
* - Leading form (`/skill:foo bar baz`): name=`foo`, args=`bar baz`.
|
|
84
|
+
* - Mid-prompt form (`fix the bug /skill:foo focus on auth`): name=`foo`,
|
|
85
|
+
* args=`fix the bug focus on auth` — the surrounding prose collapsed
|
|
86
|
+
* into a single args string.
|
|
87
|
+
*
|
|
88
|
+
* Mid-prompt detection is disabled when the draft itself starts with a
|
|
89
|
+
* different slash command (e.g. `/compact /skill:foo`) or a local-execution
|
|
90
|
+
* sigil — `!cmd` / `!!cmd` for the bash tool and `$ cmd` / `$$ cmd` for the
|
|
91
|
+
* python tool. Those handlers run after the skill-command dispatcher and
|
|
92
|
+
* their bodies routinely contain `/skill:<name>` references that are not
|
|
93
|
+
* meant as skill invocations.
|
|
94
|
+
*/
|
|
95
|
+
export declare function parseSkillInvocation(text: string): ParsedSkillInvocation | undefined;
|
|
67
96
|
export declare function buildSkillPromptMessage(skill: Pick<Skill, "name" | "filePath">, args: string): Promise<BuiltSkillPromptMessage>;
|
|
@@ -21,6 +21,14 @@ export interface MCPAddWizardOAuthResult {
|
|
|
21
21
|
interface MCPAddWizardOAuthOptions {
|
|
22
22
|
serverUrl?: string;
|
|
23
23
|
resource?: string;
|
|
24
|
+
/**
|
|
25
|
+
* External cancellation source. Aborting it tears down the in-flight OAuth
|
|
26
|
+
* flow and surfaces a neutral cancellation error. The wizard wires its own
|
|
27
|
+
* controller here so Esc cancels the OAuth wait instead of stepping back
|
|
28
|
+
* through the form (the wizard is focused, so the editor's Esc hook does
|
|
29
|
+
* not fire).
|
|
30
|
+
*/
|
|
31
|
+
abortSignal?: AbortSignal;
|
|
24
32
|
}
|
|
25
33
|
export declare class MCPAddWizard extends Container {
|
|
26
34
|
#private;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Container } from "@oh-my-pi/pi-tui";
|
|
2
2
|
import type { TodoItem } from "../../tools/todo";
|
|
3
3
|
/**
|
|
4
|
-
* Component that renders a todo completion reminder notification
|
|
4
|
+
* Component that renders a todo completion reminder notification, committed into
|
|
5
|
+
* the transcript like a TTSR notification so it stays anchored in history rather
|
|
6
|
+
* than floating above the editor.
|
|
5
7
|
* Shows when the agent stops with incomplete todos.
|
|
6
8
|
*/
|
|
7
9
|
export declare class TodoReminderComponent extends Container {
|
|
@@ -7,6 +7,15 @@ export declare class MCPAuthorizationLinkPrompt implements Component {
|
|
|
7
7
|
invalidate(): void;
|
|
8
8
|
render(_width: number): readonly string[];
|
|
9
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* Thrown by {@link MCPCommandController}'s OAuth handler when the user (or a
|
|
12
|
+
* caller-supplied {@link AbortSignal}) cancels the in-flight flow. Distinct
|
|
13
|
+
* from network/timeout failures so callers can surface a neutral
|
|
14
|
+
* "cancelled" status instead of an error banner.
|
|
15
|
+
*/
|
|
16
|
+
export declare class MCPOAuthCancelledError extends Error {
|
|
17
|
+
constructor(message?: string);
|
|
18
|
+
}
|
|
10
19
|
export declare class MCPCommandController {
|
|
11
20
|
#private;
|
|
12
21
|
private ctx;
|
|
@@ -36,6 +36,11 @@ export declare class ToolArgsRevealController {
|
|
|
36
36
|
setTarget(id: string, partialJson: string, target: ToolArgsRevealTarget): Record<string, unknown>;
|
|
37
37
|
/** Attach the component future ticks push frames into. */
|
|
38
38
|
bind(id: string, component: ToolArgsRevealComponent): void;
|
|
39
|
+
/** Migrate a live reveal entry from a placeholder key onto the real
|
|
40
|
+
* tool-call id once the owned-dialect parser assigns it. No-op when no
|
|
41
|
+
* entry exists under `from` (smoothing disabled, or the JSON already
|
|
42
|
+
* closed and `finish` cleared it). */
|
|
43
|
+
rekey(from: string, to: string): void;
|
|
39
44
|
/** Final arguments arrived (the JSON closed): drop the reveal so the
|
|
40
45
|
* caller's final-args render wins immediately, mirroring how assistant
|
|
41
46
|
* text snaps to the full message at message_end. */
|
|
@@ -83,7 +83,6 @@ export declare class InteractiveMode implements InteractiveModeContext {
|
|
|
83
83
|
chatContainer: TranscriptContainer;
|
|
84
84
|
pendingMessagesContainer: Container;
|
|
85
85
|
statusContainer: Container;
|
|
86
|
-
todoReminderContainer: Container;
|
|
87
86
|
todoContainer: Container;
|
|
88
87
|
subagentContainer: Container;
|
|
89
88
|
btwContainer: Container;
|
|
@@ -23,7 +23,7 @@ export interface BuiltSkillCommandPrompt {
|
|
|
23
23
|
message: SkillPromptMessage;
|
|
24
24
|
options: SkillPromptOptions;
|
|
25
25
|
}
|
|
26
|
-
/** Return true when `text`
|
|
26
|
+
/** Return true when `text` invokes a registered `/skill:<name>` command. */
|
|
27
27
|
export declare function isKnownSkillCommand(ctx: SkillCommandHost, text: string): boolean;
|
|
28
28
|
/** Build the user-attributed custom message for a registered `/skill:<name>` command. */
|
|
29
29
|
export declare function buildSkillCommandPrompt(ctx: SkillCommandHost, text: string, streamingBehavior: "steer" | "followUp", images?: ImageContent[]): Promise<BuiltSkillCommandPrompt | undefined>;
|
|
@@ -81,7 +81,6 @@ export interface InteractiveModeContext {
|
|
|
81
81
|
chatContainer: TranscriptContainer;
|
|
82
82
|
pendingMessagesContainer: Container;
|
|
83
83
|
statusContainer: Container;
|
|
84
|
-
todoReminderContainer: Container;
|
|
85
84
|
todoContainer: Container;
|
|
86
85
|
subagentContainer: Container;
|
|
87
86
|
btwContainer: Container;
|
|
@@ -871,7 +871,7 @@ export declare class AgentSession {
|
|
|
871
871
|
* log but NOT to settings.
|
|
872
872
|
* @throws Error if no API key available for the model
|
|
873
873
|
*/
|
|
874
|
-
setModelTemporary(model: Model, thinkingLevel?:
|
|
874
|
+
setModelTemporary(model: Model, thinkingLevel?: ConfiguredThinkingLevel, options?: {
|
|
875
875
|
ephemeral?: boolean;
|
|
876
876
|
}): Promise<void>;
|
|
877
877
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type RefCountedWorkerHandle, type SpawnedSubprocess } from "../subprocess/worker-client";
|
|
2
2
|
import type { SttProgressEvent, SttWorkerInbound, SttWorkerOutbound } from "./asr-protocol";
|
|
3
3
|
import type { SttModelKey } from "./models";
|
|
4
4
|
export interface SttTranscribeOptions {
|
|
@@ -9,6 +9,10 @@ export interface SttDownloadOptions {
|
|
|
9
9
|
signal?: AbortSignal;
|
|
10
10
|
onProgress?: (event: SttProgressEvent) => void;
|
|
11
11
|
}
|
|
12
|
+
export interface SttDownloadResult {
|
|
13
|
+
ok: boolean;
|
|
14
|
+
error?: string;
|
|
15
|
+
}
|
|
12
16
|
/** Live streaming session handle returned by {@link SttClient.startStream}. */
|
|
13
17
|
export interface SttStreamHandle {
|
|
14
18
|
/** Feed 16 kHz mono float samples as the recorder produces them. */
|
|
@@ -38,7 +42,7 @@ export declare const STT_WORKER_ARG = "__omp_worker_stt";
|
|
|
38
42
|
export declare function createSttSubprocess(): SpawnedSubprocess<SttWorkerOutbound>;
|
|
39
43
|
export declare class SttClient {
|
|
40
44
|
#private;
|
|
41
|
-
constructor(spawnWorker?: () =>
|
|
45
|
+
constructor(spawnWorker?: () => RefCountedWorkerHandle<SttWorkerInbound, SttWorkerOutbound>);
|
|
42
46
|
onProgress(listener: (event: SttProgressEvent) => void): () => void;
|
|
43
47
|
/**
|
|
44
48
|
* Transcribe 16 kHz mono audio on the warm worker. Rejects with the worker
|
|
@@ -54,7 +58,7 @@ export declare class SttClient {
|
|
|
54
58
|
* an aborted signal) tears the session down and resolves `stop()` with "".
|
|
55
59
|
*/
|
|
56
60
|
startStream(modelKey: SttModelKey, options?: SttStreamOptions): SttStreamHandle;
|
|
57
|
-
downloadModel(modelKey: SttModelKey, options?: SttDownloadOptions): Promise<
|
|
61
|
+
downloadModel(modelKey: SttModelKey, options?: SttDownloadOptions): Promise<SttDownloadResult>;
|
|
58
62
|
terminate(): Promise<void>;
|
|
59
63
|
}
|
|
60
64
|
export declare const sttClient: SttClient;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TTS/STT Submit Trigger options and evaluation logic.
|
|
3
|
+
*/
|
|
4
|
+
export declare const STT_SUBMIT_TRIGGER_VALUES: readonly ["never", "release", "release-complete", "say-submit"];
|
|
5
|
+
export type SttSubmitTrigger = (typeof STT_SUBMIT_TRIGGER_VALUES)[number];
|
|
6
|
+
export declare const STT_SUBMIT_TRIGGER_OPTIONS: ({
|
|
7
|
+
value: "never";
|
|
8
|
+
label: string;
|
|
9
|
+
description: string;
|
|
10
|
+
} | {
|
|
11
|
+
value: "release";
|
|
12
|
+
label: string;
|
|
13
|
+
description: string;
|
|
14
|
+
} | {
|
|
15
|
+
value: "release-complete";
|
|
16
|
+
label: string;
|
|
17
|
+
description: string;
|
|
18
|
+
} | {
|
|
19
|
+
value: "say-submit";
|
|
20
|
+
label: string;
|
|
21
|
+
description: string;
|
|
22
|
+
})[];
|
|
23
|
+
/**
|
|
24
|
+
* Evaluate the submit trigger against a transcribed utterance.
|
|
25
|
+
* Returns whether to submit, and the number of characters to trim from the end of the utterance.
|
|
26
|
+
*/
|
|
27
|
+
export declare function evaluateSubmitTrigger(utterance: string, trigger: SttSubmitTrigger): {
|
|
28
|
+
submit: boolean;
|
|
29
|
+
trimTrailing: number;
|
|
30
|
+
};
|
|
@@ -22,7 +22,7 @@ export declare function formatResultOutputFallback(result: Pick<SingleResult, "o
|
|
|
22
22
|
* Advisory — never a rejection — nudging the spawner toward tailored
|
|
23
23
|
* specialists when it spawns generic role-less workers and still holds spawn
|
|
24
24
|
* capacity (DepthCapacity: it currently has the `task` tool). Fires when a
|
|
25
|
-
* generic `task`/`
|
|
25
|
+
* generic `task`/`sonic` spawn carries no `role`, or when one call clones
|
|
26
26
|
* the same agent ≥2× all without roles. Returns undefined when no nudge applies.
|
|
27
27
|
*/
|
|
28
28
|
export declare function buildSpecializationAdvisory(agentName: string | undefined, items: TaskItem[], depthCapacity: boolean): string | undefined;
|
|
@@ -74,7 +74,7 @@ export interface TaskItem {
|
|
|
74
74
|
isolated?: boolean;
|
|
75
75
|
}
|
|
76
76
|
export declare const taskSchema: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
77
|
-
agent: string
|
|
77
|
+
agent: import("arktype/internal/attributes.ts").Default<string, "task">;
|
|
78
78
|
id?: string | undefined;
|
|
79
79
|
description?: string | undefined;
|
|
80
80
|
role?: string | undefined;
|
|
@@ -82,20 +82,20 @@ export declare const taskSchema: import("arktype/internal/variants/object.ts").O
|
|
|
82
82
|
isolated?: boolean | undefined;
|
|
83
83
|
}, {}>;
|
|
84
84
|
declare const ALL_TASK_SCHEMAS: readonly [import("arktype/internal/variants/object.ts").ObjectType<{
|
|
85
|
-
agent: string
|
|
85
|
+
agent: import("arktype/internal/attributes.ts").Default<string, "task">;
|
|
86
86
|
id?: string | undefined;
|
|
87
87
|
description?: string | undefined;
|
|
88
88
|
role?: string | undefined;
|
|
89
89
|
assignment: string;
|
|
90
90
|
isolated?: boolean | undefined;
|
|
91
91
|
}, {}>, import("arktype/internal/variants/object.ts").ObjectType<{
|
|
92
|
-
agent: string
|
|
92
|
+
agent: import("arktype/internal/attributes.ts").Default<string, "task">;
|
|
93
93
|
id?: string | undefined;
|
|
94
94
|
description?: string | undefined;
|
|
95
95
|
role?: string | undefined;
|
|
96
96
|
assignment: string;
|
|
97
97
|
}, {}>, import("arktype/internal/variants/object.ts").ObjectType<{
|
|
98
|
-
agent: string
|
|
98
|
+
agent: import("arktype/internal/attributes.ts").Default<string, "task">;
|
|
99
99
|
context: string;
|
|
100
100
|
tasks: {
|
|
101
101
|
id?: string | undefined;
|
|
@@ -105,7 +105,7 @@ declare const ALL_TASK_SCHEMAS: readonly [import("arktype/internal/variants/obje
|
|
|
105
105
|
isolated?: boolean | undefined;
|
|
106
106
|
}[];
|
|
107
107
|
}, {}>, import("arktype/internal/variants/object.ts").ObjectType<{
|
|
108
|
-
agent: string
|
|
108
|
+
agent: import("arktype/internal/attributes.ts").Default<string, "task">;
|
|
109
109
|
context: string;
|
|
110
110
|
tasks: {
|
|
111
111
|
id?: string | undefined;
|
|
@@ -129,7 +129,7 @@ export declare function getTaskSchema(options: {
|
|
|
129
129
|
* transcripts using the flat form keep working under either setting.
|
|
130
130
|
*/
|
|
131
131
|
export interface TaskParams {
|
|
132
|
-
/** Agent type;
|
|
132
|
+
/** Agent type to spawn; defaults to `"task"` (the general-purpose worker) when omitted. */
|
|
133
133
|
agent?: string;
|
|
134
134
|
/** Stable agent id (flat form); default = generated AdjectiveNoun. */
|
|
135
135
|
id?: string;
|
|
@@ -84,6 +84,13 @@ export declare const TINY_MEMORY_LOCAL_MODELS: readonly [{
|
|
|
84
84
|
readonly contextNote: "Blocked before load to avoid the unsupported RotaryEmbedding runtime path.";
|
|
85
85
|
readonly reasoning: true;
|
|
86
86
|
readonly unsupportedReason: "onnxruntime-node does not support Qwen3 RotaryEmbedding cache updates in onnx-community/Qwen3-1.7B-ONNX";
|
|
87
|
+
}, {
|
|
88
|
+
readonly key: "llama3.2:3b";
|
|
89
|
+
readonly repo: "onnx-community/Llama-3.2-3B-Instruct-ONNX";
|
|
90
|
+
readonly dtype: "q4";
|
|
91
|
+
readonly label: "Llama 3.2 3B";
|
|
92
|
+
readonly description: "Larger Llama 3.2 option for local memory/classifier tasks; higher quality potential at higher disk/RAM/latency cost.";
|
|
93
|
+
readonly contextNote: "Use when larger model capacity is preferred over faster load times.";
|
|
87
94
|
}, {
|
|
88
95
|
readonly key: "gemma-3-1b";
|
|
89
96
|
readonly repo: "onnx-community/gemma-3-1b-it-ONNX";
|
|
@@ -106,7 +113,7 @@ export declare const TINY_MEMORY_LOCAL_MODELS: readonly [{
|
|
|
106
113
|
readonly description: "Fastest load; solid all-rounder, slightly noisier extraction labels.";
|
|
107
114
|
readonly contextNote: "Use when local startup cost is the priority.";
|
|
108
115
|
}];
|
|
109
|
-
export declare const TINY_MEMORY_MODEL_VALUES: readonly ["online", "qwen3-1.7b", "gemma-3-1b", "qwen2.5-1.5b", "lfm2-1.2b"];
|
|
116
|
+
export declare const TINY_MEMORY_MODEL_VALUES: readonly ["online", "qwen3-1.7b", "llama3.2:3b", "gemma-3-1b", "qwen2.5-1.5b", "lfm2-1.2b"];
|
|
110
117
|
export type TinyMemoryModelKey = (typeof TINY_MEMORY_MODEL_VALUES)[number];
|
|
111
118
|
export type TinyMemoryLocalModelKey = (typeof TINY_MEMORY_LOCAL_MODELS)[number]["key"];
|
|
112
119
|
export declare const TINY_MEMORY_MODEL_OPTIONS: ({
|
|
@@ -114,9 +121,9 @@ export declare const TINY_MEMORY_MODEL_OPTIONS: ({
|
|
|
114
121
|
label: string;
|
|
115
122
|
description: string;
|
|
116
123
|
} | {
|
|
117
|
-
value: "gemma-3-1b" | "lfm2-1.2b" | "qwen2.5-1.5b" | "qwen3-1.7b";
|
|
118
|
-
label: "Gemma 3 1B" | "LFM2 1.2B" | "Qwen2.5 1.5B" | "Qwen3 1.7B";
|
|
119
|
-
description: "Best consolidation/dedup; lighter footprint, but leaks small talk during extraction." | "Best extraction granularity (atomic facts); weaker consolidation." | "Disabled for local inference: onnxruntime-node cannot run this ONNX export's RotaryEmbedding cache updates." | "Fastest load; solid all-rounder, slightly noisier extraction labels.";
|
|
124
|
+
value: "gemma-3-1b" | "lfm2-1.2b" | "llama3.2:3b" | "qwen2.5-1.5b" | "qwen3-1.7b";
|
|
125
|
+
label: "Gemma 3 1B" | "LFM2 1.2B" | "Llama 3.2 3B" | "Qwen2.5 1.5B" | "Qwen3 1.7B";
|
|
126
|
+
description: "Best consolidation/dedup; lighter footprint, but leaks small talk during extraction." | "Best extraction granularity (atomic facts); weaker consolidation." | "Disabled for local inference: onnxruntime-node cannot run this ONNX export's RotaryEmbedding cache updates." | "Fastest load; solid all-rounder, slightly noisier extraction labels." | "Larger Llama 3.2 option for local memory/classifier tasks; higher quality potential at higher disk/RAM/latency cost.";
|
|
120
127
|
})[];
|
|
121
128
|
export declare function isTinyMemoryLocalModelKey(value: string): value is TinyMemoryLocalModelKey;
|
|
122
129
|
export declare function getTinyMemoryModelSpec(key: TinyMemoryLocalModelKey): (typeof TINY_MEMORY_LOCAL_MODELS)[number];
|
|
@@ -173,6 +180,13 @@ export declare const TINY_LOCAL_MODELS: readonly [{
|
|
|
173
180
|
readonly contextNote: "Blocked before load to avoid the unsupported RotaryEmbedding runtime path.";
|
|
174
181
|
readonly reasoning: true;
|
|
175
182
|
readonly unsupportedReason: "onnxruntime-node does not support Qwen3 RotaryEmbedding cache updates in onnx-community/Qwen3-1.7B-ONNX";
|
|
183
|
+
}, {
|
|
184
|
+
readonly key: "llama3.2:3b";
|
|
185
|
+
readonly repo: "onnx-community/Llama-3.2-3B-Instruct-ONNX";
|
|
186
|
+
readonly dtype: "q4";
|
|
187
|
+
readonly label: "Llama 3.2 3B";
|
|
188
|
+
readonly description: "Larger Llama 3.2 option for local memory/classifier tasks; higher quality potential at higher disk/RAM/latency cost.";
|
|
189
|
+
readonly contextNote: "Use when larger model capacity is preferred over faster load times.";
|
|
176
190
|
}, {
|
|
177
191
|
readonly key: "gemma-3-1b";
|
|
178
192
|
readonly repo: "onnx-community/gemma-3-1b-it-ONNX";
|
|
@@ -203,14 +217,14 @@ export declare const TINY_LOCAL_MODELS: readonly [{
|
|
|
203
217
|
* sub-1B title models.
|
|
204
218
|
*/
|
|
205
219
|
export declare const ONLINE_AUTO_THINKING_MODEL_KEY = "online";
|
|
206
|
-
export declare const AUTO_THINKING_MODEL_VALUES: readonly ["online", "qwen3-1.7b", "gemma-3-1b", "qwen2.5-1.5b", "lfm2-1.2b"];
|
|
220
|
+
export declare const AUTO_THINKING_MODEL_VALUES: readonly ["online", "qwen3-1.7b", "llama3.2:3b", "gemma-3-1b", "qwen2.5-1.5b", "lfm2-1.2b"];
|
|
207
221
|
export type AutoThinkingModelKey = TinyMemoryModelKey;
|
|
208
222
|
export declare const AUTO_THINKING_MODEL_OPTIONS: ({
|
|
209
223
|
value: "online";
|
|
210
224
|
label: string;
|
|
211
225
|
description: string;
|
|
212
226
|
} | {
|
|
213
|
-
value: "gemma-3-1b" | "lfm2-1.2b" | "qwen2.5-1.5b" | "qwen3-1.7b";
|
|
214
|
-
label: "Gemma 3 1B" | "LFM2 1.2B" | "Qwen2.5 1.5B" | "Qwen3 1.7B";
|
|
215
|
-
description: "Best consolidation/dedup; lighter footprint, but leaks small talk during extraction." | "Best extraction granularity (atomic facts); weaker consolidation." | "Disabled for local inference: onnxruntime-node cannot run this ONNX export's RotaryEmbedding cache updates." | "Fastest load; solid all-rounder, slightly noisier extraction labels.";
|
|
227
|
+
value: "gemma-3-1b" | "lfm2-1.2b" | "llama3.2:3b" | "qwen2.5-1.5b" | "qwen3-1.7b";
|
|
228
|
+
label: "Gemma 3 1B" | "LFM2 1.2B" | "Llama 3.2 3B" | "Qwen2.5 1.5B" | "Qwen3 1.7B";
|
|
229
|
+
description: "Best consolidation/dedup; lighter footprint, but leaks small talk during extraction." | "Best extraction granularity (atomic facts); weaker consolidation." | "Disabled for local inference: onnxruntime-node cannot run this ONNX export's RotaryEmbedding cache updates." | "Fastest load; solid all-rounder, slightly noisier extraction labels." | "Larger Llama 3.2 option for local memory/classifier tasks; higher quality potential at higher disk/RAM/latency cost.";
|
|
216
230
|
})[];
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@oh-my-pi/pi-coding-agent",
|
|
4
|
-
"version": "16.2.
|
|
4
|
+
"version": "16.2.11",
|
|
5
5
|
"description": "Coding agent CLI with read, bash, edit, write tools and session management",
|
|
6
6
|
"homepage": "https://omp.sh",
|
|
7
7
|
"author": "Can Boluk",
|
|
@@ -32,7 +32,8 @@
|
|
|
32
32
|
},
|
|
33
33
|
"scripts": {
|
|
34
34
|
"build": "bun scripts/build-binary.ts",
|
|
35
|
-
"check": "biome check . && bun run check:types",
|
|
35
|
+
"check": "biome check . && bun run check:docs && bun run check:types",
|
|
36
|
+
"check:docs": "bun scripts/generate-docs-index.ts --check",
|
|
36
37
|
"check:types": "tsgo -p tsconfig.json --noEmit",
|
|
37
38
|
"lint": "biome lint .",
|
|
38
39
|
"test": "bun ../../scripts/ci-test-ts.ts coding-agent-heavy --full",
|
|
@@ -55,17 +56,17 @@
|
|
|
55
56
|
"@agentclientprotocol/sdk": "0.25.0",
|
|
56
57
|
"@babel/parser": "^7.29.7",
|
|
57
58
|
"@mozilla/readability": "^0.6.0",
|
|
58
|
-
"@oh-my-pi/hashline": "16.2.
|
|
59
|
-
"@oh-my-pi/omp-stats": "16.2.
|
|
60
|
-
"@oh-my-pi/pi-agent-core": "16.2.
|
|
61
|
-
"@oh-my-pi/pi-ai": "16.2.
|
|
62
|
-
"@oh-my-pi/pi-catalog": "16.2.
|
|
63
|
-
"@oh-my-pi/pi-mnemopi": "16.2.
|
|
64
|
-
"@oh-my-pi/pi-natives": "16.2.
|
|
65
|
-
"@oh-my-pi/pi-tui": "16.2.
|
|
66
|
-
"@oh-my-pi/pi-utils": "16.2.
|
|
67
|
-
"@oh-my-pi/pi-wire": "16.2.
|
|
68
|
-
"@oh-my-pi/snapcompact": "16.2.
|
|
59
|
+
"@oh-my-pi/hashline": "16.2.11",
|
|
60
|
+
"@oh-my-pi/omp-stats": "16.2.11",
|
|
61
|
+
"@oh-my-pi/pi-agent-core": "16.2.11",
|
|
62
|
+
"@oh-my-pi/pi-ai": "16.2.11",
|
|
63
|
+
"@oh-my-pi/pi-catalog": "16.2.11",
|
|
64
|
+
"@oh-my-pi/pi-mnemopi": "16.2.11",
|
|
65
|
+
"@oh-my-pi/pi-natives": "16.2.11",
|
|
66
|
+
"@oh-my-pi/pi-tui": "16.2.11",
|
|
67
|
+
"@oh-my-pi/pi-utils": "16.2.11",
|
|
68
|
+
"@oh-my-pi/pi-wire": "16.2.11",
|
|
69
|
+
"@oh-my-pi/snapcompact": "16.2.11",
|
|
69
70
|
"@opentelemetry/api": "^1.9.1",
|
|
70
71
|
"@opentelemetry/context-async-hooks": "^2.7.1",
|
|
71
72
|
"@opentelemetry/exporter-trace-otlp-proto": "^0.218.0",
|
package/scripts/bundle-dist.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import * as fs from "node:fs/promises";
|
|
4
4
|
import * as path from "node:path";
|
|
5
5
|
import { isEnoent } from "@oh-my-pi/pi-utils";
|
|
6
|
+
import { assertDocsIndexFresh, buildDocsIndexPayload } from "./generate-docs-index";
|
|
6
7
|
|
|
7
8
|
const packageDir = path.join(import.meta.dir, "..");
|
|
8
9
|
const outDir = path.join(packageDir, "dist");
|
|
@@ -72,13 +73,31 @@ async function cleanBundleOutputs(): Promise<void> {
|
|
|
72
73
|
);
|
|
73
74
|
}
|
|
74
75
|
|
|
76
|
+
async function assertDocsEmbedPopulated(): Promise<void> {
|
|
77
|
+
// bundle-dist runs from prepack (which calls `gen:docs` first) or directly.
|
|
78
|
+
// Direct invocations must fail — the tarball ships src/, and an empty embed
|
|
79
|
+
// would make src/internal-urls/docs-index.ts fall through to the missing
|
|
80
|
+
// repo `docs/` tree at runtime in published packages (codex review, PR #3941).
|
|
81
|
+
const embedPath = path.join(packageDir, "src/internal-urls/docs-index.generated.txt");
|
|
82
|
+
const embed = await Bun.file(embedPath).text();
|
|
83
|
+
if (embed.length === 0) {
|
|
84
|
+
throw new Error(
|
|
85
|
+
"docs-index embed is empty. Run `bun run gen:docs` before `bun run gen:bundle`, or use `bun pm pack` which runs the prepack chain.",
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
const expected = await buildDocsIndexPayload();
|
|
89
|
+
assertDocsIndexFresh(embed, expected);
|
|
90
|
+
}
|
|
91
|
+
|
|
75
92
|
async function main(): Promise<void> {
|
|
76
93
|
const start = Bun.nanoseconds();
|
|
77
94
|
await cleanBundleOutputs();
|
|
78
|
-
|
|
79
|
-
//
|
|
80
|
-
// (scripts/build-binary.ts). Reset
|
|
81
|
-
// placeholder empty.
|
|
95
|
+
await assertDocsEmbedPopulated();
|
|
96
|
+
// The npm bundle ships no stats dashboard sources, so embed the dashboard
|
|
97
|
+
// archive the same way compiled binaries do (scripts/build-binary.ts). Reset
|
|
98
|
+
// afterwards to keep the checked-in placeholder empty. The docs embed stays
|
|
99
|
+
// populated on disk — postpack owns its reset so `bun pm pack` can pack a
|
|
100
|
+
// tarball whose src copy is still valid for subpath imports.
|
|
82
101
|
await runCommand(["bun", "--cwd=../stats", "run", "gen:stats"]);
|
|
83
102
|
try {
|
|
84
103
|
await runCommand([
|