@phren/cli 0.1.10 → 0.1.11

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.
@@ -3,7 +3,7 @@ import { z } from "zod";
3
3
  import * as fs from "fs";
4
4
  import * as path from "path";
5
5
  import { isValidProjectName } from "../utils.js";
6
- import { addTask as addTaskStore, addTasks as addTasksBatch, taskMarkdown, completeTask as completeTaskStore, completeTasks as completeTasksBatch, removeTask as removeTaskStore, removeTasks as removeTasksBatch, linkTaskIssue, pinTask, workNextTask, tidyDoneTasks, readTasks, readTasksAcrossProjects, resolveTaskItem, TASKS_FILENAME, updateTask as updateTaskStore, promoteTask, } from "../data/access.js";
6
+ import { addTask as addTaskStore, addTasks as addTasksBatch, taskMarkdown, completeTask as completeTaskStore, completeTasks as completeTasksBatch, removeTask as removeTaskStore, removeTasks as removeTasksBatch, linkTaskIssue, pinTask, unpinTask, workNextTask, tidyDoneTasks, readTasks, readTasksAcrossProjects, resolveTaskItem, TASKS_FILENAME, updateTask as updateTaskStore, promoteTask, } from "../data/access.js";
7
7
  import { applyGravity } from "../data/tasks.js";
8
8
  import { buildTaskIssueBody, createGithubIssueForTask, parseGithubIssueUrl, resolveProjectGithubRepo, } from "../task/github.js";
9
9
  import { clearTaskCheckpoint } from "../session/checkpoints.js";
@@ -551,4 +551,32 @@ export function register(server, ctx) {
551
551
  return mcpResponse({ ok: true, message: result.data, data: { project, keep: keep ?? 30, dryRun: dry_run ?? false } });
552
552
  });
553
553
  });
554
+ server.registerTool("pin_task", {
555
+ title: "◆ phren · pin task",
556
+ description: "Pin or unpin a task. Pinned tasks always appear in hook context regardless of priority, " +
557
+ "so they stay visible across every prompt.",
558
+ inputSchema: z.object({
559
+ project: z.string().describe("Project name."),
560
+ item: z.string().describe("Partial text or task ID (A1, Q3) to match."),
561
+ unpin: z.boolean().optional().describe("If true, unpin instead of pin."),
562
+ }),
563
+ }, async ({ project: projectInput, item, unpin: shouldUnpin }) => {
564
+ const resolved = resolveStoreForProject(ctx, projectInput);
565
+ const project = resolved.project;
566
+ const targetPath = resolved.phrenPath;
567
+ if (!isValidProjectName(project))
568
+ return mcpResponse({ ok: false, error: `Invalid project name: "${project}"` });
569
+ const denied = permissionDeniedError(targetPath, "pin_task", project);
570
+ if (denied)
571
+ return mcpResponse({ ok: false, error: denied });
572
+ return withWriteQueue(async () => {
573
+ const result = shouldUnpin
574
+ ? unpinTask(targetPath, project, item)
575
+ : pinTask(targetPath, project, item);
576
+ if (!result.ok)
577
+ return mcpResponse({ ok: false, error: result.error });
578
+ refreshTaskIndex(updateFileInIndex, targetPath, project);
579
+ return mcpResponse({ ok: true, message: result.data, data: { project, item, pinned: !shouldUnpin } });
580
+ });
581
+ });
554
582
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phren/cli",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "description": "Knowledge layer for AI agents — CLI, MCP server, and data layer",
5
5
  "type": "module",
6
6
  "bin": {
@@ -66,6 +66,13 @@
66
66
  "skills",
67
67
  "scripts/preuninstall.mjs"
68
68
  ],
69
+ "scripts": {
70
+ "build": "node ../../scripts/build.mjs",
71
+ "dev": "tsx src/index.ts",
72
+ "lint": "biome lint --config-path ../../biome.json src/",
73
+ "test": "echo 'Run tests from repo root: pnpm -w test'",
74
+ "preuninstall": "node scripts/preuninstall.mjs"
75
+ },
69
76
  "dependencies": {
70
77
  "@modelcontextprotocol/sdk": "^1.28.0",
71
78
  "chalk": "^5.6.2",
@@ -94,12 +101,5 @@
94
101
  "type": "git",
95
102
  "url": "git+https://github.com/alaarab/phren.git",
96
103
  "directory": "packages/cli"
97
- },
98
- "scripts": {
99
- "build": "node ../../scripts/build.mjs",
100
- "dev": "tsx src/index.ts",
101
- "lint": "biome lint --config-path ../../biome.json src/",
102
- "test": "echo 'Run tests from repo root: pnpm -w test'",
103
- "preuninstall": "node scripts/preuninstall.mjs"
104
104
  }
105
- }
105
+ }
@@ -3,6 +3,15 @@
3
3
  <!-- Copy this file to your personal phren instance's global/CLAUDE.md and fill in your own preferences. -->
4
4
  <!-- This becomes ~/.claude/CLAUDE.md after syncing. Claude reads it at the start of every session. -->
5
5
 
6
+ ## Memory
7
+
8
+ **Use Phren for all knowledge persistence, not Claude Code's built-in auto memory.** Do not write to `~/.claude/projects/.../memory/` files. Instead:
9
+
10
+ - Save knowledge → `add_finding(project, finding)`
11
+ - Recall knowledge → `search_knowledge(query)`
12
+ - Track tasks → `add_task()` / `complete_task()` / `get_tasks()`
13
+ - Track sessions → `session_start()` / `session_end()`
14
+
6
15
  ## How I Work
7
16
 
8
17
  <!-- Your non-negotiable rules. Examples: -->
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Ala Arab
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.