@oh-my-pi/pi-coding-agent 14.4.1 → 14.4.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 +56 -0
- package/package.json +7 -7
- package/src/cli.ts +0 -1
- package/src/config/prompt-templates.ts +0 -30
- package/src/config/settings-schema.ts +26 -36
- package/src/config/settings.ts +1 -1
- package/src/edit/index.ts +1 -53
- package/src/edit/line-hash.ts +0 -53
- package/src/edit/modes/atom.ts +82 -47
- package/src/edit/modes/hashline.ts +6 -8
- package/src/edit/renderer.ts +6 -8
- package/src/edit/streaming.ts +90 -114
- package/src/export/html/template.generated.ts +1 -1
- package/src/export/html/template.js +10 -15
- package/src/internal-urls/docs-index.generated.ts +1 -2
- package/src/modes/components/settings-defs.ts +0 -5
- package/src/modes/components/tool-execution.ts +2 -5
- package/src/modes/controllers/btw-controller.ts +17 -105
- package/src/modes/controllers/todo-command-controller.ts +537 -0
- package/src/modes/interactive-mode.ts +35 -9
- package/src/modes/types.ts +2 -0
- package/src/modes/utils/ui-helpers.ts +17 -0
- package/src/prompts/system/irc-incoming.md +8 -0
- package/src/prompts/system/subagent-system-prompt.md +8 -0
- package/src/prompts/tools/ast-grep.md +1 -1
- package/src/prompts/tools/atom.md +37 -26
- package/src/prompts/tools/bash.md +2 -2
- package/src/prompts/tools/grep.md +2 -5
- package/src/prompts/tools/irc.md +49 -0
- package/src/prompts/tools/job.md +11 -0
- package/src/prompts/tools/read.md +12 -13
- package/src/prompts/tools/task.md +1 -1
- package/src/prompts/tools/todo-write.md +14 -5
- package/src/registry/agent-registry.ts +139 -0
- package/src/sdk.ts +35 -0
- package/src/session/agent-session.ts +217 -5
- package/src/session/streaming-output.ts +1 -1
- package/src/slash-commands/builtin-registry.ts +24 -0
- package/src/task/executor.ts +14 -0
- package/src/tools/bash.ts +1 -1
- package/src/tools/fetch.ts +18 -6
- package/src/tools/fs-cache-invalidation.ts +0 -5
- package/src/tools/grep.ts +4 -124
- package/src/tools/index.ts +12 -6
- package/src/tools/irc.ts +258 -0
- package/src/tools/job.ts +489 -0
- package/src/tools/match-line-format.ts +7 -6
- package/src/tools/output-meta.ts +1 -1
- package/src/tools/read.ts +36 -126
- package/src/tools/renderers.ts +2 -0
- package/src/tools/todo-write.ts +243 -12
- package/src/utils/edit-mode.ts +1 -2
- package/src/utils/file-display-mode.ts +0 -3
- package/src/cli/read-cli.ts +0 -67
- package/src/commands/read.ts +0 -33
- package/src/edit/modes/chunk.ts +0 -832
- package/src/prompts/tools/cancel-job.md +0 -5
- package/src/prompts/tools/chunk-edit.md +0 -158
- package/src/prompts/tools/poll.md +0 -5
- package/src/prompts/tools/read-chunk.md +0 -73
- package/src/tools/cancel-job.ts +0 -95
- package/src/tools/poll-tool.ts +0 -173
package/src/cli/read-cli.ts
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Read CLI command handler.
|
|
3
|
-
*
|
|
4
|
-
* Handles `omp read` subcommand — emits chunk-mode read output for files,
|
|
5
|
-
* and delegates URL reads through the read tool pipeline.
|
|
6
|
-
*/
|
|
7
|
-
import * as path from "node:path";
|
|
8
|
-
import chalk from "chalk";
|
|
9
|
-
import { Settings } from "../config/settings";
|
|
10
|
-
import { formatChunkedRead, resolveAnchorStyle } from "../edit/modes/chunk";
|
|
11
|
-
import { getLanguageFromPath } from "../modes/theme/theme";
|
|
12
|
-
import type { ToolSession } from "../tools";
|
|
13
|
-
import { parseReadUrlTarget } from "../tools/fetch";
|
|
14
|
-
import { ReadTool } from "../tools/read";
|
|
15
|
-
|
|
16
|
-
export interface ReadCommandArgs {
|
|
17
|
-
path: string;
|
|
18
|
-
sel?: string;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function createCliReadSession(cwd: string, settings: Settings): ToolSession {
|
|
22
|
-
return {
|
|
23
|
-
cwd,
|
|
24
|
-
hasUI: false,
|
|
25
|
-
hasEditTool: true,
|
|
26
|
-
getSessionFile: () => null,
|
|
27
|
-
getSessionSpawns: () => null,
|
|
28
|
-
settings,
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export async function runReadCommand(cmd: ReadCommandArgs): Promise<void> {
|
|
33
|
-
const cwd = process.cwd();
|
|
34
|
-
const parsedUrlTarget = parseReadUrlTarget(cmd.path, cmd.sel);
|
|
35
|
-
if (parsedUrlTarget) {
|
|
36
|
-
const settings = await Settings.init({ cwd });
|
|
37
|
-
const tool = new ReadTool(createCliReadSession(cwd, settings));
|
|
38
|
-
const result = await tool.execute("cli-read", { path: cmd.path, sel: cmd.sel });
|
|
39
|
-
const text = result.content.find((content): content is { type: "text"; text: string } => content.type === "text");
|
|
40
|
-
console.log(text?.text ?? "");
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const filePath = path.resolve(cmd.path);
|
|
45
|
-
const file = Bun.file(filePath);
|
|
46
|
-
if (!(await file.exists())) {
|
|
47
|
-
console.error(chalk.red(`Error: File not found: ${cmd.path}`));
|
|
48
|
-
process.exit(1);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const readPath = cmd.sel ? `${filePath}:${cmd.sel}` : filePath;
|
|
52
|
-
const language = getLanguageFromPath(filePath);
|
|
53
|
-
|
|
54
|
-
try {
|
|
55
|
-
const result = await formatChunkedRead({
|
|
56
|
-
filePath,
|
|
57
|
-
readPath,
|
|
58
|
-
cwd,
|
|
59
|
-
language,
|
|
60
|
-
anchorStyle: resolveAnchorStyle(),
|
|
61
|
-
});
|
|
62
|
-
console.log(result.text);
|
|
63
|
-
} catch (err) {
|
|
64
|
-
console.error(chalk.red(`Error: ${err instanceof Error ? err.message : String(err)}`));
|
|
65
|
-
process.exit(1);
|
|
66
|
-
}
|
|
67
|
-
}
|
package/src/commands/read.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Chunk-mode read tool.
|
|
3
|
-
*/
|
|
4
|
-
import { Args, Command, Flags } from "@oh-my-pi/pi-utils/cli";
|
|
5
|
-
import { type ReadCommandArgs, runReadCommand } from "../cli/read-cli";
|
|
6
|
-
import { initTheme } from "../modes/theme/theme";
|
|
7
|
-
|
|
8
|
-
export default class Read extends Command {
|
|
9
|
-
static description = "Read a file as a chunk tree";
|
|
10
|
-
|
|
11
|
-
static args = {
|
|
12
|
-
path: Args.string({ description: "File path to read", required: true }),
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
static flags = {
|
|
16
|
-
sel: Flags.string({
|
|
17
|
-
char: "s",
|
|
18
|
-
description: "Chunk selector or line range (e.g. class_Foo.fn_bar, L10-L20)",
|
|
19
|
-
}),
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
async run(): Promise<void> {
|
|
23
|
-
const { args, flags } = await this.parse(Read);
|
|
24
|
-
|
|
25
|
-
const cmd: ReadCommandArgs = {
|
|
26
|
-
path: args.path ?? "",
|
|
27
|
-
sel: flags.sel,
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
await initTheme();
|
|
31
|
-
await runReadCommand(cmd);
|
|
32
|
-
}
|
|
33
|
-
}
|