@kynetic-ai/spec 0.1.2 → 0.4.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 +107 -0
- package/dist/cli/batch-exec.d.ts.map +1 -0
- package/dist/cli/batch-exec.js +706 -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 +141 -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 +58 -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 +534 -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 +547 -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 +1109 -170
- 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 +810 -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 +1267 -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 +56 -0
- package/dist/cli/commands/skill-install.d.ts.map +1 -0
- package/dist/cli/commands/skill-install.js +509 -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 +584 -350
- 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 +225 -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 +483 -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 +237 -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 +402 -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 +457 -0
- package/dist/parser/config.d.ts.map +1 -0
- package/dist/parser/config.js +373 -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 +197 -0
- package/dist/parser/plan-document.d.ts.map +1 -0
- package/dist/parser/plan-document.js +341 -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 +301 -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 +94 -0
- package/dist/ralph/subagent.d.ts.map +1 -0
- package/dist/ralph/subagent.js +193 -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 +97 -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 +8 -2
- package/dist/schema/common.d.ts.map +1 -1
- package/dist/schema/common.js +42 -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 +241 -1
- package/dist/sessions/store.d.ts.map +1 -1
- package/dist/sessions/store.js +810 -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 +55 -0
- package/dist/strings/errors.d.ts.map +1 -1
- package/dist/strings/errors.js +138 -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/triage/actions.d.ts +27 -0
- package/dist/triage/actions.d.ts.map +1 -0
- package/dist/triage/actions.js +95 -0
- package/dist/triage/actions.js.map +1 -0
- package/dist/triage/constants.d.ts +6 -0
- package/dist/triage/constants.d.ts.map +1 -0
- package/dist/triage/constants.js +7 -0
- package/dist/triage/constants.js.map +1 -0
- package/dist/triage/index.d.ts +3 -0
- package/dist/triage/index.d.ts.map +1 -0
- package/dist/triage/index.js +3 -0
- package/dist/triage/index.js.map +1 -0
- 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/create-workflow/SKILL.md +235 -0
- package/plugin/plugins/kspec/skills/help/SKILL.md +42 -0
- package/plugin/plugins/kspec/skills/observations/SKILL.md +143 -0
- package/plugin/plugins/kspec/skills/plan/SKILL.md +343 -0
- package/plugin/plugins/kspec/skills/reflect/SKILL.md +161 -0
- package/plugin/plugins/kspec/skills/review/SKILL.md +193 -0
- package/plugin/plugins/kspec/skills/task-work/SKILL.md +303 -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/plugin/plugins/kspec/skills/triage-automation/SKILL.md +140 -0
- package/plugin/plugins/kspec/skills/triage-inbox/SKILL.md +232 -0
- package/plugin/plugins/kspec/skills/writing-specs/SKILL.md +340 -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/create-workflow/SKILL.md +228 -0
- package/templates/skills/help/SKILL.md +37 -0
- package/templates/skills/manifest.yaml +60 -0
- package/templates/skills/observations/SKILL.md +137 -0
- package/templates/skills/plan/SKILL.md +336 -0
- package/templates/skills/reflect/SKILL.md +155 -0
- package/templates/skills/review/SKILL.md +186 -0
- package/templates/skills/task-work/SKILL.md +296 -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
- package/templates/skills/triage-automation/SKILL.md +134 -0
- package/templates/skills/triage-inbox/SKILL.md +225 -0
- package/templates/skills/writing-specs/SKILL.md +333 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File type detection for kspec merge driver.
|
|
3
|
+
*
|
|
4
|
+
* Determines which merge strategy to apply based on file path patterns.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Types of kspec files that require different merge strategies
|
|
8
|
+
*/
|
|
9
|
+
export var FileType;
|
|
10
|
+
(function (FileType) {
|
|
11
|
+
/** Task files: *.tasks.yaml */
|
|
12
|
+
FileType["Tasks"] = "tasks";
|
|
13
|
+
/** Inbox files: *.inbox.yaml */
|
|
14
|
+
FileType["Inbox"] = "inbox";
|
|
15
|
+
/** Spec module files: modules/*.yaml */
|
|
16
|
+
FileType["SpecModules"] = "spec_modules";
|
|
17
|
+
/** Manifest file: kynetic.yaml */
|
|
18
|
+
FileType["Manifest"] = "manifest";
|
|
19
|
+
/** Meta file: kynetic.meta.yaml */
|
|
20
|
+
FileType["Meta"] = "meta";
|
|
21
|
+
/** Unrecognized files (fallback to default behavior) */
|
|
22
|
+
FileType["Unknown"] = "unknown";
|
|
23
|
+
})(FileType || (FileType = {}));
|
|
24
|
+
/**
|
|
25
|
+
* Detect the type of a kspec file based on its path.
|
|
26
|
+
*
|
|
27
|
+
* Supports both explicit names (kynetic.yaml) and slug-based names ({slug}.yaml).
|
|
28
|
+
*
|
|
29
|
+
* @param filePath - Path to the file (can be relative or absolute)
|
|
30
|
+
* @returns The detected file type
|
|
31
|
+
*/
|
|
32
|
+
export function detectFileType(filePath) {
|
|
33
|
+
// Normalize path separators for cross-platform compatibility
|
|
34
|
+
const normalizedPath = filePath.replace(/\\/g, "/");
|
|
35
|
+
// Extract just the filename for pattern matching
|
|
36
|
+
const parts = normalizedPath.split("/");
|
|
37
|
+
const fileName = parts[parts.length - 1];
|
|
38
|
+
// Check for task files (*.tasks.yaml pattern) - must be before manifest check
|
|
39
|
+
if (fileName.endsWith(".tasks.yaml")) {
|
|
40
|
+
return FileType.Tasks;
|
|
41
|
+
}
|
|
42
|
+
// Check for inbox files (*.inbox.yaml pattern)
|
|
43
|
+
if (fileName.endsWith(".inbox.yaml")) {
|
|
44
|
+
return FileType.Inbox;
|
|
45
|
+
}
|
|
46
|
+
// Check for meta file (*.meta.yaml pattern - supports slug-based naming)
|
|
47
|
+
if (fileName.endsWith(".meta.yaml")) {
|
|
48
|
+
return FileType.Meta;
|
|
49
|
+
}
|
|
50
|
+
// Check for workflow runs files (*.runs.yaml pattern)
|
|
51
|
+
if (fileName.endsWith(".runs.yaml")) {
|
|
52
|
+
return FileType.Unknown; // Runs files don't need special merge handling
|
|
53
|
+
}
|
|
54
|
+
// Check for spec modules (in modules/ directory)
|
|
55
|
+
// Match both "/modules/" and "modules/" at start of path
|
|
56
|
+
if ((normalizedPath.includes("/modules/") ||
|
|
57
|
+
normalizedPath.startsWith("modules/")) &&
|
|
58
|
+
fileName.endsWith(".yaml")) {
|
|
59
|
+
return FileType.SpecModules;
|
|
60
|
+
}
|
|
61
|
+
// Check for manifest - explicit names only for merge driver safety
|
|
62
|
+
// Slug-based manifests ({slug}.yaml) are handled at discovery time, not merge time
|
|
63
|
+
// The merge driver only needs to handle files that are definitely kspec files
|
|
64
|
+
if (fileName === "kynetic.yaml" || fileName === "kynetic.spec.yaml") {
|
|
65
|
+
return FileType.Manifest;
|
|
66
|
+
}
|
|
67
|
+
// Fallback for unrecognized files
|
|
68
|
+
return FileType.Unknown;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=file-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-type.js","sourceRoot":"","sources":["../../src/merge/file-type.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,CAAN,IAAY,QAaX;AAbD,WAAY,QAAQ;IAClB,+BAA+B;IAC/B,2BAAe,CAAA;IACf,gCAAgC;IAChC,2BAAe,CAAA;IACf,wCAAwC;IACxC,wCAA4B,CAAA;IAC5B,kCAAkC;IAClC,iCAAqB,CAAA;IACrB,mCAAmC;IACnC,yBAAa,CAAA;IACb,wDAAwD;IACxD,+BAAmB,CAAA;AACrB,CAAC,EAbW,QAAQ,KAAR,QAAQ,QAanB;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAAC,QAAgB;IAC7C,6DAA6D;IAC7D,MAAM,cAAc,GAAG,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAEpD,iDAAiD;IACjD,MAAM,KAAK,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACxC,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAEzC,8EAA8E;IAC9E,IAAI,QAAQ,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;QACrC,OAAO,QAAQ,CAAC,KAAK,CAAC;IACxB,CAAC;IAED,+CAA+C;IAC/C,IAAI,QAAQ,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;QACrC,OAAO,QAAQ,CAAC,KAAK,CAAC;IACxB,CAAC;IAED,yEAAyE;IACzE,IAAI,QAAQ,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC;QACpC,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;IAED,sDAAsD;IACtD,IAAI,QAAQ,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC;QACpC,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAC,+CAA+C;IAC1E,CAAC;IAED,iDAAiD;IACjD,yDAAyD;IACzD,IACE,CAAC,cAAc,CAAC,QAAQ,CAAC,WAAW,CAAC;QACnC,cAAc,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QACxC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,EAC1B,CAAC;QACD,OAAO,QAAQ,CAAC,WAAW,CAAC;IAC9B,CAAC;IAED,mEAAmE;IACnE,mFAAmF;IACnF,8EAA8E;IAC9E,IAAI,QAAQ,KAAK,cAAc,IAAI,QAAQ,KAAK,mBAAmB,EAAE,CAAC;QACpE,OAAO,QAAQ,CAAC,QAAQ,CAAC;IAC3B,CAAC;IAED,kCAAkC;IAClC,OAAO,QAAQ,CAAC,OAAO,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Semantic YAML merge driver for kspec files.
|
|
3
|
+
*
|
|
4
|
+
* Public API exports for the merge module.
|
|
5
|
+
*/
|
|
6
|
+
export type { MergeResult, ConflictInfo, ConflictType, MergeOptions, ParsedVersions, ParseResult, } from "./types.js";
|
|
7
|
+
export { parseYamlVersions } from "./parse.js";
|
|
8
|
+
export { mergeUlidArrays, mergeSetArray, normalizeRef, detectDeletion, } from "./arrays.js";
|
|
9
|
+
export { mergeObjects } from "./objects.js";
|
|
10
|
+
export type { ObjectMergeResult } from "./objects.js";
|
|
11
|
+
export { promptScalarConflict, promptDeleteModifyConflict, resolveConflictsInteractive, formatConflictComment, } from "./resolve.js";
|
|
12
|
+
export type { ResolutionChoice, ConflictResolution } from "./resolve.js";
|
|
13
|
+
export { detectFileType, FileType } from "./file-type.js";
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/merge/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EACV,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,WAAW,GACZ,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,EACL,eAAe,EACf,aAAa,EACb,YAAY,EACZ,cAAc,GACf,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,YAAY,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEtD,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC1B,2BAA2B,EAC3B,qBAAqB,GACtB,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEzE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Semantic YAML merge driver for kspec files.
|
|
3
|
+
*
|
|
4
|
+
* Public API exports for the merge module.
|
|
5
|
+
*/
|
|
6
|
+
export { parseYamlVersions } from "./parse.js";
|
|
7
|
+
export { mergeUlidArrays, mergeSetArray, normalizeRef, detectDeletion, } from "./arrays.js";
|
|
8
|
+
export { mergeObjects } from "./objects.js";
|
|
9
|
+
export { promptScalarConflict, promptDeleteModifyConflict, resolveConflictsInteractive, formatConflictComment, } from "./resolve.js";
|
|
10
|
+
export { detectFileType, FileType } from "./file-type.js";
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/merge/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAWH,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,EACL,eAAe,EACf,aAAa,EACb,YAAY,EACZ,cAAc,GACf,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG5C,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC1B,2BAA2B,EAC3B,qBAAqB,GACtB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Object merging algorithms for semantic YAML merge.
|
|
3
|
+
*
|
|
4
|
+
* Handles field-level merging of objects, recursively merging nested structures
|
|
5
|
+
* and detecting conflicts when both sides modify the same scalar field.
|
|
6
|
+
*/
|
|
7
|
+
import type { ConflictInfo } from "./types.js";
|
|
8
|
+
/**
|
|
9
|
+
* Result of merging two objects
|
|
10
|
+
*/
|
|
11
|
+
export interface ObjectMergeResult {
|
|
12
|
+
/** The merged object */
|
|
13
|
+
merged: Record<string, unknown>;
|
|
14
|
+
/** Conflicts detected during merge */
|
|
15
|
+
conflicts: ConflictInfo[];
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Merge two objects field by field, recursively handling nested objects.
|
|
19
|
+
*
|
|
20
|
+
* AC: @yaml-merge-driver ac-3
|
|
21
|
+
* When both versions modify different fields of the same item, fields are merged.
|
|
22
|
+
*
|
|
23
|
+
* AC: @yaml-merge-driver ac-7
|
|
24
|
+
* Nested objects are merged recursively at field level.
|
|
25
|
+
*
|
|
26
|
+
* Strategy:
|
|
27
|
+
* 1. Collect all keys from base, ours, and theirs
|
|
28
|
+
* 2. For each key, determine what happened:
|
|
29
|
+
* - Added in ours only → include ours value
|
|
30
|
+
* - Added in theirs only → include theirs value
|
|
31
|
+
* - Added in both (not in base) → conflict if different
|
|
32
|
+
* - Modified in ours only → include ours value
|
|
33
|
+
* - Modified in theirs only → include theirs value
|
|
34
|
+
* - Modified in both → recurse if objects, else conflict
|
|
35
|
+
* - Deleted in ours, kept in theirs → include theirs value
|
|
36
|
+
* - Deleted in theirs, kept in ours → include ours value
|
|
37
|
+
* - Deleted in both → omit from result
|
|
38
|
+
*
|
|
39
|
+
* @param base Object from common ancestor
|
|
40
|
+
* @param ours Object from current branch
|
|
41
|
+
* @param theirs Object from incoming branch
|
|
42
|
+
* @param path Path to this object (for conflict reporting)
|
|
43
|
+
* @returns Merged object and any conflicts detected
|
|
44
|
+
*/
|
|
45
|
+
export declare function mergeObjects(base: Record<string, unknown> | undefined, ours: Record<string, unknown> | undefined, theirs: Record<string, unknown> | undefined, path?: string): ObjectMergeResult;
|
|
46
|
+
//# sourceMappingURL=objects.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"objects.d.ts","sourceRoot":"","sources":["../../src/merge/objects.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,wBAAwB;IACxB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,sCAAsC;IACtC,SAAS,EAAE,YAAY,EAAE,CAAC;CAC3B;AAcD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EACzC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EACzC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAC3C,IAAI,SAAK,GACR,iBAAiB,CAmInB"}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Object merging algorithms for semantic YAML merge.
|
|
3
|
+
*
|
|
4
|
+
* Handles field-level merging of objects, recursively merging nested structures
|
|
5
|
+
* and detecting conflicts when both sides modify the same scalar field.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Check if a value is a plain object (not an array, null, or other type)
|
|
9
|
+
*/
|
|
10
|
+
function isPlainObject(value) {
|
|
11
|
+
return (typeof value === "object" &&
|
|
12
|
+
value !== null &&
|
|
13
|
+
!Array.isArray(value) &&
|
|
14
|
+
Object.getPrototypeOf(value) === Object.prototype);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Merge two objects field by field, recursively handling nested objects.
|
|
18
|
+
*
|
|
19
|
+
* AC: @yaml-merge-driver ac-3
|
|
20
|
+
* When both versions modify different fields of the same item, fields are merged.
|
|
21
|
+
*
|
|
22
|
+
* AC: @yaml-merge-driver ac-7
|
|
23
|
+
* Nested objects are merged recursively at field level.
|
|
24
|
+
*
|
|
25
|
+
* Strategy:
|
|
26
|
+
* 1. Collect all keys from base, ours, and theirs
|
|
27
|
+
* 2. For each key, determine what happened:
|
|
28
|
+
* - Added in ours only → include ours value
|
|
29
|
+
* - Added in theirs only → include theirs value
|
|
30
|
+
* - Added in both (not in base) → conflict if different
|
|
31
|
+
* - Modified in ours only → include ours value
|
|
32
|
+
* - Modified in theirs only → include theirs value
|
|
33
|
+
* - Modified in both → recurse if objects, else conflict
|
|
34
|
+
* - Deleted in ours, kept in theirs → include theirs value
|
|
35
|
+
* - Deleted in theirs, kept in ours → include ours value
|
|
36
|
+
* - Deleted in both → omit from result
|
|
37
|
+
*
|
|
38
|
+
* @param base Object from common ancestor
|
|
39
|
+
* @param ours Object from current branch
|
|
40
|
+
* @param theirs Object from incoming branch
|
|
41
|
+
* @param path Path to this object (for conflict reporting)
|
|
42
|
+
* @returns Merged object and any conflicts detected
|
|
43
|
+
*/
|
|
44
|
+
export function mergeObjects(base, ours, theirs, path = "") {
|
|
45
|
+
const baseObj = base ?? {};
|
|
46
|
+
const oursObj = ours ?? {};
|
|
47
|
+
const theirsObj = theirs ?? {};
|
|
48
|
+
const merged = {};
|
|
49
|
+
const conflicts = [];
|
|
50
|
+
// Collect all keys from all three versions
|
|
51
|
+
const allKeys = new Set([
|
|
52
|
+
...Object.keys(baseObj),
|
|
53
|
+
...Object.keys(oursObj),
|
|
54
|
+
...Object.keys(theirsObj),
|
|
55
|
+
]);
|
|
56
|
+
for (const key of allKeys) {
|
|
57
|
+
const fieldPath = path ? `${path}.${key}` : key;
|
|
58
|
+
const inBase = key in baseObj;
|
|
59
|
+
const inOurs = key in oursObj;
|
|
60
|
+
const inTheirs = key in theirsObj;
|
|
61
|
+
const baseVal = baseObj[key];
|
|
62
|
+
const oursVal = oursObj[key];
|
|
63
|
+
const theirsVal = theirsObj[key];
|
|
64
|
+
// Case 1: Field only in ours (added in ours)
|
|
65
|
+
if (!inBase && inOurs && !inTheirs) {
|
|
66
|
+
merged[key] = oursVal;
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
// Case 2: Field only in theirs (added in theirs)
|
|
70
|
+
if (!inBase && !inOurs && inTheirs) {
|
|
71
|
+
merged[key] = theirsVal;
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
// Case 3: Field added in both (not in base)
|
|
75
|
+
if (!inBase && inOurs && inTheirs) {
|
|
76
|
+
if (valuesEqual(oursVal, theirsVal)) {
|
|
77
|
+
// Same value added in both - no conflict
|
|
78
|
+
merged[key] = oursVal;
|
|
79
|
+
}
|
|
80
|
+
else if (isPlainObject(oursVal) && isPlainObject(theirsVal)) {
|
|
81
|
+
// Both added nested objects - try to merge them
|
|
82
|
+
const result = mergeObjects(undefined, oursVal, theirsVal, fieldPath);
|
|
83
|
+
merged[key] = result.merged;
|
|
84
|
+
conflicts.push(...result.conflicts);
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
// Different values added - conflict
|
|
88
|
+
conflicts.push({
|
|
89
|
+
type: "scalar_field",
|
|
90
|
+
path: fieldPath,
|
|
91
|
+
oursValue: oursVal,
|
|
92
|
+
theirsValue: theirsVal,
|
|
93
|
+
description: `Field "${key}" added with different values in both branches`,
|
|
94
|
+
});
|
|
95
|
+
// Default to ours for now (will be resolved interactively)
|
|
96
|
+
merged[key] = oursVal;
|
|
97
|
+
}
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
// Case 4: Field deleted in ours, kept/modified in theirs
|
|
101
|
+
if (inBase && !inOurs && inTheirs) {
|
|
102
|
+
// Deletion in ours, but theirs kept it - include theirs value
|
|
103
|
+
merged[key] = theirsVal;
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
// Case 5: Field deleted in theirs, kept/modified in ours
|
|
107
|
+
if (inBase && inOurs && !inTheirs) {
|
|
108
|
+
// Deletion in theirs, but ours kept it - include ours value
|
|
109
|
+
merged[key] = oursVal;
|
|
110
|
+
continue;
|
|
111
|
+
}
|
|
112
|
+
// Case 6: Field deleted in both
|
|
113
|
+
if (inBase && !inOurs && !inTheirs) {
|
|
114
|
+
// Both deleted - omit from result
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
// Case 7: Field exists in all three versions
|
|
118
|
+
if (inBase && inOurs && inTheirs) {
|
|
119
|
+
// Check if modified in ours
|
|
120
|
+
const modifiedInOurs = !valuesEqual(baseVal, oursVal);
|
|
121
|
+
// Check if modified in theirs
|
|
122
|
+
const modifiedInTheirs = !valuesEqual(baseVal, theirsVal);
|
|
123
|
+
if (!modifiedInOurs && !modifiedInTheirs) {
|
|
124
|
+
// No changes in either - keep base value
|
|
125
|
+
merged[key] = baseVal;
|
|
126
|
+
}
|
|
127
|
+
else if (modifiedInOurs && !modifiedInTheirs) {
|
|
128
|
+
// Only modified in ours - take ours
|
|
129
|
+
merged[key] = oursVal;
|
|
130
|
+
}
|
|
131
|
+
else if (!modifiedInOurs && modifiedInTheirs) {
|
|
132
|
+
// Only modified in theirs - take theirs
|
|
133
|
+
merged[key] = theirsVal;
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
// Modified in both - need to check for conflicts
|
|
137
|
+
if (valuesEqual(oursVal, theirsVal)) {
|
|
138
|
+
// Same modification in both - no conflict
|
|
139
|
+
merged[key] = oursVal;
|
|
140
|
+
}
|
|
141
|
+
else if (isPlainObject(oursVal) && isPlainObject(theirsVal)) {
|
|
142
|
+
// Both modified nested objects - recurse
|
|
143
|
+
const result = mergeObjects(isPlainObject(baseVal) ? baseVal : undefined, oursVal, theirsVal, fieldPath);
|
|
144
|
+
merged[key] = result.merged;
|
|
145
|
+
conflicts.push(...result.conflicts);
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
// Both modified scalar field with different values - conflict
|
|
149
|
+
conflicts.push({
|
|
150
|
+
type: "scalar_field",
|
|
151
|
+
path: fieldPath,
|
|
152
|
+
oursValue: oursVal,
|
|
153
|
+
theirsValue: theirsVal,
|
|
154
|
+
description: `Field "${key}" modified with different values in both branches`,
|
|
155
|
+
});
|
|
156
|
+
// Default to ours for now (will be resolved interactively)
|
|
157
|
+
merged[key] = oursVal;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
continue;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
return { merged, conflicts };
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Compare two values for equality.
|
|
167
|
+
* Handles primitives, arrays, and objects.
|
|
168
|
+
*/
|
|
169
|
+
function valuesEqual(a, b) {
|
|
170
|
+
// Handle primitives
|
|
171
|
+
if (a === b)
|
|
172
|
+
return true;
|
|
173
|
+
// Handle null/undefined
|
|
174
|
+
if (a == null || b == null)
|
|
175
|
+
return a === b;
|
|
176
|
+
// Handle arrays
|
|
177
|
+
if (Array.isArray(a) && Array.isArray(b)) {
|
|
178
|
+
if (a.length !== b.length)
|
|
179
|
+
return false;
|
|
180
|
+
return a.every((val, idx) => valuesEqual(val, b[idx]));
|
|
181
|
+
}
|
|
182
|
+
// Handle objects
|
|
183
|
+
if (isPlainObject(a) && isPlainObject(b)) {
|
|
184
|
+
const aKeys = Object.keys(a);
|
|
185
|
+
const bKeys = Object.keys(b);
|
|
186
|
+
if (aKeys.length !== bKeys.length)
|
|
187
|
+
return false;
|
|
188
|
+
return aKeys.every((key) => valuesEqual(a[key], b[key]));
|
|
189
|
+
}
|
|
190
|
+
// Different types or values
|
|
191
|
+
return false;
|
|
192
|
+
}
|
|
193
|
+
//# sourceMappingURL=objects.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"objects.js","sourceRoot":"","sources":["../../src/merge/objects.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAcH;;GAEG;AACH,SAAS,aAAa,CAAC,KAAc;IACnC,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QACrB,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,KAAK,MAAM,CAAC,SAAS,CAClD,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,UAAU,YAAY,CAC1B,IAAyC,EACzC,IAAyC,EACzC,MAA2C,EAC3C,IAAI,GAAG,EAAE;IAET,MAAM,OAAO,GAAG,IAAI,IAAI,EAAE,CAAC;IAC3B,MAAM,OAAO,GAAG,IAAI,IAAI,EAAE,CAAC;IAC3B,MAAM,SAAS,GAAG,MAAM,IAAI,EAAE,CAAC;IAE/B,MAAM,MAAM,GAA4B,EAAE,CAAC;IAC3C,MAAM,SAAS,GAAmB,EAAE,CAAC;IAErC,2CAA2C;IAC3C,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC;QACtB,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;QACvB,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;QACvB,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC;KAC1B,CAAC,CAAC;IAEH,KAAK,MAAM,GAAG,IAAI,OAAO,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AAU;IACzC,oBAAoB;IACpB,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAEzB,wBAAwB;IACxB,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,IAAI;QAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IAE3C,gBAAgB;IAChB,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;QACzC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;YAAE,OAAO,KAAK,CAAC;QACxC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACzD,CAAC;IAED,iBAAiB;IACjB,IAAI,aAAa,CAAC,CAAC,CAAC,IAAI,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;QACzC,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC7B,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC7B,IAAI,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM;YAAE,OAAO,KAAK,CAAC;QAChD,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAC3D,CAAC;IAED,4BAA4B;IAC5B,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
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 type { ParseResult } from "./types.js";
|
|
8
|
+
/**
|
|
9
|
+
* Parse all three versions of a YAML file.
|
|
10
|
+
*
|
|
11
|
+
* AC: @yaml-merge-driver ac-1
|
|
12
|
+
* Parses base, ours, and theirs as structured data instead of text.
|
|
13
|
+
*
|
|
14
|
+
* AC: @yaml-merge-driver ac-11
|
|
15
|
+
* Returns parse failure if any file cannot be parsed.
|
|
16
|
+
*
|
|
17
|
+
* @param basePath Path to base version (common ancestor)
|
|
18
|
+
* @param oursPath Path to ours version (current branch)
|
|
19
|
+
* @param theirsPath Path to theirs version (incoming branch)
|
|
20
|
+
* @returns ParseResult with parsed versions or error
|
|
21
|
+
*/
|
|
22
|
+
export declare function parseYamlVersions(basePath: string, oursPath: string, theirsPath: string): Promise<ParseResult>;
|
|
23
|
+
//# sourceMappingURL=parse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../src/merge/parse.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAkB,MAAM,YAAY,CAAC;AAE9D;;;;;;;;;;;;;GAaG;AACH,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,WAAW,CAAC,CAuDtB"}
|
|
@@ -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,GA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
|
+
*
|
|
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"}
|