ahto

API explorer

Every method of the ahto API: 117 in 9 services, each with its fields, a form that sends a real request to this instance, the answer as it comes, and the same call as curl, fetch and Go over REST, and over JSON-RPC, GraphQL, WebSocket, MQTT, MCP and gRPC. A gateway runs the ones its mode allows and documents the rest.

agent 3 methods

  • Ask POST /api/v1/agents/{name}/ask
    Runs an agent to its end and returns its final answer, its usage and every event of the run. Takes the same input and gives the same errors as Run; use it from a client that cannot read a stream, and Run for anything a person watches.
  • ListAgents GET /api/v1/agents
    Lists every agent the server knows, enabled or not, with whether it can run now.
  • Run POST /api/v1/agents/{name}/runs stream
    Runs an agent and streams what it does: text as it comes, tool calls and their results, usage, and one done event at the end (after an error event when it failed). Pass name and prompt; dir, model, system and maxturns are optional. The agent may change files in dir, as its sandbox allows. Server stream: the first message may take a while, and ending the call stops the agent. Errors: INVALIDARGUMENT for an empty prompt, a dir that is not absolute or a negative maxturns; NOTFOUND for an unknown agent; FAILEDPRECONDITION when the agent is disabled or not ready; PERMISSIONDENIED on a public gateway or one that accepts remote clients.

base 6 methods

  • CheckUpdate GET /api/v1/base/update
    Says whether a newer ahto is published. A release build (v0.1.2) is compared with the newest GitHub release, a build from source with the latest commit of the default branch on GitHub against the commit it was made from. It asks GitHub at most once an hour and answers from that until then. Without network, or while the repository is not public, it answers the error, not a failure. A gateway in public mode refuses it (PERMISSIONDENIED), so a visitor cannot make the server call GitHub.
  • GetInfo GET /api/v1/base/info
    Returns the version, the environment, the build, the runtime and the listen settings of the running gateway.
  • ListServices GET /api/v1/base/services
    Lists the backends the gateway forwards to, with the services each one serves and whether its descriptors are loaded.
  • Ping GET /api/v1/base/ping
    Checks that the gateway is up. Returns the message it was given and the server time.
  • Watch POST /api/v1/base/watch stream
    Streams one tick per interval until the count is reached. Use it to check that streaming works end to end.
  • WatchStatus GET /api/v1/base/status/watch stream
    Streams the status of the gateway: first GetInfo and ListServices as one message, then the whole status again each time it changes, such as a backend that gets ready or fails. The gateway compares once a second in the process and sends only a change. It never ends; a surface without streaming gets what protocol.streams collects.

debug 7 methods

  • FindTraces GET /api/v1/debug/traces
    Finds traces, newest first, each with its root span, duration, span count and first error. All filters are optional and combine; pagesize 0 is 50, at most 500, and nextpagetoken reads on. INVALIDARGUMENT for a negative mindurationus.
  • GetCrash GET /api/v1/debug/crashes/{id}
    Returns one crash group: the panic, the crashing goroutine, and every goroutine of its last crash grouped by state and stack. Pass the id from ListCrashes or ReportCrash; NOTFOUND when the store no longer has it.
  • GetTrace GET /api/v1/debug/traces/{trace_id}
    Returns one trace: every span with its attributes, events and code, and the logs that carry its trace id. Pass the traceid as 32 hex digits (INVALIDARGUMENT otherwise); NOTFOUND when the store no longer has it.
  • ListCrashes GET /api/v1/debug/crashes
    Lists crash groups (one per crashing stack and build), newest first. Filter by service and since; pagesize 0 is 50, at most 500, and nextpagetoken reads on.
  • ListLogs GET /api/v1/debug/logs
    Lists log records, newest first, or in time order when traceid is set. All filters are optional and combine; pagesize 0 is 100, at most 1000, and nextpagetoken reads on. INVALIDARGUMENT for a minseverity that is not a severity name.
  • ListTargets GET /api/v1/debug/targets
    Lists the services that sent traces, logs or crashes, with the builds they ran, their counts, and whether the OTLP listener is on and where. Takes no input; it also tells how many days the store keeps what it got.
  • ReportCrash POST /api/v1/debug/crashes
    Records a crash from the text of a Go panic or a goroutine dump, as it was written to stderr, and returns the crash group it joined (a new group, or one with a higher count). Pass service, version and text. Writes to the debug store only; it runs nothing. INVALIDARGUMENT when text is over 1 MiB or holds no panic or goroutine stack.

