@oh-my-pi/pi-coding-agent 16.1.13 → 16.1.14
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 +27 -0
- package/dist/cli.js +5547 -2759
- package/dist/types/config/settings-schema.d.ts +44 -14
- package/dist/types/eval/__tests__/julia-prelude.test.d.ts +1 -0
- package/dist/types/eval/backend-helpers.d.ts +23 -0
- package/dist/types/eval/executor-base.d.ts +118 -0
- package/dist/types/eval/index.d.ts +2 -0
- package/dist/types/eval/jl/executor.d.ts +44 -0
- package/dist/types/eval/jl/index.d.ts +11 -0
- package/dist/types/eval/jl/kernel.d.ts +28 -0
- package/dist/types/eval/jl/prelude.d.ts +1 -0
- package/dist/types/eval/jl/runtime.d.ts +22 -0
- package/dist/types/eval/kernel-base.d.ts +105 -0
- package/dist/types/eval/py/kernel.d.ts +3 -61
- package/dist/types/eval/rb/executor.d.ts +77 -0
- package/dist/types/eval/rb/index.d.ts +11 -0
- package/dist/types/eval/rb/kernel.d.ts +31 -0
- package/dist/types/eval/rb/prelude.d.ts +1 -0
- package/dist/types/eval/rb/runtime.d.ts +23 -0
- package/dist/types/eval/runtime-env.d.ts +24 -0
- package/dist/types/eval/types.d.ts +3 -3
- package/dist/types/extensibility/extensions/runner.d.ts +2 -15
- package/dist/types/extensibility/hooks/loader.d.ts +1 -25
- package/dist/types/extensibility/session-handler-types.d.ts +23 -0
- package/dist/types/jsonrpc/message-framing.d.ts +35 -0
- package/dist/types/mnemopi/embed-client.d.ts +7 -24
- package/dist/types/modes/components/chat-transcript-builder.d.ts +1 -1
- package/dist/types/modes/components/custom-editor.d.ts +11 -0
- package/dist/types/modes/components/selector-helpers.d.ts +53 -0
- package/dist/types/modes/interactive-mode.d.ts +0 -2
- package/dist/types/modes/theme/theme.d.ts +8 -1
- package/dist/types/modes/types.d.ts +0 -2
- package/dist/types/modes/utils/copy-targets.d.ts +1 -1
- package/dist/types/modes/utils/interactive-context-helpers.d.ts +14 -0
- package/dist/types/modes/utils/transcript-render-helpers.d.ts +54 -0
- package/dist/types/sdk.d.ts +1 -1
- package/dist/types/session/agent-session.d.ts +2 -2
- package/dist/types/stt/asr-client.d.ts +3 -29
- package/dist/types/subprocess/worker-client.d.ts +149 -0
- package/dist/types/subprocess/worker-runtime.d.ts +107 -0
- package/dist/types/tiny/title-client.d.ts +14 -34
- package/dist/types/tools/eval-backends.d.ts +6 -3
- package/dist/types/tools/eval-render.d.ts +6 -5
- package/dist/types/tools/eval.d.ts +13 -15
- package/dist/types/tools/index.d.ts +3 -3
- package/dist/types/tts/tts-client.d.ts +3 -28
- package/dist/types/tui/code-cell.d.ts +7 -0
- package/dist/types/utils/file-display-mode.d.ts +1 -1
- package/dist/types/web/parallel.d.ts +6 -0
- package/package.json +12 -12
- package/src/config/settings-schema.ts +50 -18
- package/src/config/settings.ts +5 -0
- package/src/dap/client.ts +13 -107
- package/src/eval/__tests__/julia-prelude.test.ts +77 -0
- package/src/eval/backend-helpers.ts +48 -0
- package/src/eval/executor-base.ts +425 -0
- package/src/eval/index.ts +2 -0
- package/src/eval/jl/executor.ts +540 -0
- package/src/eval/jl/index.ts +54 -0
- package/src/eval/jl/kernel.ts +235 -0
- package/src/eval/jl/prelude.jl +930 -0
- package/src/eval/jl/prelude.ts +3 -0
- package/src/eval/jl/runner.jl +634 -0
- package/src/eval/jl/runtime.ts +118 -0
- package/src/eval/js/index.ts +3 -14
- package/src/eval/kernel-base.ts +569 -0
- package/src/eval/py/executor.ts +43 -252
- package/src/eval/py/index.ts +9 -20
- package/src/eval/py/kernel.ts +29 -544
- package/src/eval/rb/executor.ts +504 -0
- package/src/eval/rb/index.ts +54 -0
- package/src/eval/rb/kernel.ts +230 -0
- package/src/eval/rb/prelude.rb +721 -0
- package/src/eval/rb/prelude.ts +3 -0
- package/src/eval/rb/runner.rb +474 -0
- package/src/eval/rb/runtime.ts +132 -0
- package/src/eval/runtime-env.ts +104 -0
- package/src/eval/types.ts +3 -3
- package/src/extensibility/extensions/runner.ts +4 -11
- package/src/extensibility/hooks/loader.ts +3 -21
- package/src/extensibility/session-handler-types.ts +21 -0
- package/src/internal-urls/docs-index.generated.txt +1 -1
- package/src/jsonrpc/message-framing.ts +142 -0
- package/src/lsp/client.ts +13 -109
- package/src/mnemopi/embed-client.ts +43 -198
- package/src/modes/components/agent-dashboard.ts +17 -40
- package/src/modes/components/chat-transcript-builder.ts +18 -102
- package/src/modes/components/custom-editor.ts +19 -0
- package/src/modes/components/extensions/extension-dashboard.ts +4 -13
- package/src/modes/components/extensions/extension-list.ts +16 -44
- package/src/modes/components/history-search.ts +4 -16
- package/src/modes/components/selector-helpers.ts +129 -0
- package/src/modes/components/settings-selector.ts +7 -5
- package/src/modes/components/tree-selector.ts +13 -18
- package/src/modes/controllers/event-controller.ts +3 -9
- package/src/modes/controllers/input-controller.ts +32 -54
- package/src/modes/interactive-mode.ts +5 -7
- package/src/modes/theme/theme.ts +35 -0
- package/src/modes/types.ts +0 -2
- package/src/modes/utils/copy-targets.ts +3 -2
- package/src/modes/utils/interactive-context-helpers.ts +27 -0
- package/src/modes/utils/transcript-render-helpers.ts +157 -0
- package/src/modes/utils/ui-helpers.ts +21 -126
- package/src/prompts/system/system-prompt.md +10 -10
- package/src/prompts/tools/bash.md +0 -1
- package/src/prompts/tools/eval.md +6 -4
- package/src/prompts/tools/find.md +0 -4
- package/src/prompts/tools/read.md +1 -2
- package/src/prompts/tools/replace.md +1 -1
- package/src/prompts/tools/search.md +0 -1
- package/src/sdk.ts +13 -7
- package/src/session/agent-session.ts +9 -7
- package/src/stt/asr-client.ts +35 -215
- package/src/stt/asr-worker.ts +29 -181
- package/src/subprocess/worker-client.ts +297 -0
- package/src/subprocess/worker-runtime.ts +277 -0
- package/src/task/executor.ts +4 -4
- package/src/tiny/title-client.ts +53 -219
- package/src/tiny/worker.ts +29 -180
- package/src/tools/eval-backends.ts +10 -3
- package/src/tools/eval-render.ts +17 -8
- package/src/tools/eval.ts +187 -22
- package/src/tools/index.ts +51 -28
- package/src/tts/tts-client.ts +38 -206
- package/src/tts/tts-worker.ts +23 -97
- package/src/tui/code-cell.ts +12 -1
- package/src/utils/file-display-mode.ts +2 -3
- package/src/web/parallel.ts +43 -42
- package/src/web/search/providers/parallel.ts +10 -99
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Julia runtime resolution utilities.
|
|
3
|
+
*/
|
|
4
|
+
import { createEnvFilter, enumerateRuntimes, resolveExplicitPath, resolveRuntime } from "../runtime-env";
|
|
5
|
+
|
|
6
|
+
const DEFAULT_ENV_ALLOWLIST = [
|
|
7
|
+
"PATH",
|
|
8
|
+
"HOME",
|
|
9
|
+
"USER",
|
|
10
|
+
"USERNAME",
|
|
11
|
+
"LOGNAME",
|
|
12
|
+
"SHELL",
|
|
13
|
+
"TERM",
|
|
14
|
+
"LANG",
|
|
15
|
+
"SYSTEMROOT",
|
|
16
|
+
"WINDIR",
|
|
17
|
+
"COMSPEC",
|
|
18
|
+
"PATHEXT",
|
|
19
|
+
"TEMP",
|
|
20
|
+
"TMP",
|
|
21
|
+
"TERM_PROGRAM",
|
|
22
|
+
"TERM_PROGRAM_VERSION",
|
|
23
|
+
"SSH_AUTH_SOCK",
|
|
24
|
+
"SSH_AGENT_PID",
|
|
25
|
+
"SSH_CONNECTION",
|
|
26
|
+
"SSH_CLIENT",
|
|
27
|
+
"SSH_TTY",
|
|
28
|
+
"DISPLAY",
|
|
29
|
+
"XAUTHORITY",
|
|
30
|
+
"TZ",
|
|
31
|
+
"LD_LIBRARY_PATH",
|
|
32
|
+
"DYLD_LIBRARY_PATH",
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
const WINDOWS_ENV_ALLOWLIST = [
|
|
36
|
+
"ALLUSERSPROFILE",
|
|
37
|
+
"APPDATA",
|
|
38
|
+
"COMMONPROGRAMFILES",
|
|
39
|
+
"COMMONPROGRAMFILES(X86)",
|
|
40
|
+
"COMMONPROGRAMW6432",
|
|
41
|
+
"COMPUTERNAME",
|
|
42
|
+
"HOMEDRIVE",
|
|
43
|
+
"HOMEPATH",
|
|
44
|
+
"LOCALAPPDATA",
|
|
45
|
+
"NUMBER_OF_PROCESSORS",
|
|
46
|
+
"OS",
|
|
47
|
+
"PROCESSOR_ARCHITECTURE",
|
|
48
|
+
"PROCESSOR_IDENTIFIER",
|
|
49
|
+
"PROCESSOR_LEVEL",
|
|
50
|
+
"PROCESSOR_REVISION",
|
|
51
|
+
"PROGRAMDATA",
|
|
52
|
+
"PROGRAMFILES",
|
|
53
|
+
"PROGRAMFILES(X86)",
|
|
54
|
+
"PROGRAMW6432",
|
|
55
|
+
"PUBLIC",
|
|
56
|
+
"SESSIONNAME",
|
|
57
|
+
"SYSTEMDRIVE",
|
|
58
|
+
"USERDOMAIN",
|
|
59
|
+
"USERDOMAIN_ROAMING_PC",
|
|
60
|
+
"USERPROFILE",
|
|
61
|
+
];
|
|
62
|
+
|
|
63
|
+
const DEFAULT_ENV_DENYLIST = ["PI_API_KEY", "PI_TOKEN", "PI_PASSWORD", "PI_SESSION", "PI_TOOL_BRIDGE_TOKEN"];
|
|
64
|
+
|
|
65
|
+
// Julia version managers and package layout live behind these prefixes; passing them
|
|
66
|
+
// through lets Julia discover packages and configure its runtime consistently.
|
|
67
|
+
const DEFAULT_ENV_ALLOW_PREFIXES = ["LC_", "XDG_", "PI_", "JULIA_", "OPENBLAS_", "MKL_"];
|
|
68
|
+
|
|
69
|
+
export interface JuliaRuntime {
|
|
70
|
+
/** Path to the julia executable. */
|
|
71
|
+
juliaPath: string;
|
|
72
|
+
/** Filtered environment variables. */
|
|
73
|
+
env: Record<string, string | undefined>;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export const filterEnv = createEnvFilter({
|
|
77
|
+
allowList: DEFAULT_ENV_ALLOWLIST,
|
|
78
|
+
windowsAllowList: WINDOWS_ENV_ALLOWLIST,
|
|
79
|
+
denyList: DEFAULT_ENV_DENYLIST,
|
|
80
|
+
allowPrefixes: DEFAULT_ENV_ALLOW_PREFIXES,
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Resolve an explicitly configured interpreter (`julia.interpreter`) into a
|
|
85
|
+
* runtime, bypassing discovery. Does not probe the executable.
|
|
86
|
+
* `~` expands to the home directory and relative paths resolve against `cwd`.
|
|
87
|
+
*/
|
|
88
|
+
export function resolveExplicitJuliaRuntime(
|
|
89
|
+
interpreter: string,
|
|
90
|
+
cwd: string,
|
|
91
|
+
baseEnv: Record<string, string | undefined>,
|
|
92
|
+
): JuliaRuntime {
|
|
93
|
+
const juliaPath = resolveExplicitPath(interpreter, cwd);
|
|
94
|
+
return { juliaPath, env: { ...baseEnv } };
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Enumerate candidate Julia runtimes in priority order. With an explicit
|
|
99
|
+
* interpreter that is the only candidate; otherwise the first `julia` on PATH.
|
|
100
|
+
*/
|
|
101
|
+
export function enumerateJuliaRuntimes(
|
|
102
|
+
cwd: string,
|
|
103
|
+
baseEnv: Record<string, string | undefined>,
|
|
104
|
+
interpreter?: string,
|
|
105
|
+
): JuliaRuntime[] {
|
|
106
|
+
return enumerateRuntimes(cwd, baseEnv, "julia", (juliaPath, env) => ({ juliaPath, env }), interpreter);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Resolve the highest-priority Julia runtime. Throws when none exists.
|
|
111
|
+
*/
|
|
112
|
+
export function resolveJuliaRuntime(
|
|
113
|
+
cwd: string,
|
|
114
|
+
baseEnv: Record<string, string | undefined>,
|
|
115
|
+
interpreter?: string,
|
|
116
|
+
): JuliaRuntime {
|
|
117
|
+
return resolveRuntime(cwd, baseEnv, "julia", (juliaPath, env) => ({ juliaPath, env }), interpreter);
|
|
118
|
+
}
|
package/src/eval/js/index.ts
CHANGED
|
@@ -5,14 +5,14 @@ import {
|
|
|
5
5
|
type ExecutorBackendResult,
|
|
6
6
|
resolveEvalUrlRoots,
|
|
7
7
|
} from "../backend";
|
|
8
|
+
import { namespaceSessionId as sharedNamespace, toExecutorBackendResult } from "../backend-helpers";
|
|
8
9
|
import { executeJs } from "./executor";
|
|
9
10
|
|
|
10
11
|
const JS_SESSION_PREFIX = "js:";
|
|
11
12
|
|
|
12
13
|
export function namespaceSessionId(sessionId: string): string {
|
|
13
|
-
return
|
|
14
|
+
return sharedNamespace(sessionId, JS_SESSION_PREFIX);
|
|
14
15
|
}
|
|
15
|
-
|
|
16
16
|
export default {
|
|
17
17
|
id: "js",
|
|
18
18
|
label: "JavaScript",
|
|
@@ -35,17 +35,6 @@ export default {
|
|
|
35
35
|
session: opts.session,
|
|
36
36
|
localRoots: resolveEvalUrlRoots(opts.session),
|
|
37
37
|
});
|
|
38
|
-
return
|
|
39
|
-
output: result.output,
|
|
40
|
-
exitCode: result.exitCode,
|
|
41
|
-
cancelled: result.cancelled,
|
|
42
|
-
truncated: result.truncated,
|
|
43
|
-
artifactId: result.artifactId,
|
|
44
|
-
totalLines: result.totalLines,
|
|
45
|
-
totalBytes: result.totalBytes,
|
|
46
|
-
outputLines: result.outputLines,
|
|
47
|
-
outputBytes: result.outputBytes,
|
|
48
|
-
displayOutputs: result.displayOutputs,
|
|
49
|
-
};
|
|
38
|
+
return toExecutorBackendResult(result);
|
|
50
39
|
},
|
|
51
40
|
} satisfies ExecutorBackend;
|