@phren/cli 0.1.32 → 0.1.34
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/capabilities/cli.js +2 -2
- package/dist/cli/config-access.d.ts +1 -0
- package/dist/cli/config-access.js +59 -0
- package/dist/cli/config-llm.d.ts +1 -0
- package/dist/cli/config-llm.js +60 -0
- package/dist/cli/config-policy.d.ts +11 -0
- package/dist/cli/config-policy.js +328 -0
- package/dist/cli/config-proactivity.d.ts +15 -0
- package/dist/cli/config-proactivity.js +135 -0
- package/dist/cli/config-shared.d.ts +6 -0
- package/dist/cli/config-shared.js +23 -0
- package/dist/cli/config-synonyms.d.ts +1 -0
- package/dist/cli/config-synonyms.js +63 -0
- package/dist/cli/config.d.ts +6 -24
- package/dist/cli/config.js +13 -670
- package/dist/cli/team.js +26 -13
- package/dist/content/dedup.js +25 -3
- package/dist/content/learning.js +10 -16
- package/dist/finding-graph-id.d.ts +15 -0
- package/dist/finding-graph-id.js +58 -0
- package/dist/generated/memory-ui-graph.browser.js +15 -15
- package/dist/governance/activity.d.ts +36 -0
- package/dist/governance/activity.js +83 -0
- package/dist/governance/rbac.d.ts +17 -0
- package/dist/governance/rbac.js +37 -1
- package/dist/governance/scores.js +26 -45
- package/dist/index.js +32 -1
- package/dist/memory-ui-graph.runtime.js +15 -15
- package/dist/phren-paths.d.ts +6 -0
- package/dist/phren-paths.js +8 -0
- package/dist/shared/governance.d.ts +1 -0
- package/dist/shared/governance.js +1 -0
- package/dist/shared/index.d.ts +2 -0
- package/dist/shared/index.js +90 -17
- package/dist/shared/retrieval.js +25 -6
- package/dist/shared.d.ts +1 -1
- package/dist/shared.js +1 -1
- package/dist/telemetry.js +4 -1
- package/dist/tools/config.js +39 -2
- package/dist/tools/finding.d.ts +1 -0
- package/dist/tools/finding.js +40 -2
- package/dist/tools/search.js +28 -1
- package/dist/ui/data.d.ts +2 -0
- package/dist/ui/data.js +8 -3
- package/dist/ui/graph.js +2 -0
- package/dist/ui/page.js +45 -2
- package/dist/ui/scripts.d.ts +13 -0
- package/dist/ui/scripts.js +229 -2
- package/dist/ui/server.js +165 -1
- package/dist/ui/styles.d.ts +1 -0
- package/dist/ui/styles.js +38 -0
- package/package.json +3 -3
- package/dist/cli-hooks-prompt.d.ts +0 -18
- package/dist/cli-hooks-prompt.js +0 -359
- package/dist/cli-hooks-session-handlers.d.ts +0 -3
- package/dist/cli-hooks-session-handlers.js +0 -356
- package/dist/cli-hooks-stop.d.ts +0 -11
- package/dist/cli-hooks-stop.js +0 -584
- package/dist/init-bootstrap.d.ts +0 -5
- package/dist/init-bootstrap.js +0 -21
- package/dist/init-detect.d.ts +0 -8
- package/dist/init-detect.js +0 -38
- package/dist/init-env.d.ts +0 -6
- package/dist/init-env.js +0 -114
- package/dist/init-fresh.d.ts +0 -10
- package/dist/init-fresh.js +0 -234
- package/dist/init-hooks.d.ts +0 -5
- package/dist/init-hooks.js +0 -26
- package/dist/init-mcp.d.ts +0 -8
- package/dist/init-mcp.js +0 -65
- package/dist/init-modes.d.ts +0 -4
- package/dist/init-modes.js +0 -135
- package/dist/init-npm.d.ts +0 -10
- package/dist/init-npm.js +0 -37
- package/dist/init-project-local.d.ts +0 -2
- package/dist/init-project-local.js +0 -99
- package/dist/init-semantic.d.ts +0 -4
- package/dist/init-semantic.js +0 -48
- package/dist/init-types.d.ts +0 -59
- package/dist/init-types.js +0 -1
- package/dist/init-update.d.ts +0 -10
- package/dist/init-update.js +0 -96
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Project-local init mode: creates a .phren directory inside the workspace.
|
|
3
|
-
*/
|
|
4
|
-
import * as fs from "fs";
|
|
5
|
-
import * as path from "path";
|
|
6
|
-
import { atomicWriteText, debugLog, readRootManifest, writeRootManifest, } from "./shared.js";
|
|
7
|
-
import { errorMessage } from "./utils.js";
|
|
8
|
-
import { configureVSCode, logMcpTargetStatus, } from "./init/config.js";
|
|
9
|
-
import { writeInstallPreferences, } from "./init/preferences.js";
|
|
10
|
-
import { ensureGovernanceFiles, repairPreexistingInstall, runPostInitVerify, bootstrapFromExisting, detectProjectDir, } from "./init/setup.js";
|
|
11
|
-
import { getProjectOwnershipDefault, } from "./project-config.js";
|
|
12
|
-
import { VERSION, log } from "./init/shared.js";
|
|
13
|
-
import { applyOnboardingPreferences } from "./init-env.js";
|
|
14
|
-
export async function runProjectLocalInit(opts = {}) {
|
|
15
|
-
const detectedRoot = detectProjectDir(process.cwd(), path.join(process.cwd(), ".phren")) || process.cwd();
|
|
16
|
-
const hasWorkspaceMarker = fs.existsSync(path.join(detectedRoot, ".git")) ||
|
|
17
|
-
fs.existsSync(path.join(detectedRoot, "CLAUDE.md")) ||
|
|
18
|
-
fs.existsSync(path.join(detectedRoot, "AGENTS.md")) ||
|
|
19
|
-
fs.existsSync(path.join(detectedRoot, ".claude", "CLAUDE.md"));
|
|
20
|
-
if (!hasWorkspaceMarker) {
|
|
21
|
-
throw new Error("project-local mode must be run inside a repo or project root");
|
|
22
|
-
}
|
|
23
|
-
const workspaceRoot = path.resolve(detectedRoot);
|
|
24
|
-
const phrenPath = path.join(workspaceRoot, ".phren");
|
|
25
|
-
const existingManifest = readRootManifest(phrenPath);
|
|
26
|
-
if (existingManifest && existingManifest.installMode !== "project-local") {
|
|
27
|
-
throw new Error(`Refusing to reuse non-local phren root at ${phrenPath}`);
|
|
28
|
-
}
|
|
29
|
-
const ownershipDefault = opts.projectOwnershipDefault
|
|
30
|
-
?? (existingManifest ? getProjectOwnershipDefault(phrenPath) : "detached");
|
|
31
|
-
if (!existingManifest && !opts.projectOwnershipDefault) {
|
|
32
|
-
opts.projectOwnershipDefault = ownershipDefault;
|
|
33
|
-
}
|
|
34
|
-
const mcpEnabled = opts.mcp ? opts.mcp === "on" : true;
|
|
35
|
-
const projectName = path.basename(workspaceRoot).toLowerCase().replace(/[^a-z0-9_-]/g, "-");
|
|
36
|
-
if (opts.dryRun) {
|
|
37
|
-
log("\nInit dry run. No files will be written.\n");
|
|
38
|
-
log(`Mode: project-local`);
|
|
39
|
-
log(`Workspace root: ${workspaceRoot}`);
|
|
40
|
-
log(`Phren root: ${phrenPath}`);
|
|
41
|
-
log(`Project: ${projectName}`);
|
|
42
|
-
log(`VS Code workspace MCP: ${mcpEnabled ? "on" : "off"}`);
|
|
43
|
-
log(`Hooks: unsupported in project-local mode`);
|
|
44
|
-
log("");
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
fs.mkdirSync(phrenPath, { recursive: true });
|
|
48
|
-
writeRootManifest(phrenPath, {
|
|
49
|
-
version: 1,
|
|
50
|
-
installMode: "project-local",
|
|
51
|
-
syncMode: "workspace-git",
|
|
52
|
-
workspaceRoot,
|
|
53
|
-
primaryProject: projectName,
|
|
54
|
-
});
|
|
55
|
-
ensureGovernanceFiles(phrenPath);
|
|
56
|
-
repairPreexistingInstall(phrenPath);
|
|
57
|
-
fs.mkdirSync(path.join(phrenPath, "global", "skills"), { recursive: true });
|
|
58
|
-
fs.mkdirSync(path.join(phrenPath, ".runtime"), { recursive: true });
|
|
59
|
-
fs.mkdirSync(path.join(phrenPath, ".sessions"), { recursive: true });
|
|
60
|
-
if (!fs.existsSync(path.join(phrenPath, ".gitignore"))) {
|
|
61
|
-
atomicWriteText(path.join(phrenPath, ".gitignore"), [
|
|
62
|
-
".runtime/",
|
|
63
|
-
".sessions/",
|
|
64
|
-
"*.lock",
|
|
65
|
-
"*.tmp-*",
|
|
66
|
-
"",
|
|
67
|
-
].join("\n"));
|
|
68
|
-
}
|
|
69
|
-
if (!fs.existsSync(path.join(phrenPath, "global", "CLAUDE.md"))) {
|
|
70
|
-
atomicWriteText(path.join(phrenPath, "global", "CLAUDE.md"), "# Global Context\n\nRepo-local Phren instructions shared across this workspace.\n");
|
|
71
|
-
}
|
|
72
|
-
const created = bootstrapFromExisting(phrenPath, workspaceRoot, { ownership: ownershipDefault });
|
|
73
|
-
applyOnboardingPreferences(phrenPath, opts);
|
|
74
|
-
writeInstallPreferences(phrenPath, {
|
|
75
|
-
mcpEnabled,
|
|
76
|
-
hooksEnabled: false,
|
|
77
|
-
skillsScope: opts.skillsScope ?? "global",
|
|
78
|
-
installedVersion: VERSION,
|
|
79
|
-
});
|
|
80
|
-
try {
|
|
81
|
-
const vscodeResult = configureVSCode(phrenPath, { mcpEnabled, scope: "workspace" });
|
|
82
|
-
logMcpTargetStatus("VS Code", vscodeResult, existingManifest ? "Updated" : "Configured");
|
|
83
|
-
}
|
|
84
|
-
catch (err) {
|
|
85
|
-
debugLog(`configureVSCode(workspace) failed: ${errorMessage(err)}`);
|
|
86
|
-
}
|
|
87
|
-
log(`\n${existingManifest ? "Updated" : "Created"} project-local phren at ${phrenPath}`);
|
|
88
|
-
log(` Workspace root: ${workspaceRoot}`);
|
|
89
|
-
log(` Project: ${created.project}`);
|
|
90
|
-
log(` Ownership: ${created.ownership}`);
|
|
91
|
-
log(` Sync mode: workspace-git`);
|
|
92
|
-
log(` Hooks: off (unsupported in project-local mode)`);
|
|
93
|
-
log(` VS Code MCP: ${mcpEnabled ? "workspace on" : "workspace off"}`);
|
|
94
|
-
const verify = runPostInitVerify(phrenPath);
|
|
95
|
-
log(`\nVerifying setup...`);
|
|
96
|
-
for (const check of verify.checks) {
|
|
97
|
-
log(` ${check.ok ? "pass" : "FAIL"} ${check.name}: ${check.detail}`);
|
|
98
|
-
}
|
|
99
|
-
}
|
package/dist/init-semantic.d.ts
DELETED
package/dist/init-semantic.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Semantic search warm-up for init.
|
|
3
|
-
*/
|
|
4
|
-
export async function warmSemanticSearch(phrenPath, profile) {
|
|
5
|
-
const { checkOllamaAvailable, checkModelAvailable, getOllamaUrl, getEmbeddingModel } = await import("./shared/ollama.js");
|
|
6
|
-
const ollamaUrl = getOllamaUrl();
|
|
7
|
-
if (!ollamaUrl)
|
|
8
|
-
return "Semantic search: disabled.";
|
|
9
|
-
const model = getEmbeddingModel();
|
|
10
|
-
if (!await checkOllamaAvailable()) {
|
|
11
|
-
return `Semantic search not warmed: Ollama offline at ${ollamaUrl}.`;
|
|
12
|
-
}
|
|
13
|
-
if (!await checkModelAvailable()) {
|
|
14
|
-
return `Semantic search not warmed: model ${model} is not pulled yet.`;
|
|
15
|
-
}
|
|
16
|
-
const { buildIndex, listIndexedDocumentPaths } = await import("./shared/index.js");
|
|
17
|
-
const { getEmbeddingCache, formatEmbeddingCoverage } = await import("./shared/embedding-cache.js");
|
|
18
|
-
const { backgroundEmbedMissingDocs } = await import("./startup-embedding.js");
|
|
19
|
-
const { getPersistentVectorIndex } = await import("./shared/vector-index.js");
|
|
20
|
-
const db = await buildIndex(phrenPath, profile);
|
|
21
|
-
try {
|
|
22
|
-
const cache = getEmbeddingCache(phrenPath);
|
|
23
|
-
await cache.load().catch(() => { });
|
|
24
|
-
const allPaths = listIndexedDocumentPaths(phrenPath, profile);
|
|
25
|
-
const before = cache.coverage(allPaths);
|
|
26
|
-
if (before.missing > 0) {
|
|
27
|
-
await backgroundEmbedMissingDocs(db, cache);
|
|
28
|
-
}
|
|
29
|
-
await cache.load().catch(() => { });
|
|
30
|
-
const after = cache.coverage(allPaths);
|
|
31
|
-
if (cache.size() > 0) {
|
|
32
|
-
getPersistentVectorIndex(phrenPath).ensure(cache.getAllEntries());
|
|
33
|
-
}
|
|
34
|
-
if (after.total === 0) {
|
|
35
|
-
return `Semantic search ready (${model}), but there are no indexed docs yet.`;
|
|
36
|
-
}
|
|
37
|
-
const embeddedNow = Math.max(0, after.embedded - before.embedded);
|
|
38
|
-
const prefix = after.state === "warm" ? "Semantic search warmed" : "Semantic search warming";
|
|
39
|
-
const delta = embeddedNow > 0 ? `; embedded ${embeddedNow} new docs during init` : "";
|
|
40
|
-
return `${prefix}: ${model}, ${formatEmbeddingCoverage(after)}${delta}.`;
|
|
41
|
-
}
|
|
42
|
-
finally {
|
|
43
|
-
try {
|
|
44
|
-
db.close();
|
|
45
|
-
}
|
|
46
|
-
catch { /* ignore close errors in init */ }
|
|
47
|
-
}
|
|
48
|
-
}
|
package/dist/init-types.d.ts
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared types for init modules. Separated to avoid circular dependencies.
|
|
3
|
-
*/
|
|
4
|
-
import type { InstallMode } from "./shared.js";
|
|
5
|
-
import type { ProjectOwnershipMode } from "./project-config.js";
|
|
6
|
-
import type { ProactivityLevel } from "./proactivity.js";
|
|
7
|
-
import type { McpMode, WorkflowRiskSection, StorageLocationChoice } from "./init-walkthrough.js";
|
|
8
|
-
import type { InitProjectDomain, InferredInitScaffold } from "./init/setup.js";
|
|
9
|
-
export type SkillsScope = "global" | "project";
|
|
10
|
-
export interface InitOptions {
|
|
11
|
-
mode?: InstallMode;
|
|
12
|
-
machine?: string;
|
|
13
|
-
profile?: string;
|
|
14
|
-
mcp?: McpMode;
|
|
15
|
-
hooks?: McpMode;
|
|
16
|
-
projectOwnershipDefault?: ProjectOwnershipMode;
|
|
17
|
-
findingsProactivity?: ProactivityLevel;
|
|
18
|
-
taskProactivity?: ProactivityLevel;
|
|
19
|
-
lowConfidenceThreshold?: number;
|
|
20
|
-
riskySections?: WorkflowRiskSection[];
|
|
21
|
-
taskMode?: "off" | "manual" | "suggest" | "auto";
|
|
22
|
-
findingSensitivity?: "minimal" | "conservative" | "balanced" | "aggressive";
|
|
23
|
-
skillsScope?: SkillsScope;
|
|
24
|
-
applyStarterUpdate?: boolean;
|
|
25
|
-
dryRun?: boolean;
|
|
26
|
-
yes?: boolean;
|
|
27
|
-
template?: "python-project" | "monorepo" | "library" | "frontend" | string;
|
|
28
|
-
/** Set by walkthrough to pass project name to init logic */
|
|
29
|
-
_walkthroughProject?: string;
|
|
30
|
-
/** Set by walkthrough for personalized GitHub next-steps output */
|
|
31
|
-
_walkthroughGithub?: {
|
|
32
|
-
username?: string;
|
|
33
|
-
repo: string;
|
|
34
|
-
};
|
|
35
|
-
/** Set by walkthrough to seed project docs/topics by domain */
|
|
36
|
-
_walkthroughDomain?: InitProjectDomain;
|
|
37
|
-
/** Set by walkthrough to seed adaptive project scaffold from current repo content */
|
|
38
|
-
_walkthroughInferredScaffold?: InferredInitScaffold;
|
|
39
|
-
/** Set by walkthrough when user enables auto-capture; triggers writing ~/.phren/.env */
|
|
40
|
-
_walkthroughAutoCapture?: boolean;
|
|
41
|
-
/** Set by walkthrough when user opts into local semantic search */
|
|
42
|
-
_walkthroughSemanticSearch?: boolean;
|
|
43
|
-
/** Set by walkthrough when user enables LLM semantic dedup */
|
|
44
|
-
_walkthroughSemanticDedup?: boolean;
|
|
45
|
-
/** Set by walkthrough when user enables LLM conflict detection */
|
|
46
|
-
_walkthroughSemanticConflict?: boolean;
|
|
47
|
-
/** Set by walkthrough when user provides a git clone URL for existing phren */
|
|
48
|
-
_walkthroughCloneUrl?: string;
|
|
49
|
-
/** Set by walkthrough when the user wants the current repo enrolled immediately */
|
|
50
|
-
_walkthroughBootstrapCurrentProject?: boolean;
|
|
51
|
-
/** Set by walkthrough for the ownership mode selected for the current repo */
|
|
52
|
-
_walkthroughBootstrapOwnership?: ProjectOwnershipMode;
|
|
53
|
-
/** Set by walkthrough to select where phren data is stored */
|
|
54
|
-
_walkthroughStorageChoice?: StorageLocationChoice;
|
|
55
|
-
/** Set by walkthrough to pass resolved storage path to init logic */
|
|
56
|
-
_walkthroughStoragePath?: string;
|
|
57
|
-
/** Set by walkthrough when project-local storage is chosen */
|
|
58
|
-
_walkthroughStorageRepoRoot?: string;
|
|
59
|
-
}
|
package/dist/init-types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/init-update.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { InitOptions, SkillsScope } from "./init-types.js";
|
|
2
|
-
export declare function runExistingInstallUpdate(phrenPath: string, opts: InitOptions, params: {
|
|
3
|
-
mcpEnabled: boolean;
|
|
4
|
-
hooksEnabled: boolean;
|
|
5
|
-
skillsScope: SkillsScope;
|
|
6
|
-
ownershipDefault: string;
|
|
7
|
-
syncIntent: "sync" | "local";
|
|
8
|
-
shouldBootstrapCurrentProject: boolean;
|
|
9
|
-
bootstrapOwnership: string;
|
|
10
|
-
}): Promise<void>;
|
package/dist/init-update.js
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Update logic for existing phren installs.
|
|
3
|
-
*/
|
|
4
|
-
import { hookConfigPath, writeRootManifest, } from "./shared.js";
|
|
5
|
-
import { isVersionNewer } from "./init-npm.js";
|
|
6
|
-
import { readInstallPreferences, writeInstallPreferences, } from "./init/preferences.js";
|
|
7
|
-
import { ensureGovernanceFiles, repairPreexistingInstall, runPostInitVerify, applyStarterTemplateUpdates, ensureLocalGitRepo, } from "./init/setup.js";
|
|
8
|
-
import { getWorkflowPolicy } from "./shared/governance.js";
|
|
9
|
-
import { VERSION, log, confirmPrompt } from "./init/shared.js";
|
|
10
|
-
import { configureMcpTargets } from "./init-mcp.js";
|
|
11
|
-
import { configureHooksIfEnabled } from "./init-hooks.js";
|
|
12
|
-
import { applyOnboardingPreferences, writeWalkthroughEnvDefaults, collectRepairedAssetLabels, } from "./init-env.js";
|
|
13
|
-
import { getPendingBootstrapTarget } from "./init-detect.js";
|
|
14
|
-
import { bootstrapProject } from "./init-bootstrap.js";
|
|
15
|
-
export async function runExistingInstallUpdate(phrenPath, opts, params) {
|
|
16
|
-
const { mcpEnabled, hooksEnabled, skillsScope, ownershipDefault, syncIntent, shouldBootstrapCurrentProject, bootstrapOwnership, } = params;
|
|
17
|
-
const mcpLabel = mcpEnabled ? "ON (recommended)" : "OFF (hooks-only fallback)";
|
|
18
|
-
const hooksLabel = hooksEnabled ? "ON (active)" : "OFF (disabled)";
|
|
19
|
-
writeRootManifest(phrenPath, {
|
|
20
|
-
version: 1,
|
|
21
|
-
installMode: "shared",
|
|
22
|
-
syncMode: "managed-git",
|
|
23
|
-
});
|
|
24
|
-
ensureGovernanceFiles(phrenPath);
|
|
25
|
-
const repaired = repairPreexistingInstall(phrenPath);
|
|
26
|
-
applyOnboardingPreferences(phrenPath, opts);
|
|
27
|
-
const existingGitRepo = ensureLocalGitRepo(phrenPath);
|
|
28
|
-
log(`\nphren already exists at ${phrenPath}`);
|
|
29
|
-
log(`Updating configuration...\n`);
|
|
30
|
-
log(` MCP mode: ${mcpLabel}`);
|
|
31
|
-
log(` Hooks mode: ${hooksLabel}`);
|
|
32
|
-
log(` Default project ownership: ${ownershipDefault}`);
|
|
33
|
-
log(` Task mode: ${getWorkflowPolicy(phrenPath).taskMode}`);
|
|
34
|
-
log(` Git repo: ${existingGitRepo.detail}`);
|
|
35
|
-
// Confirmation prompt before writing config
|
|
36
|
-
if (!opts.yes) {
|
|
37
|
-
const settingsPath = hookConfigPath("claude");
|
|
38
|
-
const modifications = [];
|
|
39
|
-
modifications.push(` ${settingsPath} (update MCP server + hooks)`);
|
|
40
|
-
log(`\nWill modify:`);
|
|
41
|
-
for (const mod of modifications)
|
|
42
|
-
log(mod);
|
|
43
|
-
const confirmed = await confirmPrompt("\nProceed?");
|
|
44
|
-
if (!confirmed) {
|
|
45
|
-
log("Aborted.");
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
// Always reconfigure MCP and hooks (picks up new features on upgrade)
|
|
50
|
-
configureMcpTargets(phrenPath, { mcpEnabled, hooksEnabled }, "Updated");
|
|
51
|
-
configureHooksIfEnabled(phrenPath, hooksEnabled, "Updated");
|
|
52
|
-
const prefs = readInstallPreferences(phrenPath);
|
|
53
|
-
const previousVersion = prefs.installedVersion;
|
|
54
|
-
if (isVersionNewer(VERSION, previousVersion)) {
|
|
55
|
-
log(`\n Starter template update available: v${previousVersion} -> v${VERSION}`);
|
|
56
|
-
log(` Run \`phren init --apply-starter-update\` to refresh global/CLAUDE.md and global skills.`);
|
|
57
|
-
}
|
|
58
|
-
if (opts.applyStarterUpdate) {
|
|
59
|
-
const updated = applyStarterTemplateUpdates(phrenPath);
|
|
60
|
-
if (updated.length) {
|
|
61
|
-
log(` Applied starter template updates (${updated.length} file${updated.length === 1 ? "" : "s"}).`);
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
log(` No starter template updates were applied (starter files not found).`);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
writeInstallPreferences(phrenPath, { mcpEnabled, hooksEnabled, skillsScope, installedVersion: VERSION, syncIntent });
|
|
68
|
-
if (repaired.removedLegacyProjects > 0) {
|
|
69
|
-
log(` Removed ${repaired.removedLegacyProjects} legacy starter project entr${repaired.removedLegacyProjects === 1 ? "y" : "ies"} from profiles.`);
|
|
70
|
-
}
|
|
71
|
-
const repairedAssets = collectRepairedAssetLabels(repaired);
|
|
72
|
-
if (repairedAssets.length > 0) {
|
|
73
|
-
log(` Recreated missing generated assets: ${repairedAssets.join(", ")}`);
|
|
74
|
-
}
|
|
75
|
-
// Post-update verification
|
|
76
|
-
log(`\nVerifying setup...`);
|
|
77
|
-
const verify = runPostInitVerify(phrenPath);
|
|
78
|
-
for (const check of verify.checks) {
|
|
79
|
-
log(` ${check.ok ? "pass" : "FAIL"} ${check.name}: ${check.detail}`);
|
|
80
|
-
}
|
|
81
|
-
const pendingBootstrap = getPendingBootstrapTarget(phrenPath, opts);
|
|
82
|
-
if (pendingBootstrap && shouldBootstrapCurrentProject) {
|
|
83
|
-
bootstrapProject(phrenPath, pendingBootstrap.path, opts.profile, bootstrapOwnership, "Added current project");
|
|
84
|
-
}
|
|
85
|
-
for (const envLabel of writeWalkthroughEnvDefaults(phrenPath, opts)) {
|
|
86
|
-
log(` ${envLabel}`);
|
|
87
|
-
}
|
|
88
|
-
log(`\n\x1b[95m◆\x1b[0m phren updated successfully`);
|
|
89
|
-
log(`\nNext steps:`);
|
|
90
|
-
log(` 1. Start a new Claude session in your project directory — phren injects context automatically`);
|
|
91
|
-
log(` 2. Run \`phren doctor\` to verify everything is wired correctly`);
|
|
92
|
-
log(` 3. Change defaults anytime: \`phren config project-ownership\`, \`phren config workflow\`, \`phren config proactivity.findings\`, \`phren config proactivity.tasks\``);
|
|
93
|
-
log(` 4. After your first week, run phren-discover to surface gaps in your project knowledge`);
|
|
94
|
-
log(` 5. After working across projects, run phren-consolidate to find cross-project patterns`);
|
|
95
|
-
log(``);
|
|
96
|
-
}
|