@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.
Files changed (48) hide show
  1. package/dist/agentCore/index.d.ts +45 -6
  2. package/dist/agentCore/index.js +14 -2
  3. package/dist/applicationLayer/applicationContract.d.ts +2 -0
  4. package/dist/applicationLayer/applicationRuntime.d.ts +6 -1
  5. package/dist/applicationLayer/applicationRuntime.js +37 -3
  6. package/dist/applicationLayer/index.d.ts +1 -0
  7. package/dist/basetool/core/shellRun.js +6 -1
  8. package/dist/rax_packageManager/raxCli.js +42 -1
  9. package/dist/runtimeImplementation/praxisRuntimeKernel.d.ts +6 -0
  10. package/dist/runtimeImplementation/praxisRuntimeKernel.js +165 -14
  11. package/dist/runtimeImplementation/runtime.componentPlane/runtimeComponentRegistry.d.ts +1 -1
  12. package/dist/runtimeImplementation/runtime.componentPlane/runtimeComponentRegistry.js +2 -2
  13. package/dist/runtimeImplementation/runtime.dependencyPlane/dependencySourceRegistry.d.ts +1 -1
  14. package/dist/runtimeImplementation/runtime.dependencyPlane/dependencySourceRegistry.js +12 -0
  15. package/dist/runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js +2 -0
  16. package/dist/runtimeImplementation/runtime.execEngine/baseToolExecutorPortFactory.d.ts +3 -0
  17. package/dist/runtimeImplementation/runtime.execEngine/baseToolExecutorPortFactory.js +45 -7
  18. package/dist/runtimeImplementation/runtime.execEngine/mcpRuntimeAdapter.js +56 -0
  19. package/dist/runtimeImplementation/runtime.mcpPlane/index.d.ts +114 -0
  20. package/dist/runtimeImplementation/runtime.mcpPlane/index.js +167 -0
  21. package/dist/runtimeImplementation/runtime.sandboxPlane/baseToolSandboxPlanner.js +0 -2
  22. package/dist/runtimeImplementation/runtime.sandboxPlane/raxcellSandboxProvider.d.ts +19 -0
  23. package/dist/runtimeImplementation/runtime.sandboxPlane/raxcellSandboxProvider.js +172 -0
  24. package/dist/runtimeImplementation/runtime.sandboxPlane/sandboxCommandRunner.d.ts +13 -1
  25. package/dist/runtimeImplementation/runtime.sandboxPlane/sandboxCommandRunner.js +230 -186
  26. package/dist/runtimeImplementation/runtime.sandboxPlane/sandboxPolicyMiddleware.d.ts +175 -0
  27. package/dist/runtimeImplementation/runtime.sandboxPlane/sandboxPolicyMiddleware.js +142 -0
  28. package/dist/runtimeImplementation/runtime.sandboxPlane/sandboxRuntimeProvider.d.ts +9 -0
  29. package/dist/runtimeImplementation/runtime.sandboxPlane/sandboxRuntimeProvider.js +115 -205
  30. package/dist/runtimeImplementation/runtimeAgentManifest.js +7 -3
  31. package/package.json +3 -1
  32. package/raxode-tui/dist/raxode-cli/backend/agents/codingAgent/agent.js +3 -3
  33. package/raxode-tui/dist/raxode-cli/backend/application/backendModuleInventory.js +3 -3
  34. package/raxode-tui/dist/raxode-cli/backend/application/localReadinessProbe.d.ts +1 -0
  35. package/raxode-tui/dist/raxode-cli/backend/application/localReadinessProbe.js +50 -4
  36. package/raxode-tui/dist/raxode-cli/backend/application/raxcellSandboxProvider.d.ts +12 -0
  37. package/raxode-tui/dist/raxode-cli/backend/application/raxcellSandboxProvider.js +58 -0
  38. package/raxode-tui/dist/raxode-cli/backend/application/runtimeReadiness.d.ts +1 -0
  39. package/raxode-tui/dist/raxode-cli/backend/application/runtimeReadiness.js +3 -1
  40. package/raxode-tui/dist/raxode-cli/backend/application/stdioApplicationServer.d.ts +2 -0
  41. package/raxode-tui/dist/raxode-cli/backend/application/stdioApplicationServer.js +7 -0
  42. package/raxode-tui/dist/raxode-cli/backend/directApplicationBackend.d.ts +2 -0
  43. package/raxode-tui/dist/raxode-cli/backend/directApplicationBackend.js +21 -1
  44. package/raxode-tui/dist/raxode-cli/backend/raxodeBackend.d.ts +1 -1
  45. package/raxode-tui/dist/raxode-cli/backend/raxodeBackend.js +8 -0
  46. package/raxode-tui/dist/raxode-cli/frontend/tui/cli/raxode-cli.js +19 -1
  47. package/raxode-tui/package.json +2 -1
  48. package/tsconfig.json +16 -1
@@ -1,6 +1,8 @@
1
1
  import { PromptPack, PraxisAgent, PraxisAgentArchetype, append, compileAgent, endpoint, harness, inspectAgentManifest, markdown, markdownFile, model, overwrite, policy, prepend, replaceLastLines, session, statePlane, tool, tools, validateAgentManifest } from "../runtimeImplementation/runtimeAgentManifest.js";
2
- import { createSandboxRuntimeProvider, prepareSandboxRuntime } from "../runtimeImplementation/runtime.sandboxPlane/sandboxRuntimeProvider.js";
2
+ import { createSandboxRuntimeProvider, prepareSandboxRuntime, resolveRaxcellBinaryPath } from "../runtimeImplementation/runtime.sandboxPlane/sandboxRuntimeProvider.js";
3
3
  import { createSandboxCommandPlan, createLocalSandboxRemoteWorkerAdapter, runSandboxCommand } from "../runtimeImplementation/runtime.sandboxPlane/sandboxCommandRunner.js";
