@phren/cli 0.3.46 → 0.3.47

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.
@@ -228,6 +228,10 @@ export async function handleDoctor(args) {
228
228
  else {
229
229
  console.log(`- ok semantic-search: ${semStatus.model} ready, ${semStatus.coverage}`);
230
230
  }
231
+ const { codexSignInCheck } = await import("../bridge/codex-auth-refresh.js");
232
+ const codexSignIn = await codexSignInCheck();
233
+ if (codexSignIn)
234
+ console.log(`- ${codexSignIn.ok ? "ok " : "warn"} codex-signin: ${codexSignIn.message}`);
231
235
  process.exit(result.ok ? 0 : 1);
232
236
  }
233
237
  async function getSemanticSearchStatus(phrenPath, profile) {
@@ -190,8 +190,22 @@ function firstSentence(text) {
190
190
  const s = end === -1 ? flat : flat.slice(0, end + 1);
191
191
  return s.length > 140 ? `${s.slice(0, 139)}…` : s;
192
192
  }
193
- function actionLine(action, entry) {
194
- const required = paramDocs(entry).filter((p) => p.required).map((p) => p.name);
193
+ /**
194
+ * `phren_admin` takes the action's name in `action`, so a target with its own
195
+ * `action` parameter (manage_review_item, manage_project) takes it as
196
+ * `operation` there, as owner_inbox already does.
197
+ */
198
+ const INNER_ACTION = "operation";
199
+ function hasInnerAction(entry) {
200
+ const shape = schemaOf(entry)?.shape;
201
+ return !!shape && "action" in shape && !(INNER_ACTION in shape);
202
+ }
203
+ function adminParamDocs(entry) {
204
+ const docs = paramDocs(entry);
205
+ return hasInnerAction(entry) ? docs.map((p) => p.name === "action" ? { ...p, name: INNER_ACTION } : p) : docs;
206
+ }
207
+ function actionLine(action, entry, docs = paramDocs(entry)) {
208
+ const required = docs.filter((p) => p.required).map((p) => p.name);
195
209
  const req = required.length ? ` (required: ${required.join(", ")})` : "";
196
210
  return `${action} — ${firstSentence(entry.config.description)}${req}`;
197
211
  }
@@ -297,7 +311,7 @@ export function buildCompositeTools(catalog) {
297
311
  .filter((n) => !CORE_TOOLS.includes(n) && !folded.has(n) && !(n in COMPOSITES))
298
312
  .sort();
299
313
  if (adminTargets.length) {
300
- const lines = adminTargets.map((n) => actionLine(n, catalog.get(n)));
314
+ const lines = adminTargets.map((n) => actionLine(n, catalog.get(n), adminParamDocs(catalog.get(n))));
301
315
  const actionNames = ["list_actions", ...adminTargets];
302
316
  out.push({
303
317
  name: "phren_admin",
@@ -313,10 +327,15 @@ export function buildCompositeTools(catalog) {
313
327
  if (action === "list_actions") {
314
328
  const actions = adminTargets.map((n) => {
315
329
  const entry = catalog.get(n);
316
- return { name: n, description: entry.config.description ?? "", params: paramDocs(entry) };
330
+ return { name: n, description: entry.config.description ?? "", params: adminParamDocs(entry) };
317
331
  });
318
332
  return { content: [{ type: "text", text: JSON.stringify({ ok: true, actions }, null, 2) }] };
319
333
  }
334
+ const entry = catalog.get(action);
335
+ if (entry && hasInnerAction(entry) && INNER_ACTION in rest) {
336
+ const { [INNER_ACTION]: operation, ...others } = rest;
337
+ return dispatch(catalog, action, { ...others, action: operation });
338
+ }
320
339
  return dispatch(catalog, action, rest);
321
340
  },
322
341
  });
@@ -123,8 +123,8 @@ export const BUILTIN_MODULES = [
123
123
  {
124
124
  schemaVersion: 1, name: "schedules", version: VERSION, defaultEnabled: false, requires: ["memory"],
125
125
  tools: [], cliCommands: ["schedule"], agentHooks: [],
126
- hookRoutes: routes("POST", ["/v1/schedules", "/v1/schedules/run", "/v1/schedules/history"]),
127
- capabilities: ["schedules", "scheduleProjects"], storeFiles: ["<project>/schedules.yaml", ".runtime/agent-fanouts/<run-id>/**"],
126
+ hookRoutes: routes("POST", ["/v1/schedules", "/v1/schedules/run", "/v1/schedules/history", "/v1/schedules/update"]),
127
+ capabilities: ["schedules", "scheduleProjects", "scheduleUpdate"], storeFiles: ["<project>/schedules.yaml", ".runtime/agent-fanouts/<run-id>/**"],
128
128
  localFiles: ["<bridge>/schedule-runs.jsonl"],
129
129
  phoneScreens: [{ screen: "SchedulesView", capability: "schedules" }], skills: [],
130
130
  },
@@ -49,8 +49,9 @@ const PASTED_CONTENT_WRAPPER_RE = /<pasted_content\b[^>]*>[\s\S]*?<\/pasted_cont
49
49
  // Relays may name one sender ("From tidy-phren:") or a computer and agent
50
50
  // ("From macbook android-codex:"). Keep "From now on" as a request.
51
51
  // A two-word sender needs the colon; longer names need a parenthesized handle.
52
- // "From the settings page, add …" stays a request.
53
- const RELAYED_MESSAGE_RE = /^\s*from\s+(?:the\s+)?(?!(?:now|here|there|then|scratch|today|tomorrow)\b)(?:[\w.-]+\s*[,:]|[\w.-]+\s+[\w.-]+\s*:|[\w.-]+(?:[ \t]+[\w.-]+)*[ \t]+\([\w.-]+\)[ \t]*:)/i;
52
+ // "From the settings page, add …" stays a request. A message the conductor
53
+ // sends opens with "Conductor:" or "Conductor,".
54
+ const RELAYED_MESSAGE_RE = /^\s*(?:conductor\s*[,:]|from\s+(?:the\s+)?(?!(?:now|here|there|then|scratch|today|tomorrow)\b)(?:[\w.-]+\s*[,:]|[\w.-]+\s+[\w.-]+\s*:|[\w.-]+(?:[ \t]+[\w.-]+)*[ \t]+\([\w.-]+\)[ \t]*:))/i;
54
55
  // Dispatch returns are typed into an idle agent as ordinary prompts.
55
56
  const DISPATCH_RETURN_NOTICE_RE = /^\s*returns?:\s+[^\n]+\bCall dispatch_returns\.\s*$/i;
56
57
  // A dispatched or scheduled worker's first prompt names its brief file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phren/cli",
3
- "version": "0.3.46",
3
+ "version": "0.3.47",
4
4
  "description": "Knowledge layer for AI agents - CLI, MCP server, and data layer",
5
5
  "type": "module",
6
6
  "bin": {