pygpt-net 2.6.1__py3-none-any.whl → 2.6.2__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 (61) hide show
  1. pygpt_net/CHANGELOG.txt +4 -0
  2. pygpt_net/__init__.py +3 -3
  3. pygpt_net/app.py +15 -1
  4. pygpt_net/controller/chat/response.py +5 -3
  5. pygpt_net/controller/chat/stream.py +40 -2
  6. pygpt_net/controller/plugins/plugins.py +25 -0
  7. pygpt_net/controller/presets/editor.py +33 -88
  8. pygpt_net/controller/presets/experts.py +20 -1
  9. pygpt_net/controller/presets/presets.py +2 -2
  10. pygpt_net/controller/ui/mode.py +17 -66
  11. pygpt_net/core/agents/runner.py +15 -7
  12. pygpt_net/core/experts/experts.py +3 -3
  13. pygpt_net/data/config/config.json +3 -3
  14. pygpt_net/data/config/models.json +3 -3
  15. pygpt_net/data/locale/locale.de.ini +2 -0
  16. pygpt_net/data/locale/locale.en.ini +2 -0
  17. pygpt_net/data/locale/locale.es.ini +2 -0
  18. pygpt_net/data/locale/locale.fr.ini +2 -0
  19. pygpt_net/data/locale/locale.it.ini +2 -0
  20. pygpt_net/data/locale/locale.pl.ini +3 -1
  21. pygpt_net/data/locale/locale.uk.ini +2 -0
  22. pygpt_net/data/locale/locale.zh.ini +2 -0
  23. pygpt_net/plugin/base/plugin.py +35 -3
  24. pygpt_net/plugin/bitbucket/__init__.py +12 -0
  25. pygpt_net/plugin/bitbucket/config.py +267 -0
  26. pygpt_net/plugin/bitbucket/plugin.py +125 -0
  27. pygpt_net/plugin/bitbucket/worker.py +569 -0
  28. pygpt_net/plugin/facebook/__init__.py +12 -0
  29. pygpt_net/plugin/facebook/config.py +359 -0
  30. pygpt_net/plugin/facebook/plugin.py +114 -0
  31. pygpt_net/plugin/facebook/worker.py +698 -0
  32. pygpt_net/plugin/github/__init__.py +12 -0
  33. pygpt_net/plugin/github/config.py +441 -0
  34. pygpt_net/plugin/github/plugin.py +124 -0
  35. pygpt_net/plugin/github/worker.py +674 -0
  36. pygpt_net/plugin/google/__init__.py +12 -0
  37. pygpt_net/plugin/google/config.py +367 -0
  38. pygpt_net/plugin/google/plugin.py +126 -0
  39. pygpt_net/plugin/google/worker.py +826 -0
  40. pygpt_net/plugin/slack/__init__.py +12 -0
  41. pygpt_net/plugin/slack/config.py +349 -0
  42. pygpt_net/plugin/slack/plugin.py +116 -0
  43. pygpt_net/plugin/slack/worker.py +639 -0
  44. pygpt_net/plugin/telegram/__init__.py +12 -0
  45. pygpt_net/plugin/telegram/config.py +308 -0
  46. pygpt_net/plugin/telegram/plugin.py +118 -0
  47. pygpt_net/plugin/telegram/worker.py +563 -0
  48. pygpt_net/plugin/twitter/__init__.py +12 -0
  49. pygpt_net/plugin/twitter/config.py +491 -0
  50. pygpt_net/plugin/twitter/plugin.py +126 -0
  51. pygpt_net/plugin/twitter/worker.py +837 -0
  52. pygpt_net/provider/agents/llama_index/legacy/openai_assistant.py +35 -3
  53. pygpt_net/ui/base/config_dialog.py +4 -0
  54. pygpt_net/ui/dialog/preset.py +34 -77
  55. pygpt_net/ui/layout/toolbox/presets.py +2 -2
  56. pygpt_net/ui/main.py +3 -1
  57. {pygpt_net-2.6.1.dist-info → pygpt_net-2.6.2.dist-info}/METADATA +145 -2
  58. {pygpt_net-2.6.1.dist-info → pygpt_net-2.6.2.dist-info}/RECORD +61 -33
  59. {pygpt_net-2.6.1.dist-info → pygpt_net-2.6.2.dist-info}/LICENSE +0 -0
  60. {pygpt_net-2.6.1.dist-info → pygpt_net-2.6.2.dist-info}/WHEEL +0 -0
  61. {pygpt_net-2.6.1.dist-info → pygpt_net-2.6.2.dist-info}/entry_points.txt +0 -0
