@oh-my-pi/pi-coding-agent 16.2.1 → 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 +72 -0
- package/dist/cli.js +3621 -3579
- 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/runtime.d.ts +15 -1
- 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/model-roles.d.ts +1 -1
- package/dist/types/config/settings-schema.d.ts +113 -12
- package/dist/types/debug/log-viewer.d.ts +1 -0
- package/dist/types/debug/raw-sse.d.ts +1 -0
- package/dist/types/discovery/omp-extension-roots.d.ts +3 -3
- package/dist/types/edit/hashline/diff.d.ts +0 -11
- package/dist/types/edit/index.d.ts +18 -0
- package/dist/types/edit/streaming.d.ts +30 -0
- package/dist/types/extensibility/custom-tools/types.d.ts +1 -0
- package/dist/types/extensibility/shared-events.d.ts +1 -0
- package/dist/types/extensibility/tool-event-input.d.ts +7 -0
- package/dist/types/extensibility/utils.d.ts +12 -0
- package/dist/types/mcp/oauth-discovery.d.ts +0 -11
- 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 -3
- 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/sdk.d.ts +1 -1
- package/dist/types/session/agent-session.d.ts +84 -12
- package/dist/types/session/indexed-session-storage.d.ts +7 -1
- package/dist/types/session/messages.d.ts +32 -7
- 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/session/settings-stream-fn.d.ts +21 -0
- package/dist/types/session/turn-persistence.d.ts +88 -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 +438 -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 +77 -4
- package/src/advisor/transcript-recorder.ts +25 -2
- package/src/advisor/watchdog.ts +57 -31
- package/src/auto-thinking/classifier.ts +2 -2
- 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/model-resolver.ts +5 -1
- package/src/config/model-roles.ts +3 -3
- package/src/config/settings-schema.ts +107 -8
- 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/discovery/omp-extension-roots.ts +38 -13
- package/src/edit/hashline/diff.ts +57 -4
- package/src/edit/index.ts +21 -0
- package/src/edit/streaming.ts +170 -0
- package/src/eval/js/shared/local-module-loader.ts +23 -1
- package/src/export/html/template.js +13 -7
- package/src/extensibility/custom-tools/types.ts +1 -0
- 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/legacy-pi-bundled-keys.ts +18 -1
- package/src/extensibility/plugins/legacy-pi-bundled-registry.ts +59 -2
- package/src/extensibility/plugins/manager.ts +76 -5
- package/src/extensibility/shared-events.ts +1 -0
- 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/oauth-discovery.ts +5 -29
- package/src/mcp/transports/http.ts +3 -1
- 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/mnemopi/backend.ts +2 -2
- package/src/modes/acp/acp-agent.ts +1 -1
- 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/assistant-message.ts +5 -5
- 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 +145 -14
- package/src/modes/components/status-line/segments.ts +47 -22
- 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 +114 -11
- 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 -10
- package/src/modes/print-mode.ts +1 -1
- package/src/modes/skill-command.ts +116 -0
- package/src/modes/types.ts +7 -2
- package/src/modes/utils/transcript-render-helpers.ts +2 -2
- package/src/modes/utils/ui-helpers.ts +46 -27
- 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 +40 -50
- package/src/session/agent-session.ts +1139 -600
- package/src/session/indexed-session-storage.ts +86 -13
- package/src/session/messages.test.ts +125 -0
- package/src/session/messages.ts +192 -21
- 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 +96 -3
- package/src/session/session-storage.ts +36 -0
- package/src/session/session-title-slot.ts +141 -0
- package/src/session/settings-stream-fn.ts +49 -0
- package/src/session/sql-session-storage.ts +71 -11
- package/src/session/turn-persistence.ts +142 -0
- package/src/session/unexpected-stop-classifier.ts +2 -2
- package/src/slash-commands/builtin-registry.ts +16 -3
- package/src/slash-commands/helpers/mcp.ts +2 -1
- 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/models.ts +8 -6
- package/src/tiny/text.ts +37 -7
- package/src/tools/ask.ts +55 -4
- package/src/tools/image-gen.ts +2 -1
- 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/tts.ts +2 -1
- package/src/tools/yield.ts +140 -31
- package/src/utils/thinking-display.ts +15 -0
- package/src/utils/title-generator.ts +1 -1
- package/src/web/search/providers/tavily.ts +36 -19
|
@@ -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>;
|
|
@@ -1,12 +1,24 @@
|
|
|
1
1
|
import type { AgentMessage } from "@oh-my-pi/pi-agent-core";
|
|
2
2
|
import { type SecretObfuscator } from "../secrets/obfuscator";
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* Minimal slice of `Agent` the runtime drives — satisfied by pi-agent-core
|
|
5
|
+
* `Agent`. `state.error` mirrors `Agent.state.error`: provider/stream failures
|
|
6
|
+
* the loop catches internally never reject `prompt()`, so the runtime reads
|
|
7
|
+
* this field after every prompt to detect a failed turn.
|
|
8
|
+
*/
|
|
4
9
|
export interface AdvisorAgent {
|
|
5
10
|
prompt(input: string): Promise<void>;
|
|
6
11
|
abort(reason?: unknown): void;
|
|
7
12
|
reset(): void;
|
|
13
|
+
/**
|
|
14
|
+
* Drop messages appended past `count`. Called after a failed `prompt()` so a
|
|
15
|
+
* retry doesn't replay the failed user batch + synthetic assistant-error
|
|
16
|
+
* turn `Agent.#runLoop` records on its internal state.
|
|
17
|
+
*/
|
|
18
|
+
rollbackTo?(count: number): void;
|
|
8
19
|
readonly state: {
|
|
9
20
|
messages: AgentMessage[];
|
|
21
|
+
error?: string;
|
|
10
22
|
};
|
|
11
23
|
}
|
|
12
24
|
export interface AdvisorRuntimeHost {
|
|
@@ -33,6 +45,8 @@ export interface AdvisorRuntimeHost {
|
|
|
33
45
|
* one that routes `advise()` results back to the primary.
|
|
34
46
|
*/
|
|
35
47
|
beginAdvisorUpdate?(): void;
|
|
48
|
+
/** Surface a non-recovering advisor failure to the host UI without adding model-visible context. */
|
|
49
|
+
notifyFailure?(error: unknown): void;
|
|
36
50
|
}
|
|
37
51
|
export declare class AdvisorRuntime {
|
|
38
52
|
#private;
|
|
@@ -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;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { type ThemeColor } from "../modes/theme/theme";
|
|
5
5
|
import type { Settings } from "./settings";
|
|
6
|
-
export type ModelRole = "default" | "smol" | "slow" | "vision" | "plan" | "designer" | "commit" | "
|
|
6
|
+
export type ModelRole = "default" | "smol" | "slow" | "vision" | "plan" | "designer" | "commit" | "tiny" | "task" | "advisor";
|
|
7
7
|
export interface ModelRoleInfo {
|
|
8
8
|
tag?: string;
|
|
9
9
|
name: string;
|
|
@@ -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;
|
|
@@ -1198,6 +1208,30 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
1198
1208
|
}];
|
|
1199
1209
|
};
|
|
1200
1210
|
};
|
|
1211
|
+
readonly textVerbosity: {
|
|
1212
|
+
readonly type: "enum";
|
|
1213
|
+
readonly values: readonly ["low", "medium", "high"];
|
|
1214
|
+
readonly default: "high";
|
|
1215
|
+
readonly ui: {
|
|
1216
|
+
readonly tab: "model";
|
|
1217
|
+
readonly group: "Sampling";
|
|
1218
|
+
readonly label: "Text Verbosity";
|
|
1219
|
+
readonly description: "OpenAI Responses and Codex response verbosity (low, medium, or high)";
|
|
1220
|
+
readonly options: readonly [{
|
|
1221
|
+
readonly value: "low";
|
|
1222
|
+
readonly label: "Low";
|
|
1223
|
+
readonly description: "Prefer concise responses";
|
|
1224
|
+
}, {
|
|
1225
|
+
readonly value: "medium";
|
|
1226
|
+
readonly label: "Medium";
|
|
1227
|
+
readonly description: "Balance brevity and detail";
|
|
1228
|
+
}, {
|
|
1229
|
+
readonly value: "high";
|
|
1230
|
+
readonly label: "High";
|
|
1231
|
+
readonly description: "Prefer detailed responses (default)";
|
|
1232
|
+
}];
|
|
1233
|
+
};
|
|
1234
|
+
};
|
|
1201
1235
|
readonly serviceTier: {
|
|
1202
1236
|
readonly type: "enum";
|
|
1203
1237
|
readonly values: readonly ["none", "auto", "default", "flex", "scale", "priority", "openai-only", "claude-only"];
|
|
@@ -1643,6 +1677,42 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
1643
1677
|
readonly description: "Notify when the ask tool is waiting for input";
|
|
1644
1678
|
};
|
|
1645
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
|
+
};
|
|
1646
1716
|
readonly "collab.relayUrl": {
|
|
1647
1717
|
readonly type: "string";
|
|
1648
1718
|
readonly default: "wss://my.omp.sh";
|
|
@@ -1931,6 +2001,16 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
1931
2001
|
readonly description: "Use remote compaction endpoints when available instead of local summarization";
|
|
1932
2002
|
};
|
|
1933
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
|
+
};
|
|
1934
2014
|
readonly "compaction.reserveTokens": {
|
|
1935
2015
|
readonly type: "number";
|
|
1936
2016
|
readonly default: 16384;
|
|
@@ -1947,6 +2027,10 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
1947
2027
|
readonly type: "string";
|
|
1948
2028
|
readonly default: undefined;
|
|
1949
2029
|
};
|
|
2030
|
+
readonly "compaction.v2RetainedMessageBudget": {
|
|
2031
|
+
readonly type: "number";
|
|
2032
|
+
readonly default: 64000;
|
|
2033
|
+
};
|
|
1950
2034
|
readonly "compaction.idleEnabled": {
|
|
1951
2035
|
readonly type: "boolean";
|
|
1952
2036
|
readonly default: false;
|
|
@@ -2080,7 +2164,7 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
2080
2164
|
};
|
|
2081
2165
|
readonly "tools.format": {
|
|
2082
2166
|
readonly type: "enum";
|
|
2083
|
-
readonly values: readonly ["auto", "native", "glm", "hermes", "kimi", "xml", "anthropic", "deepseek", "harmony", "
|
|
2167
|
+
readonly values: readonly ["auto", "native", "glm", "hermes", "kimi", "xml", "anthropic", "deepseek", "harmony", "qwen3", "gemini", "gemma", "minimax"];
|
|
2084
2168
|
readonly default: "auto";
|
|
2085
2169
|
readonly ui: {
|
|
2086
2170
|
readonly tab: "context";
|
|
@@ -2123,10 +2207,6 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
2123
2207
|
readonly value: "harmony";
|
|
2124
2208
|
readonly label: "Harmony";
|
|
2125
2209
|
readonly description: "Use Harmony-style in-band tool calls.";
|
|
2126
|
-
}, {
|
|
2127
|
-
readonly value: "pi";
|
|
2128
|
-
readonly label: "Pi";
|
|
2129
|
-
readonly description: "Use the Pi owned dialect (compact sigil-delimited tool calls).";
|
|
2130
2210
|
}, {
|
|
2131
2211
|
readonly value: "qwen3";
|
|
2132
2212
|
readonly label: "Qwen3";
|
|
@@ -2532,7 +2612,7 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
2532
2612
|
readonly tab: "memory";
|
|
2533
2613
|
readonly group: "Mnemopi";
|
|
2534
2614
|
readonly label: "Mnemopi LLM Mode";
|
|
2535
|
-
readonly description: "Use no LLM, the
|
|
2615
|
+
readonly description: "Use no LLM, the online tiny model (the TINY role from /models, else pi/smol), or a remote OpenAI-compatible endpoint";
|
|
2536
2616
|
readonly condition: "mnemopiActive";
|
|
2537
2617
|
readonly options: readonly [{
|
|
2538
2618
|
readonly value: "none";
|
|
@@ -2540,8 +2620,8 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
2540
2620
|
readonly description: "Disable Mnemopi LLM-backed extraction";
|
|
2541
2621
|
}, {
|
|
2542
2622
|
readonly value: "smol";
|
|
2543
|
-
readonly label: "
|
|
2544
|
-
readonly description: "Use the
|
|
2623
|
+
readonly label: "Online (tiny)";
|
|
2624
|
+
readonly description: "Use the online tiny model (the TINY role from /models, else pi/smol)";
|
|
2545
2625
|
}, {
|
|
2546
2626
|
readonly value: "remote";
|
|
2547
2627
|
readonly label: "Remote";
|
|
@@ -3887,6 +3967,16 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
3887
3967
|
readonly description: "Run modes where active goals may auto-continue between turns";
|
|
3888
3968
|
};
|
|
3889
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
|
+
};
|
|
3890
3980
|
readonly "task.isolation.mode": {
|
|
3891
3981
|
readonly type: "enum";
|
|
3892
3982
|
readonly values: readonly ["none", "auto", "apfs", "btrfs", "zfs", "reflink", "overlayfs", "projfs", "block-clone", "rcopy"];
|
|
@@ -4607,7 +4697,7 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
4607
4697
|
readonly tab: "providers";
|
|
4608
4698
|
readonly group: "Tiny Model";
|
|
4609
4699
|
readonly label: "Tiny Model";
|
|
4610
|
-
readonly description: "Session-title model: online pi/smol by default, or a local on-device model";
|
|
4700
|
+
readonly description: "Session-title model: online (the TINY role from /models, else pi/smol) by default, or a local on-device model";
|
|
4611
4701
|
readonly options: ({
|
|
4612
4702
|
value: "online";
|
|
4613
4703
|
label: string;
|
|
@@ -4763,7 +4853,7 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
4763
4853
|
readonly tab: "memory";
|
|
4764
4854
|
readonly group: "General";
|
|
4765
4855
|
readonly label: "Memory Model";
|
|
4766
|
-
readonly description: "Mnemopi LLM for fact extraction + consolidation: online (smol/remote) by default, or a local on-device model";
|
|
4856
|
+
readonly description: "Mnemopi LLM for fact extraction + consolidation: online (the TINY role from /models, else smol/remote) by default, or a local on-device model";
|
|
4767
4857
|
readonly condition: "mnemopiActive";
|
|
4768
4858
|
readonly options: ({
|
|
4769
4859
|
value: "online";
|
|
@@ -4784,7 +4874,7 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
4784
4874
|
readonly tab: "model";
|
|
4785
4875
|
readonly group: "Thinking";
|
|
4786
4876
|
readonly label: "Auto Thinking Model";
|
|
4787
|
-
readonly description: "Difficulty classifier for the `auto` thinking level: online smol by default, or a local on-device model";
|
|
4877
|
+
readonly description: "Difficulty classifier for the `auto` thinking level: online (the TINY role from /models, else smol) by default, or a local on-device model";
|
|
4788
4878
|
readonly condition: "autoThinkingActive";
|
|
4789
4879
|
readonly options: ({
|
|
4790
4880
|
value: "online";
|
|
@@ -4815,7 +4905,7 @@ export declare const SETTINGS_SCHEMA: {
|
|
|
4815
4905
|
readonly tab: "providers";
|
|
4816
4906
|
readonly group: "Tiny Model";
|
|
4817
4907
|
readonly label: "Unexpected Stop Model";
|
|
4818
|
-
readonly description: "Classifier for unexpected-stop detection: online smol by default, or a local on-device model.";
|
|
4908
|
+
readonly description: "Classifier for unexpected-stop detection: online (the TINY role from /models, else smol) by default, or a local on-device model.";
|
|
4819
4909
|
readonly condition: "unexpectedStopDetection";
|
|
4820
4910
|
readonly options: ({
|
|
4821
4911
|
value: "online";
|
|
@@ -5252,12 +5342,21 @@ export interface CompactionSettings {
|
|
|
5252
5342
|
autoContinue: boolean;
|
|
5253
5343
|
remoteEnabled: boolean;
|
|
5254
5344
|
remoteEndpoint: string | undefined;
|
|
5345
|
+
remoteStreamingV2Enabled: boolean;
|
|
5346
|
+
v2RetainedMessageBudget: number;
|
|
5255
5347
|
idleEnabled: boolean;
|
|
5256
5348
|
idleThresholdTokens: number;
|
|
5257
5349
|
idleTimeoutSeconds: number;
|
|
5258
5350
|
supersedeReads: boolean;
|
|
5259
5351
|
dropUseless: boolean;
|
|
5260
5352
|
}
|
|
5353
|
+
export interface RecapSettings {
|
|
5354
|
+
enabled: boolean;
|
|
5355
|
+
idleSeconds: number;
|
|
5356
|
+
}
|
|
5357
|
+
export interface TitleSettings {
|
|
5358
|
+
refreshOnReplan: boolean;
|
|
5359
|
+
}
|
|
5261
5360
|
export interface ContextPromotionSettings {
|
|
5262
5361
|
enabled: boolean;
|
|
5263
5362
|
}
|
|
@@ -5388,6 +5487,8 @@ export interface GcSettings {
|
|
|
5388
5487
|
/** Map group prefix -> typed settings interface */
|
|
5389
5488
|
export interface GroupTypeMap {
|
|
5390
5489
|
compaction: CompactionSettings;
|
|
5490
|
+
recap: RecapSettings;
|
|
5491
|
+
title: TitleSettings;
|
|
5391
5492
|
contextPromotion: ContextPromotionSettings;
|
|
5392
5493
|
retry: RetrySettings;
|
|
5393
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[];
|
|
@@ -31,9 +31,9 @@ export declare function getInjectedOmpExtensionCliRoots(): readonly OmpExtension
|
|
|
31
31
|
* 1. CLI roots injected via {@link injectOmpExtensionCliRoots}
|
|
32
32
|
* 2. Project `<cwd>/.omp/settings.json#extensions`
|
|
33
33
|
* 3. User `~/.omp/agent/settings.json#extensions`
|
|
34
|
-
* 4. Enabled plugins installed under `<plugins>/node_modules/` (
|
|
35
|
-
* `omp install <pkg>` / `omp plugin install` / `omp plugin link`)
|
|
36
|
-
*
|
|
34
|
+
* 4. Enabled npm/link plugins installed under `<plugins>/node_modules/` (for
|
|
35
|
+
* `omp install <pkg>` / `omp plugin install` / `omp plugin link`). Marketplace
|
|
36
|
+
* installs are loaded by the `claude-plugins` provider and are excluded here.
|
|
37
37
|
* Only entries that resolve to a directory on disk are returned; file
|
|
38
38
|
* entrypoints contribute zero sub-discovery surface and are filtered out.
|
|
39
39
|
* Installed-plugin enumeration failures (missing lockfile, unreadable
|
|
@@ -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
|
/**
|
|
@@ -60,5 +60,23 @@ export declare class EditTool implements AgentTool<TInput> {
|
|
|
60
60
|
* mode-specific patch grammar.
|
|
61
61
|
*/
|
|
62
62
|
matcherDigest(args: unknown): string | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* Project the streamed args onto their target file paths so path-scoped
|
|
65
|
+
* stream matchers (e.g. TTSR `tool:edit(*.ts)` globs) match hashline and
|
|
66
|
+
* apply_patch edits even though the path lives in the wire payload (a
|
|
67
|
+
* section header / envelope marker) rather than a top-level argument.
|
|
68
|
+
*/
|
|
69
|
+
matcherPaths(args: unknown): readonly string[] | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* Per-file projection of the streamed args, splitting multi-section
|
|
72
|
+
* hashline / multi-hunk apply_patch payloads into one (path, digest) entry
|
|
73
|
+
* per touched file. Path-scoped stream matchers (TTSR) then evaluate each
|
|
74
|
+
* file in isolation, so a `tool:edit(*.ts)` rule never fires on text that
|
|
75
|
+
* actually belongs to a sibling Markdown hunk.
|
|
76
|
+
*/
|
|
77
|
+
matcherEntries(args: unknown): readonly {
|
|
78
|
+
path: string;
|
|
79
|
+
digest: string;
|
|
80
|
+
}[] | undefined;
|
|
63
81
|
execute(_toolCallId: string, params: EditParams, signal?: AbortSignal, onUpdate?: AgentToolUpdateCallback<EditToolDetails, TInput>, context?: AgentToolContext): Promise<AgentToolResult<EditToolDetails, TInput>>;
|
|
64
82
|
}
|
|
@@ -35,6 +35,16 @@ export interface StreamingDiffContext {
|
|
|
35
35
|
*/
|
|
36
36
|
isStreaming?: boolean;
|
|
37
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Per-file projection of a streamed edit payload. Pairs one target file path
|
|
40
|
+
* with the digest of only the lines added to that file, so path-scoped stream
|
|
41
|
+
* matchers (TTSR) evaluate each file in isolation — a `tool:edit(*.ts)` rule
|
|
42
|
+
* never fires on text that actually belongs to a sibling `README.md` hunk.
|
|
43
|
+
*/
|
|
44
|
+
export interface EditMatcherEntry {
|
|
45
|
+
readonly path: string;
|
|
46
|
+
readonly digest: string;
|
|
47
|
+
}
|
|
38
48
|
export interface EditStreamingStrategy<Args = unknown> {
|
|
39
49
|
/**
|
|
40
50
|
* Return the args restricted to edits that are "complete enough" to
|
|
@@ -60,6 +70,26 @@ export interface EditStreamingStrategy<Args = unknown> {
|
|
|
60
70
|
* args don't yet carry any content.
|
|
61
71
|
*/
|
|
62
72
|
matcherDigest(args: Args): string | undefined;
|
|
73
|
+
/**
|
|
74
|
+
* Surface the target file paths a (potentially partial) call would touch,
|
|
75
|
+
* so path-scoped stream matchers (e.g. TTSR `tool:edit(*.ts)` globs) match
|
|
76
|
+
* even when the path is not a top-level argument but lives inside the wire
|
|
77
|
+
* payload — `hashline` section headers, `apply_patch` envelope markers.
|
|
78
|
+
* Returns `undefined` (or an empty list) when no paths are recoverable.
|
|
79
|
+
*/
|
|
80
|
+
matcherPaths(args: Args): readonly string[] | undefined;
|
|
81
|
+
/**
|
|
82
|
+
* Per-file projection of the (potentially partial) args: one entry per
|
|
83
|
+
* touched file pairing the path with the digest of only the lines added to
|
|
84
|
+
* that file. Multi-file payloads (multi-section hashline / multi-hunk
|
|
85
|
+
* apply_patch) MUST split here so callers can evaluate each file under its
|
|
86
|
+
* own path scope instead of leaking added lines from one file into the
|
|
87
|
+
* other's match context. Same-path sections / hunks are merged into one
|
|
88
|
+
* entry. Returns `undefined` (or empty) when no per-file split is
|
|
89
|
+
* recoverable yet — the caller falls back to {@link matcherDigest} +
|
|
90
|
+
* {@link matcherPaths}.
|
|
91
|
+
*/
|
|
92
|
+
matcherEntries(args: Args): readonly EditMatcherEntry[] | undefined;
|
|
63
93
|
}
|
|
64
94
|
/**
|
|
65
95
|
* Given an edits array parsed from partial JSON, drop the last entry when the
|
|
@@ -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 {};
|