aiset-cli 0.1.0__tar.gz → 0.3.0__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.
- {aiset_cli-0.1.0 → aiset_cli-0.3.0}/PKG-INFO +33 -6
- {aiset_cli-0.1.0 → aiset_cli-0.3.0}/README.md +31 -4
- {aiset_cli-0.1.0 → aiset_cli-0.3.0}/pyproject.toml +3 -3
- {aiset_cli-0.1.0 → aiset_cli-0.3.0}/src/aiset/__init__.py +1 -1
- {aiset_cli-0.1.0 → aiset_cli-0.3.0}/src/aiset/archmap.py +47 -12
- aiset_cli-0.3.0/src/aiset/atomic.py +61 -0
- {aiset_cli-0.1.0 → aiset_cli-0.3.0}/src/aiset/brain.py +19 -6
- {aiset_cli-0.1.0 → aiset_cli-0.3.0}/src/aiset/brief_index.py +1 -1
- aiset_cli-0.3.0/src/aiset/cli.py +23 -0
- {aiset_cli-0.1.0 → aiset_cli-0.3.0}/src/aiset/core.py +58 -8
- {aiset_cli-0.1.0 → aiset_cli-0.3.0}/src/aiset/init_team.py +109 -25
- aiset_cli-0.3.0/src/aiset/nudge.py +211 -0
- {aiset_cli-0.1.0 → aiset_cli-0.3.0}/src/aiset/registry.py +8 -7
- {aiset_cli-0.1.0 → aiset_cli-0.3.0}/src/aiset/research.py +134 -28
- aiset_cli-0.3.0/src/aiset/run/__init__.py +25 -0
- aiset_cli-0.3.0/src/aiset/run/__main__.py +7 -0
- aiset_cli-0.3.0/src/aiset/run/ac.py +25 -0
- aiset_cli-0.3.0/src/aiset/run/board.py +123 -0
- aiset_cli-0.3.0/src/aiset/run/claims.py +30 -0
- aiset_cli-0.3.0/src/aiset/run/cli.py +491 -0
- aiset_cli-0.3.0/src/aiset/run/cost.py +21 -0
- aiset_cli-0.3.0/src/aiset/run/datatypes.py +74 -0
- aiset_cli-0.3.0/src/aiset/run/fetch.py +33 -0
- aiset_cli-0.3.0/src/aiset/run/gate.py +511 -0
- aiset_cli-0.3.0/src/aiset/run/gitops.py +266 -0
- aiset_cli-0.3.0/src/aiset/run/issue_md.py +77 -0
- aiset_cli-0.3.0/src/aiset/run/launch.py +104 -0
- aiset_cli-0.3.0/src/aiset/run/names.py +32 -0
- aiset_cli-0.3.0/src/aiset/run/pr_body.py +133 -0
- aiset_cli-0.3.0/src/aiset/run/publish.py +77 -0
- aiset_cli-0.3.0/src/aiset/run/refs.py +41 -0
- aiset_cli-0.3.0/src/aiset/run/sanitize.py +14 -0
- aiset_cli-0.3.0/src/aiset/run/verdicts.py +26 -0
- {aiset_cli-0.1.0 → aiset_cli-0.3.0}/src/aiset/server.py +104 -27
- {aiset_cli-0.1.0 → aiset_cli-0.3.0}/src/aiset/settings.py +16 -5
- {aiset_cli-0.1.0 → aiset_cli-0.3.0}/src/aiset/static/brain.html +13 -3
- {aiset_cli-0.1.0 → aiset_cli-0.3.0}/src/aiset/static/index.html +7 -7
- {aiset_cli-0.1.0 → aiset_cli-0.3.0}/src/aiset/sync_names.py +5 -6
- {aiset_cli-0.1.0 → aiset_cli-0.3.0}/src/aiset/teammap.py +250 -47
- {aiset_cli-0.1.0 → aiset_cli-0.3.0}/src/aiset/templates/engineer.md +7 -4
- {aiset_cli-0.1.0 → aiset_cli-0.3.0}/src/aiset/templates/integration-checker.md +1 -1
- {aiset_cli-0.1.0 → aiset_cli-0.3.0}/src/aiset/templates/pm.md +12 -2
- aiset_cli-0.3.0/src/aiset/templates/run_prompt.md +9 -0
- {aiset_cli-0.1.0 → aiset_cli-0.3.0}/src/aiset/templates/tester.md +3 -3
- {aiset_cli-0.1.0 → aiset_cli-0.3.0}/src/aiset/workspace.py +32 -6
- {aiset_cli-0.1.0 → aiset_cli-0.3.0}/src/aiset_cli.egg-info/PKG-INFO +33 -6
- aiset_cli-0.3.0/src/aiset_cli.egg-info/SOURCES.txt +102 -0
- {aiset_cli-0.1.0 → aiset_cli-0.3.0}/src/aiset_cli.egg-info/entry_points.txt +1 -1
- aiset_cli-0.3.0/tests/test_archmap_cli.py +46 -0
- aiset_cli-0.3.0/tests/test_archmap_go.py +66 -0
- aiset_cli-0.3.0/tests/test_archmap_pyproject.py +73 -0
- aiset_cli-0.3.0/tests/test_atomic.py +136 -0
- aiset_cli-0.3.0/tests/test_brain_graph_files.py +73 -0
- aiset_cli-0.3.0/tests/test_brain_live_link.py +25 -0
- aiset_cli-0.3.0/tests/test_claude_home.py +113 -0
- aiset_cli-0.3.0/tests/test_core.py +375 -0
- aiset_cli-0.3.0/tests/test_encodings.py +80 -0
- aiset_cli-0.3.0/tests/test_init_team.py +129 -0
- aiset_cli-0.3.0/tests/test_nudge.py +173 -0
- aiset_cli-0.3.0/tests/test_repository_paths.py +134 -0
- {aiset_cli-0.1.0 → aiset_cli-0.3.0}/tests/test_research.py +89 -3
- aiset_cli-0.3.0/tests/test_run_ac.py +29 -0
- aiset_cli-0.3.0/tests/test_run_board.py +98 -0
- aiset_cli-0.3.0/tests/test_run_claims.py +26 -0
- aiset_cli-0.3.0/tests/test_run_cli.py +609 -0
- aiset_cli-0.3.0/tests/test_run_cost.py +26 -0
- aiset_cli-0.3.0/tests/test_run_gate.py +283 -0
- aiset_cli-0.3.0/tests/test_run_issue_md.py +58 -0
- aiset_cli-0.3.0/tests/test_run_launch.py +94 -0
- aiset_cli-0.3.0/tests/test_run_names.py +39 -0
- aiset_cli-0.3.0/tests/test_run_pr_body.py +128 -0
- aiset_cli-0.3.0/tests/test_run_refs.py +80 -0
- aiset_cli-0.3.0/tests/test_run_sanitize.py +26 -0
- aiset_cli-0.3.0/tests/test_run_verdicts.py +26 -0
- aiset_cli-0.3.0/tests/test_security.py +280 -0
- {aiset_cli-0.1.0 → aiset_cli-0.3.0}/tests/test_settings.py +15 -0
- aiset_cli-0.3.0/tests/test_single_repo.py +312 -0
- aiset_cli-0.3.0/tests/test_teammap_cli_inputs.py +87 -0
- aiset_cli-0.3.0/tests/test_teammap_lookup.py +259 -0
- aiset_cli-0.3.0/tests/test_teammap_outline.py +116 -0
- aiset_cli-0.3.0/tests/test_teammap_route_frames.py +147 -0
- aiset_cli-0.3.0/tests/test_usage_cost.py +56 -0
- aiset_cli-0.3.0/tests/test_version.py +56 -0
- aiset_cli-0.3.0/tests/test_workspace_slug.py +98 -0
- aiset_cli-0.1.0/src/aiset_cli.egg-info/SOURCES.txt +0 -45
- {aiset_cli-0.1.0 → aiset_cli-0.3.0}/LICENSE +0 -0
- {aiset_cli-0.1.0 → aiset_cli-0.3.0}/setup.cfg +0 -0
- {aiset_cli-0.1.0 → aiset_cli-0.3.0}/src/aiset/roster.json +0 -0
- {aiset_cli-0.1.0 → aiset_cli-0.3.0}/src/aiset/static/aiset-icon.png +0 -0
- {aiset_cli-0.1.0 → aiset_cli-0.3.0}/src/aiset/static/apple-touch-icon.png +0 -0
- {aiset_cli-0.1.0 → aiset_cli-0.3.0}/src/aiset/static/architecture.html +0 -0
- {aiset_cli-0.1.0 → aiset_cli-0.3.0}/src/aiset/static/favicon-16.png +0 -0
- {aiset_cli-0.1.0 → aiset_cli-0.3.0}/src/aiset/static/favicon-32.png +0 -0
- {aiset_cli-0.1.0 → aiset_cli-0.3.0}/src/aiset/static/favicon-48.png +0 -0
- {aiset_cli-0.1.0 → aiset_cli-0.3.0}/src/aiset/static/favicon.ico +0 -0
- {aiset_cli-0.1.0 → aiset_cli-0.3.0}/src/aiset/static/icon-192.png +0 -0
- {aiset_cli-0.1.0 → aiset_cli-0.3.0}/src/aiset/static/icon-512.png +0 -0
- {aiset_cli-0.1.0 → aiset_cli-0.3.0}/src/aiset/static/settings.html +0 -0
- {aiset_cli-0.1.0 → aiset_cli-0.3.0}/src/aiset/static/site.webmanifest +0 -0
- {aiset_cli-0.1.0 → aiset_cli-0.3.0}/src/aiset/teammap_ts.js +0 -0
- {aiset_cli-0.1.0 → aiset_cli-0.3.0}/src/aiset_cli.egg-info/dependency_links.txt +0 -0
- {aiset_cli-0.1.0 → aiset_cli-0.3.0}/src/aiset_cli.egg-info/top_level.txt +0 -0
- {aiset_cli-0.1.0 → aiset_cli-0.3.0}/tests/test_file_imports.py +0 -0
- {aiset_cli-0.1.0 → aiset_cli-0.3.0}/tests/test_registry.py +0 -0
- {aiset_cli-0.1.0 → aiset_cli-0.3.0}/tests/test_task_ids.py +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: aiset-cli
|
|
3
|
-
Version: 0.
|
|
4
|
-
Summary: Turn your
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Turn your repos into a team of Claude Code agents with persistent memory, coordinated tasks, and a live dashboard.
|
|
5
5
|
Author: Jamshid Sadik
|
|
6
6
|
License-Expression: MIT
|
|
7
7
|
Project-URL: Homepage, https://github.com/JamshidS/aiset
|
|
@@ -41,6 +41,8 @@ work in parallel, and show you every step, live.
|
|
|
41
41
|
|
|
42
42
|
<br>
|
|
43
43
|
|
|
44
|
+
[](https://pypi.org/project/aiset-cli/)
|
|
45
|
+
[](https://github.com/JamshidS/aiset/actions/workflows/ci.yml)
|
|
44
46
|
[](pyproject.toml)
|
|
45
47
|
[](pyproject.toml)
|
|
46
48
|
[](https://claude.com/claude-code)
|
|
@@ -73,7 +75,11 @@ Give the PM its first task:
|
|
|
73
75
|
|
|
74
76
|
> *"Build the knowledge briefs. Document the architecture, conventions, test commands and known pitfalls for each repository."*
|
|
75
77
|
|
|
76
|
-
|
|
78
|
+
> [!TIP]
|
|
79
|
+
> Agents working in parallel spend tokens in parallel. The office shows the cost per agent and task as it happens, and **Settings** lets you put routine roles on Sonnet or Haiku.
|
|
80
|
+
|
|
81
|
+
<sub>Needs Python 3.9+, Git and [Claude Code](https://claude.com/claude-code); TypeScript indexing also uses Node.js. Works with a folder of repositories or a monorepo; a single repository with its project at the root is one unit, and a root package that later gains service folders keeps its root engineer ([#36](https://github.com/JamshidS/aiset/issues/36)).</sub><br>
|
|
82
|
+
<sub>The PyPI package is `aiset-cli`; `aiset` on PyPI is an unrelated project.</sub>
|
|
77
83
|
|
|
78
84
|
<br>
|
|
79
85
|
|
|
@@ -155,7 +161,7 @@ Services, databases and the calls between them, each backed by a file and line.
|
|
|
155
161
|
|
|
156
162
|
| | |
|
|
157
163
|
|---|---|
|
|
158
|
-
| **Office** | Live isometric or classic view of the team: assignments, task boards, activity feed, models, tokens and estimated cost per agent. |
|
|
164
|
+
| **Office** | Live isometric or classic view of the team: assignments, task boards, activity feed, models, tokens and estimated cost per agent. Its footer uses the `<team>-pm` command when the launcher is available on `PATH`. |
|
|
159
165
|
| **Brain** | One graph of agents, briefs, sections, episodes, files, endpoints, models and API calls. Follow an agent, search anything, focus on a node. |
|
|
160
166
|
| **Architecture** | Static map of frontends, APIs, workers and infrastructure (PostgreSQL, MongoDB, Redis, RabbitMQ, Kafka, Keycloak and more), with evidence for every link. Exports Mermaid. |
|
|
161
167
|
| **Settings** | Names, roles, colours, duties and the **model per agent**: put routine work on Sonnet or Haiku, keep Opus where it matters. |
|
|
@@ -169,12 +175,17 @@ Services, databases and the calls between them, each backed by a file and line.
|
|
|
169
175
|
| Command | What it does |
|
|
170
176
|
|---|---|
|
|
171
177
|
| `aiset-init <folder> [--team NAME]` | Detect stacks, generate the roster, agents and brief stubs in `<folder>/.claude/`. Safe to re-run: keeps your names, adds new repos. |
|
|
172
|
-
| `<team>-pm` | Start the PM in its workspace from anywhere. Extra arguments go to Claude Code, e.g. `shop-pm --model sonnet`. |
|
|
178
|
+
| `<team>-pm` | Start the PM in its workspace from anywhere. The office footer suggests this command when its launcher is on `PATH`. Extra arguments go to Claude Code, e.g. `shop-pm --model sonnet`. |
|
|
173
179
|
| `aiset [--workspace FOLDER\|TEAM]` | Open the office. Without `--workspace`: the workspace you're in, else the team you set up most recently. |
|
|
180
|
+
| `aiset run <issue>` (preview) | Accepts `123`, `#123`, `owner/name#123` or a github.com issue URL. Work a GitHub issue with the team; opens a **draft** PR only after you approve at gate 2. `aiset run --help` for options; `python -m aiset.run <issue>` does the same if an older `aiset` on `PATH` opens the office instead. See the [user guide](docs/USER-GUIDE.md#work-a-github-issue-aiset-run-preview). |
|
|
174
181
|
| `teammap relevant "<task>"` | Files, symbols, endpoints, brief sections and past episodes to read first. |
|
|
175
182
|
| `teammap impact <path\|symbol\|Model> [METHOD]` | What a change can reach: consumers, models, importers, tests. Exact vs inferred. |
|
|
176
183
|
| `teammap failures <log>` | Failed tests, messages and in-repo frames from a saved test run, grouped. |
|
|
184
|
+
| `teammap outline <file>` | Imports, symbol signatures, line ranges, sizes and routes for one indexed file. |
|
|
177
185
|
| `teammap endpoint` · `model` · `arch` · `symbol` | Direct lookups. `teammap --help` lists them all. |
|
|
186
|
+
| `aiset --version` · `aiset-init --version` · `teammap --version` | Print the installed version. Doesn't start the office or touch a workspace. |
|
|
187
|
+
|
|
188
|
+
`teammap --repo NAME` uses repository names from the active roster. Unknown names and missing or non-integer numeric option values produce a usage error (exit 2); see the [user guide](docs/USER-GUIDE.md#research-tools-teammap-impact-failures-relevant) for options.
|
|
178
189
|
|
|
179
190
|
<details>
|
|
180
191
|
<summary><b>Example: what does changing an endpoint break?</b></summary>
|
|
@@ -242,6 +253,14 @@ Everything is plain Markdown and JSON in your workspace. In a monorepo, `.claude
|
|
|
242
253
|
|
|
243
254
|
## FAQ
|
|
244
255
|
|
|
256
|
+
<details>
|
|
257
|
+
<summary><b>How is this different from Claude Code subagents?</b></summary>
|
|
258
|
+
<br>
|
|
259
|
+
|
|
260
|
+
aiset is built on them. `aiset-init` writes the subagent files for you, one per repo or stack, with each agent's repos, test commands and brief. On top it adds what subagents don't have on their own: a PM that plans and verifies, memory that carries over between tasks (briefs, field notes, episodes), `teammap` research tools, and a dashboard that shows what every agent is doing and what it costs.
|
|
261
|
+
|
|
262
|
+
</details>
|
|
263
|
+
|
|
245
264
|
<details>
|
|
246
265
|
<summary><b><code>aiset-init</code> is "not recognized" after installing</b></summary>
|
|
247
266
|
<br>
|
|
@@ -286,10 +305,18 @@ The office shows one workspace at a time and prints which one at startup. Run `a
|
|
|
286
305
|
|
|
287
306
|
## Contributing
|
|
288
307
|
|
|
289
|
-
Issues and pull requests are welcome.
|
|
308
|
+
Issues and pull requests are welcome. A good place to start is an issue labeled [**good first issue**](https://github.com/JamshidS/aiset/labels/good%20first%20issue): each one names the files to change and how to test it. To work on aiset itself, clone it, `pip install -e .`, and run `make check`. [CONTRIBUTING.md](CONTRIBUTING.md) has the full workflow; report vulnerabilities privately as described in [SECURITY.md](SECURITY.md).
|
|
290
309
|
|
|
291
310
|
More docs: [User guide](docs/USER-GUIDE.md) · [Feature inventory](docs/FEATURES.md) · [Research tools](docs/RESEARCH-TOOLS.md) · [Brand assets](docs/branding/preview.html)
|
|
292
311
|
|
|
312
|
+
### Contributors
|
|
313
|
+
|
|
314
|
+
Thanks to everyone who has helped build aiset.
|
|
315
|
+
|
|
316
|
+
<a href="https://github.com/JamshidS/aiset/graphs/contributors">
|
|
317
|
+
<img src="https://contrib.rocks/image?repo=JamshidS/aiset" alt="aiset contributors">
|
|
318
|
+
</a>
|
|
319
|
+
|
|
293
320
|
<br>
|
|
294
321
|
|
|
295
322
|
<div align="center">
|
|
@@ -11,6 +11,8 @@ work in parallel, and show you every step, live.
|
|
|
11
11
|
|
|
12
12
|
<br>
|
|
13
13
|
|
|
14
|
+
[](https://pypi.org/project/aiset-cli/)
|
|
15
|
+
[](https://github.com/JamshidS/aiset/actions/workflows/ci.yml)
|
|
14
16
|
[](pyproject.toml)
|
|
15
17
|
[](pyproject.toml)
|
|
16
18
|
[](https://claude.com/claude-code)
|
|
@@ -43,7 +45,11 @@ Give the PM its first task:
|
|
|
43
45
|
|
|
44
46
|
> *"Build the knowledge briefs. Document the architecture, conventions, test commands and known pitfalls for each repository."*
|
|
45
47
|
|
|
46
|
-
|
|
48
|
+
> [!TIP]
|
|
49
|
+
> Agents working in parallel spend tokens in parallel. The office shows the cost per agent and task as it happens, and **Settings** lets you put routine roles on Sonnet or Haiku.
|
|
50
|
+
|
|
51
|
+
<sub>Needs Python 3.9+, Git and [Claude Code](https://claude.com/claude-code); TypeScript indexing also uses Node.js. Works with a folder of repositories or a monorepo; a single repository with its project at the root is one unit, and a root package that later gains service folders keeps its root engineer ([#36](https://github.com/JamshidS/aiset/issues/36)).</sub><br>
|
|
52
|
+
<sub>The PyPI package is `aiset-cli`; `aiset` on PyPI is an unrelated project.</sub>
|
|
47
53
|
|
|
48
54
|
<br>
|
|
49
55
|
|
|
@@ -125,7 +131,7 @@ Services, databases and the calls between them, each backed by a file and line.
|
|
|
125
131
|
|
|
126
132
|
| | |
|
|
127
133
|
|---|---|
|
|
128
|
-
| **Office** | Live isometric or classic view of the team: assignments, task boards, activity feed, models, tokens and estimated cost per agent. |
|
|
134
|
+
| **Office** | Live isometric or classic view of the team: assignments, task boards, activity feed, models, tokens and estimated cost per agent. Its footer uses the `<team>-pm` command when the launcher is available on `PATH`. |
|
|
129
135
|
| **Brain** | One graph of agents, briefs, sections, episodes, files, endpoints, models and API calls. Follow an agent, search anything, focus on a node. |
|
|
130
136
|
| **Architecture** | Static map of frontends, APIs, workers and infrastructure (PostgreSQL, MongoDB, Redis, RabbitMQ, Kafka, Keycloak and more), with evidence for every link. Exports Mermaid. |
|
|
131
137
|
| **Settings** | Names, roles, colours, duties and the **model per agent**: put routine work on Sonnet or Haiku, keep Opus where it matters. |
|
|
@@ -139,12 +145,17 @@ Services, databases and the calls between them, each backed by a file and line.
|
|
|
139
145
|
| Command | What it does |
|
|
140
146
|
|---|---|
|
|
141
147
|
| `aiset-init <folder> [--team NAME]` | Detect stacks, generate the roster, agents and brief stubs in `<folder>/.claude/`. Safe to re-run: keeps your names, adds new repos. |
|
|
142
|
-
| `<team>-pm` | Start the PM in its workspace from anywhere. Extra arguments go to Claude Code, e.g. `shop-pm --model sonnet`. |
|
|
148
|
+
| `<team>-pm` | Start the PM in its workspace from anywhere. The office footer suggests this command when its launcher is on `PATH`. Extra arguments go to Claude Code, e.g. `shop-pm --model sonnet`. |
|
|
143
149
|
| `aiset [--workspace FOLDER\|TEAM]` | Open the office. Without `--workspace`: the workspace you're in, else the team you set up most recently. |
|
|
150
|
+
| `aiset run <issue>` (preview) | Accepts `123`, `#123`, `owner/name#123` or a github.com issue URL. Work a GitHub issue with the team; opens a **draft** PR only after you approve at gate 2. `aiset run --help` for options; `python -m aiset.run <issue>` does the same if an older `aiset` on `PATH` opens the office instead. See the [user guide](docs/USER-GUIDE.md#work-a-github-issue-aiset-run-preview). |
|
|
144
151
|
| `teammap relevant "<task>"` | Files, symbols, endpoints, brief sections and past episodes to read first. |
|
|
145
152
|
| `teammap impact <path\|symbol\|Model> [METHOD]` | What a change can reach: consumers, models, importers, tests. Exact vs inferred. |
|
|
146
153
|
| `teammap failures <log>` | Failed tests, messages and in-repo frames from a saved test run, grouped. |
|
|
154
|
+
| `teammap outline <file>` | Imports, symbol signatures, line ranges, sizes and routes for one indexed file. |
|
|
147
155
|
| `teammap endpoint` · `model` · `arch` · `symbol` | Direct lookups. `teammap --help` lists them all. |
|
|
156
|
+
| `aiset --version` · `aiset-init --version` · `teammap --version` | Print the installed version. Doesn't start the office or touch a workspace. |
|
|
157
|
+
|
|
158
|
+
`teammap --repo NAME` uses repository names from the active roster. Unknown names and missing or non-integer numeric option values produce a usage error (exit 2); see the [user guide](docs/USER-GUIDE.md#research-tools-teammap-impact-failures-relevant) for options.
|
|
148
159
|
|
|
149
160
|
<details>
|
|
150
161
|
<summary><b>Example: what does changing an endpoint break?</b></summary>
|
|
@@ -212,6 +223,14 @@ Everything is plain Markdown and JSON in your workspace. In a monorepo, `.claude
|
|
|
212
223
|
|
|
213
224
|
## FAQ
|
|
214
225
|
|
|
226
|
+
<details>
|
|
227
|
+
<summary><b>How is this different from Claude Code subagents?</b></summary>
|
|
228
|
+
<br>
|
|
229
|
+
|
|
230
|
+
aiset is built on them. `aiset-init` writes the subagent files for you, one per repo or stack, with each agent's repos, test commands and brief. On top it adds what subagents don't have on their own: a PM that plans and verifies, memory that carries over between tasks (briefs, field notes, episodes), `teammap` research tools, and a dashboard that shows what every agent is doing and what it costs.
|
|
231
|
+
|
|
232
|
+
</details>
|
|
233
|
+
|
|
215
234
|
<details>
|
|
216
235
|
<summary><b><code>aiset-init</code> is "not recognized" after installing</b></summary>
|
|
217
236
|
<br>
|
|
@@ -256,10 +275,18 @@ The office shows one workspace at a time and prints which one at startup. Run `a
|
|
|
256
275
|
|
|
257
276
|
## Contributing
|
|
258
277
|
|
|
259
|
-
Issues and pull requests are welcome.
|
|
278
|
+
Issues and pull requests are welcome. A good place to start is an issue labeled [**good first issue**](https://github.com/JamshidS/aiset/labels/good%20first%20issue): each one names the files to change and how to test it. To work on aiset itself, clone it, `pip install -e .`, and run `make check`. [CONTRIBUTING.md](CONTRIBUTING.md) has the full workflow; report vulnerabilities privately as described in [SECURITY.md](SECURITY.md).
|
|
260
279
|
|
|
261
280
|
More docs: [User guide](docs/USER-GUIDE.md) · [Feature inventory](docs/FEATURES.md) · [Research tools](docs/RESEARCH-TOOLS.md) · [Brand assets](docs/branding/preview.html)
|
|
262
281
|
|
|
282
|
+
### Contributors
|
|
283
|
+
|
|
284
|
+
Thanks to everyone who has helped build aiset.
|
|
285
|
+
|
|
286
|
+
<a href="https://github.com/JamshidS/aiset/graphs/contributors">
|
|
287
|
+
<img src="https://contrib.rocks/image?repo=JamshidS/aiset" alt="aiset contributors">
|
|
288
|
+
</a>
|
|
289
|
+
|
|
263
290
|
<br>
|
|
264
291
|
|
|
265
292
|
<div align="center">
|
|
@@ -4,8 +4,8 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "aiset-cli"
|
|
7
|
-
version = "0.
|
|
8
|
-
description = "Turn your
|
|
7
|
+
version = "0.3.0"
|
|
8
|
+
description = "Turn your repos into a team of Claude Code agents with persistent memory, coordinated tasks, and a live dashboard."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "MIT"
|
|
11
11
|
license-files = ["LICENSE"]
|
|
@@ -37,7 +37,7 @@ Issues = "https://github.com/JamshidS/aiset/issues"
|
|
|
37
37
|
Changelog = "https://github.com/JamshidS/aiset/blob/master/CHANGELOG.md"
|
|
38
38
|
|
|
39
39
|
[project.scripts]
|
|
40
|
-
aiset = "aiset.
|
|
40
|
+
aiset = "aiset.cli:main"
|
|
41
41
|
teammap = "aiset.teammap:cli"
|
|
42
42
|
aiset-init = "aiset.init_team:main"
|
|
43
43
|
|
|
@@ -57,14 +57,17 @@ MAX_EVIDENCE = 6
|
|
|
57
57
|
DETECTORS = [
|
|
58
58
|
dict(id="postgres", label="PostgreSQL", kind="database",
|
|
59
59
|
py=["psycopg2", "psycopg2-binary", "psycopg", "asyncpg", "pg8000"], npm=["pg", "postgres", "pg-promise"], jvm=["postgresql", "r2dbc-postgresql"],
|
|
60
|
+
go=["github.com/jackc/pgx", "github.com/lib/pq", "gorm.io/driver/postgres"],
|
|
60
61
|
code=[r"postgres(?:ql)?(?:\+\w+)?://", r"\basyncpg\.(?:connect|create_pool)", r"\bpsycopg2?\.connect", r"jdbc:postgresql:"],
|
|
61
62
|
prop=[r"jdbc:postgresql:", r"database\s*=\s*postgres", r"PostgreSQL\w*Dialect"], env=[r"^(POSTGRES|PG)_?[A-Z_]*$", r"DATABASE_URL$"], image=[r"postgres|postgis|timescale"]),
|
|
62
63
|
dict(id="mysql", label="MySQL", kind="database", py=["pymysql", "mysqlclient", "aiomysql"], npm=["mysql", "mysql2"],
|
|
63
64
|
jvm=["mysql-connector-java", "mysql-connector-j", "mariadb-java-client"],
|
|
65
|
+
go=["github.com/go-sql-driver/mysql", "gorm.io/driver/mysql"],
|
|
64
66
|
code=[r"mysql(?:\+\w+)?://", r"jdbc:mysql:"], prop=[r"jdbc:mysql:", r"database\s*=\s*mysql", r"MySQL\w*Dialect", r"com\.mysql\."],
|
|
65
67
|
env=[r"^MYSQL_"], image=[r"mysql|mariadb"]),
|
|
66
68
|
dict(id="mongodb", label="MongoDB", kind="database", py=["pymongo", "motor", "mongoengine", "flask-pymongo", "mongoalchemy", "flask-mongoalchemy"],
|
|
67
69
|
npm=["mongodb", "mongoose", "@nestjs/mongoose", "winston-mongodb"], jvm=["spring-boot-starter-data-mongodb", "mongodb-driver", "mongodb-driver-sync", "mongo-java-driver"],
|
|
70
|
+
go=["go.mongodb.org/mongo-driver"],
|
|
68
71
|
code=[r"mongodb(?:\+srv)?://", r"\bMongo(?:Template|Repository|Client)\b", r"\bmongoose\.(?:connect|model|Schema)\b"],
|
|
69
72
|
prop=[r"^spring\.data\.mongodb\.", r"mongodb://"], env=[r"^MONGO"], image=[r"mongo"]),
|
|
70
73
|
dict(id="cassandra", label="Cassandra", kind="database", py=["cassandra-driver"], npm=["cassandra-driver"],
|
|
@@ -75,17 +78,20 @@ DETECTORS = [
|
|
|
75
78
|
code=[r"sqlite(?:\+\w+)?:///", r"\bsqlite3\.connect"], prop=[r"jdbc:sqlite:"], env=[], image=[]),
|
|
76
79
|
dict(id="redis", label="Redis", kind="cache", py=["redis", "aioredis", "redis-py-cluster", "flask-redis"], npm=["redis", "ioredis"],
|
|
77
80
|
jvm=["spring-boot-starter-data-redis", "spring-data-redis", "jedis", "lettuce-core", "redisson"],
|
|
81
|
+
go=["github.com/redis/go-redis", "github.com/go-redis/redis"],
|
|
78
82
|
code=[r"redis(?:s)?://", r"^\s*(?:import|from)\s+(?:redis|aioredis)\b", r"\bRedis\(", r"\b(?:RedisTemplate|StringRedisTemplate|Jedis(?:Pool)?)\b"],
|
|
79
83
|
prop=[r"^spring\.(?:data\.)?redis\."], env=[r"^REDIS"], image=[r"redis|valkey"]),
|
|
80
84
|
dict(id="celery", label="Celery", kind="worker", py=["celery"], npm=[], jvm=[], only=(".py",),
|
|
81
85
|
code=[r"\bCelery\(", r"@(?:shared_task|\w+\.task)\b", r"\.delay\(|\.apply_async\("], prop=[], env=[r"^CELERY"], image=[]),
|
|
82
86
|
dict(id="rabbitmq", label="RabbitMQ", kind="broker", py=["pika", "aio-pika", "kombu", "amqp", "aiormq"],
|
|
83
87
|
npm=["amqplib", "amqp-connection-manager", "amqplib-as-promised", "@golevelup/nestjs-rabbitmq"], jvm=["spring-rabbit", "spring-boot-starter-amqp", "amqp-client"],
|
|
88
|
+
go=["github.com/rabbitmq/amqp091-go", "github.com/streadway/amqp"],
|
|
84
89
|
code=[r"amqps?://", r"^\s*(?:import|from)\s+(?:pika|aio_pika|kombu)\b", r"\bbasic_(?:publish|consume)\b", r"\b(?:RabbitTemplate|AmqpTemplate)\b|@RabbitListener",
|
|
85
90
|
r"\bamqp\.connect\(|require\(['\"]amqplib"],
|
|
86
91
|
prop=[r"^spring\.rabbitmq\."], env=[r"^RABBIT", r"^AMQP"], image=[r"rabbitmq"]),
|
|
87
92
|
dict(id="kafka", label="Kafka", kind="broker", py=["kafka-python", "aiokafka", "confluent-kafka"], npm=["kafkajs", "node-rdkafka"],
|
|
88
93
|
jvm=["spring-kafka", "kafka-clients", "kafka-streams"],
|
|
94
|
+
go=["github.com/segmentio/kafka-go", "github.com/IBM/sarama", "github.com/Shopify/sarama", "github.com/confluentinc/confluent-kafka-go"],
|
|
89
95
|
code=[r"^\s*(?:import|from)\s+(?:kafka|aiokafka|confluent_kafka)\b", r"\bKafka(?:Producer|Consumer|Template)\b|@KafkaListener", r"new Kafka\("],
|
|
90
96
|
prop=[r"^spring\.kafka\.", r"bootstrap[.-]servers"], env=[r"^KAFKA"], image=[r"kafka|redpanda"]),
|
|
91
97
|
dict(id="mqtt", label="MQTT", kind="broker", py=["paho-mqtt", "asyncio-mqtt", "gmqtt"], npm=["mqtt", "async-mqtt"],
|
|
@@ -140,6 +146,10 @@ FRAMEWORKS_JVM = [("spring-cloud-starter-zuul", "Zuul gateway", "gateway"), ("sp
|
|
|
140
146
|
("spring-boot-starter-web", "Spring Boot", "api"), ("spring-boot-starter-webflux", "Spring Boot (WebFlux)", "api"),
|
|
141
147
|
("ktor-server-core", "Ktor", "api"), ("quarkus-core", "Quarkus", "api"), ("micronaut-http-server", "Micronaut", "api"),
|
|
142
148
|
("spring-boot-starter", "Spring Boot", "service")]
|
|
149
|
+
# Go module paths without a /vN major suffix (_deps strips it), so echo/v5 or fiber/v3 match too
|
|
150
|
+
FRAMEWORKS_GO = [("github.com/gin-gonic/gin", "Gin", "api"), ("github.com/labstack/echo", "Echo", "api"),
|
|
151
|
+
("github.com/go-chi/chi", "Chi", "api"), ("github.com/gofiber/fiber", "Fiber", "api"),
|
|
152
|
+
("github.com/gorilla/mux", "Gorilla Mux", "api"), ("github.com/kataras/iris", "Iris", "api")]
|
|
143
153
|
CODE_ROLE = [(r"@EnableZuulProxy", "Zuul gateway", "gateway"), (r"@EnableEurekaServer", "Eureka server", "registry"),
|
|
144
154
|
(r"@EnableConfigServer", "Config server", "registry")]
|
|
145
155
|
# libraries worth naming on a repo card
|
|
@@ -232,10 +242,10 @@ def _walk(repo_path):
|
|
|
232
242
|
|
|
233
243
|
|
|
234
244
|
def _deps(repo_path, files):
|
|
235
|
-
"""Python, npm and
|
|
236
|
-
py, npm, jvm = {}, {}, {}
|
|
245
|
+
"""Python, npm, JVM and Go dependency names, each with where it was declared."""
|
|
246
|
+
py, npm, jvm, go = {}, {}, {}, {}
|
|
237
247
|
for path, f in files:
|
|
238
|
-
rel = os.path.relpath(path, repo_path)
|
|
248
|
+
rel = os.path.relpath(path, repo_path).replace(os.sep, "/")
|
|
239
249
|
if re.match(r"requirements.*\.txt$", f):
|
|
240
250
|
for i, line in enumerate(_read(path).splitlines(), 1):
|
|
241
251
|
m = re.match(r"\s*([A-Za-z0-9_.\-\[\]]+)", line)
|
|
@@ -243,7 +253,7 @@ def _deps(repo_path, files):
|
|
|
243
253
|
py.setdefault(re.sub(r"\[.*\]", "", m.group(1)).lower().replace("_", "-"), (rel, i, line.strip()))
|
|
244
254
|
elif f in ("pyproject.toml", "environment.yml", "Pipfile"):
|
|
245
255
|
for i, line in enumerate(_read(path).splitlines(), 1):
|
|
246
|
-
for m in re.finditer(r"(?:^|[\"'\s-])([A-Za-z][A-Za-z0-9_.\-]+)
|
|
256
|
+
for m in re.finditer(r"(?:^|[\"'\s-])([A-Za-z][A-Za-z0-9_.\-]+)(?:\[[^\]]*\])?\s*(?:[<>=~^!]=?|\s*=\s*[\"'{]|[\"'])", line):
|
|
247
257
|
name = m.group(1).lower().replace("_", "-")
|
|
248
258
|
if len(name) > 1 and name not in ("python", "name", "version", "description", "readme", "license", "requires"):
|
|
249
259
|
py.setdefault(name, (rel, i, line.strip()))
|
|
@@ -268,7 +278,25 @@ def _deps(repo_path, files):
|
|
|
268
278
|
for i, line in enumerate(_read(path).splitlines(), 1):
|
|
269
279
|
for m in re.finditer(r"['\"]([\w.\-]+):([\w.\-]+)(?::[^'\"]*)?['\"]", line):
|
|
270
280
|
jvm.setdefault(m.group(2), (rel, i, line.strip()))
|
|
271
|
-
|
|
281
|
+
elif f == "go.mod":
|
|
282
|
+
# direct requirements only: `// indirect` ones are transitive, replace/exclude blocks are skipped
|
|
283
|
+
block = None
|
|
284
|
+
for i, line in enumerate(_read(path).splitlines(), 1):
|
|
285
|
+
code, _, comment = line.partition("//")
|
|
286
|
+
words = code.split()
|
|
287
|
+
if not words:
|
|
288
|
+
continue
|
|
289
|
+
if block:
|
|
290
|
+
if words == [")"]:
|
|
291
|
+
block = None
|
|
292
|
+
continue
|
|
293
|
+
words = [block, *words]
|
|
294
|
+
elif words[-1].endswith("("):
|
|
295
|
+
block = words[0].rstrip("(")
|
|
296
|
+
continue
|
|
297
|
+
if words[0] == "require" and len(words) >= 3 and comment.strip() != "indirect":
|
|
298
|
+
go.setdefault(re.sub(r"/v\d+$", "", words[1]), (rel, i, line.strip()))
|
|
299
|
+
return py, npm, jvm, go
|
|
272
300
|
|
|
273
301
|
|
|
274
302
|
def _spring_props(text, yml):
|
|
@@ -315,13 +343,13 @@ SPRING_CONF = re.compile(r"^(?:application|bootstrap)(?:-[\w.-]+)?\.(ya?ml|prope
|
|
|
315
343
|
def scan_repo(name):
|
|
316
344
|
path = os.path.join(CODE_ROOT, name)
|
|
317
345
|
files = list(_walk(path))
|
|
318
|
-
py, npm, jvm = _deps(path, files)
|
|
346
|
+
py, npm, jvm, go = _deps(path, files)
|
|
319
347
|
langs, envs, code_hits, entry, deploy, images, clients, props = {}, {}, {}, [], [], {}, {}, []
|
|
320
348
|
links, aliases, role = [], {name}, None # links: (kind, target name, rel, line, text)
|
|
321
349
|
detectors = [(d, [re.compile(p, re.M) for p in d["code"]]) for d in DETECTORS]
|
|
322
350
|
has_dags = False
|
|
323
351
|
for full, f in files:
|
|
324
|
-
rel = os.path.relpath(full, path)
|
|
352
|
+
rel = os.path.relpath(full, path).replace(os.sep, "/")
|
|
325
353
|
ext = os.path.splitext(f)[1].lower()
|
|
326
354
|
if f.startswith(".env") and not f.endswith((".example", ".sample")) or "/secrets/" in "/" + rel:
|
|
327
355
|
continue
|
|
@@ -453,7 +481,8 @@ def scan_repo(name):
|
|
|
453
481
|
# ---- profile ----
|
|
454
482
|
fw = next(((label, kind) for key, label, kind in FRAMEWORKS_NPM if key in npm), None) or \
|
|
455
483
|
next(((label, kind) for key, label, kind in FRAMEWORKS_JVM if key in jvm), None) or \
|
|
456
|
-
next(((label, kind) for key, label, kind in FRAMEWORKS_PY if key in py), None)
|
|
484
|
+
next(((label, kind) for key, label, kind in FRAMEWORKS_PY if key in py), None) or \
|
|
485
|
+
next(((label, kind) for key, label, kind in FRAMEWORKS_GO if key in go), None)
|
|
457
486
|
if role: # @EnableZuulProxy / @EnableEurekaServer say more than the starters
|
|
458
487
|
fw = role
|
|
459
488
|
total = sum(l["bytes"] for l in langs.values()) or 1
|
|
@@ -465,7 +494,7 @@ def scan_repo(name):
|
|
|
465
494
|
for d in DETECTORS:
|
|
466
495
|
ev = []
|
|
467
496
|
dep = next(((n, py[n]) for n in d["py"] if n in py), None) or next(((n, npm[n]) for n in d["npm"] if n in npm), None) \
|
|
468
|
-
or next(((n, jvm[n]) for n in d.get("jvm", []) if n in jvm), None)
|
|
497
|
+
or next(((n, jvm[n]) for n in d.get("jvm", []) if n in jvm), None) or next(((n, go[n]) for n in d.get("go", []) if n in go), None)
|
|
469
498
|
if dep:
|
|
470
499
|
ev.append({"type": "dependency", "file": dep[1][0], "line": dep[1][1], "text": mask(dep[1][2])})
|
|
471
500
|
for rel, i, line in code_hits.get(d["id"], [])[:MAX_EVIDENCE]:
|
|
@@ -676,7 +705,7 @@ def fingerprint():
|
|
|
676
705
|
try:
|
|
677
706
|
h.update(str(os.path.getmtime(os.path.join(HERE, mod))).encode())
|
|
678
707
|
except OSError:
|
|
679
|
-
pass
|
|
708
|
+
pass # an installed package may not ship the module; its absence is part of the fingerprint
|
|
680
709
|
for name in repo_dirs():
|
|
681
710
|
for full, _ in _walk(os.path.join(CODE_ROOT, name)):
|
|
682
711
|
try:
|
|
@@ -697,7 +726,7 @@ def cached(force=False):
|
|
|
697
726
|
if data.get("fingerprint") == fp:
|
|
698
727
|
return data
|
|
699
728
|
except (OSError, ValueError):
|
|
700
|
-
pass
|
|
729
|
+
pass # no usable cache: build the map again
|
|
701
730
|
data = build()
|
|
702
731
|
data["fingerprint"] = fp
|
|
703
732
|
try:
|
|
@@ -705,7 +734,7 @@ def cached(force=False):
|
|
|
705
734
|
with open(CACHE_FILE, "w", encoding="utf-8") as f:
|
|
706
735
|
json.dump(data, f)
|
|
707
736
|
except OSError:
|
|
708
|
-
pass
|
|
737
|
+
pass # a read-only workspace still gets the map, just without the cache
|
|
709
738
|
return data
|
|
710
739
|
|
|
711
740
|
|
|
@@ -900,6 +929,12 @@ def main(argv):
|
|
|
900
929
|
print(" → ".join([hops[0]["from"]] + [_name(data, h["to"]) for h in hops]) if hops else ends[0])
|
|
901
930
|
for h in hops:
|
|
902
931
|
print(f" {h['from']} → {_name(data, h['to'])} · {h['label']} ({h['confidence']}){_where(h)}")
|
|
932
|
+
elif rest[:1] == ["impact"]:
|
|
933
|
+
print("usage: teammap arch impact <service>")
|
|
934
|
+
return 2
|
|
935
|
+
elif rest[:1] == ["path"]:
|
|
936
|
+
print("usage: teammap arch path <from> <to>")
|
|
937
|
+
return 2
|
|
903
938
|
elif as_json:
|
|
904
939
|
if rest:
|
|
905
940
|
kind, item = resolve(data, rest[0])
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"""Small helpers for replacing text files without exposing partial writes."""
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
import secrets
|
|
5
|
+
import stat
|
|
6
|
+
import time
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def _open_temporary(directory):
|
|
10
|
+
flags = os.O_WRONLY | os.O_CREAT | os.O_EXCL | getattr(os, "O_BINARY", 0)
|
|
11
|
+
for _ in range(10):
|
|
12
|
+
temporary = os.path.join(directory, f".aiset-{secrets.token_hex(16)}.tmp")
|
|
13
|
+
try:
|
|
14
|
+
return os.open(temporary, flags, 0o666), temporary
|
|
15
|
+
except FileExistsError:
|
|
16
|
+
continue
|
|
17
|
+
raise FileExistsError(f"could not create a unique temporary file in {directory!r}")
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def _replace_with_retry(temporary, target):
|
|
21
|
+
for attempt in range(4):
|
|
22
|
+
try:
|
|
23
|
+
os.replace(temporary, target)
|
|
24
|
+
return
|
|
25
|
+
except PermissionError:
|
|
26
|
+
if os.name != "nt" or attempt == 3:
|
|
27
|
+
raise
|
|
28
|
+
time.sleep(0.05)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def write_text_atomic(path, text, *, encoding="utf-8", errors="strict", newline=None):
|
|
32
|
+
"""Write text beside its destination, then atomically replace the destination.
|
|
33
|
+
|
|
34
|
+
The temporary file is removed if writing or replacement fails. Existing POSIX
|
|
35
|
+
permission bits are retained; new files use mode 0666 filtered by the active umask.
|
|
36
|
+
"""
|
|
37
|
+
target = os.path.realpath(os.fspath(path))
|
|
38
|
+
directory = os.path.dirname(target)
|
|
39
|
+
try:
|
|
40
|
+
existing_mode = stat.S_IMODE(os.stat(target).st_mode)
|
|
41
|
+
except FileNotFoundError:
|
|
42
|
+
existing_mode = None
|
|
43
|
+
|
|
44
|
+
fd, temporary = _open_temporary(directory)
|
|
45
|
+
try:
|
|
46
|
+
stream = os.fdopen(fd, "w", encoding=encoding, errors=errors, newline=newline)
|
|
47
|
+
fd = None
|
|
48
|
+
with stream as f:
|
|
49
|
+
f.write(text)
|
|
50
|
+
if existing_mode is not None and os.name != "nt":
|
|
51
|
+
os.chmod(temporary, existing_mode)
|
|
52
|
+
_replace_with_retry(temporary, target)
|
|
53
|
+
temporary = None
|
|
54
|
+
finally:
|
|
55
|
+
if fd is not None:
|
|
56
|
+
os.close(fd)
|
|
57
|
+
if temporary is not None:
|
|
58
|
+
try:
|
|
59
|
+
os.unlink(temporary)
|
|
60
|
+
except FileNotFoundError:
|
|
61
|
+
pass
|
|
@@ -20,10 +20,23 @@ from .workspace import CODE_ROOT, EPISODES, GRAPHS, KNOWLEDGE, norm, relative, r
|
|
|
20
20
|
EPISODE_FIELDS = ("TASK", "DATE", "AGENTS", "OUTCOME", "TOUCHED", "CONTRACT", "DECISIONS", "GOTCHAS", "COST")
|
|
21
21
|
|
|
22
22
|
|
|
23
|
+
def _json_files(directory):
|
|
24
|
+
"""Sorted JSON files, including hidden names produced by the root unit."""
|
|
25
|
+
try:
|
|
26
|
+
with os.scandir(directory) as entries:
|
|
27
|
+
return sorted(
|
|
28
|
+
entry.path
|
|
29
|
+
for entry in entries
|
|
30
|
+
if entry.name.endswith(".json") and entry.is_file()
|
|
31
|
+
)
|
|
32
|
+
except OSError:
|
|
33
|
+
return []
|
|
34
|
+
|
|
35
|
+
|
|
23
36
|
def brief_sections(filename):
|
|
24
37
|
"""[(level, title, first line, text)] for the ## and ### headings of a brief."""
|
|
25
38
|
try:
|
|
26
|
-
with open(os.path.join(KNOWLEDGE, filename), encoding="utf-8") as f:
|
|
39
|
+
with open(os.path.join(KNOWLEDGE, filename), encoding="utf-8", errors="replace") as f:
|
|
27
40
|
lines = f.read().splitlines()
|
|
28
41
|
except OSError:
|
|
29
42
|
return []
|
|
@@ -43,7 +56,7 @@ def read_episodes():
|
|
|
43
56
|
if os.path.basename(path) == "index.md":
|
|
44
57
|
continue
|
|
45
58
|
try:
|
|
46
|
-
with open(path, encoding="utf-8") as f:
|
|
59
|
+
with open(path, encoding="utf-8", errors="replace") as f:
|
|
47
60
|
text = f.read()
|
|
48
61
|
except OSError:
|
|
49
62
|
continue
|
|
@@ -181,7 +194,7 @@ def build(office, roster):
|
|
|
181
194
|
|
|
182
195
|
# -- external code graphs ---------------------------------------------------------
|
|
183
196
|
tree_code = []
|
|
184
|
-
for path in
|
|
197
|
+
for path in _json_files(GRAPHS):
|
|
185
198
|
try:
|
|
186
199
|
with open(path, encoding="utf-8") as f:
|
|
187
200
|
g = json.load(f)
|
|
@@ -279,7 +292,7 @@ def _cached(key, stamp, make):
|
|
|
279
292
|
|
|
280
293
|
def _graph_nodes():
|
|
281
294
|
"""Endpoint/model/file nodes from the code graphs, for resolving teammap queries."""
|
|
282
|
-
files =
|
|
295
|
+
files = _json_files(GRAPHS)
|
|
283
296
|
stamp = tuple(os.path.getmtime(f) for f in files)
|
|
284
297
|
|
|
285
298
|
def make():
|
|
@@ -291,14 +304,14 @@ def _graph_nodes():
|
|
|
291
304
|
if n.get("type") in out:
|
|
292
305
|
out[n["type"]].append(n)
|
|
293
306
|
except (OSError, ValueError):
|
|
294
|
-
pass
|
|
307
|
+
pass # a graph file being rewritten or invalid: skip it this round
|
|
295
308
|
return out
|
|
296
309
|
return _cached("graph", stamp, make)
|
|
297
310
|
|
|
298
311
|
|
|
299
312
|
def _symbol_files():
|
|
300
313
|
"""symbol name -> [(repo, rel)] from teammap's index, refreshed when the index changes."""
|
|
301
|
-
files =
|
|
314
|
+
files = _json_files(os.path.join(GRAPHS, "index"))
|
|
302
315
|
stamp = tuple(os.path.getmtime(f) for f in files)
|
|
303
316
|
|
|
304
317
|
def make():
|
|
@@ -26,7 +26,7 @@ def index_path(brief):
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
def build(brief):
|
|
29
|
-
with open(brief, encoding="utf-8") as f:
|
|
29
|
+
with open(brief, encoding="utf-8", errors="replace") as f:
|
|
30
30
|
lines = f.read().splitlines()
|
|
31
31
|
heads = [(i + 1, len(m.group(1)), m.group(2).strip())
|
|
32
32
|
for i, l in enumerate(lines) if (m := re.match(r"^(##|###) (.+)", l))]
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"""The `aiset` command: `aiset run <issue> ...` works a GitHub issue (aiset.run); anything else starts the office.
|
|
2
|
+
|
|
3
|
+
server.py settles the workspace from sys.argv when it's imported, so `run` is dispatched before it is.
|
|
4
|
+
The office takes no positional arguments, so `run` can't be mistaken for one of its options.
|
|
5
|
+
"""
|
|
6
|
+
import os
|
|
7
|
+
import sys
|
|
8
|
+
|
|
9
|
+
if __name__ == "__main__" and not __package__: # run as a file: python src/aiset/cli.py
|
|
10
|
+
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
|
|
11
|
+
__package__ = "aiset"
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def main():
|
|
15
|
+
if len(sys.argv) > 1 and sys.argv[1] == "run":
|
|
16
|
+
from .run.cli import main as run_main
|
|
17
|
+
return run_main(sys.argv[2:])
|
|
18
|
+
from .server import main as serve
|
|
19
|
+
serve()
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
if __name__ == "__main__":
|
|
23
|
+
sys.exit(main())
|