scream-code 0.16.8 → 0.17.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.
@@ -20,8 +20,8 @@
20
20
  }
21
21
  })();
22
22
  </script>
23
- <script type="module" crossorigin src="./assets/index-DMGV8LA-.js"></script>
24
- <link rel="stylesheet" crossorigin href="./assets/index-DdPmkwIL.css">
23
+ <script type="module" crossorigin src="./assets/index-CKa_o5qA.js"></script>
24
+ <link rel="stylesheet" crossorigin href="./assets/index-CVXe8l3P.css">
25
25
  </head>
26
26
  <body>
27
27
  <div id="app"></div>
@@ -20,7 +20,7 @@ const _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
20
20
  const _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/;
21
21
  const _EXTNAME_RE = /.(\.[^./]+|\.)$/;
22
22
  const _PATH_ROOT_RE = /^[/\\]|^[a-zA-Z]:[/\\]/;
23
- const normalize$1 = function(path) {
23
+ const normalize = function(path) {
24
24
  if (path.length === 0) return ".";
25
25
  path = normalizeWindowsPath(path);
26
26
  const isUNCPath = path.match(_UNC_REGEX);
@@ -50,7 +50,7 @@ const join$1 = function(...segments) {
50
50
  else path += pathTrailing || segLeading ? seg : `/${seg}`;
51
51
  } else path += seg;
52
52
  }
53
- return normalize$1(path);
53
+ return normalize(path);
54
54
  };
