roksta 0.2.7__cp311-cp311-macosx_10_9_universal2.whl → 0.3.1__cp311-cp311-macosx_10_9_universal2.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.

Potentially problematic release.


This version of roksta might be problematic. Click here for more details.

Files changed (72) hide show
  1. roksta/ai/call_ai.cpython-311-darwin.so +0 -0
  2. roksta/ai/gemini.cpython-311-darwin.so +0 -0
  3. roksta/ai/generic.cpython-311-darwin.so +0 -0
  4. roksta/ai/llm.cpython-311-darwin.so +0 -0
  5. roksta/ai/openai.cpython-311-darwin.so +0 -0
  6. roksta/ai/tools/__init__.cpython-311-darwin.so +0 -0
  7. roksta/ai/tools/delete_file.cpython-311-darwin.so +0 -0
  8. roksta/ai/tools/edit_file.cpython-311-darwin.so +0 -0
  9. roksta/ai/tools/final_response.cpython-311-darwin.so +0 -0
  10. roksta/ai/tools/get_file_summaries.cpython-311-darwin.so +0 -0
  11. roksta/ai/tools/read_file.cpython-311-darwin.so +0 -0
  12. roksta/ai/tools/regex_replace.cpython-311-darwin.so +0 -0
  13. roksta/ai/tools/shell_any.cpython-311-darwin.so +0 -0
  14. roksta/ai/tools/shell_limited.cpython-311-darwin.so +0 -0
  15. roksta/ai/tools/tool_defs.cpython-311-darwin.so +0 -0
  16. roksta/ai/tools/tool_utils.cpython-311-darwin.so +0 -0
  17. roksta/ai/tools/write_file.cpython-311-darwin.so +0 -0
  18. roksta/balance.cpython-311-darwin.so +0 -0
  19. roksta/command_handlers/__init__.cpython-311-darwin.so +0 -0
  20. roksta/command_handlers/handle_activate_command.cpython-311-darwin.so +0 -0
  21. roksta/command_handlers/handle_add_funds_command.cpython-311-darwin.so +0 -0
  22. roksta/command_handlers/handle_auto_charge_command.cpython-311-darwin.so +0 -0
  23. roksta/command_handlers/handle_auto_commit_command.cpython-311-darwin.so +0 -0
  24. roksta/command_handlers/handle_building_command.cpython-311-darwin.so +0 -0
  25. roksta/command_handlers/handle_chat_command.cpython-311-darwin.so +0 -0
  26. roksta/command_handlers/handle_dev_rate_command.cpython-311-darwin.so +0 -0
  27. roksta/command_handlers/handle_feedback_command.cpython-311-darwin.so +0 -0
  28. roksta/command_handlers/handle_goal_command.cpython-311-darwin.so +0 -0
  29. roksta/command_handlers/handle_help_command.cpython-311-darwin.so +0 -0
  30. roksta/command_handlers/handle_init_command.cpython-311-darwin.so +0 -0
  31. roksta/command_handlers/handle_linting_command.cpython-311-darwin.so +0 -0
  32. roksta/command_handlers/handle_login_command.cpython-311-darwin.so +0 -0
  33. roksta/command_handlers/handle_logout_command.cpython-311-darwin.so +0 -0
  34. roksta/command_handlers/handle_payment_details_command.cpython-311-darwin.so +0 -0
  35. roksta/command_handlers/handle_quit_command.cpython-311-darwin.so +0 -0
  36. roksta/command_handlers/handle_redeem_command.cpython-311-darwin.so +0 -0
  37. roksta/command_handlers/handle_request_activation_command.cpython-311-darwin.so +0 -0
  38. roksta/command_handlers/handle_testing_command.cpython-311-darwin.so +0 -0
  39. roksta/command_handlers/handle_usage_command.cpython-311-darwin.so +0 -0
  40. roksta/env.cpython-311-darwin.so +0 -0
  41. roksta/extended_text_area.cpython-311-darwin.so +0 -0
  42. roksta/firebase.cpython-311-darwin.so +0 -0
  43. roksta/fix_tests.cpython-311-darwin.so +0 -0
  44. roksta/goal_workflow.cpython-311-darwin.so +0 -0
  45. roksta/lint_code.cpython-311-darwin.so +0 -0
  46. roksta/main.cpython-311-darwin.so +0 -0
  47. roksta/new_features.cpython-311-darwin.so +0 -0
  48. roksta/roksta.cpython-311-darwin.so +0 -0
  49. roksta/tips.cpython-311-darwin.so +0 -0
  50. roksta/utils.cpython-311-darwin.so +0 -0
  51. {roksta-0.2.7.dist-info → roksta-0.3.1.dist-info}/METADATA +2 -1
  52. roksta-0.3.1.dist-info/RECORD +109 -0
  53. tests/conftest.py +42 -0
  54. tests/functions/{api_v0_01 → api_v1_01}/__init__.py +1 -1
  55. tests/functions/{api_v0_01 → api_v1_01}/test__analytics.py +2 -3
  56. tests/functions/{api_v0_01 → api_v1_01}/test__gemini_proxy.py +51 -6
  57. tests/functions/{api_v0_01 → api_v1_01}/test__generic_proxy.py +31 -2
  58. tests/functions/{api_v0_01 → api_v1_01}/test__get_payment_details.py +2 -2
  59. tests/functions/{api_v0_01 → api_v1_01}/test__openai_proxy.py +50 -14
  60. tests/functions/{api_v0_01 → api_v1_01}/test__redeem_credit_code.py +2 -2
  61. tests/functions/{api_v0_01 → api_v1_01}/test__sync_emails.py +3 -2
  62. tests/functions/{api_v0_01 → api_v1_01}/test__take_payment.py +2 -2
  63. tests/functions/{api_v0_01 → api_v1_01}/test__use_activation_code.py +3 -2
  64. tests/functions/test_utils.py +484 -0
  65. roksta/ai/tools.cpython-311-darwin.so +0 -0
  66. roksta/command_handlers.cpython-311-darwin.so +0 -0
  67. roksta-0.2.7.dist-info/RECORD +0 -78
  68. tests/functions/test_utils_functions.py +0 -222
  69. {roksta-0.2.7.dist-info → roksta-0.3.1.dist-info}/WHEEL +0 -0
  70. {roksta-0.2.7.dist-info → roksta-0.3.1.dist-info}/entry_points.txt +0 -0
  71. {roksta-0.2.7.dist-info → roksta-0.3.1.dist-info}/top_level.txt +0 -0
  72. /tests/functions/{test_main_functions.py → test_main.py} +0 -0
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: roksta
3
- Version: 0.2.7
3
+ Version: 0.3.1
4
4
  Summary: An AI coding assistant
