codebyplan 1.13.64 → 1.13.66
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 +118 -75
- package/dist/__tests__/helpers.d.ts +22 -0
- package/dist/__tests__/helpers.d.ts.map +1 -0
- package/dist/ci-public.d.ts +20 -0
- package/dist/ci-public.d.ts.map +1 -0
- package/dist/ci.js +11 -2
- package/dist/cli/arch-map.d.ts +33 -0
- package/dist/cli/arch-map.d.ts.map +1 -0
- package/dist/cli/branch.d.ts +10 -0
- package/dist/cli/branch.d.ts.map +1 -0
- package/dist/cli/bump.d.ts +12 -0
- package/dist/cli/bump.d.ts.map +1 -0
- package/dist/cli/cd.d.ts +20 -0
- package/dist/cli/cd.d.ts.map +1 -0
- package/dist/cli/check.d.ts +30 -0
- package/dist/cli/check.d.ts.map +1 -0
- package/dist/cli/checkpoint.d.ts +17 -0
- package/dist/cli/checkpoint.d.ts.map +1 -0
- package/dist/cli/ci.d.ts +31 -0
- package/dist/cli/ci.d.ts.map +1 -0
- package/dist/cli/claude/__test-helpers__/expect-manifest.d.ts +7 -0
- package/dist/cli/claude/__test-helpers__/expect-manifest.d.ts.map +1 -0
- package/dist/cli/claude/__test-helpers__/tmp-fixture.d.ts +64 -0
- package/dist/cli/claude/__test-helpers__/tmp-fixture.d.ts.map +1 -0
- package/dist/cli/claude/audit-mode.d.ts +16 -0
- package/dist/cli/claude/audit-mode.d.ts.map +1 -0
- package/dist/cli/claude/generate.d.ts +23 -0
- package/dist/cli/claude/generate.d.ts.map +1 -0
- package/dist/cli/claude/install.d.ts +55 -0
- package/dist/cli/claude/install.d.ts.map +1 -0
- package/dist/cli/claude/migrate-memory.d.ts +117 -0
- package/dist/cli/claude/migrate-memory.d.ts.map +1 -0
- package/dist/cli/claude/readme.d.ts +28 -0
- package/dist/cli/claude/readme.d.ts.map +1 -0
- package/dist/cli/claude/status.d.ts +41 -0
- package/dist/cli/claude/status.d.ts.map +1 -0
- package/dist/cli/claude/uninstall.d.ts +21 -0
- package/dist/cli/claude/uninstall.d.ts.map +1 -0
- package/dist/cli/claude/update.d.ts +25 -0
- package/dist/cli/claude/update.d.ts.map +1 -0
- package/dist/cli/claude/verify-parity.d.ts +25 -0
- package/dist/cli/claude/verify-parity.d.ts.map +1 -0
- package/dist/cli/cleanup-plan-folders.d.ts +21 -0
- package/dist/cli/cleanup-plan-folders.d.ts.map +1 -0
- package/dist/cli/commit.d.ts +25 -0
- package/dist/cli/commit.d.ts.map +1 -0
- package/dist/cli/config.d.ts +50 -0
- package/dist/cli/config.d.ts.map +1 -0
- package/dist/cli/confirm.d.ts +9 -0
- package/dist/cli/confirm.d.ts.map +1 -0
- package/dist/cli/create-org.d.ts +9 -0
- package/dist/cli/create-org.d.ts.map +1 -0
- package/dist/cli/create-project.d.ts +10 -0
- package/dist/cli/create-project.d.ts.map +1 -0
- package/dist/cli/create-repo.d.ts +14 -0
- package/dist/cli/create-repo.d.ts.map +1 -0
- package/dist/cli/docs.d.ts +41 -0
- package/dist/cli/docs.d.ts.map +1 -0
- package/dist/cli/doctor.d.ts +17 -0
- package/dist/cli/doctor.d.ts.map +1 -0
- package/dist/cli/e2e/verify-round.d.ts +46 -0
- package/dist/cli/e2e/verify-round.d.ts.map +1 -0
- package/dist/cli/e2e.d.ts +11 -0
- package/dist/cli/e2e.d.ts.map +1 -0
- package/dist/cli/eslint.d.ts +20 -0
- package/dist/cli/eslint.d.ts.map +1 -0
- package/dist/cli/export-writer.d.ts +99 -0
- package/dist/cli/export-writer.d.ts.map +1 -0
- package/dist/cli/handoff.d.ts +13 -0
- package/dist/cli/handoff.d.ts.map +1 -0
- package/dist/cli/login.d.ts +10 -0
- package/dist/cli/login.d.ts.map +1 -0
- package/dist/cli/logout.d.ts +2 -0
- package/dist/cli/logout.d.ts.map +1 -0
- package/dist/cli/lsp.d.ts +16 -0
- package/dist/cli/lsp.d.ts.map +1 -0
- package/dist/cli/migration-collisions.d.ts +10 -0
- package/dist/cli/migration-collisions.d.ts.map +1 -0
- package/dist/cli/ports.d.ts +29 -0
- package/dist/cli/ports.d.ts.map +1 -0
- package/dist/cli/process-exit-signal.d.ts +24 -0
- package/dist/cli/process-exit-signal.d.ts.map +1 -0
- package/dist/cli/round.d.ts +79 -0
- package/dist/cli/round.d.ts.map +1 -0
- package/dist/cli/scaffold-publish-workflow.d.ts +16 -0
- package/dist/cli/scaffold-publish-workflow.d.ts.map +1 -0
- package/dist/cli/session/freshness-gate.d.ts +21 -0
- package/dist/cli/session/freshness-gate.d.ts.map +1 -0
- package/dist/cli/session/home-ff.d.ts +16 -0
- package/dist/cli/session/home-ff.d.ts.map +1 -0
- package/dist/cli/session/infra-files.d.ts +21 -0
- package/dist/cli/session/infra-files.d.ts.map +1 -0
- package/dist/cli/session/start.d.ts +70 -0
- package/dist/cli/session/start.d.ts.map +1 -0
- package/dist/cli/session.d.ts +17 -0
- package/dist/cli/session.d.ts.map +1 -0
- package/dist/cli/setup.d.ts +2 -0
- package/dist/cli/setup.d.ts.map +1 -0
- package/dist/cli/ship.d.ts +16 -0
- package/dist/cli/ship.d.ts.map +1 -0
- package/dist/cli/slug.d.ts +10 -0
- package/dist/cli/slug.d.ts.map +1 -0
- package/dist/cli/standalone-task.d.ts +31 -0
- package/dist/cli/standalone-task.d.ts.map +1 -0
- package/dist/cli/statusline.d.ts +10 -0
- package/dist/cli/statusline.d.ts.map +1 -0
- package/dist/cli/supabase/new-migration.d.ts +24 -0
- package/dist/cli/supabase/new-migration.d.ts.map +1 -0
- package/dist/cli/supabase/preview-check.d.ts +30 -0
- package/dist/cli/supabase/preview-check.d.ts.map +1 -0
- package/dist/cli/supabase/resolve-preview.d.ts +19 -0
- package/dist/cli/supabase/resolve-preview.d.ts.map +1 -0
- package/dist/cli/supabase/teardown-preview.d.ts +22 -0
- package/dist/cli/supabase/teardown-preview.d.ts.map +1 -0
- package/dist/cli/sync.d.ts +13 -0
- package/dist/cli/sync.d.ts.map +1 -0
- package/dist/cli/task.d.ts +17 -0
- package/dist/cli/task.d.ts.map +1 -0
- package/dist/cli/tech-stack.d.ts +11 -0
- package/dist/cli/tech-stack.d.ts.map +1 -0
- package/dist/cli/upgrade-auth.d.ts +2 -0
- package/dist/cli/upgrade-auth.d.ts.map +1 -0
- package/dist/cli/upload-e2e-images.d.ts +18 -0
- package/dist/cli/upload-e2e-images.d.ts.map +1 -0
- package/dist/cli/validate-waves.d.ts +22 -0
- package/dist/cli/validate-waves.d.ts.map +1 -0
- package/dist/cli/version-status.d.ts +42 -0
- package/dist/cli/version-status.d.ts.map +1 -0
- package/dist/cli/watch.d.ts +18 -0
- package/dist/cli/watch.d.ts.map +1 -0
- package/dist/cli/whoami.d.ts +5 -0
- package/dist/cli/whoami.d.ts.map +1 -0
- package/dist/cli/worktree/add.d.ts +81 -0
- package/dist/cli/worktree/add.d.ts.map +1 -0
- package/dist/cli/worktree/create.d.ts +46 -0
- package/dist/cli/worktree/create.d.ts.map +1 -0
- package/dist/cli/worktree/path.d.ts +19 -0
- package/dist/cli/worktree/path.d.ts.map +1 -0
- package/dist/cli/worktree/remove.d.ts +60 -0
- package/dist/cli/worktree/remove.d.ts.map +1 -0
- package/dist/cli/worktree.d.ts +15 -0
- package/dist/cli/worktree.d.ts.map +1 -0
- package/dist/cli.js +6194 -5429
- package/dist/dispatch.d.ts +64 -0
- package/dist/dispatch.d.ts.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/lib/agents-generator.d.ts +42 -0
- package/dist/lib/agents-generator.d.ts.map +1 -0
- package/dist/lib/api.d.ts +54 -0
- package/dist/lib/api.d.ts.map +1 -0
- package/dist/lib/atomic-write.d.ts +27 -0
- package/dist/lib/atomic-write.d.ts.map +1 -0
- package/dist/lib/branch-checkout.d.ts +47 -0
- package/dist/lib/branch-checkout.d.ts.map +1 -0
- package/dist/lib/branch-port-resolver.d.ts +58 -0
- package/dist/lib/branch-port-resolver.d.ts.map +1 -0
- package/dist/lib/bump.d.ts +97 -0
- package/dist/lib/bump.d.ts.map +1 -0
- package/dist/lib/cd-init.d.ts +86 -0
- package/dist/lib/cd-init.d.ts.map +1 -0
- package/dist/lib/check-baseline.d.ts +91 -0
- package/dist/lib/check-baseline.d.ts.map +1 -0
- package/dist/lib/check.d.ts +178 -0
- package/dist/lib/check.d.ts.map +1 -0
- package/dist/lib/ci-init.d.ts +106 -0
- package/dist/lib/ci-init.d.ts.map +1 -0
- package/dist/lib/ci-resolve.d.ts +60 -0
- package/dist/lib/ci-resolve.d.ts.map +1 -0
- package/dist/lib/claude-mode-audit.d.ts +41 -0
- package/dist/lib/claude-mode-audit.d.ts.map +1 -0
- package/dist/lib/claude-plan.d.ts +34 -0
- package/dist/lib/claude-plan.d.ts.map +1 -0
- package/dist/lib/commit-scope.d.ts +21 -0
- package/dist/lib/commit-scope.d.ts.map +1 -0
- package/dist/lib/e2e.d.ts +157 -0
- package/dist/lib/e2e.d.ts.map +1 -0
- package/dist/lib/eslint-generator.d.ts +86 -0
- package/dist/lib/eslint-generator.d.ts.map +1 -0
- package/dist/lib/file-lock.d.ts +44 -0
- package/dist/lib/file-lock.d.ts.map +1 -0
- package/dist/lib/flags.d.ts +115 -0
- package/dist/lib/flags.d.ts.map +1 -0
- package/dist/lib/gh-required-checks.d.ts +76 -0
- package/dist/lib/gh-required-checks.d.ts.map +1 -0
- package/dist/lib/git-utils.d.ts +46 -0
- package/dist/lib/git-utils.d.ts.map +1 -0
- package/dist/lib/gitignore-block.d.ts +32 -0
- package/dist/lib/gitignore-block.d.ts.map +1 -0
- package/dist/lib/gitignore-detect.d.ts +117 -0
- package/dist/lib/gitignore-detect.d.ts.map +1 -0
- package/dist/lib/handoff-file.d.ts +63 -0
- package/dist/lib/handoff-file.d.ts.map +1 -0
- package/dist/lib/hash.d.ts +9 -0
- package/dist/lib/hash.d.ts.map +1 -0
- package/dist/lib/lsp-detect.d.ts +42 -0
- package/dist/lib/lsp-detect.d.ts.map +1 -0
- package/dist/lib/manifest.d.ts +88 -0
- package/dist/lib/manifest.d.ts.map +1 -0
- package/dist/lib/mcp-client.d.ts +39 -0
- package/dist/lib/mcp-client.d.ts.map +1 -0
- package/dist/lib/migrate-branch-model.d.ts +34 -0
- package/dist/lib/migrate-branch-model.d.ts.map +1 -0
- package/dist/lib/migrate-local-config.d.ts +39 -0
- package/dist/lib/migrate-local-config.d.ts.map +1 -0
- package/dist/lib/migration-collisions.d.ts +61 -0
- package/dist/lib/migration-collisions.d.ts.map +1 -0
- package/dist/lib/port-verify.d.ts +73 -0
- package/dist/lib/port-verify.d.ts.map +1 -0
- package/dist/lib/prompt.d.ts +41 -0
- package/dist/lib/prompt.d.ts.map +1 -0
- package/dist/lib/readme-generator.d.ts +108 -0
- package/dist/lib/readme-generator.d.ts.map +1 -0
- package/dist/lib/repo-reader.d.ts +59 -0
- package/dist/lib/repo-reader.d.ts.map +1 -0
- package/dist/lib/scaffold-cd-workflow.d.ts +48 -0
- package/dist/lib/scaffold-cd-workflow.d.ts.map +1 -0
- package/dist/lib/scaffold-ci-workflow.d.ts +83 -0
- package/dist/lib/scaffold-ci-workflow.d.ts.map +1 -0
- package/dist/lib/scaffold-publish-workflow.d.ts +48 -0
- package/dist/lib/scaffold-publish-workflow.d.ts.map +1 -0
- package/dist/lib/server-detect.d.ts +20 -0
- package/dist/lib/server-detect.d.ts.map +1 -0
- package/dist/lib/session.d.ts +371 -0
- package/dist/lib/session.d.ts.map +1 -0
- package/dist/lib/settings-merge.d.ts +268 -0
- package/dist/lib/settings-merge.d.ts.map +1 -0
- package/dist/lib/ship.d.ts +84 -0
- package/dist/lib/ship.d.ts.map +1 -0
- package/dist/lib/slug.d.ts +26 -0
- package/dist/lib/slug.d.ts.map +1 -0
- package/dist/lib/spawn.d.ts +12 -0
- package/dist/lib/spawn.d.ts.map +1 -0
- package/dist/lib/state-client.d.ts +54 -0
- package/dist/lib/state-client.d.ts.map +1 -0
- package/dist/lib/state-store.d.ts +153 -0
- package/dist/lib/state-store.d.ts.map +1 -0
- package/dist/lib/state-sync.d.ts +101 -0
- package/dist/lib/state-sync.d.ts.map +1 -0
- package/dist/lib/statusline-config.d.ts +55 -0
- package/dist/lib/statusline-config.d.ts.map +1 -0
- package/dist/lib/structure-generator.d.ts +63 -0
- package/dist/lib/structure-generator.d.ts.map +1 -0
- package/dist/lib/supabase.d.ts +87 -0
- package/dist/lib/supabase.d.ts.map +1 -0
- package/dist/lib/sync-approvals.d.ts +108 -0
- package/dist/lib/sync-approvals.d.ts.map +1 -0
- package/dist/lib/tech-detect.d.ts +77 -0
- package/dist/lib/tech-detect.d.ts.map +1 -0
- package/dist/lib/template-walker.d.ts +26 -0
- package/dist/lib/template-walker.d.ts.map +1 -0
- package/dist/lib/templates-dir.d.ts +25 -0
- package/dist/lib/templates-dir.d.ts.map +1 -0
- package/dist/lib/types.d.ts +843 -0
- package/dist/lib/types.d.ts.map +1 -0
- package/dist/lib/validate-waves.d.ts +38 -0
- package/dist/lib/validate-waves.d.ts.map +1 -0
- package/dist/lib/verify-parity.d.ts +154 -0
- package/dist/lib/verify-parity.d.ts.map +1 -0
- package/dist/lib/version.d.ts +3 -0
- package/dist/lib/version.d.ts.map +1 -0
- package/dist/lib/watch-daemon.d.ts +114 -0
- package/dist/lib/watch-daemon.d.ts.map +1 -0
- package/dist/lib/worktree.d.ts +56 -0
- package/dist/lib/worktree.d.ts.map +1 -0
- package/dist/oauth/browser.d.ts +8 -0
- package/dist/oauth/browser.d.ts.map +1 -0
- package/dist/oauth/client-registration.d.ts +16 -0
- package/dist/oauth/client-registration.d.ts.map +1 -0
- package/dist/oauth/device-flow.d.ts +40 -0
- package/dist/oauth/device-flow.d.ts.map +1 -0
- package/dist/oauth/jwt-decode.d.ts +10 -0
- package/dist/oauth/jwt-decode.d.ts.map +1 -0
- package/dist/oauth/keychain.d.ts +17 -0
- package/dist/oauth/keychain.d.ts.map +1 -0
- package/dist/oauth/token-refresh.d.ts +7 -0
- package/dist/oauth/token-refresh.d.ts.map +1 -0
- package/dist/oauth/types.d.ts +28 -0
- package/dist/oauth/types.d.ts.map +1 -0
- package/dist/oauth/urls.d.ts +16 -0
- package/dist/oauth/urls.d.ts.map +1 -0
- package/package.json +5 -6
- package/templates/agents/cbp-security-agent.md +0 -1
- package/templates/agents/cbp-stripe-agent.md +0 -1
- package/templates/agents/cbp-testing-qa-agent.md +0 -1
- package/templates/github-workflows/ci.yml +5 -0
- package/templates/hooks/cbp-session-id-stamp.sh +67 -0
- package/templates/hooks/cbp-skill-context-guard.sh +0 -1
- package/templates/hooks/cbp-test-hooks.sh +105 -0
- package/templates/hooks/validate-structure-lib.sh +36 -9
- package/templates/rules/handoff-file-convention.md +65 -0
- package/templates/settings.project.base.json +17 -1
- package/templates/skills/cbp-checkpoint-check/SKILL.md +0 -1
- package/templates/skills/cbp-checkpoint-complete/SKILL.md +32 -0
- package/templates/skills/cbp-clear-continue/SKILL.md +23 -2
- package/templates/skills/cbp-clear-prep/SKILL.md +22 -2
- package/templates/skills/cbp-finalize/SKILL.md +36 -0
- package/templates/skills/cbp-session-end/SKILL.md +23 -25
- package/templates/skills/cbp-session-start/SKILL.md +24 -2
- package/templates/skills/cbp-setup-cd/SKILL.md +0 -1
- package/templates/skills/cbp-setup-ci/SKILL.md +0 -1
- package/templates/skills/cbp-standalone-task-complete/SKILL.md +32 -0
- package/templates/skills/cbp-stripe/SKILL.md +0 -1
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export interface CliOpts {
|
|
2
|
+
yes: boolean;
|
|
3
|
+
dryRun: boolean;
|
|
4
|
+
verbose: boolean;
|
|
5
|
+
/** Install scope. Defaults to `'project'`. */
|
|
6
|
+
scope?: "user" | "project";
|
|
7
|
+
/** Renderer to persist into `.codebyplan/statusline.local.json` after a successful project-scope install. */
|
|
8
|
+
renderer?: "bash" | "node" | "python";
|
|
9
|
+
}
|
|
10
|
+
export interface InstallDeps {
|
|
11
|
+
/** Override the templates directory. Used by tests to inject a fixture. */
|
|
12
|
+
templatesDir?: string;
|
|
13
|
+
/** Override the project root. Defaults to process.cwd(). */
|
|
14
|
+
projectDir?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Override the user directory (e.g. `~/.claude`). Used by tests to inject
|
|
17
|
+
* a fixture userDir without touching the real home dir.
|
|
18
|
+
*/
|
|
19
|
+
userDir?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Injectable deps for detectAndHealSettingsGitignore (testing only).
|
|
22
|
+
* Omit in production — defaults are the real git subprocess implementations.
|
|
23
|
+
*/
|
|
24
|
+
detectHealDeps?: import("../../lib/gitignore-detect.js").DetectAndHealDeps;
|
|
25
|
+
/**
|
|
26
|
+
* Injectable dep for warnIfSettingsUntracked (testing only).
|
|
27
|
+
* Omit in production — defaults to real git subprocess.
|
|
28
|
+
*/
|
|
29
|
+
lsFilesDep?: {
|
|
30
|
+
gitLsFiles?: (projectDir: string) => number;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
import { resolveTemplatesDir } from "../../lib/templates-dir.js";
|
|
34
|
+
export { resolveTemplatesDir };
|
|
35
|
+
/**
|
|
36
|
+
* Install codebyplan assets into `${projectDir}/.claude/`.
|
|
37
|
+
*
|
|
38
|
+
* Sequence:
|
|
39
|
+
* 1. Walk packaged `templates/` (skipping `hooks/hooks.json` + `hooks/README.md`)
|
|
40
|
+
* 2. Copy each file under `.claude/<rel>` (verbose mode logs every copy)
|
|
41
|
+
* 3. Merge `settings.project.base.json` (if present) and `hooks/hooks.json`
|
|
42
|
+
* (if present) into `.claude/settings.json`. The settings.json write is
|
|
43
|
+
* UNCONDITIONAL — the file is always normalised even when both source
|
|
44
|
+
* files are absent, so every install guarantees a valid settings.json.
|
|
45
|
+
* 4. Write the manifest (`<projectDir>/.claude/.cbp.manifest.json`)
|
|
46
|
+
*
|
|
47
|
+
* `--dry-run` short-circuits every write — files are walked + hashed,
|
|
48
|
+
* settings.json delta is computed, but nothing lands on disk.
|
|
49
|
+
*
|
|
50
|
+
* All I/O is wrapped in a single try/catch. On failure, `process.exitCode`
|
|
51
|
+
* is set to 1 and the error is logged to stderr; the caller (index.ts) does
|
|
52
|
+
* not need to re-implement that.
|
|
53
|
+
*/
|
|
54
|
+
export declare function runInstall(opts: CliOpts, deps?: InstallDeps): Promise<void>;
|
|
55
|
+
//# sourceMappingURL=install.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../../src/cli/claude/install.ts"],"names":[],"mappings":"AAqBA,MAAM,WAAW,OAAO;IACtB,GAAG,EAAE,OAAO,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,8CAA8C;IAC9C,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,6GAA6G;IAC7G,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;CACvC;AAED,MAAM,WAAW,WAAW;IAC1B,2EAA2E;IAC3E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,4DAA4D;IAC5D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,+BAA+B,EAAE,iBAAiB,CAAC;IAC3E;;;OAGG;IACH,UAAU,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,MAAM,CAAA;KAAE,CAAC;CAC9D;AAED,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAMjE,OAAO,EAAE,mBAAmB,EAAE,CAAC;AAE/B;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,UAAU,CAC9B,IAAI,EAAE,OAAO,EACb,IAAI,GAAE,WAAgB,GACrB,OAAO,CAAC,IAAI,CAAC,CAkKf"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `codebyplan claude migrate-memory`
|
|
3
|
+
*
|
|
4
|
+
* Inventory auto-memory topic files under ~/.claude/projects/<encoded-path>/memory/,
|
|
5
|
+
* emit a classification-ready plan JSON, and (opt-in --apply <plan-file>) apply
|
|
6
|
+
* an approved plan:
|
|
7
|
+
* - Create / append nested CLAUDE.md files for "keep" entries
|
|
8
|
+
* - Idempotently ensure <projectDir>/.claude/CLAUDE.md contains @import line
|
|
9
|
+
* - Delete "drop" files + MEMORY.md
|
|
10
|
+
* - rmdir the memory dir if empty after deletions
|
|
11
|
+
*
|
|
12
|
+
* Usage:
|
|
13
|
+
* codebyplan claude migrate-memory # inventory mode (print plan JSON)
|
|
14
|
+
* codebyplan claude migrate-memory --json # same (alias)
|
|
15
|
+
* codebyplan claude migrate-memory --dry-run # print plan + what apply WOULD do
|
|
16
|
+
* codebyplan claude migrate-memory --apply <file> # read plan JSON, run apply
|
|
17
|
+
*/
|
|
18
|
+
export interface MemoryEntryPlan {
|
|
19
|
+
/** Original filename (e.g. "feedback_foo.md") */
|
|
20
|
+
filename: string;
|
|
21
|
+
/** Absolute path to the source file */
|
|
22
|
+
source_path: string;
|
|
23
|
+
/** Parsed name field from frontmatter */
|
|
24
|
+
name: string;
|
|
25
|
+
/** Parsed description field from frontmatter */
|
|
26
|
+
description: string;
|
|
27
|
+
/** Parsed metadata.type field (e.g. "feedback", "project") */
|
|
28
|
+
metadata_type: string | null;
|
|
29
|
+
/** "keep" → will be migrated; "drop" → candidate for deletion */
|
|
30
|
+
suggested_action: "keep" | "drop";
|
|
31
|
+
/** Present when suggested_action === "drop" — human-readable reason */
|
|
32
|
+
drop_reason?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Target path for "keep" entries: "nested:<relpath>" means
|
|
35
|
+
* create/append to <projectDir>/<relpath>/CLAUDE.md.
|
|
36
|
+
* Absent when suggested_action === "drop".
|
|
37
|
+
*/
|
|
38
|
+
suggested_target?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Present when the frontmatter could not be parsed (malformed fences / key
|
|
41
|
+
* lines). The entry is still included in the plan so the user sees it.
|
|
42
|
+
*/
|
|
43
|
+
parse_error?: string;
|
|
44
|
+
}
|
|
45
|
+
export interface MigrateMemoryPlan {
|
|
46
|
+
/** ISO-8601 timestamp (undefined when clock is suppressed for deterministic tests) */
|
|
47
|
+
generated_at?: string;
|
|
48
|
+
/** Absolute path to the auto-memory directory that was inventoried */
|
|
49
|
+
auto_memory_dir: string;
|
|
50
|
+
/** Ordered list of entries (sorted by filename) */
|
|
51
|
+
entries: MemoryEntryPlan[];
|
|
52
|
+
/**
|
|
53
|
+
* Informational: if "keep" entries with suggested_target exist, this
|
|
54
|
+
* describes the manual step the user should take after --apply.
|
|
55
|
+
*/
|
|
56
|
+
generate_step: string;
|
|
57
|
+
}
|
|
58
|
+
export interface MigrateMemoryOpts {
|
|
59
|
+
/** Raw process.argv.slice(3) — parsed for --json / --dry-run / --apply <file> */
|
|
60
|
+
rest?: string[];
|
|
61
|
+
/** Override the project root (default: cwd). Passed via index.ts. */
|
|
62
|
+
projectDir?: string;
|
|
63
|
+
/**
|
|
64
|
+
* Override the auto-memory directory (used by unit tests so they never
|
|
65
|
+
* touch the real ~/.claude).
|
|
66
|
+
*/
|
|
67
|
+
autoMemoryDir?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Suppress the generated_at timestamp for deterministic test output.
|
|
70
|
+
* When true, generated_at is omitted from the returned plan.
|
|
71
|
+
*/
|
|
72
|
+
omitTimestamp?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Injected clock — if provided, used instead of new Date().toISOString()
|
|
75
|
+
* for generated_at. Ignored when omitTimestamp is true.
|
|
76
|
+
*/
|
|
77
|
+
now?: () => string;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Encode an absolute path to the filesystem-safe form Claude uses for project
|
|
81
|
+
* identifiers: leading `/` becomes leading `-`, remaining `/` become `-`.
|
|
82
|
+
*
|
|
83
|
+
* Example: "/Users/foo/bar" → "-Users-foo-bar"
|
|
84
|
+
* Verified against the live dir:
|
|
85
|
+
* ~/.claude/projects/-Users-merilyviks-codebyplan/memory
|
|
86
|
+
*/
|
|
87
|
+
export declare function encodeProjectPath(absPath: string): string;
|
|
88
|
+
/**
|
|
89
|
+
* Derive the auto-memory directory for a project.
|
|
90
|
+
*
|
|
91
|
+
* Priority:
|
|
92
|
+
* 1. opts.autoMemoryDir (explicit override — unit tests always pass this)
|
|
93
|
+
* 2. homedir-derivation from opts.projectDir ?? process.cwd()
|
|
94
|
+
*/
|
|
95
|
+
export declare function resolveAutoMemoryDir(opts: MigrateMemoryOpts): string;
|
|
96
|
+
/**
|
|
97
|
+
* Read all *.md files (except MEMORY.md) from `dir`, parse frontmatter, and
|
|
98
|
+
* return entries sorted deterministically by filename.
|
|
99
|
+
*/
|
|
100
|
+
export declare function inventoryFiles(dir: string): Promise<MemoryEntryPlan[]>;
|
|
101
|
+
/**
|
|
102
|
+
* Post-process entries: ensure all drop candidates have drop_reason set.
|
|
103
|
+
* (Exported separately so tests can call it independently.)
|
|
104
|
+
*/
|
|
105
|
+
export declare function flagDropCandidates(entries: MemoryEntryPlan[]): MemoryEntryPlan[];
|
|
106
|
+
export declare function buildPlan(entries: MemoryEntryPlan[], opts: {
|
|
107
|
+
autoMemoryDir: string;
|
|
108
|
+
omitTimestamp?: boolean;
|
|
109
|
+
now?: () => string;
|
|
110
|
+
}): MigrateMemoryPlan;
|
|
111
|
+
export interface ApplyOpts {
|
|
112
|
+
projectDir: string;
|
|
113
|
+
dryRun?: boolean;
|
|
114
|
+
}
|
|
115
|
+
export declare function applyPlan(plan: MigrateMemoryPlan, opts: ApplyOpts): Promise<void>;
|
|
116
|
+
export declare function runMigrateMemory(opts: MigrateMemoryOpts): Promise<void>;
|
|
117
|
+
//# sourceMappingURL=migrate-memory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate-memory.d.ts","sourceRoot":"","sources":["../../../src/cli/claude/migrate-memory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAgBH,MAAM,WAAW,eAAe;IAC9B,iDAAiD;IACjD,QAAQ,EAAE,MAAM,CAAC;IACjB,uCAAuC;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,gDAAgD;IAChD,WAAW,EAAE,MAAM,CAAC;IACpB,8DAA8D;IAC9D,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,iEAAiE;IACjE,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAAC;IAClC,uEAAuE;IACvE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC,sFAAsF;IACtF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,sEAAsE;IACtE,eAAe,EAAE,MAAM,CAAC;IACxB,mDAAmD;IACnD,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B;;;OAGG;IACH,aAAa,EAAE,MAAM,CAAC;CACvB;AAID,MAAM,WAAW,iBAAiB;IAChC,iFAAiF;IACjF,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,qEAAqE;IACrE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACpB;AAID;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,CAOpE;AAoGD;;;GAGG;AACH,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,CA6E5E;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,eAAe,EAAE,GACzB,eAAe,EAAE,CAiBnB;AAID,wBAAgB,SAAS,CACvB,OAAO,EAAE,eAAe,EAAE,EAC1B,IAAI,EAAE;IAAE,aAAa,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAA;CAAE,GAC3E,iBAAiB,CAanB;AAMD,MAAM,WAAW,SAAS;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,wBAAsB,SAAS,CAC7B,IAAI,EAAE,iBAAiB,EACvB,IAAI,EAAE,SAAS,GACd,OAAO,CAAC,IAAI,CAAC,CA2Kf;AAID,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CA8F7E"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* I/O orchestrator for `codebyplan claude readme`.
|
|
3
|
+
*
|
|
4
|
+
* Discovers outward-facing units (repo root + apps/* + non-private packages/*),
|
|
5
|
+
* then for each:
|
|
6
|
+
* - Missing README → scaffold a new one
|
|
7
|
+
* - Existing README with managed markers → refresh managed sections only
|
|
8
|
+
* - Existing README without markers → leave untouched (unless --init, which
|
|
9
|
+
* appends a managed block at the end)
|
|
10
|
+
*
|
|
11
|
+
* Flags:
|
|
12
|
+
* --dry-run Print what would be written; write nothing
|
|
13
|
+
* --check Exit with code 1 on drift or missing READMEs; print summary
|
|
14
|
+
* --init Append a managed block to marker-less existing READMEs
|
|
15
|
+
* --project-dir Override the project root (default: cwd)
|
|
16
|
+
*
|
|
17
|
+
* Idempotent: hash comparison skips write when content is unchanged.
|
|
18
|
+
* All flags are parsed locally from process.argv — NOT added to parseClaudeFlags.
|
|
19
|
+
*/
|
|
20
|
+
export interface ReadmeOpts {
|
|
21
|
+
projectDir?: string;
|
|
22
|
+
dryRun?: boolean;
|
|
23
|
+
check?: boolean;
|
|
24
|
+
init?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export declare function runReadme(opts: ReadmeOpts | Record<string, unknown>): Promise<void>;
|
|
27
|
+
export declare function runReadmeCommand(args: string[]): Promise<void>;
|
|
28
|
+
//# sourceMappingURL=readme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"readme.d.ts","sourceRoot":"","sources":["../../../src/cli/claude/readme.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AA4BH,MAAM,WAAW,UAAU;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AA4KD,wBAAsB,SAAS,CAC7B,IAAI,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACzC,OAAO,CAAC,IAAI,CAAC,CAkLf;AAmCD,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAoBpE"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export interface ClaudeStatusResult {
|
|
2
|
+
installed: string;
|
|
3
|
+
manifest_version: string | null;
|
|
4
|
+
latest: string | null;
|
|
5
|
+
newer: boolean;
|
|
6
|
+
version_skip: boolean;
|
|
7
|
+
drifted_files: string[];
|
|
8
|
+
new_in_package: string[];
|
|
9
|
+
removed_from_package: string[];
|
|
10
|
+
settings_drift: boolean;
|
|
11
|
+
/** True when manifest is present but .claude/settings.json does not exist on disk. */
|
|
12
|
+
settings_missing: boolean;
|
|
13
|
+
/** True when .claude/settings.json is matched by a gitignore rule. */
|
|
14
|
+
settings_ignored: boolean;
|
|
15
|
+
guarded: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Why the doctor is (or is not) guarded. Cross-task contract consumed by the
|
|
18
|
+
* TASK-3 statusline renderer:
|
|
19
|
+
* - "canonical_source" → the codebyplan package's own source monorepo
|
|
20
|
+
* (guarded:true; segment hidden — nothing to sync).
|
|
21
|
+
* - "protected_branch" → a consumer on a protected branch (e.g. main).
|
|
22
|
+
* guarded:false (segment visible) — drift is still
|
|
23
|
+
* reported but `action` is suppressed (no nag).
|
|
24
|
+
* - "no_manifest" → no .cbp manifest present: codebyplan claude was
|
|
25
|
+
* never installed here (guarded:true; treat as
|
|
26
|
+
* "not installed").
|
|
27
|
+
* - "unknown" → fail-safe sentinel emitted by makeFailSafe on a
|
|
28
|
+
* catastrophic error (guarded:true; also treat as
|
|
29
|
+
* "not installed").
|
|
30
|
+
* - null → a normal installed consumer on a feature branch
|
|
31
|
+
* (guarded:false; full detection ran).
|
|
32
|
+
* NOTE for TASK-3: treat BOTH "no_manifest" and "unknown" as
|
|
33
|
+
* "not a managed/installed consumer" → hide the freshness segment.
|
|
34
|
+
*/
|
|
35
|
+
guard_reason: string | null;
|
|
36
|
+
in_sync: boolean;
|
|
37
|
+
action: string | null;
|
|
38
|
+
checked_at: string;
|
|
39
|
+
}
|
|
40
|
+
export declare function runStatus(argv: string[]): Promise<void>;
|
|
41
|
+
//# sourceMappingURL=status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/cli/claude/status.ts"],"names":[],"mappings":"AAuBA,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,KAAK,EAAE,OAAO,CAAC;IACf,YAAY,EAAE,OAAO,CAAC;IACtB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,oBAAoB,EAAE,MAAM,EAAE,CAAC;IAC/B,cAAc,EAAE,OAAO,CAAC;IACxB,sFAAsF;IACtF,gBAAgB,EAAE,OAAO,CAAC;IAC1B,sEAAsE;IACtE,gBAAgB,EAAE,OAAO,CAAC;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB;;;;;;;;;;;;;;;;;;OAkBG;IACH,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;CACpB;AAgDD,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA2N7D"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type CliOpts, type InstallDeps } from "./install.js";
|
|
2
|
+
/**
|
|
3
|
+
* Uninstall: remove every file tracked by the manifest, strip owned hook
|
|
4
|
+
* entries from `settings.json`, and delete the manifest.
|
|
5
|
+
*
|
|
6
|
+
* Per-file removal logic:
|
|
7
|
+
* - File absent on disk → warn + skip (already gone, nothing to remove)
|
|
8
|
+
* - File hash differs from manifest → warn (user has modified it locally)
|
|
9
|
+
* but remove anyway — uninstall MUST be definitive; leaving stragglers
|
|
10
|
+
* defeats the purpose. The warning gives the user a chance to abort the
|
|
11
|
+
* whole uninstall via Ctrl-C before the next file is touched in
|
|
12
|
+
* interactive mode; under --yes the removal proceeds.
|
|
13
|
+
* - File matches manifest → remove silently
|
|
14
|
+
*
|
|
15
|
+
* Empty `.claude/skills/`, `.claude/agents/`, `.claude/hooks/`, and
|
|
16
|
+
* `.claude/rules/` directories are pruned leaf-first. `.claude/` itself is
|
|
17
|
+
* NOT removed — user may have their own files there (settings.json with
|
|
18
|
+
* user-owned hooks, custom rules, etc.).
|
|
19
|
+
*/
|
|
20
|
+
export declare function runUninstall(opts: CliOpts, deps?: InstallDeps): Promise<void>;
|
|
21
|
+
//# sourceMappingURL=uninstall.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uninstall.d.ts","sourceRoot":"","sources":["../../../src/cli/claude/uninstall.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAE9D;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,OAAO,EACb,IAAI,GAAE,WAAgB,GACrB,OAAO,CAAC,IAAI,CAAC,CA6If"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type CliOpts, type InstallDeps } from "./install.js";
|
|
2
|
+
/**
|
|
3
|
+
* Update the locally-installed codebyplan claude assets to match the
|
|
4
|
+
* current package state.
|
|
5
|
+
*
|
|
6
|
+
* Classification (per file):
|
|
7
|
+
* - IN manifest, on-disk hash matches manifest, templates hash matches manifest
|
|
8
|
+
* → up-to-date, skip (no write)
|
|
9
|
+
* - IN manifest, on-disk matches manifest, templates DIFFERS
|
|
10
|
+
* → safe overwrite (no user content lost)
|
|
11
|
+
* - IN manifest, on-disk DIFFERS from manifest
|
|
12
|
+
* → hand-edited, prompt overwrite/skip/diff
|
|
13
|
+
* - NOT in manifest, in templates
|
|
14
|
+
* → new file shipped by package, prompt opt-in/skip
|
|
15
|
+
* - IN manifest, NOT in templates
|
|
16
|
+
* → removed-from-package, prompt remove/keep
|
|
17
|
+
*
|
|
18
|
+
* After file moves: re-merge `hooks.json` into `settings.json` (same merger
|
|
19
|
+
* the install path uses; idempotent for unchanged entries, upsert for
|
|
20
|
+
* changed commands).
|
|
21
|
+
*
|
|
22
|
+
* The manifest is rewritten with the final on-disk state.
|
|
23
|
+
*/
|
|
24
|
+
export declare function runUpdate(opts: CliOpts, deps?: InstallDeps): Promise<void>;
|
|
25
|
+
//# sourceMappingURL=update.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/cli/claude/update.ts"],"names":[],"mappings":"AA+BA,OAAO,EAAc,KAAK,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAK1E;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,SAAS,CAC7B,IAAI,EAAE,OAAO,EACb,IAAI,GAAE,WAAgB,GACrB,OAAO,CAAC,IAAI,CAAC,CA8Pf"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI entry point for `codebyplan claude verify-parity`.
|
|
3
|
+
*
|
|
4
|
+
* Exit codes:
|
|
5
|
+
* 0 — clean (or --warn-only with violations)
|
|
6
|
+
* 1 — violations found (without --warn-only)
|
|
7
|
+
* 2 — fatal error (e.g. .claude/ not found)
|
|
8
|
+
*
|
|
9
|
+
* Flags:
|
|
10
|
+
* --json Emit violations as a JSON array to stdout instead of human-readable output
|
|
11
|
+
* --warn-only Print violations but always return exit code 0 (used by SessionStart hook)
|
|
12
|
+
*/
|
|
13
|
+
export interface VerifyParityDeps {
|
|
14
|
+
/** Override the project root (defaults to process.cwd()). */
|
|
15
|
+
cwd?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Override templates-dir resolution:
|
|
18
|
+
* - string → use this path for the sibling-parity check
|
|
19
|
+
* - null → skip sibling parity entirely (scope sweep still runs)
|
|
20
|
+
* - omitted → resolveTemplatesDir() with a graceful try/catch
|
|
21
|
+
*/
|
|
22
|
+
templatesDir?: string | null;
|
|
23
|
+
}
|
|
24
|
+
export declare function verifyParity(args: string[], deps?: VerifyParityDeps): number;
|
|
25
|
+
//# sourceMappingURL=verify-parity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify-parity.d.ts","sourceRoot":"","sources":["../../../src/cli/claude/verify-parity.ts"],"names":[],"mappings":"AAUA;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,gBAAgB;IAC/B,6DAA6D;IAC7D,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EAAE,EACd,IAAI,GAAE,gBAAqB,GAC1B,MAAM,CAuGR"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI handler for `codebyplan cleanup-plan-folders`.
|
|
3
|
+
*
|
|
4
|
+
* Removes the generated `.codebyplan/checkpoint` and `.codebyplan/standalone`
|
|
5
|
+
* plan-folder trees from the git index via `git rm -r --ignore-unmatch`.
|
|
6
|
+
*
|
|
7
|
+
* Safety guarantees:
|
|
8
|
+
* - NEVER removes `.codebyplan/exports/` — export artifacts are preserved.
|
|
9
|
+
* - NEVER removes config files (repo.json, git.json, server.json, etc.).
|
|
10
|
+
* - --ignore-unmatch makes the command idempotent: if neither folder exists
|
|
11
|
+
* the command exits 0 with empty removed[].
|
|
12
|
+
*
|
|
13
|
+
* Output (JSON on stdout):
|
|
14
|
+
* { removed: string[], skipped: string[] }
|
|
15
|
+
*
|
|
16
|
+
* Exit codes:
|
|
17
|
+
* 0 — success (even when nothing was matched)
|
|
18
|
+
* 1 — git command failed (stderr written; likely not a git repo)
|
|
19
|
+
*/
|
|
20
|
+
export declare function runCleanupPlanFolders(args: string[]): Promise<void>;
|
|
21
|
+
//# sourceMappingURL=cleanup-plan-folders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cleanup-plan-folders.d.ts","sourceRoot":"","sources":["../../src/cli/cleanup-plan-folders.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AASH,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA+CzE"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI entry point for `codebyplan commit`.
|
|
3
|
+
*
|
|
4
|
+
* Usage: codebyplan commit --scope-task [--task-files <csv>]
|
|
5
|
+
*
|
|
6
|
+
* --scope-task mode:
|
|
7
|
+
* Computes the intersection of staged paths and the active task's files.
|
|
8
|
+
* Emits { files: string[], count: number } JSON to stdout. Exit 0.
|
|
9
|
+
* Does NOT run git commit.
|
|
10
|
+
*
|
|
11
|
+
* --task-files <csv>:
|
|
12
|
+
* Comma-separated list of the task's known file paths.
|
|
13
|
+
* The skill resolves these via MCP and passes them here — same convention
|
|
14
|
+
* as session infra-files (--task-files).
|
|
15
|
+
*
|
|
16
|
+
* Exit codes:
|
|
17
|
+
* 0 success (including empty intersection)
|
|
18
|
+
* 1 usage error (missing --scope-task)
|
|
19
|
+
*/
|
|
20
|
+
import type { RunFn } from "../lib/supabase.js";
|
|
21
|
+
export interface CommitCommandDeps {
|
|
22
|
+
run?: RunFn;
|
|
23
|
+
}
|
|
24
|
+
export declare function runCommitCommand(args: string[], deps?: CommitCommandDeps): number;
|
|
25
|
+
//# sourceMappingURL=commit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commit.d.ts","sourceRoot":"","sources":["../../src/cli/commit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAyBhD,MAAM,WAAW,iBAAiB;IAChC,GAAG,CAAC,EAAE,KAAK,CAAC;CACb;AAMD,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EAAE,EACd,IAAI,GAAE,iBAAsB,GAC3B,MAAM,CA4CR"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `codebyplan config` — sync repo config from DB to .codebyplan/ per-concern files.
|
|
3
|
+
*
|
|
4
|
+
* CHK-120: writes to .codebyplan/{repo,server,git,shipment,vendor}.json
|
|
5
|
+
* instead of the legacy single .codebyplan.json.
|
|
6
|
+
*/
|
|
7
|
+
import type { RepoConfig, ServerConfig, ServerLocalConfig, GitConfig, ShipmentConfig, VendorConfig, E2eConfig } from "../lib/types.js";
|
|
8
|
+
export declare function runConfig(): Promise<void>;
|
|
9
|
+
/**
|
|
10
|
+
* Read `.codebyplan/repo.json`. Returns `null` on ENOENT or parse failure.
|
|
11
|
+
*/
|
|
12
|
+
export declare function readRepoConfig(projectPath: string): Promise<RepoConfig | null>;
|
|
13
|
+
/**
|
|
14
|
+
* Read `.codebyplan/server.json`. Returns `null` on ENOENT or parse failure.
|
|
15
|
+
*/
|
|
16
|
+
export declare function readServerConfig(projectPath: string): Promise<ServerConfig | null>;
|
|
17
|
+
/**
|
|
18
|
+
* Read `.codebyplan/git.json`. Returns `null` on ENOENT or parse failure.
|
|
19
|
+
*/
|
|
20
|
+
export declare function readGitConfig(projectPath: string): Promise<GitConfig | null>;
|
|
21
|
+
/**
|
|
22
|
+
* Read `.codebyplan/shipment.json`. Returns `null` on ENOENT or parse failure.
|
|
23
|
+
*/
|
|
24
|
+
export declare function readShipmentConfig(projectPath: string): Promise<ShipmentConfig | null>;
|
|
25
|
+
/**
|
|
26
|
+
* Read `.codebyplan/vendor.json`. Returns `null` on ENOENT or parse failure.
|
|
27
|
+
*/
|
|
28
|
+
export declare function readVendorConfig(projectPath: string): Promise<VendorConfig | null>;
|
|
29
|
+
/**
|
|
30
|
+
* Read `.codebyplan/e2e.json`. Returns `null` on ENOENT or parse failure.
|
|
31
|
+
*/
|
|
32
|
+
export declare function readE2eConfig(projectPath: string): Promise<E2eConfig | null>;
|
|
33
|
+
/**
|
|
34
|
+
* Read `.codebyplan/server.local.json` — gitignored per-worktree port overlay.
|
|
35
|
+
* Returns `null` on ENOENT or parse failure.
|
|
36
|
+
*/
|
|
37
|
+
export declare function readServerLocalConfig(projectPath: string): Promise<ServerLocalConfig | null>;
|
|
38
|
+
/**
|
|
39
|
+
* CLI handler for `codebyplan config migrate`.
|
|
40
|
+
*
|
|
41
|
+
* Migrates the legacy `.codebyplan.json` + `.codebyplan.local.json` layout
|
|
42
|
+
* to the new `.codebyplan/` directory layout.
|
|
43
|
+
*
|
|
44
|
+
* Flags:
|
|
45
|
+
* --path <dir> Project root (default: cwd)
|
|
46
|
+
* --dry-run Report whether a migration would run; write nothing
|
|
47
|
+
* --json Print result as JSON to stdout
|
|
48
|
+
*/
|
|
49
|
+
export declare function runConfigMigrate(args: string[]): Promise<void>;
|
|
50
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/cli/config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAgBH,OAAO,KAAK,EAGV,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,SAAS,EACT,cAAc,EACd,YAAY,EACZ,SAAS,EACV,MAAM,iBAAiB,CAAC;AAKzB,wBAAsB,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAmC/C;AA8LD;;GAEG;AACH,wBAAsB,cAAc,CAClC,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAU5B;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAU9B;AAED;;GAEG;AACH,wBAAsB,aAAa,CACjC,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAU3B;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAUhC;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAU9B;AAED;;GAEG;AACH,wBAAsB,aAAa,CACjC,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAU3B;AAED;;;GAGG;AACH,wBAAsB,qBAAqB,CACzC,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAUnC;AAMD;;;;;;;;;;GAUG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAmDpE"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare class SyncCancelledError extends Error {
|
|
2
|
+
constructor();
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* Prompt the user for a Y/n confirmation.
|
|
6
|
+
* Re-prompts on invalid input. Default (empty Enter) is Yes.
|
|
7
|
+
*/
|
|
8
|
+
export declare function confirmProceed(message?: string): Promise<boolean>;
|
|
9
|
+
//# sourceMappingURL=confirm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"confirm.d.ts","sourceRoot":"","sources":["../../src/cli/confirm.ts"],"names":[],"mappings":"AAOA,qBAAa,kBAAmB,SAAQ,KAAK;;CAK5C;AAQD;;;GAGG;AACH,wBAAsB,cAAc,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAkBvE"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI handler for `codebyplan create-org`.
|
|
3
|
+
*
|
|
4
|
+
* Prompts for an organization name, derives a slug preview, then POSTs to
|
|
5
|
+
* /api/organizations (backed by the create_organization_with_owner RPC).
|
|
6
|
+
* On success prints the new org's id, name, and slug.
|
|
7
|
+
*/
|
|
8
|
+
export declare function runCreateOrg(): Promise<void>;
|
|
9
|
+
//# sourceMappingURL=create-org.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-org.d.ts","sourceRoot":"","sources":["../../src/cli/create-org.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA0BH,wBAAsB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CA2ClD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI handler for `codebyplan create-project`.
|
|
3
|
+
*
|
|
4
|
+
* Resolves the target organization (--org-id flag, or interactive prompt),
|
|
5
|
+
* prompts for a project name, derives a slug preview, then POSTs to
|
|
6
|
+
* /api/projects (backed by the create_project_with_owner RPC).
|
|
7
|
+
* On success prints the new project's id, name, and slug.
|
|
8
|
+
*/
|
|
9
|
+
export declare function runCreateProject(): Promise<void>;
|
|
10
|
+
//# sourceMappingURL=create-project.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-project.d.ts","sourceRoot":"","sources":["../../src/cli/create-project.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAmCH,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAuGtD"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI handler for `codebyplan create-repo`.
|
|
3
|
+
*
|
|
4
|
+
* Resolves the target project (--project-id flag, or interactive prompt/select
|
|
5
|
+
* against GET /api/projects with manual-UUID fallback), prompts for a repo name
|
|
6
|
+
* and optional path + git_branch, then POSTs to /api/repos.
|
|
7
|
+
* On success prints the new repo's id and name. Optionally hints to run
|
|
8
|
+
* `codebyplan setup` to wire the local directory.
|
|
9
|
+
*
|
|
10
|
+
* Mirrors packages/codebyplan-package/src/cli/create-project.ts exactly,
|
|
11
|
+
* substituting the organization ↔ project and project ↔ repo relationships.
|
|
12
|
+
*/
|
|
13
|
+
export declare function runCreateRepo(): Promise<void>;
|
|
14
|
+
//# sourceMappingURL=create-repo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-repo.d.ts","sourceRoot":"","sources":["../../src/cli/create-repo.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AA2BH,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAyInD"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `codebyplan docs` — local dependency docs mirror.
|
|
3
|
+
*
|
|
4
|
+
* Subcommands:
|
|
5
|
+
* sync — fetch covered library docs from the export API into the local
|
|
6
|
+
* mirror (<dir>/<lib>/<version>/<path>.md) guided by docs.lock.json
|
|
7
|
+
* status — offline report of lock vs on-disk mirror state (no network)
|
|
8
|
+
*
|
|
9
|
+
* Dev dependencies are included by default — Claude reads dev-tool docs too.
|
|
10
|
+
* `--include-dev` is accepted as an explicit confirmation of that default.
|
|
11
|
+
*/
|
|
12
|
+
import type { TechStackSyncPayload } from "../lib/types.js";
|
|
13
|
+
/** One dependency selected for sync after skip rules + name dedup. */
|
|
14
|
+
export interface SelectedDependency {
|
|
15
|
+
name: string;
|
|
16
|
+
/** Declared range from package.json (e.g. `^19.0.0`). */
|
|
17
|
+
declared: string;
|
|
18
|
+
isDev: boolean;
|
|
19
|
+
/** Repo-relative path of the package.json that declared it. */
|
|
20
|
+
sourcePath: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Apply the skip rules and dedup the scanned dependency list by name.
|
|
24
|
+
*
|
|
25
|
+
* Skips: empty names, `@types/*` shims, and declared versions that can never
|
|
26
|
+
* resolve to a published doc set (workspace:/file:/link:/git+/http(s)).
|
|
27
|
+
* On a name collision the production entry wins over the dev one.
|
|
28
|
+
*/
|
|
29
|
+
export declare function selectDependencies(deps: TechStackSyncPayload["dependencies"]): SelectedDependency[];
|
|
30
|
+
/** Strip leading `^`, `~`, or `>=` from a declared range (fallback exact). */
|
|
31
|
+
export declare function stripRangePrefix(range: string): string;
|
|
32
|
+
/**
|
|
33
|
+
* Validate a manifest doc path and map it to the local mirror filename.
|
|
34
|
+
* Returns null for unsafe paths — any path containing `..`, starting with
|
|
35
|
+
* `/`, or containing a NUL byte is rejected (never written to disk).
|
|
36
|
+
*/
|
|
37
|
+
export declare function sanitizeDocPath(docPath: string): string | null;
|
|
38
|
+
/** Local directory name for a library: `/` → `__` (scoped-name safe). */
|
|
39
|
+
export declare function libDirName(name: string): string;
|
|
40
|
+
export declare function runDocs(): Promise<void>;
|
|
41
|
+
//# sourceMappingURL=docs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../src/cli/docs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAQH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAc5D,sEAAsE;AACtE,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,yDAAyD;IACzD,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,+DAA+D;IAC/D,UAAU,EAAE,MAAM,CAAC;CACpB;AAmED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,oBAAoB,CAAC,cAAc,CAAC,GACzC,kBAAkB,EAAE,CAqBtB;AAED,8EAA8E;AAC9E,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAO9D;AAED,yEAAyE;AACzE,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/C;AAwsBD,wBAAsB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAyB7C"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI handler for `codebyplan doctor`.
|
|
3
|
+
*
|
|
4
|
+
* Diagnostic command: runs sub-checks and reports health status.
|
|
5
|
+
* ALWAYS exits 0 — script-safe by design. Each sub-check's failure is
|
|
6
|
+
* reported as a status row rather than propagated as an unhandled error.
|
|
7
|
+
*
|
|
8
|
+
* Sub-checks:
|
|
9
|
+
* auth — validates authentication (OAuth bearer or legacy API key)
|
|
10
|
+
* version — compares installed vs latest npm version
|
|
11
|
+
* worktree — resolves active worktree UUID from device+path+branch tuple
|
|
12
|
+
*
|
|
13
|
+
* Flags:
|
|
14
|
+
* --json Emit structured JSON output to stdout
|
|
15
|
+
*/
|
|
16
|
+
export declare function runDoctor(args: string[]): Promise<void>;
|
|
17
|
+
//# sourceMappingURL=doctor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/cli/doctor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAsPH,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA8B7D"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI handler for `codebyplan e2e verify-round`.
|
|
3
|
+
*
|
|
4
|
+
* Usage:
|
|
5
|
+
* codebyplan e2e verify-round --round-id <uuid> --task-id <uuid> [--json]
|
|
6
|
+
*
|
|
7
|
+
* Fetches the round's context from the MCP `get_rounds` call, reads
|
|
8
|
+
* .codebyplan/e2e.json (absent → null), and runs the verifyRound lib.
|
|
9
|
+
*
|
|
10
|
+
* Output: JSON verdict on stdout.
|
|
11
|
+
* Exit 0 on pass, exit 1 on any failed check or usage/not-found error.
|
|
12
|
+
*
|
|
13
|
+
* Deps are injectable for testing — default deps hit the real MCP + filesystem.
|
|
14
|
+
*/
|
|
15
|
+
import { type E2eConfig } from "../../lib/e2e.js";
|
|
16
|
+
import type { VerifyRoundResult } from "../../lib/e2e.js";
|
|
17
|
+
interface RoundContext {
|
|
18
|
+
e2e_eligible?: string[];
|
|
19
|
+
e2e_outputs?: Record<string, unknown>;
|
|
20
|
+
round_type?: string;
|
|
21
|
+
}
|
|
22
|
+
interface McpRound {
|
|
23
|
+
id: string;
|
|
24
|
+
number?: number;
|
|
25
|
+
files_changed?: Array<{
|
|
26
|
+
path: string;
|
|
27
|
+
action: string;
|
|
28
|
+
}>;
|
|
29
|
+
context?: RoundContext;
|
|
30
|
+
}
|
|
31
|
+
export interface VerifyRoundDeps {
|
|
32
|
+
/** Fetch all rounds for a task. Signature mirrors fetchRoundsWithRetry from cli/round.ts. */
|
|
33
|
+
fetchRounds: (taskId: string) => Promise<McpRound[]>;
|
|
34
|
+
/** Read and parse .codebyplan/e2e.json. Returns null when file is absent. */
|
|
35
|
+
readE2eConfig: (cwd: string) => Promise<E2eConfig | null>;
|
|
36
|
+
/** Current working directory (override for tests). */
|
|
37
|
+
cwd?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface VerifyRoundVerdict {
|
|
40
|
+
round_id: string;
|
|
41
|
+
task_id: string;
|
|
42
|
+
result: VerifyRoundResult;
|
|
43
|
+
}
|
|
44
|
+
export declare function handler(args: string[], deps?: Partial<VerifyRoundDeps>): Promise<void>;
|
|
45
|
+
export {};
|
|
46
|
+
//# sourceMappingURL=verify-round.d.ts.map
|