@praxis-ai/praxis 0.1.1 → 0.1.2
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/dist/agentCore/index.d.ts +45 -6
- package/dist/agentCore/index.js +14 -2
- package/dist/applicationLayer/applicationContract.d.ts +2 -0
- package/dist/applicationLayer/applicationRuntime.d.ts +6 -1
- package/dist/applicationLayer/applicationRuntime.js +37 -3
- package/dist/applicationLayer/index.d.ts +1 -0
- package/dist/basetool/core/shellRun.js +6 -1
- package/dist/rax_packageManager/raxCli.js +42 -1
- package/dist/runtimeImplementation/praxisRuntimeKernel.d.ts +6 -0
- package/dist/runtimeImplementation/praxisRuntimeKernel.js +165 -14
- package/dist/runtimeImplementation/runtime.componentPlane/runtimeComponentRegistry.d.ts +1 -1
- package/dist/runtimeImplementation/runtime.componentPlane/runtimeComponentRegistry.js +2 -2
- package/dist/runtimeImplementation/runtime.dependencyPlane/dependencySourceRegistry.d.ts +1 -1
- package/dist/runtimeImplementation/runtime.dependencyPlane/dependencySourceRegistry.js +12 -0
- package/dist/runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js +2 -0
- package/dist/runtimeImplementation/runtime.execEngine/baseToolExecutorPortFactory.d.ts +3 -0
- package/dist/runtimeImplementation/runtime.execEngine/baseToolExecutorPortFactory.js +45 -7
- package/dist/runtimeImplementation/runtime.execEngine/mcpRuntimeAdapter.js +56 -0
- package/dist/runtimeImplementation/runtime.mcpPlane/index.d.ts +114 -0
- package/dist/runtimeImplementation/runtime.mcpPlane/index.js +167 -0
- package/dist/runtimeImplementation/runtime.sandboxPlane/baseToolSandboxPlanner.js +0 -2
- package/dist/runtimeImplementation/runtime.sandboxPlane/raxcellSandboxProvider.d.ts +19 -0
- package/dist/runtimeImplementation/runtime.sandboxPlane/raxcellSandboxProvider.js +172 -0
- package/dist/runtimeImplementation/runtime.sandboxPlane/sandboxCommandRunner.d.ts +13 -1
- package/dist/runtimeImplementation/runtime.sandboxPlane/sandboxCommandRunner.js +230 -186
- package/dist/runtimeImplementation/runtime.sandboxPlane/sandboxPolicyMiddleware.d.ts +175 -0
- package/dist/runtimeImplementation/runtime.sandboxPlane/sandboxPolicyMiddleware.js +142 -0
- package/dist/runtimeImplementation/runtime.sandboxPlane/sandboxRuntimeProvider.d.ts +9 -0
- package/dist/runtimeImplementation/runtime.sandboxPlane/sandboxRuntimeProvider.js +115 -205
- package/dist/runtimeImplementation/runtimeAgentManifest.js +7 -3
- package/package.json +3 -1
- package/raxode-tui/dist/raxode-cli/backend/agents/codingAgent/agent.js +3 -3
- package/raxode-tui/dist/raxode-cli/backend/application/backendModuleInventory.js +3 -3
- package/raxode-tui/dist/raxode-cli/backend/application/localReadinessProbe.d.ts +1 -0
- package/raxode-tui/dist/raxode-cli/backend/application/localReadinessProbe.js +50 -4
- package/raxode-tui/dist/raxode-cli/backend/application/raxcellSandboxProvider.d.ts +12 -0
- package/raxode-tui/dist/raxode-cli/backend/application/raxcellSandboxProvider.js +58 -0
- package/raxode-tui/dist/raxode-cli/backend/application/runtimeReadiness.d.ts +1 -0
- package/raxode-tui/dist/raxode-cli/backend/application/runtimeReadiness.js +3 -1
- package/raxode-tui/dist/raxode-cli/backend/application/stdioApplicationServer.d.ts +2 -0
- package/raxode-tui/dist/raxode-cli/backend/application/stdioApplicationServer.js +7 -0
- package/raxode-tui/dist/raxode-cli/backend/directApplicationBackend.d.ts +2 -0
- package/raxode-tui/dist/raxode-cli/backend/directApplicationBackend.js +21 -1
- package/raxode-tui/dist/raxode-cli/backend/raxodeBackend.d.ts +1 -1
- package/raxode-tui/dist/raxode-cli/backend/raxodeBackend.js +8 -0
- package/raxode-tui/dist/raxode-cli/frontend/tui/cli/raxode-cli.js +19 -1
- package/raxode-tui/package.json +2 -1
- package/tsconfig.json +16 -1
|
@@ -31,6 +31,7 @@ export type RaxodeLocalReadinessProbeInput = {
|
|
|
31
31
|
now?: () => string;
|
|
32
32
|
nodeVersion?: string;
|
|
33
33
|
pathEnv?: string;
|
|
34
|
+
env?: Readonly<Record<string, string | undefined>>;
|
|
34
35
|
platform?: NodeJS.Platform;
|
|
35
36
|
fileExists?: (filePath: string) => boolean;
|
|
36
37
|
resolvePackage?: (packageName: string) => string | undefined;
|
|
@@ -67,12 +67,34 @@ function dependencyDegrade(dependencyId) {
|
|
|
67
67
|
return "block-backend-start";
|
|
68
68
|
if (dependencyId === "dependency.npm.tsx")
|
|
69
69
|
return "use-built-dist-or-install";
|
|
70
|
+
if (dependencyId === "dependency.binary.raxcell")
|
|
71
|
+
return "degrade-to-workspace-rollback";
|
|
70
72
|
if (dependencyId === "dependency.binary.bwrap")
|
|
71
73
|
return "degrade-to-workspace-rollback";
|
|
72
74
|
if (dependencyId === "dependency.secret.provider.core.main")
|
|
73
75
|
return "dry-run-or-auth-required-for-live";
|
|
74
76
|
return "record-and-continue";
|
|
75
77
|
}
|
|
78
|
+
function resolveRaxcellExecutable(input) {
|
|
79
|
+
const explicitBinary = (input.env?.RAXCELL_BIN ?? process.env.RAXCELL_BIN)?.trim();
|
|
80
|
+
const fileExists = input.fileExists ?? existsSync;
|
|
81
|
+
if (explicitBinary !== undefined && explicitBinary.length > 0) {
|
|
82
|
+
return fileExists(explicitBinary) ? explicitBinary : undefined;
|
|
83
|
+
}
|
|
84
|
+
const fromPath = findExecutableOnPath({
|
|
85
|
+
name: "raxcell",
|
|
86
|
+
pathEnv: input.pathEnv,
|
|
87
|
+
platform: input.platform,
|
|
88
|
+
fileExists,
|
|
89
|
+
});
|
|
90
|
+
if (fromPath !== undefined)
|
|
91
|
+
return fromPath;
|
|
92
|
+
const resolvedPackage = input.resolvePackage?.("@praxis-ai/raxcell/package.json");
|
|
93
|
+
if (resolvedPackage === undefined)
|
|
94
|
+
return undefined;
|
|
95
|
+
const packageBinary = path.resolve(path.dirname(resolvedPackage), "dist/cli.js");
|
|
96
|
+
return fileExists(packageBinary) ? packageBinary : undefined;
|
|
97
|
+
}
|
|
76
98
|
function probeDependency(input) {
|
|
77
99
|
const degrade = dependencyDegrade(input.dependencyId);
|
|
78
100
|
if (input.dependencyId === "dependency.binary.node") {
|
|
@@ -103,6 +125,26 @@ function probeDependency(input) {
|
|
|
103
125
|
: "tsx is resolvable from the Raxode backend package.",
|
|
104
126
|
};
|
|
105
127
|
}
|
|
128
|
+
if (input.dependencyId === "dependency.binary.raxcell") {
|
|
129
|
+
const resolvedPath = resolveRaxcellExecutable({
|
|
130
|
+
pathEnv: input.pathEnv,
|
|
131
|
+
env: input.env,
|
|
132
|
+
platform: input.platform,
|
|
133
|
+
fileExists: input.fileExists,
|
|
134
|
+
resolvePackage: input.resolvePackage,
|
|
135
|
+
});
|
|
136
|
+
return {
|
|
137
|
+
dependencyId: input.dependencyId,
|
|
138
|
+
status: resolvedPath === undefined ? "missing" : "ready",
|
|
139
|
+
required: input.required,
|
|
140
|
+
resolvedPath,
|
|
141
|
+
source: "process",
|
|
142
|
+
degrade,
|
|
143
|
+
message: resolvedPath === undefined
|
|
144
|
+
? "Raxcell is not configured through RAXCELL_BIN, PATH, or the installed @praxis-ai/raxcell package; linux-bubblewrap will degrade to workspace-rollback."
|
|
145
|
+
: "Raxcell is available for linux-bubblewrap sandbox execution.",
|
|
146
|
+
};
|
|
147
|
+
}
|
|
106
148
|
if (input.dependencyId === "dependency.binary.bwrap") {
|
|
107
149
|
const resolvedPath = findExecutableOnPath({
|
|
108
150
|
name: "bwrap",
|
|
@@ -163,11 +205,12 @@ function probeSandbox(input) {
|
|
|
163
205
|
};
|
|
164
206
|
}
|
|
165
207
|
if (profile === "linux-bubblewrap" || profile === "linuxBubblewrap") {
|
|
166
|
-
const executable =
|
|
167
|
-
name: "bwrap",
|
|
208
|
+
const executable = resolveRaxcellExecutable({
|
|
168
209
|
pathEnv: input.pathEnv,
|
|
210
|
+
env: input.env,
|
|
169
211
|
platform: input.platform,
|
|
170
212
|
fileExists: input.fileExists,
|
|
213
|
+
resolvePackage: input.resolvePackage,
|
|
171
214
|
});
|
|
172
215
|
return {
|
|
173
216
|
profile,
|
|
@@ -176,8 +219,8 @@ function probeSandbox(input) {
|
|
|
176
219
|
fallback: "workspace-rollback",
|
|
177
220
|
executable,
|
|
178
221
|
message: executable === undefined
|
|
179
|
-
? "
|
|
180
|
-
: "
|
|
222
|
+
? "Raxcell was not found through RAXCELL_BIN, PATH, or the installed @praxis-ai/raxcell package; runtime should degrade to workspace-rollback."
|
|
223
|
+
: "Raxcell was found for linux-bubblewrap sandbox execution.",
|
|
181
224
|
};
|
|
182
225
|
}
|
|
183
226
|
return {
|
|
@@ -200,6 +243,7 @@ export function probeLocalRaxodeReadiness(input) {
|
|
|
200
243
|
required: dependency.required ?? true,
|
|
201
244
|
nodeVersion,
|
|
202
245
|
pathEnv: input.pathEnv,
|
|
246
|
+
env: input.env,
|
|
203
247
|
platform: input.platform,
|
|
204
248
|
fileExists: input.fileExists,
|
|
205
249
|
resolvePackage,
|
|
@@ -207,8 +251,10 @@ export function probeLocalRaxodeReadiness(input) {
|
|
|
207
251
|
sandbox: probeSandbox({
|
|
208
252
|
manifest: input.manifest,
|
|
209
253
|
pathEnv: input.pathEnv,
|
|
254
|
+
env: input.env,
|
|
210
255
|
platform: input.platform,
|
|
211
256
|
fileExists: input.fileExists,
|
|
257
|
+
resolvePackage,
|
|
212
258
|
}),
|
|
213
259
|
};
|
|
214
260
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SandboxExecutionProviderPort } from "@praxis-ai/praxis/agent-core";
|
|
2
|
+
import type { RaxodeOptions } from "../agents/codingAgent/config/raxodeOptions.js";
|
|
3
|
+
export type RaxodeRaxcellSandboxProviderOptions = Pick<RaxodeOptions, "sandboxProfile"> & {
|
|
4
|
+
sandboxProvider?: SandboxExecutionProviderPort;
|
|
5
|
+
env?: Readonly<Record<string, string | undefined>>;
|
|
6
|
+
pathEnv?: string;
|
|
7
|
+
platform?: NodeJS.Platform;
|
|
8
|
+
fileExists?: (filePath: string) => boolean;
|
|
9
|
+
resolvePackage?: (packageName: string) => string | undefined;
|
|
10
|
+
};
|
|
11
|
+
export declare function resolveRaxodeRaxcellBinaryPath(options?: Pick<RaxodeRaxcellSandboxProviderOptions, "env" | "pathEnv" | "platform" | "fileExists" | "resolvePackage">): string | undefined;
|
|
12
|
+
export declare function resolveRaxodeRaxcellSandboxProvider(options: RaxodeRaxcellSandboxProviderOptions): SandboxExecutionProviderPort | undefined;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* 文件定位:raxode-cli/backend application Raxcell provider bridge。
|
|
3
|
+
* 核心目的:把 TUI/backend 的 linuxBubblewrap 配置解析成 Praxis 沙箱执行端口。
|
|
4
|
+
* 边界:这里只装配执行 provider;策略、审批和 fallback 仍由 Praxis runtime/policy middleware 决定。
|
|
5
|
+
*/
|
|
6
|
+
import { existsSync } from "node:fs";
|
|
7
|
+
import { createRequire } from "node:module";
|
|
8
|
+
import path from "node:path";
|
|
9
|
+
import { praxis } from "@praxis-ai/praxis";
|
|
10
|
+
const requireFromHere = createRequire(import.meta.url);
|
|
11
|
+
function executableNames(name, platform) {
|
|
12
|
+
if (platform !== "win32")
|
|
13
|
+
return [name];
|
|
14
|
+
const extensions = (process.env.PATHEXT ?? ".EXE;.CMD;.BAT;.COM")
|
|
15
|
+
.split(";")
|
|
16
|
+
.filter(Boolean);
|
|
17
|
+
return [name, ...extensions.map((extension) => `${name}${extension.toLowerCase()}`), ...extensions.map((extension) => `${name}${extension.toUpperCase()}`)];
|
|
18
|
+
}
|
|
19
|
+
export function resolveRaxodeRaxcellBinaryPath(options = {}) {
|
|
20
|
+
const explicitBinary = (options.env?.RAXCELL_BIN ?? process.env.RAXCELL_BIN)?.trim();
|
|
21
|
+
const fileExists = options.fileExists ?? existsSync;
|
|
22
|
+
if (explicitBinary !== undefined && explicitBinary.length > 0) {
|
|
23
|
+
return fileExists(explicitBinary) ? explicitBinary : undefined;
|
|
24
|
+
}
|
|
25
|
+
const platform = options.platform ?? process.platform;
|
|
26
|
+
const entries = (options.pathEnv ?? process.env.PATH ?? "").split(path.delimiter).filter(Boolean);
|
|
27
|
+
for (const entry of entries) {
|
|
28
|
+
for (const name of executableNames("raxcell", platform)) {
|
|
29
|
+
const candidate = path.join(entry, name);
|
|
30
|
+
if (fileExists(candidate))
|
|
31
|
+
return candidate;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
const resolvedPackage = options.resolvePackage?.("@praxis-ai/raxcell/package.json") ?? (() => {
|
|
35
|
+
try {
|
|
36
|
+
return requireFromHere.resolve("@praxis-ai/raxcell/package.json");
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
41
|
+
})();
|
|
42
|
+
if (resolvedPackage !== undefined) {
|
|
43
|
+
const packageBinary = path.resolve(path.dirname(resolvedPackage), "dist/cli.js");
|
|
44
|
+
if (fileExists(packageBinary))
|
|
45
|
+
return packageBinary;
|
|
46
|
+
}
|
|
47
|
+
return undefined;
|
|
48
|
+
}
|
|
49
|
+
export function resolveRaxodeRaxcellSandboxProvider(options) {
|
|
50
|
+
if (options.sandboxProvider !== undefined)
|
|
51
|
+
return options.sandboxProvider;
|
|
52
|
+
if (options.sandboxProfile !== "linuxBubblewrap")
|
|
53
|
+
return undefined;
|
|
54
|
+
const binaryPath = resolveRaxodeRaxcellBinaryPath(options);
|
|
55
|
+
if (binaryPath === undefined)
|
|
56
|
+
return undefined;
|
|
57
|
+
return praxis.sandboxPlane.createRaxcellSandboxProvider({ binaryPath });
|
|
58
|
+
}
|
|
@@ -59,6 +59,7 @@ export type RaxodeBackendReadiness = {
|
|
|
59
59
|
agentReviewResolver: "configured" | "not-configured";
|
|
60
60
|
contextArtifactAdapters: "configured" | "not-configured";
|
|
61
61
|
baseToolAdapters: "configured" | "not-configured";
|
|
62
|
+
sandboxProvider: "configured" | "not-configured";
|
|
62
63
|
authStateProvider: "configured" | "not-configured";
|
|
63
64
|
foundationProject: "configured" | "not-configured";
|
|
64
65
|
liveProviderResolver: "configured" | "raxode-default";
|
|
@@ -60,7 +60,7 @@ function dependencySummary(dependency, probe) {
|
|
|
60
60
|
? "block-backend-start"
|
|
61
61
|
: dependency.dependencyId === "dependency.npm.tsx"
|
|
62
62
|
? "use-built-dist-or-install"
|
|
63
|
-
: dependency.dependencyId === "dependency.binary.bwrap"
|
|
63
|
+
: dependency.dependencyId === "dependency.binary.raxcell" || dependency.dependencyId === "dependency.binary.bwrap"
|
|
64
64
|
? "degrade-to-workspace-rollback"
|
|
65
65
|
: dependency.dependencyId === "dependency.secret.provider.core.main"
|
|
66
66
|
? "dry-run-or-auth-required-for-live"
|
|
@@ -388,6 +388,7 @@ export function inspectRaxodeBackendReadiness(input = {}) {
|
|
|
388
388
|
agentReviewResolver: input.ports?.agentReviewResolver ?? "not-configured",
|
|
389
389
|
contextArtifactAdapters: input.ports?.contextArtifactAdapters ?? "not-configured",
|
|
390
390
|
baseToolAdapters: input.ports?.baseToolAdapters ?? "not-configured",
|
|
391
|
+
sandboxProvider: input.ports?.sandboxProvider ?? "not-configured",
|
|
391
392
|
authStateProvider: input.ports?.authStateProvider ?? (view?.auth ? "configured" : "not-configured"),
|
|
392
393
|
foundationProject: input.ports?.foundationProject ?? (view?.foundationProject ? "configured" : "not-configured"),
|
|
393
394
|
liveProviderResolver: input.ports?.liveProviderResolver ?? "raxode-default",
|
|
@@ -411,6 +412,7 @@ export function inspectRaxodeBackendReadinessWithLocalProbe(input = {}) {
|
|
|
411
412
|
now: input.localProbe?.now ?? input.now,
|
|
412
413
|
nodeVersion: input.localProbe?.nodeVersion,
|
|
413
414
|
pathEnv: input.localProbe?.pathEnv,
|
|
415
|
+
env: input.localProbe?.env,
|
|
414
416
|
platform: input.localProbe?.platform,
|
|
415
417
|
fileExists: input.localProbe?.fileExists,
|
|
416
418
|
resolvePackage: input.localProbe?.resolvePackage,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { SandboxExecutionProviderPort } from "@praxis-ai/praxis/agent-core";
|
|
1
2
|
import type { RaxodeOptions } from "../agents/codingAgent/config/raxodeOptions.js";
|
|
2
3
|
import type { RaxodeLocalReadinessProbeInput } from "./localReadinessProbe.js";
|
|
3
4
|
type StdioServerOptions = RaxodeOptions & {
|
|
@@ -6,6 +7,7 @@ type StdioServerOptions = RaxodeOptions & {
|
|
|
6
7
|
output?: NodeJS.WritableStream;
|
|
7
8
|
errorOutput?: NodeJS.WritableStream;
|
|
8
9
|
now?: () => string;
|
|
10
|
+
sandboxProvider?: SandboxExecutionProviderPort;
|
|
9
11
|
localReadinessProbe?: Omit<RaxodeLocalReadinessProbeInput, "manifest">;
|
|
10
12
|
};
|
|
11
13
|
export declare function startRaxodeStdioApplicationServer(options?: StdioServerOptions): Promise<void>;
|
|
@@ -8,6 +8,7 @@ import { createApplicationProjectRuntime, createLocalApplicationTransport, } fro
|
|
|
8
8
|
import { createRaxodeLiveProvider, resolveRaxodeConfiguredModelOptions, } from "../authentication/liveProvider.js";
|
|
9
9
|
import { inspectRaxodeMemoryBridge } from "../memory/memoryBridge.js";
|
|
10
10
|
import { raxodeApplication } from "./raxodeApplication.js";
|
|
11
|
+
import { resolveRaxodeRaxcellSandboxProvider } from "./raxcellSandboxProvider.js";
|
|
11
12
|
import { createRaxodeReadinessEvent, inspectRaxodeBackendReadinessWithLocalProbe, } from "./runtimeReadiness.js";
|
|
12
13
|
function defaultProjectRoot() {
|
|
13
14
|
return new URL("..", import.meta.url).pathname;
|
|
@@ -73,6 +74,10 @@ export async function startRaxodeStdioApplicationServer(options = {}) {
|
|
|
73
74
|
memoryProfile: memoryBridge.profile,
|
|
74
75
|
memoryPromptGuide: memoryBridge.promptGuide,
|
|
75
76
|
};
|
|
77
|
+
const sandboxProvider = resolveRaxodeRaxcellSandboxProvider({
|
|
78
|
+
sandboxProfile: options.sandboxProfile,
|
|
79
|
+
sandboxProvider: options.sandboxProvider,
|
|
80
|
+
});
|
|
76
81
|
const created = await createApplicationProjectRuntime(projectRoot, {
|
|
77
82
|
applicationId: raxodeApplication.id,
|
|
78
83
|
cwd: startDir,
|
|
@@ -87,6 +92,7 @@ export async function startRaxodeStdioApplicationServer(options = {}) {
|
|
|
87
92
|
permissionProfile,
|
|
88
93
|
toolProfile: "agentCore",
|
|
89
94
|
agentOptions,
|
|
95
|
+
sandboxProvider,
|
|
90
96
|
now: options.now,
|
|
91
97
|
liveProviderResolver: async (manifest, context) => createRaxodeLiveProvider(manifest, {
|
|
92
98
|
startDir,
|
|
@@ -129,6 +135,7 @@ export async function startRaxodeStdioApplicationServer(options = {}) {
|
|
|
129
135
|
now: options.now,
|
|
130
136
|
localProbe: options.localReadinessProbe,
|
|
131
137
|
ports: {
|
|
138
|
+
sandboxProvider: sandboxProvider ? "configured" : "not-configured",
|
|
132
139
|
liveProviderResolver: "configured",
|
|
133
140
|
},
|
|
134
141
|
}),
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { SandboxExecutionProviderPort } from "@praxis-ai/praxis/agent-core";
|
|
1
2
|
import type { CreateApplicationProjectRuntimeOptions, PraxisApplicationRuntimeMode } from "@praxis-ai/praxis/application-layer";
|
|
2
3
|
import type { RaxodeOptions } from "./agents/codingAgent/config/raxodeOptions.js";
|
|
3
4
|
import type { RaxodeLocalReadinessProbeInput } from "./application/localReadinessProbe.js";
|
|
@@ -18,6 +19,7 @@ type DirectApplicationBackendOptions = RaxodeOptions & {
|
|
|
18
19
|
preCompactGovernanceEnabled?: CreateApplicationProjectRuntimeOptions["preCompactGovernanceEnabled"];
|
|
19
20
|
compactContextWindowTokens?: CreateApplicationProjectRuntimeOptions["compactContextWindowTokens"];
|
|
20
21
|
compactThresholdRatio?: CreateApplicationProjectRuntimeOptions["compactThresholdRatio"];
|
|
22
|
+
sandboxProvider?: SandboxExecutionProviderPort;
|
|
21
23
|
localReadinessProbe?: Omit<RaxodeLocalReadinessProbeInput, "manifest">;
|
|
22
24
|
};
|
|
23
25
|
export declare function startDirectApplicationBackend(options?: DirectApplicationBackendOptions): Promise<void>;
|
|
@@ -6,6 +6,7 @@ import { mkdir, appendFile } from "node:fs/promises";
|
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import { pathToFileURL } from "node:url";
|
|
8
8
|
import { inspectRaxodeMemoryBridge } from "./memory/memoryBridge.js";
|
|
9
|
+
import { resolveRaxodeRaxcellSandboxProvider } from "./application/raxcellSandboxProvider.js";
|
|
9
10
|
import { loadDirectTuiSessionSnapshot, listDirectTuiAgents, saveDirectTuiAgent, saveDirectTuiSessionSnapshot, } from "../frontend/tui/input/direct-session-store.js";
|
|
10
11
|
function defaultProjectRoot() {
|
|
11
12
|
return new URL(".", import.meta.url).pathname;
|
|
@@ -29,6 +30,16 @@ function normalizePermissionProfile(value) {
|
|
|
29
30
|
return "standard";
|
|
30
31
|
}
|
|
31
32
|
}
|
|
33
|
+
function normalizeSandboxProfile(value) {
|
|
34
|
+
switch (value) {
|
|
35
|
+
case "hostObserved":
|
|
36
|
+
case "workspaceOnly":
|
|
37
|
+
case "linuxBubblewrap":
|
|
38
|
+
return value;
|
|
39
|
+
default:
|
|
40
|
+
return undefined;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
32
43
|
function normalizeInitialTurnIndex(value) {
|
|
33
44
|
const parsed = typeof value === "number"
|
|
34
45
|
? value
|
|
@@ -747,6 +758,9 @@ export async function startDirectApplicationBackend(options = {}) {
|
|
|
747
758
|
const permissionProfile = normalizePermissionProfile(options.policyProfile
|
|
748
759
|
?? process.env.RAXODE_APPLICATION_PERMISSION_PROFILE
|
|
749
760
|
?? process.env.PRAXIS_PERMISSION_PROFILE);
|
|
761
|
+
const sandboxProfile = options.sandboxProfile
|
|
762
|
+
?? normalizeSandboxProfile(process.env.RAXODE_APPLICATION_SANDBOX_PROFILE
|
|
763
|
+
?? process.env.PRAXIS_SANDBOX_PROFILE);
|
|
750
764
|
const reportsDir = path.resolve(options.stateRoot ?? stateRoot, "live-reports");
|
|
751
765
|
await mkdir(reportsDir, { recursive: true });
|
|
752
766
|
const logPath = path.join(reportsDir, `direct-application-${sessionId.replace(/[^\w.-]+/gu, "_")}-${Date.now()}.jsonl`);
|
|
@@ -892,7 +906,7 @@ export async function startDirectApplicationBackend(options = {}) {
|
|
|
892
906
|
});
|
|
893
907
|
const agentOptions = {
|
|
894
908
|
policyProfile: permissionProfile,
|
|
895
|
-
sandboxProfile
|
|
909
|
+
sandboxProfile,
|
|
896
910
|
persistence: options.persistence,
|
|
897
911
|
includeAllCatalogTools: options.includeAllCatalogTools,
|
|
898
912
|
provider,
|
|
@@ -905,6 +919,10 @@ export async function startDirectApplicationBackend(options = {}) {
|
|
|
905
919
|
memoryProfile: memoryBridge.profile,
|
|
906
920
|
memoryPromptGuide: memoryBridge.promptGuide,
|
|
907
921
|
};
|
|
922
|
+
const sandboxProvider = resolveRaxodeRaxcellSandboxProvider({
|
|
923
|
+
sandboxProfile,
|
|
924
|
+
sandboxProvider: options.sandboxProvider,
|
|
925
|
+
});
|
|
908
926
|
const created = await applicationLayer.createApplicationProjectRuntime(projectRoot, {
|
|
909
927
|
applicationId: applicationModule.raxodeApplication.id,
|
|
910
928
|
cwd,
|
|
@@ -918,6 +936,7 @@ export async function startDirectApplicationBackend(options = {}) {
|
|
|
918
936
|
maxOutputTokens,
|
|
919
937
|
permissionProfile,
|
|
920
938
|
agentOptions,
|
|
939
|
+
sandboxProvider,
|
|
921
940
|
initialConversations: restoredInitialConversation === undefined ? [] : [restoredInitialConversation],
|
|
922
941
|
now: options.now,
|
|
923
942
|
compactExecutor: options.compactExecutor,
|
|
@@ -1043,6 +1062,7 @@ export async function startDirectApplicationBackend(options = {}) {
|
|
|
1043
1062
|
localProbe: options.localReadinessProbe,
|
|
1044
1063
|
ports: {
|
|
1045
1064
|
approvalResolver: "configured",
|
|
1065
|
+
sandboxProvider: sandboxProvider ? "configured" : "not-configured",
|
|
1046
1066
|
liveProviderResolver: options.liveProviderResolver ? "configured" : "raxode-default",
|
|
1047
1067
|
},
|
|
1048
1068
|
});
|
|
@@ -13,7 +13,7 @@ export type RaxodeBackendCommand = {
|
|
|
13
13
|
toolProfile?: PraxisApplicationToolProfile;
|
|
14
14
|
};
|
|
15
15
|
export type RaxodeBackendResult = PraxisApplicationCommandResult;
|
|
16
|
-
type RaxodeBackendRuntimePorts = Pick<CreateApplicationProjectRuntimeOptions, "approvalResolver" | "agentReviewResolver" | "contextArtifactAdapters" | "baseToolAdapters" | "authStateProvider" | "foundationProject" | "openFoundationProject" | "liveProviderResolver" | "compactExecutor" | "preCompactGovernanceExecutor" | "preCompactGovernanceEnabled" | "compactContextWindowTokens" | "compactThresholdRatio">;
|
|
16
|
+
type RaxodeBackendRuntimePorts = Pick<CreateApplicationProjectRuntimeOptions, "approvalResolver" | "agentReviewResolver" | "contextArtifactAdapters" | "baseToolAdapters" | "authStateProvider" | "sandboxProvider" | "foundationProject" | "openFoundationProject" | "liveProviderResolver" | "compactExecutor" | "preCompactGovernanceExecutor" | "preCompactGovernanceEnabled" | "compactContextWindowTokens" | "compactThresholdRatio">;
|
|
17
17
|
export type RaxodeBackendOptions = RaxodeOptions & RaxodeBackendRuntimePorts & {
|
|
18
18
|
projectRoot?: string;
|
|
19
19
|
cwd?: string;
|
|
@@ -6,6 +6,7 @@ import path from "node:path";
|
|
|
6
6
|
import { fileURLToPath } from "node:url";
|
|
7
7
|
import { createApplicationProjectRuntime, createApplicationRestServer, createApplicationWebSocketServer, createLocalApplicationTransport, } from "@praxis-ai/praxis/application-layer";
|
|
8
8
|
import { createRaxodeLiveProvider, resolveRaxodeConfiguredModelOptions, } from "./authentication/liveProvider.js";
|
|
9
|
+
import { resolveRaxodeRaxcellSandboxProvider } from "./application/raxcellSandboxProvider.js";
|
|
9
10
|
import { createRaxodeAuthStateProvider } from "./authentication/authStateProvider.js";
|
|
10
11
|
import { createRaxodeContextAdapter } from "./context/contextBridge.js";
|
|
11
12
|
import { inspectRaxodeMemoryBridge } from "./memory/memoryBridge.js";
|
|
@@ -16,6 +17,7 @@ function configuredRuntimePorts(options) {
|
|
|
16
17
|
agentReviewResolver: options.agentReviewResolver ? "configured" : "not-configured",
|
|
17
18
|
contextArtifactAdapters: options.contextArtifactAdapters ? "configured" : "not-configured",
|
|
18
19
|
baseToolAdapters: options.baseToolAdapters ? "configured" : "not-configured",
|
|
20
|
+
sandboxProvider: options.sandboxProvider ? "configured" : "not-configured",
|
|
19
21
|
authStateProvider: options.authStateProvider ? "configured" : "not-configured",
|
|
20
22
|
foundationProject: options.foundationProject || options.openFoundationProject ? "configured" : "not-configured",
|
|
21
23
|
liveProviderResolver: options.liveProviderResolver ? "configured" : "raxode-default",
|
|
@@ -68,6 +70,10 @@ async function createRaxodeRuntime(options = {}) {
|
|
|
68
70
|
now: options.now,
|
|
69
71
|
});
|
|
70
72
|
const openFoundationProject = options.openFoundationProject ?? true;
|
|
73
|
+
const sandboxProvider = resolveRaxodeRaxcellSandboxProvider({
|
|
74
|
+
sandboxProfile: options.sandboxProfile,
|
|
75
|
+
sandboxProvider: options.sandboxProvider,
|
|
76
|
+
});
|
|
71
77
|
const runtimeResult = await createApplicationProjectRuntime(projectRoot, {
|
|
72
78
|
applicationId: "application.raxode.coding",
|
|
73
79
|
runtimeId: options.runtimeId,
|
|
@@ -89,6 +95,7 @@ async function createRaxodeRuntime(options = {}) {
|
|
|
89
95
|
agentReviewResolver: options.agentReviewResolver,
|
|
90
96
|
contextArtifactAdapters,
|
|
91
97
|
baseToolAdapters: options.baseToolAdapters,
|
|
98
|
+
sandboxProvider,
|
|
92
99
|
authStateProvider,
|
|
93
100
|
foundationProject: options.foundationProject,
|
|
94
101
|
openFoundationProject,
|
|
@@ -116,6 +123,7 @@ async function createRaxodeRuntime(options = {}) {
|
|
|
116
123
|
readinessPorts: configuredRuntimePorts({
|
|
117
124
|
...options,
|
|
118
125
|
contextArtifactAdapters,
|
|
126
|
+
sandboxProvider,
|
|
119
127
|
authStateProvider,
|
|
120
128
|
openFoundationProject,
|
|
121
129
|
}),
|
|
@@ -73,7 +73,7 @@ export function buildBackendReadinessStatusLines(input = {}) {
|
|
|
73
73
|
const sandboxActionLine = readiness.sandbox.probe?.status === "degraded"
|
|
74
74
|
? [
|
|
75
75
|
`profile=${readiness.sandbox.profile}`,
|
|
76
|
-
readiness.sandbox.probe.executable === undefined ? "install=
|
|
76
|
+
readiness.sandbox.probe.executable === undefined ? "install=raxcell" : `executable=${readiness.sandbox.probe.executable}`,
|
|
77
77
|
`fallback=${readiness.sandbox.probe.fallback}`,
|
|
78
78
|
].join(", ")
|
|
79
79
|
: "none";
|
|
@@ -118,6 +118,20 @@ export function resolveRaxodeCliCommand(argv) {
|
|
|
118
118
|
rest,
|
|
119
119
|
};
|
|
120
120
|
}
|
|
121
|
+
function optionValue(arg, prefix) {
|
|
122
|
+
return arg.startsWith(prefix) ? arg.slice(prefix.length).trim() || undefined : undefined;
|
|
123
|
+
}
|
|
124
|
+
function resolveForwardedSandboxProfile(args) {
|
|
125
|
+
for (const arg of args) {
|
|
126
|
+
const sandbox = optionValue(arg, "--sandbox=");
|
|
127
|
+
if (sandbox === "hostObserved"
|
|
128
|
+
|| sandbox === "workspaceOnly"
|
|
129
|
+
|| sandbox === "linuxBubblewrap") {
|
|
130
|
+
return sandbox;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
return undefined;
|
|
134
|
+
}
|
|
121
135
|
function printUsage() {
|
|
122
136
|
process.stdout.write([
|
|
123
137
|
`${CLI_DISPLAY_NAME} CLI`,
|
|
@@ -185,6 +199,10 @@ export function resolveRaxodeLaunchPlan(command, forwardedArgs, options = {}) {
|
|
|
185
199
|
PRAXIS_APP_ROOT: resolveCliAppRoot(moduleDir),
|
|
186
200
|
PRAXIS_WORKSPACE_ROOT: cwd,
|
|
187
201
|
};
|
|
202
|
+
const sandboxProfile = resolveForwardedSandboxProfile(forwardedArgs);
|
|
203
|
+
if (sandboxProfile !== undefined) {
|
|
204
|
+
env.RAXODE_APPLICATION_SANDBOX_PROFILE = sandboxProfile;
|
|
205
|
+
}
|
|
188
206
|
const entrypoint = resolveUiEntrypoint(command, moduleDir);
|
|
189
207
|
return {
|
|
190
208
|
command: entrypoint.command,
|
package/raxode-tui/package.json
CHANGED
|
@@ -55,7 +55,8 @@
|
|
|
55
55
|
"@lancedb/lancedb": "^0.27.2",
|
|
56
56
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
57
57
|
"@openai/agents": "^0.11.4",
|
|
58
|
-
"@praxis-ai/praxis": "0.1.
|
|
58
|
+
"@praxis-ai/praxis": "0.1.2",
|
|
59
|
+
"@praxis-ai/raxcell": "^0.1.5",
|
|
59
60
|
"apache-arrow": "^18.1.0",
|
|
60
61
|
"class-variance-authority": "^0.7.1",
|
|
61
62
|
"clsx": "^2.1.1",
|
package/tsconfig.json
CHANGED
|
@@ -9,7 +9,22 @@
|
|
|
9
9
|
"noEmit": true,
|
|
10
10
|
"forceConsistentCasingInFileNames": true,
|
|
11
11
|
"skipLibCheck": true,
|
|
12
|
-
"resolveJsonModule": true
|
|
12
|
+
"resolveJsonModule": true,
|
|
13
|
+
"baseUrl": ".",
|
|
14
|
+
"paths": {
|
|
15
|
+
"@praxis-ai/praxis": ["src/agentCore/index.ts"],
|
|
16
|
+
"@praxis-ai/praxis/agentCore": ["src/agentCore/index.ts"],
|
|
17
|
+
"@praxis-ai/praxis/agent-core": ["src/agentCore/index.ts"],
|
|
18
|
+
"@praxis-ai/praxis/application": ["src/applicationLayer/index.ts"],
|
|
19
|
+
"@praxis-ai/praxis/application-layer": ["src/applicationLayer/index.ts"],
|
|
20
|
+
"@praxis-ai/praxis/basetool": ["src/basetool/index.ts"],
|
|
21
|
+
"@praxis-ai/praxis/memory": ["src/memory_managementPool/index.ts"],
|
|
22
|
+
"@praxis-ai/praxis/modelAdapter": ["src/modelAdapter/index.ts"],
|
|
23
|
+
"@praxis-ai/praxis/model-adapter": ["src/modelAdapter/index.ts"],
|
|
24
|
+
"@praxis-ai/praxis/modelAdapter/*": ["src/modelAdapter/*.ts"],
|
|
25
|
+
"@praxis-ai/praxis/model-adapter/*": ["src/modelAdapter/*.ts"],
|
|
26
|
+
"@praxis-ai/praxis/provider/*": ["src/modelAdapter/*.ts"]
|
|
27
|
+
}
|
|
13
28
|
},
|
|
14
29
|
"include": ["src/**/*.ts", "test/**/*.ts", "examples/**/*.ts"],
|
|
15
30
|
"exclude": [
|