@oh-my-pi/pi-coding-agent 16.2.2 → 16.2.4
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 +60 -0
- package/dist/cli.js +3682 -3615
- 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/cli/update-cli.d.ts +15 -0
- package/dist/types/collab/guest.d.ts +29 -0
- package/dist/types/collab/replication-shrink.d.ts +39 -0
- package/dist/types/config/provider-globals.d.ts +7 -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/memories/index.d.ts +20 -1
- 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 +35 -1
- package/dist/types/modes/components/status-line/types.d.ts +13 -1
- package/dist/types/modes/controllers/command-controller.d.ts +3 -3
- package/dist/types/modes/controllers/selector-controller.d.ts +1 -0
- package/dist/types/modes/interactive-mode.d.ts +11 -4
- package/dist/types/modes/skill-command.d.ts +32 -0
- package/dist/types/modes/types.d.ts +9 -3
- 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 +8 -7
- 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/autolearn/controller.ts +13 -22
- package/src/autoresearch/index.ts +7 -2
- package/src/cli/gc-cli.ts +17 -10
- package/src/cli/update-cli.ts +254 -0
- package/src/collab/guest.ts +43 -7
- package/src/collab/host.ts +13 -8
- package/src/collab/replication-shrink.ts +111 -0
- package/src/config/model-registry.ts +80 -18
- package/src/config/provider-globals.ts +25 -0
- 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/__tests__/julia-prelude.test.ts +2 -2
- 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 +130 -15
- package/src/memory-backend/local-backend.ts +5 -3
- 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 +150 -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 +27 -36
- package/src/modes/controllers/event-controller.ts +113 -1
- 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 +74 -25
- package/src/modes/skill-command.ts +116 -0
- package/src/modes/types.ts +9 -3
- package/src/modes/utils/ui-helpers.ts +41 -23
- package/src/prompts/agents/reviewer.md +11 -10
- package/src/prompts/goals/goal-todo-context.md +12 -0
- 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 +899 -429
- 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 +115 -22
- 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 +23 -24
- 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
- package/src/prompts/system/autolearn-nudge.md +0 -5
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type SessionTitleSlotEntry, type SessionTitleSource } from "./session-entries";
|
|
2
|
+
/** Semantic title update persisted by session storage backends. */
|
|
3
|
+
export interface SessionTitleUpdate {
|
|
4
|
+
title?: string;
|
|
5
|
+
source?: SessionTitleSource;
|
|
6
|
+
updatedAt: string;
|
|
7
|
+
}
|
|
8
|
+
/** Parse a physical title slot JSONL line. Returns undefined for legacy headers. */
|
|
9
|
+
export declare function parseTitleSlotLine(line: string): SessionTitleSlotEntry | undefined;
|
|
10
|
+
/** Parse the fixed-width title slot from a physical session body. */
|
|
11
|
+
export declare function parseTitleSlotFromContent(content: string): SessionTitleSlotEntry | undefined;
|
|
12
|
+
/** Convert a parsed title slot to the semantic storage update shape. */
|
|
13
|
+
export declare function titleUpdateFromSlot(slot: SessionTitleSlotEntry | undefined): SessionTitleUpdate | undefined;
|
|
14
|
+
/** Serialize the fixed-width first-line title slot, exactly 256 UTF-8 bytes including newline. */
|
|
15
|
+
export declare function serializeTitleSlot(options: SessionTitleUpdate): string;
|
|
16
|
+
/** Replace the physical fixed-width title slot in a full session body. */
|
|
17
|
+
export declare function overlayTitleSlotContent(content: string, update: SessionTitleUpdate): string;
|
|
18
|
+
/** Replace the physical fixed-width title slot in a prefix byte window. */
|
|
19
|
+
export declare function overlayTitleSlotPrefix(prefix: string, prefixBytes: number, update: SessionTitleUpdate): string;
|
|
@@ -14,6 +14,15 @@ export interface SSHHostInfo {
|
|
|
14
14
|
version: number;
|
|
15
15
|
os: SSHHostOs;
|
|
16
16
|
shell: SSHHostShell;
|
|
17
|
+
/**
|
|
18
|
+
* Shell name OMP verified can execute the POSIX transfer snippets
|
|
19
|
+
* (`head`/`cat`/`mv`/`test`/`ls`) `ssh://` uses. Probed by running
|
|
20
|
+
* `sh -lc` / `bash -lc` / `zsh -lc` against the remote and keeping the
|
|
21
|
+
* first one that round-trips a known marker. Independent of `shell`
|
|
22
|
+
* (the self-reported login shell), which may be noisy, exotic, or simply
|
|
23
|
+
* mis-classified — only `transferShell` gates ssh:// transfers.
|
|
24
|
+
*/
|
|
25
|
+
transferShell?: "sh" | "bash" | "zsh";
|
|
17
26
|
compatShell?: "bash" | "sh";
|
|
18
27
|
compatEnabled: boolean;
|
|
19
28
|
}
|
|
@@ -22,6 +31,44 @@ interface SSHArgsOptions {
|
|
|
22
31
|
/** When true, omit `-n` so the remote command can read from our piped stdin. */
|
|
23
32
|
allowStdin?: boolean;
|
|
24
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Parse a raw cache-file value (or any unknown) into a normalized
|
|
36
|
+
* {@link SSHHostInfo}, dropping fields that don't pass the per-field guards.
|
|
37
|
+
* Exported so cache-layer round-tripping (incl. the new `transferShell`
|
|
38
|
+
* field, #3719) is testable without touching disk.
|
|
39
|
+
*/
|
|
40
|
+
export declare function parseHostInfo(value: unknown): SSHHostInfo | null;
|
|
41
|
+
/**
|
|
42
|
+
* Frame marker emitted by the remote OS/shell probe. The probe wraps its
|
|
43
|
+
* payload in this prefix so the parser can ignore startup-file noise (banners,
|
|
44
|
+
* `motd`, login messages, `Last login: …`) instead of trusting only the first
|
|
45
|
+
* line of stdout. See #3719.
|
|
46
|
+
*/
|
|
47
|
+
export declare const HOST_PROBE_MARKER = "PI_HOST_PROBE=";
|
|
48
|
+
/** Marker for the transfer-shell capability probe. */
|
|
49
|
+
export declare const TRANSFER_PROBE_MARKER = "PI_TRANSFER_OK|";
|
|
50
|
+
/**
|
|
51
|
+
* Find the first line of `stdout`/`stderr` that begins with `marker` and
|
|
52
|
+
* return everything after it. Used by the SSH host probe so noisy login
|
|
53
|
+
* dotfiles can't corrupt OS/shell classification by emitting text on the
|
|
54
|
+
* first line of `ssh` output.
|
|
55
|
+
*
|
|
56
|
+
* Returns `null` when no marker line is found in either stream.
|
|
57
|
+
*/
|
|
58
|
+
export declare function extractProbePayload(stdout: string, stderr: string, marker?: string): string | null;
|
|
59
|
+
/**
|
|
60
|
+
* Find `marker` anywhere in `stdout` or `stderr` and return everything that
|
|
61
|
+
* follows it, scanning stdout first. Returns `null` when the marker is in
|
|
62
|
+
* neither stream.
|
|
63
|
+
*
|
|
64
|
+
* Used by the transfer-shell capability probe. Some remotes have broken
|
|
65
|
+
* login dotfiles that swap fd 1/2, so the marker can land on stderr even
|
|
66
|
+
* though the probe ran the printf successfully (matches the host-info
|
|
67
|
+
* probe's stderr fallback). See #3719.
|
|
68
|
+
*/
|
|
69
|
+
export declare function findProbeMarker(stdout: string, stderr: string, marker: string): string | null;
|
|
70
|
+
/** Classify a POSIX-ish `uname -s` payload from the transfer-shell probe. */
|
|
71
|
+
export declare function osFromUname(value: string): SSHHostOs | undefined;
|
|
25
72
|
export declare function getHostInfo(hostName: string): Promise<SSHHostInfo | undefined>;
|
|
26
73
|
export declare function getHostInfoForHost(host: SSHConnectionTarget): Promise<SSHHostInfo | undefined>;
|
|
27
74
|
/**
|
|
@@ -6,3 +6,19 @@ export declare function buildSshTarget(username: string | undefined, host: strin
|
|
|
6
6
|
* `ssh://` file-transfer helpers.
|
|
7
7
|
*/
|
|
8
8
|
export declare function quotePosixPath(value: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* Wrap a POSIX command in `<shell> -c '<command>'` so it runs under the
|
|
11
|
+
* named shell rather than whatever `$SHELL` happens to be on the remote.
|
|
12
|
+
*
|
|
13
|
+
* Used by the `ssh://` transfer helpers and the Windows compat dispatch:
|
|
14
|
+
* OpenSSH passes our snippets to `<login-shell> -c`, so a remote whose
|
|
15
|
+
* login shell is fish/csh/tcsh (or cmd/powershell on Windows compat)
|
|
16
|
+
* can't parse `if [ … ]; then …`. Wrapping forces parsing under the
|
|
17
|
+
* shell OMP actually verified can run the snippet.
|
|
18
|
+
*
|
|
19
|
+
* `-c` (not `-lc`): the transfer snippets only call absolute POSIX
|
|
20
|
+
* builtins (`head`/`cat`/`mv`/`test`/`ls`/`mkdir`/`rm`/`dirname`) and
|
|
21
|
+
* don't need login-profile setup. Capability *probing* still uses
|
|
22
|
+
* `-lc` to mirror the user's real environment.
|
|
23
|
+
*/
|
|
24
|
+
export declare function wrapInPosixShell(shell: "sh" | "bash" | "zsh", command: string): string;
|
|
@@ -23,7 +23,8 @@ import type { AuthStorage } from "../session/auth-storage";
|
|
|
23
23
|
import type { ContextFileEntry } from "../tools";
|
|
24
24
|
import type { EventBus } from "../utils/event-bus";
|
|
25
25
|
import type { WorkspaceTree } from "../workspace-tree";
|
|
26
|
-
import { type AgentDefinition, type AgentProgress, type ReviewFinding, type SingleResult } from "./types";
|
|
26
|
+
import { type AgentDefinition, type AgentProgress, type ReviewFinding, type SingleResult, type YieldItem } from "./types";
|
|
27
|
+
export type { YieldItem } from "./types";
|
|
27
28
|
/**
|
|
28
29
|
* Soft per-agent request budgets (assistant requests per run). When a subagent
|
|
29
30
|
* crosses its budget it receives ONE steering notice asking it to wrap up; at
|
|
@@ -164,20 +165,6 @@ export interface ExecutorOptions {
|
|
|
164
165
|
*/
|
|
165
166
|
keepAlive?: boolean;
|
|
166
167
|
}
|
|
167
|
-
export interface YieldItem {
|
|
168
|
-
data?: unknown;
|
|
169
|
-
status?: "success" | "aborted";
|
|
170
|
-
error?: string;
|
|
171
|
-
/**
|
|
172
|
-
* Set by the in-tool yield validator when it exhausted its retry budget
|
|
173
|
-
* (MAX_SCHEMA_RETRIES) and accepted a schema-invalid payload anyway.
|
|
174
|
-
* `finalizeSubprocessOutput` honors this by serializing the payload and
|
|
175
|
-
* surfacing a stderr warning, instead of re-emitting `schema_violation`
|
|
176
|
-
* — which would silently swap the subagent's "accepted" view for a
|
|
177
|
-
* different, opaque error blob in the parent's view of the result.
|
|
178
|
-
*/
|
|
179
|
-
schemaOverridden?: boolean;
|
|
180
|
-
}
|
|
181
168
|
interface FinalizeSubprocessOutputArgs {
|
|
182
169
|
rawOutput: string;
|
|
183
170
|
exitCode: number;
|
|
@@ -187,6 +174,7 @@ interface FinalizeSubprocessOutputArgs {
|
|
|
187
174
|
yieldItems?: YieldItem[];
|
|
188
175
|
reportFindings?: ReviewFinding[];
|
|
189
176
|
outputSchema: unknown;
|
|
177
|
+
lastAssistantText?: string;
|
|
190
178
|
}
|
|
191
179
|
interface FinalizeSubprocessOutputResult {
|
|
192
180
|
rawOutput: string;
|
|
@@ -217,4 +205,3 @@ export declare function finalizeSubagentLifecycle(args: {
|
|
|
217
205
|
* Run a single agent in-process.
|
|
218
206
|
*/
|
|
219
207
|
export declare function runSubprocess(options: ExecutorOptions): Promise<SingleResult>;
|
|
220
|
-
export {};
|
|
@@ -31,9 +31,4 @@ export declare function renderResult(result: {
|
|
|
31
31
|
details?: TaskToolDetails;
|
|
32
32
|
isError?: boolean;
|
|
33
33
|
}, options: TaskRenderOptions, theme: Theme, args?: TaskParams): Component;
|
|
34
|
-
export declare const taskToolRenderer: {
|
|
35
|
-
renderCall: typeof renderCall;
|
|
36
|
-
renderResult: typeof renderResult;
|
|
37
|
-
mergeCallAndResult: boolean;
|
|
38
|
-
};
|
|
39
34
|
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Task tool renderer export.
|
|
3
|
+
*
|
|
4
|
+
* Separated from render.ts to avoid circular dependency issues with
|
|
5
|
+
* tools/renderers.ts. This module has no side effects and can be safely
|
|
6
|
+
* imported without triggering the subprocessToolRegistry registration.
|
|
7
|
+
*/
|
|
8
|
+
import { renderCall, renderResult } from "./render";
|
|
9
|
+
export declare const taskToolRenderer: {
|
|
10
|
+
readonly renderCall: typeof renderCall;
|
|
11
|
+
readonly renderResult: typeof renderResult;
|
|
12
|
+
readonly mergeCallAndResult: true;
|
|
13
|
+
};
|
|
@@ -206,6 +206,22 @@ export interface AgentDefinition {
|
|
|
206
206
|
source: AgentSource;
|
|
207
207
|
filePath?: string;
|
|
208
208
|
}
|
|
209
|
+
/** Details extracted from a subagent `yield` tool call for final-result assembly and task rendering. */
|
|
210
|
+
export interface YieldItem {
|
|
211
|
+
data?: unknown;
|
|
212
|
+
status?: "success" | "aborted";
|
|
213
|
+
error?: string;
|
|
214
|
+
/** A string label is terminal; a non-empty array of labels is incremental. */
|
|
215
|
+
type?: string | string[];
|
|
216
|
+
/** Resolve this yield's payload from the latest durable assistant text instead of `data`. */
|
|
217
|
+
useLastTurn?: boolean;
|
|
218
|
+
/**
|
|
219
|
+
* Set by the in-tool yield validator when it exhausted its retry budget and
|
|
220
|
+
* accepted schema-invalid data anyway. The executor preserves that override
|
|
221
|
+
* during post-mortem validation.
|
|
222
|
+
*/
|
|
223
|
+
schemaOverridden?: boolean;
|
|
224
|
+
}
|
|
209
225
|
/** Progress tracking for a single agent */
|
|
210
226
|
export interface AgentProgress {
|
|
211
227
|
index: number;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { YieldItem } from "./types";
|
|
2
|
+
/** Outcome of folding a run's yield calls into one payload, with provenance flags. */
|
|
3
|
+
interface AssembledYieldResult {
|
|
4
|
+
data: unknown;
|
|
5
|
+
schemaOverridden: boolean;
|
|
6
|
+
rawText: boolean;
|
|
7
|
+
missingData: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Top-level output-schema property names declared as arrays (JTD `elements` →
|
|
11
|
+
* JSON `type: "array"`). An incremental yield section for such a label
|
|
12
|
+
* accumulates into a list even when the agent emits exactly one — otherwise a
|
|
13
|
+
* single `type: ["findings"]` yield would assemble as a bare object and fail
|
|
14
|
+
* array-typed schema validation.
|
|
15
|
+
*/
|
|
16
|
+
export declare function arrayValuedLabels(outputSchema: unknown): ReadonlySet<string>;
|
|
17
|
+
/**
|
|
18
|
+
* Assemble typed yield calls into the final payload consumed by schema validation.
|
|
19
|
+
*
|
|
20
|
+
* A non-empty array `type` contributes an incremental section and never decides
|
|
21
|
+
* termination by itself. A string `type` with omitted `data` makes the last
|
|
22
|
+
* assistant turn the raw terminal result. Other string-typed yields contribute
|
|
23
|
+
* the terminal labelled section. Untyped terminal yields keep the historical
|
|
24
|
+
* "last yield wins" behavior unless no terminal yield exists, in which case
|
|
25
|
+
* accumulated typed sections finalize on idle.
|
|
26
|
+
*/
|
|
27
|
+
export declare function assembleYieldResult(yieldItems: YieldItem[], lastAssistantText?: string, arrayLabels?: ReadonlySet<string>): AssembledYieldResult | undefined;
|
|
28
|
+
export {};
|
|
@@ -16,6 +16,14 @@ export declare function stripCodeBlocks(message: string): string;
|
|
|
16
16
|
/** Prepare a raw user message for titling: drop code blocks, then bound length. */
|
|
17
17
|
export declare function prepareTitleInput(message: string): string;
|
|
18
18
|
export declare function formatTitleUserMessage(message: string): string;
|
|
19
|
+
/** Single recent conversation turn supplied to title refresh after replanning. */
|
|
20
|
+
export interface TitleConversationTurn {
|
|
21
|
+
role: "user" | "assistant";
|
|
22
|
+
text?: string;
|
|
23
|
+
thinking?: string;
|
|
24
|
+
}
|
|
25
|
+
/** Format recent user/assistant context for title generation after a todo replan. */
|
|
26
|
+
export declare function formatTitleConversationContext(turns: readonly TitleConversationTurn[]): string;
|
|
19
27
|
/**
|
|
20
28
|
* True when a first user message is too low-signal to title (greeting, ack,
|
|
21
29
|
* bare number, or empty once code/punctuation/emoji are stripped).
|
|
@@ -45,6 +45,8 @@ export declare const TRUNCATE_LENGTHS: {
|
|
|
45
45
|
readonly LINE: 110;
|
|
46
46
|
/** Very short (task previews, badges) */
|
|
47
47
|
readonly SHORT: 40;
|
|
48
|
+
/** Idle recap status line (~40-word LLM reply) */
|
|
49
|
+
readonly RECAP: 280;
|
|
48
50
|
};
|
|
49
51
|
/** Human-readable key currently bound to tool-output expansion, e.g. `Ctrl+O`. */
|
|
50
52
|
export declare function expandKeyHint(): string;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Legacy hidden review-finding tool for agents that have not migrated to
|
|
3
|
+
* incremental `yield` sections.
|
|
3
4
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* Hidden by default - only enabled when explicitly listed in an agent's tools.
|
|
6
|
+
* Reviewers now finish via incremental `yield`; this tool remains for
|
|
7
|
+
* compatibility with older or custom review agents.
|
|
7
8
|
*/
|
|
8
9
|
import type { AgentTool } from "@oh-my-pi/pi-agent-core";
|
|
9
10
|
import type { Theme, ThemeColor } from "../modes/theme/theme";
|
|
@@ -15,6 +16,7 @@ export interface FindingPriorityInfo {
|
|
|
15
16
|
color: ThemeColor;
|
|
16
17
|
}
|
|
17
18
|
export declare const PRIORITY_LABELS: FindingPriority[];
|
|
19
|
+
export declare function isFindingPriority(value: unknown): value is FindingPriority;
|
|
18
20
|
export declare function getPriorityInfo(priority: FindingPriority): FindingPriorityInfo;
|
|
19
21
|
declare const ReportFindingParams: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
20
22
|
title: string;
|
|
@@ -67,7 +67,7 @@ export declare const sshToolRenderer: {
|
|
|
67
67
|
renderContext?: SshRenderContext;
|
|
68
68
|
}, uiTheme: Theme, args?: SshRenderArgs): Component;
|
|
69
69
|
mergeCallAndResult: boolean;
|
|
70
|
-
provisionalPendingPreview:
|
|
70
|
+
provisionalPendingPreview: boolean;
|
|
71
71
|
provisionalPartialResult: boolean;
|
|
72
72
|
};
|
|
73
73
|
export {};
|
|
@@ -6,6 +6,8 @@ import type { Theme } from "../modes/theme/theme";
|
|
|
6
6
|
import type { ToolSession } from "../sdk";
|
|
7
7
|
import type { SessionEntry } from "../session/session-entries";
|
|
8
8
|
export type TodoStatus = "pending" | "in_progress" | "completed" | "abandoned";
|
|
9
|
+
/** Operation names accepted by the todo tool and echoed in successful result details. */
|
|
10
|
+
export type TodoOperation = "init" | "start" | "done" | "rm" | "drop" | "append" | "view";
|
|
9
11
|
export interface TodoItem {
|
|
10
12
|
content: string;
|
|
11
13
|
status: TodoStatus;
|
|
@@ -19,6 +21,8 @@ export interface TodoCompletionTransition {
|
|
|
19
21
|
content: string;
|
|
20
22
|
}
|
|
21
23
|
export interface TodoToolDetails {
|
|
24
|
+
/** Operation that produced this snapshot; absent on legacy transcript entries. */
|
|
25
|
+
op?: TodoOperation;
|
|
22
26
|
phases: TodoPhase[];
|
|
23
27
|
storage: "session" | "memory";
|
|
24
28
|
completedTasks?: TodoCompletionTransition[];
|
|
@@ -35,6 +39,8 @@ declare const todoSchema: import("arktype/internal/variants/object.ts").ObjectTy
|
|
|
35
39
|
}, {}>;
|
|
36
40
|
type TodoParams = TodoSchema;
|
|
37
41
|
type TodoSchema = typeof todoSchema.infer;
|
|
42
|
+
/** Return the active todo task, preferring an in-progress item over the first pending item. */
|
|
43
|
+
export declare function nextActionableTask(phases: readonly TodoPhase[]): TodoItem | undefined;
|
|
38
44
|
export declare const USER_TODO_EDIT_CUSTOM_TYPE = "user_todo_edit";
|
|
39
45
|
export declare function getLatestTodoPhasesFromEntries(entries: SessionEntry[]): TodoPhase[];
|
|
40
46
|
/**
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Result submission tool for subagent output.
|
|
3
3
|
*
|
|
4
|
-
* Subagents
|
|
4
|
+
* Subagents can call this tool incrementally or terminally depending on `type`.
|
|
5
5
|
*/
|
|
6
6
|
import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@oh-my-pi/pi-agent-core";
|
|
7
7
|
import type { TSchema } from "@oh-my-pi/pi-ai/types";
|
|
8
8
|
import type { ToolSession } from ".";
|
|
9
9
|
export interface YieldDetails {
|
|
10
|
-
|
|
10
|
+
/** Successful result payload, or omitted when `useLastTurn` requests last-turn extraction. */
|
|
11
|
+
data?: unknown;
|
|
11
12
|
status: "success" | "aborted";
|
|
12
13
|
error?: string;
|
|
14
|
+
/** Optional result section/classification supplied by the yield caller. */
|
|
15
|
+
type?: string | string[];
|
|
16
|
+
/** True when the caller intentionally omitted success data so the executor uses the last assistant turn. */
|
|
17
|
+
useLastTurn?: boolean;
|
|
13
18
|
/**
|
|
14
19
|
* Set when the yield tool exhausted its in-tool schema-retry budget
|
|
15
20
|
* (MAX_SCHEMA_RETRIES) and accepted the data anyway. Surfaced so the
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import type { AgentMessage } from "@oh-my-pi/pi-agent-core";
|
|
1
2
|
export declare function canonicalizeMessage(text: string | null | undefined): string;
|
|
2
3
|
export declare function formatThinkingForDisplay(text: string, proseOnly: boolean): string;
|
|
4
|
+
/** Whether a formatted thinking block has non-placeholder content worth rendering. */
|
|
3
5
|
export declare function hasDisplayableThinking(text: string | null | undefined, formattedText: string | null | undefined): boolean;
|
|
6
|
+
/** Whether an assistant message contains thinking content the TUI can reveal. */
|
|
7
|
+
export declare function messageHasDisplayableThinking(message: AgentMessage, proseOnly: boolean): boolean;
|
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.4",
|
|
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",
|
|
@@ -55,17 +55,17 @@
|
|
|
55
55
|
"@agentclientprotocol/sdk": "0.25.0",
|
|
56
56
|
"@babel/parser": "^7.29.7",
|
|
57
57
|
"@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.
|
|
58
|
+
"@oh-my-pi/hashline": "16.2.4",
|
|
59
|
+
"@oh-my-pi/omp-stats": "16.2.4",
|
|
60
|
+
"@oh-my-pi/pi-agent-core": "16.2.4",
|
|
61
|
+
"@oh-my-pi/pi-ai": "16.2.4",
|
|
62
|
+
"@oh-my-pi/pi-catalog": "16.2.4",
|
|
63
|
+
"@oh-my-pi/pi-mnemopi": "16.2.4",
|
|
64
|
+
"@oh-my-pi/pi-natives": "16.2.4",
|
|
65
|
+
"@oh-my-pi/pi-tui": "16.2.4",
|
|
66
|
+
"@oh-my-pi/pi-utils": "16.2.4",
|
|
67
|
+
"@oh-my-pi/pi-wire": "16.2.4",
|
|
68
|
+
"@oh-my-pi/snapcompact": "16.2.4",
|
|
69
69
|
"@opentelemetry/api": "^1.9.1",
|
|
70
70
|
"@opentelemetry/context-async-hooks": "^2.7.1",
|
|
71
71
|
"@opentelemetry/exporter-trace-otlp-proto": "^0.218.0",
|