Skip to content

Commit 414719d

Browse files
committed
fix: Use "enabled" and uuid for prompts and resources per recent changes
Branch: PyPIPush Signed-off-by: Gabe Goodhart <ghart@us.ibm.com>
1 parent 5adfb92 commit 414719d

4 files changed

Lines changed: 79 additions & 80 deletions

File tree

cforge/commands/resources/prompts.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def prompts_list(
6161

6262

6363
def prompts_get(
64-
prompt_id: int = typer.Argument(..., help="Prompt ID"),
64+
prompt_id: str = typer.Argument(..., help="Prompt ID"),
6565
) -> None:
6666
"""Get details of a specific prompt."""
6767
try:
@@ -114,7 +114,7 @@ def prompts_create(
114114

115115

116116
def prompts_update(
117-
prompt_id: int = typer.Argument(..., help="Prompt ID"),
117+
prompt_id: str = typer.Argument(..., help="Prompt ID"),
118118
data_file: Optional[Path] = typer.Argument(None, help="JSON file containing updated prompt data (interactive mode if not provided)"),
119119
) -> None:
120120
"""Update an existing prompt."""
@@ -139,7 +139,7 @@ def prompts_update(
139139

140140

141141
def prompts_delete(
142-
prompt_id: int = typer.Argument(..., help="Prompt ID"),
142+
prompt_id: str = typer.Argument(..., help="Prompt ID"),
143143
confirm: bool = typer.Option(False, "--yes", "-y", help="Skip confirmation"),
144144
) -> None:
145145
"""Delete a prompt."""
@@ -160,7 +160,7 @@ def prompts_delete(
160160

161161

162162
def prompts_toggle(
163-
prompt_id: int = typer.Argument(..., help="Prompt ID"),
163+
prompt_id: str = typer.Argument(..., help="Prompt ID"),
164164
) -> None:
165165
"""Toggle prompt active status."""
166166
console = get_console()
@@ -174,7 +174,7 @@ def prompts_toggle(
174174
raise typer.Exit(1)
175175
assert len(this_status) == 1, "Multiple prompts with same ID found"
176176
assert isinstance(this_status[0], dict)
177-
activate = not this_status[0].get("isActive")
177+
activate = not this_status[0].get("enabled")
178178
result = make_authenticated_request("POST", f"/prompts/{prompt_id}/toggle", params={"activate": activate})
179179
console.print("[green]✓ Prompt toggled successfully![/green]")
180180
print_json(result, "Prompt Status")
@@ -184,7 +184,7 @@ def prompts_toggle(
184184

185185

186186
def prompts_execute(
187-
prompt_id: int = typer.Argument(..., help="Prompt ID"),
187+
prompt_id: str = typer.Argument(..., help="Prompt ID"),
188188
data_file: Optional[Path] = typer.Option(None, "--data", help="JSON file containing prompt arguments"),
189189
) -> None:
190190
"""Execute a prompt with optional arguments."""

cforge/commands/resources/resources.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ def resources_list(
5050
print_table(
5151
resources,
5252
"Resources",
53-
["id", "name", "uri", "description", "size", "isActive"],
54-
{"isActive": "enabled"},
53+
["id", "name", "uri", "description", "size", "enabled"],
5554
)
5655
else:
5756
console.print("[yellow]No resources found[/yellow]")
@@ -61,7 +60,7 @@ def resources_list(
6160

6261

6362
def resources_get(
64-
resource_id: int = typer.Argument(..., help="Resource ID"),
63+
resource_id: str = typer.Argument(..., help="Resource ID"),
6564
) -> None:
6665
"""Get details of a specific resource."""
6766
try:
@@ -117,7 +116,7 @@ def resources_create(
117116

118117

119118
def resources_update(
120-
resource_id: int = typer.Argument(..., help="Resource ID"),
119+
resource_id: str = typer.Argument(..., help="Resource ID"),
121120
data_file: Optional[Path] = typer.Argument(None, help="JSON file containing updated resource data"),
122121
) -> None:
123122
"""Update an existing resource."""
@@ -142,7 +141,7 @@ def resources_update(
142141

143142

144143
def resources_delete(
145-
resource_id: int = typer.Argument(..., help="Resource ID"),
144+
resource_id: str = typer.Argument(..., help="Resource ID"),
146145
confirm: bool = typer.Option(False, "--yes", "-y", help="Skip confirmation"),
147146
) -> None:
148147
"""Delete a resource."""
@@ -163,7 +162,7 @@ def resources_delete(
163162

164163

165164
def resources_toggle(
166-
resource_id: int = typer.Argument(..., help="Resource ID"),
165+
resource_id: str = typer.Argument(..., help="Resource ID"),
167166
) -> None:
168167
"""Toggle resource active status."""
169168
console = get_console()
@@ -177,7 +176,7 @@ def resources_toggle(
177176
raise typer.Exit(1)
178177
assert len(this_status) == 1, "Multiple resources with same ID found"
179178
assert isinstance(this_status[0], dict)
180-
activate = not this_status[0].get("isActive")
179+
activate = not this_status[0].get("enabled")
181180
result = make_authenticated_request("POST", f"/resources/{resource_id}/toggle", params={"activate": activate})
182181
console.print("[green]✓ Resource toggled successfully![/green]")
183182
print_json(result, "Resource Status")

0 commit comments

Comments
 (0)