5
5
  Author-email: Prash Naidu <prash@roksta.ai>
6
6
  Project-URL: Homepage, https://roksta.ai
@@ -21,6 +21,7 @@ Requires-Dist: gitpython>=3.1.44
21
21
  Requires-Dist: jsonref>=1.1.0
22
22
  Requires-Dist: pathspec>=0.12.1
23
23
  Requires-Dist: psutil>=7.1.0
24
+ Requires-Dist: PyNaCl>=1.6.0
24
25
  Provides-Extra: tests
25
26
  Requires-Dist: pytest>=8.4.1; extra == "tests"
26
27
  Requires-Dist: pytest-asyncio>=1.0.0; extra == "tests"
@@ -0,0 +1,109 @@
1
+ roksta/logger.cpython-311-darwin.so,sha256=xch275vL4nC3HeSUxVdjTpnXmRXq2Jd1auVsd-a3bNs,122016
2
+ roksta/lint_code.cpython-311-darwin.so,sha256=E4X_z2f8hE7eL0fM1Yaky8CSd0tEN3tOrzW7AET7N8A,224432
3
+ roksta/get_codebase_structure.cpython-311-darwin.so,sha256=gFFoEJU2H9vJgmbRWjcqY2tSqc_7eUJPWIGTDgSQZk4,189984
4
+ roksta/checkpoints.cpython-311-darwin.so,sha256=4vZMS8o8V6fez18V-ln64U4tXsOBPqbGgLE7pyYhZkQ,238032
5
+ roksta/extended_text_area.cpython-311-darwin.so,sha256=hPsQ9DKb5Hqsl0QjVSZMvPc-DYkneWCOcUp7gN3BLNc,290904
6
+ roksta/firebase_config.cpython-311-darwin.so,sha256=BKPNge6g8lDyI4M6dAxXVasD1T-j9stNUT--pB-AGT8,86568
7
+ roksta/init_codebase.cpython-311-darwin.so,sha256=P9kuJXGfk4uk9VnGozUvnOyP66V0PZ4xbSS22N7i890,275024
8
+ roksta/gen_one_line_goal.cpython-311-darwin.so,sha256=LGggcZkhy9W8RTUIzj9vcACw0KZs7Big3_TpTXE3IZc,207560
9
+ roksta/new_features.cpython-311-darwin.so,sha256=NHg_J74tB0CkgwGNtDr0LYgXQEOpCZSh-NKcDVLXL4U,85632
10
+ roksta/chat_workflow.cpython-311-darwin.so,sha256=uQ4mon110StmmfbIALtZ9JOI76d6yIqOu_WUsxZLbgw,257232
11
+ roksta/select_files.cpython-311-darwin.so,sha256=Qbce978o2zTA1wLVw2pHtNvhJJWhhUGHRuC5C57H_XM,207600
12
+ roksta/parse_readme.cpython-311-darwin.so,sha256=2vXGMqTmmn9vm1twZkudrs4IXL6RTm0TYBcJwUlY0_E,207088
13
+ roksta/firebase.cpython-311-darwin.so,sha256=bsMQ26yMRkpO24ADGhxOWKShbjh2fpcrWJXpXGFJXRw,471616
14
+ roksta/goal_workflow.cpython-311-darwin.so,sha256=lLuivujF8JktdLw6SBEycsRa3obAF1pE9KrbwHYgn40,505312
15
+ roksta/tips.cpython-311-darwin.so,sha256=LM8AJ59as_bZMa2rFdMogsKfc6yIk9YaH-hs6HxAItA,85592
16
+ roksta/write_code.cpython-311-darwin.so,sha256=U_6AsReL8Kxv8TwuscxLySI4jL7dQa-rFgft7kLeYCQ,190944
17
+ roksta/enums.cpython-311-darwin.so,sha256=rGABZEs5M_6PDdxssR9-gwfDhqMoor9kOyoxf79VFnI,404232
18
+ roksta/analytics.cpython-311-darwin.so,sha256=lXYObBh_e8QiM7PQHipcKWtl5sD04ygEi71p2dvtc9k,256576
19
+ roksta/main.cpython-311-darwin.so,sha256=LFCeVyu9__bUV9SuSuHyvHvZb0NU95H2LyesUHHref0,122152
20
+ roksta/response_formats.cpython-311-darwin.so,sha256=BthAKv6MpQLL6SPni865ADEgw9VQwy-w1kgEEev-xGY,153928
21
+ roksta/check_for_updates.cpython-311-darwin.so,sha256=quPqiJn9zI5elA4bJ5l3u9x_o-tpzpTVkfq2meCAqNA,290200
22
+ roksta/utils.cpython-311-darwin.so,sha256=bwm3pRF1Mba2k-IjlLadSCEsu_vdMw22X49gtRy0oMU,588840
23
+ roksta/fix_tests.cpython-311-darwin.so,sha256=ubc0XdINbsNRkJMvit4ZdNV9F5M0ovWg3udsSUdxtOk,223984
24
+ roksta/firebase_auth_web.cpython-311-darwin.so,sha256=U51PxZ0Qocf5yE5WfMacrIC2VAvYqRxraf5DvKAeNfM,439656
25
+ roksta/env.cpython-311-darwin.so,sha256=oG0EODSUDwHXQXVh6VbnoYs9AxtI_Dm02Au4r2qC6yE,87992
26
+ roksta/get_failing_tests.cpython-311-darwin.so,sha256=1jvAcZKA8gsnsrq6-HNsro-rQkqesYZIi9nKhf8g5m8,207576
27
+ roksta/clarify_goal.cpython-311-darwin.so,sha256=9GRKv1QrjNCoulhg7BxAMwKItzLaI1XGcADo0lFCaYY,207616
28
+ roksta/roksta.cpython-311-darwin.so,sha256=2biHt294CjfIxKDT8mQ69jXTtADaCg_JGQO75LimWq4,555120
29
+ roksta/build_project.cpython-311-darwin.so,sha256=vUvI_82FBp5at73GbjzytM40VdyuxNrMSoy-TF0_hW0,190992
30
+ roksta/rewrite_goal.cpython-311-darwin.so,sha256=Ef34h7nGUNKgGcRQY2EKLKkSrcNLKp4xzKE9JTmg6QY,174512
31
+ roksta/run_cli_goal.cpython-311-darwin.so,sha256=mIDRX9GJIZUYock-CE_VUBvR-zLvYAkXQRCCdMUXlU4,207120
32
+ roksta/codebase_listing.cpython-311-darwin.so,sha256=yqwkwIMP3MKag60iU2LEYWt36jCXgjmnFL7UuKiUUaQ,155656
33
+ roksta/default_config.cpython-311-darwin.so,sha256=okjKjvIXlHp_m_82TZIFdMT9fgEAfr1R3EodQhIX564,102152
34
+ roksta/__init__.cpython-311-darwin.so,sha256=0ErvE_Ab31A1ApkmxEhfJuljCTrEA6VccImUD3_9z8U,85488
35
+ roksta/create_default_config.cpython-311-darwin.so,sha256=6XuYR51E9xZ54eSdTRZzlsN1ywGP5EuVUTHnC6L0ljU,121672
36
+ roksta/make_issue.cpython-311-darwin.so,sha256=sPSYITShHG4HpdqDow8XbLhADJ-as4J4Jl_bviKOx0Q,222064
37
+ roksta/propose_solution.cpython-311-darwin.so,sha256=wCKK0fp40j_ewRIzxF1PYqmUGkE3i4iGnp6tTB0A9Vc,190920
38
+ roksta/balance.cpython-311-darwin.so,sha256=VtXA6plincv8iIgiqYjhEsKf5n8egbt3EeZDujzfejs,389536
39
+ roksta/gen_codebase_summaries.cpython-311-darwin.so,sha256=KYIPW6UaQV_XJEMttZHuUCyyHlPAQDVOvZwMNr2SIzg,621328
40
+ roksta/command_handlers/handle_goal_command.cpython-311-darwin.so,sha256=HKsEAcRKIzeOXsQh_ELLIlO1Tn87rn6Iztd2OP0PWi8,157080
41
+ roksta/command_handlers/handle_quit_command.cpython-311-darwin.so,sha256=fR56AJ2gJf8J7mg0LBfQxNez-MLn8nJuVlIW86OyW94,87480
42
+ roksta/command_handlers/handle_payment_details_command.cpython-311-darwin.so,sha256=7feybmTcI2KUbH0xiKDjxgOMlRnTZC7cTUuwgBcOOOE,173464
43
+ roksta/command_handlers/handle_request_activation_command.cpython-311-darwin.so,sha256=tnoUINf47lvZzBRziVlv0gHPQFzXKEdwDoFt9KbRsYw,206920
44
+ roksta/command_handlers/handle_feedback_command.cpython-311-darwin.so,sha256=plXKfXFR9EgR0IZ4RtphZPrGtHEyrdnCG1DIE6xNAQc,190240
45
+ roksta/command_handlers/handle_testing_command.cpython-311-darwin.so,sha256=OA5q7Osrk8MGb-ChQhWto_pHkZ5JTMfIv9K_YqB1RKk,156016
46
+ roksta/command_handlers/handle_chat_command.cpython-311-darwin.so,sha256=3_QJ4Iz4-nudRDMYWzhi7mnujrakmQ-8Rbv4Hcs1jt0,156632
47
+ roksta/command_handlers/handle_init_command.cpython-311-darwin.so,sha256=KeaaNZ35JHAobBKZADxk-KpOLcX7lqOF7wvPHyDIliU,157064
48
+ roksta/command_handlers/handle_activate_command.cpython-311-darwin.so,sha256=b6KTsnjifBgDajxnHFHhkXgnmpYzWz2AT_ZgbWsJ1EE,240256
49
+ roksta/command_handlers/handle_login_command.cpython-311-darwin.so,sha256=IpbeFewFpDfP1lnOGSmj7hHLNx0WG5JrSLymbLamQ3U,207032
50
+ roksta/command_handlers/handle_dev_rate_command.cpython-311-darwin.so,sha256=E6qpsG_dxh9MzqPfZRHMz90r-LJxt949Ydlrrj07eKE,123008
51
+ roksta/command_handlers/handle_linting_command.cpython-311-darwin.so,sha256=pPyN7t7NExmPLRfwbI5xp2zMyqT33e-HI1JVZq_ETbs,156016
52
+ roksta/command_handlers/handle_help_command.cpython-311-darwin.so,sha256=TT9unIC2ecyomkRAZjg0W8WZOEVsrMXJaDoruBz0xOc,253160
53
+ roksta/command_handlers/handle_auto_commit_command.cpython-311-darwin.so,sha256=0oLYqO33_ofrl_MhLl3DKGqU8CJinhnMMWBtUrG4yu0,122528
54
+ roksta/command_handlers/handle_add_funds_command.cpython-311-darwin.so,sha256=bzmPLTlKyg39Zb4XDdFsKOo6U13frwqIKtTyP-DVauc,207792
55
+ roksta/command_handlers/__init__.cpython-311-darwin.so,sha256=g0IaXlbYKxBp04YtfYnncYV7NczDDSuBFqLDWnNGXcg,86176
56
+ roksta/command_handlers/handle_logout_command.cpython-311-darwin.so,sha256=DusVzoMddXp1AdlDnaTlE9KsquuQnqymA7_sDZXvrwA,121608
57
+ roksta/command_handlers/handle_auto_charge_command.cpython-311-darwin.so,sha256=dtim1-R2jM56qfBmHolpsAWddYnUgFvRHmoYEzttgIM,156480
58
+ roksta/command_handlers/handle_usage_command.cpython-311-darwin.so,sha256=UeAh5EgYp0WJHTlOky66CRm1F09-nq3r80HgMDaKe4U,207880
59
+ roksta/command_handlers/handle_redeem_command.cpython-311-darwin.so,sha256=hDiLfcQiSSn4P8gZmZWGTW1LtQtbsim-VvJmi8SeluE,157592
60
+ roksta/command_handlers/handle_building_command.cpython-311-darwin.so,sha256=7eYIDWjEeJ_zq-uMENmQfFJFW0mz-lGtDtCzb6YkB8s,156016
61
+ roksta/ai/openai.cpython-311-darwin.so,sha256=KenHrHkUb1R3-XQnzui6dWIOqObeITzx95e2m_LYbm0,290352
62
+ roksta/ai/call_ai.cpython-311-darwin.so,sha256=B3n-xiMlSb_QWeBCZm27fbWsFJGxKfJ9D7JuMCd5B84,224048
63
+ roksta/ai/llm.cpython-311-darwin.so,sha256=T4egotoBbjHDoJybP0hb4uISN3etJhoNMaedj9Ypk6c,288232
64
+ roksta/ai/gemini.cpython-311-darwin.so,sha256=Lpe8zqa9psk7tHnSM1aqm69m0wm7SJyOg66hDIp3tfw,389600
65
+ roksta/ai/generic.cpython-311-darwin.so,sha256=WHnoku2qYaOZh3zv17qbxOAYa6xsnL6jdxSkJh6wdHU,290368
66
+ roksta/ai/__init__.cpython-311-darwin.so,sha256=dpXQ14GwJxUat0fxONmbamSbzHo2JsnZHVeNP3LY_No,85488
67
+ roksta/ai/tools/edit_file.cpython-311-darwin.so,sha256=H5ZTyxRy-oFpeWo9-QDIQAbBk06i-m6vPLWOvuqjq2U,155200
68
+ roksta/ai/tools/get_file_summaries.cpython-311-darwin.so,sha256=nN5pffyj9VHidsVG5_MtNRGVRJp7ZVg9sEORiddXrts,122712
69
+ roksta/ai/tools/shell_limited.cpython-311-darwin.so,sha256=XsZPLlEpjhpinJ-XTPzHJjLq7wTgG1slUX3em_Y3SBg,190640
70
+ roksta/ai/tools/regex_replace.cpython-311-darwin.so,sha256=nMap5bNM9LvEZ1i-4S0BoDd39CE2qGE0LwZyeYYaUNA,155552
71
+ roksta/ai/tools/shell_any.cpython-311-darwin.so,sha256=9I7orZwYxgOpSb4aeouYLvj_4ElixKcIRPxIQEr3yBA,223856
72
+ roksta/ai/tools/delete_file.cpython-311-darwin.so,sha256=1oWbFE966dhN8GswvNY9JdlzSQvK1NpUMKPZ7T2MgyY,122032
73
+ roksta/ai/tools/write_file.cpython-311-darwin.so,sha256=4xI09Qe0V1DzhiEBbNjq-2KSl5myTa4SYVZigJqSM7s,122112
74
+ roksta/ai/tools/read_file.cpython-311-darwin.so,sha256=Ti2F5s7kOk67Y5gw5Ruz58NhjpL2sjtDVuJXgK1nt18,155792
75
+ roksta/ai/tools/tool_utils.cpython-311-darwin.so,sha256=nnESmKl1_OY3hVapfUBKonVKPv45ImqMhH9ggmYX0-w,291136
76
+ roksta/ai/tools/tool_defs.cpython-311-darwin.so,sha256=riq3T4XRoxIFOAVmbtojuCr3yA3lcybhhIIY1a3RigM,137440
77
+ roksta/ai/tools/__init__.cpython-311-darwin.so,sha256=730VwpSAsKw6iIZ-uK8Uy5jEatE6Db1TJ1yoGi_36VQ,87216
78
+ roksta/ai/tools/final_response.cpython-311-darwin.so,sha256=nutHi0A1M1C8csSCZsKsKrYMqq3xjcFt9B97rl6Iml0,88024
79
+ tests/conftest.py,sha256=Y2cx3Jups9GkKGxOG2fSSoIr3rgfUa9QzipMoQ-ehKU,7878
80
+ tests/__init__.py,sha256=J6ztnXNqM8TSQCgHXMWb6NRq1kN_h4ql63Jq-TYR8XE,124
81
+ tests/functions/test_utils.py,sha256=_zlgSa99JYVyJ0LDe3yaPztS92kqGRKkgjon__XmfFM,16721
82
+ tests/functions/test_auth.py,sha256=I3oFTw2LTuUsnQ75v5SCfgUPnpel_pDKqUH0VAJpXQw,992
83
+ tests/functions/__init__.py,sha256=mLXx3UARcv07vs_fGJuy3L5ZRn9IRsF9zIuL5IOnwdk,95
84
+ tests/functions/test_main.py,sha256=h0W_4ISo95WzRy2HpXZw3cuNOTcYk_2QCIZffZJEfEU,2575
85
+ tests/functions/api_v1_01/test__sync_emails.py,sha256=OTyf2YbBK7e4pWIQTUGYR4x6il1Hb3g4FYqQ_fRj1nA,12699
86
+ tests/functions/api_v1_01/test__take_payment.py,sha256=I-XJasGuLW5wTMAu4nAgFkA8Mo_zVpGPvkJ2LrrJGCk,18022
87
+ tests/functions/api_v1_01/test__gemini_proxy.py,sha256=mf8ubRmNxxxN80H6EA-iDPwu6Oue6Rmgxl6tiFNpfrU,13344
88
+ tests/functions/api_v1_01/test__analytics.py,sha256=oKjd7_zjnttcb-5BuA93yllkm0OOF4YWnfTUW1-icnM,15806
89
+ tests/functions/api_v1_01/__init__.py,sha256=3RCSoj_5UQPw9Z5NeAgYz2s4gfcZIi7g36qk_Ed5TiA,124
90
+ tests/functions/api_v1_01/test__use_activation_code.py,sha256=tNyTkkRtrpjei-7F31UNwrcU-PbP-QnkWNU7h2n5Yqo,16960
91
+ tests/functions/api_v1_01/test__redeem_credit_code.py,sha256=7GD3tGgO2Lk0BCjUmzZACJiwocEhLBvXrrut0x13IWU,6347
92
+ tests/functions/api_v1_01/test__openai_proxy.py,sha256=xlO2zmG64LlrKrbjFz-ds6Map7vy4SjIuHfZJDAqGK8,17726
93
+ tests/functions/api_v1_01/test__get_payment_details.py,sha256=i5Px3NkLxqw8D3tVPrYdRJJF5jlNmysSuX_NNolbIa4,13735
94
+ tests/functions/api_v1_01/test__generic_proxy.py,sha256=KZkOtmc71aOnWlz2L7B6CFhRNEV73bExG3GR14oD2L0,17673
95
+ tests/functions/api_v1_00/test__sync_emails.py,sha256=OTyf2YbBK7e4pWIQTUGYR4x6il1Hb3g4FYqQ_fRj1nA,12699
96
+ tests/functions/api_v1_00/test__take_payment.py,sha256=I-XJasGuLW5wTMAu4nAgFkA8Mo_zVpGPvkJ2LrrJGCk,18022
97
+ tests/functions/api_v1_00/test__gemini_proxy.py,sha256=mf8ubRmNxxxN80H6EA-iDPwu6Oue6Rmgxl6tiFNpfrU,13344
98
+ tests/functions/api_v1_00/test__analytics.py,sha256=oKjd7_zjnttcb-5BuA93yllkm0OOF4YWnfTUW1-icnM,15806
99
+ tests/functions/api_v1_00/__init__.py,sha256=3RCSoj_5UQPw9Z5NeAgYz2s4gfcZIi7g36qk_Ed5TiA,124
100
+ tests/functions/api_v1_00/test__use_activation_code.py,sha256=tNyTkkRtrpjei-7F31UNwrcU-PbP-QnkWNU7h2n5Yqo,16960
101
+ tests/functions/api_v1_00/test__redeem_credit_code.py,sha256=7GD3tGgO2Lk0BCjUmzZACJiwocEhLBvXrrut0x13IWU,6347
102
+ tests/functions/api_v1_00/test__openai_proxy.py,sha256=xlO2zmG64LlrKrbjFz-ds6Map7vy4SjIuHfZJDAqGK8,17726
103
+ tests/functions/api_v1_00/test__get_payment_details.py,sha256=i5Px3NkLxqw8D3tVPrYdRJJF5jlNmysSuX_NNolbIa4,13735
104
+ tests/functions/api_v1_00/test__generic_proxy.py,sha256=KZkOtmc71aOnWlz2L7B6CFhRNEV73bExG3GR14oD2L0,17673
105
+ roksta-0.3.1.dist-info/RECORD,,
106
+ roksta-0.3.1.dist-info/WHEEL,sha256=VWNc5NH4DDoQDkc74R-nMZPza3RGJ6ac2abjVbvC-0k,141
107
+ roksta-0.3.1.dist-info/entry_points.txt,sha256=mzRdYg_DlzZRwjxYUt9-gyoRCkM1QBTeTbwETgiTdGw,44
108
+ roksta-0.3.1.dist-info/top_level.txt,sha256=lvciNZQ1dPGXpiCLdWVXK03n9fKHjbQdwjqQbnUjeYM,13
109
+ roksta-0.3.1.dist-info/METADATA,sha256=l3i3WQqIWKNwBVYQ1Eaw_1pZfMrIxEqQWipD2s_xId0,1456
tests/conftest.py CHANGED
@@ -167,3 +167,45 @@ except Exception:
167
167
  _attach_gtypes_stubs(gtypes)
