hyperpocket 0.1.8__tar.gz → 0.1.10__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (156) hide show
  1. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/.gitignore +1 -0
  2. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/PKG-INFO +27 -38
  3. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/README.md +25 -36
  4. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/config/settings.py +12 -8
  5. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/pocket_core.py +4 -2
  6. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/pocket_main.py +3 -1
  7. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/repository/lock.py +52 -1
  8. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/server/server.py +8 -8
  9. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/tool/function/tool.py +31 -37
  10. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/tool/tool.py +42 -33
  11. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/tool/wasm/browser.py +2 -7
  12. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/util/extract_func_param_desc_from_docstring.py +11 -8
  13. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/util/json_schema_to_model.py +2 -0
  14. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/pyproject.toml +7 -3
  15. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/tests/test_pocket.py +25 -16
  16. {hyperpocket-0.1.8/hyperpocket/tool/tests → hyperpocket-0.1.10/tests/tool}/test_function_tool.py +4 -4
  17. hyperpocket-0.1.10/tests/utils/test_extract_func_param_desc_from_docstring.py +214 -0
  18. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/uv.lock +80 -1
  19. hyperpocket-0.1.8/tests/tool/test_function_tool.py +0 -266
  20. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/__init__.py +0 -0
  21. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/__init__.py +0 -0
  22. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/README.md +0 -0
  23. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/__init__.py +0 -0
  24. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/calendly/__init__.py +0 -0
  25. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/calendly/context.py +0 -0
  26. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/calendly/oauth2_context.py +0 -0
  27. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/calendly/oauth2_handler.py +0 -0
  28. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/calendly/oauth2_schema.py +0 -0
  29. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/context.py +0 -0
  30. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/github/__init__.py +0 -0
  31. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/github/context.py +0 -0
  32. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/github/oauth2_context.py +0 -0
  33. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/github/oauth2_handler.py +0 -0
  34. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/github/oauth2_schema.py +0 -0
  35. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/github/token_context.py +0 -0
  36. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/github/token_handler.py +0 -0
  37. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/github/token_schema.py +0 -0
  38. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/google/__init__.py +0 -0
  39. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/google/context.py +0 -0
  40. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/google/oauth2_context.py +0 -0
  41. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/google/oauth2_handler.py +0 -0
  42. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/google/oauth2_schema.py +0 -0
  43. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/gumloop/__init__.py +0 -0
  44. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/gumloop/context.py +0 -0
  45. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/gumloop/token_context.py +0 -0
  46. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/gumloop/token_handler.py +0 -0
  47. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/gumloop/token_schema.py +0 -0
  48. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/handler.py +0 -0
  49. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/linear/__init__.py +0 -0
  50. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/linear/context.py +0 -0
  51. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/linear/token_context.py +0 -0
  52. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/linear/token_handler.py +0 -0
  53. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/linear/token_schema.py +0 -0
  54. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/notion/README.md +0 -0
  55. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/notion/__init__.py +0 -0
  56. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/notion/context.py +0 -0
  57. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/notion/token_context.py +0 -0
  58. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/notion/token_handler.py +0 -0
  59. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/notion/token_schema.py +0 -0
  60. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/provider.py +0 -0
  61. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/reddit/__init__.py +0 -0
  62. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/reddit/context.py +0 -0
  63. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/reddit/oauth2_context.py +0 -0
  64. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/reddit/oauth2_handler.py +0 -0
  65. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/reddit/oauth2_schema.py +0 -0
  66. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/schema.py +0 -0
  67. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/slack/__init__.py +0 -0
  68. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/slack/context.py +0 -0
  69. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/slack/oauth2_context.py +0 -0
  70. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/slack/oauth2_handler.py +0 -0
  71. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/slack/oauth2_schema.py +0 -0
  72. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/slack/token_context.py +0 -0
  73. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/slack/token_handler.py +0 -0
  74. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/auth/slack/token_schema.py +0 -0
  75. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/builtin.py +0 -0
  76. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/cli/__init__.py +0 -0
  77. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/cli/__main__.py +0 -0
  78. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/cli/auth.py +0 -0
  79. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/cli/codegen/__init__.py +0 -0
  80. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/cli/codegen/auth/__init__.py +0 -0
  81. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/cli/codegen/auth/auth_context_template.py +0 -0
  82. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/cli/codegen/auth/auth_token_context_template.py +0 -0
  83. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/cli/codegen/auth/auth_token_handler_template.py +0 -0
  84. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/cli/codegen/auth/auth_token_schema_template.py +0 -0
  85. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/cli/codegen/auth/server_auth_template.py +0 -0
  86. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/cli/eject.py +0 -0
  87. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/cli/pull.py +0 -0
  88. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/cli/sync.py +0 -0
  89. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/config/__init__.py +0 -0
  90. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/config/auth.py +0 -0
  91. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/config/git.py +0 -0
  92. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/config/logger.py +0 -0
  93. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/config/session.py +0 -0
  94. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/constants.py +0 -0
  95. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/futures/__init__.py +0 -0
  96. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/futures/futurestore.py +0 -0
  97. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/pocket_auth.py +0 -0
  98. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/prompts.py +0 -0
  99. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/repository/__init__.py +0 -0
  100. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/repository/lockfile.py +0 -0
  101. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/repository/repository.py +0 -0
  102. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/server/__init__.py +0 -0
  103. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/server/auth/__init__.py +0 -0
  104. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/server/auth/calendly.py +0 -0
  105. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/server/auth/github.py +0 -0
  106. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/server/auth/google.py +0 -0
  107. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/server/auth/gumloop.py +0 -0
  108. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/server/auth/linear.py +0 -0
  109. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/server/auth/notion.py +0 -0
  110. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/server/auth/reddit.py +0 -0
  111. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/server/auth/slack.py +0 -0
  112. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/server/auth/token.py +0 -0
  113. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/server/proxy.py +0 -0
  114. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/server/tool/__init__.py +0 -0
  115. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/server/tool/dto/__init__.py +0 -0
  116. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/server/tool/dto/script.py +0 -0
  117. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/server/tool/wasm.py +0 -0
  118. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/session/README.md +0 -0
  119. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/session/__init__.py +0 -0
  120. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/session/in_memory.py +0 -0
  121. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/session/interface.py +0 -0
  122. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/session/redis.py +0 -0
  123. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/tool/README.md +0 -0
  124. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/tool/__init__.py +0 -0
  125. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/tool/function/README.md +0 -0
  126. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/tool/function/__init__.py +0 -0
  127. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/tool/function/annotation.py +0 -0
  128. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/tool/tests/__init__.py +0 -0
  129. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/tool/wasm/README.md +0 -0
  130. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/tool/wasm/__init__.py +0 -0
  131. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/tool/wasm/invoker.py +0 -0
  132. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/tool/wasm/script.py +0 -0
  133. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/tool/wasm/templates/__init__.py +0 -0
  134. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/tool/wasm/templates/node.py +0 -0
  135. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/tool/wasm/templates/python.py +0 -0
  136. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/tool/wasm/tool.py +0 -0
  137. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/tool_like.py +0 -0
  138. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/util/__init__.py +0 -0
  139. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/util/find_all_leaf_class_in_package.py +0 -0
  140. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/util/find_all_subclass_in_package.py +0 -0
  141. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/util/flatten_json_schema.py +0 -0
  142. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/util/function_to_model.py +0 -0
  143. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/hyperpocket/util/get_objects_from_subpackage.py +0 -0
  144. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/tests/__init__.py +0 -0
  145. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/tests/auth/__init__.py +0 -0
  146. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/tests/auth/test_google_oauth2_handler.py +0 -0
  147. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/tests/auth/test_gumloop_token_handler.py +0 -0
  148. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/tests/auth/test_notion_token_handler.py +0 -0
  149. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/tests/auth/test_slack_oauth2_handler.py +0 -0
  150. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/tests/auth/test_slack_token_handler.py +0 -0
  151. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/tests/session/__init__.py +0 -0
  152. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/tests/session/test_in_memory.py +0 -0
  153. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/tests/session/test_redis.py +0 -0
  154. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/tests/test_pocket_auth.py +0 -0
  155. {hyperpocket-0.1.8 → hyperpocket-0.1.10}/tests/tool/__init__.py +0 -0
  156. {hyperpocket-0.1.8/hyperpocket/tool/tests → hyperpocket-0.1.10/tests/tool}/test_wasm_tool.py +0 -0
