@kynetic-ai/spec 0.1.2 → 0.3.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/README.md +250 -17
- package/dist/acp/client.d.ts +18 -4
- package/dist/acp/client.d.ts.map +1 -1
- package/dist/acp/client.js +44 -26
- package/dist/acp/client.js.map +1 -1
- package/dist/acp/framing.d.ts +2 -2
- package/dist/acp/framing.d.ts.map +1 -1
- package/dist/acp/framing.js +37 -29
- package/dist/acp/framing.js.map +1 -1
- package/dist/acp/index.d.ts +6 -7
- package/dist/acp/index.d.ts.map +1 -1
- package/dist/acp/index.js +3 -3
- package/dist/acp/index.js.map +1 -1
- package/dist/acp/types.d.ts +5 -5
- package/dist/acp/types.d.ts.map +1 -1
- package/dist/acp/types.js +18 -18
- package/dist/acp/types.js.map +1 -1
- package/dist/agents/adapters.d.ts.map +1 -1
- package/dist/agents/adapters.js +24 -13
- package/dist/agents/adapters.js.map +1 -1
- package/dist/agents/index.d.ts +2 -2
- package/dist/agents/index.js +2 -2
- package/dist/agents/spawner.d.ts +4 -4
- package/dist/agents/spawner.d.ts.map +1 -1
- package/dist/agents/spawner.js +6 -6
- package/dist/agents/spawner.js.map +1 -1
- package/dist/cli/batch-context.d.ts +43 -0
- package/dist/cli/batch-context.d.ts.map +1 -0
- package/dist/cli/batch-context.js +93 -0
- package/dist/cli/batch-context.js.map +1 -0
- package/dist/cli/batch-exec.d.ts +116 -0
- package/dist/cli/batch-exec.d.ts.map +1 -0
- package/dist/cli/batch-exec.js +694 -0
- package/dist/cli/batch-exec.js.map +1 -0
- package/dist/cli/batch.d.ts +4 -2
- package/dist/cli/batch.d.ts.map +1 -1
- package/dist/cli/batch.js +15 -14
- package/dist/cli/batch.js.map +1 -1
- package/dist/cli/command-annotations.d.ts +23 -0
- package/dist/cli/command-annotations.d.ts.map +1 -0
- package/dist/cli/command-annotations.js +27 -0
- package/dist/cli/command-annotations.js.map +1 -0
- package/dist/cli/commands/agents.d.ts +46 -0
- package/dist/cli/commands/agents.d.ts.map +1 -0
- package/dist/cli/commands/agents.js +377 -0
- package/dist/cli/commands/agents.js.map +1 -0
- package/dist/cli/commands/batch.d.ts +20 -0
- package/dist/cli/commands/batch.d.ts.map +1 -0
- package/dist/cli/commands/batch.js +214 -0
- package/dist/cli/commands/batch.js.map +1 -0
- package/dist/cli/commands/clone-for-testing.d.ts +1 -1
- package/dist/cli/commands/clone-for-testing.d.ts.map +1 -1
- package/dist/cli/commands/clone-for-testing.js +37 -47
- package/dist/cli/commands/clone-for-testing.js.map +1 -1
- package/dist/cli/commands/derive.d.ts +1 -1
- package/dist/cli/commands/derive.d.ts.map +1 -1
- package/dist/cli/commands/derive.js +140 -88
- package/dist/cli/commands/derive.js.map +1 -1
- package/dist/cli/commands/doctor.d.ts +11 -0
- package/dist/cli/commands/doctor.d.ts.map +1 -0
- package/dist/cli/commands/doctor.js +152 -0
- package/dist/cli/commands/doctor.js.map +1 -0
- package/dist/cli/commands/export.d.ts +12 -0
- package/dist/cli/commands/export.d.ts.map +1 -0
- package/dist/cli/commands/export.js +134 -0
- package/dist/cli/commands/export.js.map +1 -0
- package/dist/cli/commands/help.d.ts +1 -1
- package/dist/cli/commands/help.d.ts.map +1 -1
- package/dist/cli/commands/help.js +163 -37
- package/dist/cli/commands/help.js.map +1 -1
- package/dist/cli/commands/inbox.d.ts +1 -1
- package/dist/cli/commands/inbox.d.ts.map +1 -1
- package/dist/cli/commands/inbox.js +178 -56
- package/dist/cli/commands/inbox.js.map +1 -1
- package/dist/cli/commands/index.d.ts +31 -19
- package/dist/cli/commands/index.d.ts.map +1 -1
- package/dist/cli/commands/index.js +31 -19
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/init.d.ts +5 -1
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +108 -57
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/item.d.ts +1 -1
- package/dist/cli/commands/item.d.ts.map +1 -1
- package/dist/cli/commands/item.js +557 -274
- package/dist/cli/commands/item.js.map +1 -1
- package/dist/cli/commands/link.d.ts +1 -1
- package/dist/cli/commands/link.d.ts.map +1 -1
- package/dist/cli/commands/link.js +55 -46
- package/dist/cli/commands/link.js.map +1 -1
- package/dist/cli/commands/log.d.ts +1 -1
- package/dist/cli/commands/log.d.ts.map +1 -1
- package/dist/cli/commands/log.js +57 -51
- package/dist/cli/commands/log.js.map +1 -1
- package/dist/cli/commands/merge-driver.d.ts +19 -0
- package/dist/cli/commands/merge-driver.d.ts.map +1 -0
- package/dist/cli/commands/merge-driver.js +398 -0
- package/dist/cli/commands/merge-driver.js.map +1 -0
- package/dist/cli/commands/meta.d.ts +1 -1
- package/dist/cli/commands/meta.d.ts.map +1 -1
- package/dist/cli/commands/meta.js +533 -399
- package/dist/cli/commands/meta.js.map +1 -1
- package/dist/cli/commands/module.d.ts +1 -1
- package/dist/cli/commands/module.d.ts.map +1 -1
- package/dist/cli/commands/module.js +30 -25
- package/dist/cli/commands/module.js.map +1 -1
- package/dist/cli/commands/plan-import.d.ts +11 -0
- package/dist/cli/commands/plan-import.d.ts.map +1 -0
- package/dist/cli/commands/plan-import.js +516 -0
- package/dist/cli/commands/plan-import.js.map +1 -0
- package/dist/cli/commands/plan.d.ts +10 -0
- package/dist/cli/commands/plan.d.ts.map +1 -0
- package/dist/cli/commands/plan.js +421 -0
- package/dist/cli/commands/plan.js.map +1 -0
- package/dist/cli/commands/ralph.d.ts +1 -1
- package/dist/cli/commands/ralph.d.ts.map +1 -1
- package/dist/cli/commands/ralph.js +1097 -169
- package/dist/cli/commands/ralph.js.map +1 -1
- package/dist/cli/commands/refs.d.ts +13 -0
- package/dist/cli/commands/refs.d.ts.map +1 -0
- package/dist/cli/commands/refs.js +283 -0
- package/dist/cli/commands/refs.js.map +1 -0
- package/dist/cli/commands/search.d.ts +1 -1
- package/dist/cli/commands/search.d.ts.map +1 -1
- package/dist/cli/commands/search.js +199 -37
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/serve.d.ts +10 -0
- package/dist/cli/commands/serve.d.ts.map +1 -0
- package/dist/cli/commands/serve.js +491 -0
- package/dist/cli/commands/serve.js.map +1 -0
- package/dist/cli/commands/session.d.ts +25 -6
- package/dist/cli/commands/session.d.ts.map +1 -1
- package/dist/cli/commands/session.js +811 -127
- package/dist/cli/commands/session.js.map +1 -1
- package/dist/cli/commands/setup-seeding.d.ts +81 -0
- package/dist/cli/commands/setup-seeding.d.ts.map +1 -0
- package/dist/cli/commands/setup-seeding.js +292 -0
- package/dist/cli/commands/setup-seeding.js.map +1 -0
- package/dist/cli/commands/setup.d.ts +77 -3
- package/dist/cli/commands/setup.d.ts.map +1 -1
- package/dist/cli/commands/setup.js +1233 -274
- package/dist/cli/commands/setup.js.map +1 -1
- package/dist/cli/commands/shadow.d.ts +1 -1
- package/dist/cli/commands/shadow.d.ts.map +1 -1
- package/dist/cli/commands/shadow.js +70 -50
- package/dist/cli/commands/shadow.js.map +1 -1
- package/dist/cli/commands/skill-crud.d.ts +58 -0
- package/dist/cli/commands/skill-crud.d.ts.map +1 -0
- package/dist/cli/commands/skill-crud.js +753 -0
- package/dist/cli/commands/skill-crud.js.map +1 -0
- package/dist/cli/commands/skill-diff.d.ts +27 -0
- package/dist/cli/commands/skill-diff.d.ts.map +1 -0
- package/dist/cli/commands/skill-diff.js +840 -0
- package/dist/cli/commands/skill-diff.js.map +1 -0
- package/dist/cli/commands/skill-install.d.ts +53 -0
- package/dist/cli/commands/skill-install.d.ts.map +1 -0
- package/dist/cli/commands/skill-install.js +452 -0
- package/dist/cli/commands/skill-install.js.map +1 -0
- package/dist/cli/commands/skill.d.ts +20 -0
- package/dist/cli/commands/skill.d.ts.map +1 -0
- package/dist/cli/commands/skill.js +36 -0
- package/dist/cli/commands/skill.js.map +1 -0
- package/dist/cli/commands/task.d.ts +1 -1
- package/dist/cli/commands/task.d.ts.map +1 -1
- package/dist/cli/commands/task.js +569 -346
- package/dist/cli/commands/task.js.map +1 -1
- package/dist/cli/commands/tasks.d.ts +26 -1
- package/dist/cli/commands/tasks.d.ts.map +1 -1
- package/dist/cli/commands/tasks.js +227 -122
- package/dist/cli/commands/tasks.js.map +1 -1
- package/dist/cli/commands/trait.d.ts +1 -1
- package/dist/cli/commands/trait.d.ts.map +1 -1
- package/dist/cli/commands/trait.js +166 -101
- package/dist/cli/commands/trait.js.map +1 -1
- package/dist/cli/commands/triage.d.ts +7 -0
- package/dist/cli/commands/triage.d.ts.map +1 -0
- package/dist/cli/commands/triage.js +569 -0
- package/dist/cli/commands/triage.js.map +1 -0
- package/dist/cli/commands/util.d.ts +7 -0
- package/dist/cli/commands/util.d.ts.map +1 -0
- package/dist/cli/commands/util.js +30 -0
- package/dist/cli/commands/util.js.map +1 -0
- package/dist/cli/commands/validate.d.ts +1 -1
- package/dist/cli/commands/validate.d.ts.map +1 -1
- package/dist/cli/commands/validate.js +264 -83
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/commands/workflow.d.ts +16 -0
- package/dist/cli/commands/workflow.d.ts.map +1 -0
- package/dist/cli/commands/workflow.js +851 -0
- package/dist/cli/commands/workflow.js.map +1 -0
- package/dist/cli/exit-codes.d.ts +7 -0
- package/dist/cli/exit-codes.d.ts.map +1 -1
- package/dist/cli/exit-codes.js +26 -18
- package/dist/cli/exit-codes.js.map +1 -1
- package/dist/cli/help/content.d.ts.map +1 -1
- package/dist/cli/help/content.js +86 -71
- package/dist/cli/help/content.js.map +1 -1
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +131 -19
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/introspection.d.ts +6 -2
- package/dist/cli/introspection.d.ts.map +1 -1
- package/dist/cli/introspection.js +11 -8
- package/dist/cli/introspection.js.map +1 -1
- package/dist/cli/output.d.ts +64 -4
- package/dist/cli/output.d.ts.map +1 -1
- package/dist/cli/output.js +235 -85
- package/dist/cli/output.js.map +1 -1
- package/dist/cli/parse-utils.d.ts +21 -0
- package/dist/cli/parse-utils.d.ts.map +1 -0
- package/dist/cli/parse-utils.js +32 -0
- package/dist/cli/parse-utils.js.map +1 -0
- package/dist/cli/pid-utils.d.ts +72 -0
- package/dist/cli/pid-utils.d.ts.map +1 -0
- package/dist/cli/pid-utils.js +174 -0
- package/dist/cli/pid-utils.js.map +1 -0
- package/dist/cli/suggest.d.ts.map +1 -1
- package/dist/cli/suggest.js +1 -2
- package/dist/cli/suggest.js.map +1 -1
- package/dist/cli/validators.d.ts +43 -0
- package/dist/cli/validators.d.ts.map +1 -0
- package/dist/cli/validators.js +84 -0
- package/dist/cli/validators.js.map +1 -0
- package/dist/daemon/index.ts +52 -0
- package/dist/daemon/middleware/project-context.ts +126 -0
- package/dist/daemon/pid.ts +179 -0
- package/dist/daemon/project-context.ts +343 -0
- package/dist/daemon/routes/inbox.ts +164 -0
- package/dist/daemon/routes/items.ts +322 -0
- package/dist/daemon/routes/meta.ts +118 -0
- package/dist/daemon/routes/projects.ts +162 -0
- package/dist/daemon/routes/tasks.ts +327 -0
- package/dist/daemon/routes/triage.ts +468 -0
- package/dist/daemon/routes/validation.ts +248 -0
- package/dist/daemon/server.ts +408 -0
- package/dist/daemon/watcher.ts +195 -0
- package/dist/daemon/websocket/handler.ts +138 -0
- package/dist/daemon/websocket/heartbeat.ts +71 -0
- package/dist/daemon/websocket/pubsub.ts +125 -0
- package/dist/daemon/websocket/types.ts +66 -0
- package/dist/export/html.d.ts +19 -0
- package/dist/export/html.d.ts.map +1 -0
- package/dist/export/html.js +239 -0
- package/dist/export/html.js.map +1 -0
- package/dist/export/index.d.ts +10 -0
- package/dist/export/index.d.ts.map +1 -0
- package/dist/export/index.js +10 -0
- package/dist/export/index.js.map +1 -0
- package/dist/export/json.d.ts +24 -0
- package/dist/export/json.d.ts.map +1 -0
- package/dist/export/json.js +198 -0
- package/dist/export/json.js.map +1 -0
- package/dist/export/triage.d.ts +51 -0
- package/dist/export/triage.d.ts.map +1 -0
- package/dist/export/triage.js +83 -0
- package/dist/export/triage.js.map +1 -0
- package/dist/export/types.d.ts +122 -0
- package/dist/export/types.d.ts.map +1 -0
- package/dist/export/types.js +9 -0
- package/dist/export/types.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/lib/claude-plugin-registry.d.ts +66 -0
- package/dist/lib/claude-plugin-registry.d.ts.map +1 -0
- package/dist/lib/claude-plugin-registry.js +318 -0
- package/dist/lib/claude-plugin-registry.js.map +1 -0
- package/dist/merge/arrays.d.ts +87 -0
- package/dist/merge/arrays.d.ts.map +1 -0
- package/dist/merge/arrays.js +164 -0
- package/dist/merge/arrays.js.map +1 -0
- package/dist/merge/file-type.d.ts +32 -0
- package/dist/merge/file-type.d.ts.map +1 -0
- package/dist/merge/file-type.js +70 -0
- package/dist/merge/file-type.js.map +1 -0
- package/dist/merge/index.d.ts +14 -0
- package/dist/merge/index.d.ts.map +1 -0
- package/dist/merge/index.js +11 -0
- package/dist/merge/index.js.map +1 -0
- package/dist/merge/objects.d.ts +46 -0
- package/dist/merge/objects.d.ts.map +1 -0
- package/dist/merge/objects.js +193 -0
- package/dist/merge/objects.js.map +1 -0
- package/dist/merge/parse.d.ts +23 -0
- package/dist/merge/parse.d.ts.map +1 -0
- package/dist/merge/parse.js +78 -0
- package/dist/merge/parse.js.map +1 -0
- package/dist/merge/resolve.d.ts +66 -0
- package/dist/merge/resolve.d.ts.map +1 -0
- package/dist/merge/resolve.js +189 -0
- package/dist/merge/resolve.js.map +1 -0
- package/dist/merge/types.d.ts +82 -0
- package/dist/merge/types.d.ts.map +1 -0
- package/dist/merge/types.js +8 -0
- package/dist/merge/types.js.map +1 -0
- package/dist/parser/agent-data-sections.d.ts +53 -0
- package/dist/parser/agent-data-sections.d.ts.map +1 -0
- package/dist/parser/agent-data-sections.js +118 -0
- package/dist/parser/agent-data-sections.js.map +1 -0
- package/dist/parser/alignment.d.ts +4 -4
- package/dist/parser/alignment.d.ts.map +1 -1
- package/dist/parser/alignment.js +27 -22
- package/dist/parser/alignment.js.map +1 -1
- package/dist/parser/assess.d.ts +5 -5
- package/dist/parser/assess.d.ts.map +1 -1
- package/dist/parser/assess.js +36 -32
- package/dist/parser/assess.js.map +1 -1
- package/dist/parser/config.d.ts +351 -0
- package/dist/parser/config.d.ts.map +1 -0
- package/dist/parser/config.js +326 -0
- package/dist/parser/config.js.map +1 -0
- package/dist/parser/convention-validation.d.ts +1 -1
- package/dist/parser/convention-validation.d.ts.map +1 -1
- package/dist/parser/convention-validation.js +21 -16
- package/dist/parser/convention-validation.js.map +1 -1
- package/dist/parser/coverage-cache.d.ts +49 -0
- package/dist/parser/coverage-cache.d.ts.map +1 -0
- package/dist/parser/coverage-cache.js +123 -0
- package/dist/parser/coverage-cache.js.map +1 -0
- package/dist/parser/daemon-status.d.ts +37 -0
- package/dist/parser/daemon-status.d.ts.map +1 -0
- package/dist/parser/daemon-status.js +67 -0
- package/dist/parser/daemon-status.js.map +1 -0
- package/dist/parser/doctor.d.ts +107 -0
- package/dist/parser/doctor.d.ts.map +1 -0
- package/dist/parser/doctor.js +366 -0
- package/dist/parser/doctor.js.map +1 -0
- package/dist/parser/fix.d.ts +1 -1
- package/dist/parser/fix.d.ts.map +1 -1
- package/dist/parser/fix.js +31 -27
- package/dist/parser/fix.js.map +1 -1
- package/dist/parser/index.d.ts +16 -11
- package/dist/parser/index.d.ts.map +1 -1
- package/dist/parser/index.js +16 -11
- package/dist/parser/index.js.map +1 -1
- package/dist/parser/items.d.ts +8 -2
- package/dist/parser/items.d.ts.map +1 -1
- package/dist/parser/items.js +71 -35
- package/dist/parser/items.js.map +1 -1
- package/dist/parser/meta.d.ts +167 -9
- package/dist/parser/meta.d.ts.map +1 -1
- package/dist/parser/meta.js +379 -46
- package/dist/parser/meta.js.map +1 -1
- package/dist/parser/plan-document.d.ts +189 -0
- package/dist/parser/plan-document.d.ts.map +1 -0
- package/dist/parser/plan-document.js +340 -0
- package/dist/parser/plan-document.js.map +1 -0
- package/dist/parser/plans.d.ts +59 -0
- package/dist/parser/plans.d.ts.map +1 -0
- package/dist/parser/plans.js +239 -0
- package/dist/parser/plans.js.map +1 -0
- package/dist/parser/refs.d.ts +22 -9
- package/dist/parser/refs.d.ts.map +1 -1
- package/dist/parser/refs.js +102 -50
- package/dist/parser/refs.js.map +1 -1
- package/dist/parser/setup-status.d.ts +71 -0
- package/dist/parser/setup-status.d.ts.map +1 -0
- package/dist/parser/setup-status.js +269 -0
- package/dist/parser/setup-status.js.map +1 -0
- package/dist/parser/shadow.d.ts +150 -19
- package/dist/parser/shadow.d.ts.map +1 -1
- package/dist/parser/shadow.js +548 -187
- package/dist/parser/shadow.js.map +1 -1
- package/dist/parser/skill-render.d.ts +317 -0
- package/dist/parser/skill-render.d.ts.map +1 -0
- package/dist/parser/skill-render.js +943 -0
- package/dist/parser/skill-render.js.map +1 -0
- package/dist/parser/traits.d.ts +3 -3
- package/dist/parser/traits.d.ts.map +1 -1
- package/dist/parser/traits.js +2 -2
- package/dist/parser/traits.js.map +1 -1
- package/dist/parser/validate-skills.d.ts +32 -0
- package/dist/parser/validate-skills.d.ts.map +1 -0
- package/dist/parser/validate-skills.js +202 -0
- package/dist/parser/validate-skills.js.map +1 -0
- package/dist/parser/validate.d.ts +45 -3
- package/dist/parser/validate.d.ts.map +1 -1
- package/dist/parser/validate.js +622 -105
- package/dist/parser/validate.js.map +1 -1
- package/dist/parser/yaml.d.ts +83 -19
- package/dist/parser/yaml.d.ts.map +1 -1
- package/dist/parser/yaml.js +478 -173
- package/dist/parser/yaml.js.map +1 -1
- package/dist/ralph/cli-renderer.d.ts +8 -1
- package/dist/ralph/cli-renderer.d.ts.map +1 -1
- package/dist/ralph/cli-renderer.js +105 -34
- package/dist/ralph/cli-renderer.js.map +1 -1
- package/dist/ralph/events.d.ts +10 -10
- package/dist/ralph/events.d.ts.map +1 -1
- package/dist/ralph/events.js +277 -98
- package/dist/ralph/events.js.map +1 -1
- package/dist/ralph/index.d.ts +5 -2
- package/dist/ralph/index.d.ts.map +1 -1
- package/dist/ralph/index.js +9 -3
- package/dist/ralph/index.js.map +1 -1
- package/dist/ralph/loop-errors.d.ts +83 -0
- package/dist/ralph/loop-errors.d.ts.map +1 -0
- package/dist/ralph/loop-errors.js +150 -0
- package/dist/ralph/loop-errors.js.map +1 -0
- package/dist/ralph/subagent.d.ts +83 -0
- package/dist/ralph/subagent.d.ts.map +1 -0
- package/dist/ralph/subagent.js +174 -0
- package/dist/ralph/subagent.js.map +1 -0
- package/dist/ralph/wrap-up.d.ts +125 -0
- package/dist/ralph/wrap-up.d.ts.map +1 -0
- package/dist/ralph/wrap-up.js +270 -0
- package/dist/ralph/wrap-up.js.map +1 -0
- package/dist/schema/batch.d.ts +95 -0
- package/dist/schema/batch.d.ts.map +1 -0
- package/dist/schema/batch.js +24 -0
- package/dist/schema/batch.js.map +1 -0
- package/dist/schema/common.d.ts +2 -2
- package/dist/schema/common.d.ts.map +1 -1
- package/dist/schema/common.js +34 -31
- package/dist/schema/common.js.map +1 -1
- package/dist/schema/inbox.d.ts +12 -12
- package/dist/schema/inbox.js +4 -4
- package/dist/schema/inbox.js.map +1 -1
- package/dist/schema/index.d.ts +8 -5
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/index.js +8 -5
- package/dist/schema/index.js.map +1 -1
- package/dist/schema/meta.d.ts +1454 -27
- package/dist/schema/meta.d.ts.map +1 -1
- package/dist/schema/meta.js +198 -21
- package/dist/schema/meta.js.map +1 -1
- package/dist/schema/plan.d.ts +285 -0
- package/dist/schema/plan.d.ts.map +1 -0
- package/dist/schema/plan.js +81 -0
- package/dist/schema/plan.js.map +1 -0
- package/dist/schema/spec.d.ts +72 -33
- package/dist/schema/spec.d.ts.map +1 -1
- package/dist/schema/spec.js +22 -9
- package/dist/schema/spec.js.map +1 -1
- package/dist/schema/task.d.ts +172 -161
- package/dist/schema/task.d.ts.map +1 -1
- package/dist/schema/task.js +21 -12
- package/dist/schema/task.js.map +1 -1
- package/dist/schema/triage.d.ts +266 -0
- package/dist/schema/triage.d.ts.map +1 -0
- package/dist/schema/triage.js +134 -0
- package/dist/schema/triage.js.map +1 -0
- package/dist/sessions/index.d.ts +2 -2
- package/dist/sessions/index.d.ts.map +1 -1
- package/dist/sessions/index.js +3 -3
- package/dist/sessions/index.js.map +1 -1
- package/dist/sessions/store.d.ts +233 -1
- package/dist/sessions/store.d.ts.map +1 -1
- package/dist/sessions/store.js +628 -31
- package/dist/sessions/store.js.map +1 -1
- package/dist/sessions/types.d.ts +10 -10
- package/dist/sessions/types.d.ts.map +1 -1
- package/dist/sessions/types.js +10 -9
- package/dist/sessions/types.js.map +1 -1
- package/dist/strings/errors.d.ts +51 -0
- package/dist/strings/errors.d.ts.map +1 -1
- package/dist/strings/errors.js +136 -106
- package/dist/strings/errors.js.map +1 -1
- package/dist/strings/guidance.d.ts.map +1 -1
- package/dist/strings/guidance.js +16 -16
- package/dist/strings/guidance.js.map +1 -1
- package/dist/strings/index.d.ts +4 -4
- package/dist/strings/index.d.ts.map +1 -1
- package/dist/strings/index.js +4 -4
- package/dist/strings/index.js.map +1 -1
- package/dist/strings/labels.d.ts +4 -0
- package/dist/strings/labels.d.ts.map +1 -1
- package/dist/strings/labels.js +45 -41
- package/dist/strings/labels.js.map +1 -1
- package/dist/strings/validation.d.ts.map +1 -1
- package/dist/strings/validation.js +71 -71
- package/dist/strings/validation.js.map +1 -1
- package/dist/utils/commit.d.ts +1 -1
- package/dist/utils/commit.d.ts.map +1 -1
- package/dist/utils/commit.js +28 -26
- package/dist/utils/commit.js.map +1 -1
- package/dist/utils/git.d.ts +1 -1
- package/dist/utils/git.d.ts.map +1 -1
- package/dist/utils/git.js +40 -38
- package/dist/utils/git.js.map +1 -1
- package/dist/utils/grep.js +11 -11
- package/dist/utils/grep.js.map +1 -1
- package/dist/utils/index.d.ts +7 -7
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +4 -4
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/time.d.ts.map +1 -1
- package/dist/utils/time.js +10 -10
- package/dist/utils/time.js.map +1 -1
- package/package.json +28 -5
- package/plugin/.claude-plugin/marketplace.json +17 -0
- package/plugin/.claude-plugin/plugin.json +5 -0
- package/plugin/plugins/kspec/skills/help/SKILL.md +42 -0
- package/plugin/plugins/kspec/skills/triage/SKILL.md +206 -0
- package/plugin/plugins/kspec/skills/triage/docs/automation.md +120 -0
- package/plugin/plugins/kspec/skills/triage/docs/inbox.md +144 -0
- package/plugin/plugins/kspec/skills/triage/docs/observations.md +85 -0
- package/templates/agents-sections/01-quick-start.md +22 -0
- package/templates/agents-sections/02-shadow-branch.md +34 -0
- package/templates/agents-sections/03-task-lifecycle.md +48 -0
- package/templates/agents-sections/04-pr-workflow.md +17 -0
- package/templates/agents-sections/05-commit-convention.md +27 -0
- package/templates/agents-sections/06-ralph-loop.md +45 -0
- package/templates/hooks/pre-commit +34 -0
- package/templates/skills/help/SKILL.md +37 -0
- package/templates/skills/manifest.yaml +15 -0
- package/templates/skills/triage/SKILL.md +199 -0
- package/templates/skills/triage/docs/automation.md +120 -0
- package/templates/skills/triage/docs/inbox.md +144 -0
- package/templates/skills/triage/docs/observations.md +85 -0
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Setup status utilities
|
|
3
|
+
*
|
|
4
|
+
* Extracted from cli/commands/setup.ts to avoid CLI module dependency for doctor.ts.
|
|
5
|
+
* Provides setup status information without output formatting.
|
|
6
|
+
*
|
|
7
|
+
* AC: @doctor-command ac-setup-agent-hooks, ac-setup-skills-agents-md, ac-partial-init, ac-staleness-unknown
|
|
8
|
+
*/
|
|
9
|
+
import * as fs from "node:fs/promises";
|
|
10
|
+
import * as path from "node:path";
|
|
11
|
+
/**
|
|
12
|
+
* Guard scripts that can be installed
|
|
13
|
+
*/
|
|
14
|
+
const GUARD_SCRIPTS = {
|
|
15
|
+
"bash-guard.mjs": true,
|
|
16
|
+
"write-guard.mjs": true,
|
|
17
|
+
"edit-guard.mjs": true,
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Detect the agent type in use.
|
|
21
|
+
*/
|
|
22
|
+
export async function detectAgent() {
|
|
23
|
+
// Check environment variables for agent hints
|
|
24
|
+
const envHints = {
|
|
25
|
+
CLAUDE_CODE: "claude-code",
|
|
26
|
+
CURSOR_TRACE_ID: "cursor",
|
|
27
|
+
WINDSURF_SESSION: "windsurf",
|
|
28
|
+
};
|
|
29
|
+
for (const [envVar, agent] of Object.entries(envHints)) {
|
|
30
|
+
if (process.env[envVar]) {
|
|
31
|
+
return { type: agent, confidence: "high" };
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
// Check for Claude Code by looking for .claude directory
|
|
35
|
+
// This is a medium confidence indicator
|
|
36
|
+
if (process.env.HOME) {
|
|
37
|
+
// Global Claude Code config at ~/.claude
|
|
38
|
+
const globalClaudeDir = path.join(process.env.HOME, ".claude");
|
|
39
|
+
try {
|
|
40
|
+
const stats = await fs.stat(globalClaudeDir);
|
|
41
|
+
if (stats.isDirectory()) {
|
|
42
|
+
return { type: "claude-code", confidence: "medium" };
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
// Directory doesn't exist
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return { type: "unknown", confidence: "low" };
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Debug logging helper
|
|
53
|
+
*/
|
|
54
|
+
function debugLog(message, _error) {
|
|
55
|
+
if (process.env.KSPEC_DEBUG === "1") {
|
|
56
|
+
console.error(`[DEBUG] ${message}`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Get the current setup status for a project.
|
|
61
|
+
*
|
|
62
|
+
* AC: @doctor-command ac-setup-agent-hooks — checks hooks status
|
|
63
|
+
* AC: @doctor-command ac-setup-skills-agents-md — checks skills and agents.md
|
|
64
|
+
* AC: @doctor-command ac-partial-init — handles missing setup artifacts
|
|
65
|
+
* AC: @doctor-command ac-staleness-unknown — returns "unknown" when staleness cannot be determined
|
|
66
|
+
*
|
|
67
|
+
* @param projectDir Project root directory
|
|
68
|
+
*/
|
|
69
|
+
export async function getSetupStatus(projectDir) {
|
|
70
|
+
const detected = await detectAgent();
|
|
71
|
+
const configPath = path.join(projectDir, ".claude", "settings.json");
|
|
72
|
+
const hooksDir = path.join(projectDir, ".claude", "hooks");
|
|
73
|
+
const agentsMdPath = path.join(projectDir, "kspec-agents.md");
|
|
74
|
+
const hashPath = path.join(projectDir, ".kspec", ".kspec-agents-hash");
|
|
75
|
+
const skillsDir = path.join(projectDir, ".claude", "skills");
|
|
76
|
+
// Check hooks
|
|
77
|
+
const hooks = {
|
|
78
|
+
promptCheck: false,
|
|
79
|
+
stop: false,
|
|
80
|
+
preToolUse: false,
|
|
81
|
+
guardsPresent: [],
|
|
82
|
+
};
|
|
83
|
+
try {
|
|
84
|
+
const configContent = await fs.readFile(configPath, "utf-8");
|
|
85
|
+
const config = JSON.parse(configContent);
|
|
86
|
+
const hooksConfig = config.hooks || {};
|
|
87
|
+
// Check UserPromptSubmit
|
|
88
|
+
const promptHooks = hooksConfig.UserPromptSubmit;
|
|
89
|
+
hooks.promptCheck =
|
|
90
|
+
promptHooks?.some((entry) => entry.hooks?.some((h) => h.command?.includes("prompt-check"))) ?? false;
|
|
91
|
+
// Check Stop
|
|
92
|
+
const stopHooks = hooksConfig.Stop;
|
|
93
|
+
hooks.stop =
|
|
94
|
+
stopHooks?.some((entry) => entry.hooks?.some((h) => h.command?.includes("checkpoint"))) ?? false;
|
|
95
|
+
// Check PreToolUse
|
|
96
|
+
const preToolUseHooks = hooksConfig.PreToolUse;
|
|
97
|
+
hooks.preToolUse =
|
|
98
|
+
preToolUseHooks?.some((entry) => entry.hooks?.some((h) => h.command?.includes(".claude/hooks/"))) ?? false;
|
|
99
|
+
}
|
|
100
|
+
catch (err) {
|
|
101
|
+
debugLog("Failed to read hooks config for status", err);
|
|
102
|
+
}
|
|
103
|
+
// Check guard scripts
|
|
104
|
+
try {
|
|
105
|
+
const guardFiles = await fs.readdir(hooksDir);
|
|
106
|
+
for (const name of Object.keys(GUARD_SCRIPTS)) {
|
|
107
|
+
if (guardFiles.includes(name)) {
|
|
108
|
+
hooks.guardsPresent.push(name);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
catch (err) {
|
|
113
|
+
debugLog("Hooks dir doesn't exist", err);
|
|
114
|
+
}
|
|
115
|
+
// Check skills
|
|
116
|
+
const skills = {
|
|
117
|
+
total: 0,
|
|
118
|
+
rendered: 0,
|
|
119
|
+
drifted: 0,
|
|
120
|
+
};
|
|
121
|
+
// Helper to check a single skill directory for kspec-managed SKILL.md
|
|
122
|
+
async function checkSingleSkillDir(dirPath, dirName) {
|
|
123
|
+
const skillMdPath = path.join(dirPath, "SKILL.md");
|
|
124
|
+
try {
|
|
125
|
+
const content = await fs.readFile(skillMdPath, "utf-8");
|
|
126
|
+
if (content.includes("<!-- kspec-managed -->")) {
|
|
127
|
+
skills.total++;
|
|
128
|
+
skills.rendered++;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
catch (err) {
|
|
132
|
+
debugLog(`SKILL.md doesn't exist in ${dirName}`, err);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
// Helper to scan a directory for skill subdirectories
|
|
136
|
+
async function scanForSkills(baseDir, label) {
|
|
137
|
+
try {
|
|
138
|
+
const dirs = await fs.readdir(baseDir, { withFileTypes: true });
|
|
139
|
+
for (const dir of dirs) {
|
|
140
|
+
if (dir.isDirectory()) {
|
|
141
|
+
await checkSingleSkillDir(path.join(baseDir, dir.name), `${label}/${dir.name}`);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
catch (err) {
|
|
146
|
+
debugLog(`${label} dir doesn't exist`, err);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
// Scan .claude/skills/ (project/local skills)
|
|
150
|
+
await scanForSkills(skillsDir, "skills");
|
|
151
|
+
// Check plugin marketplace health
|
|
152
|
+
// AC: @enhanced-setup ac-7, ac-8
|
|
153
|
+
const plugin = {
|
|
154
|
+
marketplaceRegistered: false,
|
|
155
|
+
marketplaceHealthy: false,
|
|
156
|
+
pluginEnabled: false,
|
|
157
|
+
registeredPath: undefined,
|
|
158
|
+
healthMessage: undefined,
|
|
159
|
+
};
|
|
160
|
+
try {
|
|
161
|
+
const { checkMarketplaceHealth } = await import("../lib/claude-plugin-registry.js");
|
|
162
|
+
const health = await checkMarketplaceHealth();
|
|
163
|
+
plugin.marketplaceRegistered = health.status !== "missing";
|
|
164
|
+
plugin.marketplaceHealthy = health.status === "healthy";
|
|
165
|
+
plugin.registeredPath = health.registeredPath;
|
|
166
|
+
plugin.healthMessage = health.message;
|
|
167
|
+
}
|
|
168
|
+
catch (err) {
|
|
169
|
+
debugLog("Could not check marketplace health", err);
|
|
170
|
+
plugin.healthMessage = "Health check unavailable";
|
|
171
|
+
}
|
|
172
|
+
// Check if plugin is enabled in project settings
|
|
173
|
+
try {
|
|
174
|
+
const configContent = await fs.readFile(configPath, "utf-8");
|
|
175
|
+
const config = JSON.parse(configContent);
|
|
176
|
+
plugin.pluginEnabled = config.enabledPlugins?.["kspec@kspec-plugins"] === true;
|
|
177
|
+
}
|
|
178
|
+
catch (err) {
|
|
179
|
+
debugLog("Could not check plugin enablement", err);
|
|
180
|
+
}
|
|
181
|
+
// Check agents.md
|
|
182
|
+
const agentsMd = {
|
|
183
|
+
exists: false,
|
|
184
|
+
status: "missing",
|
|
185
|
+
};
|
|
186
|
+
try {
|
|
187
|
+
await fs.access(agentsMdPath);
|
|
188
|
+
agentsMd.exists = true;
|
|
189
|
+
try {
|
|
190
|
+
const hashContent = await fs.readFile(hashPath, "utf-8");
|
|
191
|
+
const hashData = JSON.parse(hashContent);
|
|
192
|
+
agentsMd.generatedAt = hashData.generatedAt;
|
|
193
|
+
// AC: @doctor-command ac-staleness-unknown
|
|
194
|
+
// Compare stored hash against current meta to detect staleness
|
|
195
|
+
try {
|
|
196
|
+
const { initContext, loadMetaContext } = await import("./index.js");
|
|
197
|
+
// Dynamic import agents.js from CLI commands
|
|
198
|
+
const { computeMetaHash, loadTemplateSections, getPackageRoot } = await import("../cli/commands/agents.js");
|
|
199
|
+
const ctx = await initContext();
|
|
200
|
+
if (ctx.manifestPath) {
|
|
201
|
+
const metaCtx = await loadMetaContext(ctx);
|
|
202
|
+
let templateSections = [];
|
|
203
|
+
try {
|
|
204
|
+
templateSections = await loadTemplateSections(getPackageRoot());
|
|
205
|
+
}
|
|
206
|
+
catch (err) {
|
|
207
|
+
debugLog("Templates not available for staleness check", err);
|
|
208
|
+
}
|
|
209
|
+
const currentHash = computeMetaHash(metaCtx.skills, metaCtx.conventions, metaCtx.workflows, templateSections);
|
|
210
|
+
agentsMd.status = hashData.metaHash === currentHash ? "current" : "stale";
|
|
211
|
+
}
|
|
212
|
+
else {
|
|
213
|
+
// AC: @doctor-command ac-staleness-unknown — no manifest means we can't check
|
|
214
|
+
agentsMd.status = "unknown";
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
catch (err) {
|
|
218
|
+
// AC: @doctor-command ac-staleness-unknown — hash computation failed
|
|
219
|
+
debugLog("Could not compute meta hash for staleness check", err);
|
|
220
|
+
agentsMd.status = "unknown";
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
catch (err) {
|
|
224
|
+
debugLog("Hash file missing or invalid, marking stale", err);
|
|
225
|
+
agentsMd.status = "stale";
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
catch (err) {
|
|
229
|
+
debugLog("kspec-agents.md doesn't exist", err);
|
|
230
|
+
}
|
|
231
|
+
// Check seeding state
|
|
232
|
+
const seeding = {
|
|
233
|
+
permissionsSeeded: false,
|
|
234
|
+
memorySeeded: false,
|
|
235
|
+
};
|
|
236
|
+
try {
|
|
237
|
+
const configContent = await fs.readFile(path.join(projectDir, ".claude", "settings.json"), "utf-8");
|
|
238
|
+
const config = JSON.parse(configContent);
|
|
239
|
+
seeding.permissionsSeeded = !!config.permissions;
|
|
240
|
+
}
|
|
241
|
+
catch (err) {
|
|
242
|
+
debugLog("Could not check permissions seeding state", err);
|
|
243
|
+
}
|
|
244
|
+
if (detected.type === "claude-code") {
|
|
245
|
+
try {
|
|
246
|
+
const { claudeCodeMemoryWriter } = await import("../cli/commands/setup-seeding.js");
|
|
247
|
+
const memoryExists = await claudeCodeMemoryWriter.exists(projectDir);
|
|
248
|
+
seeding.memorySeeded = memoryExists;
|
|
249
|
+
if (memoryExists) {
|
|
250
|
+
seeding.memoryPath = claudeCodeMemoryWriter.getMemoryPath(projectDir);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
catch (err) {
|
|
254
|
+
debugLog("Could not check memory seeding state", err);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
return {
|
|
258
|
+
agent: {
|
|
259
|
+
detected: detected.type,
|
|
260
|
+
confidence: detected.confidence,
|
|
261
|
+
},
|
|
262
|
+
hooks,
|
|
263
|
+
skills,
|
|
264
|
+
plugin,
|
|
265
|
+
agentsMd,
|
|
266
|
+
seeding,
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
//# sourceMappingURL=setup-status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup-status.js","sourceRoot":"","sources":["../../src/parser/setup-status.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAgDlC;;GAEG;AACH,MAAM,aAAa,GAA4B;IAC7C,gBAAgB,EAAE,IAAI;IACtB,iBAAiB,EAAE,IAAI;IACvB,gBAAgB,EAAE,IAAI;CACvB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW;IAI/B,8CAA8C;IAC9C,M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,CAAC,CAAC;YACxE,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,QAAQ,CAAC,sCAAsC,EAAE,GAAG,CAAC,CAAC;QACxD,CAAC;IACH,CAAC;IAED,OAAO;QACL,KAAK,EAAE;YACL,QAAQ,EAAE,QAAQ,CAAC,IAAI;YACvB,UAAU,EAAE,QAAQ,CAAC,UAAU;SAChC;QACD,KAAK;QACL,MAAM;QACN,MAAM;QACN,QAAQ;QACR,OAAO;KACR,CAAC;AACJ,CAAC"}
|
package/dist/parser/shadow.d.ts
CHANGED
|
@@ -31,15 +31,16 @@ export interface ShadowStatus {
|
|
|
31
31
|
branchExists: boolean;
|
|
32
32
|
worktreeExists: boolean;
|
|
33
33
|
worktreeLinked: boolean;
|
|
34
|
+
artifactsDirExists: boolean;
|
|
34
35
|
error?: string;
|
|
35
36
|
}
|
|
36
37
|
/**
|
|
37
38
|
* Error types for shadow branch issues
|
|
38
39
|
*/
|
|
39
40
|
export declare class ShadowError extends Error {
|
|
40
|
-
code:
|
|
41
|
+
code: "NOT_INITIALIZED" | "WORKTREE_DISCONNECTED" | "DIRECTORY_MISSING" | "GIT_ERROR" | "RUNNING_FROM_SHADOW";
|
|
41
42
|
suggestion: string;
|
|
42
|
-
constructor(message: string, code:
|
|
43
|
+
constructor(message: string, code: "NOT_INITIALIZED" | "WORKTREE_DISCONNECTED" | "DIRECTORY_MISSING" | "GIT_ERROR" | "RUNNING_FROM_SHADOW", suggestion: string);
|
|
43
44
|
}
|
|
44
45
|
/**
|
|
45
46
|
* Default shadow branch name
|
|
@@ -49,6 +50,28 @@ export declare const SHADOW_BRANCH_NAME = "kspec-meta";
|
|
|
49
50
|
* Default shadow worktree directory
|
|
50
51
|
*/
|
|
51
52
|
export declare const SHADOW_WORKTREE_DIR = ".kspec";
|
|
53
|
+
/**
|
|
54
|
+
* Options for shadow branch operations.
|
|
55
|
+
*
|
|
56
|
+
* AC: @config-shadow ac-7 — all fields optional for backward compatibility
|
|
57
|
+
*
|
|
58
|
+
* When not provided, functions use SHADOW_BRANCH_NAME and SHADOW_WORKTREE_DIR constants.
|
|
59
|
+
*/
|
|
60
|
+
export interface ShadowOptions {
|
|
61
|
+
/** Branch name (default: kspec-meta) */
|
|
62
|
+
branchName?: string;
|
|
63
|
+
/** Worktree directory name (default: .kspec) */
|
|
64
|
+
directory?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Remote target for push/pull. Can be:
|
|
67
|
+
* - Named remote (e.g., "origin", "specs-origin")
|
|
68
|
+
* - Local filesystem path (starts with /, ./, or ~)
|
|
69
|
+
* - Git URL (contains :// or starts with git@)
|
|
70
|
+
*/
|
|
71
|
+
remote?: string;
|
|
72
|
+
/** Type of remote (detected from remote string) */
|
|
73
|
+
remoteType?: "named" | "path" | "url";
|
|
74
|
+
}
|
|
52
75
|
/**
|
|
53
76
|
* Check if debug mode is enabled.
|
|
54
77
|
* Debug mode can be enabled via:
|
|
@@ -78,21 +101,75 @@ export declare function isValidWorktree(worktreeDir: string): Promise<boolean>;
|
|
|
78
101
|
* Detect if running from inside the shadow worktree directory.
|
|
79
102
|
* Returns the main project root if detected, null otherwise.
|
|
80
103
|
*
|
|
104
|
+
* AC: @config-shadow ac-8 — detects custom worktree directories using git metadata
|
|
105
|
+
*
|
|
81
106
|
* Detection logic:
|
|
82
107
|
* 1. Check if .git is a file (worktrees have .git files, not directories)
|
|
83
108
|
* 2. Read the gitdir reference from the .git file
|
|
84
|
-
* 3. Check if it points to a worktree for
|
|
109
|
+
* 3. Check if it points to a worktree for kspec (pattern: <project>/.git/worktrees/...)
|
|
110
|
+
*
|
|
111
|
+
* For custom directories, we detect ANY worktree that:
|
|
112
|
+
* - Has a kspec manifest in it (indicating it's a kspec shadow worktree)
|
|
113
|
+
* - Or has a worktree name containing "kspec" or the configured directory name
|
|
114
|
+
*
|
|
115
|
+
* @param cwd Current working directory
|
|
116
|
+
* @param configuredDirectory Optional configured directory name for matching
|
|
85
117
|
*/
|
|
86
|
-
export declare function detectRunningFromShadowWorktree(cwd: string): Promise<string | null>;
|
|
118
|
+
export declare function detectRunningFromShadowWorktree(cwd: string, configuredDirectory?: string): Promise<string | null>;
|
|
87
119
|
/**
|
|
88
120
|
* Detect shadow branch configuration from a directory.
|
|
89
|
-
* Returns shadow config if
|
|
121
|
+
* Returns shadow config if worktree directory exists and is valid.
|
|
122
|
+
*
|
|
123
|
+
* AC: @config-shadow ac-1 ac-2 — uses configured branch/directory names
|
|
124
|
+
* AC: @config-shadow ac-7 — defaults to constants when options not provided
|
|
125
|
+
*
|
|
126
|
+
* @param startDir Directory to start detection from
|
|
127
|
+
* @param options Optional shadow configuration (branch name, directory)
|
|
90
128
|
*/
|
|
91
|
-
export declare function detectShadow(startDir: string): Promise<ShadowConfig | null>;
|
|
129
|
+
export declare function detectShadow(startDir: string, options?: ShadowOptions): Promise<ShadowConfig | null>;
|
|
92
130
|
/**
|
|
93
|
-
* Get detailed shadow branch status
|
|
131
|
+
* Get detailed shadow branch status.
|
|
132
|
+
*
|
|
133
|
+
* AC: @config-shadow ac-1 ac-2 — uses configured branch/directory names
|
|
134
|
+
* AC: @config-shadow ac-7 — defaults to constants when options not provided
|
|
135
|
+
*
|
|
136
|
+
* @param projectRoot Git repository root
|
|
137
|
+
* @param options Optional shadow configuration
|
|
138
|
+
*/
|
|
139
|
+
export declare function getShadowStatus(projectRoot: string, options?: ShadowOptions): Promise<ShadowStatus>;
|
|
140
|
+
/**
|
|
141
|
+
* Result from checking config mismatch.
|
|
142
|
+
*/
|
|
143
|
+
export interface ShadowConfigMismatch {
|
|
144
|
+
/** Whether there is a mismatch */
|
|
145
|
+
hasMismatch: boolean;
|
|
146
|
+
/** Mismatched branch name (detected vs configured) */
|
|
147
|
+
branchMismatch?: {
|
|
148
|
+
detected: string;
|
|
149
|
+
configured: string;
|
|
150
|
+
};
|
|
151
|
+
/** Mismatched directory (detected vs configured) */
|
|
152
|
+
directoryMismatch?: {
|
|
153
|
+
detected: string;
|
|
154
|
+
configured: string;
|
|
155
|
+
};
|
|
156
|
+
/** Guidance message for the user */
|
|
157
|
+
guidance?: string;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Check if detected shadow branch settings match the configuration.
|
|
161
|
+
*
|
|
162
|
+
* AC: @config-shadow ac-9 — detect mismatch and guide user to migrate
|
|
163
|
+
*
|
|
164
|
+
* This function detects when:
|
|
165
|
+
* - A shadow branch exists with default settings (kspec-meta, .kspec)
|
|
166
|
+
* - But config specifies different settings
|
|
167
|
+
*
|
|
168
|
+
* @param projectRoot Git repository root
|
|
169
|
+
* @param configuredBranch Configured branch name
|
|
170
|
+
* @param configuredDirectory Configured directory name
|
|
94
171
|
*/
|
|
95
|
-
export declare function
|
|
172
|
+
export declare function checkConfigMismatch(projectRoot: string, configuredBranch: string, configuredDirectory: string): Promise<ShadowConfigMismatch>;
|
|
96
173
|
/**
|
|
97
174
|
* Create an appropriate ShadowError based on status
|
|
98
175
|
*/
|
|
@@ -114,6 +191,8 @@ export declare function generateCommitMessage(operation: string, ref?: string, d
|
|
|
114
191
|
/**
|
|
115
192
|
* Resolve a path relative to shadow worktree if enabled.
|
|
116
193
|
* Falls back to original path if shadow is not enabled.
|
|
194
|
+
*
|
|
195
|
+
* Uses the worktreeDir from shadowConfig for custom directory support.
|
|
117
196
|
*/
|
|
118
197
|
export declare function resolveShadowPath(originalPath: string, shadowConfig: ShadowConfig | null, projectRoot: string): string;
|
|
119
198
|
/**
|
|
@@ -159,13 +238,17 @@ export interface ShadowInitResult {
|
|
|
159
238
|
error?: string;
|
|
160
239
|
}
|
|
161
240
|
/**
|
|
162
|
-
* Options for shadow initialization
|
|
241
|
+
* Options for shadow initialization.
|
|
242
|
+
*
|
|
243
|
+
* AC: @config-shadow ac-1 ac-2 — branch and directory configurable
|
|
163
244
|
*/
|
|
164
245
|
export interface ShadowInitOptions {
|
|
165
246
|
/** Project name for manifest */
|
|
166
247
|
projectName?: string;
|
|
167
248
|
/** Force reinitialize even if exists */
|
|
168
249
|
force?: boolean;
|
|
250
|
+
/** Shadow branch/directory/remote configuration */
|
|
251
|
+
shadow?: ShadowOptions;
|
|
169
252
|
}
|
|
170
253
|
/**
|
|
171
254
|
* Check if a remote exists (default: origin)
|
|
@@ -183,23 +266,51 @@ export declare function fetchRemote(projectRoot: string, remoteName?: string): P
|
|
|
183
266
|
/**
|
|
184
267
|
* Push shadow branch to remote with tracking.
|
|
185
268
|
* Returns true if push succeeded, false otherwise.
|
|
269
|
+
*
|
|
270
|
+
* AC: @config-shadow ac-3 — uses configured remote name
|
|
271
|
+
* AC: @config-shadow ac-7 — defaults to origin when not provided
|
|
272
|
+
*
|
|
273
|
+
* @param worktreeDir Path to shadow worktree
|
|
274
|
+
* @param remoteName Remote name (default: origin)
|
|
275
|
+
* @param options Optional shadow configuration
|
|
186
276
|
*/
|
|
187
|
-
export declare function pushShadowBranch(worktreeDir: string, remoteName?: string): Promise<boolean>;
|
|
277
|
+
export declare function pushShadowBranch(worktreeDir: string, remoteName?: string, options?: ShadowOptions): Promise<boolean>;
|
|
188
278
|
/**
|
|
189
279
|
* Check if shadow branch has remote tracking configured.
|
|
190
280
|
* AC-4: Used to determine whether sync should be attempted.
|
|
281
|
+
*
|
|
282
|
+
* AC: @config-shadow ac-7 — backward compat when called without config
|
|
283
|
+
*
|
|
284
|
+
* @param worktreeDir Path to shadow worktree
|
|
285
|
+
* @param options Optional shadow configuration
|
|
191
286
|
*/
|
|
192
|
-
export declare function hasRemoteTracking(worktreeDir: string): Promise<boolean>;
|
|
287
|
+
export declare function hasRemoteTracking(worktreeDir: string, options?: ShadowOptions): Promise<boolean>;
|
|
193
288
|
/**
|
|
194
289
|
* Ensure shadow branch has remote tracking configured.
|
|
195
290
|
* AC-8: If shadow has no tracking but main branch has origin remote,
|
|
196
291
|
* automatically configure tracking to origin/kspec-meta.
|
|
197
292
|
*
|
|
198
|
-
* @
|
|
293
|
+
* AC: @config-shadow ac-3 ac-4 ac-5 — handles different remote types
|
|
294
|
+
* AC: @config-shadow ac-6 — error with guidance if named remote doesn't exist
|
|
295
|
+
* AC: @config-shadow ac-7 — backward compat when called without config
|
|
296
|
+
*
|
|
297
|
+
* @param worktreeDir Path to shadow worktree
|
|
199
298
|
* @param projectRoot Git repository root
|
|
200
|
-
* @
|
|
299
|
+
* @param options Optional shadow configuration
|
|
300
|
+
* @returns Result with success status and error details if applicable
|
|
301
|
+
*/
|
|
302
|
+
export declare function ensureRemoteTracking(worktreeDir: string, projectRoot: string, options?: ShadowOptions): Promise<EnsureRemoteTrackingResult>;
|
|
303
|
+
/**
|
|
304
|
+
* Result from ensuring remote tracking
|
|
305
|
+
* AC: @config-shadow ac-6 — includes error details when named remote doesn't exist
|
|
201
306
|
*/
|
|
202
|
-
export
|
|
307
|
+
export interface EnsureRemoteTrackingResult {
|
|
308
|
+
success: boolean;
|
|
309
|
+
/** Error when remote doesn't exist (AC-6) */
|
|
310
|
+
missingRemote?: string;
|
|
311
|
+
/** Guidance message for user */
|
|
312
|
+
guidance?: string;
|
|
313
|
+
}
|
|
203
314
|
/**
|
|
204
315
|
* Result from a sync operation
|
|
205
316
|
*/
|
|
@@ -216,27 +327,44 @@ export interface ShadowSyncResult {
|
|
|
216
327
|
* AC-8: Automatically sets up tracking if main branch has remote.
|
|
217
328
|
* Silently ignores errors - the local commit succeeded regardless.
|
|
218
329
|
*
|
|
219
|
-
* @
|
|
330
|
+
* AC: @config-shadow ac-7 — backward compat when called without config
|
|
331
|
+
*
|
|
332
|
+
* @param worktreeDir Path to shadow worktree
|
|
220
333
|
* @param verbose Enable debug output
|
|
334
|
+
* @param options Optional shadow configuration
|
|
221
335
|
*/
|
|
222
|
-
export declare function shadowPushAsync(worktreeDir: string, verbose?: boolean): Promise<void>;
|
|
336
|
+
export declare function shadowPushAsync(worktreeDir: string, verbose?: boolean, options?: ShadowOptions): Promise<void>;
|
|
223
337
|
/**
|
|
224
338
|
* Pull remote changes to shadow branch.
|
|
225
339
|
* AC-2: Called at session start to sync before operations.
|
|
226
340
|
* AC-6: Uses --ff-only first, falls back to --rebase.
|
|
227
341
|
* AC-3: On conflict, returns failure with suggestion.
|
|
228
342
|
* AC-8: Automatically sets up tracking if main branch has remote.
|
|
343
|
+
*
|
|
344
|
+
* AC: @config-shadow ac-7 — backward compat when called without config
|
|
345
|
+
*
|
|
346
|
+
* @param worktreeDir Path to shadow worktree
|
|
347
|
+
* @param options Optional shadow configuration
|
|
229
348
|
*/
|
|
230
|
-
export declare function shadowPull(worktreeDir: string): Promise<ShadowSyncResult>;
|
|
349
|
+
export declare function shadowPull(worktreeDir: string, options?: ShadowOptions): Promise<ShadowSyncResult>;
|
|
231
350
|
/**
|
|
232
351
|
* Full sync operation: pull then push.
|
|
233
352
|
* Used by session start and explicit sync commands.
|
|
353
|
+
*
|
|
354
|
+
* AC: @config-shadow ac-7 — backward compat when called without config
|
|
355
|
+
*
|
|
356
|
+
* @param worktreeDir Path to shadow worktree
|
|
357
|
+
* @param options Optional shadow configuration
|
|
234
358
|
*/
|
|
235
|
-
export declare function shadowSync(worktreeDir: string): Promise<ShadowSyncResult>;
|
|
359
|
+
export declare function shadowSync(worktreeDir: string, options?: ShadowOptions): Promise<ShadowSyncResult>;
|
|
236
360
|
/**
|
|
237
361
|
* Initialize shadow branch and worktree.
|
|
238
362
|
* Creates orphan branch, worktree, updates gitignore, and creates initial structure.
|
|
239
363
|
*
|
|
364
|
+
* AC: @config-shadow ac-1 — creates orphan branch with configured name
|
|
365
|
+
* AC: @config-shadow ac-2 — creates worktree at configured directory
|
|
366
|
+
* AC: @config-shadow ac-7 — defaults to constants when options not provided
|
|
367
|
+
*
|
|
240
368
|
* @param projectRoot Git repository root
|
|
241
369
|
* @param options Initialization options
|
|
242
370
|
* @returns Result indicating what was created
|
|
@@ -246,8 +374,11 @@ export declare function initializeShadow(projectRoot: string, options?: ShadowIn
|
|
|
246
374
|
* Repair a broken shadow branch setup.
|
|
247
375
|
* Handles cases where worktree is disconnected or directory is missing.
|
|
248
376
|
*
|
|
377
|
+
* AC: @config-shadow ac-7 — backward compat when called without config
|
|
378
|
+
*
|
|
249
379
|
* @param projectRoot Git repository root
|
|
380
|
+
* @param options Optional shadow configuration
|
|
250
381
|
* @returns Result indicating what was repaired
|
|
251
382
|
*/
|
|
252
|
-
export declare function repairShadow(projectRoot: string): Promise<ShadowInitResult>;
|
|
383
|
+
export declare function repairShadow(projectRoot: string, options?: ShadowOptions): Promise<ShadowInitResult>;
|
|
253
384
|
//# sourceMappingURL=shadow.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shadow.d.ts","sourceRoot":"","sources":["../../src/parser/shadow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"shadow.d.ts","sourceRoot":"","sources":["../../src/parser/shadow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAkBH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,OAAO,GAAG,IAAI,CAEhE;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,gDAAgD;IAChD,OAAO,EAAE,OAAO,CAAC;IACjB,yCAAyC;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB,+CAA+C;IAC/C,UAAU,EAAE,MAAM,CAAC;IACnB,yCAAyC;IACzC,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;IACtB,cAAc,EAAE,OAAO,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,qBAAa,WAAY,SAAQ,KAAK;IAG3B,IAAI,EACP,iBAAiB,GACjB,uBAAuB,GACvB,mBAAmB,GACnB,WAAW,GACX,qBAAqB;IAClB,UAAU,EAA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