4
+ import { createRaxcellSandboxProvider, mapSandboxProviderRequestToRaxcell } from "../runtimeImplementation/runtime.sandboxPlane/raxcellSandboxProvider.js";
5
+ import { runSandboxPolicyMiddleware } from "../runtimeImplementation/runtime.sandboxPlane/sandboxPolicyMiddleware.js";
4
6
  import { approvalInterfaceEnvelope, createInterfaceEnvelope, eventInterfaceEnvelope, managementInterfaceEnvelope, repairInterfaceEnvelope, stateInterfaceEnvelope } from "../interfaceAdapter/interfaceEnvelope.js";
5
7
  import { createInterfaceAdapterRuntime } from "../runtimeImplementation/runtime.interfaceAdapter/interfaceAdapterRuntime.js";
6
8
  import { bindBasicInterfaceLayer } from "../runtimeImplementation/runtime.interfaceAdapter/bindBasicInterfaceLayer.js";
@@ -23,7 +25,10 @@ import { assemblePromptPack } from "../executionEngine/promptPack/promptAssemble
23
25
  import { assemblePromptContextMaterials, promptPackMaterialsForManifest } from "../runtimeImplementation/runtime.execEngine/promptContextAssembly.js";
24
26
  import { createObservationMaterial } from "../executionEngine/coreLogic/observationIntegrator.js";
25
27
  import { createMemoryPlane, memoryPlane } from "../memory_managementPool/index.js";
28
+ import { buildMcpServerProfilesFromManifest, createMcpApplicationStateView, mcp, planMcpHarnessExposure } from "../runtimeImplementation/runtime.mcpPlane/index.js";
26
29
  export { PromptPack, PraxisAgent, PraxisAgentArchetype, STATE_PLANE_STANDARD_CONTROLS, append, compileAgent, endpoint, harness, inspectAgentManifest, loop, mainLoop, markdown, markdownFile, model, modelFleet, overwrite, policy, prepend, replaceLastLines, sandbox, session, statePlane, storage, tool, toolPolicies, tools, validateAgentManifest, type AgentCompileErrorCode, type AgentCompileResult, type AgentIdentity, type AgentManifest, type AgentManifestInspection, type AgentManifestValidationResult, type BaseToolPolicyDecision, type BaseToolPolicyMatrixSpec, type BaseToolPolicyProfile, type BaseToolPolicyRisk, type BaseToolPolicyRule, type HarnessSpec, type FrameworkCoreContractSpec, type LoopSpec, type MainLoopSpec, type ModelEndpointSpec, type ModelFleetSpec, type ModelSpec, type PolicySpec, type PraxisAgentClass, type PraxisAgentInput, type PromptMaterialSource, type PromptPackSpec, type PromptPatchSpec, type SandboxSpec, type SandboxIsolationLevel, type SandboxMountPolicy, type SandboxNetworkRuntimePolicy, type SandboxPlatformSupport, type SandboxPlatformSupportStatus, type SandboxProcessPolicy, type SandboxProviderFamily, type SessionSpec, type StatePlaneSpec, type StorageSpec, type ToolSpec, type ToolPolicyCustomInput, } from "../runtimeImplementation/runtimeAgentManifest.js";
30
+ export { buildMcpServerProfilesFromManifest, createMcpApplicationStateView, mcp, planMcpHarnessExposure, };
31
+ export type { McpApplicationServerView, McpApplicationServerInput, McpApplicationStateView, McpHarnessExposurePlan, McpHarnessModuleSpec, McpHarnessServerMode, McpHarnessServerSpec, McpPlusApplicationServerInput, McpTransportSpec, } from "../runtimeImplementation/runtime.mcpPlane/index.js";
27
32
  export { createMemoryPlane, memoryPlane, };
28
33
  export type { MemoryArtifactRef, MemoryIndexStatus, MemoryLayout, MemoryPlane, MemoryPlaneOptions, MemoryPolicyRisk, MemoryProfile, MemoryPromptGuide, MemoryReindexResult, MemoryRiskMetadata, MemoryScope, MemorySearchGuide, MemorySearchRequest, MemorySourceType, } from "../memory_managementPool/index.js";
29
34
  export { capabilities, capability, createProvisionPlan, dependencies, dependencyAuthoring, provisionRuntimeDescriptor, type CapabilityFallbackSpec, type CapabilityInput, type CapabilityKind, type CapabilityPolicySpec, type CapabilityReadiness, type CapabilitySpec, type CodeIntelligenceCapabilityInput, type ProvisionPlan, type SandboxCapabilityInput, } from "../runtimeImplementation/runtime.provisionPlane/index.js";
