recala-cli 0.6.0__tar.gz → 0.6.5__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 (183) hide show
  1. {recala_cli-0.6.0 → recala_cli-0.6.5}/CHANGELOG.md +35 -0
  2. {recala_cli-0.6.0 → recala_cli-0.6.5}/PKG-INFO +13 -1
  3. {recala_cli-0.6.0 → recala_cli-0.6.5}/README.md +12 -0
  4. {recala_cli-0.6.0 → recala_cli-0.6.5}/pyproject.toml +1 -1
  5. recala_cli-0.6.5/scripts/publish_pypi.py +94 -0
  6. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/__init__.py +1 -1
  7. recala_cli-0.6.5/src/recala_cli/analytics.py +55 -0
  8. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/article_runs.py +43 -3
  9. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/client.py +11 -1
  10. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/commands/article.py +170 -16
  11. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/commands/auth.py +21 -20
  12. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/commands/bing.py +2 -2
  13. recala_cli-0.6.5/src/recala_cli/commands/export.py +68 -0
  14. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/commands/keys.py +3 -3
  15. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/commands/knowledge.py +163 -4
  16. recala_cli-0.6.5/src/recala_cli/commands/onboard.py +407 -0
  17. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/commands/org.py +201 -31
  18. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/commands/status.py +6 -1
  19. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/commands/topics.py +142 -9
  20. recala_cli-0.6.5/src/recala_cli/confirm.py +129 -0
  21. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/endpoints.py +9 -2
  22. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/errors.py +8 -2
  23. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/human.py +2 -2
  24. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/main.py +32 -2
  25. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/onboarding.py +85 -11
  26. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/organizations.py +19 -1
  27. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/polling.py +31 -9
  28. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/runtime.py +20 -5
  29. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/skills/recala-article-signoff/SKILL.md +1 -1
  30. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/skills/recala-cli-contract.md +5 -2
  31. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/skills/recala-onboard/SKILL.md +1 -1
  32. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/skills/recala-onboard-brand/SKILL.md +1 -1
  33. recala_cli-0.6.5/src/recala_cli/stop_next_steps.py +52 -0
  34. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/ui.py +79 -4
  35. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/views.py +17 -3
  36. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/conftest.py +10 -1
  37. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/fixtures/human_output_pass1_json.json +1 -1
  38. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/fixtures/machine_contract_main.json +167 -94
  39. recala_cli-0.6.5/tests/test_agent_error_next_steps.py +67 -0
  40. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_agent_onboarding.py +20 -1
  41. recala_cli-0.6.5/tests/test_analytics.py +160 -0
  42. recala_cli-0.6.5/tests/test_analytics_security.py +63 -0
  43. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_approve_reconfirm.py +4 -4
  44. recala_cli-0.6.5/tests/test_article_cover.py +102 -0
  45. recala_cli-0.6.5/tests/test_article_export.py +142 -0
  46. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_article_id_output.py +2 -1
  47. recala_cli-0.6.5/tests/test_article_portal_link.py +39 -0
  48. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_billing_link.py +3 -3
  49. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_bing.py +1 -1
  50. recala_cli-0.6.5/tests/test_blank_author.py +53 -0
  51. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_c2_onboarding.py +12 -11
  52. recala_cli-0.6.5/tests/test_cms_skip.py +80 -0
  53. recala_cli-0.6.5/tests/test_company_name_in_prompts.py +40 -0
  54. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_confirm.py +25 -67
  55. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_connect_and_status.py +3 -3
  56. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_content_commands.py +36 -9
  57. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_core_release.py +2 -2
  58. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_core_short_ids.py +1 -1
  59. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_credits.py +2 -2
  60. recala_cli-0.6.5/tests/test_declined_setup_is_not_an_error.py +88 -0
  61. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_dogfood_fixes.py +15 -16
  62. recala_cli-0.6.5/tests/test_empty_scan_next.py +124 -0
  63. recala_cli-0.6.5/tests/test_empty_scan_replay.py +162 -0
  64. recala_cli-0.6.5/tests/test_failed_scan_ends_softly.py +306 -0
  65. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_faithful_translation_settings.py +4 -4
  66. recala_cli-0.6.5/tests/test_free_article_tries.py +161 -0
  67. recala_cli-0.6.5/tests/test_free_company_topics_step.py +86 -0
  68. recala_cli-0.6.5/tests/test_free_plan_wording.py +45 -0
  69. recala_cli-0.6.5/tests/test_free_scout_refusal.py +45 -0
  70. recala_cli-0.6.5/tests/test_free_topics.py +121 -0
  71. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_hold_text.py +8 -20
  72. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_human_readable.py +1 -1
  73. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_index.py +3 -3
  74. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_keys.py +8 -10
  75. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_knowledge_admit.py +4 -4
  76. recala_cli-0.6.5/tests/test_knowledge_show_ideas.py +243 -0
  77. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_languages.py +3 -3
  78. recala_cli-0.6.5/tests/test_login_json_org.py +32 -0
  79. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_monthly_report.py +6 -6
  80. recala_cli-0.6.5/tests/test_no_endings_say_what_is_true.py +120 -0
  81. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_notifications.py +3 -3
  82. recala_cli-0.6.5/tests/test_onboard_defaults.py +43 -0
  83. recala_cli-0.6.5/tests/test_onboard_free_plan.py +82 -0
  84. recala_cli-0.6.5/tests/test_onboarding_channel.py +28 -0
  85. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_onboarding_commands.py +3 -3
  86. recala_cli-0.6.5/tests/test_org_describe.py +62 -0
  87. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_org_readable.py +5 -4
  88. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_poll_pacing.py +22 -0
  89. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_publish_commands.py +26 -10
  90. recala_cli-0.6.5/tests/test_publish_pypi.py +154 -0
  91. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_questions.py +12 -13
  92. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_refresh.py +3 -3
  93. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_review_hardening.py +1 -1
  94. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_review_round3.py +4 -2
  95. recala_cli-0.6.5/tests/test_run_progress.py +30 -0
  96. recala_cli-0.6.5/tests/test_scene.py +148 -0
  97. recala_cli-0.6.5/tests/test_scout_count.py +37 -0
  98. recala_cli-0.6.5/tests/test_second_company_and_refused_details.py +129 -0
  99. recala_cli-0.6.5/tests/test_signed_in_writes.py +225 -0
  100. recala_cli-0.6.5/tests/test_stop_next_steps.py +117 -0
  101. recala_cli-0.6.5/tests/test_submit_review_state.py +49 -0
  102. recala_cli-0.6.5/tests/test_will_retry.py +65 -0
  103. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_write_flags.py +4 -4
  104. recala_cli-0.6.0/src/recala_cli/commands/onboard.py +0 -237
  105. recala_cli-0.6.0/src/recala_cli/confirm.py +0 -137
  106. recala_cli-0.6.0/tests/test_onboarding_channel.py +0 -7
  107. recala_cli-0.6.0/uv.lock +0 -172
  108. {recala_cli-0.6.0 → recala_cli-0.6.5}/.gitignore +0 -0
  109. {recala_cli-0.6.0 → recala_cli-0.6.5}/scripts/check-dogfood.sh +0 -0
  110. {recala_cli-0.6.0 → recala_cli-0.6.5}/scripts/release.py +0 -0
  111. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/__main__.py +0 -0
  112. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/auth.py +0 -0
  113. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/commands/__init__.py +0 -0
  114. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/commands/billing.py +0 -0
  115. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/commands/cadence.py +0 -0
  116. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/commands/connect.py +0 -0
  117. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/commands/credits.py +0 -0
  118. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/commands/faithful_translations.py +0 -0
  119. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/commands/gsc.py +0 -0
  120. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/commands/index.py +0 -0
  121. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/commands/languages.py +0 -0
  122. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/commands/monthly_report.py +0 -0
  123. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/commands/notifications.py +0 -0
  124. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/commands/profile.py +0 -0
  125. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/commands/questions.py +0 -0
  126. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/commands/reads.py +0 -0
  127. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/commands/refresh.py +0 -0
  128. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/commands/refusals.py +0 -0
  129. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/commands/schema.py +0 -0
  130. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/commands/shell.py +0 -0
  131. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/commands/skills.py +0 -0
  132. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/commands/slot_topic.py +0 -0
  133. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/config.py +0 -0
  134. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/display.py +0 -0
  135. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/ids.py +0 -0
  136. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/labels.py +0 -0
  137. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/output.py +0 -0
  138. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/parallel.py +0 -0
  139. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/prompts.py +0 -0
  140. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/search_numbers.py +0 -0
  141. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/skills/recala-apply-revision-notes/SKILL.md +0 -0
  142. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/skills/recala-connect-search-console/SKILL.md +0 -0
  143. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/skills/recala-plan-month/SKILL.md +0 -0
  144. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/skills/recala-schedule-approved/SKILL.md +0 -0
  145. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/skills/recala-weekly-authority-report/SKILL.md +0 -0
  146. {recala_cli-0.6.0 → recala_cli-0.6.5}/src/recala_cli/updates.py +0 -0
  147. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/distribution/test_public_install.py +0 -0
  148. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/fixtures/hold_text_json.json +0 -0
  149. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_approve_read_receipt.py +0 -0
  150. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_billing_invoices.py +0 -0
  151. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_cadence.py +0 -0
  152. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_calendar_matches_plan.py +0 -0
  153. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_calendar_slots.py +0 -0
  154. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_core_errors.py +0 -0
  155. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_core_root.py +0 -0
  156. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_core_speed.py +0 -0
  157. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_core_status_speed.py +0 -0
  158. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_dogfood_status.py +0 -0
  159. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_edit_link_warnings.py +0 -0
  160. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_errors.py +0 -0
  161. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_gsc.py +0 -0
  162. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_help_listing.py +0 -0
  163. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_hold_finding_sentences.py +0 -0
  164. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_human_output_pass1.py +0 -0
  165. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_login.py +0 -0
  166. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_machine_contract.py +0 -0
  167. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_org.py +0 -0
  168. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_profile.py +0 -0
  169. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_questions_in_words.py +0 -0
  170. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_recheck_findings.py +0 -0
  171. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_rerun_refusal.py +0 -0
  172. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_scan_reports_what_was_found.py +0 -0
  173. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_search_numbers.py +0 -0
  174. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_short_id_selectors.py +0 -0
  175. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_skills.py +0 -0
  176. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_slot_topic.py +0 -0
  177. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_times_in_company_zone.py +0 -0
  178. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_topics.py +0 -0
  179. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_topics_add.py +0 -0
  180. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_topics_one_call.py +0 -0
  181. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_ui.py +0 -0
  182. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_view_surface.py +0 -0
  183. {recala_cli-0.6.0 → recala_cli-0.6.5}/tests/test_whoami.py +0 -0
