cmdbox 0.6.2.2__py3-none-any.whl → 0.6.2.4__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.

Files changed (41) hide show
  1. cmdbox/app/auth/signin.py +6 -5
  2. cmdbox/app/common.py +21 -15
  3. cmdbox/app/feature.py +5 -1
  4. cmdbox/app/features/cli/agent_base.py +1 -1
  5. cmdbox/app/features/cli/cmdbox_audit_search.py +23 -1
  6. cmdbox/app/features/cli/cmdbox_audit_write.py +260 -260
  7. cmdbox/app/features/cli/cmdbox_cmd_list.py +2 -2
  8. cmdbox/app/features/cli/cmdbox_cmd_load.py +2 -2
  9. cmdbox/app/features/cli/cmdbox_edge_config.py +2 -2
  10. cmdbox/app/features/cli/cmdbox_edge_start.py +1 -1
  11. cmdbox/app/features/cli/cmdbox_mcp_client.py +174 -0
  12. cmdbox/app/features/cli/cmdbox_mcp_proxy.py +2 -2
  13. cmdbox/app/features/cli/cmdbox_server_start.py +1 -1
  14. cmdbox/app/features/cli/cmdbox_web_apikey_add.py +2 -2
  15. cmdbox/app/features/cli/cmdbox_web_apikey_del.py +2 -2
  16. cmdbox/app/features/cli/cmdbox_web_gencert.py +3 -3
  17. cmdbox/app/features/cli/cmdbox_web_group_add.py +2 -2
  18. cmdbox/app/features/cli/cmdbox_web_group_del.py +2 -2
  19. cmdbox/app/features/cli/cmdbox_web_group_edit.py +2 -2
  20. cmdbox/app/features/cli/cmdbox_web_group_list.py +2 -2
  21. cmdbox/app/features/cli/cmdbox_web_start.py +12 -12
  22. cmdbox/app/features/cli/cmdbox_web_stop.py +1 -1
  23. cmdbox/app/features/cli/cmdbox_web_user_add.py +2 -2
  24. cmdbox/app/features/cli/cmdbox_web_user_del.py +2 -2
  25. cmdbox/app/features/cli/cmdbox_web_user_edit.py +2 -2
  26. cmdbox/app/features/cli/cmdbox_web_user_list.py +2 -2
  27. cmdbox/app/mcp.py +82 -86
  28. cmdbox/app/options.py +2 -3
  29. cmdbox/app/web.py +15 -0
  30. cmdbox/extensions/features.yml +2 -14
  31. cmdbox/extensions/sample_project/sample/extensions/user_list.yml +25 -1
  32. cmdbox/version.py +4 -3
  33. cmdbox/web/assets/cmdbox/agent.js +1 -0
  34. cmdbox/web/assets/cmdbox/common.js +2 -0
  35. cmdbox/web/assets/cmdbox/filer_modal.js +4 -2
  36. {cmdbox-0.6.2.2.dist-info → cmdbox-0.6.2.4.dist-info}/METADATA +1 -1
  37. {cmdbox-0.6.2.2.dist-info → cmdbox-0.6.2.4.dist-info}/RECORD +41 -40
  38. {cmdbox-0.6.2.2.dist-info → cmdbox-0.6.2.4.dist-info}/LICENSE +0 -0
  39. {cmdbox-0.6.2.2.dist-info → cmdbox-0.6.2.4.dist-info}/WHEEL +0 -0
  40. {cmdbox-0.6.2.2.dist-info → cmdbox-0.6.2.4.dist-info}/entry_points.txt +0 -0
  41. {cmdbox-0.6.2.2.dist-info → cmdbox-0.6.2.4.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,174 @@
1
+ from cmdbox.app import common, feature
2
+ from cmdbox.app.features.cli import cmdbox_web_start
3
+ from cmdbox.app.options import Options
4
+ from typing import Dict, Any, Tuple, List, Union
5
+ import argparse
6
+ import logging
7
+
8
+
9
+ class McpClient(feature.UnsupportEdgeFeature):
10
+ def get_mode(self) -> Union[str, List[str]]:
11
+ """
12
+ この機能のモードを返します
13
+
14
+ Returns:
15
+ Union[str, List[str]]: モード
16
+ """
17
+ return 'mcp'
18
+
19
+ def get_cmd(self) -> str:
20
+ """
21
+ この機能のコマンドを返します
22
+
23
+ Returns:
24
+ str: コマンド
25
+ """
26
+ return 'client'
27
+
28
+ def get_option(self):
29
+ """
30
+ この機能のオプションを返します
31
+
32
+ Returns:
33
+ Dict[str, Any]: オプション
34
+ """
35
+ return dict(
36
+ use_redis=self.USE_REDIS_FALSE, nouse_webmode=True, use_agent=False,
37
+ description_ja="リモートMCPサーバーにリクエストを行うMCPクライアントを起動します。",
38
+ description_en="Starts an MCP client that makes requests to a remote MCP server.",
39
+ choice=[
40
+ dict(opt="mcpserver_name", type=Options.T_STR, default='mcpserver', required=True, multi=False, hide=False, choice=None,
41
+ description_ja="リモートMCPサーバーの名前を指定します。省略した場合は`mcpserver`となります。",
42
+ description_en="Specify the name of the MCP server. If omitted, it will be `mcpserver`.",),
43
+ dict(opt="mcpserver_url", type=Options.T_STR, default='http://localhost:8081/mcpsv/mcp', required=True, multi=False, hide=False, choice=None,
44
+ description_ja="リモートMCPサーバーのURLを指定します。省略した場合は`http://localhost:8081/mcpsv/mcp`となります。",
45
+ description_en="Specifies the URL of the remote MCP server. If omitted, it will be `http://localhost:8081/mcpsv/mcp`.",),
46
+ dict(opt="mcpserver_apikey", type=Options.T_STR, default=None, required=False, multi=False, hide=False, choice=None,
47
+ description_ja="リモートMCPサーバーのAPI Keyを指定します。",
48
+ description_en="Specify the API Key of the remote MCP server.",),
49
+ dict(opt="mcpserver_transport", type=Options.T_STR, default='streamable-http', required=True, multi=False, hide=False, choice=['', 'streamable-http', 'sse', 'http'],
50
+ description_ja="リモートMCPサーバーのトランスポートを指定します。省略した場合は`streamable-http`となります。",
51
+ description_en="Specifies the transport of the remote MCP server. If omitted, it is `streamable-http`.",),
52
+ dict(opt="operation", type=Options.T_STR, default='list_tools', required=True, multi=False, hide=False,
53
+ choice=['list_tools', 'call_tool', 'list_resources', 'read_resource', 'list_prompts', 'get_prompt'],
54
+ choice_show=dict(call_tool=['tool_name', 'tool_args', 'mcp_timeout',],
55
+ read_resource=['resource_url',],
56
+ get_prompt=['prompt_name', 'prompt_args']),
57
+ description_ja="リモートMCPサーバーに要求する操作を指定します。省略した場合は`list_tools`となります。",
58
+ description_en="Specifies the operations to request from the remote MCP server. If omitted, `list_tools` is used.",),
59
+ dict(opt="tool_name", type=Options.T_STR, default=None, required=False, multi=False, hide=False, choice=None,
60
+ description_ja="リモートMCPサーバーで実行するツールの名前を指定します。",
61
+ description_en="Specify the name of the tool to run on the remote MCP server."),
62
+ dict(opt="tool_args", type=Options.T_DICT, default=None, required=False, multi=True, hide=False, choice=None,
63
+ description_ja="リモートMCPサーバーで実行するツールの引数を指定します。",
64
+ description_en="Specify arguments for the tool to run on the remote MCP server."),
65
+ dict(opt="mcp_timeout", type=Options.T_INT, default="60", required=False, multi=False, hide=False, choice=None,
66
+ description_ja="リモートMCPサーバーの応答が返ってくるまでの最大待ち時間を指定します。",
67
+ description_en="Specifies the maximum time to wait for a response from the remote MCP server."),
68
+ dict(opt="resource_url", type=Options.T_STR, default=None, required=False, multi=False, hide=False, choice=None,
69
+ description_ja="リモートMCPサーバーから取得するリソースのURLを指定します。",
70
+ description_en="Specify the URL of the resource to retrieve from the remote MCP server."),
71
+ dict(opt="prompt_name", type=Options.T_STR, default=None, required=False, multi=False, hide=False, choice=None,
72
+ description_ja="リモートMCPサーバーから取得するプロンプトの名前を指定します。",
73
+ description_en="Specifies the name of the prompt to be retrieved from the remote MCP server."),
74
+ dict(opt="prompt_args", type=Options.T_DICT, default=None, required=False, multi=True, hide=False, choice=None,
75
+ description_ja="リモートMCPサーバーから取得するプロンプトの引数を指定します。",
76
+ description_en="Specifies prompt arguments to be retrieved from the remote MCP server."),
77
+ dict(opt="output_json", short="o", type=Options.T_FILE, default=None, required=False, multi=False, hide=True, choice=None, fileio="out",
78
+ description_ja="処理結果jsonの保存先ファイルを指定。",
79
+ description_en="Specify the destination file for saving the processing result json."),
80
+ dict(opt="output_json_append", short="a", type=Options.T_BOOL, default=False, required=False, multi=False, hide=True, choice=[True, False],
81
+ description_ja="処理結果jsonファイルを追記保存します。",
82
+ description_en="Save the processing result json file by appending."),
83
+ dict(opt="stdout_log", type=Options.T_BOOL, default=True, required=False, multi=False, hide=True, choice=[True, False],
84
+ description_ja="GUIモードでのみ使用可能です。コマンド実行時の標準出力をConsole logに出力します。",
85
+ description_en="Available only in GUI mode. Outputs standard output during command execution to Console log."),
86
+ dict(opt="capture_stdout", type=Options.T_BOOL, default=True, required=False, multi=False, hide=True, choice=[True, False],
87
+ description_ja="GUIモードでのみ使用可能です。コマンド実行時の標準出力をキャプチャーし、実行結果画面に表示します。",
88
+ description_en="Available only in GUI mode. Captures standard output during command execution and displays it on the execution result screen."),
89
+ dict(opt="capture_maxsize", type=Options.T_INT, default=self.DEFAULT_CAPTURE_MAXSIZE, required=False, multi=False, hide=True, choice=None,
90
+ description_ja="GUIモードでのみ使用可能です。コマンド実行時の標準出力の最大キャプチャーサイズを指定します。",
91
+ description_en="Available only in GUI mode. Specifies the maximum capture size of standard output when executing commands."),
92
+ ])
93
+
94
+ async def apprun(self, logger:logging.Logger, args:argparse.Namespace, tm:float, pf:List[Dict[str, float]]=[]) -> Tuple[int, Dict[str, Any], Any]:
95
+ """
96
+ この機能の実行を行います
97
+
98
+ Args:
99
+ logger (logging.Logger): ロガー
100
+ args (argparse.Namespace): 引数
101
+ tm (float): 実行開始時間
102
+ pf (List[Dict[str, float]]): 呼出元のパフォーマンス情報
103
+
104
+ Returns:
105
+ Tuple[int, Dict[str, Any], Any]: 終了コード, 結果, オブジェクト
106
+ """
107
+ logger.info("apprun function has started.")
108
+ if not hasattr(args, 'mcpserver_name'):
109
+ args.mcpserver_name = 'mcpserver'
110
+ if not hasattr(args, 'mcpserver_url'):
111
+ args.mcpserver_url = 'http://localhost:8081/mcpsv/mcp'
112
+ if not hasattr(args, 'mcpserver_transport'):
113
+ args.mcpserver_transport = 'streamable-http'
114
+ if not hasattr(args, 'mcpserver_apikey'):
115
+ args.mcpserver_apikey = None
116
+
117
+ from fastmcp import Client
118
+ config = dict(
119
+ mcpServers=dict(
120
+ default=dict(
121
+ url=args.mcpserver_url,
122
+ transport=args.mcpserver_transport,
123
+ auth=args.mcpserver_apikey
124
+ )
125
+ )
126
+ )
127
+ try:
128
+ common.reset_logger('FastMCP.fastmcp.server.server')
129
+ client = Client(config)
130
+ if logger.level == logging.DEBUG:
131
+ logger.debug(f"Starting MCP client: {config}")
132
+ async with client:
133
+ if args.operation == 'list_tools':
134
+ result = await client.list_tools()
135
+ ret = dict(success=[r.__dict__ for r in result])
136
+ elif args.operation == 'call_tool':
137
+ if not args.tool_name:
138
+ raise ValueError("Tool name must be specified for 'call_tool' operation.")
139
+ if not args.tool_args:
140
+ args.tool_args = dict()
141
+ if not hasattr(args, 'mcp_timeout'):
142
+ args.mcp_timeout = 60
143
+ result = await client.call_tool(args.tool_name, arguments=args.tool_args, timeout=args.mcp_timeout)
144
+ ret = dict(success=result.__dict__)
145
+ elif args.operation == 'list_resources':
146
+ result = await client.list_resources()
147
+ ret = dict(success=[r.__dict__ for r in result])
148
+ elif args.operation == 'read_resource':
149
+ if not args.resource_url:
150
+ raise ValueError("Resource URL must be specified for 'read_resource' operation.")
151
+ result = await client.read_resource(args.resource_url)
152
+ ret = dict(success=result.__dict__)
153
+ elif args.operation == 'list_prompts':
154
+ result = await client.list_prompts()
155
+ ret = dict(success=[r.__dict__ for r in result])
156
+ elif args.operation == 'get_prompt':
157
+ if not args.prompt_name:
158
+ raise ValueError("Prompt name must be specified for 'get_prompt' operation.")
159
+ if not args.prompt_args:
160
+ args.prompt_args = dict()
161
+ result = await client.get_prompt(args.prompt_name, arguments=args.prompt_args)
162
+ ret = dict(success=result.__dict__)
163
+ else:
164
+ raise ValueError(f"Unknown operation: {args.operation}")
165
+ common.print_format(ret, args.format, tm, args.output_json, args.output_json_append, pf=pf)
166
+ return self.RESP_SCCESS, ret, None
167
+ except Exception as e:
168
+ logger.setLevel(logging.ERROR)
169
+ for h in logger.handlers:
170
+ h.setLevel(logging.ERROR)
171
+ logger.error(f"Failed to start MCP proxy: {e}", exc_info=True)
172
+ msg = dict(warn=f"Failed to start MCP proxy: {e}")
173
+ common.print_format(msg, args.format, tm, args.output_json, args.output_json_append, pf=pf)
174
+ return self.RESP_ERROR, msg, None
@@ -6,7 +6,7 @@ import argparse
6
6
  import logging
7
7
 
8
8
 
9
- class McpStart(feature.UnsupportEdgeFeature):
9
+ class McpProxy(feature.UnsupportEdgeFeature):
10
10
  def get_mode(self) -> Union[str, List[str]]:
11
11
  """
12
12
  この機能のモードを返します
@@ -35,7 +35,7 @@ class McpStart(feature.UnsupportEdgeFeature):
35
35
  return dict(
36
36
  use_redis=self.USE_REDIS_FALSE, nouse_webmode=False, use_agent=False,
37
37
  description_ja="標準入力を受け付け、リモートMCPサーバーにリクエストを行うProxyサーバーを起動します。",
38
- description_en="-",
38
+ description_en="Starts a Proxy server that accepts standard input and makes requests to a remote MCP server.",
39
39
  choice=[
40
40
  dict(opt="mcpserver_name", type=Options.T_STR, default='mcpserver', required=True, multi=False, hide=False, choice=None,
41
41
  description_ja="リモートMCPサーバーの名前を指定します。省略した場合は`mcpserver`となります。",
@@ -49,7 +49,7 @@ class ServerStart(feature.OneshotNotifyEdgeFeature):
49
49
  dict(opt="svname", type=Options.T_STR, default=self.default_svname, required=True, multi=False, hide=True, choice=None, web="readonly",
50
50
  description_ja="サーバーのサービス名を指定します。省略時は `server` を使用します。",
51
51
  description_en="Specify the service name of the inference server. If omitted, `server` is used."),
52
- dict(opt="data", type=Options.T_FILE, default=self.default_data, required=False, multi=False, hide=False, choice=None,
52
+ dict(opt="data", type=Options.T_DIR, default=self.default_data, required=False, multi=False, hide=False, choice=None,
53
53
  description_ja=f"省略した時は `$HONE/.{self.ver.__appid__}` を使用します。",
54
54
  description_en=f"When omitted, `$HONE/.{self.ver.__appid__}` is used."),
55
55
  dict(opt="retry_count", type=Options.T_INT, default=20, required=False, multi=False, hide=True, choice=None,
@@ -49,7 +49,7 @@ class WebApikeyAdd(feature.UnsupportEdgeFeature):
49
49
  dict(opt="svname", type=Options.T_STR, default=self.default_svname, required=True, multi=False, hide=True, choice=None, web="readonly",
50
50
  description_ja="サーバーのサービス名を指定します。省略時は `server` を使用します。",
51
51
  description_en="Specify the service name of the inference server. If omitted, `server` is used."),
52
- dict(opt="data", type=Options.T_FILE, default=self.default_data, required=False, multi=False, hide=False, choice=None,
52
+ dict(opt="data", type=Options.T_DIR, default=self.default_data, required=False, multi=False, hide=False, choice=None,
53
53
  description_ja=f"省略した時は `$HONE/.{self.ver.__appid__}` を使用します。",
54
54
  description_en=f"When omitted, `$HONE/.{self.ver.__appid__}` is used."),
55
55
  dict(opt="user_name", type=Options.T_STR, default=None, required=True, multi=False, hide=False, choice=None,
@@ -58,7 +58,7 @@ class WebApikeyAdd(feature.UnsupportEdgeFeature):
58
58
  dict(opt="apikey_name", type=Options.T_STR, default=None, required=True, multi=False, hide=False, choice=None,
59
59
  description_ja="このユーザーのApiKey名を指定します。",
60
60
  description_en="Specify the ApiKey name for this user."),
61
- dict(opt="signin_file", type=Options.T_FILE, default=f".{self.ver.__appid__}/user_list.yml", required=True, multi=False, hide=False, choice=None,
61
+ dict(opt="signin_file", type=Options.T_FILE, default=f".{self.ver.__appid__}/user_list.yml", required=True, multi=False, hide=False, choice=None, fileio="in",
62
62
  description_ja="サインイン可能なユーザーとパスワードを記載したファイルを指定します。省略した時は認証を要求しません。",
63
63
  description_en="Specify a file containing users and passwords with which they can signin. If omitted, no authentication is required."),
64
64
  dict(opt="stdout_log", type=Options.T_BOOL, default=True, required=False, multi=False, hide=True, choice=[True, False],
@@ -49,7 +49,7 @@ class WebApikeyDel(feature.UnsupportEdgeFeature):
49
49
  dict(opt="svname", type=Options.T_STR, default=self.default_svname, required=True, multi=False, hide=True, choice=None, web="readonly",
50
50
  description_ja="サーバーのサービス名を指定します。省略時は `server` を使用します。",
51
51
  description_en="Specify the service name of the inference server. If omitted, `server` is used."),
52
- dict(opt="data", type=Options.T_FILE, default=self.default_data, required=False, multi=False, hide=False, choice=None,
52
+ dict(opt="data", type=Options.T_DIR, default=self.default_data, required=False, multi=False, hide=False, choice=None,
53
53
  description_ja=f"省略した時は `$HONE/.{self.ver.__appid__}` を使用します。",
54
54
  description_en=f"When omitted, `$HONE/.{self.ver.__appid__}` is used."),
55
55
  dict(opt="user_name", type=Options.T_STR, default=None, required=True, multi=False, hide=False, choice=None,
@@ -58,7 +58,7 @@ class WebApikeyDel(feature.UnsupportEdgeFeature):
58
58
  dict(opt="apikey_name", type=Options.T_STR, default=None, required=True, multi=False, hide=False, choice=None,
59
59
  description_ja="このユーザーのApiKey名を指定します。",
60
60
  description_en="Specify the ApiKey name for this user."),
61
- dict(opt="signin_file", type=Options.T_FILE, default=f".{self.ver.__appid__}/user_list.yml", required=True, multi=False, hide=False, choice=None,
61
+ dict(opt="signin_file", type=Options.T_FILE, default=f".{self.ver.__appid__}/user_list.yml", required=True, multi=False, hide=False, choice=None, fileio="in",
62
62
  description_ja="サインイン可能なユーザーとパスワードを記載したファイルを指定します。省略した時は認証を要求しません。",
63
63
  description_en="Specify a file containing users and passwords with which they can signin. If omitted, no authentication is required."),
64
64
  dict(opt="stdout_log", type=Options.T_BOOL, default=True, required=False, multi=False, hide=True, choice=[True, False],
@@ -45,19 +45,19 @@ class WebGencert(feature.UnsupportEdgeFeature):
45
45
  dict(opt="webhost", type=Options.T_STR, default="localhost", required=True, multi=False, hide=False, choice=None,
46
46
  description_ja="自己署名証明書のCN(Common Name)に指定するホスト名を指定します。",
47
47
  description_en="Specify the host name to be specified as the CN (Common Name) of the self-signed certificate."),
48
- dict(opt="output_cert", type=Options.T_FILE, default=None, required=False, multi=False, hide=False, choice=None,
48
+ dict(opt="output_cert", type=Options.T_FILE, default=None, required=False, multi=False, hide=False, choice=None, fileio="out",
49
49
  description_ja="出力する自己署名証明書のファイルを指定します。省略した場合は `webhostオプションに指定したホスト名` .crt に出力されます。",
50
50
  description_en="Specify the self-signed certificate file to be output.If omitted, the hostname specified in the `webhost option` .crt will be output."),
51
51
  dict(opt="output_cert_format", type=Options.T_STR, default="PEM", required=False, multi=False, hide=False, choice=["DER", "PEM"],
52
52
  description_ja="出力する自己署名証明書のファイルフォーマットを指定します。",
53
53
  description_en="Specifies the file format of the self-signed certificate to be output."),
54
- dict(opt="output_pkey", type=Options.T_FILE, default=None, required=False, multi=False, hide=False, choice=None,
54
+ dict(opt="output_pkey", type=Options.T_FILE, default=None, required=False, multi=False, hide=False, choice=None, fileio="out",
55
55
  description_ja="出力する自己署名証明書の公開鍵のファイルを指定します。省略した場合は `webhostオプションに指定したホスト名` .pkey に出力されます。",
56
56
  description_en="Specifies the public key file of the self-signed certificate to output. If omitted, the output will be in the `hostname specified in the `webhost option` .pkey."),
57
57
  dict(opt="output_pkey_format", type=Options.T_STR, default="PEM", required=False, multi=False, hide=False, choice=["DER", "PEM"],
58
58
  description_ja="出力する自己署名証明書の公開鍵のファイルフォーマットを指定します。",
59
59
  description_en="Specifies the file format of the public key of the self-signed certificate to be output."),
60
- dict(opt="output_key", type=Options.T_FILE, default=None, required=False, multi=False, hide=False, choice=None,
60
+ dict(opt="output_key", type=Options.T_FILE, default=None, required=False, multi=False, hide=False, choice=None, fileio="out",
61
61
  description_ja="出力する自己署名証明書の秘密鍵ファイルを指定します。省略した場合は `webhostオプションに指定したホスト名` .key に出力されます。",
62
62
  description_en="Specifies the private key file of the self-signed certificate to be output.If omitted, the hostname specified in the `webhost option` .key will be output."),
63
63
  dict(opt="output_key_format", type=Options.T_STR, default="PEM", required=False, multi=False, hide=False, choice=["DER", "PEM"],
@@ -49,7 +49,7 @@ class WebGroupAdd(feature.UnsupportEdgeFeature):
49
49
  dict(opt="svname", type=Options.T_STR, default=self.default_svname, required=True, multi=False, hide=True, choice=None, web="readonly",
50
50
  description_ja="サーバーのサービス名を指定します。省略時は `server` を使用します。",
51
51
  description_en="Specify the service name of the inference server. If omitted, `server` is used."),
52
- dict(opt="data", type=Options.T_FILE, default=self.default_data, required=False, multi=False, hide=False, choice=None,
52
+ dict(opt="data", type=Options.T_DIR, default=self.default_data, required=False, multi=False, hide=False, choice=None,
53
53
  description_ja=f"省略した時は `$HONE/.{self.ver.__appid__}` を使用します。",
54
54
  description_en=f"When omitted, `$HONE/.{self.ver.__appid__}` is used."),
55
55
  dict(opt="group_id", type=Options.T_INT, default=None, required=True, multi=False, hide=False, choice=None,
@@ -61,7 +61,7 @@ class WebGroupAdd(feature.UnsupportEdgeFeature):
61
61
  dict(opt="group_parent", type=Options.T_STR, default=None, required=False, multi=False, hide=False, choice=None,
62
62
  description_ja="親グループ名を指定します。",
63
63
  description_en="Specifies the parent group name."),
64
- dict(opt="signin_file", type=Options.T_FILE, default=f".{self.ver.__appid__}/user_list.yml", required=True, multi=False, hide=False, choice=None,
64
+ dict(opt="signin_file", type=Options.T_FILE, default=f".{self.ver.__appid__}/user_list.yml", required=True, multi=False, hide=False, choice=None, fileio="in",
65
65
  description_ja="サインイン可能なユーザーとパスワードを記載したファイルを指定します。省略した時は認証を要求しません。",
66
66
  description_en="Specify a file containing users and passwords with which they can signin. If omitted, no authentication is required."),
67
67
  dict(opt="stdout_log", type=Options.T_BOOL, default=True, required=False, multi=False, hide=True, choice=[True, False],
@@ -49,13 +49,13 @@ class WebGroupDel(feature.UnsupportEdgeFeature):
49
49
  dict(opt="svname", type=Options.T_STR, default=self.default_svname, required=True, multi=False, hide=True, choice=None, web="readonly",
50
50
  description_ja="サーバーのサービス名を指定します。省略時は `server` を使用します。",
51
51
  description_en="Specify the service name of the inference server. If omitted, `server` is used."),
52
- dict(opt="data", type=Options.T_FILE, default=self.default_data, required=False, multi=False, hide=False, choice=None,
52
+ dict(opt="data", type=Options.T_DIR, default=self.default_data, required=False, multi=False, hide=False, choice=None,
53
53
  description_ja=f"省略した時は `$HONE/.{self.ver.__appid__}` を使用します。",
54
54
  description_en=f"When omitted, `$HONE/.{self.ver.__appid__}` is used."),
55
55
  dict(opt="group_id", type=Options.T_INT, default=None, required=True, multi=False, hide=False, choice=None,
56
56
  description_ja="グループIDを指定します。",
57
57
  description_en="Specify the group ID. Do not duplicate other groups."),
58
- dict(opt="signin_file", type=Options.T_FILE, default=f".{self.ver.__appid__}/user_list.yml", required=True, multi=False, hide=False, choice=None,
58
+ dict(opt="signin_file", type=Options.T_FILE, default=f".{self.ver.__appid__}/user_list.yml", required=True, multi=False, hide=False, choice=None, fileio="in",
59
59
  description_ja="サインイン可能なユーザーとパスワードを記載したファイルを指定します。省略した時は認証を要求しません。",
60
60
  description_en="Specify a file containing users and passwords with which they can signin. If omitted, no authentication is required."),
61
61
  dict(opt="stdout_log", type=Options.T_BOOL, default=True, required=False, multi=False, hide=True, choice=[True, False],
@@ -49,7 +49,7 @@ class WebGroupEdit(feature.UnsupportEdgeFeature):
49
49
  dict(opt="svname", type=Options.T_STR, default=self.default_svname, required=True, multi=False, hide=True, choice=None, web="readonly",
50
50
  description_ja="サーバーのサービス名を指定します。省略時は `server` を使用します。",
51
51
  description_en="Specify the service name of the inference server. If omitted, `server` is used."),
52
- dict(opt="data", type=Options.T_FILE, default=self.default_data, required=False, multi=False, hide=False, choice=None,
52
+ dict(opt="data", type=Options.T_DIR, default=self.default_data, required=False, multi=False, hide=False, choice=None,
53
53
  description_ja=f"省略した時は `$HONE/.{self.ver.__appid__}` を使用します。",
54
54
  description_en=f"When omitted, `$HONE/.{self.ver.__appid__}` is used."),
55
55
  dict(opt="group_id", type=Options.T_INT, default=None, required=True, multi=False, hide=False, choice=None,
@@ -61,7 +61,7 @@ class WebGroupEdit(feature.UnsupportEdgeFeature):
61
61
  dict(opt="group_parent", type=Options.T_STR, default=None, required=False, multi=False, hide=False, choice=None,
62
62
  description_ja="親グループ名を指定します。",
63
63
  description_en="Specifies the parent group name."),
64
- dict(opt="signin_file", type=Options.T_FILE, default=f".{self.ver.__appid__}/user_list.yml", required=True, multi=False, hide=False, choice=None,
64
+ dict(opt="signin_file", type=Options.T_FILE, default=f".{self.ver.__appid__}/user_list.yml", required=True, multi=False, hide=False, choice=None, fileio="in",
65
65
  description_ja="サインイン可能なユーザーとパスワードを記載したファイルを指定します。省略した時は認証を要求しません。",
66
66
  description_en="Specify a file containing users and passwords with which they can signin. If omitted, no authentication is required."),
67
67
  dict(opt="stdout_log", type=Options.T_BOOL, default=True, required=False, multi=False, hide=True, choice=[True, False],
@@ -49,13 +49,13 @@ class WebGroupList(feature.OneshotResultEdgeFeature):
49
49
  dict(opt="svname", type=Options.T_STR, default=self.default_svname, required=True, multi=False, hide=True, choice=None, web="readonly",
50
50
  description_ja="サーバーのサービス名を指定します。省略時は `server` を使用します。",
51
51
  description_en="Specify the service name of the inference server. If omitted, `server` is used."),
52
- dict(opt="data", type=Options.T_FILE, default=self.default_data, required=False, multi=False, hide=False, choice=None,
52
+ dict(opt="data", type=Options.T_DIR, default=self.default_data, required=False, multi=False, hide=False, choice=None,
53
53
  description_ja=f"省略した時は `$HONE/.{self.ver.__appid__}` を使用します。",
54
54
  description_en=f"When omitted, `$HONE/.{self.ver.__appid__}` is used."),
55
55
  dict(opt="group_name", type=Options.T_STR, default=None, required=False, multi=False, hide=False, choice=None,
56
56
  description_ja="グループ名を指定して取得します。省略した時は全てのグループを取得します。",
57
57
  description_en="Retrieved by specifying a group name. If omitted, all groups are retrieved."),
58
- dict(opt="signin_file", type=Options.T_FILE, default=f".{self.ver.__appid__}/user_list.yml", required=True, multi=False, hide=False, choice=None,
58
+ dict(opt="signin_file", type=Options.T_FILE, default=f".{self.ver.__appid__}/user_list.yml", required=True, multi=False, hide=False, choice=None, fileio="in",
59
59
  description_ja="サインイン可能なユーザーとパスワードを記載したファイルを指定します。省略した時は認証を要求しません。",
60
60
  description_en="Specify a file containing users and passwords with which they can signin. If omitted, no authentication is required."),
61
61
  dict(opt="stdout_log", type=Options.T_BOOL, default=True, required=False, multi=False, hide=True, choice=[True, False],
@@ -53,7 +53,7 @@ class WebStart(feature.UnsupportEdgeFeature, agent_base.AgentBase):
53
53
  dict(opt="svname", type=Options.T_STR, default=self.default_svname, required=True, multi=False, hide=True, choice=None, web="readonly",
54
54
  description_ja="サーバーのサービス名を指定します。省略時は `server` を使用します。",
55
55
  description_en="Specify the service name of the inference server. If omitted, `server` is used."),
56
- dict(opt="data", type=Options.T_FILE, default=self.default_data, required=False, multi=False, hide=False, choice=None,
56
+ dict(opt="data", type=Options.T_DIR, default=self.default_data, required=False, multi=False, hide=False, choice=None,
57
57
  description_ja=f"省略した時は `$HONE/.{self.ver.__appid__}` を使用します。",
58
58
  description_en=f"When omitted, `$HONE/.{self.ver.__appid__}` is used."),
59
59
  dict(opt="allow_host", type=Options.T_STR, default="0.0.0.0", required=False, multi=False, hide=False, choice=None,
@@ -65,19 +65,19 @@ class WebStart(feature.UnsupportEdgeFeature, agent_base.AgentBase):
65
65
  dict(opt="ssl_listen_port", type=Options.T_INT, default="8443", required=False, multi=False, hide=False, choice=None,
66
66
  description_ja="省略した時は `8443` を使用します。",
67
67
  description_en="If omitted, `8443` is used."),
68
- dict(opt="ssl_cert", type=Options.T_FILE, default=None, required=False, multi=False, hide=True, choice=None,
68
+ dict(opt="ssl_cert", type=Options.T_FILE, default=None, required=False, multi=False, hide=True, choice=None, fileio="in",
69
69
  description_ja="SSLサーバー証明書ファイルを指定します。",
70
70
  description_en="Specify the SSL server certificate file."),
71
- dict(opt="ssl_key", type=Options.T_FILE, default=None, required=False, multi=False, hide=True, choice=None,
71
+ dict(opt="ssl_key", type=Options.T_FILE, default=None, required=False, multi=False, hide=True, choice=None, fileio="in",
72
72
  description_ja="SSLサーバー秘密鍵ファイルを指定します。",
73
73
  description_en="Specify the SSL server private key file."),
74
74
  dict(opt="ssl_keypass", type=Options.T_STR, default=None, required=False, multi=False, hide=True, choice=None,
75
75
  description_ja="SSLサーバー秘密鍵ファイルの複合化パスワードを指定します。",
76
76
  description_en="Specify the composite password for the SSL server private key file."),
77
- dict(opt="ssl_ca_certs", type=Options.T_FILE, default=None, required=False, multi=False, hide=True, choice=None,
77
+ dict(opt="ssl_ca_certs", type=Options.T_FILE, default=None, required=False, multi=False, hide=True, choice=None, fileio="in",
78
78
  description_ja="SSLサーバーCA証明書ファイルを指定します。",
79
79
  description_en="Specify the SSL server CA certificate file."),
80
- dict(opt="signin_file", type=Options.T_FILE, default=None, required=False, multi=False, hide=True, choice=None,
80
+ dict(opt="signin_file", type=Options.T_FILE, default=None, required=False, multi=False, hide=True, choice=None, fileio="in",
81
81
  description_ja="サインイン可能なユーザーとパスワードを記載したファイルを指定します。省略した時は認証を要求しません。",
82
82
  description_en="Specify a file containing users and passwords with which they can signin. If omitted, no authentication is required."),
83
83
  dict(opt="session_domain", type=Options.T_STR, default=None, required=False, multi=False, hide=True, choice=None,
@@ -107,22 +107,22 @@ class WebStart(feature.UnsupportEdgeFeature, agent_base.AgentBase):
107
107
  dict(opt="doc_root", type=Options.T_DIR, default=None, required=False, multi=False, hide=False, choice=None,
108
108
  description_ja="カスタムファイルのドキュメントルート. フォルダ指定のカスタムファイルのパスから、doc_rootのパスを除去したパスでURLマッピングします。",
109
109
  description_en="Document root for custom files. URL mapping from the path of a folder-specified custom file with the path of doc_root removed."),
110
- dict(opt="gui_html", type=Options.T_FILE, default=None, required=False, multi=False, hide=False, choice=None,
110
+ dict(opt="gui_html", type=Options.T_FILE, default=None, required=False, multi=False, hide=False, choice=None, fileio="in",
111
111
  description_ja="`gui.html` を指定します。省略時はcmdbox内蔵のHTMLファイルを使用します。",
112
112
  description_en="Specify `gui.html`. If omitted, the cmdbox built-in HTML file is used."),
113
- dict(opt="filer_html", type=Options.T_FILE, default=None, required=False, multi=False, hide=False, choice=None,
113
+ dict(opt="filer_html", type=Options.T_FILE, default=None, required=False, multi=False, hide=False, choice=None, fileio="in",
114
114
  description_ja="`filer.html` を指定します。省略時はcmdbox内蔵のHTMLファイルを使用します。",
115
115
  description_en="Specify `filer.html`. If omitted, the cmdbox built-in HTML file is used."),
116
- dict(opt="result_html", type=Options.T_FILE, default=None, required=False, multi=False, hide=False, choice=None,
116
+ dict(opt="result_html", type=Options.T_FILE, default=None, required=False, multi=False, hide=False, choice=None, fileio="in",
117
117
  description_ja="`result.html` を指定します。省略時はcmdbox内蔵のHTMLファイルを使用します。",
118
118
  description_en="Specify `result.html`. If omitted, the cmdbox built-in HTML file is used."),
119
- dict(opt="users_html", type=Options.T_FILE, default=None, required=False, multi=False, hide=False, choice=None,
119
+ dict(opt="users_html", type=Options.T_FILE, default=None, required=False, multi=False, hide=False, choice=None, fileio="in",
120
120
  description_ja="`users.html` を指定します。省略時はcmdbox内蔵のHTMLファイルを使用します。",
121
121
  description_en="Specify `users.html`. If omitted, the cmdbox built-in HTML file is used."),
122
- dict(opt="assets", type=Options.T_FILE, default=None, required=False, multi=True, hide=False, choice=None,
122
+ dict(opt="assets", type=Options.T_FILE, default=None, required=False, multi=True, hide=False, choice=None, fileio="in",
123
123
  description_ja="htmlファイルを使用する場合に必要なアセットファイルを指定します。",
124
124
  description_en="Specify the asset file required when using html files."),
125
- dict(opt="signin_html", type=Options.T_FILE, default=None, required=False, multi=False, hide=False, choice=None,
125
+ dict(opt="signin_html", type=Options.T_FILE, default=None, required=False, multi=False, hide=False, choice=None, fileio="in",
126
126
  description_ja="`signin.html` を指定します。省略時はcmdbox内蔵のHTMLファイルを使用します。",
127
127
  description_en="Specify `signin.html`. If omitted, the cmdbox built-in HTML file is used."),
128
128
  dict(opt="stdout_log", type=Options.T_BOOL, default=True, required=False, multi=False, hide=True, choice=[True, False],
@@ -183,7 +183,7 @@ class WebStart(feature.UnsupportEdgeFeature, agent_base.AgentBase):
183
183
  Returns:
184
184
  web.Web: Webオブジェクト
185
185
  """
186
- w = web.Web(logger, Path(args.data), appcls=self.appcls, ver=self.ver,
186
+ w = web.Web.getInstance(logger, Path(args.data), appcls=self.appcls, ver=self.ver,
187
187
  redis_host=args.host, redis_port=args.port, redis_password=args.password, svname=args.svname,
188
188
  client_only=args.client_only, doc_root=args.doc_root, gui_html=args.gui_html, filer_html=args.filer_html,
189
189
  result_html=args.result_html, users_html=args.users_html,
@@ -37,7 +37,7 @@ class WebStop(feature.UnsupportEdgeFeature):
37
37
  description_ja="Webモードを停止します。",
38
38
  description_en="Stop Web mode.",
39
39
  choice=[
40
- dict(opt="data", type=Options.T_FILE, default=self.default_data, required=False, multi=False, hide=False, choice=None,
40
+ dict(opt="data", type=Options.T_DIR, default=self.default_data, required=False, multi=False, hide=False, choice=None,
41
41
  description_ja=f"省略した時は `$HONE/.{self.ver.__appid__}` を使用します。",
42
42
  description_en=f"When omitted, `$HONE/.{self.ver.__appid__}` is used."),
43
43
  dict(opt="stdout_log", type=Options.T_BOOL, default=True, required=False, multi=False, hide=True, choice=[True, False],
@@ -49,7 +49,7 @@ class WebUserAdd(feature.UnsupportEdgeFeature):
49
49
  dict(opt="svname", type=Options.T_STR, default=self.default_svname, required=True, multi=False, hide=True, choice=None, web="readonly",
50
50
  description_ja="サーバーのサービス名を指定します。省略時は `server` を使用します。",
51
51
  description_en="Specify the service name of the inference server. If omitted, `server` is used."),
52
- dict(opt="data", type=Options.T_FILE, default=self.default_data, required=False, multi=False, hide=False, choice=None,
52
+ dict(opt="data", type=Options.T_DIR, default=self.default_data, required=False, multi=False, hide=False, choice=None,
53
53
  description_ja=f"省略した時は `$HONE/.{self.ver.__appid__}` を使用します。",
54
54
  description_en=f"When omitted, `$HONE/.{self.ver.__appid__}` is used."),
55
55
  dict(opt="user_id", type=Options.T_INT, default=None, required=True, multi=False, hide=False, choice=None,
@@ -70,7 +70,7 @@ class WebUserAdd(feature.UnsupportEdgeFeature):
70
70
  dict(opt="user_group", type=Options.T_STR, default=None, required=True, multi=True, hide=False, choice=None,
71
71
  description_ja="ユーザーが所属するグループを指定します。",
72
72
  description_en="Specifies the groups to which the user belongs."),
73
- dict(opt="signin_file", type=Options.T_FILE, default=f".{self.ver.__appid__}/user_list.yml", required=True, multi=False, hide=False, choice=None,
73
+ dict(opt="signin_file", type=Options.T_FILE, default=f".{self.ver.__appid__}/user_list.yml", required=True, multi=False, hide=False, choice=None, fileio="in",
74
74
  description_ja="サインイン可能なユーザーとパスワードを記載したファイルを指定します。省略した時は認証を要求しません。",
75
75
  description_en="Specify a file containing users and passwords with which they can signin. If omitted, no authentication is required."),
76
76
  dict(opt="stdout_log", type=Options.T_BOOL, default=True, required=False, multi=False, hide=True, choice=[True, False],
@@ -49,13 +49,13 @@ class WebUserDel(feature.UnsupportEdgeFeature):
49
49
  dict(opt="svname", type=Options.T_STR, default=self.default_svname, required=True, multi=False, hide=True, choice=None, web="readonly",
50
50
  description_ja="サーバーのサービス名を指定します。省略時は `server` を使用します。",
51
51
  description_en="Specify the service name of the inference server. If omitted, `server` is used."),
52
- dict(opt="data", type=Options.T_FILE, default=self.default_data, required=False, multi=False, hide=False, choice=None,
52
+ dict(opt="data", type=Options.T_DIR, default=self.default_data, required=False, multi=False, hide=False, choice=None,
53
53
  description_ja=f"省略した時は `$HONE/.{self.ver.__appid__}` を使用します。",
54
54
  description_en=f"When omitted, `$HONE/.{self.ver.__appid__}` is used."),
55
55
  dict(opt="user_id", type=Options.T_INT, default=None, required=True, multi=False, hide=False, choice=None,
56
56
  description_ja="ユーザーIDを指定します。",
57
57
  description_en="Specify the user ID."),
58
- dict(opt="signin_file", type=Options.T_FILE, default=f".{self.ver.__appid__}/user_list.yml", required=True, multi=False, hide=False, choice=None,
58
+ dict(opt="signin_file", type=Options.T_FILE, default=f".{self.ver.__appid__}/user_list.yml", required=True, multi=False, hide=False, choice=None, fileio="in",
59
59
  description_ja="サインイン可能なユーザーとパスワードを記載したファイルを指定します。省略した時は認証を要求しません。",
60
60
  description_en="Specify a file containing users and passwords with which they can signin. If omitted, no authentication is required."),
61
61
  dict(opt="stdout_log", type=Options.T_BOOL, default=True, required=False, multi=False, hide=True, choice=[True, False],
@@ -49,7 +49,7 @@ class WebUserEdit(feature.UnsupportEdgeFeature):
49
49
  dict(opt="svname", type=Options.T_STR, default=self.default_svname, required=True, multi=False, hide=True, choice=None, web="readonly",
50
50
  description_ja="サーバーのサービス名を指定します。省略時は `server` を使用します。",
51
51
  description_en="Specify the service name of the inference server. If omitted, `server` is used."),
52
- dict(opt="data", type=Options.T_FILE, default=self.default_data, required=False, multi=False, hide=False, choice=None,
52
+ dict(opt="data", type=Options.T_DIR, default=self.default_data, required=False, multi=False, hide=False, choice=None,
53
53
  description_ja=f"省略した時は `$HONE/.{self.ver.__appid__}` を使用します。",
54
54
  description_en=f"When omitted, `$HONE/.{self.ver.__appid__}` is used."),
55
55
  dict(opt="user_id", type=Options.T_INT, default=None, required=True, multi=False, hide=False, choice=None,
@@ -70,7 +70,7 @@ class WebUserEdit(feature.UnsupportEdgeFeature):
70
70
  dict(opt="user_group", type=Options.T_STR, default=None, required=True, multi=True, hide=False, choice=None,
71
71
  description_ja="ユーザーが所属するグループを指定します。",
72
72
  description_en="Specifies the groups to which the user belongs."),
73
- dict(opt="signin_file", type=Options.T_FILE, default=f".{self.ver.__appid__}/user_list.yml", required=True, multi=False, hide=False, choice=None,
73
+ dict(opt="signin_file", type=Options.T_FILE, default=f".{self.ver.__appid__}/user_list.yml", required=True, multi=False, hide=False, choice=None, fileio="in",
74
74
  description_ja="サインイン可能なユーザーとパスワードを記載したファイルを指定します。省略した時は認証を要求しません。",
75
75
  description_en="Specify a file containing users and passwords with which they can signin. If omitted, no authentication is required."),
76
76
  dict(opt="stdout_log", type=Options.T_BOOL, default=True, required=False, multi=False, hide=True, choice=[True, False],
@@ -49,13 +49,13 @@ class WebUserList(feature.OneshotResultEdgeFeature):
49
49
  dict(opt="svname", type=Options.T_STR, default=self.default_svname, required=True, multi=False, hide=True, choice=None, web="readonly",
50
50
  description_ja="サーバーのサービス名を指定します。省略時は `server` を使用します。",
51
51
  description_en="Specify the service name of the inference server. If omitted, `server` is used."),
52
- dict(opt="data", type=Options.T_FILE, default=self.default_data, required=False, multi=False, hide=False, choice=None,
52
+ dict(opt="data", type=Options.T_DIR, default=self.default_data, required=False, multi=False, hide=False, choice=None,
53
53
  description_ja=f"省略した時は `$HONE/.{self.ver.__appid__}` を使用します。",
54
54
  description_en=f"When omitted, `$HONE/.{self.ver.__appid__}` is used."),
55
55
  dict(opt="user_name", type=Options.T_STR, default=None, required=False, multi=False, hide=False, choice=None,
56
56
  description_ja="ユーザー名を指定して取得します。省略した時は全てのユーザーを取得します。",
57
57
  description_en="Retrieved by specifying a user name. If omitted, all users are retrieved."),
58
- dict(opt="signin_file", type=Options.T_FILE, default=f".{self.ver.__appid__}/user_list.yml", required=True, multi=False, hide=False, choice=None,
58
+ dict(opt="signin_file", type=Options.T_FILE, default=f".{self.ver.__appid__}/user_list.yml", required=True, multi=False, hide=False, choice=None, fileio="in",
59
59
  description_ja="サインイン可能なユーザーとパスワードを記載したファイルを指定します。省略した時は認証を要求しません。",
60
60
  description_en="Specify a file containing users and passwords with which they can signin. If omitted, no authentication is required."),
61
61
  dict(opt="stdout_log", type=Options.T_BOOL, default=True, required=False, multi=False, hide=True, choice=[True, False],