lunel-cli 0.1.97 → 0.1.99

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/ai/codex.js CHANGED
@@ -7,6 +7,21 @@ import { spawn } from "child_process";
7
7
  import { createInterface } from "readline";
8
8
  const THREAD_LIST_SOURCE_KINDS = ["cli", "vscode", "appServer", "exec", "unknown"];
9
9
  const DEBUG_MODE = process.env.LUNEL_DEBUG === "1" || process.env.LUNEL_DEBUG_AI === "1";
10
+ function joinStreamingText(previousText, nextChunk) {
11
+ if (!previousText) {
12
+ return nextChunk;
13
+ }
14
+ if (/[\s]$/.test(previousText) || /^[\s]/.test(nextChunk)) {
15
+ return `${previousText}${nextChunk}`;
16
+ }
17
+ if (/^[.,!?;:)\]%}"'`]/.test(nextChunk)) {
18
+ return `${previousText}${nextChunk}`;
19
+ }
20
+ if (/[(\[{/"'`]$/.test(previousText)) {
21
+ return `${previousText}${nextChunk}`;
22
+ }
23
+ return `${previousText} ${nextChunk}`;
24
+ }
10
25
  export class CodexProvider {
11
26
  proc = null;
12
27
  shuttingDown = false;
@@ -557,7 +572,10 @@ export class CodexProvider {
557
572
  const nextChunk = this.extractTextPayload(params);
558
573
  if (!nextChunk)
559
574
  return;
560
- const nextText = preferWholeText ? nextChunk : `${this.partTextById.get(partKey) ?? ""}${nextChunk}`;
575
+ const previousText = this.partTextById.get(partKey) ?? "";
576
+ const nextText = preferWholeText
577
+ ? nextChunk
578
+ : joinStreamingText(previousText, nextChunk);
561
579
  this.partTextById.set(partKey, nextText);
562
580
  session.updatedAt = Date.now();
563
581
  this.upsertLocalMessagePart(session, messageId, {
package/dist/index.js CHANGED
@@ -25,7 +25,6 @@ if (DEBUG_MODE) {
25
25
  process.env.LUNEL_DEBUG = "1";
26
26
  process.env.LUNEL_DEBUG_AI = "1";
27
27
  }
28
- const APPLE_REVIEW_CODE = "abcd";
29
28
  import { createRequire } from "module";
30
29
  const __require = createRequire(import.meta.url);
31
30
  const VERSION = __require("../package.json").version;
@@ -249,7 +248,6 @@ function parseExtraPortsFromArgs(args) {
249
248
  return Array.from(parsed).sort((a, b) => a - b);
250
249
  }
251
250
  const EXTRA_PORTS = parseExtraPortsFromArgs(CLI_ARGS);
252
- const USE_APPLE_REVIEW_CODE = hasAnyFlag(CLI_ARGS, "--abcd-code");
253
251
  const FORCE_NEW_CODE = hasAnyFlag(CLI_ARGS, "--new", "-n");
254
252
  const trackedProxyPorts = new Set(EXTRA_PORTS);
255
253
  function samePortSet(a, b) {
@@ -3086,14 +3084,7 @@ async function main() {
3086
3084
  });
3087
3085
  let sessionCodeToUse = null;
3088
3086
  let sessionPasswordToUse;
3089
- if (USE_APPLE_REVIEW_CODE) {
3090
- console.log(`Using fixed review code: ${APPLE_REVIEW_CODE}`);
3091
- const assembled = await assembleWithCode(APPLE_REVIEW_CODE);
3092
- sessionCodeToUse = assembled.code;
3093
- sessionPasswordToUse = assembled.password;
3094
- await saveSessionForRoot(sessionCodeToUse, sessionPasswordToUse);
3095
- }
3096
- else if (!FORCE_NEW_CODE && savedSession) {
3087
+ if (!FORCE_NEW_CODE && savedSession) {
3097
3088
  console.log(`Using saved session for ${ROOT_DIR}`);
3098
3089
  sessionCodeToUse = savedSession.sessionCode;
3099
3090
  sessionPasswordToUse = savedSession.sessionPassword;
@@ -3128,8 +3119,7 @@ async function main() {
3128
3119
  }
3129
3120
  catch (error) {
3130
3121
  const message = error instanceof Error ? error.message : String(error);
3131
- if (!USE_APPLE_REVIEW_CODE &&
3132
- usedSavedSession &&
3122
+ if (usedSavedSession &&
3133
3123
  /invalid|revoked|not found|expired|password invalid|password revoked/i.test(message)) {
3134
3124
  await clearSavedSessionForRoot().catch(() => { });
3135
3125
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lunel-cli",
3
- "version": "0.1.97",
3
+ "version": "0.1.99",
4
4
  "author": [
5
5
  {
6
6
  "name": "Soham Bharambe",