seekstone 0.15.2 → 0.16.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.
package/README.md CHANGED
@@ -147,6 +147,7 @@ Every write tool (`append_note`, `patch_note`, `patch_frontmatter`, `replace_in_
147
147
  | `SEEKSTONE_LOG_LEVEL` | no | `error` \| `warn` \| `info` (default) \| `debug`. |
148
148
  | `SEEKSTONE_LOG_FILE` | no | Absolute path; when set, JSON-line logs are appended here (size-rotated). |
149
149
  | `SEEKSTONE_WATCH_POLL` | no | Set to `1` to stat-poll for changes instead of native OS events — reliable on network drives, WSL, containers. |
150
+ | `SEEKSTONE_WATCH_POLL_INTERVAL` | no | Stat-poll interval in ms (default `10000`). Only used with `SEEKSTONE_WATCH_POLL=1`. Lower = faster pickup of external edits, higher CPU. |
150
151
  | `SEEKSTONE_LOG_MAX_SIZE` | no | Log-rotation threshold for `SEEKSTONE_LOG_FILE` (e.g. `10mb`; default 5 MB). |
151
152
  | `SEEKSTONE_READ_ONLY` | no | Set to `1` to run read-only: the 9 write tools are unregistered entirely (and rejected if called anyway), so the session provably cannot modify your vault. |
152
153
  | `SEEKSTONE_WRITE_PATHS` | no | Comma-separated vault-relative globs (e.g. `journal/**,inbox/*.md`). Writes are permitted only under matching paths; the rest of the vault stays read-only. |
package/dist/index.js CHANGED
@@ -173,6 +173,7 @@ Optional environment:
173
173
  SEEKSTONE_LOG_LEVEL error | warn | info (default) | debug
174
174
  SEEKSTONE_LOG_FILE Absolute path; append JSON-line logs here
175
175
  SEEKSTONE_WATCH_POLL Set to 1 to poll for changes (network drives, WSL)
176
+ SEEKSTONE_WATCH_POLL_INTERVAL Poll interval in ms (default 10000)
176
177
  SEEKSTONE_SEMANTIC Set to 1 to enable semantic search (needs fetch-model first)
177
178
  SEEKSTONE_MODEL_PATH Override the embedding-model directory
178
179
  SEEKSTONE_CACHE_DIR Override the cache root (default ~/.cache/seekstone)
@@ -4190,8 +4191,27 @@ import { realpathSync } from "fs";
4190
4191
  import { readFile as readFile16 } from "fs/promises";
4191
4192
  import { join as join10, relative as relative2, sep as sep3 } from "path";
4192
4193
  import chokidar from "chokidar";
4194
+ var DEFAULT_POLL_INTERVAL_MS = 1e4;
4195
+ function resolvePollInterval(optValue, envValue, log2) {
4196
+ if (optValue !== void 0) return optValue;
4197
+ if (envValue === void 0 || envValue === "") return DEFAULT_POLL_INTERVAL_MS;
4198
+ const parsed = Number(envValue);
4199
+ if (!Number.isInteger(parsed) || parsed <= 0) {
4200
+ log2?.warn("invalid SEEKSTONE_WATCH_POLL_INTERVAL, using default", {
4201
+ value: envValue,
4202
+ defaultMs: DEFAULT_POLL_INTERVAL_MS
4203
+ });
4204
+ return DEFAULT_POLL_INTERVAL_MS;
4205
+ }
4206
+ return parsed;
4207
+ }
4193
4208
  function startWatcher(ctx2, log2, opts) {
4194
4209
  const usePolling = opts?.usePolling ?? process.env.SEEKSTONE_WATCH_POLL === "1";
4210
+ const pollInterval = resolvePollInterval(
4211
+ opts?.pollInterval,
4212
+ process.env.SEEKSTONE_WATCH_POLL_INTERVAL,
4213
+ log2
4214
+ );
4195
4215
  let vaultRoot2 = ctx2.vaultRoot;
4196
4216
  try {
4197
4217
  vaultRoot2 = realpathSync(ctx2.vaultRoot);
@@ -4227,8 +4247,8 @@ function startWatcher(ctx2, log2, opts) {
4227
4247
  // The startup index build already covers existing files.
4228
4248
  ignoreInitial: true,
4229
4249
  usePolling,
4230
- interval: 50,
4231
- binaryInterval: 100,
4250
+ interval: pollInterval,
4251
+ binaryInterval: pollInterval * 2,
4232
4252
  // Skip dot-dirs (.obsidian, .git, .trash, …) regardless of where the vault
4233
4253
  // lives — matched on the path relative to the vault root.
4234
4254
  ignored: (p) => {
@@ -4254,7 +4274,7 @@ function startWatcher(ctx2, log2, opts) {
4254
4274
  }
4255
4275
 
4256
4276
  // src/index.ts
4257
- var VERSION = true ? "0.15.2" : "0.0.0-dev";
4277
+ var VERSION = true ? "0.16.0" : "0.0.0-dev";
4258
4278
  var intent = parseCliIntent(process.argv.slice(2));
4259
4279
  if (intent === "version") {
4260
4280
  process.stdout.write(`${VERSION}