@phren/cli 0.0.56 → 0.0.58
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.d.ts +2 -0
- package/dist/capabilities/index.d.ts +7 -0
- package/dist/capabilities/mcp.d.ts +2 -0
- package/dist/capabilities/types.d.ts +12 -0
- package/dist/capabilities/vscode.d.ts +2 -0
- package/dist/capabilities/web-ui.d.ts +2 -0
- package/dist/cli/actions.d.ts +16 -0
- package/dist/cli/cli.d.ts +3 -0
- package/dist/cli/config.d.ts +24 -0
- package/dist/cli/extract.d.ts +22 -0
- package/dist/cli/govern.d.ts +11 -0
- package/dist/cli/graph.d.ts +15 -0
- package/dist/cli/hooks-citations.d.ts +8 -0
- package/dist/cli/hooks-context.d.ts +34 -0
- package/dist/cli/hooks-globs.d.ts +2 -0
- package/dist/cli/hooks-output.d.ts +2 -0
- package/dist/cli/hooks-session.d.ts +38 -0
- package/dist/cli/hooks.d.ts +12 -0
- package/dist/cli/namespaces.d.ts +11 -0
- package/dist/cli/ops.d.ts +5 -0
- package/dist/cli/search.d.ts +38 -0
- package/dist/cli/team.d.ts +1 -0
- package/dist/cli-hooks-git.d.ts +35 -0
- package/dist/cli-hooks-prompt.d.ts +18 -0
- package/dist/cli-hooks-session-handlers.d.ts +3 -0
- package/dist/cli-hooks-stop.d.ts +11 -0
- package/dist/content/archive.d.ts +13 -0
- package/dist/content/citation.d.ts +50 -0
- package/dist/content/dedup.d.ts +55 -0
- package/dist/content/learning.d.ts +29 -0
- package/dist/content/metadata.d.ts +107 -0
- package/dist/content/validate.d.ts +70 -0
- package/dist/core/finding.d.ts +25 -0
- package/dist/core/project.d.ts +16 -0
- package/dist/core/search.d.ts +13 -0
- package/dist/data/access.d.ts +83 -0
- package/dist/data/tasks.d.ts +89 -0
- package/dist/embedding.d.ts +54 -0
- package/dist/entrypoint.d.ts +1 -0
- package/dist/finding/context.d.ts +8 -0
- package/dist/finding/impact.d.ts +11 -0
- package/dist/finding/journal.d.ts +40 -0
- package/dist/finding/lifecycle.d.ts +40 -0
- package/dist/governance/audit.d.ts +1 -0
- package/dist/governance/locks.d.ts +3 -0
- package/dist/governance/policy.d.ts +109 -0
- package/dist/governance/rbac.d.ts +25 -0
- package/dist/governance/scores.d.ts +12 -0
- package/dist/hooks.d.ts +59 -0
- package/dist/index-query.d.ts +33 -0
- package/dist/index.d.ts +2 -0
- package/dist/init/config.d.ts +43 -0
- package/dist/init/init-configure.d.ts +21 -0
- package/dist/init/init-hooks-mode.d.ts +1 -0
- package/dist/init/init-mcp-mode.d.ts +1 -0
- package/dist/init/init-uninstall.d.ts +3 -0
- package/dist/init/init-walkthrough.d.ts +61 -0
- package/dist/init/init.d.ts +84 -0
- package/dist/init/preferences.d.ts +28 -0
- package/dist/init/setup.d.ts +86 -0
- package/dist/init/shared.d.ts +13 -0
- package/dist/init-bootstrap.d.ts +5 -0
- package/dist/init-detect.d.ts +8 -0
- package/dist/init-env.d.ts +6 -0
- package/dist/init-fresh.d.ts +10 -0
- package/dist/init-hooks.d.ts +5 -0
- package/dist/init-mcp.d.ts +8 -0
- package/dist/init-modes.d.ts +4 -0
- package/dist/init-npm.d.ts +10 -0
- package/dist/init-project-local.d.ts +2 -0
- package/dist/init-semantic.d.ts +4 -0
- package/dist/init-types.d.ts +59 -0
- package/dist/init-uninstall.d.ts +3 -0
- package/dist/init-update.d.ts +10 -0
- package/dist/init-walkthrough.d.ts +55 -0
- package/dist/link/checksums.d.ts +8 -0
- package/dist/link/context.d.ts +7 -0
- package/dist/link/doctor.d.ts +2 -0
- package/dist/link/link.d.ts +29 -0
- package/dist/link/skills.d.ts +47 -0
- package/dist/logger.d.ts +9 -0
- package/dist/machine-identity.d.ts +4 -0
- package/dist/package-metadata.d.ts +4 -0
- package/dist/phren-art.d.ts +26 -0
- package/dist/phren-core.d.ts +64 -0
- package/dist/phren-dotenv.d.ts +2 -0
- package/dist/phren-paths.d.ts +60 -0
- package/dist/proactivity.d.ts +13 -0
- package/dist/profile-store.d.ts +34 -0
- package/dist/project-config.d.ts +60 -0
- package/dist/project-locator.d.ts +1 -0
- package/dist/project-topics.d.ts +122 -0
- package/dist/provider-adapters.d.ts +34 -0
- package/dist/query-correlation.d.ts +31 -0
- package/dist/runtime-profile.d.ts +6 -0
- package/dist/session/checkpoints.d.ts +25 -0
- package/dist/session/utils.d.ts +43 -0
- package/dist/shared/content.d.ts +7 -0
- package/dist/shared/data-utils.d.ts +8 -0
- package/dist/shared/embedding-cache.d.ts +30 -0
- package/dist/shared/fragment-graph.d.ts +60 -0
- package/dist/shared/governance.d.ts +4 -0
- package/dist/shared/index.d.ts +29 -0
- package/dist/shared/ollama.d.ts +28 -0
- package/dist/shared/process.d.ts +17 -0
- package/dist/shared/retrieval.d.ts +84 -0
- package/dist/shared/search-fallback.d.ts +23 -0
- package/dist/shared/sqljs.d.ts +5 -0
- package/dist/shared/stemmer.d.ts +5 -0
- package/dist/shared/vector-index.d.ts +18 -0
- package/dist/shared.d.ts +9 -0
- package/dist/shell/entry.d.ts +26 -0
- package/dist/shell/input.d.ts +57 -0
- package/dist/shell/palette.d.ts +13 -0
- package/dist/shell/render-api.d.ts +29 -0
- package/dist/shell/render-api.js +101 -0
- package/dist/shell/render.d.ts +50 -0
- package/dist/shell/shell.d.ts +61 -0
- package/dist/shell/state-store.d.ts +14 -0
- package/dist/shell/types.d.ts +29 -0
- package/dist/shell/view-list.d.ts +5 -0
- package/dist/shell/view.d.ts +34 -0
- package/dist/skill/files.d.ts +5 -0
- package/dist/skill/registry.d.ts +55 -0
- package/dist/skill/state.d.ts +3 -0
- package/dist/startup-embedding.d.ts +15 -0
- package/dist/status.d.ts +1 -0
- package/dist/store-registry.d.ts +60 -0
- package/dist/store-routing.d.ts +37 -0
- package/dist/task/github.d.ts +22 -0
- package/dist/task/hygiene.d.ts +13 -0
- package/dist/task/lifecycle.d.ts +26 -0
- package/dist/telemetry.d.ts +10 -0
- package/dist/test-global-setup.d.ts +14 -0
- package/dist/tool-registry.d.ts +14 -0
- package/dist/tools/config.d.ts +3 -0
- package/dist/tools/data.d.ts +3 -0
- package/dist/tools/extract-facts.d.ts +17 -0
- package/dist/tools/extract.d.ts +3 -0
- package/dist/tools/finding.d.ts +3 -0
- package/dist/tools/graph.d.ts +3 -0
- package/dist/tools/hooks.d.ts +3 -0
- package/dist/tools/memory.d.ts +3 -0
- package/dist/tools/ops.d.ts +3 -0
- package/dist/tools/search.d.ts +8 -0
- package/dist/tools/session.d.ts +44 -0
- package/dist/tools/skills.d.ts +3 -0
- package/dist/tools/tasks.d.ts +3 -0
- package/dist/tools/types.d.ts +50 -0
- package/dist/ui/assets.d.ts +2 -0
- package/dist/ui/data.d.ts +113 -0
- package/dist/ui/graph.d.ts +1 -0
- package/dist/ui/memory-ui.d.ts +4 -0
- package/dist/ui/page.d.ts +2 -0
- package/dist/ui/scripts.d.ts +17 -0
- package/dist/ui/server.d.ts +17 -0
- package/dist/ui/styles.d.ts +4 -0
- package/dist/update.d.ts +9 -0
- package/dist/utils-fts.d.ts +12 -0
- package/dist/utils-fts.js +450 -0
- package/dist/utils-helpers.d.ts +12 -0
- package/dist/utils-helpers.js +80 -0
- package/dist/utils-paths.d.ts +3 -0
- package/dist/utils-paths.js +61 -0
- package/dist/utils.d.ts +3 -0
- package/dist/utils.js +8 -587
- package/package.json +45 -10
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { type PhrenResult } from "../shared.js";
|
|
2
|
+
import { type ProjectConfigOverrides } from "../project-config.js";
|
|
3
|
+
/** @internal Exported for tests. */
|
|
4
|
+
export declare const MAX_QUEUE_ENTRY_LENGTH = 500;
|
|
5
|
+
export interface RetentionPolicy {
|
|
6
|
+
schemaVersion?: number;
|
|
7
|
+
ttlDays: number;
|
|
8
|
+
retentionDays: number;
|
|
9
|
+
autoAcceptThreshold: number;
|
|
10
|
+
minInjectConfidence: number;
|
|
11
|
+
decay: {
|
|
12
|
+
d30: number;
|
|
13
|
+
d60: number;
|
|
14
|
+
d90: number;
|
|
15
|
+
d120: number;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export interface WorkflowPolicy {
|
|
19
|
+
schemaVersion?: number;
|
|
20
|
+
lowConfidenceThreshold: number;
|
|
21
|
+
riskySections: Array<"Review" | "Stale" | "Conflicts">;
|
|
22
|
+
taskMode: "off" | "manual" | "suggest" | "auto";
|
|
23
|
+
findingSensitivity: "minimal" | "conservative" | "balanced" | "aggressive";
|
|
24
|
+
}
|
|
25
|
+
export interface IndexPolicy {
|
|
26
|
+
schemaVersion?: number;
|
|
27
|
+
includeGlobs: string[];
|
|
28
|
+
excludeGlobs: string[];
|
|
29
|
+
includeHidden: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface RuntimeHealth {
|
|
32
|
+
schemaVersion?: number;
|
|
33
|
+
lastSessionStartAt?: string;
|
|
34
|
+
lastPromptAt?: string;
|
|
35
|
+
lastStopAt?: string;
|
|
36
|
+
lastAutoSave?: {
|
|
37
|
+
at: string;
|
|
38
|
+
status: "clean" | "saved-local" | "saved-pushed" | "no-upstream" | "error";
|
|
39
|
+
detail?: string;
|
|
40
|
+
};
|
|
41
|
+
lastGovernance?: {
|
|
42
|
+
at: string;
|
|
43
|
+
status: "ok" | "error";
|
|
44
|
+
detail: string;
|
|
45
|
+
};
|
|
46
|
+
lastSync?: {
|
|
47
|
+
lastPullAt?: string;
|
|
48
|
+
lastPullStatus?: "ok" | "error";
|
|
49
|
+
lastPullDetail?: string;
|
|
50
|
+
lastSuccessfulPullAt?: string;
|
|
51
|
+
lastPushAt?: string;
|
|
52
|
+
lastPushStatus?: "saved-local" | "saved-pushed" | "no-upstream" | "error";
|
|
53
|
+
lastPushDetail?: string;
|
|
54
|
+
unsyncedCommits?: number;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
export type SyncStatus = NonNullable<RuntimeHealth["lastSync"]>;
|
|
58
|
+
export interface BuildSyncStatusOpts {
|
|
59
|
+
now: string;
|
|
60
|
+
pushStatus: SyncStatus["lastPushStatus"];
|
|
61
|
+
pushDetail?: string;
|
|
62
|
+
pullAt?: string;
|
|
63
|
+
pullStatus?: SyncStatus["lastPullStatus"];
|
|
64
|
+
pullDetail?: string;
|
|
65
|
+
successfulPullAt?: string;
|
|
66
|
+
unsyncedCommits?: number;
|
|
67
|
+
}
|
|
68
|
+
export declare function buildSyncStatus(opts: BuildSyncStatusOpts): SyncStatus;
|
|
69
|
+
export type RetentionPolicyPatch = Partial<Omit<RetentionPolicy, "decay">> & {
|
|
70
|
+
decay?: Partial<RetentionPolicy["decay"]>;
|
|
71
|
+
};
|
|
72
|
+
export declare const GOVERNANCE_SCHEMA_VERSION = 1;
|
|
73
|
+
type GovernanceSchema = "retention-policy" | "workflow-policy" | "index-policy";
|
|
74
|
+
export declare function validateGovernanceJson(filePath: string, schema: GovernanceSchema): boolean;
|
|
75
|
+
export interface ResolvedConfig {
|
|
76
|
+
findingSensitivity: WorkflowPolicy["findingSensitivity"];
|
|
77
|
+
proactivity: {
|
|
78
|
+
base?: "high" | "medium" | "low";
|
|
79
|
+
findings?: "high" | "medium" | "low";
|
|
80
|
+
tasks?: "high" | "medium" | "low";
|
|
81
|
+
};
|
|
82
|
+
taskMode: WorkflowPolicy["taskMode"];
|
|
83
|
+
retentionPolicy: RetentionPolicy;
|
|
84
|
+
workflowPolicy: WorkflowPolicy;
|
|
85
|
+
}
|
|
86
|
+
export declare const VALID_TASK_MODES: readonly ["off", "manual", "suggest", "auto"];
|
|
87
|
+
export type TaskMode = typeof VALID_TASK_MODES[number];
|
|
88
|
+
export declare const VALID_FINDING_SENSITIVITY: readonly ["minimal", "conservative", "balanced", "aggressive"];
|
|
89
|
+
export type FindingSensitivityLevel = typeof VALID_FINDING_SENSITIVITY[number];
|
|
90
|
+
export declare function getProjectConfigOverrides(phrenPath: string, projectName: string): ProjectConfigOverrides | null;
|
|
91
|
+
export declare function mergeConfig(phrenPath: string, projectName?: string, profile?: string): ResolvedConfig;
|
|
92
|
+
export declare function getRetentionPolicy(phrenPath: string, projectName?: string): RetentionPolicy;
|
|
93
|
+
export declare function updateRetentionPolicy(phrenPath: string, patch: RetentionPolicyPatch): PhrenResult<RetentionPolicy>;
|
|
94
|
+
export declare function getWorkflowPolicy(phrenPath: string, projectName?: string): WorkflowPolicy;
|
|
95
|
+
export declare function updateWorkflowPolicy(phrenPath: string, patch: Partial<WorkflowPolicy>): PhrenResult<WorkflowPolicy>;
|
|
96
|
+
export declare function getIndexPolicy(phrenPath: string): IndexPolicy;
|
|
97
|
+
export declare function updateIndexPolicy(phrenPath: string, patch: Partial<IndexPolicy>): PhrenResult<IndexPolicy>;
|
|
98
|
+
export declare function getRuntimeHealth(phrenPath: string): RuntimeHealth;
|
|
99
|
+
export declare function updateRuntimeHealth(phrenPath: string, patch: Partial<RuntimeHealth>): RuntimeHealth;
|
|
100
|
+
export declare function normalizeQueueEntryText(raw: string, opts?: {
|
|
101
|
+
truncate?: boolean;
|
|
102
|
+
}): PhrenResult<{
|
|
103
|
+
text: string;
|
|
104
|
+
truncated: boolean;
|
|
105
|
+
}>;
|
|
106
|
+
export declare function appendReviewQueue(phrenPath: string, project: string, section: "Review" | "Stale" | "Conflicts", entries: string[]): PhrenResult<number>;
|
|
107
|
+
export declare function pruneDeadMemories(phrenPath: string, project?: string, dryRun?: boolean): PhrenResult<string>;
|
|
108
|
+
export declare function consolidateProjectFindings(phrenPath: string, project: string, dryRun?: boolean): PhrenResult<string>;
|
|
109
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RBAC enforcement for mutating MCP tools.
|
|
3
|
+
*
|
|
4
|
+
* Access-control.json lives at `<phrenPath>/.config/access-control.json` (global).
|
|
5
|
+
* Per-project overrides live in `phren.project.yaml` under the `access` key.
|
|
6
|
+
*
|
|
7
|
+
* Schema:
|
|
8
|
+
* { admins: string[], contributors: string[], readers: string[] }
|
|
9
|
+
*
|
|
10
|
+
* Role hierarchy:
|
|
11
|
+
* admins → all actions
|
|
12
|
+
* contributors → add/edit/remove findings, complete/add/remove tasks
|
|
13
|
+
* readers → read-only (search, get)
|
|
14
|
+
*
|
|
15
|
+
* When no access-control.json exists, all actors are permitted (open mode).
|
|
16
|
+
*
|
|
17
|
+
* The actor is read from the PHREN_ACTOR env var (falls back to open if unset).
|
|
18
|
+
*/
|
|
19
|
+
type RbacAction = "add_finding" | "remove_finding" | "edit_finding" | "complete_task" | "add_task" | "remove_task" | "update_task" | "manage_config";
|
|
20
|
+
/**
|
|
21
|
+
* Convenience wrapper: returns a permission-denied MCP error string,
|
|
22
|
+
* or null if the action is allowed.
|
|
23
|
+
*/
|
|
24
|
+
export declare function permissionDeniedError(phrenPath: string, action: RbacAction, project?: string | null): string | null;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface EntryScore {
|
|
2
|
+
impressions: number;
|
|
3
|
+
helpful: number;
|
|
4
|
+
repromptPenalty: number;
|
|
5
|
+
regressionPenalty: number;
|
|
6
|
+
lastUsedAt: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function flushEntryScores(phrenPath: string): void;
|
|
9
|
+
export declare function entryScoreKey(project: string, filename: string, snippet: string): string;
|
|
10
|
+
export declare function recordInjection(phrenPath: string, key: string, sessionId?: string): void;
|
|
11
|
+
export declare function recordFeedback(phrenPath: string, key: string, feedback: "helpful" | "reprompt" | "regression", sessionId?: string): void;
|
|
12
|
+
export declare function getQualityMultiplier(phrenPath: string, key: string): number;
|
package/dist/hooks.d.ts
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { type PhrenErrorCode } from "./shared.js";
|
|
2
|
+
export interface HookError {
|
|
3
|
+
code: PhrenErrorCode;
|
|
4
|
+
message: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function commandExists(cmd: string): boolean;
|
|
7
|
+
export declare function detectInstalledTools(): Set<string>;
|
|
8
|
+
/** Shell-escape a value by wrapping in single quotes with proper escaping of embedded single quotes. */
|
|
9
|
+
export declare function shellEscape(s: string): string;
|
|
10
|
+
export interface LifecycleCommands {
|
|
11
|
+
sessionStart: string;
|
|
12
|
+
userPromptSubmit: string;
|
|
13
|
+
stop: string;
|
|
14
|
+
hookTool: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function buildLifecycleCommands(phrenPath: string): LifecycleCommands;
|
|
17
|
+
export declare function buildSharedLifecycleCommands(): LifecycleCommands;
|
|
18
|
+
/**
|
|
19
|
+
* Install a lightweight `phren` CLI wrapper at ~/.local/bin/phren so the bare
|
|
20
|
+
* `phren` command works without a global npm install. The wrapper simply execs
|
|
21
|
+
* `node <entry_script> "$@"`.
|
|
22
|
+
*/
|
|
23
|
+
export declare function installPhrenCliWrapper(phrenPath: string): boolean;
|
|
24
|
+
export interface HookToolPreferences {
|
|
25
|
+
claude?: boolean;
|
|
26
|
+
copilot?: boolean;
|
|
27
|
+
cursor?: boolean;
|
|
28
|
+
codex?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export declare function clearHookPrefsCache(): void;
|
|
31
|
+
export declare function isToolHookEnabled(phrenPath: string, tool: string): boolean;
|
|
32
|
+
export type CustomHookEvent = "pre-save" | "post-save" | "post-search" | "pre-finding" | "post-finding" | "pre-index" | "post-index" | "post-session-end" | "post-consolidate";
|
|
33
|
+
export interface CommandHookEntry {
|
|
34
|
+
event: CustomHookEvent;
|
|
35
|
+
command: string;
|
|
36
|
+
timeout?: number;
|
|
37
|
+
}
|
|
38
|
+
export interface WebhookHookEntry {
|
|
39
|
+
event: CustomHookEvent;
|
|
40
|
+
webhook: string;
|
|
41
|
+
secret?: string;
|
|
42
|
+
timeout?: number;
|
|
43
|
+
}
|
|
44
|
+
export type CustomHookEntry = CommandHookEntry | WebhookHookEntry;
|
|
45
|
+
export declare const HOOK_EVENT_VALUES: readonly ["pre-save", "post-save", "post-search", "pre-finding", "post-finding", "pre-index", "post-index", "post-session-end", "post-consolidate"];
|
|
46
|
+
/** Return the target (URL or shell command) for display or matching. */
|
|
47
|
+
export declare function getHookTarget(h: CustomHookEntry): string;
|
|
48
|
+
export declare function validateCustomHookCommand(command: string): string | null;
|
|
49
|
+
export declare function validateCustomWebhookUrl(webhook: string): string | null;
|
|
50
|
+
export declare function readCustomHooks(phrenPath: string): CustomHookEntry[];
|
|
51
|
+
export declare function runCustomHooks(phrenPath: string, event: CustomHookEvent, env?: Record<string, string>): {
|
|
52
|
+
ran: number;
|
|
53
|
+
errors: HookError[];
|
|
54
|
+
};
|
|
55
|
+
export interface HookConfigOptions {
|
|
56
|
+
tools?: Set<string>;
|
|
57
|
+
allTools?: boolean;
|
|
58
|
+
}
|
|
59
|
+
export declare function configureAllHooks(phrenPath: string, options?: HookConfigOptions): string[];
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export type SqlValue = string | number | null | Uint8Array;
|
|
2
|
+
export type DbRow = SqlValue[];
|
|
3
|
+
export interface SqlJsDatabase {
|
|
4
|
+
run(sql: string, params?: SqlValue[]): void;
|
|
5
|
+
exec(sql: string, params?: SqlValue[]): {
|
|
6
|
+
columns: string[];
|
|
7
|
+
values: DbRow[];
|
|
8
|
+
}[];
|
|
9
|
+
export(): Uint8Array;
|
|
10
|
+
close(): void;
|
|
11
|
+
}
|
|
12
|
+
export interface DocRow {
|
|
13
|
+
project: string;
|
|
14
|
+
filename: string;
|
|
15
|
+
type: string;
|
|
16
|
+
content: string;
|
|
17
|
+
path: string;
|
|
18
|
+
}
|
|
19
|
+
export declare function buildSourceDocKey(project: string, docPath: string, phrenPath: string, fallbackFilename?: string): string;
|
|
20
|
+
export declare function decodeStringRow(row: DbRow, width: number, context: string): string[];
|
|
21
|
+
export declare function decodeFiniteNumber(value: SqlValue | undefined, context: string): number;
|
|
22
|
+
export declare function getDocSourceKey(doc: Pick<DocRow, "project" | "filename" | "path">, phrenPath: string): string;
|
|
23
|
+
/** Normalize a memory ID to canonical format: `mem:project/path/to/file.md`. */
|
|
24
|
+
export declare function normalizeMemoryId(rawId: string): string;
|
|
25
|
+
export declare function rowToDoc(row: DbRow): DocRow;
|
|
26
|
+
export declare function rowToDocWithRowid(row: DbRow): {
|
|
27
|
+
rowid: number;
|
|
28
|
+
doc: DocRow;
|
|
29
|
+
};
|
|
30
|
+
export declare function queryRows(db: SqlJsDatabase, sql: string, params: (string | number)[]): DbRow[] | null;
|
|
31
|
+
export declare function queryDocRows(db: SqlJsDatabase, sql: string, params: (string | number)[]): DocRow[] | null;
|
|
32
|
+
export declare function queryDocBySourceKey(db: SqlJsDatabase, phrenPath: string, sourceKey: string): DocRow | null;
|
|
33
|
+
export declare function extractSnippet(content: string, query: string, lines?: number): string;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export type McpConfigStatus = "installed" | "already_configured" | "disabled" | "already_disabled";
|
|
2
|
+
export type McpRootKey = "mcpServers" | "servers";
|
|
3
|
+
export type ToolStatus = McpConfigStatus | "no_settings" | "no_vscode" | "no_cursor" | "no_copilot" | "no_codex";
|
|
4
|
+
export interface HookEntry {
|
|
5
|
+
matcher?: string;
|
|
6
|
+
hooks?: Array<{
|
|
7
|
+
type?: string;
|
|
8
|
+
command?: string;
|
|
9
|
+
timeout?: number;
|
|
10
|
+
}>;
|
|
11
|
+
}
|
|
12
|
+
export type HookEventName = "UserPromptSubmit" | "Stop" | "SessionStart" | "PostToolUse";
|
|
13
|
+
export type HookMap = Partial<Record<HookEventName, HookEntry[]>> & Record<string, unknown>;
|
|
14
|
+
type JsonObject = Record<string, unknown> & {
|
|
15
|
+
hooks?: HookMap;
|
|
16
|
+
mcpServers?: Record<string, unknown>;
|
|
17
|
+
servers?: Record<string, unknown>;
|
|
18
|
+
};
|
|
19
|
+
export declare function patchJsonFile(filePath: string, patch: (data: JsonObject) => void): void;
|
|
20
|
+
export declare function removeTomlMcpServer(filePath: string): boolean;
|
|
21
|
+
export declare function removeMcpServerAtPath(filePath: string): boolean;
|
|
22
|
+
export declare function isPhrenCommand(command: string): boolean;
|
|
23
|
+
export declare function configureClaude(phrenPath: string, opts?: {
|
|
24
|
+
mcpEnabled?: boolean;
|
|
25
|
+
hooksEnabled?: boolean;
|
|
26
|
+
}): McpConfigStatus;
|
|
27
|
+
/** Reset the VS Code path probe cache (for testing). */
|
|
28
|
+
export declare function resetVSCodeProbeCache(): void;
|
|
29
|
+
export declare function configureVSCode(phrenPath: string, opts?: {
|
|
30
|
+
mcpEnabled?: boolean;
|
|
31
|
+
scope?: "user" | "workspace";
|
|
32
|
+
}): McpConfigStatus | "no_vscode";
|
|
33
|
+
export declare function configureCursorMcp(phrenPath: string, opts?: {
|
|
34
|
+
mcpEnabled?: boolean;
|
|
35
|
+
}): ToolStatus;
|
|
36
|
+
export declare function configureCopilotMcp(phrenPath: string, opts?: {
|
|
37
|
+
mcpEnabled?: boolean;
|
|
38
|
+
}): ToolStatus;
|
|
39
|
+
export declare function configureCodexMcp(phrenPath: string, opts?: {
|
|
40
|
+
mcpEnabled?: boolean;
|
|
41
|
+
}): ToolStatus;
|
|
42
|
+
export declare function logMcpTargetStatus(tool: string, status: string, phase?: "Configured" | "Updated"): void;
|
|
43
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { repairPreexistingInstall } from "./setup.js";
|
|
2
|
+
import type { InitOptions } from "./init.js";
|
|
3
|
+
/**
|
|
4
|
+
* Configure MCP for all detected AI coding tools (Claude, VS Code, Cursor, Copilot, Codex).
|
|
5
|
+
* @param verb - label used in log messages, e.g. "Updated" or "Configured"
|
|
6
|
+
*/
|
|
7
|
+
export declare function configureMcpTargets(phrenPath: string, opts: {
|
|
8
|
+
mcpEnabled: boolean;
|
|
9
|
+
hooksEnabled: boolean;
|
|
10
|
+
}, verb?: "Configured" | "Updated"): string;
|
|
11
|
+
/**
|
|
12
|
+
* Configure hooks if enabled, or log a disabled message.
|
|
13
|
+
* @param verb - label used in log messages, e.g. "Updated" or "Configured"
|
|
14
|
+
*/
|
|
15
|
+
export declare function configureHooksIfEnabled(phrenPath: string, hooksEnabled: boolean, verb: string): void;
|
|
16
|
+
export declare function applyOnboardingPreferences(phrenPath: string, opts: InitOptions): void;
|
|
17
|
+
export declare function writeWalkthroughEnvDefaults(phrenPath: string, opts: InitOptions): string[];
|
|
18
|
+
export declare function collectRepairedAssetLabels(repaired: ReturnType<typeof repairPreexistingInstall>): string[];
|
|
19
|
+
export declare function applyProjectStorageBindings(repoRoot: string, phrenPath: string): string[];
|
|
20
|
+
export declare function warmSemanticSearch(phrenPath: string, profile?: string): Promise<string>;
|
|
21
|
+
export declare function runProjectLocalInit(opts?: InitOptions): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function runHooksMode(modeArg?: string): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function runMcpMode(modeArg?: string): Promise<void>;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { ProjectOwnershipMode } from "../project-config.js";
|
|
2
|
+
import type { ProactivityLevel } from "../proactivity.js";
|
|
3
|
+
import { type InitProjectDomain, type InferredInitScaffold } from "./setup.js";
|
|
4
|
+
import type { McpMode } from "./shared.js";
|
|
5
|
+
type WorkflowRiskSection = "Review" | "Stale" | "Conflicts";
|
|
6
|
+
type StorageLocationChoice = "global" | "project" | "custom";
|
|
7
|
+
export type WalkthroughChoice<T extends string> = {
|
|
8
|
+
value: T;
|
|
9
|
+
name: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
};
|
|
12
|
+
export type WalkthroughPromptUi = {
|
|
13
|
+
input(message: string, initialValue?: string): Promise<string>;
|
|
14
|
+
confirm(message: string, defaultValue?: boolean): Promise<boolean>;
|
|
15
|
+
select<T extends string>(message: string, choices: WalkthroughChoice<T>[], defaultValue?: T): Promise<T>;
|
|
16
|
+
};
|
|
17
|
+
export type WalkthroughStyle = {
|
|
18
|
+
header: (text: string) => string;
|
|
19
|
+
success: (text: string) => string;
|
|
20
|
+
warning: (text: string) => string;
|
|
21
|
+
};
|
|
22
|
+
export declare function withFallbackColors(style?: {
|
|
23
|
+
header?: (text: string) => string;
|
|
24
|
+
success?: (text: string) => string;
|
|
25
|
+
warning?: (text: string) => string;
|
|
26
|
+
}): WalkthroughStyle;
|
|
27
|
+
export declare function createWalkthroughStyle(): Promise<WalkthroughStyle>;
|
|
28
|
+
export declare function createWalkthroughPrompts(): Promise<WalkthroughPromptUi>;
|
|
29
|
+
export interface WalkthroughResult {
|
|
30
|
+
storageChoice: StorageLocationChoice;
|
|
31
|
+
storagePath: string;
|
|
32
|
+
storageRepoRoot?: string;
|
|
33
|
+
machine: string;
|
|
34
|
+
profile: string;
|
|
35
|
+
mcp: McpMode;
|
|
36
|
+
hooks: McpMode;
|
|
37
|
+
projectOwnershipDefault: ProjectOwnershipMode;
|
|
38
|
+
findingsProactivity: ProactivityLevel;
|
|
39
|
+
taskProactivity: ProactivityLevel;
|
|
40
|
+
lowConfidenceThreshold: number;
|
|
41
|
+
riskySections: WorkflowRiskSection[];
|
|
42
|
+
taskMode: "off" | "manual" | "suggest" | "auto";
|
|
43
|
+
bootstrapCurrentProject: boolean;
|
|
44
|
+
bootstrapOwnership?: ProjectOwnershipMode;
|
|
45
|
+
ollamaEnabled: boolean;
|
|
46
|
+
autoCaptureEnabled: boolean;
|
|
47
|
+
semanticDedupEnabled: boolean;
|
|
48
|
+
semanticConflictEnabled: boolean;
|
|
49
|
+
findingSensitivity: "minimal" | "conservative" | "balanced" | "aggressive";
|
|
50
|
+
githubUsername?: string;
|
|
51
|
+
githubRepo?: string;
|
|
52
|
+
cloneUrl?: string;
|
|
53
|
+
domain: InitProjectDomain;
|
|
54
|
+
inferredScaffold?: InferredInitScaffold;
|
|
55
|
+
}
|
|
56
|
+
export interface WalkthroughOptions {
|
|
57
|
+
/** When true, skip the express prompt and use recommended defaults immediately */
|
|
58
|
+
express?: boolean;
|
|
59
|
+
}
|
|
60
|
+
export declare function runWalkthrough(phrenPath: string, options?: WalkthroughOptions): Promise<WalkthroughResult>;
|
|
61
|
+
export {};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { type InstallMode } from "../shared.js";
|
|
2
|
+
export type { McpConfigStatus, McpRootKey, ToolStatus, HookEntry, HookMap } from "./config.js";
|
|
3
|
+
export { configureClaude, configureVSCode, configureCursorMcp, configureCopilotMcp, configureCodexMcp, logMcpTargetStatus, resetVSCodeProbeCache, patchJsonFile, } from "./config.js";
|
|
4
|
+
export type { InstallPreferences } from "./preferences.js";
|
|
5
|
+
export { getMcpEnabledPreference, setMcpEnabledPreference, getHooksEnabledPreference, setHooksEnabledPreference, } from "./preferences.js";
|
|
6
|
+
export { PROJECT_OWNERSHIP_MODES, type ProjectOwnershipMode, parseProjectOwnershipMode, getProjectOwnershipDefault, } from "../project-config.js";
|
|
7
|
+
export { PROACTIVITY_LEVELS, type ProactivityLevel, getProactivityLevel, getProactivityLevelForFindings, getProactivityLevelForTask, } from "../proactivity.js";
|
|
8
|
+
export type { PostInitCheck, InitProjectDomain, InferredInitScaffold } from "./setup.js";
|
|
9
|
+
export { ensureGovernanceFiles, repairPreexistingInstall, runPostInitVerify, getVerifyOutcomeNote, listTemplates, detectProjectDir, isProjectTracked, ensureLocalGitRepo, resolvePreferredHomeDir, inferInitScaffoldFromRepo, } from "./setup.js";
|
|
10
|
+
export { configureMcpTargets, warmSemanticSearch, runProjectLocalInit } from "./init-configure.js";
|
|
11
|
+
export { runMcpMode } from "./init-mcp-mode.js";
|
|
12
|
+
export { runHooksMode } from "./init-hooks-mode.js";
|
|
13
|
+
export { runUninstall } from "./init-uninstall.js";
|
|
14
|
+
import { type InitProjectDomain, type InferredInitScaffold } from "./setup.js";
|
|
15
|
+
import { type McpMode } from "./shared.js";
|
|
16
|
+
import { type ProjectOwnershipMode } from "../project-config.js";
|
|
17
|
+
import { type ProactivityLevel } from "../proactivity.js";
|
|
18
|
+
export { type McpMode, parseMcpMode } from "./shared.js";
|
|
19
|
+
type StorageLocationChoice = "global" | "project" | "custom";
|
|
20
|
+
type SkillsScope = "global" | "project";
|
|
21
|
+
/**
|
|
22
|
+
* Compare two semver strings. Returns true when `current` is strictly newer
|
|
23
|
+
* than `previous`. Pre-release versions (e.g. 1.2.3-rc.1) sort before the
|
|
24
|
+
* corresponding release (1.2.3). Among pre-release tags, comparison is
|
|
25
|
+
* lexicographic.
|
|
26
|
+
*/
|
|
27
|
+
export declare function isVersionNewer(current: string, previous?: string): boolean;
|
|
28
|
+
export interface InitOptions {
|
|
29
|
+
mode?: InstallMode;
|
|
30
|
+
machine?: string;
|
|
31
|
+
profile?: string;
|
|
32
|
+
mcp?: McpMode;
|
|
33
|
+
hooks?: McpMode;
|
|
34
|
+
projectOwnershipDefault?: ProjectOwnershipMode;
|
|
35
|
+
findingsProactivity?: ProactivityLevel;
|
|
36
|
+
taskProactivity?: ProactivityLevel;
|
|
37
|
+
lowConfidenceThreshold?: number;
|
|
38
|
+
riskySections?: ("Review" | "Stale" | "Conflicts")[];
|
|
39
|
+
taskMode?: "off" | "manual" | "suggest" | "auto";
|
|
40
|
+
findingSensitivity?: "minimal" | "conservative" | "balanced" | "aggressive";
|
|
41
|
+
skillsScope?: SkillsScope;
|
|
42
|
+
applyStarterUpdate?: boolean;
|
|
43
|
+
dryRun?: boolean;
|
|
44
|
+
yes?: boolean;
|
|
45
|
+
/** Skip walkthrough entirely with recommended defaults (express mode) */
|
|
46
|
+
express?: boolean;
|
|
47
|
+
template?: "python-project" | "monorepo" | "library" | "frontend" | string;
|
|
48
|
+
/** Set by walkthrough to pass project name to init logic */
|
|
49
|
+
_walkthroughProject?: string;
|
|
50
|
+
/** Set by walkthrough for personalized GitHub next-steps output */
|
|
51
|
+
_walkthroughGithub?: {
|
|
52
|
+
username?: string;
|
|
53
|
+
repo: string;
|
|
54
|
+
};
|
|
55
|
+
/** Set by walkthrough to seed project docs/topics by domain */
|
|
56
|
+
_walkthroughDomain?: InitProjectDomain;
|
|
57
|
+
/** Set by walkthrough to seed adaptive project scaffold from current repo content */
|
|
58
|
+
_walkthroughInferredScaffold?: InferredInitScaffold;
|
|
59
|
+
/** Set by walkthrough when user enables auto-capture; triggers writing ~/.phren/.env */
|
|
60
|
+
_walkthroughAutoCapture?: boolean;
|
|
61
|
+
/** Set by walkthrough when user opts into local semantic search */
|
|
62
|
+
_walkthroughSemanticSearch?: boolean;
|
|
63
|
+
/** Set by walkthrough when user enables LLM semantic dedup */
|
|
64
|
+
_walkthroughSemanticDedup?: boolean;
|
|
65
|
+
/** Set by walkthrough when user enables LLM conflict detection */
|
|
66
|
+
_walkthroughSemanticConflict?: boolean;
|
|
67
|
+
/** Set by walkthrough when user provides a git clone URL for existing phren */
|
|
68
|
+
_walkthroughCloneUrl?: string;
|
|
69
|
+
/** Set by walkthrough when the user wants the current repo enrolled immediately */
|
|
70
|
+
_walkthroughBootstrapCurrentProject?: boolean;
|
|
71
|
+
/** Set by walkthrough for the ownership mode selected for the current repo */
|
|
72
|
+
_walkthroughBootstrapOwnership?: ProjectOwnershipMode;
|
|
73
|
+
/** Set by walkthrough to select where phren data is stored */
|
|
74
|
+
_walkthroughStorageChoice?: StorageLocationChoice;
|
|
75
|
+
/** Set by walkthrough to pass resolved storage path to init logic */
|
|
76
|
+
_walkthroughStoragePath?: string;
|
|
77
|
+
/** Set by walkthrough when project-local storage is chosen */
|
|
78
|
+
_walkthroughStorageRepoRoot?: string;
|
|
79
|
+
}
|
|
80
|
+
export declare function getPendingBootstrapTarget(phrenPath: string, _opts: InitOptions): {
|
|
81
|
+
path: string;
|
|
82
|
+
mode: "explicit" | "detected";
|
|
83
|
+
} | null;
|
|
84
|
+
export declare function runInit(opts?: InitOptions): Promise<void>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { CustomHookEntry } from "../hooks.js";
|
|
2
|
+
export interface InstallPreferences {
|
|
3
|
+
mcpEnabled?: boolean;
|
|
4
|
+
hooksEnabled?: boolean;
|
|
5
|
+
skillsScope?: "global" | "project";
|
|
6
|
+
projectOwnershipDefault?: "phren-managed" | "detached" | "repo-managed";
|
|
7
|
+
proactivity?: "high" | "medium" | "low";
|
|
8
|
+
proactivityFindings?: "high" | "medium" | "low";
|
|
9
|
+
proactivityTask?: "high" | "medium" | "low";
|
|
10
|
+
hookTools?: Record<string, boolean>;
|
|
11
|
+
disabledSkills?: Record<string, boolean>;
|
|
12
|
+
installedVersion?: string;
|
|
13
|
+
updatedAt?: string;
|
|
14
|
+
customHooks?: CustomHookEntry[];
|
|
15
|
+
/** Whether the user intended cross-machine sync ("sync") or local-only ("local"). */
|
|
16
|
+
syncIntent?: "sync" | "local";
|
|
17
|
+
}
|
|
18
|
+
export declare function governanceInstallPreferencesFile(phrenPath: string): string;
|
|
19
|
+
export declare function readInstallPreferences(phrenPath: string): InstallPreferences;
|
|
20
|
+
export declare function readGovernanceInstallPreferences(phrenPath: string): InstallPreferences;
|
|
21
|
+
export declare function writeInstallPreferences(phrenPath: string, patch: Partial<InstallPreferences>): void;
|
|
22
|
+
export declare function writeGovernanceInstallPreferences(phrenPath: string, patch: Partial<InstallPreferences>): void;
|
|
23
|
+
/** Atomically read-modify-write install preferences using a patcher function. */
|
|
24
|
+
export declare function updateInstallPreferences(phrenPath: string, patcher: (current: InstallPreferences) => Partial<InstallPreferences>): void;
|
|
25
|
+
export declare function getMcpEnabledPreference(phrenPath: string): boolean;
|
|
26
|
+
export declare function setMcpEnabledPreference(phrenPath: string, enabled: boolean): void;
|
|
27
|
+
export declare function getHooksEnabledPreference(phrenPath: string): boolean;
|
|
28
|
+
export declare function setHooksEnabledPreference(phrenPath: string, enabled: boolean): void;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Governance files, root file migration, verification, starter templates, bootstrap.
|
|
3
|
+
*/
|
|
4
|
+
import * as fs from "fs";
|
|
5
|
+
import { commandVersion } from "./shared.js";
|
|
6
|
+
import { type ProjectOwnershipMode } from "../project-config.js";
|
|
7
|
+
import { type BuiltinTopic } from "../project-topics.js";
|
|
8
|
+
export interface PostInitCheck {
|
|
9
|
+
name: string;
|
|
10
|
+
ok: boolean;
|
|
11
|
+
detail: string;
|
|
12
|
+
fix?: string;
|
|
13
|
+
}
|
|
14
|
+
interface BootstrapProjectOptions {
|
|
15
|
+
profile?: string;
|
|
16
|
+
ownership?: ProjectOwnershipMode;
|
|
17
|
+
}
|
|
18
|
+
interface BootstrapProjectResult {
|
|
19
|
+
project: string;
|
|
20
|
+
ownership: ProjectOwnershipMode;
|
|
21
|
+
claudePath: string | null;
|
|
22
|
+
}
|
|
23
|
+
interface LocalGitRepoStatus {
|
|
24
|
+
ok: boolean;
|
|
25
|
+
initialized: boolean;
|
|
26
|
+
detail: string;
|
|
27
|
+
}
|
|
28
|
+
export type InitProjectDomain = "software" | "music" | "game" | "research" | "writing" | "creative" | "other";
|
|
29
|
+
export declare function resolvePreferredHomeDir(phrenPath: string): string;
|
|
30
|
+
interface RepairInstallResult {
|
|
31
|
+
profileFilesUpdated: number;
|
|
32
|
+
removedLegacyProjects: number;
|
|
33
|
+
createdContextFile: boolean;
|
|
34
|
+
createdRootMemory: boolean;
|
|
35
|
+
createdGlobalAssets: string[];
|
|
36
|
+
createdRuntimeAssets: string[];
|
|
37
|
+
createdFeatureDefaults: string[];
|
|
38
|
+
createdSkillArtifacts: string[];
|
|
39
|
+
repairedGlobalSymlink: boolean;
|
|
40
|
+
}
|
|
41
|
+
export declare function ensureGitignoreEntry(repoRoot: string, entry: string): boolean;
|
|
42
|
+
export declare function upsertProjectEnvVar(repoRoot: string, key: string, value: string): boolean;
|
|
43
|
+
export declare function repairPreexistingInstall(phrenPath: string): RepairInstallResult;
|
|
44
|
+
export declare function getVerifyOutcomeNote(phrenPath: string, checks: PostInitCheck[]): string | null;
|
|
45
|
+
interface HookEntrypointCheckDeps {
|
|
46
|
+
pathExists?: typeof fs.existsSync;
|
|
47
|
+
versionReader?: typeof commandVersion;
|
|
48
|
+
}
|
|
49
|
+
export declare function getHookEntrypointCheck(deps?: HookEntrypointCheckDeps): PostInitCheck;
|
|
50
|
+
export declare function applyStarterTemplateUpdates(phrenPath: string): string[];
|
|
51
|
+
export declare function ensureGovernanceFiles(phrenPath: string): string[];
|
|
52
|
+
export declare function listTemplates(): string[];
|
|
53
|
+
export declare function applyTemplate(projectDir: string, templateName: string, projectName: string): boolean;
|
|
54
|
+
export interface InferredInitScaffold {
|
|
55
|
+
domain: InitProjectDomain;
|
|
56
|
+
topics: BuiltinTopic[];
|
|
57
|
+
referenceHints: string[];
|
|
58
|
+
commandHints: string[];
|
|
59
|
+
confidence: number;
|
|
60
|
+
reason: string;
|
|
61
|
+
}
|
|
62
|
+
export declare function inferInitScaffoldFromRepo(repoRoot: string, fallbackDomain?: InitProjectDomain): InferredInitScaffold | null;
|
|
63
|
+
export declare function ensureProjectScaffold(projectDir: string, projectName: string, domain?: InitProjectDomain, inference?: InferredInitScaffold | null): void;
|
|
64
|
+
export declare function ensureLocalGitRepo(phrenPath: string): LocalGitRepoStatus;
|
|
65
|
+
/** Bootstrap a phren project from an existing project directory with CLAUDE.md.
|
|
66
|
+
* @param profile - if provided, only this profile YAML is updated (avoids leaking project to unrelated profiles).
|
|
67
|
+
*/
|
|
68
|
+
export declare function bootstrapFromExisting(phrenPath: string, projectPath: string, opts?: string | BootstrapProjectOptions): BootstrapProjectResult;
|
|
69
|
+
export declare function updateMachinesYaml(phrenPath: string, machine?: string, profile?: string): void;
|
|
70
|
+
/**
|
|
71
|
+
* Detect if a directory looks like a project that should be bootstrapped.
|
|
72
|
+
* Returns the path if it qualifies, null otherwise.
|
|
73
|
+
* A directory qualifies if it:
|
|
74
|
+
* - Is not the home directory or phren directory
|
|
75
|
+
* - Has a CLAUDE.md, AGENTS.md, .claude/CLAUDE.md, or .git directory
|
|
76
|
+
*/
|
|
77
|
+
export declare function detectProjectDir(dir: string, phrenPath: string): string | null;
|
|
78
|
+
/**
|
|
79
|
+
* Check if a project name is already tracked in any profile.
|
|
80
|
+
*/
|
|
81
|
+
export declare function isProjectTracked(phrenPath: string, projectName: string, profile?: string): boolean;
|
|
82
|
+
export declare function runPostInitVerify(phrenPath: string): {
|
|
83
|
+
ok: boolean;
|
|
84
|
+
checks: PostInitCheck[];
|
|
85
|
+
};
|
|
86
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { VERSION } from "../package-metadata.js";
|
|
2
|
+
export declare const ROOT: string;
|
|
3
|
+
export { VERSION };
|
|
4
|
+
export declare const STARTER_DIR: string;
|
|
5
|
+
export declare const DEFAULT_PHREN_PATH: string;
|
|
6
|
+
export declare function resolveEntryScript(): string;
|
|
7
|
+
export declare function log(msg: string): void;
|
|
8
|
+
export declare function commandVersion(cmd: string, args?: string[]): string | null;
|
|
9
|
+
export declare function versionAtLeast(raw: string | null, major: number, minor?: number): boolean;
|
|
10
|
+
export declare function nearestWritableTarget(filePath: string): boolean;
|
|
11
|
+
export type McpMode = "on" | "off";
|
|
12
|
+
export declare function parseMcpMode(raw?: string): McpMode | undefined;
|
|
13
|
+
export declare function confirmPrompt(message: string): Promise<boolean>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type ProjectOwnershipMode } from "./project-config.js";
|
|
2
|
+
/**
|
|
3
|
+
* Bootstrap a project from an existing directory into phren.
|
|
4
|
+
*/
|
|
5
|
+
export declare function bootstrapProject(phrenPath: string, projectPath: string, profile: string | undefined, ownership: ProjectOwnershipMode, label: string): void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { InitOptions } from "./init-types.js";
|
|
2
|
+
export declare function normalizedBootstrapProjectName(projectPath: string): string;
|
|
3
|
+
export declare function getPendingBootstrapTarget(phrenPath: string, _opts: InitOptions): {
|
|
4
|
+
path: string;
|
|
5
|
+
mode: "explicit" | "detected";
|
|
6
|
+
} | null;
|
|
7
|
+
export declare function hasInstallMarkers(phrenPath: string): boolean;
|
|
8
|
+
export declare function resolveInitPhrenPath(opts: InitOptions): string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { InitOptions } from "./init-types.js";
|
|
2
|
+
import { repairPreexistingInstall } from "./init/setup.js";
|
|
3
|
+
export declare function applyOnboardingPreferences(phrenPath: string, opts: InitOptions): void;
|
|
4
|
+
export declare function writeWalkthroughEnvDefaults(phrenPath: string, opts: InitOptions): string[];
|
|
5
|
+
export declare function collectRepairedAssetLabels(repaired: ReturnType<typeof repairPreexistingInstall>): string[];
|
|
6
|
+
export declare function applyProjectStorageBindings(repoRoot: string, phrenPath: string): string[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { InitOptions, SkillsScope } from "./init-types.js";
|
|
2
|
+
export declare function runFreshInstall(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>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configure MCP for all detected AI coding tools (Claude, VS Code, Cursor, Copilot, Codex).
|
|
3
|
+
* @param verb - label used in log messages, e.g. "Updated" or "Configured"
|
|
4
|
+
*/
|
|
5
|
+
export declare function configureMcpTargets(phrenPath: string, opts: {
|
|
6
|
+
mcpEnabled: boolean;
|
|
7
|
+
hooksEnabled: boolean;
|
|
8
|
+
}, verb?: "Configured" | "Updated"): string;
|