@hy-sde-org/dsh-git 0.1.1-rc.2 → 0.1.5-rc.1

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 (64) hide show
  1. package/LICENSE +4 -5
  2. package/README.md +13 -3
  3. package/dist/conventional/commit-types-data.d.ts +23 -0
  4. package/dist/conventional/commit-types-data.d.ts.map +1 -0
  5. package/dist/conventional/commit-types-data.js +437 -0
  6. package/dist/conventional/commit-types-data.js.map +1 -0
  7. package/dist/conventional/commit-types.d.ts +63 -0
  8. package/dist/conventional/commit-types.d.ts.map +1 -0
  9. package/dist/conventional/commit-types.js +236 -0
  10. package/dist/conventional/commit-types.js.map +1 -0
  11. package/dist/conventional/index.d.ts +19 -0
  12. package/dist/conventional/index.d.ts.map +1 -0
  13. package/dist/conventional/index.js +19 -0
  14. package/dist/conventional/index.js.map +1 -0
  15. package/dist/conventional/normalization.d.ts +59 -0
  16. package/dist/conventional/normalization.d.ts.map +1 -0
  17. package/dist/conventional/normalization.js +355 -0
  18. package/dist/conventional/normalization.js.map +1 -0
  19. package/dist/conventional/text.d.ts +20 -0
  20. package/dist/conventional/text.d.ts.map +1 -0
  21. package/dist/conventional/text.js +51 -0
  22. package/dist/conventional/text.js.map +1 -0
  23. package/dist/conventional/types.d.ts +35 -0
  24. package/dist/conventional/types.d.ts.map +1 -0
  25. package/dist/conventional/types.js +8 -0
  26. package/dist/conventional/types.js.map +1 -0
  27. package/dist/conventional/validation-data.d.ts +22 -0
  28. package/dist/conventional/validation-data.d.ts.map +1 -0
  29. package/dist/conventional/validation-data.js +2543 -0
  30. package/dist/conventional/validation-data.js.map +1 -0
  31. package/dist/conventional/validation.d.ts +89 -0
  32. package/dist/conventional/validation.d.ts.map +1 -0
  33. package/dist/conventional/validation.js +343 -0
  34. package/dist/conventional/validation.js.map +1 -0
  35. package/dist/diff.d.ts +1 -1
  36. package/dist/diff.d.ts.map +1 -1
  37. package/dist/diff.js +18 -5
  38. package/dist/diff.js.map +1 -1
  39. package/dist/index.d.ts +5 -1
  40. package/dist/index.d.ts.map +1 -1
  41. package/dist/index.js +5 -1
  42. package/dist/index.js.map +1 -1
  43. package/dist/repo-lock.d.ts +26 -0
  44. package/dist/repo-lock.d.ts.map +1 -0
  45. package/dist/repo-lock.js +53 -0
  46. package/dist/repo-lock.js.map +1 -0
  47. package/dist/service.d.ts +10 -3
  48. package/dist/service.d.ts.map +1 -1
  49. package/dist/service.js +27 -14
  50. package/dist/service.js.map +1 -1
  51. package/dist/types.d.ts +2 -2
  52. package/dist/types.d.ts.map +1 -1
  53. package/dist/types.js +1 -1
  54. package/dist/vcs.d.ts +149 -0
  55. package/dist/vcs.d.ts.map +1 -0
  56. package/dist/vcs.js +209 -0
  57. package/dist/vcs.js.map +1 -0
  58. package/dist/worktree.d.ts +269 -0
  59. package/dist/worktree.d.ts.map +1 -0
  60. package/dist/worktree.js +642 -0
  61. package/dist/worktree.js.map +1 -0
  62. package/examples/agent-preset/agent.cordis.yml +1 -1
  63. package/examples/agent-preset/preset.yml +1 -1
  64. package/package.json +32 -12
package/LICENSE CHANGED
@@ -2,11 +2,10 @@ MIT License
2
2
 
3
3
  Copyright (c) 2026 hy-sde
