blocks-cli 0.1.42__tar.gz → 0.1.43__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.
- {blocks_cli-0.1.42 → blocks_cli-0.1.43}/PKG-INFO +3 -3
- {blocks_cli-0.1.42 → blocks_cli-0.1.43}/README.md +2 -2
- {blocks_cli-0.1.42 → blocks_cli-0.1.43}/blocks_cli/commands/configure.py +2 -2
- {blocks_cli-0.1.42 → blocks_cli-0.1.43}/blocks_cli/commands/create.py +1 -1
- {blocks_cli-0.1.42 → blocks_cli-0.1.43}/blocks_cli/commands/init.py +1 -1
- {blocks_cli-0.1.42 → blocks_cli-0.1.43}/blocks_cli/commands/push.py +28 -2
- {blocks_cli-0.1.42 → blocks_cli-0.1.43}/blocks_cli/commands/test.py +1 -1
- {blocks_cli-0.1.42 → blocks_cli-0.1.43}/blocks_cli/config/auth.py +1 -1
- {blocks_cli-0.1.42 → blocks_cli-0.1.43}/blocks_cli/config/config.py +2 -2
- {blocks_cli-0.1.42 → blocks_cli-0.1.43}/setup.py +1 -1
- {blocks_cli-0.1.42 → blocks_cli-0.1.43}/LICENSE +0 -0
- {blocks_cli-0.1.42 → blocks_cli-0.1.43}/MANIFEST.in +0 -0
- {blocks_cli-0.1.42 → blocks_cli-0.1.43}/blocks_cli/__init__.py +0 -0
- {blocks_cli-0.1.42 → blocks_cli-0.1.43}/blocks_cli/api.py +0 -0
- {blocks_cli-0.1.42 → blocks_cli-0.1.43}/blocks_cli/builds.py +0 -0
- {blocks_cli-0.1.42 → blocks_cli-0.1.43}/blocks_cli/bundles.py +0 -0
- {blocks_cli-0.1.42 → blocks_cli-0.1.43}/blocks_cli/commands/__base__.py +0 -0
- {blocks_cli-0.1.42 → blocks_cli-0.1.43}/blocks_cli/commands/__init__.py +0 -0
- {blocks_cli-0.1.42 → blocks_cli-0.1.43}/blocks_cli/config/__init__.py +0 -0
- {blocks_cli-0.1.42 → blocks_cli-0.1.43}/blocks_cli/console.py +0 -0
- {blocks_cli-0.1.42 → blocks_cli-0.1.43}/blocks_cli/fs.py +0 -0
- {blocks_cli-0.1.42 → blocks_cli-0.1.43}/blocks_cli/package.py +0 -0
- {blocks_cli-0.1.42 → blocks_cli-0.1.43}/blocks_cli/registration.py +0 -0
- {blocks_cli-0.1.42 → blocks_cli-0.1.43}/blocks_cli.egg-info/SOURCES.txt +0 -0
- {blocks_cli-0.1.42 → blocks_cli-0.1.43}/requirements.txt +0 -0
- {blocks_cli-0.1.42 → blocks_cli-0.1.43}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: blocks_cli
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.43
|
|
4
4
|
Summary: CLI tool for Blocks, a platform for writing custom AI-enabled codebase automations in Python. Leverage a full codebase-aware API. Automatically trigger automations from Github, Slack, and other providers.
|
|
5
5
|
Home-page: https://github.com/BlocksOrg/sdk
|
|
6
6
|
Author: BlocksOrg
|
|
@@ -116,8 +116,8 @@ blocks push .blocks/my_automation/main.py
|
|
|
116
116
|
## Troubleshooting
|
|
117
117
|
|
|
118
118
|
- Already initialized: If `.blocks` exists, `blocks init` will report it. Use `blocks configure --key <api-key>` to update your key.
|
|
119
|
-
- Invalid API key: Ensure your key is correct. You can manage keys at https://
|
|
120
|
-
- Missing event: The `@on("...")` decorator must specify a supported event. See events at https://docs.
|
|
119
|
+
- Invalid API key: Ensure your key is correct. You can manage keys at https://blocks.team
|
|
120
|
+
- Missing event: The `@on("...")` decorator must specify a supported event. See events at https://docs.blocks.team/docs/events
|
|
121
121
|
- Multiple automations in a file: Use `--name <automation>` with `blocks test` to choose one.
|
|
122
122
|
|
|
123
123
|
## Upgrading
|
|
@@ -86,8 +86,8 @@ blocks push .blocks/my_automation/main.py
|
|
|
86
86
|
## Troubleshooting
|
|
87
87
|
|
|
88
88
|
- Already initialized: If `.blocks` exists, `blocks init` will report it. Use `blocks configure --key <api-key>` to update your key.
|
|
89
|
-
- Invalid API key: Ensure your key is correct. You can manage keys at https://
|
|
90
|
-
- Missing event: The `@on("...")` decorator must specify a supported event. See events at https://docs.
|
|
89
|
+
- Invalid API key: Ensure your key is correct. You can manage keys at https://blocks.team
|
|
90
|
+
- Missing event: The `@on("...")` decorator must specify a supported event. See events at https://docs.blocks.team/docs/events
|
|
91
91
|
- Multiple automations in a file: Use `--name <automation>` with `blocks test` to choose one.
|
|
92
92
|
|
|
93
93
|
## Upgrading
|
|
@@ -53,13 +53,13 @@ def configure(apikey: str = typer.Option(None, "--key", help="Blocks API key")):
|
|
|
53
53
|
})
|
|
54
54
|
|
|
55
55
|
if response.status_code > 299:
|
|
56
|
-
raise Exception("API Key is invalid. Please check your API key at [white]https://
|
|
56
|
+
raise Exception("API Key is invalid. Please check your API key at [white]https://blocks.team[/white]")
|
|
57
57
|
|
|
58
58
|
config.auth.save_api_key(new_api_key)
|
|
59
59
|
last_digits = new_api_key[-8:]
|
|
60
60
|
init_progress.update(api_task, description=f"[green]API key verified and saved successfully [italic][dim]...{last_digits}[/dim][/italic][/green]")
|
|
61
61
|
except Exception as e:
|
|
62
|
-
raise InvalidApiKeyError(f"Failed to verify API key. Please check your API key at [white]https://
|
|
62
|
+
raise InvalidApiKeyError(f"Failed to verify API key. Please check your API key at [white]https://blocks.team[/white]")
|
|
63
63
|
|
|
64
64
|
except InvalidApiKeyError as e:
|
|
65
65
|
console.print(f"[red]{e}[/red]")
|
|
@@ -104,7 +104,7 @@ slack-sdk>=3.19.2
|
|
|
104
104
|
|
|
105
105
|
console.print(f"Successfully created automation [green]{name}[/green] in [green]{automation_dir.absolute()}[/green]")
|
|
106
106
|
console.print(f"[green]{name}/\n main.py\n requirements.txt[/green]")
|
|
107
|
-
console.print(f"[blue]Choose an event from [white]https://docs.
|
|
107
|
+
console.print(f"[blue]Choose an event from [white]https://docs.blocks.team/events[/white] and run [white]blocks test .blocks/{name}/main.py[/white] to test the automation[/blue]")
|
|
108
108
|
|
|
109
109
|
except Exception as e:
|
|
110
110
|
# Clean up if something goes wrong after directory creation
|
|
@@ -62,7 +62,7 @@ def init(apikey: str = typer.Option(None, "--key", help="API key for authenticat
|
|
|
62
62
|
})
|
|
63
63
|
|
|
64
64
|
if response.status_code > 299:
|
|
65
|
-
raise Exception("API Key is invalid. Please check your API key at [white]https://
|
|
65
|
+
raise Exception("API Key is invalid. Please check your API key at [white]https://blocks.team[/white]")
|
|
66
66
|
|
|
67
67
|
config.auth.save_api_key(apikey)
|
|
68
68
|
last_digits = apikey[-8:]
|
|
@@ -74,7 +74,7 @@ def push(
|
|
|
74
74
|
|
|
75
75
|
for trigger_alias in trigger_aliases:
|
|
76
76
|
if trigger_alias is None or trigger_alias == "":
|
|
77
|
-
raise Exception(f"Event [white]'{trigger_alias}'[/white] is not a valid. For a list of supported events, please visit [white]https://docs.
|
|
77
|
+
raise Exception(f"Event [white]'{trigger_alias}'[/white] is not a valid. For a list of supported events, please visit [white]https://docs.blocks.team/docs/events[/white]")
|
|
78
78
|
|
|
79
79
|
# working directory from where the command was invoked
|
|
80
80
|
cwd = file.resolve().parent
|
|
@@ -274,6 +274,32 @@ def push(
|
|
|
274
274
|
registration_task, total=1, description="Automation registered successfully"
|
|
275
275
|
)
|
|
276
276
|
|
|
277
|
+
registered = res.json().get("automations") or []
|
|
278
|
+
if registered:
|
|
279
|
+
console.print()
|
|
280
|
+
for entry in registered:
|
|
281
|
+
automation_id = entry.get("id")
|
|
282
|
+
installation_id = entry.get("installation_id")
|
|
283
|
+
agent_id = entry.get("agent_id")
|
|
284
|
+
prev_rev = entry.get("prev_revision_id")
|
|
285
|
+
new_rev = entry.get("new_revision_id")
|
|
286
|
+
|
|
287
|
+
console.print(
|
|
288
|
+
f"[green]Registered[/green] automation [white]{automation_id}[/white]"
|
|
289
|
+
)
|
|
290
|
+
console.print(
|
|
291
|
+
f" [dim]installation[/dim] [white]{installation_id}[/white]"
|
|
292
|
+
)
|
|
293
|
+
if agent_id:
|
|
294
|
+
console.print(
|
|
295
|
+
f" [dim]agent[/dim] [white]{agent_id}[/white]"
|
|
296
|
+
)
|
|
297
|
+
prev_display = prev_rev if prev_rev else "—"
|
|
298
|
+
console.print(
|
|
299
|
+
f" [dim]revision[/dim] [dim]{prev_display}[/dim] [dim]→[/dim] [white]{new_rev}[/white]"
|
|
300
|
+
)
|
|
301
|
+
console.print()
|
|
302
|
+
|
|
277
303
|
# Verify build status
|
|
278
304
|
with Progress(
|
|
279
305
|
SpinnerColumn(),
|
|
@@ -299,7 +325,7 @@ def push(
|
|
|
299
325
|
build_task, total=1, description="Build failed"
|
|
300
326
|
)
|
|
301
327
|
console.print(f"[red]Error: {error_message}[/red]")
|
|
302
|
-
console.print("[yellow]Please check your automation's requirements.txt to ensure all dependencies are valid and/or our status page at https://status.
|
|
328
|
+
console.print("[yellow]Please check your automation's requirements.txt to ensure all dependencies are valid and/or our status page at https://status.blocks.team[/yellow]")
|
|
303
329
|
raise typer.Exit(1)
|
|
304
330
|
except Exception as e:
|
|
305
331
|
console.print(f"[red]{str(e)}[/red]")
|
|
@@ -27,7 +27,7 @@ def invoke_automation_with_test_event(automation_module, automation):
|
|
|
27
27
|
) as test_event_progress:
|
|
28
28
|
test_event_task = test_event_progress.add_task(description="Preparing automation...", total=None)
|
|
29
29
|
if trigger_alias is None or trigger_alias == "":
|
|
30
|
-
raise Exception("Event must be defined in the [white]@on[/white] decorator. For a list of supported events, please visit [white]https://docs.
|
|
30
|
+
raise Exception("Event must be defined in the [white]@on[/white] decorator. For a list of supported events, please visit [white]https://docs.blocks.team/docs/events[/white]")
|
|
31
31
|
res = api_client.get(f"{config.clients.client_url}/v1/test_events", params={
|
|
32
32
|
"trigger_alias": trigger_alias,
|
|
33
33
|
})
|
|
@@ -19,7 +19,7 @@ class AuthConfig(BaseModel):
|
|
|
19
19
|
# Allow only base64url characters (alphanumeric, '-', '_', and '=')
|
|
20
20
|
# This prevents invalid characters from blowing up the config file
|
|
21
21
|
if re.search(r'[^a-zA-Z0-9\-_=]', api_key):
|
|
22
|
-
raise ValueError("Invalid API key supplied. Please check your API key at [white]https://
|
|
22
|
+
raise ValueError("Invalid API key supplied. Please check your API key at [white]https://blocks.team[/white]")
|
|
23
23
|
|
|
24
24
|
config_file = Config.get_config_file()
|
|
25
25
|
|
|
@@ -15,8 +15,8 @@ from pydantic_settings import (
|
|
|
15
15
|
from blocks_cli.config.auth import AuthConfig
|
|
16
16
|
|
|
17
17
|
class ClientConfig(BaseModel):
|
|
18
|
-
client_url: str = "https://api.prod.
|
|
19
|
-
orchestrator_url: str = "https://api.prod.
|
|
18
|
+
client_url: str = "https://api.prod.blocks.team/client"
|
|
19
|
+
orchestrator_url: str = "https://api.prod.blocks.team"
|
|
20
20
|
|
|
21
21
|
class Config(BaseSettings):
|
|
22
22
|
env: str = "prod"
|
|
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
|
|
File without changes
|
|
File without changes
|