graph-agents-cli 0.3.1__py3-none-any.whl

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 (291) hide show
  1. graph_agents_cli/__init__.py +26 -0
  2. graph_agents_cli/_api_policy.py +2145 -0
  3. graph_agents_cli/_approvals.py +400 -0
  4. graph_agents_cli/_build.py +186 -0
  5. graph_agents_cli/_build_info.json +7 -0
  6. graph_agents_cli/_chat_client.py +462 -0
  7. graph_agents_cli/_click.py +157 -0
  8. graph_agents_cli/_defaults.py +139 -0
  9. graph_agents_cli/_experiments.py +64 -0
  10. graph_agents_cli/_http.py +192 -0
  11. graph_agents_cli/_output.py +83 -0
  12. graph_agents_cli/_project.py +462 -0
  13. graph_agents_cli/_remote.py +220 -0
  14. graph_agents_cli/_response_schema.py +264 -0
  15. graph_agents_cli/_runner.py +319 -0
  16. graph_agents_cli/_skills_check.py +274 -0
  17. graph_agents_cli/_tools.py +189 -0
  18. graph_agents_cli/_trust.py +66 -0
  19. graph_agents_cli/api/__init__.py +15 -0
  20. graph_agents_cli/api/_changes.py +506 -0
  21. graph_agents_cli/api/_files.py +658 -0
  22. graph_agents_cli/api/cmd_api.py +2480 -0
  23. graph_agents_cli/deploy/__init__.py +15 -0
  24. graph_agents_cli/deploy/_config.py +171 -0
  25. graph_agents_cli/deploy/_image.py +128 -0
  26. graph_agents_cli/deploy/_kube.py +286 -0
  27. graph_agents_cli/deploy/_modes.py +234 -0
  28. graph_agents_cli/deploy/_preflight.py +370 -0
  29. graph_agents_cli/deploy/_values.py +168 -0
  30. graph_agents_cli/deploy/cmd_deploy.py +1866 -0
  31. graph_agents_cli/deploy/gitops.py +562 -0
  32. graph_agents_cli/deploy/local_load.py +273 -0
  33. graph_agents_cli/dev/__init__.py +13 -0
  34. graph_agents_cli/dev/cmd_build.py +131 -0
  35. graph_agents_cli/dev/cmd_install.py +78 -0
  36. graph_agents_cli/dev/cmd_lint.py +119 -0
  37. graph_agents_cli/dev/cmd_playground.py +297 -0
  38. graph_agents_cli/dev/policy_check.py +1287 -0
  39. graph_agents_cli/eval/__init__.py +22 -0
  40. graph_agents_cli/eval/_client.py +670 -0
  41. graph_agents_cli/eval/_common.py +177 -0
  42. graph_agents_cli/eval/_judge.py +168 -0
  43. graph_agents_cli/eval/_judge_runner.py +238 -0
  44. graph_agents_cli/eval/_paths.py +212 -0
  45. graph_agents_cli/eval/checks.py +581 -0
  46. graph_agents_cli/eval/cmd_analyze.py +278 -0
  47. graph_agents_cli/eval/cmd_compare.py +284 -0
  48. graph_agents_cli/eval/cmd_eval_group.py +80 -0
  49. graph_agents_cli/eval/cmd_generate.py +558 -0
  50. graph_agents_cli/eval/cmd_grade.py +466 -0
  51. graph_agents_cli/eval/cmd_metric.py +156 -0
  52. graph_agents_cli/eval/cmd_run.py +370 -0
  53. graph_agents_cli/eval/cmd_submit.py +400 -0
  54. graph_agents_cli/eval/config.py +435 -0
  55. graph_agents_cli/eval/dataset.py +350 -0
  56. graph_agents_cli/eval/gate.py +420 -0
  57. graph_agents_cli/eval/transcript.py +192 -0
  58. graph_agents_cli/extension/__init__.py +13 -0
  59. graph_agents_cli/extension/_compat.py +86 -0
  60. graph_agents_cli/extension/_loader.py +293 -0
  61. graph_agents_cli/extension/_manifest.py +135 -0
  62. graph_agents_cli/extension/_overrides.py +195 -0
  63. graph_agents_cli/extension/_paths.py +91 -0
  64. graph_agents_cli/extension/_refs.py +193 -0
  65. graph_agents_cli/extension/_resolver.py +453 -0
  66. graph_agents_cli/extension/_schema.py +106 -0
  67. graph_agents_cli/extension/_spec.py +253 -0
  68. graph_agents_cli/extension/_sync.py +102 -0
  69. graph_agents_cli/extension/_trust.py +58 -0
  70. graph_agents_cli/extension/cmd_extension_add.py +259 -0
  71. graph_agents_cli/extension/cmd_extension_group.py +57 -0
  72. graph_agents_cli/extension/cmd_extension_list.py +56 -0
  73. graph_agents_cli/extension/cmd_extension_remove.py +61 -0
  74. graph_agents_cli/extension/cmd_extension_update.py +195 -0
  75. graph_agents_cli/info/__init__.py +13 -0
  76. graph_agents_cli/info/cmd_info.py +222 -0
  77. graph_agents_cli/infra/__init__.py +15 -0
  78. graph_agents_cli/infra/checks.py +1169 -0
  79. graph_agents_cli/infra/cmd_infra.py +103 -0
  80. graph_agents_cli/main.py +591 -0
  81. graph_agents_cli/peer/__init__.py +15 -0
  82. graph_agents_cli/peer/_generate.py +254 -0
  83. graph_agents_cli/peer/cmd_peer.py +1151 -0
  84. graph_agents_cli/run/__init__.py +13 -0
  85. graph_agents_cli/run/_local_server.py +1157 -0
  86. graph_agents_cli/run/_signals.py +141 -0
  87. graph_agents_cli/run/cmd_approvals.py +530 -0
  88. graph_agents_cli/run/cmd_run.py +1421 -0
  89. graph_agents_cli/scaffold/__init__.py +19 -0
  90. graph_agents_cli/scaffold/agents/README.md +24 -0
  91. graph_agents_cli/scaffold/agents/empty_py/.template/templateconfig.yaml +22 -0
  92. graph_agents_cli/scaffold/agents/langgraph/.env.example +292 -0
  93. graph_agents_cli/scaffold/agents/langgraph/.template/templateconfig.yaml +28 -0
  94. graph_agents_cli/scaffold/agents/langgraph/Dockerfile +59 -0
  95. graph_agents_cli/scaffold/agents/langgraph/Dockerfile.langgraph-server +59 -0
  96. graph_agents_cli/scaffold/agents/langgraph/README.md +571 -0
  97. graph_agents_cli/scaffold/agents/langgraph/api-policy.yaml +60 -0
  98. graph_agents_cli/scaffold/agents/langgraph/app/__init__.py +20 -0
  99. graph_agents_cli/scaffold/agents/langgraph/app/agent.py +174 -0
  100. graph_agents_cli/scaffold/agents/langgraph/app/app_utils/__init__.py +15 -0
  101. graph_agents_cli/scaffold/agents/langgraph/app/app_utils/a2a.py +2162 -0
  102. graph_agents_cli/scaffold/agents/langgraph/app/app_utils/a2a_client.py +1167 -0
  103. graph_agents_cli/scaffold/agents/langgraph/app/app_utils/api_client.py +4220 -0
  104. graph_agents_cli/scaffold/agents/langgraph/app/app_utils/approvals.py +1349 -0
  105. graph_agents_cli/scaffold/agents/langgraph/app/app_utils/auth.py +1986 -0
  106. graph_agents_cli/scaffold/agents/langgraph/app/app_utils/chat.py +2962 -0
  107. graph_agents_cli/scaffold/agents/langgraph/app/app_utils/checkpointer.py +432 -0
  108. graph_agents_cli/scaffold/agents/langgraph/app/app_utils/content.py +569 -0
  109. graph_agents_cli/scaffold/agents/langgraph/app/app_utils/db.py +580 -0
  110. graph_agents_cli/scaffold/agents/langgraph/app/app_utils/limits.py +203 -0
  111. graph_agents_cli/scaffold/agents/langgraph/app/app_utils/metrics.py +231 -0
  112. graph_agents_cli/scaffold/agents/langgraph/app/app_utils/middleware.py +361 -0
  113. graph_agents_cli/scaffold/agents/langgraph/app/app_utils/model.py +611 -0
  114. graph_agents_cli/scaffold/agents/langgraph/app/app_utils/playground.py +230 -0
  115. graph_agents_cli/scaffold/agents/langgraph/app/app_utils/run_locks.py +459 -0
  116. graph_agents_cli/scaffold/agents/langgraph/app/app_utils/structured.py +755 -0
  117. graph_agents_cli/scaffold/agents/langgraph/app/app_utils/telemetry.py +681 -0
  118. graph_agents_cli/scaffold/agents/langgraph/app/app_utils/threads.py +493 -0
  119. graph_agents_cli/scaffold/agents/langgraph/app/app_utils/token_exchange.py +959 -0
  120. graph_agents_cli/scaffold/agents/langgraph/app/fast_api_app.py +770 -0
  121. graph_agents_cli/scaffold/agents/langgraph/app/policies/__init__.py +55 -0
  122. graph_agents_cli/scaffold/agents/langgraph/app/policies/custom.py +97 -0
  123. graph_agents_cli/scaffold/agents/langgraph/app/tools/__init__.py +46 -0
  124. graph_agents_cli/scaffold/agents/langgraph/app/tools/example_api.py +92 -0
  125. graph_agents_cli/scaffold/agents/langgraph/app/tools/weather.py +33 -0
  126. graph_agents_cli/scaffold/agents/langgraph/langgraph.json +14 -0
  127. graph_agents_cli/scaffold/agents/langgraph/pyproject.toml +78 -0
  128. graph_agents_cli/scaffold/agents/langgraph/tests/conftest.py +376 -0
  129. graph_agents_cli/scaffold/agents/langgraph/tests/eval/datasets/basic-dataset.json +53 -0
  130. graph_agents_cli/scaffold/agents/langgraph/tests/eval/eval_config.yaml +32 -0
  131. graph_agents_cli/scaffold/agents/langgraph/tests/integration/approval_graph.py +137 -0
  132. graph_agents_cli/scaffold/agents/langgraph/tests/integration/fake_issuer.py +216 -0
  133. graph_agents_cli/scaffold/agents/langgraph/tests/integration/fake_openai.py +357 -0
  134. graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_a2a_outcomes.py +569 -0
  135. graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_a2a_relay.py +479 -0
  136. graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_api_surface.py +812 -0
  137. graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_approvals.py +1367 -0
  138. graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_approvals_server.py +794 -0
  139. graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_cross_actor.py +497 -0
  140. graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_cross_actor_server.py +247 -0
  141. graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_history_repair.py +278 -0
  142. graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_model_apis.py +242 -0
  143. graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_postgres.py +637 -0
  144. graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_resilience_postgres.py +770 -0
  145. graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_runtime_guardrails.py +854 -0
  146. graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_server_e2e.py +340 -0
  147. graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_server_runtime.py +989 -0
  148. graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_structured_answers.py +584 -0
  149. graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_structured_server.py +222 -0
  150. graph_agents_cli/scaffold/agents/langgraph/tests/integration/test_token_exchange_issuer.py +650 -0
  151. graph_agents_cli/scaffold/agents/langgraph/tests/load_test/.results/.placeholder +0 -0
  152. graph_agents_cli/scaffold/agents/langgraph/tests/load_test/README.md +22 -0
  153. graph_agents_cli/scaffold/agents/langgraph/tests/load_test/conftest.py +21 -0
  154. graph_agents_cli/scaffold/agents/langgraph/tests/load_test/load_test.py +81 -0
  155. graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_a2a_client.py +824 -0
  156. graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_a2a_scoping.py +724 -0
  157. graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_api_client.py +1214 -0
  158. graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_api_client_hardening.py +716 -0
  159. graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_api_policy_rpc.py +767 -0
  160. graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_approval_ledger.py +1536 -0
  161. graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_fake_model.py +115 -0
  162. graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_jwt_policy.py +991 -0
  163. graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_limits.py +310 -0
  164. graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_logging.py +148 -0
  165. graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_logging_hardening.py +271 -0
  166. graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_policy.py +378 -0
  167. graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_resilience.py +610 -0
  168. graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_server_auth.py +702 -0
  169. graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_structured.py +673 -0
  170. graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_telemetry.py +404 -0
  171. graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_thread_listing.py +255 -0
  172. graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_threads.py +268 -0
  173. graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_token_exchange.py +1320 -0
  174. graph_agents_cli/scaffold/agents/langgraph/tests/unit/test_untrusted_content.py +393 -0
  175. graph_agents_cli/scaffold/agents/langgraph/uv-fastapi.lock +2084 -0
  176. graph_agents_cli/scaffold/agents/langgraph/uv-langgraph-server.lock +2106 -0
  177. graph_agents_cli/scaffold/agents/langgraph/{{cookiecutter.agent_guidance_filename}} +129 -0
  178. graph_agents_cli/scaffold/base_templates/_shared/graph-agents-cli-manifest.yaml +36 -0
  179. graph_agents_cli/scaffold/base_templates/python/.dockerignore +32 -0
  180. graph_agents_cli/scaffold/base_templates/python/.github/CODEOWNERS +30 -0
  181. graph_agents_cli/scaffold/base_templates/python/.github/agent.env +7 -0
  182. graph_agents_cli/scaffold/base_templates/python/.github/workflows/pr_checks.yaml +214 -0
  183. graph_agents_cli/scaffold/base_templates/python/.gitignore +209 -0
  184. graph_agents_cli/scaffold/base_templates/python/tests/unit/test_dummy.py +23 -0
  185. graph_agents_cli/scaffold/base_templates/python/{{cookiecutter.agent_guidance_filename}} +35 -0
  186. graph_agents_cli/scaffold/cmd_scaffold_group.py +49 -0
  187. graph_agents_cli/scaffold/commands/__init__.py +13 -0
  188. graph_agents_cli/scaffold/commands/create.py +1424 -0
  189. graph_agents_cli/scaffold/commands/enhance.py +1652 -0
  190. graph_agents_cli/scaffold/commands/upgrade.py +570 -0
  191. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/.github/agent.env +12 -0
  192. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/.github/workflows/promote-to-prod.yaml +371 -0
  193. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/.github/workflows/staging.yaml +450 -0
  194. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/argocd/application-dev.yaml +43 -0
  195. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/argocd/application-prod.yaml +41 -0
  196. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/argocd/application-staging.yaml +43 -0
  197. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/.helmignore +14 -0
  198. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/Chart.yaml +21 -0
  199. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/examples/networkpolicy.yaml +103 -0
  200. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/NOTES.txt +48 -0
  201. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/_helpers.tpl +189 -0
  202. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/certificate.yaml +15 -0
  203. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/configmap.yaml +10 -0
  204. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/deployment.yaml +199 -0
  205. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/hpa.yaml +22 -0
  206. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/httproute.yaml +30 -0
  207. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/ingress.yaml +39 -0
  208. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/networkpolicy.yaml +48 -0
  209. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/pdb.yaml +13 -0
  210. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/postgresql-secret.yaml +37 -0
  211. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/service.yaml +15 -0
  212. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/serviceaccount.yaml +13 -0
  213. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/templates/servicemonitor.yaml +42 -0
  214. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/values-dev.yaml +22 -0
  215. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/values-prod.yaml +45 -0
  216. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/values-staging.yaml +29 -0
  217. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/deployment/helm/{{cookiecutter.project_name}}/values.yaml +396 -0
  218. graph_agents_cli/scaffold/deployment_targets/kubernetes/python/tests/integration/test_chart.py +269 -0
  219. graph_agents_cli/scaffold/deployment_targets/none/README.md +5 -0
  220. graph_agents_cli/scaffold/deployment_targets/none/python/README.md +6 -0
  221. graph_agents_cli/scaffold/utils/__init__.py +13 -0
  222. graph_agents_cli/scaffold/utils/backup.py +212 -0
  223. graph_agents_cli/scaffold/utils/build_record.py +257 -0
  224. graph_agents_cli/scaffold/utils/cli_options.py +184 -0
  225. graph_agents_cli/scaffold/utils/fs.py +83 -0
  226. graph_agents_cli/scaffold/utils/generate_locks.py +214 -0
  227. graph_agents_cli/scaffold/utils/generation_metadata.py +88 -0
  228. graph_agents_cli/scaffold/utils/keyedit.py +768 -0
  229. graph_agents_cli/scaffold/utils/keymerge.py +537 -0
  230. graph_agents_cli/scaffold/utils/language.py +138 -0
  231. graph_agents_cli/scaffold/utils/lock_utils.py +94 -0
  232. graph_agents_cli/scaffold/utils/logging.py +77 -0
  233. graph_agents_cli/scaffold/utils/manifest.py +292 -0
  234. graph_agents_cli/scaffold/utils/merge.py +970 -0
  235. graph_agents_cli/scaffold/utils/merge3.py +216 -0
  236. graph_agents_cli/scaffold/utils/openapi_seed.py +199 -0
  237. graph_agents_cli/scaffold/utils/remote_template.py +376 -0
  238. graph_agents_cli/scaffold/utils/template.py +1352 -0
  239. graph_agents_cli/scaffold/utils/upgrade.py +894 -0
  240. graph_agents_cli/scaffold/utils/version.py +438 -0
  241. graph_agents_cli/secrets/__init__.py +15 -0
  242. graph_agents_cli/secrets/_apply.py +954 -0
  243. graph_agents_cli/secrets/_required.py +188 -0
  244. graph_agents_cli/secrets/cmd_secrets.py +211 -0
  245. graph_agents_cli/setup/__init__.py +13 -0
  246. graph_agents_cli/setup/_antigravity.py +221 -0
  247. graph_agents_cli/setup/cmd_auth.py +1030 -0
  248. graph_agents_cli/setup/cmd_dev_token.py +513 -0
  249. graph_agents_cli/setup/cmd_setup.py +428 -0
  250. graph_agents_cli/setup/cmd_update.py +140 -0
  251. graph_agents_cli/skills/__init__.py +13 -0
  252. graph_agents_cli/skills/_bundle.py +65 -0
  253. graph_agents_cli/skills/data/README.md +19 -0
  254. graph_agents_cli/skills/data/graph-agents-cli-deploy/SKILL.md +357 -0
  255. graph_agents_cli/skills/data/graph-agents-cli-deploy/references/github-settings.md +113 -0
  256. graph_agents_cli/skills/data/graph-agents-cli-deploy/references/gitops.md +137 -0
  257. graph_agents_cli/skills/data/graph-agents-cli-deploy/references/kubernetes.md +315 -0
  258. graph_agents_cli/skills/data/graph-agents-cli-deploy/references/secrets.md +160 -0
  259. graph_agents_cli/skills/data/graph-agents-cli-eval/SKILL.md +303 -0
  260. graph_agents_cli/skills/data/graph-agents-cli-eval/references/dataset_schema.md +282 -0
  261. graph_agents_cli/skills/data/graph-agents-cli-eval/references/metrics-guide.md +143 -0
  262. graph_agents_cli/skills/data/graph-agents-cli-langgraph-code/SKILL.md +659 -0
  263. graph_agents_cli/skills/data/graph-agents-cli-langgraph-code/references/langchain-models.md +124 -0
  264. graph_agents_cli/skills/data/graph-agents-cli-langgraph-code/references/langgraph.md +235 -0
  265. graph_agents_cli/skills/data/graph-agents-cli-langgraph-code/references/template-contract.md +477 -0
  266. graph_agents_cli/skills/data/graph-agents-cli-observability/SKILL.md +231 -0
  267. graph_agents_cli/skills/data/graph-agents-cli-observability/references/langsmith.md +46 -0
  268. graph_agents_cli/skills/data/graph-agents-cli-observability/references/otel.md +59 -0
  269. graph_agents_cli/skills/data/graph-agents-cli-scaffold/SKILL.md +414 -0
  270. graph_agents_cli/skills/data/graph-agents-cli-scaffold/references/flags.md +134 -0
  271. graph_agents_cli/skills/data/graph-agents-cli-workflow/SKILL.md +478 -0
  272. graph_agents_cli/skills/data/graph-agents-cli-workflow/references/brainstorming.md +118 -0
  273. graph_agents_cli/skills/data/graph-agents-cli-workflow/references/commands.md +419 -0
  274. graph_agents_cli/skills/data/graph-agents-cli-workflow/references/extension.md +156 -0
  275. graph_agents_cli/skills/data/graph-agents-cli-workflow/references/internals.md +67 -0
  276. graph_agents_cli/skills/data/graph-agents-cli-workflow/references/spec-template.md +56 -0
  277. graph_agents_cli/skills/data/graph-agents-cli-workflow/references/terminology.md +119 -0
  278. graph_agents_cli/system/__init__.py +15 -0
  279. graph_agents_cli/system/_apply.py +519 -0
  280. graph_agents_cli/system/_checks.py +1023 -0
  281. graph_agents_cli/system/_deploy.py +215 -0
  282. graph_agents_cli/system/_model.py +363 -0
  283. graph_agents_cli/system/_system.py +664 -0
  284. graph_agents_cli/system/_views.py +208 -0
  285. graph_agents_cli/system/cmd_system.py +423 -0
  286. graph_agents_cli-0.3.1.dist-info/METADATA +162 -0
  287. graph_agents_cli-0.3.1.dist-info/RECORD +291 -0
  288. graph_agents_cli-0.3.1.dist-info/WHEEL +4 -0
  289. graph_agents_cli-0.3.1.dist-info/entry_points.txt +2 -0
  290. graph_agents_cli-0.3.1.dist-info/licenses/LICENSE +201 -0
  291. graph_agents_cli-0.3.1.dist-info/licenses/NOTICE +19 -0
@@ -0,0 +1,231 @@
1
+ ---
2
+ name: graph-agents-cli-observability
3
+ description: >
4
+ This skill should be used when the user wants to "set up tracing",
5
+ "enable LangSmith", "send traces to our collector", "monitor my agent",
6
+ "debug production traffic", "see what the agent sent to the model", "log
7
+ prompts", or needs guidance on observability for a graph-agents-cli
8
+ project. Covers the TRACING_ENABLED opt-in, the TRACE_CAPTURE metadata
9
+ versus full policy, LangSmith versus OTLP, the hashed principal id, run
10
+ records, and what is never captured by default. Part of the
11
+ graph-agents-cli skills suite. Do NOT use for deployment
12
+ (graph-agents-cli-deploy) or agent code (graph-agents-cli-langgraph-code).
13
+ metadata:
14
+ author: graph-agents-cli contributors
15
+ license: Apache-2.0
16
+ version: "0.3.1"
17
+ requires:
18
+ bins:
19
+ - graph-agents-cli
20
+ install: "uv tool install git+https://github.com/ss7172/graph-agents-cli@v0.3.1"
21
+ ---
22
+
23
+ # Observability guide
24
+
25
+ > **Tracing is off unless `TRACING_ENABLED=true`.** No exporter is configured and no LangSmith
26
+ > client is created otherwise. Setting `LANGSMITH_API_KEY` alone does not enable tracing.
27
+ > Enabling tracing to a hosted destination is an egress decision the user makes explicitly.
28
+
29
+ ## Reference files
30
+
31
+ | File | Contents |
32
+ |---|---|
33
+ | `references/langsmith.md` | LangSmith destination: variables, self-hosted endpoint, projects, what the capture policy does to LangSmith runs, `eval submit` |
34
+ | `references/otel.md` | OTLP destination: LangChain OpenTelemetry instrumentation, collector configuration, span attributes, in-cluster collectors |
35
+
36
+ ---
37
+
38
+ ## Variables
39
+
40
+ | Variable | Default | Meaning |
41
+ |---|---|---|
42
+ | `TRACING_ENABLED` | `false` | the opt-in; nothing is exported while false |
43
+ | `TRACE_CAPTURE` | `metadata` | `metadata` or `full`; applied identically to LangSmith, OTLP, and run records |
44
+ | `LANGSMITH_API_KEY` | (Secret) | when set with tracing enabled, traces go to LangSmith |
45
+ | `LANGSMITH_PROJECT` | project name | LangSmith project |
46
+ | `LANGSMITH_ENDPOINT` | LangSmith cloud | override for a self-hosted LangSmith |
47
+ | `OTEL_EXPORTER_OTLP_ENDPOINT` | (chart) | OTLP fallback used when tracing is enabled and no LangSmith key is set |
48
+
49
+ Chart values: `tracing: { enabled, capture, otlpEndpoint, langsmith: { project } }` render these
50
+ into `env:`; the key comes from the Secret. Locally, `.env` sets `TRACING_ENABLED=false` and
51
+ `TRACE_CAPTURE=metadata`.
52
+
53
+ ## Destination selection
54
+
55
+ ```
56
+ TRACING_ENABLED=false -> nothing
57
+ TRACING_ENABLED=true + LANGSMITH_API_KEY -> LangSmith (LANGSMITH_PROJECT, LANGSMITH_ENDPOINT)
58
+ TRACING_ENABLED=true, no LangSmith key -> OTLP to OTEL_EXPORTER_OTLP_ENDPOINT via LangChain OpenTelemetry instrumentation
59
+ ```
60
+
61
+ The disconnected profile allows only the OTLP path to an in-cluster collector, or tracing off.
62
+
63
+ ## Capture policy
64
+
65
+ | `TRACE_CAPTURE` | Captured | Never captured |
66
+ |---|---|---|
67
+ | `metadata` (default) | span structure and timing; model and provider names; token counts; tool **names**; error **types** and HTTP status codes; identifiers (`thread_id`, `run_id`, hashed principal id, agent version) | prompt text, completion text, tool arguments, tool results, error messages, the client's `/chat` metadata |
68
+ | `full` | everything in `metadata` plus prompts, completions, tool arguments, tool results, full error messages, and the client's `/chat` metadata (as `client_metadata`) | |
69
+
70
+ Clients can never overwrite trace ids through `/chat` metadata, and that metadata is never
71
+ written into checkpoints (it is kept in the run record).
72
+
73
+ Enabling `full` against a hosted destination sends user content off-network. The consuming
74
+ project must decide that explicitly (and publish a truthful privacy notice) before you set it. Do
75
+ not switch to `full` on your own to debug; ask, and prefer reproducing locally with
76
+ `graph-agents-cli run -v`, which prints the events to your terminal without exporting anything.
77
+
78
+ The same policy governs the chat API: `tool.call` events omit `args` for a caller who is not the
79
+ thread's owner under `metadata`.
80
+
81
+ ## Hashed principal id
82
+
83
+ Traces, logs, run records, and eval traces record `Principal.hashed_id()` (the first 16 hex
84
+ characters of sha256 of the policy's `Principal.id`, or of HMAC-SHA256 keyed with
85
+ `PRINCIPAL_HASH_SALT` when that secret is set), never the raw id. Audit and thread ownership use
86
+ the same identity, so a support engineer can correlate a trace with a conversation without the
87
+ trace revealing who the user is. Set `PRINCIPAL_HASH_SALT` (and add it to `secrets.keys`) when ids
88
+ are guessable, such as email addresses: without a salt anyone holding a trace can confirm a guess
89
+ by hashing it. Changing the salt changes every hash, so older logs and run records no longer match
90
+ new ones. To set the salt or rotate a leaked one, follow "Procedure: salt the hashed principal id"
91
+ below (no code or values change). Under `shared-bearer` every caller is `shared`. Under
92
+ `langgraph-server`, runs started through the server's native API carry the raw id in checkpoint
93
+ metadata (the server injects it); `/chat` runs carry only the hash.
94
+
95
+ ## Run records
96
+
97
+ Besides traces, the app writes one run record per `/chat` call: run id, thread id, hashed
98
+ principal, model, token counts, latency, status, error type, the client's `/chat` metadata;
99
+ payload (prompt, completion, tool I/O) only under `TRACE_CAPTURE=full`. The record is written
100
+ when the run starts (`running`) and updated when it ends: `ok`, `step_limit` (the run reached
101
+ `RECURSION_LIMIT` and ended with a reply saying so), `error`, `timeout`, `cancelled` (the client
102
+ left) or `interrupted` (the run lost its lease on the thread, or its process died: a crash, an
103
+ OOM kill, a lost node, a rollout that ran out of grace). Records a dead process left `running`
104
+ are marked `interrupted` (`error_type` `ProcessLost`) by any replica within about a minute of
105
+ the run's 30 s lease expiring, so crashes can be counted and audited.
106
+
107
+ - `CHECKPOINTER=postgres`: durable rows in the agent-owned database (`runs` table, created
108
+ under an advisory lock).
109
+ - `CHECKPOINTER=memory`: in-process, served to the `/playground` page while the process lives,
110
+ lost on restart. Local development needs no database.
111
+ - Under `langgraph-server`, the app keeps its records in an `agent_runs` table in the server's
112
+ Postgres (`DATABASE_URI`), beside the server's own Runs API.
113
+ - Retention: `RETENTION_DAYS=N` deletes threads idle for more than N days with their checkpoints
114
+ and run records, in an hourly best-effort pass on every replica (0, the default, keeps
115
+ everything). `DELETE /threads/{thread_id}` deletes one thread and its records on request.
116
+ - Evaluation never depends on run records; `eval generate` writes trace files.
117
+
118
+ ## Logs, metrics and health
119
+
120
+ - **Logs** are JSON lines by default outside `APP_ENV=dev` (`LOG_FORMAT=json|text`, `LOG_LEVEL`),
121
+ each with the request id (`X-Request-ID`, echoed to the client), run id, thread id and hashed
122
+ principal. Client-facing errors carry an `error_id`; the exception is logged under that id. The
123
+ app does not log credentials, messages or tool arguments. Under `PROPAGATE_TRACE_HEADERS=peers`
124
+ (the default) the policy client passes the request id on (and, under OTLP, the W3C
125
+ `traceparent`) only to other agents (`protocol: a2a`) and to `auth: forward` and `auth:
126
+ exchange` APIs, and an incoming `traceparent` is continued only on `/a2a/*`, so agents that
127
+ call each other share one request id and trace while a `/chat` caller cannot set trace ids.
128
+ `all`: every API and every path; `off`: neither. `true` reads as `peers`, `false` as `off`.
129
+ - **Metrics:** `GET /metrics` serves Prometheus text (`METRICS_ENABLED`, default true):
130
+ `http_requests_total` and `http_request_duration_seconds` (by method, route, status),
131
+ `agent_runs_total` (by status; `interrupted` also counts the dead processes' runs a replica
132
+ closed, once across replicas), `agent_active_runs`, `agent_run_duration_seconds`,
133
+ `agent_tokens_total`, `agent_database_up` (0 while the database is known to be unreachable).
134
+ It is unauthenticated unless `METRICS_TOKEN` is set (then the scraper
135
+ sends `Authorization: Bearer <token>`), and the chart never publishes it on the Gateway or
136
+ Ingress. Scrape it with `metrics.serviceMonitor.enabled` (Prometheus Operator; add
137
+ `metrics.serviceMonitor.bearerToken.enabled` when `METRICS_TOKEN` is set, so it sends the
138
+ token from the app Secret) or `metrics.scrapeAnnotations` (annotations carry no token: put
139
+ it in that Prometheus's scrape job). Under `langgraph dev` the server's own `/metrics` answers instead;
140
+ the server image disables it so the app's is served.
141
+ - **Health:** `GET /health` is liveness (the process answers); `GET /ready` is readiness (the
142
+ database is set up and answers within 2 s, else 503). A pod started during a database outage
143
+ stays up and unready, and is ready again seconds after the database is. During an outage
144
+ requests get 503 within a few seconds and each logs one WARNING line (`Database unavailable
145
+ (error_id=...)`), without a traceback. Useful alerts: `/ready` failing,
146
+ `agent_database_up == 0`, a rising `agent_runs_total{status!="ok"}` (notably `interrupted`
147
+ and `step_limit`), `agent_active_runs` near capacity.
148
+
149
+ ## What is never captured by default
150
+
151
+ - Prompt and completion text, tool arguments and results, error messages (only under `full`).
152
+ - Raw principal ids (except the langgraph-server native-API case above), session cookies,
153
+ session tokens, bearer keys and `attributes["credentials"]` (never, under any setting).
154
+ - External API payloads beyond what a tool returns into the trace (governed by `full`).
155
+ - Anything at all while `TRACING_ENABLED=false`.
156
+
157
+ ## Procedure: enable tracing for an environment
158
+
159
+ 1. Confirm the destination and capture level with the user (egress decision).
160
+ 2. LangSmith: put `LANGSMITH_API_KEY` in `.env.<env>`, run `graph-agents-cli secrets apply --env
161
+ <env>`; set `tracing.enabled=true`, `tracing.capture`, `tracing.langsmith.project` in
162
+ `values-<env>.yaml`.
163
+ OTLP: set `tracing.enabled=true` and `tracing.otlpEndpoint=http://<collector>:4318` in
164
+ `values-<env>.yaml`; no key.
165
+ 3. Deploy per the project's mode (`/graph-agents-cli-deploy`); in argocd mode the values change
166
+ is a PR. After a Secret change alone, `deploy --restart --env <env>`.
167
+ 4. Send one request with `graph-agents-cli run --url ... "hello"` and find the trace by
168
+ `thread_id` / `run_id` from the `message.end` event.
169
+
170
+ For a change to one environment, edit only that environment's `values-<env>.yaml` or
171
+ `.env.<env>`; `values.yaml` and the other environments stay as they are. When told not to deploy,
172
+ or when the user runs cluster commands, end your answer with the exact commands still to run, and
173
+ do not run them yourself:
174
+ - `graph-agents-cli secrets apply --env <env>`, whenever a value goes into `.env.<env>` (even one
175
+ the user fills in).
176
+ - Then the deploy (`deploy --restart --env <env>` after a Secret-only change).
177
+
178
+ Locally: edit only the project's `.env` (no chart values, no code). Set `TRACING_ENABLED=true` plus
179
+ either `LANGSMITH_API_KEY` or `OTEL_EXPORTER_OTLP_ENDPOINT=<collector URL>`; for OTLP leave the
180
+ LangSmith key unset so the OTLP path is selected. Keep `TRACE_CAPTURE=metadata` unless the user
181
+ explicitly asked for `full`. Do not add the LangSmith SDK's own switches (`LANGSMITH_TRACING`,
182
+ `LANGCHAIN_TRACING_V2`): `TRACING_ENABLED` is the switch, and the app sets `LANGSMITH_TRACING`
183
+ itself when LangSmith is the destination. Leave the other `.env` entries (model provider,
184
+ API key) as they are. `playground` and `run` pick the settings up. If the collector is not running
185
+ yet, say so in your answer; the configuration is still correct.
186
+
187
+ ## Procedure: salt the hashed principal id
188
+
189
+ Use this when principal ids are guessable (emails, phone numbers, account numbers).
190
+
191
+ 1. Add `PRINCIPAL_HASH_SALT` to `secrets.keys` in `graph-agents-cli-manifest.yaml` and keep the
192
+ existing keys. This is configuration only. The app already uses HMAC for the hash whenever the
193
+ variable is set, so do not change code, chart templates or `values-*.yaml`, and never put the
194
+ value in a values file.
195
+ 2. The user puts a long random value (for example
196
+ `python -c "import secrets; print(secrets.token_hex(32))"`) in `.env.<env>` and keeps it stable.
197
+ 3. `graph-agents-cli secrets apply --env <env>`, then `graph-agents-cli deploy --restart --env
198
+ <env>`. Pods read a changed Secret only when they start. Repeat both steps for every deployed
199
+ environment.
200
+ 4. Every hash changes once: older traces, logs and run records keep the old hashes and no longer
201
+ match new ones.
202
+
203
+ When the user runs cluster commands themselves, the final answer must list these commands
204
+ verbatim, with the real environment name substituted (for example `--env prod`). A phrase such as
205
+ "apply your secrets and roll out" is not enough.
206
+
207
+ ## Troubleshooting
208
+
209
+ | Symptom | Fix |
210
+ |---|---|
211
+ | No traces appear | `TRACING_ENABLED` is not `true` (the key alone does nothing); check `GET /health` and the pod env |
212
+ | Traces in LangSmith but empty prompts | expected under `metadata`; `full` is an explicit decision |
213
+ | OTLP exporter connection refused | endpoint must be reachable from the pod; use the collector's Service DNS and port 4318 (HTTP) |
214
+ | Traces from `eval generate` mixed with production | use `LANGSMITH_PROJECT` per environment; eval traces are files unless tracing is on |
215
+ | Need to know who a trace belongs to | correlate `hashed_id` with the client application's session log; the raw id is never in the trace |
216
+
217
+ ## Not covered by this skill
218
+
219
+ - Deploying the values or Secret changes: `/graph-agents-cli-deploy`.
220
+ - Writing nodes or tools that emit custom spans: `/graph-agents-cli-langgraph-code` (keep
221
+ prompt text out of logs).
222
+ - The eval gate and results files: `/graph-agents-cli-eval`.
223
+ - Cluster-wide metrics collection, logging stacks, dashboards, alerting rules: platform tooling
224
+ outside the CLI (the app exposes `/metrics` and JSON logs for them).
225
+ - Self-hosted LangSmith installation (point `LANGSMITH_ENDPOINT` at one that exists).
226
+
227
+ ## Migration note
228
+
229
+ Compared with google-agents-cli: Cloud Trace, Cloud Logging, prompt-response logging to GCS and
230
+ BigQuery, and the BigQuery Agent Analytics plugin are gone, and tracing is no longer always on.
231
+ LangSmith or OTLP behind `TRACING_ENABLED` with the `TRACE_CAPTURE` policy replaces them.
@@ -0,0 +1,46 @@
1
+ # LangSmith destination
2
+
3
+ Used when `TRACING_ENABLED=true` and `LANGSMITH_API_KEY` is set.
4
+
5
+ ## Variables
6
+
7
+ | Variable | Where | Notes |
8
+ |---|---|---|
9
+ | `TRACING_ENABLED=true` | `.env` / chart `tracing.enabled` | required; the key alone does nothing |
10
+ | `LANGSMITH_API_KEY` | Secret (`secrets.keys` includes it by default) | |
11
+ | `LANGSMITH_PROJECT` | `.env` / chart `tracing.langsmith.project` | defaults to the project name; use one per environment (`my-agent-staging`) |
12
+ | `LANGSMITH_ENDPOINT` | `.env` / chart | override for a self-hosted LangSmith instance |
13
+ | `TRACE_CAPTURE` | `.env` / chart `tracing.capture` | `metadata` (default) or `full` |
14
+
15
+ `app/app_utils/telemetry.py` sets the LangSmith tracing variables for the LangChain tracer only
16
+ when enabled; it does not rely on `LANGSMITH_TRACING` being set by the operator, and it removes
17
+ prompt and tool content from runs under `metadata` before they are sent.
18
+
19
+ ## What a run looks like
20
+
21
+ - One LangSmith run per `/chat` call, named after the graph, tagged with `agent_version`,
22
+ `runtime`, `checkpointer`, and `thread_id`, with `metadata.principal` = hashed id.
23
+ - Child runs per node, model call, and tool. Under `metadata` the model call shows token counts
24
+ and model name, inputs and outputs are redacted; tool runs show the tool name only.
25
+ - Under `full` inputs and outputs are present.
26
+
27
+ ## Self-hosted LangSmith
28
+
29
+ Point `LANGSMITH_ENDPOINT` at the instance's API URL. The instance itself (enterprise licence,
30
+ Postgres, Redis, ClickHouse) is outside this CLI. On a disconnected network a self-hosted
31
+ instance is the only LangSmith option; hosted LangSmith is excluded from the disconnected profile.
32
+
33
+ ## `eval submit`
34
+
35
+ Uploads a dataset and a results file as a LangSmith dataset plus experiment, so eval history can
36
+ be browsed there. Requires `LANGSMITH_API_KEY`; optional; never part of the gate; disabled in the
37
+ disconnected profile. It does not need `TRACING_ENABLED`.
38
+
39
+ ```bash
40
+ graph-agents-cli eval submit --results artifacts/grade_results/results_<ts>.json
41
+ ```
42
+
43
+ ## Finding a trace
44
+
45
+ `graph-agents-cli run --url ... "hello" -v` prints `message.start` with `thread_id` and `run_id`;
46
+ filter the LangSmith project by `thread_id` tag or `run_id` metadata.
@@ -0,0 +1,59 @@
1
+ # OpenTelemetry (OTLP) destination
2
+
3
+ Used when `TRACING_ENABLED=true` and no `LANGSMITH_API_KEY` is set. The only tracing path in the
4
+ disconnected profile.
5
+
6
+ ## Variables
7
+
8
+ | Variable | Where | Notes |
9
+ |---|---|---|
10
+ | `TRACING_ENABLED=true` | `.env` / chart `tracing.enabled` | required |
11
+ | `OTEL_EXPORTER_OTLP_ENDPOINT` | chart `tracing.otlpEndpoint` / `.env` | e.g. `http://otel-collector.observability.svc:4318` (OTLP/HTTP) |
12
+ | `TRACE_CAPTURE` | `.env` / chart `tracing.capture` | `metadata` (default) or `full` |
13
+
14
+ ## Instrumentation
15
+
16
+ `app/app_utils/telemetry.py` uses the OpenInference LangChain instrumentor
17
+ (`openinference-instrumentation-langchain`) with `opentelemetry-exporter-otlp-proto-http`. It is
18
+ initialised only when tracing is enabled and no LangSmith key is present; otherwise the modules
19
+ are not imported. Standard `OTEL_*` variables (`OTEL_RESOURCE_ATTRIBUTES`,
20
+ `OTEL_EXPORTER_OTLP_HEADERS`) are honoured by the SDK. The resource's `service.name` is
21
+ `OTEL_SERVICE_NAME` when set, else `LANGSMITH_PROJECT`, else the name of the working directory
22
+ (`app` in the fastapi image, the project name in the server image); the chart does not set it, so add `OTEL_SERVICE_NAME: <name>` to the
23
+ chart's `env` (or `values-<env>.yaml`) to name the service in your backend.
24
+
25
+ ## Spans and attributes
26
+
27
+ - Root span per `/chat` call; child spans per graph node, model call, and tool.
28
+ - Attributes under `metadata`: model and provider names, token counts, tool names, error types,
29
+ HTTP status codes, `thread_id`, `run_id`, `principal.hashed_id`, `agent_version`.
30
+ - Under `full`: additionally `input.value` / `output.value` on model and tool spans (prompts,
31
+ completions, tool arguments and results) and full exception messages. Under `metadata` the
32
+ exporter drops `exception.message` / `exception.stacktrace` from span events and the ERROR
33
+ status description (where OpenInference puts `repr(exc)` plus the traceback); the LangSmith
34
+ client likewise reduces a run's `error` to the exception class.
35
+
36
+ The capture policy is applied by a span processor before export, so a collector never sees
37
+ content that the policy excludes.
38
+
39
+ ## Collector
40
+
41
+ Any OTLP-capable collector: the OpenTelemetry Collector, Jaeger, Tempo, or a vendor agent. A
42
+ minimal in-cluster collector receives OTLP/HTTP on 4318 and exports to the backend the platform
43
+ already runs. Installing and operating the collector is outside the CLI; `infra check` does not
44
+ verify it (the endpoint is a plain URL the pod must reach).
45
+
46
+ ## Local use
47
+
48
+ Run a collector locally (for example the OpenTelemetry Collector container or Jaeger all-in-one),
49
+ set `TRACING_ENABLED=true` and `OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318` in `.env`, and
50
+ use `graph-agents-cli playground` or `run`. Nothing leaves the machine.
51
+
52
+ ## Troubleshooting
53
+
54
+ | Symptom | Fix |
55
+ |---|---|
56
+ | No spans | `TRACING_ENABLED` not `true`, or a LangSmith key is set (LangSmith wins) |
57
+ | Connection refused | wrong Service DNS or port; OTLP/HTTP is 4318, OTLP/gRPC is 4317 (this exporter uses HTTP) |
58
+ | Spans without content | expected under `metadata` |
59
+ | Import errors at startup | the OTel packages are in the template's `pyproject.toml`; run `graph-agents-cli install` |