@ory/codex 1.5.0 → 1.5.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.
- package/dist/session-state.d.ts +8 -0
- package/dist/session-state.js +25 -4
- package/package.json +2 -2
package/dist/session-state.d.ts
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
1
|
export declare function hasCodexSessionStarted(sessionId: string): boolean;
|
|
2
2
|
export declare function markCodexSessionStarted(sessionId: string): void;
|
|
3
|
+
/**
|
|
4
|
+
* Forget recorded session starts so the next prompt re-runs session start.
|
|
5
|
+
*
|
|
6
|
+
* Running Codex sessions may write markers concurrently, so a recursive
|
|
7
|
+
* delete in place can fail with ENOTEMPTY. Detach the directory with an
|
|
8
|
+
* atomic rename first, then delete the detached copy. Clearing is advisory:
|
|
9
|
+
* a failure leaves stale markers and never aborts the caller.
|
|
10
|
+
*/
|
|
3
11
|
export declare function clearCodexSessionStarts(): void;
|
package/dist/session-state.js
CHANGED
|
@@ -53,9 +53,30 @@ function markCodexSessionStarted(sessionId) {
|
|
|
53
53
|
fs.mkdirSync(path.dirname(marker), { recursive: true });
|
|
54
54
|
fs.writeFileSync(marker, "", { flag: "a" });
|
|
55
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* Forget recorded session starts so the next prompt re-runs session start.
|
|
58
|
+
*
|
|
59
|
+
* Running Codex sessions may write markers concurrently, so a recursive
|
|
60
|
+
* delete in place can fail with ENOTEMPTY. Detach the directory with an
|
|
61
|
+
* atomic rename first, then delete the detached copy. Clearing is advisory:
|
|
62
|
+
* a failure leaves stale markers and never aborts the caller.
|
|
63
|
+
*/
|
|
56
64
|
function clearCodexSessionStarts() {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
65
|
+
const dir = path.join((0, argus_1.getHarnessDataDir)("codex"), SESSION_START_DIR);
|
|
66
|
+
let target = dir;
|
|
67
|
+
try {
|
|
68
|
+
target = `${dir}.${process.pid}.${Date.now()}.stale`;
|
|
69
|
+
fs.renameSync(dir, target);
|
|
70
|
+
}
|
|
71
|
+
catch (err) {
|
|
72
|
+
if (err.code === "ENOENT")
|
|
73
|
+
return;
|
|
74
|
+
target = dir;
|
|
75
|
+
}
|
|
76
|
+
try {
|
|
77
|
+
fs.rmSync(target, { recursive: true, force: true, maxRetries: 3 });
|
|
78
|
+
}
|
|
79
|
+
catch (err) {
|
|
80
|
+
process.stderr.write(`ory-codex: could not clear session-start markers at ${target}: ${err instanceof Error ? err.message : String(err)}\n`);
|
|
81
|
+
}
|
|
61
82
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ory/codex",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.2",
|
|
4
4
|
"description": "Ory plugin for Codex: scaffolding skills, a local Ory instance, and authentication, authorization, and audit for every tool call",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://ory.com",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
],
|
|
70
70
|
"dependencies": {
|
|
71
71
|
"reova": "^0.7.0",
|
|
72
|
-
"@ory/argus": "1.5.
|
|
72
|
+
"@ory/argus": "1.5.2"
|
|
73
73
|
},
|
|
74
74
|
"engines": {
|
|
75
75
|
"node": ">=22"
|