langbot-plugin 0.3.3__tar.gz → 0.3.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/PKG-INFO +1 -1
  2. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/pyproject.toml +1 -1
  3. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/proxies/langbot_api.py +69 -8
  4. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/cli/__init__.py +2 -1
  5. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/cli/commands/login.py +26 -1
  6. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/cli/commands/runplugin.py +2 -6
  7. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/cli/locales/en_US.py +4 -0
  8. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/cli/locales/ja_JP.py +4 -0
  9. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/cli/locales/zh_Hans.py +4 -0
  10. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/cli/locales/zh_Hant.py +4 -0
  11. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/entities/io/actions/enums.py +5 -1
  12. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/runtime/app.py +3 -7
  13. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/runtime/io/handlers/plugin.py +17 -0
  14. langbot_plugin-0.3.5/src/langbot_plugin/utils/log.py +32 -0
  15. langbot_plugin-0.3.5/src/langbot_plugin/version.py +1 -0
  16. langbot_plugin-0.3.5/tests/test_log.py +29 -0
  17. langbot_plugin-0.3.3/src/langbot_plugin/version.py +0 -1
  18. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/.github/workflows/publish-pypi.yaml +0 -0
  19. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/.gitignore +0 -0
  20. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/.python-version +0 -0
  21. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/AGENTS.md +0 -0
  22. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/CLAUDE.md +0 -0
  23. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/LICENSE +0 -0
  24. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/README.md +0 -0
  25. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/data/.env.example +0 -0
  26. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/docs/Message.md +0 -0
  27. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/docs/communication/apis/lb2rt.md +0 -0
  28. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/docs/communication/runtime_plugin.md +0 -0
  29. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/docs/dependency-management.md +0 -0
  30. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/docs/langbot-plugin-social.png +0 -0
  31. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/__init__.py +0 -0
  32. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/__init__.py +0 -0
  33. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/definition/__init__.py +0 -0
  34. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/definition/abstract/__init__.py +0 -0
  35. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/definition/abstract/platform/__init__.py +0 -0
  36. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/definition/abstract/platform/adapter.py +0 -0
  37. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/definition/abstract/platform/event_logger.py +0 -0
  38. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/definition/components/__init__.py +0 -0
  39. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/definition/components/base.py +0 -0
  40. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/definition/components/command/__init__.py +0 -0
  41. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/definition/components/command/command.py +0 -0
  42. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/definition/components/common/__init__.py +0 -0
  43. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/definition/components/common/event_listener.py +0 -0
  44. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/definition/components/knowledge_engine/__init__.py +0 -0
  45. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/definition/components/knowledge_engine/engine.py +0 -0
  46. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/definition/components/manifest.py +0 -0
  47. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/definition/components/parser/__init__.py +0 -0
  48. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/definition/components/parser/parser.py +0 -0
  49. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/definition/components/tool/__init__.py +0 -0
  50. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/definition/components/tool/tool.py +0 -0
  51. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/definition/plugin.py +0 -0
  52. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/entities/__init__.py +0 -0
  53. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/entities/builtin/__init__.py +0 -0
  54. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/entities/builtin/command/__init__.py +0 -0
  55. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/entities/builtin/command/context.py +0 -0
  56. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/entities/builtin/command/errors.py +0 -0
  57. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/entities/builtin/pipeline/__init__.py +0 -0
  58. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/entities/builtin/pipeline/query.py +0 -0
  59. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/entities/builtin/platform/__init__.py +0 -0
  60. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/entities/builtin/platform/entities.py +0 -0
  61. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/entities/builtin/platform/events.py +0 -0
  62. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/entities/builtin/platform/logger.py +0 -0
  63. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/entities/builtin/platform/message.py +0 -0
  64. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/entities/builtin/provider/__init__.py +0 -0
  65. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/entities/builtin/provider/message.py +0 -0
  66. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/entities/builtin/provider/prompt.py +0 -0
  67. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/entities/builtin/provider/session.py +0 -0
  68. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/entities/builtin/rag/__init__.py +0 -0
  69. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/entities/builtin/rag/context.py +0 -0
  70. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/entities/builtin/rag/enums.py +0 -0
  71. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/entities/builtin/rag/errors.py +0 -0
  72. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/entities/builtin/rag/models.py +0 -0
  73. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/entities/builtin/resource/__init__.py +0 -0
  74. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/entities/builtin/resource/tool.py +0 -0
  75. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/entities/context.py +0 -0
  76. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/entities/events.py +0 -0
  77. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/proxies/__init__.py +0 -0
  78. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/proxies/base.py +0 -0
  79. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/proxies/event_context.py +0 -0
  80. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/proxies/execute_context.py +0 -0
  81. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/api/proxies/query_based_api.py +0 -0
  82. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/assets/__init__.py +0 -0
  83. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/assets/templates/.env.example.example +0 -0
  84. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/assets/templates/.gitignore.example +0 -0
  85. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/assets/templates/.vscode/launch.json.example +0 -0
  86. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/assets/templates/README.md.example +0 -0
  87. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/assets/templates/__init__.py +0 -0
  88. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/assets/templates/assets/icon.svg.example +0 -0
  89. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/assets/templates/components/__init__.py +0 -0
  90. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/assets/templates/components/commands/__init__.py +0 -0
  91. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/assets/templates/components/commands/{cmd_name}.py.example +0 -0
  92. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/assets/templates/components/commands/{cmd_name}.yaml.example +0 -0
  93. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/assets/templates/components/event_listener/__init__.py +0 -0
  94. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/assets/templates/components/event_listener/default.py.example +0 -0
  95. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/assets/templates/components/event_listener/default.yaml.example +0 -0
  96. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/assets/templates/components/knowledge_engine/__init__.py +0 -0
  97. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/assets/templates/components/knowledge_engine/{knowledge_engine_name}.py.example +0 -0
  98. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/assets/templates/components/knowledge_engine/{knowledge_engine_name}.yaml.example +0 -0
  99. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/assets/templates/components/parser/__init__.py +0 -0
  100. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/assets/templates/components/parser/{parser_name}.py.example +0 -0
  101. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/assets/templates/components/parser/{parser_name}.yaml.example +0 -0
  102. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/assets/templates/components/tools/__init__.py +0 -0
  103. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/assets/templates/components/tools/{tool_name}.py.example +0 -0
  104. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/assets/templates/components/tools/{tool_name}.yaml.example +0 -0
  105. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/assets/templates/main.py.example +0 -0
  106. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/assets/templates/manifest.yaml.example +0 -0
  107. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/assets/templates/requirements.txt.example +0 -0
  108. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/cli/__main__.py +0 -0
  109. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/cli/commands/__init__.py +0 -0
  110. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/cli/commands/buildplugin.py +0 -0
  111. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/cli/commands/gencomponent.py +0 -0
  112. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/cli/commands/initplugin.py +0 -0
  113. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/cli/commands/logout.py +0 -0
  114. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/cli/commands/publish.py +0 -0
  115. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/cli/gen/__init__.py +0 -0
  116. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/cli/gen/renderer.py +0 -0
  117. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/cli/i18n.py +0 -0
  118. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/cli/locales/__init__.py +0 -0
  119. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/cli/run/__init__.py +0 -0
  120. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/cli/run/controller.py +0 -0
  121. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/cli/run/handler.py +0 -0
  122. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/cli/run/hotreload.py +0 -0
  123. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/cli/utils/__init__.py +0 -0
  124. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/cli/utils/cloudsv.py +0 -0
  125. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/cli/utils/form.py +0 -0
  126. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/entities/__init__.py +0 -0
  127. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/entities/io/__init__.py +0 -0
  128. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/entities/io/actions/__init__.py +0 -0
  129. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/entities/io/errors.py +0 -0
  130. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/entities/io/req.py +0 -0
  131. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/entities/io/resp.py +0 -0
  132. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/entities/marketplace.py +0 -0
  133. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/runtime/LICENSE +0 -0
  134. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/runtime/README.md +0 -0
  135. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/runtime/__init__.py +0 -0
  136. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/runtime/context.py +0 -0
  137. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/runtime/helper/__init__.py +0 -0
  138. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/runtime/helper/marketplace.py +0 -0
  139. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/runtime/helper/pkgmgr.py +0 -0
  140. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/runtime/io/__init__.py +0 -0
  141. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/runtime/io/connection.py +0 -0
  142. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/runtime/io/connections/__init__.py +0 -0
  143. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/runtime/io/connections/stdio.py +0 -0
  144. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/runtime/io/connections/ws.py +0 -0
  145. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/runtime/io/controller.py +0 -0
  146. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/runtime/io/controllers/__init__.py +0 -0
  147. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/runtime/io/controllers/stdio/__init__.py +0 -0
  148. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/runtime/io/controllers/stdio/client.py +0 -0
  149. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/runtime/io/controllers/stdio/server.py +0 -0
  150. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/runtime/io/controllers/ws/__init__.py +0 -0
  151. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/runtime/io/controllers/ws/client.py +0 -0
  152. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/runtime/io/controllers/ws/server.py +0 -0
  153. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/runtime/io/handler.py +0 -0
  154. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/runtime/io/handlers/__init__.py +0 -0
  155. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/runtime/io/handlers/control.py +0 -0
  156. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/runtime/plugin/__init__.py +0 -0
  157. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/runtime/plugin/container.py +0 -0
  158. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/runtime/plugin/mgr.py +0 -0
  159. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/runtime/settings.py +0 -0
  160. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/utils/__init__.py +0 -0
  161. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/utils/discover/__init__.py +0 -0
  162. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/utils/discover/engine.py +0 -0
  163. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/utils/importutil.py +0 -0
  164. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/src/langbot_plugin/utils/platform.py +0 -0
  165. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/tests/api/entities/test_events.py +0 -0
  166. {langbot_plugin-0.3.3 → langbot_plugin-0.3.5}/tests/test_message.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: langbot-plugin
