mirror of
https://github.com/github/spec-kit.git
synced 2026-08-15 14:02:04 +02:00
* feat(integrations): add omp support * Update updated_at timestamp * refactor(integrations): delegate omp build_exec_args to base, register in issue templates Inherit MarkdownIntegration.build_exec_args so omp picks up shared CLI contract changes (requires_cli gating, extra-args ordering, --model handling) automatically; only specialize the --mode json flag. Also add Oh My Pi / omp to the issue-template agent lists so test_issue_template_agent_lists_match_runtime_integrations passes. * fix(integrations): use --print + positional prompt for omp argv OMP's CLI parser treats `-p`/`--print` as a boolean (one-shot mode) and consumes the prompt as a positional message; the previous inherited `-p <prompt>` shape worked by accident only because `-p` ignores its next token. Build the argv explicitly with flags first and the prompt as a trailing positional, matching upstream args.ts.
46 lines
1.4 KiB
Python
46 lines
1.4 KiB
Python
"""Oh My Pi (omp) coding agent integration."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from ..base import MarkdownIntegration
|
|
|
|
|
|
class OmpIntegration(MarkdownIntegration):
|
|
key = "omp"
|
|
config = {
|
|
"name": "Oh My Pi",
|
|
"folder": ".omp/",
|
|
"commands_subdir": "commands",
|
|
"install_url": "https://www.npmjs.com/package/@oh-my-pi/pi-coding-agent",
|
|
"requires_cli": True,
|
|
}
|
|
registrar_config = {
|
|
"dir": ".omp/commands",
|
|
"format": "markdown",
|
|
"args": "$ARGUMENTS",
|
|
"extension": ".md",
|
|
}
|
|
context_file = "AGENTS.md"
|
|
|
|
def build_exec_args(
|
|
self,
|
|
prompt: str,
|
|
*,
|
|
model: str | None = None,
|
|
output_json: bool = True,
|
|
) -> list[str] | None:
|
|
# Diverges from MarkdownIntegration.build_exec_args because OMP's
|
|
# CLI parser treats `-p`/`--print` as a boolean (one-shot mode) and
|
|
# consumes the prompt as a positional argument — see args.ts in
|
|
# can1357/oh-my-pi. JSON output is selected via `--mode json`.
|
|
if not self.config or not self.config.get("requires_cli"):
|
|
return None
|
|
args = [self._resolve_executable(), "--print"]
|
|
self._apply_extra_args_env_var(args)
|
|
if model:
|
|
args.extend(["--model", model])
|
|
if output_json:
|
|
args.extend(["--mode", "json"])
|
|
args.append(prompt)
|
|
return args
|