function 9 methods

  • Add POST /api/v1/functions
    Adds a function from a folder on the server's machine, an upload or a module URL, and returns it. Writes the manifest and module under the lake folder. The module must compile (INVALIDARGUMENT otherwise, or when it is over the size limit); a name that is taken is ALREADYEXISTS unless replace is set, and a built-in's name is always taken. A folder is PERMISSIONDENIED while the gateway accepts remote clients.
  • Call POST /api/v1/functions/{name}/call
    Calls a function over input rows and returns its output rows, the lines it logged and the run it made. Pass name; add repository and commitoid, args, and rows or input (not both: INVALIDARGUMENT). The call is recorded as a run (see ListRuns). A function that fails is an answer with error set, not a failed call. A public gateway (GetInfo.public) calls built-ins only: any other kind is PERMISSIONDENIED.
  • Get GET /api/v1/functions/{name}
    Returns one function: its manifest, version, trigger, columns, params and limits. Pass its name as List gives it; NOTFOUND when there is none.
  • GetRun GET /api/v1/functions/{name}/runs/{id}
    Returns one run of a function: its status, error, logs, row counts and duration. Pass the function's name and the run's id from ListRuns; NOTFOUND when the server no longer keeps it (it keeps the last 50).
  • List GET /api/v1/functions
    Lists the functions the server keeps, built-in and added, by name, with facets that count them per category, kind and tag. Every filter (query, category, kind, tag) is optional and they combine. There is no paging: the answer holds them all.
  • ListRuns GET /api/v1/functions/{name}/runs
    Lists the last runs of a function, newest first. The server keeps the last 50 runs of each function in a file under the lake folder, so they survive a restart. NOTFOUND for an unknown function.
  • Remove DELETE /api/v1/functions/{name}
    Removes a function, its files and its runs, and returns nothing. Pass its name; NOTFOUND when there is none, FAILEDPRECONDITION for a built-in.
  • Test POST /api/v1/functions:test
    Tries a function without adding it: compiles the module of the request, calls it once over the request's rows and returns what Call returns. Pass a folder, an upload or a fetch as Add takes it, and the call's fields as Call takes them. Nothing is kept: the server's functions, runs and cache stay as they were, so a module can be tried while others use the function of the same name. A public gateway refuses it (PERMISSIONDENIED), as it refuses Call of a wasm function.
  • WatchRuns GET /api/v1/functions/{name}/runs/watch stream
    Streams the runs of a function: first the runs ListRuns lists with reset set, then each new run as it finishes. When the function is replaced its runs start again, and the next message has reset set. The stream never ends by itself; it ends with NOTFOUND when the function is removed. Over REST it is a server-sent event stream. It is declared before GetRun so that its route wins over runs/{id}.

