hoja-cli 0.21.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. VERSION +1 -0
  2. google_workspace/__init__.py +19 -0
  3. google_workspace/client.py +253 -0
  4. google_workspace/config.py +39 -0
  5. google_workspace/errors.py +19 -0
  6. google_workspace/mcp_server.py +100 -0
  7. google_workspace/oauth.py +131 -0
  8. google_workspace/principal.py +83 -0
  9. google_workspace/py.typed +0 -0
  10. google_workspace/tools.py +64 -0
  11. google_workspace/writes.py +44 -0
  12. hoja/__init__.py +29 -0
  13. hoja/__main__.py +6 -0
  14. hoja/auth.py +42 -0
  15. hoja/cli.py +161 -0
  16. hoja/cli_state.py +55 -0
  17. hoja/client.py +268 -0
  18. hoja/commands/__init__.py +4 -0
  19. hoja/commands/auth_cmd.py +271 -0
  20. hoja/commands/comment.py +149 -0
  21. hoja/commands/cycle.py +75 -0
  22. hoja/commands/init.py +108 -0
  23. hoja/commands/issue.py +398 -0
  24. hoja/commands/label.py +163 -0
  25. hoja/commands/memory.py +240 -0
  26. hoja/commands/project.py +56 -0
  27. hoja/commands/raw.py +50 -0
  28. hoja/commands/team.py +102 -0
  29. hoja/commands/update.py +162 -0
  30. hoja/config.py +362 -0
  31. hoja/errors.py +107 -0
  32. hoja/filters.py +150 -0
  33. hoja/graphql/__init__.py +5 -0
  34. hoja/graphql/fragments.py +138 -0
  35. hoja/graphql/mutations.py +160 -0
  36. hoja/graphql/queries.py +245 -0
  37. hoja/mcp/__init__.py +27 -0
  38. hoja/mcp/content.py +151 -0
  39. hoja/mcp/prompts.py +298 -0
  40. hoja/mcp/resources.py +213 -0
  41. hoja/mcp/server.py +189 -0
  42. hoja/memory_board.py +370 -0
  43. hoja/models/__init__.py +37 -0
  44. hoja/models/base.py +64 -0
  45. hoja/models/cycle.py +32 -0
  46. hoja/models/enums.py +62 -0
  47. hoja/models/issue.py +99 -0
  48. hoja/models/label.py +17 -0
  49. hoja/models/project.py +60 -0
  50. hoja/models/team.py +31 -0
  51. hoja/models/user.py +32 -0
  52. hoja/models/workflow.py +65 -0
  53. hoja/output.py +410 -0
  54. hoja/skill_content/commands.md +222 -0
  55. hoja/skill_content/examples.md +193 -0
  56. hoja/skill_content/filters.md +101 -0
  57. hoja/skill_content/output-formats.md +92 -0
  58. hoja/skill_content/overview.md +123 -0
  59. hoja/skill_content/workflows.md +174 -0
  60. hoja_cli-0.21.4.dist-info/METADATA +279 -0
  61. hoja_cli-0.21.4.dist-info/RECORD +107 -0
  62. hoja_cli-0.21.4.dist-info/WHEEL +4 -0
  63. hoja_cli-0.21.4.dist-info/entry_points.txt +4 -0
  64. hoja_cli-0.21.4.dist-info/licenses/LICENSE +21 -0
  65. hoja_server/README.md +135 -0
  66. hoja_server/__init__.py +11 -0
  67. hoja_server/abac.py +116 -0
  68. hoja_server/agent_chat.py +280 -0
  69. hoja_server/agent_conversations.py +91 -0
  70. hoja_server/agent_durable.py +332 -0
  71. hoja_server/agent_prompt.py +117 -0
  72. hoja_server/agent_threads.py +96 -0
  73. hoja_server/agent_uploads.py +60 -0
  74. hoja_server/app.py +2189 -0
  75. hoja_server/cadence.py +231 -0
  76. hoja_server/cli.py +191 -0
  77. hoja_server/cloudflare_realtime.py +110 -0
  78. hoja_server/comment_policy.py +70 -0
  79. hoja_server/connector_actions.py +119 -0
  80. hoja_server/connectors_api.py +375 -0
  81. hoja_server/db.py +1816 -0
  82. hoja_server/denials.py +18 -0
  83. hoja_server/deployment.py +28 -0
  84. hoja_server/email_adapter.py +94 -0
  85. hoja_server/google_login.py +217 -0
  86. hoja_server/google_oidc.py +342 -0
  87. hoja_server/identity_transfer.py +210 -0
  88. hoja_server/mcp_oauth.py +623 -0
  89. hoja_server/mcp_tools.py +579 -0
  90. hoja_server/meeting_policy.py +179 -0
  91. hoja_server/meetings.py +1332 -0
  92. hoja_server/meetings_api.py +909 -0
  93. hoja_server/model_providers.py +205 -0
  94. hoja_server/realtime.py +690 -0
  95. hoja_server/resolvers.py +1281 -0
  96. hoja_server/schema.graphql +477 -0
  97. hoja_server/schema_sdl.py +8 -0
  98. hoja_server/secrets_box.py +39 -0
  99. hoja_server/signup_config.py +292 -0
  100. hoja_server/signup_gate.py +393 -0
  101. hoja_server/signup_policy.py +97 -0
  102. hoja_server/signup_store.py +577 -0
  103. hoja_server/store.py +2179 -0
  104. hoja_server/sync.py +249 -0
  105. hoja_server/tenant_context.py +131 -0
  106. hoja_server/turnstile.py +81 -0
  107. hoja_server/writer.py +1262 -0
