aes-cli 0.2.0__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.
Files changed (48) hide show
  1. aes/__init__.py +5 -0
  2. aes/__main__.py +37 -0
  3. aes/analyzer.py +487 -0
  4. aes/commands/__init__.py +0 -0
  5. aes/commands/init.py +727 -0
  6. aes/commands/inspect.py +204 -0
  7. aes/commands/install.py +379 -0
  8. aes/commands/publish.py +432 -0
  9. aes/commands/search.py +65 -0
  10. aes/commands/status.py +153 -0
  11. aes/commands/sync.py +413 -0
  12. aes/commands/validate.py +77 -0
  13. aes/config.py +43 -0
  14. aes/domains.py +1382 -0
  15. aes/frameworks.py +522 -0
  16. aes/mcp_server.py +213 -0
  17. aes/registry.py +294 -0
  18. aes/scaffold/agent.yaml.jinja +135 -0
  19. aes/scaffold/agentignore.jinja +61 -0
  20. aes/scaffold/instructions.md.jinja +311 -0
  21. aes/scaffold/local.example.yaml.jinja +35 -0
  22. aes/scaffold/local.yaml.jinja +29 -0
  23. aes/scaffold/operations.md.jinja +33 -0
  24. aes/scaffold/orchestrator.md.jinja +95 -0
  25. aes/scaffold/permissions.yaml.jinja +151 -0
  26. aes/scaffold/setup.md.jinja +244 -0
  27. aes/scaffold/skill.md.jinja +27 -0
  28. aes/scaffold/skill.yaml.jinja +175 -0
  29. aes/scaffold/workflow.yaml.jinja +44 -0
  30. aes/scaffold/workflow_command.md.jinja +48 -0
  31. aes/schemas/agent.schema.json +188 -0
  32. aes/schemas/permissions.schema.json +100 -0
  33. aes/schemas/registry.schema.json +72 -0
  34. aes/schemas/skill.schema.json +209 -0
  35. aes/schemas/workflow.schema.json +92 -0
  36. aes/targets/__init__.py +29 -0
  37. aes/targets/_base.py +77 -0
  38. aes/targets/_composer.py +338 -0
  39. aes/targets/claude.py +153 -0
  40. aes/targets/copilot.py +48 -0
  41. aes/targets/cursor.py +46 -0
  42. aes/targets/windsurf.py +46 -0
  43. aes/validator.py +394 -0
  44. aes_cli-0.2.0.dist-info/METADATA +110 -0
  45. aes_cli-0.2.0.dist-info/RECORD +48 -0
  46. aes_cli-0.2.0.dist-info/WHEEL +5 -0
  47. aes_cli-0.2.0.dist-info/entry_points.txt +3 -0
  48. aes_cli-0.2.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,188 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://aes.dev/schemas/agent/v1",
