@oh-my-pi/pi-coding-agent 16.2.2 → 16.2.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 +49 -0
- package/dist/cli.js +3624 -3568
- package/dist/types/advisor/__tests__/config.test.d.ts +1 -0
- package/dist/types/advisor/advise-tool.d.ts +8 -4
- package/dist/types/advisor/config.d.ts +88 -0
- package/dist/types/advisor/index.d.ts +1 -0
- package/dist/types/advisor/transcript-recorder.d.ts +13 -2
- package/dist/types/advisor/watchdog.d.ts +20 -0
- package/dist/types/collab/guest.d.ts +29 -0
- package/dist/types/config/settings-schema.d.ts +81 -0
- package/dist/types/debug/log-viewer.d.ts +1 -0
- package/dist/types/debug/raw-sse.d.ts +1 -0
- package/dist/types/edit/hashline/diff.d.ts +0 -11
- package/dist/types/extensibility/tool-event-input.d.ts +7 -0
- package/dist/types/extensibility/utils.d.ts +12 -0
- package/dist/types/mcp/transports/index.d.ts +1 -0
- package/dist/types/mcp/transports/sse.d.ts +20 -0
- package/dist/types/modes/components/advisor-config.d.ts +59 -0
- package/dist/types/modes/components/index.d.ts +1 -0
- package/dist/types/modes/components/model-selector.d.ts +9 -1
- package/dist/types/modes/components/settings-selector.d.ts +1 -0
- package/dist/types/modes/components/status-line/component.d.ts +30 -1
- package/dist/types/modes/components/status-line/types.d.ts +13 -1
- package/dist/types/modes/controllers/selector-controller.d.ts +1 -0
- package/dist/types/modes/interactive-mode.d.ts +10 -4
- package/dist/types/modes/skill-command.d.ts +32 -0
- package/dist/types/modes/types.d.ts +7 -2
- package/dist/types/session/agent-session.d.ts +58 -10
- package/dist/types/session/indexed-session-storage.d.ts +7 -1
- package/dist/types/session/messages.d.ts +26 -0
- package/dist/types/session/messages.test.d.ts +1 -0
- package/dist/types/session/session-entries.d.ts +31 -3
- package/dist/types/session/session-history-format.d.ts +6 -0
- package/dist/types/session/session-loader.d.ts +9 -1
- package/dist/types/session/session-manager.d.ts +6 -4
- package/dist/types/session/session-storage.d.ts +11 -0
- package/dist/types/session/session-title-slot.d.ts +19 -0
- package/dist/types/ssh/connection-manager.d.ts +47 -0
- package/dist/types/ssh/utils.d.ts +16 -0
- package/dist/types/task/executor.d.ts +3 -16
- package/dist/types/task/render.d.ts +0 -5
- package/dist/types/task/renderer.d.ts +13 -0
- package/dist/types/task/types.d.ts +16 -0
- package/dist/types/task/yield-assembly.d.ts +28 -0
- package/dist/types/tiny/text.d.ts +8 -0
- package/dist/types/tools/render-utils.d.ts +2 -0
- package/dist/types/tools/review.d.ts +6 -4
- package/dist/types/tools/ssh.d.ts +1 -1
- package/dist/types/tools/todo.d.ts +6 -0
- package/dist/types/tools/yield.d.ts +8 -3
- package/dist/types/utils/thinking-display.d.ts +4 -0
- package/package.json +12 -12
- package/src/advisor/__tests__/advisor.test.ts +242 -10
- package/src/advisor/__tests__/config.test.ts +173 -0
- package/src/advisor/advise-tool.ts +11 -6
- package/src/advisor/config.ts +256 -0
- package/src/advisor/index.ts +1 -0
- package/src/advisor/runtime.ts +12 -2
- package/src/advisor/transcript-recorder.ts +25 -2
- package/src/advisor/watchdog.ts +57 -31
- package/src/autoresearch/index.ts +7 -2
- package/src/cli/gc-cli.ts +17 -10
- package/src/collab/guest.ts +43 -7
- package/src/config/model-registry.ts +80 -18
- package/src/config/settings-schema.ts +77 -0
- package/src/debug/index.ts +32 -7
- package/src/debug/log-viewer.ts +111 -53
- package/src/debug/raw-sse.ts +68 -48
- package/src/discovery/codex.ts +13 -5
- package/src/edit/hashline/diff.ts +57 -4
- package/src/eval/js/shared/local-module-loader.ts +23 -1
- package/src/export/html/template.js +13 -7
- package/src/extensibility/extensions/loader.ts +5 -3
- package/src/extensibility/extensions/wrapper.ts +9 -3
- package/src/extensibility/hooks/loader.ts +3 -3
- package/src/extensibility/hooks/tool-wrapper.ts +13 -4
- package/src/extensibility/plugins/manager.ts +2 -1
- package/src/extensibility/tool-event-input.ts +23 -0
- package/src/extensibility/utils.ts +74 -0
- package/src/internal-urls/docs-index.generated.txt +1 -1
- package/src/mcp/client.ts +3 -1
- package/src/mcp/manager.ts +12 -5
- package/src/mcp/transports/index.ts +1 -0
- package/src/mcp/transports/sse.ts +377 -0
- package/src/memories/index.ts +15 -6
- package/src/modes/components/advisor-config.ts +555 -0
- package/src/modes/components/advisor-message.ts +9 -2
- package/src/modes/components/agent-hub.ts +9 -4
- package/src/modes/components/index.ts +2 -0
- package/src/modes/components/model-selector.ts +79 -48
- package/src/modes/components/settings-selector.ts +1 -0
- package/src/modes/components/status-line/component.ts +144 -5
- package/src/modes/components/status-line/segments.ts +46 -21
- package/src/modes/components/status-line/types.ts +13 -1
- package/src/modes/components/tool-execution.ts +47 -6
- package/src/modes/controllers/command-controller.ts +23 -2
- package/src/modes/controllers/event-controller.ts +106 -0
- package/src/modes/controllers/extension-ui-controller.ts +1 -1
- package/src/modes/controllers/input-controller.ts +61 -61
- package/src/modes/controllers/selector-controller.ts +100 -9
- package/src/modes/interactive-mode.ts +65 -5
- package/src/modes/skill-command.ts +116 -0
- package/src/modes/types.ts +7 -2
- package/src/modes/utils/ui-helpers.ts +41 -23
- package/src/prompts/agents/reviewer.md +11 -10
- package/src/prompts/review-custom-request.md +1 -2
- package/src/prompts/review-request.md +1 -2
- package/src/prompts/system/interrupted-thinking.md +7 -0
- package/src/prompts/system/recap-user.md +9 -0
- package/src/prompts/system/subagent-system-prompt.md +8 -5
- package/src/prompts/system/subagent-yield-reminder.md +6 -5
- package/src/prompts/system/system-prompt.md +0 -1
- package/src/prompts/tools/irc.md +2 -2
- package/src/prompts/tools/read.md +2 -2
- package/src/sdk.ts +28 -24
- package/src/session/agent-session.ts +867 -428
- package/src/session/indexed-session-storage.ts +86 -13
- package/src/session/messages.test.ts +125 -0
- package/src/session/messages.ts +172 -9
- package/src/session/redis-session-storage.ts +49 -2
- package/src/session/session-entries.ts +39 -2
- package/src/session/session-history-format.ts +29 -2
- package/src/session/session-listing.ts +54 -24
- package/src/session/session-loader.ts +66 -3
- package/src/session/session-manager.ts +113 -19
- package/src/session/session-persistence.ts +95 -1
- package/src/session/session-storage.ts +36 -0
- package/src/session/session-title-slot.ts +141 -0
- package/src/session/sql-session-storage.ts +71 -11
- package/src/slash-commands/builtin-registry.ts +16 -3
- package/src/ssh/__tests__/connection-manager-args.test.ts +123 -1
- package/src/ssh/__tests__/file-transfer-posix-guard.test.ts +55 -18
- package/src/ssh/connection-manager.ts +139 -12
- package/src/ssh/file-transfer.ts +23 -18
- package/src/ssh/ssh-executor.ts +2 -13
- package/src/ssh/utils.ts +19 -0
- package/src/task/executor.ts +21 -23
- package/src/task/render.ts +162 -20
- package/src/task/renderer.ts +14 -0
- package/src/task/types.ts +17 -0
- package/src/task/yield-assembly.ts +207 -0
- package/src/tiny/text.ts +23 -0
- package/src/tools/ask.ts +55 -4
- package/src/tools/render-utils.ts +2 -0
- package/src/tools/renderers.ts +8 -2
- package/src/tools/review.ts +17 -7
- package/src/tools/ssh.ts +8 -4
- package/src/tools/todo.ts +17 -1
- package/src/tools/yield.ts +140 -31
- package/src/utils/thinking-display.ts +15 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -8,11 +8,15 @@ export type AdvisorSeverity = "nit" | "concern" | "blocker";
|
|
|
8
8
|
export interface AdviseDetails {
|
|
9
9
|
note: string;
|
|
10
10
|
severity?: AdvisorSeverity;
|
|
11
|
+
/** Which configured advisor produced this note (omitted for the default advisor). */
|
|
12
|
+
advisor?: string;
|
|
11
13
|
}
|
|
12
14
|
/** One queued advice note. */
|
|
13
15
|
export interface AdvisorNote {
|
|
14
16
|
note: string;
|
|
15
17
|
severity?: AdvisorSeverity;
|
|
18
|
+
/** Which configured advisor produced this note (omitted for the default advisor). */
|
|
19
|
+
advisor?: string;
|
|
16
20
|
}
|
|
17
21
|
/** Details payload on the batched `advisor` custom message rendered in the transcript. */
|
|
18
22
|
export interface AdvisorMessageDetails {
|
|
@@ -78,11 +82,11 @@ export declare function resolveAdvisorDeliveryChannel(opts: {
|
|
|
78
82
|
*/
|
|
79
83
|
export declare function deriveAdvisorTelemetry(primaryTelemetry: AgentTelemetryConfig | undefined, identity: AgentIdentity): AgentTelemetryConfig | undefined;
|
|
80
84
|
/**
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
85
|
+
* The tools an advisor receives by default when its config omits `tools` — the
|
|
86
|
+
* read-only investigative set. The full available pool is every built tool the
|
|
87
|
+
* session has (the advisor is a full agent); a config's `tools` selects from it.
|
|
84
88
|
*/
|
|
85
|
-
export declare const
|
|
89
|
+
export declare const ADVISOR_DEFAULT_TOOL_NAMES: ReadonlySet<string>;
|
|
86
90
|
export declare class AdviseTool implements AgentTool<typeof adviseSchema, AdviseDetails> {
|
|
87
91
|
#private;
|
|
88
92
|
private readonly onAdvice;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One advisor declared in a `WATCHDOG.yml` file. `model` is a model selector
|
|
3
|
+
* with an optional `:level` thinking suffix (e.g. `x-ai/grok-code-fast:high`),
|
|
4
|
+
* resolved exactly like any other model override; `tools` is a subset of the
|
|
5
|
+
* read-only investigative tool names (default: all). `instructions` is the
|
|
6
|
+
* advisor's specialization, appended to the shared baseline.
|
|
7
|
+
*/
|
|
8
|
+
export interface AdvisorConfig {
|
|
9
|
+
name: string;
|
|
10
|
+
model?: string;
|
|
11
|
+
tools?: string[];
|
|
12
|
+
instructions?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The result of walking the `WATCHDOG.yml`/`WATCHDOG.yaml` search path: the
|
|
16
|
+
* deduped advisor roster plus the concatenated top-level `instructions` baseline
|
|
17
|
+
* that is prepended (alongside `WATCHDOG.md`) to every advisor.
|
|
18
|
+
*/
|
|
19
|
+
export interface DiscoveredAdvisors {
|
|
20
|
+
advisors: AdvisorConfig[];
|
|
21
|
+
sharedInstructions: string | undefined;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Normalize an advisor name into a filesystem-/id-safe slug used for its
|
|
25
|
+
* transcript filename and session id: lowercase, non-alphanumerics collapsed to
|
|
26
|
+
* `-`, leading/trailing `-` trimmed. Falls back to `"advisor"` when nothing
|
|
27
|
+
* survives; callers dedupe collisions.
|
|
28
|
+
*/
|
|
29
|
+
export declare function slugifyAdvisorName(name: string): string;
|
|
30
|
+
/**
|
|
31
|
+
* Discover advisor configs from `WATCHDOG.yml`/`WATCHDOG.yaml` files on the same
|
|
32
|
+
* user + project search path as `WATCHDOG.md`. Advisors are keyed by slug; a
|
|
33
|
+
* more-specific file (project leaf > project ancestor > user) replaces an earlier
|
|
34
|
+
* entry with the same slug. Top-level `instructions` across all files concatenate
|
|
35
|
+
* into the shared baseline. A malformed file is logged and skipped — never
|
|
36
|
+
* thrown — so a bad project config can't kill the session.
|
|
37
|
+
*/
|
|
38
|
+
export declare function discoverAdvisorConfigs(cwd: string, agentDir?: string): Promise<DiscoveredAdvisors>;
|
|
39
|
+
/** Which level a `WATCHDOG.yml` lives at: the project root or the user agent dir. */
|
|
40
|
+
export type AdvisorConfigScope = "project" | "user";
|
|
41
|
+
/**
|
|
42
|
+
* The editable contents of a single `WATCHDOG.yml` file: the shared top-level
|
|
43
|
+
* `instructions` plus the advisor roster. Unlike {@link DiscoveredAdvisors}, this
|
|
44
|
+
* is one file's raw view (no cross-level merge, no `@import` expansion) so the
|
|
45
|
+
* config editor round-trips exactly what the user wrote.
|
|
46
|
+
*/
|
|
47
|
+
export interface WatchdogConfigDoc {
|
|
48
|
+
instructions?: string;
|
|
49
|
+
advisors: AdvisorConfig[];
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Resolve the `WATCHDOG.yml` path for a scope: `project` → `<projectDir>/WATCHDOG.yml`
|
|
53
|
+
* (discovered by the project-level walk), `user` → `<agentDir>/WATCHDOG.yml` (the
|
|
54
|
+
* user-level candidate).
|
|
55
|
+
*/
|
|
56
|
+
export declare function advisorConfigFilePath(scope: AdvisorConfigScope, dirs: {
|
|
57
|
+
projectDir: string;
|
|
58
|
+
agentDir: string;
|
|
59
|
+
}): string;
|
|
60
|
+
/**
|
|
61
|
+
* Resolve which `WATCHDOG.{yml,yaml}` to edit for a scope: prefer the canonical
|
|
62
|
+
* `.yml`, but when only a `.yaml` exists for that scope, edit it in place so an
|
|
63
|
+
* existing `.yaml` user isn't shown a blank editor and left with two files at the
|
|
64
|
+
* same precedence. Falls back to `.yml` when neither exists.
|
|
65
|
+
*/
|
|
66
|
+
export declare function resolveAdvisorConfigEditPath(scope: AdvisorConfigScope, dirs: {
|
|
67
|
+
projectDir: string;
|
|
68
|
+
agentDir: string;
|
|
69
|
+
}): Promise<string>;
|
|
70
|
+
/**
|
|
71
|
+
* Load one `WATCHDOG.yml` file for editing — raw, un-merged, un-expanded. Missing,
|
|
72
|
+
* unparseable, or schema-invalid files yield an empty doc (never throws) so the
|
|
73
|
+
* editor opens cleanly on a fresh or broken file.
|
|
74
|
+
*/
|
|
75
|
+
export declare function loadWatchdogConfigFile(filePath: string): Promise<WatchdogConfigDoc>;
|
|
76
|
+
/**
|
|
77
|
+
* Serialize an editable doc back to block-style `WATCHDOG.yml` text via Bun's
|
|
78
|
+
* `YAML.stringify` (the same API the repo uses for other hand-editable config),
|
|
79
|
+
* omitting empty fields. Round-trips through {@link loadWatchdogConfigFile}.
|
|
80
|
+
* Returns `""` for an empty doc.
|
|
81
|
+
*/
|
|
82
|
+
export declare function serializeWatchdogConfig(doc: WatchdogConfigDoc): string;
|
|
83
|
+
/**
|
|
84
|
+
* Write an editable doc to `WATCHDOG.yml`. An empty doc removes the file so
|
|
85
|
+
* discovery falls back to the legacy single-advisor path rather than leaving an
|
|
86
|
+
* empty config behind.
|
|
87
|
+
*/
|
|
88
|
+
export declare function saveWatchdogConfigFile(filePath: string, doc: WatchdogConfigDoc): Promise<void>;
|
|
@@ -6,6 +6,14 @@ import type { AgentMessage } from "@oh-my-pi/pi-agent-core";
|
|
|
6
6
|
*/
|
|
7
7
|
export declare const ADVISOR_TRANSCRIPT_STEM = "__advisor";
|
|
8
8
|
export declare const ADVISOR_TRANSCRIPT_FILENAME = "__advisor.jsonl";
|
|
9
|
+
/**
|
|
10
|
+
* Transcript filename for an advisor: `__advisor.jsonl` for the legacy/default
|
|
11
|
+
* advisor (empty slug), `__advisor.<slug>.jsonl` for a named advisor. The `.`
|
|
12
|
+
* separator keeps named files out of the output manager's `-<n>` bump namespace.
|
|
13
|
+
*/
|
|
14
|
+
export declare function advisorTranscriptFilename(slug: string): string;
|
|
15
|
+
/** Whether a filename is any advisor transcript (`__advisor.jsonl` or `__advisor.<slug>.jsonl`). */
|
|
16
|
+
export declare function isAdvisorTranscriptName(name: string): boolean;
|
|
9
17
|
/**
|
|
10
18
|
* Append-only persister for an advisor agent's transcript.
|
|
11
19
|
*
|
|
@@ -32,11 +40,14 @@ export declare class AdvisorTranscriptRecorder {
|
|
|
32
40
|
private readonly resolveSessionFile;
|
|
33
41
|
private readonly resolveCwd;
|
|
34
42
|
/**
|
|
43
|
+
* @param filename Transcript filename within the session dir. Defaults to
|
|
44
|
+
* `__advisor.jsonl`; named advisors pass `__advisor.<slug>.jsonl` via
|
|
45
|
+
* {@link advisorTranscriptFilename}.
|
|
35
46
|
* @param after Optional barrier the queue starts behind — used on the advisor
|
|
36
47
|
* on→off→on toggle so a fresh recorder's first `open` waits for the prior
|
|
37
|
-
* recorder's `close` and the two never hold the same
|
|
48
|
+
* recorder's `close` and the two never hold the same file at once.
|
|
38
49
|
*/
|
|
39
|
-
constructor(resolveSessionFile: () => string | undefined, resolveCwd: () => string, after?: Promise<unknown>);
|
|
50
|
+
constructor(resolveSessionFile: () => string | undefined, resolveCwd: () => string, filename?: string, after?: Promise<unknown>);
|
|
40
51
|
/**
|
|
41
52
|
* Persist one finalized advisor message. Assistant turns carry the usage the
|
|
42
53
|
* stats parser reads; tool results round out the Hub transcript; user deltas
|
|
@@ -11,6 +11,26 @@ export declare function formatAdvisorContextPrompt(contextFiles: ReadonlyArray<{
|
|
|
11
11
|
path: string;
|
|
12
12
|
content: string;
|
|
13
13
|
}>): string | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* A readable config candidate discovered on the watchdog/advisor search path,
|
|
16
|
+
* with raw (un-expanded) content and its position metadata.
|
|
17
|
+
*/
|
|
18
|
+
export interface ConfigCandidate {
|
|
19
|
+
path: string;
|
|
20
|
+
content: string;
|
|
21
|
+
level: "user" | "project";
|
|
22
|
+
depth: number;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Walk the watchdog/advisor config search path — the user agent dir plus every
|
|
26
|
+
* directory from `cwd` up to the repo root (or home), probing both `<F>` and
|
|
27
|
+
* `.omp/<F>` for each given filename — and return the readable candidates with
|
|
28
|
+
* their raw content, sorted user-first then project ancestor→leaf (depth
|
|
29
|
+
* descending, so the leaf directory is most specific/last). Shared by
|
|
30
|
+
* {@link discoverWatchdogFiles} and `discoverAdvisorConfigs`. Content is returned
|
|
31
|
+
* verbatim (no `@import` expansion); callers expand what they need.
|
|
32
|
+
*/
|
|
33
|
+
export declare function collectConfigCandidates(cwd: string, agentDir: string | undefined, filenames: string[]): Promise<ConfigCandidate[]>;
|
|
14
34
|
/**
|
|
15
35
|
* Discover and load WATCHDOG.md files walking up from cwd, project .omp folder, and user agent dir.
|
|
16
36
|
* Returns formatted watchdog file blocks ready to be appended to the advisor system prompt.
|
|
@@ -5,6 +5,35 @@ import { AgentRegistry } from "../registry/agent-registry";
|
|
|
5
5
|
import { type CollabSessionState } from "./protocol";
|
|
6
6
|
/** Commands a guest may run locally; everything else is host-only. */
|
|
7
7
|
export declare const COLLAB_GUEST_ALLOWED_COMMANDS: Record<string, true>;
|
|
8
|
+
/** Minimal context surface the idle-state reconciler mutates. */
|
|
9
|
+
export interface GuestIdleReconcilerCtx {
|
|
10
|
+
statusLine: {
|
|
11
|
+
markActivityEnd: () => void;
|
|
12
|
+
};
|
|
13
|
+
loadingAnimation: {
|
|
14
|
+
stop: () => void;
|
|
15
|
+
} | undefined;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Close the guest UI state held open by an earlier `agent_start` whose
|
|
19
|
+
* matching `agent_end` never reached us — most often because a reconnect
|
|
20
|
+
* dropped the event mid-stream. Triggered from {@link CollabGuestLink}'s
|
|
21
|
+
* `state` reconciler when the host reports `isStreaming === false`:
|
|
22
|
+
* folds the in-flight active-time window into the per-session meter (so
|
|
23
|
+
* `time_spent` stops ticking) and stops the `Working…` loader if one is
|
|
24
|
+
* still animating. No-op when the host is still streaming.
|
|
25
|
+
*
|
|
26
|
+
* Exported for direct unit testing; mutates the loader field on `ctx` so
|
|
27
|
+
* the same loader is not stopped twice on subsequent reconciliations.
|
|
28
|
+
*/
|
|
29
|
+
export declare function reconcileGuestIdleHostState(ctx: GuestIdleReconcilerCtx, isStreaming: boolean): void;
|
|
30
|
+
/** Reconcile a welcome/resync snapshot's host activity state into the guest meter. */
|
|
31
|
+
export interface GuestSnapshotActivityReconcilerCtx extends GuestIdleReconcilerCtx {
|
|
32
|
+
statusLine: GuestIdleReconcilerCtx["statusLine"] & {
|
|
33
|
+
markActivityStart: () => void;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export declare function reconcileGuestSnapshotHostState(ctx: GuestSnapshotActivityReconcilerCtx, isStreaming: boolean): void;
|
|
8
37
|
export declare class CollabGuestLink {
|
|
9
38
|
#private;
|
|
10
39
|
state: CollabSessionState | null;
|
|
@@ -443,6 +443,16 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
443
443
|
readonly description: "Use the terminal's default background for the status line instead of the theme's `statusLineBg`. Powerline end caps are dropped because they need a contrasting fill to bridge into the surrounding terminal.";
|
|
444
444
|
};
|
|
445
445
|
};
|
|
446
|
+
readonly "statusLine.compactThinkingLevel": {
|
|
447
|
+
readonly type: "boolean";
|
|
448
|
+
readonly default: false;
|
|
449
|
+
readonly ui: {
|
|
450
|
+
readonly tab: "appearance";
|
|
451
|
+
readonly group: "Status Line";
|
|
452
|
+
readonly label: "Compact Thinking Level";
|
|
453
|
+
readonly description: "Show the thinking level as a single icon on the model name instead of a separate ` · <level>` suffix.";
|
|
454
|
+
};
|
|
455
|
+
};
|
|
446
456
|
readonly "tools.artifactSpillThreshold": {
|
|
447
457
|
readonly type: "number";
|
|
448
458
|
readonly default: 50;
|
|
@@ -1667,6 +1677,42 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
1667
1677
|
readonly description: "Notify when the ask tool is waiting for input";
|
|
1668
1678
|
};
|
|
1669
1679
|
};
|
|
1680
|
+
readonly "recap.enabled": {
|
|
1681
|
+
readonly type: "boolean";
|
|
1682
|
+
readonly default: true;
|
|
1683
|
+
readonly ui: {
|
|
1684
|
+
readonly tab: "interaction";
|
|
1685
|
+
readonly group: "Notifications";
|
|
1686
|
+
readonly label: "Idle Recap";
|
|
1687
|
+
readonly description: "Generate a brief LLM recap of where things stand after the terminal has been idle";
|
|
1688
|
+
};
|
|
1689
|
+
};
|
|
1690
|
+
readonly "recap.idleSeconds": {
|
|
1691
|
+
readonly type: "number";
|
|
1692
|
+
readonly default: 240;
|
|
1693
|
+
readonly ui: {
|
|
1694
|
+
readonly tab: "interaction";
|
|
1695
|
+
readonly group: "Notifications";
|
|
1696
|
+
readonly label: "Idle Recap Delay";
|
|
1697
|
+
readonly description: "Seconds to wait while idle before showing the recap";
|
|
1698
|
+
readonly options: readonly [{
|
|
1699
|
+
readonly value: "60";
|
|
1700
|
+
readonly label: "1 minute";
|
|
1701
|
+
}, {
|
|
1702
|
+
readonly value: "120";
|
|
1703
|
+
readonly label: "2 minutes";
|
|
1704
|
+
}, {
|
|
1705
|
+
readonly value: "240";
|
|
1706
|
+
readonly label: "4 minutes";
|
|
1707
|
+
}, {
|
|
1708
|
+
readonly value: "300";
|
|
1709
|
+
readonly label: "5 minutes";
|
|
1710
|
+
}, {
|
|
1711
|
+
readonly value: "600";
|
|
1712
|
+
readonly label: "10 minutes";
|
|
1713
|
+
}];
|
|
1714
|
+
};
|
|
1715
|
+
};
|
|
1670
1716
|
readonly "collab.relayUrl": {
|
|
1671
1717
|
readonly type: "string";
|
|
1672
1718
|
readonly default: "wss://my.omp.sh";
|
|
@@ -1955,6 +2001,16 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
1955
2001
|
readonly description: "Use remote compaction endpoints when available instead of local summarization";
|
|
1956
2002
|
};
|
|
1957
2003
|
};
|
|
2004
|
+
readonly "compaction.remoteStreamingV2Enabled": {
|
|
2005
|
+
readonly type: "boolean";
|
|
2006
|
+
readonly default: true;
|
|
2007
|
+
readonly ui: {
|
|
2008
|
+
readonly tab: "context";
|
|
2009
|
+
readonly group: "Compaction";
|
|
2010
|
+
readonly label: "Remote Compaction V2";
|
|
2011
|
+
readonly description: "Use Responses streaming compaction for compatible remote compaction models";
|
|
2012
|
+
};
|
|
2013
|
+
};
|
|
1958
2014
|
readonly "compaction.reserveTokens": {
|
|
1959
2015
|
readonly type: "number";
|
|
1960
2016
|
readonly default: 16384;
|
|
@@ -1971,6 +2027,10 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
1971
2027
|
readonly type: "string";
|
|
1972
2028
|
readonly default: undefined;
|
|
1973
2029
|
};
|
|
2030
|
+
readonly "compaction.v2RetainedMessageBudget": {
|
|
2031
|
+
readonly type: "number";
|
|
2032
|
+
readonly default: 64000;
|
|
2033
|
+
};
|
|
1974
2034
|
readonly "compaction.idleEnabled": {
|
|
1975
2035
|
readonly type: "boolean";
|
|
1976
2036
|
readonly default: false;
|
|
@@ -3907,6 +3967,16 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
3907
3967
|
readonly description: "Run modes where active goals may auto-continue between turns";
|
|
3908
3968
|
};
|
|
3909
3969
|
};
|
|
3970
|
+
readonly "title.refreshOnReplan": {
|
|
3971
|
+
readonly type: "boolean";
|
|
3972
|
+
readonly default: true;
|
|
3973
|
+
readonly ui: {
|
|
3974
|
+
readonly tab: "tasks";
|
|
3975
|
+
readonly group: "Modes";
|
|
3976
|
+
readonly label: "Refresh Title on Replan";
|
|
3977
|
+
readonly description: "Refresh generated session titles after todo init replans unless the title was set by the user";
|
|
3978
|
+
};
|
|
3979
|
+
};
|
|
3910
3980
|
readonly "task.isolation.mode": {
|
|
3911
3981
|
readonly type: "enum";
|
|
3912
3982
|
readonly values: readonly ["none", "auto", "apfs", "btrfs", "zfs", "reflink", "overlayfs", "projfs", "block-clone", "rcopy"];
|
|
@@ -5272,12 +5342,21 @@ export interface CompactionSettings {
|
|
|
5272
5342
|
autoContinue: boolean;
|
|
5273
5343
|
remoteEnabled: boolean;
|
|
5274
5344
|
remoteEndpoint: string | undefined;
|
|
5345
|
+
remoteStreamingV2Enabled: boolean;
|
|
5346
|
+
v2RetainedMessageBudget: number;
|
|
5275
5347
|
idleEnabled: boolean;
|
|
5276
5348
|
idleThresholdTokens: number;
|
|
5277
5349
|
idleTimeoutSeconds: number;
|
|
5278
5350
|
supersedeReads: boolean;
|
|
5279
5351
|
dropUseless: boolean;
|
|
5280
5352
|
}
|
|
5353
|
+
export interface RecapSettings {
|
|
5354
|
+
enabled: boolean;
|
|
5355
|
+
idleSeconds: number;
|
|
5356
|
+
}
|
|
5357
|
+
export interface TitleSettings {
|
|
5358
|
+
refreshOnReplan: boolean;
|
|
5359
|
+
}
|
|
5281
5360
|
export interface ContextPromotionSettings {
|
|
5282
5361
|
enabled: boolean;
|
|
5283
5362
|
}
|
|
@@ -5408,6 +5487,8 @@ export interface GcSettings {
|
|
|
5408
5487
|
/** Map group prefix -> typed settings interface */
|
|
5409
5488
|
export interface GroupTypeMap {
|
|
5410
5489
|
compaction: CompactionSettings;
|
|
5490
|
+
recap: RecapSettings;
|
|
5491
|
+
title: TitleSettings;
|
|
5411
5492
|
contextPromotion: ContextPromotionSettings;
|
|
5412
5493
|
retry: RetrySettings;
|
|
5413
5494
|
memories: MemoriesSettings;
|
|
@@ -35,6 +35,7 @@ export declare class DebugLogViewerModel {
|
|
|
35
35
|
setFilterQuery(query: string): void;
|
|
36
36
|
toggleProcessFilter(): void;
|
|
37
37
|
moveCursor(delta: number, extendSelection: boolean): void;
|
|
38
|
+
moveCursorToRow(rowIndex: number, extendSelection: boolean): boolean;
|
|
38
39
|
getSelectedLogIndices(): number[];
|
|
39
40
|
getSelectedCount(): number;
|
|
40
41
|
isSelected(logIndex: number): boolean;
|
|
@@ -12,6 +12,7 @@ export interface RawSseViewerOptions {
|
|
|
12
12
|
export declare class RawSseViewerComponent implements Component {
|
|
13
13
|
#private;
|
|
14
14
|
constructor(options: RawSseViewerOptions);
|
|
15
|
+
dispose(): void;
|
|
15
16
|
handleInput(keyData: string): void;
|
|
16
17
|
invalidate(): void;
|
|
17
18
|
render(width: number): readonly string[];
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Read-only hashline diff preview helpers used by the streaming edit
|
|
3
|
-
* renderer. Reads the target file, parses + applies the section's edits in
|
|
4
|
-
* memory (no FS write, no LSP writethrough), then hands the before/after
|
|
5
|
-
* pair to {@link generateDiffString} so the renderer can show the diff
|
|
6
|
-
* while the tool call is still streaming.
|
|
7
|
-
*
|
|
8
|
-
* Uses the same snapshot-tag semantics as the apply path: a live content-hash
|
|
9
|
-
* match is accepted even when the tag was minted by a source that did not keep
|
|
10
|
-
* history, and stale tags recover through the session snapshot store when possible.
|
|
11
|
-
*/
|
|
12
1
|
import { type PatchSection, type SnapshotStore } from "@oh-my-pi/hashline";
|
|
13
2
|
export interface HashlineDiffOptions {
|
|
14
3
|
/**
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
+
interface ToolEventInputResolver {
|
|
2
|
+
name: string;
|
|
3
|
+
resolveEventInput?: (input: string) => string;
|
|
4
|
+
}
|
|
5
|
+
/** Resolves mode-specific textual tool input before extension/hook event normalization. */
|
|
6
|
+
export declare function resolveToolEventInput(tool: ToolEventInputResolver, input: Record<string, unknown>): Record<string, unknown>;
|
|
1
7
|
/** Adds derived compatibility fields to tool event input without changing tool execution parameters. */
|
|
2
8
|
export declare function normalizeToolEventInput(toolName: string, input: Record<string, unknown>): Record<string, unknown>;
|
|
9
|
+
export {};
|
|
@@ -10,3 +10,15 @@ export declare function resolvePath(filePath: string, cwd: string): string;
|
|
|
10
10
|
* Create a no-op UI context for headless modes.
|
|
11
11
|
*/
|
|
12
12
|
export declare function createNoOpUIContext(): HookUIContext;
|
|
13
|
+
/**
|
|
14
|
+
* Raised by {@link withExitGuard} when a guarded callback synchronously
|
|
15
|
+
* attempts to terminate the host process. Callers catch this like any other
|
|
16
|
+
* load-time failure so the extension/hook is skipped with a logged error
|
|
17
|
+
* instead of taking the CLI down with it.
|
|
18
|
+
*/
|
|
19
|
+
export declare class ExtensionExitError extends Error {
|
|
20
|
+
readonly alias: string;
|
|
21
|
+
readonly code: number | string | undefined;
|
|
22
|
+
constructor(code: number | string | undefined, alias?: string);
|
|
23
|
+
}
|
|
24
|
+
export declare function withExitGuard<T>(fn: () => Promise<T>): Promise<T>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { MCPRequestOptions, MCPSseServerConfig, MCPTransport } from "../../mcp/types";
|
|
2
|
+
/** Legacy MCP HTTP+SSE transport from protocol revision 2024-11-05. */
|
|
3
|
+
export declare class LegacySseTransport implements MCPTransport {
|
|
4
|
+
#private;
|
|
5
|
+
onClose?: () => void;
|
|
6
|
+
onError?: (error: Error) => void;
|
|
7
|
+
onNotification?: (method: string, params: unknown) => void;
|
|
8
|
+
onRequest?: (method: string, params: unknown) => Promise<unknown>;
|
|
9
|
+
/** Called on 401/403 to attempt token refresh. Returns updated headers or null. */
|
|
10
|
+
onAuthError?: () => Promise<Record<string, string> | null>;
|
|
11
|
+
constructor(config: MCPSseServerConfig);
|
|
12
|
+
get connected(): boolean;
|
|
13
|
+
get url(): string;
|
|
14
|
+
connect(): Promise<void>;
|
|
15
|
+
request<T = unknown>(method: string, params?: Record<string, unknown>, options?: MCPRequestOptions): Promise<T>;
|
|
16
|
+
notify(method: string, params?: Record<string, unknown>): Promise<void>;
|
|
17
|
+
close(): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
/** Create and connect a legacy HTTP+SSE transport. */
|
|
20
|
+
export declare function createSseTransport(config: MCPSseServerConfig): Promise<LegacySseTransport>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fullscreen `/advisor configure` overlay: a mouse- and keyboard-driven editor
|
|
3
|
+
* for the `WATCHDOG.yml` advisor roster at project or user level.
|
|
4
|
+
*
|
|
5
|
+
* It paints the entire alternate screen from row 0 (so SGR mouse rows index
|
|
6
|
+
* directly into the rendered frame) using the shared {@link ./overlay-box} chrome.
|
|
7
|
+
* The list screen is a two-pane split (the `/extensions` idiom): a clickable
|
|
8
|
+
* advisor/action sidebar on the left, and a scrollable preview of the highlighted
|
|
9
|
+
* advisor's model / tools / instructions on the right, filling the free space.
|
|
10
|
+
*
|
|
11
|
+
* Each screen is backed by a proven primitive — {@link SelectList} (list / detail
|
|
12
|
+
* / tools / thinking), {@link Input} (name), {@link ModelSelectorComponent} (the
|
|
13
|
+
* same rich `/model` picker, in direct-select mode), and {@link HookEditorComponent}
|
|
14
|
+
* (multiline instructions; Ctrl+G opens `$EDITOR`). The overlay edits an in-memory
|
|
15
|
+
* {@link WatchdogConfigDoc} and only touches disk + the live advisors via the host
|
|
16
|
+
* `save` callback.
|
|
17
|
+
*/
|
|
18
|
+
import type { ThinkingLevel } from "@oh-my-pi/pi-agent-core";
|
|
19
|
+
import type { Model } from "@oh-my-pi/pi-ai";
|
|
20
|
+
import { type Component, type TUI } from "@oh-my-pi/pi-tui";
|
|
21
|
+
import { type AdvisorConfigScope, type WatchdogConfigDoc } from "../../advisor";
|
|
22
|
+
import type { ModelRegistry } from "../../config/model-registry";
|
|
23
|
+
import type { Settings } from "../../config/settings";
|
|
24
|
+
/** Host callbacks: all disk + live-runtime effects flow through these. */
|
|
25
|
+
export interface AdvisorConfigCallbacks {
|
|
26
|
+
/** Load a scope's `WATCHDOG.yml` into an editable doc (empty when absent). */
|
|
27
|
+
loadDoc: (scope: AdvisorConfigScope) => Promise<WatchdogConfigDoc>;
|
|
28
|
+
/** Persist the doc to the scope's file and rebuild the live advisors. */
|
|
29
|
+
save: (scope: AdvisorConfigScope, doc: WatchdogConfigDoc) => Promise<void>;
|
|
30
|
+
/** Tear down the overlay and restore the editor. */
|
|
31
|
+
close: () => void;
|
|
32
|
+
requestRender: () => void;
|
|
33
|
+
/** Surface a transient status/warning line to the user. */
|
|
34
|
+
notify: (message: string) => void;
|
|
35
|
+
}
|
|
36
|
+
export interface AdvisorConfigDeps {
|
|
37
|
+
modelRegistry: ModelRegistry;
|
|
38
|
+
settings: Settings;
|
|
39
|
+
scopedModels: ReadonlyArray<{
|
|
40
|
+
model: Model;
|
|
41
|
+
thinkingLevel?: ThinkingLevel;
|
|
42
|
+
}>;
|
|
43
|
+
availableToolNames: string[];
|
|
44
|
+
/** Formatted advisor-role model shown on the seeded default row (e.g. "anthropic/claude-..."). */
|
|
45
|
+
defaultModelLabel?: string;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Fullscreen advisor-configuration overlay. Implements {@link Component} directly
|
|
49
|
+
* (rather than extending Container) so it owns the whole frame and the mouse
|
|
50
|
+
* geometry needed to make every row clickable.
|
|
51
|
+
*/
|
|
52
|
+
export declare class AdvisorConfigOverlayComponent implements Component {
|
|
53
|
+
#private;
|
|
54
|
+
constructor(tui: TUI, deps: AdvisorConfigDeps, scope: AdvisorConfigScope, doc: WatchdogConfigDoc, callbacks: AdvisorConfigCallbacks);
|
|
55
|
+
render(width: number): readonly string[];
|
|
56
|
+
handleInput(data: string): void;
|
|
57
|
+
/** Forward enhanced-paste transports into a multiline instructions editor. */
|
|
58
|
+
pasteText(text: string): void;
|
|
59
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Model } from "@oh-my-pi/pi-ai";
|
|
2
|
-
import { Container, Input, type TUI } from "@oh-my-pi/pi-tui";
|
|
2
|
+
import { Container, Input, type SgrMouseEvent, type TUI } from "@oh-my-pi/pi-tui";
|
|
3
3
|
import type { ModelRegistry } from "../../config/model-registry";
|
|
4
4
|
import type { Settings } from "../../config/settings";
|
|
5
5
|
import { type ConfiguredThinkingLevel } from "../../thinking";
|
|
@@ -19,9 +19,17 @@ export declare class ModelSelectorComponent extends Container {
|
|
|
19
19
|
#private;
|
|
20
20
|
constructor(tui: TUI, _currentModel: Model | undefined, settings: Settings, modelRegistry: ModelRegistry, scopedModels: ReadonlyArray<ScopedModelItem>, onSelect: RoleSelectCallback, onCancel: () => void, options?: {
|
|
21
21
|
temporaryOnly?: boolean;
|
|
22
|
+
directSelect?: boolean;
|
|
23
|
+
pickerHint?: string;
|
|
22
24
|
initialSearchInput?: string;
|
|
23
25
|
currentContextTokens?: number;
|
|
24
26
|
});
|
|
27
|
+
/**
|
|
28
|
+
* Concatenate children like Container.render, recording where the model list
|
|
29
|
+
* lands so routed mouse events can be hit-tested against it.
|
|
30
|
+
*/
|
|
31
|
+
render(width: number): readonly string[];
|
|
32
|
+
routeMouse(event: SgrMouseEvent, line: number, _col: number): void;
|
|
25
33
|
handleInput(keyData: string): void;
|
|
26
34
|
getSearchInput(): Input;
|
|
27
35
|
}
|
|
@@ -34,6 +34,7 @@ export interface StatusLinePreviewSettings {
|
|
|
34
34
|
separator?: StatusLineSeparatorStyle;
|
|
35
35
|
sessionAccent?: boolean;
|
|
36
36
|
transparent?: boolean;
|
|
37
|
+
compactThinkingLevel?: boolean;
|
|
37
38
|
}
|
|
38
39
|
export interface SettingsCallbacks {
|
|
39
40
|
/** Called when any setting value changes */
|
|
@@ -16,7 +16,36 @@ export declare class StatusLineComponent implements Component {
|
|
|
16
16
|
setSubagentCount(count: number): void;
|
|
17
17
|
/** Active subagent count as currently displayed (collab state mirroring). */
|
|
18
18
|
get subagentCount(): number;
|
|
19
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Reset the currently-attached session's active-time accumulators so
|
|
21
|
+
* the `time_spent` segment starts from zero. Called from `/clear`,
|
|
22
|
+
* fresh-session, and joined-collab paths; both the completed
|
|
23
|
+
* accumulator and any in-flight window are dropped, so a reset
|
|
24
|
+
* mid-turn ignores the running window (the matching `markActivityEnd`
|
|
25
|
+
* will see an idle meter and no-op).
|
|
26
|
+
*/
|
|
27
|
+
resetActiveTime(): void;
|
|
28
|
+
/**
|
|
29
|
+
* Mark the currently-attached session as having started a unit of
|
|
30
|
+
* active processing. Idempotent: a second start while a window is
|
|
31
|
+
* already open is a no-op, so reentrant `agent_start` events (e.g.
|
|
32
|
+
* nested auto-compaction loops, focus-controller mid-turn attach onto
|
|
33
|
+
* an already-running window) do not double-count.
|
|
34
|
+
*/
|
|
35
|
+
markActivityStart(): void;
|
|
36
|
+
/**
|
|
37
|
+
* Close the currently-attached session's open active-processing
|
|
38
|
+
* window, folding its elapsed time into the accumulator. Idempotent
|
|
39
|
+
* when the meter is already idle so callers can fire it on every
|
|
40
|
+
* `agent_end` without guarding.
|
|
41
|
+
*/
|
|
42
|
+
markActivityEnd(): void;
|
|
43
|
+
/**
|
|
44
|
+
* Snapshot of total active-processing time for the currently-attached
|
|
45
|
+
* session, including any in-flight window. Exposed for the segment
|
|
46
|
+
* context builder; tests assert against this too.
|
|
47
|
+
*/
|
|
48
|
+
getActiveMs(): number;
|
|
20
49
|
setPlanModeStatus(status: {
|
|
21
50
|
enabled: boolean;
|
|
22
51
|
paused: boolean;
|
|
@@ -41,6 +41,9 @@ export interface StatusLineSettings {
|
|
|
41
41
|
/** Drop the theme's `statusLineBg` fill and powerline caps so the bar
|
|
42
42
|
* inherits the terminal's default background. */
|
|
43
43
|
transparent?: boolean;
|
|
44
|
+
/** Replace the model-segment icon with the thinking-level glyph and drop the
|
|
45
|
+
* " · <level>" suffix, so the thinking level reads as a single compact icon. */
|
|
46
|
+
compactThinkingLevel?: boolean;
|
|
44
47
|
}
|
|
45
48
|
export type EffectiveStatusLineSettings = Required<Pick<StatusLineSettings, "leftSegments" | "rightSegments" | "separator" | "segmentOptions">> & StatusLineSettings;
|
|
46
49
|
export type RGB = readonly [number, number, number];
|
|
@@ -51,6 +54,8 @@ export interface SegmentContext {
|
|
|
51
54
|
activeRepo: ActiveRepoContext | null;
|
|
52
55
|
width: number;
|
|
53
56
|
options: StatusLineSegmentOptions;
|
|
57
|
+
/** Render the model segment's thinking level as a compact leading glyph. */
|
|
58
|
+
compactThinkingLevel: boolean;
|
|
54
59
|
planMode: {
|
|
55
60
|
enabled: boolean;
|
|
56
61
|
paused: boolean;
|
|
@@ -78,7 +83,14 @@ export interface SegmentContext {
|
|
|
78
83
|
contextWindow: number;
|
|
79
84
|
autoCompactEnabled: boolean;
|
|
80
85
|
subagentCount: number;
|
|
81
|
-
|
|
86
|
+
/**
|
|
87
|
+
* Active processing time accumulated this session, in ms — the union of
|
|
88
|
+
* every `agent_start`→`agent_end` window plus the currently-streaming
|
|
89
|
+
* window if the agent is running. Idle wall-clock never contributes, so
|
|
90
|
+
* this is what {@link StatusLineSegmentId.time_spent} renders instead of
|
|
91
|
+
* `Date.now() - sessionStart`.
|
|
92
|
+
*/
|
|
93
|
+
activeMs: number;
|
|
82
94
|
git: {
|
|
83
95
|
branch: string | null;
|
|
84
96
|
status: {
|