cmdbox 0.6.4__py3-none-any.whl → 0.6.4.1__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.
Potentially problematic release.
This version of cmdbox might be problematic. Click here for more details.
- cmdbox/app/app.py +6 -0
- cmdbox/app/common.py +7 -4
- cmdbox/app/commons/loghandler.py +101 -20
- cmdbox/app/edge.py +1 -3
- cmdbox/app/features/cli/cmdbox_agent_mcp_client.py +175 -0
- cmdbox/app/features/cli/cmdbox_agent_mcp_proxy.py +96 -0
- cmdbox/app/features/cli/cmdbox_cmd_list.py +1 -1
- cmdbox/app/features/cli/cmdbox_server_list.py +1 -1
- cmdbox/app/features/cli/cmdbox_server_start.py +2 -2
- cmdbox/app/features/cli/cmdbox_server_stop.py +2 -2
- cmdbox/app/features/cli/cmdbox_tts_install.py +11 -1
- cmdbox/app/features/cli/cmdbox_tts_start.py +1 -1
- cmdbox/app/features/cli/cmdbox_web_apikey_add.py +1 -1
- cmdbox/app/features/cli/cmdbox_web_apikey_del.py +1 -1
- cmdbox/app/features/cli/cmdbox_web_gencert.py +1 -1
- cmdbox/app/features/cli/cmdbox_web_genpass.py +1 -1
- cmdbox/app/features/cli/cmdbox_web_group_add.py +1 -1
- cmdbox/app/features/cli/cmdbox_web_group_del.py +1 -1
- cmdbox/app/features/cli/cmdbox_web_group_edit.py +1 -1
- cmdbox/app/features/cli/cmdbox_web_group_list.py +2 -2
- cmdbox/app/features/cli/cmdbox_web_start.py +1 -0
- cmdbox/app/features/cli/cmdbox_web_stop.py +1 -1
- cmdbox/app/features/cli/cmdbox_web_user_add.py +1 -1
- cmdbox/app/features/cli/cmdbox_web_user_del.py +1 -1
- cmdbox/app/features/cli/cmdbox_web_user_edit.py +1 -1
- cmdbox/app/features/cli/cmdbox_web_user_list.py +2 -2
- cmdbox/app/features/web/cmdbox_web_agent.py +16 -4
- cmdbox/app/features/web/cmdbox_web_get_cmd_choices.py +10 -2
- cmdbox/app/features/web/cmdbox_web_save_cmd.py +1 -0
- cmdbox/app/features/web/cmdbox_web_versions_used.py +4 -0
- cmdbox/app/mcp.py +4 -1
- cmdbox/app/options.py +6 -4
- cmdbox/app/web.py +39 -17
- cmdbox/extensions/features.yml +4 -1
- cmdbox/licenses/LICENSE_APScheduler_3_11_0_MIT_License.txt +19 -0
- cmdbox/licenses/LICENSE_SQLAlchemy_2_0_43_MIT.txt +19 -0
- cmdbox/licenses/LICENSE_anyio_4_10_0_UNKNOWN.txt +20 -0
- cmdbox/licenses/LICENSE_backoff_2_2_1_MIT_License.txt +21 -0
- cmdbox/licenses/LICENSE_certifi_2025_8_3_Mozilla_Public_License_2_0-MPL_2_0.txt +20 -0
- cmdbox/licenses/LICENSE_charset-normalizer_3_4_3_MIT.txt +21 -0
- cmdbox/licenses/LICENSE_cryptography_45_0_6_Apache-2_0_OR_BSD-3-Clause.txt +3 -0
- cmdbox/licenses/LICENSE_fastapi-sso_0_18_0_MIT_License.txt +21 -0
- cmdbox/licenses/LICENSE_fastmcp_2_11_3_Apache_Software_License.txt +201 -0
- cmdbox/licenses/LICENSE_google-adk_1_10_0_Apache_Software_License.txt +202 -0
- cmdbox/licenses/LICENSE_google-api-python-client_2_178_0_Apache_Software_License.txt +201 -0
- cmdbox/licenses/LICENSE_google-cloud-aiplatform_1_108_0_Apache_2_0.txt +202 -0
- cmdbox/licenses/LICENSE_google-genai_1_29_0_Apache_Software_License.txt +202 -0
- cmdbox/licenses/LICENSE_greenlet_3_2_4_MIT_AND_Python-2_0.txt +30 -0
- cmdbox/licenses/LICENSE_huggingface-hub_0_34_4_Apache_Software_License.txt +201 -0
- cmdbox/licenses/LICENSE_litellm-enterprise_0_1_19_UNKNOWN.txt +37 -0
- cmdbox/licenses/LICENSE_litellm_1_75_5_post1_MIT_License.txt +26 -0
- cmdbox/licenses/LICENSE_markdown-it-py_4_0_0_MIT_License.txt +21 -0
- cmdbox/licenses/LICENSE_mcp_1_12_4_MIT_License.txt +21 -0
- cmdbox/licenses/LICENSE_multidict_6_6_4_Apache_License_2_0.txt +13 -0
- cmdbox/licenses/LICENSE_oauthlib_3_3_1_BSD-3-Clause.txt +27 -0
- cmdbox/licenses/LICENSE_openai_1_99_9_Apache_Software_License.txt +201 -0
- cmdbox/licenses/LICENSE_orjson_3_11_1_Apache_Software_License-MIT_License.txt +201 -0
- cmdbox/licenses/LICENSE_redis_6_4_0_MIT_License.txt +21 -0
- cmdbox/licenses/LICENSE_rpds-py_0_27_0_UNKNOWN.txt +19 -0
- cmdbox/licenses/LICENSE_sphinx-intl_2_3_2_UNKNOWN.txt +25 -0
- cmdbox/licenses/LICENSE_tenacity_9_1_2_Apache_Software_License.txt +202 -0
- cmdbox/licenses/LICENSE_tiktoken_0_11_0_MIT_License-Copyright-c-2022_OpenAI-Shantanu_Jain-Permission_is_hereby_granted-free_of_charge-to_any_per.txt +21 -0
- cmdbox/licenses/files.txt +28 -23
- cmdbox/logconf_cmdbox.yml +32 -0
- cmdbox/version.py +2 -2
- cmdbox/web/agent.html +8 -0
- cmdbox/web/assets/cmdbox/agent.js +45 -1
- cmdbox/web/assets/cmdbox/common.js +4 -22
- {cmdbox-0.6.4.dist-info → cmdbox-0.6.4.1.dist-info}/METADATA +2 -1
- {cmdbox-0.6.4.dist-info → cmdbox-0.6.4.1.dist-info}/RECORD +74 -44
- {cmdbox-0.6.4.dist-info → cmdbox-0.6.4.1.dist-info}/WHEEL +0 -0
- {cmdbox-0.6.4.dist-info → cmdbox-0.6.4.1.dist-info}/entry_points.txt +0 -0
- {cmdbox-0.6.4.dist-info → cmdbox-0.6.4.1.dist-info}/licenses/LICENSE +0 -0
- {cmdbox-0.6.4.dist-info → cmdbox-0.6.4.1.dist-info}/top_level.txt +0 -0
|
@@ -40,7 +40,7 @@ class WebGenpass(feature.OneshotResultEdgeFeature):
|
|
|
40
40
|
Dict[str, Any]: オプション
|
|
41
41
|
"""
|
|
42
42
|
return dict(
|
|
43
|
-
use_redis=self.USE_REDIS_FALSE, nouse_webmode=False,
|
|
43
|
+
use_redis=self.USE_REDIS_FALSE, nouse_webmode=False, use_agent=True,
|
|
44
44
|
description_ja="webモードで使用できるパスワード文字列を生成します。",
|
|
45
45
|
description_en="Generates a password string that can be used in web mode.",
|
|
46
46
|
choice=[
|
|
@@ -33,7 +33,7 @@ class WebGroupAdd(feature.UnsupportEdgeFeature):
|
|
|
33
33
|
Dict[str, Any]: オプション
|
|
34
34
|
"""
|
|
35
35
|
return dict(
|
|
36
|
-
use_redis=self.USE_REDIS_MEIGHT, nouse_webmode=False,
|
|
36
|
+
use_redis=self.USE_REDIS_MEIGHT, nouse_webmode=False, use_agent=False,
|
|
37
37
|
description_ja="Webモードのグループを追加します。",
|
|
38
38
|
description_en="Add a group in Web mode.",
|
|
39
39
|
choice=[
|
|
@@ -33,7 +33,7 @@ class WebGroupDel(feature.UnsupportEdgeFeature):
|
|
|
33
33
|
Dict[str, Any]: オプション
|
|
34
34
|
"""
|
|
35
35
|
return dict(
|
|
36
|
-
use_redis=self.USE_REDIS_MEIGHT, nouse_webmode=False,
|
|
36
|
+
use_redis=self.USE_REDIS_MEIGHT, nouse_webmode=False, use_agent=False,
|
|
37
37
|
description_ja="Webモードのグループを削除します。",
|
|
38
38
|
description_en="Del a group in Web mode.",
|
|
39
39
|
choice=[
|
|
@@ -33,7 +33,7 @@ class WebGroupEdit(feature.UnsupportEdgeFeature):
|
|
|
33
33
|
Dict[str, Any]: オプション
|
|
34
34
|
"""
|
|
35
35
|
return dict(
|
|
36
|
-
use_redis=self.USE_REDIS_MEIGHT, nouse_webmode=False,
|
|
36
|
+
use_redis=self.USE_REDIS_MEIGHT, nouse_webmode=False, use_agent=False,
|
|
37
37
|
description_ja="Webモードのグループを編集します。",
|
|
38
38
|
description_en="Edit a group in Web mode.",
|
|
39
39
|
choice=[
|
|
@@ -6,7 +6,7 @@ import argparse
|
|
|
6
6
|
import logging
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
class WebGroupList(feature.
|
|
9
|
+
class WebGroupList(feature.UnsupportEdgeFeature):
|
|
10
10
|
def get_mode(self) -> Union[str, List[str]]:
|
|
11
11
|
"""
|
|
12
12
|
この機能のモードを返します
|
|
@@ -33,7 +33,7 @@ class WebGroupList(feature.OneshotResultEdgeFeature):
|
|
|
33
33
|
Dict[str, Any]: オプション
|
|
34
34
|
"""
|
|
35
35
|
return dict(
|
|
36
|
-
use_redis=self.USE_REDIS_MEIGHT, nouse_webmode=False,
|
|
36
|
+
use_redis=self.USE_REDIS_MEIGHT, nouse_webmode=False, use_agent=False,
|
|
37
37
|
description_ja="Webモードのグループー一覧を取得します。",
|
|
38
38
|
description_en="Get a list of users in Web mode.",
|
|
39
39
|
choice=[
|
|
@@ -38,6 +38,7 @@ class WebStart(feature.UnsupportEdgeFeature, agent_base.AgentBase):
|
|
|
38
38
|
opt = super().get_option()
|
|
39
39
|
opt['use_redis'] = self.USE_REDIS_MEIGHT
|
|
40
40
|
opt['nouse_webmode'] = True
|
|
41
|
+
opt['use_agent'] = False
|
|
41
42
|
opt['description_ja'] = "Webモードを起動します。"
|
|
42
43
|
opt['description_en'] = "Start Web mode."
|
|
43
44
|
opt['choice'] += [
|
|
@@ -33,7 +33,7 @@ class WebStop(feature.UnsupportEdgeFeature):
|
|
|
33
33
|
Dict[str, Any]: オプション
|
|
34
34
|
"""
|
|
35
35
|
return dict(
|
|
36
|
-
use_redis=self.USE_REDIS_MEIGHT, nouse_webmode=True,
|
|
36
|
+
use_redis=self.USE_REDIS_MEIGHT, nouse_webmode=True, use_agent=False,
|
|
37
37
|
description_ja="Webモードを停止します。",
|
|
38
38
|
description_en="Stop Web mode.",
|
|
39
39
|
choice=[
|
|
@@ -33,7 +33,7 @@ class WebUserAdd(feature.UnsupportEdgeFeature):
|
|
|
33
33
|
Dict[str, Any]: オプション
|
|
34
34
|
"""
|
|
35
35
|
return dict(
|
|
36
|
-
use_redis=self.USE_REDIS_MEIGHT, nouse_webmode=False,
|
|
36
|
+
use_redis=self.USE_REDIS_MEIGHT, nouse_webmode=False, use_agent=False,
|
|
37
37
|
description_ja="Webモードのユーザーを追加します。",
|
|
38
38
|
description_en="Add a user in Web mode.",
|
|
39
39
|
choice=[
|
|
@@ -33,7 +33,7 @@ class WebUserDel(feature.UnsupportEdgeFeature):
|
|
|
33
33
|
Dict[str, Any]: オプション
|
|
34
34
|
"""
|
|
35
35
|
return dict(
|
|
36
|
-
use_redis=self.USE_REDIS_MEIGHT, nouse_webmode=False,
|
|
36
|
+
use_redis=self.USE_REDIS_MEIGHT, nouse_webmode=False, use_agent=False,
|
|
37
37
|
description_ja="Webモードのユーザーを削除します。",
|
|
38
38
|
description_en="Delete a user in Web mode.",
|
|
39
39
|
choice=[
|
|
@@ -33,7 +33,7 @@ class WebUserEdit(feature.UnsupportEdgeFeature):
|
|
|
33
33
|
Dict[str, Any]: オプション
|
|
34
34
|
"""
|
|
35
35
|
return dict(
|
|
36
|
-
use_redis=self.USE_REDIS_MEIGHT, nouse_webmode=False,
|
|
36
|
+
use_redis=self.USE_REDIS_MEIGHT, nouse_webmode=False, use_agent=False,
|
|
37
37
|
description_ja="Webモードのユーザーを編集します。",
|
|
38
38
|
description_en="Edit users in Web mode.",
|
|
39
39
|
choice=[
|
|
@@ -6,7 +6,7 @@ import argparse
|
|
|
6
6
|
import logging
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
class WebUserList(feature.
|
|
9
|
+
class WebUserList(feature.UnsupportEdgeFeature):
|
|
10
10
|
def get_mode(self) -> Union[str, List[str]]:
|
|
11
11
|
"""
|
|
12
12
|
この機能のモードを返します
|
|
@@ -33,7 +33,7 @@ class WebUserList(feature.OneshotResultEdgeFeature):
|
|
|
33
33
|
Dict[str, Any]: オプション
|
|
34
34
|
"""
|
|
35
35
|
return dict(
|
|
36
|
-
use_redis=self.USE_REDIS_MEIGHT, nouse_webmode=False,
|
|
36
|
+
use_redis=self.USE_REDIS_MEIGHT, nouse_webmode=False, use_agent=False,
|
|
37
37
|
description_ja="Webモードのユーザー一覧を取得します。",
|
|
38
38
|
description_en="Get a list of users in Web mode.",
|
|
39
39
|
choice=[
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from cmdbox.app import common, feature
|
|
2
2
|
from cmdbox.app.auth import signin
|
|
3
|
+
from cmdbox.app.features.cli import agent_base
|
|
3
4
|
from cmdbox.app.web import Web
|
|
4
5
|
from fastapi import FastAPI, Depends, HTTPException, Request, Response, WebSocket
|
|
5
6
|
from fastapi.responses import HTMLResponse, StreamingResponse
|
|
@@ -38,6 +39,16 @@ class Agent(feature.WebFeature):
|
|
|
38
39
|
web.options.audit_exec(req, res, web)
|
|
39
40
|
return web.agent_html_data
|
|
40
41
|
|
|
42
|
+
@app.get('/agent/llmsetting')
|
|
43
|
+
async def agent(req:Request, res:Response):
|
|
44
|
+
signin = web.signin.check_signin(req, res)
|
|
45
|
+
if signin is not None:
|
|
46
|
+
return signin
|
|
47
|
+
res.headers['Access-Control-Allow-Origin'] = '*'
|
|
48
|
+
web.options.audit_exec(req, res, web)
|
|
49
|
+
cmd = agent_base.AgentBase(web.appcls, web.ver)
|
|
50
|
+
return cmd.get_option().get('choice')
|
|
51
|
+
|
|
41
52
|
@app.post('/agent/session/list')
|
|
42
53
|
async def agent_session_list(req:Request, res:Response):
|
|
43
54
|
signin = web.signin.check_signin(req, res)
|
|
@@ -150,12 +161,9 @@ class Agent(feature.WebFeature):
|
|
|
150
161
|
if 'signin' in session:
|
|
151
162
|
user_id = session['signin']['name']
|
|
152
163
|
groups = session['signin']['groups']
|
|
153
|
-
# 言語認識
|
|
154
|
-
language, _ = locale.getlocale()
|
|
155
|
-
is_japan = language.find('Japan') >= 0 or language.find('ja_JP') >= 0
|
|
156
164
|
# セッションを作成する
|
|
157
165
|
agent_session = await web.create_agent_session(web.agent_runner.session_service, user_id, session_id=session_id)
|
|
158
|
-
startmsg = "こんにちは!何かお手伝いできることはありますか?" if is_japan else "Hello! Is there anything I can help you with?"
|
|
166
|
+
startmsg = "こんにちは!何かお手伝いできることはありますか?" if common.is_japan() else "Hello! Is there anything I can help you with?"
|
|
159
167
|
yield json.dumps(dict(message=startmsg), default=common.default_json_enc)
|
|
160
168
|
def _replace_match(match_obj):
|
|
161
169
|
json_str = match_obj.group(0)
|
|
@@ -229,6 +237,10 @@ class Agent(feature.WebFeature):
|
|
|
229
237
|
break
|
|
230
238
|
except self.SSEDisconnect as e:
|
|
231
239
|
break
|
|
240
|
+
except NotImplementedError as e:
|
|
241
|
+
web.logger.warning(f'The session table needs to be reloaded.{e}', exc_info=True)
|
|
242
|
+
yield json.dumps(dict(message=f'The session table needs to be reloaded. Please reload your browser.'), default=common.default_json_enc)
|
|
243
|
+
break
|
|
232
244
|
except Exception as e:
|
|
233
245
|
web.logger.warning(f'chat error.', exc_info=True)
|
|
234
246
|
yield json.dumps(dict(message=f'<pre>{traceback.format_exc()}</pre>'), default=common.default_json_enc)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from cmdbox.app import feature
|
|
1
|
+
from cmdbox.app import common, feature
|
|
2
2
|
from cmdbox.app.web import Web
|
|
3
3
|
from fastapi import FastAPI, Request, Response, HTTPException
|
|
4
4
|
|
|
@@ -20,5 +20,13 @@ class GetCmdChoices(feature.WebFeature):
|
|
|
20
20
|
form = await req.form()
|
|
21
21
|
mode = form.get('mode')
|
|
22
22
|
cmd = form.get('cmd')
|
|
23
|
-
ret = web.options.get_cmd_choices(mode, cmd, True)
|
|
23
|
+
ret = web.options.get_cmd_choices(mode, cmd, True).copy()
|
|
24
|
+
fobj = web.options.get_cmd_attr(mode, cmd, 'feature')
|
|
25
|
+
desc = web.options.get_cmd_attr(mode, cmd, 'description_en' if not common.is_japan() else 'description_ja')
|
|
26
|
+
desc_nouse_webmode = '\U00002B55 Web' if not web.options.get_cmd_attr(mode, cmd, 'nouse_webmode') else '\U0000274C Web'
|
|
27
|
+
desc_use_agent = '\U00002B55 Agent' if web.options.get_cmd_attr(mode, cmd, 'use_agent') else '\U0000274C Agent'
|
|
28
|
+
desc_edge = '\U00002B55 Edge' if not isinstance(fobj, feature.UnsupportEdgeFeature) else '\U0000274C Edge'
|
|
29
|
+
help = dict(opt="help", type=web.options.T_TEXT, default=f"\U00002B55 CLI, {desc_nouse_webmode}, {desc_use_agent}, {desc_edge}, {desc}",
|
|
30
|
+
required=False, multi=False, hide=False, choice=None, description_ja="-", description_en="-")
|
|
31
|
+
ret.insert(0, help)
|
|
24
32
|
return ret
|
|
@@ -50,5 +50,6 @@ class SaveCmd(feature.WebFeature):
|
|
|
50
50
|
if 'cmd_disabled' in opt: del opt['cmd_disabled']
|
|
51
51
|
if 'name_disabled' in opt: del opt['name_disabled']
|
|
52
52
|
if 'modal_mode' in opt: del opt['modal_mode']
|
|
53
|
+
if 'help' in opt: del opt['help']
|
|
53
54
|
common.saveopt(opt, opt_path, True)
|
|
54
55
|
return dict(success=f'Command "{title}" saved in "{opt_path}".')
|
|
@@ -25,6 +25,10 @@ class VersionsUsed(feature.WebFeature):
|
|
|
25
25
|
for i, line in enumerate(f.readlines()):
|
|
26
26
|
parts = line.strip().split('\t')
|
|
27
27
|
ret.append(parts)
|
|
28
|
+
with open(Path(cmdbox.__file__).parent / 'app' / 'lib_license_list.txt', 'r', encoding='utf-8') as f:
|
|
29
|
+
for i, line in enumerate(f.readlines()):
|
|
30
|
+
parts = line.strip().split('\t')
|
|
31
|
+
ret.append(parts)
|
|
28
32
|
with open(Path(cmdbox.__file__).parent / 'web' / 'assets_license_list.txt', 'r', encoding='utf-8') as f:
|
|
29
33
|
for i, line in enumerate(f.readlines()):
|
|
30
34
|
parts = line.strip().split('\t')
|
cmdbox/app/mcp.py
CHANGED
|
@@ -81,8 +81,9 @@ class Mcp:
|
|
|
81
81
|
"""
|
|
82
82
|
from google.adk.events import Event
|
|
83
83
|
from google.adk.sessions import DatabaseSessionService, InMemorySessionService, session
|
|
84
|
-
from typing_extensions import override
|
|
84
|
+
#from typing_extensions import override
|
|
85
85
|
if hasattr(args, 'agent_session_dburl') and args.agent_session_dburl is not None:
|
|
86
|
+
"""
|
|
86
87
|
class _DatabaseSessionService(DatabaseSessionService):
|
|
87
88
|
@override
|
|
88
89
|
async def append_event(self, session: session.Session, event: Event) -> Event:
|
|
@@ -98,6 +99,8 @@ class Mcp:
|
|
|
98
99
|
ret.content.parts = bk_parts
|
|
99
100
|
return ret
|
|
100
101
|
dss = _DatabaseSessionService(db_url=args.agent_session_dburl)
|
|
102
|
+
"""
|
|
103
|
+
dss = DatabaseSessionService(db_url=args.agent_session_dburl)
|
|
101
104
|
#dss.db_engine.echo = True
|
|
102
105
|
return dss
|
|
103
106
|
else:
|
cmdbox/app/options.py
CHANGED
|
@@ -8,10 +8,8 @@ from starlette.routing import Route
|
|
|
8
8
|
from typing import List, Dict, Any
|
|
9
9
|
import argparse
|
|
10
10
|
import functools
|
|
11
|
-
import locale
|
|
12
11
|
import logging
|
|
13
12
|
import re
|
|
14
|
-
import time
|
|
15
13
|
import uuid
|
|
16
14
|
|
|
17
15
|
|
|
@@ -179,8 +177,7 @@ class Options:
|
|
|
179
177
|
opt['action'] = 'append' if val['multi'] else None
|
|
180
178
|
o = [f'-{val["short"]}'] if "short" in val else []
|
|
181
179
|
o += [f'--{key}']
|
|
182
|
-
|
|
183
|
-
opt['help'] = val['description_en'] if language.find('Japan') < 0 and language.find('ja_JP') < 0 else val['description_ja']
|
|
180
|
+
opt['help'] = val['description_en'] if not common.is_japan() else val['description_ja']
|
|
184
181
|
opt['default'] = val['default']
|
|
185
182
|
if val['multi'] and val['default'] is not None:
|
|
186
183
|
raise ValueError(f'list_options: The default value must be None if multi is True. key={key}, val={val}')
|
|
@@ -300,6 +297,11 @@ class Options:
|
|
|
300
297
|
description_ja="このコマンド登録の説明文を指定します。Agentがこのコマンドの用途を理解するのに使用します。",
|
|
301
298
|
description_en="Specifies a description of this command registration, used to help the Agent understand the use of this command.",
|
|
302
299
|
choice=None)
|
|
300
|
+
self._options["logsv"] = dict(
|
|
301
|
+
type=Options.T_BOOL, default=False, required=False, multi=False, hide=True,
|
|
302
|
+
description_ja="logsvを有効にします。logsvは複数のプロセスがログファイルへの書き込みを同期するための機能です。すでにlogsvが有効なプロセスがある場合は無視されます。",
|
|
303
|
+
description_en="Enables logsv. Logsv is a feature that synchronizes log file writing among multiple processes. If there is already an active process with logsv enabled, it will be ignored.",
|
|
304
|
+
choice=[False, True])
|
|
303
305
|
|
|
304
306
|
def init_debugoption(self):
|
|
305
307
|
# デバックオプションを追加
|
cmdbox/app/web.py
CHANGED
|
@@ -793,10 +793,15 @@ class Web:
|
|
|
793
793
|
"""
|
|
794
794
|
if session_id is None:
|
|
795
795
|
session_id = common.random_string(32)
|
|
796
|
-
|
|
797
|
-
|
|
796
|
+
try:
|
|
797
|
+
session = await session_service.get_session(app_name=self.ver.__appid__, user_id=user_id, session_id=session_id)
|
|
798
|
+
if session is None:
|
|
799
|
+
session = await session_service.create_session(app_name=self.ver.__appid__, user_id=user_id, session_id=session_id)
|
|
800
|
+
return session
|
|
801
|
+
except NotImplementedError:
|
|
802
|
+
# セッションが1件もない場合はNotImplementedErrorが発生することがある
|
|
798
803
|
session = await session_service.create_session(app_name=self.ver.__appid__, user_id=user_id, session_id=session_id)
|
|
799
|
-
|
|
804
|
+
return session
|
|
800
805
|
self.create_agent_session = create_agent_session
|
|
801
806
|
async def list_agent_sessions(session_service:BaseSessionService, user_id:str, session_id:str=None) -> List[Session]:
|
|
802
807
|
"""
|
|
@@ -809,20 +814,37 @@ class Web:
|
|
|
809
814
|
Returns:
|
|
810
815
|
List[Session]: セッションリスト
|
|
811
816
|
"""
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
+
try:
|
|
818
|
+
if session_id is None:
|
|
819
|
+
sessions = await session_service.list_sessions(app_name=self.ver.__appid__, user_id=user_id)
|
|
820
|
+
ret = []
|
|
821
|
+
for s in sessions.sessions:
|
|
822
|
+
try:
|
|
823
|
+
session = await session_service.get_session(app_name=self.ver.__appid__, user_id=user_id, session_id=s.id)
|
|
824
|
+
if session is None:
|
|
825
|
+
continue
|
|
826
|
+
ret.append(session)
|
|
827
|
+
except:
|
|
828
|
+
# セッションが取得できない場合は削除する
|
|
829
|
+
try:
|
|
830
|
+
await session_service.delete_session(app_name=self.ver.__appid__, user_id=user_id, session_id=s.id)
|
|
831
|
+
except:
|
|
832
|
+
pass
|
|
833
|
+
finally:
|
|
834
|
+
continue
|
|
835
|
+
return ret
|
|
836
|
+
else:
|
|
837
|
+
session = await session_service.get_session(app_name=self.ver.__appid__, user_id=user_id, session_id=session_id)
|
|
817
838
|
if session is None:
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
839
|
+
return []
|
|
840
|
+
return [session]
|
|
841
|
+
except NotImplementedError:
|
|
842
|
+
# セッションが1件もない場合はNotImplementedErrorが発生することがある
|
|
843
|
+
return []
|
|
844
|
+
except Exception as e:
|
|
845
|
+
# それ以外のエラーが発生した時はログに出力して空リストを返す
|
|
846
|
+
self.logger.warning(f"list_agent_sessions warning: {e}", exc_info=True)
|
|
847
|
+
return []
|
|
826
848
|
self.list_agent_sessions = list_agent_sessions
|
|
827
849
|
async def delete_agent_session(session_service:BaseSessionService, user_id:str, session_id:str) -> bool:
|
|
828
850
|
"""
|
|
@@ -841,7 +863,7 @@ class Web:
|
|
|
841
863
|
|
|
842
864
|
mcp_app:Starlette = None
|
|
843
865
|
if self.mcp is not None:
|
|
844
|
-
mcp_app:Starlette = self.mcp.
|
|
866
|
+
mcp_app:Starlette = self.mcp.http_app()
|
|
845
867
|
#mcp_app:Starlette = self.mcp.http_app()
|
|
846
868
|
if mcp_app is not None:
|
|
847
869
|
app = FastAPI(lifespan=mcp_app.lifespan)
|
cmdbox/extensions/features.yml
CHANGED
|
@@ -44,7 +44,10 @@ agentrule: # Specifies a list of rules that determi
|
|
|
44
44
|
cmds: [list, load] # Specify the "cmd" to which the rule applies. Multiple items can be specified in a list.
|
|
45
45
|
rule: allow # Specifies whether the specified command is allowed or not. Values are allow or deny.
|
|
46
46
|
- mode: client
|
|
47
|
-
cmds: [http]
|
|
47
|
+
cmds: [file_download, file_list, http, server_info]
|
|
48
|
+
rule: allow
|
|
49
|
+
- mode: server
|
|
50
|
+
cmds: [list]
|
|
48
51
|
rule: allow
|
|
49
52
|
- mode: tts
|
|
50
53
|
cmds: [say]
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
This is the MIT license: http://www.opensource.org/licenses/mit-license.php
|
|
2
|
+
|
|
3
|
+
Copyright (c) Alex Grönholm
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this
|
|
6
|
+
software and associated documentation files (the "Software"), to deal in the Software
|
|
7
|
+
without restriction, including without limitation the rights to use, copy, modify, merge,
|
|
8
|
+
publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
|
|
9
|
+
to whom the Software is furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all copies or
|
|
12
|
+
substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
15
|
+
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
|
16
|
+
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
|
|
17
|
+
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
18
|
+
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
19
|
+
DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Copyright 2005-2025 SQLAlchemy authors and contributors <see AUTHORS file>.
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
4
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
5
|
+
the Software without restriction, including without limitation the rights to
|
|
6
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
7
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
|
8
|
+
so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
|
11
|
+
copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
19
|
+
SOFTWARE.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018 Alex Grönholm
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
7
|
+
the Software without restriction, including without limitation the rights to
|
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
9
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
10
|
+
subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
17
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
18
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
19
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
20
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2014 litl, LLC.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
This package contains a modified version of ca-bundle.crt:
|
|
2
|
+
|
|
3
|
+
ca-bundle.crt -- Bundle of CA Root Certificates
|
|
4
|
+
|
|
5
|
+
This is a bundle of X.509 certificates of public Certificate Authorities
|
|
6
|
+
(CA). These were automatically extracted from Mozilla's root certificates
|
|
7
|
+
file (certdata.txt). This file can be found in the mozilla source tree:
|
|
8
|
+
https://hg.mozilla.org/mozilla-central/file/tip/security/nss/lib/ckfw/builtins/certdata.txt
|
|
9
|
+
It contains the certificates in PEM format and therefore
|
|
10
|
+
can be directly used with curl / libcurl / php_curl, or with
|
|
11
|
+
an Apache+mod_ssl webserver for SSL client authentication.
|
|
12
|
+
Just configure this file as the SSLCACertificateFile.#
|
|
13
|
+
|
|
14
|
+
***** BEGIN LICENSE BLOCK *****
|
|
15
|
+
This Source Code Form is subject to the terms of the Mozilla Public License,
|
|
16
|
+
v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain
|
|
17
|
+
one at http://mozilla.org/MPL/2.0/.
|
|
18
|
+
|
|
19
|
+
***** END LICENSE BLOCK *****
|
|
20
|
+
@(#) $RCSfile: certdata.txt,v $ $Revision: 1.80 $ $Date: 2011/11/03 15:11:58 $
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 TAHRI Ahmed R.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021 Tomas Votava <info@tomasvotava.eu>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|