chatmd 0.2.7__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.
Files changed (136) hide show
  1. chatmd-0.2.7/.gitignore +31 -0
  2. chatmd-0.2.7/CHANGELOG.md +196 -0
  3. chatmd-0.2.7/CONTRIBUTING.md +146 -0
  4. chatmd-0.2.7/LICENSE +21 -0
  5. chatmd-0.2.7/PKG-INFO +477 -0
  6. chatmd-0.2.7/README.md +446 -0
  7. chatmd-0.2.7/pyproject.toml +74 -0
  8. chatmd-0.2.7/src/chatmd/__init__.py +3 -0
  9. chatmd-0.2.7/src/chatmd/__main__.py +6 -0
  10. chatmd-0.2.7/src/chatmd/cli.py +214 -0
  11. chatmd-0.2.7/src/chatmd/commands/__init__.py +1 -0
  12. chatmd-0.2.7/src/chatmd/commands/agent_lifecycle.py +327 -0
  13. chatmd-0.2.7/src/chatmd/commands/init_workspace.py +189 -0
  14. chatmd-0.2.7/src/chatmd/commands/migrations.py +246 -0
  15. chatmd-0.2.7/src/chatmd/commands/mode.py +43 -0
  16. chatmd-0.2.7/src/chatmd/commands/service.py +418 -0
  17. chatmd-0.2.7/src/chatmd/commands/upgrade.py +76 -0
  18. chatmd-0.2.7/src/chatmd/commands/win_service.py +348 -0
  19. chatmd-0.2.7/src/chatmd/engine/__init__.py +1 -0
  20. chatmd-0.2.7/src/chatmd/engine/agent.py +1213 -0
  21. chatmd-0.2.7/src/chatmd/engine/confirm.py +179 -0
  22. chatmd-0.2.7/src/chatmd/engine/cron_inline.py +118 -0
  23. chatmd-0.2.7/src/chatmd/engine/cron_log.py +51 -0
  24. chatmd-0.2.7/src/chatmd/engine/cron_parser.py +523 -0
  25. chatmd-0.2.7/src/chatmd/engine/cron_safety.py +58 -0
  26. chatmd-0.2.7/src/chatmd/engine/cron_scheduler.py +395 -0
  27. chatmd-0.2.7/src/chatmd/engine/cron_state.py +122 -0
  28. chatmd-0.2.7/src/chatmd/engine/parser.py +350 -0
  29. chatmd-0.2.7/src/chatmd/engine/reference_resolver.py +204 -0
  30. chatmd-0.2.7/src/chatmd/engine/router.py +217 -0
  31. chatmd-0.2.7/src/chatmd/engine/scheduler.py +251 -0
  32. chatmd-0.2.7/src/chatmd/engine/state.py +134 -0
  33. chatmd-0.2.7/src/chatmd/exceptions.py +33 -0
  34. chatmd-0.2.7/src/chatmd/i18n/__init__.py +76 -0
  35. chatmd-0.2.7/src/chatmd/i18n/en.py +647 -0
  36. chatmd-0.2.7/src/chatmd/i18n/zh_CN.py +626 -0
  37. chatmd-0.2.7/src/chatmd/infra/__init__.py +1 -0
  38. chatmd-0.2.7/src/chatmd/infra/config.py +205 -0
  39. chatmd-0.2.7/src/chatmd/infra/file_writer.py +256 -0
  40. chatmd-0.2.7/src/chatmd/infra/git_sync.py +166 -0
  41. chatmd-0.2.7/src/chatmd/infra/git_utils.py +122 -0
  42. chatmd-0.2.7/src/chatmd/infra/index_manager.py +88 -0
  43. chatmd-0.2.7/src/chatmd/infra/notification.py +456 -0
  44. chatmd-0.2.7/src/chatmd/infra/offline_queue.py +97 -0
  45. chatmd-0.2.7/src/chatmd/providers/__init__.py +1 -0
  46. chatmd-0.2.7/src/chatmd/providers/base.py +16 -0
  47. chatmd-0.2.7/src/chatmd/providers/liteagent.py +183 -0
  48. chatmd-0.2.7/src/chatmd/providers/litestartup.py +477 -0
  49. chatmd-0.2.7/src/chatmd/providers/openai_compat.py +146 -0
  50. chatmd-0.2.7/src/chatmd/security/__init__.py +1 -0
  51. chatmd-0.2.7/src/chatmd/security/kernel_gate.py +91 -0
  52. chatmd-0.2.7/src/chatmd/skills/__init__.py +5 -0
  53. chatmd-0.2.7/src/chatmd/skills/ai.py +233 -0
  54. chatmd-0.2.7/src/chatmd/skills/base.py +81 -0
  55. chatmd-0.2.7/src/chatmd/skills/bind.py +244 -0
  56. chatmd-0.2.7/src/chatmd/skills/builtin.py +610 -0
  57. chatmd-0.2.7/src/chatmd/skills/canvas.py +341 -0
  58. chatmd-0.2.7/src/chatmd/skills/confirm.py +67 -0
  59. chatmd-0.2.7/src/chatmd/skills/cron.py +518 -0
  60. chatmd-0.2.7/src/chatmd/skills/hot_reload.py +109 -0
  61. chatmd-0.2.7/src/chatmd/skills/inbox.py +132 -0
  62. chatmd-0.2.7/src/chatmd/skills/infra.py +272 -0
  63. chatmd-0.2.7/src/chatmd/skills/loader.py +303 -0
  64. chatmd-0.2.7/src/chatmd/skills/notify.py +137 -0
  65. chatmd-0.2.7/src/chatmd/skills/upload.py +320 -0
  66. chatmd-0.2.7/src/chatmd/watcher/__init__.py +1 -0
  67. chatmd-0.2.7/src/chatmd/watcher/auto_upload.py +166 -0
  68. chatmd-0.2.7/src/chatmd/watcher/file_watcher.py +186 -0
  69. chatmd-0.2.7/src/chatmd/watcher/suffix_trigger.py +91 -0
  70. chatmd-0.2.7/tests/__init__.py +0 -0
  71. chatmd-0.2.7/tests/conftest.py +51 -0
  72. chatmd-0.2.7/tests/test_ai_preserve_text.py +147 -0
  73. chatmd-0.2.7/tests/test_ai_skills.py +98 -0
  74. chatmd-0.2.7/tests/test_ai_writing_skills.py +200 -0
  75. chatmd-0.2.7/tests/test_auto_upload.py +349 -0
  76. chatmd-0.2.7/tests/test_bind_skill.py +236 -0
  77. chatmd-0.2.7/tests/test_bot_notification.py +299 -0
  78. chatmd-0.2.7/tests/test_builtin_skills.py +160 -0
  79. chatmd-0.2.7/tests/test_canvas_skill.py +327 -0
  80. chatmd-0.2.7/tests/test_config.py +89 -0
  81. chatmd-0.2.7/tests/test_confirm.py +313 -0
  82. chatmd-0.2.7/tests/test_cron_inline.py +189 -0
  83. chatmd-0.2.7/tests/test_cron_integration.py +501 -0
  84. chatmd-0.2.7/tests/test_cron_parser.py +471 -0
  85. chatmd-0.2.7/tests/test_cron_safety.py +186 -0
  86. chatmd-0.2.7/tests/test_cron_scheduler.py +400 -0
  87. chatmd-0.2.7/tests/test_cron_skill.py +191 -0
  88. chatmd-0.2.7/tests/test_cron_skill_extended.py +206 -0
  89. chatmd-0.2.7/tests/test_cron_state.py +249 -0
  90. chatmd-0.2.7/tests/test_daily_note_skill.py +299 -0
  91. chatmd-0.2.7/tests/test_datetime_skills.py +167 -0
  92. chatmd-0.2.7/tests/test_e2e.py +170 -0
  93. chatmd-0.2.7/tests/test_e2e_v020.py +298 -0
  94. chatmd-0.2.7/tests/test_e2e_v022.py +291 -0
  95. chatmd-0.2.7/tests/test_fence_parser.py +241 -0
  96. chatmd-0.2.7/tests/test_file_watcher_assistant.py +134 -0
  97. chatmd-0.2.7/tests/test_file_writer.py +91 -0
  98. chatmd-0.2.7/tests/test_git_sync.py +129 -0
  99. chatmd-0.2.7/tests/test_git_utils.py +201 -0
  100. chatmd-0.2.7/tests/test_graceful_shutdown.py +363 -0
  101. chatmd-0.2.7/tests/test_hot_reload.py +61 -0
  102. chatmd-0.2.7/tests/test_i18n.py +114 -0
  103. chatmd-0.2.7/tests/test_inbox_skill.py +153 -0
  104. chatmd-0.2.7/tests/test_index_manager.py +58 -0
  105. chatmd-0.2.7/tests/test_init.py +70 -0
  106. chatmd-0.2.7/tests/test_inline_cmd.py +158 -0
  107. chatmd-0.2.7/tests/test_interaction_dir.py +150 -0
  108. chatmd-0.2.7/tests/test_kernel_gate.py +104 -0
  109. chatmd-0.2.7/tests/test_litestartup_provider.py +281 -0
  110. chatmd-0.2.7/tests/test_markdown_skills.py +230 -0
  111. chatmd-0.2.7/tests/test_migrations.py +328 -0
  112. chatmd-0.2.7/tests/test_mode.py +186 -0
  113. chatmd-0.2.7/tests/test_network_placeholder.py +179 -0
  114. chatmd-0.2.7/tests/test_new_session.py +271 -0
  115. chatmd-0.2.7/tests/test_notification.py +281 -0
  116. chatmd-0.2.7/tests/test_notify_skill.py +564 -0
  117. chatmd-0.2.7/tests/test_offline_queue.py +78 -0
  118. chatmd-0.2.7/tests/test_output_format.py +173 -0
  119. chatmd-0.2.7/tests/test_parser.py +127 -0
  120. chatmd-0.2.7/tests/test_parser_enhanced.py +208 -0
  121. chatmd-0.2.7/tests/test_plugin_loader.py +461 -0
  122. chatmd-0.2.7/tests/test_po_validation.py +684 -0
  123. chatmd-0.2.7/tests/test_providers.py +384 -0
  124. chatmd-0.2.7/tests/test_readme_smoke.py +438 -0
  125. chatmd-0.2.7/tests/test_reference_resolver.py +243 -0
  126. chatmd-0.2.7/tests/test_router.py +121 -0
  127. chatmd-0.2.7/tests/test_router_conflict.py +109 -0
  128. chatmd-0.2.7/tests/test_scheduler.py +147 -0
  129. chatmd-0.2.7/tests/test_service.py +215 -0
  130. chatmd-0.2.7/tests/test_skill_loader.py +95 -0
  131. chatmd-0.2.7/tests/test_state.py +86 -0
  132. chatmd-0.2.7/tests/test_suffix_integration.py +165 -0
  133. chatmd-0.2.7/tests/test_suffix_trigger.py +60 -0
  134. chatmd-0.2.7/tests/test_system_channel.py +69 -0
  135. chatmd-0.2.7/tests/test_upgrade.py +87 -0
  136. chatmd-0.2.7/tests/test_upload_skill.py +421 -0