55
55
  function cwd() {
56
56
  if (typeof process !== "undefined" && typeof process.cwd === "function") return process.cwd().replace(/\\/g, "/");
@@ -1798,6 +1798,32 @@ function findStale(memos, staleDays) {
1798
1798
  const LOCK_FILE = "dream-lock.json";
1799
1799
  const MIN_HOURS_BETWEEN_DREAMS = 24;
1800
1800
  const MIN_SESSIONS_BETWEEN_DREAMS = 5;
1801
+ let atomicWriteSequence = 0;
1802
+ /**
1803
+ * Write `data` to `path` through a temp file + rename, so a crash mid-write
1804
+ * leaves the previous state on disk instead of a truncated file. The temp file
1805
+ * sits next to the target, which keeps the rename inside one filesystem.
1806
+ *
1807
+ * The swap replaces the target inode rather than writing through it: a
1808
+ * rewritten file's permissions follow the process umask, and a symlink at the
1809
+ * target is replaced by a regular file. That is the same trade-off every other
1810
+ * state-file swap in this repository makes.
1811
+ *
1812
+ * Implemented here rather than imported because this package declares `pathe`
1813
+ * as its only dependency: the atomic-write helpers in `@scream-code/jian` and
1814
+ * `@scream-code/agent-core` are not reachable from it, and pulling either
1815
+ * package in for ten lines would widen the dependency graph.
1816
+ */
1817
+ async function writeFileAtomic(path, data) {
1818
+ const tmpPath = `${path}.${process.pid.toString(36)}.${(atomicWriteSequence++).toString(36)}.tmp`;
1819
+ try {
1820
+ await writeFile(tmpPath, data, "utf8");
1821
+ await rename(tmpPath, path);
1822
+ } catch (error) {
1823
+ await unlink(tmpPath).catch(() => {});
1824
+ throw error;
1825
+ }
1826
+ }
1801
1827
  /**
1802
1828
  * Tracks dream consolidation state and decides when to suggest running
1803
1829
  * another dream. Persisted to `<screamHomeDir>/dream-lock.json`.
@@ -1859,7 +1885,7 @@ var DreamTracker = class {
1859
1885
  };
1860
1886
  try {
1861
1887
  await mkdir(dirname$1(this.lockPath), { recursive: true });
1862
- await writeFile(this.lockPath, JSON.stringify(data, null, 2), "utf8");
1888
+ await writeFileAtomic(this.lockPath, JSON.stringify(data, null, 2));
1863
1889
  } catch {}
1864
1890
  }
1865
1891
  /**
@@ -4112,4 +4138,4 @@ async function chunkVectorFallback(store, queryVec, topK) {
4112
4138
  return results;
4113
4139
  }
4114
4140
  //#endregion
4115
- export { classifyEmbeddingFailure as A, rankMemos as B, applyConsolidation as C, parseMemoryMemos as D, buildExitExtractionPrompt as E, createMemoryMemo as F, normalize$1 as G, dirname$1 as H, toSummary as I, resolve$1 as J, parse as K, generateTags as L, createFastEmbedEngine as M, hasEmbeddingModelCache as N, stripMemoryTags as O, probeLocalEmbeddingSupport as P, normalizeTags as R, DreamTracker as S, EXIT_EXTRACTION_SYSTEM_PROMPT as T, isAbsolute$1 as U, basename$1 as V, join$1 as W, splitLargeSection as _, isSupportedFile as a, sharedKnowledgeStoreReady as b, buildExtractionUserPrompt as c, extractQueryEntities as d, parseExtractionResponse as f, estimateTokens as g, chunkText as h, ingestFile as i, clearEmbeddingModelCache as j, MemoryMemoStore as k, extractEventFromChunk as l, chunkMarkdown as m, multiSearchWithTrace as n, ENTITY_TYPES as o, rerankEventsWithLlm as p, relative$1 as q, ingestDirectory as r, EXTRACTION_SYSTEM_PROMPT as s, multiSearch as t, extractJsonFromText as u, stripMarkdown as v, buildConsolidationPlan as w, KnowledgeStore as x, sharedKnowledgeStore as y, buildProjectTagCloud as z };
4141
+ export { classifyEmbeddingFailure as A, rankMemos as B, applyConsolidation as C, parseMemoryMemos as D, buildExitExtractionPrompt as E, createMemoryMemo as F, normalize as G, dirname$1 as H, toSummary as I, resolve$1 as J, parse as K, generateTags as L, createFastEmbedEngine as M, hasEmbeddingModelCache as N, stripMemoryTags as O, probeLocalEmbeddingSupport as P, normalizeTags as R, DreamTracker as S, EXIT_EXTRACTION_SYSTEM_PROMPT as T, isAbsolute$1 as U, basename$1 as V, join$1 as W, splitLargeSection as _, isSupportedFile as a, sharedKnowledgeStoreReady as b, buildExtractionUserPrompt as c, extractQueryEntities as d, parseExtractionResponse as f, estimateTokens as g, chunkText as h, ingestFile as i, clearEmbeddingModelCache as j, MemoryMemoStore as k, extractEventFromChunk as l, chunkMarkdown as m, multiSearchWithTrace as n, ENTITY_TYPES as o, rerankEventsWithLlm as p, relative$1 as q, ingestDirectory as r, EXTRACTION_SYSTEM_PROMPT as s, multiSearch as t, extractJsonFromText as u, stripMarkdown as v, buildConsolidationPlan as w, KnowledgeStore as x, sharedKnowledgeStore as y, buildProjectTagCloud as z };
@@ -3,5 +3,5 @@ import { fileURLToPath as __cjsShimFileURLToPath } from 'node:url';
3
3
  import { dirname as __cjsShimDirname } from 'node:path';
4
4
  const __filename = __cjsShimFileURLToPath(import.meta.url);
5
5
  const __dirname = __cjsShimDirname(__filename);
6
- import { n as multiSearchWithTrace } from "./src-CXmZg1VT.mjs";
6
+ import { n as multiSearchWithTrace } from "./src-BhZujafw.mjs";
7
7
  export { multiSearchWithTrace };
@@ -3,5 +3,5 @@ import { fileURLToPath as __cjsShimFileURLToPath } from 'node:url';
3
3
  import { dirname as __cjsShimDirname } from 'node:path';
4
4
  const __filename = __cjsShimFileURLToPath(import.meta.url);
5
5
  const __dirname = __cjsShimDirname(__filename);
6
- import { t as TextInputDialogComponent } from "./text-input-dialog-6v2667rm.mjs";
6
+ import { t as TextInputDialogComponent } from "./text-input-dialog-XT3cOEjD.mjs";
7
7
  export { TextInputDialogComponent };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scream-code",
3
- "version": "0.16.8",
3
+ "version": "0.17.0",
4
4
  "description": "A terminal-native AI agent for builders",
5
5
  "license": "MIT",
6
6
  "author": "ScreamCli",
@@ -57,13 +57,12 @@
57
57
  "dependencies": {
58
58
  "@fontsource-variable/inter": "^5.3.0",
59
59
  "@fontsource-variable/jetbrains-mono": "^5.3.0",
60
- "@liutod-scream/pi-tui": "^0.87.0",
60
+ "@liutod-scream/pi-tui": "^0.87.1",
61
61
  "@mariozechner/clipboard": "^0.3.2",
62
62
  "chalk": "^5.4.1",
63
63
  "cli-highlight": "^2.1.11",
64
64
  "commander": "^13.1.0",
65
65
  "diff": "^9.0.0",
66
- "fastembed": "^2.1.0",
67
66
  "grok-mermaid": "^0.2.3",
68
67
  "marked": "^15.0.7",
69
68
  "mupdf": "^1.28.0",
@@ -74,11 +73,15 @@
74
73
  "ws": "^8.21.1",
75
74
  "zod": "^4.3.6"
76
75
  },
76
+ "optionalDependencies": {
77
+ "fastembed": "^2.1.0"
78
+ },
77
79
  "devDependencies": {
78
80
  "@modelcontextprotocol/sdk": "^1.29.0",
79
81
  "@scream-code/agent-core": "workspace:^",
80
82
  "@scream-code/config": "workspace:^",
81
83
  "@scream-code/evals": "workspace:^",
84
+ "@scream-code/jian": "workspace:^",
82
85
  "@scream-code/knowledge": "workspace:*",
83
86
  "@scream-code/memory": "workspace:*",
84
87
  "@scream-code/scream-code-sdk": "workspace:^",
@@ -6,8 +6,8 @@ const __dirname = __cjsShimDirname(__filename);
6
6
  import { randomUUID } from "node:crypto";
7
7
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
8
8
  import { join } from "node:path";
9
- import { execFileSync } from "node:child_process";
10
9
  import { arch, hostname, release, type } from "node:os";
10
+ import { execFileSync } from "node:child_process";
11
11
  import chalk from "chalk";
12
12
  import { Container, Input, Key, matchesKey, truncateToWidth, visibleWidth } from "@liutod-scream/pi-tui";
13
13
  //#region ../../packages/config/dist/index.mjs