@phren/cli 0.2.15 → 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.js +1 -1
- 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,16 @@
|
|
|
1
|
+
export declare const CODE_PACKAGE_HINT = "phren code needs @phren/code: run phren modules enable code";
|
|
2
|
+
type CodePackage = typeof import("@phren/code");
|
|
3
|
+
/** Where the loaded copy came from: an explicit directory, a resolver step or
|
|
4
|
+
* the bare specifier "@phren/code". Undefined until a load succeeds. */
|
|
5
|
+
export declare function loadedFrom(): string | undefined;
|
|
6
|
+
/** Resolution order for the optional package. First success wins and is remembered. */
|
|
7
|
+
export declare function loadCodePackage(store?: string): Promise<CodePackage | undefined>;
|
|
8
|
+
export declare function requireCodePackage(store?: string): Promise<CodePackage>;
|
|
9
|
+
/**
|
|
10
|
+
* Make @phren/code available to this store. A workspace checkout links its own
|
|
11
|
+
* package; otherwise npm installs into the store's runtime packages, which the
|
|
12
|
+
* Hook can resolve without a global npm.
|
|
13
|
+
*/
|
|
14
|
+
export declare function installCodePackage(store: string): Promise<CodePackage>;
|
|
15
|
+
export declare function copyCodeSkill(store: string, code: CodePackage): void;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { execFileSync } from "node:child_process";
|
|
2
|
+
import * as fs from "node:fs";
|
|
3
|
+
import { homedir } from "node:os";
|
|
4
|
+
import * as path from "node:path";
|
|
5
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
6
|
+
export const CODE_PACKAGE_HINT = "phren code needs @phren/code: run phren modules enable code";
|
|
7
|
+
let loaded;
|
|
8
|
+
let resolvedFrom;
|
|
9
|
+
/** Where the loaded copy came from: an explicit directory, a resolver step or
|
|
10
|
+
* the bare specifier "@phren/code". Undefined until a load succeeds. */
|
|
11
|
+
export function loadedFrom() { return resolvedFrom; }
|
|
12
|
+
/**
|
|
13
|
+
* The Hook bundle runs from `<bridge>/versions/<v>` with no node_modules, so a
|
|
14
|
+
* bare import fails there and the npm global root is invisible when the
|
|
15
|
+
* daemon's PATH has no npm (mise shims under systemd). Resolve a local copy
|
|
16
|
+
* before the bare import: an explicit directory, the bridge install, then the
|
|
17
|
+
* store's runtime packages.
|
|
18
|
+
*/
|
|
19
|
+
function bridgeRoot() { return process.env.PHREN_BRIDGE_HOME || path.join(homedir(), ".local/share/phren/bridge"); }
|
|
20
|
+
/** The npm shims and Homebrew bin a service manager's PATH usually omits. */
|
|
21
|
+
const EXTRA_PATH = [path.join(homedir(), ".local/share/mise/shims"), "/opt/homebrew/bin"];
|
|
22
|
+
function npmPath() {
|
|
23
|
+
const entries = (process.env.PATH ?? "").split(path.delimiter).filter(Boolean);
|
|
24
|
+
for (const entry of EXTRA_PATH)
|
|
25
|
+
if (!entries.includes(entry) && fs.existsSync(entry))
|
|
26
|
+
entries.push(entry);
|
|
27
|
+
return entries.join(path.delimiter);
|
|
28
|
+
}
|
|
29
|
+
/** The entry file an installed package declares, without executing anything. */
|
|
30
|
+
function packageEntry(directory) {
|
|
31
|
+
const manifest = JSON.parse(fs.readFileSync(path.join(directory, "package.json"), "utf8"));
|
|
32
|
+
const exported = typeof manifest.exports === "object" && manifest.exports !== null && "." in manifest.exports
|
|
33
|
+
? manifest.exports["."] : manifest.exports;
|
|
34
|
+
const nested = typeof exported === "object" && exported !== null ? exported.default ?? exported.import : exported;
|
|
35
|
+
for (const candidate of [nested, manifest.module, manifest.main, "index.js", "index.mjs"]) {
|
|
36
|
+
if (typeof candidate === "string")
|
|
37
|
+
return path.join(directory, candidate);
|
|
38
|
+
}
|
|
39
|
+
throw new Error(`@phren/code has no entry point in ${directory}.`);
|
|
40
|
+
}
|
|
41
|
+
async function importDirectory(directory) {
|
|
42
|
+
return await import(pathToFileURL(packageEntry(directory)).href);
|
|
43
|
+
}
|
|
44
|
+
function globalPackageDirectory() {
|
|
45
|
+
try {
|
|
46
|
+
const root = execFileSync("npm", ["root", "-g"], { encoding: "utf8", timeout: 10_000, env: { ...process.env, PATH: npmPath() } }).trim();
|
|
47
|
+
return root ? path.join(root, "@phren", "code") : undefined;
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
return undefined;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/** Resolution order for the optional package. First success wins and is remembered. */
|
|
54
|
+
export async function loadCodePackage(store) {
|
|
55
|
+
if (loaded)
|
|
56
|
+
return loaded;
|
|
57
|
+
const candidates = [];
|
|
58
|
+
if (process.env.PHREN_CODE_PACKAGE)
|
|
59
|
+
candidates.push(process.env.PHREN_CODE_PACKAGE);
|
|
60
|
+
candidates.push(path.join(bridgeRoot(), "node_modules", "@phren", "code"));
|
|
61
|
+
const root = store || process.env.PHREN_PATH;
|
|
62
|
+
if (root)
|
|
63
|
+
candidates.push(path.join(root, ".runtime", "packages", "node_modules", "@phren", "code"));
|
|
64
|
+
for (const directory of candidates) {
|
|
65
|
+
if (!fs.existsSync(path.join(directory, "package.json")))
|
|
66
|
+
continue;
|
|
67
|
+
try {
|
|
68
|
+
loaded = await importDirectory(directory);
|
|
69
|
+
resolvedFrom = directory;
|
|
70
|
+
return loaded;
|
|
71
|
+
}
|
|
72
|
+
catch { /* try the next candidate */ }
|
|
73
|
+
}
|
|
74
|
+
try {
|
|
75
|
+
loaded = await import("@phren/code");
|
|
76
|
+
resolvedFrom = "@phren/code";
|
|
77
|
+
return loaded;
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
if (error.code !== "ERR_MODULE_NOT_FOUND")
|
|
81
|
+
throw error;
|
|
82
|
+
}
|
|
83
|
+
const global = globalPackageDirectory();
|
|
84
|
+
if (global && fs.existsSync(path.join(global, "package.json"))) {
|
|
85
|
+
try {
|
|
86
|
+
loaded = await importDirectory(global);
|
|
87
|
+
resolvedFrom = global;
|
|
88
|
+
return loaded;
|
|
89
|
+
}
|
|
90
|
+
catch { /* not installed after all */ }
|
|
91
|
+
}
|
|
92
|
+
return undefined;
|
|
93
|
+
}
|
|
94
|
+
export async function requireCodePackage(store) {
|
|
95
|
+
const code = await loadCodePackage(store);
|
|
96
|
+
if (!code)
|
|
97
|
+
throw new Error(CODE_PACKAGE_HINT);
|
|
98
|
+
return code;
|
|
99
|
+
}
|
|
100
|
+
/** This repository checked out as a workspace, if its packages/code is present. */
|
|
101
|
+
function workspaceCodeDirectory() {
|
|
102
|
+
let directory = path.dirname(fileURLToPath(import.meta.url));
|
|
103
|
+
for (let depth = 0; depth < 8; depth++) {
|
|
104
|
+
const candidate = path.join(directory, "packages", "code");
|
|
105
|
+
if (fs.existsSync(path.join(candidate, "package.json")))
|
|
106
|
+
return candidate;
|
|
107
|
+
const parent = path.dirname(directory);
|
|
108
|
+
if (parent === directory)
|
|
109
|
+
break;
|
|
110
|
+
directory = parent;
|
|
111
|
+
}
|
|
112
|
+
return undefined;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Make @phren/code available to this store. A workspace checkout links its own
|
|
116
|
+
* package; otherwise npm installs into the store's runtime packages, which the
|
|
117
|
+
* Hook can resolve without a global npm.
|
|
118
|
+
*/
|
|
119
|
+
export async function installCodePackage(store) {
|
|
120
|
+
const existing = await loadCodePackage(store);
|
|
121
|
+
if (existing)
|
|
122
|
+
return existing;
|
|
123
|
+
const packages = path.join(store, ".runtime", "packages");
|
|
124
|
+
const linked = path.join(packages, "node_modules", "@phren", "code");
|
|
125
|
+
const workspace = workspaceCodeDirectory();
|
|
126
|
+
if (workspace) {
|
|
127
|
+
fs.mkdirSync(path.dirname(linked), { recursive: true });
|
|
128
|
+
fs.rmSync(linked, { recursive: true, force: true });
|
|
129
|
+
fs.symlinkSync(workspace, linked, "junction");
|
|
130
|
+
const code = await loadCodePackage(store);
|
|
131
|
+
if (!code)
|
|
132
|
+
throw new Error(`${CODE_PACKAGE_HINT}\nLinked ${workspace}, but it could not be loaded. Run pnpm build.`);
|
|
133
|
+
console.log(`@phren/code linked from ${workspace} into ${linked}.`);
|
|
134
|
+
return code;
|
|
135
|
+
}
|
|
136
|
+
try {
|
|
137
|
+
execFileSync("npm", ["install", "--prefix", packages, "@phren/code"], { stdio: "inherit", timeout: 120_000, env: { ...process.env, PATH: npmPath() } });
|
|
138
|
+
}
|
|
139
|
+
catch {
|
|
140
|
+
throw new Error(`${CODE_PACKAGE_HINT}\nInstallation failed. Run: npm install --prefix ${packages} @phren/code`);
|
|
141
|
+
}
|
|
142
|
+
const installed = await loadCodePackage(store);
|
|
143
|
+
if (!installed)
|
|
144
|
+
throw new Error(`${CODE_PACKAGE_HINT}\nRun: npm install --prefix ${packages} @phren/code`);
|
|
145
|
+
console.log(`@phren/code installed into ${packages}.`);
|
|
146
|
+
return installed;
|
|
147
|
+
}
|
|
148
|
+
export function copyCodeSkill(store, code) {
|
|
149
|
+
const destination = path.join(store, "global", "skills", "code", "SKILL.md");
|
|
150
|
+
fs.mkdirSync(path.dirname(destination), { recursive: true });
|
|
151
|
+
fs.copyFileSync(code.codeSkill, destination);
|
|
152
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { installCodePackage, copyCodeSkill } from "./code-package.js";
|
|
2
|
+
import { resolveRuntimeProfile } from "../runtime-profile.js";
|
|
3
|
+
import { resolveAllStores } from "../store-registry.js";
|
|
4
|
+
import { isVersionNewer } from "../init/init.js";
|
|
5
|
+
import { installedHookVersion, migrateInstalledModules, moduleSnapshot } from "./runtime.js";
|
|
6
|
+
import { BUILTIN_MODULES, moduleSource, readConfig } from "./registry.js";
|
|
7
|
+
import { setModuleEnabled } from "./config.js";
|
|
8
|
+
export async function runModules(args, ctx) {
|
|
9
|
+
const [action, ...rest] = args;
|
|
10
|
+
let name;
|
|
11
|
+
let profile;
|
|
12
|
+
let storeName;
|
|
13
|
+
if (action === "enable" || action === "disable")
|
|
14
|
+
name = rest.shift();
|
|
15
|
+
while (["--profile", "--store"].includes(rest[0]) && rest[1] && !rest[1].startsWith("-")) {
|
|
16
|
+
const option = rest.shift(), value = rest.shift();
|
|
17
|
+
if (option === "--profile" && profile === undefined)
|
|
18
|
+
profile = value;
|
|
19
|
+
else if (option === "--store" && storeName === undefined)
|
|
20
|
+
storeName = value;
|
|
21
|
+
else {
|
|
22
|
+
rest.push("invalid");
|
|
23
|
+
break;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (!["list", "enable", "disable"].includes(action) || rest.length || (action !== "list" && (!name || name.startsWith("-")))) {
|
|
27
|
+
console.error("Usage: phren modules list|enable|disable [name] [--profile <name>] [--store <name>]");
|
|
28
|
+
return 1;
|
|
29
|
+
}
|
|
30
|
+
if (name && !BUILTIN_MODULES.some(module => module.name === name))
|
|
31
|
+
throw new Error(`Unknown module "${name}".`);
|
|
32
|
+
if (name === "memory" && action === "disable")
|
|
33
|
+
throw new Error("The memory module cannot be disabled.");
|
|
34
|
+
let store = ctx.phrenPath();
|
|
35
|
+
if (storeName) {
|
|
36
|
+
const selected = resolveAllStores(store).find(entry => entry.name === storeName);
|
|
37
|
+
if (!selected || selected.available === false)
|
|
38
|
+
throw new Error(`Store "${storeName}" is unavailable.`);
|
|
39
|
+
if (action !== "list" && selected.role === "readonly")
|
|
40
|
+
throw new Error(`Store "${storeName}" is read-only.`);
|
|
41
|
+
store = selected.path;
|
|
42
|
+
}
|
|
43
|
+
const selectedProfile = profile ?? (action === "list" ? (storeName ? resolveRuntimeProfile(store) : ctx.profile()) : "");
|
|
44
|
+
if (action !== "list") {
|
|
45
|
+
migrateInstalledModules(store);
|
|
46
|
+
const code = name === "code" && action === "enable" ? await installCodePackage(store) : undefined;
|
|
47
|
+
setModuleEnabled(store, name, action === "enable", profile);
|
|
48
|
+
if (code)
|
|
49
|
+
copyCodeSkill(store, code);
|
|
50
|
+
console.log(`${name} ${action === "enable" ? "enabled" : "disabled"}${profile ? ` for profile ${profile}` : " for the store"}. Run phren init to reconcile integrations; restart MCP and Hook to refresh their surfaces.`);
|
|
51
|
+
if (action === "enable") {
|
|
52
|
+
const manifest = BUILTIN_MODULES.find(module => module.name === name);
|
|
53
|
+
const installed = installedHookVersion();
|
|
54
|
+
if (manifest && installed && isVersionNewer(manifest.version, installed)) {
|
|
55
|
+
console.error(`warning: installed Phren Hook ${installed} is older than module ${name} ${manifest.version}; run phren bridge update so the Hook knows this module.`);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const snapshot = moduleSnapshot(store, selectedProfile);
|
|
61
|
+
const config = readConfig(store);
|
|
62
|
+
console.log(`Modules for profile ${selectedProfile || "(store)"}`);
|
|
63
|
+
console.log("Module\tVersion\tEffective\tSource\tRequires");
|
|
64
|
+
for (const module of BUILTIN_MODULES) {
|
|
65
|
+
console.log(`${module.name}\t${module.version}\t${snapshot.has(module.name) ? "enabled" : "disabled"}\t${moduleSource(config, module.name, selectedProfile)}\t${module.requires.join(",") || "-"}`);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function setModuleEnabled(store: string, name: string, value: boolean, profile?: string): void;
|
|
2
|
+
/** Freeze legacy surfaces before runtime defaults can change an existing install. */
|
|
3
|
+
export declare function migrateModules(store: string, hookInstalled?: boolean): void;
|
|
4
|
+
export declare function initializeModules(store: string): void;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import * as fs from "node:fs";
|
|
2
|
+
import * as path from "node:path";
|
|
3
|
+
import * as yaml from "js-yaml";
|
|
4
|
+
import { withFileLock } from "../governance/locks.js";
|
|
5
|
+
import { atomicWriteText, installPreferencesFile, runtimeFile } from "../phren-paths.js";
|
|
6
|
+
import { inProgressGitOperation } from "../sync/git-state.js";
|
|
7
|
+
import { BUILTIN_MODULES, readConfig, resolveModules, validateConfig } from "./registry.js";
|
|
8
|
+
export function setModuleEnabled(store, name, value, profile) {
|
|
9
|
+
if (!BUILTIN_MODULES.some(module => module.name === name))
|
|
10
|
+
throw new Error(`Unknown module "${name}".`);
|
|
11
|
+
const file = path.join(store, ".config", "modules.yaml");
|
|
12
|
+
withFileLock(file, () => {
|
|
13
|
+
const config = readConfig(store) ?? { version: 1, enabled: { tasks: false } };
|
|
14
|
+
if (profile !== undefined) {
|
|
15
|
+
if (!profile.trim() || ["__proto__", "constructor", "prototype"].includes(profile))
|
|
16
|
+
throw new Error("Invalid module profile.");
|
|
17
|
+
config.profiles ??= {};
|
|
18
|
+
config.profiles[profile] ??= {};
|
|
19
|
+
config.profiles[profile].enabled = { ...config.profiles[profile].enabled, [name]: value };
|
|
20
|
+
}
|
|
21
|
+
else
|
|
22
|
+
config.enabled = { ...config.enabled, [name]: value };
|
|
23
|
+
validateConfig(config);
|
|
24
|
+
for (const scope of [undefined, ...Object.keys(config.profiles ?? {})])
|
|
25
|
+
resolveModules(config, scope);
|
|
26
|
+
atomicWriteText(file, yaml.dump(config, { noRefs: true, lineWidth: -1 }));
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
/** Freeze legacy surfaces before runtime defaults can change an existing install. */
|
|
30
|
+
export function migrateModules(store, hookInstalled = false) {
|
|
31
|
+
if (inProgressGitOperation(store))
|
|
32
|
+
return;
|
|
33
|
+
const file = path.join(store, ".config", "modules.yaml");
|
|
34
|
+
const existing = readConfig(store);
|
|
35
|
+
if (existing?.enabled?.tasks !== undefined)
|
|
36
|
+
return;
|
|
37
|
+
const legacy = fs.existsSync(path.join(store, "phren.root.yaml")) || fs.existsSync(installPreferencesFile(store));
|
|
38
|
+
if (!existing && !legacy && !hookInstalled)
|
|
39
|
+
return;
|
|
40
|
+
withFileLock(file, () => {
|
|
41
|
+
const current = readConfig(store);
|
|
42
|
+
if (current?.enabled?.tasks !== undefined)
|
|
43
|
+
return;
|
|
44
|
+
if (current) {
|
|
45
|
+
// Before memory-only defaults, an omitted tasks override meant enabled.
|
|
46
|
+
current.enabled = { tasks: true, ...current.enabled };
|
|
47
|
+
const text = yaml.dump(current, { noRefs: true });
|
|
48
|
+
atomicWriteText(runtimeFile(store, "modules.yaml.migration-backup"), fs.readFileSync(file, "utf8"));
|
|
49
|
+
atomicWriteText(file, text);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const conductor = fs.existsSync(path.join(store, "global", "skills", "conductor"));
|
|
53
|
+
const schedules = fs.existsSync(store) && fs.readdirSync(store, { withFileTypes: true })
|
|
54
|
+
.some(entry => entry.isDirectory() && fs.existsSync(path.join(store, entry.name, "schedules.yaml")));
|
|
55
|
+
const config = { version: 1, enabled: Object.fromEntries(BUILTIN_MODULES.map(module => [module.name,
|
|
56
|
+
["memory", "tasks", "git"].includes(module.name) || (hookInstalled && ["hook", "schedules", "conductor"].includes(module.name))
|
|
57
|
+
|| (conductor && ["hook", "conductor"].includes(module.name)) || (schedules && module.name === "schedules"),
|
|
58
|
+
])) };
|
|
59
|
+
const text = yaml.dump(config, { noRefs: true });
|
|
60
|
+
atomicWriteText(runtimeFile(store, "modules.yaml.migration-backup"), text);
|
|
61
|
+
atomicWriteText(file, text);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
export function initializeModules(store) {
|
|
65
|
+
const file = path.join(store, ".config", "modules.yaml");
|
|
66
|
+
withFileLock(file, () => {
|
|
67
|
+
if (!readConfig(store))
|
|
68
|
+
atomicWriteText(file, yaml.dump({ version: 1, enabled: Object.fromEntries(BUILTIN_MODULES.map(module => [module.name, module.defaultEnabled])) }, { noRefs: true }));
|
|
69
|
+
});
|
|
70
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { McpProfile } from "../mcp/profile.js";
|
|
2
|
+
export interface ModuleTool {
|
|
3
|
+
name: string;
|
|
4
|
+
profiles: readonly McpProfile[];
|
|
5
|
+
}
|
|
6
|
+
export interface ModuleAgentHook {
|
|
7
|
+
agents: readonly string[];
|
|
8
|
+
events: readonly string[];
|
|
9
|
+
handler: string;
|
|
10
|
+
}
|
|
11
|
+
export interface ModuleRoute {
|
|
12
|
+
method: "GET" | "POST" | "DELETE" | "WS";
|
|
13
|
+
path: string;
|
|
14
|
+
}
|
|
15
|
+
/** Declarations only: loading a manifest must not install or start its module. */
|
|
16
|
+
export interface ModuleManifest {
|
|
17
|
+
schemaVersion: 1;
|
|
18
|
+
name: string;
|
|
19
|
+
version: string;
|
|
20
|
+
defaultEnabled: boolean;
|
|
21
|
+
requires: readonly string[];
|
|
22
|
+
tools: readonly ModuleTool[];
|
|
23
|
+
cliCommands: readonly string[];
|
|
24
|
+
agentHooks: readonly ModuleAgentHook[];
|
|
25
|
+
hookRoutes: readonly ModuleRoute[];
|
|
26
|
+
capabilities: readonly string[];
|
|
27
|
+
storeFiles: readonly string[];
|
|
28
|
+
localFiles: readonly string[];
|
|
29
|
+
phoneScreens: readonly {
|
|
30
|
+
screen: string;
|
|
31
|
+
capability: string;
|
|
32
|
+
}[];
|
|
33
|
+
skills: readonly string[];
|
|
34
|
+
}
|
|
35
|
+
export interface ModulesConfig {
|
|
36
|
+
version: 1;
|
|
37
|
+
enabled?: Record<string, boolean>;
|
|
38
|
+
profiles?: Record<string, {
|
|
39
|
+
enabled?: Record<string, boolean>;
|
|
40
|
+
}>;
|
|
41
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import * as fs from "node:fs";
|
|
2
|
+
import * as path from "node:path";
|
|
3
|
+
import { createHash } from "node:crypto";
|
|
4
|
+
import { atomicWriteText } from "../phren-paths.js";
|
|
5
|
+
import { BUILTIN_MODULES } from "./registry.js";
|
|
6
|
+
import { moduleSnapshot } from "./runtime.js";
|
|
7
|
+
export function skillEnabled(store, name, profile) {
|
|
8
|
+
const owner = BUILTIN_MODULES.find(module => module.skills.includes(name.replace(/\.md$/, "")));
|
|
9
|
+
return !owner || moduleSnapshot(store, profile).has(owner.name);
|
|
10
|
+
}
|
|
11
|
+
export function reconcileStarterSkills(store, starter) {
|
|
12
|
+
const ledgerFile = path.join(store, ".runtime", "module-starters.json");
|
|
13
|
+
let ledger = {};
|
|
14
|
+
try {
|
|
15
|
+
ledger = JSON.parse(fs.readFileSync(ledgerFile, "utf8"));
|
|
16
|
+
}
|
|
17
|
+
catch (error) {
|
|
18
|
+
if (error.code !== "ENOENT")
|
|
19
|
+
throw error;
|
|
20
|
+
}
|
|
21
|
+
const digest = (file) => createHash("sha256").update(fs.readFileSync(file)).digest("hex");
|
|
22
|
+
const snapshot = moduleSnapshot(store);
|
|
23
|
+
for (const module of BUILTIN_MODULES)
|
|
24
|
+
for (const skill of module.skills) {
|
|
25
|
+
const source = path.join(starter, "global", "skills", skill);
|
|
26
|
+
const visit = (dir, prefix) => {
|
|
27
|
+
if (!fs.existsSync(dir))
|
|
28
|
+
return;
|
|
29
|
+
const destination = path.join(store, prefix);
|
|
30
|
+
if (fs.lstatSync(destination, { throwIfNoEntry: false })?.isSymbolicLink())
|
|
31
|
+
return;
|
|
32
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
33
|
+
const relative = path.join(prefix, entry.name);
|
|
34
|
+
const src = path.join(dir, entry.name), dest = path.join(store, relative);
|
|
35
|
+
if (entry.isDirectory()) {
|
|
36
|
+
visit(src, relative);
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
if (!entry.isFile())
|
|
40
|
+
continue;
|
|
41
|
+
const stat = fs.lstatSync(dest, { throwIfNoEntry: false });
|
|
42
|
+
if (stat && (!stat.isFile() || stat.isSymbolicLink()))
|
|
43
|
+
continue;
|
|
44
|
+
const expected = digest(src);
|
|
45
|
+
if (snapshot.has(module.name)) {
|
|
46
|
+
if (!stat) {
|
|
47
|
+
fs.mkdirSync(path.dirname(dest), { recursive: true });
|
|
48
|
+
fs.copyFileSync(src, dest);
|
|
49
|
+
ledger[relative] = expected;
|
|
50
|
+
}
|
|
51
|
+
else if (digest(dest) === expected)
|
|
52
|
+
ledger[relative] = expected;
|
|
53
|
+
}
|
|
54
|
+
else if (stat && [expected, ledger[relative]].includes(digest(dest))) {
|
|
55
|
+
fs.unlinkSync(dest);
|
|
56
|
+
delete ledger[relative];
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
const target = path.join(store, prefix);
|
|
60
|
+
if (!snapshot.has(module.name) && fs.existsSync(target) && fs.readdirSync(target).length === 0)
|
|
61
|
+
fs.rmdirSync(target);
|
|
62
|
+
};
|
|
63
|
+
visit(source, path.join("global", "skills", skill));
|
|
64
|
+
}
|
|
65
|
+
const instructions = path.join(starter, "global", "AGENTS.md");
|
|
66
|
+
if (fs.existsSync(instructions)) {
|
|
67
|
+
const relative = "global/AGENTS.md", dest = path.join(store, relative);
|
|
68
|
+
const source = fs.readFileSync(instructions, "utf8"), desired = starterInstructions(store, source);
|
|
69
|
+
const stat = fs.lstatSync(dest, { throwIfNoEntry: false });
|
|
70
|
+
if (!stat || (stat.isFile() && !stat.isSymbolicLink() && [digest(instructions), ledger[relative]].includes(digest(dest)))) {
|
|
71
|
+
fs.mkdirSync(path.dirname(dest), { recursive: true });
|
|
72
|
+
atomicWriteText(dest, desired);
|
|
73
|
+
ledger[relative] = digest(dest);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
fs.mkdirSync(path.dirname(ledgerFile), { recursive: true });
|
|
77
|
+
atomicWriteText(ledgerFile, JSON.stringify(ledger, null, 2) + "\n");
|
|
78
|
+
}
|
|
79
|
+
export function starterInstructions(store, content) {
|
|
80
|
+
if (moduleSnapshot(store).has("tasks"))
|
|
81
|
+
return content;
|
|
82
|
+
return content.split("\n").filter(line => !line.startsWith("- Tasks:")).join("\n")
|
|
83
|
+
.replace("findings, tasks and skills", "findings and skills");
|
|
84
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ModuleManifest, ModulesConfig } from "./manifest.js";
|
|
2
|
+
export declare const BUILTIN_MODULES: readonly ModuleManifest[];
|
|
3
|
+
export declare function readConfig(store: string): ModulesConfig | undefined;
|
|
4
|
+
/**
|
|
5
|
+
* Unknown keys belong to a newer CLI that enabled a module this build (the
|
|
6
|
+
* Hook) does not know; they are ignored, kept for writes, and warned about
|
|
7
|
+
* once instead of failing every Hook connection.
|
|
8
|
+
*/
|
|
9
|
+
export declare function validateConfig(input: unknown, warnUnknown?: boolean): ModulesConfig;
|
|
10
|
+
/** Reads never mutate configuration or enable dependencies implicitly. */
|
|
11
|
+
export declare function enabled(store: string, profile?: string): readonly ModuleManifest[];
|
|
12
|
+
export declare function resolveModules(config: ModulesConfig | undefined, profile?: string): readonly ModuleManifest[];
|
|
13
|
+
export declare function moduleSource(config: ModulesConfig | undefined, name: string, profile?: string): "default" | "store" | "profile";
|
|
14
|
+
export declare function toolOwner(name: string): ModuleManifest | undefined;
|
|
15
|
+
export declare function commandOwner(command: string): ModuleManifest | undefined;
|
|
16
|
+
export declare function disabledHint(name: string): string;
|