@@ -0,0 +1,107 @@
1
+ hoja/__init__.py,sha256=T4IjUl1v2zX21ILt_I8TsSlkdgN6_8r-9jJA-IXZ2-E,1024
2
+ hoja/__main__.py,sha256=2CM61FH8dF-mCH8X45bM9ckkiZO--1UOhy-BARXp7qY,104
3
+ hoja/auth.py,sha256=9mzVfkNbxfKke102-M9-AUuUw7kpPZNWkKSyN9o66hQ,1173
4
+ hoja/cli.py,sha256=lGV6svufT7GiT9fr0nXjc2aud45_Ni7laK9r3oLK2Yg,5696
5
+ hoja/cli_state.py,sha256=KmazATo31wW-UPll30Eyp4dOM-y6N15nDcV19poG9C8,1403
6
+ hoja/client.py,sha256=gJ7lQjK8ERpUYdTeFYsjgDE_p26p0VsSFxWUwNNa5EQ,9008
7
+ hoja/config.py,sha256=DbBeO9fGVAt7bbQGxtdqeJKMYRtghx2QB5sjUMq3WIo,11888
8
+ hoja/errors.py,sha256=0jqfUJEq48bEDYH5Fh3UGRBnuwlbxj2uL2nX0LpFHiA,2533
9
+ hoja/filters.py,sha256=R17xUnQT1tVprTpv43Bh5sMQeQG3wbj58sGj4L1r9Rg,4882
10
+ hoja/memory_board.py,sha256=gBGPJVC0lEtjCftDVbhBkKPUdgZ5a-tZY7dhCgZKBW4,13002
11
+ hoja/output.py,sha256=rSGO9wRXWX11XVjxU3nd6-pT3M6uteWYh-IWNhPvoxY,13731
12
+ hoja/commands/__init__.py,sha256=QzHbaMpvxUpoaKMMYlEOkaE6KGgvupX8PY2_gGggdeY,83
13
+ hoja/commands/auth_cmd.py,sha256=H1LWvqnTrPBu1N6B3WYrlUwQl3uD4nb5aKK6BnDWMTc,9020
14
+ hoja/commands/comment.py,sha256=lTFxxPxvxK99SY9XuAt9apGpyK1OFV0eemRcUl-YAVI,5319
15
+ hoja/commands/cycle.py,sha256=aDonLNMCTPPsLR9p7LP5I7NbJE5iK3FG-jBPRn291LU,2640
16
+ hoja/commands/init.py,sha256=B8GJyGkqlCEen1mMx1xaoaqEUGeyelFVopdBsYq7tNk,3423
17
+ hoja/commands/issue.py,sha256=DBvv3PjRanvlkhYcpl8qvoOP37pr3HX8Nx_njmTEyEo,16180
18
+ hoja/commands/label.py,sha256=Z6Eg14TQytLBmmMKou-BtIgythcS9q7s-Vcy8a08Xm4,5398
19
+ hoja/commands/memory.py,sha256=gfTbIScitpYfaTN_0UnOOSsEbdkPalBr0q-MIYJPM9I,7863
20
+ hoja/commands/project.py,sha256=vFd8IeYcALW23iuJ_IHUIp9a6hC-gX-QYAxmZs0Yv-Y,1649
21
+ hoja/commands/raw.py,sha256=d6d6Uz2514BvjgCIh3jPy-naWU4seRU3fEpsHxdOOsI,1480
22
+ hoja/commands/team.py,sha256=1VrYV1HaPwfL6Te-7c6HOqnRa1FOozOIxtkZuzi29V4,3022
23
+ hoja/commands/update.py,sha256=LB-1LB9En3vHZN2mgblesw6zyBdtiYkUQSBcmR4HUc8,4949
24
+ hoja/graphql/__init__.py,sha256=zeKvKi_uuNed1yP9GjViX4M09aaxr9bgCmgdJpQWpv4,165
25
+ hoja/graphql/fragments.py,sha256=fwq_gFKItnpz5dnL1MTA3YAgEBsVHcLXIVJNUpo9Elk,1996
26
+ hoja/graphql/mutations.py,sha256=b0w1V9vwSnJH7gZ2bxDUW-ocly7jNVaKmMFNxoD3Faw,3413
27
+ hoja/graphql/queries.py,sha256=-aDnk_3FrmyXaZqWliOwwE8JG5M1EAgx4wlqAe33CNw,5577
28
+ hoja/mcp/__init__.py,sha256=UyJiPuq7meFHCSn5fX5pPUZwhhsFQ9pkUkFsusdwha0,732
29
+ hoja/mcp/content.py,sha256=31mgccQtD4UBBZXxO-YDfKJ_avpOZ5cLhOKCega3rZI,5383
30
+ hoja/mcp/prompts.py,sha256=LDXSfQ5qUcoh0_QBZ9KquUPLzVocNTqpzm3TdmFhIWo,7423
31
+ hoja/mcp/resources.py,sha256=LfA7Ap7aVT8jspJ2oJ9msfKOgHlyKUqey-VktywnShc,7714
32
+ hoja/mcp/server.py,sha256=1wMXlyuEfMzgfJ35JMOEszLVYYhfcSE2BkRg6nKNTzY,7237
33
+ hoja/models/__init__.py,sha256=m99Tw1ptF9U5_iWEiQGJVx3kG7mzryki_Bs-SdUdKwk,768
34
+ hoja/models/base.py,sha256=VrHTGfLM7Vmb91vkFf7VVVpt8r32xUjTGper0BMb2kA,1862
35
+ hoja/models/cycle.py,sha256=T1RFKnWXBXwcfXbStuRAeXgOpzsjJy9nb-AeX7kqETo,805
36
+ hoja/models/enums.py,sha256=nVNPOC9AcJRRitpNXqMqqUqVb4RsQ-awuAFihqdOClo,1577
37
+ hoja/models/issue.py,sha256=frFUZ3jiSFm_RWPKhK15bus32Sp3J_04kZpYlHSIrRI,2862
38
+ hoja/models/label.py,sha256=WHATVfQr6hMTxs2_PbhilWjhacF4gFnQP7VzWbdOMuU,382
39
+ hoja/models/project.py,sha256=y7geJQjGnRHxzSeNNRRmvcc-SSQsT1nRSunE0kQQv00,1696
40
+ hoja/models/team.py,sha256=wZVjslOyFHXJ_hKTN3qgmfscESRPuP61kdl8jhPlvOs,856
41
+ hoja/models/user.py,sha256=gedTjH9Rf575v8F6z_Lj8q-QcaLLYx_YlfXHtfacT-Y,936
42
+ hoja/models/workflow.py,sha256=eNhAEQX2I2cNoImMhdNhgTx217rrkqkaKm-PK6eLlHE,2098
43
+ hoja/skill_content/commands.md,sha256=bwLcupx_SvQ8_w77doYKoiHJ4aki_XSO1s9dEDv4x6c,6970
44
+ hoja/skill_content/examples.md,sha256=deqk2OroGy--dIkpGmLsxMT9lzrxAGtuGVXmd979eAA,4388
45
+ hoja/skill_content/filters.md,sha256=rTxRCO2BbnFhTsBYFJUaPy_mHnvtEC5ksIF3debjAPc,3644
46
+ hoja/skill_content/output-formats.md,sha256=_zqI0p4XVWTVaEn3-bq8S12LcPCOfZh8Hu_nAJEWwGE,3401
47
+ hoja/skill_content/overview.md,sha256=vV1Dgc3L-2N6yTfUeuu9dNaLt8WI5Y6DozvkXVmbt-Q,6215
48
+ hoja/skill_content/workflows.md,sha256=RCz-jXHcIPHM5_1vUN7ALc5cvF1zk74Crx1VsrcozgA,5034
49
+ hoja_server/README.md,sha256=w6acVohyiNhnafafN1iVMXnMnUIFgMiXRc8eZRz8v78,5332
50
+ hoja_server/__init__.py,sha256=EUdc238pW8W-zqXJ93UbblfvKHwBBmorviHsQlC7nIk,423
51
+ hoja_server/abac.py,sha256=yYi28iS_74gz6dbdBQsNVPl3pk1i9qxWXXisxHkM8jc,3797
52
+ hoja_server/agent_chat.py,sha256=78i1yIllmh96EIthTWNPMqnvImehs5HsSVCpfi8IOPU,13986
53
+ hoja_server/agent_conversations.py,sha256=LyxzquR28w2nmgZMV2UNyJP3ZvplghY4ub2e4iW4Kls,2950
54
+ hoja_server/agent_durable.py,sha256=2NAwe5vKK6RzUOZKb3QfKciA8Jij5vTFOS0OMZapAOE,13692
55
+ hoja_server/agent_prompt.py,sha256=6EWzIWByb7q7G2y7mWfR-rcWsTI64yd4y0Ms2fArrYA,6393
56
+ hoja_server/agent_threads.py,sha256=g8wVrrdYwazXPwF4FCMREQS0OYaS5vmFZ14z3oFNIt0,4218
57
+ hoja_server/agent_uploads.py,sha256=_n-Xf8AhF30BEPdnYP-OK_8iWNSw1AtGS8s2KU_0F3o,2350
58
+ hoja_server/app.py,sha256=AwYhTwYeHhZwD1g6rxuh3uONBjLSgpw9RxNC60Li5-E,98831
59
+ hoja_server/cadence.py,sha256=z-NbHGCh4a-wD_BbuhYiOP32GkTEKtlt2fg6llDAd4g,12311
60
+ hoja_server/cli.py,sha256=ouC5Cjpj-EPwus5KmA_HuELuBM7IUKZ-UOkAdHPbQUo,7366
61
+ hoja_server/cloudflare_realtime.py,sha256=aZnjeBvciyaFbZ9AP-5e9fj4uODZ0EHAE3U2dn2FLzA,4699
62
+ hoja_server/comment_policy.py,sha256=yQdR78jczXRwsscSCKaUKKijKhn2iEQF4kckwbQE1oU,2604
63
+ hoja_server/connector_actions.py,sha256=khBvRAf6iNcs13lfRJQfZU8WuslTpU5tYeitnfTwxnA,3725
64
+ hoja_server/connectors_api.py,sha256=vfMJg1gCeKGnvkNygr38n4D_LfdR-Jm8o3FVnt2xhA0,15822
65
+ hoja_server/db.py,sha256=HQOFjSxUOljdfmCvYpMl9BlCrA1aw7yacipmufHvJgk,75188
66
+ hoja_server/denials.py,sha256=T3kF4fCG9rEodvidwWAOJB0Q_w6e0Y8Dg3FOFHNf4XI,650
67
+ hoja_server/deployment.py,sha256=gaxWcjAeMeYgZ3yJ607KKK1BAFC-GKCyPFcnhJMCT3k,1082
68
+ hoja_server/email_adapter.py,sha256=oV4t5d6rZCHlOu2Z1jjNjqKa5vIeUFsdXFi-td63nEk,3582
69
+ hoja_server/google_login.py,sha256=qWV-sp8YVTABmQVyRTGZRe7r6pU9zI_tyXEDNG-O5Tc,7528
70
+ hoja_server/google_oidc.py,sha256=T__8aPZEm8CJlyEV9MkmZUhg_zsq2VV2kdtT0B4z_HU,12871
71
+ hoja_server/identity_transfer.py,sha256=hyTUh9gcD2-XPnICkdDFujTMomIWrvi7Di40xUmTw58,8076
72
+ hoja_server/mcp_oauth.py,sha256=aVqXLJBxc51Im84s--qU3DOfWio_pYsYhUpnhiXzhV8,27281
73
+ hoja_server/mcp_tools.py,sha256=0v9qecOsA_Wl_DpG7aRK5-oh5ujKaSjma8IOMjfSVWw,27801
74
+ hoja_server/meeting_policy.py,sha256=wKcPRo3j-e6vWxbp_f8OJLDkzMnSP4d3SfBi4M9VOLo,9390
75
+ hoja_server/meetings.py,sha256=HpdkUNNatvnLgW-LY7QdiTaU9P68ZWFw7w0jE1f47jg,76208
76
+ hoja_server/meetings_api.py,sha256=_Ln1Ylh_uSH2XCvooL04K86Zaol7VENb9UxlHSViK3U,41437
77
+ hoja_server/model_providers.py,sha256=vp4aCkE2sXipSge6ugwdVWJ7LMHbt0h44qEv3ctdUVA,7031
78
+ hoja_server/realtime.py,sha256=6-fhYBtHt6qUhFMrFULju_dnm7L82sQ000XrhyhqywM,31149
79
+ hoja_server/resolvers.py,sha256=rT7hAySXUVkikJUPvk-_UrMSBUIQnRZhxLVJoUxvCGY,47408
80
+ hoja_server/schema_sdl.py,sha256=IlmWY6fpJqWuE1jH79vvpsAeSqaRtH3QLif7AH1HiWA,352
81
+ hoja_server/secrets_box.py,sha256=y2MPxZTfebnbjU6EdsvPS5GU7iP8Bc4DrOoTY-ZJpwI,1104
82
+ hoja_server/signup_config.py,sha256=q70s059uaZ1dCUAVo5gVP70-XokR_JelM3qV6ADiUVc,12139
83
+ hoja_server/signup_gate.py,sha256=6hYacWY0cfP-14brd08Ogc81ICjdUHTb7XZkMw0KzJg,14909
84
+ hoja_server/signup_policy.py,sha256=APfHjLD7fDH9QpKxaLcI2bGMkhlhNVaXcMliqi4msuI,3097
85
+ hoja_server/signup_store.py,sha256=RKTU5UORZO0TlkMEiGAqRV2Ghbx77xv2nWZfCwKGrjk,21026
86
+ hoja_server/store.py,sha256=2_5wrs9CX1k5dqwWoK-qzh9U0QAsJX3axxAet_d0E1A,113949
87
+ hoja_server/sync.py,sha256=WhYZOLiwp1FyelWyPhxYspQgdsMgRCMXyUP064k0low,11106
88
+ hoja_server/tenant_context.py,sha256=HCBtSWNkEm32CzwzPXAuFMPQG3_KZLNmPlA23qF95eo,4972
89
+ hoja_server/turnstile.py,sha256=yiFAFSg5CW9uGu2pIj4PeZpeWiNQXKLDiq9NZSkPS_s,3168
90
+ hoja_server/writer.py,sha256=AvSjMD9cFYxh2xz4z3nyOyxeli0xE-ZbN-Bk1P2m-pE,67182
91
+ VERSION,sha256=n_a8usbA9y6fmW7qs9277ZNoWzUCv03NNoPjDKRed-s,7
92
+ google_workspace/__init__.py,sha256=prUYalkh7gEUz6LGBmOz27OIBMk_bGhrSN5TJCdZXVI,519
93
+ google_workspace/client.py,sha256=Ig-D52w0jjdzvopI9cJ4EF5U7CFGatU0-vk4U6i4iL0,8936
94
+ google_workspace/config.py,sha256=CTqM1FM2-nafG2azUl9xldgQhnYhCazBHj34-fZzbrk,1389
95
+ google_workspace/errors.py,sha256=owRdgcnMXL5AhiRQTsByC45rq7RLrcr8cBq1k6cPL7Y,591
96
+ google_workspace/mcp_server.py,sha256=FDOPwyJxdYJqeXSfWmD051QjkdXqc2_na4QvNdz9jzk,4199
97
+ google_workspace/oauth.py,sha256=5s2E6uZgFf_-xTZWks2hhqR8IsAZB7hRAFM-6xL_7ho,3991
98
+ google_workspace/principal.py,sha256=zc54bXfyChe-9MDVgW-WwYzsUf-8iQh4uBXmPgXI6eQ,2430
99
+ google_workspace/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
100
+ google_workspace/tools.py,sha256=HPTvalGoJt8_n445WtLRAI3y7Z3q9o26sgE0tLyY-Po,2054
101
+ google_workspace/writes.py,sha256=yUMoyCln53LZx3mlOMJ7klvmxUFPt59enVH95TDjVw0,1778
102
+ hoja_server/schema.graphql,sha256=D6KxZu58FMlKCnRx20tSOsQRe3o5CmLs1W-UHJ3RmYc,15744
103
+ hoja_cli-0.21.4.dist-info/METADATA,sha256=vWZZXfDXsXywmKZbZlWzBHM7EzkANkoJCQ5raGCNg4k,12789
104
+ hoja_cli-0.21.4.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
105
+ hoja_cli-0.21.4.dist-info/entry_points.txt,sha256=v_Ymb_5cOVydSj7qPRN5QCNCoJZAjHO0wSVF-iktjWs,104
106
+ hoja_cli-0.21.4.dist-info/licenses/LICENSE,sha256=FjWVSBTneKC0IpZ5wDmoRTXMc6zDa7tYFt5qpPOdwVs,1063
107
+ hoja_cli-0.21.4.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.33.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,4 @@
1
+ [console_scripts]
2
+ hoja = hoja.cli:app
3
+ hoja-mcp = hoja.mcp.server:main
4
+ hoja-serve = hoja_server.cli:main
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Clover
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
hoja_server/README.md ADDED
@@ -0,0 +1,135 @@
1
+ # hoja_server — self-hosted Linear-compatible backend
2
+
3
+ A self-hosted GraphQL server and web UI that speaks the exact subset of the Linear API the
4
+ `hoja` CLI uses. Run `hoja` **fully offline** against a single-file SQLite
5
+ database or host many organizations in PostgreSQL, with **no rate limits**.
6
+
7
+ > The CLI needs only one change to talk to it: an `accounts.<name>.base_url`
8
+ > pointing at this server. Everything else is byte-for-byte identical.
9
+
10
+ ## Web UI
11
+
12
+ The server now serves a first-party workspace UI at `/`. It authenticates with
13
+ the same locally-issued API token as the CLI and never contacts Linear Cloud.
14
+ For a team deployment, use the included Docker Compose setup:
15
+
16
+ ```bash
17
+ docker compose up --build -d
18
+ docker compose exec app hoja-serve seed --org "Acme" --org-key acme --user "Admin" --email admin@example.com
19
+ ```
20
+
21
+ Open `http://localhost:8787/` and paste the token printed by `seed`.
22
+
23
+ ## Install
24
+
25
+ ```bash
26
+ pip install 'hoja-cli[server]' # includes the SQLite and psycopg 3 PostgreSQL drivers
27
+ ```
28
+
29
+ ## Quick start (offline, 60 seconds)
30
+
31
+ ```bash
32
+ # 1. Seed a tenant DB (org, admin user, team ENG, workflow states, token)
33
+ hoja-serve seed --tenant default
34
+ # -> prints: TOKEN : lin_api_XXXXXXXX...
35
+
36
+ # 2. Start the server
37
+ hoja-serve serve --tenant default --port 8787
38
+ # -> http://127.0.0.1:8787/graphql
39
+
40
+ # 3. Point hoja at it (~/.config/hoja/config.toml)
41
+ cat >> ~/.config/hoja/config.toml <<'TOML'
42
+ [accounts.local]
43
+ base_url = "http://127.0.0.1:8787/graphql"
44
+ token = "lin_api_XXXXXXXX..." # the token printed by `seed`
45
+ TOML
46
+
47
+ # 4. Use hoja normally
48
+ hoja --account local me
49
+ hoja --account local issue create --team ENG --title "Hello local"
50
+ hoja --account local issue list
51
+ ```
52
+
53
+ `$HOJA_API_URL` overrides `base_url` for any account (the deprecated
54
+ `$LINEAR_API_URL` is still read when it is unset), e.g.:
55
+
56
+ ```bash
57
+ HOJA_API_URL=http://127.0.0.1:8787/graphql hoja me
58
+ ```
59
+
60
+ ## Commands
61
+
62
+ | Command | Purpose |
63
+ |---------|---------|
64
+ | `hoja-serve migrate` | Apply outstanding ordered schema revisions. |
65
+ | `hoja-serve seed` | Provision an organization/user/team/states/token. Prints the token. |
66
+ | `hoja-serve serve` | Run the GraphQL server (`--host`, `--port`, `--open`, database flags). |
67
+ | `hoja-serve token` | Mint a token for a selected organization user. |
68
+
69
+ Every command resolves its database in this order: explicit `--database-url`,
70
+ `HOJA_DATABASE_URL`, then the existing `--db` or `--tenant` SQLite path.
71
+ `seed` applies migrations for local convenience; hosted deployments should run
72
+ `migrate` as an explicit pre-deployment step. `serve` never mutates the schema.
73
+
74
+ `--open` is an isolated-SQLite convenience only: any token maps to the identity
75
+ only when exactly one organization and one user exist. It never chooses a global
76
+ first user in a shared or ambiguous database.
77
+
78
+ ## What it implements
79
+
80
+ **Queries:** `viewer`, `teams`, `team` (+ `states`/`members`/`cycles`/`activeCycle`),
81
+ top-level `workflowStates`/`cycles`, `issues` (with `IssueFilter` + `orderBy`),
82
+ `issue` (+ `comments`/`labels`/`subscribers`), `projects`, `project`,
83
+ `issueLabels`, `searchIssues`, `rateLimitStatus`.
84
+
85
+ **Mutations:** `issueCreate/Update/Delete/Archive`, `commentCreate/Update/Delete`,
86
+ `issueLabelCreate/Delete`, `projectCreate/Update/Archive`, `attachmentCreate`.
87
+
88
+ **Semantics:** per-team incrementing identifiers (`ENG-1`, `ENG-2`, …), seeded
89
+ workflow states (Backlog/Todo/In Progress/In Review/Done/Canceled), derived
90
+ `priorityLabel`/`url`/`branchName`, state-transition timestamps
91
+ (`startedAt`/`completedAt`/`canceledAt`), soft-delete via `archivedAt`, and the
92
+ Relay `{ nodes, pageInfo }` connection envelope.
93
+
94
+ ## Multi-tenancy
95
+
96
+ Each API token maps to exactly one organization. Every resolver is scoped by
97
+ `organization_id`, so tenants cannot see each other's data. One server endpoint
98
+ serves many tenants — add several `accounts.<name>` in hoja config, all with
99
+ the same `base_url` but different tokens.
100
+
101
+ ## No rate limits
102
+
103
+ The server never returns HTTP 429 and implements `rateLimitStatus` with
104
+ effectively-unlimited values, so any client polling it is satisfied.
105
+
106
+ ## Storage
107
+
108
+ Isolated mode uses one SQLite file per tenant at
109
+ `$XDG_DATA_HOME/hoja/<tenant>.db` (default `~/.local/share/hoja/`), WAL mode.
110
+ Hosted mode accepts a SQLAlchemy PostgreSQL URL, uses psycopg 3 with connection
111
+ pre-ping, and stores many organizations in one database. Every generated issue
112
+ and project URL uses `HOJA_APP_URL` (default `http://localhost:8787`), so an
113
+ owned deployment never depends on `linear.app`.
114
+
115
+ See [the deployment guide](../docs/DEPLOYMENT.md) for PostgreSQL setup,
116
+ organization seeding, explicit token selection, and operational checks.
117
+
118
+ ## Architecture
119
+
120
+ ```
121
+ hoja_server/
122
+ ├── schema.graphql SDL — exact Linear camelCase field names
123
+ ├── db.py SQLAlchemy Core tables, engine, migrate, seed
124
+ ├── store.py org-scoped reads + serializers + filter compilers
125
+ ├── writer.py mutations (identifier counter, derived fields)
126
+ ├── resolvers.py Ariadne bindings (Relay envelope, lazy field resolvers)
127
+ ├── app.py Starlette app + token auth + /graphql + /health + /ready
128
+ └── cli.py `hoja-serve` entry point (serve|seed|token)
129
+ ```
130
+
131
+ ## Prove it
132
+
133
+ ```bash
134
+ bash scripts/e2e-local-backend.sh # 17/17 checks: boots server + drives real hoja CLI
135
+ ```
@@ -0,0 +1,11 @@
1
+ """hoja_server — local, Linear-API-compatible GraphQL backend for the hoja CLI.
2
+
3
+ Wire-compatible with the ~25 Linear GraphQL operations hoja actually sends.
4
+ Offline-first (SQLite per tenant), multi-tenant by token, no rate limits.
5
+ """
6
+ from pathlib import Path
7
+
8
+ try:
9
+ __version__ = (Path(__file__).resolve().parent.parent / "VERSION").read_text().strip()
10
+ except Exception: # pragma: no cover
11
+ __version__ = "0.0.0"
hoja_server/abac.py ADDED
@@ -0,0 +1,116 @@
1
+ """Tiny attribute-based access control (ABAC) engine.
2
+
3
+ A decision is a pure function of four attribute bags: the *subject* (who is asking), the
4
+ *resource* (what they touch), the *action*, and the *environment* (server facts). Rules
5
+ are data: each has an effect, the actions it covers, and a predicate over the attributes.
6
+
7
+ Evaluation is deny-overrides with default deny:
8
+
9
+ 1. Any matching ``deny`` rule refuses the request (first one in rule order is reported).
10
+ 2. Otherwise any matching ``permit`` rule allows it.
11
+ 3. Otherwise the request is refused ("no rule permits").
12
+
13
+ Every decision names the rule that decided it, so refusals can be audited and explained.
14
+ Predicates read attributes through :class:`Attrs`, which returns ``None`` for anything
15
+ missing, so a rule can never crash on an attribute the caller did not supply.
16
+ """
17
+ from __future__ import annotations
18
+
19
+ from collections.abc import Callable, Iterable, Mapping
20
+ from dataclasses import dataclass
21
+ from typing import Any
22
+
23
+ PERMIT = "permit"
24
+ DENY = "deny"
25
+ ANY = "*"
26
+
27
+
28
+ class Attrs:
29
+ """Read-only attribute bag; missing keys read as None."""
30
+
31
+ __slots__ = ("_data",)
32
+
33
+ def __init__(self, data: Mapping[str, Any] | None = None) -> None:
34
+ self._data = dict(data or {})
35
+
36
+ def __getattr__(self, name: str) -> Any:
37
+ return self._data.get(name)
38
+
39
+ def get(self, name: str, default: Any = None) -> Any:
40
+ return self._data.get(name, default)
41
+
42
+ def as_dict(self) -> dict[str, Any]:
43
+ return dict(self._data)
44
+
45
+
46
+ @dataclass(frozen=True)
47
+ class Context:
48
+ action: str
49
+ s: Attrs # subject
50
+ r: Attrs # resource
51
+ e: Attrs # environment
52
+
53
+
54
+ @dataclass(frozen=True)
55
+ class Rule:
56
+ id: str
57
+ effect: str
58
+ actions: frozenset
59
+ when: Callable[[Context], bool]
60
+ reason: str
61
+
62
+ def covers(self, action: str) -> bool:
63
+ return ANY in self.actions or action in self.actions
64
+
65
+
66
+ @dataclass(frozen=True)
67
+ class Decision:
68
+ allowed: bool
69
+ reason: str
70
+ rule: str | None = None
71
+
72
+ def __bool__(self) -> bool:
73
+ return self.allowed
74
+
75
+
76
+ def permit(rule_id: str, actions: Iterable[str] | str, when: Callable[[Context], bool], reason: str = "") -> Rule:
77
+ return Rule(rule_id, PERMIT, _actions(actions), when, reason or rule_id)
78
+
79
+
80
+ def deny(rule_id: str, actions: Iterable[str] | str, when: Callable[[Context], bool], reason: str) -> Rule:
81
+ return Rule(rule_id, DENY, _actions(actions), when, reason)
82
+
83
+
84
+ def _actions(actions: Iterable[str] | str) -> frozenset:
85
+ return frozenset([actions]) if isinstance(actions, str) else frozenset(actions)
86
+
87
+
88
+ class Policy:
89
+ def __init__(self, rules: Iterable[Rule]) -> None:
90
+ self.rules = tuple(rules)
91
+ seen: set[str] = set()
92
+ for rule in self.rules:
93
+ if rule.id in seen:
94
+ raise ValueError(f"duplicate rule id {rule.id!r}")
95
+ seen.add(rule.id)
96
+
97
+ def decide(self, action: str, subject: Mapping | None = None, resource: Mapping | None = None,
98
+ environment: Mapping | None = None) -> Decision:
99
+ ctx = Context(action, Attrs(subject), Attrs(resource), Attrs(environment))
100
+ permitted: Rule | None = None
101
+ for rule in self.rules:
102
+ if not rule.covers(action):
103
+ continue
104
+ try:
105
+ hit = bool(rule.when(ctx))
106
+ except Exception: # a broken predicate must fail closed, never open
107
+ hit = rule.effect == DENY
108
+ if not hit:
109
+ continue
110
+ if rule.effect == DENY:
111
+ return Decision(False, rule.reason, rule.id)
112
+ if permitted is None:
113
+ permitted = rule
114
+ if permitted is not None:
115
+ return Decision(True, permitted.reason, permitted.id)
116
+ return Decision(False, "No rule permits this action.", None)