4
4
 
5
- This repository is a port of the oh-my-pi memory surface (retain / recall /
6
- reflect / memory_edit / learn and the durable project-scoped local memory
7
- backend) onto the DeepSeek Harness `ctx.memory` service contract — see
8
- port_omp.md item 4 in the hy-sde fork. The ported portions are distributed
9
- under the same MIT license with their original copyright held by their
5
+ This repository is a port of the oh-my-pi (omp) agentic git commit + review
6
+ surface onto the DeepSeek Harness `ctx.git` service contract. The ported
7
+ portions are distributed under the same MIT license with their original
8
+ copyright held by their
10
9
  respective authors:
11
10
 
12
11
  Copyright (c) 2025 Mario Zechner
package/README.md CHANGED
@@ -8,12 +8,22 @@ directly.
8
8
 
9
9
  - `GitService` — `run` / `status` / `diffText` / `diffStat` /
10
10
  `stagedFiles` / `resetIndex` / `stageHunks` / `commit` / `log` /
11
- `currentBranch` / `isWorktree`.
11
+ `currentBranch` / `isWorktree`, plus `push` with remote/branch/upstream
12
+ options and `root` for the review gate.
12
13
  - `parseFileDiffs` / `parseNumstat` / `computeDependencyOrder` /
13
14
  `LOCK_FILES` — pure diff + topo-sort + lock-file primitives.
15
+ - `vcs` — TS contract port of omp's native `pi-vcs` surface (error taxonomy,
16
+ repo discovery, newline-safe `joinPatches`, HEAD stat-poll `watch`).
17
+ - `withRepoLock` — in-process per-repository mutation queue (`repo-lock`).
18
+ - `acquireWorktree` / `releaseWorktree` / `listWorktrees` / `pruneWorktrees`
19
+ / `destroyWorktree` — a durable-lease worktree pool with dry-run safety
20
+ (`worktree`).
21
+ - `conventional` — llm-git canonical commit-type vocabulary plus commit
22
+ message normalization / validation (scopes, summaries, bodies, pep-595
23
+ length rules).
14
24
  - `apply(ctx, config)` registers `ctx.git` (subprocess seam required).
15
25
 
16
- Port of omp (oh-my-pi)'s git layer — see `port_omp.md` item: commit. The
26
+ Port of omp (oh-my-pi)'s git layer — see LICENSE. The
17
27
  service owns no durable state and shells out per call, so one host instance
18
28
  serves every session; which repo the tools act on comes from the calling
19
29
  agent's session cwd at call time.
@@ -36,5 +46,5 @@ mount from any user preset that copies `examples/agent-preset/`.
36
46
  pnpm install
37
47
  pnpm run check # tsc --noEmit
38
48
  pnpm run build # tsc -p tsconfig.build.json → dist/
