hyperpocket 0.3.6__py3-none-any.whl → 0.4.0__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 (51) hide show
  1. hyperpocket/auth/provider.py +2 -0
  2. hyperpocket/auth/weaviate/context.py +12 -0
  3. hyperpocket/auth/weaviate/token_context.py +11 -0
  4. hyperpocket/auth/weaviate/token_handler.py +68 -0
  5. hyperpocket/auth/weaviate/token_schema.py +7 -0
  6. hyperpocket/auth/zinc/__init__.py +0 -0
  7. hyperpocket/auth/zinc/context.py +12 -0
  8. hyperpocket/auth/zinc/token_context.py +11 -0
  9. hyperpocket/auth/zinc/token_handler.py +64 -0
  10. hyperpocket/auth/zinc/token_schema.py +7 -0
  11. hyperpocket/cli/eject.py +2 -7
  12. hyperpocket/cli/pull.py +2 -7
  13. hyperpocket/config/settings.py +2 -1
  14. hyperpocket/pocket_core.py +41 -68
  15. hyperpocket/pocket_main.py +37 -16
  16. hyperpocket/repository/__init__.py +3 -4
  17. hyperpocket/repository/repository.py +6 -41
  18. hyperpocket/repository/tool_reference.py +28 -0
  19. hyperpocket/server/auth/weaviate.py +27 -0
  20. hyperpocket/server/auth/zinc.py +27 -0
  21. hyperpocket/server/server.py +127 -61
  22. hyperpocket/session/in_memory.py +13 -3
  23. hyperpocket/tool/__init__.py +0 -3
  24. hyperpocket/tool/dock/__init__.py +3 -0
  25. hyperpocket/tool/dock/dock.py +34 -0
  26. hyperpocket/tool/function/__init__.py +1 -1
  27. hyperpocket/tool/function/tool.py +62 -32
  28. hyperpocket/tool/tool.py +1 -9
  29. hyperpocket/tool_like.py +2 -1
  30. hyperpocket/util/generate_slug.py +4 -0
  31. hyperpocket/util/json_schema_to_model.py +5 -1
  32. {hyperpocket-0.3.6.dist-info → hyperpocket-0.4.0.dist-info}/METADATA +4 -1
  33. {hyperpocket-0.3.6.dist-info → hyperpocket-0.4.0.dist-info}/RECORD +36 -36
  34. hyperpocket/cli/sync.py +0 -17
  35. hyperpocket/repository/lock.py +0 -240
  36. hyperpocket/repository/lockfile.py +0 -62
  37. hyperpocket/server/tool/__init__.py +0 -10
  38. hyperpocket/server/tool/dto/script.py +0 -33
  39. hyperpocket/server/tool/wasm.py +0 -46
  40. hyperpocket/tool/wasm/README.md +0 -166
  41. hyperpocket/tool/wasm/__init__.py +0 -3
  42. hyperpocket/tool/wasm/browser.py +0 -63
  43. hyperpocket/tool/wasm/invoker.py +0 -41
  44. hyperpocket/tool/wasm/script.py +0 -134
  45. hyperpocket/tool/wasm/templates/__init__.py +0 -35
  46. hyperpocket/tool/wasm/templates/node.py +0 -87
  47. hyperpocket/tool/wasm/templates/python.py +0 -93
  48. hyperpocket/tool/wasm/tool.py +0 -163
  49. /hyperpocket/{server/tool/dto → auth/weaviate}/__init__.py +0 -0
  50. {hyperpocket-0.3.6.dist-info → hyperpocket-0.4.0.dist-info}/WHEEL +0 -0
  51. {hyperpocket-0.3.6.dist-info → hyperpocket-0.4.0.dist-info}/entry_points.txt +0 -0
@@ -2,15 +2,15 @@ hyperpocket/__init__.py,sha256=VVLbApRTiULqEVQp6lCNOcuXKx9V62O_7C9VNKBQ0G0,137
2
2
  hyperpocket/builtin.py,sha256=SOrVrNjoKadDMksfB1rt6pKreJFzHG2YGBsLGVsg72c,2385
3
3
  hyperpocket/constants.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  hyperpocket/pocket_auth.py,sha256=VzpGpHOOQIiEgrk1sYg5DYa5WYV6gRQmFlm8Kb2C9V0,17611
5
- hyperpocket/pocket_core.py,sha256=qa6V4RAdnjtO6CbKiNaUYk--Mq8PVl2APlqCmqrCBt8,11081
6
- hyperpocket/pocket_main.py,sha256=ZSj0107pBBXx_pFKzggjEpm68Y1tQpDyYc2O_QDb4qQ,9628
5
+ hyperpocket/pocket_core.py,sha256=WkY7Dp7KcJTORAFNuxDbZ5PDgicRANUtKkpZmI5gg6s,10021
6
+ hyperpocket/pocket_main.py,sha256=XH0wlT1AafZDItgbYBkoo0dSb0z6Tcvl8AC9puXe8mg,10215
7
7
  hyperpocket/prompts.py,sha256=N1bCzCLZvGUVhH1Vn_cgeBPsdY3MdIU7ZGqVgexoj5E,472
