codex-1up 0.1.2 → 0.1.3
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/README.md
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
- ✅ Unified **Codex config** with multiple profiles: `balanced` / `safe` / `minimal` / `yolo`
|
|
12
12
|
- ✅ 🔊 **Notification sounds** with customizable audio alerts for Codex events
|
|
13
13
|
|
|
14
|
+
![Screenshot of Codex 1UP terminal interface] (https://raw.githubusercontent.com/regenrek/codex-1up/main/public/example.png)
|
|
14
15
|
|
|
15
16
|
## Quick start
|
|
16
17
|
|
package/package.json
CHANGED
package/scripts/release.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { execSync } from "node:child_process";
|
|
2
2
|
import fs from "node:fs";
|
|
3
3
|
import path from "node:path";
|
|
4
|
+
import os from "node:os";
|
|
4
5
|
|
|
5
6
|
interface PackageTarget {
|
|
6
7
|
name: string;
|
|
@@ -122,6 +123,8 @@ async function publishPackages(
|
|
|
122
123
|
|
|
123
124
|
const newVersion = bumpAllVersions(versionBump);
|
|
124
125
|
|
|
126
|
+
let repoSlug = "";
|
|
127
|
+
|
|
125
128
|
for (const target of packageTargets.filter((pkg) => pkg.publish)) {
|
|
126
129
|
const pkgPath = path.resolve(target.dir);
|
|
127
130
|
const manifestPath = path.join(pkgPath, "package.json");
|
|
@@ -130,6 +133,13 @@ async function publishPackages(
|
|
|
130
133
|
continue;
|
|
131
134
|
}
|
|
132
135
|
const manifest = JSON.parse(fs.readFileSync(manifestPath, "utf8"));
|
|
136
|
+
try {
|
|
137
|
+
const repoUrl: string | undefined = manifest?.repository?.url;
|
|
138
|
+
if (repoUrl) {
|
|
139
|
+
const m = repoUrl.match(/github\.com\/(.+?)\.git$/);
|
|
140
|
+
if (m) repoSlug = m[1];
|
|
141
|
+
}
|
|
142
|
+
} catch {}
|
|
133
143
|
if (manifest.private) {
|
|
134
144
|
console.warn(
|
|
135
145
|
`Skipping publish for ${target.name}; package.json is marked private`,
|
|
@@ -150,14 +160,6 @@ async function publishPackages(
|
|
|
150
160
|
let readme = fs.readFileSync(rootReadme, "utf8");
|
|
151
161
|
// If README uses local ./public images, rewrite to absolute GitHub raw URLs
|
|
152
162
|
// Derive repo slug from package.json repository.url when possible
|
|
153
|
-
let repoSlug = "";
|
|
154
|
-
try {
|
|
155
|
-
const repoUrl: string | undefined = manifest?.repository?.url;
|
|
156
|
-
if (repoUrl) {
|
|
157
|
-
const m = repoUrl.match(/github\.com\/(.+?)\.git$/);
|
|
158
|
-
if (m) repoSlug = m[1];
|
|
159
|
-
}
|
|
160
|
-
} catch {}
|
|
161
163
|
if (repoSlug) {
|
|
162
164
|
readme = readme.replace(
|
|
163
165
|
/\]\(\.\/public\//g,
|
|
@@ -191,6 +193,13 @@ async function publishPackages(
|
|
|
191
193
|
}
|
|
192
194
|
|
|
193
195
|
createGitCommitAndTag(newVersion);
|
|
196
|
+
|
|
197
|
+
// After tagging, create or update a GitHub Release with notes from CHANGELOG
|
|
198
|
+
try {
|
|
199
|
+
createGithubRelease(newVersion, repoSlug);
|
|
200
|
+
} catch (e) {
|
|
201
|
+
console.warn("Skipping GitHub Release creation:", e);
|
|
202
|
+
}
|
|
194
203
|
}
|
|
195
204
|
|
|
196
205
|
// Get version bump type from command line arguments
|
|
@@ -198,3 +207,59 @@ const args = process.argv.slice(2);
|
|
|
198
207
|
const versionBumpArg = args[0] || "patch"; // Default to patch
|
|
199
208
|
|
|
200
209
|
publishPackages(versionBumpArg).catch(console.error);
|
|
210
|
+
|
|
211
|
+
// -------------- helpers: GitHub Release --------------
|
|
212
|
+
|
|
213
|
+
function hasGhCLI(): boolean {
|
|
214
|
+
try {
|
|
215
|
+
execSync("gh --version", { stdio: "ignore" });
|
|
216
|
+
return true;
|
|
217
|
+
} catch {
|
|
218
|
+
return false;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
function changelogSection(versionLike: string): string | null {
|
|
223
|
+
const file = path.resolve("CHANGELOG.md");
|
|
224
|
+
if (!fs.existsSync(file)) return null;
|
|
225
|
+
const text = fs.readFileSync(file, "utf8");
|
|
226
|
+
const re = new RegExp(
|
|
227
|
+
`^## \\\\[${versionLike.replace(/[.*+?^${}()|[\\]\\\\]/g, "\\$&")}\\\\]` + "[\\s\\S]*?(?=^## \\\\[(?:.|\\n)*?\\\\]|\n\n?$)",
|
|
228
|
+
"m",
|
|
229
|
+
);
|
|
230
|
+
const m = text.match(re);
|
|
231
|
+
return m ? m[0].trim() + "\n" : null;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
function ghReleaseExists(tag: string): boolean {
|
|
235
|
+
try {
|
|
236
|
+
execSync(`gh release view ${tag}`, { stdio: "ignore" });
|
|
237
|
+
return true;
|
|
238
|
+
} catch {
|
|
239
|
+
return false;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
function createGithubRelease(version: string, repoSlug: string) {
|
|
244
|
+
if (!hasGhCLI()) return;
|
|
245
|
+
const tag = `v${version}`;
|
|
246
|
+
const title = `codex-1up ${tag}`;
|
|
247
|
+
let notes = changelogSection(version);
|
|
248
|
+
|
|
249
|
+
// fallback: if no section for this semver (e.g., 0.1.1), try mapping to 0.4 if present
|
|
250
|
+
if (!notes) {
|
|
251
|
+
const alt = process.env.GH_NOTES_REF || "0.4";
|
|
252
|
+
notes = changelogSection(alt) || undefined;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
const tmp = path.join(os.tmpdir(), `release-notes-${version}.md`);
|
|
256
|
+
if (notes) fs.writeFileSync(tmp, notes);
|
|
257
|
+
|
|
258
|
+
const exists = ghReleaseExists(tag);
|
|
259
|
+
const cmd = exists
|
|
260
|
+
? `gh release edit ${tag} --title "${title}" ${notes ? `--notes-file ${tmp}` : "--generate-notes"}`
|
|
261
|
+
: `gh release create ${tag} --title "${title}" ${notes ? `--notes-file ${tmp}` : "--generate-notes"}`;
|
|
262
|
+
|
|
263
|
+
console.log(`${exists ? "Updating" : "Creating"} GitHub Release ${tag}...`);
|
|
264
|
+
execSync(cmd, { stdio: "inherit" });
|
|
265
|
+
}
|
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
When you need to call tools from the shell, use this rubric:
|
|
4
4
|
|
|
5
5
|
## File Operations
|
|
6
|
-
-
|
|
6
|
+
- Find files by file name: `fd`
|
|
7
|
+
- Find files with path name: `fd -p <file-path>`
|
|
8
|
+
- List files in a directory: `fd . <directory>`
|
|
9
|
+
- Find files with extension and pattern: `fd -e <extension> <pattern>`
|
|
7
10
|
|
|
8
11
|
## Structured Code Search
|
|
9
12
|
- Find code structure: `ast-grep --lang <language> -p '<pattern>'`
|
|
@@ -18,6 +18,10 @@ network_access = true
|
|
|
18
18
|
# Desktop notifications from the TUI: boolean or filtered list. Default: false
|
|
19
19
|
# Examples: true | ["agent-turn-complete", "approval-requested"]
|
|
20
20
|
notifications = false
|
|
21
|
+
# Show raw reasoning content when available (default: false)
|
|
22
|
+
show_raw_agent_reasoning = true
|
|
23
|
+
# Ensure we do not hide internal reasoning (default: false)
|
|
24
|
+
hide_agent_reasoning = false
|
|
21
25
|
|
|
22
26
|
# Centralized feature flags — booleans only
|
|
23
27
|
[features]
|