@telora/daemon-core 0.2.17 → 0.2.19
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/escalation-types.d.ts +25 -0
- package/dist/escalation-types.d.ts.map +1 -1
- package/dist/escalation-types.js +15 -0
- package/dist/escalation-types.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp-resolution.d.ts +34 -40
- package/dist/mcp-resolution.d.ts.map +1 -1
- package/dist/mcp-resolution.js +34 -42
- package/dist/mcp-resolution.js.map +1 -1
- package/package.json +1 -1
|
@@ -28,4 +28,29 @@ export declare const ESCALATION_REASONS: {
|
|
|
28
28
|
NEEDS_CLARIFICATION: "needs_clarification";
|
|
29
29
|
SECURITY_CONCERN: "security_concern";
|
|
30
30
|
};
|
|
31
|
+
/**
|
|
32
|
+
* Optional discriminator on agent_escalations.escalation_kind. While
|
|
33
|
+
* `reason_type` answers "what shape of help is needed?", `escalation_kind`
|
|
34
|
+
* answers "which subsystem filed this?" -- letting the daemon dedup
|
|
35
|
+
* already-pending escalations and route them to specialized handlers.
|
|
36
|
+
*
|
|
37
|
+
* Add new kinds here AND in the migration that loosens/extends the DB CHECK
|
|
38
|
+
* constraint on agent_escalations.escalation_kind.
|
|
39
|
+
*/
|
|
40
|
+
export type EscalationKind = 'stuck_focus_branch' | 'review_missing_report' | 'review_nonconvergent' | 'injection_unverified' | 'tree_drift' | 'incomplete_planning';
|
|
41
|
+
/**
|
|
42
|
+
* Const object of all valid escalation kinds.
|
|
43
|
+
*
|
|
44
|
+
* Usage:
|
|
45
|
+
* import { ESCALATION_KINDS } from '@telora/daemon-core';
|
|
46
|
+
* createEscalation({ escalationKind: ESCALATION_KINDS.INJECTION_UNVERIFIED, ... });
|
|
47
|
+
*/
|
|
48
|
+
export declare const ESCALATION_KINDS: {
|
|
49
|
+
STUCK_FOCUS_BRANCH: "stuck_focus_branch";
|
|
50
|
+
REVIEW_MISSING_REPORT: "review_missing_report";
|
|
51
|
+
REVIEW_NONCONVERGENT: "review_nonconvergent";
|
|
52
|
+
INJECTION_UNVERIFIED: "injection_unverified";
|
|
53
|
+
TREE_DRIFT: "tree_drift";
|
|
54
|
+
INCOMPLETE_PLANNING: "incomplete_planning";
|
|
55
|
+
};
|
|
31
56
|
//# sourceMappingURL=escalation-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"escalation-types.d.ts","sourceRoot":"","sources":["../src/escalation-types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAC5B,iBAAiB,GACjB,mBAAmB,GACnB,cAAc,GACd,qBAAqB,GACrB,qBAAqB,GACrB,kBAAkB,CAAC;AAEvB;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB;;;;;;;CAOiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"escalation-types.d.ts","sourceRoot":"","sources":["../src/escalation-types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAC5B,iBAAiB,GACjB,mBAAmB,GACnB,cAAc,GACd,qBAAqB,GACrB,qBAAqB,GACrB,kBAAkB,CAAC;AAEvB;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB;;;;;;;CAOiB,CAAC;AAMjD;;;;;;;;GAQG;AACH,MAAM,MAAM,cAAc,GACtB,oBAAoB,GACpB,uBAAuB,GACvB,sBAAsB,GACtB,sBAAsB,GACtB,YAAY,GACZ,qBAAqB,CAAC;AAE1B;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB;;;;;;;CAOa,CAAC"}
|
package/dist/escalation-types.js
CHANGED
|
@@ -21,4 +21,19 @@ export const ESCALATION_REASONS = {
|
|
|
21
21
|
NEEDS_CLARIFICATION: 'needs_clarification',
|
|
22
22
|
SECURITY_CONCERN: 'security_concern',
|
|
23
23
|
};
|
|
24
|
+
/**
|
|
25
|
+
* Const object of all valid escalation kinds.
|
|
26
|
+
*
|
|
27
|
+
* Usage:
|
|
28
|
+
* import { ESCALATION_KINDS } from '@telora/daemon-core';
|
|
29
|
+
* createEscalation({ escalationKind: ESCALATION_KINDS.INJECTION_UNVERIFIED, ... });
|
|
30
|
+
*/
|
|
31
|
+
export const ESCALATION_KINDS = {
|
|
32
|
+
STUCK_FOCUS_BRANCH: 'stuck_focus_branch',
|
|
33
|
+
REVIEW_MISSING_REPORT: 'review_missing_report',
|
|
34
|
+
REVIEW_NONCONVERGENT: 'review_nonconvergent',
|
|
35
|
+
INJECTION_UNVERIFIED: 'injection_unverified',
|
|
36
|
+
TREE_DRIFT: 'tree_drift',
|
|
37
|
+
INCOMPLETE_PLANNING: 'incomplete_planning',
|
|
38
|
+
};
|
|
24
39
|
//# sourceMappingURL=escalation-types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"escalation-types.js","sourceRoot":"","sources":["../src/escalation-types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAoBH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,eAAe,EAAE,iBAA0B;IAC3C,iBAAiB,EAAE,mBAA4B;IAC/C,YAAY,EAAE,cAAuB;IACrC,mBAAmB,EAAE,qBAA8B;IACnD,mBAAmB,EAAE,qBAA8B;IACnD,gBAAgB,EAAE,kBAA2B;CACC,CAAC"}
|
|
1
|
+
{"version":3,"file":"escalation-types.js","sourceRoot":"","sources":["../src/escalation-types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAoBH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,eAAe,EAAE,iBAA0B;IAC3C,iBAAiB,EAAE,mBAA4B;IAC/C,YAAY,EAAE,cAAuB;IACrC,mBAAmB,EAAE,qBAA8B;IACnD,mBAAmB,EAAE,qBAA8B;IACnD,gBAAgB,EAAE,kBAA2B;CACC,CAAC;AAuBjD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,kBAAkB,EAAE,oBAA6B;IACjD,qBAAqB,EAAE,uBAAgC;IACvD,oBAAoB,EAAE,sBAA+B;IACrD,oBAAoB,EAAE,sBAA+B;IACrD,UAAU,EAAE,YAAqB;IACjC,mBAAmB,EAAE,qBAA8B;CACX,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export { ResourceGovernor, type ResourceGovernorConfig, type ResourceUtilization
|
|
|
14
14
|
export { formatEventForLog, } from './event-logger.js';
|
|
15
15
|
export { ActivityTracker, type ActivitySnapshot, } from './activity-tracker.js';
|
|
16
16
|
export { buildOtelEnv, type BuildOtelEnvOptions, } from './otel-env.js';
|
|
17
|
-
export { ESCALATION_REASONS, type EscalationReasonType, } from './escalation-types.js';
|
|
17
|
+
export { ESCALATION_REASONS, ESCALATION_KINDS, type EscalationReasonType, type EscalationKind, } from './escalation-types.js';
|
|
18
18
|
export { extractSessionKey, pruneOldLogs, scanLogDirectory, type LogFileInfo, type LogManagerDeps, type LogRetentionConfig, type PruneResult, } from './log-manager.js';
|
|
19
19
|
export { buildMcpConfig, isLegacyMcpConfigShape, resolveMcpServerPath, writeMcpConfigFile, MCP_PRODUCTS_PACKAGE, MCP_PRODUCTS_BIN, type McpConfigOptions, } from './mcp-resolution.js';
|
|
20
20
|
export { HealthEventBuffer, healthEvents, type HealthEvent, type HealthSeverity, } from './health-events.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,QAAQ,EACR,cAAc,EACd,gBAAgB,EAChB,KAAK,qBAAqB,EAC1B,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,kBAAkB,EAClB,4BAA4B,EAC5B,kBAAkB,EAClB,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GvB,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,sBAAsB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,eAAe,GACrB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,aAAa,GACnB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,KAAK,aAAa,EAClB,KAAK,aAAa,GACnB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,gBAAgB,EAChB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,GACzB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EACL,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,eAAe,EACf,KAAK,gBAAgB,GACtB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACL,YAAY,EACZ,KAAK,mBAAmB,GACzB,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,kBAAkB,EAClB,KAAK,oBAAoB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,QAAQ,EACR,cAAc,EACd,gBAAgB,EAChB,KAAK,qBAAqB,EAC1B,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,kBAAkB,EAClB,4BAA4B,EAC5B,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACZ,SAAS,GACV,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,eAAe,EACf,KAAK,aAAa,EAClB,KAAK,SAAS,GACf,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,eAAe,EACf,cAAc,GACf,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EACzB,aAAa,EACb,KAAK,gBAAgB,GACtB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,WAAW,EACX,KAA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AAK,mBAAmB,GACzB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EACL,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,eAAe,EACf,KAAK,gBAAgB,GACtB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACL,YAAY,EACZ,KAAK,mBAAmB,GACzB,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,KAAK,oBAAoB,EACzB,KAAK,cAAc,GACpB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,WAAW,GACjB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,cAAc,EACd,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,KAAK,gBAAgB,GACtB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,KAAK,WAAW,EAChB,KAAK,cAAc,GACpB,MAAM,oBAAoB,CAAC;AAG5B,YAAY,EACV,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,YAAY,EACZ,aAAa,EACb,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,EACnB,eAAe,EACf,qBAAqB,EACrB,0BAA0B,EAC1B,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,qBAAqB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -30,7 +30,7 @@ export { ActivityTracker, } from './activity-tracker.js';
|
|
|
30
30
|
// OTEL environment variable builder (shared OTLP env injection for spawned processes)
|
|
31
31
|
export { buildOtelEnv, } from './otel-env.js';
|
|
32
32
|
// Escalation reason types (shared enum/constants for agent_escalations.reason_type)
|
|
33
|
-
export { ESCALATION_REASONS, } from './escalation-types.js';
|
|
33
|
+
export { ESCALATION_REASONS, ESCALATION_KINDS, } from './escalation-types.js';
|
|
34
34
|
// Log manager (retention policy and pruning for agent log files)
|
|
35
35
|
export { extractSessionKey, pruneOldLogs, scanLogDirectory, } from './log-manager.js';
|
|
36
36
|
// MCP server resolution and config generation
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,4EAA4E;AAE5E,OAAO,EACL,QAAQ,EACR,cAAc,EACd,gBAAgB,EAIhB,kBAAkB,EAClB,4BAA4B,EAC5B,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACZ,SAAS,GACV,MAAM,iBAAiB,CAAC;AAEzB,2DAA2D;AAC3D,OAAO,EACL,eAAe,GAGhB,MAAM,iBAAiB,CAAC;AAEzB,6DAA6D;AAC7D,OAAO,EACL,eAAe,EACf,cAAc,GACf,MAAM,iBAAiB,CAAC;AAEzB,qDAAqD;AACrD,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EACzB,aAAa,GAEd,MAAM,kBAAkB,CAAC;AAE1B,iFAAiF;AACjF,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,WAAW,GAqBZ,MAAM,kBAAkB,CAAC;AAE1B,iEAAiE;AACjE,OAAO,EACL,UAAU,EACV,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,GAGnB,MAAM,aAAa,CAAC;AAErB,0EAA0E;AAC1E,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,mBAAmB,GAEpB,MAAM,gBAAgB,CAAC;AAExB,yDAAyD;AACzD,OAAO,EACL,sBAAsB,EACtB,YAAY,EACZ,MAAM,GAEP,MAAM,UAAU,CAAC;AAElB,0DAA0D;AAC1D,OAAO,EACL,SAAS,EACT,kBAAkB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 -1,23 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* MCP server path resolution and config generation.
|
|
3
3
|
*
|
|
4
|
-
* `.mcp.json`
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
4
|
+
* `.mcp.json` is per-user-machine (gitignored). It uses `command: "node"`
|
|
5
|
+
* with an absolute path to the daemon's bundled `@telora/mcp-products`. The
|
|
6
|
+
* daemon owns the dependency; its self-update mechanism keeps the bundled
|
|
7
|
+
* MCP fresh, so there is no second self-updater and no npx cache key for
|
|
8
|
+
* `@latest` to fossilize into.
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
10
|
+
* Earlier shape used `npx -p @telora/mcp-products@latest telora-mcp-products`.
|
|
11
|
+
* That argv hashes into `~/.npm/_npx/<hash>/` and npx reuses the cache for
|
|
12
|
+
* the same argv -- the `@latest` token never re-resolves. Users would sit on
|
|
13
|
+
* a months-old MCP without any signal. The abs-path shape sidesteps the
|
|
14
|
+
* problem entirely.
|
|
12
15
|
*
|
|
13
16
|
* The config generation helpers are pure JSON builders with no external deps.
|
|
14
17
|
*/
|
|
15
18
|
/**
|
|
16
|
-
* Canonical bin
|
|
17
|
-
*
|
|
18
|
-
* `mcp-products`, which does NOT match, so `npx -p @telora/mcp-products
|
|
19
|
-
* @latest` requires the bin to be named explicitly. Same lesson the daemon
|
|
20
|
-
* learned in commit 0368f4b6.
|
|
19
|
+
* Canonical package + bin names. Retained as exported constants for callers
|
|
20
|
+
* that need to detect or migrate legacy npx-shape `.mcp.json` files.
|
|
21
21
|
*/
|
|
22
22
|
export declare const MCP_PRODUCTS_PACKAGE = "@telora/mcp-products";
|
|
23
23
|
export declare const MCP_PRODUCTS_BIN = "telora-mcp-products";
|
|
@@ -36,50 +36,44 @@ export declare function resolveMcpServerPath(callerImportMetaUrl: string): strin
|
|
|
36
36
|
/**
|
|
37
37
|
* MCP config generation options.
|
|
38
38
|
*
|
|
39
|
-
* `mcpServerPath` is
|
|
40
|
-
*
|
|
41
|
-
*
|
|
39
|
+
* `mcpServerPath` is required: the file uses an absolute path so Claude
|
|
40
|
+
* Code can spawn the MCP without npx (the cache trap that motivated this
|
|
41
|
+
* shape). Callers resolve the path from their own package context via
|
|
42
|
+
* `resolveMcpServerPath(import.meta.url)`.
|
|
42
43
|
*/
|
|
43
44
|
export interface McpConfigOptions {
|
|
44
|
-
/**
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
/** Telora tracker ID. Only inlined when `inlineTrackerId` is true (legacy
|
|
48
|
-
* worktree path); the committable shape leaves this off. */
|
|
45
|
+
/** Absolute path to the MCP server entry point (`dist/index.js`). */
|
|
46
|
+
mcpServerPath: string;
|
|
47
|
+
/** Telora tracker ID. Inlined into env when present. */
|
|
49
48
|
trackerId?: string;
|
|
50
|
-
/** Telora API URL. Inlined into env
|
|
49
|
+
/** Telora API URL. Inlined into env when present. */
|
|
51
50
|
teloraUrl?: string;
|
|
52
|
-
/** MCP profile (e.g. 'execution' for daemon-spawned agents
|
|
51
|
+
/** MCP profile (e.g. 'execution' for daemon-spawned agents, 'human' for
|
|
52
|
+
* user repos). Optional; inlined into env when present. */
|
|
53
53
|
profile?: string;
|
|
54
|
-
/** When true, inline TELORA_TRACKER_ID into env (legacy / daemon-spawned
|
|
55
|
-
* worktrees). When false/undefined, omit from env so the file is
|
|
56
|
-
* committable -- the MCP server reads tracker_id from daemon.json. */
|
|
57
|
-
inlineTrackerId?: boolean;
|
|
58
54
|
}
|
|
59
55
|
/**
|
|
60
56
|
* Build the .mcp.json content object.
|
|
61
57
|
*
|
|
62
|
-
*
|
|
63
|
-
* command: "npx"
|
|
64
|
-
* args: ["-p", "@telora/mcp-products@latest", "telora-mcp-products"]
|
|
65
|
-
* env: { TELORA_URL: "<url>" } (TELORA_TRACKER_ID intentionally absent)
|
|
66
|
-
*
|
|
67
|
-
* Legacy shape (daemon-spawned worktrees, when mcpServerPath is set):
|
|
58
|
+
* Shape:
|
|
68
59
|
* command: "node"
|
|
69
|
-
* args: ["<
|
|
60
|
+
* args: ["<abs-path-to-mcp-products/dist/index.js>"]
|
|
70
61
|
* env: { TELORA_TRACKER_ID, TELORA_URL, [TELORA_MCP_PROFILE] }
|
|
62
|
+
*
|
|
63
|
+
* The file is per-user-machine and gitignored. The daemon refreshes it on
|
|
64
|
+
* every startup so the path stays valid across daemon self-updates.
|
|
71
65
|
*/
|
|
72
66
|
export declare function buildMcpConfig(options: McpConfigOptions): Record<string, unknown>;
|
|
73
67
|
/**
|
|
74
|
-
* Heuristic: is a parsed .mcp.json the legacy
|
|
68
|
+
* Heuristic: is a parsed .mcp.json the legacy npx shape?
|
|
75
69
|
*
|
|
76
|
-
* Old shape:
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
70
|
+
* Old shape used `command: "npx"` with args invoking
|
|
71
|
+
* `@telora/mcp-products@latest`. That argv hashes into a stable npx cache
|
|
72
|
+
* directory and never re-resolves `@latest` -- users would sit on a stale
|
|
73
|
+
* MCP version with no signal.
|
|
80
74
|
*
|
|
81
|
-
* Used by the connect flow
|
|
82
|
-
*
|
|
75
|
+
* Used by the connect flow and the daemon's startup refresh to detect a
|
|
76
|
+
* pre-fix file and rewrite it to the current node + abs-path shape.
|
|
83
77
|
*/
|
|
84
78
|
export declare function isLegacyMcpConfigShape(parsed: unknown): boolean;
|
|
85
79
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-resolution.d.ts","sourceRoot":"","sources":["../src/mcp-resolution.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"mcp-resolution.d.ts","sourceRoot":"","sources":["../src/mcp-resolution.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAMH;;;GAGG;AACH,eAAO,MAAM,oBAAoB,yBAAyB,CAAC;AAC3D,eAAO,MAAM,gBAAgB,wBAAwB,CAAC;AAEtD;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAAC,mBAAmB,EAAE,MAAM,GAAG,MAAM,CAUxE;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,gBAAgB;IAC/B,qEAAqE;IACrE,aAAa,EAAE,MAAM,CAAC;IACtB,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;gEAC4D;IAC5D,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAiBjF;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAW/D;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAInF"}
|
package/dist/mcp-resolution.js
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* MCP server path resolution and config generation.
|
|
3
3
|
*
|
|
4
|
-
* `.mcp.json`
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
4
|
+
* `.mcp.json` is per-user-machine (gitignored). It uses `command: "node"`
|
|
5
|
+
* with an absolute path to the daemon's bundled `@telora/mcp-products`. The
|
|
6
|
+
* daemon owns the dependency; its self-update mechanism keeps the bundled
|
|
7
|
+
* MCP fresh, so there is no second self-updater and no npx cache key for
|
|
8
|
+
* `@latest` to fossilize into.
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
10
|
+
* Earlier shape used `npx -p @telora/mcp-products@latest telora-mcp-products`.
|
|
11
|
+
* That argv hashes into `~/.npm/_npx/<hash>/` and npx reuses the cache for
|
|
12
|
+
* the same argv -- the `@latest` token never re-resolves. Users would sit on
|
|
13
|
+
* a months-old MCP without any signal. The abs-path shape sidesteps the
|
|
14
|
+
* problem entirely.
|
|
12
15
|
*
|
|
13
16
|
* The config generation helpers are pure JSON builders with no external deps.
|
|
14
17
|
*/
|
|
@@ -16,11 +19,8 @@ import { createRequire } from 'node:module';
|
|
|
16
19
|
import { writeFileSync } from 'node:fs';
|
|
17
20
|
import { join } from 'node:path';
|
|
18
21
|
/**
|
|
19
|
-
* Canonical bin
|
|
20
|
-
*
|
|
21
|
-
* `mcp-products`, which does NOT match, so `npx -p @telora/mcp-products
|
|
22
|
-
* @latest` requires the bin to be named explicitly. Same lesson the daemon
|
|
23
|
-
* learned in commit 0368f4b6.
|
|
22
|
+
* Canonical package + bin names. Retained as exported constants for callers
|
|
23
|
+
* that need to detect or migrate legacy npx-shape `.mcp.json` files.
|
|
24
24
|
*/
|
|
25
25
|
export const MCP_PRODUCTS_PACKAGE = '@telora/mcp-products';
|
|
26
26
|
export const MCP_PRODUCTS_BIN = 'telora-mcp-products';
|
|
@@ -48,31 +48,26 @@ export function resolveMcpServerPath(callerImportMetaUrl) {
|
|
|
48
48
|
/**
|
|
49
49
|
* Build the .mcp.json content object.
|
|
50
50
|
*
|
|
51
|
-
*
|
|
52
|
-
* command: "npx"
|
|
53
|
-
* args: ["-p", "@telora/mcp-products@latest", "telora-mcp-products"]
|
|
54
|
-
* env: { TELORA_URL: "<url>" } (TELORA_TRACKER_ID intentionally absent)
|
|
55
|
-
*
|
|
56
|
-
* Legacy shape (daemon-spawned worktrees, when mcpServerPath is set):
|
|
51
|
+
* Shape:
|
|
57
52
|
* command: "node"
|
|
58
|
-
* args: ["<
|
|
53
|
+
* args: ["<abs-path-to-mcp-products/dist/index.js>"]
|
|
59
54
|
* env: { TELORA_TRACKER_ID, TELORA_URL, [TELORA_MCP_PROFILE] }
|
|
55
|
+
*
|
|
56
|
+
* The file is per-user-machine and gitignored. The daemon refreshes it on
|
|
57
|
+
* every startup so the path stays valid across daemon self-updates.
|
|
60
58
|
*/
|
|
61
59
|
export function buildMcpConfig(options) {
|
|
62
60
|
const env = {};
|
|
63
61
|
if (options.teloraUrl)
|
|
64
62
|
env.TELORA_URL = options.teloraUrl;
|
|
65
|
-
if (
|
|
63
|
+
if (options.trackerId)
|
|
66
64
|
env.TELORA_TRACKER_ID = options.trackerId;
|
|
67
|
-
}
|
|
68
65
|
if (options.profile)
|
|
69
66
|
env.TELORA_MCP_PROFILE = options.profile;
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
: ['-p', `${MCP_PRODUCTS_PACKAGE}@latest`, MCP_PRODUCTS_BIN];
|
|
75
|
-
const server = { command, args };
|
|
67
|
+
const server = {
|
|
68
|
+
command: 'node',
|
|
69
|
+
args: [options.mcpServerPath],
|
|
70
|
+
};
|
|
76
71
|
if (Object.keys(env).length > 0)
|
|
77
72
|
server.env = env;
|
|
78
73
|
return {
|
|
@@ -82,15 +77,15 @@ export function buildMcpConfig(options) {
|
|
|
82
77
|
};
|
|
83
78
|
}
|
|
84
79
|
/**
|
|
85
|
-
* Heuristic: is a parsed .mcp.json the legacy
|
|
80
|
+
* Heuristic: is a parsed .mcp.json the legacy npx shape?
|
|
86
81
|
*
|
|
87
|
-
* Old shape:
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
82
|
+
* Old shape used `command: "npx"` with args invoking
|
|
83
|
+
* `@telora/mcp-products@latest`. That argv hashes into a stable npx cache
|
|
84
|
+
* directory and never re-resolves `@latest` -- users would sit on a stale
|
|
85
|
+
* MCP version with no signal.
|
|
91
86
|
*
|
|
92
|
-
* Used by the connect flow
|
|
93
|
-
*
|
|
87
|
+
* Used by the connect flow and the daemon's startup refresh to detect a
|
|
88
|
+
* pre-fix file and rewrite it to the current node + abs-path shape.
|
|
94
89
|
*/
|
|
95
90
|
export function isLegacyMcpConfigShape(parsed) {
|
|
96
91
|
if (!parsed || typeof parsed !== 'object')
|
|
@@ -100,14 +95,11 @@ export function isLegacyMcpConfigShape(parsed) {
|
|
|
100
95
|
if (!server || typeof server !== 'object')
|
|
101
96
|
return false;
|
|
102
97
|
const s = server;
|
|
103
|
-
if (s.command
|
|
104
|
-
return
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
return true;
|
|
109
|
-
}
|
|
110
|
-
return false;
|
|
98
|
+
if (s.command !== 'npx')
|
|
99
|
+
return false;
|
|
100
|
+
if (!Array.isArray(s.args))
|
|
101
|
+
return false;
|
|
102
|
+
return s.args.some((a) => typeof a === 'string' && a.includes(`${MCP_PRODUCTS_PACKAGE}@`));
|
|
111
103
|
}
|
|
112
104
|
/**
|
|
113
105
|
* Write a .mcp.json file to a directory.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp-resolution.js","sourceRoot":"","sources":["../src/mcp-resolution.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"mcp-resolution.js","sourceRoot":"","sources":["../src/mcp-resolution.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,sBAAsB,CAAC;AAC3D,MAAM,CAAC,MAAM,gBAAgB,GAAG,qBAAqB,CAAC;AAEtD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,oBAAoB,CAAC,mBAA2B;IAC9D,MAAM,aAAa,GAAG,aAAa,CAAC,mBAAmB,CAAC,CAAC;IACzD,IAAI,CAAC;QACH,OAAO,aAAa,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC;IACvD,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,iGAAiG;YACjG,mBAAmB,GAAG,YAAY,KAAK,CAAC,CAAC,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