8
- hyperpocket/tool_like.py,sha256=5JgHZFEFu-GcZZl5pwkUqHeABUpN3nyJdtKJHtEjpHU,135
8
+ hyperpocket/tool_like.py,sha256=lUk9kUHPUmugqHCLbnWflKtZbCwtgcoYWtqGqUQtV38,187
9
9
  hyperpocket/auth/README.md,sha256=zn4QqnFZCA_4X3x8Wb6lE3OP5otYxpByZaCiUkBvaNs,11562
10
10
  hyperpocket/auth/__init__.py,sha256=pO8M6SAuq0EPqi848_Iy650wqaLekx98e3RRnEAM_r0,607
11
11
  hyperpocket/auth/context.py,sha256=m-j2gDYUKBMsiakLHsu9thhM4dYyFiXP0Wp0S_iC0bU,1303
12
12
  hyperpocket/auth/handler.py,sha256=5cusl9ANEyG3gORVFjqh709txC0alw6eKtxgV6wjf6k,6683
13
- hyperpocket/auth/provider.py,sha256=60jJnTQZzJvHYyCDJVJ89PHUPEnYaeZvOiMwkBO5QJ8,2017
13
+ hyperpocket/auth/provider.py,sha256=7oRpa3ImMdQPXp2-VwTF3tZGhPkyIe0cOgQCJcljzgQ,2061
14
14
  hyperpocket/auth/schema.py,sha256=pl4oRTNj8PdqQg6UVPWf8ei2uYQ4DtOmmD58cVFMYQw,537
15
15
  hyperpocket/auth/activeloop/README.md,sha256=xp8n0itbY9VNt8XEvCAE4Ealvj4uf_f1uSZyWG4Q5FE,172
16
16
  hyperpocket/auth/activeloop/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -428,6 +428,11 @@ hyperpocket/auth/wandb/context.py,sha256=YKtk8yz-LnKHMwLs0CGZ3HUqvvtS6J2eAWQ7B-Z
428
428
  hyperpocket/auth/wandb/token_context.py,sha256=TFE_r8eMHeUzCMpM91SIy668GHpu_NxFpqmmMoEuaDw,437
429
429
  hyperpocket/auth/wandb/token_handler.py,sha256=WBsli6ZJPXVTKKDz9c_UIXQ15SfzWvxNZVeZWa1RuwE,2789
430
430
  hyperpocket/auth/wandb/token_schema.py,sha256=AEDE-HkS-lSDzMdARETDO0xyPvBbHxqLXFAzbkIusFA,207
431
+ hyperpocket/auth/weaviate/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
432
+ hyperpocket/auth/weaviate/context.py,sha256=RnoxPR1awSmi4VNB8tIfKJvm1JDqbIMAwDNZEOvGt6M,427
433
+ hyperpocket/auth/weaviate/token_context.py,sha256=AG_1r_pa8O-5Y35nwS-RAK31WACO8PI1dqcHFB3FGNg,485
434
+ hyperpocket/auth/weaviate/token_handler.py,sha256=YQRu_XEOHSIH_xCM9kRPuKLbroEQWzpFoBXj_pWcdRs,2733
435
+ hyperpocket/auth/weaviate/token_schema.py,sha256=ajXoOyglBD-8SpfQhStduhDe1_uV5YfzebMnXmLcd_M,273
431
436
  hyperpocket/auth/workiom/README.md,sha256=icnFTBhr_RPIBJCv21JyP6hxjmZsLLQXTEluBfpwVII,301
432
437
  hyperpocket/auth/workiom/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
433
438
  hyperpocket/auth/workiom/context.py,sha256=N6sD3gfycGCr5xvxF3CFfxR3ufU1_cgKKjRkpTqD3-A,429
@@ -440,6 +445,11 @@ hyperpocket/auth/x/context.py,sha256=5Ur9GI8og49E-8FToKlqR3TtPn6vWAdu1boLqYxJL8k
440
445
  hyperpocket/auth/x/oauth2_context.py,sha256=q2HB14WENz2LU7Qe7KkE7-AtsEOtzXIj7n8alykac8M,955
441
446
  hyperpocket/auth/x/oauth2_handler.py,sha256=kEnsbL1YIeIQUlMVPIZYqOswk9_t-sNGiaixj43M1Yc,5634
442
447
  hyperpocket/auth/x/oauth2_schema.py,sha256=PKeaHccpxGLJjEd8RxP2wVcrIPCE-W9HEtP8EMzU4To,401
448
+ hyperpocket/auth/zinc/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
449
+ hyperpocket/auth/zinc/context.py,sha256=nsjUnNcOVUB2C3tjN2jT94dWPI9wRagtpyrV452pieY,419
450
+ hyperpocket/auth/zinc/token_context.py,sha256=CG0aVRO-xEIk39zHLu2-IF46VMrKnKlxg4mqTtv2H-s,449
451
+ hyperpocket/auth/zinc/token_handler.py,sha256=S0if3Zb8TFRP52XwHpanm_AbthkojLmsnKaeJU8RyxA,2574
452
+ hyperpocket/auth/zinc/token_schema.py,sha256=18C50Wnr9Vq-YJBS4qzjUotoEJy5zLWqFKK2G7nmcMg,265
443
453
  hyperpocket/auth/zoom/README.md,sha256=xzfcoAiWyFxUdHfOgnXwMXygt_RkaAsaZuCH3ylTcVQ,401
444
454
  hyperpocket/auth/zoom/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
