@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/dist/tools/search.js
CHANGED
|
@@ -6,7 +6,7 @@ import { createHash } from "crypto";
|
|
|
6
6
|
import { execFileSync } from "child_process";
|
|
7
7
|
import { isValidProjectName, errorMessage } from "../utils.js";
|
|
8
8
|
import { resolveAllStores } from "../store-registry.js";
|
|
9
|
-
import { readFindings } from "../data/access.js";
|
|
9
|
+
import { readFindings, FINDINGS_FILENAME } from "../data/access.js";
|
|
10
10
|
import { debugLog, runtimeFile, DOC_TYPES, FINDING_TAGS, isMemoryScopeVisible, normalizeMemoryScope, } from "../shared.js";
|
|
11
11
|
import { FINDING_LIFECYCLE_STATUSES, parseFindingLifecycle, } from "../shared/content.js";
|
|
12
12
|
import { decodeStringRow, queryRows, queryDocRows, queryFragmentLinks, logFragmentMiss, extractSnippet, queryDocBySourceKey, normalizeMemoryId, } from "../shared/index.js";
|
|
@@ -471,10 +471,10 @@ async function handleGetProjectSummary(ctx, { name }) {
|
|
|
471
471
|
if (store && fs.existsSync(path.join(store.path, lookupName))) {
|
|
472
472
|
const projDir = path.join(store.path, lookupName);
|
|
473
473
|
const fsDocs = [];
|
|
474
|
-
for (const [file, type] of [["summary.md", "summary"], ["CLAUDE.md", "claude"], [
|
|
474
|
+
for (const [file, type] of [["summary.md", "summary"], ["CLAUDE.md", "claude"], [FINDINGS_FILENAME, "findings"], ["tasks.md", "task"], ["truths.md", "canonical"]]) {
|
|
475
475
|
const filePath = path.join(projDir, file);
|
|
476
476
|
if (fs.existsSync(filePath)) {
|
|
477
|
-
fsDocs.push({ filename: file, type, content: fs.readFileSync(filePath, "utf8").slice(0, 8000), path: filePath });
|
|
477
|
+
fsDocs.push({ project: lookupName, filename: file, type, content: fs.readFileSync(filePath, "utf8").slice(0, 8000), path: filePath });
|
|
478
478
|
}
|
|
479
479
|
}
|
|
480
480
|
if (fsDocs.length > 0)
|
|
@@ -587,7 +587,7 @@ async function handleListProjects(ctx, { page, page_size }) {
|
|
|
587
587
|
if (projDir) {
|
|
588
588
|
if (fs.existsSync(path.join(projDir, "CLAUDE.md")))
|
|
589
589
|
badges.push("CLAUDE.md");
|
|
590
|
-
if (fs.existsSync(path.join(projDir,
|
|
590
|
+
if (fs.existsSync(path.join(projDir, FINDINGS_FILENAME)))
|
|
591
591
|
badges.push("FINDINGS");
|
|
592
592
|
if (fs.existsSync(path.join(projDir, "summary.md")))
|
|
593
593
|
badges.push("summary");
|
package/dist/tools/session.js
CHANGED
|
@@ -11,7 +11,7 @@ import { runCustomHooks } from "../hooks.js";
|
|
|
11
11
|
import { readExtractedFacts } from "./extract-facts.js";
|
|
12
12
|
import { resolveFindingSessionId } from "../finding/context.js";
|
|
13
13
|
import { readTasks } from "../data/tasks.js";
|
|
14
|
-
import { readFindings } from "../data/access.js";
|
|
14
|
+
import { readFindings, FINDINGS_FILENAME } from "../data/access.js";
|
|
15
15
|
import { getActiveTaskForSession } from "../task/lifecycle.js";
|
|
16
16
|
import { listTaskCheckpoints, writeTaskCheckpoint } from "../session/checkpoints.js";
|
|
17
17
|
import { findMostRecentSummaryWithProject as findMostRecentSummaryRecord, writeLastSummary as writeLastSummaryRecord, } from "../session/artifacts.js";
|
|
@@ -332,7 +332,7 @@ async function hasCompletedTasksInSession(phrenPath, sessionId, project) {
|
|
|
332
332
|
/** Compute what changed since the last session ended. */
|
|
333
333
|
function computeSessionDiff(phrenPath, project, lastSessionEnd) {
|
|
334
334
|
const projectDir = path.join(phrenPath, project);
|
|
335
|
-
const findingsPath = path.join(projectDir,
|
|
335
|
+
const findingsPath = path.join(projectDir, FINDINGS_FILENAME);
|
|
336
336
|
if (!fs.existsSync(findingsPath))
|
|
337
337
|
return { newFindings: 0, superseded: 0, tasksCompleted: 0 };
|
|
338
338
|
const content = fs.readFileSync(findingsPath, "utf8");
|
package/dist/ui/data.js
CHANGED
|
@@ -10,6 +10,7 @@ import { hookConfigPaths, hookConfigRoots } from "../provider-adapters.js";
|
|
|
10
10
|
import { readProjectConfig, isProjectHookEnabled, PROJECT_HOOK_EVENTS } from "../project-config.js";
|
|
11
11
|
import { getAllSkills } from "../skill/registry.js";
|
|
12
12
|
import { resolveTaskFilePath, readTasks, TASKS_FILENAME } from "../data/tasks.js";
|
|
13
|
+
import { FINDINGS_FILENAME } from "../data/access.js";
|
|
13
14
|
import { buildIndex, queryDocBySourceKey, queryRows } from "../shared/index.js";
|
|
14
15
|
import { readProjectTopics, classifyTopicForText } from "../project-topics.js";
|
|
15
16
|
import { entryScoreKey } from "../governance/scores.js";
|
|
@@ -190,7 +191,7 @@ export async function buildGraph(phrenPath, profile, focusProject, existingDb) {
|
|
|
190
191
|
topicMetaMap.set(topic.slug, { slug: topic.slug, label: topic.label });
|
|
191
192
|
}
|
|
192
193
|
}
|
|
193
|
-
const findingsPath = path.join(storePath, project,
|
|
194
|
+
const findingsPath = path.join(storePath, project, FINDINGS_FILENAME);
|
|
194
195
|
const storeName = storePathToName.get(storePath) || "unknown";
|
|
195
196
|
if (!fs.existsSync(findingsPath)) {
|
|
196
197
|
if (!addedProjectNodeIds.has(project)) {
|
|
@@ -260,7 +261,7 @@ export async function buildGraph(phrenPath, profile, focusProject, existingDb) {
|
|
|
260
261
|
if (taggedCount >= MAX_TAGGED)
|
|
261
262
|
continue;
|
|
262
263
|
const topic = classifyTopicForText(`[${currentHeadingTag}] ${text}`, projectTopics);
|
|
263
|
-
const scoreKey = entryScoreKey(project,
|
|
264
|
+
const scoreKey = entryScoreKey(project, FINDINGS_FILENAME, `[${currentHeadingTag}] ${text}`);
|
|
264
265
|
const nodeId = stableId("finding", scoreKey);
|
|
265
266
|
taggedCount++;
|
|
266
267
|
nodes.push({
|
|
@@ -295,7 +296,7 @@ export async function buildGraph(phrenPath, profile, focusProject, existingDb) {
|
|
|
295
296
|
const label = text.length > 55 ? `${text.slice(0, 52)}...` : text;
|
|
296
297
|
// Classify the finding using the project's topic system
|
|
297
298
|
const topic = classifyTopicForText(`[${tag}] ${text}`, projectTopics);
|
|
298
|
-
const scoreKey = entryScoreKey(project,
|
|
299
|
+
const scoreKey = entryScoreKey(project, FINDINGS_FILENAME, `[${tag}] ${text}`);
|
|
299
300
|
const nodeId = stableId("finding", scoreKey);
|
|
300
301
|
taggedCount++;
|
|
301
302
|
nodes.push({
|
|
@@ -330,7 +331,7 @@ export async function buildGraph(phrenPath, profile, focusProject, existingDb) {
|
|
|
330
331
|
const label = text.length > 55 ? `${text.slice(0, 52)}...` : text;
|
|
331
332
|
// Classify using dynamic topics
|
|
332
333
|
const topic = classifyTopicForText(text, projectTopics);
|
|
333
|
-
const scoreKey = entryScoreKey(project,
|
|
334
|
+
const scoreKey = entryScoreKey(project, FINDINGS_FILENAME, text);
|
|
334
335
|
const nodeId = stableId("finding", scoreKey);
|
|
335
336
|
untaggedAdded++;
|
|
336
337
|
nodes.push({
|
|
@@ -566,7 +567,7 @@ export function recentAccepted(phrenPath) {
|
|
|
566
567
|
}
|
|
567
568
|
function buildProjectInfo(basePath, project, store) {
|
|
568
569
|
const dir = path.join(basePath, project);
|
|
569
|
-
const findingsPath = path.join(dir,
|
|
570
|
+
const findingsPath = path.join(dir, FINDINGS_FILENAME);
|
|
570
571
|
const taskPath = resolveTaskFilePath(basePath, project);
|
|
571
572
|
const claudeMdPath = path.join(dir, "CLAUDE.md");
|
|
572
573
|
const summaryPath = path.join(dir, "summary.md");
|
package/dist/ui/server.js
CHANGED
|
@@ -7,7 +7,7 @@ import * as querystring from "querystring";
|
|
|
7
7
|
import { spawn, execFileSync } from "child_process";
|
|
8
8
|
import { computePhrenLiveStateToken, getProjectDirs, } from "../shared.js";
|
|
9
9
|
import { getNonPrimaryStores, subscribeStoreProjects, unsubscribeStoreProjects } from "../store-registry.js";
|
|
10
|
-
import { editFinding, readReviewQueue, removeFinding, readFindings, addFinding as addFindingStore, readTasksAcrossProjects, addTask as addTaskStore, completeTask as completeTaskStore, removeTask as removeTaskStore, updateTask as updateTaskStore, TASKS_FILENAME, } from "../data/access.js";
|
|
10
|
+
import { editFinding, readReviewQueue, removeFinding, readFindings, addFinding as addFindingStore, readTasksAcrossProjects, addTask as addTaskStore, completeTask as completeTaskStore, removeTask as removeTaskStore, updateTask as updateTaskStore, TASKS_FILENAME, FINDINGS_FILENAME, } from "../data/access.js";
|
|
11
11
|
import { isValidProjectName, errorMessage, queueFilePath, safeProjectPath } from "../utils.js";
|
|
12
12
|
import { readInstallPreferences, writeInstallPreferences, writeGovernanceInstallPreferences } from "../init/preferences.js";
|
|
13
13
|
import { buildGraph, collectProjectsForUI, collectSkillsForUI, getHooksData, isAllowedSkillPath, readSyncSnapshot, recentAccepted, recentUsage, } from "./data.js";
|
|
@@ -376,7 +376,7 @@ function handleGetProjectContent(res, url, ctx) {
|
|
|
376
376
|
const file = String(qs.file || "");
|
|
377
377
|
if (!project || !isValidProjectName(project) || !file)
|
|
378
378
|
return jsonErr(res, "Invalid project or file", 400);
|
|
379
|
-
const allowedFiles = [
|
|
379
|
+
const allowedFiles = [FINDINGS_FILENAME, TASKS_FILENAME, "CLAUDE.md", "summary.md"];
|
|
380
380
|
if (!allowedFiles.includes(file))
|
|
381
381
|
return jsonErr(res, `File not allowed: ${file}`, 400);
|
|
382
382
|
const basePath = resolveProjectBasePath(ctx.phrenPath, project);
|
|
@@ -509,7 +509,7 @@ function handleGetSettings(res, url, ctx) {
|
|
|
509
509
|
const projectDir = path.join(ctx.phrenPath, settingsProject);
|
|
510
510
|
const configFile = path.join(projectDir, "phren.project.yaml");
|
|
511
511
|
const projConfig = readProjectConfig(ctx.phrenPath, settingsProject);
|
|
512
|
-
const findingsPath = path.join(projectDir,
|
|
512
|
+
const findingsPath = path.join(projectDir, FINDINGS_FILENAME);
|
|
513
513
|
const taskPath = path.join(projectDir, "tasks.md");
|
|
514
514
|
let findingCount = 0;
|
|
515
515
|
if (fs.existsSync(findingsPath))
|