thoughtleaders-cli 0.9.24__tar.gz → 0.9.25__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 (220) hide show
  1. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/.claude-plugin/plugin.json +1 -1
  2. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/AGENTS.md +1 -1
  3. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/PKG-INFO +12 -1
  4. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/README.md +11 -0
  5. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/pyproject.toml +1 -1
  6. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl/SKILL.md +3 -1
  7. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/src/tl_cli/__init__.py +1 -1
  8. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/src/tl_cli/client/errors.py +28 -0
  9. thoughtleaders_cli-0.9.25/src/tl_cli/commands/resets.py +222 -0
  10. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/src/tl_cli/main.py +2 -0
  11. thoughtleaders_cli-0.9.25/tests/test_resets.py +222 -0
  12. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/uv.lock +1 -1
  13. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/.claude-plugin/marketplace.json +0 -0
  14. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/.github/dependabot.yml +0 -0
  15. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/.github/workflows/ci.yml +0 -0
  16. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/.github/workflows/cli-integration.yml +0 -0
  17. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/.github/workflows/python-publish.yml +0 -0
  18. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/.gitignore +0 -0
  19. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/API.md +0 -0
  20. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/CLAUDE.md +0 -0
  21. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/LICENSE +0 -0
  22. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/agents/cast-sheet.md +0 -0
  23. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/agents/gem-classifier.md +0 -0
  24. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/agents/keyword-context-classifier.md +0 -0
  25. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/agents/keyword-entity-resolver.md +0 -0
  26. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/agents/keyword-relevance-validator.md +0 -0
  27. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/agents/merge-shard.md +0 -0
  28. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/agents/tl-analyst.md +0 -0
  29. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/agents/youtube-comment-classifier.md +0 -0
  30. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/hooks/hooks.json +0 -0
  31. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/hooks/scripts/load-tl-skill.mjs +0 -0
  32. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/hooks/scripts/post-usage.sh +0 -0
  33. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/hooks/scripts/pre-check.sh +0 -0
  34. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/_shared/tl_data.py +0 -0
  35. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/connector-impact/SKILL.md +0 -0
  36. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/connector-impact/references/help.md +0 -0
  37. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/connector-impact/references/impact-schema.md +0 -0
  38. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/connector-impact/references/impact-to-tl-mapping.md +0 -0
  39. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl/references/business-glossary.md +0 -0
  40. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl/references/elasticsearch-schema.md +0 -0
  41. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl/references/firebolt-schema.md +0 -0
  42. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl/references/postgres-schema.md +0 -0
  43. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-brand-creator-connection/SKILL.md +0 -0
  44. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-brand-creator-connection/references/cast-sheet.md +0 -0
  45. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-brand-creator-connection/references/creator-brief-template.md +0 -0
  46. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-brand-creator-connection/references/cue-phrases.txt +0 -0
  47. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-brand-creator-connection/references/evidence-rules.md +0 -0
  48. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-brand-creator-connection/references/extractor-rubric.md +0 -0
  49. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-brand-creator-connection/references/identity-lane.md +0 -0
  50. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-brand-creator-connection/references/profile-spec.md +0 -0
  51. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-brand-creator-connection/references/transcript-mining.md +0 -0
  52. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-brand-creator-connection/scripts/assemble_extracts.py +0 -0
  53. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-brand-creator-connection/scripts/authenticate.py +0 -0
  54. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-brand-creator-connection/scripts/bio_lane.py +0 -0
  55. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-brand-creator-connection/scripts/brand_reads.py +0 -0
  56. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-brand-creator-connection/scripts/build_html.py +0 -0
  57. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-brand-creator-connection/scripts/cast_sheet.py +0 -0
  58. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-brand-creator-connection/scripts/channel_context.py +0 -0
  59. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-brand-creator-connection/scripts/cluster_gems.py +0 -0
  60. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-brand-creator-connection/scripts/extractor_prompt.py +0 -0
  61. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-brand-creator-connection/scripts/fetch_cues.py +0 -0
  62. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-brand-creator-connection/scripts/identity_prompt.py +0 -0
  63. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-brand-creator-connection/scripts/ledger_meta.py +0 -0
  64. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-brand-creator-connection/scripts/merge_pass.py +0 -0
  65. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-brand-creator-connection/scripts/moment_check.py +0 -0
  66. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-brand-creator-connection/scripts/page.css +0 -0
  67. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-brand-creator-connection/scripts/start_run.py +0 -0
  68. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-brand-creator-connection/scripts/store_io.py +0 -0
  69. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-brand-creator-connection/scripts/tier_hint.py +0 -0
  70. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-brand-creator-connection/scripts/verify_quotes.py +0 -0
  71. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-channel-authenticity/.gitignore +0 -0
  72. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-channel-authenticity/SKILL.md +0 -0
  73. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-channel-authenticity/references/comment-patterns.md +0 -0
  74. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-channel-authenticity/references/peer-cohort.md +0 -0
  75. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-channel-authenticity/references/red-flags.md +0 -0
  76. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-channel-authenticity/references/scoring.md +0 -0
  77. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-channel-authenticity/scripts/_io_utf8.py +0 -0
  78. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-channel-authenticity/scripts/analyze_channel.py +0 -0
  79. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-channel-authenticity/scripts/anomaly_detector.py +0 -0
  80. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-channel-authenticity/scripts/channel_lookup.py +0 -0
  81. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-channel-authenticity/scripts/comment_analyzer.py +0 -0
  82. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-channel-authenticity/scripts/comment_scraper.py +0 -0
  83. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-channel-authenticity/scripts/engagement_ratios.py +0 -0
  84. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-channel-authenticity/scripts/peer_cohort.py +0 -0
  85. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-channel-authenticity/scripts/report.py +0 -0
  86. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-channel-authenticity/scripts/resolve_channel.py +0 -0
  87. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-channel-authenticity/scripts/score.py +0 -0
  88. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-channel-authenticity/scripts/video_integrity.py +0 -0
  89. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-channel-authenticity/scripts/view_curves.py +0 -0
  90. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-create-workflow/SKILL.md +0 -0
  91. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-create-workflow/references/creating-in-app.md +0 -0
  92. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-create-workflow/references/methodology.md +0 -0
  93. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-create-workflow/references/pitfalls.md +0 -0
  94. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-create-workflow/references/workflow-model.md +0 -0
  95. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-keyword-research/SKILL.md +0 -0
  96. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-keyword-research/references/elasticsearch-content-search.md +0 -0
  97. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-keyword-research/references/help.md +0 -0
  98. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-keyword-research/scripts/build_report.py +0 -0
  99. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-keyword-research/scripts/expand_entities.py +0 -0
  100. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-keyword-research/scripts/fetch_context.py +0 -0
  101. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-keyword-research/scripts/probe.py +0 -0
  102. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-keyword-research/scripts/search_channels.py +0 -0
  103. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-keyword-research/scripts/search_videos.py +0 -0
  104. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-keyword-research/scripts/select_keywords.py +0 -0
  105. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-save-report/SKILL.md +0 -0
  106. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-save-report/references/columns_brands.md +0 -0
  107. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-save-report/references/columns_channels.md +0 -0
  108. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-save-report/references/columns_content.md +0 -0
  109. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-save-report/references/columns_sponsorships.md +0 -0
  110. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-save-report/references/intelligence_filterset_schema.json +0 -0
  111. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-save-report/references/intelligence_widget_schema.json +0 -0
  112. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-save-report/references/report_glossary.md +0 -0
  113. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-save-report/references/sortable_columns.json +0 -0
  114. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-save-report/references/sponsorship_filterset_schema.json +0 -0
  115. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-save-report/references/sponsorship_widget_schema.json +0 -0
  116. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-save-report/references/widgets.md +0 -0
  117. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-top-partnerships/SKILL.md +0 -0
  118. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-top-partnerships/scripts/top_partnerships.py +0 -0
  119. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-views-guarantee/SKILL.md +0 -0
  120. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/skills/tl-views-guarantee/scripts/vg.py +0 -0
  121. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/src/tl_cli/__main__.py +0 -0
  122. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/src/tl_cli/_completions.py +0 -0
  123. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/src/tl_cli/_typer_utils.py +0 -0
  124. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/src/tl_cli/auth/__init__.py +0 -0
  125. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/src/tl_cli/auth/commands.py +0 -0
  126. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/src/tl_cli/auth/login.py +0 -0
  127. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/src/tl_cli/auth/pkce.py +0 -0
  128. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/src/tl_cli/auth/token_store.py +0 -0
  129. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/src/tl_cli/client/__init__.py +0 -0
  130. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/src/tl_cli/client/http.py +0 -0
  131. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/src/tl_cli/commands/__init__.py +0 -0
  132. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/src/tl_cli/commands/_comments_common.py +0 -0
  133. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/src/tl_cli/commands/agent.py +0 -0
  134. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/src/tl_cli/commands/balance.py +0 -0
  135. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/src/tl_cli/commands/brands.py +0 -0
  136. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/src/tl_cli/commands/bulk_import.py +0 -0
  137. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/src/tl_cli/commands/changelog.py +0 -0
  138. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/src/tl_cli/commands/channels.py +0 -0
  139. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/src/tl_cli/commands/credits.py +0 -0
  140. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/src/tl_cli/commands/db.py +0 -0
  141. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/src/tl_cli/commands/deals.py +0 -0
  142. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/src/tl_cli/commands/describe.py +0 -0
  143. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/src/tl_cli/commands/doctor.py +0 -0
  144. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/src/tl_cli/commands/matches.py +0 -0
  145. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/src/tl_cli/commands/memory.py +0 -0
  146. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/src/tl_cli/commands/profiles.py +0 -0
  147. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/src/tl_cli/commands/proposals.py +0 -0
  148. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/src/tl_cli/commands/recommender.py +0 -0
  149. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/src/tl_cli/commands/reports.py +0 -0
  150. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/src/tl_cli/commands/schema.py +0 -0
  151. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/src/tl_cli/commands/setup.py +0 -0
  152. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/src/tl_cli/commands/skills.py +0 -0
  153. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/src/tl_cli/commands/snapshots.py +0 -0
  154. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/src/tl_cli/commands/sponsorships.py +0 -0
  155. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/src/tl_cli/commands/uploads.py +0 -0
  156. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/src/tl_cli/commands/whoami.py +0 -0
  157. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/src/tl_cli/commands/workflows.py +0 -0
  158. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/src/tl_cli/config.py +0 -0
  159. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/src/tl_cli/filters.py +0 -0
  160. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/src/tl_cli/hints.py +0 -0
  161. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/src/tl_cli/output/__init__.py +0 -0
  162. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/src/tl_cli/output/formatter.py +0 -0
  163. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/src/tl_cli/query_history.py +0 -0
  164. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/src/tl_cli/self_update.py +0 -0
  165. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/src/tl_cli/skill_registry.py +0 -0
  166. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests/__init__.py +0 -0
  167. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests/test_agent_complete.py +0 -0
  168. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests/test_assemble_extracts.py +0 -0
  169. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests/test_auth.py +0 -0
  170. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests/test_bio_lane.py +0 -0
  171. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests/test_brands_winner_channels.py +0 -0
  172. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests/test_build_report.py +0 -0
  173. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests/test_cast_sheet.py +0 -0
  174. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests/test_channels_lookalike.py +0 -0
  175. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests/test_cluster_gems.py +0 -0
  176. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests/test_connections_map_rules.py +0 -0
  177. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests/test_creator_brief_accuracy.py +0 -0
  178. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests/test_creator_brief_scripts.py +0 -0
  179. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests/test_db_repeat_warning.py +0 -0
  180. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests/test_describe.py +0 -0
  181. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests/test_error_hints.py +0 -0
  182. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests/test_expand_entities.py +0 -0
  183. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests/test_extractor_prompt.py +0 -0
  184. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests/test_fetch_cues.py +0 -0
  185. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests/test_filters.py +0 -0
  186. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests/test_http_auth.py +0 -0
  187. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests/test_ledger_meta.py +0 -0
  188. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests/test_memory.py +0 -0
  189. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests/test_merge_pass.py +0 -0
  190. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests/test_output.py +0 -0
  191. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests/test_probe.py +0 -0
  192. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests/test_probe_matching.py +0 -0
  193. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests/test_profiles.py +0 -0
  194. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests/test_quota_refusal_message.py +0 -0
  195. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests/test_refusal_rendering.py +0 -0
  196. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests/test_reports.py +0 -0
  197. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests/test_scripts_executable.py +0 -0
  198. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests/test_search_channels.py +0 -0
  199. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests/test_search_videos.py +0 -0
  200. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests/test_select_keywords.py +0 -0
  201. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests/test_setup.py +0 -0
  202. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests/test_setup_marker_respect.py +0 -0
  203. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests/test_shared_tl_data.py +0 -0
  204. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests/test_skill_registry.py +0 -0
  205. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests/test_skills_command.py +0 -0
  206. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests/test_sponsorships.py +0 -0
  207. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests/test_start_run.py +0 -0
  208. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests/test_whoami_newsletter.py +0 -0
  209. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests/test_workflows.py +0 -0
  210. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests_cli/AGENTS.md +0 -0
  211. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests_cli/conftest.py +0 -0
  212. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests_cli/test_balance.py +0 -0
  213. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests_cli/test_db_es.py +0 -0
  214. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests_cli/test_db_fb.py +0 -0
  215. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests_cli/test_db_pg.py +0 -0
  216. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests_cli/test_schema.py +0 -0
  217. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tests_cli/test_whoami.py +0 -0
  218. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tools/tl-brand-creator-connection/references/cue-phrases.trained-2026-09-15.txt +0 -0
  219. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tools/tl-brand-creator-connection/references/cue-training.md +0 -0
  220. {thoughtleaders_cli-0.9.24 → thoughtleaders_cli-0.9.25}/tools/tl-brand-creator-connection/scripts/train_cues.py +0 -0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tl-cli",