3
- Version: 0.3.3
3
+ Version: 0.3.5
4
4
  Summary: This package contains the SDK, CLI for building plugins for LangBot, plus the runtime for hosting LangBot plugins
5
5
  Project-URL: Homepage, https://langbot.app
6
6
  Project-URL: Repository, https://github.com/langbot-app/langbot-plugin-sdk
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "langbot-plugin"
3
- version = "0.3.3"
3
+ version = "0.3.5"
4
4
  description = "This package contains the SDK, CLI for building plugins for LangBot, plus the runtime for hosting LangBot plugins"
5
5
  readme = "README.md"
6
6
  authors = [
@@ -264,6 +264,7 @@ class LangBotAPIProxy:
264
264
  filters: dict[str, Any] | None = None,
265
265
  search_type: str = "vector",
266
266
  query_text: str = "",
267
+ vector_weight: float | None = None,
267
268
  ) -> list[dict[str, Any]]:
268
269
  """Search similar vectors in Host's vector store.
269
270
 
@@ -274,23 +275,27 @@ class LangBotAPIProxy:
274
275
  filters: Optional metadata filters.
275
276
  search_type: One of 'vector', 'full_text', 'hybrid'.
276
277
  query_text: Raw query text, used for full_text and hybrid search.
278
+ vector_weight: Weight for vector search in hybrid mode (0.0–1.0).
279
+ ``None`` means use equal weights (backward compatible).
277
280
 
278
281
  Returns:
279
282
  List of search results (dict with id, distance, metadata).
280
283
  Some hosts may also include an optional score field, but distance
281
284
  is the stable field and lower values mean more similar results.
282
285
  """
