ivcap-lambda 0.8.2__tar.gz → 0.8.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ivcap_lambda-0.8.2 → ivcap_lambda-0.8.3}/PKG-INFO +1 -1
- {ivcap_lambda-0.8.2 → ivcap_lambda-0.8.3}/ivcap_lambda/builder.py +1 -1
- {ivcap_lambda-0.8.2 → ivcap_lambda-0.8.3}/ivcap_lambda/server.py +24 -1
- {ivcap_lambda-0.8.2 → ivcap_lambda-0.8.3}/ivcap_lambda/service_definition.py +10 -1
- {ivcap_lambda-0.8.2 → ivcap_lambda-0.8.3}/pyproject.toml +1 -1
- {ivcap_lambda-0.8.2 → ivcap_lambda-0.8.3}/AUTHORS.md +0 -0
- {ivcap_lambda-0.8.2 → ivcap_lambda-0.8.3}/LICENSE +0 -0
- {ivcap_lambda-0.8.2 → ivcap_lambda-0.8.3}/README.md +0 -0
- {ivcap_lambda-0.8.2 → ivcap_lambda-0.8.3}/ivcap_lambda/__init__.py +0 -0
- {ivcap_lambda-0.8.2 → ivcap_lambda-0.8.3}/ivcap_lambda/decorators.py +0 -0
- {ivcap_lambda-0.8.2 → ivcap_lambda-0.8.3}/ivcap_lambda/executor.py +0 -0
- {ivcap_lambda-0.8.2 → ivcap_lambda-0.8.3}/ivcap_lambda/health_handler.py +0 -0
- {ivcap_lambda-0.8.2 → ivcap_lambda-0.8.3}/ivcap_lambda/logger.py +0 -0
- {ivcap_lambda-0.8.2 → ivcap_lambda-0.8.3}/ivcap_lambda/logging.json +0 -0
- {ivcap_lambda-0.8.2 → ivcap_lambda-0.8.3}/ivcap_lambda/mcp.py +0 -0
- {ivcap_lambda-0.8.2 → ivcap_lambda-0.8.3}/ivcap_lambda/py.typed +0 -0
- {ivcap_lambda-0.8.2 → ivcap_lambda-0.8.3}/ivcap_lambda/secret.py +0 -0
- {ivcap_lambda-0.8.2 → ivcap_lambda-0.8.3}/ivcap_lambda/utils.py +0 -0
- {ivcap_lambda-0.8.2 → ivcap_lambda-0.8.3}/ivcap_lambda/version.py +0 -0
|
@@ -286,7 +286,7 @@ def _return_job_result(el, job_id):
|
|
|
286
286
|
headers=h,
|
|
287
287
|
)
|
|
288
288
|
elif isinstance(el, ExecutionError):
|
|
289
|
-
if el.type
|
|
289
|
+
if el.type == ValueError.__name__:
|
|
290
290
|
m = ErrorModel(message=el.error, code=400)
|
|
291
291
|
status_code = status.HTTP_400_BAD_REQUEST
|
|
292
292
|
else:
|
|
@@ -107,6 +107,11 @@ def start_lambda_server(
|
|
|
107
107
|
"e.g. Claude Desktop, Cline). Requires the 'mcp' extra."
|
|
108
108
|
),
|
|
109
109
|
)
|
|
110
|
+
parser.add_argument(
|
|
111
|
+
"--list-services",
|
|
112
|
+
action="store_true",
|
|
113
|
+
help="List the names of all registered services/tools and exit",
|
|
114
|
+
)
|
|
110
115
|
parser.add_argument(
|
|
111
116
|
"--print-service-description",
|
|
112
117
|
type=str,
|
|
@@ -116,6 +121,15 @@ def start_lambda_server(
|
|
|
116
121
|
default=None,
|
|
117
122
|
help=f"Print service description to stdout [{','.join(tool_names)}]",
|
|
118
123
|
)
|
|
124
|
+
parser.add_argument(
|
|
125
|
+
"--service-name",
|
|
126
|
+
type=str,
|
|
127
|
+
default=None,
|
|
128
|
+
help=(
|
|
129
|
+
"Override the service name used in --print-service-description "
|
|
130
|
+
"(defaults to the tool name, with '_' replaced by '-')"
|
|
131
|
+
),
|
|
132
|
+
)
|
|
119
133
|
parser.add_argument(
|
|
120
134
|
"--print-tool-description",
|
|
121
135
|
type=str,
|
|
@@ -134,6 +148,11 @@ def start_lambda_server(
|
|
|
134
148
|
if args.with_mcp_stdio and args.with_mcp:
|
|
135
149
|
parser.error("--with-mcp-stdio and --with-mcp are mutually exclusive")
|
|
136
150
|
|
|
151
|
+
if args.list_services:
|
|
152
|
+
for name in tool_names:
|
|
153
|
+
print(name)
|
|
154
|
+
sys.exit(0)
|
|
155
|
+
|
|
137
156
|
if args.print_tool_description:
|
|
138
157
|
tool = next((t for t in tools if t.name == args.print_tool_description), None)
|
|
139
158
|
if tool is None:
|
|
@@ -157,7 +176,11 @@ def start_lambda_server(
|
|
|
157
176
|
file=sys.stderr,
|
|
158
177
|
)
|
|
159
178
|
sys.exit(1)
|
|
160
|
-
|
|
179
|
+
tool_slug = tool.name.replace("_", "-")
|
|
180
|
+
name = args.service_name or f"{service.name}-{tool_slug}"
|
|
181
|
+
print_rest_service_definition(
|
|
182
|
+
service, tool.worker_fn, name=name, path=tool.path_prefix
|
|
183
|
+
)
|
|
161
184
|
sys.exit(0)
|
|
162
185
|
|
|
163
186
|
logger.info(
|
|
@@ -22,6 +22,7 @@ REST_CONTROLLER_SCHEMA = "urn:ivcap:schema.service.rest.1"
|
|
|
22
22
|
|
|
23
23
|
class RestController(BaseModel):
|
|
24
24
|
jschema: str = Field(default=REST_CONTROLLER_SCHEMA, alias="$schema")
|
|
25
|
+
path: str | None = Field(default=None, description="internal path of this tool's endpoint")
|
|
25
26
|
image: str
|
|
26
27
|
command: list[str] | str
|
|
27
28
|
resources: Resources = Field(default_factory=Resources)
|
|
@@ -30,11 +31,15 @@ def print_rest_service_definition(
|
|
|
30
31
|
service_description: Service,
|
|
31
32
|
fn: Callable[..., Any],
|
|
32
33
|
service_id: str | None = None,
|
|
34
|
+
name: str | None = None,
|
|
35
|
+
path: str | None = None,
|
|
33
36
|
):
|
|
34
37
|
sd = create_rest_service_definition(
|
|
35
38
|
service_description,
|
|
36
39
|
fn,
|
|
37
40
|
service_id=service_id,
|
|
41
|
+
name=name,
|
|
42
|
+
path=path,
|
|
38
43
|
)
|
|
39
44
|
print(sd.model_dump_json(indent=2, by_alias=True, exclude_none=True))
|
|
40
45
|
|
|
@@ -42,11 +47,15 @@ def create_rest_service_definition(
|
|
|
42
47
|
service_description: Service,
|
|
43
48
|
fn: Callable[..., Any],
|
|
44
49
|
service_id: str | None = None,
|
|
50
|
+
name: str | None = None,
|
|
51
|
+
path: str | None = None,
|
|
45
52
|
) -> ServiceDefinition:
|
|
46
53
|
# controller
|
|
47
54
|
image = os.getenv("DOCKER_IMG", IMAGE_PLACEHOLDER)
|
|
48
55
|
|
|
49
56
|
command = find_command()
|
|
50
57
|
resources = find_resources_file()
|
|
51
|
-
controller = RestController(image=image, command=command, resources=resources)
|
|
58
|
+
controller = RestController(path=path, image=image, command=command, resources=resources)
|
|
59
|
+
if name is not None:
|
|
60
|
+
service_description = service_description.model_copy(update={"name": name})
|
|
52
61
|
return create_service_definition(service_description, fn, REST_CONTROLLER_SCHEMA, controller, service_id)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|