identity 29 methods

  • AcceptInvite POST /api/v1/identity/invites/accept
    Joins the network with an invite: creates the person and their first credential, starts a session and returns both. Pass the invite's token, a nonce from CreateSignInChallenge that the credential signed, a displayname and the credential. Needs no session. UNAUTHENTICATED when the invite is unknown, used, revoked or expired; FAILEDPRECONDITION when it was used meanwhile or the key is a credential already.
  • AddCredential POST /api/v1/identity/credentials
    Adds a device key or a passkey to the signed-in person and returns it. Pass a nonce from CreateSignInChallenge and the new credential with its proof that its holder has the key. The caller must have signed in within the last 5 minutes (UNAUTHENTICATED otherwise). FAILEDPRECONDITION when the key or passkey is bound already. Writes to the membership log.
  • AdmitWorkload POST /api/v1/identity/workloads
    Admits a service principal by its peer id and returns it. It gets no role until GrantRole gives it one (default deny). Admins only. Writes to the membership log.
  • CancelQuorumRequest POST /api/v1/identity/quorum/{id}/cancel
    Cancels an open quorum request, which frees its slot at once, and returns the request in state CANCELLED. Admins only. FAILEDPRECONDITION when no open request has that id.
  • CreateInvite POST /api/v1/identity/invites
    Creates an invite for a new person with a role and returns the invite and its token. The token is in this answer only; the log keeps its hash. The invite lives for ttl, 0 meaning 7 days. Admins only. Writes to the membership log. INVALIDARGUMENT for a role that is not admin or member or a ttl over the longest an invite may live.
  • CreateOneTimeCode POST /api/v1/identity/signin/code
    Returns the one-time code that ahto ui prints. The node's own key signs a challenge from CreateSignInChallenge and gets a code that signs one browser in as the node owner through VerifySignIn within 5 minutes. A new code replaces the last. Needs no session, but works over loopback only: it is refused from any other address, and whenever allowremote is true.
  • CreateSignInChallenge POST /api/v1/identity/signin/challenge
    Creates a sign-in challenge and returns its one-time nonce, the network fingerprint and the relying party id. The nonce is valid for 5 minutes and bound to this network and the caller's origin. The device key or passkey signs it, and VerifySignIn checks the signature. Needs no session and takes no input.
  • ExportAuditEvents GET /api/v1/identity/audit/export stream
    Streams the audit events of a time range, oldest first, one per message, for a SIEM or an archive. Admins only. Server stream: it ends after the last event up to until (or now).
  • GetAuthorityStatus GET /api/v1/identity/authority
    Returns the network's authority as this node sees it: the lease state and expiry, the epoch and its certificate, the group of nodes and which are reachable, the newest log entry applied, and the outage policy. "Reconnecting" in the UI is leasestate RECONNECTING; nobody is signed out. leasestate OFF means the network has no v2 log and identity is off. Takes no input.
  • GetNetworkPolicy GET /api/v1/identity/policy
    Returns the network-wide rules: the session profile and its timeouts, the outage policy and the passkey authenticator rules. Takes no input.
  • GetPerson GET /api/v1/identity/persons/{id}
    Returns one person with their roles (grants), by id. Anyone may read themselves; another person is for an admin, and NOTFOUND for anyone else, so ids cannot be probed.
  • GetSession GET /api/v1/identity/session
    Returns the caller's session and person. UNAUTHENTICATED when there is none. Works for a session that needs reauthentication, so a client can read needsreauth.
  • GrantRole POST /api/v1/identity/roles/grant
    Grants a role (admin or member) to a person or a workload and returns the grant. resource is a glob over a repository name, and empty means the whole network. Admins only. Writes to the membership log.
  • ListAuditEvents GET /api/v1/identity/audit
    Lists audit events, newest first: who did what, with which outcome, never the request's content. Filter by action, person and time range (since, until). Admins only. Paged: pagesize 0 means 50, at most 200; nextpagetoken reads on, and totalsize counts them all.
  • ListCredentials GET /api/v1/identity/credentials
    Lists the live device keys and passkeys ordered by key: of personid when set, else of the whole network for an admin and the caller's own for anyone else. Only an admin may name another person. The log keeps no label or times for a credential, so those stay empty. Paged: pagesize 0 means 50, at most 200; nextpagetoken reads on.
  • ListGuardians GET /api/v1/identity/guardians
    Lists the guardians who can recover the network, the threshold, when a rehearsal last passed and the quorum requests still open. Admins only. Takes no input.
  • ListInvites GET /api/v1/identity/invites
    Lists the invites of the network, open and used, oldest first. Admins only. Paged: pagesize 0 means 50, at most 200; nextpagetoken reads on, and totalsize counts them all.
  • ListPersons GET /api/v1/identity/persons
    Lists the people in the network in the order they were admitted: everyone for an admin, only the caller for anyone else. Revoked people are left out unless includerevoked is set. Paged: pagesize 0 means 50, at most 200; nextpagetoken reads on, and totalsize counts them all.
  • ListSessions GET /api/v1/identity/sessions
    Lists the sessions on this node, newest first: the caller's own, or, for an admin who names personid, another person's. Sessions are kept on this node only, not in the network's log. Paged: pagesize 0 means 50, at most 200; nextpagetoken reads on, and totalsize counts them all.
  • ListWorkloads GET /api/v1/identity/workloads
    Lists the workloads, that is the service principals such as build nodes. A workload is never a person. Paged: pagesize 0 means 50, at most 200; nextpagetoken reads on.
  • Revoke POST /api/v1/identity/revoke
    Revokes a person, a credential, a workload or an invite, whichever target names, and returns its position in the log. Open sessions and streams of what is revoked end at once on every node the authority reaches. Pass a short reason with no names or personal data: it is kept in the log for good. Admins only. FAILEDPRECONDITION when it would revoke the last admin or an invite that is used already.
  • RevokeRole POST /api/v1/identity/roles/revoke
    Takes back a grant by its id and returns nothing. Admins only. NOTFOUND for an unknown grant; FAILEDPRECONDITION when it would leave the network with no admin.
  • RevokeSession POST /api/v1/identity/sessions/revoke
    Ends one session on this node by its id and returns nothing. A member may end only their own sessions; an admin may end any. Needs no lease, since sessions are local. Errors: INVALIDARGUMENT for an id that is not a session id; NOTFOUND when there is no such session.
  • SetGuardians POST /api/v1/identity/guardians
    Proposes a new guardian set and threshold and returns the quorum request that carries it. The set replaces the one in force and applies once enough current guardians sign the request (SignQuorumRequest). Admins only.
  • SetNetworkPolicy POST /api/v1/identity/policy
    Changes the network-wide rules and returns the policy now in force. A field left UNSPECIFIED or zero keeps its value. Admins only. Writes to the membership log. names and epochlifetime are not served yet: setting them is UNIMPLEMENTED. FAILEDPRECONDITION when the change would refuse the caller's own passkey.
  • SignOut POST /api/v1/identity/signout
    Ends the caller's own session and clears the session cookie. Takes no input and returns nothing. Works for a session that needs reauthentication.
  • SignQuorumRequest POST /api/v1/identity/quorum/{id}/sign
    Adds one guardian's signature to an open quorum request (a guardian change or a rehearsal) and returns the request. Pass the request's id, the guardian's fingerprint and its signature over the request's payload. The signature is the authority, so any signed-in caller may hand it in. FAILEDPRECONDITION when no open request has that id.
  • StartRecoveryRehearsal POST /api/v1/identity/guardians/rehearsal
    Starts a recovery rehearsal and returns its quorum request. The guardians sign a throwaway successor, which proves the network can be recovered; it passes once the threshold have signed (SignQuorumRequest). Admins only. Takes no input.
  • VerifySignIn POST /api/v1/identity/signin
    Checks a signed challenge (a device key signature, a passkey assertion or the local one-time code) and starts a session, returning the session and the person. The session secret is set as a cookie, never in the answer. With a session cookie present it renews that session instead: the one tap the enterprise profile asks for after an hour idle. Needs no session. The one-time code is refused whenever allowremote is true, and over a remote connection.