445
455
  hyperpocket/auth/zoom/context.py,sha256=26S_aMbvtdzXYoXdDNpnHGJ-tmMcOSt0F15cMYwQZaM,423
@@ -450,9 +460,8 @@ hyperpocket/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
450
460
  hyperpocket/cli/__main__.py,sha256=f9qvOb33F5edNjP_eyshT1F8SjofV3bwLFl8lAru_u8,813
451
461
  hyperpocket/cli/auth_oauth2.py,sha256=FTsaIrJY9U1uDEtZL456zOWQKfcqzOPg33ikFhFFjyA,4899
452
462
  hyperpocket/cli/auth_token.py,sha256=YV1AK70Q_hNsm_xwHP5LTaUWI-omssnX8214JyD3m_w,4875
453
- hyperpocket/cli/eject.py,sha256=Te1YhDONk_VCgZ6l2HjLqONJrn04EfPk19sD6D5SOyY,636
454
- hyperpocket/cli/pull.py,sha256=3xCyTmdbP77l7awNyCY63_ZmUhIlX1PE3apwReXNYco,549
455
- hyperpocket/cli/sync.py,sha256=OO5zFrLOMXk7TSAFEew04ZzW4HLoQ1uVb80UKvIJha0,517
463
+ hyperpocket/cli/eject.py,sha256=utzeL4t02ML-EIgpPUiFjCbycjRpvkP1905bLeZAT2Y,321
464
+ hyperpocket/cli/pull.py,sha256=JnoIsmQwJODWOuilmKR5KKFsdMZ0Ht7pCWIbENJuYfw,275
456
465
  hyperpocket/cli/tool_create.py,sha256=1tsVw_sy28JmeCSXT1j-7dqOsDXzvZPTNqcmHchtcpI,3996
457
466
  hyperpocket/cli/tool_export.py,sha256=NRfssftdb1HEj9DtdM7rh6_rFs1hydYyjpDe7V8kFzU,8060
458
467
  hyperpocket/cli/codegen/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -472,16 +481,15 @@ hyperpocket/config/auth.py,sha256=OOVdaAfMva6b-Kz4iy5YpnIKjT5WgcQ17toFzHqoRPY,21
472
481
  hyperpocket/config/git.py,sha256=CGbY7J1LyN4ccZr9CFGAQwwhjC9kvdU0On_nsAsZ1FQ,362
473
482
  hyperpocket/config/logger.py,sha256=T5LESHvQfl2q1F-7FjsVfrz9fWz6jxPo7u6Jml3CQjc,2804
474
483
  hyperpocket/config/session.py,sha256=1ng1mARv4R_07SF5CkZWLgX9pNeXTcM0knCRw07Fpms,816
475
- hyperpocket/config/settings.py,sha256=HhtlrX_NP6yx59_1uzBEVbmwzk6m_2DV7JQ_b3aPPLs,2373
484
+ hyperpocket/config/settings.py,sha256=aw3TiPepcmSOKsIXDFHBhhqD2Ubz-51xRbFHZ5qx8KY,2437
476
485
  hyperpocket/futures/__init__.py,sha256=IObmC6hKC_Rc3vwOzINUVJ1hU2MDB5BUfXuH0vlSjtE,136
477
486
  hyperpocket/futures/futurestore.py,sha256=TVbCPf4HLKc32ol7e-oZckXMPPBKBvmjKmQAM1xj0dI,1329
478
- hyperpocket/repository/__init__.py,sha256=ExLIim8eauewS-xxpL6FdgfwmCZJU_8oMrstwTHKTi4,219
479
- hyperpocket/repository/lock.py,sha256=3cHj516sZW5S4fen3-UfqzOnmBtg10wPp6Lja97WPoM,8546
480
- hyperpocket/repository/lockfile.py,sha256=pCz7keGT8P8G_8QPUFndNYNObjAY0q9ySGJHfcmqWIg,2183
481
- hyperpocket/repository/repository.py,sha256=AHQ-E7B42wAxrJ_pYZ8hdTr8pxUzOb2kWD8YWlrphtQ,1349
487
+ hyperpocket/repository/__init__.py,sha256=ML7XfV1SgcEiOBgQpfqjsT8QEKJbGQG3sVRqi_iAxqA,168
488
+ hyperpocket/repository/repository.py,sha256=KvgZnJW_TrBzaLWV0DxjReLklkni1oyLq856OyjJ__A,129
489
+ hyperpocket/repository/tool_reference.py,sha256=Nuc2ckWuH_5K-p8S_0IuJiaJiPE6XWchA2XM71nOTjM,554
482
490
  hyperpocket/server/__init__.py,sha256=8laNl098-IkFkarqwOZs_gm6yG0q3NAObq4cCUxK_Tw,90
483
491
  hyperpocket/server/proxy.py,sha256=ItM1qfuUBs6QiPqIpErBWUZWdtsEf0twPJY5r2UUFBU,2042
484
- hyperpocket/server/server.py,sha256=0RB5cm9ZwSYno8F6Urk6VP10V0-QAl0NIeqHONtllNA,8793
492
+ hyperpocket/server/server.py,sha256=_kRWyoBJPcInbJTU_64MTv5Dbjpm9_oksix2Ow_0_Ko,11332
485
493
  hyperpocket/server/auth/__init__.py,sha256=IMjz9PCzD7qh4QIf2g-gWIdkDeU36jt-9F55vaHvLoM,286
