@kjerneverk/execution-openai 1.0.5-dev.0
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.
- package/.kodrdriv-test-cache.json +6 -0
- package/LICENSE +18 -0
- package/README.md +80 -0
- package/dist/index.d.ts +85 -0
- package/dist/index.js +103 -0
- package/dist/index.js.map +1 -0
- package/output/kodrdriv/.kodrdriv-parallel-context.json +589 -0
- package/output/kodrdriv/260110-1751-release-notes.md +39 -0
- package/output/kodrdriv/260112-2207-commit-message.md +1 -0
- package/output/kodrdriv/260112-2208-release-notes.md +36 -0
- package/output/kodrdriv/260112-2341-commit-message.md +1 -0
- package/output/kodrdriv/260113-0029-commit-message.md +1 -0
- package/output/kodrdriv/260113-0030-release-notes.md +5 -0
- package/output/kodrdriv/260114-0656-commit-message.md +6 -0
- package/output/kodrdriv/260115-0616-commit-message.md +1 -0
- package/output/kodrdriv/260115-0739-commit-message.md +1 -0
- package/output/kodrdriv/260126-0852-commit-message.md +1 -0
- package/output/kodrdriv/260126-0853-release-notes.md +47 -0
- package/output/kodrdriv/260126-0854-release-notes.md +50 -0
- package/output/kodrdriv/260128-0929-commit-message.md +1 -0
- package/output/kodrdriv/260128-0929-release-notes.md +24 -0
- package/output/kodrdriv/260128-0959-commit-message.md +6 -0
- package/output/kodrdriv/260128-1127-commit-message.md +1 -0
- package/output/kodrdriv/260128-1127-release-notes.md +30 -0
- package/output/kodrdriv/260130-1639-commit-message.md +5 -0
- package/output/kodrdriv/260130-1652-commit-message.md +1 -0
- package/output/kodrdriv/260130-1652-release-notes.md +27 -0
- package/output/kodrdriv/RELEASE_NOTES.md +25 -0
- package/output/kodrdriv/RELEASE_TITLE.md +1 -0
- package/output/kodrdriv/agentic-reflection-commit-2026-01-13T06-07-12-251Z.md +97 -0
- package/output/kodrdriv/agentic-reflection-commit-2026-01-13T07-41-08-151Z.md +97 -0
- package/output/kodrdriv/agentic-reflection-commit-2026-01-13T08-29-26-449Z.md +97 -0
- package/output/kodrdriv/agentic-reflection-commit-2026-01-14T14-56-03-314Z.md +102 -0
- package/output/kodrdriv/agentic-reflection-commit-2026-01-15T14-16-42-406Z.md +97 -0
- package/output/kodrdriv/agentic-reflection-commit-2026-01-15T15-39-56-545Z.md +114 -0
- package/output/kodrdriv/agentic-reflection-commit-2026-01-26T16-52-42-503Z.md +152 -0
- package/output/kodrdriv/agentic-reflection-commit-2026-01-28T17-59-30-913Z.md +204 -0
- package/output/kodrdriv/agentic-reflection-commit-2026-01-31T00-39-30-443Z.md +245 -0
- package/output/kodrdriv/agentic-reflection-commit-2026-01-31T00-52-07-165Z.md +152 -0
- package/output/kodrdriv/agentic-reflection-release-2026-01-11T01-51-19-115Z.md +277 -0
- package/output/kodrdriv/agentic-reflection-release-2026-01-13T06-08-15-507Z.md +289 -0
- package/output/kodrdriv/agentic-reflection-release-2026-01-13T08-30-05-728Z.md +312 -0
- package/output/kodrdriv/agentic-reflection-release-2026-01-26T16-53-34-128Z.md +417 -0
- package/output/kodrdriv/agentic-reflection-release-2026-01-26T16-53-55-634Z.md +391 -0
- package/output/kodrdriv/agentic-reflection-release-2026-01-26T16-54-13-700Z.md +456 -0
- package/output/kodrdriv/agentic-reflection-release-2026-01-26T16-54-22-655Z.md +496 -0
- package/output/kodrdriv/agentic-reflection-release-2026-01-26T16-54-32-261Z.md +490 -0
- package/output/kodrdriv/agentic-reflection-release-2026-01-31T00-52-29-053Z.md +334 -0
- package/package.json +58 -0
- package/package.json~ +57 -0
|
@@ -0,0 +1,496 @@
|
|
|
1
|
+
# Agentic Workflow - Self-Reflection Report
|
|
2
|
+
|
|
3
|
+
Generated: 2026-01-26T16:54:22.655Z
|
|
4
|
+
|
|
5
|
+
## Execution Summary
|
|
6
|
+
|
|
7
|
+
- **Iterations**: 9
|
|
8
|
+
- **Tool Calls**: 22
|
|
9
|
+
- **Unique Tools**: 11
|
|
10
|
+
|
|
11
|
+
## Tool Effectiveness Analysis
|
|
12
|
+
|
|
13
|
+
| Tool | Calls | Success | Failures | Success Rate | Avg Duration |
|
|
14
|
+
|------|-------|---------|----------|--------------|--------------|
|
|
15
|
+
| get_file_content | 5 | 5 | 0 | 100.0% | 0ms |
|
|
16
|
+
| get_file_history | 5 | 5 | 0 | 100.0% | 15ms |
|
|
17
|
+
| search_codebase | 4 | 4 | 0 | 100.0% | 17ms |
|
|
18
|
+
| get_release_stats | 1 | 1 | 0 | 100.0% | 50ms |
|
|
19
|
+
| get_tag_history | 1 | 1 | 0 | 100.0% | 71ms |
|
|
20
|
+
| analyze_commit_patterns | 1 | 1 | 0 | 100.0% | 13ms |
|
|
21
|
+
| get_breaking_changes | 1 | 1 | 0 | 100.0% | 28ms |
|
|
22
|
+
| group_files_by_concern | 1 | 1 | 0 | 100.0% | 1ms |
|
|
23
|
+
| get_file_dependencies | 1 | 1 | 0 | 100.0% | 10ms |
|
|
24
|
+
| get_related_tests | 1 | 1 | 0 | 100.0% | 0ms |
|
|
25
|
+
| compare_previous_release | 1 | 1 | 0 | 100.0% | 27ms |
|
|
26
|
+
|
|
27
|
+
### Tool Performance Insights
|
|
28
|
+
|
|
29
|
+
**Most Frequently Used:**
|
|
30
|
+
- get_release_stats: 1 calls
|
|
31
|
+
- get_tag_history: 1 calls
|
|
32
|
+
- analyze_commit_patterns: 1 calls
|
|
33
|
+
|
|
34
|
+
## Recommendations for Improvement
|
|
35
|
+
|
|
36
|
+
- **Underutilized Tools**: Many tools were called only once. Consider whether all tools are necessary or if the agent needs better guidance on when to use them.
|
|
37
|
+
|
|
38
|
+
## Detailed Execution Timeline
|
|
39
|
+
|
|
40
|
+
| Time | Iteration | Tool | Result | Duration |
|
|
41
|
+
|------|-----------|------|--------|----------|
|
|
42
|
+
| 8:52:50 AM | 1 | get_release_stats | ✅ Success | 50ms |
|
|
43
|
+
| 8:52:50 AM | 1 | get_tag_history | ✅ Success | 71ms |
|
|
44
|
+
| 8:52:50 AM | 1 | analyze_commit_patterns | ✅ Success | 13ms |
|
|
45
|
+
| 8:52:50 AM | 1 | get_breaking_changes | ✅ Success | 28ms |
|
|
46
|
+
| 8:52:55 AM | 2 | group_files_by_concern | ✅ Success | 1ms |
|
|
47
|
+
| 8:53:01 AM | 3 | get_file_content | ✅ Success | 0ms |
|
|
48
|
+
| 8:53:01 AM | 3 | get_file_content | ✅ Success | 1ms |
|
|
49
|
+
| 8:53:01 AM | 3 | get_file_content | ✅ Success | 0ms |
|
|
50
|
+
| 8:53:01 AM | 3 | get_file_content | ✅ Success | 0ms |
|
|
51
|
+
| 8:53:01 AM | 3 | get_file_content | ✅ Success | 1ms |
|
|
52
|
+
| 8:53:01 AM | 3 | get_file_history | ✅ Success | 15ms |
|
|
53
|
+
| 8:53:01 AM | 3 | get_file_dependencies | ✅ Success | 10ms |
|
|
54
|
+
| 8:53:01 AM | 3 | search_codebase | ✅ Success | 14ms |
|
|
55
|
+
| 8:53:13 AM | 4 | search_codebase | ✅ Success | 19ms |
|
|
56
|
+
| 8:53:14 AM | 5 | search_codebase | ✅ Success | 15ms |
|
|
57
|
+
| 8:53:16 AM | 6 | search_codebase | ✅ Success | 18ms |
|
|
58
|
+
| 8:53:17 AM | 7 | get_related_tests | ✅ Success | 0ms |
|
|
59
|
+
| 8:53:43 AM | 8 | get_file_history | ✅ Success | 18ms |
|
|
60
|
+
| 8:53:43 AM | 8 | get_file_history | ✅ Success | 14ms |
|
|
61
|
+
| 8:53:43 AM | 8 | get_file_history | ✅ Success | 14ms |
|
|
62
|
+
| 8:53:43 AM | 8 | get_file_history | ✅ Success | 13ms |
|
|
63
|
+
| 8:53:43 AM | 8 | compare_previous_release | ✅ Success | 27ms |
|
|
64
|
+
|
|
65
|
+
## Conversation History
|
|
66
|
+
|
|
67
|
+
<details>
|
|
68
|
+
<summary>Click to expand full agentic interaction</summary>
|
|
69
|
+
|
|
70
|
+
```json
|
|
71
|
+
[
|
|
72
|
+
{
|
|
73
|
+
"role": "system",
|
|
74
|
+
"content": "You are a professional software engineer writing release notes for your team and users.\n\n## Available Tools\n\nYou have access to tools to investigate the release:\n- `get_tag_history` - Understand release patterns\n- `get_release_stats` - Quantify scope of changes\n- `compare_previous_release` - See how this compares to previous releases\n- `group_files_by_concern` - Identify themes in changes\n- `analyze_commit_patterns` - Detect patterns in commits\n- `get_file_content` - Read file contents or diffs\n- `analyze_diff_section` - Expand unclear changes\n- `get_file_history` - Understand how code evolved\n- `get_file_dependencies` - Assess impact and reach\n- `search_codebase` - Find usage patterns\n- `get_related_tests` - Understand behavior changes\n- `get_breaking_changes` - Identify breaking changes (always use this)\n\nUse these tools to investigate the changes rather than asking for information upfront.\n\n## Your Task\n\nWrite release notes that clearly explain what's in this release and why it matters. Your notes should help users and developers understand what changed without needing to read every commit.\n\nFocus on:\n- What problems does this release solve?\n- What new capabilities does it add?\n- What's the impact on users and developers?\n- Are there breaking changes or important considerations?\n\nUse the available tools to investigate the changes. The more you understand, the better your notes will be.\n\n**Important**: If additional context is provided (from context files or other sources), use your judgment:\n- If the context is relevant to this specific package/release, incorporate it appropriately\n- If the context describes changes in other packages or unrelated work, ignore it\n- Don't fabricate connections between this package and unrelated context\n- Be honest about what changed - only mention what actually happened in this release\n- Context is supplemental information, not a requirement to include\n\n## Investigation Approach\n\nUse tools based on what you need to know:\n\n**Context:**\n- get_tag_history - understand release patterns\n- get_release_stats - quantify scope\n- compare_previous_release - see how this compares\n\n**Understanding:**\n- group_files_by_concern - identify themes\n- analyze_commit_patterns - detect patterns\n- get_file_content - see full context\n- analyze_diff_section - expand unclear changes\n- get_file_history - understand evolution\n\n**Impact:**\n- get_file_dependencies - assess reach\n- search_codebase - find usage patterns\n- get_related_tests - understand behavior changes\n- get_breaking_changes - identify breaking changes (always use)\n\n## Writing Style\n\nWrite naturally and directly:\n- Use plain language that users can understand\n- Be specific about what changed and why\n- Avoid marketing speak and buzzwords\n- No emojis or excessive punctuation\n- No phrases like \"we're excited to announce\"\n- No meta-commentary about the release itself\n- Focus on facts and implications, not enthusiasm\n\nStructure your notes logically:\n- Start with the most important changes\n- Group related changes together\n- Explain breaking changes clearly\n- Include practical examples when helpful\n\n## Output Format\n\nWhen ready, output your release notes in this exact format:\n\nRELEASE_TITLE:\n[A clear, factual title describing the main changes]\n\nRELEASE_BODY:\n[Detailed release notes in Markdown format]\n\nDo not include any JSON, code blocks, or wrapper syntax. Output plain text and markdown only.\nNo conversational remarks or follow-up offers."
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"role": "user",
|
|
78
|
+
"content": "I need comprehensive release notes for changes from main to HEAD.\n\n**CRITICAL VERSION INSTRUCTION: This is a release for version 1.0.0. You MUST use EXACTLY \"1.0.0\" in your release title. DO NOT use any development/prerelease version numbers you may see in the diff (like 1.0.0-dev.0 or similar). The release version is 1.0.0.**\n\n## Your Analysis Task\n\nUse your tools to investigate the changes between main and HEAD:\n1. Use `get_release_stats` to understand the scope of changes\n2. Use `get_tag_history` or `compare_previous_release` to see release patterns\n3. Use `analyze_commit_patterns` to detect themes\n4. Use `group_files_by_concern` to identify logical groupings\n5. Use `get_breaking_changes` to identify breaking changes (always check this)\n6. Use `get_file_content` or `analyze_diff_section` to understand specific changes\n7. Use `get_file_dependencies` and `search_codebase` to assess impact\n\nWrite clear release notes that answer:\n- What's the main story of this release?\n- What problems does it solve?\n- What's the impact on users and developers?\n- Are there breaking changes?\n\nIf context information is provided, use it only if relevant to this specific package.\nDon't force connections that don't exist - if context describes changes in other packages\nor unrelated features, simply ignore it and focus on what actually changed in this release.\n\nStart by gathering statistics and understanding the scope, then investigate specific changes as needed."
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"role": "assistant",
|
|
82
|
+
"content": null,
|
|
83
|
+
"tool_calls": [
|
|
84
|
+
{
|
|
85
|
+
"id": "call_ra4lT63p6uQT0mXHk1UJlVu8",
|
|
86
|
+
"type": "function",
|
|
87
|
+
"function": {
|
|
88
|
+
"name": "get_release_stats",
|
|
89
|
+
"arguments": "{\"fromRef\": \"main\", \"toRef\": \"HEAD\"}"
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"id": "call_xVXJQrdmivNEJQIH86uDBRfD",
|
|
94
|
+
"type": "function",
|
|
95
|
+
"function": {
|
|
96
|
+
"name": "get_tag_history",
|
|
97
|
+
"arguments": "{\"limit\": 20, \"pattern\": \"v*\"}"
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"id": "call_xqkb3frxgqYOUxYgpQAAkxNs",
|
|
102
|
+
"type": "function",
|
|
103
|
+
"function": {
|
|
104
|
+
"name": "analyze_commit_patterns",
|
|
105
|
+
"arguments": "{\"fromRef\": \"main\", \"toRef\": \"HEAD\"}"
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"id": "call_BI32BvvGxgYKVi746GlbLCMl",
|
|
110
|
+
"type": "function",
|
|
111
|
+
"function": {
|
|
112
|
+
"name": "get_breaking_changes",
|
|
113
|
+
"arguments": "{\"fromRef\": \"main\", \"toRef\": \"HEAD\"}"
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
]
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"role": "tool",
|
|
120
|
+
"tool_call_id": "call_ra4lT63p6uQT0mXHk1UJlVu8",
|
|
121
|
+
"content": "Total commits: 6\n\nContributors:\n 6\tTim O'Brien\n\n\nFile changes: 5 files changed, 116 insertions(+), 50 deletions(-)\n\nTop 10 most changed files:\n vite.config.ts | 9 +++-\n src/index.ts | 148 +++++++++++++++++++++++++++++++++++++++------------------\n package.json | 6 ++-\n README.md | 2 +\n 5 files changed, 116 insertions(+), 50 deletions(-)\n .gitignore | 1 +\n",
|
|
122
|
+
"name": "get_release_stats"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"role": "tool",
|
|
126
|
+
"tool_call_id": "call_xVXJQrdmivNEJQIH86uDBRfD",
|
|
127
|
+
"content": "Recent release tags:\nv0.0.4: 2026-01-13 00:30:54 -0800 - chore(release): bump @riotprompt/execution-openai to 0.0.4 (#7)\nv0.0.3: 2026-01-12 22:09:39 -0800 - chore(release): bump @riotprompt/execution-openai to 0.0.3 (#6)\nv0.0.3-dev.0: tag v0.0.3-dev.0\nTagger: Tim O'Brien <tobrien@discursive.com>\n\n0.0.3-dev.0\n2026-01-10 17:54:34 -0800 - 0.0.3-dev.0\nv0.0.2: 2026-01-10 17:51:23 -0800 - Updated and separated tests (#5)\nv0.0.2-dev.0: tag v0.0.2-dev.0\nTagger: Tim O'Brien <tobrien@discursive.com>\n\n0.0.2-dev.0\n2026-01-10 11:22:13 -0800 - 0.0.2-dev.0",
|
|
128
|
+
"name": "get_tag_history"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"role": "tool",
|
|
132
|
+
"tool_call_id": "call_xqkb3frxgqYOUxYgpQAAkxNs",
|
|
133
|
+
"content": "Commit types:\n chore: 5\n feat: 1\n\nTop keywords in commits:\n chore: 5\n release: 2\n openai: 2\n kodrdriv: 2\n riotprompt: 1\n execution: 1\n gitignore: 1\n pattern: 1\n ignore: 1\n internal: 1\n files: 1\n build: 1\n precommit: 1\n script: 1\n validate: 1",
|
|
134
|
+
"name": "analyze_commit_patterns"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"role": "tool",
|
|
138
|
+
"tool_call_id": "call_BI32BvvGxgYKVi746GlbLCMl",
|
|
139
|
+
"content": "No obvious breaking changes detected. Manual review recommended for API changes.",
|
|
140
|
+
"name": "get_breaking_changes"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"role": "assistant",
|
|
144
|
+
"content": null,
|
|
145
|
+
"tool_calls": [
|
|
146
|
+
{
|
|
147
|
+
"id": "call_VXatQsBL65lMs2I5ZxYIkY0A",
|
|
148
|
+
"type": "function",
|
|
149
|
+
"function": {
|
|
150
|
+
"name": "group_files_by_concern",
|
|
151
|
+
"arguments": "{\"filePaths\":[\"vite.config.ts\",\"src/index.ts\",\"package.json\",\"README.md\",\".gitignore\"]}"
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
]
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"role": "tool",
|
|
158
|
+
"tool_call_id": "call_VXatQsBL65lMs2I5ZxYIkY0A",
|
|
159
|
+
"content": "other (2 files):\n - vite.config.ts\n - .gitignore\n\nsource:src (1 files):\n - src/index.ts\n\ndependencies (1 files):\n - package.json\n\ndocumentation (1 files):\n - README.md\n\nSuggestion: These 4 groups represent different concerns in the release.",
|
|
160
|
+
"name": "group_files_by_concern"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"role": "assistant",
|
|
164
|
+
"content": null,
|
|
165
|
+
"tool_calls": [
|
|
166
|
+
{
|
|
167
|
+
"id": "call_9CFp3malinxl7LHqG5i3meyN",
|
|
168
|
+
"type": "function",
|
|
169
|
+
"function": {
|
|
170
|
+
"name": "get_file_content",
|
|
171
|
+
"arguments": "{\"filePath\": \"src/index.ts\", \"includeLineNumbers\": true}"
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"id": "call_jCDhKZneYWiFh8IxvehU87wn",
|
|
176
|
+
"type": "function",
|
|
177
|
+
"function": {
|
|
178
|
+
"name": "get_file_content",
|
|
179
|
+
"arguments": "{\"filePath\": \"package.json\", \"includeLineNumbers\": true}"
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"id": "call_CsBQGTnJC1E7cul1F0VbIqYk",
|
|
184
|
+
"type": "function",
|
|
185
|
+
"function": {
|
|
186
|
+
"name": "get_file_content",
|
|
187
|
+
"arguments": "{\"filePath\": \"vite.config.ts\", \"includeLineNumbers\": true}"
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"id": "call_k2G7LOafOvOJmO4SXt0OFMEN",
|
|
192
|
+
"type": "function",
|
|
193
|
+
"function": {
|
|
194
|
+
"name": "get_file_content",
|
|
195
|
+
"arguments": "{\"filePath\": \"README.md\", \"includeLineNumbers\": true}"
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"id": "call_mt2djf8bDFnLhLEbKFQh4Jrl",
|
|
200
|
+
"type": "function",
|
|
201
|
+
"function": {
|
|
202
|
+
"name": "get_file_content",
|
|
203
|
+
"arguments": "{\"filePath\": \".gitignore\", \"includeLineNumbers\": true}"
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"id": "call_8AZv0l7NmNdYI1kWR5hySjuz",
|
|
208
|
+
"type": "function",
|
|
209
|
+
"function": {
|
|
210
|
+
"name": "get_file_history",
|
|
211
|
+
"arguments": "{\"filePaths\": [\"src/index.ts\", \"package.json\", \"vite.config.ts\"], \"limit\": 20, \"format\": \"detailed\"}"
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
"id": "call_1i5ztWrVRTpPbWJES1OWUw12",
|
|
216
|
+
"type": "function",
|
|
217
|
+
"function": {
|
|
218
|
+
"name": "get_file_dependencies",
|
|
219
|
+
"arguments": "{\"filePaths\": [\"src/index.ts\"]}"
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"id": "call_YVBWtX7nkB3PYpwwexpHvpeF",
|
|
224
|
+
"type": "function",
|
|
225
|
+
"function": {
|
|
226
|
+
"name": "search_codebase",
|
|
227
|
+
"arguments": "{\"query\": \"@riotprompt/execution-openai\", \"contextLines\": 2}"
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
]
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
"role": "tool",
|
|
234
|
+
"tool_call_id": "call_9CFp3malinxl7LHqG5i3meyN",
|
|
235
|
+
"content": "1: /**\n2: * Execution OpenAI Package\n3: *\n4: * OpenAI provider implementation for LLM execution.\n5: *\n6: * @packageDocumentation\n7: */\n8: \n9: import OpenAI from 'openai';\n10: import { getRedactor } from '@theunwalked/offrecord';\n11: import { \n12: createSafeError, \n13: configureErrorSanitizer,\n14: configureSecretGuard,\n15: } from '@theunwalked/spotclean';\n16: \n17: // Register OpenAI API key patterns on module load\n18: const redactor = getRedactor();\n19: redactor.register({\n20: name: 'openai',\n21: patterns: [\n22: /sk-[a-zA-Z0-9]{20,}/g,\n23: /sk-proj-[a-zA-Z0-9_-]+/g,\n24: ],\n25: validator: (key: string) => /^sk-(proj-)?[a-zA-Z0-9_-]{20,}$/.test(key),\n26: envVar: 'OPENAI_API_KEY',\n27: description: 'OpenAI API keys',\n28: });\n29: \n30: // Configure spotclean for error sanitization\n31: configureErrorSanitizer({\n32: enabled: true,\n33: environment: process.env.NODE_ENV === 'production' ? 'production' : 'development',\n34: includeCorrelationId: true,\n35: sanitizeStackTraces: process.env.NODE_ENV === 'production',\n36: maxMessageLength: 500,\n37: });\n38: \n39: configureSecretGuard({\n40: enabled: true,\n41: redactionText: '[REDACTED]',\n42: preservePartial: false,\n43: preserveLength: 0,\n44: customPatterns: [\n45: { name: 'openai', pattern: /sk-[a-zA-Z0-9]{20,}/g, description: 'OpenAI API key' },\n46: { name: 'openai-proj', pattern: /sk-proj-[a-zA-Z0-9_-]+/g, description: 'OpenAI project key' },\n47: ],\n48: });\n49: \n50: // ===== INLINE TYPES (from 'execution' package) =====\n51: // These types are duplicated here for build independence.\n52: // When 'execution' is published, these can be imported from there.\n53: \n54: export type Model = string;\n55: \n56: export interface Message {\n57: role: 'user' | 'assistant' | 'system' | 'developer' | 'tool';\n58: content: string | string[] | null;\n59: name?: string;\n60: }\n61: \n62: export interface Request {\n63: messages: Message[];\n64: model: Model;\n65: responseFormat?: any;\n66: validator?: any;\n67: addMessage(message: Message): void;\n68: }\n69: \n70: export interface ProviderResponse {\n71: content: string;\n72: model: string;\n73: usage?: {\n74: inputTokens: number;\n75: outputTokens: number;\n76: };\n77: toolCalls?: Array<{\n78: id: string;\n79: type: 'function';\n80: function: {\n81: name: string;\n82: arguments: string;\n83: };\n84: }>;\n85: }\n86: \n87: export interface ExecutionOptions {\n88: apiKey?: string;\n89: model?: string;\n90: temperature?: number;\n91: maxTokens?: number;\n92: timeout?: number;\n93: retries?: number;\n94: }\n95: \n96: export interface Provider {\n97: readonly name: string;\n98: execute(request: Request, options?: ExecutionOptions): Promise<ProviderResponse>;\n99: supportsModel?(model: Model): boolean;\n100: }\n101: \n102: /**\n103: * OpenAI Provider implementation\n104: */\n105: export class OpenAIProvider implements Provider {\n106: readonly name = 'openai';\n107: \n108: /**\n109: * Check if this provider supports a given model\n110: */\n111: supportsModel(model: Model): boolean {\n112: if (!model) return true; // Default to OpenAI\n113: return (\n114: model.startsWith('gpt') ||\n115: model.startsWith('o1') ||\n116: model.startsWith('o3') ||\n117: model.startsWith('o4')\n118: );\n119: }\n120: \n121: /**\n122: * Execute a request against OpenAI\n123: */\n124: async execute(\n125: request: Request,\n126: options: ExecutionOptions = {}\n127: ): Promise<ProviderResponse> {\n128: const apiKey = options.apiKey || process.env.OPENAI_API_KEY;\n129: \n130: if (!apiKey) {\n131: throw new Error('OpenAI API key is required. Set OPENAI_API_KEY environment variable.');\n132: }\n133: \n134: // Validate key format\n135: const validation = redactor.validateKey(apiKey, 'openai');\n136: if (!validation.valid) {\n137: throw new Error('Invalid OpenAI API key format');\n138: }\n139: \n140: try {\n141: const client = new OpenAI({ apiKey });\n142: \n143: const model = options.model || request.model || 'gpt-4';\n144: \n145: // Convert messages to OpenAI format\n146: const messages = request.messages.map((msg) => {\n147: const role =\n148: msg.role === 'developer' ? 'system' : msg.role;\n149: \n150: return {\n151: role: role,\n152: content:\n153: typeof msg.content === 'string'\n154: ? msg.content\n155: : JSON.stringify(msg.content),\n156: name: msg.name,\n157: } as any;\n158: });\n159: \n160: const response = await client.chat.completions.create({\n161: model: model,\n162: messages: messages,\n163: temperature: options.temperature,\n164: max_tokens: options.maxTokens,\n165: response_format: request.responseFormat,\n166: });\n167: \n168: const choice = response.choices[0];\n169: \n170: return {\n171: content: choice.message.content || '',\n172: model: response.model,\n173: usage: response.usage\n174: ? {\n175: inputTokens: response.usage.prompt_tokens,\n176: outputTokens: response.usage.completion_tokens,\n177: }\n178: : undefined,\n179: toolCalls: choice.message.tool_calls?.map((tc) => ({\n180: id: tc.id,\n181: type: 'function' as const,\n182: function: {\n183: name: tc.function.name,\n184: arguments: tc.function.arguments,\n185: },\n186: })),\n187: };\n188: } catch (error) {\n189: // Sanitize error to remove any API keys from error messages\n190: // Use spotclean for comprehensive error sanitization\n191: throw createSafeError(error as Error, { provider: 'openai' });\n192: }\n193: }\n194: }\n195: \n196: /**\n197: * Create a new OpenAI provider instance\n198: */\n199: export function createOpenAIProvider(): OpenAIProvider {\n200: return new OpenAIProvider();\n201: }\n202: \n203: /**\n204: * Package version\n205: */\n206: export const VERSION = '0.0.1';\n207: \n208: export default OpenAIProvider;\n209: ",
|
|
236
|
+
"name": "get_file_content"
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
"role": "tool",
|
|
240
|
+
"tool_call_id": "call_jCDhKZneYWiFh8IxvehU87wn",
|
|
241
|
+
"content": "1: {\n2: \"name\": \"@riotprompt/execution-openai\",\n3: \"version\": \"1.0.0\",\n4: \"description\": \"OpenAI provider for execution - implements Provider interface\",\n5: \"type\": \"module\",\n6: \"main\": \"./dist/index.js\",\n7: \"types\": \"./dist/index.d.ts\",\n8: \"exports\": {\n9: \".\": {\n10: \"types\": \"./dist/index.d.ts\",\n11: \"import\": \"./dist/index.js\"\n12: }\n13: },\n14: \"engines\": {\n15: \"node\": \">=24.0.0\"\n16: },\n17: \"scripts\": {\n18: \"clean\": \"rm -rf dist\",\n19: \"build\": \"vite build\",\n20: \"test\": \"vitest run --coverage\",\n21: \"test:coverage\": \"vitest run --coverage\",\n22: \"lint\": \"eslint src\",\n23: \"precommit\": \"npm run build && npm run lint && npm run test\",\n24: \"prepublishOnly\": \"npm run clean && npm run build\"\n25: },\n26: \"keywords\": [\n27: \"llm\",\n28: \"openai\",\n29: \"gpt\",\n30: \"execution\",\n31: \"provider\"\n32: ],\n33: \"author\": \"Tim O'Brien <tobrien@discursive.com>\",\n34: \"license\": \"Apache-2.0\",\n35: \"repository\": {\n36: \"type\": \"git\",\n37: \"url\": \"https://github.com/kjerneverk/execution-openai\"\n38: },\n39: \"dependencies\": {\n40: \"@theunwalked/offrecord\": \"^0.0.1\",\n41: \"@theunwalked/spotclean\": \"^0.0.3\",\n42: \"openai\": \"^4.103.0\",\n43: \"tiktoken\": \"^1.0.21\"\n44: },\n45: \"devDependencies\": {\n46: \"@types/node\": \"^25.0.6\",\n47: \"@typescript-eslint/eslint-plugin\": \"^8.33.1\",\n48: \"@typescript-eslint/parser\": \"^8.33.1\",\n49: \"@vitest/coverage-v8\": \"^3.2.4\",\n50: \"eslint\": \"^9.28.0\",\n51: \"globals\": \"^16.2.0\",\n52: \"typescript\": \"^5.8.3\",\n53: \"vite\": \"^7.0.4\",\n54: \"vite-plugin-dts\": \"^4.5.4\",\n55: \"vitest\": \"^3.2.4\"\n56: }\n57: }\n58: ",
|
|
242
|
+
"name": "get_file_content"
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
"role": "tool",
|
|
246
|
+
"tool_call_id": "call_CsBQGTnJC1E7cul1F0VbIqYk",
|
|
247
|
+
"content": "1: import { defineConfig } from \"vite\";\n2: import dts from \"vite-plugin-dts\";\n3: \n4: export default defineConfig({\n5: build: {\n6: lib: {\n7: entry: \"src/index.ts\",\n8: name: \"execution-openai\",\n9: fileName: () => \"index.js\",\n10: formats: [\"es\"],\n11: },\n12: rollupOptions: {\n13: external: [\n14: \"openai\",\n15: \"tiktoken\",\n16: \"execution\",\n17: \"@theunwalked/offrecord\",\n18: \"@theunwalked/spotclean\",\n19: \"node:crypto\",\n20: ],\n21: },\n22: sourcemap: true,\n23: minify: false,\n24: },\n25: plugins: [dts({ rollupTypes: true })],\n26: });\n27: ",
|
|
248
|
+
"name": "get_file_content"
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
"role": "tool",
|
|
252
|
+
"tool_call_id": "call_k2G7LOafOvOJmO4SXt0OFMEN",
|
|
253
|
+
"content": "1: # execution-openai\n2: \n3: OpenAI provider implementation for LLM execution. Implements the `Provider` interface from the `execution` package.\n4: \n5: ## Installation\n6: \n7: ```bash\n8: npm install execution-openai openai\n9: ```\n10: \n11: ## Usage\n12: \n13: ```typescript\n14: import { OpenAIProvider, createOpenAIProvider } from 'execution-openai';\n15: \n16: // Create provider\n17: const provider = createOpenAIProvider();\n18: \n19: // Or use the class directly\n20: const provider = new OpenAIProvider();\n21: \n22: // Execute a request\n23: const response = await provider.execute(\n24: {\n25: model: 'gpt-4o',\n26: messages: [\n27: { role: 'system', content: 'You are helpful.' },\n28: { role: 'user', content: 'Hello!' }\n29: ],\n30: addMessage: () => {},\n31: },\n32: {\n33: apiKey: process.env.OPENAI_API_KEY,\n34: temperature: 0.7,\n35: maxTokens: 1000,\n36: }\n37: );\n38: \n39: console.log(response.content);\n40: console.log(response.usage); // { inputTokens: X, outputTokens: Y }\n41: ```\n42: \n43: ## Supported Models\n44: \n45: The provider supports all OpenAI models:\n46: - GPT-4 family (gpt-4, gpt-4o, gpt-4-turbo, etc.)\n47: - O-series (o1, o1-preview, o1-mini, o3, etc.)\n48: - GPT-3.5 family\n49: \n50: ## API Key\n51: \n52: Set via:\n53: 1. `options.apiKey` parameter\n54: 2. `OPENAI_API_KEY` environment variable\n55: \n56: ## Response Format\n57: \n58: ```typescript\n59: interface ProviderResponse {\n60: content: string;\n61: model: string;\n62: usage?: {\n63: inputTokens: number;\n64: outputTokens: number;\n65: };\n66: toolCalls?: ToolCall[];\n67: }\n68: ```\n69: \n70: ## Related Packages\n71: \n72: - `execution` - Core interfaces (no SDK dependencies)\n73: - `execution-anthropic` - Anthropic provider\n74: - `execution-gemini` - Google Gemini provider\n75: \n76: ## License\n77: \n78: Apache-2.0\n79: \n80: <!-- v1.0.0 -->\n81: ",
|
|
254
|
+
"name": "get_file_content"
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
"role": "tool",
|
|
258
|
+
"tool_call_id": "call_mt2djf8bDFnLhLEbKFQh4Jrl",
|
|
259
|
+
"content": "1: *~\n2: .env \n3: dist\n4: node_modules\n5: *.log\n6: .vscode\n7: coverage/\n8: **/.DS_Store\n9: package-lock.json\n10: \n11: output/\n12: .kodrdriv*\n13: ",
|
|
260
|
+
"name": "get_file_content"
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
"role": "tool",
|
|
264
|
+
"tool_call_id": "call_8AZv0l7NmNdYI1kWR5hySjuz",
|
|
265
|
+
"content": "dbca41cf5b0a6f65a0f0c6d8232e9602da2b1de3\nTim O'Brien (tobrien@discursive.com)\nMon Jan 26 08:52:42 2026 -0800\nchore(release): bump @riotprompt/execution-openai to 1.0.0\n\n\n---\n3019c9a186bb07749007d0e5469c36a0f0e5adbd\nTim O'Brien (tobrien@discursive.com)\nThu Jan 15 07:39:56 2026 -0800\nchore: run build in precommit script\n\n\n---\n117b7a501da6606d85b6615b73907fabff98ccef\nTim O'Brien (tobrien@discursive.com)\nThu Jan 15 06:16:42 2026 -0800\nchore(release): bump to 1.0.0-dev.0\n\n\n---\neea6bd7bfdc10b9276ef5363dbb4c1e38a291f6a\nTim O'Brien (tobrien@discursive.com)\nWed Jan 14 06:56:03 2026 -0800\nfeat(openai): validate API key and sanitize errors with offrecord/spotclean\n\n- Add offrecord + spotclean dependencies and register OpenAI key patterns\n- Validate OPENAI_API_KEY format before creating client\n- Sanitize provider errors to prevent leaking secrets\n- Mark new deps (and node:crypto) as external in Vite build\n\n---\nc4e914942be29dcd85b70d5dac3d1b7d8ce731d8\nTim O'Brien (tobrien@discursive.com)\nTue Jan 13 00:31:48 2026 -0800\nchore: bump to 0.0.4-dev.0\n\n\n---\n2f6afb38ef9077c54bd911c68d0eed2cadd9917a\nTim O'Brien (tobrien@discursive.com)\nTue Jan 13 00:30:54 2026 -0800\nchore(release): bump @riotprompt/execution-openai to 0.0.4 (#7)\n\n* chore: bump to v0.0.4-dev.0\n\n* chore(build): switch to ESM-only output, require Node 24, and target ES2024\n\n* chore(release): bump @riotprompt/execution-openai to 0.0.4\n---\n77c696fc4b15e11624eef8b36a695ec6fd5ebac1\nTim O'Brien (tobrien@discursive.com)\nMon Jan 12 22:09:39 2026 -0800\nchore(release): bump @riotprompt/execution-openai to 0.0.3 (#6)\n\n* 0.0.2-dev.0\n\n* Updated and separated tests\n\n* 0.0.3-dev.0\n\n* ci: bump GitHub Actions Node to 24 and use npm install\n\n* chore(release): bump @riotprompt/execution-openai to 0.0.3\n---\nd3ddebdaed42578185cf6a9717896e0dcc2fa2f5\nTim O'Brien (tobrien@discursive.com)\nSat Jan 10 17:51:23 2026 -0800\nUpdated and separated tests (#5)\n\n* 0.0.2-dev.0\n\n* Updated and separated tests\n---\n52ade0898ae977c0e7058b0aa15568a9ded40825\nTim O'Brien (tobrien@discursive.com)\nSat Jan 10 11:21:52 2026 -0800\nFirst commit\n\n\n---\n",
|
|
266
|
+
"name": "get_file_history"
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
"role": "tool",
|
|
270
|
+
"tool_call_id": "call_1i5ztWrVRTpPbWJES1OWUw12",
|
|
271
|
+
"content": "No files found that import the specified files",
|
|
272
|
+
"name": "get_file_dependencies"
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"role": "tool",
|
|
276
|
+
"tool_call_id": "call_YVBWtX7nkB3PYpwwexpHvpeF",
|
|
277
|
+
"content": "package.json-1-{\npackage.json:2: \"name\": \"@riotprompt/execution-openai\",\npackage.json-3- \"version\": \"1.0.0\",\npackage.json-4- \"description\": \"OpenAI provider for execution - implements Provider interface\",\n",
|
|
278
|
+
"name": "search_codebase"
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
"role": "assistant",
|
|
282
|
+
"content": null,
|
|
283
|
+
"tool_calls": [
|
|
284
|
+
{
|
|
285
|
+
"id": "call_xhIHdZzOoNMZi9v43PxiIQTn",
|
|
286
|
+
"type": "function",
|
|
287
|
+
"function": {
|
|
288
|
+
"name": "search_codebase",
|
|
289
|
+
"arguments": "{\"query\":\"export const VERSION\", \"fileTypes\":[\"ts\",\"js\"], \"contextLines\":2}"
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
]
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
"role": "tool",
|
|
296
|
+
"tool_call_id": "call_xhIHdZzOoNMZi9v43PxiIQTn",
|
|
297
|
+
"content": "src/index.ts-204- * Package version\nsrc/index.ts-205- */\nsrc/index.ts:206:export const VERSION = '0.0.1';\nsrc/index.ts-207-\nsrc/index.ts-208-export default OpenAIProvider;\n",
|
|
298
|
+
"name": "search_codebase"
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
"role": "assistant",
|
|
302
|
+
"content": null,
|
|
303
|
+
"tool_calls": [
|
|
304
|
+
{
|
|
305
|
+
"id": "call_oZ2NHE3OZCTcVsQFHWd845J0",
|
|
306
|
+
"type": "function",
|
|
307
|
+
"function": {
|
|
308
|
+
"name": "search_codebase",
|
|
309
|
+
"arguments": "{\"query\":\"createSafeError(\", \"fileTypes\":[\"ts\"],\"contextLines\":2}"
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
]
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
"role": "tool",
|
|
316
|
+
"tool_call_id": "call_oZ2NHE3OZCTcVsQFHWd845J0",
|
|
317
|
+
"content": "src/index.ts-189- // Sanitize error to remove any API keys from error messages\nsrc/index.ts-190- // Use spotclean for comprehensive error sanitization\nsrc/index.ts:191: throw createSafeError(error as Error, { provider: 'openai' });\nsrc/index.ts-192- }\nsrc/index.ts-193- }\n",
|
|
318
|
+
"name": "search_codebase"
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
"role": "assistant",
|
|
322
|
+
"content": null,
|
|
323
|
+
"tool_calls": [
|
|
324
|
+
{
|
|
325
|
+
"id": "call_XZa0DcCZqBX9TsilzuXiXoFq",
|
|
326
|
+
"type": "function",
|
|
327
|
+
"function": {
|
|
328
|
+
"name": "search_codebase",
|
|
329
|
+
"arguments": "{\"query\":\"validateKey(\", \"fileTypes\":[\"ts\"],\"contextLines\":2}"
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
]
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
"role": "tool",
|
|
336
|
+
"tool_call_id": "call_XZa0DcCZqBX9TsilzuXiXoFq",
|
|
337
|
+
"content": "src/index.ts-133-\nsrc/index.ts-134- // Validate key format\nsrc/index.ts:135: const validation = redactor.validateKey(apiKey, 'openai');\nsrc/index.ts-136- if (!validation.valid) {\nsrc/index.ts-137- throw new Error('Invalid OpenAI API key format');\n",
|
|
338
|
+
"name": "search_codebase"
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
"role": "assistant",
|
|
342
|
+
"content": null,
|
|
343
|
+
"tool_calls": [
|
|
344
|
+
{
|
|
345
|
+
"id": "call_YjLQ1psjWuETnDaZd0PQZfMk",
|
|
346
|
+
"type": "function",
|
|
347
|
+
"function": {
|
|
348
|
+
"name": "get_related_tests",
|
|
349
|
+
"arguments": "{\"filePaths\":[\"src/index.ts\"]}"
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
]
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
"role": "tool",
|
|
356
|
+
"tool_call_id": "call_YjLQ1psjWuETnDaZd0PQZfMk",
|
|
357
|
+
"content": "Found related test files:\nsrc/index.ts",
|
|
358
|
+
"name": "get_related_tests"
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
"role": "assistant",
|
|
362
|
+
"content": null,
|
|
363
|
+
"tool_calls": [
|
|
364
|
+
{
|
|
365
|
+
"id": "call_qvYqz7bOGOnXW7ChWzTNgtgf",
|
|
366
|
+
"type": "function",
|
|
367
|
+
"function": {
|
|
368
|
+
"name": "get_file_history",
|
|
369
|
+
"arguments": "{\"filePaths\": [\"package.json\"], \"limit\": 15, \"format\": \"detailed\"}"
|
|
370
|
+
}
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
"id": "call_clWfO0SVy7VD2AAcclmIdH16",
|
|
374
|
+
"type": "function",
|
|
375
|
+
"function": {
|
|
376
|
+
"name": "get_file_history",
|
|
377
|
+
"arguments": "{\"filePaths\": [\"vite.config.ts\"], \"limit\": 15, \"format\": \"detailed\"}"
|
|
378
|
+
}
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
"id": "call_n1F00Bmax9q948hc8ONi039Z",
|
|
382
|
+
"type": "function",
|
|
383
|
+
"function": {
|
|
384
|
+
"name": "get_file_history",
|
|
385
|
+
"arguments": "{\"filePaths\": [\"README.md\"], \"limit\": 15, \"format\": \"detailed\"}"
|
|
386
|
+
}
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
"id": "call_YHqlzzRaUQQf8SRRftejirVn",
|
|
390
|
+
"type": "function",
|
|
391
|
+
"function": {
|
|
392
|
+
"name": "get_file_history",
|
|
393
|
+
"arguments": "{\"filePaths\": [\".gitignore\"], \"limit\": 15, \"format\": \"detailed\"}"
|
|
394
|
+
}
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
"id": "call_gOWyifOeskGSbGMugNfLRm6K",
|
|
398
|
+
"type": "function",
|
|
399
|
+
"function": {
|
|
400
|
+
"name": "compare_previous_release",
|
|
401
|
+
"arguments": "{\"previousTag\": \"v0.0.4\", \"currentRef\": \"HEAD\", \"statsOnly\": true}"
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
]
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
"role": "tool",
|
|
408
|
+
"tool_call_id": "call_qvYqz7bOGOnXW7ChWzTNgtgf",
|
|
409
|
+
"content": "dbca41cf5b0a6f65a0f0c6d8232e9602da2b1de3\nTim O'Brien (tobrien@discursive.com)\nMon Jan 26 08:52:42 2026 -0800\nchore(release): bump @riotprompt/execution-openai to 1.0.0\n\n\n---\n3019c9a186bb07749007d0e5469c36a0f0e5adbd\nTim O'Brien (tobrien@discursive.com)\nThu Jan 15 07:39:56 2026 -0800\nchore: run build in precommit script\n\n\n---\n117b7a501da6606d85b6615b73907fabff98ccef\nTim O'Brien (tobrien@discursive.com)\nThu Jan 15 06:16:42 2026 -0800\nchore(release): bump to 1.0.0-dev.0\n\n\n---\neea6bd7bfdc10b9276ef5363dbb4c1e38a291f6a\nTim O'Brien (tobrien@discursive.com)\nWed Jan 14 06:56:03 2026 -0800\nfeat(openai): validate API key and sanitize errors with offrecord/spotclean\n\n- Add offrecord + spotclean dependencies and register OpenAI key patterns\n- Validate OPENAI_API_KEY format before creating client\n- Sanitize provider errors to prevent leaking secrets\n- Mark new deps (and node:crypto) as external in Vite build\n\n---\nc4e914942be29dcd85b70d5dac3d1b7d8ce731d8\nTim O'Brien (tobrien@discursive.com)\nTue Jan 13 00:31:48 2026 -0800\nchore: bump to 0.0.4-dev.0\n\n\n---\n2f6afb38ef9077c54bd911c68d0eed2cadd9917a\nTim O'Brien (tobrien@discursive.com)\nTue Jan 13 00:30:54 2026 -0800\nchore(release): bump @riotprompt/execution-openai to 0.0.4 (#7)\n\n* chore: bump to v0.0.4-dev.0\n\n* chore(build): switch to ESM-only output, require Node 24, and target ES2024\n\n* chore(release): bump @riotprompt/execution-openai to 0.0.4\n---\n77c696fc4b15e11624eef8b36a695ec6fd5ebac1\nTim O'Brien (tobrien@discursive.com)\nMon Jan 12 22:09:39 2026 -0800\nchore(release): bump @riotprompt/execution-openai to 0.0.3 (#6)\n\n* 0.0.2-dev.0\n\n* Updated and separated tests\n\n* 0.0.3-dev.0\n\n* ci: bump GitHub Actions Node to 24 and use npm install\n\n* chore(release): bump @riotprompt/execution-openai to 0.0.3\n---\nd3ddebdaed42578185cf6a9717896e0dcc2fa2f5\nTim O'Brien (tobrien@discursive.com)\nSat Jan 10 17:51:23 2026 -0800\nUpdated and separated tests (#5)\n\n* 0.0.2-dev.0\n\n* Updated and separated tests\n---\n52ade0898ae977c0e7058b0aa15568a9ded40825\nTim O'Brien (tobrien@discursive.com)\nSat Jan 10 11:21:52 2026 -0800\nFirst commit\n\n\n---\n",
|
|
410
|
+
"name": "get_file_history"
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
"role": "tool",
|
|
414
|
+
"tool_call_id": "call_clWfO0SVy7VD2AAcclmIdH16",
|
|
415
|
+
"content": "eea6bd7bfdc10b9276ef5363dbb4c1e38a291f6a\nTim O'Brien (tobrien@discursive.com)\nWed Jan 14 06:56:03 2026 -0800\nfeat(openai): validate API key and sanitize errors with offrecord/spotclean\n\n- Add offrecord + spotclean dependencies and register OpenAI key patterns\n- Validate OPENAI_API_KEY format before creating client\n- Sanitize provider errors to prevent leaking secrets\n- Mark new deps (and node:crypto) as external in Vite build\n\n---\n2f6afb38ef9077c54bd911c68d0eed2cadd9917a\nTim O'Brien (tobrien@discursive.com)\nTue Jan 13 00:30:54 2026 -0800\nchore(release): bump @riotprompt/execution-openai to 0.0.4 (#7)\n\n* chore: bump to v0.0.4-dev.0\n\n* chore(build): switch to ESM-only output, require Node 24, and target ES2024\n\n* chore(release): bump @riotprompt/execution-openai to 0.0.4\n---\n52ade0898ae977c0e7058b0aa15568a9ded40825\nTim O'Brien (tobrien@discursive.com)\nSat Jan 10 11:21:52 2026 -0800\nFirst commit\n\n\n---\n",
|
|
416
|
+
"name": "get_file_history"
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
"role": "tool",
|
|
420
|
+
"tool_call_id": "call_n1F00Bmax9q948hc8ONi039Z",
|
|
421
|
+
"content": "117b7a501da6606d85b6615b73907fabff98ccef\nTim O'Brien (tobrien@discursive.com)\nThu Jan 15 06:16:42 2026 -0800\nchore(release): bump to 1.0.0-dev.0\n\n\n---\n52ade0898ae977c0e7058b0aa15568a9ded40825\nTim O'Brien (tobrien@discursive.com)\nSat Jan 10 11:21:52 2026 -0800\nFirst commit\n\n\n---\n",
|
|
422
|
+
"name": "get_file_history"
|
|
423
|
+
},
|
|
424
|
+
{
|
|
425
|
+
"role": "tool",
|
|
426
|
+
"tool_call_id": "call_YHqlzzRaUQQf8SRRftejirVn",
|
|
427
|
+
"content": "8ff7fa91d2505c6f47ae6b597f54c79c1c5027bc\nTim O'Brien (tobrien@discursive.com)\nMon Jan 26 08:51:49 2026 -0800\nchore(gitignore): add .kodrdriv* pattern to ignore kodrdriv internal files\n\n\n---\n77c696fc4b15e11624eef8b36a695ec6fd5ebac1\nTim O'Brien (tobrien@discursive.com)\nMon Jan 12 22:09:39 2026 -0800\nchore(release): bump @riotprompt/execution-openai to 0.0.3 (#6)\n\n* 0.0.2-dev.0\n\n* Updated and separated tests\n\n* 0.0.3-dev.0\n\n* ci: bump GitHub Actions Node to 24 and use npm install\n\n* chore(release): bump @riotprompt/execution-openai to 0.0.3\n---\n52ade0898ae977c0e7058b0aa15568a9ded40825\nTim O'Brien (tobrien@discursive.com)\nSat Jan 10 11:21:52 2026 -0800\nFirst commit\n\n\n---\n",
|
|
428
|
+
"name": "get_file_history"
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
"role": "tool",
|
|
432
|
+
"tool_call_id": "call_gOWyifOeskGSbGMugNfLRm6K",
|
|
433
|
+
"content": "Comparison between v0.0.4 and HEAD:\n\nCommits: 6\n\nFile changes:\n .gitignore | 1 +\n README.md | 2 +\n package.json | 6 ++-\n src/index.ts | 148 +++++++++++++++++++++++++++++++++++++++------------------\n vite.config.ts | 9 +++-\n 5 files changed, 116 insertions(+), 50 deletions(-)\n",
|
|
434
|
+
"name": "compare_previous_release"
|
|
435
|
+
},
|
|
436
|
+
{
|
|
437
|
+
"role": "assistant",
|
|
438
|
+
"content": "RELEASE_TITLE:\n1.0.0 — OpenAI API key validation + secret-safe error handling\n\nRELEASE_BODY:\n## Main story\nThis release hardens `@riotprompt/execution-openai` against accidental secret leakage by validating OpenAI API keys up front and sanitizing provider errors before they escape to application logs/telemetry. It also updates packaging/scripts to support the new security dependencies.\n\n## Security & reliability improvements\n- **API key format validation before any OpenAI calls**\n - `OpenAIProvider.execute()` now validates the configured key (from `options.apiKey` or `OPENAI_API_KEY`) and fails fast with a clear error if it’s missing or malformed.\n - Key patterns include both `sk-...` and `sk-proj-...`.\n\n- **Sanitized errors to reduce risk of secret leakage**\n - Provider errors are now wrapped/sanitized via `@theunwalked/spotclean` (`createSafeError(...)`) to help prevent API keys or other secrets from appearing in thrown errors.\n - Error sanitization is configured at module load with correlation IDs enabled; stack trace sanitization is stricter in production.\n\n- **Secret redaction patterns registered on import**\n - `@theunwalked/offrecord` is configured on module load to recognize OpenAI key formats for validation/redaction purposes.\n\n## Packaging / dependency changes\n- **New runtime dependencies**\n - Adds `@theunwalked/offrecord` and `@theunwalked/spotclean` as dependencies (used for key validation and error sanitization).\n\n- **Build configuration updated for externalized deps**\n - `vite.config.ts` now treats the new dependencies (and `node:crypto`) as externals for the library build, avoiding bundling them into the output.\n\n## Developer experience\n- **Stricter precommit checks**\n - The `precommit` script now runs `build` in addition to `lint` and `test`, catching build-time issues earlier.\n\n- **Repo hygiene**\n - `.gitignore` now ignores `.kodrdriv*` internal files.\n\n## Documentation\n- Minor README updates (no functional behavior change described in docs).\n\n## Breaking changes\nNo explicit breaking changes were detected in the release range.\n\nThat said, there are a couple of behavior changes to be aware of:\n- **Error shape/content may differ**: errors thrown from `execute()` are now sanitized/wrapped, which can change error messages and stack traces compared to previous versions.\n- **Module import has side effects**: importing the package now configures redaction/sanitization behavior at module load (via `offrecord`/`spotclean`). If your app configures these libraries globally, verify the combined configuration behaves as expected.\n\n## Upgrade notes\n- If you were relying on raw OpenAI SDK error messages (or exact error strings), re-check your error handling and tests—sanitization can change what you see.\n- If you provide keys dynamically, ensure they match expected OpenAI formats; invalid keys will now fail fast before any network request."
|
|
439
|
+
}
|
|
440
|
+
]
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
</details>
|
|
444
|
+
|
|
445
|
+
## Generated Release Notes
|
|
446
|
+
|
|
447
|
+
### Title
|
|
448
|
+
```
|
|
449
|
+
1.0.0 — OpenAI API key validation + secret-safe error handling
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
### Body
|
|
453
|
+
```markdown
|
|
454
|
+
## Main story
|
|
455
|
+
This release hardens `@riotprompt/execution-openai` against accidental secret leakage by validating OpenAI API keys up front and sanitizing provider errors before they escape to application logs/telemetry. It also updates packaging/scripts to support the new security dependencies.
|
|
456
|
+
|
|
457
|
+
## Security & reliability improvements
|
|
458
|
+
- **API key format validation before any OpenAI calls**
|
|
459
|
+
- `OpenAIProvider.execute()` now validates the configured key (from `options.apiKey` or `OPENAI_API_KEY`) and fails fast with a clear error if it’s missing or malformed.
|
|
460
|
+
- Key patterns include both `sk-...` and `sk-proj-...`.
|
|
461
|
+
|
|
462
|
+
- **Sanitized errors to reduce risk of secret leakage**
|
|
463
|
+
- Provider errors are now wrapped/sanitized via `@theunwalked/spotclean` (`createSafeError(...)`) to help prevent API keys or other secrets from appearing in thrown errors.
|
|
464
|
+
- Error sanitization is configured at module load with correlation IDs enabled; stack trace sanitization is stricter in production.
|
|
465
|
+
|
|
466
|
+
- **Secret redaction patterns registered on import**
|
|
467
|
+
- `@theunwalked/offrecord` is configured on module load to recognize OpenAI key formats for validation/redaction purposes.
|
|
468
|
+
|
|
469
|
+
## Packaging / dependency changes
|
|
470
|
+
- **New runtime dependencies**
|
|
471
|
+
- Adds `@theunwalked/offrecord` and `@theunwalked/spotclean` as dependencies (used for key validation and error sanitization).
|
|
472
|
+
|
|
473
|
+
- **Build configuration updated for externalized deps**
|
|
474
|
+
- `vite.config.ts` now treats the new dependencies (and `node:crypto`) as externals for the library build, avoiding bundling them into the output.
|
|
475
|
+
|
|
476
|
+
## Developer experience
|
|
477
|
+
- **Stricter precommit checks**
|
|
478
|
+
- The `precommit` script now runs `build` in addition to `lint` and `test`, catching build-time issues earlier.
|
|
479
|
+
|
|
480
|
+
- **Repo hygiene**
|
|
481
|
+
- `.gitignore` now ignores `.kodrdriv*` internal files.
|
|
482
|
+
|
|
483
|
+
## Documentation
|
|
484
|
+
- Minor README updates (no functional behavior change described in docs).
|
|
485
|
+
|
|
486
|
+
## Breaking changes
|
|
487
|
+
No explicit breaking changes were detected in the release range.
|
|
488
|
+
|
|
489
|
+
That said, there are a couple of behavior changes to be aware of:
|
|
490
|
+
- **Error shape/content may differ**: errors thrown from `execute()` are now sanitized/wrapped, which can change error messages and stack traces compared to previous versions.
|
|
491
|
+
- **Module import has side effects**: importing the package now configures redaction/sanitization behavior at module load (via `offrecord`/`spotclean`). If your app configures these libraries globally, verify the combined configuration behaves as expected.
|
|
492
|
+
|
|
493
|
+
## Upgrade notes
|
|
494
|
+
- If you were relying on raw OpenAI SDK error messages (or exact error strings), re-check your error handling and tests—sanitization can change what you see.
|
|
495
|
+
- If you provide keys dynamically, ensure they match expected OpenAI formats; invalid keys will now fail fast before any network request.
|
|
496
|
+
```
|