curl --request POST \
--url https://api.eddy.engineer/v1/agents/{id}/publish \
--header 'Content-Type: application/json' \
--data '
{
"changelog": "<string>",
"agent_expected_version": 123,
"dry_run": true,
"expected_version": 123,
"override": {
"reason": "<string>"
},
"screen": "<string>"
}
'import requests
url = "https://api.eddy.engineer/v1/agents/{id}/publish"
payload = {
"changelog": "<string>",
"agent_expected_version": 123,
"dry_run": True,
"expected_version": 123,
"override": { "reason": "<string>" },
"screen": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
changelog: '<string>',
agent_expected_version: 123,
dry_run: true,
expected_version: 123,
override: {reason: '<string>'},
screen: '<string>'
})
};
fetch('https://api.eddy.engineer/v1/agents/{id}/publish', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.eddy.engineer/v1/agents/{id}/publish",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'changelog' => '<string>',
'agent_expected_version' => 123,
'dry_run' => true,
'expected_version' => 123,
'override' => [
'reason' => '<string>'
],
'screen' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.eddy.engineer/v1/agents/{id}/publish"
payload := strings.NewReader("{\n \"changelog\": \"<string>\",\n \"agent_expected_version\": 123,\n \"dry_run\": true,\n \"expected_version\": 123,\n \"override\": {\n \"reason\": \"<string>\"\n },\n \"screen\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.eddy.engineer/v1/agents/{id}/publish")
.header("Content-Type", "application/json")
.body("{\n \"changelog\": \"<string>\",\n \"agent_expected_version\": 123,\n \"dry_run\": true,\n \"expected_version\": 123,\n \"override\": {\n \"reason\": \"<string>\"\n },\n \"screen\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eddy.engineer/v1/agents/{id}/publish")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"changelog\": \"<string>\",\n \"agent_expected_version\": 123,\n \"dry_run\": true,\n \"expected_version\": 123,\n \"override\": {\n \"reason\": \"<string>\"\n },\n \"screen\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"agent": {
"asks_again": true,
"changed": true,
"hash": "<string>",
"hash_before": "<string>",
"id": "<string>",
"restored": true,
"version": 123
},
"app": "<string>",
"dry_run": true,
"lint": {},
"pair": {
"agent": "<string>",
"screen": "<string>"
},
"tests": {},
"unchanged": true,
"version": {},
"would_publish": true
}Publish an agent with its screen, as one (TL4)
An agent is not published alone: what its screen’s viewers run is the agent’s saved record (TL2’s seat pins its spec hash at each token). A person who may edit both (an API key, an app or an agent run: 403 HUMAN_GATE_NEEDS_HUMAN) publishes the agent with its screen: the screen is the one app the caller may edit whose draft declares this agent (screen names it when there are several: 409 AGENT_SCREENS_AMBIGUOUS; none: 409 AGENT_HAS_NO_SCREEN; an app whose draft declares another agent or none: 409 SCREEN_NOT_PAIRED). The agent’s draft (its live chain’s head while current) must have no problems (422 AGENT_INVALID). The agent first: a draft that differs from the record is saved as the agent’s next version. Then the screen, exactly as POST /v1/apps//publish publishes it (the gate, override, expected_version the screen’s; its errors are its own). If the screen does not publish, the agent is put back: its record holds the earlier document again as a new version (so viewers keep what they consented to) and its live chain keeps the author’s edits; the error says agent.restored: true. The reply is the screen’s publish reply with agent (id, version, changed, hash, hash_before, asks_again: the consent hash moved, so each viewer’s next token asks again) and pair (agent, screen). dry_run: true answers the screen’s dry run and what the agent would become, writing nothing.
curl --request POST \
--url https://api.eddy.engineer/v1/agents/{id}/publish \
--header 'Content-Type: application/json' \
--data '
{
"changelog": "<string>",
"agent_expected_version": 123,
"dry_run": true,
"expected_version": 123,
"override": {
"reason": "<string>"
},
"screen": "<string>"
}
'import requests
url = "https://api.eddy.engineer/v1/agents/{id}/publish"
payload = {
"changelog": "<string>",
"agent_expected_version": 123,
"dry_run": True,
"expected_version": 123,
"override": { "reason": "<string>" },
"screen": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
changelog: '<string>',
agent_expected_version: 123,
dry_run: true,
expected_version: 123,
override: {reason: '<string>'},
screen: '<string>'
})
};
fetch('https://api.eddy.engineer/v1/agents/{id}/publish', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.eddy.engineer/v1/agents/{id}/publish",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'changelog' => '<string>',
'agent_expected_version' => 123,
'dry_run' => true,
'expected_version' => 123,
'override' => [
'reason' => '<string>'
],
'screen' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.eddy.engineer/v1/agents/{id}/publish"
payload := strings.NewReader("{\n \"changelog\": \"<string>\",\n \"agent_expected_version\": 123,\n \"dry_run\": true,\n \"expected_version\": 123,\n \"override\": {\n \"reason\": \"<string>\"\n },\n \"screen\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.eddy.engineer/v1/agents/{id}/publish")
.header("Content-Type", "application/json")
.body("{\n \"changelog\": \"<string>\",\n \"agent_expected_version\": 123,\n \"dry_run\": true,\n \"expected_version\": 123,\n \"override\": {\n \"reason\": \"<string>\"\n },\n \"screen\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eddy.engineer/v1/agents/{id}/publish")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"changelog\": \"<string>\",\n \"agent_expected_version\": 123,\n \"dry_run\": true,\n \"expected_version\": 123,\n \"override\": {\n \"reason\": \"<string>\"\n },\n \"screen\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"agent": {
"asks_again": true,
"changed": true,
"hash": "<string>",
"hash_before": "<string>",
"id": "<string>",
"restored": true,
"version": 123
},
"app": "<string>",
"dry_run": true,
"lint": {},
"pair": {
"agent": "<string>",
"screen": "<string>"
},
"tests": {},
"unchanged": true,
"version": {},
"would_publish": true
}Body
Response
Published: the screen's version and what the agent became