security 8 methods

  • GetAdvisory GET /api/v1/security/advisories/{id}
    Gets one advisory by its id or any alias, with its affected ranges, references, the KEV entry and EPSS score of its CVE, and the lake repositories that hold its commits. Fails with INVALIDARGUMENT when id is empty and with NOTFOUND when no advisory has that id or alias.
  • GetPosture GET /api/v1/security/posture
    Gets how safe a repository is at a commit: a grade from A to F, its findings by severity, its dependencies, its manifests, and what the advisories say of the packages it uses. Pass repo and, optionally, a commit or ref (the default branch head when empty). Fails with INVALIDARGUMENT for a bad argument and with NOTFOUND when the repository or commit is not in the lake.
  • GetSources GET /api/v1/security/sources
    Lists the advisory feeds as the last sync left them, with how each one went. Takes no arguments. The list is empty before the first sync. Fails with UNAVAILABLE while the lake is not open.
  • ListDependencies GET /api/v1/security/dependencies
    Lists the packages a repository's manifests and lockfiles pin at a commit, one entry per ecosystem, name and version. Filter by ecosystem, words in the name, direct only, or vulnerable only. Paged with pagesize (default 200, at most 1000) and pagetoken. Fails with INVALIDARGUMENT for a bad argument and with NOTFOUND when the repository or commit is not in the lake.
  • ListFindings GET /api/v1/security/findings
    Lists what is wrong in a repository at a commit, riskiest first: a dependency pinned at an affected version (vulnerabledependency), the commit inside an advisory's GIT range (vulnerablecommit), and, when asked for by kinds, secrets, dangerous calls and sensitive files found in the files. Filters, order and paging (pagesize default 100, at most 500) are in the request. Fails with INVALIDARGUMENT for a bad argument and with NOTFOUND when the repository or commit is not in the lake.
  • SearchAdvisories GET /api/v1/security/advisories
    Searches the advisories and returns one page of matches with facet counts for the whole result. Pass words, an ecosystem, a package, a minimum severity, KEV or EPSS filters, an order, and pagesize and pagetoken (default 50, at most 200). Withdrawn advisories are left out unless asked for. Fails with INVALIDARGUMENT for a bad page size or token, and with UNAVAILABLE while the lake is not open.
  • StreamFindings GET /api/v1/security/findings/stream stream
    Streams the findings of a repository at a commit as they are found, with the filters of ListFindings but no paging: the advisory findings first, then the code findings as the files are scanned, then a last message with phase done and the counts. Fails like ListFindings. Over REST it is a server-sent event stream.
  • SyncAdvisories POST /api/v1/security/sync stream
    Downloads the advisory feeds and replaces the advisory tables of the lake in one run. Pass feeds to sync only some of them, or offline to read the kept copies without downloading. This writes the lake. It is a server stream: each message reports one step of one feed, and the last message has report set. A feed that fails keeps its earlier copy; the call fails only when no feed could be read. Fails with INVALIDARGUMENT for an unknown feed name, and with PERMISSIONDENIED in public mode. Over REST it is a server-sent event stream.