486
494
  hyperpocket/server/auth/activeloop.py,sha256=MHh43F0j6q0r-GcevwD41ewLXdaPHfhLT9bCLuL7puU,739
487
495
  hyperpocket/server/auth/adobe.py,sha256=HH6elxV3ELWUnTRlkQBBFSXMHAc0angRUfHHkZVA4Kg,437
@@ -550,44 +558,36 @@ hyperpocket/server/auth/timekit.py,sha256=8pC-DT_gbm6vmd1oZaquD4Z68998BEDb1nYVAI
550
558
  hyperpocket/server/auth/token.py,sha256=Yq5Ym-uEO_3cBpQOsmCBuqtFIdImrNcVUgF5ozs5NHk,1763
551
559
  hyperpocket/server/auth/trello.py,sha256=1T3ez62h8-KMvu2Zj1Tyv2afgqLUbtG2LM4QbISLOGA,441
552
560
  hyperpocket/server/auth/wandb.py,sha256=jfwg-lQVrr5TgEL7QETnaFucDvi057SJvVZlBe7cOqQ,709
561
+ hyperpocket/server/auth/weaviate.py,sha256=WnBQu4H9mOGYEq7JcGqUkk3QXRO8FpGa9TLRHMQfpCE,732
553
562
  hyperpocket/server/auth/workiom.py,sha256=0apFB5-3rmcJaQeEl1_XZ_QlsZORdq8kixJBGkTpZ3Y,445
554
563
  hyperpocket/server/auth/x.py,sha256=CYCD_ajBY6Jt04E2bSEBZFRRIUZmNjF2gn6F0ZV5XuA,450
564
+ hyperpocket/server/auth/zinc.py,sha256=xgVV5lWP6YSEHTCmH0gipG5lh4Wvf716tHTnOvTTj3w,708
555
565
  hyperpocket/server/auth/zoom.py,sha256=kWp4MB4i9FKMA4ZYcj4g4_90Y1ZMEoAQTTjbb0rsMRs,703
556
- hyperpocket/server/tool/__init__.py,sha256=khNLe3H2W7WXKQlHjXuuvd9R87eHOAZhDsQmjDcbYsg,210
557
- hyperpocket/server/tool/wasm.py,sha256=VJyp6RGsq8llKT_sY6DhV52wsETu-W9bzJ7C9wC17Oo,1698
558
- hyperpocket/server/tool/dto/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
559
- hyperpocket/server/tool/dto/script.py,sha256=2z5_QFhmNtbuau0De0GYUS0K1t6o81od9QLmfr97iZM,852
560
566
  hyperpocket/session/README.md,sha256=Wmh-qWJQ-40vU9hP5jNxuM33i0STNfaIjOecba7H-oc,1968
561
567
  hyperpocket/session/__init__.py,sha256=ljqLlIMsrY9Hb8UOweaEvBM_Ku9IxBMMIXar6T7h5Lg,275
562
- hyperpocket/session/in_memory.py,sha256=Eb-oaFrA38iG7eO6SWpxsz36olgDD8OaE5mjxdvYwl4,3504
568
+ hyperpocket/session/in_memory.py,sha256=sYFBIc0w4sxSj28j9pkdtn_Oga8a-lsi4YJRvSFA_Jc,3799
563
569
  hyperpocket/session/interface.py,sha256=vQobJCzQe29uM6yXanRAysUhJvtfuUZ0qddMpeLn8NI,4964
564
570
  hyperpocket/session/redis.py,sha256=rbW2b0C6HUNp5HpTpr6sxDKZQCuPHu2ipCyn1TXjPgM,5444
565
571
  hyperpocket/tool/README.md,sha256=vbHvP3fnfihq-H481MiSZEVJNhVoUu0djENb9tiy78c,3026
566
- hyperpocket/tool/__init__.py,sha256=3rpvo5k76VX97gvnlHlCfi5TTtCZmzc7GuQORaJdUqU,347
567
- hyperpocket/tool/tool.py,sha256=CX_eAtpVRcF0H64u7qa7nZgkMa0DEKdVQj4HqF8f1GA,7365
572
+ hyperpocket/tool/__init__.py,sha256=ZwGG7_MfTUigAdHxdR-s3NMFm_QdJDoKNeVrTmFsZSo,253
573
+ hyperpocket/tool/tool.py,sha256=3ApLB7mpo_xCnpvQKE7KdxY7cHVweZ-iExJEkovyfbI,7029
574
+ hyperpocket/tool/dock/__init__.py,sha256=gEFaYTgTIzzaAHW6Bl1CJL8RQlU23NK--bojLqPTLSc,63
575
+ hyperpocket/tool/dock/dock.py,sha256=Uk3Lggmj_piGFiPVde2ZvRXOKncIYqjPaRQ3LD8DWT0,859
568
576
  hyperpocket/tool/function/README.md,sha256=6Y9a8FlFjEdbrVqF0NoQ1j34VoV8Zt6Pf9-xlLIHkTc,3676
569
- hyperpocket/tool/function/__init__.py,sha256=2zV5ojuzvv38B9J-5l6XomZ3x-8FTC0-Bow5FdioTIU,245
577
+ hyperpocket/tool/function/__init__.py,sha256=n0IYvfoyoFWv76iwK2kBC-X6468dl5XyYFl1mudYSe4,261
570
578
  hyperpocket/tool/function/annotation.py,sha256=mHm_TN2X7xmivBZ8_tbnsaGt_GUQZ-l2IPv0PudZKb8,982