@@ -44,7 +49,9 @@ export { PRE_COMPACT_GOVERNANCE_SCHEMA, createModelPreCompactGovernanceExecutor,
44
49
  export { PRAXIS_BASE_TOOL_CALLING_PROTOCOL, assemblePromptContextMaterials, promptPackMaterialsForManifest, type PromptContextAssemblyBudget, type PromptContextAssemblyRequest, type PromptContextAssemblyResult, type PromptContextConversationMessage, type PromptContextSessionSummary, } from "../runtimeImplementation/runtime.execEngine/promptContextAssembly.js";
45
50
  export { PROMPT_PACK_PROVIDER_VISIBLE_SEGMENT_KINDS, PROMPT_PACK_SEGMENT_KINDS, inferPromptPackSegmentKind, type PromptPackSegmentKind, } from "../executionEngine/promptPack/promptDefiner.js";
46
51
  export { createSandboxCommandPlan, createLocalSandboxRemoteWorkerAdapter, runSandboxCommand, sandboxCommandRunnerDescriptor, type SandboxCommandDenial, type SandboxCommandFilesystemPolicy, type SandboxCommandNetworkPolicy, type SandboxCommandPlan, type SandboxCommandProviderFamily, type SandboxCommandRequest, type SandboxCommandRunResult, type SandboxRemoteWorkerAdapter, } from "../runtimeImplementation/runtime.sandboxPlane/sandboxCommandRunner.js";
47
- export { createSandboxRuntimeProvider, prepareSandboxRuntime, sandboxRuntimeProviderDescriptor, type SandboxRuntimePrepareResult, type SandboxRuntimeDependencyCheck, type SandboxRuntimeSelfRepairHint, type SandboxRuntimeProvider, type SandboxRuntimeProviderAction, type SandboxRuntimeProviderProbe, type SandboxRuntimeProviderStatus, type SandboxRuntimeSmokeResult, } from "../runtimeImplementation/runtime.sandboxPlane/sandboxRuntimeProvider.js";
52
+ export { createSandboxRuntimeProvider, prepareSandboxRuntime, resolveRaxcellBinaryPath, sandboxRuntimeProviderDescriptor, type SandboxRuntimePrepareResult, type SandboxRuntimeDependencyCheck, type SandboxRuntimeSelfRepairHint, type SandboxRuntimeProvider, type SandboxRuntimeProviderAction, type SandboxRuntimeProviderProbe, type SandboxRuntimeProviderStatus, type SandboxRuntimeSmokeResult, } from "../runtimeImplementation/runtime.sandboxPlane/sandboxRuntimeProvider.js";
53
+ export { createRaxcellSandboxProvider, mapSandboxProviderRequestToRaxcell, raxcellSandboxProviderDescriptor, type RaxcellClientLike, type RaxcellSandboxProviderOptions, } from "../runtimeImplementation/runtime.sandboxPlane/raxcellSandboxProvider.js";
54
+ export { runSandboxPolicyMiddleware, sandboxPolicyMiddlewareDescriptor, type SandboxExecutionProviderPort, type SandboxPolicyMiddlewareAuditEvent, type SandboxPolicyMiddlewareEnvironmentGapDecision, type SandboxPolicyMiddlewareResult, type SandboxProviderRunRequest, } from "../runtimeImplementation/runtime.sandboxPlane/sandboxPolicyMiddleware.js";
48
55
  export { approvalInterfaceEnvelope, createInterfaceEnvelope, eventInterfaceEnvelope, managementInterfaceEnvelope, repairInterfaceEnvelope, stateInterfaceEnvelope, type InterfaceEnvelope, type InterfaceEnvelopeKind, type InterfaceEnvelopeSurface, type InterfaceEnvelopeValidationErrorCode, type InterfaceEnvelopeValidationResult, } from "../interfaceAdapter/interfaceEnvelope.js";
49
56
  export { bindBasicInterfaceLayer, type BasicInterfaceKind, type BasicInterfaceLayerBinding, type BasicInterfaceLayerBindingRequest, type BasicInterfaceLayerBindingResult, type BasicInterfaceRef, } from "../runtimeImplementation/runtime.interfaceAdapter/bindBasicInterfaceLayer.js";
50
57
  export { createInterfaceAdapterRuntime, type InterfaceAdapterRuntimeBinding, type InterfaceAdapterRuntimeBindingInput, type InterfaceAdapterRuntimeCaller, type InterfaceAdapterRuntimeHandle, type InterfaceAdapterRuntimeRequest, type InterfaceAdapterRuntimeResult, type InterfaceAdapterRuntimeSurface, } from "../runtimeImplementation/runtime.interfaceAdapter/interfaceAdapterRuntime.js";
@@ -398,7 +405,7 @@ export declare const componentPlane: Readonly<{
398
405
  officialRuntimeComponents: readonly [{
399
406
  readonly componentId: "component.sandbox.bubblewrap";
400
407
  readonly kind: "sandbox";
401
- readonly title: "Linux bubblewrap sandbox";
408
+ readonly title: "Linux Raxcell sandbox provider";
402
409
  readonly dependencies: readonly [import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencyDeclaration];
403
410
  readonly fallbackComponentIds: readonly ["component.sandbox.workspaceRollback"];
404
411
  readonly supportedPlatforms: readonly ["linux"];
@@ -459,21 +466,37 @@ export declare const dependencyPlane: Readonly<{
459
466
  defaultManagedRoot: typeof defaultManagedRoot;
460
467
  ensureDependencyAvailable: typeof ensureDependencyAvailable;
461
468
  lookupDependencySource: typeof lookupDependencySource;
462
- officialDependencySources: readonly [import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource];
469
+ officialDependencySources: readonly [import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource];
463
470
  planDependencyInstallation: typeof planDependencyInstallation;
464
471
  probeDependency: typeof probeDependency;
465
472
  }>;
466
473
  export declare const sandboxPlane: Readonly<{
474
+ createRaxcellSandboxProvider: typeof createRaxcellSandboxProvider;
467
475
  createSandboxCommandPlan: typeof createSandboxCommandPlan;
468
476
  createLocalSandboxRemoteWorkerAdapter: typeof createLocalSandboxRemoteWorkerAdapter;
469
477
  createSandboxRuntimeProvider: typeof createSandboxRuntimeProvider;
478
+ mapSandboxProviderRequestToRaxcell: typeof mapSandboxProviderRequestToRaxcell;
470
479
  prepareSandboxRuntime: typeof prepareSandboxRuntime;
480
+ resolveRaxcellBinaryPath: typeof resolveRaxcellBinaryPath;
481
+ runSandboxPolicyMiddleware: typeof runSandboxPolicyMiddleware;
471
482
  runSandboxCommand: typeof runSandboxCommand;
483
+ raxcellSandboxProviderDescriptor: {
484
+ readonly surface: "runtime.sandboxPlane.raxcellSandboxProvider";
485
+ readonly providerFamily: "linux-bubblewrap";
486
+ readonly policyOwner: "praxis";
487
+ readonly role: "environment-and-execution";
488
+ };
472
489
  sandboxCommandRunnerDescriptor: {
473
490
  readonly surface: "runtime.sandboxPlane.sandboxCommandRunner";
474
491
  readonly publicApiCandidate: "application may inject providers through runtime options";
475
492
  readonly providers: readonly ["host-observed", "workspace-rollback", "linux-bubblewrap", "macos-containerization", "windows-sandbox", "remote-worker"];
476
493
  };
494
+ sandboxPolicyMiddlewareDescriptor: {
495
+ readonly surface: "runtime.sandboxPlane.sandboxPolicyMiddleware";
496
+ readonly policyOwner: "praxis";
497
+ readonly providerRole: "environment-and-execution";
498
+ readonly publicSafe: true;
499
+ };
477
500
  sandboxRuntimeProviderDescriptor: {
478
501
  readonly surface: "runtime.sandboxPlane";
479
502
  readonly capability: "sandboxRuntimeProvider";
@@ -942,7 +965,7 @@ export declare const praxis: Readonly<{
942
965
  defaultManagedRoot: typeof defaultManagedRoot;
943
966
  ensureDependencyAvailable: typeof ensureDependencyAvailable;
944
967
  lookupDependencySource: typeof lookupDependencySource;
945
- officialDependencySources: readonly [import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource];
968
+ officialDependencySources: readonly [import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource, import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencySource];
946
969
  planDependencyInstallation: typeof planDependencyInstallation;
947
970
  probeDependency: typeof probeDependency;
948
971
  }>;
@@ -964,7 +987,7 @@ export declare const praxis: Readonly<{
964
987
  officialRuntimeComponents: readonly [{
965
988
  readonly componentId: "component.sandbox.bubblewrap";
966
989
  readonly kind: "sandbox";
967
- readonly title: "Linux bubblewrap sandbox";
990
+ readonly title: "Linux Raxcell sandbox provider";
968
991
  readonly dependencies: readonly [import("../runtimeImplementation/runtime.dependencyPlane/dependencyTypes.js").DependencyDeclaration];
969
992
  readonly fallbackComponentIds: readonly ["component.sandbox.workspaceRollback"];
970
993
  readonly supportedPlatforms: readonly ["linux"];
@@ -1066,16 +1089,32 @@ export declare const praxis: Readonly<{
1066
1089
  resolveRaxWorkspace: typeof resolveRaxWorkspace;
1067
1090
  }>;
1068
1091
  sandboxPlane: Readonly<{
1092
+ createRaxcellSandboxProvider: typeof createRaxcellSandboxProvider;
1069
1093
  createSandboxCommandPlan: typeof createSandboxCommandPlan;
1070
1094
  createLocalSandboxRemoteWorkerAdapter: typeof createLocalSandboxRemoteWorkerAdapter;
1071
1095
  createSandboxRuntimeProvider: typeof createSandboxRuntimeProvider;
1096
+ mapSandboxProviderRequestToRaxcell: typeof mapSandboxProviderRequestToRaxcell;
1072
1097
  prepareSandboxRuntime: typeof prepareSandboxRuntime;
1098
+ resolveRaxcellBinaryPath: typeof resolveRaxcellBinaryPath;
1099
+ runSandboxPolicyMiddleware: typeof runSandboxPolicyMiddleware;
1073
1100
  runSandboxCommand: typeof runSandboxCommand;
1101
+ raxcellSandboxProviderDescriptor: {
1102
+ readonly surface: "runtime.sandboxPlane.raxcellSandboxProvider";
1103
+ readonly providerFamily: "linux-bubblewrap";
1104
+ readonly policyOwner: "praxis";
1105
+ readonly role: "environment-and-execution";
1106
+ };
1074
1107
  sandboxCommandRunnerDescriptor: {
1075
1108
  readonly surface: "runtime.sandboxPlane.sandboxCommandRunner";
1076
1109
  readonly publicApiCandidate: "application may inject providers through runtime options";
1077
1110
  readonly providers: readonly ["host-observed", "workspace-rollback", "linux-bubblewrap", "macos-containerization", "windows-sandbox", "remote-worker"];
1078
1111
  };
1112
+ sandboxPolicyMiddlewareDescriptor: {
1113
+ readonly surface: "runtime.sandboxPlane.sandboxPolicyMiddleware";
1114
+ readonly policyOwner: "praxis";
1115
+ readonly providerRole: "environment-and-execution";
1116
+ readonly publicSafe: true;
1117
+ };
1079
1118
  sandboxRuntimeProviderDescriptor: {
1080
1119
  readonly surface: "runtime.sandboxPlane";
1081
1120
  readonly capability: "sandboxRuntimeProvider";
@@ -4,8 +4,10 @@
4
4
  * 边界:不把 runtime.* 深层实现文件作为普通 public API。
5
5
  */
6
6
  import { PromptPack, PraxisAgent, PraxisAgentArchetype, append, compileAgent, endpoint, harness, inspectAgentManifest, loop, mainLoop, markdown, markdownFile, model, modelFleet, overwrite, policy, prepend, replaceLastLines, sandbox, session, statePlane, storage, tool, toolPolicies, tools, validateAgentManifest, } from "../runtimeImplementation/runtimeAgentManifest.js";
7
- import { createSandboxRuntimeProvider, prepareSandboxRuntime, sandboxRuntimeProviderDescriptor, } from "../runtimeImplementation/runtime.sandboxPlane/sandboxRuntimeProvider.js";
7
+ import { createSandboxRuntimeProvider, prepareSandboxRuntime, resolveRaxcellBinaryPath, sandboxRuntimeProviderDescriptor, } from "../runtimeImplementation/runtime.sandboxPlane/sandboxRuntimeProvider.js";
8
8
  import { createSandboxCommandPlan, createLocalSandboxRemoteWorkerAdapter, runSandboxCommand, sandboxCommandRunnerDescriptor, } from "../runtimeImplementation/runtime.sandboxPlane/sandboxCommandRunner.js";
9
+ import { createRaxcellSandboxProvider, mapSandboxProviderRequestToRaxcell, raxcellSandboxProviderDescriptor, } from "../runtimeImplementation/runtime.sandboxPlane/raxcellSandboxProvider.js";
10
+ import { runSandboxPolicyMiddleware, sandboxPolicyMiddlewareDescriptor, } from "../runtimeImplementation/runtime.sandboxPlane/sandboxPolicyMiddleware.js";
9
11
  import { approvalInterfaceEnvelope, createInterfaceEnvelope, eventInterfaceEnvelope, managementInterfaceEnvelope, repairInterfaceEnvelope, stateInterfaceEnvelope, } from "../interfaceAdapter/interfaceEnvelope.js";
10
12
  import { createInterfaceAdapterRuntime, } from "../runtimeImplementation/runtime.interfaceAdapter/interfaceAdapterRuntime.js";
11
13
  import { bindBasicInterfaceLayer, } from "../runtimeImplementation/runtime.interfaceAdapter/bindBasicInterfaceLayer.js";
@@ -29,7 +31,9 @@ import { assemblePromptContextMaterials, promptPackMaterialsForManifest, } from
29
31
  import { createObservationMaterial, } from "../executionEngine/coreLogic/observationIntegrator.js";
30
32
  import { runtimeAuth, } from "../runtimeImplementation/runtime.authPlane/index.js";
31
33
  import { createMemoryPlane, memoryPlane, } from "../memory_managementPool/index.js";
34
+ import { buildMcpServerProfilesFromManifest, createMcpApplicationStateView, mcp, planMcpHarnessExposure, } from "../runtimeImplementation/runtime.mcpPlane/index.js";
32
35
  export { PromptPack, PraxisAgent, PraxisAgentArchetype, STATE_PLANE_STANDARD_CONTROLS, append, compileAgent, endpoint, harness, inspectAgentManifest, loop, mainLoop, markdown, markdownFile, model, modelFleet, overwrite, policy, prepend, replaceLastLines, sandbox, session, statePlane, storage, tool, toolPolicies, tools, validateAgentManifest, } from "../runtimeImplementation/runtimeAgentManifest.js";
36
+ export { buildMcpServerProfilesFromManifest, createMcpApplicationStateView, mcp, planMcpHarnessExposure, };
33
37
  export { createMemoryPlane, memoryPlane, };
34
38
  export { capabilities, capability, createProvisionPlan, dependencies, dependencyAuthoring, provisionRuntimeDescriptor, } from "../runtimeImplementation/runtime.provisionPlane/index.js";
35
39
  export { component, createRuntimeComponentRegistry, lookupRuntimeComponent, officialRuntimeComponents, } from "../runtimeImplementation/runtime.componentPlane/index.js";
@@ -49,7 +53,9 @@ export { PRE_COMPACT_GOVERNANCE_SCHEMA, createModelPreCompactGovernanceExecutor,
49
53
  export { PRAXIS_BASE_TOOL_CALLING_PROTOCOL, assemblePromptContextMaterials, promptPackMaterialsForManifest, } from "../runtimeImplementation/runtime.execEngine/promptContextAssembly.js";
50
54
  export { PROMPT_PACK_PROVIDER_VISIBLE_SEGMENT_KINDS, PROMPT_PACK_SEGMENT_KINDS, inferPromptPackSegmentKind, } from "../executionEngine/promptPack/promptDefiner.js";
51
55
  export { createSandboxCommandPlan, createLocalSandboxRemoteWorkerAdapter, runSandboxCommand, sandboxCommandRunnerDescriptor, } from "../runtimeImplementation/runtime.sandboxPlane/sandboxCommandRunner.js";
52
- export { createSandboxRuntimeProvider, prepareSandboxRuntime, sandboxRuntimeProviderDescriptor, } from "../runtimeImplementation/runtime.sandboxPlane/sandboxRuntimeProvider.js";
56
+ export { createSandboxRuntimeProvider, prepareSandboxRuntime, resolveRaxcellBinaryPath, sandboxRuntimeProviderDescriptor, } from "../runtimeImplementation/runtime.sandboxPlane/sandboxRuntimeProvider.js";
57
+ export { createRaxcellSandboxProvider, mapSandboxProviderRequestToRaxcell, raxcellSandboxProviderDescriptor, } from "../runtimeImplementation/runtime.sandboxPlane/raxcellSandboxProvider.js";
58
+ export { runSandboxPolicyMiddleware, sandboxPolicyMiddlewareDescriptor, } from "../runtimeImplementation/runtime.sandboxPlane/sandboxPolicyMiddleware.js";
53
59
  export { approvalInterfaceEnvelope, createInterfaceEnvelope, eventInterfaceEnvelope, managementInterfaceEnvelope, repairInterfaceEnvelope, stateInterfaceEnvelope, } from "../interfaceAdapter/interfaceEnvelope.js";
54
60
  export { bindBasicInterfaceLayer, } from "../runtimeImplementation/runtime.interfaceAdapter/bindBasicInterfaceLayer.js";
55
61
  export { createInterfaceAdapterRuntime, } from "../runtimeImplementation/runtime.interfaceAdapter/interfaceAdapterRuntime.js";
@@ -212,12 +218,18 @@ export const dependencyPlane = Object.freeze({
212
218
  probeDependency,
213
219
  });
214
220
  export const sandboxPlane = Object.freeze({
221
+ createRaxcellSandboxProvider,
215
222
  createSandboxCommandPlan,
216
223
  createLocalSandboxRemoteWorkerAdapter,
217
224
  createSandboxRuntimeProvider,
225
+ mapSandboxProviderRequestToRaxcell,
218
226
  prepareSandboxRuntime,
227
+ resolveRaxcellBinaryPath,
228
+ runSandboxPolicyMiddleware,
219
229
  runSandboxCommand,
230
+ raxcellSandboxProviderDescriptor,
220
231
  sandboxCommandRunnerDescriptor,
232
+ sandboxPolicyMiddlewareDescriptor,
221
233
  sandboxRuntimeProviderDescriptor,
222
234
  });
223
235
  export const interfaceAdapter = Object.freeze({
@@ -1,4 +1,5 @@
1
1
  import type { BaseToolProfileName } from "../basetool/types.js";
2
+ import type { McpApplicationStateView } from "../runtimeImplementation/runtime.mcpPlane/index.js";
2
3
  export type PraxisApplicationRuntimeMode = "dry-run" | "live";
3
4
  export type PraxisApplicationToolProfile = BaseToolProfileName;
4
5
  export type PraxisApplicationPermissionProfile = "restricted" | "standard" | "permissive" | "yolo" | "bapr";
@@ -157,6 +158,7 @@ export type PraxisApplicationViewModel = {
157
158
  approvals: readonly PraxisApplicationApprovalSummary[];
158
159
  manifest?: PraxisApplicationManifestView;
159
160
  tools: PraxisApplicationToolCatalogState;
161
+ mcp: McpApplicationStateView;
160
162
  counters: {
161
163
  turns: number;
162
164
  events: number;
@@ -1,4 +1,5 @@
1
- import { type AgentManifest, type BaseToolExecutorPort, type AgentToolCallProgressEvent, type RuntimeApprovalResolver, type RuntimeAgentReviewResolver, type RuntimeAuthResolver, type RuntimeAuthResolverRequest, type CompactExecutor, type PreCompactGovernanceExecutor, type PraxisProjectRuntime } from "../agentCore/index.js";
1
+ import { type AgentManifest, type BaseToolExecutorPort, type AgentToolCallProgressEvent, type RuntimeApprovalResolver, type RuntimeAgentReviewResolver, type RuntimeAuthResolver, type RuntimeAuthResolverRequest, type SandboxExecutionProviderPort, type CompactExecutor, type PreCompactGovernanceExecutor, type PraxisProjectRuntime } from "../agentCore/index.js";
2
+ import { type McpApplicationServerInput, type McpHarnessModuleSpec, type McpPlusApplicationServerInput } from "../runtimeImplementation/runtime.mcpPlane/index.js";
2
3
  import { type OpenAIV1ResponsesProviderCaller, type OpenAIV1ResponsesResult } from "../modelAdapter/actualInvocationLayer/openai/v1_responses.js";
3
4
  import type { OpenAiV1ChatCompletionsProviderCaller } from "../modelAdapter/actualInvocationLayer/openai/v1_chat_completions.js";
4
5
  import type { AnthropicV1MessagesProviderCaller } from "../modelAdapter/actualInvocationLayer/anthropic/v1_messages.js";
@@ -66,10 +67,14 @@ export type PraxisApplicationRuntimeOptions = {
66
67
  permissionProfile?: PraxisApplicationPermissionProfile;
67
68
  toolProfile?: PraxisApplicationToolProfile;
68
69
  agentOptions?: unknown;
70
+ sandboxProvider?: SandboxExecutionProviderPort;
69
71
  approvalResolver?: RuntimeApprovalResolver;
70
72
  agentReviewResolver?: RuntimeAgentReviewResolver;
71
73
  contextArtifactAdapters?: Pick<Partial<BaseToolExecutorPort>, "context" | "artifact">;
72
74
  baseToolAdapters?: Partial<BaseToolExecutorPort>;
75
+ mcpServers?: readonly McpApplicationServerInput[];
76
+ mcpPlusServers?: readonly McpPlusApplicationServerInput[];
77
+ mcpModule?: McpHarnessModuleSpec;
73
78
  onApplicationToolEvent?: (event: PraxisApplicationEvent) => void | Promise<void>;
74
79
  initialConversations?: readonly PraxisApplicationInitialConversation[];
75
80
  foundationProject?: PraxisProjectRuntime;
@@ -6,6 +6,7 @@ import path from "node:path";
6
6
  import { pathToFileURL } from "node:url";
7
7
  import { mkdir, readFile, writeFile } from "node:fs/promises";
8
8
  import { praxis, } from "../agentCore/index.js";
9
+ import { createMcpApplicationStateView, toMcpRuntimeServerProfile, } from "../runtimeImplementation/runtime.mcpPlane/index.js";
9
10
  import { invokeOpenAIV1Responses, } from "../modelAdapter/actualInvocationLayer/openai/v1_responses.js";
10
11
  import { invokeChatGPTCodexResponses } from "../modelAdapter/actualInvocationLayer/openai/chatgpt_codex_responses.js";
11
12
  import { createInMemoryMultiagentRuntime, } from "../runtimeImplementation/runtime.multiagentPlane/index.js";
@@ -2549,11 +2550,37 @@ function summarizeRunUsage(result) {
2549
2550
  }
2550
2551
  return summary.modelCalls > 0 ? summary : undefined;
2551
2552
  }
2553
+ function createApplicationMcpModule(options) {
2554
+ if (options.mcpModule !== undefined)
2555
+ return options.mcpModule;
2556
+ const nativeServers = (options.mcpServers ?? []).map((server) => ({
2557
+ ...server,
2558
+ mode: server.mode ?? "native",
2559
+ }));
2560
+ const plusServers = (options.mcpPlusServers ?? []).map((server) => ({
2561
+ ...server,
2562
+ mode: "mcp-plus",
2563
+ }));
2564
+ const servers = [...nativeServers, ...plusServers];
2565
+ if (servers.length === 0)
2566
+ return undefined;
2567
+ return {
2568
+ kind: "praxis.mcp.module",
2569
+ version: "praxis.mcp.v1",
2570
+ servers,
2571
+ recommended: true,
2572
+ metadata: { source: "application.mcp.options" },
2573
+ };
2574
+ }
2575
+ function applicationMcpServerProfiles(module) {
2576
+ return (module?.servers ?? []).map(toMcpRuntimeServerProfile);
2577
+ }
2552
2578
  export function createPraxisApplicationRuntime(options) {
2553
2579
  const now = options.now ?? defaultNow;
2554
2580
  const listeners = new Set();
2555
2581
  const project = options.project;
2556
2582
  const applicationId = options.applicationId ?? project.applicationId;
2583
+ const applicationMcpModule = createApplicationMcpModule(options);
2557
2584
  const state = {
2558
2585
  status: "idle",
2559
2586
  sessionId: options.sessionId ?? `session.${applicationId}.default`,
@@ -2602,6 +2629,7 @@ export function createPraxisApplicationRuntime(options) {
2602
2629
  multiagentActiveSessions: 1,
2603
2630
  multiagentBackgroundRuns: new Set(),
2604
2631
  auth: undefined,
2632
+ mcp: createMcpApplicationStateView(applicationMcpModule),
2605
2633
  };
2606
2634
  async function refreshAuthState() {
2607
2635
  const next = await options.authStateProvider?.({
@@ -2809,12 +2837,14 @@ export function createPraxisApplicationRuntime(options) {
2809
2837
  exposeProviderTools: true,
2810
2838
  approvalResolver: approvalResolverForRun(),
2811
2839
  agentReviewResolver: options.agentReviewResolver,
2840
+ mcpServers: applicationMcpServerProfiles(applicationMcpModule),
2841
+ mcpModule: applicationMcpModule,
2812
2842
  storage: {
2813
2843
  cwd: childSession.workingDirectory,
2814
2844
  workspaceRoot: path.join(project.projectRoot, ".raxode"),
2815
2845
  initMode: "on-run",
2816
2846
  },
2817
- sandbox: { cwd: childSession.workingDirectory },
2847
+ sandbox: { cwd: childSession.workingDirectory, provider: options.sandboxProvider },
2818
2848
  baseToolAdapters: {
2819
2849
  agent: multiagentAgentAdapter(),
2820
2850
  ...(options.contextArtifactAdapters ?? {}),
@@ -2946,6 +2976,7 @@ export function createPraxisApplicationRuntime(options) {
2946
2976
  : "input budget: unknown",
2947
2977
  `permission: ${state.permissionProfile}`,
2948
2978
  `tool profile: ${state.toolProfile}`,
2979
+ `mcp servers: ${state.mcp.servers.length}`,
2949
2980
  `workspace: ${state.cwd}`,
2950
2981
  `tools: ${summarizeToolCatalog(state.manifest, state.toolProfile).mounted}/${summarizeToolCatalog(state.manifest, state.toolProfile).total}`,
2951
2982
  state.finalOutput ? `final: ${state.finalOutput}` : `status: ${state.status}`,
@@ -2976,6 +3007,7 @@ export function createPraxisApplicationRuntime(options) {
2976
3007
  approvals: [...state.approvals.values()].sort((left, right) => right.updatedAt.localeCompare(left.updatedAt)),
2977
3008
  manifest: summarizeManifest(state.manifest),
2978
3009
  tools: summarizeToolCatalog(state.manifest, state.toolProfile),
3010
+ mcp: state.mcp,
2979
3011
  counters: {
2980
3012
  turns: state.turns,
2981
3013
  events: state.events.length,
@@ -3170,7 +3202,7 @@ export function createPraxisApplicationRuntime(options) {
3170
3202
  workspaceRoot: path.join(project.projectRoot, ".raxode"),
3171
3203
  initMode: "on-run",
3172
3204
  },
3173
- sandbox: { cwd: state.cwd },
3205
+ sandbox: { cwd: state.cwd, provider: options.sandboxProvider },
3174
3206
  now,
3175
3207
  }),
3176
3208
  timeoutMs,
@@ -3432,12 +3464,14 @@ export function createPraxisApplicationRuntime(options) {
3432
3464
  compactThresholdRatio: options.compactThresholdRatio,
3433
3465
  approvalResolver: approvalResolverForRun(),
3434
3466
  agentReviewResolver: options.agentReviewResolver,
3467
+ mcpServers: applicationMcpServerProfiles(applicationMcpModule),
3468
+ mcpModule: applicationMcpModule,
3435
3469
  storage: {
3436
3470
  cwd: state.cwd,
3437
3471
  workspaceRoot: path.join(project.projectRoot, ".raxode"),
3438
3472
  initMode: "on-run",
3439
3473
  },
3440
- sandbox: { cwd: state.cwd },
3474
+ sandbox: { cwd: state.cwd, provider: options.sandboxProvider },
3441
3475
  baseToolAdapters: {
3442
3476
  agent: multiagentAgentAdapter(),
3443
3477
  ...(options.contextArtifactAdapters ?? {}),
@@ -1,4 +1,5 @@
1
1
  export type { PraxisApplicationAttachment, PraxisApplicationAgentEntryView, PraxisApplicationAuxiliaryTaskInput, PraxisApplicationAuthProfileView, PraxisApplicationAuthState, PraxisApplicationCommand, PraxisApplicationCommandResult, PraxisApplicationContextTelemetry, PraxisApplicationEvent, PraxisApplicationEventKind, PraxisApplicationInputEnvelope, PraxisApplicationManifestView, PraxisApplicationModelState, PraxisApplicationPermissionProfile, PraxisApplicationReasoningEffort, PraxisApplicationRuntime, PraxisApplicationRuntimeMode, PraxisApplicationStatus, PraxisApplicationToolCatalogState, PraxisApplicationToolProfile, PraxisApplicationUsageTelemetry, PraxisApplicationViewModel, } from "./applicationContract.js";
2
2
  export { loadApplicationProject, type PraxisApplicationProject, type PraxisApplicationProjectDescriptor, type PraxisApplicationProjectResult, } from "./applicationProject.js";
3
3
  export { createApplicationProjectRuntime, createPraxisApplicationRuntime, type PraxisApplicationBaseToolIntegrationOptions, type CreateApplicationProjectRuntimeOptions, type PraxisApplicationInitialConversation, type PraxisApplicationInitialConversationMessage, type PraxisApplicationLiveProvider, type PraxisApplicationRuntimeOptions, } from "./applicationRuntime.js";
4
+ export type { McpApplicationServerInput, McpPlusApplicationServerInput, } from "../runtimeImplementation/runtime.mcpPlane/index.js";
4
5
  export { createApplicationRestServer, createApplicationWebSocketServer, createLocalApplicationTransport, describeApplicationRestTransport, describeApplicationWebSocketTransport, type PraxisApplicationRestServer, type PraxisApplicationWebSocketServer, type PraxisApplicationProtocolMessage, type PraxisApplicationRestRoute, type PraxisApplicationTransportClient, type PraxisApplicationTransportDescriptor, type PraxisApplicationTransportKind, type PraxisApplicationWebSocketMessage, } from "./applicationTransport.js";
@@ -16,7 +16,12 @@ export async function invokeShellRunCore(definition, request) {
16
16
  const run = namespaceMethod(definition, request, "shell", "run");
17
17
  if (!run.ok)
18
18
  return run.result;
19
- return callRuntimePort(definition, run.value(compactRecord({ command: command.value, cwd: cwd.value, timeoutMs: timeoutMs.value })), {
19
+ return callRuntimePort(definition, run.value(compactRecord({
20
+ command: command.value,
21
+ cwd: cwd.value,
22
+ timeoutMs: timeoutMs.value,
23
+ context: input.value.context,
24
+ })), {
20
25
  portPath: "shell.run",
21
26
  metadata: { command: command.value, cwd: cwd.value },
22
27
  });
@@ -138,6 +138,33 @@ async function pathExists(pathname) {
138
138
  return false;
139
139
  }
140
140
  }
141
+ async function findProjectRootForAgent(agentPath) {
142
+ let current = path.dirname(path.resolve(agentPath));
143
+ while (true) {
144
+ if (await pathExists(path.join(current, "rax.project.json")) || await pathExists(path.join(current, "package.json"))) {
145
+ return current;
146
+ }
147
+ const parent = path.dirname(current);
148
+ if (parent === current) {
149
+ return undefined;
150
+ }
151
+ current = parent;
152
+ }
153
+ }
154
+ async function isFrameworkDependencyMissing(projectRoot) {
155
+ const packageJsonPath = path.join(projectRoot, "package.json");
156
+ if (!await pathExists(packageJsonPath)) {
157
+ return false;
158
+ }
159
+ const packageJson = JSON.parse(await readFile(packageJsonPath, "utf8"));
160
+ const declaresFramework = packageJson.dependencies?.["@praxis-ai/praxis"] !== undefined
161
+ || packageJson.devDependencies?.["@praxis-ai/praxis"] !== undefined
162
+ || packageJson.peerDependencies?.["@praxis-ai/praxis"] !== undefined;
163
+ if (!declaresFramework) {
164
+ return false;
165
+ }
166
+ return !await pathExists(path.join(projectRoot, "node_modules", "@praxis-ai", "praxis", "package.json"));
167
+ }
141
168
  async function resolveAgentEntry(inputPath, exportName) {
142
169
  const absolute = path.resolve(inputPath);
143
170
  const info = await stat(absolute);
@@ -171,7 +198,7 @@ async function resolveProjectAgentEntry(inputPath, exportName) {
171
198
  const absolute = path.resolve(inputPath);
172
199
  const info = await stat(absolute);
173
200
  if (!info.isDirectory()) {
174
- return { agentPath: absolute, exportName };
201
+ return { agentPath: absolute, exportName, projectRoot: await findProjectRootForAgent(absolute) };
175
202
  }
176
203
  const resolved = await resolveAgentEntry(inputPath, exportName);
177
204
  return { ...resolved, projectRoot: absolute };
@@ -777,6 +804,20 @@ async function handleInspectTestRun(command, args) {
777
804
  if (!plan.ok) {
778
805
  return { exitCode: 1, output: `${plan.error.message}\n` };
779
806
  }
807
+ if (resolvedEntry?.projectRoot !== undefined && await isFrameworkDependencyMissing(resolvedEntry.projectRoot)) {
808
+ return {
809
+ exitCode: 1,
810
+ output: [
811
+ `rax ${command} could not load ${agentPath}`,
812
+ "project dependency @praxis-ai/praxis is declared but not installed",
813
+ "self-repair hints:",
814
+ " - run npm install in the generated agent project",
815
+ " - verify @praxis-ai/praxis is installed or linked",
816
+ " - rerun rax inspect after the issue is fixed",
817
+ "",
818
+ ].join("\n"),
819
+ };
820
+ }
780
821
  let compiled;
781
822
  try {
782
823
  compiled = await compileAgentFile(resolvedEntry?.agentPath ?? agentPath, resolvedEntry?.exportName ?? exportName);
@@ -21,6 +21,9 @@ import type { ToolDependencyProbe } from "./runtime.execEngine/baseToolDependenc
21
21
  import { type RuntimeApprovalRecord, type RuntimeSessionSnapshot, type RuntimeSessionStateEventStore } from "./runtimeSessionStateEventStore.js";
22
22
  import { type RaxStorageInitMode } from "./runtime.storagePlane/storagePlaneRuntime.js";
23
23
  import type { SandboxRemoteWorkerAdapter } from "./runtime.sandboxPlane/sandboxCommandRunner.js";
24
+ import type { SandboxExecutionProviderPort } from "./runtime.sandboxPlane/sandboxPolicyMiddleware.js";
25
+ import { type McpHarnessModuleSpec } from "./runtime.mcpPlane/index.js";
26
+ import type { McpRuntimeServerProfile } from "./runtime.execEngine/mcpRuntimeAdapter.js";
24
27
  export type PraxisRuntimeKernelErrorCode = "MANIFEST_COMPILE_FAILED" | "TEXT_INPUT_REJECTED" | "PROMPT_PACK_FAILED" | "MAIN_LOOP_INTERRUPTED" | "MODEL_INVOCATION_FAILED" | "MODEL_DECISION_FAILED" | "TOOL_INVOCATION_FAILED" | "PROCEDURE_INVOCATION_FAILED" | "APPROVAL_REQUIRED" | "SANDBOX_UNAVAILABLE" | "STORAGE_RESOLUTION_FAILED" | "TEXT_OUTPUT_REJECTED";
25
28
  export type PraxisRuntimeKernelError = {
26
29
  code: PraxisRuntimeKernelErrorCode;
@@ -47,6 +50,8 @@ export type PraxisRuntimeKernelOptions = {
47
50
  };
48
51
  executor?: BaseToolExecutorPort;
49
52
  baseToolAdapters?: Partial<BaseToolExecutorPort>;
53
+ mcpServers?: readonly McpRuntimeServerProfile[];
54
+ mcpModule?: McpHarnessModuleSpec;
50
55
  baseToolPolicy?: RuntimeBaseToolExecutorPolicy;
51
56
  baseToolResourceLimits?: RuntimeBaseToolExecutorResourceLimits;
52
57
  store?: RuntimeSessionStateEventStore;
@@ -85,6 +90,7 @@ export type PraxisRuntimeKernelOptions = {
85
90
  cwd?: string;
86
91
  runSmoke?: boolean;
87
92
  failOnUnavailable?: boolean;
93
+ provider?: SandboxExecutionProviderPort;
88
94
  remoteWorker?: SandboxRemoteWorkerAdapter;
89
95
  };
90
96
  onTextDelta?: (delta: string, metadata?: Readonly<Record<string, unknown>>) => void | Promise<void>;