@@ -6,7 +6,7 @@
6
6
  # GitHub: https://github.com/szczyglis-dev/py-gpt #
7
7
  # MIT License #
8
8
  # Created By : Marcin Szczygliński #
9
- # Updated Date: 2025.08.14 03:00:00 #
9
+ # Updated Date: 2025.08.14 13:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  import asyncio
@@ -24,6 +24,8 @@ from pygpt_net.core.types import (
24
24
  AGENT_MODE_OPENAI,
25
25
  )
26
26
 
27
+ from pygpt_net.item.ctx import CtxItem
28
+
27
29
  from .runners.llama_assistant import LlamaAssistant
28
30
  from .runners.llama_plan import LlamaPlan
29
31
  from .runners.llama_steps import LlamaSteps
@@ -31,10 +33,13 @@ from .runners.llama_workflow import LlamaWorkflow
31
33
  from .runners.openai_workflow import OpenAIWorkflow
32
34
  from .runners.helpers import Helpers
33
35
  from .runners.loop import Loop
34
- from ...item.ctx import CtxItem
35
-
36
36
 
37
37
  class Runner:
38
+
39
+ APPEND_SYSTEM_PROMPT_TO_MSG = [
40
+ "react", # llama-index
41
+ ]
42
+
38
43
  def __init__(self, window=None):