@@ -14,6 +14,7 @@ __pycache__/
14
14
  build/
15
15
  develop-eggs/
16
16
  dist/
17
+ !tools/**/dist/
17
18
  downloads/
18
19
  eggs/
19
20
  .eggs/
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hyperpocket
3
- Version: 0.1.8
3
+ Version: 0.1.10
4
4
  Summary: Building AI agent with hyperpocket tool in a flash
5
5
  Project-URL: Homepage, https://vessl-ai.github.io/hyperpocket
6
6
  Project-URL: Repository, https://github.com/vessl-ai/hyperpocket
7
- Author-email: VESSL AI Devs <dev@vessl.ai>
7
+ Author-email: Hyperpocket Team <hyperpocket@vessl.ai>
8
8
  Requires-Python: >=3.10
9
9
  Requires-Dist: click>=8.1.7
10
10
  Requires-Dist: dynaconf>=3.2.6
@@ -23,20 +23,19 @@ Requires-Dist: toml>=0.10.2
23
23
  Requires-Dist: uvicorn>=0.32.1
24
24
  Description-Content-Type: text/markdown
25
25
 
26
- # Pocket 👛
26
+ # Hyperpocket 👛
27
27
 
28
- Pocket is where tools belong. Power your agent up with a pocket of tools. 👛
28
+ Hyperpocket is where tools belong. Power your agent up with a pocket of tools. 👛
29
29
 