4
+ "title": "AES Agent Manifest",
5
+ "description": "Validates .agent/agent.yaml — the central manifest for an AES project",
6
+ "type": "object",
7
+ "required": ["aes", "name", "version", "description"],
8
+ "properties": {
9
+ "aes": {
10
+ "type": "string",
11
+ "pattern": "^\\d+\\.\\d+$",
12
+ "description": "AES spec version (e.g., '1.0')"
13
+ },
14
+ "name": {
15
+ "type": "string",
16
+ "pattern": "^[a-z][a-z0-9_-]*$",
17
+ "description": "Project name in kebab-case"
18
+ },
19
+ "version": {
20
+ "type": "string",
21
+ "pattern": "^\\d+\\.\\d+\\.\\d+",
22
+ "description": "Semantic version"
23
+ },
24
+ "description": {
25
+ "type": "string",
26
+ "minLength": 1,
27
+ "description": "One-line project description"
28
+ },
29
+ "domain": {
30
+ "type": "string",
31
+ "description": "Project domain (ml, web, devops, data-pipeline, etc.)"
32
+ },
33
+ "license": {
34
+ "type": "string"
35
+ },
36
+ "repository": {
37
+ "type": "string",
38
+ "format": "uri"
39
+ },
40
+ "author": {
41
+ "type": "object",
42
+ "properties": {
43
+ "name": { "type": "string" },
44
+ "email": { "type": "string", "format": "email" }
45
+ }
46
+ },
47
+ "runtime": {
48
+ "type": "object",
49
+ "properties": {
50
+ "language": { "type": "string" },
51
+ "version": { "type": "string" },
52
+ "entry_point": { "type": "string" },
53
+ "setup": { "type": "string" }
54
+ },
55
+ "required": ["language"]
56
+ },
57
+ "agent": {
58
+ "type": "object",
59
+ "required": ["instructions"],
60
+ "properties": {
61
+ "instructions": {
62
+ "type": "string",
63
+ "description": "Path to instructions.md relative to .agent/"
64
+ },
65
+ "permissions": {
66
+ "type": "string",
67
+ "description": "Path to permissions.yaml relative to .agent/"
68
+ },
69
+ "orchestrator": {
70
+ "type": "string",
71
+ "description": "Path to ORCHESTRATOR.md relative to .agent/"
72
+ }
73
+ }
74
+ },
75
+ "skills": {
76
+ "type": "array",
77
+ "items": {
78
+ "$ref": "#/$defs/skill_ref"
79
+ }
80
+ },
81
+ "registries": {
82
+ "type": "array",
83
+ "items": {
84
+ "$ref": "#/$defs/registry_ref"
85
+ }
86
+ },
87
+ "workflows": {
88
+ "type": "array",
89
+ "items": {
90
+ "$ref": "#/$defs/workflow_ref"
91
+ }
92
+ },
93
+ "commands": {
94
+ "type": "array",
95
+ "items": {
96
+ "$ref": "#/$defs/command_ref"
97
+ }
98
+ },
99
+ "dependencies": {
100
+ "type": "object",
101
+ "properties": {
102
+ "skills": {
103
+ "type": "object",
104
+ "additionalProperties": { "type": "string" }
105
+ }
106
+ }
107
+ },
108
+ "environment": {
109
+ "type": "object",
110
+ "properties": {
111
+ "required": {
112
+ "type": "array",
113
+ "items": { "$ref": "#/$defs/env_var" }
114
+ },
115
+ "optional": {
116
+ "type": "array",
117
+ "items": { "$ref": "#/$defs/env_var_optional" }
118
+ }
119
+ }
120
+ },
121
+ "resources": {
122
+ "type": "object",
123
+ "properties": {
124
+ "max_cpu_percent": { "type": "integer", "minimum": 1, "maximum": 100 },
125
+ "max_memory_percent": { "type": "integer", "minimum": 1, "maximum": 100 },
126
+ "max_concurrent_jobs": { "type": "integer", "minimum": 1 },
127
+ "max_disk_usage_mb": { "type": "integer", "minimum": 1 },
128
+ "coexistence_note": { "type": "string" }
129
+ }
130
+ }
131
+ },
132
+ "additionalProperties": false,
133
+ "$defs": {
134
+ "skill_ref": {
135
+ "type": "object",
136
+ "required": ["id"],
137
+ "properties": {
138
+ "id": { "type": "string", "pattern": "^[a-z][a-z0-9_-]*$" },
139
+ "manifest": { "type": "string" },
140
+ "runbook": { "type": "string" }
141
+ }
142
+ },
143
+ "registry_ref": {
144
+ "type": "object",
145
+ "required": ["id", "path"],
146
+ "properties": {
147
+ "id": { "type": "string" },
148
+ "path": { "type": "string" },
149
+ "description": { "type": "string" }
150
+ }
151
+ },
152
+ "workflow_ref": {
153
+ "type": "object",
154
+ "required": ["id", "path"],
155
+ "properties": {
156
+ "id": { "type": "string" },
157
+ "path": { "type": "string" }
158
+ }
159
+ },
160
+ "command_ref": {
161
+ "type": "object",
162
+ "required": ["id", "path"],
163
+ "properties": {
164
+ "id": { "type": "string" },
165
+ "path": { "type": "string" },
166
+ "trigger": { "type": "string", "pattern": "^/" },
167
+ "description": { "type": "string" }
168
+ }
169
+ },
170
+ "env_var": {
171
+ "type": "object",
172
+ "required": ["name", "description"],
173
+ "properties": {
174
+ "name": { "type": "string" },
175
+ "description": { "type": "string" }
176
+ }
177
+ },
178
+ "env_var_optional": {
179
+ "type": "object",
180
+ "required": ["name"],
181
+ "properties": {
182
+ "name": { "type": "string" },
183
+ "default": { "type": "string" },
184
+ "description": { "type": "string" }
185
+ }
186
+ }
187
+ }
188
+ }
@@ -0,0 +1,100 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://aes.dev/schemas/permissions/v1",
4
+ "title": "AES Permissions Model",
5
+ "description": "Validates .agent/permissions.yaml",
6
+ "type": "object",
7
+ "required": ["aes_permissions"],
8
+ "properties": {
9
+ "aes_permissions": {
10
+ "type": "string",
11
+ "pattern": "^\\d+\\.\\d+$"
12
+ },
13
+ "allow": {
14
+ "$ref": "#/$defs/permission_set"
15
+ },
16
+ "deny": {
17
+ "$ref": "#/$defs/permission_set"
18
+ },
19
+ "confirm": {
20
+ "type": "object",
21
+ "properties": {
22
+ "shell": {
23
+ "type": "array",
24
+ "items": { "type": "string" }
25
+ },
26
+ "files": {
27
+ "type": "object",
28
+ "properties": {
29
+ "read": { "$ref": "#/$defs/pattern_or_patterns" },
30
+ "write": { "$ref": "#/$defs/pattern_or_patterns" },
31
+ "create": { "$ref": "#/$defs/pattern_or_patterns" },
32
+ "delete": { "$ref": "#/$defs/pattern_or_patterns" }
33
+ }
34
+ },
35
+ "actions": {
36
+ "type": "array",
37
+ "items": { "type": "string" }
38
+ }
39
+ }
40
+ },
41
+ "resource_limits": {
42
+ "type": "object",
43
+ "properties": {
44
+ "max_cpu_percent": { "type": "integer", "minimum": 1, "maximum": 100 },
45
+ "max_memory_percent": { "type": "integer", "minimum": 1, "maximum": 100 },
46
+ "check_before": {
47
+ "type": "array",
48
+ "items": { "type": "string" }
49
+ },
50
+ "on_exceeded": {
51
+ "type": "string",
52
+ "enum": ["warn_and_skip", "wait_and_retry", "abort"]
53
+ }
54
+ }
55
+ },
56
+ "overrides": {
57
+ "type": "object",
58
+ "additionalProperties": true
59
+ }
60
+ },
61
+ "additionalProperties": false,
62
+ "$defs": {
63
+ "permission_set": {
64
+ "type": "object",
65
+ "properties": {
66
+ "shell": {
67
+ "oneOf": [
68
+ {
69
+ "type": "array",
70
+ "items": { "type": "string" }
71
+ },
72
+ {
73
+ "type": "object",
74
+ "properties": {
75
+ "read": { "type": "array", "items": { "type": "string" } },
76
+ "execute": { "type": "array", "items": { "type": "string" } },
77
+ "remote": { "type": "array", "items": { "type": "string" } }
78
+ }
79
+ }
80
+ ]
81
+ },
82
+ "files": {
83
+ "type": "object",
84
+ "properties": {
85
+ "read": { "$ref": "#/$defs/pattern_or_patterns" },
86
+ "write": { "$ref": "#/$defs/pattern_or_patterns" },
87
+ "create": { "$ref": "#/$defs/pattern_or_patterns" },
88
+ "delete": { "$ref": "#/$defs/pattern_or_patterns" }
89
+ }
90
+ }
91
+ }
92
+ },
93
+ "pattern_or_patterns": {
94
+ "oneOf": [
95
+ { "type": "string" },
96
+ { "type": "array", "items": { "type": "string" } }
97
+ ]
98
+ }
99
+ }
100
+ }
@@ -0,0 +1,72 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://aes.dev/schemas/registry/v1",
4
+ "title": "AES Registry Definition",
5
+ "description": "Validates .agent/registry/*.yaml component registries",
6
+ "type": "object",
7
+ "required": ["aes_registry", "id", "categories"],
8
+ "properties": {
9
+ "aes_registry": {
10
+ "type": "string",
11
+ "pattern": "^\\d+\\.\\d+$"
12
+ },
13
+ "id": {
14
+ "type": "string",
15
+ "pattern": "^[a-z][a-z0-9_-]*$"
16
+ },
17
+ "description": {
18
+ "type": "string"
19
+ },
20
+ "entry_schema": {
21
+ "type": "object",
22
+ "properties": {
23
+ "required": {
24
+ "type": "array",
25
+ "items": { "$ref": "#/$defs/schema_field" }
26
+ },
27
+ "optional": {
28
+ "type": "array",
29
+ "items": { "$ref": "#/$defs/schema_field" }
30
+ },
31
+ "dynamic": {
32
+ "type": "array",
33
+ "items": { "$ref": "#/$defs/schema_field" }
34
+ }
35
+ }
36
+ },
37
+ "interface": {
38
+ "type": "object",
39
+ "properties": {
40
+ "description": { "type": "string" },
41
+ "functions": {
42
+ "type": "array",
43
+ "items": {
44
+ "type": "object",
45
+ "required": ["name"],
46
+ "properties": {
47
+ "name": { "type": "string" },
48
+ "signature": { "type": "string" },
49
+ "description": { "type": "string" }
50
+ }
51
+ }
52
+ }
53
+ }
54
+ },
55
+ "categories": {
56
+ "type": "object",
57
+ "additionalProperties": true
58
+ }
59
+ },
60
+ "additionalProperties": false,
61
+ "$defs": {
62
+ "schema_field": {
63
+ "type": "object",
64
+ "required": ["name"],
65
+ "properties": {
66
+ "name": { "type": "string" },
67
+ "type": { "type": "string" },
68
+ "description": { "type": "string" }
69
+ }
70
+ }
71
+ }
72
+ }
@@ -0,0 +1,209 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://aes.dev/schemas/skill/v1",
4
+ "title": "AES Skill Manifest",
5
+ "description": "Validates .agent/skills/*.skill.yaml",
6
+ "type": "object",
7
+ "required": ["aes_skill", "id", "name", "version", "description"],
8
+ "properties": {
9
+ "aes_skill": {
10
+ "type": "string",
11
+ "pattern": "^\\d+\\.\\d+$"
12
+ },
13
+ "id": {
14
+ "type": "string",
15
+ "pattern": "^[a-z][a-z0-9_-]*$"
16
+ },
17
+ "name": {
18
+ "type": "string",
19
+ "minLength": 1
20
+ },
21
+ "version": {
22
+ "type": "string",
23
+ "pattern": "^\\d+\\.\\d+\\.\\d+"
24
+ },
25
+ "description": {
26
+ "type": "string",
27
+ "minLength": 1,
28
+ "maxLength": 1024
29
+ },
30
+ "negative_triggers": {
31
+ "type": "array",
32
+ "items": { "type": "string" },
33
+ "description": "Phrases or scenarios where this skill should NOT be used"
34
+ },
35
+ "activation": {
36
+ "type": "string",
37
+ "enum": ["auto", "explicit", "hybrid"],
38
+ "default": "explicit",
39
+ "description": "How the skill is activated: auto (loaded by description match), explicit (slash command only), hybrid (both)"
40
+ },
41
+ "allowed_tools": {
42
+ "type": "object",
43
+ "properties": {
44
+ "shell": { "type": "boolean" },
45
+ "files": {
46
+ "type": "object",
47
+ "properties": {
48
+ "read": {
49
+ "oneOf": [
50
+ { "type": "boolean" },
51
+ { "type": "array", "items": { "type": "string" } }
52
+ ]
53
+ },
54
+ "write": {
55
+ "oneOf": [
56
+ { "type": "boolean" },
57
+ { "type": "array", "items": { "type": "string" } }
58
+ ]
59
+ }
60
+ },
61
+ "additionalProperties": false
62
+ },
63
+ "network": { "type": "boolean" },
64
+ "mcp_servers": {
65
+ "type": "array",
66
+ "items": { "type": "string" }
67
+ }
68
+ },
69
+ "additionalProperties": false
70
+ },
71
+ "stage": {
72
+ "type": "integer",
73
+ "minimum": 1
74
+ },
75
+ "phase": {
76
+ "type": "string"
77
+ },
78
+ "inputs": {
79
+ "type": "object",
80
+ "properties": {
81
+ "required": {
82
+ "type": "array",
83
+ "items": { "$ref": "#/$defs/input_field" }
84
+ },
85
+ "optional": {
86
+ "type": "array",
87
+ "items": { "$ref": "#/$defs/input_field_optional" }
88
+ },
89
+ "environment": {
90
+ "type": "array",
91
+ "items": { "type": "string" }
92
+ }
93
+ }
94
+ },
95
+ "outputs": {
96
+ "type": "array",
97
+ "items": { "$ref": "#/$defs/output_field" }
98
+ },
99
+ "prerequisites": {
100
+ "type": "array",
101
+ "items": { "type": "string" }
102
+ },
103
+ "triggers": {
104
+ "type": "array",
105
+ "items": { "$ref": "#/$defs/trigger" }
106
+ },
107
+ "error_handling": {
108
+ "type": "object",
109
+ "properties": {
110
+ "strategy": {
111
+ "type": "string",
112
+ "enum": ["per-item-isolation", "fail-fast", "retry-with-backoff", "skip-on-error"]
113
+ },
114
+ "retries": { "type": "integer", "minimum": 0 },
115
+ "on_network_error": { "type": "string" },
116
+ "on_rate_limit": { "type": "string" },
117
+ "on_invalid_data": { "type": "string" }
118
+ }
119
+ },
120
+ "code": {
121
+ "type": "object",
122
+ "properties": {
123
+ "primary": { "type": "string" },
124
+ "config": { "type": "string" },
125
+ "db": { "type": "string" },
126
+ "functions": {
127
+ "type": "array",
128
+ "items": { "type": "string" }
129
+ }
130
+ }
131
+ },
132
+ "depends_on": {
133
+ "type": "array",
134
+ "items": {
135
+ "oneOf": [
136
+ { "type": "string" },
137
+ {
138
+ "type": "object",
139
+ "required": ["skill"],
140
+ "properties": {
141
+ "skill": { "type": "string" },
142
+ "version": { "type": "string" }
143
+ }
144
+ }
145
+ ]
146
+ }
147
+ },
148
+ "blocks": {
149
+ "type": "array",
150
+ "items": { "type": "string" }
151
+ },
152
+ "tags": {
153
+ "type": "array",
154
+ "items": { "type": "string" }
155
+ }
156
+ },
157
+ "additionalProperties": false,
158
+ "$defs": {
159
+ "input_field": {
160
+ "type": "object",
161
+ "required": ["name", "type"],
162
+ "properties": {
163
+ "name": { "type": "string" },
164
+ "type": { "type": "string" },
165
+ "description": { "type": "string" }
166
+ }
167
+ },
168
+ "input_field_optional": {
169
+ "type": "object",
170
+ "required": ["name", "type"],
171
+ "properties": {
172
+ "name": { "type": "string" },
173
+ "type": { "type": "string" },
174
+ "default": {},
175
+ "description": { "type": "string" }
176
+ }
177
+ },
178
+ "output_field": {
179
+ "type": "object",
180
+ "properties": {
181
+ "name": { "type": "string" },
182
+ "type": { "type": "string" },
183
+ "description": { "type": "string" },
184
+ "state_change": {
185
+ "type": "object",
186
+ "properties": {
187
+ "entity": { "type": "string" },
188
+ "from_status": { "type": ["string", "null"] },
189
+ "to_status": { "type": "string" }
190
+ }
191
+ }
192
+ }
193
+ },
194
+ "trigger": {
195
+ "type": "object",
196
+ "required": ["type"],
197
+ "properties": {
198
+ "type": {
199
+ "type": "string",
200
+ "enum": ["manual", "schedule", "condition", "event"]
201
+ },
202
+ "command": { "type": "string" },
203
+ "cron": { "type": "string" },
204
+ "when": { "type": "string" },
205
+ "event": { "type": "string" }
206
+ }
207
+ }
208
+ }
209
+ }
@@ -0,0 +1,92 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://aes.dev/schemas/workflow/v1",
4
+ "title": "AES Workflow Definition",
5
+ "description": "Validates .agent/workflows/*.yaml state machine definitions",
6
+ "type": "object",
7
+ "required": ["aes_workflow", "id", "entity", "states", "transitions"],
8
+ "properties": {
9
+ "aes_workflow": {
10
+ "type": "string",
11
+ "pattern": "^\\d+\\.\\d+$"
12
+ },
13
+ "id": {
14
+ "type": "string",
15
+ "pattern": "^[a-z][a-z0-9_-]*$"
16
+ },
17
+ "entity": {
18
+ "type": "string",
19
+ "description": "The entity type this workflow tracks"
20
+ },
21
+ "description": {
22
+ "type": "string"
23
+ },
24
+ "states": {
25
+ "type": "object",
26
+ "minProperties": 2,
27
+ "additionalProperties": {
28
+ "$ref": "#/$defs/state"
29
+ }
30
+ },
31
+ "transitions": {
32
+ "type": "array",
33
+ "minItems": 1,
34
+ "items": { "$ref": "#/$defs/transition" }
35
+ },
36
+ "rejection": {
37
+ "type": "object",
38
+ "properties": {
39
+ "any_state_can_reject": { "type": "boolean" },
40
+ "requires_reason": { "type": "boolean" },
41
+ "column": { "type": "string" }
42
+ }
43
+ },
44
+ "idempotency": {
45
+ "type": "object",
46
+ "properties": {
47
+ "pattern": {
48
+ "type": "string",
49
+ "enum": ["status-gated", "timestamp-based", "version-based", "none"]
50
+ },
51
+ "description": { "type": "string" }
52
+ }
53
+ },
54
+ "persistence": {
55
+ "type": "object",
56
+ "properties": {
57
+ "backend": { "type": "string" },
58
+ "table": { "type": "string" },
59
+ "status_column": { "type": "string" },
60
+ "updated_at": { "type": "string" }
61
+ }
62
+ }
63
+ },
64
+ "additionalProperties": false,
65
+ "$defs": {
66
+ "state": {
67
+ "type": "object",
68
+ "required": ["description"],
69
+ "properties": {
70
+ "description": { "type": "string" },
71
+ "initial": { "type": "boolean" },
72
+ "active": { "type": "boolean" },
73
+ "terminal": { "type": "boolean" }
74
+ }
75
+ },
76
+ "transition": {
77
+ "type": "object",
78
+ "required": ["from", "to"],
79
+ "properties": {
80
+ "from": { "type": "string" },
81
+ "to": { "type": "string" },
82
+ "skill": { "type": "string" },
83
+ "conditions": {
84
+ "type": "array",
85
+ "items": { "type": "string" }
86
+ },
87
+ "on_failure": { "type": "string" },
88
+ "description": { "type": "string" }
89
+ }
90
+ }
91
+ }
92
+ }
@@ -0,0 +1,29 @@
1
+ """Sync target adapters for AI coding tools."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Dict, Type
6
+
7
+ from aes.targets._base import AgentContext, GeneratedFile, SyncPlan, SyncTarget
8
+ from aes.targets.claude import ClaudeTarget
9
+ from aes.targets.copilot import CopilotTarget
10
+ from aes.targets.cursor import CursorTarget
11
+ from aes.targets.windsurf import WindsurfTarget
12
+
13
+ TARGETS: Dict[str, Type[SyncTarget]] = {
14
+ "claude": ClaudeTarget,
15
+ "cursor": CursorTarget,
16
+ "copilot": CopilotTarget,
17
+ "windsurf": WindsurfTarget,
18
+ }
19
+
20
+ TARGET_NAMES = list(TARGETS.keys())
21
+
22
+ __all__ = [
23
+ "TARGETS",
24
+ "TARGET_NAMES",
25
+ "AgentContext",
26
+ "GeneratedFile",
27
+ "SyncPlan",
28
+ "SyncTarget",
29
+ ]