light-plan 0.0.0-stage → 0.1.0
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/LICENSE +21 -0
- package/README.md +3181 -2
- package/assets/README.md +111 -0
- package/assets/agents/lpm-developer.md +468 -0
- package/assets/agents/lpm-planner.md +532 -0
- package/assets/harnesses/claude.yml +43 -0
- package/assets/harnesses/copilot.yml +54 -0
- package/assets/harnesses/reasonix.yml +49 -0
- package/assets/hcm/light-plan.yml +45 -0
- package/assets/skills/lpm-board-health.md +243 -0
- package/assets/skills/lpm-board-setup.md +354 -0
- package/assets/skills/lpm-delivery.md +344 -0
- package/assets/skills/lpm-planning.md +411 -0
- package/assets/skills/lpm-templates.md +144 -0
- package/assets/skills/lpm.md +267 -0
- package/dist/cli/agent-view.d.ts +27 -0
- package/dist/cli/agent-view.js +247 -0
- package/dist/cli/agent-view.js.map +1 -0
- package/dist/cli/commands/agent/assets.d.ts +64 -0
- package/dist/cli/commands/agent/assets.js +106 -0
- package/dist/cli/commands/agent/assets.js.map +1 -0
- package/dist/cli/commands/agent/glob.d.ts +25 -0
- package/dist/cli/commands/agent/glob.js +82 -0
- package/dist/cli/commands/agent/glob.js.map +1 -0
- package/dist/cli/commands/agent/index.d.ts +11 -0
- package/dist/cli/commands/agent/index.js +284 -0
- package/dist/cli/commands/agent/index.js.map +1 -0
- package/dist/cli/commands/agent/install.d.ts +59 -0
- package/dist/cli/commands/agent/install.js +131 -0
- package/dist/cli/commands/agent/install.js.map +1 -0
- package/dist/cli/commands/agent/mapping.d.ts +175 -0
- package/dist/cli/commands/agent/mapping.js +256 -0
- package/dist/cli/commands/agent/mapping.js.map +1 -0
- package/dist/cli/commands/check.d.ts +2 -0
- package/dist/cli/commands/check.js +81 -0
- package/dist/cli/commands/check.js.map +1 -0
- package/dist/cli/commands/comment.d.ts +2 -0
- package/dist/cli/commands/comment.js +104 -0
- package/dist/cli/commands/comment.js.map +1 -0
- package/dist/cli/commands/convert.d.ts +2 -0
- package/dist/cli/commands/convert.js +115 -0
- package/dist/cli/commands/convert.js.map +1 -0
- package/dist/cli/commands/copy.d.ts +2 -0
- package/dist/cli/commands/copy.js +69 -0
- package/dist/cli/commands/copy.js.map +1 -0
- package/dist/cli/commands/export.d.ts +11 -0
- package/dist/cli/commands/export.js +226 -0
- package/dist/cli/commands/export.js.map +1 -0
- package/dist/cli/commands/flag.d.ts +2 -0
- package/dist/cli/commands/flag.js +172 -0
- package/dist/cli/commands/flag.js.map +1 -0
- package/dist/cli/commands/git.d.ts +11 -0
- package/dist/cli/commands/git.js +357 -0
- package/dist/cli/commands/git.js.map +1 -0
- package/dist/cli/commands/hcm/bundle.d.ts +60 -0
- package/dist/cli/commands/hcm/bundle.js +166 -0
- package/dist/cli/commands/hcm/bundle.js.map +1 -0
- package/dist/cli/commands/hcm/index.d.ts +11 -0
- package/dist/cli/commands/hcm/index.js +162 -0
- package/dist/cli/commands/hcm/index.js.map +1 -0
- package/dist/cli/commands/init.d.ts +2 -0
- package/dist/cli/commands/init.js +81 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/insert.d.ts +2 -0
- package/dist/cli/commands/insert.js +70 -0
- package/dist/cli/commands/insert.js.map +1 -0
- package/dist/cli/commands/instructions.d.ts +7 -0
- package/dist/cli/commands/instructions.js +256 -0
- package/dist/cli/commands/instructions.js.map +1 -0
- package/dist/cli/commands/link.d.ts +2 -0
- package/dist/cli/commands/link.js +121 -0
- package/dist/cli/commands/link.js.map +1 -0
- package/dist/cli/commands/mcp/config.d.ts +71 -0
- package/dist/cli/commands/mcp/config.js +119 -0
- package/dist/cli/commands/mcp/config.js.map +1 -0
- package/dist/cli/commands/mcp/index.d.ts +9 -0
- package/dist/cli/commands/mcp/index.js +92 -0
- package/dist/cli/commands/mcp/index.js.map +1 -0
- package/dist/cli/commands/mcp/serve.d.ts +1 -0
- package/dist/cli/commands/mcp/serve.js +76 -0
- package/dist/cli/commands/mcp/serve.js.map +1 -0
- package/dist/cli/commands/mcp/setup.d.ts +1 -0
- package/dist/cli/commands/mcp/setup.js +83 -0
- package/dist/cli/commands/mcp/setup.js.map +1 -0
- package/dist/cli/commands/me.d.ts +2 -0
- package/dist/cli/commands/me.js +85 -0
- package/dist/cli/commands/me.js.map +1 -0
- package/dist/cli/commands/move.d.ts +2 -0
- package/dist/cli/commands/move.js +81 -0
- package/dist/cli/commands/move.js.map +1 -0
- package/dist/cli/commands/new.d.ts +2 -0
- package/dist/cli/commands/new.js +222 -0
- package/dist/cli/commands/new.js.map +1 -0
- package/dist/cli/commands/open.d.ts +2 -0
- package/dist/cli/commands/open.js +43 -0
- package/dist/cli/commands/open.js.map +1 -0
- package/dist/cli/commands/period.d.ts +10 -0
- package/dist/cli/commands/period.js +165 -0
- package/dist/cli/commands/period.js.map +1 -0
- package/dist/cli/commands/profile.d.ts +2 -0
- package/dist/cli/commands/profile.js +133 -0
- package/dist/cli/commands/profile.js.map +1 -0
- package/dist/cli/commands/queue.d.ts +2 -0
- package/dist/cli/commands/queue.js +582 -0
- package/dist/cli/commands/queue.js.map +1 -0
- package/dist/cli/commands/remote.d.ts +10 -0
- package/dist/cli/commands/remote.js +3142 -0
- package/dist/cli/commands/remote.js.map +1 -0
- package/dist/cli/commands/rm.d.ts +2 -0
- package/dist/cli/commands/rm.js +63 -0
- package/dist/cli/commands/rm.js.map +1 -0
- package/dist/cli/commands/set.d.ts +2 -0
- package/dist/cli/commands/set.js +139 -0
- package/dist/cli/commands/set.js.map +1 -0
- package/dist/cli/commands/split.d.ts +2 -0
- package/dist/cli/commands/split.js +90 -0
- package/dist/cli/commands/split.js.map +1 -0
- package/dist/cli/commands/task.d.ts +2 -0
- package/dist/cli/commands/task.js +298 -0
- package/dist/cli/commands/task.js.map +1 -0
- package/dist/cli/commands/team.d.ts +2 -0
- package/dist/cli/commands/team.js +114 -0
- package/dist/cli/commands/team.js.map +1 -0
- package/dist/cli/commands/template.d.ts +2 -0
- package/dist/cli/commands/template.js +338 -0
- package/dist/cli/commands/template.js.map +1 -0
- package/dist/cli/commands/ui.d.ts +2 -0
- package/dist/cli/commands/ui.js +98 -0
- package/dist/cli/commands/ui.js.map +1 -0
- package/dist/cli/commands/upstream.d.ts +2 -0
- package/dist/cli/commands/upstream.js +218 -0
- package/dist/cli/commands/upstream.js.map +1 -0
- package/dist/cli/context.d.ts +24 -0
- package/dist/cli/context.js +52 -0
- package/dist/cli/context.js.map +1 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +208 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/live.d.ts +71 -0
- package/dist/cli/live.js +182 -0
- package/dist/cli/live.js.map +1 -0
- package/dist/cli/plan.d.ts +28 -0
- package/dist/cli/plan.js +76 -0
- package/dist/cli/plan.js.map +1 -0
- package/dist/cli/prompt.d.ts +60 -0
- package/dist/cli/prompt.js +185 -0
- package/dist/cli/prompt.js.map +1 -0
- package/dist/cli/ui.d.ts +65 -0
- package/dist/cli/ui.js +79 -0
- package/dist/cli/ui.js.map +1 -0
- package/dist/core/board/dependency-rollup.d.ts +54 -0
- package/dist/core/board/dependency-rollup.js +72 -0
- package/dist/core/board/dependency-rollup.js.map +1 -0
- package/dist/core/board/flag-rollup.d.ts +33 -0
- package/dist/core/board/flag-rollup.js +56 -0
- package/dist/core/board/flag-rollup.js.map +1 -0
- package/dist/core/board/index.d.ts +21 -0
- package/dist/core/board/index.js +22 -0
- package/dist/core/board/index.js.map +1 -0
- package/dist/core/board/load/cache.d.ts +52 -0
- package/dist/core/board/load/cache.js +105 -0
- package/dist/core/board/load/cache.js.map +1 -0
- package/dist/core/board/load/fields.d.ts +33 -0
- package/dist/core/board/load/fields.js +154 -0
- package/dist/core/board/load/fields.js.map +1 -0
- package/dist/core/board/load/scan.d.ts +39 -0
- package/dist/core/board/load/scan.js +88 -0
- package/dist/core/board/load/scan.js.map +1 -0
- package/dist/core/board/load/tree.d.ts +10 -0
- package/dist/core/board/load/tree.js +114 -0
- package/dist/core/board/load/tree.js.map +1 -0
- package/dist/core/board/load.d.ts +69 -0
- package/dist/core/board/load.js +204 -0
- package/dist/core/board/load.js.map +1 -0
- package/dist/core/board/query.d.ts +126 -0
- package/dist/core/board/query.js +291 -0
- package/dist/core/board/query.js.map +1 -0
- package/dist/core/board/registry.d.ts +51 -0
- package/dist/core/board/registry.js +98 -0
- package/dist/core/board/registry.js.map +1 -0
- package/dist/core/board/remote-scopes.d.ts +71 -0
- package/dist/core/board/remote-scopes.js +103 -0
- package/dist/core/board/remote-scopes.js.map +1 -0
- package/dist/core/board/rollup.d.ts +32 -0
- package/dist/core/board/rollup.js +67 -0
- package/dist/core/board/rollup.js.map +1 -0
- package/dist/core/board/scope.d.ts +81 -0
- package/dist/core/board/scope.js +134 -0
- package/dist/core/board/scope.js.map +1 -0
- package/dist/core/board/simulate.d.ts +138 -0
- package/dist/core/board/simulate.js +141 -0
- package/dist/core/board/simulate.js.map +1 -0
- package/dist/core/board/tasks/index.d.ts +25 -0
- package/dist/core/board/tasks/index.js +26 -0
- package/dist/core/board/tasks/index.js.map +1 -0
- package/dist/core/board/tasks/ranking.d.ts +155 -0
- package/dist/core/board/tasks/ranking.js +374 -0
- package/dist/core/board/tasks/ranking.js.map +1 -0
- package/dist/core/board/tasks/roster.d.ts +42 -0
- package/dist/core/board/tasks/roster.js +82 -0
- package/dist/core/board/tasks/roster.js.map +1 -0
- package/dist/core/board/tasks.d.ts +1 -0
- package/dist/core/board/tasks.js +2 -0
- package/dist/core/board/tasks.js.map +1 -0
- package/dist/core/config/index.d.ts +9 -0
- package/dist/core/config/index.js +10 -0
- package/dist/core/config/index.js.map +1 -0
- package/dist/core/config/lookup.d.ts +114 -0
- package/dist/core/config/lookup.js +221 -0
- package/dist/core/config/lookup.js.map +1 -0
- package/dist/core/config/remote-blocks.d.ts +17 -0
- package/dist/core/config/remote-blocks.js +47 -0
- package/dist/core/config/remote-blocks.js.map +1 -0
- package/dist/core/config/schema.d.ts +10 -0
- package/dist/core/config/schema.js +451 -0
- package/dist/core/config/schema.js.map +1 -0
- package/dist/core/errors.d.ts +23 -0
- package/dist/core/errors.js +31 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/gitsync/hosts.d.ts +40 -0
- package/dist/core/gitsync/hosts.js +115 -0
- package/dist/core/gitsync/hosts.js.map +1 -0
- package/dist/core/gitsync/index.d.ts +25 -0
- package/dist/core/gitsync/index.js +25 -0
- package/dist/core/gitsync/index.js.map +1 -0
- package/dist/core/gitsync/integrate.d.ts +72 -0
- package/dist/core/gitsync/integrate.js +115 -0
- package/dist/core/gitsync/integrate.js.map +1 -0
- package/dist/core/gitsync/repo.d.ts +61 -0
- package/dist/core/gitsync/repo.js +213 -0
- package/dist/core/gitsync/repo.js.map +1 -0
- package/dist/core/gitsync/run.d.ts +58 -0
- package/dist/core/gitsync/run.js +102 -0
- package/dist/core/gitsync/run.js.map +1 -0
- package/dist/core/gitsync/status.d.ts +59 -0
- package/dist/core/gitsync/status.js +81 -0
- package/dist/core/gitsync/status.js.map +1 -0
- package/dist/core/gitsync/sync.d.ts +111 -0
- package/dist/core/gitsync/sync.js +275 -0
- package/dist/core/gitsync/sync.js.map +1 -0
- package/dist/core/index.d.ts +31 -0
- package/dist/core/index.js +32 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/instructions/analyze.d.ts +70 -0
- package/dist/core/instructions/analyze.js +275 -0
- package/dist/core/instructions/analyze.js.map +1 -0
- package/dist/core/instructions/builtin.d.ts +21 -0
- package/dist/core/instructions/builtin.js +133 -0
- package/dist/core/instructions/builtin.js.map +1 -0
- package/dist/core/instructions/context.d.ts +155 -0
- package/dist/core/instructions/context.js +209 -0
- package/dist/core/instructions/context.js.map +1 -0
- package/dist/core/instructions/index.d.ts +29 -0
- package/dist/core/instructions/index.js +30 -0
- package/dist/core/instructions/index.js.map +1 -0
- package/dist/core/instructions/instructions.d.ts +90 -0
- package/dist/core/instructions/instructions.js +179 -0
- package/dist/core/instructions/instructions.js.map +1 -0
- package/dist/core/instructions/template.d.ts +108 -0
- package/dist/core/instructions/template.js +252 -0
- package/dist/core/instructions/template.js.map +1 -0
- package/dist/core/model/attributes.d.ts +16 -0
- package/dist/core/model/attributes.js +119 -0
- package/dist/core/model/attributes.js.map +1 -0
- package/dist/core/model/index.d.ts +10 -0
- package/dist/core/model/index.js +11 -0
- package/dist/core/model/index.js.map +1 -0
- package/dist/core/model/links.d.ts +34 -0
- package/dist/core/model/links.js +114 -0
- package/dist/core/model/links.js.map +1 -0
- package/dist/core/model/profile.d.ts +31 -0
- package/dist/core/model/profile.js +8 -0
- package/dist/core/model/profile.js.map +1 -0
- package/dist/core/model/types.d.ts +441 -0
- package/dist/core/model/types.js +167 -0
- package/dist/core/model/types.js.map +1 -0
- package/dist/core/model/zod.d.ts +6 -0
- package/dist/core/model/zod.js +11 -0
- package/dist/core/model/zod.js.map +1 -0
- package/dist/core/operations/board-index.d.ts +45 -0
- package/dist/core/operations/board-index.js +147 -0
- package/dist/core/operations/board-index.js.map +1 -0
- package/dist/core/operations/claim.d.ts +69 -0
- package/dist/core/operations/claim.js +115 -0
- package/dist/core/operations/claim.js.map +1 -0
- package/dist/core/operations/comment.d.ts +30 -0
- package/dist/core/operations/comment.js +46 -0
- package/dist/core/operations/comment.js.map +1 -0
- package/dist/core/operations/create.d.ts +82 -0
- package/dist/core/operations/create.js +306 -0
- package/dist/core/operations/create.js.map +1 -0
- package/dist/core/operations/flag.d.ts +58 -0
- package/dist/core/operations/flag.js +95 -0
- package/dist/core/operations/flag.js.map +1 -0
- package/dist/core/operations/git-sync.d.ts +148 -0
- package/dist/core/operations/git-sync.js +341 -0
- package/dist/core/operations/git-sync.js.map +1 -0
- package/dist/core/operations/index.d.ts +44 -0
- package/dist/core/operations/index.js +45 -0
- package/dist/core/operations/index.js.map +1 -0
- package/dist/core/operations/init.d.ts +25 -0
- package/dist/core/operations/init.js +122 -0
- package/dist/core/operations/init.js.map +1 -0
- package/dist/core/operations/link.d.ts +40 -0
- package/dist/core/operations/link.js +131 -0
- package/dist/core/operations/link.js.map +1 -0
- package/dist/core/operations/move.d.ts +43 -0
- package/dist/core/operations/move.js +103 -0
- package/dist/core/operations/move.js.map +1 -0
- package/dist/core/operations/profile.d.ts +23 -0
- package/dist/core/operations/profile.js +26 -0
- package/dist/core/operations/profile.js.map +1 -0
- package/dist/core/operations/remotes-off.d.ts +12 -0
- package/dist/core/operations/remotes-off.js +67 -0
- package/dist/core/operations/remotes-off.js.map +1 -0
- package/dist/core/operations/remove.d.ts +18 -0
- package/dist/core/operations/remove.js +114 -0
- package/dist/core/operations/remove.js.map +1 -0
- package/dist/core/operations/retype.d.ts +25 -0
- package/dist/core/operations/retype.js +59 -0
- package/dist/core/operations/retype.js.map +1 -0
- package/dist/core/operations/rollup.d.ts +74 -0
- package/dist/core/operations/rollup.js +121 -0
- package/dist/core/operations/rollup.js.map +1 -0
- package/dist/core/operations/shared.d.ts +133 -0
- package/dist/core/operations/shared.js +383 -0
- package/dist/core/operations/shared.js.map +1 -0
- package/dist/core/operations/update.d.ts +43 -0
- package/dist/core/operations/update.js +161 -0
- package/dist/core/operations/update.js.map +1 -0
- package/dist/core/operations/user.d.ts +27 -0
- package/dist/core/operations/user.js +68 -0
- package/dist/core/operations/user.js.map +1 -0
- package/dist/core/profile/current.d.ts +35 -0
- package/dist/core/profile/current.js +31 -0
- package/dist/core/profile/current.js.map +1 -0
- package/dist/core/profile/index.d.ts +14 -0
- package/dist/core/profile/index.js +15 -0
- package/dist/core/profile/index.js.map +1 -0
- package/dist/core/profile/schema.d.ts +9 -0
- package/dist/core/profile/schema.js +100 -0
- package/dist/core/profile/schema.js.map +1 -0
- package/dist/core/storage/activity.d.ts +78 -0
- package/dist/core/storage/activity.js +131 -0
- package/dist/core/storage/activity.js.map +1 -0
- package/dist/core/storage/atomic.d.ts +34 -0
- package/dist/core/storage/atomic.js +117 -0
- package/dist/core/storage/atomic.js.map +1 -0
- package/dist/core/storage/comments.d.ts +39 -0
- package/dist/core/storage/comments.js +88 -0
- package/dist/core/storage/comments.js.map +1 -0
- package/dist/core/storage/document.d.ts +16 -0
- package/dist/core/storage/document.js +98 -0
- package/dist/core/storage/document.js.map +1 -0
- package/dist/core/storage/frontmatter.d.ts +16 -0
- package/dist/core/storage/frontmatter.js +33 -0
- package/dist/core/storage/frontmatter.js.map +1 -0
- package/dist/core/storage/git.d.ts +8 -0
- package/dist/core/storage/git.js +48 -0
- package/dist/core/storage/git.js.map +1 -0
- package/dist/core/storage/index.d.ts +27 -0
- package/dist/core/storage/index.js +28 -0
- package/dist/core/storage/index.js.map +1 -0
- package/dist/core/storage/local.d.ts +57 -0
- package/dist/core/storage/local.js +133 -0
- package/dist/core/storage/local.js.map +1 -0
- package/dist/core/storage/lock.d.ts +85 -0
- package/dist/core/storage/lock.js +364 -0
- package/dist/core/storage/lock.js.map +1 -0
- package/dist/core/storage/paths.d.ts +125 -0
- package/dist/core/storage/paths.js +202 -0
- package/dist/core/storage/paths.js.map +1 -0
- package/dist/core/storage/state.d.ts +32 -0
- package/dist/core/storage/state.js +71 -0
- package/dist/core/storage/state.js.map +1 -0
- package/dist/core/storage/templates.d.ts +29 -0
- package/dist/core/storage/templates.js +62 -0
- package/dist/core/storage/templates.js.map +1 -0
- package/dist/core/storage/views.d.ts +18 -0
- package/dist/core/storage/views.js +62 -0
- package/dist/core/storage/views.js.map +1 -0
- package/dist/core/validation/check.d.ts +4 -0
- package/dist/core/validation/check.js +22 -0
- package/dist/core/validation/check.js.map +1 -0
- package/dist/core/validation/checks/collection.d.ts +4 -0
- package/dist/core/validation/checks/collection.js +152 -0
- package/dist/core/validation/checks/collection.js.map +1 -0
- package/dist/core/validation/checks/counters.d.ts +3 -0
- package/dist/core/validation/checks/counters.js +23 -0
- package/dist/core/validation/checks/counters.js.map +1 -0
- package/dist/core/validation/checks/dependencies.d.ts +3 -0
- package/dist/core/validation/checks/dependencies.js +58 -0
- package/dist/core/validation/checks/dependencies.js.map +1 -0
- package/dist/core/validation/checks/gitignore.d.ts +10 -0
- package/dist/core/validation/checks/gitignore.js +22 -0
- package/dist/core/validation/checks/gitignore.js.map +1 -0
- package/dist/core/validation/checks/index-file.d.ts +8 -0
- package/dist/core/validation/checks/index-file.js +26 -0
- package/dist/core/validation/checks/index-file.js.map +1 -0
- package/dist/core/validation/checks/index.d.ts +20 -0
- package/dist/core/validation/checks/index.js +21 -0
- package/dist/core/validation/checks/index.js.map +1 -0
- package/dist/core/validation/checks/issues.d.ts +3 -0
- package/dist/core/validation/checks/issues.js +152 -0
- package/dist/core/validation/checks/issues.js.map +1 -0
- package/dist/core/validation/checks/periods.d.ts +3 -0
- package/dist/core/validation/checks/periods.js +89 -0
- package/dist/core/validation/checks/periods.js.map +1 -0
- package/dist/core/validation/checks/remotes.d.ts +20 -0
- package/dist/core/validation/checks/remotes.js +42 -0
- package/dist/core/validation/checks/remotes.js.map +1 -0
- package/dist/core/validation/checks/resources.d.ts +3 -0
- package/dist/core/validation/checks/resources.js +77 -0
- package/dist/core/validation/checks/resources.js.map +1 -0
- package/dist/core/validation/checks/rollup.d.ts +27 -0
- package/dist/core/validation/checks/rollup.js +53 -0
- package/dist/core/validation/checks/rollup.js.map +1 -0
- package/dist/core/validation/checks/squads.d.ts +3 -0
- package/dist/core/validation/checks/squads.js +42 -0
- package/dist/core/validation/checks/squads.js.map +1 -0
- package/dist/core/validation/checks/templates.d.ts +14 -0
- package/dist/core/validation/checks/templates.js +119 -0
- package/dist/core/validation/checks/templates.js.map +1 -0
- package/dist/core/validation/fix.d.ts +7 -0
- package/dist/core/validation/fix.js +273 -0
- package/dist/core/validation/fix.js.map +1 -0
- package/dist/core/validation/index.d.ts +7 -0
- package/dist/core/validation/index.js +8 -0
- package/dist/core/validation/index.js.map +1 -0
- package/dist/core/validation/shared.d.ts +47 -0
- package/dist/core/validation/shared.js +66 -0
- package/dist/core/validation/shared.js.map +1 -0
- package/dist/mcp/context.d.ts +70 -0
- package/dist/mcp/context.js +110 -0
- package/dist/mcp/context.js.map +1 -0
- package/dist/mcp/index.d.ts +49 -0
- package/dist/mcp/index.js +90 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/reply.d.ts +28 -0
- package/dist/mcp/reply.js +34 -0
- package/dist/mcp/reply.js.map +1 -0
- package/dist/mcp/tools/plan/create.d.ts +3 -0
- package/dist/mcp/tools/plan/create.js +128 -0
- package/dist/mcp/tools/plan/create.js.map +1 -0
- package/dist/mcp/tools/plan/delete.d.ts +3 -0
- package/dist/mcp/tools/plan/delete.js +35 -0
- package/dist/mcp/tools/plan/delete.js.map +1 -0
- package/dist/mcp/tools/plan/graph.d.ts +3 -0
- package/dist/mcp/tools/plan/graph.js +53 -0
- package/dist/mcp/tools/plan/graph.js.map +1 -0
- package/dist/mcp/tools/plan/index.d.ts +15 -0
- package/dist/mcp/tools/plan/index.js +16 -0
- package/dist/mcp/tools/plan/index.js.map +1 -0
- package/dist/mcp/tools/plan/link.d.ts +3 -0
- package/dist/mcp/tools/plan/link.js +46 -0
- package/dist/mcp/tools/plan/link.js.map +1 -0
- package/dist/mcp/tools/plan/registrar.d.ts +10 -0
- package/dist/mcp/tools/plan/registrar.js +24 -0
- package/dist/mcp/tools/plan/registrar.js.map +1 -0
- package/dist/mcp/tools/plan/reshape.d.ts +3 -0
- package/dist/mcp/tools/plan/reshape.js +95 -0
- package/dist/mcp/tools/plan/reshape.js.map +1 -0
- package/dist/mcp/tools/plan/timeline.d.ts +3 -0
- package/dist/mcp/tools/plan/timeline.js +68 -0
- package/dist/mcp/tools/plan/timeline.js.map +1 -0
- package/dist/mcp/tools/plan/upstream.d.ts +14 -0
- package/dist/mcp/tools/plan/upstream.js +69 -0
- package/dist/mcp/tools/plan/upstream.js.map +1 -0
- package/dist/mcp/tools/plan.d.ts +1 -0
- package/dist/mcp/tools/plan.js +2 -0
- package/dist/mcp/tools/plan.js.map +1 -0
- package/dist/mcp/tools/read.d.ts +3 -0
- package/dist/mcp/tools/read.js +339 -0
- package/dist/mcp/tools/read.js.map +1 -0
- package/dist/mcp/tools/remote.d.ts +3 -0
- package/dist/mcp/tools/remote.js +254 -0
- package/dist/mcp/tools/remote.js.map +1 -0
- package/dist/mcp/tools/templates.d.ts +12 -0
- package/dist/mcp/tools/templates.js +165 -0
- package/dist/mcp/tools/templates.js.map +1 -0
- package/dist/mcp/tools/work.d.ts +16 -0
- package/dist/mcp/tools/work.js +359 -0
- package/dist/mcp/tools/work.js.map +1 -0
- package/dist/remote/accounts.d.ts +158 -0
- package/dist/remote/accounts.js +207 -0
- package/dist/remote/accounts.js.map +1 -0
- package/dist/remote/adopt.d.ts +139 -0
- package/dist/remote/adopt.js +181 -0
- package/dist/remote/adopt.js.map +1 -0
- package/dist/remote/anchor.d.ts +35 -0
- package/dist/remote/anchor.js +53 -0
- package/dist/remote/anchor.js.map +1 -0
- package/dist/remote/attributes.d.ts +103 -0
- package/dist/remote/attributes.js +245 -0
- package/dist/remote/attributes.js.map +1 -0
- package/dist/remote/audit.d.ts +112 -0
- package/dist/remote/audit.js +215 -0
- package/dist/remote/audit.js.map +1 -0
- package/dist/remote/capabilities.d.ts +267 -0
- package/dist/remote/capabilities.js +225 -0
- package/dist/remote/capabilities.js.map +1 -0
- package/dist/remote/check.d.ts +49 -0
- package/dist/remote/check.js +356 -0
- package/dist/remote/check.js.map +1 -0
- package/dist/remote/comments.d.ts +86 -0
- package/dist/remote/comments.js +87 -0
- package/dist/remote/comments.js.map +1 -0
- package/dist/remote/config-file.d.ts +237 -0
- package/dist/remote/config-file.js +640 -0
- package/dist/remote/config-file.js.map +1 -0
- package/dist/remote/conflicts.d.ts +110 -0
- package/dist/remote/conflicts.js +188 -0
- package/dist/remote/conflicts.js.map +1 -0
- package/dist/remote/connection-catalogue.d.ts +65 -0
- package/dist/remote/connection-catalogue.js +66 -0
- package/dist/remote/connection-catalogue.js.map +1 -0
- package/dist/remote/connection.d.ts +84 -0
- package/dist/remote/connection.js +229 -0
- package/dist/remote/connection.js.map +1 -0
- package/dist/remote/coverage.d.ts +65 -0
- package/dist/remote/coverage.js +244 -0
- package/dist/remote/coverage.js.map +1 -0
- package/dist/remote/credentials.d.ts +95 -0
- package/dist/remote/credentials.js +210 -0
- package/dist/remote/credentials.js.map +1 -0
- package/dist/remote/execute.d.ts +178 -0
- package/dist/remote/execute.js +1245 -0
- package/dist/remote/execute.js.map +1 -0
- package/dist/remote/fingerprint.d.ts +172 -0
- package/dist/remote/fingerprint.js +337 -0
- package/dist/remote/fingerprint.js.map +1 -0
- package/dist/remote/fixtures.d.ts +176 -0
- package/dist/remote/fixtures.js +432 -0
- package/dist/remote/fixtures.js.map +1 -0
- package/dist/remote/guard.d.ts +90 -0
- package/dist/remote/guard.js +83 -0
- package/dist/remote/guard.js.map +1 -0
- package/dist/remote/hierarchy.d.ts +141 -0
- package/dist/remote/hierarchy.js +129 -0
- package/dist/remote/hierarchy.js.map +1 -0
- package/dist/remote/index.d.ts +145 -0
- package/dist/remote/index.js +146 -0
- package/dist/remote/index.js.map +1 -0
- package/dist/remote/inspect.d.ts +103 -0
- package/dist/remote/inspect.js +152 -0
- package/dist/remote/inspect.js.map +1 -0
- package/dist/remote/labels.d.ts +75 -0
- package/dist/remote/labels.js +137 -0
- package/dist/remote/labels.js.map +1 -0
- package/dist/remote/ladder.d.ts +145 -0
- package/dist/remote/ladder.js +387 -0
- package/dist/remote/ladder.js.map +1 -0
- package/dist/remote/ledger.d.ts +97 -0
- package/dist/remote/ledger.js +148 -0
- package/dist/remote/ledger.js.map +1 -0
- package/dist/remote/lifecycle.d.ts +175 -0
- package/dist/remote/lifecycle.js +274 -0
- package/dist/remote/lifecycle.js.map +1 -0
- package/dist/remote/links.d.ts +411 -0
- package/dist/remote/links.js +748 -0
- package/dist/remote/links.js.map +1 -0
- package/dist/remote/managed-block.d.ts +182 -0
- package/dist/remote/managed-block.js +406 -0
- package/dist/remote/managed-block.js.map +1 -0
- package/dist/remote/managed-comment.d.ts +104 -0
- package/dist/remote/managed-comment.js +92 -0
- package/dist/remote/managed-comment.js.map +1 -0
- package/dist/remote/mapping.d.ts +282 -0
- package/dist/remote/mapping.js +336 -0
- package/dist/remote/mapping.js.map +1 -0
- package/dist/remote/merge.d.ts +172 -0
- package/dist/remote/merge.js +221 -0
- package/dist/remote/merge.js.map +1 -0
- package/dist/remote/periods.d.ts +209 -0
- package/dist/remote/periods.js +224 -0
- package/dist/remote/periods.js.map +1 -0
- package/dist/remote/plan.d.ts +671 -0
- package/dist/remote/plan.js +1210 -0
- package/dist/remote/plan.js.map +1 -0
- package/dist/remote/policy.d.ts +67 -0
- package/dist/remote/policy.js +67 -0
- package/dist/remote/policy.js.map +1 -0
- package/dist/remote/preflight.d.ts +112 -0
- package/dist/remote/preflight.js +342 -0
- package/dist/remote/preflight.js.map +1 -0
- package/dist/remote/prerequisites.d.ts +113 -0
- package/dist/remote/prerequisites.js +161 -0
- package/dist/remote/prerequisites.js.map +1 -0
- package/dist/remote/provider.d.ts +802 -0
- package/dist/remote/provider.js +27 -0
- package/dist/remote/provider.js.map +1 -0
- package/dist/remote/providers/github/config.d.ts +84 -0
- package/dist/remote/providers/github/config.js +161 -0
- package/dist/remote/providers/github/config.js.map +1 -0
- package/dist/remote/providers/github/connector.d.ts +33 -0
- package/dist/remote/providers/github/connector.js +774 -0
- package/dist/remote/providers/github/connector.js.map +1 -0
- package/dist/remote/providers/github/edges.d.ts +29 -0
- package/dist/remote/providers/github/edges.js +56 -0
- package/dist/remote/providers/github/edges.js.map +1 -0
- package/dist/remote/providers/github/hierarchy.d.ts +21 -0
- package/dist/remote/providers/github/hierarchy.js +46 -0
- package/dist/remote/providers/github/hierarchy.js.map +1 -0
- package/dist/remote/providers/github/index.d.ts +26 -0
- package/dist/remote/providers/github/index.js +69 -0
- package/dist/remote/providers/github/index.js.map +1 -0
- package/dist/remote/providers/github/project-iteration.d.ts +71 -0
- package/dist/remote/providers/github/project-iteration.js +203 -0
- package/dist/remote/providers/github/project-iteration.js.map +1 -0
- package/dist/remote/providers/github/project-provision.d.ts +130 -0
- package/dist/remote/providers/github/project-provision.js +247 -0
- package/dist/remote/providers/github/project-provision.js.map +1 -0
- package/dist/remote/providers/github/project-status.d.ts +115 -0
- package/dist/remote/providers/github/project-status.js +317 -0
- package/dist/remote/providers/github/project-status.js.map +1 -0
- package/dist/remote/providers/github/projects.d.ts +181 -0
- package/dist/remote/providers/github/projects.js +481 -0
- package/dist/remote/providers/github/projects.js.map +1 -0
- package/dist/remote/providers/github/translator.d.ts +103 -0
- package/dist/remote/providers/github/translator.js +400 -0
- package/dist/remote/providers/github/translator.js.map +1 -0
- package/dist/remote/providers/jira/config.d.ts +96 -0
- package/dist/remote/providers/jira/config.js +200 -0
- package/dist/remote/providers/jira/config.js.map +1 -0
- package/dist/remote/providers/jira/connector.d.ts +42 -0
- package/dist/remote/providers/jira/connector.js +1688 -0
- package/dist/remote/providers/jira/connector.js.map +1 -0
- package/dist/remote/providers/jira/fields.d.ts +292 -0
- package/dist/remote/providers/jira/fields.js +463 -0
- package/dist/remote/providers/jira/fields.js.map +1 -0
- package/dist/remote/providers/jira/hierarchy.d.ts +28 -0
- package/dist/remote/providers/jira/hierarchy.js +60 -0
- package/dist/remote/providers/jira/hierarchy.js.map +1 -0
- package/dist/remote/providers/jira/index.d.ts +29 -0
- package/dist/remote/providers/jira/index.js +100 -0
- package/dist/remote/providers/jira/index.js.map +1 -0
- package/dist/remote/providers/jira/links.d.ts +41 -0
- package/dist/remote/providers/jira/links.js +102 -0
- package/dist/remote/providers/jira/links.js.map +1 -0
- package/dist/remote/providers/jira/sprints.d.ts +80 -0
- package/dist/remote/providers/jira/sprints.js +107 -0
- package/dist/remote/providers/jira/sprints.js.map +1 -0
- package/dist/remote/providers/jira/translator.d.ts +61 -0
- package/dist/remote/providers/jira/translator.js +382 -0
- package/dist/remote/providers/jira/translator.js.map +1 -0
- package/dist/remote/providers/jira/types.d.ts +112 -0
- package/dist/remote/providers/jira/types.js +160 -0
- package/dist/remote/providers/jira/types.js.map +1 -0
- package/dist/remote/providers/jira/vocabulary.d.ts +55 -0
- package/dist/remote/providers/jira/vocabulary.js +91 -0
- package/dist/remote/providers/jira/vocabulary.js.map +1 -0
- package/dist/remote/providers/jsonfile/config.d.ts +61 -0
- package/dist/remote/providers/jsonfile/config.js +83 -0
- package/dist/remote/providers/jsonfile/config.js.map +1 -0
- package/dist/remote/providers/jsonfile/connector.d.ts +34 -0
- package/dist/remote/providers/jsonfile/connector.js +251 -0
- package/dist/remote/providers/jsonfile/connector.js.map +1 -0
- package/dist/remote/providers/jsonfile/index.d.ts +38 -0
- package/dist/remote/providers/jsonfile/index.js +90 -0
- package/dist/remote/providers/jsonfile/index.js.map +1 -0
- package/dist/remote/providers/jsonfile/store.d.ts +59 -0
- package/dist/remote/providers/jsonfile/store.js +48 -0
- package/dist/remote/providers/jsonfile/store.js.map +1 -0
- package/dist/remote/providers/jsonfile/translator.d.ts +54 -0
- package/dist/remote/providers/jsonfile/translator.js +199 -0
- package/dist/remote/providers/jsonfile/translator.js.map +1 -0
- package/dist/remote/providers/linear/config.d.ts +83 -0
- package/dist/remote/providers/linear/config.js +140 -0
- package/dist/remote/providers/linear/config.js.map +1 -0
- package/dist/remote/providers/linear/connector.d.ts +36 -0
- package/dist/remote/providers/linear/connector.js +438 -0
- package/dist/remote/providers/linear/connector.js.map +1 -0
- package/dist/remote/providers/linear/estimate.d.ts +63 -0
- package/dist/remote/providers/linear/estimate.js +112 -0
- package/dist/remote/providers/linear/estimate.js.map +1 -0
- package/dist/remote/providers/linear/index.d.ts +31 -0
- package/dist/remote/providers/linear/index.js +75 -0
- package/dist/remote/providers/linear/index.js.map +1 -0
- package/dist/remote/providers/linear/labels.d.ts +51 -0
- package/dist/remote/providers/linear/labels.js +129 -0
- package/dist/remote/providers/linear/labels.js.map +1 -0
- package/dist/remote/providers/linear/states.d.ts +97 -0
- package/dist/remote/providers/linear/states.js +124 -0
- package/dist/remote/providers/linear/states.js.map +1 -0
- package/dist/remote/providers/linear/translator.d.ts +48 -0
- package/dist/remote/providers/linear/translator.js +343 -0
- package/dist/remote/providers/linear/translator.js.map +1 -0
- package/dist/remote/providers/linear/vocabulary.d.ts +27 -0
- package/dist/remote/providers/linear/vocabulary.js +42 -0
- package/dist/remote/providers/linear/vocabulary.js.map +1 -0
- package/dist/remote/provision.d.ts +45 -0
- package/dist/remote/provision.js +81 -0
- package/dist/remote/provision.js.map +1 -0
- package/dist/remote/pull.d.ts +52 -0
- package/dist/remote/pull.js +116 -0
- package/dist/remote/pull.js.map +1 -0
- package/dist/remote/readiness.d.ts +67 -0
- package/dist/remote/readiness.js +336 -0
- package/dist/remote/readiness.js.map +1 -0
- package/dist/remote/rebase.d.ts +157 -0
- package/dist/remote/rebase.js +255 -0
- package/dist/remote/rebase.js.map +1 -0
- package/dist/remote/reconcile.d.ts +115 -0
- package/dist/remote/reconcile.js +140 -0
- package/dist/remote/reconcile.js.map +1 -0
- package/dist/remote/redact.d.ts +70 -0
- package/dist/remote/redact.js +132 -0
- package/dist/remote/redact.js.map +1 -0
- package/dist/remote/registry.d.ts +32 -0
- package/dist/remote/registry.js +54 -0
- package/dist/remote/registry.js.map +1 -0
- package/dist/remote/remotes.d.ts +94 -0
- package/dist/remote/remotes.js +182 -0
- package/dist/remote/remotes.js.map +1 -0
- package/dist/remote/render.d.ts +147 -0
- package/dist/remote/render.js +683 -0
- package/dist/remote/render.js.map +1 -0
- package/dist/remote/report.d.ts +63 -0
- package/dist/remote/report.js +345 -0
- package/dist/remote/report.js.map +1 -0
- package/dist/remote/resolutions.d.ts +115 -0
- package/dist/remote/resolutions.js +217 -0
- package/dist/remote/resolutions.js.map +1 -0
- package/dist/remote/scaffold.d.ts +134 -0
- package/dist/remote/scaffold.js +370 -0
- package/dist/remote/scaffold.js.map +1 -0
- package/dist/remote/scope.d.ts +57 -0
- package/dist/remote/scope.js +91 -0
- package/dist/remote/scope.js.map +1 -0
- package/dist/remote/selection.d.ts +38 -0
- package/dist/remote/selection.js +50 -0
- package/dist/remote/selection.js.map +1 -0
- package/dist/remote/shape.d.ts +141 -0
- package/dist/remote/shape.js +220 -0
- package/dist/remote/shape.js.map +1 -0
- package/dist/remote/status.d.ts +104 -0
- package/dist/remote/status.js +238 -0
- package/dist/remote/status.js.map +1 -0
- package/dist/remote/sync.d.ts +182 -0
- package/dist/remote/sync.js +523 -0
- package/dist/remote/sync.js.map +1 -0
- package/dist/remote/transport/budget.d.ts +48 -0
- package/dist/remote/transport/budget.js +68 -0
- package/dist/remote/transport/budget.js.map +1 -0
- package/dist/remote/transport/connector.d.ts +115 -0
- package/dist/remote/transport/connector.js +21 -0
- package/dist/remote/transport/connector.js.map +1 -0
- package/dist/remote/transport/error.d.ts +88 -0
- package/dist/remote/transport/error.js +196 -0
- package/dist/remote/transport/error.js.map +1 -0
- package/dist/remote/transport/gh.d.ts +20 -0
- package/dist/remote/transport/gh.js +41 -0
- package/dist/remote/transport/gh.js.map +1 -0
- package/dist/remote/transport/graphql.d.ts +25 -0
- package/dist/remote/transport/graphql.js +81 -0
- package/dist/remote/transport/graphql.js.map +1 -0
- package/dist/remote/transport/http.d.ts +47 -0
- package/dist/remote/transport/http.js +195 -0
- package/dist/remote/transport/http.js.map +1 -0
- package/dist/remote/transport/index.d.ts +18 -0
- package/dist/remote/transport/index.js +19 -0
- package/dist/remote/transport/index.js.map +1 -0
- package/dist/remote/transport/process.d.ts +39 -0
- package/dist/remote/transport/process.js +121 -0
- package/dist/remote/transport/process.js.map +1 -0
- package/dist/remote/transport/rest.d.ts +22 -0
- package/dist/remote/transport/rest.js +57 -0
- package/dist/remote/transport/rest.js.map +1 -0
- package/dist/remote/transport/retry.d.ts +91 -0
- package/dist/remote/transport/retry.js +138 -0
- package/dist/remote/transport/retry.js.map +1 -0
- package/dist/remote/transport-error.d.ts +19 -0
- package/dist/remote/transport-error.js +22 -0
- package/dist/remote/transport-error.js.map +1 -0
- package/dist/remote/vocabulary.d.ts +126 -0
- package/dist/remote/vocabulary.js +57 -0
- package/dist/remote/vocabulary.js.map +1 -0
- package/dist/runner/config.d.ts +7 -0
- package/dist/runner/config.js +61 -0
- package/dist/runner/config.js.map +1 -0
- package/dist/runner/git.d.ts +19 -0
- package/dist/runner/git.js +26 -0
- package/dist/runner/git.js.map +1 -0
- package/dist/runner/index.d.ts +20 -0
- package/dist/runner/index.js +21 -0
- package/dist/runner/index.js.map +1 -0
- package/dist/runner/loop.d.ts +46 -0
- package/dist/runner/loop.js +243 -0
- package/dist/runner/loop.js.map +1 -0
- package/dist/runner/pi.d.ts +39 -0
- package/dist/runner/pi.js +276 -0
- package/dist/runner/pi.js.map +1 -0
- package/dist/runner/shell.d.ts +44 -0
- package/dist/runner/shell.js +174 -0
- package/dist/runner/shell.js.map +1 -0
- package/dist/runner/stats.d.ts +19 -0
- package/dist/runner/stats.js +58 -0
- package/dist/runner/stats.js.map +1 -0
- package/dist/runner/types.d.ts +218 -0
- package/dist/runner/types.js +37 -0
- package/dist/runner/types.js.map +1 -0
- package/dist/server/git.d.ts +8 -0
- package/dist/server/git.js +50 -0
- package/dist/server/git.js.map +1 -0
- package/dist/server/http/respond.d.ts +13 -0
- package/dist/server/http/respond.js +59 -0
- package/dist/server/http/respond.js.map +1 -0
- package/dist/server/http/router.d.ts +27 -0
- package/dist/server/http/router.js +48 -0
- package/dist/server/http/router.js.map +1 -0
- package/dist/server/http/static.d.ts +14 -0
- package/dist/server/http/static.js +55 -0
- package/dist/server/http/static.js.map +1 -0
- package/dist/server/index.d.ts +58 -0
- package/dist/server/index.js +124 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/routes/board.d.ts +8 -0
- package/dist/server/routes/board.js +19 -0
- package/dist/server/routes/board.js.map +1 -0
- package/dist/server/routes/comments.d.ts +13 -0
- package/dist/server/routes/comments.js +36 -0
- package/dist/server/routes/comments.js.map +1 -0
- package/dist/server/routes/flags.d.ts +16 -0
- package/dist/server/routes/flags.js +37 -0
- package/dist/server/routes/flags.js.map +1 -0
- package/dist/server/routes/git.d.ts +13 -0
- package/dist/server/routes/git.js +84 -0
- package/dist/server/routes/git.js.map +1 -0
- package/dist/server/routes/remotes.d.ts +36 -0
- package/dist/server/routes/remotes.js +749 -0
- package/dist/server/routes/remotes.js.map +1 -0
- package/dist/server/routes/views.d.ts +10 -0
- package/dist/server/routes/views.js +63 -0
- package/dist/server/routes/views.js.map +1 -0
- package/dist/server/views/schema.d.ts +2 -0
- package/dist/server/views/schema.js +121 -0
- package/dist/server/views/schema.js.map +1 -0
- package/dist/server/views/store.d.ts +17 -0
- package/dist/server/views/store.js +67 -0
- package/dist/server/views/store.js.map +1 -0
- package/dist/shared/adf.d.ts +83 -0
- package/dist/shared/adf.js +795 -0
- package/dist/shared/adf.js.map +1 -0
- package/dist/shared/blocking.d.ts +130 -0
- package/dist/shared/blocking.js +179 -0
- package/dist/shared/blocking.js.map +1 -0
- package/dist/shared/changes.d.ts +100 -0
- package/dist/shared/changes.js +112 -0
- package/dist/shared/changes.js.map +1 -0
- package/dist/shared/cohesion.d.ts +75 -0
- package/dist/shared/cohesion.js +132 -0
- package/dist/shared/cohesion.js.map +1 -0
- package/dist/shared/dependency-rollup.d.ts +91 -0
- package/dist/shared/dependency-rollup.js +132 -0
- package/dist/shared/dependency-rollup.js.map +1 -0
- package/dist/shared/errors.d.ts +23 -0
- package/dist/shared/errors.js +24 -0
- package/dist/shared/errors.js.map +1 -0
- package/dist/shared/flag-rollup.d.ts +88 -0
- package/dist/shared/flag-rollup.js +119 -0
- package/dist/shared/flag-rollup.js.map +1 -0
- package/dist/shared/git-sync.d.ts +90 -0
- package/dist/shared/git-sync.js +9 -0
- package/dist/shared/git-sync.js.map +1 -0
- package/dist/shared/index.d.ts +40 -0
- package/dist/shared/index.js +41 -0
- package/dist/shared/index.js.map +1 -0
- package/dist/shared/model.d.ts +218 -0
- package/dist/shared/model.js +95 -0
- package/dist/shared/model.js.map +1 -0
- package/dist/shared/period-query.d.ts +21 -0
- package/dist/shared/period-query.js +26 -0
- package/dist/shared/period-query.js.map +1 -0
- package/dist/shared/period-stance.d.ts +45 -0
- package/dist/shared/period-stance.js +50 -0
- package/dist/shared/period-stance.js.map +1 -0
- package/dist/shared/plans/breakdown.d.ts +66 -0
- package/dist/shared/plans/breakdown.js +186 -0
- package/dist/shared/plans/breakdown.js.map +1 -0
- package/dist/shared/plans/index.d.ts +21 -0
- package/dist/shared/plans/index.js +22 -0
- package/dist/shared/plans/index.js.map +1 -0
- package/dist/shared/plans/instantiate.d.ts +61 -0
- package/dist/shared/plans/instantiate.js +184 -0
- package/dist/shared/plans/instantiate.js.map +1 -0
- package/dist/shared/plans/reading.d.ts +79 -0
- package/dist/shared/plans/reading.js +149 -0
- package/dist/shared/plans/reading.js.map +1 -0
- package/dist/shared/plans/reparent.d.ts +54 -0
- package/dist/shared/plans/reparent.js +217 -0
- package/dist/shared/plans/reparent.js.map +1 -0
- package/dist/shared/plans/timeline.d.ts +93 -0
- package/dist/shared/plans/timeline.js +224 -0
- package/dist/shared/plans/timeline.js.map +1 -0
- package/dist/shared/plans/upstream.d.ts +67 -0
- package/dist/shared/plans/upstream.js +73 -0
- package/dist/shared/plans/upstream.js.map +1 -0
- package/dist/shared/remote-api.d.ts +413 -0
- package/dist/shared/remote-api.js +11 -0
- package/dist/shared/remote-api.js.map +1 -0
- package/dist/shared/remote-coverage.d.ts +120 -0
- package/dist/shared/remote-coverage.js +98 -0
- package/dist/shared/remote-coverage.js.map +1 -0
- package/dist/shared/remote-readiness.d.ts +162 -0
- package/dist/shared/remote-readiness.js +49 -0
- package/dist/shared/remote-readiness.js.map +1 -0
- package/dist/shared/remote-status.d.ts +268 -0
- package/dist/shared/remote-status.js +79 -0
- package/dist/shared/remote-status.js.map +1 -0
- package/dist/shared/rollup.d.ts +90 -0
- package/dist/shared/rollup.js +119 -0
- package/dist/shared/rollup.js.map +1 -0
- package/dist/shared/static.d.ts +65 -0
- package/dist/shared/static.js +107 -0
- package/dist/shared/static.js.map +1 -0
- package/dist/shared/template-params.d.ts +80 -0
- package/dist/shared/template-params.js +141 -0
- package/dist/shared/template-params.js.map +1 -0
- package/dist/shared/view.d.ts +105 -0
- package/dist/shared/view.js +44 -0
- package/dist/shared/view.js.map +1 -0
- package/dist/shared/work-unit.d.ts +34 -0
- package/dist/shared/work-unit.js +47 -0
- package/dist/shared/work-unit.js.map +1 -0
- package/dist/sync/apply.d.ts +21 -0
- package/dist/sync/apply.js +149 -0
- package/dist/sync/apply.js.map +1 -0
- package/dist/sync/dto.d.ts +9 -0
- package/dist/sync/dto.js +162 -0
- package/dist/sync/dto.js.map +1 -0
- package/dist/sync/index.d.ts +24 -0
- package/dist/sync/index.js +25 -0
- package/dist/sync/index.js.map +1 -0
- package/dist/sync/patch.d.ts +13 -0
- package/dist/sync/patch.js +212 -0
- package/dist/sync/patch.js.map +1 -0
- package/dist/sync/session.d.ts +31 -0
- package/dist/sync/session.js +55 -0
- package/dist/sync/session.js.map +1 -0
- package/dist/sync/static.d.ts +11 -0
- package/dist/sync/static.js +33 -0
- package/dist/sync/static.js.map +1 -0
- package/package.json +95 -4
- package/templates/blank.yml +71 -0
- package/templates/context/bug.md +107 -0
- package/templates/context/default.md +119 -0
- package/templates/context/epic.md +81 -0
- package/templates/context/feature.md +91 -0
- package/templates/context/research.md +87 -0
- package/templates/context/review.md +81 -0
- package/templates/context/story.md +94 -0
- package/templates/context/sub_task.md +108 -0
- package/templates/context/task.md +86 -0
- package/templates/context/test.md +73 -0
- package/templates/context/user_story.md +147 -0
- package/templates/kanban.yml +226 -0
- package/templates/scrum.yml +567 -0
- package/web/dist/assets/index-D0j8OnHq.js +35 -0
- package/web/dist/assets/index-DFL7v8aP.css +1 -0
- package/web/dist/index.html +13 -0
- package/web/dist-viewer/assets/index-Bcns6OuC.css +1 -0
- package/web/dist-viewer/assets/index-vVXzeiFo.js +7 -0
- package/web/dist-viewer/index.html +14 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The git hosts setup knows how to talk somebody through.
|
|
3
|
+
*
|
|
4
|
+
* Knowing a host is *help*, never a requirement: any URL git can push to works,
|
|
5
|
+
* and an unrecognised one is "a git server". What a host entry adds is what a
|
|
6
|
+
* person setting this up for the first time actually needs — what a URL to
|
|
7
|
+
* that host looks like, where an empty repository is created, and how git will
|
|
8
|
+
* find the credential — because the commonest way setup fails is a URL pasted
|
|
9
|
+
* from the wrong page, or a token git was never told about.
|
|
10
|
+
*
|
|
11
|
+
* light-plan stores no git credential. It runs git, and git asks its own
|
|
12
|
+
* credential helper (Git Credential Manager, the macOS keychain, an SSH key) —
|
|
13
|
+
* the same thing that answers when the person pushes their code. That is why
|
|
14
|
+
* every hint below points at git's configuration rather than at a light-plan
|
|
15
|
+
* command.
|
|
16
|
+
*
|
|
17
|
+
* Data only; the CLI prints it and the web serves it.
|
|
18
|
+
*/
|
|
19
|
+
export const GIT_HOSTS = [
|
|
20
|
+
{
|
|
21
|
+
id: 'github',
|
|
22
|
+
label: 'GitHub',
|
|
23
|
+
examples: ['https://github.com/<owner>/<repo>.git', 'git@github.com:<owner>/<repo>.git'],
|
|
24
|
+
create: 'https://github.com/new — leave it empty (no README, no licence).',
|
|
25
|
+
credentials: 'HTTPS: Git Credential Manager signs in through the browser, or use a personal access token with "Contents: read and write". SSH: add your public key at https://github.com/settings/keys.',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: 'gitlab',
|
|
29
|
+
label: 'GitLab',
|
|
30
|
+
examples: ['https://gitlab.com/<group>/<project>.git', 'git@gitlab.com:<group>/<project>.git'],
|
|
31
|
+
create: 'New project → "Create blank project", with "Initialize repository with a README" unticked.',
|
|
32
|
+
credentials: 'HTTPS: a personal or project access token with write_repository (use it as the password). SSH: add your key under Preferences → SSH Keys.',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
id: 'bitbucket',
|
|
36
|
+
label: 'Bitbucket',
|
|
37
|
+
examples: [
|
|
38
|
+
'https://<user>@bitbucket.org/<workspace>/<repo>.git',
|
|
39
|
+
'git@bitbucket.org:<workspace>/<repo>.git',
|
|
40
|
+
],
|
|
41
|
+
create: 'Create → Repository, with "Include a README?" set to No.',
|
|
42
|
+
credentials: 'HTTPS: an app password or API token with repository write access (Git Credential Manager can store it). SSH: add your key under Personal settings → SSH keys.',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
id: 'azure',
|
|
46
|
+
label: 'Azure DevOps',
|
|
47
|
+
examples: [
|
|
48
|
+
'https://dev.azure.com/<organization>/<project>/_git/<repo>',
|
|
49
|
+
'git@ssh.dev.azure.com:v3/<organization>/<project>/<repo>',
|
|
50
|
+
],
|
|
51
|
+
create: 'Repos → "New repository", with "Add a README" unticked.',
|
|
52
|
+
credentials: 'HTTPS: Git Credential Manager signs in with your Microsoft account, or use a personal access token with Code (Read & write). SSH: add your key under User settings → SSH public keys.',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
id: 'other',
|
|
56
|
+
label: 'Git server',
|
|
57
|
+
examples: ['https://<server>/<path>.git', 'ssh://<user>@<server>/<path>.git', '/path/to/shared/board.git'],
|
|
58
|
+
create: 'An empty (bare) repository: `git init --bare board.git` on the server or a shared drive.',
|
|
59
|
+
credentials: 'Whatever your git is already configured with for this server: a credential helper, or an SSH key.',
|
|
60
|
+
},
|
|
61
|
+
];
|
|
62
|
+
function hostOf(id) {
|
|
63
|
+
return GIT_HOSTS.find((host) => host.id === id);
|
|
64
|
+
}
|
|
65
|
+
/** The host name a URL points at, for HTTPS, `ssh://` and `user@host:path` forms. */
|
|
66
|
+
function hostname(url) {
|
|
67
|
+
const trimmed = url.trim();
|
|
68
|
+
const scheme = trimmed.match(/^[a-z][a-z0-9+.-]*:\/\/(?:[^@/]*@)?([^/:]+)/i);
|
|
69
|
+
if (scheme)
|
|
70
|
+
return scheme[1].toLowerCase();
|
|
71
|
+
const scp = trimmed.match(/^(?:[^@/]+@)?([^/:]+):(?!\/)/);
|
|
72
|
+
// A Windows drive letter ("C:\boards") is a path, not a host.
|
|
73
|
+
if (scp && scp[1].length > 1)
|
|
74
|
+
return scp[1].toLowerCase();
|
|
75
|
+
return '';
|
|
76
|
+
}
|
|
77
|
+
/** Which host a URL belongs to; `other` for anything unrecognised. */
|
|
78
|
+
export function recognizeHost(url) {
|
|
79
|
+
const host = hostname(url);
|
|
80
|
+
if (host === 'github.com' || host.endsWith('.github.com'))
|
|
81
|
+
return hostOf('github');
|
|
82
|
+
if (host === 'bitbucket.org')
|
|
83
|
+
return hostOf('bitbucket');
|
|
84
|
+
if (host === 'dev.azure.com' || host === 'ssh.dev.azure.com' || host.endsWith('visualstudio.com')) {
|
|
85
|
+
return hostOf('azure');
|
|
86
|
+
}
|
|
87
|
+
if (host === 'gitlab.com' || host.startsWith('gitlab.'))
|
|
88
|
+
return hostOf('gitlab');
|
|
89
|
+
return hostOf('other');
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Why a string cannot be a git URL, or null when git may as well try it. Loose
|
|
93
|
+
* on purpose — git is the judge — but a leading dash would be read as an
|
|
94
|
+
* option, and an empty string is a form somebody has not filled in.
|
|
95
|
+
*/
|
|
96
|
+
export function urlProblem(url) {
|
|
97
|
+
const trimmed = url.trim();
|
|
98
|
+
if (!trimmed)
|
|
99
|
+
return 'Give the URL of the repository the board should live in.';
|
|
100
|
+
// Spaces are allowed: a path to a bare repository on a shared drive may
|
|
101
|
+
// well have one, and git is passed the URL as one argument, never a shell.
|
|
102
|
+
if (trimmed.startsWith('-'))
|
|
103
|
+
return 'A repository URL cannot start with "-".';
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
/** Two URLs naming the same repository, ignoring a trailing `.git`, a slash and case. */
|
|
107
|
+
export function sameRepositoryUrl(a, b) {
|
|
108
|
+
const norm = (url) => url
|
|
109
|
+
.trim()
|
|
110
|
+
.replace(/\/+$/, '')
|
|
111
|
+
.replace(/\.git$/i, '')
|
|
112
|
+
.toLowerCase();
|
|
113
|
+
return norm(a) === norm(b);
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=hosts.js.map
|
|
@@ -0,0 +1 @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AwE;IACxE,2EAA2E;IAC3E,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,yCAAyC,CAAC;IAC9E,OAAO,IAAI,CAAC;AACd,CAAC;AAED,yFAAyF;AACzF,MAAM,UAAU,iBAAiB,CAAC,CAAS,EAAE,CAAS;IACpD,MAAM,IAAI,GAAG,CAAC,GAAW,EAAU,EAAE,CACnC,GAAG;SACA,IAAI,EAAE;SACN,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;SACnB,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC;SACtB,WAAW,EAAE,CAAC;IACnB,OAAO,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC;AAC7B,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sharing a board through its own git repository: the mechanism.
|
|
3
|
+
*
|
|
4
|
+
* `run` is the only way git is run (never waiting for a person), `repo` asks
|
|
5
|
+
* the repository questions and makes the few writes this layer needs,
|
|
6
|
+
* `integrate` brings fetched work into the board — fast-forward, or local work
|
|
7
|
+
* laid over upstream when the two touched different files, or a conflict when
|
|
8
|
+
* they touched the same one — `sync` is the network half and the write
|
|
9
|
+
* transaction, `status` the report, `hosts` the help a person setting this up
|
|
10
|
+
* is shown.
|
|
11
|
+
*
|
|
12
|
+
* The contract: when `git_sync` is configured, every operation that writes the
|
|
13
|
+
* board runs inside `sharedWrite` (operations/shared.ts makes that structural),
|
|
14
|
+
* so a write is either committed and pushed, or undone and refused. Nothing is
|
|
15
|
+
* ever merged inside a document. Front ends call `pullBoard` before they load,
|
|
16
|
+
* which keeps refusals rare; correctness does not depend on it.
|
|
17
|
+
*
|
|
18
|
+
* Sits between `board/` and `operations/`: it may read config and storage, and
|
|
19
|
+
* the operations that set sharing up (`operations/git-sync.ts`) are built on it.
|
|
20
|
+
*/
|
|
21
|
+
export * from './hosts.js';
|
|
22
|
+
export type { IntegrateResult, Resolution } from './integrate.js';
|
|
23
|
+
export { GIT_TIMEOUT_ENV } from './run.js';
|
|
24
|
+
export * from './status.js';
|
|
25
|
+
export { GIT_OFFLINE_ENV, describeFiles, fetchBoardAsync, isOffline, lastFetchOf, type FetchResult, type PullOutcome, } from './sync.js';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sharing a board through its own git repository: the mechanism.
|
|
3
|
+
*
|
|
4
|
+
* `run` is the only way git is run (never waiting for a person), `repo` asks
|
|
5
|
+
* the repository questions and makes the few writes this layer needs,
|
|
6
|
+
* `integrate` brings fetched work into the board — fast-forward, or local work
|
|
7
|
+
* laid over upstream when the two touched different files, or a conflict when
|
|
8
|
+
* they touched the same one — `sync` is the network half and the write
|
|
9
|
+
* transaction, `status` the report, `hosts` the help a person setting this up
|
|
10
|
+
* is shown.
|
|
11
|
+
*
|
|
12
|
+
* The contract: when `git_sync` is configured, every operation that writes the
|
|
13
|
+
* board runs inside `sharedWrite` (operations/shared.ts makes that structural),
|
|
14
|
+
* so a write is either committed and pushed, or undone and refused. Nothing is
|
|
15
|
+
* ever merged inside a document. Front ends call `pullBoard` before they load,
|
|
16
|
+
* which keeps refusals rare; correctness does not depend on it.
|
|
17
|
+
*
|
|
18
|
+
* Sits between `board/` and `operations/`: it may read config and storage, and
|
|
19
|
+
* the operations that set sharing up (`operations/git-sync.ts`) are built on it.
|
|
20
|
+
*/
|
|
21
|
+
export * from './hosts.js';
|
|
22
|
+
export { GIT_TIMEOUT_ENV } from './run.js';
|
|
23
|
+
export * from './status.js';
|
|
24
|
+
export { GIT_OFFLINE_ENV, describeFiles, fetchBoardAsync, isOffline, lastFetchOf, } from './sync.js';
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/gitsync/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,cAAc,YAAY,CAAC;AAE3B,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,cAAc,aAAa,CAAC;AAC5B,OAAO,EACL,eAAe,EACf,aAAa,EACb,eAAe,EACf,SAAS,EACT,WAAW,GAGZ,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { GitSyncConfig } from '../model/types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Bringing what was fetched into the board.
|
|
4
|
+
*
|
|
5
|
+
* Three shapes, and the rule that separates the last two is the whole design:
|
|
6
|
+
*
|
|
7
|
+
* - **behind** — fast-forward. Somebody else wrote; nothing here did.
|
|
8
|
+
* - **diverged, different files** — what this checkout committed is laid on
|
|
9
|
+
* top of upstream as one commit, and both changes stand. Two people
|
|
10
|
+
* editing two stories is not a conflict, and refusing it would make a
|
|
11
|
+
* shared board unusable.
|
|
12
|
+
* - **diverged, the same file** — a conflict, and nothing moves. light-plan
|
|
13
|
+
* cannot know whether your title and their status change belong together,
|
|
14
|
+
* any more than `requireUnchanged` can, so it says so instead of merging
|
|
15
|
+
* lines inside a document. A claim is exactly this case: two people wrote
|
|
16
|
+
* the same `_issue.md`, and the second must be told rather than win.
|
|
17
|
+
*
|
|
18
|
+
* Two files are exempt from "the same file", because neither is anybody's
|
|
19
|
+
* writing: `INDEX.md` is derived and is rendered again from the result, and
|
|
20
|
+
* `state.json` holds counters, which merge by taking the larger of each. Two
|
|
21
|
+
* people creating an issue at the same moment still collide — on the folder
|
|
22
|
+
* both allocated, which *is* a document — but an issue here and a sprint there
|
|
23
|
+
* do not.
|
|
24
|
+
*
|
|
25
|
+
* Works through plumbing (`checkout <commit> -- <paths>`, `update-ref`) rather
|
|
26
|
+
* than `merge` or `rebase`, so it touches exactly the files it names and never
|
|
27
|
+
* leaves conflict markers, a half-finished rebase, or a stash behind in a
|
|
28
|
+
* folder people open in an editor.
|
|
29
|
+
*/
|
|
30
|
+
export type Resolution = 'ours' | 'theirs';
|
|
31
|
+
export type IntegrateResult =
|
|
32
|
+
/** The branch does not exist on the remote yet; the first push creates it. */
|
|
33
|
+
{
|
|
34
|
+
kind: 'no-upstream';
|
|
35
|
+
} | {
|
|
36
|
+
kind: 'current';
|
|
37
|
+
}
|
|
38
|
+
/** Only local commits — nothing to bring in, something to push. */
|
|
39
|
+
| {
|
|
40
|
+
kind: 'ahead';
|
|
41
|
+
ahead: number;
|
|
42
|
+
} | {
|
|
43
|
+
kind: 'fast-forward';
|
|
44
|
+
files: string[];
|
|
45
|
+
}
|
|
46
|
+
/** Local work laid over upstream. */
|
|
47
|
+
| {
|
|
48
|
+
kind: 'rebased';
|
|
49
|
+
files: string[];
|
|
50
|
+
} | {
|
|
51
|
+
kind: 'conflict';
|
|
52
|
+
/**
|
|
53
|
+
* `diverged`: committed work here and upstream changed the same files.
|
|
54
|
+
* `uncommitted`: incoming work would overwrite edits nobody committed.
|
|
55
|
+
*/
|
|
56
|
+
reason: 'diverged' | 'uncommitted';
|
|
57
|
+
paths: string[];
|
|
58
|
+
};
|
|
59
|
+
export interface IntegrateOptions {
|
|
60
|
+
/**
|
|
61
|
+
* Settle a `diverged` conflict instead of reporting it: `ours` keeps this
|
|
62
|
+
* checkout's version of every contested file, `theirs` takes upstream's.
|
|
63
|
+
*/
|
|
64
|
+
resolve?: Resolution;
|
|
65
|
+
/** The board's index rendered from what is on disk now, or null if it cannot be. */
|
|
66
|
+
renderIndex?: () => string | null;
|
|
67
|
+
/** Say what would happen, and change nothing. */
|
|
68
|
+
dryRun?: boolean;
|
|
69
|
+
}
|
|
70
|
+
/** Make the working tree hold `commit`'s version of `files` (absent ones deleted). */
|
|
71
|
+
export declare function materialize(dir: string, commit: string, files: readonly string[]): void;
|
|
72
|
+
export declare function integrate(dir: string, sync: GitSyncConfig, options?: IntegrateOptions): IntegrateResult;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { BoardError } from '../errors.js';
|
|
4
|
+
import { INDEX_FILE, STATE_FILE } from '../storage/paths.js';
|
|
5
|
+
import { changedBetween, commitFiles, dirtyPaths, fileAt, filesAt, headOf, mergeBase, moveHead, countBetween, resolveRef, subjectsBetween, syncIndex, trackingRef, writeWorkingFile, } from './repo.js';
|
|
6
|
+
import { firstLine, git } from './run.js';
|
|
7
|
+
/** Files nobody writes by hand, which therefore never count as contested. */
|
|
8
|
+
const DERIVED = new Set([INDEX_FILE, STATE_FILE]);
|
|
9
|
+
/** Make the working tree hold `commit`'s version of `files` (absent ones deleted). */
|
|
10
|
+
export function materialize(dir, commit, files) {
|
|
11
|
+
if (!files.length)
|
|
12
|
+
return;
|
|
13
|
+
const present = filesAt(dir, commit);
|
|
14
|
+
const there = files.filter((file) => present.has(file));
|
|
15
|
+
const gone = files.filter((file) => !present.has(file));
|
|
16
|
+
if (there.length) {
|
|
17
|
+
const result = git(dir, ['checkout', commit, '--pathspec-from-file=-', '--pathspec-file-nul'], {
|
|
18
|
+
input: there.join('\0'),
|
|
19
|
+
});
|
|
20
|
+
if (!result.ok)
|
|
21
|
+
throw new BoardError('Could not update the board from git', [firstLine(result.stderr)]);
|
|
22
|
+
}
|
|
23
|
+
for (const file of gone) {
|
|
24
|
+
if (existsSync(path.join(dir, file)))
|
|
25
|
+
writeWorkingFile(dir, file, null);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/** `state.json` from both sides, keeping the higher of every counter. */
|
|
29
|
+
function mergedState(dir, ours, theirs) {
|
|
30
|
+
const read = (commit) => {
|
|
31
|
+
const bytes = fileAt(dir, commit, STATE_FILE);
|
|
32
|
+
if (!bytes)
|
|
33
|
+
return {};
|
|
34
|
+
try {
|
|
35
|
+
return JSON.parse(bytes.toString('utf8'));
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
return {};
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
const a = read(ours);
|
|
42
|
+
const b = read(theirs);
|
|
43
|
+
const merged = { ...b, ...a };
|
|
44
|
+
for (const key of new Set([...Object.keys(a), ...Object.keys(b)])) {
|
|
45
|
+
const left = a[key];
|
|
46
|
+
const right = b[key];
|
|
47
|
+
if (typeof left === 'number' && typeof right === 'number')
|
|
48
|
+
merged[key] = Math.max(left, right);
|
|
49
|
+
}
|
|
50
|
+
return Object.keys(merged).length ? Buffer.from(`${JSON.stringify(merged, null, 2)}\n`, 'utf8') : null;
|
|
51
|
+
}
|
|
52
|
+
export function integrate(dir, sync, options = {}) {
|
|
53
|
+
const upstream = resolveRef(dir, trackingRef(sync.remote, sync.branch));
|
|
54
|
+
if (!upstream)
|
|
55
|
+
return { kind: 'no-upstream' };
|
|
56
|
+
const head = headOf(dir);
|
|
57
|
+
if (!head) {
|
|
58
|
+
throw new BoardError('The board repository has no commits yet', ['Run `lpm git setup` to share it.']);
|
|
59
|
+
}
|
|
60
|
+
if (head === upstream)
|
|
61
|
+
return { kind: 'current' };
|
|
62
|
+
const base = mergeBase(dir, head, upstream);
|
|
63
|
+
if (base === upstream)
|
|
64
|
+
return { kind: 'ahead', ahead: countBetween(dir, upstream, head) };
|
|
65
|
+
if (!base) {
|
|
66
|
+
throw new BoardError(`The board and ${sync.remote}/${sync.branch} share no history`, [
|
|
67
|
+
'They are two different boards. Run `lpm git status` for the remote this one points at,',
|
|
68
|
+
'or move this .lpm aside and run `lpm git join` to work on the shared one.',
|
|
69
|
+
]);
|
|
70
|
+
}
|
|
71
|
+
const incoming = changedBetween(dir, base, upstream);
|
|
72
|
+
const ours = base === head ? [] : changedBetween(dir, base, head);
|
|
73
|
+
const touched = new Set([...incoming, ...ours]);
|
|
74
|
+
// Uncommitted edits in the way. The index is derived, so a local copy of it
|
|
75
|
+
// is simply dropped and taken from whichever side wins.
|
|
76
|
+
const dirty = dirtyPaths(dir);
|
|
77
|
+
const blocked = dirty.filter((file) => touched.has(file) && file !== INDEX_FILE);
|
|
78
|
+
if (blocked.length)
|
|
79
|
+
return { kind: 'conflict', reason: 'uncommitted', paths: blocked.sort() };
|
|
80
|
+
if (base === head) {
|
|
81
|
+
if (options.dryRun)
|
|
82
|
+
return { kind: 'fast-forward', files: incoming };
|
|
83
|
+
materialize(dir, upstream, incoming);
|
|
84
|
+
moveHead(dir, upstream, `lpm: fast-forward to ${sync.remote}/${sync.branch}`);
|
|
85
|
+
syncIndex(dir, incoming);
|
|
86
|
+
return { kind: 'fast-forward', files: incoming };
|
|
87
|
+
}
|
|
88
|
+
const incomingSet = new Set(incoming);
|
|
89
|
+
const contested = ours.filter((file) => incomingSet.has(file) && !DERIVED.has(file)).sort();
|
|
90
|
+
if (contested.length && !options.resolve) {
|
|
91
|
+
return { kind: 'conflict', reason: 'diverged', paths: contested };
|
|
92
|
+
}
|
|
93
|
+
if (options.dryRun)
|
|
94
|
+
return { kind: 'rebased', files: [...touched].sort() };
|
|
95
|
+
const subjects = subjectsBetween(dir, base, head);
|
|
96
|
+
const contestedSet = new Set(contested);
|
|
97
|
+
const keep = ours.filter((file) => !DERIVED.has(file) && (options.resolve === 'ours' || !contestedSet.has(file)));
|
|
98
|
+
// Stand on upstream for everything either side changed, then lay our files
|
|
99
|
+
// back over it. The commit `head` stays in the object store, so nothing of
|
|
100
|
+
// ours is lost even if a step below fails.
|
|
101
|
+
materialize(dir, upstream, [...touched]);
|
|
102
|
+
moveHead(dir, upstream, `lpm: re-apply local work on ${sync.remote}/${sync.branch}`);
|
|
103
|
+
syncIndex(dir, [...touched]);
|
|
104
|
+
materialize(dir, head, keep);
|
|
105
|
+
const state = mergedState(dir, head, upstream);
|
|
106
|
+
if (state)
|
|
107
|
+
writeWorkingFile(dir, STATE_FILE, state);
|
|
108
|
+
const index = options.renderIndex?.();
|
|
109
|
+
if (index)
|
|
110
|
+
writeWorkingFile(dir, INDEX_FILE, Buffer.from(index, 'utf8'));
|
|
111
|
+
const message = subjects.length === 1 ? subjects[0] : `lpm: ${subjects.length} board changes\n\n${subjects.map((s) => `- ${s}`).join('\n')}`;
|
|
112
|
+
commitFiles(dir, [...keep, STATE_FILE, INDEX_FILE], message);
|
|
113
|
+
return { kind: 'rebased', files: [...touched].sort() };
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=integrate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integrate.js","sourceRoot":"","sources":["../../../src/core/gitsync/integrate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EACL,cAAc,EACd,WAAW,EACX,UAAU,EACV,MAAM,EACN,OAAO,EACP,MAAM,EACN,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,eAAe,EACf,SAAS,EACT,WAAW,EACX,gBAAgB,GACjB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAgE1C,6EAA6E;AAC7E,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC;AAElD,sFAAsF;AACtF,MAAM,UAAU,WAAW,CAAC,GAAW,EAAE,MAAc,EAAE,KAAwB;IAC/E,IAAI,CAAC,KAAK,CAAC,MAAM;QAAE,OAAO;IAC1B,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IACrC,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;IACxD,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CA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|
|
1
|
+
/**
|
|
2
|
+
* Questions about the `.lpm` repository, and the handful of writes the sync
|
|
3
|
+
* layer makes to it. Every path in and out of here is relative to the
|
|
4
|
+
* repository root (the board folder), with forward slashes — git's spelling.
|
|
5
|
+
*/
|
|
6
|
+
/** True when `dir` is the root of a git repository of its own. */
|
|
7
|
+
export declare function isOwnRepo(dir: string): boolean;
|
|
8
|
+
/** The commit a ref names, or null when it names nothing. */
|
|
9
|
+
export declare function resolveRef(dir: string, ref: string): string | null;
|
|
10
|
+
export declare function headOf(dir: string): string | null;
|
|
11
|
+
/** The remote-tracking ref this board's branch is fetched into. */
|
|
12
|
+
export declare function trackingRef(remote: string, branch: string): string;
|
|
13
|
+
export declare function remoteUrl(dir: string, remote: string): string | null;
|
|
14
|
+
/** The name of the checked-out branch, or null on a detached HEAD. */
|
|
15
|
+
export declare function currentBranch(dir: string): string | null;
|
|
16
|
+
export declare function mergeBase(dir: string, a: string, b: string): string | null;
|
|
17
|
+
/** How many commits `from` has that `to` does not. */
|
|
18
|
+
export declare function countBetween(dir: string, to: string, from: string): number;
|
|
19
|
+
/** Files that differ between two commits. */
|
|
20
|
+
export declare function changedBetween(dir: string, from: string, to: string): string[];
|
|
21
|
+
/**
|
|
22
|
+
* Paths with uncommitted changes, untracked files included and ignored ones not.
|
|
23
|
+
* `--no-optional-locks` because this runs on every write, and a status that
|
|
24
|
+
* takes the index lock to refresh stat data collides with whatever git command
|
|
25
|
+
* the person is running in another window.
|
|
26
|
+
*/
|
|
27
|
+
export declare function dirtyPaths(dir: string): string[];
|
|
28
|
+
/** Every path the commit holds. */
|
|
29
|
+
export declare function filesAt(dir: string, commit: string): Set<string>;
|
|
30
|
+
/** A file as one commit holds it, or null when it does not. */
|
|
31
|
+
export declare function fileAt(dir: string, commit: string, file: string): Buffer | null;
|
|
32
|
+
/** Subject lines of the commits in `from..to`, oldest first. */
|
|
33
|
+
export declare function subjectsBetween(dir: string, from: string, to: string): string[];
|
|
34
|
+
/**
|
|
35
|
+
* The bytes of a working-tree file — the before-and-after picture a write is
|
|
36
|
+
* measured by. `null` means "not there".
|
|
37
|
+
*/
|
|
38
|
+
export interface FileState {
|
|
39
|
+
hash: string | null;
|
|
40
|
+
/** The content itself, kept so an undone write can put it back. */
|
|
41
|
+
bytes: Buffer | null;
|
|
42
|
+
}
|
|
43
|
+
export declare function fileState(dir: string, file: string): FileState;
|
|
44
|
+
/** Put a working-tree file back to `bytes`, or delete it when `bytes` is null. */
|
|
45
|
+
export declare function writeWorkingFile(dir: string, file: string, bytes: Buffer | null): void;
|
|
46
|
+
/**
|
|
47
|
+
* Commit exactly `files` — their current working-tree state, deletions
|
|
48
|
+
* included — on top of HEAD, and nothing else.
|
|
49
|
+
*
|
|
50
|
+
* Built in a private index rather than the repository's own, so whatever the
|
|
51
|
+
* person had staged, or left dirty in another file (a view the web app keeps
|
|
52
|
+
* saving, a hand edit in progress), is neither swept into the commit nor
|
|
53
|
+
* disturbed by it. The real index is then brought level for these paths only.
|
|
54
|
+
*
|
|
55
|
+
* Returns the new commit, or null when the files already match HEAD.
|
|
56
|
+
*/
|
|
57
|
+
export declare function commitFiles(dir: string, files: readonly string[], message: string): string | null;
|
|
58
|
+
/** Bring the repository's own index level with HEAD for these paths only. */
|
|
59
|
+
export declare function syncIndex(dir: string, files: readonly string[]): void;
|
|
60
|
+
/** Move the branch to `commit` without touching the working tree. */
|
|
61
|
+
export declare function moveHead(dir: string, commit: string, message: string): void;
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { existsSync, mkdirSync, readFileSync, rmSync, statSync, writeFileSync } from 'node:fs';
|
|
3
|
+
import os from 'node:os';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import { BoardError } from '../errors.js';
|
|
6
|
+
import { firstLine, git, gitBytes } from './run.js';
|
|
7
|
+
/**
|
|
8
|
+
* Questions about the `.lpm` repository, and the handful of writes the sync
|
|
9
|
+
* layer makes to it. Every path in and out of here is relative to the
|
|
10
|
+
* repository root (the board folder), with forward slashes — git's spelling.
|
|
11
|
+
*/
|
|
12
|
+
/** True when `dir` is the root of a git repository of its own. */
|
|
13
|
+
export function isOwnRepo(dir) {
|
|
14
|
+
// `.git` beside the board, not merely "inside some work tree": a `.lpm` with
|
|
15
|
+
// no repository of its own sits inside the project's, and every command here
|
|
16
|
+
// would otherwise run against the code.
|
|
17
|
+
return existsSync(path.join(dir, '.git'));
|
|
18
|
+
}
|
|
19
|
+
/** The commit a ref names, or null when it names nothing. */
|
|
20
|
+
export function resolveRef(dir, ref) {
|
|
21
|
+
const result = git(dir, ['rev-parse', '--verify', '--quiet', `${ref}^{commit}`]);
|
|
22
|
+
return result.ok ? result.stdout.trim() || null : null;
|
|
23
|
+
}
|
|
24
|
+
export function headOf(dir) {
|
|
25
|
+
return resolveRef(dir, 'HEAD');
|
|
26
|
+
}
|
|
27
|
+
/** The remote-tracking ref this board's branch is fetched into. */
|
|
28
|
+
export function trackingRef(remote, branch) {
|
|
29
|
+
return `refs/remotes/${remote}/${branch}`;
|
|
30
|
+
}
|
|
31
|
+
export function remoteUrl(dir, remote) {
|
|
32
|
+
const result = git(dir, ['remote', 'get-url', remote]);
|
|
33
|
+
return result.ok ? result.stdout.trim() || null : null;
|
|
34
|
+
}
|
|
35
|
+
/** The name of the checked-out branch, or null on a detached HEAD. */
|
|
36
|
+
export function currentBranch(dir) {
|
|
37
|
+
const result = git(dir, ['symbolic-ref', '--quiet', '--short', 'HEAD']);
|
|
38
|
+
return result.ok ? result.stdout.trim() || null : null;
|
|
39
|
+
}
|
|
40
|
+
export function mergeBase(dir, a, b) {
|
|
41
|
+
const result = git(dir, ['merge-base', a, b]);
|
|
42
|
+
return result.ok ? result.stdout.trim() || null : null;
|
|
43
|
+
}
|
|
44
|
+
/** How many commits `from` has that `to` does not. */
|
|
45
|
+
export function countBetween(dir, to, from) {
|
|
46
|
+
const result = git(dir, ['rev-list', '--count', `${to}..${from}`]);
|
|
47
|
+
return result.ok ? Number(result.stdout.trim()) || 0 : 0;
|
|
48
|
+
}
|
|
49
|
+
function splitZ(text) {
|
|
50
|
+
return text.split('\0').filter(Boolean);
|
|
51
|
+
}
|
|
52
|
+
/** Files that differ between two commits. */
|
|
53
|
+
export function changedBetween(dir, from, to) {
|
|
54
|
+
const result = git(dir, ['diff', '--name-only', '-z', '--no-renames', from, to]);
|
|
55
|
+
if (!result.ok)
|
|
56
|
+
throw new BoardError('Could not compare two versions of the board', [firstLine(result.stderr)]);
|
|
57
|
+
return splitZ(result.stdout);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Paths with uncommitted changes, untracked files included and ignored ones not.
|
|
61
|
+
* `--no-optional-locks` because this runs on every write, and a status that
|
|
62
|
+
* takes the index lock to refresh stat data collides with whatever git command
|
|
63
|
+
* the person is running in another window.
|
|
64
|
+
*/
|
|
65
|
+
export function dirtyPaths(dir) {
|
|
66
|
+
const result = git(dir, [
|
|
67
|
+
'--no-optional-locks',
|
|
68
|
+
'status',
|
|
69
|
+
'--porcelain=v1',
|
|
70
|
+
'-z',
|
|
71
|
+
'--untracked-files=all',
|
|
72
|
+
'--no-renames',
|
|
73
|
+
]);
|
|
74
|
+
if (!result.ok)
|
|
75
|
+
throw new BoardError('Could not read the state of the board repository', [firstLine(result.stderr)]);
|
|
76
|
+
return splitZ(result.stdout).map((entry) => entry.slice(3));
|
|
77
|
+
}
|
|
78
|
+
/** Every path the commit holds. */
|
|
79
|
+
export function filesAt(dir, commit) {
|
|
80
|
+
const result = git(dir, ['ls-tree', '-r', '-z', '--name-only', commit]);
|
|
81
|
+
return new Set(result.ok ? splitZ(result.stdout) : []);
|
|
82
|
+
}
|
|
83
|
+
/** A file as one commit holds it, or null when it does not. */
|
|
84
|
+
export function fileAt(dir, commit, file) {
|
|
85
|
+
return gitBytes(dir, ['cat-file', 'blob', `${commit}:${file}`]);
|
|
86
|
+
}
|
|
87
|
+
/** Subject lines of the commits in `from..to`, oldest first. */
|
|
88
|
+
export function subjectsBetween(dir, from, to) {
|
|
89
|
+
const result = git(dir, ['log', '--reverse', '--format=%s', `${from}..${to}`]);
|
|
90
|
+
return result.ok ? result.stdout.split('\n').map((line) => line.trim()).filter(Boolean) : [];
|
|
91
|
+
}
|
|
92
|
+
/** Files above this size are compared by hash only and never restored from memory. */
|
|
93
|
+
const KEEP_BYTES_LIMIT = 4 * 1024 * 1024;
|
|
94
|
+
export function fileState(dir, file) {
|
|
95
|
+
const full = path.join(dir, file);
|
|
96
|
+
try {
|
|
97
|
+
if (!statSync(full).isFile())
|
|
98
|
+
return { hash: null, bytes: null };
|
|
99
|
+
const bytes = readFileSync(full);
|
|
100
|
+
const hash = createHash('sha1').update(bytes).digest('hex');
|
|
101
|
+
return { hash, bytes: bytes.length <= KEEP_BYTES_LIMIT ? bytes : null };
|
|
102
|
+
}
|
|
103
|
+
catch {
|
|
104
|
+
return { hash: null, bytes: null };
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
/** Put a working-tree file back to `bytes`, or delete it when `bytes` is null. */
|
|
108
|
+
export function writeWorkingFile(dir, file, bytes) {
|
|
109
|
+
const full = path.join(dir, file);
|
|
110
|
+
if (bytes === null) {
|
|
111
|
+
rmSync(full, { force: true });
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
mkdirSync(path.dirname(full), { recursive: true });
|
|
115
|
+
writeFileSync(full, bytes);
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Who a commit is signed by when git has not been told. A board written from a
|
|
119
|
+
* web page has nobody at a terminal to run `git config user.name`, and failing
|
|
120
|
+
* every write over a missing name would be a strange way to find out.
|
|
121
|
+
*/
|
|
122
|
+
function identityEnv(dir) {
|
|
123
|
+
const name = git(dir, ['config', 'user.name']).stdout.trim();
|
|
124
|
+
const email = git(dir, ['config', 'user.email']).stdout.trim();
|
|
125
|
+
if (name && email)
|
|
126
|
+
return {};
|
|
127
|
+
let user = 'light-plan';
|
|
128
|
+
try {
|
|
129
|
+
user = os.userInfo().username || user;
|
|
130
|
+
}
|
|
131
|
+
catch {
|
|
132
|
+
// Keep the fallback.
|
|
133
|
+
}
|
|
134
|
+
const fallbackName = name || user;
|
|
135
|
+
const fallbackEmail = email || `${user}@${os.hostname() || 'localhost'}`;
|
|
136
|
+
return {
|
|
137
|
+
GIT_AUTHOR_NAME: fallbackName,
|
|
138
|
+
GIT_AUTHOR_EMAIL: fallbackEmail,
|
|
139
|
+
GIT_COMMITTER_NAME: fallbackName,
|
|
140
|
+
GIT_COMMITTER_EMAIL: fallbackEmail,
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Commit exactly `files` — their current working-tree state, deletions
|
|
145
|
+
* included — on top of HEAD, and nothing else.
|
|
146
|
+
*
|
|
147
|
+
* Built in a private index rather than the repository's own, so whatever the
|
|
148
|
+
* person had staged, or left dirty in another file (a view the web app keeps
|
|
149
|
+
* saving, a hand edit in progress), is neither swept into the commit nor
|
|
150
|
+
* disturbed by it. The real index is then brought level for these paths only.
|
|
151
|
+
*
|
|
152
|
+
* Returns the new commit, or null when the files already match HEAD.
|
|
153
|
+
*/
|
|
154
|
+
export function commitFiles(dir, files, message) {
|
|
155
|
+
if (!files.length)
|
|
156
|
+
return null;
|
|
157
|
+
const head = headOf(dir);
|
|
158
|
+
const gitDir = path.resolve(dir, git(dir, ['rev-parse', '--git-dir']).stdout.trim() || '.git');
|
|
159
|
+
const indexFile = path.join(gitDir, `lpm-index-${process.pid}-${Date.now()}`);
|
|
160
|
+
const env = { GIT_INDEX_FILE: indexFile, ...identityEnv(dir) };
|
|
161
|
+
try {
|
|
162
|
+
const read = git(dir, head ? ['read-tree', head] : ['read-tree', '--empty'], { env });
|
|
163
|
+
if (!read.ok)
|
|
164
|
+
throw new BoardError('Could not prepare a commit of the board', [firstLine(read.stderr)]);
|
|
165
|
+
// A path that is neither on disk nor in HEAD (created and deleted again
|
|
166
|
+
// within one write) is not a change git can name; leave it out rather than
|
|
167
|
+
// fail the whole commit on it.
|
|
168
|
+
const tracked = head ? filesAt(dir, head) : new Set();
|
|
169
|
+
const wanted = files.filter((file) => tracked.has(file) || existsSync(path.join(dir, file)));
|
|
170
|
+
if (!wanted.length)
|
|
171
|
+
return null;
|
|
172
|
+
const add = git(dir, ['add', '-A', '--pathspec-from-file=-', '--pathspec-file-nul'], {
|
|
173
|
+
env,
|
|
174
|
+
input: wanted.join('\0'),
|
|
175
|
+
});
|
|
176
|
+
if (!add.ok)
|
|
177
|
+
throw new BoardError('Could not stage the board change', [firstLine(add.stderr)]);
|
|
178
|
+
const tree = git(dir, ['write-tree'], { env }).stdout.trim();
|
|
179
|
+
if (!tree)
|
|
180
|
+
throw new BoardError('Could not write the board change to git');
|
|
181
|
+
if (head && git(dir, ['rev-parse', `${head}^{tree}`]).stdout.trim() === tree)
|
|
182
|
+
return null;
|
|
183
|
+
const commit = git(dir, ['commit-tree', tree, ...(head ? ['-p', head] : []), '-m', message], { env });
|
|
184
|
+
if (!commit.ok)
|
|
185
|
+
throw new BoardError('Could not commit the board change', [firstLine(commit.stderr)]);
|
|
186
|
+
const sha = commit.stdout.trim();
|
|
187
|
+
// Compare-and-swap: if something else moved HEAD while this was being
|
|
188
|
+
// built, refuse rather than write over it.
|
|
189
|
+
const update = git(dir, ['update-ref', '-m', message, 'HEAD', sha, ...(head ? [head] : [])]);
|
|
190
|
+
if (!update.ok)
|
|
191
|
+
throw new BoardError('The board repository moved while a change was being committed', [firstLine(update.stderr)]);
|
|
192
|
+
}
|
|
193
|
+
finally {
|
|
194
|
+
rmSync(indexFile, { force: true });
|
|
195
|
+
}
|
|
196
|
+
syncIndex(dir, files);
|
|
197
|
+
return headOf(dir);
|
|
198
|
+
}
|
|
199
|
+
/** Bring the repository's own index level with HEAD for these paths only. */
|
|
200
|
+
export function syncIndex(dir, files) {
|
|
201
|
+
if (!files.length || !headOf(dir))
|
|
202
|
+
return;
|
|
203
|
+
git(dir, ['reset', '-q', 'HEAD', '--pathspec-from-file=-', '--pathspec-file-nul'], {
|
|
204
|
+
input: files.join('\0'),
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
/** Move the branch to `commit` without touching the working tree. */
|
|
208
|
+
export function moveHead(dir, commit, message) {
|
|
209
|
+
const result = git(dir, ['update-ref', '-m', message, 'HEAD', commit]);
|
|
210
|
+
if (!result.ok)
|
|
211
|
+
throw new BoardError('Could not move the board branch', [firstLine(result.stderr)]);
|
|
212
|
+
}
|
|
213
|
+
//# sourceMappingURL=repo.js.map
|