settings 2 methods

  • ListSettings GET /api/v1/settings
    Lists every setting of the gateway: the value in effect, the value the files give now, its default, where it came from, and whether a change applies at once or after a restart. Takes no input. Also says whether settings can be saved here (writable) and why not. A setting that holds a secret is shown as a fingerprint, never its value.
  • UpdateSettings POST /api/v1/settings
    Saves values to the saved file, takes the keys in unset out of it, and applies the changes that can apply while the gateway runs; the rest wait for a restart. Returns every setting after the save and the keys applied and waiting. All the values are checked together first; one bad value saves nothing. Errors: INVALIDARGUMENT for nothing to change, an unknown or locked key, or a value that does not read; FAILEDPRECONDITION when settings are not writable (public mode, no saved file).

source 34 methods

  • AddRepository POST /api/v1/source/repositories
    Adds a repository from a git URL, or from a folder on the machine the server runs on, as ahto crawl does. It checks the input, queues the crawl and returns the job at once; GetSyncJob follows it. A URL the lake has already syncs that repository. A folder is PermissionDenied while the gateway accepts remote clients (protocol.allowremote).
  • FindFiles GET /api/v1/source/files/find
    Finds the files of a commit whose path holds a text, ignoring case, by path; every file when the text is empty. It answers the first page and the total; the whole list is at /arrow/v1/<repo>/files?commit=<commit>&text=<text> as an Arrow IPC stream.
  • GetActivity GET /api/v1/source/activity
    Counts the commits that change a file or a directory along the first-parent history of a commit, and their distinct authors, per day, week, month or year of author time, oldest first. The same rows are at /arrow/v1/<repo>/activity as Arrow.
  • GetBlame GET /api/v1/source/blame
    Says which commit last changed each line of a file at a commit, as git blame --porcelain does on the repository's mirror: the runs of lines (hunks) in file order and each commit they name once. Lines carried across a rename keep the path they had then.
  • GetCommit GET /api/v1/source/commit
    Returns a commit: its author, committer, message, parents, and the files it changed against its first parent.
  • GetFile GET /api/v1/source/file
    Returns one file at a commit: the fields of its tree entry, the authors who changed it most and the files most often changed with it. The bytes are at rawurl; with content set the text is in the answer too, whole or a range of lines, so a client that cannot fetch a URL (an MCP tool call) still reads the file. Use it to read code.
  • GetFileSummary GET /api/v1/source/files/summary
    Sums up the files of the tree of a commit under a path, as ListFileStats lists them: how many files, bytes, lines and folders there are, and the files changed by the most commits. For a page that shows totals, without sending every file.
  • GetReview GET /api/v1/source/review
    Returns the review that landed a commit: the GitHub pull request (by the commit, or "(#N)" in its subject) or the Gerrit change of its Reviewed-on trailer, with its reviewers, conversation and inline comments. Public forges only; names, never emails.
  • GetSchema GET /api/v1/source/schema
    Lists the tables RunQuery and StreamQuery read, with each column, its SQL type and what it holds, as ahto query schema prints them; table names one. Read it before writing SQL. Commits, trees and blobs are shared by every repository; repocommits, refs and snapshots say which repository has them. The tables the lake's functions wrote (fn<name>) come last, with the columns their manifests gave them.
  • GetSyncJob GET /api/v1/source/sync-jobs/{id}
    Returns one add or sync job: its state, its stage while it runs, and the counts of the crawl when it is done. The server remembers the last 200 jobs until it restarts.
  • GetSyntax GET /api/v1/source/syntax
    Returns the syntax tree of a file at a commit in a language ahto parses (Go and the tree-sitter languages), every node in preorder with its byte span: from the syntaxnodes table when ahto parse stored the blob's nodes, else parsed for this call. A file in any other language is FAILEDPRECONDITION ("is not in a language ahto parses").
  • GetTree GET /api/v1/source/tree
    Lists one directory at a commit, in Git's order, each entry with its size, lines, language and flags, and its first-parent history up to the commit: the number of commits and authors that changed it and the last of those commits.
  • GetUpkeep GET /api/v1/source/upkeep
    Says whether a file or a directory is still kept up: its last change, the whole months since, and the authors who changed it in the twelve months before a moment (now by default). Only the changes authored at or before that moment count, and one person with several emails is one author (merged by name, the email they used most). Its answer changes with the moment, so it carries no immutable cache headers.
  • ListAuthors GET /api/v1/source/authors
    Lists every author of the commits that change a file or a directory along the first-parent history of a commit, the most commits first, with the author times of their first and last such commit.
  • ListFileStats GET /api/v1/source/files/stats
    Lists every file of the tree of a commit under a path, by path, with its size, lines and language and its history along the first-parent chain up to the commit: how many commits changed it, by how many authors, and its last change. It is the data of the code city; every row is at /arrow/v1/<repo>/stats as Arrow.
  • ListFolders GET /api/v1/source/folders
    Lists the folders in a folder on the machine the server runs on, so a client can pick one for AddRepository; a browser cannot give an absolute path itself. Folders only, sorted by name, at most 2000. PermissionDenied while the gateway accepts remote clients (protocol.allowremote), as a folder in AddRepository is.
  • ListHistory GET /api/v1/source/history
    Lists the commits that change a file or a directory along the first-parent history of a commit, newest first, as git log --no-renames --first-parent <commit> -- <path>, one page at a time.
  • ListRefs GET /api/v1/source/refs
    Lists the branches and tags of a repository as the last snapshot has them, in name order, each with the object it points at and the commit it leads to. Pass kind to keep only branches or only tags. Refs whose name is not valid UTF-8 are left out. Returns NOTFOUND when the repository is unknown or has no snapshot, and INVALIDARGUMENT for a kind that is not branch or tag or a pagetoken this server did not give. totalsize counts every match, over all pages.
  • ListRepositories GET /api/v1/source/repositories
    Lists the repositories of the lake that are not removed, with their default branch and last snapshot: a page at a time, by name or by a stat, filtered by name and state, with the stats of each when stats is true (stats is null without it).
  • ListSyncJobs GET /api/v1/source/sync-jobs
    Lists the add and sync jobs the server remembers, newest first.
  • RemoveRepository DELETE /api/v1/source/repositories/{repo}
    Removes a repository from the lake, as ahto repo rm does, and drops its sync interval. Its rows stay in the files until ahto storage gc; it no longer lists.
  • Resolve GET /api/v1/source/resolve
    Resolves a branch, a tag, HEAD or an object id of a repository, and a path in it, to the commit id, the id of what the path names, its kind and the snapshot. Call it once per page, then call the other rpcs with the commit id.
  • RunQuery POST /api/v1/source/query
    Runs one read-only SELECT (or WITH) statement over the views of the lake, one per table, as ahto query sql does, and returns its first rows as JSON values. Any other statement, or more than one, is refused. The rows are also at /arrow/v1/<repo>/query as Arrow (GET with ?sql=, or POST with the SQL as the body). A query that fails is INVALIDARGUMENT; unless the gateway runs in public mode (GetInfo.public) the message is DuckDB's and the error carries a QueryError detail with where it points.
  • Search GET /api/v1/source/search
    Finds files, symbols, commits, people and lines of code that hold every word of a text, ignoring case, in one repository or in all of them. It reads each repository's default branch at its last snapshot: the files, the symbols and the lines of its tree, and the commits and authors of its first-parent history. It answers one group per kind, best first. A person it finds carries no email, only the name it matched (ListAuthors gives the emails). Its answer changes with each crawl, so it carries no immutable cache headers.
  • SetSyncSchedule PUT /api/v1/source/repositories/{repo}/schedule
    Sets how often the server syncs a repository while it runs: 0 turns it off, else from one minute to 30 days. ListRepositories reads it back with the next sync time.
  • StreamActivity GET /api/v1/source/activity/stream stream
    Streams the activity of several paths, one message per path in the order asked, each with the buckets GetActivity answers for it. The last message has done set. Over REST it is a server-sent event stream; repeat paths in the query (?paths=a&paths=b).
  • StreamFileStats GET /api/v1/source/files/stats/stream stream
    Streams every file of the tree of a commit under a path, by path, with the fields of ListFileStats, in chunks, as DuckDB reads them: the first chunk arrives before the last file is read. Each message says how many files were sent and how many there are; the last one has done set. Over REST it is a server-sent event stream.
  • StreamHistory GET /api/v1/source/history/stream stream
    Streams the commits ListHistory lists, newest first, every page of them, each with how many files it changed, added and deleted against its first parent. The last message has done set. Over REST it is a server-sent event stream.
  • StreamQuery GET /api/v1/source/query/stream stream
    Streams the rows of one query, with the rules of RunQuery, as DuckDB reads them: the first message has the column names, and each message carries up to chunk rows and says how many were sent. The last message has done set, and truncated when the query has more rows than the limit. A query that fails is an error of the stream, as RunQuery says it. ahto never logs the SQL. Over REST it is a server-sent event stream: ?sql=<sql>&limit=<n>&timeout=10s.
  • StreamTimeLapse GET /api/v1/source/timelapse/stream stream
    Streams the time-lapse of a path: one frame per bucket of author time with at least one commit, oldest first, each with the bucket's newest commit, its commit and author counts (those of GetActivity) and what it changed under the path, one entry per path with its net status over the bucket. A frame of more than 2000 changes comes in parts; the last part has frameend set. The last message has done set. Over REST it is a server-sent event stream.
  • StreamUpkeep GET /api/v1/source/upkeep/stream stream
    Streams the upkeep of several paths, one message per path in the order asked, each the answer GetUpkeep gives for it, all measured from one moment. The last message has done set. Over REST it is a server-sent event stream; repeat paths in the query (?paths=a&paths=b).
  • SyncRepository POST /api/v1/source/repositories/{repo}/sync
    Crawls a repository again now, from the remote of its last crawl with that crawl's refs and depth, then derives the read models and parses the new Go files. It returns the job at once; a repository with a job already waiting or running gets that job.
  • WatchSnapshots GET /api/v1/source/snapshots/watch stream
    Streams the state of the lake: first the current one, then one message each time a crawl publishes. A page that receives one resolves its refs again.
  • WatchSyncJobs GET /api/v1/source/sync-jobs/watch stream
    Streams the add and sync jobs the server remembers: first all of them with reset set, newest first, then a message each time jobs change, with the jobs that are new or changed and the ids of the jobs the server forgot. A running job changes with its step, at most about ten times a second. Over REST it is a server-sent event stream. It is declared before GetSyncJob so that its route wins over sync-jobs/{id}.

