@praxis-ai/praxis 0.1.1 → 0.1.3
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 +13 -1
- package/dist/applicationLayer/applicationRuntime.js +39 -3
- package/dist/applicationLayer/index.d.ts +2 -0
- package/dist/applicationLayer/index.js +1 -0
- package/dist/basetool/core/shellRun.js +6 -1
- package/dist/rax_packageManager/raxCli.js +42 -1
- package/dist/runtimeImplementation/praxisRuntimeKernel.d.ts +13 -0
- package/dist/runtimeImplementation/praxisRuntimeKernel.js +550 -15
- 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 +225 -0
- package/dist/runtimeImplementation/runtime.mcpPlane/index.js +549 -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
|
@@ -9,8 +9,8 @@ export const officialRuntimeComponents = [
|
|
|
9
9
|
{
|
|
10
10
|
componentId: "component.sandbox.bubblewrap",
|
|
11
11
|
kind: "sandbox",
|
|
12
|
-
title: "Linux
|
|
13
|
-
dependencies: [dependency("dependency.binary.
|
|
12
|
+
title: "Linux Raxcell sandbox provider",
|
|
13
|
+
dependencies: [dependency("dependency.binary.raxcell", { kind: "binary", required: true })],
|
|
14
14
|
fallbackComponentIds: ["component.sandbox.workspaceRollback"],
|
|
15
15
|
supportedPlatforms: ["linux"],
|
|
16
16
|
},
|
|
@@ -10,7 +10,7 @@ export type DependencySourceRegistry = {
|
|
|
10
10
|
sources: readonly DependencySource[];
|
|
11
11
|
warnings: readonly string[];
|
|
12
12
|
};
|
|
13
|
-
export declare const officialDependencySources: readonly [DependencySource, DependencySource, DependencySource, DependencySource, DependencySource, DependencySource, DependencySource, DependencySource, DependencySource, DependencySource, DependencySource, DependencySource, DependencySource, DependencySource, DependencySource, DependencySource, DependencySource, DependencySource, DependencySource, DependencySource, DependencySource, DependencySource];
|
|
13
|
+
export declare const officialDependencySources: readonly [DependencySource, DependencySource, DependencySource, DependencySource, DependencySource, DependencySource, DependencySource, DependencySource, DependencySource, DependencySource, DependencySource, DependencySource, DependencySource, DependencySource, DependencySource, DependencySource, DependencySource, DependencySource, DependencySource, DependencySource, DependencySource, DependencySource, DependencySource];
|
|
14
14
|
export declare function defaultManagedRoot(input?: {
|
|
15
15
|
raxToolDepsRoot?: string;
|
|
16
16
|
env?: Readonly<Record<string, string | undefined>>;
|
|
@@ -125,6 +125,18 @@ export const officialDependencySources = [
|
|
|
125
125
|
executableName: "rg",
|
|
126
126
|
versionCommand: { command: "rg", args: ["--version"] },
|
|
127
127
|
}),
|
|
128
|
+
source({
|
|
129
|
+
dependencyId: "dependency.binary.raxcell",
|
|
130
|
+
sourceId: "official:detect:raxcell",
|
|
131
|
+
displayName: "Raxcell sandbox provider",
|
|
132
|
+
kind: "binary",
|
|
133
|
+
safety: "trusted-detect-only",
|
|
134
|
+
packageManager: "detect-only",
|
|
135
|
+
executableName: "raxcell",
|
|
136
|
+
versionCommand: { command: "raxcell", args: ["--version"] },
|
|
137
|
+
supportedPlatforms: ["linux"],
|
|
138
|
+
installInstructions: "Install @praxis-ai/raxcell with Praxis/Raxode, or set RAXCELL_BIN to an explicit provider binary path.",
|
|
139
|
+
}),
|
|
128
140
|
source({
|
|
129
141
|
dependencyId: "dependency.binary.bwrap",
|
|
130
142
|
sourceId: "official:detect:bwrap",
|
|
@@ -7,6 +7,7 @@ export function canonicalDependencyId(input) {
|
|
|
7
7
|
const value = input.trim();
|
|
8
8
|
const legacy = {
|
|
9
9
|
"binary:bwrap": "dependency.binary.bwrap",
|
|
10
|
+
"binary:raxcell": "dependency.binary.raxcell",
|
|
10
11
|
"binary:podman|docker": "dependency.binary.podmanOrDocker",
|
|
11
12
|
"windows:Windows-Sandbox": "dependency.windows.sandbox",
|
|
12
13
|
"macos:containerization": "dependency.macos.containerization",
|
|
@@ -60,6 +61,7 @@ export function legacyDependencyIds(input) {
|
|
|
60
61
|
const canonical = canonicalDependencyId(input);
|
|
61
62
|
const reverse = {
|
|
62
63
|
"dependency.binary.bwrap": ["binary:bwrap"],
|
|
64
|
+
"dependency.binary.raxcell": ["binary:raxcell"],
|
|
63
65
|
"dependency.binary.podmanOrDocker": ["binary:podman|docker"],
|
|
64
66
|
"dependency.windows.sandbox": ["windows:Windows-Sandbox"],
|
|
65
67
|
"dependency.macos.containerization": ["macos:containerization"],
|
|
@@ -2,6 +2,7 @@ import type { BaseToolExecutorPort } from "../../basetool/types.js";
|
|
|
2
2
|
import { type BaseToolPolicyProfile, type SandboxSpec } from "../runtimeAgentManifest.js";
|
|
3
3
|
import type { SandboxRuntimePrepareResult } from "../runtime.sandboxPlane/sandboxRuntimeProvider.js";
|
|
4
4
|
import { type SandboxRemoteWorkerAdapter } from "../runtime.sandboxPlane/sandboxCommandRunner.js";
|
|
5
|
+
import type { SandboxExecutionProviderPort, SandboxPolicyMiddlewareAuditEvent } from "../runtime.sandboxPlane/sandboxPolicyMiddleware.js";
|
|
5
6
|
import { type McpRuntimeServerProfile } from "./mcpRuntimeAdapter.js";
|
|
6
7
|
export type RuntimeBaseToolExecutorEvent = {
|
|
7
8
|
type: string;
|
|
@@ -60,6 +61,8 @@ export type RuntimeBaseToolExecutorContext = {
|
|
|
60
61
|
sandboxSpec?: SandboxSpec;
|
|
61
62
|
preparedSandbox?: SandboxRuntimePrepareResult;
|
|
62
63
|
policyProfile?: BaseToolPolicyProfile;
|
|
64
|
+
sandboxProvider?: SandboxExecutionProviderPort;
|
|
65
|
+
sandboxAudit?: (event: SandboxPolicyMiddlewareAuditEvent) => Promise<void> | void;
|
|
63
66
|
remoteSandboxWorker?: SandboxRemoteWorkerAdapter;
|
|
64
67
|
mcpServers?: readonly McpRuntimeServerProfile[];
|
|
65
68
|
environment?: Readonly<Record<string, string | undefined>>;
|
|
@@ -159,8 +159,6 @@ function legacyPreparedSandbox(value) {
|
|
|
159
159
|
}
|
|
160
160
|
function sandboxModeForContext(context) {
|
|
161
161
|
const profile = policyProfileForContext(context);
|
|
162
|
-
if (profile === "bapr")
|
|
163
|
-
return "none";
|
|
164
162
|
const explicitProviderFamily = context.sandboxSpec?.providerFamily ?? context.sandbox?.providerFamily;
|
|
165
163
|
const prepared = context.preparedSandbox ?? legacyPreparedSandbox(context.sandbox);
|
|
166
164
|
if (strongSandboxFamily(explicitProviderFamily)) {
|
|
@@ -314,6 +312,10 @@ async function runCommand(context, command, args = [], cwd, input = {}) {
|
|
|
314
312
|
if (!resolvedCwd.ok)
|
|
315
313
|
return resolvedCwd;
|
|
316
314
|
const commandCwd = String(resolvedCwd.output);
|
|
315
|
+
const root = workspaceRoot(context);
|
|
316
|
+
const approvedWriteRoots = input.approved === true
|
|
317
|
+
? context.policy?.allowedWriteRoots ?? [root]
|
|
318
|
+
: context.policy?.allowedWriteRoots;
|
|
317
319
|
if (spec !== undefined) {
|
|
318
320
|
const result = await runSandboxCommand({
|
|
319
321
|
runtimeId: context.runtimeId,
|
|
@@ -331,13 +333,17 @@ async function runCommand(context, command, args = [], cwd, input = {}) {
|
|
|
331
333
|
policyProfile: profile,
|
|
332
334
|
sandboxMode: sandboxModeForContext(context),
|
|
333
335
|
filesystem: {
|
|
334
|
-
workspaceRoot:
|
|
335
|
-
allowedReadRoots: context.policy?.allowedRoots ?? [
|
|
336
|
-
...(
|
|
336
|
+
workspaceRoot: root,
|
|
337
|
+
allowedReadRoots: context.policy?.allowedRoots ?? [root],
|
|
338
|
+
...(approvedWriteRoots === undefined ? {} : { allowedWriteRoots: approvedWriteRoots }),
|
|
339
|
+
...(input.approved === true ? { readonlyRoot: false } : {}),
|
|
337
340
|
},
|
|
338
341
|
network: input.network,
|
|
342
|
+
approval: input.approved === true ? { accepted: true, grantedBy: "praxis-human-approval" } : undefined,
|
|
339
343
|
}, {
|
|
340
344
|
remoteWorker: context.remoteSandboxWorker,
|
|
345
|
+
sandboxProvider: context.sandboxProvider,
|
|
346
|
+
audit: context.sandboxAudit,
|
|
341
347
|
});
|
|
342
348
|
if (!result.ok) {
|
|
343
349
|
return fail(result.error.code, result.error.message, {
|
|
@@ -423,6 +429,7 @@ function createShellExecutor(context) {
|
|
|
423
429
|
invocationId: typeof request?.toolCallId === "string" ? request.toolCallId : undefined,
|
|
424
430
|
shellScript: true,
|
|
425
431
|
timeoutMs: typeof request?.timeoutMs === "number" ? request.timeoutMs : undefined,
|
|
432
|
+
approved: approvedByRuntimeContext(request?.context),
|
|
426
433
|
});
|
|
427
434
|
}),
|
|
428
435
|
};
|
|
@@ -436,6 +443,7 @@ function createProcessExecutor(context) {
|
|
|
436
443
|
toolId: "process.run",
|
|
437
444
|
invocationId: typeof request?.toolCallId === "string" ? request.toolCallId : undefined,
|
|
438
445
|
timeoutMs: typeof request?.timeoutMs === "number" ? request.timeoutMs : undefined,
|
|
446
|
+
approved: approvedByRuntimeContext(request?.context),
|
|
439
447
|
});
|
|
440
448
|
}),
|
|
441
449
|
wait: withAdapter(context, "process", "wait", async (request) => {
|
|
@@ -630,7 +638,22 @@ function createMcpExecutor(context) {
|
|
|
630
638
|
const configured = context.mcpServers !== undefined && context.mcpServers.length > 0
|
|
631
639
|
? createMcpRuntimeAdapter({ servers: context.mcpServers })
|
|
632
640
|
: undefined;
|
|
633
|
-
const base = configured ?? createUnavailableNamespace("mcp", [
|
|
641
|
+
const base = configured ?? createUnavailableNamespace("mcp", [
|
|
642
|
+
"connect",
|
|
643
|
+
"ping",
|
|
644
|
+
"listTools",
|
|
645
|
+
"call",
|
|
646
|
+
"stream",
|
|
647
|
+
"listResources",
|
|
648
|
+
"readResource",
|
|
649
|
+
"listPrompts",
|
|
650
|
+
"getPrompt",
|
|
651
|
+
"setRoots",
|
|
652
|
+
"reportProgress",
|
|
653
|
+
"createSamplingMessage",
|
|
654
|
+
"elicit",
|
|
655
|
+
"setLoggingLevel",
|
|
656
|
+
]);
|
|
634
657
|
const callTool = base.callTool ?? base.call;
|
|
635
658
|
const streamTool = base.streamTool ?? base.stream;
|
|
636
659
|
return {
|
|
@@ -643,7 +666,21 @@ function createMcpExecutor(context) {
|
|
|
643
666
|
export function listRuntimeBaseToolImplementedPortPaths(context = {}) {
|
|
644
667
|
const ports = new Set(baseToolExecutorPortFactoryDescriptor.implementedAdapters);
|
|
645
668
|
if (context.mcpServers !== undefined && context.mcpServers.length > 0) {
|
|
646
|
-
for (const portPath of [
|
|
669
|
+
for (const portPath of [
|
|
670
|
+
"mcp.connect",
|
|
671
|
+
"mcp.call",
|
|
672
|
+
"mcp.callTool",
|
|
673
|
+
"mcp.listTools",
|
|
674
|
+
"mcp.listResources",
|
|
675
|
+
"mcp.readResource",
|
|
676
|
+
"mcp.listPrompts",
|
|
677
|
+
"mcp.getPrompt",
|
|
678
|
+
"mcp.setRoots",
|
|
679
|
+
"mcp.reportProgress",
|
|
680
|
+
"mcp.createSamplingMessage",
|
|
681
|
+
"mcp.elicit",
|
|
682
|
+
"mcp.setLoggingLevel",
|
|
683
|
+
]) {
|
|
647
684
|
ports.add(portPath);
|
|
648
685
|
}
|
|
649
686
|
}
|
|
@@ -694,6 +731,7 @@ export function createRuntimeBaseToolExecutorPort(context) {
|
|
|
694
731
|
toolId: typeof request?.toolId === "string" ? request.toolId : "sandbox.run",
|
|
695
732
|
invocationId: typeof request?.invocationId === "string" ? request.invocationId : undefined,
|
|
696
733
|
network: request?.network === "allow" ? "allow" : undefined,
|
|
734
|
+
approved: approvedByRuntimeContext(request?.context),
|
|
697
735
|
});
|
|
698
736
|
}),
|
|
699
737
|
},
|
|
@@ -324,6 +324,62 @@ export function createMcpRuntimeAdapter(options) {
|
|
|
324
324
|
})) : [];
|
|
325
325
|
return success({ uri: requestInput.resourceUri, contents, truncated: false, providerMetadata: metadata(connected.output.profile, { method: "resources/read" }), raw: read.output });
|
|
326
326
|
},
|
|
327
|
+
async listPrompts(requestInput) {
|
|
328
|
+
const connected = await getConnection(requestInput.serverId);
|
|
329
|
+
if (!connected.ok)
|
|
330
|
+
return connected;
|
|
331
|
+
const listed = await request(connected.output, "prompts/list", requestInput.cursor === undefined ? {} : { cursor: requestInput.cursor });
|
|
332
|
+
if (!listed.ok)
|
|
333
|
+
return listed;
|
|
334
|
+
const raw = resultObject(listed.output);
|
|
335
|
+
const prompts = Array.isArray(raw.prompts) ? raw.prompts.filter(isObject).map((prompt) => ({
|
|
336
|
+
name: String(prompt.name ?? ""),
|
|
337
|
+
title: typeof prompt.title === "string" ? prompt.title : undefined,
|
|
338
|
+
description: typeof prompt.description === "string" ? prompt.description : undefined,
|
|
339
|
+
arguments: Array.isArray(prompt.arguments) ? prompt.arguments : undefined,
|
|
340
|
+
raw: prompt,
|
|
341
|
+
})).filter((prompt) => prompt.name.length > 0) : [];
|
|
342
|
+
return success({ prompts, nextCursor: typeof raw.nextCursor === "string" ? raw.nextCursor : undefined, providerMetadata: metadata(connected.output.profile, { method: "prompts/list" }), raw: listed.output });
|
|
343
|
+
},
|
|
344
|
+
async getPrompt(requestInput) {
|
|
345
|
+
const connected = await getConnection(requestInput.serverId);
|
|
346
|
+
if (!connected.ok)
|
|
347
|
+
return connected;
|
|
348
|
+
const read = await request(connected.output, "prompts/get", { name: requestInput.name, arguments: requestInput.arguments ?? {} });
|
|
349
|
+
if (!read.ok)
|
|
350
|
+
return read;
|
|
351
|
+
return success(read.output, metadata(connected.output.profile, { method: "prompts/get", promptName: requestInput.name }));
|
|
352
|
+
},
|
|
353
|
+
async setRoots(requestInput) {
|
|
354
|
+
const profile = getProfile(requestInput.serverId);
|
|
355
|
+
if (profile === undefined)
|
|
356
|
+
return failure("MCP_SERVER_NOT_CONFIGURED", `MCP server '${requestInput.serverId}' is not configured.`);
|
|
357
|
+
return success({ serverId: requestInput.serverId, roots: requestInput.roots ?? [], status: "registered", providerMetadata: metadata(profile, { hostSemantic: "roots" }) });
|
|
358
|
+
},
|
|
359
|
+
async reportProgress(requestInput) {
|
|
360
|
+
const profile = getProfile(requestInput.serverId);
|
|
361
|
+
if (profile === undefined)
|
|
362
|
+
return failure("MCP_SERVER_NOT_CONFIGURED", `MCP server '${requestInput.serverId}' is not configured.`);
|
|
363
|
+
return success({ serverId: requestInput.serverId, progressToken: requestInput.progressToken, progress: requestInput.progress, total: requestInput.total, status: "reported", providerMetadata: metadata(profile, { hostSemantic: "progress" }) });
|
|
364
|
+
},
|
|
365
|
+
async createSamplingMessage(requestInput) {
|
|
366
|
+
const profile = getProfile(requestInput.serverId);
|
|
367
|
+
if (profile === undefined)
|
|
368
|
+
return failure("MCP_SERVER_NOT_CONFIGURED", `MCP server '${requestInput.serverId}' is not configured.`);
|
|
369
|
+
return success({ serverId: requestInput.serverId, status: "accepted", request: requestInput, providerMetadata: metadata(profile, { hostSemantic: "sampling" }) });
|
|
370
|
+
},
|
|
371
|
+
async elicit(requestInput) {
|
|
372
|
+
const profile = getProfile(requestInput.serverId);
|
|
373
|
+
if (profile === undefined)
|
|
374
|
+
return failure("MCP_SERVER_NOT_CONFIGURED", `MCP server '${requestInput.serverId}' is not configured.`);
|
|
375
|
+
return success({ serverId: requestInput.serverId, status: "pending", request: requestInput, providerMetadata: metadata(profile, { hostSemantic: "elicitation" }) });
|
|
376
|
+
},
|
|
377
|
+
async setLoggingLevel(requestInput) {
|
|
378
|
+
const profile = getProfile(requestInput.serverId);
|
|
379
|
+
if (profile === undefined)
|
|
380
|
+
return failure("MCP_SERVER_NOT_CONFIGURED", `MCP server '${requestInput.serverId}' is not configured.`);
|
|
381
|
+
return success({ serverId: requestInput.serverId, level: requestInput.level ?? "info", status: "configured", providerMetadata: metadata(profile, { hostSemantic: "logging" }) });
|
|
382
|
+
},
|
|
327
383
|
async createResource(requestInput) {
|
|
328
384
|
const profile = getProfile(requestInput.serverId);
|
|
329
385
|
if (profile === undefined)
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { type ExposureMode, type ExposureState, type McpCompatibleSurface, type McpPlusManifest, type NativeToolDeclaration } from "@praxis-ai/mcp-plus";
|
|
2
|
+
import type { ToolSpec } from "../runtimeAgentManifest.js";
|
|
3
|
+
import type { McpRuntimeServerProfile } from "../runtime.execEngine/mcpRuntimeAdapter.js";
|
|
4
|
+
export type McpHarnessServerMode = "native" | "mcp-plus";
|
|
5
|
+
export type McpTransportSpec = {
|
|
6
|
+
transport: "stdio";
|
|
7
|
+
command: string;
|
|
8
|
+
args?: readonly string[];
|
|
9
|
+
cwd?: string;
|
|
10
|
+
env?: Readonly<Record<string, string | undefined>>;
|
|
11
|
+
timeoutMs?: number;
|
|
12
|
+
framing?: "content-length" | "line-json";
|
|
13
|
+
} | {
|
|
14
|
+
transport: "http" | "sse";
|
|
15
|
+
url: string;
|
|
16
|
+
sseUrl?: string;
|
|
17
|
+
headers?: Readonly<Record<string, string>>;
|
|
18
|
+
timeoutMs?: number;
|
|
19
|
+
};
|
|
20
|
+
export type McpHarnessServerSpec = McpTransportSpec & {
|
|
21
|
+
serverId: string;
|
|
22
|
+
mode: McpHarnessServerMode;
|
|
23
|
+
title?: string;
|
|
24
|
+
summary?: string;
|
|
25
|
+
manifest?: McpPlusManifest;
|
|
26
|
+
metadata?: Readonly<Record<string, unknown>>;
|
|
27
|
+
};
|
|
28
|
+
export type McpApplicationServerInput = McpTransportSpec & {
|
|
29
|
+
serverId: string;
|
|
30
|
+
mode?: McpHarnessServerMode;
|
|
31
|
+
title?: string;
|
|
32
|
+
summary?: string;
|
|
33
|
+
manifest?: McpPlusManifest;
|
|
34
|
+
metadata?: Readonly<Record<string, unknown>>;
|
|
35
|
+
};
|
|
36
|
+
type HttpMcpHelperInput = {
|
|
37
|
+
url: string;
|
|
38
|
+
sseUrl?: string;
|
|
39
|
+
headers?: Readonly<Record<string, string>>;
|
|
40
|
+
timeoutMs?: number;
|
|
41
|
+
} & Partial<Pick<McpHarnessServerSpec, "mode" | "title" | "summary" | "manifest" | "metadata">>;
|
|
42
|
+
export type McpHarnessModuleSpec = {
|
|
43
|
+
kind: "praxis.mcp.module";
|
|
44
|
+
version: "praxis.mcp.v1";
|
|
45
|
+
servers: readonly McpHarnessServerSpec[];
|
|
46
|
+
recommended: true;
|
|
47
|
+
metadata?: Readonly<Record<string, unknown>>;
|
|
48
|
+
};
|
|
49
|
+
export type McpApplicationServerView = {
|
|
50
|
+
serverId: string;
|
|
51
|
+
mode: McpHarnessServerMode;
|
|
52
|
+
transport: McpHarnessServerSpec["transport"];
|
|
53
|
+
title?: string;
|
|
54
|
+
summary?: string;
|
|
55
|
+
manifestPresent: boolean;
|
|
56
|
+
status: "declared" | "mounted" | "error";
|
|
57
|
+
toolCount?: number;
|
|
58
|
+
visibleToolCount?: number;
|
|
59
|
+
indexedToolCount?: number;
|
|
60
|
+
publicSafe: true;
|
|
61
|
+
};
|
|
62
|
+
export type McpApplicationStateView = {
|
|
63
|
+
servers: readonly McpApplicationServerView[];
|
|
64
|
+
recommendedMode: "mcp-plus";
|
|
65
|
+
nativeCompatible: true;
|
|
66
|
+
publicSafe: true;
|
|
67
|
+
};
|
|
68
|
+
export type McpExposurePlanServer = {
|
|
69
|
+
serverId: string;
|
|
70
|
+
mode: McpHarnessServerMode;
|
|
71
|
+
surface: McpCompatibleSurface;
|
|
72
|
+
dynamicToolSpecs: readonly ToolSpec[];
|
|
73
|
+
};
|
|
74
|
+
export type McpHarnessExposurePlan = {
|
|
75
|
+
servers: readonly McpExposurePlanServer[];
|
|
76
|
+
};
|
|
77
|
+
export type McpPlusProfileProposal = {
|
|
78
|
+
serverId: string;
|
|
79
|
+
pinnedTools?: readonly string[];
|
|
80
|
+
warmTools?: readonly string[];
|
|
81
|
+
indexedTools?: readonly string[];
|
|
82
|
+
alwaysIndexTools?: readonly string[];
|
|
83
|
+
toolCards?: Readonly<Record<string, {
|
|
84
|
+
title?: string;
|
|
85
|
+
summary?: string;
|
|
86
|
+
keywords?: readonly string[];
|
|
87
|
+
}>>;
|
|
88
|
+
skillChapters?: readonly {
|
|
89
|
+
id: string;
|
|
90
|
+
title: string;
|
|
91
|
+
summary: string;
|
|
92
|
+
}[];
|
|
93
|
+
rationale?: string;
|
|
94
|
+
metadata?: Readonly<Record<string, unknown>>;
|
|
95
|
+
};
|
|
96
|
+
export type McpPlusLearnedProfile = {
|
|
97
|
+
schemaVersion: "mcp-plus.profile.v1";
|
|
98
|
+
serverId: string;
|
|
99
|
+
projectId: string;
|
|
100
|
+
exposure: NonNullable<McpPlusManifest["exposure"]>;
|
|
101
|
+
skills?: NonNullable<McpPlusManifest["skills"]>;
|
|
102
|
+
rationale?: string;
|
|
103
|
+
createdAt: string;
|
|
104
|
+
updatedAt: string;
|
|
105
|
+
metadata?: Readonly<Record<string, unknown>>;
|
|
106
|
+
};
|
|
107
|
+
export type McpPlusRuntimeOverlay = {
|
|
108
|
+
serverId: string;
|
|
109
|
+
sessionId: string;
|
|
110
|
+
mode: ExposureMode;
|
|
111
|
+
activeTools: readonly string[];
|
|
112
|
+
pendingReprofile?: boolean;
|
|
113
|
+
counters: {
|
|
114
|
+
consecutiveIndexedToolCalls: Readonly<Record<string, number>>;
|
|
115
|
+
};
|
|
116
|
+
updatedAt: string;
|
|
117
|
+
metadata?: Readonly<Record<string, unknown>>;
|
|
118
|
+
};
|
|
119
|
+
export type McpPlusProfileStoreKey = {
|
|
120
|
+
serverId: string;
|
|
121
|
+
projectId: string;
|
|
122
|
+
};
|
|
123
|
+
export type McpPlusOverlayStoreKey = {
|
|
124
|
+
serverId: string;
|
|
125
|
+
sessionId: string;
|
|
126
|
+
};
|
|
127
|
+
export type McpPlusProfileStore = {
|
|
128
|
+
load(key: McpPlusProfileStoreKey): Promise<McpPlusLearnedProfile | undefined>;
|
|
129
|
+
save(key: McpPlusProfileStoreKey, profile: McpPlusLearnedProfile): Promise<void>;
|
|
130
|
+
};
|
|
131
|
+
export type McpPlusOverlayStore = {
|
|
132
|
+
load(key: McpPlusOverlayStoreKey): Promise<McpPlusRuntimeOverlay | undefined>;
|
|
133
|
+
save(key: McpPlusOverlayStoreKey, overlay: McpPlusRuntimeOverlay): Promise<void>;
|
|
134
|
+
};
|
|
135
|
+
export type McpPlusSkillNote = {
|
|
136
|
+
id: string;
|
|
137
|
+
serverId: string;
|
|
138
|
+
projectId: string;
|
|
139
|
+
chapter: string;
|
|
140
|
+
title: string;
|
|
141
|
+
summary: string;
|
|
142
|
+
whenToUse?: string;
|
|
143
|
+
do?: readonly string[];
|
|
144
|
+
why?: string;
|
|
145
|
+
avoid?: readonly string[];
|
|
146
|
+
pitfalls?: readonly string[];
|
|
147
|
+
createdAt: string;
|
|
148
|
+
updatedAt: string;
|
|
149
|
+
metadata?: Readonly<Record<string, unknown>>;
|
|
150
|
+
};
|
|
151
|
+
export type McpPlusSkillStore = {
|
|
152
|
+
list(key: McpPlusProfileStoreKey): Promise<readonly McpPlusSkillNote[]>;
|
|
153
|
+
read(key: McpPlusProfileStoreKey, query: {
|
|
154
|
+
id?: string;
|
|
155
|
+
chapter?: string;
|
|
156
|
+
}): Promise<readonly McpPlusSkillNote[]>;
|
|
157
|
+
write(key: McpPlusProfileStoreKey, note: Omit<McpPlusSkillNote, "id" | "serverId" | "projectId" | "createdAt" | "updatedAt"> & {
|
|
158
|
+
id?: string;
|
|
159
|
+
}): Promise<McpPlusSkillNote>;
|
|
160
|
+
};
|
|
161
|
+
export type McpPlusApplicationServerInput = McpTransportSpec & {
|
|
162
|
+
serverId: string;
|
|
163
|
+
manifest: McpPlusManifest;
|
|
164
|
+
title?: string;
|
|
165
|
+
summary?: string;
|
|
166
|
+
metadata?: Readonly<Record<string, unknown>>;
|
|
167
|
+
};
|
|
168
|
+
export declare function mcpServer(serverId: string, input: McpTransportSpec & Partial<Pick<McpHarnessServerSpec, "mode" | "title" | "summary" | "manifest" | "metadata">>): McpHarnessServerSpec;
|
|
169
|
+
export declare const mcp: {
|
|
170
|
+
readonly module: (input: {
|
|
171
|
+
servers: readonly McpHarnessServerSpec[];
|
|
172
|
+
metadata?: Readonly<Record<string, unknown>>;
|
|
173
|
+
}) => McpHarnessModuleSpec;
|
|
174
|
+
readonly stdio: (serverId: string, input: Omit<Extract<McpTransportSpec, {
|
|
175
|
+
transport: "stdio";
|
|
176
|
+
}>, "transport"> & Partial<Pick<McpHarnessServerSpec, "mode" | "title" | "summary" | "manifest" | "metadata">>) => McpHarnessServerSpec;
|
|
177
|
+
readonly http: (serverId: string, input: HttpMcpHelperInput) => McpHarnessServerSpec;
|
|
178
|
+
readonly sse: (serverId: string, input: HttpMcpHelperInput) => McpHarnessServerSpec;
|
|
179
|
+
readonly recommendedTools: () => readonly ToolSpec[];
|
|
180
|
+
};
|
|
181
|
+
export declare function isMcpHarnessModuleSpec(value: unknown): value is McpHarnessModuleSpec;
|
|
182
|
+
export declare function mcpHarnessModuleFrom(input: {
|
|
183
|
+
modules?: Readonly<Record<string, unknown>>;
|
|
184
|
+
}): McpHarnessModuleSpec | undefined;
|
|
185
|
+
export declare function runtimeRequirementsForMcpModule(module: McpHarnessModuleSpec | undefined): readonly string[];
|
|
186
|
+
export declare function toMcpRuntimeServerProfile(server: McpHarnessServerSpec): McpRuntimeServerProfile;
|
|
187
|
+
export declare function buildMcpServerProfilesFromManifest(input: {
|
|
188
|
+
harness: {
|
|
189
|
+
modules: Readonly<Record<string, unknown>>;
|
|
190
|
+
};
|
|
191
|
+
}): readonly McpRuntimeServerProfile[];
|
|
192
|
+
export declare function createMcpApplicationStateView(module: McpHarnessModuleSpec | undefined): McpApplicationStateView;
|
|
193
|
+
export declare function createMcpPlusInitToolDeclaration(): NativeToolDeclaration;
|
|
194
|
+
export declare function createMcpPlusReprofileToolDeclaration(): NativeToolDeclaration;
|
|
195
|
+
export declare function createMcpPlusSkillReadToolDeclaration(): NativeToolDeclaration;
|
|
196
|
+
export declare function createMcpPlusSkillWriteToolDeclaration(): NativeToolDeclaration;
|
|
197
|
+
export declare function createMcpPlusFinishToolDeclaration(): NativeToolDeclaration;
|
|
198
|
+
export declare function createInMemoryMcpPlusProfileStore(initial?: readonly McpPlusLearnedProfile[]): McpPlusProfileStore;
|
|
199
|
+
export declare function createInMemoryMcpPlusOverlayStore(initial?: readonly McpPlusRuntimeOverlay[]): McpPlusOverlayStore;
|
|
200
|
+
export declare function createInMemoryMcpPlusSkillStore(initial?: readonly McpPlusSkillNote[]): McpPlusSkillStore;
|
|
201
|
+
export declare function createFileMcpPlusProfileStore(rootDir: string): McpPlusProfileStore;
|
|
202
|
+
export declare function createFileMcpPlusSkillStore(rootDir: string): McpPlusSkillStore;
|
|
203
|
+
export declare function learnedProfileFromProposal(input: {
|
|
204
|
+
proposal: McpPlusProfileProposal;
|
|
205
|
+
nativeTools: readonly NativeToolDeclaration[];
|
|
206
|
+
projectId: string;
|
|
207
|
+
now: string;
|
|
208
|
+
existing?: McpPlusLearnedProfile;
|
|
209
|
+
}): {
|
|
210
|
+
ok: true;
|
|
211
|
+
profile: McpPlusLearnedProfile;
|
|
212
|
+
} | {
|
|
213
|
+
ok: false;
|
|
214
|
+
error: {
|
|
215
|
+
code: string;
|
|
216
|
+
message: string;
|
|
217
|
+
publicSafe: true;
|
|
218
|
+
};
|
|
219
|
+
};
|
|
220
|
+
export declare function planMcpHarnessExposure(manifest: {
|
|
221
|
+
harness: {
|
|
222
|
+
modules: Readonly<Record<string, unknown>>;
|
|
223
|
+
};
|
|
224
|
+
}, nativeToolInventoryByServerId: Readonly<Record<string, readonly NativeToolDeclaration[]>>, stateByServerId?: Readonly<Record<string, Partial<ExposureState>>>, profileByServerId?: Readonly<Record<string, McpPlusLearnedProfile | undefined>>): McpHarnessExposurePlan;
|
|
225
|
+
export {};
|