@@ -1,5 +1,40 @@
1
1
  # CLI changes
2
2
 
3
+ ## Unreleased
4
+
5
+ ## 0.6.5
6
+
7
+ - `connect bing` opens Bing consent directly for the selected company, then waits for approval and selects its verified site. Google and Bing consent return to Connections with confirmation from the stored connection.
8
+
9
+ - With `--json`, the error code for a company address the server refuses changed from `invalid` to `address_rejected`. Any other refusal of the company details (languages, a name over its limit) keeps the server's own code.
10
+
11
+ ## 0.6.4
12
+
13
+ - `article export <id> [--format markdown|html]`: prints an approved article's text, for a company with no CMS to publish it to. Only the text goes to stdout, so `recala article export <id> > article.md` makes a clean file (no added newline); `--json` gives `{body, format, title}` and needs `--org`. Before approval it refuses, and says the next command: `article approve`, or, when the final checks are missing, `article edit`, `article recheck`, then `article approve`. It only reads; nothing is changed.
14
+ - A draft that was not pushed to a CMS ends with the line "Once it is approved, take its text with `recala article export <id> > article.md`".
15
+
16
+ ## 0.6.3
17
+
18
+ - A free account's first article tries again by itself (up to 3 tries) when a try fails, and says so while it waits; `--no-wait` never retries, and a retry that started keeps its own outcome instead of the first failure.
19
+ - `onboard` can finish without a CMS (`--skip-cms`; with `--dry-run` it saves nothing), and a free account gets its first topic the way a free web account does. `login --json` selects the only company, or lists several.
20
+ - A topic that cannot be written for want of something from the company now exits 6 `needs_input` with what is missing and the command that supplies it (`Next: ...`): the company description, an author, a source, or a document. A free account does not retry it, since trying again changes nothing; a stop that follows a failed try is the one shown.
21
+ - `org describe "<what your company does and who it is for>"`: saves the company description the writer starts from (asks for confirmation; `--dry-run` previews it).
22
+ - A long wait shows a small harbour and says every minute that the run is alive.
23
+
24
+ ## 0.6.2
25
+
26
+ - Commands that attempt an authenticated API request report their command name, version, duration and exit status to that same API origin. Company context is checked by the server. Arguments, terminal output and credentials are excluded; reporting failures preserve the command result. Set `RECALA_TELEMETRY=0` or `DO_NOT_TRACK=1` to opt out. Local-only commands, dry runs and signed-out commands do not report.
27
+ - `knowledge ideas` waits for a document reading in progress and, after the normal write confirmation, can recover one failed reading the API says may be retried. Terminal reading failures exit 6 with their reason instead of returning a successful empty result. Dry runs never start a reading, and an unknown write outcome is never repeated. `--add` also sends the source document id for document-aware topic scoring.
28
+ - `article submit` recognizes an article already in review after checking its current state. Other transition refusals remain errors; the CLI never repeats the submission.
29
+
30
+ ## 0.6.1
31
+
32
+ - `knowledge add --help` now documents the 50 MB upload limit shared by the API and web app. Large files already use the same upload transport; 12 MB and 50 MB regression cases verify the bytes are forwarded unchanged.
33
+ - `article cover <id>`: a new cover image for an article, in the company's current brand style, like "Change image" in the portal (one paid image; the text and status stay as they are; `--dry-run` previews it). A failed image exits 9 `cover_failed` with the reason and `retryable: false` (that attempt is already paid), and the old cover stays. A server error (5xx) is never `retryable` either, because the image may already be paid for; the message says to check the cover in the portal first. The command waits up to 630 s, past the API's own 600 s limit.
34
+ - `knowledge show <id>`: what Recala learned from a source, as the portal shows it: summary, value score with its reason, originality with its tier (a part that was not measured says so), and the facts taken from it.
35
+ - `knowledge ideas <id>`: the article ideas and questions found in a source, numbered, each with why. `knowledge ideas <id> --add N` sends number N to the topic queue, like the portal's "Add to topics" (asks for confirmation; `--dry-run` previews it).
36
+ - No more `recala grant`. A sign-in (`recala login`) stays until `recala logout` and is its own permission to write: without a terminal, a write runs when it names the company with `--org <company>` (the saved company and `RECALA_ORG` don't count, since they may be a client's; unnamed, exit 2 `org_required`). It says `Writing for <company>: <what>` on stderr first, outside `--json`. In a terminal every write still asks. Deleting a key, a source or a review link, and unpublishing, need `--yes` without a terminal. `recala grant --status` still answers; `recala grant` changes nothing.
37
+
3
38
  ## 0.6.0
4
39
 
5
40
  Faster, clearer and complete, and installed from PyPI.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: recala-cli
3
- Version: 0.6.0
3
+ Version: 0.6.5
4
4
  Summary: Drive your Recala company from the terminal, by hand or through an AI agent.
5
5
  Project-URL: Homepage, https://recala.co
6
6
  Project-URL: Documentation, https://recala.co/developers
@@ -61,3 +61,15 @@ Add `--json` to any command for output an agent can read. `recala --help` lists
61
61
  `recala completion zsh` prints shell completion.
62
62
 
63
63
  Documentation: https://recala.co/developers
64
+
65
+ ## Usage analytics
66
+
67
+ Commands that attempt an authenticated API request report their registered command name, CLI version, duration
68
+ and exit status through Recala's authenticated API. Arguments, article content,
69
+ terminal output and credentials are not included. API credentials authenticate
70
+ the report as usual; PostHog credentials remain on Recala's server.
71
+
72
+ Set `RECALA_TELEMETRY=0` (or `DO_NOT_TRACK=1`) to opt out. Signed-out commands,
73
+ local-only commands, help/version output and dry runs do not report. Reports go
74
+ only to the same API origin and path prefix the command already used. Delivery is best effort;
75
+ an analytics outage does not change the command's output or exit status.
@@ -38,3 +38,15 @@ Add `--json` to any command for output an agent can read. `recala --help` lists
38
38
  `recala completion zsh` prints shell completion.
