@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 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/export/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JSON Export Module
|
|
3
|
+
*
|
|
4
|
+
* Generates JSON snapshots of kspec data for static site hosting.
|
|
5
|
+
* Handles reference resolution, trait expansion, and validation inclusion.
|
|
6
|
+
*
|
|
7
|
+
* AC: @gh-pages-export ac-1, ac-2, ac-3, ac-4, ac-5
|
|
8
|
+
*/
|
|
9
|
+
import type { ExportStats, KspecSnapshot } from "./types.js";
|
|
10
|
+
/**
|
|
11
|
+
* Generate a JSON snapshot of all kspec data.
|
|
12
|
+
* AC: @gh-pages-export ac-1, ac-2, ac-3, ac-4, ac-5
|
|
13
|
+
*/
|
|
14
|
+
export declare function generateJsonSnapshot(includeValidation?: boolean): Promise<KspecSnapshot>;
|
|
15
|
+
/**
|
|
16
|
+
* Calculate export statistics for dry-run.
|
|
17
|
+
* AC: @gh-pages-export ac-7
|
|
18
|
+
*/
|
|
19
|
+
export declare function calculateExportStats(snapshot: KspecSnapshot): ExportStats;
|
|
20
|
+
/**
|
|
21
|
+
* Format bytes to human-readable size.
|
|
22
|
+
*/
|
|
23
|
+
export declare function formatBytes(bytes: number): string;
|
|
24
|
+
//# sourceMappingURL=json.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../src/export/json.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAqBH,OAAO,KAAK,EAIV,WAAW,EAEX,aAAa,EACd,MAAM,YAAY,CAAC;AA+IpB;;;GAGG;AACH,wBAAsB,oBAAoB,CACxC,iBAAiB,UAAQ,GACxB,OAAO,CAAC,aAAa,CAAC,CAoDxB;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,aAAa,GAAG,WAAW,CAazE;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAIjD"}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JSON Export Module
|
|
3
|
+
*
|
|
4
|
+
* Generates JSON snapshots of kspec data for static site hosting.
|
|
5
|
+
* Handles reference resolution, trait expansion, and validation inclusion.
|
|
6
|
+
*
|
|
7
|
+
* AC: @gh-pages-export ac-1, ac-2, ac-3, ac-4, ac-5
|
|
8
|
+
*/
|
|
9
|
+
import * as fs from "node:fs/promises";
|
|
10
|
+
import * as path from "node:path";
|
|
11
|
+
import { buildIndexes, computeACCoverage, initContext, loadAllItems, loadAllTasks, loadInboxItems, loadMetaContext, scanTestCoverage, validate, } from "../parser/index.js";
|
|
12
|
+
import { loadSessionContext } from "../parser/meta.js";
|
|
13
|
+
/**
|
|
14
|
+
* Get the kspec version from package.json
|
|
15
|
+
*/
|
|
16
|
+
async function getKspecVersion() {
|
|
17
|
+
try {
|
|
18
|
+
// Try to find package.json relative to this module
|
|
19
|
+
const packagePath = path.resolve(import.meta.dirname || __dirname, "../../package.json");
|
|
20
|
+
const packageJson = JSON.parse(await fs.readFile(packagePath, "utf-8"));
|
|
21
|
+
return packageJson.version || "unknown";
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
return "unknown";
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Resolve spec_ref to its title for display.
|
|
29
|
+
* AC: @gh-pages-export ac-3
|
|
30
|
+
*/
|
|
31
|
+
function resolveSpecRefTitle(specRef, items, refIndex) {
|
|
32
|
+
if (!specRef)
|
|
33
|
+
return undefined;
|
|
34
|
+
const result = refIndex.resolve(specRef);
|
|
35
|
+
if (!result.ok)
|
|
36
|
+
return undefined;
|
|
37
|
+
const item = items.find((i) => i._ulid === result.ulid);
|
|
38
|
+
return item?.title;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Expand tasks with resolved spec reference titles.
|
|
42
|
+
* AC: @gh-pages-export ac-3
|
|
43
|
+
*/
|
|
44
|
+
function expandTasks(tasks, items, refIndex) {
|
|
45
|
+
return tasks.map((task) => {
|
|
46
|
+
const exportedTask = { ...task };
|
|
47
|
+
if (task.spec_ref) {
|
|
48
|
+
const title = resolveSpecRefTitle(task.spec_ref, items, refIndex);
|
|
49
|
+
if (title) {
|
|
50
|
+
exportedTask.spec_ref_title = title;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return exportedTask;
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Get inherited ACs from traits for a spec item.
|
|
58
|
+
* AC: @gh-pages-export ac-4
|
|
59
|
+
*/
|
|
60
|
+
function getInheritedACs(item, traitIndex) {
|
|
61
|
+
const inheritedAC = traitIndex.getInheritedAC(item._ulid);
|
|
62
|
+
return inheritedAC.map(({ trait, ac }) => ({
|
|
63
|
+
...ac,
|
|
64
|
+
_inherited_from: `@${trait.slug}`,
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Expand items with inherited ACs from traits and test coverage.
|
|
69
|
+
* AC: @gh-pages-export ac-4
|
|
70
|
+
* AC: @web-dashboard ac-15 - Add test coverage for static mode
|
|
71
|
+
*/
|
|
72
|
+
function expandItems(items, traitIndex, coveredACs) {
|
|
73
|
+
return items.map((item) => {
|
|
74
|
+
// Compute coverage for acceptance criteria using shared utility
|
|
75
|
+
const acWithCoverage = item.acceptance_criteria && item.acceptance_criteria.length > 0
|
|
76
|
+
? computeACCoverage(item, coveredACs)
|
|
77
|
+
: item.acceptance_criteria;
|
|
78
|
+
const exportedItem = {
|
|
79
|
+
...item,
|
|
80
|
+
acceptance_criteria: acWithCoverage,
|
|
81
|
+
};
|
|
82
|
+
// Get inherited ACs from traits
|
|
83
|
+
const inheritedACs = getInheritedACs(item, traitIndex);
|
|
84
|
+
if (inheritedACs.length > 0) {
|
|
85
|
+
exportedItem.inherited_acs = inheritedACs;
|
|
86
|
+
}
|
|
87
|
+
return exportedItem;
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Convert validation result to exported format.
|
|
92
|
+
* AC: @gh-pages-export ac-5
|
|
93
|
+
*/
|
|
94
|
+
function convertValidationResult(result) {
|
|
95
|
+
return {
|
|
96
|
+
valid: result.valid,
|
|
97
|
+
errorCount: result.schemaErrors.length + result.refErrors.length,
|
|
98
|
+
warningCount: result.orphans.length + result.completenessWarnings.length,
|
|
99
|
+
errors: [
|
|
100
|
+
...result.schemaErrors.map((e) => ({
|
|
101
|
+
file: e.file,
|
|
102
|
+
message: e.message,
|
|
103
|
+
path: e.path,
|
|
104
|
+
})),
|
|
105
|
+
...result.refErrors.map((e) => ({
|
|
106
|
+
file: e.sourceFile || "unknown",
|
|
107
|
+
message: e.message,
|
|
108
|
+
})),
|
|
109
|
+
],
|
|
110
|
+
warnings: [
|
|
111
|
+
...result.orphans.map((o) => ({
|
|
112
|
+
file: "orphan",
|
|
113
|
+
message: `Orphaned ${o.type}: ${o.title}`,
|
|
114
|
+
})),
|
|
115
|
+
...result.completenessWarnings.map((w) => ({
|
|
116
|
+
file: w.itemRef,
|
|
117
|
+
message: w.message,
|
|
118
|
+
})),
|
|
119
|
+
],
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Generate a JSON snapshot of all kspec data.
|
|
124
|
+
* AC: @gh-pages-export ac-1, ac-2, ac-3, ac-4, ac-5
|
|
125
|
+
*/
|
|
126
|
+
export async function generateJsonSnapshot(includeValidation = false) {
|
|
127
|
+
const ctx = await initContext();
|
|
128
|
+
// Load all data
|
|
129
|
+
const tasks = await loadAllTasks(ctx);
|
|
130
|
+
const items = await loadAllItems(ctx);
|
|
131
|
+
const inboxItems = await loadInboxItems(ctx);
|
|
132
|
+
const metaContext = await loadMetaContext(ctx);
|
|
133
|
+
const sessionContext = await loadSessionContext(ctx);
|
|
134
|
+
// Build indexes
|
|
135
|
+
const { refIndex, traitIndex } = await buildIndexes(ctx);
|
|
136
|
+
// Scan test coverage for AC annotations
|
|
137
|
+
const coveredACs = await scanTestCoverage(ctx.rootDir);
|
|
138
|
+
// Expand tasks with resolved spec references
|
|
139
|
+
const exportedTasks = expandTasks(tasks, items, refIndex);
|
|
140
|
+
// Expand items with inherited ACs and test coverage
|
|
141
|
+
const exportedItems = expandItems(items, traitIndex, coveredACs);
|
|
142
|
+
// Build the snapshot
|
|
143
|
+
const snapshot = {
|
|
144
|
+
version: await getKspecVersion(),
|
|
145
|
+
exported_at: new Date().toISOString(),
|
|
146
|
+
project: {
|
|
147
|
+
name: ctx.manifest?.project?.name || "Unknown Project",
|
|
148
|
+
version: ctx.manifest?.project?.version,
|
|
149
|
+
},
|
|
150
|
+
tasks: exportedTasks,
|
|
151
|
+
items: exportedItems,
|
|
152
|
+
inbox: inboxItems,
|
|
153
|
+
session: sessionContext,
|
|
154
|
+
observations: metaContext.observations,
|
|
155
|
+
agents: metaContext.agents,
|
|
156
|
+
workflows: metaContext.workflows,
|
|
157
|
+
conventions: metaContext.conventions,
|
|
158
|
+
};
|
|
159
|
+
// Include validation if requested
|
|
160
|
+
if (includeValidation) {
|
|
161
|
+
const validationResult = await validate(ctx, {
|
|
162
|
+
schema: true,
|
|
163
|
+
refs: true,
|
|
164
|
+
orphans: true,
|
|
165
|
+
completeness: true,
|
|
166
|
+
});
|
|
167
|
+
snapshot.validation = convertValidationResult(validationResult);
|
|
168
|
+
}
|
|
169
|
+
return snapshot;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Calculate export statistics for dry-run.
|
|
173
|
+
* AC: @gh-pages-export ac-7
|
|
174
|
+
*/
|
|
175
|
+
export function calculateExportStats(snapshot) {
|
|
176
|
+
const jsonString = JSON.stringify(snapshot);
|
|
177
|
+
return {
|
|
178
|
+
taskCount: snapshot.tasks.length,
|
|
179
|
+
itemCount: snapshot.items.length,
|
|
180
|
+
inboxCount: snapshot.inbox.length,
|
|
181
|
+
observationCount: snapshot.observations.length,
|
|
182
|
+
agentCount: snapshot.agents.length,
|
|
183
|
+
workflowCount: snapshot.workflows.length,
|
|
184
|
+
conventionCount: snapshot.conventions.length,
|
|
185
|
+
estimatedSizeBytes: Buffer.byteLength(jsonString, "utf-8"),
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Format bytes to human-readable size.
|
|
190
|
+
*/
|
|
191
|
+
export function formatBytes(bytes) {
|
|
192
|
+
if (bytes < 1024)
|
|
193
|
+
return `${bytes} B`;
|
|
194
|
+
if (bytes < 1024 * 1024)
|
|
195
|
+
return `${(bytes / 1024).toFixed(1)} KB`;
|
|
196
|
+
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
197
|
+
}
|
|
198
|
+
//# sourceMappingURL=json.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json.js","sourceRoot":"","sources":["../../src/export/json.ts"],"names":[],"mappings":"AAAA;;;;;;;GA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,KAAK,GAAG,IAAI,GAAG,IAAI;QAAE,OAAO,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;IAClE,OAAO,GAAG,CAAC,KAAK,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Triage Export Formatter
|
|
3
|
+
*
|
|
4
|
+
* Shared formatter for triage record exports, used by both CLI and daemon API.
|
|
5
|
+
* Two formats: structured JSON and markdown context block.
|
|
6
|
+
*
|
|
7
|
+
* AC: @triage-agent-export ac-1, ac-2, ac-3, ac-4
|
|
8
|
+
*/
|
|
9
|
+
import type { TriageRecord } from "../schema/triage.js";
|
|
10
|
+
/**
|
|
11
|
+
* Truncate text to a maximum length, taking only the first line.
|
|
12
|
+
*/
|
|
13
|
+
export declare function truncateText(text: string, maxLen?: number): string;
|
|
14
|
+
/**
|
|
15
|
+
* Format a single triage record as a markdown context block.
|
|
16
|
+
* AC: @triage-agent-export ac-1
|
|
17
|
+
* AC: @triage-agent-export ac-3
|
|
18
|
+
*/
|
|
19
|
+
export declare function formatTriageRecordContext(record: TriageRecord): string;
|
|
20
|
+
/**
|
|
21
|
+
* Export triage records in context (markdown) format.
|
|
22
|
+
* AC: @triage-agent-export ac-1 — markdown block per record
|
|
23
|
+
* AC: @triage-agent-export ac-3 — overrides included
|
|
24
|
+
* AC: @triage-agent-export ac-4 — empty result message
|
|
25
|
+
*/
|
|
26
|
+
export declare function exportTriageAsContext(records: TriageRecord[]): string;
|
|
27
|
+
/**
|
|
28
|
+
* Export result for JSON format.
|
|
29
|
+
* AC: @triage-agent-export ac-2 — JSON array with full objects
|
|
30
|
+
* AC: @triage-agent-export ac-3 — overrides included (full objects)
|
|
31
|
+
* AC: @triage-agent-export ac-4 — empty array when no records
|
|
32
|
+
*/
|
|
33
|
+
export interface TriageJsonExport {
|
|
34
|
+
format: "json";
|
|
35
|
+
items: TriageRecord[];
|
|
36
|
+
total: number;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Export result for context format.
|
|
40
|
+
*/
|
|
41
|
+
export interface TriageContextExport {
|
|
42
|
+
format: "context";
|
|
43
|
+
content: string;
|
|
44
|
+
}
|
|
45
|
+
export type TriageExportResult = TriageJsonExport | TriageContextExport;
|
|
46
|
+
/**
|
|
47
|
+
* Export triage records in the requested format.
|
|
48
|
+
* AC: @triage-agent-export ac-1, ac-2, ac-3, ac-4
|
|
49
|
+
*/
|
|
50
|
+
export declare function exportTriageRecords(records: TriageRecord[], format: "json" | "context"): TriageExportResult;
|
|
51
|
+
//# sourceMappingURL=triage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"triage.d.ts","sourceRoot":"","sources":["../../src/export/triage.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,GAAE,MAAW,GAAG,MAAM,CAItE;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAsBtE;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,MAAM,CASrE;AAED;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,SAAS,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,kBAAkB,GAAG,gBAAgB,GAAG,mBAAmB,CAAC;AAExE;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,YAAY,EAAE,EACvB,MAAM,EAAE,MAAM,GAAG,SAAS,GACzB,kBAAkB,CAYpB"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Triage Export Formatter
|
|
3
|
+
*
|
|
4
|
+
* Shared formatter for triage record exports, used by both CLI and daemon API.
|
|
5
|
+
* Two formats: structured JSON and markdown context block.
|
|
6
|
+
*
|
|
7
|
+
* AC: @triage-agent-export ac-1, ac-2, ac-3, ac-4
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Truncate text to a maximum length, taking only the first line.
|
|
11
|
+
*/
|
|
12
|
+
export function truncateText(text, maxLen = 60) {
|
|
13
|
+
const firstLine = text.split("\n")[0].trim();
|
|
14
|
+
if (firstLine.length <= maxLen)
|
|
15
|
+
return firstLine;
|
|
16
|
+
return `${firstLine.slice(0, maxLen - 3)}...`;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Format a single triage record as a markdown context block.
|
|
20
|
+
* AC: @triage-agent-export ac-1
|
|
21
|
+
* AC: @triage-agent-export ac-3
|
|
22
|
+
*/
|
|
23
|
+
export function formatTriageRecordContext(record) {
|
|
24
|
+
const lines = [];
|
|
25
|
+
lines.push(`### ${record._ulid.slice(0, 8)} — ${truncateText(record.item_snapshot, 80)}`);
|
|
26
|
+
lines.push("");
|
|
27
|
+
lines.push(`**Item:** ${record.item_snapshot}`);
|
|
28
|
+
lines.push(`**Status:** ${record.status}`);
|
|
29
|
+
if (record.action)
|
|
30
|
+
lines.push(`**Action:** ${record.action}`);
|
|
31
|
+
if (record.reasoning)
|
|
32
|
+
lines.push(`**Reasoning:** ${record.reasoning}`);
|
|
33
|
+
if (record.decided_by)
|
|
34
|
+
lines.push(`**Decided by:** ${record.decided_by}`);
|
|
35
|
+
if (record.evidence_refs.length > 0) {
|
|
36
|
+
lines.push(`**Evidence:** ${record.evidence_refs.join(", ")}`);
|
|
37
|
+
}
|
|
38
|
+
// AC: @triage-agent-export ac-3 — include override information
|
|
39
|
+
if (record.override_reasoning) {
|
|
40
|
+
lines.push(`**Override:** ${record.override_reasoning} (by ${record.override_by || "unknown"})`);
|
|
41
|
+
}
|
|
42
|
+
if (record.acted_at) {
|
|
43
|
+
lines.push(`**Acted at:** ${record.acted_at}`);
|
|
44
|
+
if (record.result_ref)
|
|
45
|
+
lines.push(`**Result:** ${record.result_ref}`);
|
|
46
|
+
}
|
|
47
|
+
lines.push("");
|
|
48
|
+
return lines.join("\n");
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Export triage records in context (markdown) format.
|
|
52
|
+
* AC: @triage-agent-export ac-1 — markdown block per record
|
|
53
|
+
* AC: @triage-agent-export ac-3 — overrides included
|
|
54
|
+
* AC: @triage-agent-export ac-4 — empty result message
|
|
55
|
+
*/
|
|
56
|
+
export function exportTriageAsContext(records) {
|
|
57
|
+
if (records.length === 0) {
|
|
58
|
+
return "No triage decisions recorded.";
|
|
59
|
+
}
|
|
60
|
+
let content = "# Triage Decisions\n\n";
|
|
61
|
+
for (const record of records) {
|
|
62
|
+
content += formatTriageRecordContext(record);
|
|
63
|
+
}
|
|
64
|
+
return content;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Export triage records in the requested format.
|
|
68
|
+
* AC: @triage-agent-export ac-1, ac-2, ac-3, ac-4
|
|
69
|
+
*/
|
|
70
|
+
export function exportTriageRecords(records, format) {
|
|
71
|
+
if (format === "context") {
|
|
72
|
+
return {
|
|
73
|
+
format: "context",
|
|
74
|
+
content: exportTriageAsContext(records),
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
return {
|
|
78
|
+
format: "json",
|
|
79
|
+
items: records,
|
|
80
|
+
total: records.length,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=triage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version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,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,OAAO;QACd,KAAK,EAAE,OAAO,CAAC,MAAM;KACtB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Export Types
|
|
3
|
+
*
|
|
4
|
+
* Types for the kspec export functionality.
|
|
5
|
+
* These define the structure of exported JSON snapshots and related types.
|
|
6
|
+
* AC: @gh-pages-export ac-2, ac-3, ac-4
|
|
7
|
+
*/
|
|
8
|
+
import type { AcceptanceCriterion, Agent, Convention, InboxItem, Observation, SessionContext, Workflow } from "../schema/index.js";
|
|
9
|
+
import type { LoadedSpecItem, LoadedTask } from "../parser/yaml.js";
|
|
10
|
+
/**
|
|
11
|
+
* Exported task with resolved spec reference title.
|
|
12
|
+
* AC: @gh-pages-export ac-3
|
|
13
|
+
*/
|
|
14
|
+
export interface ExportedTask extends LoadedTask {
|
|
15
|
+
/** Resolved title of the linked spec item (for display) */
|
|
16
|
+
spec_ref_title?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Acceptance criterion with inheritance tracking.
|
|
20
|
+
* AC: @gh-pages-export ac-4
|
|
21
|
+
*/
|
|
22
|
+
export interface InheritedAC extends AcceptanceCriterion {
|
|
23
|
+
/** Reference to the trait this AC was inherited from */
|
|
24
|
+
_inherited_from: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Exported spec item with nested hierarchy and inherited ACs.
|
|
28
|
+
* AC: @gh-pages-export ac-4
|
|
29
|
+
*/
|
|
30
|
+
export interface ExportedItem extends Omit<LoadedSpecItem, 'acceptance_criteria'> {
|
|
31
|
+
/** Own acceptance criteria */
|
|
32
|
+
acceptance_criteria?: AcceptanceCriterion[];
|
|
33
|
+
/** Nested child items */
|
|
34
|
+
children?: ExportedItem[];
|
|
35
|
+
/** Acceptance criteria inherited from traits */
|
|
36
|
+
inherited_acs?: InheritedAC[];
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Project metadata in the snapshot.
|
|
40
|
+
* AC: @gh-pages-export ac-2
|
|
41
|
+
*/
|
|
42
|
+
export interface ExportedProject {
|
|
43
|
+
name: string;
|
|
44
|
+
version?: string;
|
|
45
|
+
description?: string;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Validation result included in the snapshot.
|
|
49
|
+
* AC: @gh-pages-export ac-5
|
|
50
|
+
*/
|
|
51
|
+
export interface ExportedValidation {
|
|
52
|
+
valid: boolean;
|
|
53
|
+
errorCount: number;
|
|
54
|
+
warningCount: number;
|
|
55
|
+
errors: Array<{
|
|
56
|
+
file: string;
|
|
57
|
+
message: string;
|
|
58
|
+
path?: string;
|
|
59
|
+
}>;
|
|
60
|
+
warnings: Array<{
|
|
61
|
+
file: string;
|
|
62
|
+
message: string;
|
|
63
|
+
}>;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Full kspec snapshot structure.
|
|
67
|
+
* AC: @gh-pages-export ac-2
|
|
68
|
+
*/
|
|
69
|
+
export interface KspecSnapshot {
|
|
70
|
+
/** kspec version that generated this snapshot */
|
|
71
|
+
version: string;
|
|
72
|
+
/** ISO timestamp when the snapshot was exported */
|
|
73
|
+
exported_at: string;
|
|
74
|
+
/** Project metadata */
|
|
75
|
+
project: ExportedProject;
|
|
76
|
+
/** All tasks with resolved spec references */
|
|
77
|
+
tasks: ExportedTask[];
|
|
78
|
+
/** All spec items with hierarchy and inherited ACs */
|
|
79
|
+
items: ExportedItem[];
|
|
80
|
+
/** Inbox items */
|
|
81
|
+
inbox: InboxItem[];
|
|
82
|
+
/** Session context */
|
|
83
|
+
session: SessionContext | null;
|
|
84
|
+
/** Observations */
|
|
85
|
+
observations: Observation[];
|
|
86
|
+
/** Agents */
|
|
87
|
+
agents: Agent[];
|
|
88
|
+
/** Workflows */
|
|
89
|
+
workflows: Workflow[];
|
|
90
|
+
/** Conventions */
|
|
91
|
+
conventions: Convention[];
|
|
92
|
+
/** Validation results (optional) */
|
|
93
|
+
validation?: ExportedValidation;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Options for the export command.
|
|
97
|
+
*/
|
|
98
|
+
export interface ExportOptions {
|
|
99
|
+
/** Output format */
|
|
100
|
+
format: 'json' | 'html';
|
|
101
|
+
/** Output path (optional, defaults to stdout for json) */
|
|
102
|
+
output?: string;
|
|
103
|
+
/** Include validation results */
|
|
104
|
+
includeValidation?: boolean;
|
|
105
|
+
/** Dry run - show stats without writing */
|
|
106
|
+
dryRun?: boolean;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Statistics shown during dry-run.
|
|
110
|
+
* AC: @gh-pages-export ac-7
|
|
111
|
+
*/
|
|
112
|
+
export interface ExportStats {
|
|
113
|
+
taskCount: number;
|
|
114
|
+
itemCount: number;
|
|
115
|
+
inboxCount: number;
|
|
116
|
+
observationCount: number;
|
|
117
|
+
agentCount: number;
|
|
118
|
+
workflowCount: number;
|
|
119
|
+
conventionCount: number;
|
|
120
|
+
estimatedSizeBytes: number;
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/export/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACV,mBAAmB,EACnB,KAAK,EACL,UAAU,EACV,SAAS,EACT,WAAW,EACX,cAAc,EACd,QAAQ,EACT,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpE;;;GAGG;AACH,MAAM,WAAW,YAAa,SAAQ,UAAU;IAC9C,2DAA2D;IAC3D,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,WAAY,SAAQ,mBAAmB;IACtD,wDAAwD;IACxD,eAAe,EAAE,MAAM,CAAC;CACzB;AAED;;;GA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ACb,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,gBAAgB;IAChB,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,kBAAkB;IAClB,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,oCAAoC;IACpC,UAAU,CAAC,EAAE,kBAAkB,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,oBAAoB;IACpB,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,0DAA0D;IAC1D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iCAAiC;IACjC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,2CAA2C;IAC3C,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,kBAAkB,EAAE,MAAM,CAAC;CAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/export/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
1
|
+
export * from "./parser/index.js";
|
|
2
|
+
export * from "./schema/index.js";
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Kynetic Spec - Main library entry point
|
|
2
2
|
// Re-export everything for library consumers
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
3
|
+
export * from "./parser/index.js";
|
|
4
|
+
export * from "./schema/index.js";
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Claude Code plugin marketplace registry library.
|
|
3
|
+
*
|
|
4
|
+
* Shared by setup.ts and skill-install.ts for registering the kspec core
|
|
5
|
+
* skills plugin with Claude Code's global state.
|
|
6
|
+
*
|
|
7
|
+
* AC: @core-skill-install ac-6, ac-7, ac-8
|
|
8
|
+
* AC: @enhanced-setup ac-7, ac-8
|
|
9
|
+
*/
|
|
10
|
+
export interface RegisterResult {
|
|
11
|
+
success: boolean;
|
|
12
|
+
action: "registered" | "updated" | "unchanged" | "skipped" | "error";
|
|
13
|
+
message: string;
|
|
14
|
+
registeredPath?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface EnableResult {
|
|
17
|
+
success: boolean;
|
|
18
|
+
action: "enabled" | "unchanged" | "error";
|
|
19
|
+
message: string;
|
|
20
|
+
}
|
|
21
|
+
export type MarketplaceHealthStatus = "healthy" | "missing" | "path-broken" | "version-mismatch" | "error";
|
|
22
|
+
export interface MarketplaceHealth {
|
|
23
|
+
status: MarketplaceHealthStatus;
|
|
24
|
+
registeredPath?: string;
|
|
25
|
+
pluginVersion?: string;
|
|
26
|
+
packageVersion?: string;
|
|
27
|
+
message: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Get the Claude Code plugins directory.
|
|
31
|
+
* Respects KSPEC_CLAUDE_HOME env override for test isolation.
|
|
32
|
+
*/
|
|
33
|
+
export declare function getClaudePluginsDir(): string;
|
|
34
|
+
/**
|
|
35
|
+
* Get the absolute path to the pre-built plugin directory in the npm package.
|
|
36
|
+
* Uses fs.realpath for symlink/pnpm stability.
|
|
37
|
+
*/
|
|
38
|
+
export declare function getPackagePluginDir(): Promise<string>;
|
|
39
|
+
/**
|
|
40
|
+
* Register the kspec core plugin marketplace in Claude Code's global state.
|
|
41
|
+
* Writes kspec-plugins entry to known_marketplaces.json.
|
|
42
|
+
* Only updates lastUpdated when path actually changes (idempotent).
|
|
43
|
+
* Validates plugin/.claude-plugin/plugin.json exists before registering.
|
|
44
|
+
*
|
|
45
|
+
* AC: @core-skill-install ac-6, ac-8
|
|
46
|
+
*/
|
|
47
|
+
export declare function registerCorePluginMarketplace(opts?: {
|
|
48
|
+
dryRun?: boolean;
|
|
49
|
+
}): Promise<RegisterResult>;
|
|
50
|
+
/**
|
|
51
|
+
* Enable the kspec plugin in a project's .claude/settings.json.
|
|
52
|
+
* Uses strict JSON read to avoid silently discarding hooks config.
|
|
53
|
+
*
|
|
54
|
+
* AC: @core-skill-install ac-7
|
|
55
|
+
*/
|
|
56
|
+
export declare function enablePluginInProject(projectDir: string, opts?: {
|
|
57
|
+
dryRun?: boolean;
|
|
58
|
+
}): Promise<EnableResult>;
|
|
59
|
+
/**
|
|
60
|
+
* Check the health of the kspec marketplace registration.
|
|
61
|
+
* Returns status and details for setup --status reporting.
|
|
62
|
+
*
|
|
63
|
+
* AC: @enhanced-setup ac-7, ac-8
|
|
64
|
+
*/
|
|
65
|
+
export declare function checkMarketplaceHealth(): Promise<MarketplaceHealth>;
|
|
66
|
+
//# sourceMappingURL=claude-plugin-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-plugin-registry.d.ts","sourceRoot":"","sources":["../../src/lib/claude-plugin-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAUH,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,YAAY,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,OAAO,CAAC;IACrE,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,SAAS,GAAG,WAAW,GAAG,OAAO,CAAC;IAC1C,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAA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