286
+ data = {
287
+ "collection_id": collection_id,
288
+ "query_vector": query_vector,
289
+ "top_k": top_k,
290
+ "filters": filters,
291
+ "search_type": search_type,
292
+ "query_text": query_text,
293
+ "vector_weight": vector_weight,
294
+ }
283
295
  return (
284
296
  await self.plugin_runtime_handler.call_action(
285
297
  PluginToRuntimeAction.VECTOR_SEARCH,
286
- {
287
- "collection_id": collection_id,
288
- "query_vector": query_vector,
289
- "top_k": top_k,
290
- "filters": filters,
291
- "search_type": search_type,
292
- "query_text": query_text,
293
- },
298
+ data,
294
299
  timeout=30,
295
300
  )
296
301
  )["results"]
@@ -372,6 +377,62 @@ class LangBotAPIProxy:
372
377
  await self.plugin_runtime_handler.delete_local_file(file_key)
373
378
  return file_bytes
374
379
 
380
+ # ================= Knowledge Base APIs =================
381
+
382
+ async def list_knowledge_bases(self) -> list[dict[str, Any]]:
383
+ """List all knowledge bases available in the LangBot instance.
384
+
385
+ Unlike query-based ``list_pipeline_knowledge_bases``, this API is
386
+ globally available and not restricted to a specific pipeline's
387
+ configured knowledge bases.
388
+
389
+ Returns:
390
+ List of dicts, each containing:
391
+ - uuid: Knowledge base UUID
392
+ - name: Knowledge base name
393
+ - description: Knowledge base description
394
+ """
395
+ return (
396
+ await self.plugin_runtime_handler.call_action(
397
+ PluginToRuntimeAction.LIST_KNOWLEDGE_BASES, {}
398
+ )
399
+ )["knowledge_bases"]
400
+
401
+ async def retrieve_knowledge(
402
+ self,
403
+ kb_id: str,
404
+ query_text: str,
405
+ top_k: int = 5,
406
+ filters: dict[str, Any] | None = None,
407
+ ) -> list[dict[str, Any]]:
408
+ """Retrieve relevant documents from any knowledge base.
409
+
410
+ Unlike query-based ``retrieve_knowledge``, this API is globally
411
+ available and can access any knowledge base without pipeline
412
+ restrictions.
413
+
414
+ Args:
415
+ kb_id: Knowledge base UUID
416
+ query_text: Search query text
417
+ top_k: Number of results to return (default: 5)
418
+ filters: Optional metadata filters for retrieval
419
+
420
+ Returns:
421
+ List of retrieval result entries.
422
+ """
423
+ return (
424
+ await self.plugin_runtime_handler.call_action(
425
+ PluginToRuntimeAction.RETRIEVE_KNOWLEDGE,
426
+ {
427
+ "kb_id": kb_id,
428
+ "query_text": query_text,
429
+ "top_k": top_k,
430
+ "filters": filters or {},
431
+ },
432
+ timeout=30,
433
+ )
434
+ )["results"]
435
+
375
436
  # ================= Parser Capability APIs =================
