@phren/cli 0.2.14 → 0.2.16
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/README.md +2 -2
- package/dist/agent-instructions.d.ts +12 -0
- package/dist/agent-instructions.js +52 -0
- package/dist/bridge/agent-hook-stores.d.ts +32 -0
- package/dist/bridge/agent-hook-stores.js +67 -0
- package/dist/bridge/agent-hooks.d.ts +193 -2
- package/dist/bridge/agent-hooks.js +1045 -38
- package/dist/bridge/canary.d.ts +27 -0
- package/dist/bridge/canary.js +189 -0
- package/dist/bridge/changes.d.ts +57 -0
- package/dist/bridge/changes.js +403 -0
- package/dist/bridge/client.d.ts +3 -0
- package/dist/bridge/client.js +36 -0
- package/dist/bridge/code-note.d.ts +22 -0
- package/dist/bridge/code-note.js +42 -0
- package/dist/bridge/code-routes.d.ts +133 -0
- package/dist/bridge/code-routes.js +319 -0
- package/dist/bridge/codex-threads.d.ts +27 -0
- package/dist/bridge/codex-threads.js +442 -0
- package/dist/bridge/command.d.ts +7 -0
- package/dist/bridge/command.js +50 -5
- package/dist/bridge/computer-names.d.ts +4 -0
- package/dist/bridge/computer-names.js +16 -0
- package/dist/bridge/computers.d.ts +9 -0
- package/dist/bridge/computers.js +111 -0
- package/dist/bridge/context.d.ts +14 -0
- package/dist/bridge/context.js +149 -0
- package/dist/bridge/dispatch-command.d.ts +3 -0
- package/dist/bridge/dispatch-command.js +93 -0
- package/dist/bridge/dispatch-hosts.d.ts +23 -0
- package/dist/bridge/dispatch-hosts.js +25 -0
- package/dist/bridge/dispatch-returns.d.ts +123 -0
- package/dist/bridge/dispatch-returns.js +279 -0
- package/dist/bridge/dispatch-tree.d.ts +54 -0
- package/dist/bridge/dispatch-tree.js +198 -0
- package/dist/bridge/dispatch.d.ts +207 -0
- package/dist/bridge/dispatch.js +261 -0
- package/dist/bridge/enroll.d.ts +31 -0
- package/dist/bridge/enroll.js +236 -0
- package/dist/bridge/fanout-messages.d.ts +74 -0
- package/dist/bridge/fanout-messages.js +230 -0
- package/dist/bridge/fanouts.d.ts +160 -0
- package/dist/bridge/fanouts.js +702 -0
- package/dist/bridge/file-range.d.ts +16 -0
- package/dist/bridge/file-range.js +90 -0
- package/dist/bridge/files.d.ts +20 -0
- package/dist/bridge/files.js +54 -0
- package/dist/bridge/git-publish.d.ts +23 -0
- package/dist/bridge/git-publish.js +145 -0
- package/dist/bridge/git-worktrees.d.ts +21 -0
- package/dist/bridge/git-worktrees.js +150 -0
- package/dist/bridge/git.d.ts +54 -0
- package/dist/bridge/git.js +552 -0
- package/dist/bridge/grants.d.ts +31 -0
- package/dist/bridge/grants.js +181 -0
- package/dist/bridge/hand-off.d.ts +79 -0
- package/dist/bridge/hand-off.js +151 -0
- package/dist/bridge/health.d.ts +128 -0
- package/dist/bridge/health.js +260 -0
- package/dist/bridge/herdr.d.ts +79 -6
- package/dist/bridge/herdr.js +292 -27
- package/dist/bridge/hook-main.js +2 -0
- package/dist/bridge/install.d.ts +32 -1
- package/dist/bridge/install.js +225 -38
- package/dist/bridge/launch-worktree.d.ts +21 -0
- package/dist/bridge/launch-worktree.js +70 -0
- package/dist/bridge/limits.d.ts +20 -0
- package/dist/bridge/limits.js +65 -0
- package/dist/bridge/locate.d.ts +16 -0
- package/dist/bridge/locate.js +75 -0
- package/dist/bridge/metrics.d.ts +29 -0
- package/dist/bridge/metrics.js +71 -0
- package/dist/bridge/model-switch.d.ts +35 -0
- package/dist/bridge/model-switch.js +250 -0
- package/dist/bridge/models.d.ts +46 -0
- package/dist/bridge/models.js +257 -0
- package/dist/bridge/opencode-approvals.d.ts +6 -0
- package/dist/bridge/opencode-approvals.js +60 -0
- package/dist/bridge/pane-text.d.ts +15 -0
- package/dist/bridge/pane-text.js +23 -0
- package/dist/bridge/peers.d.ts +27 -0
- package/dist/bridge/peers.js +130 -0
- package/dist/bridge/projects.d.ts +12 -1
- package/dist/bridge/projects.js +268 -20
- package/dist/bridge/protocol.d.ts +35 -2
- package/dist/bridge/protocol.js +42 -7
- package/dist/bridge/push.d.ts +83 -0
- package/dist/bridge/push.js +199 -0
- package/dist/bridge/questions.d.ts +38 -0
- package/dist/bridge/questions.js +205 -0
- package/dist/bridge/schedule-format.d.ts +103 -0
- package/dist/bridge/schedule-format.js +266 -0
- package/dist/bridge/schedule-launch.d.ts +11 -0
- package/dist/bridge/schedule-launch.js +169 -0
- package/dist/bridge/schedule-watch.d.ts +52 -0
- package/dist/bridge/schedule-watch.js +242 -0
- package/dist/bridge/schedules.d.ts +48 -0
- package/dist/bridge/schedules.js +205 -0
- package/dist/bridge/server-launch.d.ts +14 -0
- package/dist/bridge/server-launch.js +218 -0
- package/dist/bridge/server-overview.d.ts +45 -0
- package/dist/bridge/server-overview.js +102 -0
- package/dist/bridge/server-pane-routes.d.ts +29 -0
- package/dist/bridge/server-pane-routes.js +400 -0
- package/dist/bridge/server-routes.d.ts +106 -0
- package/dist/bridge/server-routes.js +538 -0
- package/dist/bridge/server-stream.d.ts +46 -0
- package/dist/bridge/server-stream.js +253 -0
- package/dist/bridge/server.d.ts +3 -15
- package/dist/bridge/server.js +162 -264
- package/dist/bridge/session-servers.d.ts +24 -0
- package/dist/bridge/session-servers.js +136 -0
- package/dist/bridge/side-questions.d.ts +74 -0
- package/dist/bridge/side-questions.js +252 -0
- package/dist/bridge/simulators.d.ts +28 -0
- package/dist/bridge/simulators.js +198 -0
- package/dist/bridge/speech-transcribe.d.ts +24 -0
- package/dist/bridge/speech-transcribe.js +124 -0
- package/dist/bridge/speech.d.ts +35 -0
- package/dist/bridge/speech.js +98 -0
- package/dist/bridge/steps.d.ts +13 -0
- package/dist/bridge/steps.js +222 -0
- package/dist/bridge/tab-activity.d.ts +18 -0
- package/dist/bridge/tab-activity.js +99 -0
- package/dist/bridge/terminal-choice.d.ts +64 -0
- package/dist/bridge/terminal-choice.js +281 -0
- package/dist/bridge/transcript-claude.d.ts +22 -0
- package/dist/bridge/transcript-claude.js +353 -0
- package/dist/bridge/transcript-codex.d.ts +30 -0
- package/dist/bridge/transcript-codex.js +282 -0
- package/dist/bridge/transcript-copilot.d.ts +4 -0
- package/dist/bridge/transcript-copilot.js +14 -0
- package/dist/bridge/transcript-opencode.d.ts +5 -0
- package/dist/bridge/transcript-opencode.js +26 -0
- package/dist/bridge/transcript-preview.d.ts +94 -0
- package/dist/bridge/transcript-preview.js +476 -0
- package/dist/bridge/transcripts.d.ts +81 -4
- package/dist/bridge/transcripts.js +332 -67
- package/dist/bridge/transport.d.ts +3 -0
- package/dist/bridge/transport.js +96 -15
- package/dist/bridge/uploads.d.ts +15 -0
- package/dist/bridge/uploads.js +44 -2
- package/dist/bridge/usage.d.ts +124 -0
- package/dist/bridge/usage.js +859 -0
- package/dist/bridge-hook.mjs +41246 -21385
- package/dist/cli/actions.js +14 -1
- package/dist/cli/config-proactivity.d.ts +3 -1
- package/dist/cli/config-proactivity.js +35 -3
- package/dist/cli/config.js +4 -1
- package/dist/cli/extract.js +3 -6
- package/dist/cli/govern.js +5 -2
- package/dist/cli/hooks-globs.js +1 -1
- package/dist/cli/hooks.d.ts +1 -1
- package/dist/cli/hooks.js +9 -7
- package/dist/cli/namespaces-projects.js +12 -6
- package/dist/cli/namespaces-store.js +37 -6
- package/dist/cli/namespaces-tasks.js +1 -1
- package/dist/cli/schedules.d.ts +1 -0
- package/dist/cli/schedules.js +164 -0
- package/dist/cli/session-background.js +1 -1
- package/dist/cli/session-git.d.ts +8 -5
- package/dist/cli/session-git.js +45 -120
- package/dist/cli/session-start.js +3 -1
- package/dist/cli/session-stop.js +19 -8
- package/dist/cli/team.js +13 -10
- package/dist/cli-handlers.d.ts +1 -1
- package/dist/cli-handlers.js +8 -4
- package/dist/cli-help.d.ts +5 -4
- package/dist/cli-help.js +15 -15
- package/dist/cli-registry.d.ts +4 -1
- package/dist/cli-registry.js +119 -6
- package/dist/content/archive.js +2 -2
- package/dist/content/citation.d.ts +11 -0
- package/dist/content/citation.js +18 -0
- package/dist/content/learning.js +2 -0
- package/dist/content/summarize.d.ts +14 -15
- package/dist/content/summarize.js +60 -5
- package/dist/content/validate.d.ts +3 -1
- package/dist/content/validate.js +26 -8
- package/dist/core/project-registry.d.ts +26 -0
- package/dist/core/project-registry.js +573 -0
- package/dist/core/project.js +2 -3
- package/dist/data/access.d.ts +7 -1
- package/dist/data/access.js +13 -3
- package/dist/data/tasks.d.ts +18 -3
- package/dist/data/tasks.js +8 -7
- package/dist/entrypoint.js +44 -10
- package/dist/fanout/adapters/claude.d.ts +2 -0
- package/dist/fanout/adapters/claude.js +7 -0
- package/dist/fanout/adapters/codex.d.ts +2 -0
- package/dist/fanout/adapters/codex.js +9 -0
- package/dist/fanout/adapters/opencode.d.ts +4 -0
- package/dist/fanout/adapters/opencode.js +9 -0
- package/dist/fanout/adapters/types.d.ts +21 -0
- package/dist/fanout/adapters/types.js +3 -0
- package/dist/fanout/command.d.ts +2 -0
- package/dist/fanout/command.js +78 -0
- package/dist/fanout/launcher.d.ts +27 -0
- package/dist/fanout/launcher.js +156 -0
- package/dist/fanout/opencode-serve.d.ts +24 -0
- package/dist/fanout/opencode-serve.js +191 -0
- package/dist/fanout/picker.d.ts +91 -0
- package/dist/fanout/picker.js +51 -0
- package/dist/fanout/usage.d.ts +5 -0
- package/dist/fanout/usage.js +51 -0
- package/dist/fanout/watchdog.d.ts +10 -0
- package/dist/fanout/watchdog.js +27 -0
- package/dist/filenames.d.ts +9 -0
- package/dist/filenames.js +11 -0
- package/dist/finding/context.js +4 -22
- package/dist/generated/memory-ui-graph.browser.js +279 -283
- package/dist/governance/policy-constants.d.ts +11 -0
- package/dist/governance/policy-constants.js +9 -0
- package/dist/governance/policy.d.ts +5 -8
- package/dist/governance/policy.js +7 -5
- package/dist/graph-core/camera.d.ts +24 -0
- package/dist/graph-core/camera.js +18 -0
- package/dist/graph-core/index.d.ts +2 -0
- package/dist/graph-core/index.js +2 -0
- package/dist/graph-core/labels.d.ts +77 -0
- package/dist/graph-core/labels.js +124 -0
- package/dist/graph-core/model.d.ts +13 -0
- package/dist/graph-core/model.js +33 -0
- package/dist/graph-core/types.d.ts +2 -0
- package/dist/home-paths.d.ts +7 -0
- package/dist/home-paths.js +21 -0
- package/dist/hooks.d.ts +3 -0
- package/dist/hooks.js +13 -0
- package/dist/index.js +24 -2
- package/dist/init/guard-globals.d.ts +1 -1
- package/dist/init/guard-globals.js +4 -4
- package/dist/init/init-configure.js +3 -3
- package/dist/init/init-uninstall.js +2 -2
- package/dist/init/init-walkthrough.d.ts +2 -0
- package/dist/init/init-walkthrough.js +17 -6
- package/dist/init/init.js +26 -6
- package/dist/init/management-preset.d.ts +1 -1
- package/dist/init/management-preset.js +2 -2
- package/dist/init/preferences.js +1 -1
- package/dist/init/self-wiring.js +1 -1
- package/dist/init/setup.d.ts +3 -26
- package/dist/init/setup.js +49 -588
- package/dist/init/shared.js +2 -0
- package/dist/init/store-gitignore.d.ts +1 -1
- package/dist/init/store-gitignore.js +2 -0
- package/dist/init/teardown.d.ts +1 -1
- package/dist/init/teardown.js +2 -2
- package/dist/link/context.js +1 -1
- package/dist/link/doctor.d.ts +22 -1
- package/dist/link/doctor.js +100 -54
- package/dist/link/link.js +29 -61
- package/dist/link/refresh.js +2 -2
- package/dist/link/skills.js +26 -5
- package/dist/machine-identity.d.ts +3 -0
- package/dist/machine-identity.js +6 -0
- package/dist/mcp/profile.d.ts +2 -15
- package/dist/mcp/profile.js +64 -9
- package/dist/memory-ui-graph.runtime.js +279 -283
- package/dist/modules/code-package.d.ts +16 -0
- package/dist/modules/code-package.js +152 -0
- package/dist/modules/command.d.ts +2 -0
- package/dist/modules/command.js +67 -0
- package/dist/modules/config.d.ts +4 -0
- package/dist/modules/config.js +70 -0
- package/dist/modules/manifest.d.ts +41 -0
- package/dist/modules/manifest.js +1 -0
- package/dist/modules/provision.d.ts +3 -0
- package/dist/modules/provision.js +84 -0
- package/dist/modules/registry.d.ts +16 -0
- package/dist/modules/registry.js +250 -0
- package/dist/modules/runtime.d.ts +15 -0
- package/dist/modules/runtime.js +59 -0
- package/dist/package-metadata.js +10 -2
- package/dist/phren-dotenv.js +4 -2
- package/dist/phren-paths.d.ts +3 -2
- package/dist/phren-paths.js +4 -5
- package/dist/profile-store.js +4 -5
- package/dist/project-config.d.ts +19 -1
- package/dist/project-config.js +29 -3
- package/dist/project-topics.js +4 -4
- package/dist/provider-adapters.js +1 -4
- package/dist/query-correlation.js +6 -6
- package/dist/session/artifacts.js +5 -5
- package/dist/session/checkpoints.js +5 -0
- package/dist/session/utils.d.ts +2 -2
- package/dist/session/utils.js +6 -6
- package/dist/shared/content.d.ts +1 -1
- package/dist/shared/content.js +1 -1
- package/dist/shared/data-utils.js +1 -1
- package/dist/shared/fragment-graph.d.ts +1 -1
- package/dist/shared/fragment-graph.js +5 -5
- package/dist/shared/index.js +48 -7
- package/dist/shared/retrieval.d.ts +18 -1
- package/dist/shared/retrieval.js +100 -11
- package/dist/shared/search-fallback.js +4 -6
- package/dist/shared/sqljs.d.ts +2 -0
- package/dist/shared/sqljs.js +4 -2
- package/dist/shared.d.ts +0 -1
- package/dist/shared.js +0 -1
- package/dist/shell/input.d.ts +1 -5
- package/dist/shell/input.js +16 -10
- package/dist/shell/palette.d.ts +2 -2
- package/dist/shell/palette.js +3 -7
- package/dist/shell/render.d.ts +3 -1
- package/dist/shell/render.js +4 -4
- package/dist/shell/shell.js +4 -1
- package/dist/shell/types.d.ts +1 -0
- package/dist/shell/types.js +4 -0
- package/dist/shell/view.d.ts +0 -4
- package/dist/shell/view.js +19 -27
- package/dist/skill/registry.js +25 -17
- package/dist/skill/state.d.ts +3 -0
- package/dist/skill/state.js +13 -7
- package/dist/status.js +38 -17
- package/dist/store-registry.d.ts +44 -18
- package/dist/store-registry.js +169 -60
- package/dist/store-weight.d.ts +1 -6
- package/dist/store-weight.js +4 -2
- package/dist/sync/auth-doctor.d.ts +8 -0
- package/dist/sync/auth-doctor.js +27 -0
- package/dist/sync/auth.d.ts +27 -0
- package/dist/sync/auth.js +114 -0
- package/dist/sync/conflict-resolve.d.ts +9 -0
- package/dist/sync/conflict-resolve.js +146 -0
- package/dist/sync/git-state.d.ts +4 -0
- package/dist/sync/git-state.js +49 -0
- package/dist/sync/outcome.d.ts +34 -0
- package/dist/sync/outcome.js +57 -0
- package/dist/sync/pull.d.ts +15 -7
- package/dist/sync/pull.js +84 -35
- package/dist/sync/store-merge.d.ts +29 -0
- package/dist/sync/store-merge.js +137 -0
- package/dist/sync/task-merge.d.ts +22 -0
- package/dist/sync/task-merge.js +158 -0
- package/dist/task/github.js +1 -1
- package/dist/task/lifecycle.d.ts +5 -0
- package/dist/task/lifecycle.js +67 -23
- package/dist/terminal-text.d.ts +5 -0
- package/dist/terminal-text.js +11 -0
- package/dist/test-global-setup.js +7 -0
- package/dist/tool-registry.d.ts +1 -1
- package/dist/tool-registry.js +3 -1
- package/dist/tools/code.d.ts +3 -0
- package/dist/tools/code.js +178 -0
- package/dist/tools/config.js +5 -0
- package/dist/tools/data.js +14 -7
- package/dist/tools/dispatch.d.ts +2 -0
- package/dist/tools/dispatch.js +66 -0
- package/dist/tools/finding.js +43 -41
- package/dist/tools/ops.js +5 -2
- package/dist/tools/search.js +21 -8
- package/dist/tools/session.js +21 -22
- package/dist/tools/tasks.js +8 -2
- package/dist/tools/types.d.ts +2 -2
- package/dist/tools/types.js +2 -2
- package/dist/ui/assets.js +1 -1
- package/dist/ui/data.js +14 -15
- package/dist/ui/deep-void.d.ts +1 -1
- package/dist/ui/deep-void.js +0 -1
- package/dist/ui/graph-chrome.d.ts +1 -1
- package/dist/ui/graph-chrome.js +51 -0
- package/dist/ui/page.js +5 -5
- package/dist/ui/scripts.js +67 -30
- package/dist/ui/server.js +34 -6
- package/dist/update.js +1 -1
- package/dist/utils-fts.js +1 -0
- package/dist/utils-helpers.d.ts +7 -0
- package/dist/utils-helpers.js +17 -0
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +1 -1
- package/package.json +45 -3
- package/plugins/opencode/phren-transcript.js +340 -0
- package/starter/README.md +4 -4
- package/starter/global/{CLAUDE.md → AGENTS.md} +2 -2
- package/starter/global/skills/conductor/SKILL.md +106 -0
- package/starter/global/skills/fanout/SKILL.md +20 -0
- package/starter/global/skills/phren-discover/SKILL.md +6 -6
- package/starter/global/skills/phren-init/SKILL.md +4 -4
- package/starter/global/skills/phren-sync/SKILL.md +3 -3
- package/starter/templates/frontend/reference/README.md +1 -1
- package/starter/templates/library/reference/README.md +1 -1
- package/starter/templates/monorepo/reference/README.md +1 -1
- package/starter/templates/python-project/reference/README.md +1 -1
- /package/starter/templates/frontend/{CLAUDE.md → AGENTS.md} +0 -0
- /package/starter/templates/library/{CLAUDE.md → AGENTS.md} +0 -0
- /package/starter/templates/monorepo/{CLAUDE.md → AGENTS.md} +0 -0
- /package/starter/templates/python-project/{CLAUDE.md → AGENTS.md} +0 -0
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
import { readdir, readFile, realpath, stat } from "node:fs/promises";
|
|
2
|
+
import { createReadStream } from "node:fs";
|
|
3
|
+
import { createInterface } from "node:readline";
|
|
4
|
+
import { createHash } from "node:crypto";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
import { object, objects } from "./protocol.js";
|
|
7
|
+
/** Claude Code's transcript reader: Task sidechains and named teammates as
|
|
8
|
+
* child agents, and the public rows of a conversation. */
|
|
9
|
+
const claudeRelationCache = new Map();
|
|
10
|
+
const claudeChildModelCache = new Map();
|
|
11
|
+
function cacheClaudeChildModel(file, entry) {
|
|
12
|
+
claudeChildModelCache.set(file, entry);
|
|
13
|
+
while (claudeChildModelCache.size > 128)
|
|
14
|
+
claudeChildModelCache.delete(claudeChildModelCache.keys().next().value);
|
|
15
|
+
}
|
|
16
|
+
/** The model is available on the first assistant turn of a Claude sidechain.
|
|
17
|
+
* A growing transcript without that turn is retried; a known model is final. */
|
|
18
|
+
async function claudeChildModel(file) {
|
|
19
|
+
const metadata = await stat(file), cached = claudeChildModelCache.get(file);
|
|
20
|
+
if (cached && cached.dev === metadata.dev && cached.ino === metadata.ino
|
|
21
|
+
&& (cached.model !== undefined || metadata.size <= cached.size))
|
|
22
|
+
return cached.model;
|
|
23
|
+
let model;
|
|
24
|
+
if (metadata.size > 0) {
|
|
25
|
+
const bytes = Math.min(metadata.size, 65_536);
|
|
26
|
+
const input = createInterface({ input: createReadStream(file, { start: 0, end: bytes - 1 }), crlfDelay: Infinity });
|
|
27
|
+
let lines = 0;
|
|
28
|
+
for await (const line of input) {
|
|
29
|
+
++lines;
|
|
30
|
+
try {
|
|
31
|
+
const raw = object(JSON.parse(line));
|
|
32
|
+
if (raw.type === "assistant") {
|
|
33
|
+
const value = object(raw.message).model;
|
|
34
|
+
if (typeof value === "string" && value.length > 0 && value.length <= 200)
|
|
35
|
+
model = value;
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
catch { /* Ignore malformed rows while looking for the first assistant turn. */ }
|
|
40
|
+
if (lines === 200)
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
cacheClaudeChildModel(file, { dev: metadata.dev, ino: metadata.ino, size: metadata.size, ...(model !== undefined ? { model } : {}) });
|
|
45
|
+
return model;
|
|
46
|
+
}
|
|
47
|
+
/** The checkout a Claude sub-agent edits in. Claude Code writes the isolated
|
|
48
|
+
* worktree into the child's `.meta.json`; an older child falls back to the
|
|
49
|
+
* `cwd` its own first rows record when that folder is a linked worktree (its
|
|
50
|
+
* `.git` is a file). A child working in the parent's checkout gets nothing,
|
|
51
|
+
* and a worktree already removed is not offered. */
|
|
52
|
+
export async function claudeChildCheckout(file) {
|
|
53
|
+
const meta = await readFile(file.slice(0, -".jsonl".length) + ".meta.json", "utf8").then(v => object(JSON.parse(v))).catch(() => ({}));
|
|
54
|
+
let cwd = typeof meta.worktreePath === "string" && path.isAbsolute(meta.worktreePath) ? meta.worktreePath : undefined;
|
|
55
|
+
let branch = typeof meta.worktreeBranch === "string" && meta.worktreeBranch ? meta.worktreeBranch.slice(0, 200) : undefined;
|
|
56
|
+
if (!cwd) {
|
|
57
|
+
const input = createInterface({ input: createReadStream(file, { start: 0, end: 65_535 }), crlfDelay: Infinity });
|
|
58
|
+
let lines = 0;
|
|
59
|
+
for await (const line of input) {
|
|
60
|
+
try {
|
|
61
|
+
const value = object(JSON.parse(line)).cwd;
|
|
62
|
+
if (typeof value === "string" && path.isAbsolute(value)) {
|
|
63
|
+
if ((await stat(path.join(value, ".git")).catch(() => undefined))?.isFile())
|
|
64
|
+
cwd = value;
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
catch { /* Keep looking past a malformed row. */ }
|
|
69
|
+
if (++lines >= 40)
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
input.close();
|
|
73
|
+
branch = undefined;
|
|
74
|
+
}
|
|
75
|
+
if (!cwd || !(await stat(cwd).catch(() => undefined))?.isDirectory())
|
|
76
|
+
return {};
|
|
77
|
+
return { cwd, worktreeName: path.basename(cwd).slice(0, 200), ...(branch ? { branch } : {}) };
|
|
78
|
+
}
|
|
79
|
+
async function withClaudeChildModels(relations) {
|
|
80
|
+
return Promise.all(relations.map(async (relation) => {
|
|
81
|
+
if (relation.model !== undefined || relation.transcript === undefined)
|
|
82
|
+
return relation;
|
|
83
|
+
const model = await claudeChildModel(relation.transcript).catch(() => undefined);
|
|
84
|
+
return model === undefined ? relation : { ...relation, model };
|
|
85
|
+
}));
|
|
86
|
+
}
|
|
87
|
+
export async function claudeChildAgents(file, session) {
|
|
88
|
+
const metadata = await stat(file), signature = `${metadata.dev}:${metadata.ino}:${metadata.size}:${metadata.mtimeMs}`;
|
|
89
|
+
const cached = claudeRelationCache.get(file);
|
|
90
|
+
if (cached?.signature === signature && !(cached.recheckAt !== undefined && Date.now() >= cached.recheckAt)) {
|
|
91
|
+
cached.relations = await withClaudeChildModels(cached.relations);
|
|
92
|
+
return cached.relations;
|
|
93
|
+
}
|
|
94
|
+
const launches = new Map();
|
|
95
|
+
// Named teammates (the Agent tool with a `name`) run as their own session
|
|
96
|
+
// and never post a task-notification: they announce themselves idle in a
|
|
97
|
+
// teammate-message instead, and may be woken again later. Their file is
|
|
98
|
+
// `agent-a<name>-<hex>.jsonl` beside the Task sidechains.
|
|
99
|
+
const teammates = new Map();
|
|
100
|
+
const lines = createInterface({ input: createReadStream(file, { encoding: "utf8" }), crlfDelay: Infinity });
|
|
101
|
+
for await (const line of lines) {
|
|
102
|
+
try {
|
|
103
|
+
const raw = object(JSON.parse(line)), result = object(raw.toolUseResult);
|
|
104
|
+
const agentId = String(result.agentId ?? ""), status = String(result.status ?? "");
|
|
105
|
+
if (/^[A-Za-z0-9._-]{1,128}$/.test(agentId) && ["async_launched", "running"].includes(status)) {
|
|
106
|
+
const blocks = objects(object(raw.message).content), callId = String(blocks.find(b => b.type === "tool_result")?.tool_use_id ?? "");
|
|
107
|
+
if (callId)
|
|
108
|
+
launches.set(agentId, { path: String(result.description || result.name || "Agent").slice(0, 200), callId, state: "running" });
|
|
109
|
+
}
|
|
110
|
+
if (raw.type === "assistant") {
|
|
111
|
+
for (const block of objects(object(raw.message).content)) {
|
|
112
|
+
if (block.type !== "tool_use" || block.name !== "Agent")
|
|
113
|
+
continue;
|
|
114
|
+
const input = object(block.input), name = String(input.name ?? "");
|
|
115
|
+
if (!/^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/.test(name) || typeof block.id !== "string")
|
|
116
|
+
continue;
|
|
117
|
+
teammates.set(name, { path: String(input.description || name).slice(0, 200), callId: block.id.slice(0, 200), state: "running" });
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
const content = typeof raw.content === "string" ? raw.content : typeof object(raw.message).content === "string" ? String(object(raw.message).content) : "";
|
|
121
|
+
if (content.includes("<task-notification>")) {
|
|
122
|
+
const child = /<task-id>([^<>]{1,128})<\/task-id>/.exec(content)?.[1], taskStatus = /<status>([^<>]+)<\/status>/.exec(content)?.[1];
|
|
123
|
+
// A stopped agent's notification says "killed"; it is finished as
|
|
124
|
+
// much as a completed one and must leave the running count.
|
|
125
|
+
const previous = child && launches.get(child);
|
|
126
|
+
if (previous && ["completed", "failed", "cancelled", "killed"].includes(taskStatus ?? ""))
|
|
127
|
+
previous.state = "completed";
|
|
128
|
+
}
|
|
129
|
+
if (content.includes("<teammate-message")) {
|
|
130
|
+
const from = /<teammate-message teammate_id="([A-Za-z0-9][A-Za-z0-9_-]{0,63})"/.exec(content)?.[1];
|
|
131
|
+
const teammate = from && teammates.get(from);
|
|
132
|
+
if (teammate)
|
|
133
|
+
teammate.state = content.includes("\"type\":\"idle_notification\"") ? "completed" : "running";
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
catch { /* Ignore unrelated/malformed rows. */ }
|
|
137
|
+
}
|
|
138
|
+
const relations = [];
|
|
139
|
+
// Claude Code records the launch in the parent before the child's own
|
|
140
|
+
// file exists. A launch without a transcript yet is looked for again
|
|
141
|
+
// shortly, rather than being missed until the parent next changes.
|
|
142
|
+
let awaiting = false;
|
|
143
|
+
const root = await realpath(path.join(path.dirname(file), session, "subagents")).catch(() => undefined);
|
|
144
|
+
for (const [agentId, launch] of launches) {
|
|
145
|
+
const childFile = root && await realpath(path.join(root, `agent-${agentId}.jsonl`)).catch(() => undefined);
|
|
146
|
+
if (!childFile || !childFile.startsWith(root + path.sep) || !await claudeChildBelongsTo(childFile, session, agentId)) {
|
|
147
|
+
if (launch.state === "running")
|
|
148
|
+
awaiting = true;
|
|
149
|
+
continue;
|
|
150
|
+
}
|
|
151
|
+
const model = await claudeChildModel(childFile).catch(() => undefined);
|
|
152
|
+
const checkout = await claudeChildCheckout(childFile).catch(() => ({}));
|
|
153
|
+
relations.push({ id: createHash("sha256").update(`claude\0${session}\0${agentId}`).digest("hex").slice(0, 32),
|
|
154
|
+
session: agentId, transcript: childFile, provider: "claude", ...launch,
|
|
155
|
+
...(model !== undefined ? { model } : {}), ...checkout, children: [] });
|
|
156
|
+
}
|
|
157
|
+
if (teammates.size && root) {
|
|
158
|
+
const names = (await readdir(root).catch(() => [])).filter(n => /^agent-a[A-Za-z0-9][A-Za-z0-9_-]{0,63}-[0-9a-f]{8,32}\.jsonl$/.test(n));
|
|
159
|
+
for (const [name, launch] of teammates) {
|
|
160
|
+
const fileName = names.find(n => n.startsWith(`agent-a${name}-`));
|
|
161
|
+
const agentId = fileName?.slice("agent-".length, -".jsonl".length);
|
|
162
|
+
const childFile = agentId && await realpath(path.join(root, fileName)).catch(() => undefined);
|
|
163
|
+
if (!agentId || !childFile || !childFile.startsWith(root + path.sep) || !await claudeChildBelongsTo(childFile, session, agentId)) {
|
|
164
|
+
if (launch.state === "running")
|
|
165
|
+
awaiting = true;
|
|
166
|
+
continue;
|
|
167
|
+
}
|
|
168
|
+
// The meta file names the model as the launcher chose it ("sonnet");
|
|
169
|
+
// the transcript's first assistant turn carries the full id and wins.
|
|
170
|
+
const meta = await readFile(childFile.slice(0, -".jsonl".length) + ".meta.json", "utf8").then(v => object(JSON.parse(v))).catch(() => ({}));
|
|
171
|
+
const model = await claudeChildModel(childFile).catch(() => undefined) ?? (typeof meta.model === "string" && meta.model ? meta.model.slice(0, 200) : undefined);
|
|
172
|
+
const checkout = await claudeChildCheckout(childFile).catch(() => ({}));
|
|
173
|
+
relations.push({ id: createHash("sha256").update(`claude\0${session}\0${agentId}`).digest("hex").slice(0, 32),
|
|
174
|
+
session: agentId, transcript: childFile, provider: "claude", ...launch,
|
|
175
|
+
...(model !== undefined ? { model } : {}), ...checkout, children: [] });
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
claudeRelationCache.set(file, { signature, relations, ...(awaiting ? { recheckAt: Date.now() + 2_000 } : {}) });
|
|
179
|
+
while (claudeRelationCache.size > 64)
|
|
180
|
+
claudeRelationCache.delete(claudeRelationCache.keys().next().value);
|
|
181
|
+
return relations;
|
|
182
|
+
}
|
|
183
|
+
async function claudeChildBelongsTo(file, parent, agentId) {
|
|
184
|
+
let bytes = Buffer.alloc(0);
|
|
185
|
+
for await (const chunk of createReadStream(file, { start: 0, end: 1_048_575 })) {
|
|
186
|
+
bytes = Buffer.concat([bytes, Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk)]);
|
|
187
|
+
const newline = bytes.indexOf(0x0a);
|
|
188
|
+
if (newline >= 0) {
|
|
189
|
+
bytes = bytes.subarray(0, newline);
|
|
190
|
+
break;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
try {
|
|
194
|
+
const raw = object(JSON.parse(bytes.toString("utf8")));
|
|
195
|
+
return (raw.isSidechain === true && raw.sessionId === parent && raw.agentId === agentId)
|
|
196
|
+
|| (raw.type === "fork-context-ref" && raw.parentSessionId === parent && raw.agentId === agentId);
|
|
197
|
+
}
|
|
198
|
+
catch {
|
|
199
|
+
return false;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
const CLAUDE_KEYS = new Set(["type", "uuid", "parentUuid", "timestamp", "message", "gitBranch", "cwd", "requestId", "isMeta", "isSidechain", "isCompactSummary", "phrenQueued", "phrenQueueKey", "phrenBackground", "phrenCompacted"]);
|
|
203
|
+
export const harnessPreamble = (text) => /^<(?:environment_context>|user_instructions>|permission_profile|system-reminder>|turn_context>)/.test(text.trimStart());
|
|
204
|
+
function taskNotification(content) {
|
|
205
|
+
const envelope = /<task-notification>([\s\S]*?)<\/task-notification>/.exec(content)?.[1];
|
|
206
|
+
if (!envelope)
|
|
207
|
+
return;
|
|
208
|
+
// Only plain tag values are public. Never copy nested output envelopes.
|
|
209
|
+
const values = new Map();
|
|
210
|
+
for (const match of envelope.matchAll(/<([a-z-]+)(?:\s[^<>]*)?>([\s\S]*?)<\/\1>/g)) {
|
|
211
|
+
if (["task-id", "tool-use-id", "status", "summary"].includes(match[1]) && !match[2].includes("<") && !values.has(match[1]))
|
|
212
|
+
values.set(match[1], match[2]);
|
|
213
|
+
}
|
|
214
|
+
const tags = ["task-id", "tool-use-id", "status", "summary"].flatMap(tag => {
|
|
215
|
+
const value = values.get(tag);
|
|
216
|
+
return value === undefined ? [] : [`<${tag}>${value.slice(0, tag === "summary" ? 500 : 200)}</${tag}>`];
|
|
217
|
+
});
|
|
218
|
+
return tags.some(tag => tag.startsWith("<tool-use-id>")) ? `<task-notification>\n${tags.join("\n")}\n</task-notification>` : undefined;
|
|
219
|
+
}
|
|
220
|
+
/** Claude Code files bracketed-paste input — which is how Herdr's
|
|
221
|
+
* `agent.prompt` delivers every message the phone sends — as
|
|
222
|
+
* `<pasted_content id="…">…</pasted_content id="…">`. The wrapper is the
|
|
223
|
+
* terminal's bookkeeping, not what the user wrote. */
|
|
224
|
+
const PASTED_CONTENT = /<pasted_content\b[^>]*>\n?([\s\S]*?)\n?<\/pasted_content\b[^>]*>/g;
|
|
225
|
+
export function unwrapPastedContent(text) {
|
|
226
|
+
return text.includes("<pasted_content") ? text.replace(PASTED_CONTENT, "$1").trim() : text;
|
|
227
|
+
}
|
|
228
|
+
function unwrapUserText(message) {
|
|
229
|
+
if (message.role !== "user")
|
|
230
|
+
return message;
|
|
231
|
+
if (typeof message.content === "string")
|
|
232
|
+
return { ...message, content: unwrapPastedContent(message.content) };
|
|
233
|
+
if (!Array.isArray(message.content))
|
|
234
|
+
return message;
|
|
235
|
+
return { ...message, content: message.content.map(block => {
|
|
236
|
+
const b = object(block);
|
|
237
|
+
return b.type === "text" && typeof b.text === "string" ? { ...b, text: unwrapPastedContent(b.text) } : block;
|
|
238
|
+
}) };
|
|
239
|
+
}
|
|
240
|
+
/** A thinking block Claude marks as narration for the person watching: its
|
|
241
|
+
* signature is a length-prefixed field reading "narration" (private
|
|
242
|
+
* reasoning reads "thinking" and is stored without text). */
|
|
243
|
+
export function isNarration(block) {
|
|
244
|
+
if (block.type !== "thinking" || typeof block.thinking !== "string" || !block.thinking.trim())
|
|
245
|
+
return false;
|
|
246
|
+
if (typeof block.signature !== "string" || block.signature.length > 16_384)
|
|
247
|
+
return false;
|
|
248
|
+
let bytes;
|
|
249
|
+
try {
|
|
250
|
+
bytes = Buffer.from(block.signature, "base64");
|
|
251
|
+
}
|
|
252
|
+
catch {
|
|
253
|
+
return false;
|
|
254
|
+
}
|
|
255
|
+
return bytes.subarray(0, 96).includes(Buffer.from([0x42, 0x09, ...Buffer.from("narration")]));
|
|
256
|
+
}
|
|
257
|
+
/** The largest injection the phone is sent; the hook's own budget keeps real ones far smaller. */
|
|
258
|
+
const HOOK_CONTEXT_LIMIT = 16_384;
|
|
259
|
+
/** A phren UserPromptSubmit injection, as `{ type: "phren_hook_context",
|
|
260
|
+
* parentUuid, content }`, or undefined for any other row. */
|
|
261
|
+
export function phrenHookContext(raw, includeSidechain = false) {
|
|
262
|
+
if (raw.type !== "attachment" || (raw.isSidechain && !includeSidechain))
|
|
263
|
+
return undefined;
|
|
264
|
+
const attachment = object(raw.attachment);
|
|
265
|
+
// Input Claude takes mid-turn arrives as a queued_command row right before
|
|
266
|
+
// its hook output. Only whether it was a background notification crosses,
|
|
267
|
+
// so the phone can leave a notification's injection out.
|
|
268
|
+
if (attachment.type === "queued_command") {
|
|
269
|
+
return { type: "phren_turn_input", timestamp: raw.timestamp, notification: attachment.commandMode === "task-notification" };
|
|
270
|
+
}
|
|
271
|
+
if (attachment.type !== "hook_success" || attachment.hookEvent !== "UserPromptSubmit")
|
|
272
|
+
return undefined;
|
|
273
|
+
const content = typeof attachment.content === "string" ? attachment.content : "";
|
|
274
|
+
if (!/^\s*◆ phren\b/.test(content) && !content.includes("<phren-context>"))
|
|
275
|
+
return undefined;
|
|
276
|
+
return { type: "phren_hook_context", timestamp: raw.timestamp, uuid: raw.uuid, parentUuid: raw.parentUuid,
|
|
277
|
+
content: content.length > HOOK_CONTEXT_LIMIT ? content.slice(0, HOOK_CONTEXT_LIMIT) + "\n…" : content };
|
|
278
|
+
}
|
|
279
|
+
/** Claude Code rows the phone may see: user, assistant and system turns with
|
|
280
|
+
* private reasoning redacted, queued phone messages, background task
|
|
281
|
+
* notifications and compaction markers. */
|
|
282
|
+
export function visibleClaudeEvent(raw, includeSidechain = false) {
|
|
283
|
+
// A queued phone message carries the same wrapper; unwrap before the
|
|
284
|
+
// digest so enqueue and remove keep matching keys.
|
|
285
|
+
if (raw.type === "queue-operation" && typeof raw.content === "string")
|
|
286
|
+
raw = { ...raw, content: unwrapPastedContent(raw.content) };
|
|
287
|
+
if (raw.type === "queue-operation" && raw.operation === "remove" && typeof raw.content === "string") {
|
|
288
|
+
return { type: "phren_queue_consumed", key: createHash("sha256").update(raw.content).digest("hex"), timestamp: raw.timestamp };
|
|
289
|
+
}
|
|
290
|
+
// Claude Code records background completion as an internal queue row,
|
|
291
|
+
// outside the ordinary user/assistant transcript. Export only the small
|
|
292
|
+
// task-notification envelope; other internal events remain private.
|
|
293
|
+
if (raw.type === "queue-operation" && typeof raw.content === "string"
|
|
294
|
+
&& raw.content.length <= 65_536 && raw.content.includes("<task-notification>")
|
|
295
|
+
&& raw.content.includes("<tool-use-id>")) {
|
|
296
|
+
const content = taskNotification(raw.content);
|
|
297
|
+
return content ? { type: "system", phrenBackground: true, timestamp: raw.timestamp,
|
|
298
|
+
message: { role: "user", content } } : undefined;
|
|
299
|
+
}
|
|
300
|
+
// A message sent while the agent was mid-turn is only ever a queue row:
|
|
301
|
+
// Claude Code hands it to the model inside a later tool result and never
|
|
302
|
+
// writes a user turn for it. Export the enqueue as the person's message so
|
|
303
|
+
// the phone can draw the bubble it sent. Consumption exposes only a digest.
|
|
304
|
+
if (raw.type === "queue-operation" && ["enqueue", "remove"].includes(String(raw.operation))
|
|
305
|
+
&& !raw.isMeta && !raw.isSidechain && typeof raw.content === "string"
|
|
306
|
+
&& raw.content.length <= 65_536 && !raw.content.includes("<task-notification>")) {
|
|
307
|
+
// The paste wrapper was removed above; any envelope still starting
|
|
308
|
+
// with "<" is the harness's own and stays private.
|
|
309
|
+
if (raw.content.trimStart().startsWith("<"))
|
|
310
|
+
return undefined;
|
|
311
|
+
const text = raw.content;
|
|
312
|
+
const key = createHash("sha256").update(raw.content).digest("hex");
|
|
313
|
+
// Only the identity crosses the wire on consumption: no queue payload,
|
|
314
|
+
// tool envelope, private metadata, or reasoning is exported.
|
|
315
|
+
if (raw.operation === "remove")
|
|
316
|
+
return { type: "phren_queue_consumed", key, timestamp: raw.timestamp };
|
|
317
|
+
return { type: "user", phrenQueued: true, phrenQueueKey: key, timestamp: raw.timestamp,
|
|
318
|
+
message: { role: "user", content: text } };
|
|
319
|
+
}
|
|
320
|
+
// Claude Code appends a boundary marker and then the summary it hands the
|
|
321
|
+
// model as a user turn. The phone shows the marker and a bounded preview,
|
|
322
|
+
// never the full summary as a bubble.
|
|
323
|
+
if (raw.type === "system" && raw.subtype === "compact_boundary") {
|
|
324
|
+
return { type: "system", phrenCompacted: true, timestamp: raw.timestamp };
|
|
325
|
+
}
|
|
326
|
+
if (raw.type === "user" && raw.isCompactSummary === true) {
|
|
327
|
+
const content = object(raw.message).content;
|
|
328
|
+
return { type: "user", isCompactSummary: true, timestamp: raw.timestamp,
|
|
329
|
+
message: { role: "user", content: (typeof content === "string" ? content : "").slice(0, 4_000) } };
|
|
330
|
+
}
|
|
331
|
+
// What phren's prompt hook injected into a user turn: Claude Code records
|
|
332
|
+
// the hook's output as an attachment row pointing at that turn. Only
|
|
333
|
+
// phren's own output crosses; other hooks' output stays private.
|
|
334
|
+
const hookContext = phrenHookContext(raw, includeSidechain);
|
|
335
|
+
if (hookContext)
|
|
336
|
+
return hookContext;
|
|
337
|
+
if (raw.isMeta || (raw.isSidechain && !includeSidechain) || !["user", "assistant", "system"].includes(String(raw.type)))
|
|
338
|
+
return undefined;
|
|
339
|
+
raw = Object.fromEntries(Object.entries(raw).filter(([key]) => CLAUDE_KEYS.has(key)));
|
|
340
|
+
const message = unwrapUserText(object(raw.message));
|
|
341
|
+
// Keep indexes for historical images while removing thinking contents.
|
|
342
|
+
// The one exception is narration: short progress notes the model writes
|
|
343
|
+
// for the person watching (the lines Claude Code's terminal shows between
|
|
344
|
+
// tool calls). They arrive as thinking blocks whose signature declares
|
|
345
|
+
// them narration and whose text is present; private reasoning is stored
|
|
346
|
+
// with empty text and a "thinking" signature and stays redacted.
|
|
347
|
+
if (typeof message.content === "string")
|
|
348
|
+
return raw.type === "user" && harnessPreamble(message.content) ? undefined : { ...raw, message };
|
|
349
|
+
if (Array.isArray(message.content))
|
|
350
|
+
return { ...raw, message: { ...message, content: objects(message.content).map(b => ["text", "image", "tool_use", "tool_result"].includes(String(b.type)) ? b
|
|
351
|
+
: isNarration(b) ? { type: "text", text: String(b.thinking), narration: true } : { type: "redacted" }) } };
|
|
352
|
+
return undefined;
|
|
353
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type Json } from "./protocol.js";
|
|
2
|
+
import type { Entry, LocalChildAgentRelation } from "./transcripts.js";
|
|
3
|
+
/** Codex's transcript reader: SubAgentActivity child links, the public rows
|
|
4
|
+
* of a rollout, and code-mode calls projected into ordinary tool calls. */
|
|
5
|
+
export type DirectRelation = Pick<LocalChildAgentRelation, "session" | "path" | "callId" | "state">;
|
|
6
|
+
export declare function directChildAgents(file: string): Promise<DirectRelation[]>;
|
|
7
|
+
export declare function childTranscriptBelongsTo(file: string, parent: string): Promise<boolean>;
|
|
8
|
+
/** Codex rows the phone may see: public messages, tool calls and their
|
|
9
|
+
* outputs, the answering model, and turn/usage events. */
|
|
10
|
+
export declare function visibleCodexEvent(raw: Json): Json | undefined;
|
|
11
|
+
/** Codex 0.155 code mode: the model calls one generic tool whose input is
|
|
12
|
+
* JavaScript, and that source invokes `tools.apply_patch`/`tools.shell`/
|
|
13
|
+
* `tools.read`. The Hook resolves each invocation into the ordinary call the
|
|
14
|
+
* phone already draws, so a patch shows a diff instead of an opaque source. */
|
|
15
|
+
export interface CodeToolCall {
|
|
16
|
+
name: "apply_patch" | "shell" | "read";
|
|
17
|
+
input: Json;
|
|
18
|
+
}
|
|
19
|
+
/** Every recognized invocation in a code-mode source, in the order written. */
|
|
20
|
+
export declare function codeToolCalls(source: string): CodeToolCall[] | undefined;
|
|
21
|
+
/** Expand one Codex row: a code-mode call becomes one ordinary call per
|
|
22
|
+
* invocation, each carrying the original source under `input.source`, and the
|
|
23
|
+
* matching result follows the first. Other rows pass through unchanged. */
|
|
24
|
+
export declare function projectCodexRow(raw: Json): {
|
|
25
|
+
rows: Json[];
|
|
26
|
+
base?: string;
|
|
27
|
+
};
|
|
28
|
+
/** The output row for a projected call is read before its call (newest row
|
|
29
|
+
* first), so an output already collected in this page follows the first. */
|
|
30
|
+
export declare function rewriteProjectedOutput(entries: Entry[], base: string): void;
|