@phren/cli 0.1.13 → 0.1.15
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/dist/capabilities/cli.js +1 -1
- package/dist/capabilities/mcp.js +1 -1
- package/dist/capabilities/vscode.js +1 -1
- package/dist/capabilities/web-ui.js +1 -1
- package/dist/cli/extract.js +2 -1
- package/dist/cli/govern.js +3 -2
- package/dist/cli/hooks-session.d.ts +18 -36
- package/dist/cli/hooks-session.js +21 -1482
- package/dist/cli/namespaces-findings.d.ts +1 -0
- package/dist/cli/namespaces-findings.js +208 -0
- package/dist/cli/namespaces-profile.d.ts +1 -0
- package/dist/cli/namespaces-profile.js +76 -0
- package/dist/cli/namespaces-projects.d.ts +1 -0
- package/dist/cli/namespaces-projects.js +371 -0
- package/dist/cli/namespaces-review.d.ts +1 -0
- package/dist/cli/namespaces-review.js +45 -0
- package/dist/cli/namespaces-skills.d.ts +4 -0
- package/dist/cli/namespaces-skills.js +550 -0
- package/dist/cli/namespaces-store.d.ts +2 -0
- package/dist/cli/namespaces-store.js +367 -0
- package/dist/cli/namespaces-tasks.d.ts +1 -0
- package/dist/cli/namespaces-tasks.js +369 -0
- package/dist/cli/namespaces-utils.d.ts +4 -0
- package/dist/cli/namespaces-utils.js +47 -0
- package/dist/cli/namespaces.d.ts +7 -11
- package/dist/cli/namespaces.js +8 -2011
- package/dist/cli/ops.js +2 -2
- package/dist/cli/session-background.d.ts +3 -0
- package/dist/cli/session-background.js +176 -0
- package/dist/cli/session-git.d.ts +17 -0
- package/dist/cli/session-git.js +181 -0
- package/dist/cli/session-metrics.d.ts +2 -0
- package/dist/cli/session-metrics.js +67 -0
- package/dist/cli/session-start.d.ts +3 -0
- package/dist/cli/session-start.js +290 -0
- package/dist/cli/session-stop.d.ts +8 -0
- package/dist/cli/session-stop.js +468 -0
- package/dist/cli/session-tool-hook.d.ts +18 -0
- package/dist/cli/session-tool-hook.js +376 -0
- package/dist/cli/team.js +7 -5
- package/dist/cli-hooks-session-handlers.js +2 -1
- package/dist/content/archive.js +2 -1
- package/dist/content/dedup.js +6 -5
- package/dist/content/learning.js +3 -2
- package/dist/content/validate.js +2 -1
- package/dist/core/project.js +2 -1
- package/dist/data/access.d.ts +1 -0
- package/dist/data/access.js +11 -10
- package/dist/finding/journal.js +2 -1
- package/dist/finding/lifecycle.js +2 -1
- package/dist/governance/policy.d.ts +2 -0
- package/dist/governance/policy.js +2 -2
- package/dist/hooks.js +38 -2
- package/dist/init/init-uninstall.js +2 -1
- package/dist/init/setup.js +5 -4
- package/dist/init-uninstall.js +2 -1
- package/dist/link/checksums.js +2 -1
- package/dist/link/context.js +2 -1
- package/dist/link/doctor.js +4 -3
- package/dist/link/link.js +2 -1
- package/dist/phren-paths.js +3 -2
- package/dist/profile-store.d.ts +1 -0
- package/dist/profile-store.js +15 -16
- package/dist/project-topics.js +4 -3
- package/dist/shell/input.js +3 -3
- package/dist/status.js +2 -2
- package/dist/tools/data.js +4 -4
- package/dist/tools/extract.js +2 -1
- package/dist/tools/finding.js +9 -9
- package/dist/tools/search.js +4 -4
- package/dist/tools/session.js +2 -2
- package/dist/ui/data.js +6 -5
- package/dist/ui/server.js +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ MCP server that indexes your personal phren and exposes it to AI agents via full
|
|
|
4
4
|
|
|
5
5
|
On startup it walks your phren directory, reads all `.md` files, and builds an in-memory SQLite FTS5 index.
|
|
6
6
|
|
|
7
|
-
Public surface:
|
|
7
|
+
Public surface: 54 MCP tools across 12 modules (search, tasks, findings, memory, data, graph, sessions, ops/review, skills, hooks, config, extraction).
|
|
8
8
|
|
|
9
9
|
Notable shipped capabilities:
|
|
10
10
|
- finding lifecycle tools: `supersede_finding`, `retract_finding`, `resolve_contradiction`, `get_contradictions`
|
package/dist/capabilities/cli.js
CHANGED
package/dist/capabilities/mcp.js
CHANGED
package/dist/cli/extract.js
CHANGED
|
@@ -4,6 +4,7 @@ import { detectProject } from "../shared/index.js";
|
|
|
4
4
|
import { commandExists } from "../hooks.js";
|
|
5
5
|
import { runGit as runGitShared, isFeatureEnabled, clampInt, errorMessage, resolveExecCommand } from "../utils.js";
|
|
6
6
|
import { appendFindingJournal, compactFindingJournals } from "../finding/journal.js";
|
|
7
|
+
import { FINDINGS_FILENAME } from "../data/access.js";
|
|
7
8
|
import { getProactivityLevelForTask, getProactivityLevelForFindings, shouldAutoCaptureFindingsForLevel } from "../proactivity.js";
|
|
8
9
|
import * as fs from "fs";
|
|
9
10
|
import * as os from "os";
|
|
@@ -276,7 +277,7 @@ export async function handleExtractMemories(projectArg, cwdArg, silent = false,
|
|
|
276
277
|
continue;
|
|
277
278
|
const line = `${c.text}${c.commit ? ` (source commit ${c.commit.slice(0, 8)})` : ""}`;
|
|
278
279
|
if (c.text.startsWith("CI failure pattern:")) {
|
|
279
|
-
const key = entryScoreKey(project,
|
|
280
|
+
const key = entryScoreKey(project, FINDINGS_FILENAME, line);
|
|
280
281
|
recordFeedback(getPhrenPath(), key, "regression");
|
|
281
282
|
}
|
|
282
283
|
if (c.score >= threshold) {
|
package/dist/cli/govern.js
CHANGED
|
@@ -5,6 +5,7 @@ import * as fs from "fs";
|
|
|
5
5
|
import * as path from "path";
|
|
6
6
|
import { handleExtractMemories } from "./extract.js";
|
|
7
7
|
import { errorMessage } from "../utils.js";
|
|
8
|
+
import { FINDINGS_FILENAME } from "../data/access.js";
|
|
8
9
|
import { logger } from "../logger.js";
|
|
9
10
|
import { compactFindingJournals } from "../finding/journal.js";
|
|
10
11
|
import { resolveRuntimeProfile } from "../runtime-profile.js";
|
|
@@ -72,7 +73,7 @@ export async function handleGovernMemories(projectArg, silent = false, dryRun =
|
|
|
72
73
|
let conflictCount = 0;
|
|
73
74
|
let reviewCount = 0;
|
|
74
75
|
for (const project of projects) {
|
|
75
|
-
const learningsPath = path.join(getPhrenPath(), project,
|
|
76
|
+
const learningsPath = path.join(getPhrenPath(), project, FINDINGS_FILENAME);
|
|
76
77
|
if (!fs.existsSync(learningsPath))
|
|
77
78
|
continue;
|
|
78
79
|
const content = fs.readFileSync(learningsPath, "utf8");
|
|
@@ -162,7 +163,7 @@ export async function handlePruneMemories(args = []) {
|
|
|
162
163
|
}
|
|
163
164
|
let ttlExpired = 0;
|
|
164
165
|
for (const project of projects) {
|
|
165
|
-
const learningsPath = path.join(getPhrenPath(), project,
|
|
166
|
+
const learningsPath = path.join(getPhrenPath(), project, FINDINGS_FILENAME);
|
|
166
167
|
if (!fs.existsSync(learningsPath))
|
|
167
168
|
continue;
|
|
168
169
|
const content = fs.readFileSync(learningsPath, "utf8");
|
|
@@ -1,38 +1,20 @@
|
|
|
1
|
-
import type { SelectedSnippet } from "../shared/retrieval.js";
|
|
2
|
-
export type { HookContext } from "./hooks-context.js";
|
|
3
|
-
export { buildHookContext, handleGuardSkip } from "./hooks-context.js";
|
|
4
|
-
export declare function getUntrackedProjectNotice(phrenPath: string, cwd: string): string | null;
|
|
5
|
-
export declare function getSessionStartOnboardingNotice(phrenPath: string, cwd: string, activeProject: string | null): string | null;
|
|
6
|
-
export interface GitContext {
|
|
7
|
-
branch: string;
|
|
8
|
-
changedFiles: Set<string>;
|
|
9
|
-
}
|
|
10
|
-
export declare function getGitContext(cwd?: string): GitContext | null;
|
|
11
|
-
export declare function trackSessionMetrics(phrenPathLocal: string, sessionId: string, selected: SelectedSnippet[]): void;
|
|
12
|
-
export declare function resolveSubprocessArgs(command: string): string[] | null;
|
|
13
|
-
export declare function handleHookSessionStart(): Promise<void>;
|
|
14
1
|
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
2
|
+
* Session lifecycle hooks — orchestrator module.
|
|
3
|
+
*
|
|
4
|
+
* This file re-exports all session hook functionality from the split modules:
|
|
5
|
+
* - session-git.ts — Git context and command helpers
|
|
6
|
+
* - session-metrics.ts — Session metrics tracking
|
|
7
|
+
* - session-background.ts — Background sync/maintenance scheduling
|
|
8
|
+
* - session-start.ts — SessionStart hook handler + onboarding notices
|
|
9
|
+
* - session-stop.ts — Stop hook handler + background sync + conversation capture
|
|
10
|
+
* - session-tool-hook.ts — PostToolUse and context hook handlers + tool finding extraction
|
|
17
11
|
*/
|
|
18
|
-
export
|
|
19
|
-
export
|
|
20
|
-
export
|
|
21
|
-
export
|
|
22
|
-
export
|
|
23
|
-
export
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
explicit?: boolean;
|
|
28
|
-
}
|
|
29
|
-
export declare function filterToolFindingsForProactivity(candidates: Array<{
|
|
30
|
-
text: string;
|
|
31
|
-
confidence: number;
|
|
32
|
-
explicit?: boolean;
|
|
33
|
-
}>, level?: "high" | "medium" | "low"): Array<{
|
|
34
|
-
text: string;
|
|
35
|
-
confidence: number;
|
|
36
|
-
explicit?: boolean;
|
|
37
|
-
}>;
|
|
38
|
-
export declare function extractToolFindings(toolName: string, input: Record<string, unknown>, responseStr: string): LearningCandidate[];
|
|
12
|
+
export type { HookContext } from "./hooks-context.js";
|
|
13
|
+
export { buildHookContext, handleGuardSkip } from "./hooks-context.js";
|
|
14
|
+
export type { GitContext } from "./session-git.js";
|
|
15
|
+
export { getGitContext } from "./session-git.js";
|
|
16
|
+
export { trackSessionMetrics } from "./session-metrics.js";
|
|
17
|
+
export { resolveSubprocessArgs } from "./session-background.js";
|
|
18
|
+
export { getUntrackedProjectNotice, getSessionStartOnboardingNotice, handleHookSessionStart, } from "./session-start.js";
|
|
19
|
+
export { extractConversationInsights, filterConversationInsightsForProactivity, handleHookStop, handleBackgroundSync, } from "./session-stop.js";
|
|
20
|
+
export { handleHookContext, handleHookTool, extractToolFindings, filterToolFindingsForProactivity, } from "./session-tool-hook.js";
|