30
30
  <figure>
31
- <img src="image.png" alt="4d-pocket" width="200"/>
32
- <figcaption>© Doraemon</figcaption>
31
+ <img src="../../logo.png" alt="hyperpocket" width="200"/>
33
32
  </figure>
34
33
 
35
34
  ## Introduction
36
35
 
37
- Pocket is a tool that allows you to easily use tool and auth for agents on your machine.
36
+ Hyperpocket is a tool that allows you to easily use tool and auth for agents on your machine.
38
37
 
39
- **_Start fast._** Just install Pocket and use it. We know you don't have time to authenticate to our server.
38
+ **_Start fast._** Just install Hyperpocket and use it. We know you don't have time to authenticate to our server.
40
39
 
41
40
  **_Go securely._** Not like others, you are the only one who knows your secret tokens. We do NOT. All of your secret
42
41
  tokens belong to your infrastructure, not ours.
@@ -47,11 +46,6 @@ with the dependency spaghetti.
47
46
 
48
47
  **_Battery Included_** You can use popular tools and authentication providers out-of-the-box.
49
48
 
50
- <figure>
51
- <img src="pocket1.png" alt="pocket-flow" width="400"/>
52
- <figcaption></figcaption>
53
- </figure>
54
-
55
49
  ## Installation
56
50
 
57
51
  1. install hyperpocket
@@ -82,16 +76,16 @@ Or just use LLM API Clients out of the box.
82
76
  ### Using out-of-the-box tools
83
77
 
84
78
  ```python
85
- from hyperpocket.tool import from_git
79
+
86
80
  from langchain_openai import ChatOpenAI
87
81
 
88
82
  from hyperpocket_langchain import PocketLangchain
89
83
 
90
84
  pklc = PocketLangchain(
91
- tools=[
92
- from_git("https://github.com/vessl-ai/hyperawesometools", "main", "managed-tools/slack/get-message"),
93
- from_git("https://github.com/vessl-ai/hyperawesometools", "main", "managed-tools/slack/post-message"),
94
- ]
85
+ tools=[
86
+ "https://github.com/vessl-ai/hyperpocket/tree/main/tools/slack/get-message",
87
+ "https://github.com/vessl-ai/hyperpocket/tree/main/tools/slack/post-message",
88
+ ]
95
89
  )
96
90
  tools = pklc.get_tools()
97
91
 
@@ -104,7 +98,7 @@ llm_tool_binding.invoke(...)
104
98
 
105
99
  There are two kinds of auth process, one is using system auth(developer api key) and the other is using end user auth.
106
100
 
107
- Pocket provides way to use end user auth easily.
101
+ Hyperpocket provides way to use end user auth easily.
108
102
  (Of course, you can also just set your STRIPE_API_KEY when using Stripe API related tools)
109
103
 
110
104
  - Supported methods
@@ -130,7 +124,7 @@ Pocket provides way to use end user auth easily.
130
124
  You can manage your auths in request-wise level. (e.g. you can use different auths for different requests)
131
125
 
132
126
  ```python
133
- from hyperpocket.tool import from_git
127
+
134
128
  from langchain_openai import ChatOpenAI
135
129
  from langgraph.graph import StateGraph, START, MessagesState
136
130
  from langgraph.prebuilt import tools_condition
@@ -138,10 +132,10 @@ from langgraph.prebuilt import tools_condition
138
132
  from hyperpocket_langgraph import PocketLanggraph
139
133
 
140
134
  pklg = PocketLanggraph(
141
- tools=[
142
- from_git("https://github.com/vessl-ai/hyperawesometools", "main", "managed-tools/slack/get-message"),
143
- from_git("https://github.com/vessl-ai/hyperawesometools", "main", "managed-tools/slack/post-message"),
144
- ],
135
+ tools=[
136
+ "https://github.com/vessl-ai/hyperpocket/tree/main/tools/slack/get-message",
137
+ "https://github.com/vessl-ai/hyperpocket/tree/main/tools/slack/post-message",
138
+ ],
145
139
  )
146
140
  llm = ChatOpenAI()
147
141
 
@@ -166,22 +160,21 @@ graph_builder.compile()
166
160
  ```
167
161
 
168
162
  ```python
