@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.
- package/dist/bridge/codex-auth-refresh.d.ts +7 -0
- package/dist/bridge/codex-auth-refresh.js +15 -0
- package/dist/bridge/git-write-policy.d.ts +13 -0
- package/dist/bridge/git-write-policy.js +39 -0
- package/dist/bridge/schedule-format.d.ts +4 -1
- package/dist/bridge/schedule-format.js +40 -3
- package/dist/bridge/schedule-update.d.ts +6 -0
- package/dist/bridge/schedule-update.js +63 -0
- package/dist/bridge/schedules.js +16 -4
- package/dist/bridge/server-pane-routes.d.ts +4 -2
- package/dist/bridge/server-pane-routes.js +8 -2
- package/dist/bridge/server-routes.js +14 -4
- package/dist/bridge-hook.mjs +307 -109
- package/dist/cli/actions.js +4 -0
- package/dist/mcp/profile.js +23 -4
- package/dist/modules/registry.js +2 -2
- package/dist/task/lifecycle.js +3 -2
- package/package.json +1 -1
package/dist/cli/actions.js
CHANGED
|
@@ -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) {
|
package/dist/mcp/profile.js
CHANGED
|
@@ -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
|
-
|
|
194
|
-
|
|
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:
|
|
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
|
});
|
package/dist/modules/registry.js
CHANGED
|
@@ -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
|
},
|
package/dist/task/lifecycle.js
CHANGED
|
@@ -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
|
-
|
|
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
|