gibson-cli 0.7.6__py3-none-any.whl → 0.7.8__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.
gibson/command/Help.py CHANGED
@@ -3,7 +3,6 @@ from rich.console import Console
3
3
  from rich.table import Table
4
4
  from rich.text import Text
5
5
 
6
- import gibson.core.Colors as Colors
7
6
  from gibson.command.BaseCommand import BaseCommand
8
7
  from gibson.core.Memory import Memory
9
8
 
@@ -57,7 +56,7 @@ class Help(BaseCommand):
57
56
  "memory": None,
58
57
  },
59
58
  "forget": {
60
- "description": f"delete entities from memory",
59
+ "description": "delete entities from memory",
61
60
  "subcommands": ["all", "last", "stored"],
62
61
  "memory": "based on user selection",
63
62
  },
@@ -72,6 +71,11 @@ class Help(BaseCommand):
72
71
  "subcommands": ["entities", "projects"],
73
72
  "memory": None,
74
73
  },
74
+ "mcp": {
75
+ "description": "allows tools like Cursor to interact with your gibson project",
76
+ "subcommands": ["run"],
77
+ "memory": None,
78
+ },
75
79
  "merge": {
76
80
  "description": "merge last memory (recent changes) into stored project memory",
77
81
  "subcommands": None,
@@ -0,0 +1,25 @@
1
+ import signal
2
+ import sys
3
+
4
+ import gibson.core.Colors as Colors
5
+ from gibson.command.BaseCommand import BaseCommand
6
+ from gibson.services.mcp.server import mcp
7
+
8
+
9
+ class McpServer(BaseCommand):
10
+ def execute(self):
11
+ if len(sys.argv) == 3 and sys.argv[2] == "run":
12
+ # Setup signal handlers to exit the server
13
+ signal.signal(signal.SIGTERM, lambda signo, frame: sys.exit(0))
14
+ signal.signal(signal.SIGINT, lambda signo, frame: sys.exit(0))
15
+ mcp.run()
16
+ else:
17
+ self.usage()
18
+
19
+ def usage(self):
20
+ self.configuration.display_project()
21
+ self.conversation.type(
22
+ f"usage: {Colors.command(self.configuration.command, 'mcp', args='run', hint='run the mcp server')}\n"
23
+ )
24
+ self.conversation.newline()
25
+ exit(1)
@@ -34,7 +34,6 @@ class Rewrite(BaseCommand):
34
34
 
35
35
  def write(self, argument=None):
36
36
  self.configuration.require_project()
37
- self.configuration.require_project_key()
38
37
 
39
38
  if len(self.memory.recall_merged()) == 0:
40
39
  self.conversation.cant_no_entities(self.configuration.project.name)
@@ -10,6 +10,7 @@ from gibson.command.Forget import Forget
10
10
  from gibson.command.Help import Help
11
11
  from gibson.command.importer.Import import Import
12
12
  from gibson.command.list.List import List
13
+ from gibson.command.mcp.McpServer import McpServer
13
14
  from gibson.command.Merge import Merge
14
15
  from gibson.command.Modify import Modify
15
16
  from gibson.command.new.New import New
@@ -58,6 +59,8 @@ class CommandRouter:
58
59
  command = Import(self.configuration)
59
60
  elif sys.argv[1] == "list":
60
61
  command = List(self.configuration)
62
+ elif sys.argv[1] == "mcp":
63
+ command = McpServer(self.configuration)
61
64
  elif sys.argv[1] == "merge":
62
65
  command = Merge(self.configuration)
63
66
  elif sys.argv[1] == "modify":
@@ -8,7 +8,7 @@ class Completions:
8
8
  self.file_name = "bash_completion"
9
9
 
10
10
  def install(self):
11
- completions_location = f"$HOME/{self.gibson_config}/{self.file_name}"
11
+ completions_location = f"{self.user_home}/{self.gibson_config}/{self.file_name}"
12
12
  installation = f"""\n[ -s "{completions_location}" ] && \\. "{completions_location}" # Load gibson auto completion\n"""
13
13
 
14
14
  for file in [f"{self.user_home}/.bashrc", f"{self.user_home}/.zshrc"]:
@@ -21,7 +21,7 @@ class Completions:
21
21
 
22
22
  def write(self):
23
23
  try:
24
- file = os.path.dirname(__file__) + f"/../data/bash-completion.tmpl"
24
+ file = os.path.dirname(__file__) + "/../data/bash-completion.tmpl"
25
25
  with open(file, "r") as f:
26
26
  contents = f.read()
27
27
  except FileNotFoundError:
@@ -0,0 +1,13 @@
1
+ import os
2
+
3
+ from mcp.server.fastmcp import FastMCP
4
+
5
+ mcp = FastMCP("GibsonAI")
6
+
7
+ # Note: Resources are not yet supported by Cursor, everything must be implemented as a tool
8
+
9
+
10
+ @mcp.tool()
11
+ def get_project_name() -> str:
12
+ """Get the gibson project name"""
13
+ return os.environ.get("GIBSONAI_PROJECT")
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: gibson-cli
3
- Version: 0.7.6
3
+ Version: 0.7.8
4
4
  Summary: Gibson Command Line Interface
5
5
  Author-email: GibsonAI <noc@gibsonai.com>
6
6
  Project-URL: Homepage, https://gibsonai.com/
@@ -11,55 +11,60 @@ Project-URL: Changelog, https://github.com/gibsonai/cli/releases
11
11
  Classifier: Operating System :: OS Independent
12
12
  Classifier: Development Status :: 4 - Beta
13
13
  Classifier: Intended Audience :: Developers
14
- Classifier: Programming Language :: Python :: 3.9
15
- Requires-Python: >=3.9
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Requires-Python: >=3.10
16
16
  Description-Content-Type: text/markdown
17
17
  Requires-Dist: annotated-types==0.6.0
18
- Requires-Dist: anyio==4.3.0
18
+ Requires-Dist: anyio==4.9.0
19
19
  Requires-Dist: certifi==2024.2.2
20
20
  Requires-Dist: charset-normalizer==3.3.2
21
21
  Requires-Dist: click==8.1.7
22
22
  Requires-Dist: dnspython==2.6.1
23
- Requires-Dist: email_validator==2.1.1
23
+ Requires-Dist: email-validator==2.1.1
24
24
  Requires-Dist: exceptiongroup==1.2.0
25
- Requires-Dist: Faker==24.0.0
26
- Requires-Dist: faker_sqlalchemy==0.10.2208140
27
- Requires-Dist: fastapi==0.111.0
25
+ Requires-Dist: faker==24.0.0
26
+ Requires-Dist: faker-sqlalchemy==0.10.2208140
27
+ Requires-Dist: fastapi==0.115.12
28
28
  Requires-Dist: fastapi-cli==0.0.2
29
29
  Requires-Dist: h11==0.14.0
30
30
  Requires-Dist: httpcore==1.0.5
31
31
  Requires-Dist: httptools==0.6.1
32
32
  Requires-Dist: httpx==0.27.0
33
+ Requires-Dist: httpx-sse==0.4.0
33
34
  Requires-Dist: idna==3.6
34
35
  Requires-Dist: iniconfig==2.0.0
35
- Requires-Dist: Jinja2==3.1.4
36
+ Requires-Dist: jinja2==3.1.4
36
37
  Requires-Dist: markdown-it-py==3.0.0
37
- Requires-Dist: MarkupSafe==2.1.5
38
+ Requires-Dist: markupsafe==2.1.5
39
+ Requires-Dist: mcp==1.6.0
38
40
  Requires-Dist: mdurl==0.1.2
39
41
  Requires-Dist: orjson==3.10.3
40
42
  Requires-Dist: packaging==23.2
41
43
  Requires-Dist: pluggy==1.4.0
42
- Requires-Dist: pydantic==2.6.1
43
- Requires-Dist: pydantic_core==2.16.2
44
+ Requires-Dist: pydantic==2.11.0
45
+ Requires-Dist: pydantic-core==2.33.0
46
+ Requires-Dist: pydantic-settings==2.8.1
44
47
  Requires-Dist: pyfiglet==1.0.2
45
- Requires-Dist: Pygments==2.18.0
46
- Requires-Dist: PyMySQL==1.1.0
48
+ Requires-Dist: pygments==2.18.0
49
+ Requires-Dist: pymysql==1.1.0
47
50
  Requires-Dist: pytest==8.0.1
48
51
  Requires-Dist: python-dateutil==2.9.0.post0
49
52
  Requires-Dist: python-dotenv==1.0.1
50
53
  Requires-Dist: python-multipart==0.0.9
51
- Requires-Dist: PyYAML==6.0.1
54
+ Requires-Dist: pyyaml==6.0.1
52
55
  Requires-Dist: requests==2.31.0
53
56
  Requires-Dist: rich==13.9.2
54
57
  Requires-Dist: shellingham==1.5.4
55
58
  Requires-Dist: six==1.16.0
56
59
  Requires-Dist: sniffio==1.3.1
57
- Requires-Dist: SQLAlchemy==1.4.41
58
- Requires-Dist: starlette==0.37.2
60
+ Requires-Dist: sqlalchemy==1.4.41
61
+ Requires-Dist: sse-starlette==2.2.1
62
+ Requires-Dist: starlette==0.46.1
59
63
  Requires-Dist: textual==0.83.0
60
64
  Requires-Dist: tomli==2.0.1
61
65
  Requires-Dist: typer==0.12.3
62
- Requires-Dist: typing_extensions==4.9.0
66
+ Requires-Dist: typing-extensions==4.13.0
67
+ Requires-Dist: typing-inspection==0.4.0
63
68
  Requires-Dist: ujson==5.9.0
64
69
  Requires-Dist: urllib3==1.26.6
65
70
  Requires-Dist: uvicorn==0.29.0
@@ -12,7 +12,7 @@ gibson/command/Conf.py,sha256=yuAGL6M8MUURG4hW3MAW043c-h_ALw3FHWbyCOR8YTQ,2375
12
12
  gibson/command/Count.py,sha256=QOagwCwDxUHYPivFntr-RWUmlKWKDHgDIGZBfju6VpY,1040
13
13
  gibson/command/Dev.py,sha256=zbZjsgAKAHlNUflEr_Lj2QmRBXNbIGIHrPJ3t5DcFC8,4213
14
14
  gibson/command/Forget.py,sha256=Fm1mUyZkK3HS5fIVgNaC3d97vcWWQVysdDkg4ciE8Bk,1018
15
- gibson/command/Help.py,sha256=_-I_hVGAwzb9rioHxVw4-G7vJgvcXdiQxQ1Smohi83k,6289
15
+ gibson/command/Help.py,sha256=Gih3JVZ3SLXrdZPInZccb-NtlzvSUTbTwW2NztKnrbo,6456
16
16
  gibson/command/Merge.py,sha256=R5ybMC1tUR5_T8YyUfXutzFa_V9j1_flv0s7KTJRq0M,1061
17
17
  gibson/command/Modify.py,sha256=XgTM6EodL7sVhWrnWuTCDx2PNJw3xo-aKI80HCmSpV8,1171
18
18
  gibson/command/Question.py,sha256=g8SwopbzeG14WWP0bc-fXIDVqOOicMzjC9YXoGd-NxY,3830
@@ -38,12 +38,13 @@ gibson/command/importer/OpenApi.py,sha256=5PL4JlhniPhUidOFxKpC9ao_r8C_qIeCoGyliP
38
38
  gibson/command/list/Entities.py,sha256=o5Wemlq_EpeObNwJHbCqkUT4nccfu_OOZ_gYWzJ051Y,1223
39
39
  gibson/command/list/List.py,sha256=IA9VYuOiFdweg-6HIBZ5hECnMyNxsoU2dKd-gzRNtio,1107
40
40
  gibson/command/list/Projects.py,sha256=8kD_Ny-rSsireW69YigJQia4QzvIRQsPnEUVISL0u0Y,1202
41
+ gibson/command/mcp/McpServer.py,sha256=fzeo6gQU0eZL9LA0w5iC1I-wATufIyh23zA7oiYRtGM,810
41
42
  gibson/command/new/Module.py,sha256=PCTt6k54XFzgNjNgwY0FKQFzk0YFoaN_KPZF2sfN_V0,1535
42
43
  gibson/command/new/New.py,sha256=cwsBpZAZH-9se26ywAUFyvrc9L9ezwoERIrRLlDkrzU,1519
43
44
  gibson/command/new/Project.py,sha256=Cw1Z6TvPIGhTi7GiQZ2VFjv6hXdpGKQdX9HuAd5gric,759
44
45
  gibson/command/rename/Entity.py,sha256=SaAiN1bYsTOsqjyVzxghK8-N3sAKITThTzS5LEYgppY,1801
45
46
  gibson/command/rename/Rename.py,sha256=Ly-X2XGkH8oyxNUs4qPudmcriPJlOQegZMZN1qw02V0,668
46
- gibson/command/rewrite/Rewrite.py,sha256=WXUgO-Xk7riKqdQIiG2yMvOeIzEkd9BEF-HqwSgaqXg,4453
47
+ gibson/command/rewrite/Rewrite.py,sha256=5Htt4LkHMl3FUrzU48PQeqyefU9PUXW3HaevfkjNTGo,4404
47
48
  gibson/command/tests/test_command_BaseCommand.py,sha256=hSbBfLFI3RTp_DdEHtm5oOLWoN6drI6ucFJypi7xxV8,364
48
49
  gibson/command/tests/test_command_Conf.py,sha256=5eBuCjEfskjb-JujwwUDQLFKjc3uThO4cJj148JoxkE,597
49
50
  gibson/conf/Api.py,sha256=GM9okYs1A8ujPjDwzziOoQpqRYFkr-dz5pgkfb6j4DI,59
@@ -65,8 +66,8 @@ gibson/conf/dev/Schema.py,sha256=kOSlX1jEyVb82xd8TO8jEAimLcaefIFJr6d2JYvyTqg,74
65
66
  gibson/conf/tests/test_conf_Dependencies.py,sha256=LITeeYiqXM5rKkyWFBqcnMvUR5pzDRuHVAngH372jWc,116
66
67
  gibson/conf/tests/test_conf_Platform.py,sha256=Zc53IsZmV-hT9VRrZEPNrsuehSdWnJXWKGMmOhEqWHo,138
67
68
  gibson/core/Colors.py,sha256=sllEmJAb2AAUH0e-ZLP1_C8pfz5U_w0fo5kubSH5g1o,3426
68
- gibson/core/CommandRouter.py,sha256=w9VNpvWntfAEOWmLwqWlp7W55z2lRR3rr9oHcIjILQ8,3182
69
- gibson/core/Completions.py,sha256=Bsh25vnf0pjpJA6MJNR_2MA2s58Ujj8XolR8fm8AQ_s,1197
69
+ gibson/core/CommandRouter.py,sha256=P64NCzC2noHauV_cdMU1IzfjgHe1zezDadviaPs3Cds,3320
70
+ gibson/core/Completions.py,sha256=a26WRh40UpnTT5HGTPT8TCcL8h80HvvZiTJXZofDjx8,1207
70
71
  gibson/core/Configuration.py,sha256=ryCDvuLzJDIbnjW-ty6HYLuMn0U2EYU__LdsMbu6-KE,15968
71
72
  gibson/core/Conversation.py,sha256=cl9dHfQDocB78GF3IyS3jve8iYBSXmeF4hwVAPY-vCE,10239
72
73
  gibson/core/Diff.py,sha256=onUJ5_0_S1vKAY_oFgX4vmwQo4byrnXLV4w7QSNA8fY,1071
@@ -105,6 +106,7 @@ gibson/services/code/customization/CustomizationManager.py,sha256=M2gz98Yo2WTnnh
105
106
  gibson/services/code/customization/Index.py,sha256=4Thf0gZM6VErZJS97w748PRNmHi8QvsyblOLCw1Y_XE,364
106
107
  gibson/services/code/customization/tests/test_code_customization_Authenticator.py,sha256=kKExkLfKPpRA2NQH3fvRCuBEMhCGhR-IvNJqXuyBz3c,1949
107
108
  gibson/services/code/customization/tests/test_code_customization_BaseCustomization.py,sha256=jaEwxxoU7d9ziOtfF21NPmZX2qSRpa-kz_8Ju9BKGts,412
109
+ gibson/services/mcp/server.py,sha256=EpoBu9BJP5iO-eNY-29mg0zyDZuxfT2dSUIIWsXSfGk,299
108
110
  gibson/structure/Entity.py,sha256=N_Tx8RTs9ySMMgAoR9rVuMcsRgNA7zvNvJBScJLfYE4,675
109
111
  gibson/structure/mysql/Entity.py,sha256=zolt3N_F3WlQtlOqrHflwsJeJ6r6A3MN4LxCzeAbU_k,3693
110
112
  gibson/structure/mysql/testing.py,sha256=al4LI6e3bhjopsR0qTAmaOJyCQXF0_inVQ4xv7VQ6qo,9149
@@ -126,8 +128,9 @@ gibson/structure/tests/test_structure_Entity.py,sha256=askl8w0p1uqET6HKBogJlRcPP
126
128
  gibson/tests/test_Env.py,sha256=DPWmP0-aEelducq9bAwv7rKoY2NjWXUeCrzfJDQkn2M,369
127
129
  gibson/tests/test_Memory.py,sha256=YP7owToABAk_-s7fD5UG0HTc4lamDjdA39JUlLnk3Fg,2574
128
130
  gibson/tests/test_utils.py,sha256=r_y-EG05YTCNtL8MWiAK1KmPsmeoMgypKsQC_lVgOtM,559
129
- gibson_cli-0.7.6.dist-info/METADATA,sha256=l4_cKuK-vskymWf4WUJ_7y9_rcDeg_X9u57ILFFK3_0,13578
130
- gibson_cli-0.7.6.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
131
- gibson_cli-0.7.6.dist-info/entry_points.txt,sha256=j5VUvq3AzL21xPvVC24zMoXFt-I5lUWulr66nL3OAPM,50
132
- gibson_cli-0.7.6.dist-info/top_level.txt,sha256=RFaUY7VXGiqkMwo1Rj7pM4kGvxkhhnfo-2LmPpuL_fs,11
133
- gibson_cli-0.7.6.dist-info/RECORD,,
131
+ venv/bin/activate_this.py,sha256=E1T7r3559tBsyqFpdcQW0HbY7gDvNiIv5Pc6HQ4bpoA,2383
132
+ gibson_cli-0.7.8.dist-info/METADATA,sha256=fm4SkzjQLoNzUgJJsGY4-6G0fb4aP41sWzkH9hISeto,13757
133
+ gibson_cli-0.7.8.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
134
+ gibson_cli-0.7.8.dist-info/entry_points.txt,sha256=j5VUvq3AzL21xPvVC24zMoXFt-I5lUWulr66nL3OAPM,50
135
+ gibson_cli-0.7.8.dist-info/top_level.txt,sha256=fSV3vegbdbSDwiB6n5z3FCeYwkIonzFrx4ek3F_OSdI,16
136
+ gibson_cli-0.7.8.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.6.0)
2
+ Generator: setuptools (78.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -0,0 +1,59 @@
1
+ # Copyright (c) 2020-202x The virtualenv developers
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining
4
+ # a copy of this software and associated documentation files (the
5
+ # "Software"), to deal in the Software without restriction, including
6
+ # without limitation the rights to use, copy, modify, merge, publish,
7
+ # distribute, sublicense, and/or sell copies of the Software, and to
8
+ # permit persons to whom the Software is furnished to do so, subject to
9
+ # the following conditions:
10
+ #
11
+ # The above copyright notice and this permission notice shall be
12
+ # included in all copies or substantial portions of the Software.
13
+ #
14
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+
22
+ """
23
+ Activate virtualenv for current interpreter:
24
+
25
+ import runpy
26
+ runpy.run_path(this_file)
27
+
28
+ This can be used when you must use an existing Python interpreter, not the virtualenv bin/python.
29
+ """ # noqa: D415
30
+
31
+ from __future__ import annotations
32
+
33
+ import os
34
+ import site
35
+ import sys
36
+
37
+ try:
38
+ abs_file = os.path.abspath(__file__)
39
+ except NameError as exc:
40
+ msg = "You must use import runpy; runpy.run_path(this_file)"
41
+ raise AssertionError(msg) from exc
42
+
43
+ bin_dir = os.path.dirname(abs_file)
44
+ base = bin_dir[: -len("bin") - 1] # strip away the bin part from the __file__, plus the path separator
45
+
46
+ # prepend bin to PATH (this file is inside the bin directory)
47
+ os.environ["PATH"] = os.pathsep.join([bin_dir, *os.environ.get("PATH", "").split(os.pathsep)])
48
+ os.environ["VIRTUAL_ENV"] = base # virtual env is right above bin directory
49
+ os.environ["VIRTUAL_ENV_PROMPT"] = "" or os.path.basename(base) # noqa: SIM222
50
+
51
+ # add the virtual environments libraries to the host python import mechanism
52
+ prev_length = len(sys.path)
53
+ for lib in "../lib/python3.10/site-packages".split(os.pathsep):
54
+ path = os.path.realpath(os.path.join(bin_dir, lib))
55
+ site.addsitedir(path)
56
+ sys.path[:] = sys.path[prev_length:] + sys.path[0:prev_length]
57
+
58
+ sys.real_prefix = sys.prefix
59
+ sys.prefix = base