@@ -0,0 +1,31 @@
1
+ # Python
2
+ __pycache__/
3
+ *.pyc
4
+ *.pyo
5
+ *.egg-info/
6
+ dist/
7
+ build/
8
+ .venv/
9
+ .eggs/
10
+
11
+ # IDE
12
+ .vscode/
13
+ .idea/
14
+
15
+ # ChatMD runtime (user workspace, not this repo)
16
+ # .chatmd/state.json
17
+ # .chatmd/tasks.json
18
+ # .chatmd/queue.json
19
+ # .chatmd/logs/
20
+
21
+ # Secrets
22
+ .env
23
+
24
+ # OS
25
+ .DS_Store
26
+ Thumbs.db
27
+
28
+ # Test / coverage
29
+ .coverage
30
+ htmlcov/
31
+ .pytest_cache/
@@ -0,0 +1,196 @@
1
+ # Changelog
2
+
3
+ > Format follows [Keep a Changelog](https://keepachangelog.com/). Versioning follows [Semantic Versioning](https://semver.org/).
4
+
5
+ ---
6
+
7
+ ## [0.2.7] — 2026-04-15
8
+
9
+ Windows Service management + `/notify` channel filtering + multi-service convenience commands.
10
+
11
+ ### Added
12
+
13
+ - **Windows Service (pywin32)**: proper SCM-managed Windows Service replacing Task Scheduler
14
+ - `chatmd service install -w <path>` — install per-workspace service with auto-start
15
+ - Auto-detect `pywin32_postinstall.py` DLL status with clear fix instructions
16
+ - Idempotent install (existing service auto-removed before reinstall)
17
+ - Failure recovery: auto-restart on crash (5s delay, max 3/day)
18
+ - **Multi-service convenience commands**:
19
+ - `chatmd service status` (no `-w`) — list all installed ChatMD services
20
+ - `chatmd service uninstall --all` — uninstall all ChatMD services at once
21
+ - **`/notify` channel filtering**: target specific notification channels
22
+ - `/notify(email) msg` — send via email only
23
+ - `/notify(bot) msg` — send via Bot only
24
+ - `/notify(email,bot) msg` — send via email + Bot
25
+ - `/notify msg` — all channels (default, unchanged)
26
+ - `chatmd init` now creates `.chatmd/agent.yaml.example` + `.chatmd/user.yaml.example` (committed to git as safe templates)
27
+ - `.chatmd/agent.yaml` and `.chatmd/user.yaml` added to workspace `.gitignore` (may contain API keys)
28
+
29
+ ### Fixed
30
+
31
+ - Windows Service Error 1073 (service already exists) — idempotent reinstall
32
+ - Windows Service Error 1053 (DLL / PythonPath / SCM issues) — auto-detection + registry fix
33
+
34
+ ---
35
+
36
+ ## [0.2.6] — 2026-04-14
37
+
38
+ `/sync` quality improvements + Bot notification pipeline + CI.
39
+
40
+ ### Added
41
+
42
+ - `/sync` detailed feedback: shows `↓N pulled, ↑N pushed` counts
43
+ - `chatmd upgrade` migration 0.2.4→0.2.5: auto-add `.gitignore` runtime patterns
44
+ - LiteStartup `POST /api/bot/notify` — push notifications to bound Telegram Bot
45
+ - LiteStartup `POST /api/bot/sync-complete` — reset pending messages after sync
46
+ - GitHub Actions CI: Ruff lint + pytest (Python 3.10–3.13, ubuntu/windows/macos)
47
+
48
+ ---
49
+
50
+ ## [0.2.5] — 2026-04-14
51
+
52
+ Bot binding + reverse notifications + inbox + security fixes.
53
+
54
+ ### Added
55
+
56
+ - `/bind <token>` — one-step Telegram Bot binding (auto-detect git remote, SSH→HTTPS)
57
+ - `BotNotificationChannel` — push notifications to Telegram Bot
58
+ - `/inbox` — view messages received via Bot
59
+ - Inbox deduplication (monotonic `message_id`)
60
+ - Timezone support for Bot messages (`notification.bot.timezone` config)
61
+
62
+ ### Security
63
+
64
+ - `strip_url_credentials()` — strip plaintext credentials from repo URLs before API calls
65
+ - `mask_repo_url()` — sanitize repo URLs for display
66
+
67
+ ---
68
+
69
+ ## [0.2.4] — 2026-04-13
70
+
71
+ Confirmation window + open-source preparation + CLI improvements.
72
+
73
+ ### Added
74
+
75
+ - Confirmation window for destructive commands (`/sync`, `/upload`, `/new`)
76
+ - `chatmd restart` / `chatmd upgrade -w <path>` CLI commands
77
+ - `CONTRIBUTING.md` for open-source contributors
78
+
79
+ ---
80
+
81
+ ## [0.2.3] — 2026-04-12
82
+
83
+ Custom Skill plugins + Git Sync Cron + `/notify` notifications.
84
+
85
+ ### Added
86
+
87
+ - Custom Skill plugin system (YAML declarative + Python dynamic)
88
+ - `/notify` — send notifications through file/desktop/email channels
89
+ - Git Sync as Cron job (`@every 5m /sync`)
90
+ - Cron task management: `/cron list`, `/cron pause`, `/cron resume`
91
+
92
+ ---
93
+
94
+ ## [0.2.2] — 2026-04-10
95
+
96
+ Cron scheduled tasks + Notification system + `/help` improvements.
97
+
98
+ ### Added
99
+
100
+ - Cron task engine (crontab syntax + `@every` intervals)
101
+ - Notification system (FileChannel + SystemChannel desktop toast)
102
+ - `/help` grouped by category with rich Markdown output
103
+
104
+ ---
105
+
106
+ ## [0.2.1] — 2026-04-02
107
+
108
+ Cross-platform startup experience improvements + configuration audit + code quality fixes.
109
+
110
+ ### Added
111
+
112
+ - `chatmd mode suffix/save` — trigger mode switching command
113
+ - `chatmd start --daemon` — background daemon mode (Unix nohup/double-fork + Windows pythonw)
114
+ - `chatmd service install/uninstall/status` — system service registration (systemd/launchd/Windows Service)
115
+ - Windows graceful shutdown via signal file (replaces SIGTERM)
116
+
117
+ ### Fixed
118
+
119
+ - Assistant mode (`--mode assistant`) now monitors all `.md` files across the entire workspace via `watch_dirs: ["."]`, with internal directories (`.chatmd`, `.git`, `node_modules`, etc.) excluded
120
+ - Windows `chatmd service install` and `_start_agent_now` now use `pythonw.exe` instead of `python.exe`, eliminating the cmd window popup when the service starts
121
+ - Removed unimplemented default config entries (`trigger.confirm`, `async.retry`, `commands.natural_language`, `display_name`, `preferences`) to avoid misleading users
122
+ - `KernelGate` now respects `logging.audit` config toggle
123
+ - `Scheduler` async task timeout (`async.timeout` config + watchdog timer)
124
+ - `file_writer` atomic write auto-retry + fallback on Windows PermissionError
125
+ - `logging.level` config now correctly applies to file log handler
126
+
127
+ ### Changed
128
+
129
+ - Recommend `pipx` as the primary installation method
130
+ - README updated with Python installation guide
131
+
132
+ ---
133
+
134
+ ## [0.2.0] — 2026-04-01
135
+
136
+ Provider unified abstraction + long text + AI writing + Canvas + upload + date/time + Markdown templates. 595 tests passed.
137
+
138
+ ### Added
139
+
140
+ - LiteStartupProvider unified abstraction (multi-endpoint routing: AI/upload, backward compatible)
141
+ - Parser extensions: `:::` fenced long text + `/cmd{text}` inline command + `@` reference markers
142
+ - AI writing commands: `/rewrite`, `/expand`, `/polish`, `/summary`, `/tag`, `/title`
143
+ - `/canvas` — AI Canvas mind map (structured AI output + tree layout + .canvas export)
144
+ - `/upload` — manual image upload + auto-upload mode (Watcher integration)
145
+ - `/new` — archive conversation and start new session
146
+ - Date/time extensions: `/datetime`, `/timestamp`, `/week`, `/weekday`, `/progress`, `/daynum`, `/countdown`
147
+ - Markdown templates: `/todo`, `/done`, `/table`, `/code`, `/link`, `/img`, `/hr`, `/heading`, `/quote`
148
+ - `/help` grouped by category (datetime/ai/markdown/utility/custom)
149
+
150
+ ### Fixed
151
+
152
+ - Alias conflict: `/q` restored to `/quote`
153
+
154
+ ---
155
+
156
+ ## [0.1.0] — 2026-03-30
157
+
158
+ First official release. 168 tests passed. 6 sprints, 35 development tasks.
159
+
160
+ ### Added
161
+
162
+ - Project skeleton: pyproject.toml + src/chatmd/ modular structure + CLI entry point
163
+ - `chatmd init` — workspace initialization (full/assistant mode + Git + config generation)
164
+ - `chatmd start/stop/status` — Agent lifecycle management (PID dedup + graceful stop)
165
+ - `chatmd upgrade --full` — assistant → full workspace conversion
166
+ - Config loading (agent.yaml + user.yaml + defaults merge + ${ENV} variable resolution)
167
+ - FileWatcher (watchdog + 300ms debounce + Agent write-back filter)
168
+ - Parser (`/command(args) input` syntax + `@ai{}` inline/multi-line + code block protection)
169
+ - Router (deterministic match + alias chain resolution + Levenshtein fuzzy suggestions)
170
+ - FileWriter (task ID anchor replacement + atomic write + thread-lock serialization)
171
+ - Scheduler (sync/async task dispatch + 6-state machine + ThreadPool)
172
+ - AI Skills: `/ask` conversation + `/translate` multi-language translation
173
+ - LiteAgent AI Provider (httpx + timeout/401/429 error handling)
174
+ - KernelGate security filter (AI output `/command` escaping + audit log)
175
+ - Multi-turn AI conversation context (ChatSession + max_turns truncation)
176
+ - Multi-session state management (StateManager + JSON persistence)
177
+ - Offline queue (OfflineQueue + FIFO + disk persistence)
178
+ - Git auto-sync + `/sync` (auto-commit + pull --rebase + push)
179
+ - Suffix signal trigger (SuffixTrigger + custom marker + enable/disable)
180
+ - Confirmation window (ConfirmationWindow + delay timer + delete-to-cancel)
181
+ - `@ai{}` enhanced (inline + multi-line block + code block protection)
182
+ - YAML/Python Skill Loader (declarative templates + dynamic import)
183
+ - Command conflict detection and priority (builtin > ai > custom > remote)
184
+ - Skill hot reload (SkillReloader + YAML/Python dynamic loading)
185
+ - `chat/_index.md` auto-maintenance (IndexManager)
186
+ - Built-in Skills: `/help`, `/date`, `/time`, `/now`, `/status`, `/list`, `/log`, `/sync`
187
+
188
+ ### Fixed
189
+
190
+ - Skill base class `field()` compatibility on non-dataclass ABC
191
+
192
+ ---
193
+
194
+ ## [0.0.0] — 2026-03-30
195
+
196
+ Project initialization.
@@ -0,0 +1,146 @@
1
+ # Contributing to ChatMarkdown
2
+
3
+ Thank you for your interest in contributing to ChatMarkdown! This guide will help you get started.
4
+
5
+ ## Quick Start
6
+
7
+ ```bash
8
+ # 1. Fork and clone
9
+ git clone https://github.com/<your-username>/chatmd.git
10
+ cd chatmd
11
+
12
+ # 2. Create a virtual environment
13
+ python -m venv .venv
14
+ source .venv/bin/activate # Linux/macOS
15
+ # .venv\Scripts\activate # Windows
16
+
17
+ # 3. Install dev dependencies
18
+ pip install -e ".[dev]"
19
+
20
+ # 4. Verify everything works
21
+ pytest
22
+ ruff check src/
23
+ ```
24
+
25
+ ## Development Guidelines
26
+
27
+ ### Code Style
28
+
29
+ - **Python 3.10+** — use modern type hints (`list[str]`, `X | None`)
30
+ - **Ruff** for linting — run `ruff check src/ tests/` before committing
31
+ - **100-character** line width
32
+ - **Google-style** docstrings for all public functions
33
+ - **English** for all code, comments, variable names, and commit messages
34
+
35
+ ### Testing
36
+
37
+ - **pytest + pytest-asyncio** — tests live in `tests/`
38
+ - Run the full suite: `pytest`
39
+ - Run with coverage: `coverage run -m pytest && coverage report`
40
+ - Markers: `@pytest.mark.unit`, `@pytest.mark.integration`, `@pytest.mark.e2e`, `@pytest.mark.slow`
41
+ - **All new features must include tests** — aim for ≥ 80% coverage
42
+
43
+ ### Commit Messages
44
+
45
+ We follow [Conventional Commits](https://www.conventionalcommits.org/):
46
+
47
+ ```
48
+ <type>(<scope>): <description>
49
+ ```
50
+
51
+ **Types**: `feat`, `fix`, `docs`, `test`, `refactor`, `chore`, `ci`, `perf`
52
+
53
+ **Examples**:
54
+ - `feat(skills): add /weather skill`
55
+ - `fix(parser): handle empty lines in fenced blocks`
56
+ - `docs: update README with new CLI commands`
57
+ - `test(cron): add persistence edge case tests`
58
+
59
+ ### Branch Strategy
60
+
61
+ | Branch | Purpose |
62
+ |--------|---------|
63
+ | `main` | Stable releases |
64
+ | `dev` | Integration branch |
65
+ | `feat/<name>` | New features |
66
+ | `fix/<name>` | Bug fixes |
67
+
68
+ ## How to Contribute
69
+
70
+ ### Reporting Bugs
71
+
72
+ 1. Search [existing issues](https://github.com/litestartup-com/chatmd/issues) first
73
+ 2. Use the **Bug Report** issue template
74
+ 3. Include: Python version, OS, steps to reproduce, expected vs actual behavior
75
+
76
+ ### Suggesting Features
77
+
78
+ 1. Open a **Feature Request** issue
79
+ 2. Describe the use case and expected behavior
80
+ 3. We'll discuss feasibility before implementation
81
+
82
+ ### Submitting Pull Requests
83
+
84
+ 1. **Fork** the repo and create a branch from `dev`
85
+ 2. **Write tests** for your changes
86
+ 3. **Run checks** before pushing:
87
+ ```bash
88
+ pytest
89
+ ruff check src/ tests/
90
+ ```
91
+ 4. **Open a PR** against `dev` with a clear description
92
+ 5. Link related issues (e.g., "Closes #42")
93
+
94
+ ### Creating Custom Skills
95
+
96
+ ChatMarkdown supports a plugin system for custom skills. See [`rules/custom_skills.md`](rules/custom_skills.md) for the full guide.
97
+
98
+ Quick overview:
99
+ 1. Create a Python module with a class extending `Skill`
100
+ 2. Register it in `.chatmd/skills.yaml`
101
+ 3. Skills support `configure()` / `teardown()` lifecycle hooks
102
+
103
+ ## Project Structure
104
+
105
+ ```
106
+ src/chatmd/
107
+ ├── cli.py # CLI entry point (Click)
108
+ ├── commands/ # CLI subcommands (init, start, stop, upgrade)
109
+ ├── engine/ # Core engine (parser, router, agent, scheduler, cron)
110
+ ├── watcher/ # File watcher + suffix trigger
111
+ ├── skills/ # Built-in skills (ai, cron, infra, builtin)
112
+ ├── providers/ # AI provider backends
113
+ ├── security/ # KernelGate safety checks
114
+ ├── infra/ # Config, file writer, git sync, notifications
115
+ └── i18n/ # Internationalization (en, zh_CN)
116
+
117
+ tests/ # All tests (unit, integration, e2e)
118
+ rules/ # Development rules and conventions
119
+ docs/ # Project documentation
120
+ ```
121
+
122
+ ## i18n
123
+
124
+ - All user-facing strings use `t("key.name")` from `chatmd.i18n`
125
+ - Default locale: `en`, supported: `zh-CN`
126
+ - **Never hardcode user-facing text** — always use i18n keys
127
+ - Add keys to both `i18n/en.py` and `i18n/zh_CN.py`
128
+
129
+ ## Security
130
+
131
+ - **No hardcoded API keys** — use environment variables or `.env`
132
+ - Commands in `security/kernel_gate.py` blacklist are blocked
133
+ - Destructive operations require explicit `/confirm`
134
+
135
+ ## Code of Conduct
136
+
137
+ Be respectful, constructive, and inclusive. We follow the [Contributor Covenant](https://www.contributor-covenant.org/) Code of Conduct.
138
+
139
+ ## License
140
+
141
+ By contributing, you agree that your contributions will be licensed under the [MIT License](LICENSE).
142
+
143
+ ## Questions?
144
+
145
+ - Open a [Discussion](https://github.com/litestartup-com/chatmd/discussions) for general questions
146
+ - Check the [README](README.md) for usage documentation
chatmd-0.2.7/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Litestartup
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.