39
39
 
40
40
  Documentation: https://recala.co/developers
41
+
42
+ ## Usage analytics
43
+
44
+ Commands that attempt an authenticated API request report their registered command name, CLI version, duration
45
+ and exit status through Recala's authenticated API. Arguments, article content,
46
+ terminal output and credentials are not included. API credentials authenticate
47
+ the report as usual; PostHog credentials remain on Recala's server.
48
+
49
+ Set `RECALA_TELEMETRY=0` (or `DO_NOT_TRACK=1`) to opt out. Signed-out commands,
50
+ local-only commands, help/version output and dry runs do not report. Reports go
51
+ only to the same API origin and path prefix the command already used. Delivery is best effort;
52
+ an analytics outage does not change the command's output or exit status.
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "recala-cli"
3
- version = "0.6.0"
3
+ version = "0.6.5"
4
4
  description = "Drive your Recala company from the terminal, by hand or through an AI agent."
5
5
  readme = "README.md"
6
6
  authors = [{ name = "Recala" }]
@@ -0,0 +1,94 @@
1
+ #!/usr/bin/env python3
2
+ """Upload the current CLI version to PyPI from this Mac, with the token kept in the login Keychain.
3
+
4
+ GitHub Actions is off, so .github/workflows/release-cli.yml (trusted publishing) cannot run. After the CLI version
5
+ bump merges, from any directory:
6
+ python3 apps/cli/scripts/publish_pypi.py --dry-run # builds, scans and checks the upload, sends nothing
7
+ python3 apps/cli/scripts/publish_pypi.py
8
+
9
+ The token is read with `security find-generic-password -s recala-pypi-upload-token -a recala -w` and handed to
10
+ `uv publish` only in its environment (UV_PUBLISH_TOKEN): never printed, never an argument, never written to a file.
11
+ """
12
+
13
+ from __future__ import annotations
14
+
15
+ import argparse
16
+ import os
17
+ import subprocess
18
+ import tempfile
19
+ from pathlib import Path
20
+
21
+ import release # beside this file: the version check and the public-wheel scanner
22
+
23
+ CLI = Path(__file__).resolve().parents[1]
24
+ KEYCHAIN_SERVICE = "recala-pypi-upload-token"
25
+ KEYCHAIN_ACCOUNT = "recala"
26
+ PYPI_UPLOAD_URL = "https://upload.pypi.org/legacy/" # pinned: the token is PyPI's and goes nowhere else
27
+ #: uv settings a shell may carry that would point the upload, or its credentials, somewhere other than PyPI.
28
+ _UPLOAD_OVERRIDES = ("UV_PUBLISH_", "UV_INDEX", "UV_DEFAULT_INDEX", "UV_EXTRA_INDEX_URL")
29
+ READ_TOKEN = ("security", "find-generic-password", "-s", KEYCHAIN_SERVICE, "-a", KEYCHAIN_ACCOUNT, "-w")
30
+
31
+
32
+ class PublishError(Exception):
33
+ """A publish step failed; the message never carries the token."""
34
+
35
+
36
+ def built_files(cli_directory: Path, version: str, out_dir: Path, run) -> list[Path]:
37
+ """The wheel and sdist of ``version``, the wheel scanned as release.py scans the public one."""
38
+ run(["uv", "build", "--out-dir", str(out_dir), str(cli_directory)], check=True)
39
+ wheel = out_dir / f"recala_cli-{version}-py3-none-any.whl"
40
+ sdist = out_dir / f"recala_cli-{version}.tar.gz"
41
+ missing = [path.name for path in (wheel, sdist) if not path.is_file()]
42
+ if missing:
43
+ raise PublishError(f"Build did not produce {', '.join(missing)}")
44
+ release.scan_public_wheel(wheel, cli_directory)
45
+ return [wheel, sdist]
46
+
47
+
48
+ def keychain_token(run) -> str:
49
+ result = run(list(READ_TOKEN), capture_output=True, text=True)
50
+ token = result.stdout.strip() if result.returncode == 0 else ""
51
+ if not token:
52
+ raise PublishError(f"No PyPI token in the login Keychain (service {KEYCHAIN_SERVICE}, account "
53
+ f"{KEYCHAIN_ACCOUNT}). The founder adds it; nothing was uploaded.")
54
+ return token
55
+
56
+
57
+ def upload_environment(token: str) -> dict[str, str]:
58
+ """This shell's environment without any uv upload or index override, plus the token."""
59
+ kept = {name: value for name, value in os.environ.items() if not name.startswith(_UPLOAD_OVERRIDES)}
60
+ return {**kept, "UV_PUBLISH_TOKEN": token}
61
+
62
+
63
+ def upload(files: list[Path], token: str, run, *, dry_run: bool) -> None:
64
+ # No --check-url: a version already on PyPI must fail loudly, not be skipped and reported as published.
65
+ command = ["uv", "publish", "--publish-url", PYPI_UPLOAD_URL, *(["--dry-run"] if dry_run else []), *map(str, files)]
66
+ result = run(command, env=upload_environment(token))
67
+ if result.returncode != 0:
68
+ raise PublishError(f"uv publish failed with exit code {result.returncode}; its own message is above.")
69
+
70
+
71
+ def publish(cli_directory: Path, *, run=None, dry_run: bool = False) -> str:
72
+ """Build, scan, read the token, upload; the version sent."""
73
+ run = run or subprocess.run # looked up per call, so a test's stand-in is the one used
74
+ version = release.release_version(cli_directory)
75
+ with tempfile.TemporaryDirectory(prefix="recala-cli-pypi-") as out_dir:
76
+ files = built_files(cli_directory, version, Path(out_dir), run)
77
+ upload(files, keychain_token(run), run, dry_run=dry_run)
78
+ return version
79
+
80
+
81
+ def main() -> None:
82
+ parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
83
+ parser.add_argument("--dry-run", action="store_true", help="Build, scan and check the upload without sending it.")
84
+ args = parser.parse_args()
85
+ try:
86
+ version = publish(CLI, dry_run=args.dry_run)
87
+ except (PublishError, ValueError, OSError, subprocess.CalledProcessError) as error:
88
+ parser.exit(1, f"Publish failed: {error}\n")
89
+ print(f"Checked recala-cli {version} for PyPI; nothing was sent." if args.dry_run
90
+ else f"Published recala-cli {version} to PyPI.")
91
+
92
+
93
+ if __name__ == "__main__":
94
+ main()
@@ -1,3 +1,3 @@
1
1
  """Recala from the terminal: drive a company by hand or through an AI agent."""
