@phren/cli 0.1.32 → 0.1.33

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.
Files changed (71) hide show
  1. package/dist/capabilities/cli.js +2 -2
  2. package/dist/cli/config-access.d.ts +1 -0
  3. package/dist/cli/config-access.js +59 -0
  4. package/dist/cli/config-llm.d.ts +1 -0
  5. package/dist/cli/config-llm.js +60 -0
  6. package/dist/cli/config-policy.d.ts +11 -0
  7. package/dist/cli/config-policy.js +328 -0
  8. package/dist/cli/config-proactivity.d.ts +15 -0
  9. package/dist/cli/config-proactivity.js +129 -0
  10. package/dist/cli/config-shared.d.ts +6 -0
  11. package/dist/cli/config-shared.js +23 -0
  12. package/dist/cli/config-synonyms.d.ts +1 -0
  13. package/dist/cli/config-synonyms.js +60 -0
  14. package/dist/cli/config.d.ts +6 -24
  15. package/dist/cli/config.js +13 -670
  16. package/dist/finding-graph-id.d.ts +15 -0
  17. package/dist/finding-graph-id.js +58 -0
  18. package/dist/generated/memory-ui-graph.browser.js +15 -15
  19. package/dist/governance/activity.d.ts +36 -0
  20. package/dist/governance/activity.js +83 -0
  21. package/dist/governance/rbac.d.ts +17 -0
  22. package/dist/governance/rbac.js +37 -1
  23. package/dist/memory-ui-graph.runtime.js +15 -15
  24. package/dist/phren-paths.d.ts +6 -0
  25. package/dist/phren-paths.js +8 -0
  26. package/dist/shared/governance.d.ts +1 -0
  27. package/dist/shared/governance.js +1 -0
  28. package/dist/shared.d.ts +1 -1
  29. package/dist/shared.js +1 -1
  30. package/dist/tools/config.js +39 -2
  31. package/dist/tools/search.js +28 -1
  32. package/dist/ui/data.d.ts +2 -0
  33. package/dist/ui/data.js +8 -3
  34. package/dist/ui/graph.js +2 -0
  35. package/dist/ui/page.js +45 -2
  36. package/dist/ui/scripts.d.ts +13 -0
  37. package/dist/ui/scripts.js +229 -2
  38. package/dist/ui/server.js +165 -1
  39. package/dist/ui/styles.d.ts +1 -0
  40. package/dist/ui/styles.js +38 -0
  41. package/package.json +1 -1
  42. package/dist/cli-hooks-prompt.d.ts +0 -18
  43. package/dist/cli-hooks-prompt.js +0 -359
  44. package/dist/cli-hooks-session-handlers.d.ts +0 -3
  45. package/dist/cli-hooks-session-handlers.js +0 -356
  46. package/dist/cli-hooks-stop.d.ts +0 -11
  47. package/dist/cli-hooks-stop.js +0 -584
  48. package/dist/init-bootstrap.d.ts +0 -5
  49. package/dist/init-bootstrap.js +0 -21
  50. package/dist/init-detect.d.ts +0 -8
  51. package/dist/init-detect.js +0 -38
  52. package/dist/init-env.d.ts +0 -6
  53. package/dist/init-env.js +0 -114
  54. package/dist/init-fresh.d.ts +0 -10
  55. package/dist/init-fresh.js +0 -234
  56. package/dist/init-hooks.d.ts +0 -5
  57. package/dist/init-hooks.js +0 -26
  58. package/dist/init-mcp.d.ts +0 -8
  59. package/dist/init-mcp.js +0 -65
  60. package/dist/init-modes.d.ts +0 -4
  61. package/dist/init-modes.js +0 -135
  62. package/dist/init-npm.d.ts +0 -10
  63. package/dist/init-npm.js +0 -37
  64. package/dist/init-project-local.d.ts +0 -2
  65. package/dist/init-project-local.js +0 -99
  66. package/dist/init-semantic.d.ts +0 -4
  67. package/dist/init-semantic.js +0 -48
  68. package/dist/init-types.d.ts +0 -59
  69. package/dist/init-types.js +0 -1
  70. package/dist/init-update.d.ts +0 -10
  71. package/dist/init-update.js +0 -96
