cli-mem 0.3.0__tar.gz → 0.3.1__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.
- {cli_mem-0.3.0 → cli_mem-0.3.1}/PKG-INFO +1 -1
- {cli_mem-0.3.0 → cli_mem-0.3.1}/pyproject.toml +1 -1
- {cli_mem-0.3.0 → cli_mem-0.3.1}/src/mem/__init__.py +1 -1
- {cli_mem-0.3.0 → cli_mem-0.3.1}/src/mem/patterns.py +11 -5
- {cli_mem-0.3.0 → cli_mem-0.3.1}/.github/workflows/ci.yml +0 -0
- {cli_mem-0.3.0 → cli_mem-0.3.1}/.github/workflows/release.yml +0 -0
- {cli_mem-0.3.0 → cli_mem-0.3.1}/.gitignore +0 -0
- {cli_mem-0.3.0 → cli_mem-0.3.1}/ARCHITECTURE.md +0 -0
- {cli_mem-0.3.0 → cli_mem-0.3.1}/LICENSE +0 -0
- {cli_mem-0.3.0 → cli_mem-0.3.1}/PHILOSOPHY.md +0 -0
- {cli_mem-0.3.0 → cli_mem-0.3.1}/README.md +0 -0
- {cli_mem-0.3.0 → cli_mem-0.3.1}/assets/.gitkeep +0 -0
- {cli_mem-0.3.0 → cli_mem-0.3.1}/docs/decisions/001-jsonl-over-sqlite.md +0 -0
- {cli_mem-0.3.0 → cli_mem-0.3.1}/docs/decisions/002-apple-fm-sdk-for-patterns.md +0 -0
- {cli_mem-0.3.0 → cli_mem-0.3.1}/docs/decisions/003-no-daemon.md +0 -0
- {cli_mem-0.3.0 → cli_mem-0.3.1}/docs/decisions/004-per-repo-jsonl.md +0 -0
- {cli_mem-0.3.0 → cli_mem-0.3.1}/hooks/mem.zsh +0 -0
- {cli_mem-0.3.0 → cli_mem-0.3.1}/install.sh +0 -0
- {cli_mem-0.3.0 → cli_mem-0.3.1}/src/mem/capture.py +0 -0
- {cli_mem-0.3.0 → cli_mem-0.3.1}/src/mem/cli.py +0 -0
- {cli_mem-0.3.0 → cli_mem-0.3.1}/src/mem/groups.py +0 -0
- {cli_mem-0.3.0 → cli_mem-0.3.1}/src/mem/models.py +0 -0
- {cli_mem-0.3.0 → cli_mem-0.3.1}/src/mem/search.py +0 -0
- {cli_mem-0.3.0 → cli_mem-0.3.1}/src/mem/storage.py +0 -0
- {cli_mem-0.3.0 → cli_mem-0.3.1}/src/mem/variables.py +0 -0
- {cli_mem-0.3.0 → cli_mem-0.3.1}/tests/conftest.py +0 -0
- {cli_mem-0.3.0 → cli_mem-0.3.1}/tests/test_capture.py +0 -0
- {cli_mem-0.3.0 → cli_mem-0.3.1}/tests/test_groups.py +0 -0
- {cli_mem-0.3.0 → cli_mem-0.3.1}/tests/test_patterns.py +0 -0
- {cli_mem-0.3.0 → cli_mem-0.3.1}/tests/test_search.py +0 -0
- {cli_mem-0.3.0 → cli_mem-0.3.1}/tests/test_storage.py +0 -0
|
@@ -95,18 +95,24 @@ async def _generalize_commands(tool: str, unique_commands: list[str]) -> dict[st
|
|
|
95
95
|
"""Generalize each unique command via Apple FM guided generation.
|
|
96
96
|
|
|
97
97
|
Returns a mapping from concrete command -> generalized pattern.
|
|
98
|
-
Uses
|
|
98
|
+
Uses a fresh session per command to avoid exceeding the on-device
|
|
99
|
+
model's context window when processing many commands.
|
|
99
100
|
"""
|
|
100
101
|
import apple_fm_sdk as fm
|
|
101
102
|
|
|
102
103
|
GeneralizedCommand = _get_generable_types()
|
|
103
|
-
session = fm.LanguageModelSession()
|
|
104
104
|
cmd_to_pattern: dict[str, str] = {}
|
|
105
105
|
|
|
106
106
|
for cmd in unique_commands:
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
107
|
+
try:
|
|
108
|
+
session = fm.LanguageModelSession()
|
|
109
|
+
prompt = GENERALIZE_PROMPT.format(tool=tool, command=cmd)
|
|
110
|
+
result = await session.respond(prompt, generating=GeneralizedCommand)
|
|
111
|
+
cmd_to_pattern[cmd] = result.pattern
|
|
112
|
+
except Exception:
|
|
113
|
+
# Skip commands that fail (too long, context issues, etc.)
|
|
114
|
+
# Fall back to the raw command as its own pattern.
|
|
115
|
+
cmd_to_pattern[cmd] = cmd
|
|
110
116
|
|
|
111
117
|
return cmd_to_pattern
|
|
112
118
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|