sourcegraph / cody

Type less, code more: Cody is an AI code assistant that uses advanced search and codebase context to help you write and fix code.
https://cody.dev
Apache License 2.0
2.59k stars 275 forks source link

agent: added a simple cli to get the tsc autocomplete context #4754

Closed hitesh-1997 closed 3 weeks ago

hitesh-1997 commented 3 months ago

Context

Adding a simple cli to get the tsc compiler api context. We can specify a configuration file having filePath and line number and trigger the tsc context retriver. This would be useful to gather the context data for training and evaluation purpose.

Usages

pnpm agent internal tsc-context-retriever \
            --src-access-token <token> \
            --src-endpoint https://sourcegraph.com \
            --config-path /Users/hiteshsagtani/fixtures/config.json  \
            --save-dir /Users/hiteshsagtani/fixtures/output

Test plan

  1. Manully checking the generated outputs via cli.
github-actions[bot] commented 3 months ago

‼️ Hey @sourcegraph/cody-security, please review this PR carefully as it introduces the usage of an unsafe_ function or abuses PromptString.

hitesh-1997 commented 3 months ago

I'm glad to see activity in making the cli tool richer! Only a few blocking comments on naming convention, otherwise LGTM. I highly encourage experimentation like this and want there to be a low barrier to add helpers like these.

Thanks @olafurpg I added a Semaphore in the package.json for agent to limit the number of concurrent request, can you please check that once.

Meanwhile I am looking into what is causing the security issue here: https://github.com/sourcegraph/cody/pull/4754#issuecomment-2206083330

olafurpg commented 2 months ago

Heads up, I merged a PR today that adds a new internal subcommand where bench lives. This command should live there as well

github-actions[bot] commented 4 weeks ago

This PR is marked as stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed automatically in 5 days.