openxiangda 1.0.209 → 1.0.210

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.
@@ -33,9 +33,22 @@ function currentCodexThreadId(env = process.env) {
33
33
  return String(env?.CODEX_THREAD_ID || '').trim();
34
34
  }
35
35
 
36
- function createPublishClientSessionId(env = process.env) {
36
+ function createPublishClientSessionId(env = process.env, options = {}) {
37
37
  const threadId = currentCodexThreadId(env);
38
- return threadId ? `codex:${threadId}` : `cli:${crypto.randomUUID()}`;
38
+ const nonce = String(
39
+ typeof options.randomUUID === 'function'
40
+ ? options.randomUUID()
41
+ : crypto.randomUUID()
42
+ ).trim();
43
+ if (!threadId) return `cli:${nonce}`;
44
+ const candidate = `codex:${threadId}:${nonce}`;
45
+ if (candidate.length <= 128) return candidate;
46
+ const threadDigest = crypto
47
+ .createHash('sha256')
48
+ .update(threadId)
49
+ .digest('hex')
50
+ .slice(0, 24);
51
+ return `codex:${threadDigest}:${nonce}`;
39
52
  }
40
53
 
41
54
  function isPublishLeaseOwnedByCurrentSession(lease, env = process.env) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openxiangda",
3
- "version": "1.0.209",
3
+ "version": "1.0.210",
4
4
  "description": "OpenXiangda CLI, workspace build tools, runtime SDK, and form components.",
5
5
  "private": false,
6
6
  "bin": {