@oh-my-pi/pi-coding-agent 14.5.11 → 14.5.13
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 +58 -0
- package/package.json +18 -10
- package/src/cli/jupyter-cli.ts +1 -1
- package/src/config/model-equivalence.ts +49 -16
- package/src/config/model-registry.ts +100 -25
- package/src/config/model-resolver.ts +29 -15
- package/src/config/settings-schema.ts +20 -6
- package/src/config/settings.ts +9 -8
- package/src/config.ts +9 -0
- package/src/eval/backend.ts +43 -0
- package/src/eval/eval.lark +43 -0
- package/src/eval/index.ts +5 -0
- package/src/eval/js/context-manager.ts +717 -0
- package/src/eval/js/executor.ts +131 -0
- package/src/eval/js/index.ts +46 -0
- package/src/eval/js/prelude.ts +2 -0
- package/src/eval/js/prelude.txt +84 -0
- package/src/eval/js/tool-bridge.ts +124 -0
- package/src/eval/parse.ts +337 -0
- package/src/{ipy → eval/py}/executor.ts +2 -180
- package/src/{ipy → eval/py}/gateway-coordinator.ts +4 -3
- package/src/eval/py/index.ts +58 -0
- package/src/{ipy → eval/py}/kernel.ts +5 -41
- package/src/{ipy → eval/py}/prelude.py +39 -227
- package/src/eval/types.ts +48 -0
- package/src/export/html/template.generated.ts +1 -1
- package/src/export/html/template.js +23 -17
- package/src/extensibility/extensions/types.ts +2 -3
- package/src/internal-urls/docs-index.generated.ts +5 -5
- package/src/lsp/client.ts +9 -0
- package/src/lsp/index.ts +395 -0
- package/src/lsp/types.ts +15 -4
- package/src/main.ts +25 -14
- package/src/mcp/oauth-flow.ts +1 -1
- package/src/memories/index.ts +1 -1
- package/src/modes/acp/acp-event-mapper.ts +1 -1
- package/src/modes/components/{python-execution.ts → eval-execution.ts} +11 -4
- package/src/modes/components/login-dialog.ts +1 -1
- package/src/modes/components/oauth-selector.ts +2 -1
- package/src/modes/components/tool-execution.ts +3 -4
- package/src/modes/controllers/command-controller.ts +28 -8
- package/src/modes/controllers/input-controller.ts +4 -4
- package/src/modes/controllers/selector-controller.ts +2 -1
- package/src/modes/interactive-mode.ts +4 -5
- package/src/modes/types.ts +3 -3
- package/src/modes/utils/ui-helpers.ts +2 -2
- package/src/prompts/system/system-prompt.md +3 -3
- package/src/prompts/tools/atom.md +3 -2
- package/src/prompts/tools/browser.md +61 -16
- package/src/prompts/tools/eval.md +92 -0
- package/src/prompts/tools/lsp.md +7 -3
- package/src/sdk.ts +45 -31
- package/src/session/agent-session.ts +44 -54
- package/src/session/messages.ts +1 -1
- package/src/slash-commands/builtin-registry.ts +1 -1
- package/src/system-prompt.ts +34 -66
- package/src/task/executor.ts +5 -9
- package/src/tools/browser/attach.ts +175 -0
- package/src/tools/browser/launch.ts +576 -0
- package/src/tools/browser/readable.ts +90 -0
- package/src/tools/browser/registry.ts +198 -0
- package/src/tools/browser/render.ts +212 -0
- package/src/tools/browser/tab-protocol.ts +101 -0
- package/src/tools/browser/tab-supervisor.ts +429 -0
- package/src/tools/browser/tab-worker-entry.ts +21 -0
- package/src/tools/browser/tab-worker.ts +1006 -0
- package/src/tools/browser.ts +231 -1567
- package/src/tools/checkpoint.ts +2 -2
- package/src/tools/{python.ts → eval.ts} +324 -315
- package/src/tools/exit-plan-mode.ts +1 -1
- package/src/tools/index.ts +62 -100
- package/src/tools/plan-mode-guard.ts +27 -1
- package/src/tools/read.ts +0 -6
- package/src/tools/recipe/runners/pkg.ts +34 -32
- package/src/tools/renderers.ts +4 -2
- package/src/tools/resolve.ts +7 -2
- package/src/tools/todo-write.ts +0 -1
- package/src/tools/tool-timeouts.ts +2 -2
- package/src/utils/markit.ts +15 -7
- package/src/utils/tools-manager.ts +5 -5
- package/src/web/search/index.ts +5 -5
- package/src/web/search/provider.ts +121 -39
- package/src/web/search/providers/gemini.ts +2 -2
- package/src/web/search/render.ts +2 -2
- package/src/ipy/modules.ts +0 -144
- package/src/prompts/tools/python.md +0 -57
- /package/src/{ipy → eval/py}/cancellation.ts +0 -0
- /package/src/{ipy → eval/py}/prelude.ts +0 -0
- /package/src/{ipy → eval/py}/runtime.ts +0 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ToolSession } from "../tools";
|
|
2
|
+
import type { EvalDisplayOutput, EvalLanguage } from "./types";
|
|
3
|
+
|
|
4
|
+
/** Per-cell execute() options. */
|
|
5
|
+
export interface ExecutorBackendExecOptions {
|
|
6
|
+
cwd: string;
|
|
7
|
+
sessionId: string;
|
|
8
|
+
sessionFile: string | undefined;
|
|
9
|
+
kernelOwnerId: string | undefined;
|
|
10
|
+
signal?: AbortSignal;
|
|
11
|
+
session: ToolSession;
|
|
12
|
+
deadlineMs: number;
|
|
13
|
+
reset: boolean;
|
|
14
|
+
artifactPath: string | undefined;
|
|
15
|
+
artifactId: string | undefined;
|
|
16
|
+
onChunk: (chunk: string) => void;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** Result returned by a backend's execute(). */
|
|
20
|
+
export interface ExecutorBackendResult {
|
|
21
|
+
output: string;
|
|
22
|
+
exitCode: number | undefined;
|
|
23
|
+
cancelled: boolean;
|
|
24
|
+
truncated: boolean;
|
|
25
|
+
artifactId: string | undefined;
|
|
26
|
+
totalLines: number;
|
|
27
|
+
totalBytes: number;
|
|
28
|
+
outputLines: number;
|
|
29
|
+
outputBytes: number;
|
|
30
|
+
displayOutputs: EvalDisplayOutput[];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** Pluggable language backend for the eval tool. */
|
|
34
|
+
export interface ExecutorBackend {
|
|
35
|
+
readonly id: EvalLanguage;
|
|
36
|
+
readonly label: string;
|
|
37
|
+
/** Source language identifier passed to the syntax highlighter (e.g. "python", "javascript"). */
|
|
38
|
+
readonly highlightLang: string;
|
|
39
|
+
/** Cheap availability check. Used by fallback resolution. */
|
|
40
|
+
isAvailable(session: ToolSession): Promise<boolean>;
|
|
41
|
+
/** Execute one cell. Caller invokes once per cell and aggregates results. */
|
|
42
|
+
execute(code: string, opts: ExecutorBackendExecOptions): Promise<ExecutorBackendResult>;
|
|
43
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
%import common.LF
|
|
2
|
+
%import common.WS_INLINE
|
|
3
|
+
|
|
4
|
+
// Strict canonical surface for the eval tool. Callers MUST emit exactly this
|
|
5
|
+
// form. The runtime parser accepts additional lenient shapes (positional
|
|
6
|
+
// title/duration, alias keys, long-form lang tokens, mixed casing, fence
|
|
7
|
+
// runs of any length ≥ 3, etc.) but those are fallback only and MUST NOT
|
|
8
|
+
// be relied on.
|
|
9
|
+
//
|
|
10
|
+
// Each cell is a fenced code block opened and closed by exactly three
|
|
11
|
+
// (or exactly five) backticks or tildes — five lets callers nest a 3-char
|
|
12
|
+
// fence inside a cell verbatim. The opening fence carries an optional info
|
|
13
|
+
// string with up to four parts, IN THIS ORDER:
|
|
14
|
+
//
|
|
15
|
+
// lang? id_attr? t_attr? rst_attr?
|
|
16
|
+
//
|
|
17
|
+
// where:
|
|
18
|
+
// lang = "py" | "js" | "ts"
|
|
19
|
+
// id_attr = id="..." (double-quoted cell id)
|
|
20
|
+
// t_attr = t=<duration> (bare integer with optional ms/s/m unit)
|
|
21
|
+
// rst_attr= rst=0|1 (per-language kernel reset for this cell)
|
|
22
|
+
|
|
23
|
+
start: cell+
|
|
24
|
+
|
|
25
|
+
cell: backtick_cell | tilde_cell
|
|
26
|
+
|
|
27
|
+
backtick_cell: BACKTICKS info? LF code_line* BACKTICKS LF
|
|
28
|
+
tilde_cell: TILDES info? LF code_line* TILDES LF
|
|
29
|
+
|
|
30
|
+
info: lang (WS_INLINE id_attr)? (WS_INLINE t_attr)? (WS_INLINE rst_attr)?
|
|
31
|
+
| id_attr (WS_INLINE t_attr)? (WS_INLINE rst_attr)?
|
|
32
|
+
| t_attr (WS_INLINE rst_attr)?
|
|
33
|
+
| rst_attr
|
|
34
|
+
|
|
35
|
+
lang: "py" | "js" | "ts"
|
|
36
|
+
id_attr: "id=" /"[^"\r\n]*"/
|
|
37
|
+
t_attr: "t=" /\d+(ms|s|m)?/
|
|
38
|
+
rst_attr: "rst=" /[01]/
|
|
39
|
+
|
|
40
|
+
code_line: /[^\r\n]*/ LF
|
|
41
|
+
|
|
42
|
+
BACKTICKS: "```" | "`````"
|
|
43
|
+
TILDES: "~~~" | "~~~~~"
|