@eldrforge/kodrdriv 0.0.1 → 0.0.2

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.
@@ -11,7 +11,20 @@ const create = async (options)=>{
11
11
  try {
12
12
  logger.debug('Executing git diff');
13
13
  const excludeString = options.excludedPatterns.map((p)=>`':(exclude)${p}'`).join(' ');
14
- const command = options.cached ? `git diff --cached -- . ${excludeString}` : `git diff -- . ${excludeString}`;
14
+ let range = '';
15
+ if (options.from && options.to) {
16
+ range = `${options.from}..${options.to}`;
17
+ } else if (options.from) {
18
+ range = `${options.from}`;
19
+ } else if (options.to) {
20
+ range = `${options.to}`;
21
+ }
22
+ let command = '';
23
+ if (options.cached) {
24
+ command = `git diff --cached${range ? ' ' + range : ''} -- . ${excludeString}`;
25
+ } else {
26
+ command = `git diff${range ? ' ' + range : ''} -- . ${excludeString}`;
27
+ }
15
28
  const { stdout, stderr } = await run(command);
16
29
  if (stderr) {
17
30
  logger.warn('Git log produced stderr: %s', stderr);
@@ -1 +1 @@
1
- {"version":3,"file":"diff.js","sources":["../../src/content/diff.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { ExitError } from '../error/ExitError';\nimport { getLogger } from '../logging';\nimport { run } from '../util/child';\n\nexport interface Instance {\n get(): Promise<string>;\n}\n\nexport const create = async (options: { cached?: boolean, excludedPatterns: string[] }): Promise<Instance> => {\n const logger = getLogger();\n\n async function get(): Promise<string> {\n try {\n logger.verbose('Gathering change information from Git');\n\n try {\n logger.debug('Executing git diff');\n const excludeString = options.excludedPatterns.map(p => `':(exclude)${p}'`).join(' ');\n const command = options.cached ? `git diff --cached -- . ${excludeString}` : `git diff -- . ${excludeString}`;\n const { stdout, stderr } = await run(command);\n if (stderr) {\n logger.warn('Git log produced stderr: %s', stderr);\n }\n logger.debug('Git log output: %s', stdout);\n return stdout;\n } catch (error: any) {\n logger.error('Failed to execute git log: %s', error.message);\n throw error;\n }\n } catch (error: any) {\n logger.error('Error occurred during gather change phase: %s %s', error.message, error.stack);\n throw new ExitError('Error occurred during gather change phase');\n }\n }\n\n return { get };\n}\n\nexport const hasStagedChanges = async (): Promise<boolean> => {\n const logger = getLogger();\n try {\n logger.debug('Checking for staged changes');\n const { stderr } = await run('git diff --cached --quiet');\n if (stderr) {\n logger.warn('Git diff produced stderr: %s', stderr);\n }\n // If there are staged changes, git diff --cached --quiet will return non-zero\n // So if we get here without an error, there are no staged changes\n return false;\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n } catch (error: any) {\n // If we get an error, it means there are staged changes\n return true;\n }\n}\n"],"names":["create","options","logger","getLogger","get","verbose","debug","excludeString","excludedPatterns","map","p","join","command","cached","stdout","stderr","run","warn","error","message","stack","ExitError","hasStagedChanges"],"mappings":";;;;;AASO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAMA,SAAS,CAAOC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA;AACzB,CAAA,CAAA,CAAA,CAAA,CAAMC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAASC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA;CAEf,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAeC,GAAAA,CAAAA,CAAAA,CAAAA,CAAAA;QACX,CAAI,CAAA,CAAA,CAAA,CAAA;AACAF,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAOG,CAAO,CAAA,CAAA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AA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;;QAGA,OAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;AAGX,CAAA,CAAA,CAAA,CAAA,CAAA,CAAE,CAAOG,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAY,CAAA,CAAA,CAAA;;QAEjB,OAAO,CAAA,CAAA,CAAA,CAAA,CAAA;AACX,CAAA,CAAA,CAAA,CAAA,CAAA;AACJ,CAAA,CAAA;;"}
1
+ {"version":3,"file":"diff.js","sources":["../../src/content/diff.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { ExitError } from '../error/ExitError';\nimport { getLogger } from '../logging';\nimport { run } from '../util/child';\n\nexport interface Instance {\n get(): Promise<string>;\n}\n\nexport const create = async (options: { from?: string, to?: string, cached?: boolean, excludedPatterns: string[] }): Promise<Instance> => {\n const logger = getLogger();\n\n async function get(): Promise<string> {\n try {\n logger.verbose('Gathering change information from Git');\n\n try {\n logger.debug('Executing git diff');\n const excludeString = options.excludedPatterns.map(p => `':(exclude)${p}'`).join(' ');\n let range = '';\n if (options.from && options.to) {\n range = `${options.from}..${options.to}`;\n } else if (options.from) {\n range = `${options.from}`;\n } else if (options.to) {\n range = `${options.to}`;\n }\n let command = '';\n if (options.cached) {\n command = `git diff --cached${range ? ' ' + range : ''} -- . ${excludeString}`;\n } else {\n command = `git diff${range ? ' ' + range : ''} -- . ${excludeString}`;\n }\n const { stdout, stderr } = await run(command);\n if (stderr) {\n logger.warn('Git log produced stderr: %s', stderr);\n }\n logger.debug('Git log output: %s', stdout);\n return stdout;\n } catch (error: any) {\n logger.error('Failed to execute git log: %s', error.message);\n throw error;\n }\n } catch (error: any) {\n logger.error('Error occurred during gather change phase: %s %s', error.message, error.stack);\n throw new ExitError('Error occurred during gather change phase');\n }\n }\n\n return { get };\n}\n\nexport const hasStagedChanges = async (): Promise<boolean> => {\n const logger = getLogger();\n try {\n logger.debug('Checking for staged changes');\n const { stderr } = await run('git diff --cached --quiet');\n if (stderr) {\n logger.warn('Git diff produced stderr: %s', stderr);\n }\n // If there are staged changes, git diff --cached --quiet will return non-zero\n // So if we get here without an error, there are no staged changes\n return false;\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n } catch (error: any) {\n // If we get an error, it means there are staged changes\n return true;\n }\n}\n"],"names":["create","options","logger","getLogger","get","verbose","debug","excludeString","excludedPatterns","map","p","join","range","from","to","command","cached","stdout","stderr","run","warn","error","message","stack","ExitError","hasStagedChanges"],"mappings":";;;;;AASO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAMA,SAAS,CAAOC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA;AACzB,CAAA,CAAA,CAAA,CAAA,CAAMC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAASC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA;CAEf,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAeC,GAAAA,CAAAA,CAAAA,CAAAA,CAAAA;QACX,CAAI,CAAA,CAAA,CAAA,CAAA;AACAF,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAOG,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAC,uCAAA,CAAA,CAAA;YAEf,CAAI,CAAA,CAAA,CAAA,CAAA;AACAH,CAAAA,CAAAA,CAAAA,CAAA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A;;"}
@@ -10,7 +10,26 @@ const create = async (options)=>{
10
10
  logger.verbose('Gathering change information from Git');
11
11
  try {
12
12
  logger.debug('Executing git log');
13
- const { stdout, stderr } = await run(`git log ${options.from}..${options.to}`);
13
+ // Build git log range
14
+ let range = '';
15
+ let extraArgs = '';
16
+ // If currentBranchOnly, show only commits unique to HEAD vs. to-branch (or main/master if not provided)
17
+ if (options.currentBranchOnly) {
18
+ const toBranch = options.to || 'main'; // Default to 'main' if not provided
19
+ range = `${toBranch}..HEAD`;
20
+ } else if (options.from && options.to) {
21
+ range = `${options.from}..${options.to}`;
22
+ } else if (options.from) {
23
+ range = `${options.from}`;
24
+ } else if (options.to) {
25
+ range = `${options.to}`;
26
+ } // else, no range: show all
27
+ if (options.limit && options.limit > 0) {
28
+ extraArgs += ` -n ${options.limit}`;
29
+ }
30
+ const gitLogCmd = `git log${range ? ' ' + range : ''}${extraArgs}`;
31
+ logger.debug('Git log command: %s', gitLogCmd);
32
+ const { stdout, stderr } = await run(gitLogCmd);
14
33
  if (stderr) {
15
34
  logger.warn('Git log produced stderr: %s', stderr);
16
35
  }
@@ -1 +1 @@
1
- {"version":3,"file":"log.js","sources":["../../src/content/log.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { ExitError } from '../error/ExitError';\nimport { getLogger } from '../logging';\nimport { run } from '../util/child';\n\nexport interface Instance {\n get(): Promise<string>;\n}\n\nexport const create = async (options: { from: string, to: string }): Promise<Instance> => {\n const logger = getLogger();\n\n async function get(): Promise<string> {\n try {\n logger.verbose('Gathering change information from Git');\n\n try {\n logger.debug('Executing git log');\n const { stdout, stderr } = await run(`git log ${options.from}..${options.to}`);\n if (stderr) {\n logger.warn('Git log produced stderr: %s', stderr);\n }\n logger.debug('Git log output: %s', stdout);\n return stdout;\n } catch (error: any) {\n logger.error('Failed to execute git log: %s', error.message);\n throw error;\n }\n } catch (error: any) {\n logger.error('Error occurred during gather change phase: %s %s', error.message, error.stack);\n throw new ExitError('Error occurred during gather change phase');\n }\n }\n\n return { get };\n}\n\n"],"names":["create","options","logger","getLogger","get","verbose","debug","stdout","stderr","run","from","to","warn","error","message","stack","ExitError"],"mappings":";;;;;AASO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAMA,SAAS,CAAOC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA;AACzB,CAAA,CAAA,CAAA,CAAA,CAAMC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAASC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA;CAEf,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAeC,GAAAA,CAAAA,CAAAA,CAAAA,CAAAA;QACX,CAAI,CAAA,CAAA,CAAA,CAAA;AACAF,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAOG,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAC,uCAAA,CAAA,CAAA;YAEf,CAAI,CAAA,CAAA,CAAA,CAAA;AACAH,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAOI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAC,mBAAA,CAAA,CAAA;AACb,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,C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AAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAoDA,MAAMC,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAED,MAAME,KAAK,CAAA,CAAA;AAC3F,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAIC,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,2CAAA,CAAA,CAAA;AACxB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACJ,CAAA,CAAA,CAAA,CAAA,CAAA;IAEA,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAEZ,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA;AAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACjB,CAAA,CAAA;;"}
1
+ {"version":3,"file":"log.js","sources":["../../src/content/log.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { ExitError } from '../error/ExitError';\nimport { getLogger } from '../logging';\nimport { run } from '../util/child';\n\nexport interface Instance {\n get(): Promise<string>;\n}\n\nexport const create = async (options: { from?: string, to?: string, limit?: number, currentBranchOnly?: boolean }): Promise<Instance> => {\n const logger = getLogger();\n\n async function get(): Promise<string> {\n try {\n logger.verbose('Gathering change information from Git');\n\n try {\n logger.debug('Executing git log');\n // Build git log range\n let range = '';\n let extraArgs = '';\n // If currentBranchOnly, show only commits unique to HEAD vs. to-branch (or main/master if not provided)\n if (options.currentBranchOnly) {\n const toBranch = options.to || 'main'; // Default to 'main' if not provided\n range = `${toBranch}..HEAD`;\n } else if (options.from && options.to) {\n range = `${options.from}..${options.to}`;\n } else if (options.from) {\n range = `${options.from}`;\n } else if (options.to) {\n range = `${options.to}`;\n } // else, no range: show all\n\n if (options.limit && options.limit > 0) {\n extraArgs += ` -n ${options.limit}`;\n }\n const gitLogCmd = `git log${range ? ' ' + range : ''}${extraArgs}`;\n logger.debug('Git log command: %s', gitLogCmd);\n const { stdout, stderr } = await run(gitLogCmd);\n if (stderr) {\n logger.warn('Git log produced stderr: %s', stderr);\n }\n logger.debug('Git log output: %s', stdout);\n return stdout;\n } catch (error: any) {\n logger.error('Failed to execute git log: %s', error.message);\n throw error;\n }\n } catch (error: any) {\n logger.error('Error occurred during gather change phase: %s %s', error.message, error.stack);\n throw new ExitError('Error occurred during gather change phase');\n }\n }\n\n return { get };\n}\n\n"],"names":["create","options","logger","getLogger","get","verbose","debug","range","extraArgs","currentBranchOnly","toBranch","to","from","limit","gitLogCmd","stdout","stderr","run","warn","error","message","stack","ExitError"],"mappings":";;;;;AASO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAMA,SAAS,CAAOC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA;AACzB,CAAA,CAAA,CAAA,CAAA,CAAMC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAASC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA;CAEf,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAeC,GAAAA,CAAAA,CAAAA,CAAAA,CAAAA;QACX,CAAI,CAAA,CAAA,CAAA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CAAA,CAAA,CAAA,CAAA,CAAA,CAAIC,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,2CAAA,CAAA,CAAA;AACxB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACJ,CAAA,CAAA,CAAA,CAAA,CAAA;IAEA,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAElB,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA;AAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACjB,CAAA,CAAA;;"}
@@ -1,48 +1,84 @@
1
- Task #1: Create a commit message for the changes that are in the content.
1
+ Here is a revised version of your prompt retaining all original structure and detail, but improving clarity, precision, and flow. It avoids redundancy, tightens the language, and better emphasizes key steps:
2
2
 
3
- Task #2: When creating the commit message, use data in the context to help you relate the changes to information about people, projects, issues, and other entities.
3
+ ---
4
4
 
5
- This commit message is for someone who knows what the project is and what it does so don't summarize the project.
5
+ **🔧 Task Definition**
6
6
 
7
- Don't start the commit message with a sentence that refers to the project. For example, don't start with "the changes to the audio tool contained in this commit..." Instead I want you to assume that the person reading this is another developer in the project.
7
+ You are generating a Git commit message based on the content provided below. The content contains three critical sections:
8
8
 
9
- Also, use you understanding of the code to try to explain what is happening in the change. Look at the data in the <context> section for information about what frameworks, languages, and libraries are used in this project.
9
+ * **\[User Context]** Describes the motivation, goals, or intent behind the change. Use this to understand *why* the changes were made.
10
+ * **\[Diff]** — A code diff representing the actual modifications. Analyze this to understand *what* was changed.
11
+ * **\[Log]** — A short history of recent commit messages to give you temporal and thematic continuity.
10
12
 
11
- ### Please Be Concise and Direct
13
+ ---
12
14
 
13
- The first sentence should be a short summary of the change, and the rest of the commit message should discuss more detailed changes.
15
+ ## 🧠 COMMIT MESSAGE GUIDELINES
14
16
 
15
- If the commit contains a large number of changes or changes in different areas, try to list the changes in a way that is easy to understand.
17
+ ### DO:
16
18
 
17
- If the commit contains a smaller number of changes you can just state what the changes are quickly. Don't write a long message if there are only changes for a single file.
19
+ * Start with a **clear, concise summary** of what was changed and why grounded in the `User Context`.
20
+ * **Group changes logically** by purpose or domain (e.g., "error handling cleanup", "refactored tests", "adjusted CI config").
21
+ * **Refer to specific changes** seen in the `Diff`, and explain why those changes matter when it’s non-obvious.
22
+ * If the change is large, **add one or two paragraphs** expanding on the most important elements.
23
+ * Keep the tone technical and direct — written for a fellow developer who will read this in six months.
18
24
 
19
- Do not end the commit message with something vague like "These changes aim to improve overall efficiency." If a statement isn't directly related to the change, do not include it.
25
+ ### DO NOT:
20
26
 
21
- ### Output Format
27
+ * Don’t describe the project or its general purpose.
28
+ * ❌ Don’t begin with boilerplate like “This commit includes…” or “The following changes…”
29
+ * ❌ Don’t use fluffy or celebratory language (“awesome update”, “great enhancement”).
30
+ * ❌ Don’t end with vague statements like “improves experience” unless clearly supported by the change.
31
+ * ❌ Don’t use markdown formatting — the output should be plain text only.
22
32
 
23
- This commit message should be a single paragraph followed by a list of changes if the change is substantial.
33
+ ---
24
34
 
25
- Also, don't start with a header in Markdown. The first paragraph or single sentence should just be plain text.
35
+ ## 📝 OUTPUT STRUCTURE
26
36
 
27
- #### Example Output: Small change in a single file
37
+ ### For Small or Straightforward Changes
28
38
 
29
- Example #1: A small change to a single file.
39
+ If the change affects:
30
40
 
31
- "Updated the package.json file to add a dependency on @someorg/some-package, and making sure that our dependency no jest is compatible."
41
+ * A single file
42
+ * A single function or config block
43
+ * Or is otherwise low complexity
32
44
 
33
- Exmaple #2: A larger change to a single file.
45
+ Then output a:
34
46
 
35
- "Refactored the methods in BlabberService.java to ensure that the code is more straightforward. This change involved creating a new class, while also ensuring that the interfaces are properly implemented."
47
+ * **Single sentence**, or
48
+ * **Short paragraph**, with an optional **bullet list** for clarity
36
49
 
37
- Example #3: A change that affects a small number of files.
50
+ #### Example:
38
51
 
39
- "Implemented new unit tests for WalkingService.ts, and updated the README.md file to include information about the new tests. This commit also makes sure that the libraries for testing are updated. A few other changes in the testing directory are related to newer functions now avialable in the new version of Jest."
52
+ > Switched from `parseUser()` to `getUserProfile()` in `session.ts` to align with new session schema and remove legacy parsing logic.
40
53
 
41
- Example #4: A large change that affects multiples files and which also includes several different types of changes.
54
+ ---
42
55
 
43
- "A number of changes have been made, primarily focusing on updating the \`package.json\` to include new dependencies.
56
+ ### For Complex or Multi-Part Changes
44
57
 
45
- - Added the dependency \`@riotprompt/riotprompt\` with version \`^0.0.2\` to enhance command-line prompt functionality.
46
- - Included the \`glob\` module with version \`^11.0.1\`, which is useful for matching files using patterns, thus improving file handling capabilities within the project.
58
+ If the change affects:
47
59
 
48
- This commit is an effort to streamline file operations and introduce improved interactive features for users of the command - line interface.The additions will allow for more robust handling of prompts and file searches, potentially improving user experience and development efficiency."
60
+ * Multiple files or systems
61
+ * Multiple concerns (e.g., config + business logic)
62
+ * Involves a refactor or architectural update
63
+
64
+ Then output:
65
+
66
+ * A **summary paragraph** describing the overall intent
67
+ * One or two **detail paragraphs** focusing on key aspects or trade-offs
68
+ * An optional **bullet list** to call out specific files, tools, or changes
69
+
70
+ #### Example:
71
+
72
+ > Reorganized pipeline logic to improve readability and make phase execution more testable. This is part of ongoing work to modularize transition handling.
73
+ >
74
+ > The main change separates phase node execution into its own module, reduces reliance on shared state, and simplifies test construction. Existing functionality remains unchanged, but internal structure is now better aligned with future transition plugin support.
75
+ >
76
+ > * Extracted `executePhaseNode()` from `pipeline.ts`
77
+ > * Added `phase-runner.ts` with dedicated error handling
78
+ > * Updated tests in `phase.test.ts` for new isolation boundaries
79
+
80
+ ---
81
+
82
+ ## 🧾 Final Note
83
+
84
+ Match your output to the **scope and complexity** of the change. Be terse where appropriate, but thorough when it matters. Your audience is technical and time-constrained — give them clarity, not commentary.
@@ -12,20 +12,78 @@ Task #3: Use the content in the <context> section to help you write the release
12
12
 
13
13
  - If the release is very simple, keep the release notes short and simple. And, if the release is very compliex, then feel free to add more sections to capture significant areas of change.
14
14
 
15
- ### Output Format
15
+ ## 🎯 Purpose
16
16
 
17
- ## Release: Create a Title for this Release
17
+ Create release notes that:
18
18
 
19
- (summarize the release in two paragraphs)
19
+ * Help developers, contributors, or users **understand what changed**
20
+ * Reflect the **actual purpose** and **impact** of the release
21
+ * Are **not promotional**, **not exaggerated**, and **not overly positive**
20
22
 
21
- ## New Features
22
23
 
23
- Identify some of the latest changes that have been made
24
+ ## 🧭 Instructions
24
25
 
25
- ## Other Improvements
26
+ 1. **Use the "User Context" section at the top** of the input as your guide to the **focus and framing** of this release. This context may include:
26
27
 
27
- Identify some of the things that are related to the build or some behind-the-scenes changes.
28
+ * The theme or reason behind the release (e.g., "we're cleaning up configuration files", "this is about improving test stability")
29
+ * Key goals or constraints
30
+ * Target audiences or known issues being addressed
28
31
 
29
- ### Use the Context
32
+ ⚠️ The User Context should shape the **opening paragraph** and influence which changes are emphasized.
30
33
 
31
- Use the context to help you write the release notes and to help make connections with people, projects, issues, features, and other information.
34
+ 2. **Structure the release notes as follows:**
35
+
36
+ * **Opening paragraph** that gives a high-level summary of the release, grounded in the User Context
37
+ * Followed by **grouped sections** of changes using headers like:
38
+
39
+ * `New Features`
40
+ * `Improvements`
41
+ * `Bug Fixes`
42
+ * `Refactoring`
43
+ * `Documentation Updates`
44
+ * `Breaking Changes`
45
+ * `Deprecations`
46
+
47
+ Include only the sections that are relevant.
48
+
49
+ 3. **Use clear, factual bullet points** under each section. Briefly describe what changed and why it's relevant — **but do not use marketing language**. Avoid vague or exaggerated terms like:
50
+
51
+ * “awesome new feature”
52
+ * “significant boost”
53
+ * “exciting changes”
54
+ * “revolutionary update”
55
+
56
+ 4. **Keep your tone technical, neutral, and useful.** It’s okay to include references to:
57
+
58
+ * Affected files or systems
59
+ * Internal components (if relevant to the audience)
60
+ * Specific pull requests or issues (if helpful)
61
+ * Contributors (optionally, in parentheses or footnotes)
62
+
63
+ ---
64
+
65
+ ## 📝 Output Format Example
66
+
67
+ **Release v1.6.0 – May 26, 2025**
68
+
69
+ This release focuses on simplifying the configuration system and removing deprecated environment-specific files. Based on internal feedback, the team prioritized changes that reduce friction for new developers and standardize build behavior across local and CI environments.
70
+
71
+ **Improvements**
72
+
73
+ * Unified `vite.config.ts` and `webpack.config.js` into a single environment-aware module
74
+ * Reduced config nesting depth in `tsconfig.json` to improve readability
75
+ * Updated CI scripts to use `.env.defaults` instead of `.env.local`
76
+
77
+ **Bug Fixes**
78
+
79
+ * Fixed crash in config loader when optional fields were undefined
80
+ * Resolved issue with `yarn build` failing on Windows due to missing path escape
81
+
82
+ **Documentation Updates**
83
+
84
+ * Rewrote setup instructions in `README.md` to reflect unified config process
85
+ * Removed legacy instructions for `env.local.js`
86
+
87
+ ---
88
+
89
+ Let me know if you'd like a version optimized for a changelog generator plugin or a GitHub Actions pipeline.
@@ -0,0 +1,29 @@
1
+ You are an intelligent assistant responsible for generating **high-quality, concise, and structured commit messages** for repositories that may include **code**, **configuration**, or **long-form written content** (e.g., technical docs, policies, onboarding materials).
2
+
3
+ ## 🧑‍💻 Persona: GitHub Project Committer
4
+
5
+ **Role Title:** GitHub Committer / Core Contributor
6
+ **Scope:** Regular contributor with write access; responsible for submitting high-quality commits, maintaining code health, and ensuring clarity and traceability in project history.
7
+
8
+ ### 🔑 Responsibilities
9
+
10
+ * **Submit Meaningful Commits**
11
+ Write clear, purposeful, and well-scoped commits that align with project standards, including thoughtful messages that reflect both technical and contextual intent.
12
+
13
+ * **Respect Context**
14
+ Incorporate `User Context`, linked issues, and project priorities into commits. Treat commit messages as historical records for collaborators and future maintainers.
15
+
16
+ * **Code + Content Awareness**
17
+ Committers may work on code, config, docs, or mixed artifacts. Must treat documentation changes with the same level of diligence as code edits.
18
+
19
+ ### 🛠 Technical Proficiencies
20
+
21
+ * Proficient in project languages and tooling (e.g., TypeScript, Python, Rust, etc.)
22
+ * Familiar with Git workflows: feature branching, squash-and-merge, rebase with care
23
+ * Uses pre-commit hooks, linting, and test tools before pushing changes
24
+
25
+ ### 🧭 Operating Principles
26
+
27
+ * Clarity > Brevity > Cleverness
28
+ * Commit messages are communication tools, not just logs
29
+ * Consider the reader: future teammates, open-source collaborators, or even your future self
@@ -0,0 +1,24 @@
1
+ Prepares concise, user-facing summaries of changes introduced in each release. Helps users and contributors understand what’s new, improved, fixed, or deprecated.
2
+
3
+ ---
4
+
5
+ ### 🔑 Responsibilities
6
+
7
+ * **Filter by Audience**
8
+ Write for the intended audience: developers, users, or contributors. Avoid internal jargon unless relevant.
9
+
10
+ * **Clarify the “Why”**
11
+ Go beyond “what changed” — explain what users can now do, what’s been improved, or what to watch out for.
12
+
13
+ * **Highlight Important Changes**
14
+ Emphasize anything that affects how the project is used, installed, configured, or integrated.
15
+
16
+ ---
17
+
18
+ ### ✍️ Writing Style
19
+
20
+ * ✅ Clear, direct, and action-oriented
21
+ * ✅ Use bullet points for lists of changes
22
+ * ✅ Include brief headers for different sections
23
+ * ❌ Avoid overly technical deep dives — link to docs or PRs instead
24
+ * ❌ Don’t include internal-only context or commit-level detail unless useful to the user
@@ -1,39 +1,47 @@
1
1
  import { Formatter, Builder } from '@riotprompt/riotprompt';
2
- import { DEFAULT_PERSONA_YOU_FILE, DEFAULT_INSTRUCTIONS_RELEASE_FILE, DEFAULT_INSTRUCTIONS_COMMIT_FILE } from '../constants.js';
3
- import { getLogger } from '../logging.js';
4
- import { fileURLToPath } from 'url';
5
2
  import path from 'path';
3
+ import { fileURLToPath } from 'url';
4
+ import { DEFAULT_PERSONA_RELEASER_FILE, DEFAULT_INSTRUCTIONS_RELEASE_FILE, DEFAULT_PERSONA_COMMITTER_FILE, DEFAULT_INSTRUCTIONS_COMMIT_FILE } from '../constants.js';
5
+ import { getLogger } from '../logging.js';
6
6
 
7
7
  const __filename = fileURLToPath(import.meta.url);
8
8
  const __dirname = path.dirname(__filename);
9
9
  const create = (model, runConfig)=>{
10
10
  const logger = getLogger();
11
- const createCommitPrompt = async (content)=>{
11
+ const createCommitPrompt = async (content, logContent, context)=>{
12
12
  let builder = Builder.create({
13
13
  logger,
14
14
  basePath: __dirname,
15
15
  overridePath: runConfig === null || runConfig === void 0 ? void 0 : runConfig.configDirectory,
16
16
  overrides: (runConfig === null || runConfig === void 0 ? void 0 : runConfig.overrides) || false
17
17
  });
18
- builder = await builder.addPersonaPath(DEFAULT_PERSONA_YOU_FILE);
18
+ builder = await builder.addPersonaPath(DEFAULT_PERSONA_COMMITTER_FILE);
19
19
  builder = await builder.addInstructionPath(DEFAULT_INSTRUCTIONS_COMMIT_FILE);
20
- builder = await builder.addContent(content);
20
+ if (context) {
21
+ builder = await builder.addContent(`\n\n[User Context]\n${context}`);
22
+ }
23
+ builder = await builder.addContent(`\n\n[Diff]\n${content}`);
24
+ builder = await builder.addContent(`\n\n[Log]\n${logContent}`);
21
25
  if (runConfig.contextDirectories) {
22
26
  builder = await builder.loadContext(runConfig.contextDirectories);
23
27
  }
24
28
  const prompt = await builder.build();
25
29
  return prompt;
26
30
  };
27
- const createReleasePrompt = async (content)=>{
31
+ const createReleasePrompt = async (content, diffContent, context)=>{
28
32
  let builder = Builder.create({
29
33
  logger,
30
34
  basePath: __dirname,
31
35
  overridePath: runConfig === null || runConfig === void 0 ? void 0 : runConfig.configDirectory,
32
36
  overrides: (runConfig === null || runConfig === void 0 ? void 0 : runConfig.overrides) || false
33
37
  });
34
- builder = await builder.addPersonaPath(DEFAULT_PERSONA_YOU_FILE);
38
+ builder = await builder.addPersonaPath(DEFAULT_PERSONA_RELEASER_FILE);
35
39
  builder = await builder.addInstructionPath(DEFAULT_INSTRUCTIONS_RELEASE_FILE);
36
- builder = await builder.addContent(content);
40
+ if (context) {
41
+ builder = await builder.addContent(`\n\n[User Context]\n${context}`);
42
+ }
43
+ builder = await builder.addContent(`\n\n[Log]\n${content}`);
44
+ builder = await builder.addContent(`\n\n[Diff]\n${diffContent}`);
37
45
  if (runConfig.contextDirectories) {
38
46
  builder = await builder.loadContext(runConfig.contextDirectories);
39
47
  }
@@ -1 +1 @@
1
- {"version":3,"file":"prompts.js","sources":["../../src/prompt/prompts.ts"],"sourcesContent":["import { Builder, Formatter, Model, Prompt, Request } from '@riotprompt/riotprompt';\nimport { DEFAULT_INSTRUCTIONS_COMMIT_FILE, DEFAULT_INSTRUCTIONS_RELEASE_FILE, DEFAULT_PERSONA_YOU_FILE } from '../constants';\nimport { Config as RunConfig } from '../types';\nimport { getLogger } from '../logging';\nimport { fileURLToPath } from 'url';\nimport path from 'path';\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = path.dirname(__filename);\n\nexport interface Factory {\n createCommitPrompt: (content: string) => Promise<Prompt>;\n createReleasePrompt: (content: string) => Promise<Prompt>;\n format: (prompt: Prompt) => Request;\n}\n\nexport const create = (model: Model, runConfig: RunConfig): Factory => {\n\n const logger = getLogger();\n\n const createCommitPrompt = async (content: string): Promise<Prompt> => {\n let builder: Builder.Instance = Builder.create({ logger, basePath: __dirname, overridePath: runConfig?.configDirectory, overrides: runConfig?.overrides || false });\n builder = await builder.addPersonaPath(DEFAULT_PERSONA_YOU_FILE);\n builder = await builder.addInstructionPath(DEFAULT_INSTRUCTIONS_COMMIT_FILE);\n builder = await builder.addContent(content);\n if (runConfig.contextDirectories) {\n builder = await builder.loadContext(runConfig.contextDirectories);\n }\n\n const prompt = await builder.build();\n return prompt;\n };\n\n const createReleasePrompt = async (content: string): Promise<Prompt> => {\n let builder: Builder.Instance = Builder.create({ logger, basePath: __dirname, overridePath: runConfig?.configDirectory, overrides: runConfig?.overrides || false });\n builder = await builder.addPersonaPath(DEFAULT_PERSONA_YOU_FILE);\n builder = await builder.addInstructionPath(DEFAULT_INSTRUCTIONS_RELEASE_FILE);\n builder = await builder.addContent(content);\n if (runConfig.contextDirectories) {\n builder = await builder.loadContext(runConfig.contextDirectories);\n }\n\n const prompt = await builder.build();\n return prompt;\n }\n\n const format = (prompt: Prompt): Request => {\n const formatter = Formatter.create();\n return formatter.formatPrompt(model, prompt);\n };\n\n return {\n createCommitPrompt,\n createReleasePrompt,\n format,\n };\n}\n\n"],"names":["__filename","fileURLToPath","url","__dirname","path","dirname","create","model","runConfig","logger","getLogger","createCommitPrompt","content","builder","Builder","basePath","overridePath","configDirectory","overrides","addPersonaPath","DEFAULT_PERSONA_YOU_FILE","addInstructionPath","DEFAULT_INSTRUCTIONS_COMMIT_FILE","addContent","contextDirectories","loadContext","prompt","build","createReleasePrompt","DEFAULT_INSTRUCTIONS_RELEASE_FILE","format","formatter","Formatter","formatPrompt"],"mappings":";;;;;;AAOA,MAAMA,UAAAA,GAAaC,aAAc,CAAA,MAAA,CAAA,IAAA,CAAYC,GAAG,CAAA;AAChD,MAAMC,SAAAA,GAAYC,IAAKC,CAAAA,OAAO,CAACL,UAAAA,CAAAA;AAQxB,MAAMM,MAAS,GAAA,CAACC,KAAcC,EAAAA,SAAAA,GAAAA;AAEjC,IAAA,MAAMC,MAASC,GAAAA,SAAAA,EAAAA;AAEf,IAAA,MAAMC,qBAAqB,OAAOC,OAAAA,GAAAA;QAC9B,IAAIC,OAAAA,GAA4BC,OAAQR,CAAAA,MAAM,CAAC;AAAEG,YAAAA,MAAAA;YAAQM,QAAUZ,EAAAA,SAAAA;AAAWa,YAAAA,YAAY,EAAER,SAAAA,KAAAA,IAAAA,IAAAA,SAAAA,KAAAA,MAAAA,GAAAA,MAAAA,GAAAA,SAAAA,CAAWS,eAAe;AAAEC,YAAAA,SAAAA,EAAWV,CAAAA,SAAAA,KAAAA,IAAAA,IAAAA,SAAAA,KAAAA,MAAAA,GAAAA,MAAAA,GAAAA,SAAAA,CAAWU,SAAS,KAAI;AAAM,SAAA,CAAA;QACjKL,OAAU,GAAA,MAAMA,OAAQM,CAAAA,cAAc,CAACC,wBAAAA,CAAAA;QACvCP,OAAU,GAAA,MAAMA,OAAQQ,CAAAA,kBAAkB,CAACC,gCAAAA,CAAAA;QAC3CT,OAAU,GAAA,MAAMA,OAAQU,CAAAA,UAAU,CAACX,OAAAA,CAAAA;QACnC,IAAIJ,SAAAA,CAAUgB,kB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AACzC,KAAA;IAEA,OAAO;AACHf,QAAAA,kBAAAA;AACAiB,QAAAA,mBAAAA;AACAE,QAAAA;AACJ,KAAA;AACJ;;;;"}
1
+ {"version":3,"file":"prompts.js","sources":["../../src/prompt/prompts.ts"],"sourcesContent":["import { Builder, Formatter, Model, Prompt, Request } from '@riotprompt/riotprompt';\nimport path from 'path';\nimport { fileURLToPath } from 'url';\nimport { DEFAULT_INSTRUCTIONS_COMMIT_FILE, DEFAULT_INSTRUCTIONS_RELEASE_FILE, DEFAULT_PERSONA_COMMITTER_FILE, DEFAULT_PERSONA_RELEASER_FILE } from '../constants';\nimport { getLogger } from '../logging';\nimport { Config as RunConfig } from '../types';\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = path.dirname(__filename);\n\nexport interface Factory {\n createCommitPrompt: (content: string, logContent: string, context?: string) => Promise<Prompt>;\n createReleasePrompt: (content: string, diffContent: string, context?: string) => Promise<Prompt>;\n format: (prompt: Prompt) => Request;\n}\n\nexport const create = (model: Model, runConfig: RunConfig): Factory => {\n\n const logger = getLogger();\n\n const createCommitPrompt = async (content: string, logContent: string, context?: string): Promise<Prompt> => {\n let builder: Builder.Instance = Builder.create({ logger, basePath: __dirname, overridePath: runConfig?.configDirectory, overrides: runConfig?.overrides || false });\n builder = await builder.addPersonaPath(DEFAULT_PERSONA_COMMITTER_FILE);\n builder = await builder.addInstructionPath(DEFAULT_INSTRUCTIONS_COMMIT_FILE);\n if (context) {\n builder = await builder.addContent(`\\n\\n[User Context]\\n${context}`);\n }\n builder = await builder.addContent(`\\n\\n[Diff]\\n${content}`);\n builder = await builder.addContent(`\\n\\n[Log]\\n${logContent}`);\n\n if (runConfig.contextDirectories) {\n builder = await builder.loadContext(runConfig.contextDirectories);\n }\n\n const prompt = await builder.build();\n return prompt;\n };\n\n const createReleasePrompt = async (content: string, diffContent: string, context?: string): Promise<Prompt> => {\n let builder: Builder.Instance = Builder.create({ logger, basePath: __dirname, overridePath: runConfig?.configDirectory, overrides: runConfig?.overrides || false });\n builder = await builder.addPersonaPath(DEFAULT_PERSONA_RELEASER_FILE);\n builder = await builder.addInstructionPath(DEFAULT_INSTRUCTIONS_RELEASE_FILE);\n if (context) {\n builder = await builder.addContent(`\\n\\n[User Context]\\n${context}`);\n }\n builder = await builder.addContent(`\\n\\n[Log]\\n${content}`);\n builder = await builder.addContent(`\\n\\n[Diff]\\n${diffContent}`);\n if (runConfig.contextDirectories) {\n builder = await builder.loadContext(runConfig.contextDirectories);\n }\n\n const prompt = await builder.build();\n return prompt;\n }\n\n const format = (prompt: Prompt): Request => {\n const formatter = Formatter.create();\n return formatter.formatPrompt(model, prompt);\n };\n\n return {\n createCommitPrompt,\n createReleasePrompt,\n format,\n };\n}\n\n"],"names":["__filename","fileURLToPath","url","__dirname","path","dirname","create","model","runConfig","logger","getLogger","createCommitPrompt","content","logContent","context","builder","Builder","basePath","overridePath","configDirectory","overrides","addPersonaPath","DEFAULT_PERSONA_COMMITTER_FILE","addInstructionPath","DEFAULT_INSTRUCTIONS_COMMIT_FILE","addContent","contextDirectories","loadContext","prompt","build","createReleasePrompt","diffContent","DEFAULT_PERSONA_RELEASER_FILE","DEFAULT_INSTRUCTIONS_RELEASE_FILE","format","formatter","Formatter","formatPrompt"],"mappings":";;;;;;AAOA,MAAMA,UAAAA,GAAaC,aAAc,CAAA,MAAA,CAAA,IAAA,CAAYC,GAAG,CAAA;AAChD,MAAMC,SAAAA,GAAYC,IAAKC,CAAAA,OAAO,CAACL,UAAAA,CAAAA;AAQxB,MAAMM,MAAS,GAAA,CAACC,KAAcC,EAAAA,SAAAA,GAAAA;AAEjC,IAAA,MAAMC,MAASC,GAAAA,SAAAA,EAAAA;IAEf,MAAMC,kBAAAA,GAAqB,OAAOC,OAAAA,EAAiBC,UAAoBC,EAAAA,OAAAA,GAAAA;QACnE,IAAIC,OAAAA,GAA4BC,OAAQV,CAAAA,MAAM,CAAC;AAAEG,YAAAA,MAAAA;YAAQQ,QAAUd,EAAAA,SAAAA;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/dist/types.js CHANGED
@@ -10,11 +10,15 @@ const ConfigSchema = z.object({
10
10
  contextDirectories: z.array(z.string()).optional(),
11
11
  commit: z.object({
12
12
  cached: z.boolean().optional(),
13
- sendit: z.boolean().optional()
13
+ sendit: z.boolean().optional(),
14
+ messageLimit: z.number().optional(),
15
+ context: z.string().optional()
14
16
  }).optional(),
15
17
  release: z.object({
16
18
  from: z.string().optional(),
17
- to: z.string().optional()
19
+ to: z.string().optional(),
20
+ messageLimit: z.number().optional(),
21
+ context: z.string().optional()
18
22
  }).optional(),
19
23
  excludedPatterns: z.array(z.string()).optional()
20
24
  });
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sources":["../src/types.ts"],"sourcesContent":["import * as Cardigantime from '@theunwalked/cardigantime';\nimport { z } from \"zod\";\n\nexport const ConfigSchema = z.object({\n dryRun: z.boolean().optional(),\n verbose: z.boolean().optional(),\n debug: z.boolean().optional(),\n overrides: z.boolean().optional(),\n instructions: z.string().optional(),\n model: z.string().optional(),\n contextDirectories: z.array(z.string()).optional(),\n commit: z.object({\n cached: z.boolean().optional(),\n sendit: z.boolean().optional(),\n }).optional(),\n release: z.object({\n from: z.string().optional(),\n to: z.string().optional(),\n }).optional(),\n excludedPatterns: z.array(z.string()).optional(),\n});\n\nexport const SecureConfigSchema = z.object({\n openaiApiKey: z.string().optional(),\n});\n\nexport const CommandConfigSchema = z.object({\n commandName: z.string().optional(),\n});\n\nexport type Config = z.infer<typeof ConfigSchema> & Cardigantime.Config;\nexport type SecureConfig = z.infer<typeof SecureConfigSchema>;\nexport type CommandConfig = z.infer<typeof CommandConfigSchema>;\n"],"names":["ConfigSchema","z","object","dryRun","boolean","optional","verbose","debug","overrides","instructions","string","model","contextDirectories","array","commit","cached","sendit","release","from","to","excludedPatterns","openaiApiKey","commandName"],"mappings":";;AAGaA,MAAAA,YAAAA,GAAeC,CAAEC,CAAAA,MAAM,CAAC;IACjCC,MAAQF,EAAAA,CAAAA,CAAEG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
+ {"version":3,"file":"types.js","sources":["../src/types.ts"],"sourcesContent":["import * as Cardigantime from '@theunwalked/cardigantime';\nimport { z } from \"zod\";\n\nexport const ConfigSchema = z.object({\n dryRun: z.boolean().optional(),\n verbose: z.boolean().optional(),\n debug: z.boolean().optional(),\n overrides: z.boolean().optional(),\n instructions: z.string().optional(),\n model: z.string().optional(),\n contextDirectories: z.array(z.string()).optional(),\n commit: z.object({\n cached: z.boolean().optional(),\n sendit: z.boolean().optional(),\n messageLimit: z.number().optional(),\n context: z.string().optional(),\n }).optional(),\n release: z.object({\n from: z.string().optional(),\n to: z.string().optional(),\n messageLimit: z.number().optional(),\n context: z.string().optional(),\n }).optional(),\n excludedPatterns: z.array(z.string()).optional(),\n});\n\nexport const SecureConfigSchema = z.object({\n openaiApiKey: z.string().optional(),\n});\n\nexport const CommandConfigSchema = z.object({\n commandName: z.string().optional(),\n});\n\nexport type Config = z.infer<typeof ConfigSchema> & Cardigantime.Config;\nexport type SecureConfig = z.infer<typeof SecureConfigSchema>;\nexport type CommandConfig = z.infer<typeof CommandConfigSchema>;\n"],"names":["ConfigSchema","z","object","dryRun","boolean","optional","verbose","debug","overrides","instructions","string","model","contextDirectories","array","commit","cached","sendit","messageLimit","number","context","release","from","to","excludedPatterns","openaiApiKey","commandName"],"mappings":";;AAGaA,MAAAA,YAAAA,GAAeC,CAAEC,CAAAA,MAAM,CAAC;IACjCC,MAAQF,EAAAA,CAAAA,CAAEG,OAAO,EAAA,CAAGC,QAAQ,EAAA;IAC5BC,OAASL,EAAAA,CAAAA,CAAEG,OAAO,EAAA,CAAGC,QAAQ,EAAA;IAC7BE,KAAON,EAAAA,CAAAA,CAAEG,OAAO,EAAA,CAAGC,QAAQ,EAAA;IAC3BG,SAAWP,EAAAA,CAAAA,CAAEG,OAAO,EAAA,CAAGC,QAAQ,EAAA;IAC/BI,YAAcR,EAAAA,CAAAA,CAAES,MAAM,EAAA,CAAGL,QAAQ,EAAA;IACjCM,KAAOV,EAAAA,CAA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jSON.stringify;
3
+ const stringifyJSON = function(obj, options = {
4
+ depth: 0
5
+ }) {
6
+ if (options.depth > 10) {
7
+ return '{"error": "Maximum depth reached"}';
8
+ }
9
+ const arrOfKeyVals = [];
10
+ const arrVals = [];
11
+ let objKeys = [];
12
+ /*********CHECK FOR PRIMITIVE TYPES**********/ if (typeof obj === 'number' || typeof obj === 'boolean' || obj === null) return '' + obj;
13
+ else if (typeof obj === 'string') return '"' + obj + '"';
14
+ else if (Array.isArray(obj)) {
15
+ //check for empty array
16
+ if (obj[0] === undefined) return '[]';
17
+ else {
18
+ obj.forEach(function(el) {
19
+ arrVals.push(stringifyJSON(el, {
20
+ depth: options.depth + 1
21
+ }));
22
+ });
23
+ return '[' + arrVals + ']';
24
+ }
25
+ } else if (obj instanceof Object) {
26
+ //get object keys
27
+ objKeys = Object.keys(obj);
28
+ //set key output;
29
+ objKeys.forEach(function(key) {
30
+ const keyOut = '"' + key + '":';
31
+ const keyValOut = obj[key];
32
+ //skip functions and undefined properties
33
+ if (keyValOut instanceof Function || keyValOut === undefined) arrOfKeyVals.push('');
34
+ else if (typeof keyValOut === 'string') arrOfKeyVals.push(keyOut + '"' + keyValOut + '"');
35
+ else if (typeof keyValOut === 'boolean' || typeof keyValOut === 'number' || keyValOut === null) arrOfKeyVals.push(keyOut + keyValOut);
36
+ else if (keyValOut instanceof Object) {
37
+ arrOfKeyVals.push(keyOut + stringifyJSON(keyValOut, {
38
+ depth: options.depth + 1
39
+ }));
40
+ }
41
+ });
42
+ return '{' + arrOfKeyVals + '}';
43
+ }
44
+ return '';
45
+ };
46
+
47
+ export { stringifyJSON };
48
+ //# sourceMappingURL=general.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"general.js","sources":["../../src/util/general.ts"],"sourcesContent":["// Utility function for deep merging two objects.\nexport function deepMerge(target: any, source: any): any {\n for (const key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n if (key === \"__proto__\" || key === \"constructor\") {\n continue; // Skip prototype-polluting keys\n }\n if (source[key] && typeof source[key] === 'object' && !Array.isArray(source[key])) {\n if (!target[key]) {\n target[key] = {};\n }\n deepMerge(target[key], source[key]);\n } else {\n target[key] = source[key];\n }\n }\n }\n return target;\n}\n\n//Recursive implementation of jSON.stringify;\nexport const stringifyJSON = function (obj: any, options: { depth: number } = { depth: 0 }): string {\n\n if (options.depth > 10) {\n return '{\"error\": \"Maximum depth reached\"}';\n }\n\n const arrOfKeyVals: string[] = [];\n const arrVals: string[] = [];\n let objKeys: string[] = [];\n\n /*********CHECK FOR PRIMITIVE TYPES**********/\n if (typeof obj === 'number' || typeof obj === 'boolean' || obj === null)\n return '' + obj;\n else if (typeof obj === 'string')\n return '\"' + obj + '\"';\n\n /*********CHECK FOR ARRAY**********/\n else if (Array.isArray(obj)) {\n //check for empty array\n if (obj[0] === undefined)\n return '[]';\n else {\n obj.forEach(function (el) {\n arrVals.push(stringifyJSON(el, { depth: options.depth + 1 }));\n });\n return '[' + arrVals + ']';\n }\n }\n /*********CHECK FOR OBJECT**********/\n else if (obj instanceof Object) {\n //get object keys\n objKeys = Object.keys(obj);\n //set key output;\n objKeys.forEach(function (key) {\n const keyOut = '\"' + key + '\":';\n const keyValOut = obj[key];\n //skip functions and undefined properties\n if (keyValOut instanceof Function || keyValOut === undefined)\n arrOfKeyVals.push('');\n else if (typeof keyValOut === 'string')\n arrOfKeyVals.push(keyOut + '\"' + keyValOut + '\"');\n else if (typeof keyValOut === 'boolean' || typeof keyValOut === 'number' || keyValOut === null)\n arrOfKeyVals.push(keyOut + keyValOut);\n //check for nested objects, call recursively until no more objects\n else if (keyValOut instanceof Object) {\n arrOfKeyVals.push(keyOut + stringifyJSON(keyValOut, { depth: options.depth + 1 }));\n }\n });\n return '{' + arrOfKeyVals + '}';\n }\n return '';\n};"],"names":["stringifyJSON","obj","options","depth","arrOfKeyVals","arrVals","objKeys","Array","isArray","undefined","forEach","el","push","Object","keys","key","keyOut","keyValOut","Function"],"mappings":"AAAA;AAoBA;AAC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