getappmap / appmap-js

Client libraries for AppMap
45 stars 12 forks source link

Navie oneshot command #1788

Closed dividedmind closed 1 month ago

dividedmind commented 1 month ago

This adds appmap navie command to run one-shot interactions with Navie that do the same context gathering as the RPC commands.

$ LC_ALL=C ./built/cli.js navie --help
cli.js navie [question..]

Explain a question using Navie

Positionals:
  question  Question text; appended to any other input     [array] [default: []]

Options:
      --version         Show version number                            [boolean]
  -v, --verbose         Run with verbose logging                       [boolean]
      --help            Show help                                      [boolean]
  -d, --directory       program working directory
             [array] [default: ["/home/divide/projects/appmap-js/packages/cli"]]
      --navie-provider  navie provider to use
                                           [string] [choices: "local", "remote"]
      --log-navie       Log Navie events to stderr    [boolean] [default: false]
      --ai-option       Specify an extended option to the AI provider, in the
                        form of a key=value pair. May be repeated.       [array]
      --agent-mode      Agent mode which to run the Navie AI. The agent can also
                        be controlled by starting the question with '@<agent> '.
                                        [choices: "explain", "generate", "help"]
      --code-editor     Active code editor. This information is used to tune the
                        @help responses. If unspecified, the code editor may be
                        picked up from environment variables APPMAP_CODE_EDITOR,
                        TERM_PROGRAM and TERMINAL_EMULATOR.             [string]
  -o, --output          Output path                                     [string]
  -i, --input           Input path                                      [string]

$ ./built/cli.js navie -d /tmp/user/1000/swe-navie-marshmallow-3.0-d14cebrt/ "what does this project do?" 2>/dev/null
The project appears to revolve around Marshmallow, a Python library used for object serialization. Marshmallow assists in converting complex data types, like ORM/ODM entities or custom class objects, to and from native Python data types like dictionaries, which can then be rendered into standard formats such as JSON.
[...]
github-actions[bot] commented 1 month ago

AppMap runtime code review

Summary Status
Failed tests :white_check_mark: All tests passed
API changes :zero: No API changes
Security flaws :white_check_mark: None detected
Performance problems :white_check_mark: None detected
Code anti-patterns :white_check_mark: None detected
New AppMaps :zero: No new AppMaps
kgilpin commented 1 month ago

Thanks, I do have a couple of comments on the interface that I think will make this command a bit more accessible to use, even if they make it less pure in some sense.

appland-release commented 1 month ago

:tada: This PR is included in version @appland/appmap-v3.142.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: