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,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ESLint config generator.
|
|
3
|
+
*
|
|
4
|
+
* Takes ordered presets + user overrides and produces a standalone
|
|
5
|
+
* eslint.config.mjs file. Parses config_fragment TEXT fields from
|
|
6
|
+
* DB presets, deduplicates imports, and composes the final config.
|
|
7
|
+
*/
|
|
8
|
+
import type { EslintPreset } from "./types.js";
|
|
9
|
+
/**
|
|
10
|
+
* Test-only hook to clear the module-level warning dedup set between
|
|
11
|
+
* describe blocks. Tests must call this in `beforeEach` of any block that
|
|
12
|
+
* relies on warnSpy call counts (Finding #5).
|
|
13
|
+
*/
|
|
14
|
+
export declare function __resetWarnedPresetNamesForTest(): void;
|
|
15
|
+
/**
|
|
16
|
+
* Return the set of JS identifiers bound by the given import/setup lines.
|
|
17
|
+
* Used as a pre-emit guard: if the generator is about to emit a config
|
|
18
|
+
* object that references a binding (e.g., `jsxA11y`, `react`), it must
|
|
19
|
+
* confirm that binding was actually introduced by some preset's
|
|
20
|
+
* `config_fragment`. If the DB fragment is edited to drop the binding, the
|
|
21
|
+
* generator would otherwise emit a reference to an undefined variable and
|
|
22
|
+
* the generated eslint.config.mjs would throw at load time (Finding #3).
|
|
23
|
+
*
|
|
24
|
+
* Recognised forms:
|
|
25
|
+
* import X from "..."
|
|
26
|
+
* import { X, Y as Z } from "..."
|
|
27
|
+
* const X = require("...")
|
|
28
|
+
*/
|
|
29
|
+
export declare function importedIdentifiers(importLines: string[]): Set<string>;
|
|
30
|
+
export interface GeneratorInput {
|
|
31
|
+
/** Ordered list of resolved presets (display_order ascending). */
|
|
32
|
+
presets: EslintPreset[];
|
|
33
|
+
/** User-defined rule overrides to merge on top. */
|
|
34
|
+
ruleOverrides?: Record<string, unknown>;
|
|
35
|
+
/** Absolute or relative tsconfigRootDir for parser options. */
|
|
36
|
+
tsconfigRootDir?: string;
|
|
37
|
+
/** Files/patterns to ignore (self-ignore + user additions). */
|
|
38
|
+
ignorePatterns?: string[];
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Collect all npm dependencies required by the given presets.
|
|
42
|
+
* Returns a Map of packageName -> version constraint.
|
|
43
|
+
*/
|
|
44
|
+
export declare function collectDependencies(presets: EslintPreset[]): Map<string, string>;
|
|
45
|
+
/**
|
|
46
|
+
* Compute SHA256 hash of config content for drift detection.
|
|
47
|
+
*/
|
|
48
|
+
export declare function hashConfig(content: string): string;
|
|
49
|
+
/**
|
|
50
|
+
* Classify merged preset rules by key prefix into plugin-scoped buckets so we
|
|
51
|
+
* can co-locate plugin-scoped rules with the block that registers their
|
|
52
|
+
* plugin.
|
|
53
|
+
*
|
|
54
|
+
* - `reactHooks`: react-hooks/, react-compiler/ — safe to emit in both the
|
|
55
|
+
* React block AND the Next.js block (react-compiler is explicitly
|
|
56
|
+
* registered in both; react-hooks is registered by the React preset block
|
|
57
|
+
* or by eslint-config-next).
|
|
58
|
+
* - `reactOrA11y`: react/, jsx-a11y/ — registered by the React preset block
|
|
59
|
+
* OR by eslint-config-next (undocumented). In the Next.js branch we emit
|
|
60
|
+
* these in a SEPARATE trailing object that explicitly registers `jsxA11y`
|
|
61
|
+
* and `react` as a defensive measure.
|
|
62
|
+
* - `importPlugin`: import/ — safe to co-locate inside the Next.js branch,
|
|
63
|
+
* since eslint-config-next bundles eslint-plugin-import. When `hasNextJs`
|
|
64
|
+
* is false, these keys are routed directly into `generic` at
|
|
65
|
+
* classification time so they still land in the standalone overrides
|
|
66
|
+
* block (Finding #2). The `hasNextJs` argument is a dependency of the
|
|
67
|
+
* classification: import/ routing changes with it.
|
|
68
|
+
* - `generic`: everything else — emitted in the standalone `// Rule
|
|
69
|
+
* overrides` block.
|
|
70
|
+
*
|
|
71
|
+
* @param rules - merged preset rules (user overrides already subtracted)
|
|
72
|
+
* @param hasNextJs - when false, import/* keys route to `generic` bucket instead of `importPlugin`
|
|
73
|
+
* @returns { reactHooks, reactOrA11y, importPlugin, generic } buckets
|
|
74
|
+
*/
|
|
75
|
+
export interface SplitRules {
|
|
76
|
+
reactHooks: Record<string, unknown>;
|
|
77
|
+
reactOrA11y: Record<string, unknown>;
|
|
78
|
+
importPlugin: Record<string, unknown>;
|
|
79
|
+
generic: Record<string, unknown>;
|
|
80
|
+
}
|
|
81
|
+
export declare function splitRulesByPlugin(rules: Record<string, unknown>, hasNextJs: boolean): SplitRules;
|
|
82
|
+
/**
|
|
83
|
+
* Generate a complete eslint.config.mjs file from presets and options.
|
|
84
|
+
*/
|
|
85
|
+
export declare function generateEslintConfig(input: GeneratorInput): string;
|
|
86
|
+
//# sourceMappingURL=eslint-generator.d.ts.map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OAAO,GACjB,UAAU,CAuBZ;AAiBD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,CAwWlE"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Best-effort cross-process advisory file lock.
|
|
3
|
+
*
|
|
4
|
+
* `withFileLock` runs a callback while holding an exclusive on-disk lock.
|
|
5
|
+
* Acquisition uses `O_EXCL` (the `"wx"` open flag): exactly one process can
|
|
6
|
+
* create the lock file, so concurrent CLI invocations / hook subprocesses
|
|
7
|
+
* serialize through it. The original use case is OAuth token refresh — a
|
|
8
|
+
* rotating refresh token must not be spent by two processes at once.
|
|
9
|
+
*
|
|
10
|
+
* Liveness over strictness: a lock whose mtime is older than `staleMs` (the
|
|
11
|
+
* holder crashed without cleanup) is stolen, and a lock still held at
|
|
12
|
+
* `timeoutMs` is stolen as a last resort so a wedged lock never deadlocks the
|
|
13
|
+
* CLI. To keep a steal from corrupting the new holder, release is
|
|
14
|
+
* OWNERSHIP-CHECKED: each acquire writes a unique holder id into the lock file
|
|
15
|
+
* and only deletes the lock on release if it still holds that id — so a holder
|
|
16
|
+
* whose lock was stolen will NOT delete the thief's lock (which would otherwise
|
|
17
|
+
* let a third waiter run concurrently with the new holder). The lock is always
|
|
18
|
+
* released in a `finally`, including when the callback throws (the original
|
|
19
|
+
* error propagates).
|
|
20
|
+
*/
|
|
21
|
+
export interface FileLockOptions {
|
|
22
|
+
/**
|
|
23
|
+
* Max time to spend waiting for a live lock before stealing it (ms).
|
|
24
|
+
* Default 15000.
|
|
25
|
+
*/
|
|
26
|
+
timeoutMs?: number;
|
|
27
|
+
/**
|
|
28
|
+
* A lock whose mtime is older than this is treated as abandoned (holder
|
|
29
|
+
* crashed) and stolen immediately. Default 30000.
|
|
30
|
+
*/
|
|
31
|
+
staleMs?: number;
|
|
32
|
+
/** Poll interval between acquisition attempts (ms). Default 100. */
|
|
33
|
+
retryMs?: number;
|
|
34
|
+
/** Injected sleep — tests pass a no-op / fake-timer variant. */
|
|
35
|
+
sleep?: (ms: number) => Promise<void>;
|
|
36
|
+
/** Injected clock — tests pass a controllable monotonic source. */
|
|
37
|
+
now?: () => number;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Run `fn` while holding an exclusive lock at `lockPath`. Returns whatever `fn`
|
|
41
|
+
* returns. Never deadlocks: stale and wedged locks are stolen.
|
|
42
|
+
*/
|
|
43
|
+
export declare function withFileLock<T>(lockPath: string, fn: () => Promise<T>, opts?: FileLockOptions): Promise<T>;
|
|
44
|
+
//# sourceMappingURL=file-lock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-lock.d.ts","sourceRoot":"","sources":["../../src/lib/file-lock.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAOH,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oEAAoE;IACpE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gEAAgE;IAChE,KAAK,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,mEAAmE;IACnE,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACpB;AAKD;;;GAGG;AACH,wBAAsB,YAAY,CAAC,CAAC,EAClC,QAAQ,EAAE,MAAM,EAChB,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACpB,IAAI,GAAE,eAAoB,GACzB,OAAO,CAAC,CAAC,CAAC,CAgEZ"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
export interface CliConfig {
|
|
2
|
+
repoId: string;
|
|
3
|
+
worktreeId?: string;
|
|
4
|
+
projectPath: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Walk up from `startDir` looking for the `.codebyplan/repo.json` sentinel
|
|
8
|
+
* (new layout), falling back to the legacy `.codebyplan.json` for ONE
|
|
9
|
+
* release window.
|
|
10
|
+
*
|
|
11
|
+
* Returns `{ path, contents }` on first hit where `path` is the discovered
|
|
12
|
+
* file path and `contents` is the parsed JSON (sentinel JSON for new layout,
|
|
13
|
+
* full JSON for legacy). Returns `null` if the walk exhausts without a match.
|
|
14
|
+
*
|
|
15
|
+
* Probe-style: ENOENT (or any read failure) at each level is treated as
|
|
16
|
+
* "not here, keep walking". The filesystem-root guard (`parent === cursor`)
|
|
17
|
+
* stops the walk when `..` stops changing.
|
|
18
|
+
*
|
|
19
|
+
* CHK-120: sentinel changed from `.codebyplan.json` to `.codebyplan/repo.json`.
|
|
20
|
+
* Legacy `.codebyplan.json` fallback is present for ONE release window only —
|
|
21
|
+
* all writers now use the new `.codebyplan/` directory layout.
|
|
22
|
+
*/
|
|
23
|
+
export declare function findCodebyplanConfig(startDir: string, maxDepth?: number): Promise<{
|
|
24
|
+
path: string;
|
|
25
|
+
contents: {
|
|
26
|
+
repo_id?: string;
|
|
27
|
+
worktree_id?: string;
|
|
28
|
+
};
|
|
29
|
+
} | null>;
|
|
30
|
+
/**
|
|
31
|
+
* Parse CLI flags from process.argv (starting at startIndex).
|
|
32
|
+
*/
|
|
33
|
+
export declare function parseFlags(startIndex: number): Record<string, string>;
|
|
34
|
+
/**
|
|
35
|
+
* Parse CLI flags from an explicit args array (e.g. process.argv.slice(N)).
|
|
36
|
+
* Supports both value flags (`--key value`) and boolean flags (`--flag`).
|
|
37
|
+
* Value flags consume the next element when it does not start with `--`.
|
|
38
|
+
* Boolean flags are collected in a separate Set.
|
|
39
|
+
*/
|
|
40
|
+
export declare function parseFlagsFromArgs(args: string[]): {
|
|
41
|
+
flags: Record<string, string>;
|
|
42
|
+
booleans: Set<string>;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Check if a boolean flag is present.
|
|
46
|
+
*/
|
|
47
|
+
export declare function hasFlag(name: string, startIndex: number): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Derive the repo root directory from a `.codebyplan` config file path.
|
|
50
|
+
*
|
|
51
|
+
* Strips the config-file suffix to recover the directory that contains
|
|
52
|
+
* `.codebyplan/` (new multi-file layout) or `.codebyplan.json` (legacy flat
|
|
53
|
+
* layout). Also handles the bare-directory forms that can appear in edge cases
|
|
54
|
+
* (e.g. a path ending in `/.codebyplan` or `/.codebyplan/`).
|
|
55
|
+
*
|
|
56
|
+
* Supported forms:
|
|
57
|
+
* /some/path/.codebyplan/repo.json → /some/path (new layout)
|
|
58
|
+
* /some/path/.codebyplan.json → /some/path (legacy flat)
|
|
59
|
+
* /some/path/.codebyplan/ → /some/path (dir form, trailing slash)
|
|
60
|
+
* /some/path/.codebyplan → /some/path (dir form, no slash)
|
|
61
|
+
*
|
|
62
|
+
* @param configPath The path returned by `findCodebyplanConfig().path`.
|
|
63
|
+
* @returns The absolute directory path that is the repo root.
|
|
64
|
+
*/
|
|
65
|
+
export declare function deriveRepoRoot(configPath: string): string;
|
|
66
|
+
/**
|
|
67
|
+
* Convert every top-level key from kebab-case to snake_case.
|
|
68
|
+
* Returns a NEW object; values are copied unchanged.
|
|
69
|
+
* No recursion into nested objects.
|
|
70
|
+
*
|
|
71
|
+
* Example: { "task-id": "x", "is-claude-written": true }
|
|
72
|
+
* → { task_id: "x", is_claude_written: true }
|
|
73
|
+
*/
|
|
74
|
+
export declare function kebabToSnakeKeys(obj: Record<string, unknown>): Record<string, unknown>;
|
|
75
|
+
/**
|
|
76
|
+
* Coerce string values to their correct runtime types for a CLOSED ENUM of
|
|
77
|
+
* known column names. Runs AFTER kebabToSnakeKeys (keys already snake_case).
|
|
78
|
+
* Returns a NEW object; unrecognised keys and already-typed values pass through
|
|
79
|
+
* unchanged.
|
|
80
|
+
*
|
|
81
|
+
* JSON fields (JSON.parse; SyntaxError → keep original string):
|
|
82
|
+
* files_changed, context, qa, research, resources,
|
|
83
|
+
* context_development, ideas, plan, handoff
|
|
84
|
+
*
|
|
85
|
+
* Boolean field (string 'true'→true, 'false'→false, other strings unchanged):
|
|
86
|
+
* is_claude_written
|
|
87
|
+
*
|
|
88
|
+
* Numeric fields (Number(v) when result is not NaN; NaN → keep original string):
|
|
89
|
+
* number, day_number, duration_minutes, session_number
|
|
90
|
+
*/
|
|
91
|
+
export declare function coerceFieldValues(obj: Record<string, unknown>): Record<string, unknown>;
|
|
92
|
+
/**
|
|
93
|
+
* Resolve repo_id and project path from flags, env vars, and config file.
|
|
94
|
+
*
|
|
95
|
+
* Priority for repo_id:
|
|
96
|
+
* 1. --repo-id flag
|
|
97
|
+
* 2. CODEBYPLAN_REPO_ID env var
|
|
98
|
+
* 3. .codebyplan/repo.json (or legacy .codebyplan.json) in projectPath or any ancestor
|
|
99
|
+
*
|
|
100
|
+
* Priority for worktree_id (legacy only — new layout does not store worktree_id in files;
|
|
101
|
+
* consumers must compute it via the resolver):
|
|
102
|
+
* 1. --worktree-id flag
|
|
103
|
+
* 2. CODEBYPLAN_WORKTREE_ID env var
|
|
104
|
+
* 3. Legacy .codebyplan.json in projectPath or any ancestor (new repo.json never has this)
|
|
105
|
+
*
|
|
106
|
+
* Priority for project path:
|
|
107
|
+
* 1. --path flag
|
|
108
|
+
* 2. process.cwd()
|
|
109
|
+
*
|
|
110
|
+
* Note: `projectPath` is NOT re-homed to the discovered config's directory.
|
|
111
|
+
* The walk-up is only used to resolve repo_id/worktree_id. Downstream code
|
|
112
|
+
* still operates relative to `projectPath` (the flag or cwd).
|
|
113
|
+
*/
|
|
114
|
+
export declare function resolveConfig(flags: Record<string, string>): Promise<CliConfig>;
|
|
115
|
+
//# sourceMappingURL=flags.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flags.d.ts","sourceRoot":"","sources":["../../src/lib/flags.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAA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OAAO,CAAC,SAAS,CAAC,CA2BpB"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Library for `codebyplan ci enforce-check`.
|
|
3
|
+
*
|
|
4
|
+
* Reads and writes `.codebyplan/ci.json` atomically, and enforces the CI
|
|
5
|
+
* required status check on a GitHub branch via `gh api`
|
|
6
|
+
* (node:child_process execSync).
|
|
7
|
+
*
|
|
8
|
+
* Idempotent: if `ci.json workflow.required_check_enforced === true`, returns
|
|
9
|
+
* `already_enforced` immediately. Mirrors the pattern used in
|
|
10
|
+
* `.codebyplan/shipment.json` `branching_configured.required_check_enforced`.
|
|
11
|
+
*
|
|
12
|
+
* On any non-zero `gh api` exit, prints a manual GitHub-UI fallback checklist
|
|
13
|
+
* and returns `manual_required` rather than throwing.
|
|
14
|
+
*/
|
|
15
|
+
import type { CiConfig } from "./types.js";
|
|
16
|
+
/**
|
|
17
|
+
* Read `.codebyplan/ci.json` from the project directory.
|
|
18
|
+
* Returns a minimal default CiConfig if the file is absent or malformed.
|
|
19
|
+
*/
|
|
20
|
+
export declare function readCiJson(projectDir: string): CiConfig;
|
|
21
|
+
/**
|
|
22
|
+
* Write `config` to `.codebyplan/ci.json` atomically using a tmp-file rename.
|
|
23
|
+
* Writes the full config object so no sibling keys are lost.
|
|
24
|
+
*/
|
|
25
|
+
export declare function writeCiJsonAtomic(projectDir: string, config: CiConfig): void;
|
|
26
|
+
export interface EnforceRequiredCheckOptions {
|
|
27
|
+
/** Branch to enforce the required check on (default: "main"). */
|
|
28
|
+
branch?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Name of the CI status check as it appears in GitHub PR checks. Defaults to
|
|
31
|
+
* "Lint + typecheck + test + build" to match `jobs.ci.name` in the generated
|
|
32
|
+
* ci.yml template — they MUST stay in sync, or GitHub shows the required
|
|
33
|
+
* check as perpetually pending and blocks every merge.
|
|
34
|
+
*/
|
|
35
|
+
checkName?: string;
|
|
36
|
+
/** Override the project root directory (default: process.cwd()). */
|
|
37
|
+
projectDir?: string;
|
|
38
|
+
/** Preview the action without calling `gh api` or writing ci.json. */
|
|
39
|
+
dryRun?: boolean;
|
|
40
|
+
}
|
|
41
|
+
export type EnforceRequiredCheckResult = {
|
|
42
|
+
status: "enforced";
|
|
43
|
+
path: string;
|
|
44
|
+
} | {
|
|
45
|
+
status: "already_enforced";
|
|
46
|
+
path: string;
|
|
47
|
+
} | {
|
|
48
|
+
status: "dry_run";
|
|
49
|
+
path: string;
|
|
50
|
+
} | {
|
|
51
|
+
status: "manual_required";
|
|
52
|
+
path: string;
|
|
53
|
+
instructions: string;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Enforce the CI required status check on a GitHub branch via `gh api`.
|
|
57
|
+
*
|
|
58
|
+
* Steps:
|
|
59
|
+
* 1. Read `.codebyplan/ci.json`. Return `already_enforced` if already done.
|
|
60
|
+
* 2. Probe whether branch protection already exists.
|
|
61
|
+
* 3a. If it exists → POST the check name to
|
|
62
|
+
* `.../protection/required_status_checks/contexts` (a SURGICAL add that
|
|
63
|
+
* leaves every other protection setting — required_linear_history,
|
|
64
|
+
* lock_branch, PR reviews, etc. — untouched). A full PUT /protection is a
|
|
65
|
+
* whole-object REPLACE and would silently wipe unrelated settings, so it
|
|
66
|
+
* is deliberately avoided here.
|
|
67
|
+
* 3b. If it does not exist → PUT a minimal protection rule requiring just the
|
|
68
|
+
* CI check (nothing to preserve).
|
|
69
|
+
* 4. Update `ci.json workflow.required_check_enforced = true` (atomic write).
|
|
70
|
+
*
|
|
71
|
+
* On any non-zero `gh api` exit → return `manual_required` with a GitHub UI
|
|
72
|
+
* checklist fallback. With `dryRun`, prints the intended action and returns
|
|
73
|
+
* `dry_run` without calling `gh api` or writing ci.json.
|
|
74
|
+
*/
|
|
75
|
+
export declare function enforceRequiredCheck(opts?: EnforceRequiredCheckOptions): EnforceRequiredCheckResult;
|
|
76
|
+
//# sourceMappingURL=gh-required-checks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gh-required-checks.d.ts","sourceRoot":"","sources":["../../src/lib/gh-required-checks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAO3C;;;GAGG;AACH,wBAAgB,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,QAAQ,CAkBvD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,GAAG,IAAI,CAG5E;AAMD,MAAM,WAAW,2BAA2B;IAC1C,iEAAiE;IACjE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oEAAoE;IACpE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,sEAAsE;IACtE,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,MAAM,0BAA0B,GAClC;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACpC;IAAE,MAAM,EAAE,kBAAkB,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC5C;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACnC;IAAE,MAAM,EAAE,iBAAiB,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAAC;AAMtE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,CAAC,EAAE,2BAA2B,GACjC,0BAA0B,CA0H5B"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared git configuration helpers.
|
|
3
|
+
*
|
|
4
|
+
* Extracted from ship.ts so that bump.ts (and future callers) can reuse
|
|
5
|
+
* the same base-branch resolution logic without duplicating it.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Resolve the current git branch name for `cwd`.
|
|
9
|
+
* Tries `git symbolic-ref --short HEAD` first, falling back to
|
|
10
|
+
* `git rev-parse --abbrev-ref HEAD` (which yields "HEAD" on a detached HEAD).
|
|
11
|
+
* THROWS if both git invocations fail (no repo / git absent) — callers keep
|
|
12
|
+
* their existing try/catch + fallback value, so behavior is preserved.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getCurrentBranch(cwd?: string): string;
|
|
15
|
+
/**
|
|
16
|
+
* Read branch_config.base (production branch) from .codebyplan/git.json.
|
|
17
|
+
* Falls back gracefully when the file is missing or branch_config is absent.
|
|
18
|
+
* Default: "main".
|
|
19
|
+
*
|
|
20
|
+
* Resolution order:
|
|
21
|
+
* 1. branch_config.base (explicit base field)
|
|
22
|
+
* 2. branch_config.production
|
|
23
|
+
* 3. "main"
|
|
24
|
+
*/
|
|
25
|
+
export declare function readBaseBranch(cwd: string): Promise<string>;
|
|
26
|
+
/**
|
|
27
|
+
* Resolve the configured base branch NAME to the git ref the bump engine should
|
|
28
|
+
* actually compare against.
|
|
29
|
+
*
|
|
30
|
+
* The local `<base>` branch (e.g. `main`) is frequently stale relative to the
|
|
31
|
+
* remote — `git fetch` updates `origin/<base>`, not the local branch. Comparing
|
|
32
|
+
* against a stale local ref produces BOTH false positives (a stale merge-base
|
|
33
|
+
* widens the three-dot diff to include files already on the remote) and false
|
|
34
|
+
* negatives (idempotency wrongly skips a package whose version merely exceeds
|
|
35
|
+
* the stale local version). So prefer the remote-tracking ref `origin/<base>`
|
|
36
|
+
* when it exists.
|
|
37
|
+
*
|
|
38
|
+
* Repo-agnostic: when no `origin/<base>` remote-tracking ref exists (offline,
|
|
39
|
+
* no remote, detached fork), fall back to the local branch name. This function
|
|
40
|
+
* never fetches — keeping the resolution side-effect-free; the caller (ship /
|
|
41
|
+
* merge-main) owns freshness.
|
|
42
|
+
*
|
|
43
|
+
* @returns `origin/<base>` when that ref resolves, otherwise `<base>` unchanged.
|
|
44
|
+
*/
|
|
45
|
+
export declare function resolveBaseRef(cwd: string, baseBranch: string): string;
|
|
46
|
+
//# sourceMappingURL=git-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-utils.d.ts","sourceRoot":"","sources":["../../src/lib/git-utils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,GAAE,MAAsB,GAAG,MAAM,CAcpE;AAED;;;;;;;;;GASG;AACH,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA8CjE;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAiBtE"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The canonical set of codebyplan-managed .gitignore entries.
|
|
3
|
+
* Single source of truth — install/update/uninstall and setup all use this.
|
|
4
|
+
*/
|
|
5
|
+
export declare const CANONICAL_GITIGNORE_ENTRIES: readonly string[];
|
|
6
|
+
export declare const GITIGNORE_BLOCK_START = "# >>> codebyplan (managed) >>>";
|
|
7
|
+
export declare const GITIGNORE_BLOCK_END = "# <<< codebyplan <<<";
|
|
8
|
+
export type GitignoreBlockAction = "created" | "appended" | "refreshed" | "unchanged" | "removed";
|
|
9
|
+
/**
|
|
10
|
+
* Ensure the managed block (start marker, the canonical entries, end marker)
|
|
11
|
+
* exists in `<projectDir>/.gitignore`.
|
|
12
|
+
*
|
|
13
|
+
* - file absent → "created" (write file with just the block)
|
|
14
|
+
* - file present, no block → "appended" (preserve existing content + append)
|
|
15
|
+
* - file present, block differs → "refreshed" (replace only the block lines)
|
|
16
|
+
* - file present, block matches → "unchanged" (no write)
|
|
17
|
+
*
|
|
18
|
+
* CRLF-safe: detects dominant newline and writes block with same newline.
|
|
19
|
+
* Trailing-newline-safe: ensures a separating newline before the appended block.
|
|
20
|
+
* dryRun: computes action but does NOT write.
|
|
21
|
+
*/
|
|
22
|
+
export declare function ensureManagedGitignoreBlock(projectDir: string, dryRun?: boolean): Promise<GitignoreBlockAction>;
|
|
23
|
+
/**
|
|
24
|
+
* Remove the managed block (start marker, body, end marker) from
|
|
25
|
+
* `<projectDir>/.gitignore`.
|
|
26
|
+
*
|
|
27
|
+
* - block present → removes it, collapses stray double-blank-lines → "removed"
|
|
28
|
+
* - block absent or file missing → "unchanged"
|
|
29
|
+
* dryRun: computes action but does NOT write.
|
|
30
|
+
*/
|
|
31
|
+
export declare function removeManagedGitignoreBlock(projectDir: string, dryRun?: boolean): Promise<GitignoreBlockAction>;
|
|
32
|
+
//# sourceMappingURL=gitignore-block.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gitignore-block.d.ts","sourceRoot":"","sources":["../../src/lib/gitignore-block.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,eAAO,MAAM,2BAA2B,EAAE,SAAS,MAAM,EAWxD,CAAC;AAEF,eAAO,MAAM,qBAAqB,mCAAmC,CAAC;AACtE,eAAO,MAAM,mBAAmB,yBAAyB,CAAC;AAE1D,MAAM,MAAM,oBAAoB,GAC5B,SAAS,GACT,UAAU,GACV,WAAW,GACX,WAAW,GACX,SAAS,CAAC;AAEd;;;;;;;;;;;;GAYG;AACH,wBAAsB,2BAA2B,CAC/C,UAAU,EAAE,MAAM,EAClB,MAAM,UAAQ,GACb,OAAO,CAAC,oBAAoB,CAAC,CAoG/B;AAED;;;;;;;GAOG;AACH,wBAAsB,2BAA2B,CAC/C,UAAU,EAAE,MAAM,EAClB,MAAM,UAAQ,GACb,OAAO,CAAC,oBAAoB,CAAC,CAqE/B"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
export type SettingsIgnoredSkipReason = "non-git" | "not-ignored" | "managed-block" | "user-declined";
|
|
2
|
+
export interface DetectAndHealResult {
|
|
3
|
+
healed: boolean;
|
|
4
|
+
skipped?: SettingsIgnoredSkipReason;
|
|
5
|
+
}
|
|
6
|
+
export interface DetectAndHealOpts {
|
|
7
|
+
/** When true, auto-accept removal without prompting (equivalent to --yes). */
|
|
8
|
+
yes: boolean;
|
|
9
|
+
/** When true, report what would happen but do NOT write anything. */
|
|
10
|
+
dryRun: boolean;
|
|
11
|
+
}
|
|
12
|
+
/** Injectable deps — swap out in tests. */
|
|
13
|
+
export interface DetectAndHealDeps {
|
|
14
|
+
/**
|
|
15
|
+
* Run `git check-ignore -v -- .claude/settings.json` in projectDir.
|
|
16
|
+
* Returns { exitCode, stdout, stderr }.
|
|
17
|
+
* exitCode 0 → ignored; exitCode 1 → not ignored; exitCode 128 → not in a git repo.
|
|
18
|
+
*/
|
|
19
|
+
gitCheckIgnore?: (projectDir: string) => GitCheckIgnoreResult;
|
|
20
|
+
/**
|
|
21
|
+
* Run `git ls-files --error-unmatch -- .claude/settings.json` in projectDir.
|
|
22
|
+
* Returns exit code (0 = tracked, 1 = untracked, 128 = non-git / git absent).
|
|
23
|
+
*/
|
|
24
|
+
gitLsFiles?: (projectDir: string) => number;
|
|
25
|
+
/** Read a file as UTF-8. Defaults to node:fs/promises readFile. */
|
|
26
|
+
readFileFn?: (p: string) => Promise<string>;
|
|
27
|
+
/** Write a file as UTF-8. Defaults to node:fs/promises writeFile. */
|
|
28
|
+
writeFileFn?: (p: string, content: string) => Promise<void>;
|
|
29
|
+
/** Prompt the user for a remove/keep decision. Returns true = accept removal. */
|
|
30
|
+
promptRemoveIgnore?: (displayLine: string, opts: DetectAndHealOpts) => Promise<boolean>;
|
|
31
|
+
/** Print a one-line warning to stdout. */
|
|
32
|
+
printWarning?: (msg: string) => void;
|
|
33
|
+
/** Print a one-line informational notice to stdout. */
|
|
34
|
+
printInfo?: (msg: string) => void;
|
|
35
|
+
}
|
|
36
|
+
export interface GitCheckIgnoreResult {
|
|
37
|
+
exitCode: number | null;
|
|
38
|
+
stdout: string;
|
|
39
|
+
stderr: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Parse a single `git check-ignore -v` stdout line.
|
|
43
|
+
*
|
|
44
|
+
* Format: `<source>:<linenum>:<pattern>\t<path>`
|
|
45
|
+
*
|
|
46
|
+
* Returns null when the line does not match the expected format.
|
|
47
|
+
*/
|
|
48
|
+
export interface CheckIgnoreParsed {
|
|
49
|
+
sourceFile: string;
|
|
50
|
+
lineNum: number;
|
|
51
|
+
pattern: string;
|
|
52
|
+
matchedPath: string;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* True when a gitignore pattern specifically targets `settings.json` —
|
|
56
|
+
* i.e. its final path segment is exactly `settings.json` (no globs, not a
|
|
57
|
+
* directory pattern). Specific patterns are removed automatically without a
|
|
58
|
+
* prompt; broad patterns (e.g. `.claude/`) merely *match* settings.json and
|
|
59
|
+
* still require user consent, since removing them affects other files.
|
|
60
|
+
*/
|
|
61
|
+
export declare function patternTargetsSettingsJson(pattern: string): boolean;
|
|
62
|
+
export declare function parseCheckIgnoreLine(line: string): CheckIgnoreParsed | null;
|
|
63
|
+
/**
|
|
64
|
+
* Detect whether `.claude/settings.json` is matched by a gitignore rule and
|
|
65
|
+
* heal the violation: a pattern that specifically targets settings.json is
|
|
66
|
+
* removed automatically (no prompt — settings.json must be committed); a
|
|
67
|
+
* broad pattern that merely matches it (e.g. `.claude/`) prompts the user,
|
|
68
|
+
* since removing the line affects other files.
|
|
69
|
+
*
|
|
70
|
+
* Returns `{ healed: true }` when the line was removed.
|
|
71
|
+
* Returns `{ healed: false, skipped: reason }` for all other outcomes.
|
|
72
|
+
*
|
|
73
|
+
* Never throws — all error paths return a structured skipped reason.
|
|
74
|
+
*/
|
|
75
|
+
export declare function detectAndHealSettingsGitignore(projectDir: string, opts: DetectAndHealOpts, deps?: DetectAndHealDeps): Promise<DetectAndHealResult>;
|
|
76
|
+
export interface SettingsIgnoredInfo {
|
|
77
|
+
sourceFile: string;
|
|
78
|
+
lineNum: number;
|
|
79
|
+
pattern: string;
|
|
80
|
+
}
|
|
81
|
+
export type DetectSettingsIgnoredResult = {
|
|
82
|
+
status: "ignored";
|
|
83
|
+
info: SettingsIgnoredInfo;
|
|
84
|
+
} | {
|
|
85
|
+
status: "not-ignored";
|
|
86
|
+
} | {
|
|
87
|
+
status: "non-git";
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Detect whether `.claude/settings.json` is matched by a gitignore rule.
|
|
91
|
+
* Non-mutating: no file reads, no writes, no prompts.
|
|
92
|
+
*
|
|
93
|
+
* Returns:
|
|
94
|
+
* { status: "ignored", info } — matched by a gitignore rule
|
|
95
|
+
* { status: "not-ignored" } — file is not gitignored
|
|
96
|
+
* { status: "non-git" } — not in a git repo / git absent
|
|
97
|
+
*/
|
|
98
|
+
export declare function detectSettingsIgnored(projectDir: string, deps?: {
|
|
99
|
+
gitCheckIgnore?: (projectDir: string) => GitCheckIgnoreResult;
|
|
100
|
+
}): DetectSettingsIgnoredResult;
|
|
101
|
+
/**
|
|
102
|
+
* Check whether `.claude/settings.json` is tracked by git.
|
|
103
|
+
* Prints a one-line reminder when it is untracked. Non-fatal outside git.
|
|
104
|
+
*
|
|
105
|
+
* Returns:
|
|
106
|
+
* 'tracked' — git knows the file
|
|
107
|
+
* 'untracked' — file exists but not added to git index
|
|
108
|
+
* 'non-git' — not in a git repo / git absent
|
|
109
|
+
*/
|
|
110
|
+
export type UntrackedStatus = "tracked" | "untracked" | "non-git";
|
|
111
|
+
export declare function checkSettingsUntracked(projectDir: string, deps?: {
|
|
112
|
+
gitLsFiles?: (projectDir: string) => number;
|
|
113
|
+
}): UntrackedStatus;
|
|
114
|
+
export declare function warnIfSettingsUntracked(projectDir: string, deps?: {
|
|
115
|
+
gitLsFiles?: (projectDir: string) => number;
|
|
116
|
+
}): void;
|
|
117
|
+
//# sourceMappingURL=gitignore-detect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|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;CAAO,GACzD,eAAe,CAMjB;AAED,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,MAAM,EAClB,IAAI,GAAE;IAAE,UAAU,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,MAAM,CAAA;CAAO,GACzD,IAAI,CAON"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure handoff-file library — no file I/O.
|
|
3
|
+
*
|
|
4
|
+
* All functions take content/paths as parameters so they are trivially
|
|
5
|
+
* unit-testable without touching the filesystem.
|
|
6
|
+
*
|
|
7
|
+
* Handoff layout under `.codebyplan/handoff/`:
|
|
8
|
+
* repo → handoff/repo.md (per-worktree ## sections)
|
|
9
|
+
* checkpoint → handoff/checkpoint/<NNN>.md (3-digit zero-padded)
|
|
10
|
+
* task → handoff/task/<NNN>-<T>.md
|
|
11
|
+
* standalone → handoff/standalone/<N>.md
|
|
12
|
+
*/
|
|
13
|
+
export declare const HANDOFF_LEVELS: readonly ["repo", "checkpoint", "task", "standalone"];
|
|
14
|
+
export type HandoffLevel = (typeof HANDOFF_LEVELS)[number];
|
|
15
|
+
export interface HandoffPathOpts {
|
|
16
|
+
/** Checkpoint number (required for level "checkpoint" and "task"). */
|
|
17
|
+
checkpoint?: number;
|
|
18
|
+
/** Task number within the checkpoint (required for level "task"). */
|
|
19
|
+
task?: number;
|
|
20
|
+
/** Standalone task number (required for level "standalone"). */
|
|
21
|
+
number?: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Return the absolute path for a handoff file at the given level.
|
|
25
|
+
*
|
|
26
|
+
* - repo: <projectDir>/.codebyplan/handoff/repo.md
|
|
27
|
+
* - checkpoint: <projectDir>/.codebyplan/handoff/checkpoint/<NNN>.md
|
|
28
|
+
* - task: <projectDir>/.codebyplan/handoff/task/<NNN>-<T>.md
|
|
29
|
+
* - standalone: <projectDir>/.codebyplan/handoff/standalone/<N>.md
|
|
30
|
+
*
|
|
31
|
+
* Checkpoint numbers are zero-padded to 3 digits.
|
|
32
|
+
*/
|
|
33
|
+
export declare function handoffPath(projectDir: string, level: HandoffLevel, opts?: HandoffPathOpts): string;
|
|
34
|
+
/**
|
|
35
|
+
* Returns true when content is absent (undefined/null), empty, or
|
|
36
|
+
* whitespace-only. A file is considered "empty" only in these cases.
|
|
37
|
+
*/
|
|
38
|
+
export declare function isHandoffEmpty(content: string | null | undefined): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Extract the body of the `## <sectionLabel>` block from repo.md content.
|
|
41
|
+
*
|
|
42
|
+
* Returns the text between this heading and the next `## ` heading (or EOF),
|
|
43
|
+
* trimmed of leading/trailing blank lines. Returns null if the section is not
|
|
44
|
+
* found.
|
|
45
|
+
*/
|
|
46
|
+
export declare function readHandoffSection(fileContent: string, sectionLabel: string): string | null;
|
|
47
|
+
/**
|
|
48
|
+
* Upsert a `## <sectionLabel>` section in repo.md content.
|
|
49
|
+
*
|
|
50
|
+
* - If the section already exists, its body is replaced with `body`.
|
|
51
|
+
* - If it does not exist, it is appended at the end.
|
|
52
|
+
* - An empty `body` removes the section (delegates to removeHandoffSection).
|
|
53
|
+
*
|
|
54
|
+
* Returns the updated file content.
|
|
55
|
+
*/
|
|
56
|
+
export declare function replaceHandoffSection(fileContent: string, sectionLabel: string, body: string): string;
|
|
57
|
+
/**
|
|
58
|
+
* Remove the `## <sectionLabel>` section from repo.md content.
|
|
59
|
+
*
|
|
60
|
+
* Returns the resulting file content (may be empty string if no sections remain).
|
|
61
|
+
*/
|
|
62
|
+
export declare function removeHandoffSection(fileContent: string, sectionLabel: string): string;
|
|
63
|
+
//# sourceMappingURL=handoff-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handoff-file.d.ts","sourceRoot":"","sources":["../../src/lib/handoff-file.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAQH,eAAO,MAAM,cAAc,uDAKjB,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE3D,MAAM,WAAW,eAAe;IAC9B,sEAAsE;IACtE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qEAAqE;IACrE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gEAAgE;IAChE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAMD;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CACzB,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,YAAY,EACnB,IAAI,GAAE,eAAoB,GACzB,MAAM,CAmCR;AAMD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAG1E;AAMD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,GACnB,MAAM,GAAG,IAAI,CA4Bf;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,MAAM,GACX,MAAM,CAsCR;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,GACnB,MAAM,CAkCR"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compute a sha256 digest of the given input and return it as
|
|
3
|
+
* `sha256:<hex>`. The prefix is required so manifest entries are
|
|
4
|
+
* self-describing (forward-compatible if we ever switch algorithms).
|
|
5
|
+
*
|
|
6
|
+
* Accepts either a Buffer (typical for file reads) or a string (utf8).
|
|
7
|
+
*/
|
|
8
|
+
export declare function sha256(input: Buffer | string): string;
|
|
9
|
+
//# sourceMappingURL=hash.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../../src/lib/hash.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAGrD"}
|