Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: add agent endpoint for querying file system#16736

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ethanndickson merged 11 commits intomainfromethan/agent-ls
Mar 7, 2025

Conversation

ethanndickson
Copy link
Member

@ethanndicksonethanndickson commentedFeb 28, 2025
edited
Loading

Closescoder/internal#382

The API differs slightly from the RFC, in the interest of making consumption of the API agnostic to the host operating system of the agent.

Queries supply the requested path as an array:

{"path": ["home","coder"],"relativity":"root" }

Whilst the agent returns the requested path as an OS-specific path string but also as an array, both absolute. (relativity = root)

Linux:

{"absolute_path_string":"/home/coder","absolute_path": ["home","coder"],"contents": [        {"absolute_path_string":"/home/coder/.bash_logout","is_dir":false,"name":".bash_logout"        },...    ]}

Windows:

{"absolute_path_string":"C:\\Users\\coder","absolute_path": ["C:\\","Users","coder"],"contents": [        {"absolute_path_string":"C:\\Users\\coder\\Documents","is_dir":true,"name":"Documents"        },...    ]}

API consumers need only append thename of a contents to the existing path array in order to query a subdirectory.
To traverse backwards frompath: [], relativity=home, theabsolute_path array returned can be used, popping the last element off the array, and changing the relativity toroot.
Once the consumer has a target, they can use theabsolute_path_string - at no point do they need to know the workspace OS.

Example Usage:

$ http POST localhost:4/api/v0/list-directory path:='["home", "coder"]' relativity=rootHTTP/1.1 200 OKContent-Length: 649Content-Type: application/json; charset=utf-8Date: Fri, 28 Feb 2025 05:53:40 GMT{    "absolute_path": [        "home",        "coder"    ],    "absolute_path_string": "/home/coder",    "contents": [        {            "absolute_path_string": "/home/coder/.bash_logout",            "is_dir": false,            "name": ".bash_logout"        },        ...    ]}

@ethanndicksonGraphite App
Copy link
MemberAuthor

This stack of pull requests is managed byGraphite. Learn more aboutstacking.

@ethanndicksonethanndickson changed the titlefeat: add agent endpoint for querying file systemchore: add agent endpoint for querying file systemFeb 28, 2025
@ethanndicksonethanndickson marked this pull request as ready for reviewFebruary 28, 2025 03:40
@ethanndicksonethanndicksonforce-pushed theethan/agent-ls branch 3 times, most recently from690da7c to39aa907CompareFebruary 28, 2025 06:11
@ethanndicksonethanndicksonforce-pushed theethan/agent-ls branch 2 times, most recently from285ae7f to4c37100CompareFebruary 28, 2025 07:37
@ethanndicksonethanndickson merged commit17f8e93 intomainMar 7, 2025
31 checks passed
@ethanndicksonethanndickson deleted the ethan/agent-ls branchMarch 7, 2025 04:33
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsMar 7, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@spikecurtisspikecurtisspikecurtis left review comments

@deansheatherdeansheatherdeansheather approved these changes

@ThomasK33ThomasK33Awaiting requested review from ThomasK33

Assignees

@ethanndicksonethanndickson

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Implement file 'ls' API on Agent
4 participants
@ethanndickson@ThomasK33@spikecurtis@deansheather

[8]ページ先頭

©2009-2025 Movatter.jp