Skip to content

✨ feat(web-api): extend API to CLI feature parity#1491

Merged
harehare merged 2 commits intomainfrom
feat/web-api-cli-parity
Mar 24, 2026
Merged

✨ feat(web-api): extend API to CLI feature parity#1491
harehare merged 2 commits intomainfrom
feat/web-api-cli-parity

Conversation

@harehare
Copy link
Copy Markdown
Owner

Add module loading, variable definitions, output format selection, aggregate mode, type checking, and code formatting to mq-web-api.

Add module loading, variable definitions, output format selection,
aggregate mode, type checking, and code formatting to mq-web-api.

New endpoints:
- POST /api/check — type-check a query via mq-check (always 200,
  errors are data); returns syntax and type errors with source positions
- POST /api/format — format mq code via mq-formatter; supports
  indent_width, sort_imports, sort_functions, sort_fields options

Extended ApiRequest fields (all optional, backward-compatible):
- modules: load named builtin modules before query execution
- args: define string variables accessible in queries
- output_format: markdown (default) | html | text | json | none
- aggregate: prepend `nodes | import "section" |` prefix (CLI -A flag)

Deps: add mq-check, mq-formatter, mq-hir; enable json feature on mq-markdown
@harehare harehare merged commit d8fe14e into main Mar 24, 2026
4 checks passed
@harehare harehare deleted the feat/web-api-cli-parity branch March 24, 2026 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant