canyonos 0.2.3.dev3__tar.gz → 0.2.3.dev4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/PKG-INFO +1 -1
  2. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/api.py +18 -17
  3. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/auth.py +1 -1
  4. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/dashboard.compose.yml +1 -1
  5. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/dashboard.py +1 -1
  6. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/dashboard_registration.py +7 -2
  7. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/dashboard_stack.py +4 -4
  8. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/doctor.py +2 -2
  9. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/logs.py +10 -1
  10. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/quickstart.py +5 -2
  11. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/sdk/models.py +4 -1
  12. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/status.py +4 -2
  13. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/sync.py +6 -2
  14. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos.egg-info/PKG-INFO +1 -1
  15. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/pyproject.toml +1 -1
  16. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/README.md +0 -0
  17. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/__init__.py +0 -0
  18. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/aws_provision.py +0 -0
  19. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/chat.py +0 -0
  20. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/clean.py +0 -0
  21. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/config.py +0 -0
  22. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/constants.py +0 -0
  23. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/contact.py +0 -0
  24. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/context.py +0 -0
  25. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/convert.py +0 -0
  26. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/curl.py +0 -0
  27. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/deploy.py +0 -0
  28. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/deployment.py +0 -0
  29. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/dev_machine.py +0 -0
  30. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/docker_cmd.py +0 -0
  31. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/env.py +0 -0
  32. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/feedback.py +0 -0
  33. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/forwards.py +0 -0
  34. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/init.py +0 -0
  35. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/internal_ca.py +0 -0
  36. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/kubernetes_local.py +0 -0
  37. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/kubernetes_target.py +0 -0
  38. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/new_app.py +0 -0
  39. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/new_app_template/.env.example +0 -0
  40. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/new_app_template/.gitignore +0 -0
  41. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/new_app_template/agents/my_agent.py.tmpl +0 -0
  42. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/new_app_template/agents/workflow.py.tmpl +0 -0
  43. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/new_app_template/config/llms.yaml +0 -0
  44. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/new_app_template/config/policy.yaml +0 -0
  45. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/new_app_template/config/prompts.yaml +0 -0
  46. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/new_app_template/config/scaling.yaml +0 -0
  47. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/new_app_template/config/workflow_config.yaml +0 -0
  48. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/os_support/__init__.py +0 -0
  49. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/os_support/_posix.py +0 -0
  50. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/os_support/_windows.py +0 -0
  51. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/port_utils.py +0 -0
  52. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/ports.py +0 -0
  53. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/provision.py +0 -0
  54. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/resources.py +0 -0
  55. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/sdk/__init__.py +0 -0
  56. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/selection.py +0 -0
  57. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/serve.py +0 -0
  58. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/starters/helloworld/README.md +0 -0
  59. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/starters/helloworld/helloworld/agents/hello_agent.py.tmpl +0 -0
  60. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/starters/helloworld/helloworld/agents/workflow.py.tmpl +0 -0
  61. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/starters/helloworld/helloworld/config/policy.yaml +0 -0
  62. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/starters/helloworld/helloworld/config/test_query.txt +0 -0
  63. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/starters/helloworld/helloworld/config/workflow_config.yaml +0 -0
  64. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/starters/helloworld/workflow_group.yaml +0 -0
  65. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/starters/portfolio/portfolio/.env +0 -0
  66. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/starters/portfolio/portfolio/.env.example +0 -0
  67. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/starters/portfolio/portfolio/agents/advisor_agent.py.tmpl +0 -0
  68. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/starters/portfolio/portfolio/agents/intent_agent.py.tmpl +0 -0
  69. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/starters/portfolio/portfolio/agents/metrics_agent.py.tmpl +0 -0
  70. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/starters/portfolio/portfolio/agents/price_agent.py.tmpl +0 -0
  71. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/starters/portfolio/portfolio/agents/risk_agent.py.tmpl +0 -0
  72. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/starters/portfolio/portfolio/agents/workflow.py.tmpl +0 -0
  73. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/starters/portfolio/portfolio/config/llms.yaml +0 -0
  74. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/starters/portfolio/portfolio/config/policy.yaml +0 -0
  75. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/starters/portfolio/portfolio/config/prompts.yaml +0 -0
  76. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/starters/portfolio/portfolio/config/scaling.yaml +0 -0
  77. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/starters/portfolio/portfolio/config/test_query.txt +0 -0
  78. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/starters/portfolio/portfolio/config/workflow_config.yaml +0 -0
  79. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/starters/portfolio/workflow_group.yaml +0 -0
  80. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/stop.py +0 -0
  81. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/test.py +0 -0
  82. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/theme.py +0 -0
  83. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/ui.py +0 -0
  84. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/upgrade.py +0 -0
  85. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/usage/__init__.py +0 -0
  86. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/usage/consent.py +0 -0
  87. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/usage/delivery.py +0 -0
  88. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/usage/outbox.py +0 -0
  89. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/usage/settings.py +0 -0
  90. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/validate.py +0 -0
  91. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos/workflow_group.yaml +0 -0
  92. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos.egg-info/SOURCES.txt +0 -0
  93. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos.egg-info/dependency_links.txt +0 -0
  94. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos.egg-info/entry_points.txt +0 -0
  95. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos.egg-info/requires.txt +0 -0
  96. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/canyonos.egg-info/top_level.txt +0 -0
  97. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/cli.py +0 -0
  98. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/setup.cfg +0 -0
  99. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/utils/__init__.py +0 -0
  100. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/utils/help_screen.py +0 -0
  101. {canyonos-0.2.3.dev3 → canyonos-0.2.3.dev4}/utils/tui.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: canyonos
3
- Version: 0.2.3.dev3
3
+ Version: 0.2.3.dev4
4
4
  Summary: Open-source platform for multi-agent apps: per-agent scaling, tracing and cost, in plain Python
5
5
  License-Expression: AGPL-3.0-only
6
6
  Project-URL: Homepage, https://canyonos.ai
@@ -53,7 +53,7 @@ OLDER_CHART_ERRORS = {
53
53
  401: ("auth.control_key_unset",),
54
54
  }
55
55
 
56
- # What the API answers a /v1 call whose control key it was not started with, or when
56
+ # What the API answers a /v1/workflow-groups call whose control key it was not started with, or when
57
57
  # it was started with none.
58
58
  CONTROL_KEY_REFUSALS = (
59
59
  "auth.missing_key",
@@ -129,7 +129,7 @@ def error_detail(body, status):
129
129
  """The error object of an answer's `body`, raw bytes, as `{error, code, findings,
130
130
  warnings}`, `error` its message and `code` its code without the prefix, from the
131
131
  CanyonOS API's `{error: code, message}`; each check that is not ok as `error` for
132
- `/readyz`'s answer, and the raw body as `error` when it is neither."""
132
+ `/v1/readyz`'s answer, and the raw body as `error` when it is neither."""
133
133
  text = body.decode(errors="replace").strip()
134
134
  try:
135
135
  parsed = json.loads(text)
@@ -326,17 +326,17 @@ def list_workflow_groups(state=None):
326
326
 
327
327
 
328
328
  def _wait_until_ready(state=None):
329
- """Wait up to READY_TIMEOUT_SECONDS for the API to answer `/readyz`: it listens
330
- before its database is ready, and its `/v1` routes answer 503 until then. An older
331
- API without `/readyz` is not waited for. Raises ApiError with its last answer when
332
- it is still not ready: its database, the one thing `/readyz` waits on, is not."""
329
+ """Wait up to READY_TIMEOUT_SECONDS for the API to answer `/v1/readyz`: it listens
330
+ before its database is ready, and its `/v1/workflow-groups` routes answer 503 until then. An older
331
+ API without `/v1/readyz` is not waited for. Raises ApiError with its last answer when
332
+ it is still not ready: its database, the one thing `/v1/readyz` waits on, is not."""
333
333
  deadline = time.monotonic() + READY_TIMEOUT_SECONDS
334
334
  while True:
335
335
  try:
336
336
  _open(
337
337
  state,
338
338
  "GET",
339
- "/readyz",
339
+ "/v1/readyz",
340
340
  "Readiness check",
341
341
  timeout=STATUS_TIMEOUT_SECONDS,
342
342
  ).close()
@@ -345,7 +345,7 @@ def _wait_until_ready(state=None):
345
345
  if e.status == 404:
346
346
  return
347
347
  if time.monotonic() >= deadline:
348
- # A 503 is `/readyz` waiting on the database.
348
+ # A 503 is `/v1/readyz` waiting on the database.
349
349
  answer = str(e)
350
350
  if e.status == 503:
351
351
  answer = f"{answer.rstrip('.')}.{_database_hint(state)}"
@@ -381,7 +381,8 @@ def probe(state=None):
381
381
  def put_workflow_group(state, config, env_text, workflows=None, api_key_hash=None):
382
382
  """Upload the workflow group's name, the text `config` of its `workflow_group.yaml`
383
383
  and the text `env_text` of the `.env` beside it (None when there is none); with
384
- `workflows`, the API removes the uploaded workflows not among them; with
384
+ `workflows`, a list of workflow_ids, the API removes the uploaded workflows not
385
+ among them; with
385
386
  `api_key_hash`, the SHA-256 of the deploy's API key ("" for none), it keeps that as
386
387
  the deploy's key. Return the new generation and the upload's warnings. Raises
387
388
  ApiError on failure."""
@@ -395,15 +396,15 @@ def put_workflow_group(state, config, env_text, workflows=None, api_key_hash=Non
395
396
  return _request(state, "PUT", _group_path(state), "Sync", body)
396
397
 
397
398
 
398
- def put_workflow(state, name, archive):
399
- """Make `archive`, an open gzip tar file of workflow `name`'s folder, that workflow's
399
+ def put_workflow(state, workflow_id, archive):
400
+ """Make `archive`, an open gzip tar file of the workflow's folder, that workflow's
400
401
  files in the Global Controller's workspace and return the new generation and the
401
402
  upload's warnings. Raises ApiError on failure, with the `findings` `canyonos
402
403
  validate` would print when the workflow breaks the contract."""
403
404
  return _request(
404
405
  state,
405
406
  "PUT",
406
- _group_path(state, f"/workflows/{_quoted(name)}"),
407
+ _group_path(state, f"/workflows/{_quoted(workflow_id)}"),
407
408
  "Sync",
408
409
  archive=archive,
409
410
  )
@@ -548,15 +549,15 @@ def controller_log(state, tail="all", follow=False):
548
549
  raise ApiError(f"Could not read the Global Controller log: {e}") from None
549
550
 
550
551
 
551
- def deployed_logs(state, name, tail):
552
- """Return the last `tail` lines of each running replica of agent `name`, or of the
553
- one replica whose ID is `name`, keyed by replica ID; raise ApiError when the API
554
- can't say, naming the agents when `name` is neither."""
552
+ def deployed_logs(state, agent_id, tail):
553
+ """Return the last `tail` lines of each running replica of the agent whose ID is
554
+ `agent_id`, or of the one replica whose ID it is, keyed by replica ID; raise ApiError
555
+ when the API can't say, naming the agents when it is neither."""
555
556
  query = urllib.parse.urlencode({"tail": tail})
556
557
  return _request(
557
558
  state,
558
559
  "GET",
559
- _group_path(state, f"/logs/agents/{_quoted(name)}?{query}"),
560
+ _group_path(state, f"/logs/agents/{_quoted(agent_id)}?{query}"),
560
561
  "Read logs",
561
562
  timeout=LOGS_REQUEST_TIMEOUT_SECONDS,
562
563
  )["logs"]
@@ -6,7 +6,7 @@
6
6
  The containers get only its SHA-256 hash. Without a key nothing is checked.
7
7
 
8
8
  Also this machine's control key, which the CLI makes itself and keeps in
9
- `~/.canyonos/control_key`: the CanyonOS API's `/v1` routes, which run and stop each
9
+ `~/.canyonos/control_key`: the CanyonOS API's `/v1/workflow-groups` routes, which run and stop each
10
10
  workflow group's Global Controller, answer only a call that sends it, whatever the
11
11
  API key. The API gets only its hash."""
12
12
 
@@ -48,7 +48,7 @@ services:
48
48
  # nothing. Read once when the API starts.
49
49
  CANYONOS_API_KEY_HASH: ${CANYONOS_API_KEY_HASH}
50
50
  # The SHA-256 of this machine's control key (`~/.canyonos/control_key`), which
51
- # the `/v1` routes that run each Global Controller require; unset, they refuse
51
+ # the `/v1/workflow-groups` routes that run each Global Controller require; unset, they refuse
52
52
  # every call.
53
53
  CANYONOS_CONTROL_KEY_HASH: ${CANYONOS_CONTROL_KEY_HASH}
54
54
  DOCKER_SOCKET: /var/run/docker.sock
@@ -28,7 +28,7 @@ def _requires_key():
28
28
  return True
29
29
  try:
30
30
  with urllib.request.urlopen(
31
- f"http://127.0.0.1:{port}/auth/status", timeout=5
31
+ f"http://127.0.0.1:{port}/v1/auth/status", timeout=5
32
32
  ) as response:
33
33
  return (
34
34
  json.loads(response.read()).get("api_key_required", True) is not False
@@ -112,12 +112,14 @@ def register_workflows(state: dict) -> list[dict]:
112
112
 
113
113
 
114
114
  def add_sample_data(
115
+ workflow_group_id: str,
115
116
  workflow_id: str,
116
117
  workflow: str,
117
118
  api_port: int | None = None,
118
119
  ) -> dict:
119
120
  """Ask the dashboard, its API on `api_port` or where it is when that is None, to
120
- add its recorded run of `workflow` to the workflow `workflow_id`.
121
+ add its recorded run of `workflow` to the workflow `workflow_id` of workflow group
122
+ `workflow_group_id`.
121
123
 
122
124
  The api replays a run of that bundled workflow it ships, spread across the
123
125
  week ending now, so a first request lands among a week of earlier ones
@@ -129,7 +131,10 @@ def add_sample_data(
129
131
  does not answer.
130
132
  """
131
133
  base_url = f"http://127.0.0.1:{api_port or _api_port()}"
132
- url = f"{base_url}/workflows/{workflow_id}/sample-data"
134
+ url = (
135
+ f"{base_url}/v1/workflow-groups/{workflow_group_id}"
136
+ f"/workflows/{workflow_id}/sample-data"
137
+ )
133
138
  payload = json.dumps({"workflow": workflow}).encode()
134
139
  try:
135
140
  return _post(url, payload, SAMPLE_DATA_TIMEOUT_SECONDS)
@@ -499,7 +499,7 @@ def _prepare(stack: DashboardStack) -> tuple[dict[str, str], str]:
499
499
  for service, port in stack.host_ports.items()
500
500
  },
501
501
  API_KEY_HASH_ENV: stack.api_key_hash,
502
- # The CanyonOS API's `/v1` routes answer only the control key.
502
+ # The CanyonOS API's `/v1/workflow-groups` routes answer only the control key.
503
503
  CONTROL_KEY_HASH_ENV: control_key_hash(),
504
504
  # The API runs each workflow group's Global Controller through the same
505
505
  # engine the CLI created that container on.
@@ -736,10 +736,10 @@ def _health_urls(host_ports: dict[str, int], services: tuple[str, ...]) -> list[
736
736
  """What answers 200 once `services` are up: the API on its own port once its
737
737
  database is ready, and the web app with the API behind its proxy when the web app
738
738
  is among them."""
739
- urls = [f"http://127.0.0.1:{host_ports['api']}/readyz"]
739
+ urls = [f"http://127.0.0.1:{host_ports['api']}/v1/readyz"]
740
740
  if "web" in services:
741
741
  web_url = f"http://127.0.0.1:{host_ports['web']}"
742
- urls += [f"{web_url}/healthz", f"{web_url}/api/healthz"]
742
+ urls += [f"{web_url}/healthz", f"{web_url}/api/v1/healthz"]
743
743
  return urls
744
744
 
745
745
 
@@ -847,7 +847,7 @@ def run_dashboard(
847
847
  """Start `services` of the local stack, with what they depend on, for `canyonos
848
848
  serve` and `canyonos deploy`, reporting each step; on failure, save the logs and
849
849
  remove what this run started. Its API checks the API key whose hash is
850
- `api_key_hash`, or nothing when it is "", and its `/v1` routes this machine's
850
+ `api_key_hash`, or nothing when it is "", and its `/v1/workflow-groups` routes this machine's
851
851
  control key. The `renewed` services start in new containers even when they run,
852
852
  as the api does for `canyonos serve` and for a deploy that changes a key or the
853
853
  API's image. The result's URL is the dashboard's when `services` hold the web app.
@@ -84,8 +84,8 @@ def _api_checks():
84
84
  port = running_api_port()
85
85
  api_ok = _print_check(
86
86
  "CanyonOS API",
87
- port is not None and _endpoint_healthy(f"http://127.0.0.1:{port}/healthz"),
88
- f"127.0.0.1:{port}/healthz",
87
+ port is not None and _endpoint_healthy(f"http://127.0.0.1:{port}/v1/healthz"),
88
+ f"127.0.0.1:{port}/v1/healthz",
89
89
  "the CanyonOS API isn't answering -- `canyonos serve` again",
90
90
  )
91
91
  return db_ok and api_ok
@@ -34,7 +34,16 @@ def run_logs(follow=True, tail="200", agent=None):
34
34
  )
35
35
 
36
36
  if agent:
37
- replica_logs = deployed_logs(state, agent, tail)
37
+ # The API takes an agent by its ID, which the status lists; anything else is a replica's.
38
+ agent_id = next(
39
+ (
40
+ listed["agent_id"]
41
+ for listed in status.get("agents") or []
42
+ if listed["name"] == agent
43
+ ),
44
+ None,
45
+ )
46
+ replica_logs = deployed_logs(state, agent_id or agent, tail)
38
47
  ui.json_result["logs"] = replica_logs
39
48
  if not replica_logs:
40
49
  ui.warn(f"{agent} has no running replicas.")
@@ -596,11 +596,14 @@ def _add_sample_data(workflow):
596
596
  """Ask the dashboard to add `workflow`'s example runs to each workflow of this
597
597
  workflow group, whether or not the first request worked. Never fails the run."""
598
598
  try:
599
- registered = register_workflows(load_state())
599
+ state = load_state()
600
+ registered = register_workflows(state)
600
601
  ui.blank()
601
602
  ui.say("Adding example runs to the dashboard...")
602
603
  spans = sum(
603
- add_sample_data(entry["workflow_id"], workflow)["spans"]
604
+ add_sample_data(state["workflow_group_id"], entry["workflow_id"], workflow)[
605
+ "spans"
606
+ ]
604
607
  for entry in registered
605
608
  )
606
609
  except (KeyError, OSError, RuntimeError, ValueError, RegistrationError) as e:
@@ -55,6 +55,8 @@ class Endpoint(TypedDict, closed=True):
55
55
 
56
56
 
57
57
  class AgentStatus(TypedDict, closed=True):
58
+ agent_id: str | None
59
+ name: str
58
60
  desired_replicas: int
59
61
  running_replicas: int
60
62
  launch_error: str | None
@@ -101,7 +103,7 @@ class WorkflowGroupStatus(TypedDict, closed=True):
101
103
  )
102
104
  root_cause: str | None
103
105
  endpoint: Endpoint | None
104
- agents: dict[str, AgentStatus] | None
106
+ agents: list[AgentStatus] | None
105
107
  machine_errors: dict[str, str] | None
106
108
  generation: int
107
109
  applied_generation: int
@@ -132,6 +134,7 @@ class Fingerprints(TypedDict, closed=True):
132
134
 
133
135
 
134
136
  class Workflow(TypedDict, closed=True):
137
+ workflow_id: str
135
138
  name: str
136
139
  fingerprints: Fingerprints
137
140
  test_query: str | None
@@ -83,9 +83,11 @@ def _read_status():
83
83
  ui.warn(
84
84
  "Could not read the running workflow group's endpoint. Run `canyonos logs` to see why."
85
85
  )
86
- for name, agent in (report["agents"] or {}).items():
86
+ for agent in report["agents"] or []:
87
87
  if agent["launch_error"]:
88
- ui.warn(f"{name} could not start a replica: {agent['launch_error']}")
88
+ ui.warn(
89
+ f"{agent['name']} could not start a replica: {agent['launch_error']}"
90
+ )
89
91
 
90
92
  dashboard_port = running_web_port()
91
93
  report["dashboard_url"] = dashboard_url(dashboard_port) if dashboard_port else None
@@ -114,6 +114,10 @@ def run_sync(workflows, keep_other_workflows=False, api_key_hash=None):
114
114
  status then, or False when a file could not be read."""
115
115
  state = require_state()
116
116
  label = f"Syncing {', '.join(workflows)}"
117
+ ids = {
118
+ name: workflow_id
119
+ for workflow_id, name in deployment.workflow_names_by_id().items()
120
+ }
117
121
  warnings = []
118
122
  try:
119
123
  with ui.status(f"{label}..."), contextlib.ExitStack() as archives:
@@ -136,14 +140,14 @@ def run_sync(workflows, keep_other_workflows=False, api_key_hash=None):
136
140
  state,
137
141
  config,
138
142
  env_text,
139
- None if keep_other_workflows else list(workflows),
143
+ None if keep_other_workflows else [ids[name] for name in workflows],
140
144
  api_key_hash,
141
145
  )
142
146
  warnings += answer["warnings"]
143
147
  if deployment.configured_target() != "kubernetes":
144
148
  warnings += collector_image_warnings(config)
145
149
  for name, tar in tars.items():
146
- answer = put_workflow(state, name, tar)
150
+ answer = put_workflow(state, ids[name], tar)
147
151
  warnings += answer["warnings"]
148
152
  for warning in warnings:
149
153
  ui.warn(warning)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: canyonos
3
- Version: 0.2.3.dev3
3
+ Version: 0.2.3.dev4
4
4
  Summary: Open-source platform for multi-agent apps: per-agent scaling, tracing and cost, in plain Python
5
5
  License-Expression: AGPL-3.0-only
6
6
  Project-URL: Homepage, https://canyonos.ai
@@ -3,7 +3,7 @@
3
3
 
4
4
  [project]
5
5
  name = "canyonos"
6
- version = "0.2.3.dev3"
6
+ version = "0.2.3.dev4"
7
7
  description = "Open-source platform for multi-agent apps: per-agent scaling, tracing and cost, in plain Python"
8
8
  readme = "README.md"
9
9
  license = "AGPL-3.0-only"
File without changes
File without changes
File without changes