@oh-my-pi/pi-coding-agent 14.5.12 → 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.
Files changed (85) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/package.json +18 -10
  3. package/src/cli/jupyter-cli.ts +1 -1
  4. package/src/config/model-equivalence.ts +49 -16
  5. package/src/config/model-registry.ts +100 -25
  6. package/src/config/model-resolver.ts +29 -15
  7. package/src/config/settings-schema.ts +20 -6
  8. package/src/config/settings.ts +9 -8
  9. package/src/config.ts +9 -0
  10. package/src/eval/backend.ts +43 -0
  11. package/src/eval/eval.lark +43 -0
  12. package/src/eval/index.ts +5 -0
  13. package/src/eval/js/context-manager.ts +717 -0
  14. package/src/eval/js/executor.ts +131 -0
  15. package/src/eval/js/index.ts +46 -0
  16. package/src/eval/js/prelude.ts +2 -0
  17. package/src/eval/js/prelude.txt +84 -0
  18. package/src/eval/js/tool-bridge.ts +124 -0
  19. package/src/eval/parse.ts +337 -0
  20. package/src/{ipy → eval/py}/executor.ts +2 -180
  21. package/src/{ipy → eval/py}/gateway-coordinator.ts +2 -2
  22. package/src/eval/py/index.ts +58 -0
  23. package/src/{ipy → eval/py}/kernel.ts +5 -41
  24. package/src/{ipy → eval/py}/prelude.py +39 -227
  25. package/src/eval/types.ts +48 -0
  26. package/src/export/html/template.generated.ts +1 -1
  27. package/src/export/html/template.js +8 -10
  28. package/src/extensibility/extensions/types.ts +2 -3
  29. package/src/internal-urls/docs-index.generated.ts +5 -5
  30. package/src/lsp/client.ts +9 -0
  31. package/src/lsp/index.ts +395 -0
  32. package/src/lsp/types.ts +15 -4
  33. package/src/main.ts +25 -14
  34. package/src/mcp/oauth-flow.ts +1 -1
  35. package/src/memories/index.ts +1 -1
  36. package/src/modes/acp/acp-event-mapper.ts +1 -1
  37. package/src/modes/components/{python-execution.ts → eval-execution.ts} +11 -4
  38. package/src/modes/components/login-dialog.ts +1 -1
  39. package/src/modes/components/oauth-selector.ts +2 -1
  40. package/src/modes/components/tool-execution.ts +3 -4
  41. package/src/modes/controllers/command-controller.ts +28 -8
  42. package/src/modes/controllers/input-controller.ts +4 -4
  43. package/src/modes/controllers/selector-controller.ts +2 -1
  44. package/src/modes/interactive-mode.ts +4 -5
  45. package/src/modes/types.ts +3 -3
  46. package/src/modes/utils/ui-helpers.ts +2 -2
  47. package/src/prompts/system/system-prompt.md +3 -3
  48. package/src/prompts/tools/eval.md +92 -0
  49. package/src/prompts/tools/lsp.md +7 -3
  50. package/src/sdk.ts +45 -31
  51. package/src/session/agent-session.ts +42 -42
  52. package/src/session/messages.ts +1 -1
  53. package/src/slash-commands/builtin-registry.ts +1 -1
  54. package/src/system-prompt.ts +34 -66
  55. package/src/task/executor.ts +5 -9
  56. package/src/tools/browser/launch.ts +22 -0
  57. package/src/tools/browser/registry.ts +25 -244
  58. package/src/tools/browser/render.ts +1 -1
  59. package/src/tools/browser/tab-protocol.ts +101 -0
  60. package/src/tools/browser/tab-supervisor.ts +429 -0
  61. package/src/tools/browser/tab-worker-entry.ts +21 -0
  62. package/src/tools/browser/tab-worker.ts +1006 -0
  63. package/src/tools/browser.ts +12 -29
  64. package/src/tools/checkpoint.ts +2 -2
  65. package/src/tools/{python.ts → eval.ts} +324 -315
  66. package/src/tools/exit-plan-mode.ts +1 -1
  67. package/src/tools/index.ts +62 -100
  68. package/src/tools/read.ts +0 -6
  69. package/src/tools/recipe/runners/pkg.ts +34 -32
  70. package/src/tools/renderers.ts +2 -2
  71. package/src/tools/resolve.ts +7 -2
  72. package/src/tools/todo-write.ts +0 -1
  73. package/src/tools/tool-timeouts.ts +2 -2
  74. package/src/utils/markit.ts +15 -7
  75. package/src/utils/tools-manager.ts +5 -5
  76. package/src/web/search/index.ts +5 -5
  77. package/src/web/search/provider.ts +121 -39
  78. package/src/web/search/providers/gemini.ts +2 -2
  79. package/src/web/search/render.ts +2 -2
  80. package/src/ipy/modules.ts +0 -144
  81. package/src/prompts/tools/python.md +0 -57
  82. package/src/tools/browser/vm.ts +0 -792
  83. /package/src/{ipy → eval/py}/cancellation.ts +0 -0
  84. /package/src/{ipy → eval/py}/prelude.ts +0 -0
  85. /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: "~~~" | "~~~~~"
@@ -0,0 +1,5 @@
1
+ export * from "./backend";
2
+ export { default as jsBackend } from "./js";
3
+ export * from "./parse";
4
+ export { default as pythonBackend } from "./py";
5
+ export * from "./types";