39
- pnpm run test # vitest (20 unit + 8 real-repo integration)
49
+ pnpm run test # vitest (89 tests: conventional/repo-lock/vcs/worktree/service/unit on real temp repos)
40
50
  ```
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Conventional-commit type vocabulary (llm-git canonical classification).
3
+ * Ported verbatim from omp's `commit/conventional/resources/commit_types.json`.
4
+ * @module @hy-sde-org/dsh-git/conventional/commit-types-data
5
+ */
6
+ /** One entry of the llm-git commit-type vocabulary resource. */
7
+ export interface CommitTypeEntry {
8
+ name: string;
9
+ description: string;
10
+ diff_indicators?: string[];
11
+ examples: string[];
12
+ file_patterns?: string[];
13
+ hint?: string;
14
+ aliases: string[];
15
+ }
16
+ /** Shape of the verbatim `commit_types.json` resource. */
17
+ export interface CommitTypesResource {
18
+ classifier_hint: string;
19
+ types: CommitTypeEntry[];
20
+ }
21
+ /** Verbatim llm-git commit-type table (22 canonical types + aliases). */
22
+ export declare const COMMIT_TYPES_RESOURCE: CommitTypesResource;
23
+ //# sourceMappingURL=commit-types-data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commit-types-data.d.ts","sourceRoot":"","sources":["../../src/conventional/commit-types-data.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,gEAAgE;AAChE,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;IAC1B,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IACxB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,EAAE,CAAA;CAClB;AAED,0DAA0D;AAC1D,MAAM,WAAW,mBAAmB;IAClC,eAAe,EAAE,MAAM,CAAA;IACvB,KAAK,EAAE,eAAe,EAAE,CAAA;CACzB;AAED,yEAAyE;AACzE,eAAO,MAAM,qBAAqB,EAAE,mBA8anC,CAAA"}
@@ -0,0 +1,437 @@
1
+ /**
2
+ * Conventional-commit type vocabulary (llm-git canonical classification).
3
+ * Ported verbatim from omp's `commit/conventional/resources/commit_types.json`.
4
+ * @module @hy-sde-org/dsh-git/conventional/commit-types-data
5
+ */
6
+ /** Verbatim llm-git commit-type table (22 canonical types + aliases). */
7
+ export const COMMIT_TYPES_RESOURCE = {
8
+ 'classifier_hint': 'CRITICAL disambiguation rules:\n- feat vs refactor: feat=ANY observable behavior change OR new public API; refactor=provably unchanged (same tests, same API). When in doubt, prefer feat.\n- fix vs hotfix: hotfix=critical production emergency; fix=normal bug.\n- fix vs security: security=proactive hardening, CVE patches, auth hardening; fix=non-security bugs.\n- deps vs chore: deps=dependency version bumps only; chore=other maintenance (tooling, scripts).\n- deps vs build: build=build system scripts/config; deps=bumping library versions in manifests.\n- config vs chore: config=application/runtime config; chore=dev tooling and housekeeping.\n- ux vs feat: ux=existing feature made easier/clearer; feat=new capability.\n- init=bootstrap commit for a project or major subsystem; use once.\n- wip=in-progress save-point; prefer a real type for finished commits.\n- hack=deliberate temporary workaround; body must note intent to revisit.\n- merge=merge/sync commits with no standalone logic change.',
9
+ 'types': [
10
+ {
11
+ 'name': 'feat',
12
+ 'description': 'New public API surface OR user-observable capability/behavior change',
13
+ 'diff_indicators': [
14
+ 'pub fn',
15
+ 'pub struct',
16
+ 'pub enum',
17
+ 'export function',
18
+ '#[arg]',
19
+ ],
20
+ 'examples': [
21
+ 'Added pub fn process_batch() → feat (new API)',
22
+ 'Migrated HTTP client to async → feat (behavior change)',
23
+ ],
24
+ 'hint': 'ANY observable behavior change OR new public API. When unsure between feat and refactor, prefer feat.',
25
+ 'aliases': [
26
+ 'feature',
27
+ 'features',
28
+ 'enhancement',
29
+ 'enhancements',
30
+ ],
31
+ },
32
+ {
33
+ 'name': 'fix',
34
+ 'description': 'Fixes incorrect behavior (bugs, crashes, wrong outputs, race conditions)',
35
+ 'diff_indicators': [
36
+ 'unwrap() → ?',
37
+ 'bounds check',
38
+ 'off-by-one',
39
+ 'error handling',
40
+ ],
41
+ 'examples': [
42
+ 'Corrected off-by-one in pagination offset → fix (wrong output)',
43
+ 'Guarded against panic on empty input → fix (crash)',
44
+ ],
45
+ 'hint': 'Non-security bug fixes. Security-motivated fix → security; production emergency → hotfix.',
46
+ 'aliases': [
47
+ 'bug',
48
+ 'bugfix',
49
+ 'bugfixes',
50
+ ],
51
+ },
52
+ {
53
+ 'name': 'refactor',
54
+ 'description': 'Internal restructuring with provably unchanged behavior',
55
+ 'diff_indicators': [
56
+ 'rename',
57
+ 'extract',
58
+ 'consolidate',
59
+ 'reorganize',
60
+ ],
61
+ 'examples': [
62
+ 'Renamed internal module structure → refactor (no API change)',
63
+ 'Extracted shared helper from three call sites → refactor',
64
+ ],
65
+ 'hint': 'Requires proof: same tests pass, same API. If behavior changes, use feat.',
66
+ 'aliases': [
67
+ 'refactoring',
68
+ 'refactors',
69
+ 'rework',
70
+ 'rewrite',
71
+ 'cleanup',
72
+ ],
73
+ },
74
+ {
75
+ 'name': 'docs',
76
+ 'description': 'Documentation only changes',
77
+ 'diff_indicators': [
78
+ '///',
79
+ '//!',
80
+ 'README',
81
+ '/** */',
82
+ ],
83
+ 'file_patterns': [
84
+ '*.md',
85
+ 'doc comments',
86
+ ],
87
+ 'examples': [
88
+ 'Expanded README usage section → docs',
89
+ 'Added rustdoc examples to public API → docs',
90
+ ],
91
+ 'hint': 'Excludes prompt template files (prompts/*.md). Prompt changes are functional — use feat/fix/refactor.',
92
+ 'aliases': [
93
+ 'doc',
94
+ 'documentation',
95
+ ],
96
+ },
97
+ {
98
+ 'name': 'test',
99
+ 'description': 'Adding or modifying tests',
100
+ 'diff_indicators': [
101
+ '#[test]',
102
+ 'assert_eq!',
103
+ 'describe(',
104
+ 'it(',
105
+ 'expect(',
106
+ ],
107
+ 'file_patterns': [
108
+ '*_test.rs',
109
+ 'tests/',
110
+ '*.test.ts',
111
+ '*.spec.ts',
112
+ ],
113
+ 'examples': [
114
+ 'Added unit tests for parser edge cases → test',
115
+ 'Migrated suite to table-driven cases → test',
116
+ ],
117
+ 'hint': "Test-only changes. Production code touched alongside tests uses that code's type.",
118
+ 'aliases': [
119
+ 'tests',
120
+ 'testing',
121
+ ],
122
+ },
123
+ {
124
+ 'name': 'chore',
125
+ 'description': 'Housekeeping: tooling scripts, editor config, miscellaneous maintenance not covered by other types',
126
+ 'file_patterns': [
127
+ '.gitignore',
128
+ '*.lock',
129
+ '.editorconfig',
130
+ ],
131
+ 'examples': [
132
+ 'Updated .gitignore and editor config → chore',
133
+ 'Refreshed lockfile after unrelated change → chore',
134
+ ],
135
+ 'hint': 'Use deps for version bumps, config for app/env config, build for build scripts.',
136
+ 'aliases': [
137
+ 'housekeeping',
138
+ 'maintenance',
139
+ 'misc',
140
+ ],
141
+ },
142
+ {
143
+ 'name': 'style',
144
+ 'description': 'Formatting, whitespace changes (no logic change)',
145
+ 'diff_indicators': [
146
+ 'whitespace',
147
+ 'formatting',
148
+ 'indentation',
149
+ ],
150
+ 'examples': [
151
+ 'Reformatted with rustfmt, no logic change → style',
152
+ 'Normalized import ordering → style',
153
+ ],
154
+ 'hint': 'Variable/function renames are refactor, not style.',
155
+ 'aliases': [
156
+ 'format',
157
+ 'formatting',
158
+ 'reformat',
159
+ 'whitespace',
160
+ 'lint',
161
+ 'fmt',
162
+ ],
163
+ },
164
+ {
165
+ 'name': 'perf',
166
+ 'description': 'Performance improvements (proven faster)',
167
+ 'diff_indicators': [
168
+ 'optimization',
169
+ 'cache',
170
+ 'batch',
171
+ 'preallocate',
172
+ ],
173
+ 'examples': [
174
+ 'Cached repeated lookups to cut allocations → perf',
175
+ 'Replaced O(n^2) scan with hashmap → perf',
176
+ ],
177
+ 'hint': 'Requires evidence of a measurable improvement; speculative tidying is refactor.',
178
+ 'aliases': [
179
+ 'performance',
180
+ 'optimize',
181
+ 'optimise',
182
+ 'optimization',
183
+ ],
184
+ },
185
+ {
186
+ 'name': 'build',
187
+ 'description': 'Build system and toolchain configuration (build scripts, compiler/bundler settings)',
188
+ 'file_patterns': [
189
+ 'Cargo.toml',
190
+ 'package.json',
191
+ 'Makefile',
192
+ 'build.rs',
193
+ ],
194
+ 'examples': [
195
+ 'Added release profile to Cargo.toml → build',
196
+ 'Wired a new build script step → build',
197
+ ],
198
+ 'hint': 'Build scripts and tooling config. Bumping library versions in manifests → deps.',
199
+ 'aliases': [
200
+ 'buildsystem',
201
+ 'builder',
202
+ ],
203
+ },
204
+ {
205
+ 'name': 'ci',
206
+ 'description': 'CI/CD configuration',
207
+ 'file_patterns': [
208
+ '.github/workflows/',
209
+ '.gitlab-ci.yml',
210
+ '.circleci/',
211
+ ],
212
+ 'examples': [
213
+ 'Added a test matrix to GitHub Actions → ci',
214
+ 'Cached cargo registry between CI runs → ci',
215
+ ],
216
+ 'hint': 'Pipeline definitions and CI scripts. Runtime app config → config; IaC → infra.',
217
+ 'aliases': [
218
+ 'pipeline',
219
+ 'workflow',
220
+ 'actions',
221
+ 'cicd',
222
+ ],
223
+ },
224
+ {
225
+ 'name': 'revert',
226
+ 'description': 'Reverts a previous commit',
227
+ 'diff_indicators': [
228
+ 'Revert',
229
+ 'This reverts commit',
230
+ ],
231
+ 'examples': [
232
+ 'Reverted commit abc123 introducing the regression → revert',
233
+ ],
234
+ 'hint': 'Undoing a prior commit. A fresh fix that supersedes it is fix, not revert.',
235
+ 'aliases': [
236
+ 'reverts',
237
+ 'reversion',
238
+ ],
239
+ },
240
+ {
241
+ 'name': 'deps',
242
+ 'description': 'Dependency version bumps (Cargo.toml, package.json, go.mod, requirements.txt, etc.)',
243
+ 'diff_indicators': [
244
+ 'version = "',
245
+ '"^',
246
+ '~>',
247
+ 'go.sum',
248
+ ],
249
+ 'file_patterns': [
250
+ 'Cargo.toml',
251
+ 'package.json',
252
+ 'go.mod',
253
+ 'requirements.txt',
254
+ 'pyproject.toml',
255
+ ],
256
+ 'examples': [
257
+ 'Bumped serde 1.0.197 → 1.0.210 → deps',
258
+ 'Upgraded transitive deps via lockfile → deps',
259
+ ],
260
+ 'hint': 'Version bumps only. Build system changes belong in build; lockfile-only changes can be deps.',
261
+ 'aliases': [
262
+ 'dependency',
263
+ 'dependencies',
264
+ 'dep',
265
+ 'bump',
266
+ ],
267
+ },
268
+ {
269
+ 'name': 'security',
270
+ 'description': 'Security hardening, CVE patches, auth improvements, input sanitization, rate limiting',
271
+ 'diff_indicators': [
272
+ 'sanitize',
273
+ 'auth',
274
+ 'CVE',
275
+ 'rate limit',
276
+ 'HMAC',
277
+ 'escape',
278
+ ],
279
+ 'examples': [
280
+ 'Sanitized user input before the SQL query → security',
281
+ 'Added rate limiting to the login endpoint → security',
282
+ ],
283
+ 'hint': 'Use for proactive hardening too, not just bug fixes. Security-motivated fix → security, not fix.',
284
+ 'aliases': [
285
+ 'sec',
286
+ 'vuln',
287
+ 'vulnerability',
288
+ ],
289
+ },
290
+ {
291
+ 'name': 'config',
292
+ 'description': 'Application or environment configuration changes (.env, settings, feature flags, runtime config)',
293
+ 'file_patterns': [
294
+ '.env',
295
+ 'settings.toml',
296
+ 'config.yaml',
297
+ ],
298
+ 'examples': [
299
+ 'Added a feature flag for the new pipeline → config',
300
+ 'Raised the default request timeout → config',
301
+ ],
302
+ 'hint': 'App/runtime config. Build system config → build; CI config → ci; dev tooling → chore.',
303
+ 'aliases': [
304
+ 'configuration',
305
+ 'settings',
306
+ 'cfg',
307
+ ],
308
+ },
309
+ {
310
+ 'name': 'ux',
311
+ 'description': 'Usability and ergonomics improvements to existing interfaces (CLI flags, error messages, output formatting)',
312
+ 'diff_indicators': [
313
+ 'help text',
314
+ 'error message',
315
+ 'prompt',
316
+ '--flag',
317
+ ],
318
+ 'examples': [
319
+ 'Clarified an ambiguous error message → ux',
320
+ 'Added a short alias for an existing flag → ux',
321
+ ],
322
+ 'hint': 'Existing feature made easier/clearer → ux. New capability → feat.',
323
+ 'aliases': [
324
+ 'ui',
325
+ 'usability',
326
+ 'ergonomics',
327
+ ],
328
+ },
329
+ {
330
+ 'name': 'release',
331
+ 'description': 'Version bump and release preparation (CHANGELOG.md updates, version files, release tags)',
332
+ 'file_patterns': [
333
+ 'CHANGELOG.md',
334
+ 'CHANGELOG',
335
+ 'VERSION',
336
+ ],
337
+ 'examples': [
338
+ 'Bumped version to 2.1.0 and updated CHANGELOG → release',
339
+ 'Cut the v3 release notes → release',
340
+ ],
341
+ 'hint': 'Only for the release commit itself. Code changes alongside a release use their own type.',
342
+ 'aliases': [
343
+ 'releases',
344
+ 'versioning',
345
+ ],
346
+ },
347
+ {
348
+ 'name': 'hotfix',
349
+ 'description': 'Critical production fix requiring immediate patch, often on a dedicated hotfix branch',
350
+ 'examples': [
351
+ 'Patched a production auth bypass on the hotfix branch → hotfix',
352
+ 'Emergency rollback of a broken migration → hotfix',
353
+ ],
354
+ 'hint': 'Reserve for genuine production emergencies. Normal bugs → fix.',
355
+ 'aliases': [
356
+ 'hotfixes',
357
+ ],
358
+ },
359
+ {
360
+ 'name': 'infra',
361
+ 'description': 'Infrastructure-as-code changes (Terraform, Kubernetes manifests, Ansible, cloud config)',
362
+ 'file_patterns': [
363
+ '*.tf',
364
+ 'helm/',
365
+ 'terraform/',
366
+ 'k8s/',
367
+ 'ansible/',
368
+ ],
369
+ 'examples': [
370
+ 'Added a Terraform module for RDS → infra',
371
+ 'Tuned Kubernetes resource limits → infra',
372
+ ],
373
+ 'hint': 'IaC and cloud provisioning. App config → config; CI pipelines → ci.',
374
+ 'aliases': [
375
+ 'infrastructure',
376
+ 'iac',
377
+ ],
378
+ },
379
+ {
380
+ 'name': 'init',
381
+ 'description': 'Initial commit bootstrapping a project, module, or major subsystem',
382
+ 'examples': [
383
+ 'Scaffolded a new crate with cargo init → init',
384
+ 'Bootstrapped the auth subsystem skeleton → init',
385
+ ],
386
+ 'hint': 'Use once per project/module bootstrap. Subsequent setup → chore or build.',
387
+ 'aliases': [
388
+ 'initial',
389
+ 'bootstrap',
390
+ 'scaffold',
391
+ 'initialization',
392
+ ],
393
+ },
394
+ {
395
+ 'name': 'merge',
396
+ 'description': 'Merge or sync commit with no standalone logic change (merge branches, sync forks)',
397
+ 'examples': [
398
+ 'Merged the release branch back into main → merge',
399
+ 'Synced fork with upstream → merge',
400
+ ],
401
+ 'hint': 'Only when the commit is purely a merge. Squashed logic changes → use the appropriate type.',
402
+ 'aliases': [
403
+ 'merges',
404
+ 'sync',
405
+ 'merging',
406
+ ],
407
+ },
408
+ {
409
+ 'name': 'hack',
410
+ 'description': 'Deliberate temporary workaround or shortcut with known technical debt',
411
+ 'examples': [
412
+ 'Hardcoded a timeout pending the upstream fix → hack',
413
+ 'Stubbed the flaky call behind a guard → hack',
414
+ ],
415
+ 'hint': 'Must signal intent to revisit in the body (e.g., TODO: replace once X lands).',
416
+ 'aliases': [
417
+ 'hacks',
418
+ 'workaround',
419
+ 'hacky',
420
+ ],
421
+ },
422
+ {
423
+ 'name': 'wip',
424
+ 'description': 'Incomplete in-progress work not ready for review or release',
425
+ 'examples': [
426
+ 'Saved a partial refactor mid-progress → wip',
427
+ 'Checkpointed exploratory spike → wip',
428
+ ],
429
+ 'hint': 'Prefer a real type for finished commits. Use wip only for explicit save-points.',
430
+ 'aliases': [
431
+ 'inprogress',
432
+ 'work-in-progress',
433
+ ],
434
+ },
435
+ ],
436
+ };
437
+ //# sourceMappingURL=commit-types-data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commit-types-data.js","sourceRoot":"","sources":["../../src/conventional/commit-types-data.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAmBH,yEAAyE;AACzE,MAAM,CAAC,MAAM,qBAAqB,GAAwB;IAExD,iBAAiB,EAAE,0+BAA0+B;IAC7/B,OAAO,EAAE;QACP;YACE,MAAM,EAAE,MAAM;YACd,aAAa,EAAE,sEAAsE;YACrF,iBAAiB,EAAE;gBACjB,QAAQ;gBACR,YAAY;gBACZ,UAAU;gBACV,iBAAiB;gBACjB,QAAQ;aACT;YACD,UAAU,EAAE;gBACV,+CAA+C;gBAC/C,wDAAwD;aACzD;YACD,MAAM,EAAE,uGAAuG;YAC/G,SAAS,EAAE;gBACT,SAAS;gBACT,UAAU;gBACV,aAAa;gBACb,cAAc;aACf;SACF;QACD;YACE,MAAM,EAAE,KAAK;YACb,aAAa,EAAE,0EAA0E;YACzF,iBAAiB,EAAE;gBACjB,cAAc;gBACd,cAAc;gBACd,YAAY;gBACZ,gBAAgB;aACjB;YACD,UAAU,EAAE;gBACV,gEAAgE;gBAChE,oDAAoD;aACrD;YACD,MAAM,EAAE,2FAA2F;YACnG,SAAS,EAAE;gBACT,KAAK;gBACL,QAAQ;gBACR,UAAU;aACX;SACF;QACD;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ACtF,UAAU,EAAE;gBACV,qDAAqD;gBACrD,8CAA8C;aAC/C;YACD,MAAM,EAAE,+EAA+E;YACvF,SAAS,EAAE;gBACT,OAAO;gBACP,YAAY;gBACZ,OAAO;aACR;SACF;QACD;YACE,MAAM,EAAE,KAAK;YACb,aAAa,EAAE,6DAA6D;YAC5E,UAAU,EAAE;gBACV,6CAA6C;gBAC7C,sCAAsC;aACvC;YACD,MAAM,EAAE,iFAAiF;YACzF,SAAS,EAAE;gBACT,YAAY;gBACZ,kBAAkB;aACnB;SACF;KACF;CACF,CAAA"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Conventional-commit type vocabulary and coercion.
3
+ * Direct port of omp's `commit/conventional/commit-types.ts`, fed by the
4
+ * verbatim `commit_types.json` resource (see `./commit-types-data.ts`).
5
+ * @module @hy-sde-org/dsh-git/conventional/commit-types
6
+ */
7
+ import type { CommitType, ConventionalAnalysis, ConventionalCommit } from './types.ts';
8
+ /** Conventional commit types in llm-git's canonical classification order. */
9
+ export declare const COMMIT_TYPE_ORDER: readonly CommitType[];
10
+ /**
11
+ * Return whether a string is an accepted conventional commit type.
12
+ * @param value - any candidate type string.
13
+ * @returns true when `value` is one of the 22 canonical types.
14
+ */
15
+ export declare function isCommitType(value: string): value is CommitType;
16
+ /**
17
+ * Resolve a canonical commit type or configured alias.
18
+ * @param raw - a type, alias, or mixed-case type name.
19
+ * @returns the canonical type, or `undefined` when unresolvable.
20
+ */
21
+ export declare function canonicalCommitType(raw: string): CommitType | undefined;
22
+ /**
23
+ * Resolve a model-emitted type, falling back to `chore` when unknown.
24
+ * @param raw - a type, alias, or mixed-case type name.
25
+ * @returns the canonical type (never `undefined`).
26
+ */
27
+ export declare function coerceCommitType(raw: string): CommitType;
28
+ /**
29
+ * Resolve a model-emitted scope using llm-git's lossy two-segment normalization.
30
+ * @param raw - raw scope string or value.
31
+ * @returns the normalized scope, or `null` when empty/`none`/`n/a`.
32
+ */
33
+ export declare function coerceOptionalScope(raw: unknown): string | null;
34
+ /**
35
+ * Render the configured commit-type vocabulary (for analysis prompts).
36
+ * @returns one `- type: description (hint)` line per type, then the classifier hint.
37
+ */
38
+ export declare function formatTypesDescription(): string;
39
+ /**
40
+ * Normalize raw model analysis into the conventional commit domain.
41
+ * @param input - the raw analysis (`type`, optional `scope`/`summary`/`details`/`issueRefs`).
42
+ * @returns the normalized {@link ConventionalAnalysis}.
43
+ */
44
+ export declare function conventionalAnalysis(input: {
45
+ type: string;
46
+ scope?: unknown;
47
+ summary?: unknown;
48
+ details?: unknown;
49
+ issueRefs?: unknown;
50
+ }): ConventionalAnalysis;
51
+ /**
52
+ * Build a normalized conventional commit value.
53
+ * @param input - a raw commit (`type`, optional `scope`/`body`/`footers`, required `summary`).
54
+ * @returns the normalized {@link ConventionalCommit}.
55
+ */
56
+ export declare function conventionalCommit(input: {
57
+ type: string;
58
+ scope?: unknown;
59
+ summary: string;
60
+ body?: readonly string[];
61
+ footers?: readonly string[];
62
+ }): ConventionalCommit;
63
+ //# sourceMappingURL=commit-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commit-types.d.ts","sourceRoot":"","sources":["../../src/conventional/commit-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAqB,UAAU,EAAE,oBAAoB,EAAE,kBAAkB,EAAsB,MAAM,YAAY,CAAA;AAqB7H,6EAA6E;AAC7E,eAAO,MAAM,iBAAiB,EAAE,SAAS,UAAU,EAGlD,CAAA;AAwBD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,UAAU,CAE/D;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAIvE;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAExD;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAW/D;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,CAW/C;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE;IAC1C,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,GAAG,oBAAoB,CAWvB;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE;IACxC,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACxB,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAC5B,GAAG,kBAAkB,CAYrB"}