39
44
  """
40
45
  Agent runner
@@ -52,9 +57,6 @@ class Runner:
52
57
  self.llama_steps = LlamaSteps(window)
53
58
  self.llama_workflow = LlamaWorkflow(window)
54
59
  self.openai_workflow = OpenAIWorkflow(window)
55
- self.APPEND_SYSTEM_PROMPT_TO_MSG = [
56
- "react", # llama-index
57
- ]
58
60
 
59
61
  def call(
60
62
  self,
@@ -85,8 +87,9 @@ class Runner:
85
87
 
86
88
  # prepare agent
87
89
  model = context.model
88
- vector_store_idx = extra.get("agent_idx", None)
90
+ vector_store_idx = extra.get("agent_idx", None)
89
91
  system_prompt = context.system_prompt
92
+ preset = context.preset
90
93
  max_steps = self.window.core.config.get("agent.llama.steps", 10)
91
94
  is_stream = self.window.core.config.get("stream", False)
92
95
  is_cmd = self.window.core.command.is_cmd(inline=False)
@@ -94,6 +97,10 @@ class Runner:
94
97
  llm = self.window.core.idx.llm.get(model, stream=False)
95
98
  workdir = self.window.core.config.get_workdir_prefix()
96
99
 
100
+ # vector store idx from preset
101
+ if preset:
102
+ vector_store_idx = preset.idx
103
+
97
104
  # tools
98
105
  self.window.core.agents.tools.context = context
99
106
  self.window.core.agents.tools.agent_idx = vector_store_idx
@@ -174,6 +181,7 @@ class Runner:
174
181
  return asyncio.run(self.openai_workflow.run(**kwargs))
175
182
 
176
183
  except Exception as e:
184
+ print("Error in agent runner:", e)
177
185
  self.window.core.debug.error(e)
178
186
  self.last_error = e
179
187
  return False
@@ -6,7 +6,7 @@
6
6
  # GitHub: https://github.com/szczyglis-dev/py-gpt #
7
7
  # MIT License #
8
8
  # Created By : Marcin Szczygliński #
9
- # Updated Date: 2025.08.14 01:00:00 #
9
+ # Updated Date: 2025.08.14 13:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  import json
@@ -577,7 +577,7 @@ class ExpertWorker(QRunnable):
577
577
  try:
578
578
  # get or create children (slave) meta
579
579
  slave = self.window.core.ctx.get_or_create_slave_meta(master_ctx, expert_id)
580
- expert = self.window.core.experts.get_expert(expert_id)
580
+ expert = self.window.core.experts.get_expert(expert_id) # preset
581
581
  reply = True
582
582
  hidden = False
583
583
  internal = False
@@ -604,7 +604,7 @@ class ExpertWorker(QRunnable):
604
604
  stream_mode = self.window.core.config.get('stream')
605
605
  verbose = self.window.core.config.get('agent.llama.verbose')
606
606
  use_agent = self.window.core.config.get('experts.use_agent', False)
607
- db_idx = self.window.controller.idx.current_idx # get idx from agent config
607
+ db_idx = expert.idx # get idx from expert preset
608
608
 
609
609
  mode = MODE_EXPERT # force expert mode, mode will change in bridge
610
610
 
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "__meta__": {
3
- "version": "2.6.1",
4
- "app.version": "2.6.1",
5
- "updated_at": "2025-08-13T00:00:00"
3
+ "version": "2.6.2",
4
+ "app.version": "2.6.2",
5
+ "updated_at": "2025-08-15T00:00:00"
6
6
  },
7
7
  "access.audio.event.speech": false,
8
8
  "access.audio.event.speech.disabled": [],
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "__meta__": {
3
- "version": "2.6.1",
4
- "app.version": "2.6.1",
5
- "updated_at": "2025-08-13T23:07:35"
3
+ "version": "2.6.2",
4
+ "app.version": "2.6.2",
5
+ "updated_at": "2025-08-15T23:07:35"
6
6
  },
7
7
  "items": {
8
8
  "SpeakLeash/bielik-11b-v2.3-instruct:Q4_K_M": {
@@ -966,8 +966,10 @@ preset.prompt.rename = Umbenennen
966
966
  preset.prompt.save_custom = Als Meine Vorlage speichern
967
967
  preset.prompt.use = Einfügen...
968
968
  preset.research = Forschung
969
+ preset.tab.experts = Experten
969
970
  preset.tab.general = Allgemein
970
971
  preset.tab.personalize = Personalisieren
972
+ preset.tab.remote_tools = Remote-Tools
971
973
  preset.temperature = Temperatur
972
974
  preset.tool.function = Funktionen
973
975
  preset.tool.function.tip.agent_llama = Tipp: Funktionen aus Plugins werden automatisch aktiviert.
@@ -967,8 +967,10 @@ preset.prompt.rename = Rename
967
967
  preset.prompt.save_custom = Save as My template
968
968
  preset.prompt.use = Paste...
969
969
  preset.research = Research
970
+ preset.tab.experts = Experts
970
971
  preset.tab.general = General
971
972
  preset.tab.personalize = Personalize
973
+ preset.tab.remote_tools = Remote tools
972
974
  preset.temperature = Temperature
973
975
  preset.tool.function = Functions
974
976
  preset.tool.function.tip.agent_llama = Tip: Functions from plugins are enabled automatically.
@@ -967,8 +967,10 @@ preset.prompt.rename = Renombrar
967
967
  preset.prompt.save_custom = Guardar como Mi plantilla
968
968
  preset.prompt.use = Pegar...
969
969
  preset.research = Investigación
970
+ preset.tab.experts = Expertos
970
971
  preset.tab.general = General
971
972
  preset.tab.personalize = Personalizar
973
+ preset.tab.remote_tools = Herramientas remotas
972
974
  preset.temperature = Temperatura
973
975
  preset.tool.function = Funciones
974
976
  preset.tool.function.tip.agent_llama = Consejo: Las funciones de los plugins se habilitan automáticamente.
@@ -966,8 +966,10 @@ preset.prompt.rename = Renommer
966
966
  preset.prompt.save_custom = Enregistrer comme Mon modèle
967
967
  preset.prompt.use = Coller...
968
968
  preset.research = Recherche
969
+ preset.tab.experts = Experts
969
970
  preset.tab.general = Général
970
971
  preset.tab.personalize = Personnaliser
972
+ preset.tab.remote_tools = Outils à distance
971
973
  preset.temperature = Température
972
974
  preset.tool.function = Fonctionnalités
973
975
  preset.tool.function.tip.agent_llama = Astuce : Les fonctions des plugins sont activées automatiquement.
@@ -966,8 +966,10 @@ preset.prompt.rename = Rinomina
966
966
  preset.prompt.save_custom = Salva come Mio modello
967
967
  preset.prompt.use = Incolla...
968
968
  preset.research = Ricerca
969
+ preset.tab.experts = Esperti
969
970
  preset.tab.general = Generale
970
971
  preset.tab.personalize = Personalizzare
972
+ preset.tab.remote_tools = Strumenti remoti
971
973
  preset.temperature = Temperatura
972
974
  preset.tool.function = Funzioni
973
975
  preset.tool.function.tip.agent_llama = Suggerimento: Le funzioni dai plugin sono abilitate automaticamente.
@@ -818,7 +818,7 @@ model.ctx = Tokeny kontekstu
818
818
  model.ctx.desc = Maksymalna liczba tokenów wejściowych modelu
819
819
  model.default = Domyślnie w trybie
820
820
  model.extra = Dodatkowe parametry (JSON)
821
- model.extra.desc = Obiekt JSON zawierający dodatkowe parametry dla modelu (takie jak wysiłek intelektualny itp.).
821
+ model.extra.desc = Obiekt JSON zawierający dodatkowe parametry dla modelu (takie jak wysiłek intelektualny itp.).
822
822
  model.id = ID modelu
823
823
  model.input = Wejście
824
824
  mode.llama_index = Czat z plikami
@@ -969,8 +969,10 @@ preset.prompt.rename = Zmień nazwę
969
969
  preset.prompt.save_custom = Zapisz jako Mój szablon
970
970
  preset.prompt.use = Wklej...
971
971
  preset.research = Badania
972
+ preset.tab.experts = Eksperci
972
973
  preset.tab.general = Ogólne
973
974
  preset.tab.personalize = Personalizuj
975
+ preset.tab.remote_tools = Narzędzia zdalne
974
976
  preset.temperature = Temperatura
975
977
  preset.tool.function = Funkcje
976
978
  preset.tool.function.tip.agent_llama = Tip: Funkcje z wtyczek są automatycznie włączane.
@@ -966,8 +966,10 @@ preset.prompt.rename = Перейменувати
966
966
  preset.prompt.save_custom = Зберегти як Моя шаблона
967
967
  preset.prompt.use = Вставити...
968
968
  preset.research = Дослідження
969
+ preset.tab.experts = Експерти
969
970
  preset.tab.general = Загальні
970
971
  preset.tab.personalize = Персоналізувати
972
+ preset.tab.remote_tools = Віддалені інструменти
971
973
  preset.temperature = Температура
972
974
  preset.tool.function = Функції
973
975
  preset.tool.function.tip.agent_llama = Порада: Функції з плагінів увімкнені автоматично.
@@ -966,8 +966,10 @@ preset.prompt.rename = 重命名
966
966
  preset.prompt.save_custom = 保存为我的模板
967
967
  preset.prompt.use = 粘贴...
968
968
  preset.research = 研究
969
+ preset.tab.experts = 专家
969
970
  preset.tab.general = 常规
970
971
  preset.tab.personalize = 个性化
972
+ preset.tab.remote_tools = 远程工具
971
973
  preset.temperature = 溫度
972
974
  preset.tool.function = 函數
973
975
  preset.tool.function.tip.agent_llama = 提示:插件中的功能 会自动启用。
@@ -6,13 +6,14 @@
6
6
  # GitHub: https://github.com/szczyglis-dev/py-gpt #
7
7
  # MIT License #
8
8
  # Created By : Marcin Szczygliński #
9
- # Updated Date: 2025.08.06 01:00:00 #
9
+ # Updated Date: 2025.08.15 01:00:00 #
10
10
  # ================================================== #
11
11
 
12
12
  import copy
13
13
  from typing import Optional, Any, Dict, List
14
14
 
15
- from PySide6.QtCore import QObject, Slot
15
+ from PySide6.QtCore import QObject, Slot, QUrl
16
+ from PySide6.QtGui import QDesktopServices
16
17
 
17
18
  from pygpt_net.core.bridge.context import BridgeContext
18
19
  from pygpt_net.core.events import Event, KernelEvent
@@ -230,6 +231,27 @@ class BasePlugin(QObject):
230
231
  return float(value)
231
232
  return self.options[name]["value"]
232
233
 
234
+ def set_option_value(
235
+ self,
236
+ name: str,
237
+ value: Any
238
+ ):
239
+ """
240
+ Set option value
241
+
242
+ :param name: option name
243
+ :param value: option value
244
+ """
245
+ if self.has_option(name):
246
+ if self.options[name]["type"] == "bool":
247
+ value = bool(value)
248
+ elif self.options[name]["type"] == "int":
249
+ value = int(value)
250
+ elif self.options[name]["type"] == "float":
251
+ value = float(value)
252
+ self.options[name]["value"] = value
253
+ self.refresh_option(name)
254
+
233
255
  def attach(self, window):
234
256
  """
