@ambystech/ambykit 1.3.0 → 1.5.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/CHANGELOG.md +125 -1
- package/README.md +16 -4
- package/dist/cli/activity.d.ts +5 -1
- package/dist/cli/activity.js +22 -8
- package/dist/cli/activity.js.map +1 -1
- package/dist/cli/add.js +12 -5
- package/dist/cli/add.js.map +1 -1
- package/dist/cli/analyze.d.ts +1 -1
- package/dist/cli/analyze.js +83 -6
- package/dist/cli/analyze.js.map +1 -1
- package/dist/cli/base-command.js +12 -0
- package/dist/cli/base-command.js.map +1 -1
- package/dist/cli/check.js +36 -3
- package/dist/cli/check.js.map +1 -1
- package/dist/cli/dashboard.js +3 -1
- package/dist/cli/dashboard.js.map +1 -1
- package/dist/cli/directive.d.ts +7 -0
- package/dist/cli/directive.js +43 -0
- package/dist/cli/directive.js.map +1 -0
- package/dist/cli/fleet.d.ts +16 -0
- package/dist/cli/fleet.js +472 -0
- package/dist/cli/fleet.js.map +1 -0
- package/dist/cli/graph.d.ts +13 -0
- package/dist/cli/graph.js +40 -0
- package/dist/cli/graph.js.map +1 -0
- package/dist/cli/index.js +12 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/io/fsops.d.ts +9 -0
- package/dist/cli/io/fsops.js +70 -1
- package/dist/cli/io/fsops.js.map +1 -1
- package/dist/cli/lane.d.ts +20 -0
- package/dist/cli/lane.js +396 -0
- package/dist/cli/lane.js.map +1 -0
- package/dist/cli/mcp.d.ts +21 -0
- package/dist/cli/mcp.js +27 -0
- package/dist/cli/mcp.js.map +1 -0
- package/dist/cli/sync.d.ts +9 -1
- package/dist/cli/sync.js +61 -7
- package/dist/cli/sync.js.map +1 -1
- package/dist/cli/trace.d.ts +14 -0
- package/dist/cli/trace.js +89 -0
- package/dist/cli/trace.js.map +1 -0
- package/dist/cli/ui/dashboard/feature-chart.js +15 -2
- package/dist/cli/ui/dashboard/feature-chart.js.map +1 -1
- package/dist/cli/ui/dashboard/feature-view.js +11 -1
- package/dist/cli/ui/dashboard/feature-view.js.map +1 -1
- package/dist/cli/ui/dashboard/graph-view.d.ts +44 -0
- package/dist/cli/ui/dashboard/graph-view.js +78 -0
- package/dist/cli/ui/dashboard/graph-view.js.map +1 -0
- package/dist/cli/ui/dashboard/help-overlay.d.ts +1 -1
- package/dist/cli/ui/dashboard/help-overlay.js +9 -0
- package/dist/cli/ui/dashboard/help-overlay.js.map +1 -1
- package/dist/cli/ui/dashboard/live-tokens.d.ts +221 -0
- package/dist/cli/ui/dashboard/live-tokens.js +221 -0
- package/dist/cli/ui/dashboard/live-tokens.js.map +1 -1
- package/dist/cli/ui/dashboard/quality-view.d.ts +8 -0
- package/dist/cli/ui/dashboard/quality-view.js +31 -0
- package/dist/cli/ui/dashboard/quality-view.js.map +1 -0
- package/dist/cli/ui/dashboard/story-detail.d.ts +1 -1
- package/dist/cli/ui/dashboard/story-detail.js +10 -3
- package/dist/cli/ui/dashboard/story-detail.js.map +1 -1
- package/dist/cli/ui/dashboard/tokens.d.ts +26 -0
- package/dist/cli/ui/dashboard/tokens.js +26 -0
- package/dist/cli/ui/dashboard/tokens.js.map +1 -1
- package/dist/cli/ui/dashboard/worktrees-panel.js +21 -3
- package/dist/cli/ui/dashboard/worktrees-panel.js.map +1 -1
- package/dist/cli/ui/interactive/live.js +3 -0
- package/dist/cli/ui/interactive/live.js.map +1 -1
- package/dist/cli/ui/interactive/overview.d.ts +13 -1
- package/dist/cli/ui/interactive/overview.js +62 -0
- package/dist/cli/ui/interactive/overview.js.map +1 -1
- package/dist/cli/ui/interactive/prompt.d.ts +17 -2
- package/dist/cli/ui/interactive/prompt.js +39 -9
- package/dist/cli/ui/interactive/prompt.js.map +1 -1
- package/dist/cli/ui/tool-options.d.ts +3 -2
- package/dist/cli/ui/tool-options.js +3 -3
- package/dist/cli/ui/tool-options.js.map +1 -1
- package/dist/cli/update.d.ts +1 -1
- package/dist/cli/update.js +8 -3
- package/dist/cli/update.js.map +1 -1
- package/dist/core/activity.d.ts +19 -2
- package/dist/core/activity.js +23 -7
- package/dist/core/activity.js.map +1 -1
- package/dist/core/agents.d.ts +1 -1
- package/dist/core/agents.js +9 -0
- package/dist/core/agents.js.map +1 -1
- package/dist/core/analyze.d.ts +86 -2
- package/dist/core/analyze.js +211 -63
- package/dist/core/analyze.js.map +1 -1
- package/dist/core/checkouts.d.ts +11 -0
- package/dist/core/checkouts.js +84 -10
- package/dist/core/checkouts.js.map +1 -1
- package/dist/core/config.d.ts +28 -1
- package/dist/core/config.js +44 -0
- package/dist/core/config.js.map +1 -1
- package/dist/core/dashboard.d.ts +17 -0
- package/dist/core/dashboard.js +29 -1
- package/dist/core/dashboard.js.map +1 -1
- package/dist/core/decisions.d.ts +60 -0
- package/dist/core/decisions.js +231 -0
- package/dist/core/decisions.js.map +1 -0
- package/dist/core/emit.d.ts +21 -1
- package/dist/core/emit.js +93 -4
- package/dist/core/emit.js.map +1 -1
- package/dist/core/features.js +6 -1
- package/dist/core/features.js.map +1 -1
- package/dist/core/fleet/claims.d.ts +45 -0
- package/dist/core/fleet/claims.js +85 -0
- package/dist/core/fleet/claims.js.map +1 -0
- package/dist/core/fleet/directives.d.ts +56 -0
- package/dist/core/fleet/directives.js +99 -0
- package/dist/core/fleet/directives.js.map +1 -0
- package/dist/core/fleet/flow-input.d.ts +6 -0
- package/dist/core/fleet/flow-input.js +35 -0
- package/dist/core/fleet/flow-input.js.map +1 -0
- package/dist/core/fleet/index.d.ts +9 -0
- package/dist/core/fleet/index.js +10 -0
- package/dist/core/fleet/index.js.map +1 -0
- package/dist/core/fleet/lane-status.d.ts +39 -0
- package/dist/core/fleet/lane-status.js +63 -0
- package/dist/core/fleet/lane-status.js.map +1 -0
- package/dist/core/fleet/lock.d.ts +23 -0
- package/dist/core/fleet/lock.js +103 -0
- package/dist/core/fleet/lock.js.map +1 -0
- package/dist/core/fleet/notes.d.ts +31 -0
- package/dist/core/fleet/notes.js +56 -0
- package/dist/core/fleet/notes.js.map +1 -0
- package/dist/core/fleet/run-flow.d.ts +157 -0
- package/dist/core/fleet/run-flow.js +205 -0
- package/dist/core/fleet/run-flow.js.map +1 -0
- package/dist/core/fleet/runs.d.ts +46 -0
- package/dist/core/fleet/runs.js +182 -0
- package/dist/core/fleet/runs.js.map +1 -0
- package/dist/core/fleet/types.d.ts +63 -0
- package/dist/core/fleet/types.js +11 -0
- package/dist/core/fleet/types.js.map +1 -0
- package/dist/core/graph-format.d.ts +51 -0
- package/dist/core/graph-format.js +99 -0
- package/dist/core/graph-format.js.map +1 -0
- package/dist/core/graph-paths.d.ts +27 -0
- package/dist/core/graph-paths.js +94 -0
- package/dist/core/graph-paths.js.map +1 -0
- package/dist/core/graph-scope.d.ts +7 -0
- package/dist/core/graph-scope.js +31 -0
- package/dist/core/graph-scope.js.map +1 -0
- package/dist/core/graph-types.d.ts +55 -0
- package/dist/core/graph-types.js +6 -0
- package/dist/core/graph-types.js.map +1 -0
- package/dist/core/graph.d.ts +14 -0
- package/dist/core/graph.js +144 -0
- package/dist/core/graph.js.map +1 -0
- package/dist/core/index.d.ts +13 -0
- package/dist/core/index.js +13 -0
- package/dist/core/index.js.map +1 -1
- package/dist/core/lanes.d.ts +116 -0
- package/dist/core/lanes.js +225 -0
- package/dist/core/lanes.js.map +1 -0
- package/dist/core/legacy.d.ts +10 -0
- package/dist/core/legacy.js +35 -0
- package/dist/core/legacy.js.map +1 -0
- package/dist/core/markers.d.ts +44 -0
- package/dist/core/markers.js +139 -0
- package/dist/core/markers.js.map +1 -0
- package/dist/core/merge-json.d.ts +15 -0
- package/dist/core/merge-json.js +46 -0
- package/dist/core/merge-json.js.map +1 -0
- package/dist/core/moved-targets.d.ts +23 -0
- package/dist/core/moved-targets.js +23 -0
- package/dist/core/moved-targets.js.map +1 -0
- package/dist/core/overview-types.d.ts +42 -2
- package/dist/core/overview-types.js.map +1 -1
- package/dist/core/overview.d.ts +1 -1
- package/dist/core/overview.js +93 -74
- package/dist/core/overview.js.map +1 -1
- package/dist/core/path-guard.d.ts +5 -0
- package/dist/core/path-guard.js +9 -0
- package/dist/core/path-guard.js.map +1 -0
- package/dist/core/paths.d.ts +2 -0
- package/dist/core/paths.js +4 -0
- package/dist/core/paths.js.map +1 -1
- package/dist/core/query.d.ts +91 -0
- package/dist/core/query.js +197 -0
- package/dist/core/query.js.map +1 -0
- package/dist/core/report.d.ts +36 -0
- package/dist/core/report.js +62 -0
- package/dist/core/report.js.map +1 -0
- package/dist/core/rules.js +5 -2
- package/dist/core/rules.js.map +1 -1
- package/dist/core/scaffold.d.ts +2 -2
- package/dist/core/scaffold.js +3 -1
- package/dist/core/scaffold.js.map +1 -1
- package/dist/core/subagents.d.ts +29 -0
- package/dist/core/subagents.js +52 -0
- package/dist/core/subagents.js.map +1 -0
- package/dist/core/tasks-edit.d.ts +34 -0
- package/dist/core/tasks-edit.js +115 -0
- package/dist/core/tasks-edit.js.map +1 -0
- package/dist/core/test-design.d.ts +94 -0
- package/dist/core/test-design.js +325 -0
- package/dist/core/test-design.js.map +1 -0
- package/dist/core/trace-cite.d.ts +16 -0
- package/dist/core/trace-cite.js +24 -0
- package/dist/core/trace-cite.js.map +1 -0
- package/dist/core/trace-coverage.d.ts +8 -0
- package/dist/core/trace-coverage.js +40 -0
- package/dist/core/trace-coverage.js.map +1 -0
- package/dist/core/trace-design.d.ts +6 -0
- package/dist/core/trace-design.js +16 -0
- package/dist/core/trace-design.js.map +1 -0
- package/dist/core/trace-io.d.ts +14 -0
- package/dist/core/trace-io.js +97 -0
- package/dist/core/trace-io.js.map +1 -0
- package/dist/core/trace-requirements.d.ts +9 -0
- package/dist/core/trace-requirements.js +27 -0
- package/dist/core/trace-requirements.js.map +1 -0
- package/dist/core/trace-tests.d.ts +7 -0
- package/dist/core/trace-tests.js +27 -0
- package/dist/core/trace-tests.js.map +1 -0
- package/dist/core/trace-types.d.ts +81 -0
- package/dist/core/trace-types.js +3 -0
- package/dist/core/trace-types.js.map +1 -0
- package/dist/core/trace.d.ts +18 -0
- package/dist/core/trace.js +109 -0
- package/dist/core/trace.js.map +1 -0
- package/dist/core/types.d.ts +48 -1
- package/dist/core/worktree.d.ts +8 -0
- package/dist/core/worktree.js +19 -1
- package/dist/core/worktree.js.map +1 -1
- package/dist/emitters/antigravity-cli.d.ts +7 -2
- package/dist/emitters/antigravity-cli.js +11 -2
- package/dist/emitters/antigravity-cli.js.map +1 -1
- package/dist/emitters/antigravity.d.ts +14 -9
- package/dist/emitters/antigravity.js +16 -10
- package/dist/emitters/antigravity.js.map +1 -1
- package/dist/emitters/augment.d.ts +14 -0
- package/dist/emitters/augment.js +20 -0
- package/dist/emitters/augment.js.map +1 -0
- package/dist/emitters/base-emitter.d.ts +34 -0
- package/dist/emitters/base-emitter.js +50 -3
- package/dist/emitters/base-emitter.js.map +1 -1
- package/dist/emitters/claude.d.ts +12 -2
- package/dist/emitters/claude.js +34 -5
- package/dist/emitters/claude.js.map +1 -1
- package/dist/emitters/codex.d.ts +2 -9
- package/dist/emitters/codex.js +2 -19
- package/dist/emitters/codex.js.map +1 -1
- package/dist/emitters/copilot-cli.d.ts +7 -3
- package/dist/emitters/copilot-cli.js +12 -8
- package/dist/emitters/copilot-cli.js.map +1 -1
- package/dist/emitters/copilot.d.ts +5 -0
- package/dist/emitters/copilot.js +23 -1
- package/dist/emitters/copilot.js.map +1 -1
- package/dist/emitters/cursor.d.ts +3 -0
- package/dist/emitters/cursor.js +8 -1
- package/dist/emitters/cursor.js.map +1 -1
- package/dist/emitters/gemini.d.ts +14 -0
- package/dist/emitters/gemini.js +19 -0
- package/dist/emitters/gemini.js.map +1 -0
- package/dist/emitters/index.d.ts +28 -2
- package/dist/emitters/index.js +55 -4
- package/dist/emitters/index.js.map +1 -1
- package/dist/emitters/kilo.d.ts +14 -0
- package/dist/emitters/kilo.js +17 -0
- package/dist/emitters/kilo.js.map +1 -0
- package/dist/emitters/kiro.d.ts +12 -0
- package/dist/emitters/kiro.js +14 -0
- package/dist/emitters/kiro.js.map +1 -0
- package/dist/emitters/llxprt.d.ts +13 -0
- package/dist/emitters/llxprt.js +18 -0
- package/dist/emitters/llxprt.js.map +1 -0
- package/dist/emitters/opencode.d.ts +8 -0
- package/dist/emitters/opencode.js +23 -0
- package/dist/emitters/opencode.js.map +1 -1
- package/dist/emitters/qwen.d.ts +15 -0
- package/dist/emitters/qwen.js +23 -0
- package/dist/emitters/qwen.js.map +1 -0
- package/dist/emitters/skills-emitter.d.ts +21 -0
- package/dist/emitters/skills-emitter.js +39 -0
- package/dist/emitters/skills-emitter.js.map +1 -0
- package/dist/emitters/toml-command-emitter.d.ts +29 -0
- package/dist/emitters/toml-command-emitter.js +69 -0
- package/dist/emitters/toml-command-emitter.js.map +1 -0
- package/dist/emitters/windsurf.d.ts +16 -0
- package/dist/emitters/windsurf.js +21 -0
- package/dist/emitters/windsurf.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp/protocol.d.ts +44 -0
- package/dist/mcp/protocol.js +114 -0
- package/dist/mcp/protocol.js.map +1 -0
- package/dist/mcp/registry.d.ts +40 -0
- package/dist/mcp/registry.js +44 -0
- package/dist/mcp/registry.js.map +1 -0
- package/dist/mcp/server.d.ts +7 -0
- package/dist/mcp/server.js +14 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tools/common.d.ts +12 -0
- package/dist/mcp/tools/common.js +12 -0
- package/dist/mcp/tools/common.js.map +1 -0
- package/dist/mcp/tools/fleet.d.ts +10 -0
- package/dist/mcp/tools/fleet.js +102 -0
- package/dist/mcp/tools/fleet.js.map +1 -0
- package/dist/mcp/tools/index.d.ts +3 -0
- package/dist/mcp/tools/index.js +13 -0
- package/dist/mcp/tools/index.js.map +1 -0
- package/dist/mcp/tools/read.d.ts +6 -0
- package/dist/mcp/tools/read.js +62 -0
- package/dist/mcp/tools/read.js.map +1 -0
- package/dist/mcp/tools/write.d.ts +6 -0
- package/dist/mcp/tools/write.js +34 -0
- package/dist/mcp/tools/write.js.map +1 -0
- package/dist/plugins/api.d.ts +39 -0
- package/dist/plugins/api.js +28 -0
- package/dist/plugins/api.js.map +1 -0
- package/dist/plugins/index.d.ts +11 -0
- package/dist/plugins/index.js +9 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/plugins/loader.d.ts +35 -0
- package/dist/plugins/loader.js +117 -0
- package/dist/plugins/loader.js.map +1 -0
- package/dist/plugins/manifest.d.ts +21 -0
- package/dist/plugins/manifest.js +53 -0
- package/dist/plugins/manifest.js.map +1 -0
- package/dist/plugins/registry.d.ts +36 -0
- package/dist/plugins/registry.js +30 -0
- package/dist/plugins/registry.js.map +1 -0
- package/dist/plugins/report.d.ts +9 -0
- package/dist/plugins/report.js +19 -0
- package/dist/plugins/report.js.map +1 -0
- package/dist/plugins/semver.d.ts +23 -0
- package/dist/plugins/semver.js +106 -0
- package/dist/plugins/semver.js.map +1 -0
- package/dist/plugins/session.d.ts +18 -0
- package/dist/plugins/session.js +22 -0
- package/dist/plugins/session.js.map +1 -0
- package/dist/testkit/contract.d.ts +33 -0
- package/dist/testkit/contract.js +118 -0
- package/dist/testkit/contract.js.map +1 -0
- package/dist/testkit/index.d.ts +15 -0
- package/dist/testkit/index.js +15 -0
- package/dist/testkit/index.js.map +1 -0
- package/docs/architecture.md +34 -6
- package/docs/artifacts/decision-record.md +54 -0
- package/docs/artifacts/tasks.md +37 -0
- package/docs/artifacts/tests.md +43 -0
- package/docs/cli-reference.md +224 -7
- package/docs/concepts/mcp-server.md +93 -0
- package/docs/contributing.md +9 -0
- package/docs/index.md +2 -2
- package/docs/plugin-api.md +124 -0
- package/docs/plugin-split.md +55 -0
- package/docs/plugin-trust.md +51 -0
- package/docs/tool-compatibility.md +155 -18
- package/docs/workflow.md +66 -5
- package/package.json +5 -2
- package/src/agents/worker.md +37 -0
- package/src/prompts/converge.md +8 -3
- package/src/prompts/decide.md +31 -0
- package/src/prompts/implement.md +17 -8
- package/src/prompts/revise.md +4 -2
- package/src/prompts/run.md +100 -0
- package/src/prompts/tasks.md +16 -4
- package/src/roles/security.md +17 -0
- package/src/templates/adr.md +29 -0
- package/src/templates/tasks.md +8 -1
- package/src/templates/tests.md +29 -0
package/dist/emitters/index.js
CHANGED
|
@@ -7,6 +7,13 @@ import { CursorCliEmitter } from "./cursor-cli.js";
|
|
|
7
7
|
import { AntigravityEmitter } from "./antigravity.js";
|
|
8
8
|
import { AntigravityCliEmitter } from "./antigravity-cli.js";
|
|
9
9
|
import { CodexEmitter } from "./codex.js";
|
|
10
|
+
import { GeminiEmitter } from "./gemini.js";
|
|
11
|
+
import { LlxprtEmitter } from "./llxprt.js";
|
|
12
|
+
import { QwenEmitter } from "./qwen.js";
|
|
13
|
+
import { KiloEmitter } from "./kilo.js";
|
|
14
|
+
import { AugmentEmitter } from "./augment.js";
|
|
15
|
+
import { WindsurfEmitter } from "./windsurf.js";
|
|
16
|
+
import { KiroEmitter } from "./kiro.js";
|
|
10
17
|
export { BaseEmitter } from "./base-emitter.js";
|
|
11
18
|
export { ClaudeEmitter } from "./claude.js";
|
|
12
19
|
export { CopilotEmitter } from "./copilot.js";
|
|
@@ -17,6 +24,15 @@ export { CursorCliEmitter } from "./cursor-cli.js";
|
|
|
17
24
|
export { AntigravityEmitter } from "./antigravity.js";
|
|
18
25
|
export { AntigravityCliEmitter } from "./antigravity-cli.js";
|
|
19
26
|
export { CodexEmitter } from "./codex.js";
|
|
27
|
+
export { GeminiEmitter } from "./gemini.js";
|
|
28
|
+
export { LlxprtEmitter } from "./llxprt.js";
|
|
29
|
+
export { QwenEmitter } from "./qwen.js";
|
|
30
|
+
export { KiloEmitter } from "./kilo.js";
|
|
31
|
+
export { AugmentEmitter } from "./augment.js";
|
|
32
|
+
export { WindsurfEmitter } from "./windsurf.js";
|
|
33
|
+
export { KiroEmitter } from "./kiro.js";
|
|
34
|
+
export { TomlCommandEmitter } from "./toml-command-emitter.js";
|
|
35
|
+
export { SkillsEmitter } from "./skills-emitter.js";
|
|
20
36
|
const claude = new ClaudeEmitter();
|
|
21
37
|
const copilot = new CopilotEmitter();
|
|
22
38
|
const copilotCli = new CopilotCliEmitter();
|
|
@@ -26,6 +42,13 @@ const cursorCli = new CursorCliEmitter();
|
|
|
26
42
|
const antigravity = new AntigravityEmitter();
|
|
27
43
|
const antigravityCli = new AntigravityCliEmitter();
|
|
28
44
|
const codex = new CodexEmitter();
|
|
45
|
+
const gemini = new GeminiEmitter();
|
|
46
|
+
const llxprt = new LlxprtEmitter();
|
|
47
|
+
const qwen = new QwenEmitter();
|
|
48
|
+
const kilo = new KiloEmitter();
|
|
49
|
+
const augment = new AugmentEmitter();
|
|
50
|
+
const windsurf = new WindsurfEmitter();
|
|
51
|
+
const kiro = new KiroEmitter();
|
|
29
52
|
/**
|
|
30
53
|
* Registry of selectable targets → emitters. Several targets can share one emitter (VS Code
|
|
31
54
|
* extensions, CLIs that reuse a sibling's output). Adding a tool is a new emitter + entries here.
|
|
@@ -41,16 +64,44 @@ export const TARGETS = [
|
|
|
41
64
|
{ id: "antigravity", displayName: "Antigravity (IDE)", emitter: antigravity },
|
|
42
65
|
{ id: "antigravity-cli", displayName: "Antigravity CLI", emitter: antigravityCli },
|
|
43
66
|
{ id: "codex", displayName: "Codex CLI", emitter: codex },
|
|
67
|
+
{ id: "gemini", displayName: "Gemini CLI", emitter: gemini },
|
|
68
|
+
{ id: "llxprt", displayName: "LLxprt Code", emitter: llxprt },
|
|
69
|
+
{ id: "qwen", displayName: "Qwen Code", emitter: qwen },
|
|
70
|
+
{ id: "kilo", displayName: "Kilo Code", emitter: kilo },
|
|
71
|
+
{ id: "augment", displayName: "Augment Code", emitter: augment },
|
|
72
|
+
{ id: "windsurf", displayName: "Windsurf", emitter: windsurf },
|
|
73
|
+
{ id: "kiro", displayName: "Kiro", emitter: kiro },
|
|
74
|
+
{ id: "pi", displayName: "Pi", emitter: codex, alias: true },
|
|
44
75
|
];
|
|
45
|
-
export function getTarget(id) {
|
|
46
|
-
return TARGETS.find((t) => t.id === id);
|
|
76
|
+
export function getTarget(id, source) {
|
|
77
|
+
return (source?.targets ?? TARGETS).find((t) => t.id === id);
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Targets whose emitters write the same command directory share its output files (feature 016,
|
|
81
|
+
* FR-007; by directory since 018, so Antigravity and Codex, which are separate emitters, list as
|
|
82
|
+
* co-owners): one entry per directory with two or more configured owners, e.g. `pi` + `codex` +
|
|
83
|
+
* `antigravity` → `.agents/skills`. Files are written once; removing one owner leaves them for the rest.
|
|
84
|
+
*/
|
|
85
|
+
export function sharedOutputs(ids, source) {
|
|
86
|
+
const byDir = new Map();
|
|
87
|
+
for (const id of ids) {
|
|
88
|
+
const target = getTarget(id, source);
|
|
89
|
+
if (!target || target.emitter.commandSurface === "none")
|
|
90
|
+
continue; // rules-only targets own no command dir
|
|
91
|
+
const dir = target.emitter.commandDir;
|
|
92
|
+
const entry = byDir.get(dir) ?? { dir, owners: [] };
|
|
93
|
+
if (!entry.owners.includes(id))
|
|
94
|
+
entry.owners.push(id);
|
|
95
|
+
byDir.set(dir, entry);
|
|
96
|
+
}
|
|
97
|
+
return [...byDir.values()].filter((e) => e.owners.length > 1);
|
|
47
98
|
}
|
|
48
99
|
/** Distinct emitters for a set of target ids (deduped, so shared emitters emit once). */
|
|
49
|
-
export function emittersForTargets(ids) {
|
|
100
|
+
export function emittersForTargets(ids, source) {
|
|
50
101
|
const seen = new Set();
|
|
51
102
|
const out = [];
|
|
52
103
|
for (const id of ids) {
|
|
53
|
-
const target = getTarget(id);
|
|
104
|
+
const target = getTarget(id, source);
|
|
54
105
|
if (!target)
|
|
55
106
|
continue;
|
|
56
107
|
if (seen.has(target.emitter.toolId))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/emitters/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,cAAc,EAA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AAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAChC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CommandSpec, CommandSurface } from "../core/types.js";
|
|
2
|
+
import { BaseEmitter } from "./base-emitter.js";
|
|
3
|
+
/**
|
|
4
|
+
* Kilo Code emitter. Commands are Markdown + YAML at `.kilo/commands/*.md`; `description` is the
|
|
5
|
+
* only key we emit, and `$ARGUMENTS` is supported natively, so bodies are emitted verbatim. Kilo
|
|
6
|
+
* reads AGENTS.md, so no tool-specific rules file is emitted.
|
|
7
|
+
*/
|
|
8
|
+
export declare class KiloEmitter extends BaseEmitter {
|
|
9
|
+
readonly toolId = "kilo";
|
|
10
|
+
readonly displayName = "Kilo Code";
|
|
11
|
+
readonly commandSurface: CommandSurface;
|
|
12
|
+
readonly commandDir: string;
|
|
13
|
+
protected commandFrontmatter(spec: CommandSpec): Array<[string, string]>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { join } from "node:path/posix";
|
|
2
|
+
import { BaseEmitter } from "./base-emitter.js";
|
|
3
|
+
/**
|
|
4
|
+
* Kilo Code emitter. Commands are Markdown + YAML at `.kilo/commands/*.md`; `description` is the
|
|
5
|
+
* only key we emit, and `$ARGUMENTS` is supported natively, so bodies are emitted verbatim. Kilo
|
|
6
|
+
* reads AGENTS.md, so no tool-specific rules file is emitted.
|
|
7
|
+
*/
|
|
8
|
+
export class KiloEmitter extends BaseEmitter {
|
|
9
|
+
toolId = "kilo";
|
|
10
|
+
displayName = "Kilo Code";
|
|
11
|
+
commandSurface = "commands";
|
|
12
|
+
commandDir = join(".kilo", "commands");
|
|
13
|
+
commandFrontmatter(spec) {
|
|
14
|
+
return [["description", this.yamlQuote(spec.description)]];
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=kilo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kilo.js","sourceRoot":"","sources":["../../src/emitters/kilo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;;;GAIG;AACH,MAAM,OAAO,WAAY,SAAQ,WAAW;IACjC,MAAM,GAAG,MAAM,CAAC;IAChB,WAAW,GAAG,WAAW,CAAC;IAC1B,cAAc,GAAmB,UAAU,CAAC;IAC5C,UAAU,GAAG,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IAE7B,kBAAkB,CAAC,IAAiB;QACrD,OAAO,CAAC,CAAC,aAAa,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAC7D,CAAC;CACF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SkillsEmitter } from "./skills-emitter.js";
|
|
2
|
+
/**
|
|
3
|
+
* Kiro (IDE and `kiro-cli`) emitter. Commands are skills at `.kiro/skills/<name>/SKILL.md`; `name`
|
|
4
|
+
* must equal the directory and use only lowercase letters, digits and hyphens (so `amby-specify`,
|
|
5
|
+
* never `amby.specify`). `$ARGUMENTS` is substituted by the CLI only, so the shared skills rewording
|
|
6
|
+
* to prose is used. Kiro reads AGENTS.md, so no tool-specific rules file is emitted.
|
|
7
|
+
*/
|
|
8
|
+
export declare class KiroEmitter extends SkillsEmitter {
|
|
9
|
+
readonly toolId = "kiro";
|
|
10
|
+
readonly displayName = "Kiro";
|
|
11
|
+
readonly commandDir: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { join } from "node:path/posix";
|
|
2
|
+
import { SkillsEmitter } from "./skills-emitter.js";
|
|
3
|
+
/**
|
|
4
|
+
* Kiro (IDE and `kiro-cli`) emitter. Commands are skills at `.kiro/skills/<name>/SKILL.md`; `name`
|
|
5
|
+
* must equal the directory and use only lowercase letters, digits and hyphens (so `amby-specify`,
|
|
6
|
+
* never `amby.specify`). `$ARGUMENTS` is substituted by the CLI only, so the shared skills rewording
|
|
7
|
+
* to prose is used. Kiro reads AGENTS.md, so no tool-specific rules file is emitted.
|
|
8
|
+
*/
|
|
9
|
+
export class KiroEmitter extends SkillsEmitter {
|
|
10
|
+
toolId = "kiro";
|
|
11
|
+
displayName = "Kiro";
|
|
12
|
+
commandDir = join(".kiro", "skills");
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=kiro.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kiro.js","sourceRoot":"","sources":["../../src/emitters/kiro.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD;;;;;GAKG;AACH,MAAM,OAAO,WAAY,SAAQ,aAAa;IACnC,MAAM,GAAG,MAAM,CAAC;IAChB,WAAW,GAAG,MAAM,CAAC;IACrB,UAAU,GAAG,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;CAC/C"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { EmittedFile, RulesContext } from "../core/types.js";
|
|
2
|
+
import { TomlCommandEmitter } from "./toml-command-emitter.js";
|
|
3
|
+
/**
|
|
4
|
+
* LLxprt Code emitter (a Gemini CLI fork). Commands are TOML at `.llxprt/commands/amby.<phase>.toml`
|
|
5
|
+
* with the same shape as Gemini's; the loader globs `**\/*.toml`. It reads `LLXPRT.md`, not AGENTS.md,
|
|
6
|
+
* so a pointer region carries the rules.
|
|
7
|
+
*/
|
|
8
|
+
export declare class LlxprtEmitter extends TomlCommandEmitter {
|
|
9
|
+
readonly toolId = "llxprt";
|
|
10
|
+
readonly displayName = "LLxprt Code";
|
|
11
|
+
readonly commandDir: string;
|
|
12
|
+
protected rulesFiles(_ctx: RulesContext): EmittedFile[];
|
|
13
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { join } from "node:path/posix";
|
|
2
|
+
import { buildPointerRegion } from "../core/rules.js";
|
|
3
|
+
import { TomlCommandEmitter } from "./toml-command-emitter.js";
|
|
4
|
+
/**
|
|
5
|
+
* LLxprt Code emitter (a Gemini CLI fork). Commands are TOML at `.llxprt/commands/amby.<phase>.toml`
|
|
6
|
+
* with the same shape as Gemini's; the loader globs `**\/*.toml`. It reads `LLXPRT.md`, not AGENTS.md,
|
|
7
|
+
* so a pointer region carries the rules.
|
|
8
|
+
*/
|
|
9
|
+
export class LlxprtEmitter extends TomlCommandEmitter {
|
|
10
|
+
toolId = "llxprt";
|
|
11
|
+
displayName = "LLxprt Code";
|
|
12
|
+
commandDir = join(".llxprt", "commands");
|
|
13
|
+
rulesFiles(_ctx) {
|
|
14
|
+
const region = buildPointerRegion("The `/amby.*` commands under `.llxprt/commands/` drive the phases.");
|
|
15
|
+
return [{ path: "LLXPRT.md", contents: `# LLxprt Code instructions\n\n${region}`, scope: "project", merge: "region" }];
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=llxprt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"llxprt.js","sourceRoot":"","sources":["../../src/emitters/llxprt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE/D;;;;GAIG;AACH,MAAM,OAAO,aAAc,SAAQ,kBAAkB;IAC1C,MAAM,GAAG,QAAQ,CAAC;IAClB,WAAW,GAAG,aAAa,CAAC;IAC5B,UAAU,GAAG,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IAE/B,UAAU,CAAC,IAAkB;QAC9C,MAAM,MAAM,GAAG,kBAAkB,CAAC,oEAAoE,CAAC,CAAC;QACxG,OAAO,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,iCAAiC,MAAM,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;IACzH,CAAC;CACF"}
|
|
@@ -13,4 +13,12 @@ export declare class OpenCodeEmitter extends BaseEmitter {
|
|
|
13
13
|
protected commandFrontmatter(spec: CommandSpec): Array<[string, string]>;
|
|
14
14
|
/** Agents at `.opencode/agents/<id>.md` — filename is the id; `description` required (verified, feature 013). */
|
|
15
15
|
protected roleFiles(roles: Role[], _ctx: RulesContext): EmittedFile[];
|
|
16
|
+
/** The worker at `.opencode/agents/amby-worker.md`; no `model` (not verified for OpenCode agents, Principle 4). */
|
|
17
|
+
protected workerFiles(worker: NonNullable<RulesContext["worker"]>, _ctx: RulesContext): EmittedFile[];
|
|
18
|
+
/**
|
|
19
|
+
* Not written. OpenCode documents two incompatible shapes (`mcp.<name>` with `enabled`, and `mcp.servers.<name>`
|
|
20
|
+
* with `disabled`) and nothing says which one an installed version reads, so a guess could break the user's
|
|
21
|
+
* `opencode.json` (`specs/025-mcp-server/research.md`).
|
|
22
|
+
*/
|
|
23
|
+
mcpSkipReason(): string | null;
|
|
16
24
|
}
|
|
@@ -24,5 +24,28 @@ export class OpenCodeEmitter extends BaseEmitter {
|
|
|
24
24
|
scope: "project",
|
|
25
25
|
}));
|
|
26
26
|
}
|
|
27
|
+
/** The worker at `.opencode/agents/amby-worker.md`; no `model` (not verified for OpenCode agents, Principle 4). */
|
|
28
|
+
workerFiles(worker, _ctx) {
|
|
29
|
+
return [
|
|
30
|
+
{
|
|
31
|
+
path: join(".opencode", "agents", `amby-${worker.id}.md`),
|
|
32
|
+
contents: `${this.renderFrontmatter([
|
|
33
|
+
["description", this.yamlQuote(worker.description)],
|
|
34
|
+
["mode", "subagent"],
|
|
35
|
+
])}
|
|
36
|
+
${this.workerBody(worker)}
|
|
37
|
+
`,
|
|
38
|
+
scope: "project",
|
|
39
|
+
},
|
|
40
|
+
];
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Not written. OpenCode documents two incompatible shapes (`mcp.<name>` with `enabled`, and `mcp.servers.<name>`
|
|
44
|
+
* with `disabled`) and nothing says which one an installed version reads, so a guess could break the user's
|
|
45
|
+
* `opencode.json` (`specs/025-mcp-server/research.md`).
|
|
46
|
+
*/
|
|
47
|
+
mcpSkipReason() {
|
|
48
|
+
return "OpenCode documents two incompatible MCP schemas and none is confirmed for installed versions; add the server by hand";
|
|
49
|
+
}
|
|
27
50
|
}
|
|
28
51
|
//# sourceMappingURL=opencode.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"opencode.js","sourceRoot":"","sources":["../../src/emitters/opencode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;;;GAIG;AACH,MAAM,OAAO,eAAgB,SAAQ,WAAW;IACrC,MAAM,GAAG,UAAU,CAAC;IACpB,WAAW,GAAG,UAAU,CAAC;IACzB,cAAc,GAAmB,UAAU,CAAC;IAC5C,UAAU,GAAG,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;IAEjC,kBAAkB,CAAC,IAAiB;QACrD,OAAO,CAAC,CAAC,aAAa,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAC7D,CAAC;IAED,iHAAiH;IAC9F,SAAS,CAAC,KAAa,EAAE,IAAkB;QAC5D,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YAC1B,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,WAAW,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B,CAAC,IAAI,CAAC,CAAC,CAAC;gBAC9D,CAAC,MAAM,EAAE,UAAU,CAAC;aACrB,CAAC,KAAK,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI;YACnC,KAAK,EAAE,SAAS;SACjB,CAAC,CAAC,CAAC;IACN,CAAC;IAED,mHAAmH;IAChG,WAAW,CAAC,MAA2C,EAAE,IAAkB;QAC5F,OAAO;YACL;gBACE,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE,QAAQ,EAAE,QAAQ,MAAM,CAAC,EAAE,KAAK,CAAC;gBACzD,QAAQ,EAAE,GAAG,IAAI,CAAC,iBAAiB,CAAC;oBAClC,CAAC,aAAa,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;oBACnD,CAAC,MAAM,EAAE,UAAU,CAAC;iBACrB,CAAC;EACR,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;CACxB;gBACO,KAAK,EAAE,SAAS;aACjB;SACF,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACM,aAAa;QACpB,OAAO,sHAAsH,CAAC;IAChI,CAAC;CACF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CommandSpec, CommandSurface } from "../core/types.js";
|
|
2
|
+
import { BaseEmitter } from "./base-emitter.js";
|
|
3
|
+
/**
|
|
4
|
+
* Qwen Code emitter. Commands are Markdown + YAML at `.qwen/commands/*.md` (TOML is deprecated);
|
|
5
|
+
* documented keys are `description` and `argument-hint`, and the argument placeholder is `{{args}}`.
|
|
6
|
+
* Qwen reads AGENTS.md (per its source; see research R3), so no tool-specific rules file is emitted.
|
|
7
|
+
*/
|
|
8
|
+
export declare class QwenEmitter extends BaseEmitter {
|
|
9
|
+
readonly toolId = "qwen";
|
|
10
|
+
readonly displayName = "Qwen Code";
|
|
11
|
+
readonly commandSurface: CommandSurface;
|
|
12
|
+
readonly commandDir: string;
|
|
13
|
+
protected commandFrontmatter(spec: CommandSpec): Array<[string, string]>;
|
|
14
|
+
protected transformBody(spec: CommandSpec): string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { join } from "node:path/posix";
|
|
2
|
+
import { BaseEmitter } from "./base-emitter.js";
|
|
3
|
+
/**
|
|
4
|
+
* Qwen Code emitter. Commands are Markdown + YAML at `.qwen/commands/*.md` (TOML is deprecated);
|
|
5
|
+
* documented keys are `description` and `argument-hint`, and the argument placeholder is `{{args}}`.
|
|
6
|
+
* Qwen reads AGENTS.md (per its source; see research R3), so no tool-specific rules file is emitted.
|
|
7
|
+
*/
|
|
8
|
+
export class QwenEmitter extends BaseEmitter {
|
|
9
|
+
toolId = "qwen";
|
|
10
|
+
displayName = "Qwen Code";
|
|
11
|
+
commandSurface = "commands";
|
|
12
|
+
commandDir = join(".qwen", "commands");
|
|
13
|
+
commandFrontmatter(spec) {
|
|
14
|
+
return [
|
|
15
|
+
["description", this.yamlQuote(spec.description)],
|
|
16
|
+
["argument-hint", this.yamlQuote(spec.argumentHint)],
|
|
17
|
+
];
|
|
18
|
+
}
|
|
19
|
+
transformBody(spec) {
|
|
20
|
+
return spec.body.replaceAll("$ARGUMENTS", "{{args}}");
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=qwen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qwen.js","sourceRoot":"","sources":["../../src/emitters/qwen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;;;GAIG;AACH,MAAM,OAAO,WAAY,SAAQ,WAAW;IACjC,MAAM,GAAG,MAAM,CAAC;IAChB,WAAW,GAAG,WAAW,CAAC;IAC1B,cAAc,GAAmB,UAAU,CAAC;IAC5C,UAAU,GAAG,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IAE7B,kBAAkB,CAAC,IAAiB;QACrD,OAAO;YACL,CAAC,aAAa,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YACjD,CAAC,eAAe,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;SACrD,CAAC;IACJ,CAAC;IAEkB,aAAa,CAAC,IAAiB;QAChD,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;IACxD,CAAC;CACF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { CommandSpec, EmittedFile, RulesContext } from "../core/types.js";
|
|
2
|
+
import { BaseEmitter } from "./base-emitter.js";
|
|
3
|
+
/** Skill id: lowercase-hyphen, e.g. `amby.specify` → `amby-specify` (dots are not valid in every host). */
|
|
4
|
+
export declare function skillName(spec: CommandSpec): string;
|
|
5
|
+
/** `<dir>/<skill name>/SKILL.md` — the skills layout shared by Codex, Copilot CLI and Kiro. */
|
|
6
|
+
export declare function skillPath(dir: string, spec: CommandSpec): string;
|
|
7
|
+
/** Documented skill frontmatter: just `name` and `description`. */
|
|
8
|
+
export declare function skillFrontmatter(spec: CommandSpec, quote: (value: string) => string): Array<[string, string]>;
|
|
9
|
+
/**
|
|
10
|
+
* Base for hosts whose file-based command surface is **skills** (feature 016): one directory per
|
|
11
|
+
* phase holding `SKILL.md` with `name` + `description`. Skills have no `$ARGUMENTS` substitution, so
|
|
12
|
+
* the token becomes an instruction. A target that must inherit from another emitter (Copilot CLI)
|
|
13
|
+
* reuses the exported helpers instead of this class.
|
|
14
|
+
*/
|
|
15
|
+
export declare abstract class SkillsEmitter extends BaseEmitter {
|
|
16
|
+
readonly commandSurface: "skills";
|
|
17
|
+
protected commandFilePath(spec: CommandSpec): string;
|
|
18
|
+
protected commandFrontmatter(spec: CommandSpec): Array<[string, string]>;
|
|
19
|
+
protected commandFile(spec: CommandSpec, ctx?: RulesContext): EmittedFile;
|
|
20
|
+
protected transformBody(spec: CommandSpec): string;
|
|
21
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { join } from "node:path/posix";
|
|
2
|
+
import { BaseEmitter } from "./base-emitter.js";
|
|
3
|
+
/** Skill id: lowercase-hyphen, e.g. `amby.specify` → `amby-specify` (dots are not valid in every host). */
|
|
4
|
+
export function skillName(spec) {
|
|
5
|
+
return spec.name.replace(/\./g, "-").toLowerCase();
|
|
6
|
+
}
|
|
7
|
+
/** `<dir>/<skill name>/SKILL.md` — the skills layout shared by Codex, Copilot CLI and Kiro. */
|
|
8
|
+
export function skillPath(dir, spec) {
|
|
9
|
+
return join(dir, skillName(spec), "SKILL.md");
|
|
10
|
+
}
|
|
11
|
+
/** Documented skill frontmatter: just `name` and `description`. */
|
|
12
|
+
export function skillFrontmatter(spec, quote) {
|
|
13
|
+
return [
|
|
14
|
+
["name", skillName(spec)],
|
|
15
|
+
["description", quote(spec.description)],
|
|
16
|
+
];
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Base for hosts whose file-based command surface is **skills** (feature 016): one directory per
|
|
20
|
+
* phase holding `SKILL.md` with `name` + `description`. Skills have no `$ARGUMENTS` substitution, so
|
|
21
|
+
* the token becomes an instruction. A target that must inherit from another emitter (Copilot CLI)
|
|
22
|
+
* reuses the exported helpers instead of this class.
|
|
23
|
+
*/
|
|
24
|
+
export class SkillsEmitter extends BaseEmitter {
|
|
25
|
+
commandSurface = "skills";
|
|
26
|
+
commandFilePath(spec) {
|
|
27
|
+
return skillPath(this.commandDir, spec);
|
|
28
|
+
}
|
|
29
|
+
commandFrontmatter(spec) {
|
|
30
|
+
return skillFrontmatter(spec, (v) => this.yamlQuote(v));
|
|
31
|
+
}
|
|
32
|
+
commandFile(spec, ctx) {
|
|
33
|
+
return { ...super.commandFile(spec, ctx), protectForeign: true };
|
|
34
|
+
}
|
|
35
|
+
transformBody(spec) {
|
|
36
|
+
return spec.body.replaceAll("$ARGUMENTS", "the user's request that followed this skill invocation");
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=skills-emitter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skills-emitter.js","sourceRoot":"","sources":["../../src/emitters/skills-emitter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,2GAA2G;AAC3G,MAAM,UAAU,SAAS,CAAC,IAAiB;IACzC,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC;AACrD,CAAC;AAED,+FAA+F;AAC/F,MAAM,UAAU,SAAS,CAAC,GAAW,EAAE,IAAiB;IACtD,OAAO,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC,CAAC;AAChD,CAAC;AAED,mEAAmE;AACnE,MAAM,UAAU,gBAAgB,CAAC,IAAiB,EAAE,KAAgC;IAClF,OAAO;QACL,CAAC,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;QACzB,CAAC,aAAa,EAAE,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;KACzC,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,OAAgB,aAAc,SAAQ,WAAW;IAC5C,cAAc,GAAG,QAAiB,CAAC;IAEzB,eAAe,CAAC,IAAiB;QAClD,OAAO,SAAS,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IAC1C,CAAC;IAEkB,kBAAkB,CAAC,IAAiB;QACrD,OAAO,gBAAgB,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1D,CAAC;IAEkB,WAAW,CAAC,IAAiB,EAAE,GAAkB;QAClE,OAAO,EAAE,GAAG,KAAK,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC;IACnE,CAAC;IAEkB,aAAa,CAAC,IAAiB;QAChD,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,YAAY,EAAE,wDAAwD,CAAC,CAAC;IACtG,CAAC;CACF"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { CommandSpec, CommandSurface } from "../core/types.js";
|
|
2
|
+
import { BaseEmitter } from "./base-emitter.js";
|
|
3
|
+
/**
|
|
4
|
+
* Base for tools whose custom commands are TOML files (Gemini CLI, LLxprt Code; feature 016, R1):
|
|
5
|
+
*
|
|
6
|
+
* # <generated notice>
|
|
7
|
+
* description = "<basic-escaped>"
|
|
8
|
+
* prompt = '''
|
|
9
|
+
* <body>
|
|
10
|
+
* '''
|
|
11
|
+
*
|
|
12
|
+
* The prompt is a TOML *literal* multi-line string, so backslashes and quotes in the neutral body
|
|
13
|
+
* need no escaping. A body containing `'''` falls back to a basic `"""` string with `\` and `"`
|
|
14
|
+
* escaped. The generated notice is a `#` comment, so it costs no prompt tokens. `$ARGUMENTS` becomes
|
|
15
|
+
* `{{args}}`. Only two string keys are written and AmbyKit never parses TOML, hence no dependency.
|
|
16
|
+
*/
|
|
17
|
+
export declare abstract class TomlCommandEmitter extends BaseEmitter {
|
|
18
|
+
readonly commandSurface: CommandSurface;
|
|
19
|
+
/** Commands live in `<dir>/amby.<phase>.toml`; dots are kept (the command name is the file path). */
|
|
20
|
+
protected commandFileName(spec: CommandSpec): string;
|
|
21
|
+
protected commandFrontmatter(spec: CommandSpec): Array<[string, string]>;
|
|
22
|
+
protected generatedNotice(spec: CommandSpec): string;
|
|
23
|
+
protected transformBody(spec: CommandSpec): string;
|
|
24
|
+
protected renderCommand(pairs: Array<[string, string]>, notice: string, body: string): string;
|
|
25
|
+
}
|
|
26
|
+
/** TOML basic string (`"…"`) with the required escapes. */
|
|
27
|
+
export declare function tomlBasic(value: string): string;
|
|
28
|
+
/** The `prompt` value: a literal `'''` block, or a basic `"""` block when the body contains `'''`. */
|
|
29
|
+
export declare function tomlPrompt(body: string): string;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { BaseEmitter } from "./base-emitter.js";
|
|
2
|
+
/**
|
|
3
|
+
* Base for tools whose custom commands are TOML files (Gemini CLI, LLxprt Code; feature 016, R1):
|
|
4
|
+
*
|
|
5
|
+
* # <generated notice>
|
|
6
|
+
* description = "<basic-escaped>"
|
|
7
|
+
* prompt = '''
|
|
8
|
+
* <body>
|
|
9
|
+
* '''
|
|
10
|
+
*
|
|
11
|
+
* The prompt is a TOML *literal* multi-line string, so backslashes and quotes in the neutral body
|
|
12
|
+
* need no escaping. A body containing `'''` falls back to a basic `"""` string with `\` and `"`
|
|
13
|
+
* escaped. The generated notice is a `#` comment, so it costs no prompt tokens. `$ARGUMENTS` becomes
|
|
14
|
+
* `{{args}}`. Only two string keys are written and AmbyKit never parses TOML, hence no dependency.
|
|
15
|
+
*/
|
|
16
|
+
export class TomlCommandEmitter extends BaseEmitter {
|
|
17
|
+
commandSurface = "commands";
|
|
18
|
+
/** Commands live in `<dir>/amby.<phase>.toml`; dots are kept (the command name is the file path). */
|
|
19
|
+
commandFileName(spec) {
|
|
20
|
+
return `${spec.name}.toml`;
|
|
21
|
+
}
|
|
22
|
+
commandFrontmatter(spec) {
|
|
23
|
+
return [["description", tomlBasic(spec.description)]];
|
|
24
|
+
}
|
|
25
|
+
generatedNotice(spec) {
|
|
26
|
+
return `# GENERATED by AmbyKit from src/prompts/${spec.id}.md — do not edit by hand; run \`ambykit sync\`.`;
|
|
27
|
+
}
|
|
28
|
+
transformBody(spec) {
|
|
29
|
+
return spec.body.replaceAll("$ARGUMENTS", "{{args}}");
|
|
30
|
+
}
|
|
31
|
+
renderCommand(pairs, notice, body) {
|
|
32
|
+
const keys = pairs.map(([k, v]) => `${k} = ${v}`).join("\n");
|
|
33
|
+
return `${notice}\n${keys}\nprompt = ${tomlPrompt(body)}\n`;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/** TOML basic string (`"…"`) with the required escapes. */
|
|
37
|
+
export function tomlBasic(value) {
|
|
38
|
+
return `"${escapeBasic(value)}"`;
|
|
39
|
+
}
|
|
40
|
+
function escapeBasic(value) {
|
|
41
|
+
let out = "";
|
|
42
|
+
for (const ch of value) {
|
|
43
|
+
const code = ch.codePointAt(0);
|
|
44
|
+
if (ch === "\\")
|
|
45
|
+
out += "\\\\";
|
|
46
|
+
else if (ch === '"')
|
|
47
|
+
out += '\\"';
|
|
48
|
+
else if (ch === "\n")
|
|
49
|
+
out += "\\n";
|
|
50
|
+
else if (ch === "\t")
|
|
51
|
+
out += "\\t";
|
|
52
|
+
else if (ch === "\r")
|
|
53
|
+
out += "\\r";
|
|
54
|
+
else if (code < 0x20 || code === 0x7f)
|
|
55
|
+
out += `\\u${code.toString(16).toUpperCase().padStart(4, "0")}`;
|
|
56
|
+
else
|
|
57
|
+
out += ch;
|
|
58
|
+
}
|
|
59
|
+
return out;
|
|
60
|
+
}
|
|
61
|
+
/** The `prompt` value: a literal `'''` block, or a basic `"""` block when the body contains `'''`. */
|
|
62
|
+
export function tomlPrompt(body) {
|
|
63
|
+
if (!body.includes("'''") && !/[\u0000-\u0008\u000b-\u001f\u007f]/.test(body))
|
|
64
|
+
return `'''\n${body}\n'''`;
|
|
65
|
+
// Multi-line basic string: keep real newlines (a leading one is trimmed by TOML), escape the rest.
|
|
66
|
+
const escaped = body.split("\n").map(escapeBasic).join("\n");
|
|
67
|
+
return `"""\n${escaped}\n"""`;
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=toml-command-emitter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toml-command-emitter.js","sourceRoot":"","sources":["../../src/emitters/toml-command-emitter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;A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AAE,KAAK,GAAG;YAAE,GAAG,IAAI,KAAK,CAAC;aAC7B,IAAI,EAAE,KAAK,IAAI;YAAE,GAAG,IAAI,KAAK,CAAC;aAC9B,IAAI,EAAE,KAAK,IAAI;YAAE,GAAG,IAAI,KAAK,CAAC;aAC9B,IAAI,EAAE,KAAK,IAAI;YAAE,GAAG,IAAI,KAAK,CAAC;aAC9B,IAAI,IAAI,GAAG,IAAI,IAAI,IAAI,KAAK,IAAI;YAAE,GAAG,IAAI,MAAM,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;;YAClG,GAAG,IAAI,EAAE,CAAC;IACjB,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,sGAAsG;AACtG,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,oCAAoC,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,QAAQ,IAAI,OAAO,CAAC;IAC1G,mGAAmG;IACnG,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7D,OAAO,QAAQ,OAAO,OAAO,CAAC;AAChC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CommandSpec, CommandSurface } from "../core/types.js";
|
|
2
|
+
import { BaseEmitter } from "./base-emitter.js";
|
|
3
|
+
/**
|
|
4
|
+
* Windsurf emitter. Workflows are Markdown at `.windsurf/workflows/*.md` with no documented
|
|
5
|
+
* frontmatter and a 12,000-character limit per file; the filename is the slash command. There is no
|
|
6
|
+
* argument placeholder, so `$ARGUMENTS` becomes an instruction (the Codex wording). Windsurf reads
|
|
7
|
+
* AGENTS.md, so no tool-specific rules file is emitted.
|
|
8
|
+
*/
|
|
9
|
+
export declare class WindsurfEmitter extends BaseEmitter {
|
|
10
|
+
readonly toolId = "windsurf";
|
|
11
|
+
readonly displayName = "Windsurf";
|
|
12
|
+
readonly commandSurface: CommandSurface;
|
|
13
|
+
readonly commandDir: string;
|
|
14
|
+
protected commandFrontmatter(_spec: CommandSpec): Array<[string, string]>;
|
|
15
|
+
protected transformBody(spec: CommandSpec): string;
|
|
16
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { join } from "node:path/posix";
|
|
2
|
+
import { BaseEmitter } from "./base-emitter.js";
|
|
3
|
+
/**
|
|
4
|
+
* Windsurf emitter. Workflows are Markdown at `.windsurf/workflows/*.md` with no documented
|
|
5
|
+
* frontmatter and a 12,000-character limit per file; the filename is the slash command. There is no
|
|
6
|
+
* argument placeholder, so `$ARGUMENTS` becomes an instruction (the Codex wording). Windsurf reads
|
|
7
|
+
* AGENTS.md, so no tool-specific rules file is emitted.
|
|
8
|
+
*/
|
|
9
|
+
export class WindsurfEmitter extends BaseEmitter {
|
|
10
|
+
toolId = "windsurf";
|
|
11
|
+
displayName = "Windsurf";
|
|
12
|
+
commandSurface = "workflows";
|
|
13
|
+
commandDir = join(".windsurf", "workflows");
|
|
14
|
+
commandFrontmatter(_spec) {
|
|
15
|
+
return [];
|
|
16
|
+
}
|
|
17
|
+
transformBody(spec) {
|
|
18
|
+
return spec.body.replaceAll("$ARGUMENTS", "the user's request that followed this workflow invocation");
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=windsurf.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"windsurf.js","sourceRoot":"","sources":["../../src/emitters/windsurf.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,OAAO,eAAgB,SAAQ,WAAW;IACrC,MAAM,GAAG,UAAU,CAAC;IACpB,WAAW,GAAG,UAAU,CAAC;IACzB,cAAc,GAAmB,WAAW,CAAC;IAC7C,UAAU,GAAG,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IAElC,kBAAkB,CAAC,KAAkB;QACtD,OAAO,EAAE,CAAC;IACZ,CAAC;IAEkB,aAAa,CAAC,IAAiB;QAChD,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,YAAY,EAAE,2DAA2D,CAAC,CAAC;IACzG,CAAC;CACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
/** Library entry point — re-exports the core model and emitters for programmatic use. */
|
|
2
2
|
export * from "./core/index.js";
|
|
3
3
|
export * from "./emitters/index.js";
|
|
4
|
+
/** Plugin API (feature 027, experimental): the loader, registry and range check stay internal. */
|
|
5
|
+
export { PLUGIN_API_VERSION, PLUGIN_API_EXPERIMENTAL } from "./plugins/api.js";
|
|
6
|
+
export type { PluginModule, PluginFactory, PluginApi } from "./plugins/api.js";
|
|
7
|
+
export { skillName, skillPath, skillFrontmatter } from "./emitters/skills-emitter.js";
|
|
8
|
+
export { tomlBasic, tomlPrompt } from "./emitters/toml-command-emitter.js";
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
/** Library entry point — re-exports the core model and emitters for programmatic use. */
|
|
2
2
|
export * from "./core/index.js";
|
|
3
3
|
export * from "./emitters/index.js";
|
|
4
|
+
/** Plugin API (feature 027, experimental): the loader, registry and range check stay internal. */
|
|
5
|
+
export { PLUGIN_API_VERSION, PLUGIN_API_EXPERIMENTAL } from "./plugins/api.js";
|
|
6
|
+
export { skillName, skillPath, skillFrontmatter } from "./emitters/skills-emitter.js";
|
|
7
|
+
export { tomlBasic, tomlPrompt } from "./emitters/toml-command-emitter.js";
|
|
4
8
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,kGAAkG;AAClG,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAE/E,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACtF,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { Readable, Writable } from "node:stream";
|
|
2
|
+
import type { ToolContext, ToolRegistry } from "./registry.js";
|
|
3
|
+
/**
|
|
4
|
+
* Newline-delimited JSON-RPC 2.0 over stdio (feature 025, T014). Hand-rolled on purpose (plan open
|
|
5
|
+
* decision 1): the server needs `initialize`, `server/discover`, `ping`, `tools/list` and `tools/call`.
|
|
6
|
+
* Stateless, so one dispatcher serves both protocol generations: the `initialize` handshake of
|
|
7
|
+
* 2024-11-05 to 2025-11-25 and the handshake-free 2026-07-28 revision, which puts the version in each
|
|
8
|
+
* request's `_meta` (see `specs/025-mcp-server/research.md`).
|
|
9
|
+
*/
|
|
10
|
+
export declare const SUPPORTED_VERSIONS: readonly ["2024-11-05", "2025-03-26", "2025-06-18", "2025-11-25", "2026-07-28"];
|
|
11
|
+
/** The newest revision that still has the `initialize` handshake; offered to a client we cannot match. */
|
|
12
|
+
export declare const LEGACY_LATEST = "2025-11-25";
|
|
13
|
+
export declare const META_VERSION_KEY = "io.modelcontextprotocol/protocolVersion";
|
|
14
|
+
export interface ServerInfo {
|
|
15
|
+
name: string;
|
|
16
|
+
version: string;
|
|
17
|
+
}
|
|
18
|
+
type Id = string | number | null;
|
|
19
|
+
export interface RpcResponse {
|
|
20
|
+
jsonrpc: "2.0";
|
|
21
|
+
id: Id;
|
|
22
|
+
result?: unknown;
|
|
23
|
+
error?: {
|
|
24
|
+
code: number;
|
|
25
|
+
message: string;
|
|
26
|
+
data?: unknown;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/** Answer one parsed message. Notifications (no `id`) and responses get no reply (`null`). */
|
|
30
|
+
export declare function handleMessage(msg: unknown, registry: ToolRegistry, ctx: ToolContext, info: ServerInfo): Promise<RpcResponse | null>;
|
|
31
|
+
/** Handle one line: a single message or a batch (2025-03-26 allowed them). Returns the line to write, if any. */
|
|
32
|
+
export declare function handleLine(line: string, registry: ToolRegistry, ctx: ToolContext, info: ServerInfo): Promise<string | null>;
|
|
33
|
+
/**
|
|
34
|
+
* Serve until `input` ends. stdout carries protocol messages only, one per line with no embedded
|
|
35
|
+
* newline; anything else belongs on stderr.
|
|
36
|
+
*/
|
|
37
|
+
export declare function serveStdio(opts: {
|
|
38
|
+
input: Readable;
|
|
39
|
+
output: Writable;
|
|
40
|
+
registry: ToolRegistry;
|
|
41
|
+
ctx: ToolContext;
|
|
42
|
+
info: ServerInfo;
|
|
43
|
+
}): Promise<void>;
|
|
44
|
+
export {};
|