376
437
 
377
438
  async def list_parsers(self, mime_type: str | None = None) -> list[dict[str, Any]]:
@@ -68,6 +68,7 @@ def main():
68
68
 
69
69
  # login command
70
70
  login_parser = subparsers.add_parser("login", help="Login to LangBot account")
71
+ login_parser.add_argument("--token", "-t", help="Login with a personal access token", default=None)
71
72
 
72
73
  # logout command
73
74
  logout_parser = subparsers.add_parser("logout", help="Logout from LangBot account")
@@ -122,7 +123,7 @@ def main():
122
123
  case "ver":
123
124
  cli_print("version_info", __version__)
124
125
  case "login":
125
- login_process()
126
+ login_process(token=args.token)
126
127
  case "logout":
127
128
  logout_process()
128
129
  case "init":
@@ -13,7 +13,27 @@ from langbot_plugin.cli.i18n import cli_print, t
13
13
  SERVER_URL = get_cloud_service_url()
14
14
 
15
15
 
16
- def login_process() -> None:
16
+ def login_process(token: str | None = None) -> None:
17
+ if token is not None:
18
+ if not token.startswith("lbpat_"):
19
+ cli_print("pat_invalid_format")
20
+ return
21
+
22
+ config = {
23
+ "access_token": token,
24
+ "token_type": "personal_access_token",
25
+ "login_time": int(time.time()),
26
+ "expires_in": 0,
27
+ }
28
+
29
+ config_file = _save_config(config)
30
+
31
+ print("\n" + "=" * 50)
32
+ cli_print("pat_login_successful")
33
+ cli_print("pat_saved", config_file)
34
+ print("=" * 50)
35
+ return
36
+
17
37
  """
18
38
  Implement LangBot CLI login process
19
39
 
@@ -200,6 +220,9 @@ def _is_token_valid(config: dict[str, Any]) -> bool:
200
220
  if not config:
201
221
  return False
202
222
 
223
+ if config.get("token_type") == "personal_access_token":
224
+ return True
225
+
203
226
  login_time = config.get("login_time", 0)
204
227
  expires_in = config.get("expires_in", 0)
205
228
 
@@ -247,6 +270,8 @@ def _refresh_token(config: dict[str, Any]) -> bool:
247
270
  def check_login_status() -> bool:
248
271
  """Check login status"""
249
272
  config = _load_config()
273
+ if config and config.get("token_type") == "personal_access_token":
274
+ return True
250
275
  if not _is_token_valid(config):
251
276
  # try refresh token
252
277
  if not _refresh_token(config):
@@ -6,6 +6,7 @@ import dotenv
6
6
  import logging
7
7
 
8
8
  from langbot_plugin.utils.discover.engine import ComponentDiscoveryEngine
9
+ from langbot_plugin.utils.log import configure_process_logging
9
10
  from langbot_plugin.cli.run.controller import PluginRuntimeController
10
11
  from langbot_plugin.cli.i18n import cli_print
11
12
 
@@ -66,12 +67,7 @@ async def arun_plugin_process(stdio: bool = False, prod_mode: bool = False, plug
66
67
 
67
68
 
68
69
  def run_plugin_process(stdio: bool = False, prod_mode: bool = False, plugin_debug_key: str = "") -> None:
69
- # Configure logging for plugin process
70
- logging.basicConfig(
71
- level=logging.INFO,
72
- format='[%(asctime)s.%(msecs)03d] (PluginProcess) %(filename)s (%(lineno)d) - [%(levelname)s] : %(message)s',
73
- datefmt='%Y-%m-%d %H:%M:%S'
74
- )
70
+ configure_process_logging()
75
71
 
76
72
  try:
77
73
  asyncio.run(arun_plugin_process(stdio, prod_mode, plugin_debug_key))
@@ -70,4 +70,8 @@ messages = {
70
70
  "publish_failed": "!!! Failed to publish plugin: {}",
71
71
  "publish_successful": "✅ Plugin published successfully. You can check it on {}/market",
72
72
  "publish_successful_new_plugin": "⚠️ Plugin draft published successfully. You need to upload usage screenshots on {}/market to complete the submission.",
73
+
74
+ "pat_login_successful": "✅ Logged in with personal access token!",
75
+ "pat_invalid_format": "Invalid token format. Personal access tokens should start with 'lbpat_'.",
76
+ "pat_saved": "Token saved to: {}",
73
77
  }
@@ -70,4 +70,8 @@ messages = {
70
70
  "publish_failed": "!!! プラグインの公開に失敗しました:{}",
71
71
  "publish_successful": "✅ プラグインの公開が完了しました。{}/market で確認できます",
72
72
  "publish_successful_new_plugin": "⚠️ プラグインの公開が完了しました。使用スクリーンショットを {}/market にアップロードして提出を完了してください。",
73
+
74
+ "pat_login_successful": "✅ パーソナルアクセストークンでログインしました!",
75
+ "pat_invalid_format": "トークンの形式が無効です。パーソナルアクセストークンは 'lbpat_' で始まる必要があります。",
76
+ "pat_saved": "トークンの保存先:{}",
73
77
  }
@@ -70,4 +70,8 @@ messages = {
70
70
  "publish_failed": "!!! 插件发布失败:{}",
71
71
  "publish_successful": "✅ 插件发布成功。你可以在 {}/market 查看",
72
72
  "publish_successful_new_plugin": "⚠️ 插件草稿发布成功。你还需要在 {}/market 上传使用截图证明插件可用以完成提交。",
73
+
74
+ "pat_login_successful": "✅ 使用个人访问令牌登录成功!",
75
+ "pat_invalid_format": "令牌格式无效。个人访问令牌应以 'lbpat_' 开头。",
76
+ "pat_saved": "令牌已保存至:{}",
73
77
  }
@@ -70,4 +70,8 @@ messages = {
70
70
  "publish_failed": "!!! 插件發布失敗:{}",
71
71
  "publish_successful": "✅ 插件發布成功。你可以在 {}/market 查看",
72
72
  "publish_successful_new_plugin": "⚠️ 插件草稿發布成功。請在 {}/market 上傳使用截圖證明插件可用以完成提交。",
73
+
74
+ "pat_login_successful": "✅ 使用個人存取權杖登入成功!",
75
+ "pat_invalid_format": "權杖格式無效。個人存取權杖應以 'lbpat_' 開頭。",
76
+ "pat_saved": "權杖已儲存至:{}",
73
77
  }
@@ -68,7 +68,11 @@ class PluginToRuntimeAction(ActionType):
68
68
  LIST_PARSERS = "list_parsers"
69
69
  INVOKE_PARSER = "invoke_parser"
70
70
 
71
- """Knowledge Base Query APIs (query-based)"""
71
+ """Knowledge Base APIs (global, unrestricted)"""
72
+ LIST_KNOWLEDGE_BASES = "list_knowledge_bases"
73
+ RETRIEVE_KNOWLEDGE = "retrieve_knowledge"
74
+
75
+ """Knowledge Base Query APIs (query-based, pipeline-scoped)"""
72
76
  LIST_PIPELINE_KNOWLEDGE_BASES = "list_pipeline_knowledge_bases"
73
77
  RETRIEVE_KNOWLEDGE_BASE = "retrieve_knowledge_base"
74
78
 
@@ -17,6 +17,7 @@ from langbot_plugin.runtime.io.connection import Connection
17
17
  from langbot_plugin.runtime.plugin import mgr as plugin_mgr_cls
18
18
  from langbot_plugin.runtime import context
19
19
  from langbot_plugin.runtime.settings import settings
20
+ from langbot_plugin.utils.log import configure_process_logging
20
21
 
21
22
  logger = logging.getLogger(__name__)
22
23
 
@@ -125,13 +126,8 @@ class RuntimeApplication:
125
126
 
126
127
 
127
128
  def main(args: argparse.Namespace):
128
- # Configure logging for runtime
129
- logging.basicConfig(
130
- level=logging.INFO,
131
- format='[%(asctime)s.%(msecs)03d] %(filename)s (%(lineno)d) - [%(levelname)s] : %(message)s',
132
- datefmt='%Y-%m-%d %H:%M:%S'
133
- )
134
-
129
+ configure_process_logging()
130
+
135
131
  app = RuntimeApplication(args)
136
132
 
137
133
  try:
@@ -301,6 +301,23 @@ class PluginConnectionHandler(handler.Handler):
301
301
 
302
302
  # ================= Knowledge Base Query Handlers (Plugin -> Runtime -> Host) =================
303
303
 
304
+ @self.action(PluginToRuntimeAction.LIST_KNOWLEDGE_BASES)
305
+ async def list_knowledge_bases(data: dict[str, Any]) -> handler.ActionResponse:
306
+ result = await self.context.control_handler.call_action(
307
+ PluginToRuntimeAction.LIST_KNOWLEDGE_BASES,
308
+ data,
309
+ )
310
+ return handler.ActionResponse.success(result)
311
+
312
+ @self.action(PluginToRuntimeAction.RETRIEVE_KNOWLEDGE)
313
+ async def retrieve_knowledge(data: dict[str, Any]) -> handler.ActionResponse:
314
+ result = await self.context.control_handler.call_action(
315
+ PluginToRuntimeAction.RETRIEVE_KNOWLEDGE,
316
+ data,
317
+ timeout=30,
318
+ )
319
+ return handler.ActionResponse.success(result)
320
+
304
321
  @self.action(PluginToRuntimeAction.LIST_PIPELINE_KNOWLEDGE_BASES)
305
322
  async def list_pipeline_knowledge_bases(data: dict[str, Any]) -> handler.ActionResponse:
306
323
  result = await self.context.control_handler.call_action(
@@ -0,0 +1,32 @@
1
+ from __future__ import annotations
2
+
3
+ import logging
4
+ from typing import TextIO
5
+
6
+ DEFAULT_LOG_DATEFMT = "%m-%d %H:%M:%S"
7
+ _BASE_LOG_FORMAT = "[%(asctime)s.%(msecs)03d] %(filename)s (%(lineno)d) - [%(levelname)s] : %(message)s"
8
+ _PREFIXED_LOG_FORMAT = (
9
+ "[%(asctime)s.%(msecs)03d] ({process_name}) %(filename)s (%(lineno)d) - [%(levelname)s] : %(message)s"
10
+ )
11
+
12
+
13
+ def build_process_log_format(process_name: str | None = None) -> str:
14
+ if process_name:
15
+ return _PREFIXED_LOG_FORMAT.format(process_name=process_name)
16
+ return _BASE_LOG_FORMAT
17
+
18
+
19
+ def configure_process_logging(
20
+ *,
21
+ level: int = logging.INFO,
22
+ process_name: str | None = None,
23
+ stream: TextIO | None = None,
24
+ ) -> None:
25
+ """Configure a consistent log format for standalone SDK entrypoints."""
26
+ logging.basicConfig(
27
+ level=level,
28
+ format=build_process_log_format(process_name),
29
+ datefmt=DEFAULT_LOG_DATEFMT,
30
+ stream=stream,
31
+ force=True,
32
+ )
@@ -0,0 +1 @@
1
+ __version__ = "0.3.5"
@@ -0,0 +1,29 @@
1
+ from __future__ import annotations
2
+
3
+ import io
4
+ import logging
5
+ import re
6
+
7
+ from langbot_plugin.utils.log import build_process_log_format, configure_process_logging
8
+
9
+
10
+ def test_build_process_log_format_supports_optional_prefix():
11
+ assert build_process_log_format() == "[%(asctime)s.%(msecs)03d] %(filename)s (%(lineno)d) - [%(levelname)s] : %(message)s"
12
+ assert (
13
+ build_process_log_format("BoxRuntime")
14
+ == "[%(asctime)s.%(msecs)03d] (BoxRuntime) %(filename)s (%(lineno)d) - [%(levelname)s] : %(message)s"
15
+ )
16
+
17
+
18
+ def test_configure_process_logging_uses_unified_formatter():
19
+ stream = io.StringIO()
20
+ logger = logging.getLogger("langbot_plugin.tests.log")
21
+
22
+ configure_process_logging(stream=stream)
23
+ logger.info("hello logging")
24
+
25
+ output = stream.getvalue().strip()
26
+ assert re.match(
27
+ r"^\[\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3}\] test_log\.py \(\d+\) - \[INFO\] : hello logging$",
28
+ output,
29
+ )
@@ -1 +0,0 @@
1
- __version__ = "0.3.3"
File without changes
File without changes
File without changes
File without changes