235
257
  Attach window to plugin
@@ -539,4 +561,14 @@ class BasePlugin(QObject):
539
561
 
540
562
  :return: True if threaded
541
563
  """
542
- return self.window.controller.kernel.is_threaded()
564
+ return self.window.controller.kernel.is_threaded()
565
+
566
+
567
+ def open_url(self, url: str):
568
+ """
569
+ Open URL in the default web browser
570
+
571
+ :param url: URL to open
572
+ """
573
+ if url:
574
+ QDesktopServices.openUrl(QUrl(url))
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+ # ================================================== #
4
+ # This file is a part of PYGPT package #
5
+ # Website: https://pygpt.net #
6
+ # GitHub: https://github.com/szczyglis-dev/py-gpt #
7
+ # MIT License #
8
+ # Created By : Marcin Szczygliński #
9
+ # Updated Date: 2025.06.30 02:00:00 #
10
+ # ================================================== #
11
+
12
+ from .plugin import *
@@ -0,0 +1,267 @@
1
+ #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+ # ================================================== #
4
+ # This file is a part of PYGPT package #
5
+ # Website: https://pygpt.net #
6
+ # GitHub: https://github.com/szczyglis-dev/py-gpt #
7
+ # MIT License #
8
+ # Created By : Marcin Szczygliński #
9
+ # Updated Date: 2025.08.15 00:00:00 #
10
+ # ================================================== #
11
+
12
+ from pygpt_net.plugin.base.config import BaseConfig, BasePlugin
13
+
14
+
15
+ class Config(BaseConfig):
16
+ def __init__(self, plugin: BasePlugin = None, *args, **kwargs):
17
+ super(Config, self).__init__(plugin)
18
+ self.plugin = plugin
19
+
20
+ def from_defaults(self, plugin: BasePlugin = None):
21
+ # HTTP / Endpoints
22
+ plugin.add_option("api_base", type="text", value="https://api.bitbucket.org/2.0",
23
+ label="API base", description="Bitbucket Cloud API 2.0 base URL.")
24
+ plugin.add_option("http_timeout", type="int", value=30,
25
+ label="HTTP timeout (s)", description="Requests timeout in seconds.")
26
+
27
+ # Auth options
28
+ plugin.add_option("auth_mode", type="combo", value="auto",
29
+ label="Auth mode", description="auto|basic|bearer", keys=["auto", "basic", "bearer"],)
30
+ plugin.add_option("bb_username", type="text", value="",
31
+ label="Username", description="Bitbucket username (handle, not email).")
32
+ plugin.add_option("bb_app_password", type="textarea", value="",
33
+ label="App Password", description="Bitbucket App Password (Basic).", secret=True)
34
+ plugin.add_option("bb_access_token", type="textarea", value="",
35
+ label="Bearer token", description="OAuth access token (Bearer).", secret=True)
36
+
37
+ # Cached convenience
38
+ plugin.add_option("user_uuid", type="text", value="", label="(auto) User UUID", description="Cached after bb_me.")
39
+ plugin.add_option("username", type="text", value="", label="(auto) Username", description="Cached after bb_me.")
40
+
41
+ # ---------------- Commands ----------------
42
+
43
+ # Auth
44
+ plugin.add_cmd("bb_auth_set_mode",
45
+ instruction="Set auth mode: auto|basic|bearer.",
46
+ params=[{"name": "mode", "type": "str", "required": True, "description": "auto|basic|bearer"}],
47
+ enabled=True, description="Auth: set mode", tab="auth")
48
+
49
+ plugin.add_cmd("bb_set_app_password",
50
+ instruction="Set App Password credentials.",
51
+ params=[
52
+ {"name": "username", "type": "str", "required": True, "description": "Bitbucket username"},
53
+ {"name": "app_password", "type": "str", "required": True, "description": "App password"},
54
+ {"name": "set_mode", "type": "bool", "required": False, "description": "Switch to basic"},
55
+ ],
56
+ enabled=True, description="Auth: set App Password", tab="auth")
57
+
58
+ plugin.add_cmd("bb_set_bearer",
59
+ instruction="Set Bearer token.",
60
+ params=[
61
+ {"name": "access_token", "type": "str", "required": True, "description": "OAuth access token"},
62
+ {"name": "set_mode", "type": "bool", "required": False, "description": "Switch to bearer"},
63
+ ],
64
+ enabled=True, description="Auth: set Bearer", tab="auth")
65
+
66
+ plugin.add_cmd("bb_auth_check",
67
+ instruction="Diagnostics: show auth result for /user.",
68
+ params=[],
69
+ enabled=True, description="Auth: check", tab="auth")
70
+
71
+ # Users / Workspaces
72
+ plugin.add_cmd("bb_me",
73
+ instruction="Get authenticated user.",
74
+ params=[], enabled=True, description="Users: me", tab="users")
75
+
76
+ plugin.add_cmd("bb_user_get",
77
+ instruction="Get user by username.",
78
+ params=[{"name": "username", "type": "str", "required": True, "description": "Bitbucket username"}],
79
+ enabled=True, description="Users: get", tab="users")
80
+
81
+ plugin.add_cmd("bb_workspaces_list",
82
+ instruction="List accessible workspaces.",
83
+ params=[
84
+ {"name": "page", "type": "int", "required": False, "description": "Page"},
85
+ {"name": "pagelen", "type": "int", "required": False, "description": "Items per page"},
86
+ ],
87
+ enabled=True, description="Workspaces: list", tab="users")
88
+
89
+ # Repos
90
+ plugin.add_cmd("bb_repos_list",
91
+ instruction="List repositories.",
92
+ params=[
93
+ {"name": "workspace", "type": "str", "required": False, "description": "Workspace id"},
94
+ {"name": "role", "type": "str", "required": False, "description": "owner|contributor|member"},
95
+ {"name": "q", "type": "str", "required": False, "description": "BBQL filter"},
96
+ {"name": "sort", "type": "str", "required": False, "description": "Sort expression"},
97
+ {"name": "page", "type": "int", "required": False, "description": "Page"},
98
+ {"name": "pagelen", "type": "int", "required": False, "description": "Items per page"},
99
+ {"name": "after", "type": "str", "required": False, "description": "Cursor"},
100
+ ],
101
+ enabled=True, description="Repos: list", tab="repos")
102
+
103
+ plugin.add_cmd("bb_repo_get",
104
+ instruction="Get repository details.",
105
+ params=[
106
+ {"name": "workspace", "type": "str", "required": True, "description": "Workspace id"},
107
+ {"name": "repo", "type": "str", "required": True, "description": "Repo slug"},
108
+ ],
109
+ enabled=True, description="Repos: get", tab="repos")
110
+
111
+ plugin.add_cmd("bb_repo_create",
112
+ instruction="Create repository.",
113
+ params=[
114
+ {"name": "workspace", "type": "str", "required": True, "description": "Workspace id"},
115
+ {"name": "repo", "type": "str", "required": True, "description": "Repo slug"},
116
+ {"name": "description", "type": "str", "required": False, "description": "Description"},
117
+ {"name": "is_private", "type": "bool", "required": False, "description": "Default True"},
118
+ {"name": "scm", "type": "str", "required": False, "description": "git"},
119
+ {"name": "project_key", "type": "str", "required": False, "description": "Project key"},
120
+ ],
121
+ enabled=True, description="Repos: create", tab="repos")
122
+
123
+ plugin.add_cmd("bb_repo_delete",
124
+ instruction="Delete repository.",
125
+ params=[
126
+ {"name": "workspace", "type": "str", "required": True, "description": "Workspace id"},
127
+ {"name": "repo", "type": "str", "required": True, "description": "Repo slug"},
128
+ {"name": "confirm", "type": "bool", "required": False, "description": "Must be true"},
129
+ ],
130
+ enabled=False, description="Repos: delete", tab="repos")
131
+
132
+ # Contents
133
+ plugin.add_cmd("bb_contents_get",
134
+ instruction="Get file or list directory contents.",
135
+ params=[
136
+ {"name": "workspace", "type": "str", "required": True, "description": "Workspace id"},
137
+ {"name": "repo", "type": "str", "required": True, "description": "Repo slug"},
138
+ {"name": "path", "type": "str", "required": False, "description": "Path inside repo"},
139
+ {"name": "ref", "type": "str", "required": False, "description": "Branch/tag/commit"},
140
+ {"name": "format", "type": "str", "required": False, "description": "meta|rendered"},
141
+ {"name": "q", "type": "str", "required": False, "description": "Filter (BBQL)"},
142
+ {"name": "sort", "type": "str", "required": False, "description": "Sort"},
143
+ {"name": "max_depth", "type": "int", "required": False, "description": "Depth"},
144
+ ],
145
+ enabled=True, description="Contents: get", tab="contents")
146
+
147
+ plugin.add_cmd("bb_file_put",
148
+ instruction="Create or update a file (POST /src).",
149
+ params=[
150
+ {"name": "workspace", "type": "str", "required": True, "description": "Workspace"},
151
+ {"name": "repo", "type": "str", "required": True, "description": "Repo"},
152
+ {"name": "path", "type": "str", "required": True, "description": "Remote path"},
153
+ {"name": "message", "type": "str", "required": False, "description": "Commit message"},
154
+ {"name": "content", "type": "str", "required": False, "description": "Raw text content"},
155
+ {"name": "local_path", "type": "str", "required": False, "description": "Local file to upload"},
156
+ {"name": "branch", "type": "str", "required": False, "description": "Branch"},
157
+ {"name": "parents", "type": "str", "required": False, "description": "Parent commit SHA1"},
158
+ ],
159
+ enabled=True, description="Contents: put file", tab="contents")
160
+
161
+ plugin.add_cmd("bb_file_delete",
162
+ instruction="Delete file(s) (POST /src with files=...).",
163
+ params=[
164
+ {"name": "workspace", "type": "str", "required": True, "description": "Workspace"},
165
+ {"name": "repo", "type": "str", "required": True, "description": "Repo"},
166
+ {"name": "paths", "type": "list", "required": True, "description": "List of paths to delete"},
167
+ {"name": "message", "type": "str", "required": False, "description": "Commit message"},
168
+ {"name": "branch", "type": "str", "required": False, "description": "Branch"},
169
+ {"name": "parents", "type": "str", "required": False, "description": "Parent SHA1"},
170
+ ],
171
+ enabled=True, description="Contents: delete files", tab="contents")
172
+
173
+ # Issues
174
+ plugin.add_cmd("bb_issues_list",
175
+ instruction="List repository issues.",
176
+ params=[
177
+ {"name": "workspace", "type": "str", "required": True, "description": "Workspace"},
178
+ {"name": "repo", "type": "str", "required": True, "description": "Repo"},
179
+ {"name": "q", "type": "str", "required": False, "description": "BBQL filter"},
180
+ {"name": "state", "type": "str", "required": False, "description": "open|resolved|closed|..."},
181
+ {"name": "sort", "type": "str", "required": False, "description": "Sort"},
182
+ {"name": "page", "type": "int", "required": False, "description": "Page"},
183
+ {"name": "pagelen", "type": "int", "required": False, "description": "Items per page"},
184
+ ],
185
+ enabled=True, description="Issues: list", tab="issues")
186
+
187
+ plugin.add_cmd("bb_issue_create",
188
+ instruction="Create an issue.",
189
+ params=[
190
+ {"name": "workspace", "type": "str", "required": True, "description": "Workspace"},
191
+ {"name": "repo", "type": "str", "required": True, "description": "Repo"},
192
+ {"name": "title", "type": "str", "required": True, "description": "Title"},
193
+ {"name": "content", "type": "str", "required": False, "description": "Body"},
194
+ {"name": "assignee", "type": "str", "required": False, "description": "Assignee username"},
195
+ ],
196
+ enabled=True, description="Issues: create", tab="issues")
197
+
198
+ plugin.add_cmd("bb_issue_comment",
199
+ instruction="Comment on an issue.",
200
+ params=[
201
+ {"name": "workspace", "type": "str", "required": True, "description": "Workspace"},
202
+ {"name": "repo", "type": "str", "required": True, "description": "Repo"},
203
+ {"name": "id", "type": "int", "required": True, "description": "Issue id"},
204
+ {"name": "content", "type": "str", "required": True, "description": "Comment body"},
205
+ ],
206
+ enabled=True, description="Issues: comment", tab="issues")
207
+
208
+ plugin.add_cmd("bb_issue_update",
209
+ instruction="Update an issue.",
210
+ params=[
211
+ {"name": "workspace", "type": "str", "required": True, "description": "Workspace"},
212
+ {"name": "repo", "type": "str", "required": True, "description": "Repo"},
213
+ {"name": "id", "type": "int", "required": True, "description": "Issue id"},
214
+ {"name": "state", "type": "str", "required": False, "description": "open|resolved|closed|..."},
215
+ {"name": "title", "type": "str", "required": False, "description": "New title"},
216
+ {"name": "content", "type": "str", "required": False, "description": "New body"},
217
+ ],
218
+ enabled=True, description="Issues: update", tab="issues")
219
+
220
+ # Pull requests
221
+ plugin.add_cmd("bb_prs_list",
222
+ instruction="List pull requests.",
223
+ params=[
224
+ {"name": "workspace", "type": "str", "required": True, "description": "Workspace"},
225
+ {"name": "repo", "type": "str", "required": True, "description": "Repo"},
226
+ {"name": "state", "type": "str", "required": False, "description": "open|merged|declined|superseded"},
227
+ {"name": "q", "type": "str", "required": False, "description": "BBQL filter"},
228
+ {"name": "sort", "type": "str", "required": False, "description": "Sort"},
229
+ {"name": "page", "type": "int", "required": False, "description": "Page"},
230
+ {"name": "pagelen", "type": "int", "required": False, "description": "Items per page"},
231
+ ],
232
+ enabled=True, description="PR: list", tab="pulls")
233
+
234
+ plugin.add_cmd("bb_pr_create",
235
+ instruction="Create a pull request.",
236
+ params=[
237
+ {"name": "workspace", "type": "str", "required": True, "description": "Workspace"},
238
+ {"name": "repo", "type": "str", "required": True, "description": "Repo"},
239
+ {"name": "title", "type": "str", "required": True, "description": "PR title"},
240
+ {"name": "source_branch", "type": "str", "required": True, "description": "Source branch"},
241
+ {"name": "destination_branch", "type": "str", "required": True, "description": "Target branch"},
242
+ {"name": "description", "type": "str", "required": False, "description": "PR description"},
243
+ {"name": "draft", "type": "bool", "required": False, "description": "Draft PR"},
244
+ ],
245
+ enabled=True, description="PR: create", tab="pulls")
246
+
247
+ plugin.add_cmd("bb_pr_merge",
248
+ instruction="Merge a pull request.",
249
+ params=[
250
+ {"name": "workspace", "type": "str", "required": True, "description": "Workspace"},
251
+ {"name": "repo", "type": "str", "required": True, "description": "Repo"},
252
+ {"name": "id", "type": "int", "required": True, "description": "PR id"},
253
+ {"name": "message", "type": "str", "required": False, "description": "Commit message"},
254
+ {"name": "close_source_branch", "type": "bool", "required": False, "description": "Close source"},
255
+ ],
256
+ enabled=True, description="PR: merge", tab="pulls")
257
+
258
+ # Search
259
+ plugin.add_cmd("bb_search_repos",
260
+ instruction="Search repositories (BBQL via ?q=).",
261
+ params=[
262
+ {"name": "q", "type": "str", "required": False, "description": "Query string (BBQL)"},
263
+ {"name": "sort", "type": "str", "required": False, "description": "Sort expression"},
264
+ {"name": "page", "type": "int", "required": False, "description": "Page"},
265
+ {"name": "pagelen", "type": "int", "required": False, "description": "Items per page"},
266
+ ],
267
+ enabled=True, description="Search: repositories", tab="search")