168
168
  genai.types = gtypes
169
169
  sys.modules['google.genai.types'] = gtypes
170
+
171
+ # Provide a minimal nacl.public stub if PyNaCl is not installed. This prevents
172
+ # import-time failures in tests that import `roksta.firebase` which does
173
+ # `from nacl.public import PublicKey, SealedBox`.
174
+ try:
175
+ import nacl.public # type: ignore
176
+ except Exception:
177
+ # Create lightweight stub modules to satisfy `from nacl.public import PublicKey, SealedBox`
178
+ nacl = _types_mod.ModuleType('nacl')
179
+ nacl_public = _types_mod.ModuleType('nacl.public')
180
+
181
+ class PublicKey:
182
+ def __init__(self, data):
183
+ # Accept bytes-like input; ensure it's bytes when possible.
184
+ try:
185
+ self._data = bytes(data)
186
+ except Exception:
187
+ self._data = data
188
+
189
+ def __repr__(self):
190
+ try:
191
+ length = len(self._data)
192
+ except Exception:
193
+ length = 'unknown'
194
+ return f"<PublicKey len={length}>"
195
+
196
+ class SealedBox:
197
+ def __init__(self, public_key):
198
+ self.public_key = public_key
199
+
200
+ def encrypt(self, plaintext: bytes) -> bytes:
201
+ # Return deterministic bytes so callers can base64-encode the result.
202
+ if not isinstance(plaintext, (bytes, bytearray)):
203
+ plaintext = str(plaintext).encode('utf-8')
204
+ return b"STUB_ENCRYPTED:" + bytes(plaintext)
205
+
206
+ nacl_public.PublicKey = PublicKey
207
+ nacl_public.SealedBox = SealedBox
208
+ # Attach the submodule on the parent module object for attribute access
209
+ nacl.public = nacl_public
210
+ sys.modules['nacl'] = nacl
211
+ sys.modules['nacl.public'] = nacl_public
@@ -1,2 +1,2 @@
1
- # tests.functions.api_v0_01 package marker
1
+ # tests.functions.api_v1_00 package marker
2
2
  # Allows tests under this directory to be imported with package-qualified names.