3
- "version": "0.9.24",
3
+ "version": "0.9.25",
4
4
  "description": "ThoughtLeaders CLI — query sponsorship deals, channels, brands, uploads, and intelligence from the terminal",
5
5
  "author": {
6
6
  "name": "ThoughtLeaders",
@@ -6,7 +6,7 @@
6
6
 
7
7
  ## Entry Point & Command Registration
8
8
 
9
- `src/tl_cli/main.py` creates the root Typer app and registers all subcommands via `app.add_typer()`. The console script `tl` maps to `tl_cli.main:cli`, which wraps the Typer app with top-level error handling (respects `--debug`). System commands (`auth`, `setup`, `balance`, `doctor`, `whoami`) are free and don't cost credits.
9
+ `src/tl_cli/main.py` creates the root Typer app and registers all subcommands via `app.add_typer()`. The console script `tl` maps to `tl_cli.main:cli`, which wraps the Typer app with top-level error handling (respects `--debug`). System commands (`auth`, `setup`, `balance`, `resets`, `doctor`, `whoami`) are free and don't cost credits.
10
10
 
11
11
  ## Command Pattern (all data commands follow this)
12
12
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: thoughtleaders-cli
3
- Version: 0.9.24
3
+ Version: 0.9.25
4
4
  Summary: ThoughtLeaders CLI — query sponsorship data, channels, brands, and intelligence
5
5
  Project-URL: Homepage, https://thoughtleaders.io
6
6
  Project-URL: Repository, https://github.com/ThoughtLeaders-io/thoughtleaders-cli
@@ -235,6 +235,17 @@ tl describe show sponsorships --filters # Available filters for sponsorships
235
235
  tl balance # Your credit balance
236
236
  ```
237
237
 
238
+ ### Usage resets
239
+
240
+ A usage reset refills your weekly credits to your plan's allotment and restarts your 5-hour session. You get one as a gift from ThoughtLeaders when you sign up, one for each new organization that signs up with your invite link, and a bonus when that organization makes its first proposal or payment. Resets expire 90 days after they're granted, and you spend them only when you choose to.
241
+
242
+ ```bash
243
+ tl resets # Resets you have, recent history, your invite link
244
+ tl resets use # Spend one (asks first; --yes skips the question)
245
+ ```
246
+
247
+ When a query is refused because you're out of credits or at your session limit, the error tells you if you have a reset to spend, and gives your invite link: invite a friend outside your organization and you get a free reset when they join.
248
+
238
249
  `tl db pg` is priced **per-row**: the per-row rate is the **sum of the rates of the tables the query touches** (default 1.0/row; some tables are cheaper or dearer), plus a flat per-row charge for every expensive column read (demographics, channel outreach emails), all times the rows returned. Aggregate queries (`count`/`GROUP BY`) add a surcharge proportional to the rows they aggregate. Run `tl describe show db --json` to see the live `pg_pricing` map, and check `usage.credit_rate` in the response envelope after a query to see what your query was actually charged.
239
250
 
240
251
  To preview a query's cost **before** running it, add `--pricing`: `tl db pg "SELECT … LIMIT 100" --pricing` runs only the planner's `EXPLAIN`, prints the cost breakdown and an upper-bound estimate (at the query's `LIMIT`), and costs a flat **1 credit** — the query itself never executes. Works with `--json` too. `--pricing` is also available on `tl db fb` and `tl db es`; those backends have no per-table or per-column charges, so the estimate is the flat per-row rate at the query's row ceiling (`LIMIT` for Firebolt, `size` — or the aggregation doc cap — for Elasticsearch).
@@ -207,6 +207,17 @@ tl describe show sponsorships --filters # Available filters for sponsorships
207
207
  tl balance # Your credit balance
208
208
  ```
209
209
 
210
+ ### Usage resets
211
+
212
+ A usage reset refills your weekly credits to your plan's allotment and restarts your 5-hour session. You get one as a gift from ThoughtLeaders when you sign up, one for each new organization that signs up with your invite link, and a bonus when that organization makes its first proposal or payment. Resets expire 90 days after they're granted, and you spend them only when you choose to.
213
+
214
+ ```bash
215
+ tl resets # Resets you have, recent history, your invite link
216
+ tl resets use # Spend one (asks first; --yes skips the question)
217
+ ```
218
+
219
+ When a query is refused because you're out of credits or at your session limit, the error tells you if you have a reset to spend, and gives your invite link: invite a friend outside your organization and you get a free reset when they join.
220
+
210
221
  `tl db pg` is priced **per-row**: the per-row rate is the **sum of the rates of the tables the query touches** (default 1.0/row; some tables are cheaper or dearer), plus a flat per-row charge for every expensive column read (demographics, channel outreach emails), all times the rows returned. Aggregate queries (`count`/`GROUP BY`) add a surcharge proportional to the rows they aggregate. Run `tl describe show db --json` to see the live `pg_pricing` map, and check `usage.credit_rate` in the response envelope after a query to see what your query was actually charged.
211
222
 
212
223
  To preview a query's cost **before** running it, add `--pricing`: `tl db pg "SELECT … LIMIT 100" --pricing` runs only the planner's `EXPLAIN`, prints the cost breakdown and an upper-bound estimate (at the query's `LIMIT`), and costs a flat **1 credit** — the query itself never executes. Works with `--json` too. `--pricing` is also available on `tl db fb` and `tl db es`; those backends have no per-table or per-column charges, so the estimate is the flat per-row rate at the query's row ceiling (`LIMIT` for Firebolt, `size` — or the aggregation doc cap — for Elasticsearch).
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "thoughtleaders-cli"
7
- version = "0.9.24"
7
+ version = "0.9.25"
8
8
  description = "ThoughtLeaders CLI — query sponsorship data, channels, brands, and intelligence"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -111,7 +111,7 @@ Other key concepts:
111
111
  - **`purchase_date`** — when the sponsorship was purchased (i.e. when the deal was made); These make up bookings.
112
112
  - **`scheduled_date`** — the date the video is/was expected to be published (scheduled)
113
113
  - **`publish_date`** — the date the video was actually published; These make up live ads.
114
- - **Credits** — every data query costs credits; use `tl describe` to see rates. Top up with `tl credits buy --amount-usd N` (free; opens a browser checkout). New accounts get a starter balance on first `tl auth login`; the rate is shown by `tl credits pricing`.
114
+ - **Credits** — every data query costs credits; use `tl describe` to see rates. Top up with `tl credits buy --amount-usd N` (free; opens a browser checkout). New accounts get a starter balance on first `tl auth login`; the rate is shown by `tl credits pricing`. When a credits or session-limit refusal says the user has usage resets, a reset refills their weekly credits and restarts their 5-hour session; `tl resets` lists them. Spending one is the user's call: ask them first, and only then run `tl resets use --yes`.
115
115
 
116
116
  Users see data scoped by their organization and plan:
117
117
  - **Media buyers** see sponsorships where their org is the brand. They see `price` but never `cost`.
@@ -559,6 +559,8 @@ tl balance --json # Credit balance + recent usage (free)
559
559
  tl credits pricing # Current usd-per-credit rate (free, no auth)
560
560
  tl credits buy --amount-usd 10 # Start a top-up; opens browser checkout (free)
561
561
  tl credits history # Recent top-ups for the caller's org (free)
562
+ tl resets --json # Usage resets, invite link, referrals (free)
563
+ tl resets use --yes # Spend a usage reset — only after the user says so (free)
562
564
  tl whoami # Current user, org, brands (free)
563
565
  tl auth status # Auth check (free)
564
566
  tl changelog # Release notes — current version, or current..latest if behind (free)
@@ -1,3 +1,3 @@
1
1
  """ThoughtLeaders CLI — query sponsorship data, channels, brands, and intelligence."""
2
2
 
3
- __version__ = "0.9.24"
3
+ __version__ = "0.9.25"
@@ -66,6 +66,30 @@ def _print_hint(hint: str | None) -> None:
66
66
  err.print(f"[bold yellow]Hint:[/bold yellow] [yellow]{escape(hint)}[/yellow]")
67
67
 
68
68
 
69
+ def _print_resets_hint(error: ApiError) -> None:
70
+ """On a credits or session refusal, tell a user who has banked usage
71
+ resets that they can spend one. Spending is always their own choice, so
72
+ this only names the command — it never spends a reset."""
73
+ raw = error.raw if isinstance(error.raw, dict) else {}
74
+ count = raw.get("_billing_resets_available")
75
+ if isinstance(count, int) and not isinstance(count, bool) and count > 0:
76
+ noun = "usage reset" if count == 1 else "usage resets"
77
+ err.print(f"You have {count} {noun}. Spend one with: [bold]tl resets use[/bold]")
78
+
79
+
80
+ def _print_invite_hint(error: ApiError) -> None:
81
+ """On a credits or session refusal, point the user at their personal
82
+ invite link, which earns them a reset. Older servers send no link, and
83
+ then nothing is printed."""
84
+ raw = error.raw if isinstance(error.raw, dict) else {}
85
+ link = raw.get("_billing_invite_link")
86
+ if isinstance(link, str) and link:
87
+ err.print(
88
+ "Or invite a friend outside your organization. "
89
+ f"You'll get a free reset when they join: {escape(link)}"
90
+ )
91
+
92
+
69
93
  def handle_api_error(error: ApiError) -> None:
70
94
  """Print a user-friendly error message and exit with the right code."""
71
95
  detail, hint = _split_hint(error)
@@ -95,6 +119,8 @@ def handle_api_error(error: ApiError) -> None:
95
119
  err.print("Or visit: https://app.thoughtleaders.io/billing")
96
120
  _print_hint(hint)
97
121
  err.print("Top up with: [bold]tl credits buy --amount-usd 10[/bold]")
122
+ _print_resets_hint(error)
123
+ _print_invite_hint(error)
98
124
  _print_debug(error)
99
125
  sys.exit(4)
100
126
  elif error.status_code == 403:
@@ -125,6 +151,8 @@ def handle_api_error(error: ApiError) -> None:
125
151
  else:
126
152
  err.print("[yellow]Rate limited.[/yellow] Please wait and try again.")
127
153
  _print_hint(hint)
154
+ _print_resets_hint(error)
155
+ _print_invite_hint(error)
128
156
  _print_debug(error)
129
157
  sys.exit(3)
130
158
  elif error.status_code >= 500:
@@ -0,0 +1,222 @@
1
+ """tl resets — banked usage resets: list them and spend one.
2
+
3
+ A usage reset refills your weekly credits to your plan's allotment and
4
+ restarts your 5-hour session. Spending one is always your explicit choice.
5
+ """
6
+
7
+ import json
8
+ import sys
9
+ from datetime import datetime
10
+
11
+ import typer
12
+ from rich.console import Console
13
+ from rich.markup import escape
14
+ from rich.table import Table
15
+
16
+ from tl_cli._typer_utils import AlphaSortedTyperGroup
17
+ from tl_cli.client.errors import ApiError, handle_api_error
18
+ from tl_cli.client.http import get_client
19
+ from tl_cli.output.formatter import detect_format
20
+
21
+ app = typer.Typer(cls=AlphaSortedTyperGroup, help="Usage resets: list them and spend one (free)")
22
+ console = Console()
23
+ err = Console(stderr=True)
24
+
25
+ SOURCE_LABELS = {
26
+ "welcome": "Gift from ThoughtLeaders",
27
+ "referred_bonus": "You were invited",
28
+ "referral_signup": "Your invite was accepted",
29
+ "referral_bonus": "Your invitee's first proposal or payment",
30
+ "admin_grant": "Added by support",
31
+ }
32
+
33
+ STATUS_LABELS = {
34
+ "issued": "Available",
35
+ "used": "Used",
36
+ "expired": "Expired",
37
+ "capped": "Over the limit",
38
+ "voided": "Removed",
39
+ }
40
+
41
+ # Refusals of `tl resets use`. None of them consume a reset; the server's
42
+ # `detail` says why, so it is shown as is.
43
+ REFUSAL_CODES = {"nothing_to_restore", "reset_not_eligible", "resets_disabled", "no_reset_available"}
44
+
45
+ DISABLED_MESSAGE = "Usage resets aren't available on your account."
46
+ HISTORY_LIMIT = 10
47
+
48
+
49
+ def _label(mapping: dict[str, str], value: str | None) -> str:
50
+ return mapping.get(value or "", value or "")
51
+
52
+
53
+ def _day(value: str | None) -> str:
54
+ """An ISO timestamp as its calendar date; anything unparseable as is."""
55
+ if not value:
56
+ return ""
57
+ try:
58
+ return datetime.fromisoformat(value.replace("Z", "+00:00")).date().isoformat()
59
+ except ValueError:
60
+ return value
61
+
62
+
63
+ def _plural(n: int, word: str) -> str:
64
+ return f"{n} {word}" if n == 1 else f"{n} {word}s"
65
+
66
+
67
+ def _interactive() -> bool:
68
+ return sys.stdin.isatty()
69
+
70
+
71
+ def _render_resets(data: dict) -> None:
72
+ if not data.get("enabled"):
73
+ console.print(DISABLED_MESSAGE)
74
+ return
75
+
76
+ available = data.get("available") or []
77
+ console.print(f"\n[bold]Usage resets available:[/bold] [cyan]{len(available)}[/cyan]")
78
+ console.print(
79
+ "[dim]A reset refills your weekly credits to your plan's allotment "
80
+ "and restarts your 5-hour session.[/dim]"
81
+ )
82
+ if not data.get("eligible", True):
83
+ console.print("[yellow]Resets can't be spent on your current plan.[/yellow]")
84
+
85
+ if available:
86
+ table = Table(title="Available")
87
+ table.add_column("Reason")
88
+ table.add_column("Expires")
89
+ for reset in available:
90
+ table.add_row(_label(SOURCE_LABELS, reset.get("source")), _day(reset.get("expires_at")))
91
+ console.print(table)
92
+ if data.get("eligible", True):
93
+ console.print("Spend one with: [bold]tl resets use[/bold]")
94
+
95
+ history = data.get("history") or []
96
+ if history:
97
+ table = Table(title="Recent history")
98
+ table.add_column("Reason")
99
+ table.add_column("Status")
100
+ table.add_column("Granted")
101
+ table.add_column("Used / expires")
102
+ for reset in history[:HISTORY_LIMIT]:
103
+ when = reset.get("used_at") if reset.get("status") == "used" else reset.get("expires_at")
104
+ table.add_row(
105
+ _label(SOURCE_LABELS, reset.get("source")),
106
+ _label(STATUS_LABELS, reset.get("status")),
107
+ _day(reset.get("granted_at")),
108
+ _day(when),
109
+ )
110
+ console.print(table)
111
+
112
+ link = data.get("referral_link")
113
+ if link:
114
+ console.print(
115
+ "\nInvite a friend outside your organization. "
116
+ f"You'll get a free reset when they join: {escape(link)}"
117
+ )
118
+ bonus = data.get("bonus_resets")
119
+ if bonus:
120
+ console.print(
121
+ f"[dim]You get {_plural(bonus, 'more reset')} when their organization "
122
+ "makes its first proposal or payment.[/dim]"
123
+ )
124
+
125
+ referrals = data.get("referrals") or {}
126
+ made = referrals.get("made") or 0
127
+ valid = referrals.get("valid") or 0
128
+ if made:
129
+ console.print(f"{_plural(made, 'user')} signed up with your link")
130
+ if valid:
131
+ console.print(f"{_plural(valid, 'user')} earned you a reset")
132
+
133
+ expiry_days = data.get("expiry_days")
134
+ if expiry_days:
135
+ console.print(f"[dim]Resets expire {expiry_days} days after they're granted.[/dim]")
136
+
137
+
138
+ def _render_use(result: dict) -> None:
139
+ console.print("[green]Usage reset spent.[/green]")
140
+ console.print(
141
+ f"Weekly credits: {result.get('weekly_before')} → "
142
+ f"[cyan]{result.get('weekly_after')}[/cyan] credits"
143
+ )
144
+ if result.get("session_reanchored"):
145
+ console.print("Your 5-hour session restarted.")
146
+ left = result.get("available")
147
+ if left is not None:
148
+ console.print(f"Resets left: [cyan]{left}[/cyan]")
149
+
150
+
151
+ @app.callback(invoke_without_command=True)
152
+ def resets(
153
+ ctx: typer.Context,
154
+ json_output: bool = typer.Option(False, "--json", help="JSON output"),
155
+ ) -> None:
156
+ """Show your usage resets, your invite link and referrals (free, no credits).
157
+
158
+ Examples:
159
+ tl resets
160
+ tl resets --json
161
+ tl resets use
162
+ """
163
+ if ctx.invoked_subcommand is not None:
164
+ return
165
+
166
+ fmt = detect_format(json_output, False, False)
167
+ client = get_client()
168
+ try:
169
+ data = client.get("/resets")
170
+ except ApiError as e:
171
+ handle_api_error(e)
172
+ return
173
+ finally:
174
+ client.close()
175
+
176
+ if fmt == "json":
177
+ print(json.dumps(data, indent=2, default=str))
178
+ return
179
+ _render_resets(data)
180
+
181
+
182
+ @app.command("use")
183
+ def use_cmd(
184
+ yes: bool = typer.Option(False, "--yes", "-y", help="Spend without asking for confirmation"),
185
+ json_output: bool = typer.Option(False, "--json", help="JSON output"),
186
+ ) -> None:
187
+ """Spend one usage reset (the one that expires first).
188
+
189
+ Refills your weekly credits to your plan's allotment and restarts your
190
+ 5-hour session. Asks for confirmation unless --yes is passed or the
191
+ session isn't interactive.
192
+
193
+ Examples:
194
+ tl resets use
195
+ tl resets use --yes --json
196
+ """
197
+ fmt = detect_format(json_output, False, False)
198
+ if not yes and _interactive():
199
+ if not typer.confirm(
200
+ "Spend one usage reset? It refills your weekly credits and restarts your 5-hour session.",
201
+ err=True,
202
+ ):
203
+ err.print("No reset spent.")
204
+ raise typer.Exit(1)
205
+
206
+ client = get_client()
207
+ try:
208
+ result = client.post("/resets/use")
209
+ except ApiError as e:
210
+ code = e.raw.get("code") if isinstance(e.raw, dict) else None
211
+ if code in REFUSAL_CODES:
212
+ err.print(f"[yellow]{escape(e.detail)}[/yellow]")
213
+ raise typer.Exit(5 if e.status_code == 403 else 1)
214
+ handle_api_error(e)
215
+ return
216
+ finally:
217
+ client.close()
218
+
219
+ if fmt == "json":
220
+ print(json.dumps(result, indent=2, default=str))
221
+ return
222
+ _render_use(result)
@@ -30,6 +30,7 @@ from tl_cli.commands.profiles import app as profiles_app
30
30
  from tl_cli.commands.proposals import app as proposals_app
31
31
  from tl_cli.commands.recommender import app as recommender_app
32
32
  from tl_cli.commands.reports import app as reports_app
33
+ from tl_cli.commands.resets import app as resets_app
33
34
  from tl_cli.commands.schema import app as schema_app
34
35
  from tl_cli.commands.setup import app as setup_app
35
36
  from tl_cli.commands.skills import app as skills_app
@@ -124,6 +125,7 @@ app.add_typer(describe_app, name="describe")
124
125
  app.add_typer(schema_app, name="schema")
125
126
  app.add_typer(balance_app, name="balance")
126
127
  app.add_typer(credits_app, name="credits")
128
+ app.add_typer(resets_app, name="resets")
127
129
  app.add_typer(doctor_app, name="doctor")
128
130
  app.add_typer(whoami_app, name="whoami")
129
131
  app.add_typer(agent_app, name="agent")
@@ -0,0 +1,222 @@
1
+ """Tests for `tl resets` and the usage-reset hint on credit/session refusals.
2
+
3
+ Spending a reset is always the user's explicit choice: `tl resets use` asks
4
+ first, and a refusal only names the command, never spends one.
5
+ """
6
+
7
+ from unittest.mock import patch
8
+
9
+ import pytest
10
+ from typer.testing import CliRunner
11
+
12
+ from tl_cli.client.errors import ApiError, handle_api_error
13
+ from tl_cli.commands import resets as resets_mod
14
+ from tl_cli.commands.resets import app as resets_app
15
+
16
+ runner = CliRunner()
17
+
18
+
19
+ class _FakeClient:
20
+ def __init__(self, get_payload: dict | None = None, post_result: dict | Exception | None = None) -> None:
21
+ self.get_payload = get_payload or {}
22
+ self.post_result = post_result
23
+ self.calls: list[tuple[str, str]] = []
24
+
25
+ def get(self, path: str, params: dict | None = None) -> dict:
26
+ self.calls.append(("GET", path))
27
+ return self.get_payload
28
+
29
+ def post(self, path: str, json_body: dict | None = None) -> dict:
30
+ self.calls.append(("POST", path))
31
+ if isinstance(self.post_result, Exception):
32
+ raise self.post_result
33
+ return self.post_result or {}
34
+
35
+ def close(self) -> None:
36
+ pass
37
+
38
+
39
+ def _resets_payload(**overrides) -> dict:
40
+ data = {
41
+ "enabled": True,
42
+ "eligible": True,
43
+ "bonus_resets": 3,
44
+ "expiry_days": 90,
45
+ "available": [
46
+ {"id": 1, "source": "welcome", "granted_at": "2026-10-01T10:00:00Z", "expires_at": "2026-12-30T10:00:00Z"},
47
+ {"id": 2, "source": "referral_bonus", "granted_at": "2026-10-20T10:00:00Z", "expires_at": "2027-01-18T10:00:00Z"},
48
+ ],
49
+ "history": [
50
+ {"id": 3, "source": "referral_signup", "status": "used", "granted_at": "2026-09-01T10:00:00Z",
51
+ "expires_at": "2026-11-30T10:00:00Z", "used_at": "2026-09-15T10:00:00Z"},
52
+ {"id": 4, "source": "admin_grant", "status": "capped", "granted_at": "2026-08-01T10:00:00Z",
53
+ "expires_at": "2026-10-30T10:00:00Z", "used_at": None},
54
+ ],
55
+ "referral_link": "https://app.thoughtleaders.io/r/abc123",
56
+ "referrals": {"made": 4, "valid": 1},
57
+ }
58
+ data.update(overrides)
59
+ return data
60
+
61
+
62
+ def _flat(text: str) -> str:
63
+ return " ".join(text.split())
64
+
65
+
66
+ class TestResetsList:
67
+ def test_renders_available_history_link_and_referrals(self, capsys):
68
+ resets_mod._render_resets(_resets_payload())
69
+ out = _flat(capsys.readouterr().out)
70
+ assert "Usage resets available: 2" in out
71
+ assert "Gift from ThoughtLeaders" in out
72
+ assert "Your invitee's first proposal or payment" in out
73
+ assert "2026-12-30" in out
74
+ assert "Your invite was accepted" in out
75
+ assert "Used" in out and "2026-09-15" in out
76
+ assert "Added by support" in out and "Over the limit" in out
77
+ assert ("Invite a friend outside your organization. You'll get a free reset when they join: "
78
+ "https://app.thoughtleaders.io/r/abc123") in out
79
+ assert "4 users signed up with your link" in out
80
+ assert "1 user earned you a reset" in out
81
+ assert "tl resets use" in out
82
+ assert "cr " not in out
83
+
84
+ def test_zero_referral_counts_are_left_out(self, capsys):
85
+ resets_mod._render_resets(_resets_payload(referrals={"made": 2, "valid": 0}))
86
+ out = _flat(capsys.readouterr().out)
87
+ assert "2 users signed up with your link" in out
88
+ assert "earned you a reset" not in out
89
+
90
+ def test_disabled_prints_one_line(self, capsys):
91
+ resets_mod._render_resets({"enabled": False})
92
+ out = capsys.readouterr().out.strip()
93
+ assert out == resets_mod.DISABLED_MESSAGE
94
+
95
+ def test_ineligible_plan_says_so_and_does_not_suggest_spending(self, capsys):
96
+ resets_mod._render_resets(_resets_payload(eligible=False))
97
+ out = _flat(capsys.readouterr().out)
98
+ assert "can't be spent on your current plan" in out
99
+ assert "Spend one with" not in out
100
+
101
+ def test_json_prints_the_response(self):
102
+ fake = _FakeClient(get_payload=_resets_payload())
103
+ with patch.object(resets_mod, "get_client", return_value=fake):
104
+ result = runner.invoke(resets_app, ["--json"])
105
+ assert result.exit_code == 0, result.output
106
+ assert '"referral_link": "https://app.thoughtleaders.io/r/abc123"' in result.output
107
+ assert fake.calls == [("GET", "/resets")]
108
+
109
+
110
+ USE_RESULT = {
111
+ "weekly_before": "12.50",
112
+ "weekly_after": "1000.00",
113
+ "debt_repaid": "0",
114
+ "session_reanchored": True,
115
+ "available": 1,
116
+ }
117
+
118
+
119
+ class TestResetsUse:
120
+ def test_yes_spends_without_asking(self):
121
+ fake = _FakeClient(post_result=USE_RESULT)
122
+ with patch.object(resets_mod, "get_client", return_value=fake), \
123
+ patch.object(resets_mod, "_interactive", return_value=True), \
124
+ patch.object(resets_mod, "detect_format", return_value="table"):
125
+ result = runner.invoke(resets_app, ["use", "--yes"])
126
+ assert result.exit_code == 0, result.output
127
+ assert fake.calls == [("POST", "/resets/use")]
128
+ out = _flat(result.output)
129
+ assert "12.50 → 1000.00 credits" in out
130
+ assert "5-hour session restarted" in out
131
+ assert "Resets left: 1" in out
132
+
133
+ def test_interactive_session_asks_and_declining_spends_nothing(self):
134
+ fake = _FakeClient(post_result=USE_RESULT)
135
+ with patch.object(resets_mod, "get_client", return_value=fake), \
136
+ patch.object(resets_mod, "_interactive", return_value=True):
137
+ result = runner.invoke(resets_app, ["use"], input="n\n")
138
+ assert result.exit_code == 1
139
+ assert fake.calls == []
140
+ assert "No reset spent" in result.output
141
+
142
+ def test_interactive_session_confirmed_spends(self):
143
+ fake = _FakeClient(post_result=USE_RESULT)
144
+ with patch.object(resets_mod, "get_client", return_value=fake), \
145
+ patch.object(resets_mod, "_interactive", return_value=True):
146
+ result = runner.invoke(resets_app, ["use", "--json"], input="y\n")
147
+ assert result.exit_code == 0, result.output
148
+ assert fake.calls == [("POST", "/resets/use")]
149
+
150
+ def test_non_interactive_session_does_not_ask(self):
151
+ fake = _FakeClient(post_result=USE_RESULT)
152
+ with patch.object(resets_mod, "get_client", return_value=fake), \
153
+ patch.object(resets_mod, "_interactive", return_value=False):
154
+ result = runner.invoke(resets_app, ["use", "--json"])
155
+ assert result.exit_code == 0, result.output
156
+ assert '"weekly_after": "1000.00"' in result.output
157
+
158
+ @pytest.mark.parametrize(
159
+ ("status", "code", "exit_code"),
160
+ [
161
+ (400, "nothing_to_restore", 1),
162
+ (403, "reset_not_eligible", 5),
163
+ (403, "resets_disabled", 5),
164
+ (409, "no_reset_available", 1),
165
+ ],
166
+ )
167
+ def test_refusals_show_their_detail(self, status, code, exit_code):
168
+ detail = f"Refused because {code}."
169
+ error = ApiError(status, detail, raw={"code": code, "detail": detail})
170
+ fake = _FakeClient(post_result=error)
171
+ with patch.object(resets_mod, "get_client", return_value=fake):
172
+ result = runner.invoke(resets_app, ["use", "--yes"])
173
+ assert result.exit_code == exit_code
174
+ assert detail in _flat(result.output)
175
+ assert "Error (" not in result.output
176
+ assert "Access denied" not in result.output
177
+
178
+
179
+ def _render_error(error: ApiError, capsys, code: int) -> str:
180
+ with pytest.raises(SystemExit) as exc:
181
+ handle_api_error(error)
182
+ assert exc.value.code == code
183
+ return _flat(capsys.readouterr().err)
184
+
185
+
186
+ class TestRefusalHint:
187
+ def test_402_with_resets_names_the_command(self, capsys):
188
+ raw = {"detail": "Out of credits.", "code": "insufficient_credits",
189
+ "_billing_resets_available": 2, "_billing_reset_url": "/api/cli/v1/resets/use"}
190
+ out = _render_error(ApiError(402, "Out of credits.", raw=raw), capsys, code=4)
191
+ assert "You have 2 usage resets. Spend one with: tl resets use" in out
192
+
193
+ def test_429_with_one_reset(self, capsys):
194
+ raw = {"detail": "Session limit reached.", "code": "quota_exhausted", "_billing_resets_available": 1}
195
+ out = _render_error(ApiError(429, "Session limit reached.", raw=raw), capsys, code=3)
196
+ assert "You have 1 usage reset. Spend one with: tl resets use" in out
197
+
198
+ @pytest.mark.parametrize("status,code", [(402, 4), (429, 3)])
199
+ def test_invite_link_follows_the_reset_offer(self, capsys, status, code):
200
+ raw = {"detail": "Refused.", "_billing_resets_available": 1,
201
+ "_billing_invite_link": "https://app.thoughtleaders.io/r/5jXOLpkmhx/",
202
+ "_billing_invite_url": "https://app.thoughtleaders.io/billing/?section=invite"}
203
+ out = _render_error(ApiError(status, "Refused.", raw=raw), capsys, code=code)
204
+ invite = ("Or invite a friend outside your organization. You'll get a free reset when they join: "
205
+ "https://app.thoughtleaders.io/r/5jXOLpkmhx/")
206
+ assert invite in out
207
+ assert out.index("tl resets use") < out.index(invite)
208
+ assert "section=invite" not in out
209
+
210
+ def test_no_invite_line_without_link(self, capsys):
211
+ raw = {"detail": "Out of credits.", "code": "insufficient_credits", "_billing_resets_available": 1}
212
+ out = _render_error(ApiError(402, "Out of credits.", raw=raw), capsys, code=4)
213
+ assert "invite a friend" not in out
214
+
215
+ @pytest.mark.parametrize("raw", [
216
+ {"detail": "Out of credits.", "code": "insufficient_credits"},
217
+ {"detail": "Out of credits.", "code": "insufficient_credits", "_billing_resets_available": 0},
218
+ None,
219
+ ])
220
+ def test_no_hint_without_resets(self, capsys, raw):
221
+ out = _render_error(ApiError(402, "Out of credits.", raw=raw), capsys, code=4)
222
+ assert "tl resets use" not in out
@@ -422,7 +422,7 @@ wheels = [
422
422
 
423
423
  [[package]]
424
424
  name = "thoughtleaders-cli"
425
- version = "0.9.24"
425
+ version = "0.9.25"
426
426
  source = { editable = "." }
427
427
  dependencies = [
428
428
  { name = "authlib" },