2
2
 
3
- __version__ = "0.6.0"
3
+ __version__ = "0.6.5"
@@ -0,0 +1,55 @@
1
+ """Best-effort command completion, through Recala's authenticated API.
2
+
3
+ Only registered command names and scalar outcomes leave the process. A daemon
4
+ sender gets half a second before exit; analytics cannot hold a command open.
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ import os
10
+ from threading import Thread
11
+ from uuid import uuid4
12
+
13
+ import click
14
+ import httpx
15
+
16
+ from recala_cli import __version__, config
17
+
18
+
19
+ def report(ctx: click.Context, exit_code: int, duration_ms: int) -> None:
20
+ if (ctx.obj or {}).get("dry_run") or ctx.meta.get("analytics_dry_run"):
21
+ return
22
+ if os.environ.get("RECALA_TELEMETRY", "1").lower() in {"0", "false", "off", "no"}:
23
+ return
24
+ if os.environ.get("DO_NOT_TRACK") == "1":
25
+ return
26
+ client = ctx.meta.get("analytics_client")
27
+ if client is None or not client.authenticated_request_sent or not client.token:
28
+ return
29
+ token = client.token
30
+ headers = {"Authorization": f"Bearer {token}", "User-Agent": f"recala-cli/{__version__}"}
31
+ org_id = ctx.meta.get("resolved_org")
32
+ if not org_id and exit_code == 0:
33
+ org_id = config.saved_active_org()
34
+ if org_id and config.is_org_id(org_id):
35
+ headers["X-Recala-Org-ID"] = org_id
36
+ data = {
37
+ "command": ctx.meta.get("analytics_command", "unknown"),
38
+ "cli_version": __version__,
39
+ "exit_code": max(0, min(exit_code, 255)),
40
+ "duration_ms": max(0, min(duration_ms, 86_400_000)),
41
+ "invocation_id": str(uuid4()),
42
+ }
43
+ api_url = client.api_url
44
+ transport = client.transport
45
+
46
+ def send():
47
+ try:
48
+ with httpx.Client(base_url=api_url, transport=transport, timeout=0.3) as http:
49
+ http.post("/api/v1/cli/events", json=data, headers=headers)
50
+ except Exception:
51
+ pass
52
+
53
+ worker = Thread(target=send, daemon=True)
54
+ worker.start()
55
+ worker.join(0.5)
@@ -4,11 +4,13 @@ import re
4
4
  from datetime import UTC, datetime, timedelta
5
5
  from shlex import quote
6
6
 
7
+ from recala_cli import config
7
8
  from recala_cli.display import display_name
8
9
  from recala_cli.endpoints import ARTICLE_SHOW, GENERATION_STATUS, CADENCE_SHOW
9
10
  from recala_cli.errors import CliError, ExitCode
10
11
  from recala_cli.human import describe_fields, finding_sentences, recheck_findings
11
12
  from recala_cli.polling import poll_until
13
+ from recala_cli.stop_next_steps import needs_input_message
12
14
  from recala_cli.views import company_timezone, moment_in
13
15
 
14
16
 
@@ -139,6 +141,11 @@ def ensure_outcome(result, client=None, *, ctx=None):
139
141
  result.get("cms_status") if result.get("cms_status") != "skipped" else None,
140
142
  result.get("cms_publish_status") if result.get("cms_publish_status") != "skipped" else None,
141
143
  }
144
+ if result.get("failure_code") == "needs_input" and not result.get("article_id"):
145
+ # The company has to give something first: this is neither a hold nor a failed try, and running it again changes nothing.
146
+ raise CliError(ExitCode.CONFLICT, "needs_input",
147
+ needs_input_message(result.get("failure_reason"), "Recala needs more from the company before it can write this."),
148
+ details=result)
142
149
  failed_states = states & {"held", "failed", "skipped"}
143
150
  state = (
144
151
  "held" if "held" in states else next(iter(failed_states), result.get("state"))
@@ -178,6 +185,14 @@ def restart_command(client, identifier):
178
185
  return f"recala article create --topic {quote(identifier)} --org {quote(client.org_id)}"
179
186
 
180
187
 
188
+ #: A promised retry is waited for at most this long (one read a minute); then the failure is reported as it is.
189
+ RETRY_WAIT_MINUTES = 30
190
+
191
+
192
+ def _still_writing(seconds):
193
+ return f"still writing… {seconds // 60}m{seconds % 60:02d}s"
194
+
195
+
181
196
  def wait_for_article(ctx, client, identifier, *, regeneration=False, regenerate_id=None):
182
197
  next_command = resume_command(client, identifier, article=regeneration)
183
198
 
@@ -213,6 +228,8 @@ def wait_for_article(ctx, client, identifier, *, regeneration=False, regenerate_
213
228
  result["state"] = "held"
214
229
  return result
215
230
 
231
+ retry_reads: list[bool] = []
232
+
216
233
  def finished(result):
217
234
  state = result.get("state")
218
235
  if not state:
@@ -221,6 +238,11 @@ def wait_for_article(ctx, client, identifier, *, regeneration=False, regenerate_
221
238
  "unreadable_run",
222
239
  "The API did not report the run's state.",
223
240
  )
241
+ waiting_for_retry = (state == "failed" and result.get("will_retry") and not result.get("article_id")) or (
242
+ state == "pending" and retry_reads)
243
+ if waiting_for_retry:
244
+ retry_reads.append(True) # the server runs it again: this is not the end, for a while
245
+ return len(retry_reads) > RETRY_WAIT_MINUTES
224
246
  return state not in {
225
247
  "regenerating",
226
248
  "processing",
@@ -236,8 +258,12 @@ def wait_for_article(ctx, client, identifier, *, regeneration=False, regenerate_
236
258
  label="Waiting for article",
237
259
  timeout_seconds=7200,
238
260
  describe=lambda r: (
239
- f"{r.get('title') or r.get('topic') or 'Article'}: {r.get('current_node') or r.get('state')}"
261
+ f"{r.get('title') or r.get('topic') or 'Article'}: "
262
+ + ("taking another careful pass" if r.get("state") == "failed" and r.get("will_retry")
263
+ else r.get("current_node") or r.get("state"))
240
264
  ),
265
+ heartbeat=None if regeneration else _still_writing,
266
+ scene=True,
241
267
  )
242
268
  except KeyboardInterrupt:
243
269
  raise CliError(
@@ -353,8 +379,22 @@ def describe_run(result, *, ctx=None):
353
379
  else:
354
380
  outcome = "ready for review."
355
381
  if outcome == "published.":
356
- return prefix + f"{title}: {outcome}"
357
- return prefix + f"{title}: {outcome}" + review_next_step(result)
382
+ return prefix + f"{title}: {outcome}" + portal_link(result, ctx)
383
+ if outcome.endswith("not pushed to the CMS.") and result.get("article_id"): # no CMS: the text leaves by export
384
+ return (prefix + f"{title}: {outcome}" + review_next_step(result) + "\nOnce it is approved, take its text with "
385
+ f"recala article export {quote(str(result['article_id'])[:8])} > article.md" + portal_link(result, ctx))
386
+ return prefix + f"{title}: {outcome}" + review_next_step(result) + portal_link(result, ctx)
387
+
388
+
389
+ def portal_link(result, ctx=None):
390
+ """The article's page in the portal, where its cover and signer are checked; nothing for a run with no article.
391
+
392
+ The portal opens the person's oldest company unless the link names one, so the link carries the run's company."""
393
+ if not result.get("article_id"):
394
+ return ""
395
+ org_id = getattr((ctx.meta.get("org_client") if ctx else None), "org_id", None)
396
+ scope = f"?org={org_id}" if org_id else ""
397
+ return f"\nOpen it in the portal: {config.web_url()}/portal/article/{result['article_id']}{scope}"
358
398
 
359
399
 
360
400
  def review_next_step(result):
@@ -10,6 +10,7 @@ from __future__ import annotations
10
10
  from collections.abc import Callable
11
11
  from typing import Any
12
12
 
13
+ import click
13
14
  import httpx
14
15
 
15
16
  from recala_cli import __version__
@@ -39,6 +40,8 @@ class RecalaClient:
39
40
  ) -> None:
40
41
  self.org_id = org_id
41
42
  self.token: str | None = None
43
+ self.authenticated_request_sent = False
44
+ self.transport = transport
42
45
  self._me: Any = None # GET /me answered once per command; any write forgets it
43
46
  self.refresh_session: Callable[[], str] | None = None
44
47
  self.dry_run = False # --dry-run: reads go out, no write ever does
@@ -48,6 +51,7 @@ class RecalaClient:
48
51
  timeout=timeout,
49
52
  headers={"User-Agent": f"recala-cli/{__version__}"},
50
53
  )
54
+ self.api_url = str(self._http.base_url)
51
55
 
52
56
  @property
53
57
  def known_me(self) -> Any:
@@ -70,6 +74,7 @@ class RecalaClient:
70
74
  return self._me
71
75
  if self.dry_run and endpoint.writes:
72
76
  raise DryRunStop(f"send {endpoint.method} {endpoint.url_path(**(path or {}))}")
77
+ url = endpoint.url_path(**(path or {}))
73
78
  headers = dict(extra_headers or {})
74
79
  if authenticated:
75
80
  headers["Authorization"] = f"Bearer {self.token}"
@@ -77,8 +82,13 @@ class RecalaClient:
77
82
  headers["X-Recala-Org-ID"] = self.org_id
78
83
  for attempt in range(2):
79
84
  try:
85
+ if authenticated and self.token:
86
+ self.authenticated_request_sent = True
87
+ ctx = click.get_current_context(silent=True)
88
+ if ctx is not None:
89
+ ctx.meta["analytics_client"] = self
80
90
  response = self._http.request(
81
- endpoint.method, endpoint.url_path(**(path or {})), params=params, json=json, content=content,
91
+ endpoint.method, url, params=params, json=json, content=content,
82
92
  headers=headers, timeout=httpx.USE_CLIENT_DEFAULT if timeout is None else timeout,
83
93
  )
84
94
  except httpx.HTTPError as exc: