@omercnet/paseo-context-mode 2.0.1-next.247.1 → 2.0.1-next.256.1
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/README.md +1 -1
- package/package.json +2 -2
- package/server/handlers.ts +26 -5
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ These previews were captured from an isolated Paseo test daemon with Context Mod
|
|
|
22
22
|
|
|
23
23
|
- Bundles Context Mode as a runtime dependency; a separately installed global executable remains optional.
|
|
24
24
|
- Resolves a configured absolute executable first, then the daemon's `PATH`, then the bundled runtime.
|
|
25
|
-
- Shows Context Mode version, structured diagnostics, provider activation, storage roots, lifetime savings, activity, categories, and indexed sources. Savings lists the built-in harness storage plus the storage of every provider configured in Paseo (including ones derived with `extends`), the latter under its Paseo provider id and the root its own `env` resolves to. `ctx_stats` and the Setup tab
|
|
25
|
+
- Shows Context Mode version, structured diagnostics, provider activation, storage roots, lifetime savings, activity, categories, and indexed sources. Savings lists the built-in harness storage plus the storage of every provider configured in Paseo (including ones derived with `extends`), the latter under its Paseo provider id and the root its own `env` resolves to. `ctx_stats` and the Setup tab run against a plugin-owned probe store (`<PASEO_HOME>/plugin-data/context-mode/probe`) so they never write into a provider root; it starts empty.
|
|
26
26
|
- Reads Context Mode 1.0.169 SQLite databases in query-only mode, honors active WAL state, isolates corrupt databases, and reports partial coverage instead of mutating schemas.
|
|
27
27
|
- Injects the bundled stdio MCP server into new supported agents through Paseo's `agent.create` hook.
|
|
28
28
|
- Injects provider identity and an existing provider-specific storage root on create, resume, refresh, and import.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omercnet/paseo-context-mode",
|
|
3
|
-
"version": "2.0.1-next.
|
|
3
|
+
"version": "2.0.1-next.256.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Provider-aware Context Mode health, savings, and MCP activation for Paseo.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"publishConfig": {
|
|
18
18
|
"access": "public"
|
|
19
19
|
},
|
|
20
|
-
"packageManager": "bun@1.4.
|
|
20
|
+
"packageManager": "bun@1.4.3",
|
|
21
21
|
"engines": {
|
|
22
22
|
"node": ">=24"
|
|
23
23
|
},
|
package/server/handlers.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { homedir } from "node:os";
|
|
2
|
+
import { join } from "node:path";
|
|
1
3
|
import type { PluginSettings } from "@getpaseo/plugin/server";
|
|
2
4
|
import type {
|
|
3
5
|
BinaryStatus,
|
|
@@ -25,11 +27,29 @@ type SettingsHandle = PluginSettings<typeof contextModeSettings.schema>;
|
|
|
25
27
|
type ToolName = "ctx_doctor" | "ctx_stats";
|
|
26
28
|
type FailureReport = Extract<CommandReport, { state: "unavailable" }>;
|
|
27
29
|
|
|
30
|
+
interface ProbeOptions {
|
|
31
|
+
env: NodeJS.ProcessEnv;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Panel probes belong to no provider. Without an explicit storage root Context Mode falls back to
|
|
36
|
+
* whichever provider config directory exists, and writes its sidecar and content store there.
|
|
37
|
+
*/
|
|
38
|
+
function contextModeProbeOptions(env: NodeJS.ProcessEnv = process.env): ProbeOptions {
|
|
39
|
+
const home = env.PASEO_HOME?.trim() || join(homedir(), ".paseo");
|
|
40
|
+
return { env: { CONTEXT_MODE_DIR: join(home, "plugin-data", "context-mode", "probe") } };
|
|
41
|
+
}
|
|
42
|
+
|
|
28
43
|
export interface ContextModeHandlerDependencies {
|
|
29
44
|
now?: () => Date;
|
|
30
45
|
resolveBinary?: (settings: ContextModeSettings) => Promise<BinaryResolution>;
|
|
31
|
-
inspect?: (launch: LaunchDescriptor) => Promise<McpInspection>;
|
|
32
|
-
callTool?: (
|
|
46
|
+
inspect?: (launch: LaunchDescriptor, options: ProbeOptions) => Promise<McpInspection>;
|
|
47
|
+
callTool?: (
|
|
48
|
+
launch: LaunchDescriptor,
|
|
49
|
+
name: ToolName,
|
|
50
|
+
arguments_: Record<string, never>,
|
|
51
|
+
options: ProbeOptions,
|
|
52
|
+
) => Promise<string>;
|
|
33
53
|
createAudit?: (
|
|
34
54
|
settings: ContextModeSettings,
|
|
35
55
|
runtime: { path: string; version: string | null },
|
|
@@ -71,6 +91,7 @@ export function createContextModeHandlers(
|
|
|
71
91
|
const callTool = dependencies.callTool ?? callContextModeTool;
|
|
72
92
|
const buildAudit = dependencies.createAudit ?? createIntegrationAudit;
|
|
73
93
|
const cache = new Map<string, CacheEntry<BinaryStatus | CommandReport>>();
|
|
94
|
+
const probe = contextModeProbeOptions();
|
|
74
95
|
|
|
75
96
|
async function settingsAndBinary(): Promise<
|
|
76
97
|
| {
|
|
@@ -145,7 +166,7 @@ export function createContextModeHandlers(
|
|
|
145
166
|
return cached(cacheKey, 10_000, fresh, async () => {
|
|
146
167
|
const checkedAt = now().toISOString();
|
|
147
168
|
try {
|
|
148
|
-
const inspection = await inspect(resolved.binary.launch);
|
|
169
|
+
const inspection = await inspect(resolved.binary.launch, probe);
|
|
149
170
|
return {
|
|
150
171
|
state: "ready",
|
|
151
172
|
binaryPath: resolved.binary.path,
|
|
@@ -170,7 +191,7 @@ export function createContextModeHandlers(
|
|
|
170
191
|
return {
|
|
171
192
|
state: "ready",
|
|
172
193
|
binaryPath: resolved.binary.path,
|
|
173
|
-
output: await callTool(resolved.binary.launch, name),
|
|
194
|
+
output: await callTool(resolved.binary.launch, name, {}, probe),
|
|
174
195
|
checkedAt,
|
|
175
196
|
};
|
|
176
197
|
} catch (error) {
|
|
@@ -193,7 +214,7 @@ export function createContextModeHandlers(
|
|
|
193
214
|
checkedAt: resolved.report.checkedAt,
|
|
194
215
|
};
|
|
195
216
|
}
|
|
196
|
-
const inspection = await inspect(resolved.binary.launch).catch(() => ({
|
|
217
|
+
const inspection = await inspect(resolved.binary.launch, probe).catch(() => ({
|
|
197
218
|
version: null,
|
|
198
219
|
tools: [],
|
|
199
220
|
}));
|