Skip to content

Add support for emitting usage as a JSON schema #897

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

natebosch
Copy link
Member

  • Vendor a copy of a library defining a JSON schema API which can output
    as a Map<String, Object?>.
  • Add a jsonSchema getter on ArgParser which is similar to usage
    but outputs a schema instead of help text.

Clients can manually support a --json-help or similar argument in the
same way they support --help.

- Vendor a copy of a library defining a JSON schema API which can output
  as a `Map<String, Object?>`.
- Add a `jsonSchema` getter on `ArgParser` which is similar to `usage`
  but outputs a schema instead of help text.

Clients can manually support a `--json-help` or similar argument in the
same way they support `--help`.
Copy link

PR Health

Breaking changes ⚠️
Package Change Current Version New Version Needed Version Looking good?
args Breaking 2.7.0 2.7.0 3.0.0
Got "2.7.0" expected >= "3.0.0" (breaking changes)
⚠️

This check can be disabled by tagging the PR with skip-breaking-check.

Changelog Entry
Package Changed Files
package:args pkgs/args/lib/src/allow_anything_parser.dart
pkgs/args/lib/src/arg_parser.dart
pkgs/args/lib/src/json_schema.dart

Changes to files need to be accounted for in their respective changelogs.

This check can be disabled by tagging the PR with skip-changelog-check.

Coverage ⚠️
File Coverage
pkgs/args/lib/src/allow_anything_parser.dart 💔 72 % ⬇️ 4 %
pkgs/args/lib/src/arg_parser.dart 💚 95 % ⬆️ 1 %
pkgs/args/lib/src/json_schema.dart 💚 17 %

This check for test coverage is informational (issues shown here will not fail the PR).

This check can be disabled by tagging the PR with skip-coverage-check.

API leaks ✔️

The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.

Package Leaked API symbols
License Headers ✔️
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
Files
no missing headers

All source files should start with a license header.

// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

// Copied from https://github.com/dart-lang/ai/blob/failures-only/pkgs/dart_mcp/lib/src/api/tools.dart
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Copied from https://github.com/dart-lang/ai/blob/failures-only/pkgs/dart_mcp/lib/src/api/tools.dart
// Copied from https://github.com/dart-lang/ai/blob/main/pkgs/dart_mcp/lib/src/api/tools.dart

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants