framework-py 0.1.0.dev28__py3-none-any.whl → 0.1.0.dev30__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.
framework/__init__.py CHANGED
@@ -129,7 +129,7 @@ from framework.scaffold import project_info, scaffold, status
129
129
  from framework.scratch import scratch_capture, scratch_clean
130
130
  from framework.security import AuditResult, git_security_audit
131
131
  from framework.settings import settings, settings_read, settings_write
132
- from framework.skill_pull import pull_skills, push_skills
132
+ from framework.skill_pull import pull_skills, push_skills, skills_copy
133
133
  from framework.skill_sync import skills_sync
134
134
  from framework.snippets import load_ipython_extension as load_ipython_extension
135
135
  from framework.snippets import snippet
@@ -275,6 +275,7 @@ __all__ = [
275
275
  "settings_read",
276
276
  "settings_write",
277
277
  "show_table",
278
+ "skills_copy",
278
279
  "skills_sync",
279
280
  "snippet",
280
281
  "spec_check",
framework/ai.py CHANGED
@@ -27,7 +27,11 @@ def assistant_targets(spec: dict[str, Any]) -> tuple[list[str], list[str]]:
27
27
  With no assistants selected, skills go to ``.agents/skills`` only, the
28
28
  folder more tools read.
29
29
  """
30
- selected = [name for name in spec.get("ai", {}).get("assistants", {}) if name in ASSISTANTS]
30
+ chosen = spec.get("ai", {}).get("assistants", {})
31
+ # A mapping selects the assistants whose value is true; a list selects each one listed
32
+ if isinstance(chosen, dict):
33
+ chosen = [name for name, on in chosen.items() if on]
34
+ selected = [name for name in chosen if name in ASSISTANTS]
31
35
  if not selected:
32
36
  return [AGENTS_DEFAULT], []
33
37
  folders = list(dict.fromkeys(ASSISTANTS[name][0] for name in selected))
@@ -141,11 +145,13 @@ def write_ai_files(root: Path, spec: dict[str, Any]) -> list[str]:
141
145
  if entry.get("package") is True:
142
146
  from framework.skill_sync import install_package
143
147
 
144
- install_package(_shipped(name), root, target, name)
148
+ if not install_package(_shipped(name), root, target, name):
149
+ continue # Declined (an existing edited or Cloud copy): not written
145
150
  elif entry.get("sync") and entry.get("bundle"):
146
151
  from framework.skill_sync import install_cloud
147
152
 
148
- install_cloud(root, target, entry)
153
+ if not install_cloud(root, target, entry):
154
+ continue
149
155
  else:
150
156
  _write(root, f"{target}/SKILL.md", entry["content"])
151
157
  for relative, content in (entry.get("files") or {}).items():
framework/create.py CHANGED
@@ -116,6 +116,21 @@ def _create_directories(root: Path, spec: Mapping[str, Any]) -> None:
116
116
  (root / path).mkdir(parents=True, exist_ok=True)
117
117
 
118
118
 
119
+ _KEEP_SKIP = {".git", "renv", ".quarto", "_freeze", "node_modules", ".venv"}
120
+
121
+
122
+ def _keep_folders(root: Path) -> None:
123
+ """Put a ``.gitkeep`` in every empty folder, as R's ``.spec_keep_folders()`` does,
124
+ so the folders creation made survive git, GitHub, and its Download ZIP. Folders a
125
+ project's ``.gitignore`` excludes (private ones) stay out of git anyway, and
126
+ ``scaffold()`` makes them again."""
127
+ for folder in sorted(root.rglob("*")):
128
+ if not folder.is_dir() or _KEEP_SKIP & set(folder.relative_to(root).parts):
129
+ continue
130
+ if not any(folder.iterdir()):
131
+ (folder / ".gitkeep").touch()
132
+
133
+
119
134
  def _sections(spec: Mapping[str, Any]) -> dict[str, Any]:
120
135
  """The settings sections a Python project writes, in the shared format."""
121
136
  scaffold = spec.get("scaffold") or {}
@@ -528,6 +543,7 @@ def project_create(
528
543
  )
529
544
  if not bare:
530
545
  db.ensure_db(root)
546
+ _keep_folders(root)
531
547
  _record(root, spec)
532
548
 
533
549
  if not headless: