@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,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parsing utilities for merge driver.
|
|
3
|
+
*
|
|
4
|
+
* Handles reading and parsing all three versions (base, ours, theirs)
|
|
5
|
+
* of a YAML file, with graceful fallback when parsing fails.
|
|
6
|
+
*/
|
|
7
|
+
import * as fs from "node:fs/promises";
|
|
8
|
+
import { parseYaml } from "../parser/yaml.js";
|
|
9
|
+
/**
|
|
10
|
+
* Parse all three versions of a YAML file.
|
|
11
|
+
*
|
|
12
|
+
* AC: @yaml-merge-driver ac-1
|
|
13
|
+
* Parses base, ours, and theirs as structured data instead of text.
|
|
14
|
+
*
|
|
15
|
+
* AC: @yaml-merge-driver ac-11
|
|
16
|
+
* Returns parse failure if any file cannot be parsed.
|
|
17
|
+
*
|
|
18
|
+
* @param basePath Path to base version (common ancestor)
|
|
19
|
+
* @param oursPath Path to ours version (current branch)
|
|
20
|
+
* @param theirsPath Path to theirs version (incoming branch)
|
|
21
|
+
* @returns ParseResult with parsed versions or error
|
|
22
|
+
*/
|
|
23
|
+
export async function parseYamlVersions(basePath, oursPath, theirsPath) {
|
|
24
|
+
try {
|
|
25
|
+
// Read all three files
|
|
26
|
+
const [baseContent, oursContent, theirsContent] = await Promise.all([
|
|
27
|
+
fs.readFile(basePath, "utf-8"),
|
|
28
|
+
fs.readFile(oursPath, "utf-8"),
|
|
29
|
+
fs.readFile(theirsPath, "utf-8"),
|
|
30
|
+
]);
|
|
31
|
+
// Parse all three versions
|
|
32
|
+
let base;
|
|
33
|
+
let ours;
|
|
34
|
+
let theirs;
|
|
35
|
+
try {
|
|
36
|
+
base = parseYaml(baseContent);
|
|
37
|
+
}
|
|
38
|
+
catch (err) {
|
|
39
|
+
return {
|
|
40
|
+
success: false,
|
|
41
|
+
error: `Failed to parse base: ${err instanceof Error ? err.message : String(err)}`,
|
|
42
|
+
failedFile: "base",
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
try {
|
|
46
|
+
ours = parseYaml(oursContent);
|
|
47
|
+
}
|
|
48
|
+
catch (err) {
|
|
49
|
+
return {
|
|
50
|
+
success: false,
|
|
51
|
+
error: `Failed to parse ours: ${err instanceof Error ? err.message : String(err)}`,
|
|
52
|
+
failedFile: "ours",
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
try {
|
|
56
|
+
theirs = parseYaml(theirsContent);
|
|
57
|
+
}
|
|
58
|
+
catch (err) {
|
|
59
|
+
return {
|
|
60
|
+
success: false,
|
|
61
|
+
error: `Failed to parse theirs: ${err instanceof Error ? err.message : String(err)}`,
|
|
62
|
+
failedFile: "theirs",
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
success: true,
|
|
67
|
+
versions: { base, ours, theirs },
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
catch (err) {
|
|
71
|
+
// File read error
|
|
72
|
+
return {
|
|
73
|
+
success: false,
|
|
74
|
+
error: `Failed to read files: ${err instanceof Error ? err.message : String(err)}`,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=parse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse.js","sourceRoot":"","sources":["../../src/merge/parse.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAG9C;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,QAAgB,EAChB,QAAgB,EAChB,UAAkB;IAElB,IAAI,CAAC;QACH,uBAAuB;QACvB,MAAM,CAAC,WAAW,EAAE,WAAW,EAAE,aAAa,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;YAClE,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;YAC9B,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;YAC9B,EAAE,CAAC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;SACjC,CAAC,CAAC;QAEH,2BAA2B;QAC3B,IAAI,IAAa,CAAC;QAClB,IAAI,IAAa,CAAC;QAClB,IAAI,MAAe,CAAC;QAEpB,IAAI,CAAC;YACH,IAAI,GAAG,SAAS,CAAC,WAAW,CAAC,CAAC;QAChC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,yBAAyB,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE;gBAClF,UAAU,EAAE,MAAM;aACnB,CAAC;QACJ,CAAC;QAED,IAAI,CAAC;YACH,IAAI,GAAG,SAAS,CAAC,WAAW,CAAC,CAAC;QAChC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,yBAAyB,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE;gBAClF,UAAU,EAAE,MAAM;aACnB,CAAC;QACJ,CAAC;QAED,IAAI,CAAC;YACH,MAAM,GAAG,SAAS,CAAC,aAAa,CAAC,CAAC;QACpC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,2BAA2B,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE;gBACpF,UAAU,EAAE,QAAQ;aACrB,CAAC;QACJ,CAAC;QAED,OAAO;YACL,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE;SACjC,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,kBAAkB;QAClB,OAAO;YACL,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,yBAAyB,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE;SACnF,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Conflict resolution for semantic YAML merge.
|
|
3
|
+
*
|
|
4
|
+
* Handles interactive prompts for conflicts and formatting
|
|
5
|
+
* conflicts as YAML comments in non-interactive mode.
|
|
6
|
+
*/
|
|
7
|
+
import type { ConflictInfo } from "./types.js";
|
|
8
|
+
import * as readline from "node:readline/promises";
|
|
9
|
+
/**
|
|
10
|
+
* Resolution choice for a conflict
|
|
11
|
+
*/
|
|
12
|
+
export type ResolutionChoice = "ours" | "theirs" | "skip";
|
|
13
|
+
/**
|
|
14
|
+
* Result of resolving a single conflict
|
|
15
|
+
*/
|
|
16
|
+
export interface ConflictResolution {
|
|
17
|
+
/** The conflict that was resolved */
|
|
18
|
+
conflict: ConflictInfo;
|
|
19
|
+
/** The choice made */
|
|
20
|
+
choice: ResolutionChoice;
|
|
21
|
+
/** The resolved value (undefined if skipped) */
|
|
22
|
+
value?: unknown;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* AC: @yaml-merge-driver ac-4
|
|
26
|
+
* Prompt user interactively to resolve a scalar field conflict.
|
|
27
|
+
*
|
|
28
|
+
* @param conflict The conflict to resolve
|
|
29
|
+
* @param createInterface Optional readline factory for testing
|
|
30
|
+
* @returns The resolution choice and value
|
|
31
|
+
*/
|
|
32
|
+
export declare function promptScalarConflict(conflict: ConflictInfo, createInterface?: typeof readline.createInterface): Promise<ConflictResolution>;
|
|
33
|
+
/**
|
|
34
|
+
* AC: @yaml-merge-driver ac-8
|
|
35
|
+
* Prompt user to choose between deletion and keeping modified version.
|
|
36
|
+
*
|
|
37
|
+
* @param conflict The delete-modify conflict to resolve
|
|
38
|
+
* @param createInterface Optional readline factory for testing
|
|
39
|
+
* @returns The resolution choice
|
|
40
|
+
*/
|
|
41
|
+
export declare function promptDeleteModifyConflict(conflict: ConflictInfo, createInterface?: typeof readline.createInterface): Promise<ConflictResolution>;
|
|
42
|
+
/**
|
|
43
|
+
* Resolve multiple conflicts interactively.
|
|
44
|
+
*
|
|
45
|
+
* @param conflicts Array of conflicts to resolve
|
|
46
|
+
* @returns Array of resolutions
|
|
47
|
+
*/
|
|
48
|
+
export declare function resolveConflictsInteractive(conflicts: ConflictInfo[]): Promise<ConflictResolution[]>;
|
|
49
|
+
/**
|
|
50
|
+
* AC: @yaml-merge-driver ac-10
|
|
51
|
+
* Format a conflict as a YAML comment for non-interactive mode.
|
|
52
|
+
*
|
|
53
|
+
* Example output:
|
|
54
|
+
* ```yaml
|
|
55
|
+
* # CONFLICT: Field "title" modified with different values in both branches
|
|
56
|
+
* # Path: tasks[0].title
|
|
57
|
+
* # Ours: "Fix authentication bug"
|
|
58
|
+
* # Theirs: "Fix auth issue"
|
|
59
|
+
* title: "Fix authentication bug" # Using ours
|
|
60
|
+
* ```
|
|
61
|
+
*
|
|
62
|
+
* @param conflict The conflict to format
|
|
63
|
+
* @returns YAML comment lines
|
|
64
|
+
*/
|
|
65
|
+
export declare function formatConflictComment(conflict: ConflictInfo): string[];
|
|
66
|
+
//# sourceMappingURL=resolve.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/merge/resolve.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,KAAK,QAAQ,MAAM,wBAAwB,CAAC;AAGnD;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,qCAAqC;IACrC,QAAQ,EAAE,YAAY,CAAC;IACvB,sBAAsB;IACtB,MAAM,EAAE,gBAAgB,CAAC;IACzB,gDAAgD;IAChD,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;;GAOG;AACH,wBAAsB,oBAAoB,CACxC,QAAQ,EAAE,YAAY,EACtB,eAAe,CAAC,EAAE,OAAO,QAAQ,CAAC,eAAe,GAChD,OAAO,CAAC,kBAAkB,CAAC,CAoC7B;AAED;;;;;;;GAOG;AACH,wBAAsB,0BAA0B,CAC9C,QAAQ,EAAE,YAAY,EACtB,eAAe,CAAC,EAAE,OAAO,QAAQ,CAAC,eAAe,GAChD,OAAO,CAAC,kBAAkB,CAAC,CA6C7B;AAED;;;;;GAKG;AACH,wBAAsB,2BAA2B,CAC/C,SAAS,EAAE,YAAY,EAAE,GACxB,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAuB/B;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,YAAY,GAAG,MAAM,EAAE,CAetE"}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Conflict resolution for semantic YAML merge.
|
|
3
|
+
*
|
|
4
|
+
* Handles interactive prompts for conflicts and formatting
|
|
5
|
+
* conflicts as YAML comments in non-interactive mode.
|
|
6
|
+
*/
|
|
7
|
+
import * as readline from "node:readline/promises";
|
|
8
|
+
import { stdin as input, stdout as output } from "node:process";
|
|
9
|
+
/**
|
|
10
|
+
* AC: @yaml-merge-driver ac-4
|
|
11
|
+
* Prompt user interactively to resolve a scalar field conflict.
|
|
12
|
+
*
|
|
13
|
+
* @param conflict The conflict to resolve
|
|
14
|
+
* @param createInterface Optional readline factory for testing
|
|
15
|
+
* @returns The resolution choice and value
|
|
16
|
+
*/
|
|
17
|
+
export async function promptScalarConflict(conflict, createInterface) {
|
|
18
|
+
const factory = createInterface || readline.createInterface;
|
|
19
|
+
const rl = factory({ input, output });
|
|
20
|
+
try {
|
|
21
|
+
console.log(`\n${conflict.description}`);
|
|
22
|
+
console.log(`Path: ${conflict.path}`);
|
|
23
|
+
console.log(` [1] Ours: ${formatValue(conflict.oursValue)}`);
|
|
24
|
+
console.log(` [2] Theirs: ${formatValue(conflict.theirsValue)}`);
|
|
25
|
+
console.log(` [3] Skip (leave unresolved)`);
|
|
26
|
+
const answer = await rl.question("\nChoose [1/2/3]: ");
|
|
27
|
+
switch (answer.trim()) {
|
|
28
|
+
case "1":
|
|
29
|
+
return {
|
|
30
|
+
conflict,
|
|
31
|
+
choice: "ours",
|
|
32
|
+
value: conflict.oursValue,
|
|
33
|
+
};
|
|
34
|
+
case "2":
|
|
35
|
+
return {
|
|
36
|
+
conflict,
|
|
37
|
+
choice: "theirs",
|
|
38
|
+
value: conflict.theirsValue,
|
|
39
|
+
};
|
|
40
|
+
case "3":
|
|
41
|
+
default:
|
|
42
|
+
return {
|
|
43
|
+
conflict,
|
|
44
|
+
choice: "skip",
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
finally {
|
|
49
|
+
rl.close();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* AC: @yaml-merge-driver ac-8
|
|
54
|
+
* Prompt user to choose between deletion and keeping modified version.
|
|
55
|
+
*
|
|
56
|
+
* @param conflict The delete-modify conflict to resolve
|
|
57
|
+
* @param createInterface Optional readline factory for testing
|
|
58
|
+
* @returns The resolution choice
|
|
59
|
+
*/
|
|
60
|
+
export async function promptDeleteModifyConflict(conflict, createInterface) {
|
|
61
|
+
const factory = createInterface || readline.createInterface;
|
|
62
|
+
const rl = factory({ input, output });
|
|
63
|
+
try {
|
|
64
|
+
console.log(`\n${conflict.description}`);
|
|
65
|
+
console.log(`Path: ${conflict.path}`);
|
|
66
|
+
// Determine which side deleted
|
|
67
|
+
const deletedInOurs = conflict.oursValue === undefined;
|
|
68
|
+
if (deletedInOurs) {
|
|
69
|
+
console.log(` [1] Delete (ours deleted this)`);
|
|
70
|
+
console.log(` [2] Keep modified version: ${formatValue(conflict.theirsValue)}`);
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
console.log(` [1] Keep modified version: ${formatValue(conflict.oursValue)}`);
|
|
74
|
+
console.log(` [2] Delete (theirs deleted this)`);
|
|
75
|
+
}
|
|
76
|
+
console.log(` [3] Skip (leave unresolved)`);
|
|
77
|
+
const answer = await rl.question("\nChoose [1/2/3]: ");
|
|
78
|
+
switch (answer.trim()) {
|
|
79
|
+
case "1":
|
|
80
|
+
return {
|
|
81
|
+
conflict,
|
|
82
|
+
choice: "ours",
|
|
83
|
+
value: deletedInOurs ? undefined : conflict.oursValue,
|
|
84
|
+
};
|
|
85
|
+
case "2":
|
|
86
|
+
return {
|
|
87
|
+
conflict,
|
|
88
|
+
choice: "theirs",
|
|
89
|
+
value: deletedInOurs ? conflict.theirsValue : undefined,
|
|
90
|
+
};
|
|
91
|
+
case "3":
|
|
92
|
+
default:
|
|
93
|
+
return {
|
|
94
|
+
conflict,
|
|
95
|
+
choice: "skip",
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
finally {
|
|
100
|
+
rl.close();
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Resolve multiple conflicts interactively.
|
|
105
|
+
*
|
|
106
|
+
* @param conflicts Array of conflicts to resolve
|
|
107
|
+
* @returns Array of resolutions
|
|
108
|
+
*/
|
|
109
|
+
export async function resolveConflictsInteractive(conflicts) {
|
|
110
|
+
const resolutions = [];
|
|
111
|
+
for (const conflict of conflicts) {
|
|
112
|
+
let resolution;
|
|
113
|
+
switch (conflict.type) {
|
|
114
|
+
case "scalar_field":
|
|
115
|
+
resolution = await promptScalarConflict(conflict);
|
|
116
|
+
break;
|
|
117
|
+
case "delete_modify":
|
|
118
|
+
resolution = await promptDeleteModifyConflict(conflict);
|
|
119
|
+
break;
|
|
120
|
+
case "nested_conflict":
|
|
121
|
+
// Nested conflicts should have been flattened to scalar conflicts
|
|
122
|
+
resolution = await promptScalarConflict(conflict);
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
resolutions.push(resolution);
|
|
126
|
+
}
|
|
127
|
+
return resolutions;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* AC: @yaml-merge-driver ac-10
|
|
131
|
+
* Format a conflict as a YAML comment for non-interactive mode.
|
|
132
|
+
*
|
|
133
|
+
* Example output:
|
|
134
|
+
* ```yaml
|
|
135
|
+
* # CONFLICT: Field "title" modified with different values in both branches
|
|
136
|
+
* # Path: tasks[0].title
|
|
137
|
+
* # Ours: "Fix authentication bug"
|
|
138
|
+
* # Theirs: "Fix auth issue"
|
|
139
|
+
* title: "Fix authentication bug" # Using ours
|
|
140
|
+
* ```
|
|
141
|
+
*
|
|
142
|
+
* @param conflict The conflict to format
|
|
143
|
+
* @returns YAML comment lines
|
|
144
|
+
*/
|
|
145
|
+
export function formatConflictComment(conflict) {
|
|
146
|
+
const lines = [];
|
|
147
|
+
lines.push(`# CONFLICT: ${conflict.description}`);
|
|
148
|
+
lines.push(`# Path: ${conflict.path}`);
|
|
149
|
+
if (conflict.ulid) {
|
|
150
|
+
lines.push(`# ULID: ${conflict.ulid}`);
|
|
151
|
+
}
|
|
152
|
+
lines.push(`# Ours: ${formatValue(conflict.oursValue)}`);
|
|
153
|
+
lines.push(`# Theirs: ${formatValue(conflict.theirsValue)}`);
|
|
154
|
+
lines.push(`# Resolution: Using ours (run merge interactively to resolve)`);
|
|
155
|
+
return lines;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Format a value for display in prompts or comments.
|
|
159
|
+
* Handles primitives, arrays, and objects concisely.
|
|
160
|
+
*/
|
|
161
|
+
function formatValue(value) {
|
|
162
|
+
if (value === undefined)
|
|
163
|
+
return "<deleted>";
|
|
164
|
+
if (value === null)
|
|
165
|
+
return "null";
|
|
166
|
+
if (typeof value === "string")
|
|
167
|
+
return `"${value}"`;
|
|
168
|
+
if (typeof value === "number" || typeof value === "boolean")
|
|
169
|
+
return String(value);
|
|
170
|
+
if (Array.isArray(value)) {
|
|
171
|
+
if (value.length === 0)
|
|
172
|
+
return "[]";
|
|
173
|
+
if (value.length <= 3) {
|
|
174
|
+
return `[${value.map(formatValue).join(", ")}]`;
|
|
175
|
+
}
|
|
176
|
+
return `[${value.length} items]`;
|
|
177
|
+
}
|
|
178
|
+
if (typeof value === "object") {
|
|
179
|
+
const keys = Object.keys(value);
|
|
180
|
+
if (keys.length === 0)
|
|
181
|
+
return "{}";
|
|
182
|
+
if (keys.length === 1) {
|
|
183
|
+
return `{${keys[0]}}`;
|
|
184
|
+
}
|
|
185
|
+
return `{${keys.length} fields}`;
|
|
186
|
+
}
|
|
187
|
+
return String(value);
|
|
188
|
+
}
|
|
189
|
+
//# sourceMappingURL=resolve.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../src/merge/resolve.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,QAAQ,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,KAAK,IAAI,KAAK,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,cAAc,CAAC;AAmBhE;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,QAAsB,EACtB,eAAiD;IAEjD,MAAM,OAAO,GAAG,eAAe,IAAI,QAAQ,CAAC,eAAe,CAAC;IAC5D,MAAM,EAAE,GAAG,OAAO,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;IAEtC,IAAI,CAAC;QACH,OAAO,CAAC,GAAG,CAAC,KAAK,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC;QACzC,OAAO,CAAC,GAAG,CAAC,SAAS,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;QACtC,OAAO,CAAC,GAAG,CAAC,iBAAiB,WAAW,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QAChE,OAAO,CAAC,GAAG,CAAC,iBAAiB,WAAW,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;QAClE,OAAO,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC;QAE7C,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,oBAAoB,CAAC,CAAC;QAEvD,QAAQ,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;YACtB,KAAK,GAAG;gBACN,OAAO;oBACL,QAAQ;oBACR,MAAM,EAAE,MAAM;oBACd,KAAK,EAA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AAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;QAClD,CAAC;QACD,OAAO,IAAI,KAAK,CAAC,MAAM,SAAS,CAAC;IACnC,CAAC;IAED,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAChC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QACnC,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACtB,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;QACxB,CAAC;QACD,OAAO,IAAI,IAAI,CAAC,MAAM,UAAU,CAAC;IACnC,CAAC;IAED,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for semantic YAML merge driver.
|
|
3
|
+
*
|
|
4
|
+
* The merge driver parses kspec YAML files and merges them semantically,
|
|
5
|
+
* understanding the structure of tasks, items, and other entities.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Result of a merge operation
|
|
9
|
+
*/
|
|
10
|
+
export interface MergeResult {
|
|
11
|
+
/** The merged YAML content */
|
|
12
|
+
content: string;
|
|
13
|
+
/** Whether conflicts were detected */
|
|
14
|
+
hasConflicts: boolean;
|
|
15
|
+
/** Conflict information (empty if no conflicts) */
|
|
16
|
+
conflicts: ConflictInfo[];
|
|
17
|
+
/** Whether parsing failed (triggers fallback) */
|
|
18
|
+
parseFailed: boolean;
|
|
19
|
+
/** Error message if parse failed */
|
|
20
|
+
parseError?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Information about a conflict that requires resolution
|
|
24
|
+
*/
|
|
25
|
+
export interface ConflictInfo {
|
|
26
|
+
/** Type of conflict */
|
|
27
|
+
type: ConflictType;
|
|
28
|
+
/** Path to the conflicting field (e.g., "tasks[0].title") */
|
|
29
|
+
path: string;
|
|
30
|
+
/** ULID of the item with conflict (if applicable) */
|
|
31
|
+
ulid?: string;
|
|
32
|
+
/** Value from "ours" branch */
|
|
33
|
+
oursValue: unknown;
|
|
34
|
+
/** Value from "theirs" branch */
|
|
35
|
+
theirsValue: unknown;
|
|
36
|
+
/** Description of the conflict */
|
|
37
|
+
description: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Types of conflicts that can occur during merge
|
|
41
|
+
*/
|
|
42
|
+
export type ConflictType = "scalar_field" | "delete_modify" | "nested_conflict";
|
|
43
|
+
/**
|
|
44
|
+
* Options for merge operations
|
|
45
|
+
*/
|
|
46
|
+
export interface MergeOptions {
|
|
47
|
+
/** Whether to run in non-interactive mode (no prompts) */
|
|
48
|
+
nonInteractive?: boolean;
|
|
49
|
+
/** Output file path for merged result */
|
|
50
|
+
outputPath: string;
|
|
51
|
+
/** Path to "base" version (common ancestor) */
|
|
52
|
+
basePath: string;
|
|
53
|
+
/** Path to "ours" version (current branch) */
|
|
54
|
+
oursPath: string;
|
|
55
|
+
/** Path to "theirs" version (incoming branch) */
|
|
56
|
+
theirsPath: string;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Parsed versions of a file for merging
|
|
60
|
+
*/
|
|
61
|
+
export interface ParsedVersions {
|
|
62
|
+
/** Common ancestor version */
|
|
63
|
+
base: unknown;
|
|
64
|
+
/** Current branch version */
|
|
65
|
+
ours: unknown;
|
|
66
|
+
/** Incoming branch version */
|
|
67
|
+
theirs: unknown;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Result of parsing all three versions
|
|
71
|
+
*/
|
|
72
|
+
export interface ParseResult {
|
|
73
|
+
/** Whether parsing succeeded */
|
|
74
|
+
success: boolean;
|
|
75
|
+
/** Parsed versions (undefined if parse failed) */
|
|
76
|
+
versions?: ParsedVersions;
|
|
77
|
+
/** Error message if parse failed */
|
|
78
|
+
error?: string;
|
|
79
|
+
/** Which file failed to parse (if applicable) */
|
|
80
|
+
failedFile?: "base" | "ours" | "theirs";
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/merge/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,8BAA8B;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,sCAAsC;IACtC,YAAY,EAAE,OAAO,CAAC;IACtB,mDAAmD;IACnD,SAAS,EAAE,YAAY,EAAE,CAAC;IAC1B,iDAAiD;IACjD,WAAW,EAAE,OAAO,CAAC;IACrB,oCAAoC;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,uBAAuB;IACvB,IAAI,EAAE,YAAY,CAAC;IACnB,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAAC;IACb,qDAAqD;IACrD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+BAA+B;IAC/B,SAAS,EAAE,OAAO,CAAC;IACnB,iCAAiC;IACjC,WAAW,EAAE,OAAO,CAAC;IACrB,kCAAkC;IAClC,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,MAAM,YAAY,GACpB,cAAc,GACd,eAAe,GACf,iBAAiB,CAAC;AAEtB;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,0DAA0D;IAC1D,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,yCAAyC;IACzC,UAAU,EAAE,MAAM,CAAC;IACnB,+CAA+C;IAC/C,QAAQ,EAAE,MAAM,CAAC;IACjB,8CAA8C;IAC9C,QAAQ,EAAE,MAAM,CAAC;IACjB,iDAAiD;IACjD,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,8BAA8B;IAC9B,IAAI,EAAE,OAAO,CAAC;IACd,6BAA6B;IAC7B,IAAI,EAAE,OAAO,CAAC;IACd,8BAA8B;IAC9B,MAAM,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,gCAAgC;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,kDAAkD;IAClD,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,oCAAoC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iDAAiD;IACjD,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;CACzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/merge/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-generated data sections for agent instructions.
|
|
3
|
+
*
|
|
4
|
+
* Library functions that generate markdown sections from kspec meta data:
|
|
5
|
+
* skills table, conventions summary, and workflows summary.
|
|
6
|
+
*
|
|
7
|
+
* AC: @agent-data-sections ac-1 - generateSkillsTable returns markdown table
|
|
8
|
+
* AC: @agent-data-sections ac-2 - generateConventionsSummary returns markdown section
|
|
9
|
+
* AC: @agent-data-sections ac-3 - generateWorkflowsSummary returns markdown section
|
|
10
|
+
*/
|
|
11
|
+
import type { LoadedConvention, LoadedSkill, LoadedWorkflow } from "./meta.js";
|
|
12
|
+
/**
|
|
13
|
+
* Generate a markdown table for skills.
|
|
14
|
+
*
|
|
15
|
+
* AC: @agent-data-sections ac-1
|
|
16
|
+
* Given: skills in meta with varying names and descriptions
|
|
17
|
+
* When: generateSkillsTable is called
|
|
18
|
+
* Then: a markdown table is returned with columns for skill name, description, and invocation
|
|
19
|
+
*
|
|
20
|
+
* @param skills - Array of loaded skills from meta
|
|
21
|
+
* @returns Markdown table string with columns: name (as description), description, invocation
|
|
22
|
+
*/
|
|
23
|
+
export declare function generateSkillsTable(skills: LoadedSkill[]): string;
|
|
24
|
+
/**
|
|
25
|
+
* Intro paragraph for the conventions section.
|
|
26
|
+
* Extracted as a constant for future configurability.
|
|
27
|
+
*/
|
|
28
|
+
export declare const CONVENTIONS_INTRO = "These are the project's agreed-upon conventions. Follow them in all contributions to maintain consistency.";
|
|
29
|
+
/**
|
|
30
|
+
* Generate a markdown section summarizing conventions by domain.
|
|
31
|
+
*
|
|
32
|
+
* AC: @agent-data-sections ac-2
|
|
33
|
+
* Given: conventions in meta with rules arrays
|
|
34
|
+
* When: generateConventionsSummary is called
|
|
35
|
+
* Then: a markdown section is returned listing each domain with its rules
|
|
36
|
+
*
|
|
37
|
+
* @param conventions - Array of loaded conventions from meta
|
|
38
|
+
* @returns Markdown section string with domain headers, rules as list items, and examples
|
|
39
|
+
*/
|
|
40
|
+
export declare function generateConventionsSummary(conventions: LoadedConvention[]): string;
|
|
41
|
+
/**
|
|
42
|
+
* Generate a markdown section summarizing workflows.
|
|
43
|
+
*
|
|
44
|
+
* AC: @agent-data-sections ac-3
|
|
45
|
+
* Given: workflows in meta with triggers and descriptions
|
|
46
|
+
* When: generateWorkflowsSummary is called
|
|
47
|
+
* Then: a markdown section is returned listing each workflow with its trigger
|
|
48
|
+
*
|
|
49
|
+
* @param workflows - Array of loaded workflows from meta
|
|
50
|
+
* @returns Markdown section string with workflow list including triggers
|
|
51
|
+
*/
|
|
52
|
+
export declare function generateWorkflowsSummary(workflows: LoadedWorkflow[]): string;
|
|
53
|
+
//# sourceMappingURL=agent-data-sections.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-data-sections.d.ts","sourceRoot":"","sources":["../../src/parser/agent-data-sections.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE/E;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,CA4BjE;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,+GACgF,CAAC;AAE/G;;;;;;;;;;GAUG;AACH,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,gBAAgB,EAAE,GAC9B,MAAM,CAsCR;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,cAAc,EAAE,GAAG,MAAM,CAiB5E"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-generated data sections for agent instructions.
|
|
3
|
+
*
|
|
4
|
+
* Library functions that generate markdown sections from kspec meta data:
|
|
5
|
+
* skills table, conventions summary, and workflows summary.
|
|
6
|
+
*
|
|
7
|
+
* AC: @agent-data-sections ac-1 - generateSkillsTable returns markdown table
|
|
8
|
+
* AC: @agent-data-sections ac-2 - generateConventionsSummary returns markdown section
|
|
9
|
+
* AC: @agent-data-sections ac-3 - generateWorkflowsSummary returns markdown section
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Generate a markdown table for skills.
|
|
13
|
+
*
|
|
14
|
+
* AC: @agent-data-sections ac-1
|
|
15
|
+
* Given: skills in meta with varying names and descriptions
|
|
16
|
+
* When: generateSkillsTable is called
|
|
17
|
+
* Then: a markdown table is returned with columns for skill name, description, and invocation
|
|
18
|
+
*
|
|
19
|
+
* @param skills - Array of loaded skills from meta
|
|
20
|
+
* @returns Markdown table string with columns: name (as description), description, invocation
|
|
21
|
+
*/
|
|
22
|
+
export function generateSkillsTable(skills) {
|
|
23
|
+
if (skills.length === 0) {
|
|
24
|
+
return "";
|
|
25
|
+
}
|
|
26
|
+
const lines = [
|
|
27
|
+
"## Finding Information",
|
|
28
|
+
"",
|
|
29
|
+
"Use skills and CLI help for detailed documentation:",
|
|
30
|
+
"",
|
|
31
|
+
"| Need | Where to look |",
|
|
32
|
+
"|------|---------------|",
|
|
33
|
+
];
|
|
34
|
+
for (const skill of skills) {
|
|
35
|
+
const description = skill.description || skill.name;
|
|
36
|
+
// Core skills in plugin system are invoked as /kspec:<id>, project skills as /<id>
|
|
37
|
+
const invocation = skill.origin === "core" ? `kspec:${skill.id}` : skill.id;
|
|
38
|
+
lines.push(`| ${description} | \`/${invocation}\` skill |`);
|
|
39
|
+
}
|
|
40
|
+
lines.push("");
|
|
41
|
+
lines.push("Skills inject their full documentation when invoked — you don't need to memorize their contents.");
|
|
42
|
+
lines.push("");
|
|
43
|
+
return lines.join("\n");
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Intro paragraph for the conventions section.
|
|
47
|
+
* Extracted as a constant for future configurability.
|
|
48
|
+
*/
|
|
49
|
+
export const CONVENTIONS_INTRO = "These are the project's agreed-upon conventions. Follow them in all contributions to maintain consistency.";
|
|
50
|
+
/**
|
|
51
|
+
* Generate a markdown section summarizing conventions by domain.
|
|
52
|
+
*
|
|
53
|
+
* AC: @agent-data-sections ac-2
|
|
54
|
+
* Given: conventions in meta with rules arrays
|
|
55
|
+
* When: generateConventionsSummary is called
|
|
56
|
+
* Then: a markdown section is returned listing each domain with its rules
|
|
57
|
+
*
|
|
58
|
+
* @param conventions - Array of loaded conventions from meta
|
|
59
|
+
* @returns Markdown section string with domain headers, rules as list items, and examples
|
|
60
|
+
*/
|
|
61
|
+
export function generateConventionsSummary(conventions) {
|
|
62
|
+
if (conventions.length === 0) {
|
|
63
|
+
return "";
|
|
64
|
+
}
|
|
65
|
+
const lines = ["## Conventions", "", CONVENTIONS_INTRO, ""];
|
|
66
|
+
for (const convention of conventions) {
|
|
67
|
+
lines.push(`### ${convention.domain}`);
|
|
68
|
+
lines.push("");
|
|
69
|
+
for (const rule of convention.rules) {
|
|
70
|
+
lines.push(`- ${rule}`);
|
|
71
|
+
}
|
|
72
|
+
// Render examples when present
|
|
73
|
+
if (convention.examples && convention.examples.length > 0) {
|
|
74
|
+
lines.push("");
|
|
75
|
+
lines.push("**Examples:**");
|
|
76
|
+
for (const example of convention.examples) {
|
|
77
|
+
const combinedLength = example.good.length + example.bad.length;
|
|
78
|
+
if (combinedLength > 80) {
|
|
79
|
+
// Long format: quoted, separate lines
|
|
80
|
+
lines.push(`- Good: "${example.good}"`);
|
|
81
|
+
lines.push(`- Bad: "${example.bad}"`);
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
// Short format: inline code with em-dash
|
|
85
|
+
lines.push(`- Good: \`${example.good}\` — Bad: \`${example.bad}\``);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
lines.push("");
|
|
90
|
+
}
|
|
91
|
+
return lines.join("\n");
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Generate a markdown section summarizing workflows.
|
|
95
|
+
*
|
|
96
|
+
* AC: @agent-data-sections ac-3
|
|
97
|
+
* Given: workflows in meta with triggers and descriptions
|
|
98
|
+
* When: generateWorkflowsSummary is called
|
|
99
|
+
* Then: a markdown section is returned listing each workflow with its trigger
|
|
100
|
+
*
|
|
101
|
+
* @param workflows - Array of loaded workflows from meta
|
|
102
|
+
* @returns Markdown section string with workflow list including triggers
|
|
103
|
+
*/
|
|
104
|
+
export function generateWorkflowsSummary(workflows) {
|
|
105
|
+
if (workflows.length === 0) {
|
|
106
|
+
return "";
|
|
107
|
+
}
|
|
108
|
+
const lines = ["## Workflows", "", "Available workflows:", ""];
|
|
109
|
+
for (const workflow of workflows) {
|
|
110
|
+
const description = workflow.description || workflow.trigger;
|
|
111
|
+
lines.push(`- **${workflow.id}**: ${description}`);
|
|
112
|
+
}
|
|
113
|
+
lines.push("");
|
|
114
|
+
lines.push("Use `kspec workflow start @workflow-id` to start a workflow.");
|
|
115
|
+
lines.push("");
|
|
116
|
+
return lines.join("\n");
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=agent-data-sections.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-data-sections.js","sourceR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SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3B,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,KAAK,GAAa,CAAC,cAAc,EAAE,EAAE,EAAE,sBAAsB,EAAE,EAAE,CAAC,CAAC;IAEzE,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;QACjC,MAAM,WAAW,GAAG,QAAQ,CAAC,WAAW,IAAI,QAAQ,CAAC,OAAO,CAAC;QAC7D,KAAK,CAAC,IAAI,CAAC,OAAO,QAAQ,CAAC,EAAE,OAAO,WAAW,EAAE,CAAC,CAAC;IACrD,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CAAC,8DAA8D,CAAC,CAAC;IAC3E,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAEf,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* Provides bidirectional mapping from spec items to implementing tasks,
|
|
5
5
|
* and detects alignment issues like orphaned specs or stale implementation status.
|
|
6
6
|
*/
|
|
7
|
-
import type {
|
|
8
|
-
import type { ReferenceIndex } from
|
|
9
|
-
import type {
|
|
7
|
+
import type { ImplementationStatus } from "../schema/index.js";
|
|
8
|
+
import type { ReferenceIndex } from "./refs.js";
|
|
9
|
+
import type { KspecContext, LoadedSpecItem, LoadedTask } from "./yaml.js";
|
|
10
10
|
/**
|
|
11
11
|
* Summary of a spec item's implementation status based on linked tasks
|
|
12
12
|
*/
|
|
@@ -31,7 +31,7 @@ export interface LinkedTaskSummary {
|
|
|
31
31
|
* Alignment warning
|
|
32
32
|
*/
|
|
33
33
|
export interface AlignmentWarning {
|
|
34
|
-
type:
|
|
34
|
+
type: "orphaned_spec" | "status_mismatch" | "stale_implementation";
|
|
35
35
|
specUlid?: string;
|
|
36
36
|
specTitle?: string;
|
|
37
37
|
taskUlid?: string;
|