@phren/cli 0.3.20 → 0.3.22
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/agent-hooks.d.ts +22 -19
- package/dist/bridge/agent-hooks.js +49 -33
- package/dist/bridge/approval-summary.d.ts +4 -0
- package/dist/bridge/approval-summary.js +12 -1
- package/dist/bridge/code-note.d.ts +1 -0
- package/dist/bridge/code-note.js +2 -2
- package/dist/bridge/codex-binary.d.ts +5 -0
- package/dist/bridge/codex-binary.js +7 -0
- package/dist/bridge/dispatch-command.js +1 -1
- package/dist/bridge/dispatch-returns.d.ts +3 -2
- package/dist/bridge/dispatch-returns.js +27 -11
- package/dist/bridge/dispatch.d.ts +4 -0
- package/dist/bridge/dispatch.js +5 -3
- package/dist/bridge/folder-trust.d.ts +13 -3
- package/dist/bridge/folder-trust.js +42 -4
- package/dist/bridge/hand-off.js +2 -1
- package/dist/bridge/herdr.js +6 -5
- package/dist/bridge/launch-brief.d.ts +3 -1
- package/dist/bridge/launch-brief.js +3 -1
- package/dist/bridge/memory-store.d.ts +7 -0
- package/dist/bridge/memory-store.js +41 -2
- package/dist/bridge/schedule-format.d.ts +1 -1
- package/dist/bridge/schedule-format.js +1 -1
- package/dist/bridge/schedule-launch.js +5 -0
- package/dist/bridge/schedule-watch.d.ts +5 -2
- package/dist/bridge/schedule-watch.js +59 -20
- package/dist/bridge/server-launch.d.ts +6 -0
- package/dist/bridge/server-launch.js +59 -11
- package/dist/bridge/server-pane-routes.js +20 -13
- package/dist/bridge/server-routes.d.ts +1 -0
- package/dist/bridge/server-routes.js +1 -1
- package/dist/bridge/server-stream.js +12 -0
- package/dist/bridge/server.js +2 -2
- package/dist/bridge/session-activity.d.ts +6 -0
- package/dist/bridge/session-activity.js +16 -0
- package/dist/bridge/settings-switch.d.ts +7 -0
- package/dist/bridge/settings-switch.js +15 -0
- package/dist/bridge/speech-transcribe.d.ts +8 -1
- package/dist/bridge/speech-transcribe.js +18 -3
- package/dist/bridge/transcript-claude.js +39 -10
- package/dist/bridge/worker-close.js +3 -2
- package/dist/bridge/worker-unfinished.d.ts +8 -2
- package/dist/bridge/worker-unfinished.js +57 -24
- package/dist/bridge-hook.mjs +520 -278
- package/dist/cli-registry.js +1 -1
- package/dist/data/tasks.js +6 -1
- package/dist/home-paths.d.ts +2 -0
- package/dist/home-paths.js +4 -0
- package/dist/modules/registry.js +1 -1
- package/dist/test-global-setup.js +2 -1
- package/dist/test-sandbox.d.ts +15 -0
- package/dist/test-sandbox.js +36 -0
- package/package.json +1 -1
- package/starter/global/skills/conductor/SKILL.md +2 -1
package/dist/cli-registry.js
CHANGED
|
@@ -161,7 +161,7 @@ export const REGISTRY = [
|
|
|
161
161
|
},
|
|
162
162
|
},
|
|
163
163
|
{
|
|
164
|
-
name: "dispatch", topic: "core", usage: "phren dispatch <computer|anywhere> <project> --label <label> --prompt <brief> [--harness codex|claude|opencode] [--model <model>] [--effort <effort>] [--account <id>] [--permission-mode <mode>] [--keep-open]",
|
|
164
|
+
name: "dispatch", topic: "core", usage: "phren dispatch <computer|anywhere> <project> --label <label> --prompt <brief> [--harness codex|claude|opencode|copilot] [--model <model>] [--effort <effort>] [--account <id>] [--permission-mode <mode>] [--keep-open]",
|
|
165
165
|
summary: "Dispatch a worker brief through Phren Hook",
|
|
166
166
|
subcommands: [{ name: "status", usage: "phren dispatch status", summary: "List local dispatch receipts" },
|
|
167
167
|
{ name: "returns", usage: "phren dispatch returns", summary: "List unread worker returns (done, needs you, blocked, gone) and mark them read" },
|
package/dist/data/tasks.js
CHANGED
|
@@ -635,8 +635,13 @@ export function updateTask(phrenPath, project, match, updates) {
|
|
|
635
635
|
if (updates.context) {
|
|
636
636
|
if (updates.replace_context || !item.context)
|
|
637
637
|
item.context = updates.context;
|
|
638
|
-
|
|
638
|
+
// Agents sometimes send the existing context with their new note. Do
|
|
639
|
+
// not append the complete history to itself on every such update.
|
|
640
|
+
else if (updates.context.startsWith(`${item.context}; `))
|
|
641
|
+
item.context = updates.context;
|
|
642
|
+
else if (updates.context !== item.context && !item.context.endsWith(`; ${updates.context}`)) {
|
|
639
643
|
item.context = `${item.context}; ${updates.context}`;
|
|
644
|
+
}
|
|
640
645
|
changes.push("context updated");
|
|
641
646
|
}
|
|
642
647
|
if (updates.unlink_github) {
|
package/dist/home-paths.d.ts
CHANGED
|
@@ -5,3 +5,5 @@ export declare function homeDir(env?: NodeJS.ProcessEnv): string;
|
|
|
5
5
|
export declare function claudeConfigDir(env?: NodeJS.ProcessEnv): string;
|
|
6
6
|
/** Codex's home: `CODEX_HOME`, else `~/.codex`. */
|
|
7
7
|
export declare function codexHome(env?: NodeJS.ProcessEnv): string;
|
|
8
|
+
/** Copilot CLI's home: `COPILOT_HOME`, else `~/.copilot`. */
|
|
9
|
+
export declare function copilotHome(env?: NodeJS.ProcessEnv): string;
|
package/dist/home-paths.js
CHANGED
|
@@ -19,3 +19,7 @@ export function claudeConfigDir(env = process.env) {
|
|
|
19
19
|
export function codexHome(env = process.env) {
|
|
20
20
|
return configuredDir(env.CODEX_HOME, env, ".codex");
|
|
21
21
|
}
|
|
22
|
+
/** Copilot CLI's home: `COPILOT_HOME`, else `~/.copilot`. */
|
|
23
|
+
export function copilotHome(env = process.env) {
|
|
24
|
+
return configuredDir(env.COPILOT_HOME, env, ".copilot");
|
|
25
|
+
}
|
package/dist/modules/registry.js
CHANGED
|
@@ -96,7 +96,7 @@ export const BUILTIN_MODULES = [
|
|
|
96
96
|
capabilities: [
|
|
97
97
|
"hook", "transcript", "progress", "images", "prompt", "stop", "terminal", "shell", "herdr",
|
|
98
98
|
"webServers", "webPreview", "activity", "approvals", "questions", "accountUsage", "providers",
|
|
99
|
-
"files", "repositoryFiles", "subagents", "sideQuestions", "approvalPush", "simulators", "overviewStream", "speech", "speechTimestamps", "speechTimestampStream", "speechLive", "speechVoices", "speechFormats", "transcribe", "promptOnce", "promptStatus", "resources", "sessionRename", "sudo", "sudoOutcome", "previewDeltas", "quickChat",
|
|
99
|
+
"files", "repositoryFiles", "subagents", "sideQuestions", "approvalPush", "simulators", "overviewStream", "speech", "speechTimestamps", "speechTimestampStream", "speechLive", "speechVoices", "speechFormats", "transcribe", "promptOnce", "promptStatus", "deliveryFrames", "resources", "sessionRename", "sudo", "sudoOutcome", "previewDeltas", "quickChat",
|
|
100
100
|
],
|
|
101
101
|
storeFiles: [".runtime/sessions/opencode-*.events.jsonl", ".runtime/approvals/opencode-*.json"],
|
|
102
102
|
localFiles: ["<bridge>/installed.json", "<bridge>/versions/**", "<bridge>/current", "<bridge>/dispatch", "<bridge>/askpass", "<bridge>/computer-id", "<bridge>/canary.json", "<bridge>/canary-daily"],
|
|
@@ -16,6 +16,7 @@ import * as fs from "fs";
|
|
|
16
16
|
import * as os from "os";
|
|
17
17
|
import * as path from "path";
|
|
18
18
|
import { fileURLToPath } from "url";
|
|
19
|
+
import { removeSandboxHome } from "./test-sandbox.js";
|
|
19
20
|
const __filename = fileURLToPath(import.meta.url);
|
|
20
21
|
const __dirname = path.dirname(__filename);
|
|
21
22
|
const REPO_ROOT = path.resolve(__dirname, "../../..");
|
|
@@ -57,7 +58,7 @@ function sandboxHomeDir() {
|
|
|
57
58
|
}
|
|
58
59
|
export async function teardown() {
|
|
59
60
|
if (sandboxHome)
|
|
60
|
-
|
|
61
|
+
removeSandboxHome(sandboxHome);
|
|
61
62
|
}
|
|
62
63
|
export async function setup() {
|
|
63
64
|
sandboxHomeDir();
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface SandboxDeps {
|
|
2
|
+
/** Run one command; throws on failure. */
|
|
3
|
+
run: (file: string, args: string[], env: NodeJS.ProcessEnv) => void;
|
|
4
|
+
/** `ps` rows: pid and full command line. */
|
|
5
|
+
processes: () => {
|
|
6
|
+
pid: number;
|
|
7
|
+
command: string;
|
|
8
|
+
}[];
|
|
9
|
+
kill: (pid: number) => void;
|
|
10
|
+
}
|
|
11
|
+
/** Codex 0.158 leaves a detached `app-server --managed-daemon` (and its
|
|
12
|
+
* `pid-update-loop`) per HOME, reparented to init. Stop whatever a run left
|
|
13
|
+
* under `home`, then delete it. `codex app-server daemon stop` is the
|
|
14
|
+
* graceful path; processes whose command line names the home are the net. */
|
|
15
|
+
export declare function removeSandboxHome(home: string, deps?: SandboxDeps): void;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { execFileSync } from "child_process";
|
|
2
|
+
import * as fs from "fs";
|
|
3
|
+
const real = {
|
|
4
|
+
run: (file, args, env) => { execFileSync(file, args, { env, stdio: "ignore", timeout: 15_000 }); },
|
|
5
|
+
processes: () => {
|
|
6
|
+
try {
|
|
7
|
+
return execFileSync("ps", ["-Aww", "-o", "pid=,command="], { encoding: "utf8", maxBuffer: 8_388_608 }).split("\n").flatMap(line => {
|
|
8
|
+
const match = /^\s*(\d+)\s+(.*)$/.exec(line);
|
|
9
|
+
return match ? [{ pid: Number(match[1]), command: match[2] }] : [];
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
return [];
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
kill: pid => { try {
|
|
17
|
+
process.kill(pid, "SIGKILL");
|
|
18
|
+
}
|
|
19
|
+
catch { /* already gone */ } },
|
|
20
|
+
};
|
|
21
|
+
/** Codex 0.158 leaves a detached `app-server --managed-daemon` (and its
|
|
22
|
+
* `pid-update-loop`) per HOME, reparented to init. Stop whatever a run left
|
|
23
|
+
* under `home`, then delete it. `codex app-server daemon stop` is the
|
|
24
|
+
* graceful path; processes whose command line names the home are the net. */
|
|
25
|
+
export function removeSandboxHome(home, deps = real) {
|
|
26
|
+
const env = { ...process.env, HOME: home, USERPROFILE: home, CODEX_HOME: undefined };
|
|
27
|
+
try {
|
|
28
|
+
deps.run("codex", ["app-server", "daemon", "stop"], env);
|
|
29
|
+
}
|
|
30
|
+
catch { /* no codex, or no daemon */ }
|
|
31
|
+
for (const { pid, command } of deps.processes()) {
|
|
32
|
+
if (pid !== process.pid && command.includes(home) && /app-server|pid-update-loop/.test(command))
|
|
33
|
+
deps.kill(pid);
|
|
34
|
+
}
|
|
35
|
+
fs.rmSync(home, { recursive: true, force: true });
|
|
36
|
+
}
|
package/package.json
CHANGED
|
@@ -144,7 +144,8 @@ Write one short line either way. Call `dispatch` in full or
|
|
|
144
144
|
in core. The CLI equivalent is `phren dispatch <computer|anywhere> <project>
|
|
145
145
|
--harness <harness> --label <label> --prompt <brief> [--model <model>] [--effort <effort>]
|
|
146
146
|
[--permission-mode supervised|auto-edits|auto|full-access]`. `permissionMode` sets how the
|
|
147
|
-
worker starts (Claude and
|
|
147
|
+
worker starts (Claude, Codex and Copilot; not OpenCode). `harness` is codex,
|
|
148
|
+
claude, opencode or copilot.
|
|
148
149
|
For release work (merge, publish, deploy, app-store, github-admin), read the
|
|
149
150
|
owner's release authority policy first with `authority` in full or
|
|
150
151
|
`phren_admin(action: "authority", project)` in core (CLI: `phren authority show
|