@@ -176,12 +176,11 @@ sys.modules['httpx'] = httpx_mod
176
176
  # -----------------------------
177
177
  repo_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..'))
178
178
  functions_root = os.path.join(repo_root, 'functions')
179
- module_path = os.path.join(functions_root, 'api_v0_01', '_analytics.py')
180
- spec = importlib.util.spec_from_file_location('api_v0_01._analytics', module_path)
179
+ module_path = os.path.join(functions_root, 'api_v1_00', '_analytics.py')
180
+ spec = importlib.util.spec_from_file_location('api_v1_00._analytics', module_path)
181
181
  _analytics = importlib.util.module_from_spec(spec)
182
182
  spec.loader.exec_module(_analytics)
183
183
 
184
-
185
184
  # Restore original sys.modules mappings to avoid side-effects for other tests
186
185
  for name, orig in _orig_sys_modules.items():
187
186
  if orig is None:
@@ -19,6 +19,8 @@ if FUNCTIONS_DIR not in sys.path:
19
19
  _orig_sys_modules = {}
20
20
  _names_to_fake = [
21
21
  'firebase_functions',
22
+ 'firebase_admin',
23
+ 'firebase_admin.firestore',
22
24
  'utils',
23
25
  'auth',
24
26
  'google',
@@ -49,6 +51,35 @@ class FakeResponse:
49
51
  firebase_functions.https_fn = types.SimpleNamespace(Request=object, Response=FakeResponse)
50
52
  sys.modules['firebase_functions'] = firebase_functions
51
53
 
54
+ # Fake firebase_admin and its firestore submodule to satisfy optional imports in the proxy
55
+ firebase_admin = types.ModuleType('firebase_admin')
56
+ firestore_mod = types.ModuleType('firebase_admin.firestore')
57
+
58
+ # Minimal Client type for annotations and a no-op client() factory
59
+ class _DummyClient: # pragma: no cover - just a stub for import-time type hints
60
+ pass
61
+
62
+ def _dummy_client():
63
+ # Return a simple object; logic using it is patched in tests
64
+ return types.SimpleNamespace()
65
+
66
+ # Decorator stub used by perform_atomic_debit; never actually invoked in tests
67
+ def _transactional(fn=None):
68
+ def wrapper(*args, **kwargs):
69
+ return fn(*args, **kwargs)
70
+ return wrapper
71
+
72
+ # Populate stubs on the firestore module
73
+ setattr(firestore_mod, 'Client', _DummyClient)
74
+ setattr(firestore_mod, 'client', _dummy_client)
75
+ setattr(firestore_mod, 'transactional', _transactional)
76
+ setattr(firestore_mod, 'SERVER_TIMESTAMP', object())
77
+
78
+ # Attach firestore submodule to firebase_admin package and register in sys.modules
79
+ setattr(firebase_admin, 'firestore', firestore_mod)
80
+ sys.modules['firebase_admin'] = firebase_admin
81
+ sys.modules['firebase_admin.firestore'] = firestore_mod
82
+
52
83
  # Fake utils module (provides functions imported by _gemini_proxy)
53
84
  utils_mod = types.ModuleType('utils')
54
85
 
@@ -118,14 +149,14 @@ sys.modules['google.genai'] = genai_mod
118
149
  sys.modules['google.genai.types'] = types_mod
119
150
 
120
151
  # Import the module under test after preparing the fake imports
152
+ # Resolve the actual repository 'functions' directory (tests files live under tests/, so climb up to repo root)
121
153
  repo_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..'))
122
154
  functions_root = os.path.join(repo_root, 'functions')
123
- module_path = os.path.join(functions_root, 'api_v0_01', '_gemini_proxy.py')
124
- spec = importlib.util.spec_from_file_location('api_v0_01._gemini_proxy', module_path)
155
+ module_path = os.path.join(functions_root, 'api_v1_00', '_gemini_proxy.py')
156
+ spec = importlib.util.spec_from_file_location('api_v1_00._gemini_proxy', module_path)
125
157
  _gemini = importlib.util.module_from_spec(spec)
126
158
  spec.loader.exec_module(_gemini)
127
159
 
128
-
129
160
  # Restore original sys.modules mappings to avoid side-effects for other tests
130
161
  for name, orig in _orig_sys_modules.items():
131
162
  if orig is None:
@@ -198,7 +229,9 @@ def test_invalid_auth_key_returns_403():
198
229
  def test_non_post_method_returns_405():
199
230
  headers = {_gemini.AUTH_HEADER_NAME: 'ok'}
200
231
  req = DummyRequest(headers=headers, method='GET')
201
- with patch.object(_gemini, 'validate_auth_key', return_value=True), patch.object(_gemini, 'verify_firebase_token', return_value={}):
232
+ with patch.object(_gemini, 'validate_auth_key', return_value=True), \
233
+ patch.object(_gemini, 'verify_firebase_token', return_value={}), \
234
+ patch.object(_gemini, 'ensure_balance_positive', return_value=(True, 100.0)):
202
235
  resp = _gemini._gemini_proxy(req)
203
236
 
204
237
  assert resp.status_code == 405
@@ -210,7 +243,9 @@ def test_non_post_method_returns_405():
210
243
  def test_malformed_json_returns_400():
211
244
  headers = {_gemini.AUTH_HEADER_NAME: 'ok'}
212
245
  req = DummyRequest(headers=headers, method='POST', raise_on_get_json=True)
213
- with patch.object(_gemini, 'validate_auth_key', return_value=True), patch.object(_gemini, 'verify_firebase_token', return_value={}):
246
+ with patch.object(_gemini, 'validate_auth_key', return_value=True), \
247
+ patch.object(_gemini, 'verify_firebase_token', return_value={}), \
248
+ patch.object(_gemini, 'ensure_balance_positive', return_value=(True, 100.0)):
214
249
  resp = _gemini._gemini_proxy(req)
215
250
 
216
251
  assert resp.status_code == 400
@@ -223,7 +258,9 @@ def test_rehydrate_params_error_returns_400():
223
258
  headers = {_gemini.AUTH_HEADER_NAME: 'ok'}
224
259
  # missing 'model' to cause KeyError inside rehydrate_params
225
260
  req = DummyRequest(headers=headers, method='POST', json_data={'contents': 'x', 'config': {}})
226
- with patch.object(_gemini, 'validate_auth_key', return_value=True), patch.object(_gemini, 'verify_firebase_token', return_value={}):
261
+ with patch.object(_gemini, 'validate_auth_key', return_value=True), \
262
+ patch.object(_gemini, 'verify_firebase_token', return_value={}), \
263
+ patch.object(_gemini, 'ensure_balance_positive', return_value=(True, 100.0)):
227
264
  resp = _gemini._gemini_proxy(req)
228
265
 
229
266
  assert resp.status_code == 400
@@ -237,6 +274,7 @@ def test_get_api_key_failure_returns_500():
237
274
  req = DummyRequest(headers=headers, method='POST', json_data={'model': 'g', 'contents': 'hi', 'config': {}})
238
275
  with patch.object(_gemini, 'validate_auth_key', return_value=True), \
239
276
  patch.object(_gemini, 'verify_firebase_token', return_value={}), \
277
+ patch.object(_gemini, 'ensure_balance_positive', return_value=(True, 100.0)), \
240
278
  patch.object(_gemini, 'get_api_key', side_effect=Exception('boom')):
241
279
  resp = _gemini._gemini_proxy(req)
242
280
 
@@ -258,12 +296,18 @@ def test_successful_flow_calls_genai_and_returns_payload():
258
296
 
259
297
  def generate_content(self, **params):
260
298
  class FakeResp:
299
+ def __init__(self):
300
+ # include usage metadata expected by get_usage()
301
+ self.usage_metadata = types.SimpleNamespace(prompt_token_count=1, total_token_count=2)
302
+
261
303
  def to_json_dict(self_inner):
262
304
  return { 'result': 'ok', 'received_model': params.get('model') }
263
305
  return FakeResp()
264
306
 
265
307
  with patch.object(_gemini, 'validate_auth_key', return_value=True), \
266
308
  patch.object(_gemini, 'verify_firebase_token', return_value={}), \
309
+ patch.object(_gemini, 'ensure_balance_positive', return_value=(True, 100.0)), \
310
+ patch.object(_gemini, 'bill_with_retry', return_value=("ok", 99.5)), \
267
311
  patch.object(_gemini, 'get_api_key', return_value='GEMINI-KEY'), \
268
312
  patch.object(_gemini.genai, 'Client', FakeClient):
269
313
  resp = _gemini._gemini_proxy(req)
@@ -297,6 +341,7 @@ def test_genai_exception_with_status_code_is_returned_as_error_status():
297
341
 
298
342
  with patch.object(_gemini, 'validate_auth_key', return_value=True), \
299
343
  patch.object(_gemini, 'verify_firebase_token', return_value={}), \
344
+ patch.object(_gemini, 'ensure_balance_positive', return_value=(True, 100.0)), \
300
345
  patch.object(_gemini, 'get_api_key', return_value='GEMINI-KEY'), \
301
346
  patch.object(_gemini.genai, 'Client', ErrClient):
302
347
  resp = _gemini._gemini_proxy(req)
@@ -108,13 +108,42 @@ openai_mod.APIError = APIError
108
108
  sys.modules['openai'] = openai_mod
109
109
 
110
110
  # Import the module under test after preparing the fake imports
111
+ #_generic = importlib.import_module('_generic_proxy')
112
+
111
113
  repo_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..'))
112
114
  functions_root = os.path.join(repo_root, 'functions')
113
- module_path = os.path.join(functions_root, 'api_v0_01', '_generic_proxy.py')
114
- spec = importlib.util.spec_from_file_location('api_v0_01._generic_proxy', module_path)
115
+ module_path = os.path.join(functions_root, 'api_v1_00', '_generic_proxy.py')
116
+ spec = importlib.util.spec_from_file_location('api_v1_00._generic_proxy', module_path)
115
117
  _generic = importlib.util.module_from_spec(spec)
116
118
  spec.loader.exec_module(_generic)
117
119
 
120
+ # Patch Firestore client and billing functions to avoid external dependencies during tests
121
+ # Provide a dummy Firestore client and make balance checks/billing no-ops.
122
+ _generic.firestore = types.SimpleNamespace(client=lambda: object())
123
+
124
+ def _fake_ensure_balance_positive(db, user_id):
125
+ return True, 100.0
126
+
127
+ def _fake_extract_usage(llm_family=None, call_type=None, model_id=None, request_payload=None, response_payload=None):
128
+ # Default to zero-usage unless present in the payload
129
+ usage = response_payload.get('usage', {}) if isinstance(response_payload, dict) else {}
130
+ in_tokens = usage.get('prompt_tokens', 0) or usage.get('input_tokens', 0) or 0
131
+ out_tokens = usage.get('completion_tokens', 0) or usage.get('output_tokens', 0) or 0
132
+ return {"input_tokens": in_tokens, "output_tokens": out_tokens}
133
+
134
+ def _fake_calculate_cost(model_id=None, input_tokens=0, output_tokens=0):
135
+ return 0.0
136
+
137
+ def _fake_bill_with_retry(db=None, user_id=None, model_id=None, usage=None, cost=None, reason=None):
138
+ return "ok", 100.0
139
+
140
+ _generic.ensure_balance_positive = _fake_ensure_balance_positive
141
+ _generic.extract_usage = _fake_extract_usage
142
+ # Compatibility shim: some versions of the module call get_usage(response) instead of extract_usage(...)
143
+ _generic.get_usage = lambda response: _fake_extract_usage(response_payload=response)
144
+ _generic.calculate_cost = _fake_calculate_cost
145
+ _generic.bill_with_retry = _fake_bill_with_retry
146
+
118
147
  # Restore original sys.modules mappings to avoid side-effects for other tests
119
148
  for name, orig in _orig_sys_modules.items():
120
149
  if orig is None:
@@ -186,8 +186,8 @@ sys.modules['ulid'] = ulid_mod
186
186
  # Load the module directly from the functions/ tree so the test's fake sys.modules entries are respected
187
187
  repo_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..'))
188
188
  functions_root = os.path.join(repo_root, 'functions')
189
- module_path = os.path.join(functions_root, 'api_v0_01', '_get_payment_details.py')
190
- spec = importlib.util.spec_from_file_location('api_v0_01._get_payment_details', module_path)
189
+ module_path = os.path.join(functions_root, 'api_v1_00', '_get_payment_details.py')
190
+ spec = importlib.util.spec_from_file_location('api_v1_00._get_payment_details', module_path)
191
191
  _get_payment_details = importlib.util.module_from_spec(spec)
192
192
  spec.loader.exec_module(_get_payment_details)
193
193