task 19 methods

  • AddComment POST /api/v1/tasks/{task_id}/comments
    Adds a comment to a task. Comments are ops: ListHistory with kinds COMMENT reads them back.
  • AddLink POST /api/v1/tasks/{from_id}/links
    Links two tasks: fromid depends on, relates to or duplicates toid. Both must exist, and a dependency that would close a loop is refused. Linking twice is the same as once.
  • AddTask POST /api/v1/tasks
    Adds a task. Without parentid it is a new project. It goes last among its siblings unless beforeid or afterid names a sibling to stand next to. The state is backlog unless given; it cannot start as done or dropped.
  • Export GET /api/v1/tasks/export
    Exports the node's op log: every op, oldest first. Import reads it back, here or on another node, and the tree, the links and the history come back the same.
  • GetChain GET /api/v1/tasks/chain
    Gets the longest chain of open tasks under rootid by hours: each task in it waits for the one before (it depends on it, or it is its parent). The first task is the one to start first. Paged with pagesize and pagetoken.
  • GetTask GET /api/v1/tasks/{id}
    Gets one task with the path from its root, its children counts, the rollup of its subtree (done of total, hours, latest due date) and its links both ways. Pass its version as expectedversion to the write that follows.
  • GetTree GET /api/v1/tasks/tree
    Gets a subtree as a flat list in tree order, each node with its depth and the rollup of everything under it. Without id, every project and what is under it. Paged with pagesize and pagetoken.
  • Import POST /api/v1/tasks/import
    Imports an Export of ahto's: the ops not already here are added and the tasks are worked out again from the whole log. Any other format is refused. Importing the same export twice is the same as once.
  • ListHistory GET /api/v1/tasks/history
    Lists the ops of a task (or of its subtree, or of every task), newest first: who changed what and when, the comments, and the forcereason of each forced write. Paged with pagesize and pagetoken.
  • ListLate GET /api/v1/tasks/late
    Lists what is late: open tasks past their due day, and tasks the plan (as PlanTasks makes it) ends after their due day. Soonest due first. Paged with pagesize and pagetoken.
  • ListNext GET /api/v1/tasks/next
    Lists what to work on next: ready tasks whose dependencies are all done, soonest due first (tasks without a due date last), then by rank. Paged with pagesize and pagetoken.
  • ListTasks GET /api/v1/tasks
    Lists tasks in tree order (a parent before its children, siblings by rank). With parentid, the subtree under that task to depth levels; without it, every task. The filters combine with AND. Paged with pagesize and pagetoken.
  • MoveTask POST /api/v1/tasks/{id}/move
    Moves a task, with its subtree, under another parent (or to the top as a project) and places it among its new siblings. A move under its own subtree is refused.
  • PlanTasks GET /api/v1/tasks/plan
    Plans the open tasks of rootid and its subtree into days from starton, at hoursperday: dependencies first, then soonest due (a task is as urgent as the most urgent task waiting on it), a parent after its open children, no task before its own starton. Answers what each day holds (days with nothing planned are left out) and, on the first page, what cannot fit: tasks the plan ends after their due day, tasks already overdue, tasks whose dependencies loop and tasks past the horizon. A task without hours takes none and is counted in unestimated. Every day counts as a work day. Paged by day with pagesize and pagetoken.
  • RemoveLink POST /api/v1/tasks/{from_id}/links/remove
    Removes a link. Removing a link that is not there does nothing.
  • RemoveTask DELETE /api/v1/tasks/{id}
    Removes a task and everything under it. They are marked removed (a tombstone) rather than deleted, so the history keeps them; lists leave them out.
  • SetState POST /api/v1/tasks/{id}/state
    Sets a task's state: backlog, ready, doing, review, done or dropped. The rules: doing needs every dependency done; done needs evidence or a pr, and no open children; dropped, and leaving done, need a reason. forcereason skips them. Evidence given here is added to the task's evidence.
  • UpdateTask PATCH /api/v1/tasks/{id}
    Changes the fields updatemask names, to their values in task. Fields the mask does not name keep their values. The state, the parent and the place are changed with SetState and MoveTask. The old values stay in the history.
  • WatchTasks GET /api/v1/tasks/watch stream
    Streams each op as it is written, from now on, or from after afterhlc first. With taskid, only the ops of that task and its subtree.