169
- from hyperpocket.config import secret
170
- from hyperpocket.tool import from_git
171
163
  from llama_index.core.agent import FunctionCallingAgent
172
164
  from llama_index.llms.openai import OpenAI
173
165
 
166
+ from hyperpocket.config import secret
174
167
  from hyperpocket_llamaindex import PocketLlamaindex
175
168
 
176
169
  llm = OpenAI(api_key=secret["OPENAI_API_KEY"])
177
170
  pocket = PocketLlamaindex(
178
- tools=[
179
- from_git("https://github.com/vessl-ai/hyperawesometools", "main", "managed-tools/slack/get-message"),
180
- from_git("https://github.com/vessl-ai/hyperawesometools", "main", "managed-tools/slack/post-message"),
181
- from_git("https://github.com/vessl-ai/hyperawesometools", "main", "managed-tools/linear/get-issues"),
182
- from_git("https://github.com/vessl-ai/hyperawesometools", "main", "managed-tools/google/get-calendar-events"),
183
- from_git("https://github.com/vessl-ai/hyperawesometools", "main", "managed-tools/google/get-calendar-list"),
184
- ]
171
+ tools=[
172
+ "https://github.com/vessl-ai/hyperpocket/tree/main/tools/slack/get-message",
173
+ "https://github.com/vessl-ai/hyperpocket/tree/main/tools/slack/post-message",
174
+ "https://github.com/vessl-ai/hyperpocket/tree/main/tools/linear/get-issues",
175
+ "https://github.com/vessl-ai/hyperpocket/tree/main/tools/google/get-calendar-events",
176
+ "https://github.com/vessl-ai/hyperpocket/tree/main/tools/google/get-calendar-list",
177
+ ]
185
178
  )
186
179
  tools = pocket.get_tools()
187
180
 
@@ -218,12 +211,8 @@ Assistance: Here are the recent 10 messages.
218
211
 
219
212
  ### Config
220
213
 
221
- Running `pocket config init` will create your config file in `$HOME/.pocket/settings.toml`
222
-
223
214
  The `settings.toml` looks as follows.
224
215
 
225
- TODO: Add `secrets.toml`.
226
-
227
216
  ```toml
228
217
  log_level = "debug"
229
218
  internal_server_port = "8000" # optional, default is 8000
@@ -265,7 +254,7 @@ client_secret = "" # your github client secret
265
254
  - While creating your github OAuth app, configuring your app's `Authorization callback URL` is different for your
266
255
  development environment and production environment.
267
256
  - For development environment, you can use `http://localhost:8000/auth/github/callback`
268
- - **Note**: Default port for pocket dev server is `8000`. If you are using a different port, make sure to
257
+ - **Note**: Default port for hyperpocket dev server is `8000`. If you are using a different port, make sure to
269
258
  replace `8000` with your actual port number.
270
259
  - For production environment, you can use `https://yourdomain.com/auth/github/callback`
271
260
  - **Note**: Make sure to replace `yourdomain.com` with your actual domain name that this app will be hosted on.
@@ -1,17 +1,16 @@
1
- # Pocket 👛
1
+ # Hyperpocket 👛
2
2
 
3
- Pocket is where tools belong. Power your agent up with a pocket of tools. 👛
3
+ Hyperpocket is where tools belong. Power your agent up with a pocket of tools. 👛
4
4
 
5
5
  <figure>
6
- <img src="image.png" alt="4d-pocket" width="200"/>
7
- <figcaption>© Doraemon</figcaption>
6
+ <img src="../../logo.png" alt="hyperpocket" width="200"/>
8
7
  </figure>
9
8
 
10
9
  ## Introduction
11
10
 
12
- Pocket is a tool that allows you to easily use tool and auth for agents on your machine.
11
+ Hyperpocket is a tool that allows you to easily use tool and auth for agents on your machine.
13
12
 
14
- **_Start fast._** Just install Pocket and use it. We know you don't have time to authenticate to our server.
13
+ **_Start fast._** Just install Hyperpocket and use it. We know you don't have time to authenticate to our server.
15
14
 
16
15
  **_Go securely._** Not like others, you are the only one who knows your secret tokens. We do NOT. All of your secret
17
16
  tokens belong to your infrastructure, not ours.
@@ -22,11 +21,6 @@ with the dependency spaghetti.
22
21
 
23
22
  **_Battery Included_** You can use popular tools and authentication providers out-of-the-box.
24
23
 
25
- <figure>
26
- <img src="pocket1.png" alt="pocket-flow" width="400"/>
27
- <figcaption></figcaption>
28
- </figure>
29
-
30
24
  ## Installation
31
25
 
32
26
  1. install hyperpocket