@@ -0,0 +1,60 @@
1
+ import { getPhrenPath } from "../shared.js";
2
+ import { isValidProjectName, learnedSynonymsPath, learnSynonym, loadLearnedSynonyms, removeLearnedSynonym, } from "../utils.js";
3
+ // ── Synonyms ─────────────────────────────────────────────────────────────────
4
+ function printSynonymsUsage() {
5
+ console.error("Usage: phren config synonyms list <project>");
6
+ console.error(" phren config synonyms add <project> <term> <syn1,syn2,...>");
7
+ console.error(" phren config synonyms remove <project> <term> [syn1,syn2,...]");
8
+ }
9
+ function parseSynonymItems(raw) {
10
+ if (!raw)
11
+ return [];
12
+ return raw
13
+ .split(",")
14
+ .map((item) => item.trim())
15
+ .filter(Boolean);
16
+ }
17
+ export function handleConfigSynonyms(args) {
18
+ const phrenPath = getPhrenPath();
19
+ let action = args[0] || "list";
20
+ let project = args[1];
21
+ if (action !== "list" && action !== "add" && action !== "remove" && isValidProjectName(action)) {
22
+ project = action;
23
+ action = "list";
24
+ }
25
+ if (!project || !isValidProjectName(project)) {
26
+ printSynonymsUsage();
27
+ process.exit(1);
28
+ }
29
+ if (action === "list") {
30
+ console.log(JSON.stringify({
31
+ project,
32
+ path: learnedSynonymsPath(phrenPath, project),
33
+ synonyms: loadLearnedSynonyms(project, phrenPath),
34
+ }, null, 2));
35
+ return;
36
+ }
37
+ if (action === "add") {
38
+ const term = args[2];
39
+ const synonyms = parseSynonymItems(args[3]);
40
+ if (!term || synonyms.length === 0) {
41
+ printSynonymsUsage();
42
+ process.exit(1);
43
+ }
44
+ const updated = learnSynonym(phrenPath, project, term, synonyms);
45
+ console.log(JSON.stringify({ project, term, synonyms: updated[term.toLowerCase()] ?? [], updated }, null, 2));
46
+ return;
47
+ }
48
+ if (action === "remove") {
49
+ const term = args[2];
50
+ if (!term) {
51
+ printSynonymsUsage();
52
+ process.exit(1);
53
+ }
54
+ const updated = removeLearnedSynonym(phrenPath, project, term, parseSynonymItems(args[3]));
55
+ console.log(JSON.stringify({ project, term: term.toLowerCase(), updated }, null, 2));
56
+ return;
57
+ }
58
+ printSynonymsUsage();
59
+ process.exit(1);
60
+ }
@@ -1,25 +1,7 @@
1
- import { type FindingSensitivityLevel } from "../shared/governance.js";
2
- export declare function checkProjectInProfile(phrenPath: string, project: string): string | null;
3
- export declare function buildProactivitySnapshot(phrenPath: string): {
4
- path: string;
5
- configured: {
6
- proactivity: "high" | "medium" | "low" | null;
7
- proactivityFindings: "high" | "medium" | "low" | null;
8
- proactivityTask: "high" | "medium" | "low" | null;
9
- };
10
- effective: {
11
- proactivity: "high" | "medium" | "low";
12
- proactivityFindings: "high" | "medium" | "low";
13
- proactivityTask: "high" | "medium" | "low";
14
- };
15
- };
1
+ import { checkProjectInProfile } from "./config-shared.js";
2
+ import { handleIndexPolicy, handleRetentionPolicy, handleWorkflowPolicy } from "./config-policy.js";
3
+ import { handleConfigAccess } from "./config-access.js";
4
+ export { checkProjectInProfile, handleIndexPolicy, handleRetentionPolicy, handleWorkflowPolicy, handleConfigAccess };
5
+ export { buildProactivitySnapshot } from "./config-proactivity.js";
6
+ export { FINDING_SENSITIVITY_CONFIG } from "./config-policy.js";
16
7
  export declare function handleConfig(args: string[]): Promise<void>;
17
- export declare const FINDING_SENSITIVITY_CONFIG: Record<FindingSensitivityLevel, {
18
- sessionCap: number;
19
- proactivityFindings: string;
20
- agentInstruction: string;
21
- }>;
22
- export declare function handleIndexPolicy(args: string[]): Promise<void>;
23
- export declare function handleRetentionPolicy(args: string[]): Promise<void>;
24
- export declare function handleWorkflowPolicy(args: string[]): Promise<void>;
25
- export declare function handleConfigAccess(args: string[]): void;