devflow-toolkit 0.3.5__py3-none-any.whl → 0.3.7__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.
- devflow/adapters/agents.py +3 -0
- devflow/adapters/claude_code.py +18 -3
- devflow/adapters/codex.py +11 -3
- devflow/adapters/instructions.py +95 -0
- devflow/adapters/kiro.py +16 -0
- devflow/adapters/opencode.py +16 -0
- devflow/cli.py +1 -1
- devflow/commands/approve.py +1 -1
- devflow/core/project.py +132 -9
- devflow/profiles/ai-rag/profile.yaml +3 -0
- {devflow_toolkit-0.3.5.dist-info → devflow_toolkit-0.3.7.dist-info}/METADATA +29 -7
- {devflow_toolkit-0.3.5.dist-info → devflow_toolkit-0.3.7.dist-info}/RECORD +15 -15
- {devflow_toolkit-0.3.5.dist-info → devflow_toolkit-0.3.7.dist-info}/WHEEL +0 -0
- {devflow_toolkit-0.3.5.dist-info → devflow_toolkit-0.3.7.dist-info}/entry_points.txt +0 -0
- {devflow_toolkit-0.3.5.dist-info → devflow_toolkit-0.3.7.dist-info}/licenses/LICENSE +0 -0
devflow/adapters/agents.py
CHANGED
|
@@ -8,6 +8,7 @@ from pathlib import Path
|
|
|
8
8
|
from devflow.adapters.instructions import (
|
|
9
9
|
MANAGED_MARKER as _MANAGED_MARKER,
|
|
10
10
|
render_agent_instructions,
|
|
11
|
+
write_gitignore_entries,
|
|
11
12
|
write_text_managed,
|
|
12
13
|
)
|
|
13
14
|
from devflow.core.config import DevFlowConfig
|
|
@@ -46,4 +47,6 @@ class AgentsFileWriter:
|
|
|
46
47
|
def write(self, root: Path, content: str) -> AgentsWriteResult:
|
|
47
48
|
"""Write AGENTS.md without overwriting unmanaged user content."""
|
|
48
49
|
result = write_text_managed(root / "AGENTS.md", content, root=root)
|
|
50
|
+
if result.status != "skipped":
|
|
51
|
+
write_gitignore_entries(root, ("AGENTS.md",))
|
|
49
52
|
return AgentsWriteResult(path=result.path, status=result.status)
|
devflow/adapters/claude_code.py
CHANGED
|
@@ -14,6 +14,7 @@ from devflow.adapters.base import (
|
|
|
14
14
|
)
|
|
15
15
|
from devflow.adapters.instructions import (
|
|
16
16
|
render_agent_instructions,
|
|
17
|
+
write_gitignore_entries,
|
|
17
18
|
write_text_managed,
|
|
18
19
|
)
|
|
19
20
|
|
|
@@ -38,9 +39,16 @@ class ClaudeCodeAdapter(HarnessAdapter):
|
|
|
38
39
|
content,
|
|
39
40
|
root=context.root,
|
|
40
41
|
)
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
changes = [FileChange(path=result.path, status=result.status)]
|
|
43
|
+
if result.status != "skipped":
|
|
44
|
+
ignored = write_gitignore_entries(
|
|
45
|
+
context.root,
|
|
46
|
+
("CLAUDE.md",),
|
|
47
|
+
)
|
|
48
|
+
changes.append(
|
|
49
|
+
FileChange(path=ignored.path, status=ignored.status)
|
|
50
|
+
)
|
|
51
|
+
return SetupResult(changes=tuple(changes))
|
|
44
52
|
|
|
45
53
|
def build_run(self, context: RunContext) -> Invocation:
|
|
46
54
|
settings = json.dumps(
|
|
@@ -54,6 +62,8 @@ class ClaudeCodeAdapter(HarnessAdapter):
|
|
|
54
62
|
self.executable,
|
|
55
63
|
"--permission-mode",
|
|
56
64
|
"dontAsk",
|
|
65
|
+
"--allowedTools",
|
|
66
|
+
"AskUserQuestion",
|
|
57
67
|
"--settings",
|
|
58
68
|
settings,
|
|
59
69
|
context.prompt,
|
|
@@ -108,6 +118,11 @@ class ClaudeCodeAdapter(HarnessAdapter):
|
|
|
108
118
|
if context.permissions.allow_project_read:
|
|
109
119
|
allow.extend(["Read", "Grep", "Glob"])
|
|
110
120
|
|
|
121
|
+
if context.mode == "interactive":
|
|
122
|
+
# Discovery needs to ask the user directly. ``dontAsk`` denies
|
|
123
|
+
# every prompt unless the tool is explicitly allowed.
|
|
124
|
+
allow.append("AskUserQuestion")
|
|
125
|
+
|
|
111
126
|
if context.permissions.allow_source_code_changes:
|
|
112
127
|
allow.extend(["Edit", "Bash"])
|
|
113
128
|
elif context.permissions.allow_spec_write:
|
devflow/adapters/codex.py
CHANGED
|
@@ -12,6 +12,7 @@ from devflow.adapters.base import (
|
|
|
12
12
|
)
|
|
13
13
|
from devflow.adapters.instructions import (
|
|
14
14
|
render_agent_instructions,
|
|
15
|
+
write_gitignore_entries,
|
|
15
16
|
write_text_managed,
|
|
16
17
|
)
|
|
17
18
|
|
|
@@ -35,9 +36,16 @@ class CodexAdapter(HarnessAdapter):
|
|
|
35
36
|
content,
|
|
36
37
|
root=context.root,
|
|
37
38
|
)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
changes = [FileChange(path=result.path, status=result.status)]
|
|
40
|
+
if result.status != "skipped":
|
|
41
|
+
ignored = write_gitignore_entries(
|
|
42
|
+
context.root,
|
|
43
|
+
("AGENTS.md",),
|
|
44
|
+
)
|
|
45
|
+
changes.append(
|
|
46
|
+
FileChange(path=ignored.path, status=ignored.status)
|
|
47
|
+
)
|
|
48
|
+
return SetupResult(changes=tuple(changes))
|
|
41
49
|
|
|
42
50
|
def build_run(self, context: RunContext) -> Invocation:
|
|
43
51
|
root = context.root
|
devflow/adapters/instructions.py
CHANGED
|
@@ -6,6 +6,7 @@ import json
|
|
|
6
6
|
import os
|
|
7
7
|
import stat
|
|
8
8
|
import tempfile
|
|
9
|
+
from collections.abc import Sequence
|
|
9
10
|
from dataclasses import dataclass
|
|
10
11
|
from pathlib import Path
|
|
11
12
|
from typing import Any
|
|
@@ -15,6 +16,8 @@ from devflow.models.profile import Profile
|
|
|
15
16
|
from devflow.models.project import Project
|
|
16
17
|
|
|
17
18
|
MANAGED_MARKER = "<!-- devflow:managed -->"
|
|
19
|
+
GITIGNORE_BEGIN = "# devflow:managed:begin"
|
|
20
|
+
GITIGNORE_END = "# devflow:managed:end"
|
|
18
21
|
|
|
19
22
|
|
|
20
23
|
class ManagedWriteError(OSError):
|
|
@@ -261,3 +264,95 @@ def write_json_if_missing(
|
|
|
261
264
|
target = _managed_path(root, target)
|
|
262
265
|
_write_atomic(target, json.dumps(data, indent=2) + "\n")
|
|
263
266
|
return ManagedWriteResult(path=target, status="created")
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
def _normalize_gitignore_entries(entries: Sequence[str]) -> list[str]:
|
|
270
|
+
"""Return unique, root-anchored ignore patterns."""
|
|
271
|
+
normalized: list[str] = []
|
|
272
|
+
for entry in entries:
|
|
273
|
+
value = str(entry).strip()
|
|
274
|
+
if not value or value.startswith("#"):
|
|
275
|
+
continue
|
|
276
|
+
if not value.startswith("/"):
|
|
277
|
+
value = f"/{value}"
|
|
278
|
+
if value not in normalized:
|
|
279
|
+
normalized.append(value)
|
|
280
|
+
return normalized
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
def _render_gitignore_block(entries: Sequence[str]) -> str:
|
|
284
|
+
"""Render the managed .gitignore block."""
|
|
285
|
+
lines = [
|
|
286
|
+
GITIGNORE_BEGIN,
|
|
287
|
+
"# Generated by DevFlow for agent harness integration.",
|
|
288
|
+
*entries,
|
|
289
|
+
GITIGNORE_END,
|
|
290
|
+
]
|
|
291
|
+
return "\n".join(lines) + "\n"
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
def write_gitignore_entries(
|
|
295
|
+
root: Path,
|
|
296
|
+
entries: Sequence[str],
|
|
297
|
+
) -> ManagedWriteResult:
|
|
298
|
+
"""Ignore DevFlow-generated harness files inside a managed block.
|
|
299
|
+
|
|
300
|
+
Existing user entries are preserved. Patterns already inside the
|
|
301
|
+
managed block are kept when the selected harness changes.
|
|
302
|
+
"""
|
|
303
|
+
path = root / ".gitignore"
|
|
304
|
+
desired = _normalize_gitignore_entries(entries)
|
|
305
|
+
if not desired:
|
|
306
|
+
return ManagedWriteResult(path=path, status="skipped")
|
|
307
|
+
if path.is_symlink():
|
|
308
|
+
return ManagedWriteResult(path=path, status="skipped")
|
|
309
|
+
|
|
310
|
+
target = _managed_path(root, path)
|
|
311
|
+
if not target.exists():
|
|
312
|
+
target.parent.mkdir(parents=True, exist_ok=True)
|
|
313
|
+
_write_atomic(target, _render_gitignore_block(desired))
|
|
314
|
+
return ManagedWriteResult(path=target, status="created")
|
|
315
|
+
|
|
316
|
+
try:
|
|
317
|
+
existing = target.read_text(encoding="utf-8")
|
|
318
|
+
except OSError:
|
|
319
|
+
return ManagedWriteResult(path=target, status="skipped")
|
|
320
|
+
|
|
321
|
+
begin = existing.find(GITIGNORE_BEGIN)
|
|
322
|
+
end = existing.find(GITIGNORE_END)
|
|
323
|
+
if begin == -1 and end == -1:
|
|
324
|
+
prefix = existing
|
|
325
|
+
if prefix and not prefix.endswith("\n"):
|
|
326
|
+
prefix += "\n"
|
|
327
|
+
if prefix:
|
|
328
|
+
prefix += "\n"
|
|
329
|
+
updated = prefix + _render_gitignore_block(desired)
|
|
330
|
+
elif begin == -1 or end == -1 or end < begin:
|
|
331
|
+
return ManagedWriteResult(path=target, status="skipped")
|
|
332
|
+
else:
|
|
333
|
+
current = existing[
|
|
334
|
+
begin + len(GITIGNORE_BEGIN) : end
|
|
335
|
+
].splitlines()
|
|
336
|
+
merged = _normalize_gitignore_entries(
|
|
337
|
+
[
|
|
338
|
+
line
|
|
339
|
+
for line in current
|
|
340
|
+
if line.strip() and not line.strip().startswith("#")
|
|
341
|
+
]
|
|
342
|
+
+ desired
|
|
343
|
+
)
|
|
344
|
+
suffix = existing[end + len(GITIGNORE_END) :]
|
|
345
|
+
if suffix.startswith("\r\n"):
|
|
346
|
+
suffix = suffix[2:]
|
|
347
|
+
elif suffix.startswith("\n"):
|
|
348
|
+
suffix = suffix[1:]
|
|
349
|
+
updated = (
|
|
350
|
+
existing[:begin]
|
|
351
|
+
+ _render_gitignore_block(merged)
|
|
352
|
+
+ suffix
|
|
353
|
+
)
|
|
354
|
+
|
|
355
|
+
if updated == existing:
|
|
356
|
+
return ManagedWriteResult(path=target, status="unchanged")
|
|
357
|
+
_write_atomic(target, updated)
|
|
358
|
+
return ManagedWriteResult(path=target, status="updated")
|
devflow/adapters/kiro.py
CHANGED
|
@@ -13,6 +13,7 @@ from devflow.adapters.base import (
|
|
|
13
13
|
from devflow.adapters.instructions import (
|
|
14
14
|
MANAGED_MARKER,
|
|
15
15
|
render_agent_instructions,
|
|
16
|
+
write_gitignore_entries,
|
|
16
17
|
write_json_managed,
|
|
17
18
|
write_text_managed,
|
|
18
19
|
)
|
|
@@ -31,6 +32,7 @@ class KiroAdapter(HarnessAdapter):
|
|
|
31
32
|
def setup(self, context: SetupContext) -> SetupResult:
|
|
32
33
|
changes: list[FileChange] = []
|
|
33
34
|
warnings: list[str] = []
|
|
35
|
+
ignored: list[str] = []
|
|
34
36
|
|
|
35
37
|
steering = context.root / ".kiro" / "steering"
|
|
36
38
|
for document in context.constitution.documents:
|
|
@@ -41,6 +43,8 @@ class KiroAdapter(HarnessAdapter):
|
|
|
41
43
|
root=context.root,
|
|
42
44
|
)
|
|
43
45
|
changes.append(FileChange(path=result.path, status=result.status))
|
|
46
|
+
if result.status != "skipped":
|
|
47
|
+
ignored.append(f".kiro/steering/devflow-{document.name}")
|
|
44
48
|
if result.status == "skipped":
|
|
45
49
|
warnings.append(
|
|
46
50
|
f"Kiro steering file {result.path.relative_to(context.root)} "
|
|
@@ -64,6 +68,8 @@ class KiroAdapter(HarnessAdapter):
|
|
|
64
68
|
status=workflow_result.status,
|
|
65
69
|
)
|
|
66
70
|
)
|
|
71
|
+
if workflow_result.status != "skipped":
|
|
72
|
+
ignored.append(".kiro/steering/devflow-spec-workflow.md")
|
|
67
73
|
|
|
68
74
|
agents = context.root / ".kiro" / "agents"
|
|
69
75
|
interactive = write_json_managed(
|
|
@@ -94,6 +100,16 @@ class KiroAdapter(HarnessAdapter):
|
|
|
94
100
|
"and was left untouched."
|
|
95
101
|
)
|
|
96
102
|
|
|
103
|
+
if interactive.status != "skipped":
|
|
104
|
+
ignored.append(f".kiro/agents/{INTERACTIVE_AGENT}.json")
|
|
105
|
+
if readonly.status != "skipped":
|
|
106
|
+
ignored.append(f".kiro/agents/{READONLY_AGENT}.json")
|
|
107
|
+
if ignored:
|
|
108
|
+
gitignore = write_gitignore_entries(context.root, ignored)
|
|
109
|
+
changes.append(
|
|
110
|
+
FileChange(path=gitignore.path, status=gitignore.status)
|
|
111
|
+
)
|
|
112
|
+
|
|
97
113
|
return SetupResult(changes=tuple(changes), warnings=tuple(warnings))
|
|
98
114
|
|
|
99
115
|
def build_run(self, context: RunContext) -> Invocation:
|
devflow/adapters/opencode.py
CHANGED
|
@@ -15,6 +15,7 @@ from devflow.adapters.base import (
|
|
|
15
15
|
from devflow.adapters.instructions import (
|
|
16
16
|
MANAGED_MARKER,
|
|
17
17
|
render_agent_instructions,
|
|
18
|
+
write_gitignore_entries,
|
|
18
19
|
write_json_if_missing,
|
|
19
20
|
write_text_managed,
|
|
20
21
|
)
|
|
@@ -91,6 +92,21 @@ class OpenCodeAdapter(HarnessAdapter):
|
|
|
91
92
|
FileChange(path=readonly.path, status=readonly.status)
|
|
92
93
|
)
|
|
93
94
|
|
|
95
|
+
ignored: list[str] = []
|
|
96
|
+
if result.status != "skipped":
|
|
97
|
+
ignored.append("AGENTS.md")
|
|
98
|
+
if config_result.status != "skipped":
|
|
99
|
+
ignored.append("opencode.json")
|
|
100
|
+
if interactive.status != "skipped":
|
|
101
|
+
ignored.append(f".opencode/agents/{INTERACTIVE_AGENT}.md")
|
|
102
|
+
if readonly.status != "skipped":
|
|
103
|
+
ignored.append(f".opencode/agents/{READONLY_AGENT}.md")
|
|
104
|
+
if ignored:
|
|
105
|
+
gitignore = write_gitignore_entries(context.root, ignored)
|
|
106
|
+
changes.append(
|
|
107
|
+
FileChange(path=gitignore.path, status=gitignore.status)
|
|
108
|
+
)
|
|
109
|
+
|
|
94
110
|
if result.status == "skipped":
|
|
95
111
|
warnings.append(
|
|
96
112
|
"AGENTS.md contains unmanaged content and was left untouched."
|
devflow/cli.py
CHANGED
devflow/commands/approve.py
CHANGED
|
@@ -57,7 +57,7 @@ def _approve(spec_id: str, path: Path, stage: str) -> None:
|
|
|
57
57
|
normalized = stage.strip().lower()
|
|
58
58
|
if normalized != "spec":
|
|
59
59
|
msg = (
|
|
60
|
-
f"Stage '{stage}' is not available in DevFlow 0.3.
|
|
60
|
+
f"Stage '{stage}' is not available in DevFlow 0.3.7. "
|
|
61
61
|
"Only the 'spec' stage can be approved."
|
|
62
62
|
)
|
|
63
63
|
raise UnsupportedStageError(msg)
|
devflow/core/project.py
CHANGED
|
@@ -11,6 +11,8 @@ from typing import Any, Iterator
|
|
|
11
11
|
|
|
12
12
|
from devflow.models.project import Project
|
|
13
13
|
|
|
14
|
+
VIRTUALENV_DIRECTORIES = (".venv", "venv", "env")
|
|
15
|
+
|
|
14
16
|
SKIP_DIRECTORIES = {
|
|
15
17
|
".git",
|
|
16
18
|
".venv",
|
|
@@ -62,6 +64,10 @@ FRAMEWORK_DEPENDENCIES = {
|
|
|
62
64
|
"chromadb": "ChromaDB",
|
|
63
65
|
"faiss-cpu": "FAISS",
|
|
64
66
|
"sentence-transformers": "Sentence Transformers",
|
|
67
|
+
"qdrant-client": "Qdrant",
|
|
68
|
+
"weaviate-client": "Weaviate",
|
|
69
|
+
"pinecone-client": "Pinecone",
|
|
70
|
+
"pgvector": "pgvector",
|
|
65
71
|
"openai": "OpenAI",
|
|
66
72
|
"anthropic": "Anthropic",
|
|
67
73
|
}
|
|
@@ -85,6 +91,26 @@ FRONTEND_FRAMEWORKS = {
|
|
|
85
91
|
"Next.js",
|
|
86
92
|
}
|
|
87
93
|
|
|
94
|
+
AI_FRAMEWORKS = {
|
|
95
|
+
"LangChain",
|
|
96
|
+
"LlamaIndex",
|
|
97
|
+
"ChromaDB",
|
|
98
|
+
"FAISS",
|
|
99
|
+
"Sentence Transformers",
|
|
100
|
+
"Qdrant",
|
|
101
|
+
"Weaviate",
|
|
102
|
+
"Pinecone",
|
|
103
|
+
"pgvector",
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
VECTOR_DEPENDENCIES = {
|
|
107
|
+
"chromadb",
|
|
108
|
+
"qdrant-client",
|
|
109
|
+
"weaviate-client",
|
|
110
|
+
"pinecone-client",
|
|
111
|
+
"pgvector",
|
|
112
|
+
}
|
|
113
|
+
|
|
88
114
|
BACKEND_FRAMEWORKS = {
|
|
89
115
|
"Django",
|
|
90
116
|
"Django REST Framework",
|
|
@@ -242,6 +268,12 @@ class ProjectDetector:
|
|
|
242
268
|
manifests.append(path.relative_to(resolved).as_posix())
|
|
243
269
|
dependencies.update(self._read_requirements(path))
|
|
244
270
|
|
|
271
|
+
venv_dependencies, venv_manifests = self._virtualenv_dependencies(
|
|
272
|
+
resolved,
|
|
273
|
+
)
|
|
274
|
+
dependencies.update(venv_dependencies)
|
|
275
|
+
manifests.extend(venv_manifests)
|
|
276
|
+
|
|
245
277
|
source_files = [
|
|
246
278
|
path.relative_to(resolved).as_posix()
|
|
247
279
|
for path in iter_project_files(
|
|
@@ -415,6 +447,101 @@ class ProjectDetector:
|
|
|
415
447
|
dependencies.add(name)
|
|
416
448
|
return dependencies
|
|
417
449
|
|
|
450
|
+
def _virtualenv_dependencies(
|
|
451
|
+
self,
|
|
452
|
+
root: Path,
|
|
453
|
+
) -> tuple[set[str], list[str]]:
|
|
454
|
+
"""Read installed distributions from a local virtual environment.
|
|
455
|
+
|
|
456
|
+
Dependency manifests are optional in many projects; the virtual
|
|
457
|
+
environment is often the only place where the real stack is
|
|
458
|
+
recorded. Only well-known local directory names are inspected.
|
|
459
|
+
"""
|
|
460
|
+
dependencies: set[str] = set()
|
|
461
|
+
manifests: list[str] = []
|
|
462
|
+
for name in VIRTUALENV_DIRECTORIES:
|
|
463
|
+
directory = root / name
|
|
464
|
+
if (
|
|
465
|
+
not directory.is_dir()
|
|
466
|
+
or directory.is_symlink()
|
|
467
|
+
or _is_symlink_escape(directory, root)
|
|
468
|
+
):
|
|
469
|
+
continue
|
|
470
|
+
for site_packages in self._site_packages(directory):
|
|
471
|
+
installed = self._installed_distributions(site_packages)
|
|
472
|
+
if not installed:
|
|
473
|
+
continue
|
|
474
|
+
dependencies.update(installed)
|
|
475
|
+
manifests.append(
|
|
476
|
+
f"{site_packages.relative_to(root).as_posix()} "
|
|
477
|
+
"(installed packages)"
|
|
478
|
+
)
|
|
479
|
+
return dependencies, manifests
|
|
480
|
+
|
|
481
|
+
def _site_packages(self, directory: Path) -> list[Path]:
|
|
482
|
+
"""Return contained site-packages directories of a virtualenv."""
|
|
483
|
+
candidates: list[Path] = []
|
|
484
|
+
for pattern in (
|
|
485
|
+
"lib/python*/site-packages",
|
|
486
|
+
"lib64/python*/site-packages",
|
|
487
|
+
"Lib/site-packages",
|
|
488
|
+
):
|
|
489
|
+
candidates.extend(directory.glob(pattern))
|
|
490
|
+
paths: dict[Path, Path] = {}
|
|
491
|
+
for path in candidates:
|
|
492
|
+
if (
|
|
493
|
+
not path.is_dir()
|
|
494
|
+
or path.is_symlink()
|
|
495
|
+
or _is_symlink_escape(path, directory)
|
|
496
|
+
):
|
|
497
|
+
continue
|
|
498
|
+
paths.setdefault(path.resolve(), path)
|
|
499
|
+
return sorted(paths.values())
|
|
500
|
+
|
|
501
|
+
def _installed_distributions(self, site_packages: Path) -> set[str]:
|
|
502
|
+
"""Return canonical package names from dist-info and egg-info."""
|
|
503
|
+
names: set[str] = set()
|
|
504
|
+
try:
|
|
505
|
+
entries = sorted(site_packages.iterdir())
|
|
506
|
+
except OSError:
|
|
507
|
+
return names
|
|
508
|
+
|
|
509
|
+
for entry in entries:
|
|
510
|
+
if entry.is_symlink():
|
|
511
|
+
continue
|
|
512
|
+
if entry.name.endswith(".dist-info"):
|
|
513
|
+
name = self._metadata_name(entry / "METADATA")
|
|
514
|
+
if name is None:
|
|
515
|
+
name = entry.name[: -len(".dist-info")].rsplit("-", 1)[0]
|
|
516
|
+
names.add(canonicalize_dependency(name))
|
|
517
|
+
elif entry.name.endswith(".egg-info"):
|
|
518
|
+
name = self._metadata_name(entry / "PKG-INFO")
|
|
519
|
+
if name is None:
|
|
520
|
+
name = entry.name[: -len(".egg-info")].rsplit("-", 1)[0]
|
|
521
|
+
names.add(canonicalize_dependency(name))
|
|
522
|
+
|
|
523
|
+
return {name for name in names if name}
|
|
524
|
+
|
|
525
|
+
def _metadata_name(self, path: Path) -> str | None:
|
|
526
|
+
"""Read the ``Name`` field from a package metadata file."""
|
|
527
|
+
if not path.is_file() or path.is_symlink():
|
|
528
|
+
return None
|
|
529
|
+
try:
|
|
530
|
+
with path.open(
|
|
531
|
+
encoding="utf-8",
|
|
532
|
+
errors="replace",
|
|
533
|
+
) as handle:
|
|
534
|
+
for _ in range(40):
|
|
535
|
+
line = handle.readline()
|
|
536
|
+
if not line:
|
|
537
|
+
break
|
|
538
|
+
if line.lower().startswith("name:"):
|
|
539
|
+
value = line.split(":", 1)[1].strip()
|
|
540
|
+
return value or None
|
|
541
|
+
except OSError:
|
|
542
|
+
return None
|
|
543
|
+
return None
|
|
544
|
+
|
|
418
545
|
def _detect_languages(
|
|
419
546
|
self,
|
|
420
547
|
root: Path,
|
|
@@ -484,7 +611,10 @@ class ProjectDetector:
|
|
|
484
611
|
):
|
|
485
612
|
databases.append(label)
|
|
486
613
|
|
|
487
|
-
if
|
|
614
|
+
if any(
|
|
615
|
+
self._has_dependency(dependencies, name)
|
|
616
|
+
for name in VECTOR_DEPENDENCIES
|
|
617
|
+
):
|
|
488
618
|
if "vector-database" not in databases:
|
|
489
619
|
databases.append("vector-database")
|
|
490
620
|
return databases
|
|
@@ -499,14 +629,7 @@ class ProjectDetector:
|
|
|
499
629
|
for framework in frameworks
|
|
500
630
|
)
|
|
501
631
|
ai = any(
|
|
502
|
-
framework
|
|
503
|
-
in {
|
|
504
|
-
"LangChain",
|
|
505
|
-
"LlamaIndex",
|
|
506
|
-
"ChromaDB",
|
|
507
|
-
"FAISS",
|
|
508
|
-
"Sentence Transformers",
|
|
509
|
-
}
|
|
632
|
+
framework in AI_FRAMEWORKS
|
|
510
633
|
for framework in frameworks
|
|
511
634
|
)
|
|
512
635
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: devflow-toolkit
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.7
|
|
4
4
|
Summary: Specification workflow toolkit for AI-assisted software changes
|
|
5
5
|
Author: DevFlow contributors
|
|
6
6
|
License-Expression: MIT
|
|
@@ -42,7 +42,7 @@ anyone starts implementing it. DevFlow owns the workflow state; the
|
|
|
42
42
|
selected agent harness is only the execution backend that drafts the
|
|
43
43
|
specification.
|
|
44
44
|
|
|
45
|
-
This is the `0.3.
|
|
45
|
+
This is the `0.3.7` MVP. It implements the **discovery and
|
|
46
46
|
specification stages only**. It supports two specification contexts:
|
|
47
47
|
**Existing Project** (the default) and **Greenfield**. It is not a
|
|
48
48
|
complete SDD platform and does not include planning, implementation or
|
|
@@ -118,7 +118,7 @@ pip install devflow-toolkit
|
|
|
118
118
|
To install a specific built artifact instead:
|
|
119
119
|
|
|
120
120
|
```bash
|
|
121
|
-
pip install devflow_toolkit-0.3.
|
|
121
|
+
pip install devflow_toolkit-0.3.7-py3-none-any.whl
|
|
122
122
|
```
|
|
123
123
|
|
|
124
124
|
Verify the installation:
|
|
@@ -142,6 +142,15 @@ copies the applicable constitution documents, writes
|
|
|
142
142
|
`.devflow/config.yaml` and generates the integration for the selected
|
|
143
143
|
harness.
|
|
144
144
|
|
|
145
|
+
The stack is detected from `pyproject.toml`, `requirements*.txt` and
|
|
146
|
+
`package.json`. When those manifests are absent or incomplete, DevFlow
|
|
147
|
+
also reads the packages installed in a local virtual environment
|
|
148
|
+
(`.venv`, `venv` or `env`). This keeps Django, FastAPI and the
|
|
149
|
+
RAG/vector stack (`langchain`, `llama-index`, `chromadb`,
|
|
150
|
+
`qdrant-client`, `weaviate-client`, `pinecone-client`, `pgvector` and
|
|
151
|
+
`sentence-transformers`) detectable without versioning a dependency
|
|
152
|
+
manifest.
|
|
153
|
+
|
|
145
154
|
Common options:
|
|
146
155
|
|
|
147
156
|
```bash
|
|
@@ -282,7 +291,7 @@ as an architectural constraint when it is present.
|
|
|
282
291
|
|
|
283
292
|
### Harnesses
|
|
284
293
|
|
|
285
|
-
| Harness | Status in 0.3.
|
|
294
|
+
| Harness | Status in 0.3.7 |
|
|
286
295
|
| --- | --- |
|
|
287
296
|
| OpenCode | Verified end-to-end in non-interactive mode |
|
|
288
297
|
| Codex | Integration files are generated, but not verified for this release |
|
|
@@ -308,6 +317,14 @@ also select the model used by the agent, for example:
|
|
|
308
317
|
DevFlow creates `opencode.json` only when it does not exist and never
|
|
309
318
|
replaces an existing OpenCode configuration.
|
|
310
319
|
|
|
320
|
+
DevFlow records the files it generates for the selected harness in a
|
|
321
|
+
managed block inside `.gitignore`, for example `CLAUDE.md`, `AGENTS.md`,
|
|
322
|
+
`opencode.json` and the DevFlow agents. Existing ignore entries are
|
|
323
|
+
preserved, and the block is shared across harnesses, so switching
|
|
324
|
+
adapters keeps earlier generated files ignored. Unmanaged files that
|
|
325
|
+
DevFlow did not create are never added. DevFlow does not ignore
|
|
326
|
+
`.devflow/` or the constitution.
|
|
327
|
+
|
|
311
328
|
### Permissions
|
|
312
329
|
|
|
313
330
|
`allow_workflow_write` controls writes to DevFlow artifacts.
|
|
@@ -323,6 +340,11 @@ not treated as the only permission boundary.
|
|
|
323
340
|
When a harness cannot enforce a restriction technically, DevFlow prints
|
|
324
341
|
a warning instead of claiming that the restriction is guaranteed.
|
|
325
342
|
|
|
343
|
+
For Claude Code, interactive runs explicitly allow the
|
|
344
|
+
`AskUserQuestion` tool even though the adapter uses `dontAsk` mode, so
|
|
345
|
+
Discovery can ask the user directly. Non-interactive runs do not allow
|
|
346
|
+
the tool.
|
|
347
|
+
|
|
326
348
|
## Discovery
|
|
327
349
|
|
|
328
350
|
Discovery is separate from specification. The project context decides
|
|
@@ -432,7 +454,7 @@ specification that still lists open questions.
|
|
|
432
454
|
8. If artifacts exist without workflow state, diagnose with
|
|
433
455
|
`devflow doctor <id>` and repair with `devflow recover <id>`.
|
|
434
456
|
|
|
435
|
-
Available commands in `0.3.
|
|
457
|
+
Available commands in `0.3.7`:
|
|
436
458
|
|
|
437
459
|
| Command | Status |
|
|
438
460
|
| --- | --- |
|
|
@@ -620,7 +642,7 @@ devflow approve 001 --stage spec
|
|
|
620
642
|
```
|
|
621
643
|
|
|
622
644
|
Approval is explicit and binds the decision to the current artifact
|
|
623
|
-
digests. For a `0.3.
|
|
645
|
+
digests. For a `0.3.7` change it binds `spec.md`, `discovery.yaml` and,
|
|
624
646
|
when a manifest applies, the architecture manifest digest. Repeating the
|
|
625
647
|
same approval is a no-op. If an artifact changes after validation,
|
|
626
648
|
DevFlow marks it stale and refuses approval until it is regenerated and
|
|
@@ -631,7 +653,7 @@ and names the pending questions and assumptions. Approval also rejects a
|
|
|
631
653
|
specification whose section 7 still lists open questions. Legacy `0.2.0`
|
|
632
654
|
changes without `discovery.yaml` remain approvable with a warning.
|
|
633
655
|
|
|
634
|
-
Only the `spec` stage is available in `0.3.
|
|
656
|
+
Only the `spec` stage is available in `0.3.7`. `--stage plan` and
|
|
635
657
|
`--stage review` are rejected. There are no `plan`, `implement` or
|
|
636
658
|
`review` commands in this release.
|
|
637
659
|
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
devflow/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
devflow/cli.py,sha256
|
|
2
|
+
devflow/cli.py,sha256=-J_7Tnc6wzNiwBnoaz1XrUSUIWLJUBh6kyDMhsopBNE,1168
|
|
3
3
|
devflow/adapters/__init__.py,sha256=WcsjXQTKzHNzMAHx82-sdJQeR3ceHRVqLWTUtRlaraE,867
|
|
4
|
-
devflow/adapters/agents.py,sha256=
|
|
4
|
+
devflow/adapters/agents.py,sha256=OZnz7wAJNcIojtgaQIK1iB6QKWGgv2VCmoBp8M9DUKE,1423
|
|
5
5
|
devflow/adapters/base.py,sha256=YggY_IwHExdybl5S9NjwZSlmmcw9Y6z7DhQsl3JLvXs,2055
|
|
6
|
-
devflow/adapters/claude_code.py,sha256=
|
|
7
|
-
devflow/adapters/codex.py,sha256=
|
|
6
|
+
devflow/adapters/claude_code.py,sha256=V7Hsog9CRPvA50jhBoI3KvTy0xehCt-vUFi7jWhDPc4,3663
|
|
7
|
+
devflow/adapters/codex.py,sha256=ctMQi-qvumkQxCNdiD9d25bDQoxarMl_-9GfBsYxoyQ,3290
|
|
8
8
|
devflow/adapters/detector.py,sha256=92BkNAvWs2Vh8H6xJzMweBDCw6yuYVg7sV4LoSZ8KFo,3291
|
|
9
|
-
devflow/adapters/instructions.py,sha256=
|
|
10
|
-
devflow/adapters/kiro.py,sha256=
|
|
11
|
-
devflow/adapters/opencode.py,sha256=
|
|
9
|
+
devflow/adapters/instructions.py,sha256=ukkPhI2FFZPqERg6PFFyP05BPifrpDHzw082b7D-Teo,10222
|
|
10
|
+
devflow/adapters/kiro.py,sha256=VxAcwkAdkTbZjDjTJaZfs4kyVHSwR4_Wo3GmFsbmEBU,6754
|
|
11
|
+
devflow/adapters/opencode.py,sha256=tAsLApXFSUU2-fPgE8wXtgF7OAOA_qYrVJVeS-GiJ3E,7077
|
|
12
12
|
devflow/adapters/registry.py,sha256=NLd_tf7dAiZUa6gbQFcwPogurZyjbMNbzjjXozAD4xs,1177
|
|
13
13
|
devflow/commands/__init__.py,sha256=yOLtd_4R4xdlMgAzihzIT35oyV_qcz0br-aoLebRj1c,157
|
|
14
|
-
devflow/commands/approve.py,sha256=
|
|
14
|
+
devflow/commands/approve.py,sha256=W-IYx2RTDZQfqHrVcC40hXyAusD6mKR2IJaSVUR-m-o,2740
|
|
15
15
|
devflow/commands/doctor.py,sha256=vYk2i3OksbGpHEUFsqi7c4w44mAXRmY0OeEdO8h5j_M,4161
|
|
16
16
|
devflow/commands/harness.py,sha256=bm0TQ7abASHfa81JKZV5w6raWN7ezbzfNmUK_n75dsI,3765
|
|
17
17
|
devflow/commands/init.py,sha256=B-rW-etZ-Rptt9YW43YZ5mN_l3gfGczuXW9kpmHDOWQ,15420
|
|
@@ -26,7 +26,7 @@ devflow/core/constitution.py,sha256=nPHyy7BuIyyqkn4y85UyWn2E7f5AWHbg4iZ0frF9SfE,
|
|
|
26
26
|
devflow/core/discovery.py,sha256=ed0gScDUbic4YEY-1XQzc2kVlQ6-lcLXWloubyFX7dc,44204
|
|
27
27
|
devflow/core/ports.py,sha256=R6ybjAdJEdtTKFc4FMFTX0TVwRfDwPoWCsu-BHrhI5A,4071
|
|
28
28
|
devflow/core/profile_manager.py,sha256=QnnJka2KIKD2tCSWJkGTOUEFMgmQT0Z9Qv173JKWKHw,8937
|
|
29
|
-
devflow/core/project.py,sha256=
|
|
29
|
+
devflow/core/project.py,sha256=aXJanCK-TjkDy4v_XM14Xj3z7sbHPusjyJrIzmDqeAI,16989
|
|
30
30
|
devflow/core/recovery.py,sha256=W2If6Ymb3ISwMN8IVQYCwptDUzhxejlF-P2NvMYyZP0,8818
|
|
31
31
|
devflow/core/spec_workflow.py,sha256=_GTCMewFo-Vf3XPQPRFB6YnWUqH1Menj2W9EWsXuf1A,32660
|
|
32
32
|
devflow/core/specification.py,sha256=vVlhHCdBFlnuIfA_IJPxY4sa0S0t6oX27cn_nFyevGM,65399
|
|
@@ -45,7 +45,7 @@ devflow/core/state/transitions.py,sha256=Go0zLhxcujWhaZEGg7JMqcC_UJU_nEFEBbpKIqr
|
|
|
45
45
|
devflow/models/__init__.py,sha256=hXX3IDZbHgklmuzVVlpiRs5SSPnrkO5kN1-k2hIEk7E,156
|
|
46
46
|
devflow/models/profile.py,sha256=j8KifeDQSN-wvzDJe1GGQQN9Vw7S2oncj75NNHpwpZs,2001
|
|
47
47
|
devflow/models/project.py,sha256=2CAMY-mPEnkVryndNOzCURxknbZnnN2MYuEE-RIUcp0,1303
|
|
48
|
-
devflow/profiles/ai-rag/profile.yaml,sha256
|
|
48
|
+
devflow/profiles/ai-rag/profile.yaml,sha256=-6qxhXPkuQEfDzHZUo0Kra1ucOHg40vljv-isrLhrWY,517
|
|
49
49
|
devflow/profiles/ai-rag/constitution/ai-rag-standards.md,sha256=sU-uM9iH50_xaF0vzqYNggIbvEnzYYCgaY7HdzOB6HY,1749
|
|
50
50
|
devflow/profiles/base/profile.yaml,sha256=_V3Y51Rl9J5PjXwBAleD1I6iiwVuDRu81bYILfsbpCE,249
|
|
51
51
|
devflow/profiles/base/constitution/architecture.md,sha256=gcuRWaV1uETI9_yF0w2egcFOU8KQzywDFPb8rHlek90,1712
|
|
@@ -59,8 +59,8 @@ devflow/prompts/__init__.py,sha256=hdixkEhocz84S3-Vvx7Xmje03VordXE8jUtqGUZMqbs,8
|
|
|
59
59
|
devflow/prompts/discovery.md,sha256=EGxzDYNoH_kOL3pptTkTG89SFB9-7f43Pfew4KrUDqc,6126
|
|
60
60
|
devflow/prompts/spec.greenfield.md,sha256=BEKTN7G0B_P0bAevNeShzb_54dYu6j95_B3YqyhYK40,5154
|
|
61
61
|
devflow/prompts/spec.md,sha256=zXrNA--c8IiQJBMyxidTtLVHUIrn7Ynj6935dyje1SY,3801
|
|
62
|
-
devflow_toolkit-0.3.
|
|
63
|
-
devflow_toolkit-0.3.
|
|
64
|
-
devflow_toolkit-0.3.
|
|
65
|
-
devflow_toolkit-0.3.
|
|
66
|
-
devflow_toolkit-0.3.
|
|
62
|
+
devflow_toolkit-0.3.7.dist-info/METADATA,sha256=baMOOZD-gKXN5ypN49ScJYwP39e9YGrFW5_Nv3QLCXw,28631
|
|
63
|
+
devflow_toolkit-0.3.7.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
|
|
64
|
+
devflow_toolkit-0.3.7.dist-info/entry_points.txt,sha256=wPmqE1081vi8s3xf-Wfzfvpl-44IKgwx7OGoLEK3u7o,44
|
|
65
|
+
devflow_toolkit-0.3.7.dist-info/licenses/LICENSE,sha256=Wa04lstC8Goe4b9IYfEYWB2k7nokYBejZl6NdyAl8rA,1077
|
|
66
|
+
devflow_toolkit-0.3.7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|