@@ -57,16 +51,16 @@ Or just use LLM API Clients out of the box.
57
51
  ### Using out-of-the-box tools
58
52
 
59
53
  ```python
60
- from hyperpocket.tool import from_git
54
+
61
55
  from langchain_openai import ChatOpenAI
62
56
 
63
57
  from hyperpocket_langchain import PocketLangchain
64
58
 
65
59
  pklc = PocketLangchain(
66
- tools=[
67
- from_git("https://github.com/vessl-ai/hyperawesometools", "main", "managed-tools/slack/get-message"),
68
- from_git("https://github.com/vessl-ai/hyperawesometools", "main", "managed-tools/slack/post-message"),
69
- ]
60
+ tools=[
61
+ "https://github.com/vessl-ai/hyperpocket/tree/main/tools/slack/get-message",
62
+ "https://github.com/vessl-ai/hyperpocket/tree/main/tools/slack/post-message",
63
+ ]
70
64
  )
71
65
  tools = pklc.get_tools()
72
66
 
@@ -79,7 +73,7 @@ llm_tool_binding.invoke(...)
79
73
 
80
74
  There are two kinds of auth process, one is using system auth(developer api key) and the other is using end user auth.
81
75
 
82
- Pocket provides way to use end user auth easily.
76
+ Hyperpocket provides way to use end user auth easily.
83
77
  (Of course, you can also just set your STRIPE_API_KEY when using Stripe API related tools)
84
78
 
85
79
  - Supported methods
@@ -105,7 +99,7 @@ Pocket provides way to use end user auth easily.
105
99
  You can manage your auths in request-wise level. (e.g. you can use different auths for different requests)
106
100
 
107
101
  ```python
108
- from hyperpocket.tool import from_git
102
+
109
103
  from langchain_openai import ChatOpenAI
110
104
  from langgraph.graph import StateGraph, START, MessagesState
111
105
  from langgraph.prebuilt import tools_condition
@@ -113,10 +107,10 @@ from langgraph.prebuilt import tools_condition
113
107
  from hyperpocket_langgraph import PocketLanggraph
114
108
 
115
109
  pklg = PocketLanggraph(
116
- tools=[
117
- from_git("https://github.com/vessl-ai/hyperawesometools", "main", "managed-tools/slack/get-message"),
118
- from_git("https://github.com/vessl-ai/hyperawesometools", "main", "managed-tools/slack/post-message"),
119
- ],
110
+ tools=[
111
+ "https://github.com/vessl-ai/hyperpocket/tree/main/tools/slack/get-message",
112
+ "https://github.com/vessl-ai/hyperpocket/tree/main/tools/slack/post-message",
113
+ ],
120
114
  )
121
115
  llm = ChatOpenAI()
122
116
 
@@ -141,22 +135,21 @@ graph_builder.compile()
141
135
  ```
142
136
 
143
137
  ```python
144
- from hyperpocket.config import secret
145
- from hyperpocket.tool import from_git
146
138
  from llama_index.core.agent import FunctionCallingAgent
147
139
  from llama_index.llms.openai import OpenAI
148
140
 
141
+ from hyperpocket.config import secret
149
142
  from hyperpocket_llamaindex import PocketLlamaindex
150
143
 
151
144
  llm = OpenAI(api_key=secret["OPENAI_API_KEY"])
152
145
  pocket = PocketLlamaindex(
153
- tools=[
154
- from_git("https://github.com/vessl-ai/hyperawesometools", "main", "managed-tools/slack/get-message"),
155
- from_git("https://github.com/vessl-ai/hyperawesometools", "main", "managed-tools/slack/post-message"),
156
- from_git("https://github.com/vessl-ai/hyperawesometools", "main", "managed-tools/linear/get-issues"),
157
- from_git("https://github.com/vessl-ai/hyperawesometools", "main", "managed-tools/google/get-calendar-events"),
158
- from_git("https://github.com/vessl-ai/hyperawesometools", "main", "managed-tools/google/get-calendar-list"),
159
- ]
146
+ tools=[
147
+ "https://github.com/vessl-ai/hyperpocket/tree/main/tools/slack/get-message",
148
+ "https://github.com/vessl-ai/hyperpocket/tree/main/tools/slack/post-message",
149
+ "https://github.com/vessl-ai/hyperpocket/tree/main/tools/linear/get-issues",
150
+ "https://github.com/vessl-ai/hyperpocket/tree/main/tools/google/get-calendar-events",
151
+ "https://github.com/vessl-ai/hyperpocket/tree/main/tools/google/get-calendar-list",
152
+ ]
160
153
  )
161
154
  tools = pocket.get_tools()
162
155
 
@@ -193,12 +186,8 @@ Assistance: Here are the recent 10 messages.
193
186
 