571
- hyperpocket/tool/function/tool.py,sha256=FVEn8i3HJaG2S-LuBgRc4DJUYWWplsGs0nRmuVstLZQ,6280
579
+ hyperpocket/tool/function/tool.py,sha256=HwsTI__DapAoYxQMuy45ivD4Lxyd7_-MO0GHlqfuI5c,7466
572
580
  hyperpocket/tool/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
573
- hyperpocket/tool/wasm/README.md,sha256=DjHtzOS4oe4Mk39M8BfxE0N_hqds32KXx2OWJ2cJOGo,3866
574
- hyperpocket/tool/wasm/__init__.py,sha256=t6KwkMY0pwZheCf9Q-9Kt7HGHQU7U--b9TTKgNegWUY,72
575
- hyperpocket/tool/wasm/browser.py,sha256=JWn34P1ybPJCogBB85BePWFXM4AqOI2wSbIb5LcCXTs,1867
576
- hyperpocket/tool/wasm/invoker.py,sha256=jgW3XqdbAXgDjTlURmD2Xeh5qpjZgvB6PYzNlcdvfQc,1431
577
- hyperpocket/tool/wasm/script.py,sha256=qi7uYkXxMGV5aZTnUllqp-LoJtlUd3HNadYeqv4UGgc,4348
578
- hyperpocket/tool/wasm/tool.py,sha256=sw0njNvucoXRikKHzALWec_w04LjUVZfTpvL5xAVeGE,5241
579
- hyperpocket/tool/wasm/templates/__init__.py,sha256=YWHy035YflIbQsQth0VCQoqO1PQ0aKmG6vYIkTLv2XA,920
580
- hyperpocket/tool/wasm/templates/node.py,sha256=4nSrKX1Qc7WH_yIJ-56xdRjd-1Xmrvf4sR0CphggMGE,2783
581
- hyperpocket/tool/wasm/templates/python.py,sha256=rhJTzb1jULiyhTBIhMesy_-Sc-Z9lLkgFM37RjWSYrw,2734
582
581
  hyperpocket/util/__init__.py,sha256=7vN8c7dy7nhGhjXtSUGAsc6GIlUnuBMvXSl1yW1M4js,35
583
582
  hyperpocket/util/extract_func_param_desc_from_docstring.py,sha256=eGDrbigmVg1zaud1q5l2WDZkYqzy56TRznNPouc8i_Y,4170
584
583
  hyperpocket/util/find_all_leaf_class_in_package.py,sha256=06n8R47BDPovxhCOnzu9GuEfeQzEbv-HdG-zfMu1gBw,533
585
584
  hyperpocket/util/find_all_subclass_in_package.py,sha256=TtEb41-nzCNhC9pgelTS6MMxLT_JNZkFPJe5z2H9yik,978
586
585
  hyperpocket/util/flatten_json_schema.py,sha256=iuNBEmMSKFtPi-uqo6fb3RWN0koHOAihWAAofWbd1U8,1671
587
586
  hyperpocket/util/function_to_model.py,sha256=TXUs-qPbzL8C9-qqpz4Ad4D9MOPP61n_p0iPU6SoBeM,2318
587
+ hyperpocket/util/generate_slug.py,sha256=gwwf9gfTlqribrvybMQQj7VIHX5FspVoTm5-EYH-X74,150
588
588
  hyperpocket/util/get_objects_from_subpackage.py,sha256=4mR_S8eaJSdU68YfCkiXeIcXxb6q7LjFGsY_IHeNIZw,929
