show#
One changeset in full: its parents, author, message, changes and signatures; pass max_changes of 100 or less, since clients limit long tool results.
- Since
0.1.0- Mutates
- no
- Identity required
- no
- Envelope op
show- Cli command
swarmops show- Request type
ShowReq- Annotations
{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true}- Max result chars
null- CLI command
swarmops show
Input schema#
arguments is a ShowReq: swarmops schema ShowReq prints the type. A field the type does not know is ignored.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
max_changes | integer | no | 400 | The most entries of changes to return: at least 1 (0 is E_INVALID_ARG). |
rev | string | yes | The changeset to show. A revision as the caller wrote it, for the store to resolve: a ref name (main, release/1.2), a full 64-hex changeset id or a unique prefix of at least 12 hex digits, optionally followed by ~N for the N-th first-parent ancestor. |
JSON Schema#
As tools/list gives it: each $ref replaced by its definition, so that it stands alone.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"description": "`show`: one changeset in full.",
"properties": {
"max_changes": {
"default": 400,
"description": "The most entries of `changes` to return: at least 1 (0 is `E_INVALID_ARG`).",
"format": "uint",
"minimum": 1,
"type": "integer"
},
"rev": {
"description": "The changeset to show. A revision as the caller wrote it, for the store to resolve: a ref name (`main`,\n`release/1.2`), a full 64-hex changeset id or a unique prefix of at least 12 hex digits,\noptionally followed by `~N` for the N-th first-parent ancestor.",
"type": "string"
}
},
"required": [
"rev"
],
"title": "ShowReq",
"type": "object"
}Annotations#
It only reads the store.
| Annotation | Value | Meaning |
|---|---|---|
destructiveHint | false | True: a tool that changes the store may overwrite or delete what is there, not only add to it. |
idempotentHint | true | True: calling it again with the same arguments changes nothing more. |
openWorldHint | false | True: it reaches beyond a closed set of things. Every tool here stays inside the store. |
readOnlyHint | true | True: the tool does not change its environment, the store. |
Its entry in tools/list carries no _meta.
CLI command#
swarmops show runs the same operation and prints the same envelope.
Examples#
{
"id": 13,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"rev": "[landed]"
},
"name": "show"
}
}{
"id": 13,
"jsonrpc": "2.0",
"result": {
"content": [
{
"text": "{\"ok\":true,\"op\":\"show\",\"api\":1,\"result\":{\"id\":\"[landed]\",\"seq\":3,\"parents\":[\"[theirs]\"],\"root\":\"[id5]\",\"author\":{\"agent\":\"agent/worker-17\"},\"lander\":{\"agent\":\"agent/worker-17\"},\"created_at\":\"[created_at]\",\"message\":\"change f\",\"land_key\":\"land-7\",\"squashed_from\":[\"[head]\"],\"changes\":[{\"path\":\"src/lib.rs\",\"op\":\"put\",\"kind\":\"file\",\"blob\":\"[id6]\"}],\"files_changed\":1,\"changes_truncated\":false,\"metadata\":{\"agent\":\"agent/worker-17\",\"land_key\":\"land-7\",\"lander\":\"agent/worker-17\",\"squashed_from\":\"[head]\"},\"signatures\":{\"author\":{\"name\":\"agent/worker-17\",\"email\":\"worker-17@agent.swarmops.local\",\"secs\":\"[secs]\",\"offset_secs\":0},\"committer\":{\"name\":\"agent/worker-17\",\"email\":\"worker-17@agent.swarmops.local\",\"secs\":\"[secs]\",\"offset_secs\":0}}},\"meta\":{\"repo\":\"[tmp]/store\",\"elapsed_ms\":\"[elapsed_ms]\",\"resolved\":{\"[landed]\":\"[landed]\"},\"auth\":\"trust\"}}",
"type": "text"
}
],
"isError": false,
"structuredContent": {
"api": 1,
"meta": {
"auth": "trust",
"elapsed_ms": "[elapsed_ms]",
"repo": "[tmp]/store",
"resolved": {
"[landed]": "[landed]"
}
},
"ok": true,
"op": "show",
"result": {
"author": {
"agent": "agent/worker-17"
},
"changes": [
{
"blob": "[id6]",
"kind": "file",
"op": "put",
"path": "src/lib.rs"
}
],
"changes_truncated": false,
"created_at": "[created_at]",
"files_changed": 1,
"id": "[landed]",
"land_key": "land-7",
"lander": {
"agent": "agent/worker-17"
},
"message": "change f",
"metadata": {
"agent": "agent/worker-17",
"land_key": "land-7",
"lander": "agent/worker-17",
"squashed_from": "[head]"
},
"parents": [
"[theirs]"
],
"root": "[id5]",
"seq": 3,
"signatures": {
"author": {
"email": "worker-17@agent.swarmops.local",
"name": "agent/worker-17",
"offset_secs": 0,
"secs": "[secs]"
},
"committer": {
"email": "worker-17@agent.swarmops.local",
"name": "agent/worker-17",
"offset_secs": 0,
"secs": "[secs]"
}
},
"squashed_from": [
"[head]"
]
}
}
}
}The server ran as swarmops mcp --repo [tmp]/store --as agent/worker-17, after initialize. Recorded by the MCP tests. A name in square brackets, such as [tmp] or [c1], stands for what differs from run to run: the test's temporary directory, an id, a time, the version.
Details#
Pass max_changes of 100 or less: a changeset's change list can be long, and a result holds the
envelope twice.
The result gives the changeset's parents, author, message, changes and signatures.
Return information#
A tool result: the envelope, whose op is show, as structuredContent and again as the text of its one content block. isError is true exactly when the envelope's ok is false. On success the envelope's result is what swarmops show returns.
Errors#
A failed call is a tool result with isError: true; the envelope's error.code is one of the error codes.
- E_INVALID_ARG: arguments that do not fit
ShowReq, a field named twice among them included, or that break one of the server's own rules. - E_NOT_A_REPO: the server's store is not there; the server serves on.
- E_INTERNAL: the operation panicked, a bug.
Then the errors of the operation, as swarmops show lists them.
See also#
resolve_rev
The full id of the changeset a revision names (a ref name, a full id or a unique prefix of 12 or more hex digits, then any \~N suffixes), resolved as every…
undo
Moves every ref an operation of op\_log moved back to what it named before, by compare-and-swap in one transaction: all of them or none. A ref moved since…