194
187
  ### Config
195
188
 
196
- Running `pocket config init` will create your config file in `$HOME/.pocket/settings.toml`
197
-
198
189
  The `settings.toml` looks as follows.
199
190
 
200
- TODO: Add `secrets.toml`.
201
-
202
191
  ```toml
203
192
  log_level = "debug"
204
193
  internal_server_port = "8000" # optional, default is 8000
@@ -240,7 +229,7 @@ client_secret = "" # your github client secret
240
229
  - While creating your github OAuth app, configuring your app's `Authorization callback URL` is different for your
241
230
  development environment and production environment.
242
231
  - For development environment, you can use `http://localhost:8000/auth/github/callback`
243
- - **Note**: Default port for pocket dev server is `8000`. If you are using a different port, make sure to
232
+ - **Note**: Default port for hyperpocket dev server is `8000`. If you are using a different port, make sure to
244
233
  replace `8000` with your actual port number.
245
234
  - For production environment, you can use `https://yourdomain.com/auth/github/callback`
246
235
  - **Note**: Make sure to replace `yourdomain.com` with your actual domain name that this app will be hosted on.
@@ -7,18 +7,22 @@ from pydantic import BaseModel, Field
7
7
  from hyperpocket.config.auth import AuthConfig, DefaultAuthConfig
8
8
  from hyperpocket.config.session import DefaultSessionConfig, SessionConfig
9
9
 
10
- pocket_root = Path.home() / ".pocket"
11
- if not pocket_root.exists():
12
- os.makedirs(pocket_root)
13
- settings_path = pocket_root / "settings.toml"
10
+ POCKET_ROOT = Path.home() / ".pocket"
11
+ SETTING_ROOT = Path.cwd()
12
+
13
+
14
+ settings_path = SETTING_ROOT / "settings.toml"
14
15
  if not settings_path.exists():
15
16
  with open(settings_path, "w"):
16
17
  pass
17
- secret_path = pocket_root / ".secrets.toml"
18
+
19
+ secret_path = SETTING_ROOT / ".secrets.toml"
18
20
  if not secret_path.exists():
19
21
  with open(secret_path, "w"):
20
22
  pass
21
- toolpkg_path = pocket_root / "toolpkg"
23
+
24
+
25
+ toolpkg_path = POCKET_ROOT / "toolpkg"
22
26
  if not toolpkg_path.exists():
23
27
  os.makedirs(toolpkg_path)
24
28
 
@@ -50,9 +54,9 @@ class Config(BaseModel):
50
54
 
51
55
  @property
52
56
  def public_base_url(self):
53
- if self.public_server_protocol == 'https' and self.public_server_port == 443:
57
+ if self.public_server_protocol == "https" and self.public_server_port == 443:
54
58
  return f"{self.public_server_protocol}://{self.public_hostname}"
55
- elif self.public_server_protocol == 'http' and self.public_server_port == 80:
59
+ elif self.public_server_protocol == "http" and self.public_server_port == 80:
56
60
  return f"{self.public_server_protocol}://{self.public_hostname}"
57
61
  return f"{self.public_server_protocol}://{self.public_hostname}:{self.public_server_port}"
58
62
 
@@ -38,8 +38,10 @@ class PocketCore:
38
38
  lock = LocalLock(tool_like)
39
39
  req = WasmToolRequest(lock, "")
40
40
  else:
41
- lock = GitLock(repository_url=tool_like, git_ref='HEAD')
42
- req = WasmToolRequest(lock, "")
41
+ base_repo_url, git_ref, rel_path = GitLock.parse_repo_url(repo_url=tool_like)
42
+ lock = GitLock(repository_url=base_repo_url, git_ref=git_ref)
43
+ req = WasmToolRequest(lock=lock, rel_path=rel_path, tool_vars={})
44
+
43
45
  lockfile.add_lock(lock)
44
46
  tool_likes.append(req)
45
47
  elif isinstance(tool_like, WasmToolRequest):
@@ -16,7 +16,9 @@ class Pocket(object):
16
16
  tools: list[ToolLike],
17
17
  auth: PocketAuth = None,
18
18
  lockfile_path: Optional[str] = None,
19
- force_update: bool = False):
19
+ force_update: bool = False,
20
+ use_profile: bool = False):
21
+ self.use_profile = use_profile
20
22
 