589
- hyperpocket/util/json_schema_to_model.py,sha256=PqI87pU5dWwcrQWB8eQxRdfgAEvvC1x_DKZnhcsRV-o,3586
590
- hyperpocket-0.3.6.dist-info/METADATA,sha256=LGGLNW4eXKm114TkCo2gSabG11oM_nPDYU4z8skNt98,12958
591
- hyperpocket-0.3.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
592
- hyperpocket-0.3.6.dist-info/entry_points.txt,sha256=KpBleaYr0SaENXOa-dFvJ_cvFCHYFEQ4LMl11ShAcBI,61
593
- hyperpocket-0.3.6.dist-info/RECORD,,
589
+ hyperpocket/util/json_schema_to_model.py,sha256=BNTFYzBK-yZr2VkO6lAdZkXdZXfGSabzWa3DM6it4KI,3731
590
+ hyperpocket-0.4.0.dist-info/METADATA,sha256=ldzb1IY6csgV76cTF-pXdYOiqkmxV-xR-fsEEgy5KRg,13074
591
+ hyperpocket-0.4.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
592
+ hyperpocket-0.4.0.dist-info/entry_points.txt,sha256=KpBleaYr0SaENXOa-dFvJ_cvFCHYFEQ4LMl11ShAcBI,61
593
+ hyperpocket-0.4.0.dist-info/RECORD,,
hyperpocket/cli/sync.py DELETED
@@ -1,17 +0,0 @@
1
- import pathlib
2
- from typing import Optional
3
-
4
- import click
5
-
6
- import hyperpocket.repository as repository
7
-
8
-
9
- @click.command()
10
- @click.option("--lockfile", envvar="PATHS", type=click.Path(exists=True))
11
- @click.option("--force-update", type=str, default="HEAD")
12
- def sync(lockfile: Optional[pathlib.Path], force_update: bool):
13
- if not lockfile:
14
- lockfile = pathlib.Path.cwd() / "pocket.lock"
15
- if not lockfile.exists():
16
- lockfile.touch()
17
- repository.sync(repository.Lockfile(path=lockfile), force_update)
@@ -1,240 +0,0 @@
1
- import abc
2
- import pathlib
3
- import shutil
4
- from typing import Optional, Tuple, ClassVar
5
-
6
- import git
7
- from pydantic import BaseModel, Field
8
- from pydantic.fields import ModelPrivateAttr
9
-
10
- from hyperpocket.config import pocket_logger, settings
11
-
12
-
13
- class Lock(BaseModel, abc.ABC):
14
- tool_source: str = None
15
-
16
- @abc.abstractmethod
17
- def __str__(self):
18
- raise NotImplementedError
19
-
20
- @abc.abstractmethod
21
- def key(self) -> tuple[str, ...]:
22
- raise NotImplementedError
23
-
24
- @abc.abstractmethod
25
- def sync(self, **kwargs):
26
- raise NotImplementedError
27
-
28
- @abc.abstractmethod
29
- def toolpkg_path(self) -> pathlib.Path:
30
- raise NotImplementedError
31
-
32
- def eject_to_path(self, dest_path: pathlib.Path, src_sub_path: str = None):
33
- ## local locks are already tracked by git
34
- raise NotImplementedError
35
-
36
-
37
- class LocalLock(Lock):
38
- tool_source: str = Field(default="local")
39
- tool_path: str
40
-
41
- def __init__(self, tool_path: str):
42
- super().__init__(
43
- tool_source="local", tool_path=str(pathlib.Path(tool_path).resolve())
44
- )
45
-
46
- def __str__(self):
47
- return f"local\t{self.tool_path}"
48
-
49
- def key(self):
50
- return self.tool_source, self.tool_path.rstrip("/")
51
-
52
- def sync(self, **kwargs):
53
- pocket_logger.info(f"Syncing path: {self.tool_path} ...")
54
- pkg_path = self.toolpkg_path()
55
- if pkg_path.exists():
56
- shutil.rmtree(pkg_path)
57
- shutil.copytree(self.tool_path, pkg_path)
58
-
59
- def toolpkg_path(self) -> pathlib.Path:
60
- pocket_pkgs = settings.toolpkg_path
61
- return pocket_pkgs / "local" / self.tool_path[1:]
62
-
63
-
64
- class GitLock(Lock):
65
- _remote_cache: ClassVar[dict[str, dict[str, str]]]
66
- tool_source: str = "git"
67
- repository_url: str
68
- git_ref: str
69
- ref_sha: Optional[str] = None
70
-
71
- def __str__(self):
72
- return f"git\t{self.repository_url}\t{self.git_ref}\t{self.ref_sha}"
73
-
74
- def key(self):
75
- return self.tool_source, self.repository_url.rstrip("/"), self.git_ref
76
-
77
- def toolpkg_path(self) -> pathlib.Path:
78
- if not self.ref_sha:
79
- raise ValueError("ref_sha is not set")
80
- cleansed_url = self.repository_url
81
- if self.repository_url.startswith("http://"):
82
- cleansed_url = self.repository_url[7:]
83
- elif self.repository_url.startswith("https://"):
84
- cleansed_url = self.repository_url[8:]
85
- elif self.repository_url.startswith("git@"):
86
- cleansed_url = self.repository_url[4:]
87
- return settings.toolpkg_path / cleansed_url / self.ref_sha
88
-
89
- def sync(self, force_update: bool = False, **kwargs):
90
- """
91
- Synchronize the local git repository with the target remote branch.
92
-
93
- 1. Check if the SHA of the target ref in the remote repository matches the current local SHA.
94
- 2. If they do not match, fetch the target ref from the remote repository and do a hard reset
95
- to align the local repository with the remote version.
96
- """
97
- try:
98
- pocket_logger.info(
99
- f"Syncing git: {self.repository_url} @ ref: {self.git_ref} ..."
100
- )
101
-
102
- # get new sha from refs
103
- new_sha = self._get_new_sha_if_exists_in_remote()
104
- if new_sha is None:
105
- raise ValueError(
106
- f"Could not find ref {self.git_ref} in {self.repository_url}"
107
- )
108
-
109
- # check self.ref_sha should be updated
110
- if self.ref_sha != new_sha:
111
- if force_update or self.ref_sha is None:
112
- self.ref_sha = new_sha
113
-
114
- # make pkg_version_path dir if not exists
115
- pkg_version_path = self.toolpkg_path()
116
- if not pkg_version_path.exists():
117
- pkg_version_path.mkdir(parents=True)
118
-
119
- # init git repo in local and set origin url
120
- repo = git.Repo.init(pkg_version_path)
121
- try:
122
- remote = repo.remote("origin")
123
- remote.set_url(self.repository_url)
124
- except ValueError:
125
- remote = repo.create_remote("origin", self.repository_url)
126
-
127
- # check current local commit include new_sha
128
- # if not included, fetch and do hard reset
129
- exist_sha = None
130
- try:
131
- exist_sha = repo.head.commit.hexsha
132
- except ValueError:
133
- pass
134
- if exist_sha is None or exist_sha != self.ref_sha:
135
- remote.fetch(depth=1, refspec=self.ref_sha)
136
- repo.git.checkout(new_sha)
137
- repo.git.reset("--hard", new_sha)
138
- repo.git.clean("-fd")
139
- except Exception as e:
140
- pocket_logger.error(
141
- f"failed to sync git: {self.repository_url} @ ref: {self.git_ref}. reason : {e}"
142
- )
143
- raise e
144
-
145
- def _get_new_sha_if_exists_in_remote(self):
146
- """
147
- get new sha in refs
148
- First, check remote sha is matched to saved ref_sha
149
- Second, check remote ref name is matched to saved ref name
150
- Third, check local ref name is matched to saved ref name
151
- And last, check tag ref name is matched to saved ref name
152
- """
153
- refs = git.cmd.Git().ls_remote(self.repository_url)
154
-
155
- new_sha = None
156
- for r in refs.split("\n"):
157
- sha, ref = r.split("\t")
158
- if sha == self.ref_sha:
159
- new_sha = sha
160
- break
161
- elif ref == self.git_ref:
162
- new_sha = sha
163
- break
164
- elif ref == f"refs/heads/{self.git_ref}":
165
- new_sha = sha
166
- break
167
- elif ref == f"refs/tags/{self.git_ref}":
168
- new_sha = sha
169
- break
170
- return new_sha
171
-
172
- @classmethod
173
- def get_git_branches(cls, repo_url):
174
- if not hasattr(cls, "_remote_cache"):
175
- cls._remote_cache = {}
176
- if cls._remote_cache.get(repo_url) is None:
177
- ls_lists = git.cmd.Git().ls_remote(repo_url)
178
-
179
- branches = {}
180
- for line in ls_lists.split("\n"):
181
- sha, ref = line.split("\t")
182
- if ref.startswith("refs/heads/"):
183
- branch_name = ref.replace("refs/heads/", "")
184
- branches[branch_name] = sha
185
- cls._remote_cache[repo_url] = branches
186
- return cls._remote_cache[repo_url]
187
-
188
- @classmethod
189
- def parse_repo_url(cls, repo_url: str) -> Tuple[str, str, str]:
190
- """
191
- Parses a GitHub repository URL with optional branch and path information.
192
-
193
- Returns:
194
- Tuple[str, str, str]: base_repo, branch_name, directory_path
195
- """
196
- if not repo_url.startswith("https://github.com/"):
197
- raise AttributeError("Only GitHub URLs are supported")
198
-
199
- # Remove the base URL and split the path
200
- repo_path = repo_url.removeprefix("https://github.com/")
201
- repo_path_list = repo_path.split("/")
202
-
203
- # Check if the URL contains 'tree' (indicating branch and sub-path information)
204
- if "tree" not in repo_path_list:
205
- # If no 'tree', return the full repository URL
206
- return repo_url, "HEAD", ""
207
-
208
- # Parse base repo URL and remaining path
209
- tree_index = repo_path_list.index("tree")
210
- base_repo = f"https://github.com/{'/'.join(repo_path_list[:tree_index])}"
211
- sub_path = repo_path_list[tree_index + 1 :]
212
-
213
- # Fetch branch information
214
- branches = cls.get_git_branches(base_repo)
215
-
216
- # Find branch and sub-directory path
217
- for idx in range(1, len(sub_path) + 1):
218
- branch_name = "/".join(sub_path[:idx])
219
- if branch_name in branches:
220
- directory_path = (
221
- "/".join(sub_path[idx:]) if idx < len(sub_path) else None
222
- )
223
- return base_repo, branch_name, directory_path
224
-
225
- # If no valid branch is found, raise an error
226
- raise ValueError("Branch not found in repository")
227
-
228
- def eject_to_path(self, dest_path: pathlib.Path, src_sub_path: str = None):
229
- # clone the git repository to the target path
230
- pocket_logger.info(
231
- f"Ejecting git: {self.repository_url} @ ref: {self.git_ref} source in path: {src_sub_path} to {dest_path} ..."
232
- )
233
- if dest_path.exists():
234
- shutil.rmtree(dest_path)
235
-
236
- if src_sub_path:
237
- src_path = self.toolpkg_path() / src_sub_path
238
- else:
239
- src_path = self.toolpkg_path()
240
- shutil.copytree(src_path, dest_path)
@@ -1,62 +0,0 @@
1
- import pathlib
2
- from concurrent.futures.thread import ThreadPoolExecutor
3
-
4
- from hyperpocket.repository.lock import GitLock, LocalLock, Lock
5
-
6
-
7
- class Lockfile:
8
- path: pathlib.Path = None
9
- locks: dict[tuple, Lock] = None
10
- referenced_locks: set[tuple] = None
11
-
12
- def __init__(self, path: pathlib.Path):
13
- self.path = path
14
- self.locks = {}
15
- self.referenced_locks = set()
16
- if self.path.exists():
17
- with open(self.path, "r") as f:
18
- for line in f:
19
- split = line.strip().split("\t")
20
- source = split[0]
21
- if source == "local":
22
- lock = LocalLock(tool_path=split[1])
23
- elif source == "git":
24
- lock = GitLock(
25
- repository_url=split[1],
26
- git_ref=split[2],
27
- ref_sha=split[3],
28
- )
29
- else:
30
- raise ValueError(f"Unknown tool source: {source}")
31
- self.locks[lock.key()] = lock
32
- else:
33
- self.path.touch()
34
-
35
- def add_lock(self, lock: Lock):
36
- if lock.key() not in self.locks:
37
- self.locks[lock.key()] = lock
38
- self.referenced_locks.add(lock.key())
39
-
40
- def remove_lock(self, key: tuple[str, ...]):
41
- self.locks.pop(key)
42
- if key in self.referenced_locks:
43
- self.referenced_locks.remove(key)
44
-
45
- def get_lock(self, key: tuple[str, ...]):
46
- return self.locks[key]
47
-
48
- def sync(self, force_update: bool, referenced_only: bool = False):
49
- if referenced_only:
50
- locks = [self.get_lock(key) for key in self.referenced_locks]
51
- else:
52
- locks = list(self.locks.values())
53
- with ThreadPoolExecutor(
54
- max_workers=min(len(locks) + 1, 100), thread_name_prefix="repository_loader"
55
- ) as executor:
56
- executor.map(lambda lock: lock.sync(force_update=force_update), locks)
57
- self.write()
58
-
59
- def write(self):
60
- with open(self.path, "w") as f:
61
- for lock in self.locks.values():
62
- f.write(str(lock) + "\n")
@@ -1,10 +0,0 @@
1
- from fastapi import APIRouter
2
-
3
- from hyperpocket.server.tool.wasm import wasm_tool_router
4
-
5
- tool_router = APIRouter(
6
- prefix="/tools",
7
- )
8
- tool_router.include_router(wasm_tool_router)
9
-
10
- __all__ = ["tool_router"]
@@ -1,33 +0,0 @@
1
- from typing import Optional
2
-
3
- from pydantic import BaseModel, Field
4
-
5
- from hyperpocket.tool.wasm.script import ScriptFileNode
6
-
7
-
8
- class Script(BaseModel):
9
- id: str = Field(alias="id")
10
- tool_id: str = Field(alias="tool_id")
11
-
12
-
13
- class ScriptResult(BaseModel):
14
- stdout: Optional[str] = Field(alias="stdout", default=None)
15
- stderr: Optional[str] = Field(alias="stderr", default=None)
16
- error: Optional[str] = Field(alias="error", default=None)
17
-
18
-
19
- class ScriptFileTree(BaseModel):
20
- tree: dict[str, ScriptFileNode] = Field(alias="tree")
21
-
22
-
23
- class ScriptEntrypoint(BaseModel):
24
- package_name: Optional[str] = Field(alias="package_name")
25
- entrypoint: str = Field(alias="entrypoint")
26
-
27
-
28
- class ScriptEncodedFile(BaseModel):
29
- encoded_file: str = Field(alias="encoded_file")
30
-
31
-
32
- class ScriptFileRequest(BaseModel):
33
- path: str = Field(alias="path")
@@ -1,46 +0,0 @@
1
- from fastapi import APIRouter
2
- from fastapi.responses import FileResponse, HTMLResponse
3
-
4
- from hyperpocket.futures import FutureStore
5
- from hyperpocket.server.tool.dto import script as scriptdto
6
- from hyperpocket.tool.wasm.script import ScriptStore
7
-
8
- wasm_tool_router = APIRouter(prefix="/wasm")
9
-
10
-
11
- @wasm_tool_router.get("/scripts/{script_id}/browse", response_class=HTMLResponse)
12
- async def browse_script_page(script_id: str):
13
- html = ScriptStore.get_script(script_id).rendered_html
14
- return HTMLResponse(content=html)
15
-
16
-
17
- @wasm_tool_router.post("/scripts/{script_id}/done")
18
- async def done_script_page(
19
- script_id: str, req: scriptdto.ScriptResult
20
- ) -> scriptdto.ScriptResult:
21
- FutureStore.resolve_future(
22
- script_id, {"stdout": req.stdout, "stderr": req.stderr, "error": req.error}
23
- )
24
- return req
25
-
26
-
27
- @wasm_tool_router.get("/scripts/{script_id}/file_tree")
28
- async def get_file_tree(script_id: str) -> scriptdto.ScriptFileTree:
29
- script = ScriptStore.get_script(script_id)
30
- return scriptdto.ScriptFileTree(tree=script.load_file_tree())
31
-
32
-
33
- @wasm_tool_router.get("/scripts/{script_id}/entrypoint")
34
- async def get_entrypoint(script_id: str) -> scriptdto.ScriptEntrypoint:
35
- script = ScriptStore.get_script(script_id)
36
- package_name = script.package_name
37
- entrypoint = f"/tools/wasm/scripts/{script_id}/file/{script.entrypoint}"
38
- return scriptdto.ScriptEntrypoint(package_name=package_name, entrypoint=entrypoint)
39
-
40
-
41
- @wasm_tool_router.get(
42
- "/scripts/{script_id}/file/{file_name}", response_class=FileResponse
43
- )
44
- async def get_dist_file(script_id: str, file_name: str):
45
- script = ScriptStore.get_script(script_id)
46
- return FileResponse(script.dist_file_path(file_name))