21
23
  self.core = PocketCore(
22
24
  tools=tools,
@@ -1,7 +1,7 @@
1
1
  import abc
2
2
  import pathlib
3
3
  import shutil
4
- from typing import Optional
4
+ from typing import Optional, Tuple
5
5
 
6
6
  import git
7
7
  from pydantic import BaseModel, Field
@@ -159,6 +159,57 @@ class GitLock(Lock):
159
159
  break
160
160
  return new_sha
161
161
 
162
+ @classmethod
163
+ def get_git_branches(cls, repo_url):
164
+ ls_lists = git.cmd.Git().ls_remote(repo_url)
165
+
166
+ branches = {}
167
+ for line in ls_lists.split("\n"):
168
+ sha, ref = line.split("\t")
169
+ if ref.startswith("refs/heads/"):
170
+ branch_name = ref.replace("refs/heads/", "")
171
+ branches[branch_name] = sha
172
+
173
+ return branches
174
+
175
+ @classmethod
176
+ def parse_repo_url(cls, repo_url: str) -> Tuple[str, str, str]:
177
+ """
178
+ Parses a GitHub repository URL with optional branch and path information.
179
+
180
+ Returns:
181
+ Tuple[str, str, str]: base_repo, branch_name, directory_path
182
+ """
183
+ if not repo_url.startswith("https://github.com/"):
184
+ raise AttributeError("Only GitHub URLs are supported")
185
+
186
+ # Remove the base URL and split the path
187
+ repo_path = repo_url.removeprefix("https://github.com/")
188
+ repo_path_list = repo_path.split("/")
189
+
190
+ # Check if the URL contains 'tree' (indicating branch and sub-path information)
191
+ if "tree" not in repo_path_list:
192
+ # If no 'tree', return the full repository URL
193
+ return repo_url, "HEAD", ""
194
+
195
+ # Parse base repo URL and remaining path
196
+ tree_index = repo_path_list.index("tree")
197
+ base_repo = f"https://github.com/{'/'.join(repo_path_list[:tree_index])}"
198
+ sub_path = repo_path_list[tree_index + 1:]
199
+
200
+ # Fetch branch information
201
+ branches = cls.get_git_branches(base_repo)
202
+
203
+ # Find branch and sub-directory path
204
+ for idx in range(1, len(sub_path) + 1):
205
+ branch_name = "/".join(sub_path[:idx])
206
+ if branch_name in branches:
207
+ directory_path = "/".join(sub_path[idx:]) if idx < len(sub_path) else None
208
+ return base_repo, branch_name, directory_path
209
+
210
+ # If no valid branch is found, raise an error
211
+ raise ValueError("Branch not found in repository")
212
+
162
213
  def eject_to_path(self, dest_path: pathlib.Path, src_sub_path: str = None):
163
214
 
164
215
  # clone the git repository to the target path
@@ -136,11 +136,11 @@ class PocketServer(object):
136
136
  while True:
137
137
  if conn.poll():
138
138
  op, uid, result, error = conn.recv()
139
- if error:
140
- raise error
141
-
142
139
  future = self.future_store[uid]
143
- future.set_result(result)
140
+ if error:
141
+ future.set_exception(error)
142
+ else:
143
+ future.set_result(result)
144
144
  break
145
145
  else:
146
146
  await asyncio.sleep(0)
@@ -158,7 +158,7 @@ class PocketServer(object):
158
158
  self._set_mp_start_method()
159
159
 
160
160
  self.pipe = mp.Pipe()
161
- self.process = mp.Process(target=self._run, args=(pocket_core,), daemon=True)
161
+ self.process = mp.Process(target=self._run, args=(pocket_core,))
162
162
  self.process.start()
163
163
 
164
164
  def _run(self, pocket_core):
@@ -185,9 +185,9 @@ class PocketServer(object):
185
185
  from hyperpocket.server.proxy import _generate_ssl_certificates
186
186
  from hyperpocket.server.proxy import https_proxy_app
187
187
 
188
- from hyperpocket.config.settings import pocket_root
189
- ssl_keypath = pocket_root / "callback_server.key"
190
- ssl_certpath = pocket_root / "callback_server.crt"
188
+ from hyperpocket.config.settings import POCKET_ROOT
189
+ ssl_keypath = POCKET_ROOT / "callback_server.key"
190
+ ssl_certpath = POCKET_ROOT / "callback_server.crt"
191
191
 
192
192
  if not ssl_keypath.exists() or not ssl_certpath.exists():
193
193
  _generate_ssl_certificates(ssl_keypath, ssl_certpath)
@@ -1,11 +1,9 @@
1
1
  import asyncio
2
2
  import copy
3
3
  import inspect
4
- import pathlib
5
4
  from typing import Any, Coroutine
6
5
  from typing import Callable, Optional
7
6
 
8
- import toml
9
7
  from pydantic import BaseModel
10
8
 
11
9
  from hyperpocket.tool.tool import Tool, ToolAuth
@@ -47,32 +45,37 @@ class FunctionTool(Tool):
47
45
  _kwargs = copy.deepcopy(kwargs)
48
46
 
49
47
  # make body args to model
50
- schema_model = self.schema_model()
51
- model = schema_model(body=_kwargs["body"])
48
+ schema_model = self.schema_model(use_profile=False)
49
+ model = schema_model(**_kwargs["body"])
52
50
  _kwargs.pop("body")
53
51
 
54
52
  # body model to dict
55
- args = self.model_to_kwargs(model.body)
53
+ args = self.model_to_kwargs(model)
56
54
 
57
55
  # binding args
58
56
  binding_args = {}
59
- sig = inspect.signature(self.func)
60
- for param_name, param in sig.parameters.items():
61
- if param_name not in args:
62
- continue
57
+ if self.func.__dict__.get("__model__") is not None:
58
+ # when a function signature is not inferrable from the function itself
59
+ binding_args = args.copy()
60
+ binding_args |= _kwargs.get("envs", {}) | self.tool_vars
61
+ else:
62
+ sig = inspect.signature(self.func)
63
+ for param_name, param in sig.parameters.items():
64
+ if param_name not in args:
65
+ continue
63
66
 
64
- if param.kind == param.VAR_KEYWORD:
65
- # var keyword args should be passed by plain dict
66
- binding_args |= args[param_name]
67
- binding_args |= _kwargs.get("envs", {}) | self.tool_vars
67
+ if param.kind == param.VAR_KEYWORD:
68
+ # var keyword args should be passed by plain dict
69
+ binding_args |= args[param_name]
70
+ binding_args |= _kwargs.get("envs", {}) | self.tool_vars
68
71
 
69
- if "envs" in _kwargs:
70
- _kwargs.pop("envs")
72
+ if "envs" in _kwargs:
73
+ _kwargs.pop("envs")
71
74
 
72
- binding_args |= _kwargs # add other kwargs
73
- continue
75
+ binding_args |= _kwargs # add other kwargs
76
+ continue
74
77
 
75
- binding_args[param_name] = args[param_name]
78
+ binding_args[param_name] = args[param_name]
76
79
 
77
80
  return binding_args
78
81
 
@@ -113,7 +116,7 @@ class FunctionTool(Tool):
113
116
  func=func,
114
117
  afunc=afunc,
115
118
  name=func.__name__,
116
- description=model.__doc__,
119
+ description=func.__doc__ if func.__doc__ is not None else "",
117
120
  argument_json_schema=argument_json_schema,
118
121
  auth=auth,
119
122
  default_tool_vars=tool_vars
@@ -123,10 +126,16 @@ class FunctionTool(Tool):
123
126
  def from_dock(
124
127
  cls,
125
128
  dock: list[Callable[..., str]],
129
+ tool_vars: Optional[dict[str, str]] = None,
126
130
  ) -> list["FunctionTool"]:
131
+ if tool_vars is None:
132
+ tool_vars = dict()
127
133
  tools = []
128
134
  for func in dock:
129
- model = function_to_model(func)
135
+ if (_model := func.__dict__.get("__model__")) is not None:
136
+ model = _model
137
+ else:
138
+ model = function_to_model(func)
130
139
  argument_json_schema = flatten_json_schema(model.model_json_schema())
131
140
  if not callable(func):
132
141
  raise ValueError(f"Dock element should be a list of functions, but found {func}")
@@ -142,6 +151,7 @@ class FunctionTool(Tool):
142
151
  description=func.__doc__,
143
152
  argument_json_schema=argument_json_schema,
144
153
  auth=auth,
154
+ default_tool_vars=(tool_vars | func.__dict__.get("__vars__", {})),
145
155
  ))
146
156
  else:
147
157
  tools.append(cls(
@@ -151,22 +161,6 @@ class FunctionTool(Tool):
151
161
  description=func.__doc__,
152
162
  argument_json_schema=argument_json_schema,
153
163
  auth=auth,
164
+ default_tool_vars=(tool_vars | func.__dict__.get("__vars__", {})),
154
165
  ))
155
166
  return tools
156
-
157
- @classmethod
158
- def _get_tool_vars_from_config(cls, func: Callable) -> dict:
159
- print(func.__name__)
160
- tool_path = inspect.getfile(func)
161
- print(tool_path)
162
- tool_parent = "/".join(tool_path.split("/")[:-1])
163
- tool_config_path = pathlib.Path(tool_parent) / "config.toml"
164
- with tool_config_path.open("r") as f:
165
- tool_config = toml.load(f)
166
- tool_vars = tool_config.get("tool_var")
167
- if not tool_vars:
168
- return
169
- tool_vars_dict = {}
170
- for key, value in tool_vars.items():
171
- tool_vars_dict[key] = value
172
- return tool_vars_dict