@hraness/wordcell 0.22.4 → 0.23.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.
Files changed (80) hide show
  1. package/README.md +63 -22
  2. package/dist/authoring.js +2 -2
  3. package/dist/{authority-06eqhqam.js → authority-35cbvp1x.js} +2 -2
  4. package/dist/benchmark.js +3 -3
  5. package/dist/capture.js +6 -6
  6. package/dist/cli.js +26 -24
  7. package/dist/clip/acquire.js +3 -3
  8. package/dist/clip/args.js +1 -1
  9. package/dist/clip/cli.js +6 -6
  10. package/dist/clip/doctor.js +4 -4
  11. package/dist/evaluation-builder.js +10 -10
  12. package/dist/evaluation-kb.js +10 -10
  13. package/dist/graph-authority.js +4 -4
  14. package/dist/graph-percolation.js +6 -6
  15. package/dist/graph.js +5 -1
  16. package/dist/{index-bcknqxrq.js → index-0eacgvpv.js} +9 -1
  17. package/dist/{index-xv80vzfp.js → index-1er88ckw.js} +4 -4
  18. package/dist/{index-233z9wmn.js → index-1s8mc4hz.js} +13 -5
  19. package/dist/{index-de2w8crk.js → index-2fmnttca.js} +82 -15
  20. package/dist/{index-vnybgywh.js → index-ahyhryb8.js} +1 -1
  21. package/dist/{index-ecqpgr5y.js → index-b0khj0h5.js} +164 -9
  22. package/dist/{index-jk1sgx36.js → index-bdwcjvr4.js} +1 -1
  23. package/dist/{index-dfag79p7.js → index-byz4kzww.js} +3 -0
  24. package/dist/{index-hgve9rh2.js → index-cd75vky9.js} +96 -1
  25. package/dist/{index-rr9kzq4n.js → index-fp732bgg.js} +2 -2
  26. package/dist/{index-qbssx940.js → index-jvb7w0gg.js} +227 -9
  27. package/dist/{index-f984hw45.js → index-k86wepd8.js} +1 -1
  28. package/dist/{index-1k595z6v.js → index-mnq2wy34.js} +2 -2
  29. package/dist/{index-n386evxj.js → index-nn67kzwa.js} +1 -1
  30. package/dist/{index-fc4dr114.js → index-nwrehke7.js} +1 -1
  31. package/dist/{index-76dbn6pe.js → index-p70t8j13.js} +1 -1
  32. package/dist/{index-tf4wzjew.js → index-pgtm2nhf.js} +1 -1
  33. package/dist/{index-054mb7d3.js → index-qfqjfxaa.js} +10 -9
  34. package/dist/{index-pnt9wr59.js → index-r0m5taz2.js} +2 -2
  35. package/dist/{index-bqtqeak3.js → index-r4qs6vq4.js} +4 -4
  36. package/dist/{index-djrcc1yf.js → index-tcaq1c7f.js} +4 -4
  37. package/dist/{index-q7tbg07z.js → index-tvd2sqrx.js} +7 -7
  38. package/dist/{index-9h7zh0wt.js → index-vtwbapjr.js} +3814 -162
  39. package/dist/{index-g5vsqmdy.js → index-xwxy71ew.js} +190 -4
  40. package/dist/index.js +22 -14
  41. package/dist/pdf.js +3 -3
  42. package/dist/percolate.js +2 -2
  43. package/dist/portfolio.js +10 -10
  44. package/dist/publish.js +3 -3
  45. package/dist/sdk.js +9 -9
  46. package/dist/search.js +2 -2
  47. package/dist/semantic.js +4 -4
  48. package/dist/{support-m3t917ev.js → support-c8hy7qfa.js} +25 -23
  49. package/dist/url-intelligence.js +1 -1
  50. package/dist/workflows/decision-context.js +10 -10
  51. package/dist/workflows/index.js +10 -10
  52. package/package.json +12 -4
  53. package/skills/wordcell/AGENTS.md +1 -0
  54. package/skills/wordcell/SKILL.md +5 -3
  55. package/skills/wordcell/references/plan-structure.md +1 -1
  56. package/skills/wordcell/references/query.md +35 -1
  57. package/skills/wordcell/references/session-memory.md +207 -0
  58. package/skills/wordcell/references/url-platforms.md +1 -1
  59. package/src/authoring-import.ts +32 -0
  60. package/src/authoring-model.ts +185 -2
  61. package/src/authoring-program.ts +19 -7
  62. package/src/cli-help.ts +893 -0
  63. package/src/cli-intro.ts +1 -1
  64. package/src/cli-program.ts +575 -82
  65. package/src/cli-style.ts +132 -0
  66. package/src/clip/acquire.ts +20 -0
  67. package/src/clip/args.ts +3 -0
  68. package/src/clip/cli.ts +82 -5
  69. package/src/clip/cookie-permission.ts +241 -0
  70. package/src/clip/url-metadata-cli.ts +6 -5
  71. package/src/clip/url-metadata.ts +14 -0
  72. package/src/graph.ts +88 -13
  73. package/src/import-supermemory.ts +1629 -0
  74. package/src/mcp-server.ts +415 -0
  75. package/src/mcp-tools.ts +1122 -0
  76. package/src/mention-index.ts +194 -0
  77. package/src/pdf/cli.ts +5 -4
  78. package/src/support-profile.ts +1 -1
  79. package/src/support.ts +3 -0
  80. package/src/vault.ts +26 -2
@@ -113,6 +113,175 @@ function portfolioDocumentIdentity(vault, path, metadata) {
113
113
  });
114
114
  }
115
115
 
116
+ // src/mention-index.ts
117
+ var MENTION_INDEX_LIMITS = {
118
+ maxNodes: 262144,
119
+ maxWork: 64 * 1024 * 1024,
120
+ maxMatches: 1e6,
121
+ maxInputCodeUnits: 256 * 1024 * 1024
122
+ };
123
+
124
+ class MentionIndexBudgetError extends RangeError {
125
+ kind;
126
+ limit;
127
+ constructor(kind, limit) {
128
+ super(`Vault analysis exceeds the ${limit} ${kind} limit.`);
129
+ this.kind = kind;
130
+ this.limit = limit;
131
+ }
132
+ }
133
+ function checkedLimits(options) {
134
+ const limits = { ...MENTION_INDEX_LIMITS };
135
+ for (const name of Object.keys(MENTION_INDEX_LIMITS)) {
136
+ const value = options[name] ?? MENTION_INDEX_LIMITS[name];
137
+ if (!Number.isSafeInteger(value) || value < 0 || value > MENTION_INDEX_LIMITS[name]) {
138
+ throw new RangeError(`${name} must be a safe integer from 0 through ${MENTION_INDEX_LIMITS[name]}.`);
139
+ }
140
+ limits[name] = value;
141
+ }
142
+ return limits;
143
+ }
144
+ function preflightMentionInput(inputs, options) {
145
+ const limits = checkedLimits(options);
146
+ let rawInputCodeUnits = 0, work = 0;
147
+ for (const input of inputs) {
148
+ rawInputCodeUnits += input.length;
149
+ if (rawInputCodeUnits > limits.maxInputCodeUnits)
150
+ throw new MentionIndexBudgetError("mention-input-code-units", limits.maxInputCodeUnits);
151
+ work += input.length + 1;
152
+ if (work > limits.maxWork)
153
+ throw new MentionIndexBudgetError("mention-index-work", limits.maxWork);
154
+ }
155
+ return { rawInputCodeUnits, work };
156
+ }
157
+ function cleanMentionBoundary(text, phrase, offset) {
158
+ const word = (value) => /[A-Za-z0-9]/.test(value);
159
+ return (!word(phrase[0] ?? "") || !word(text[offset - 1] ?? "")) && (!word(phrase.at(-1) ?? "") || !word(text[offset + phrase.length] ?? ""));
160
+ }
161
+
162
+ class MentionMatcher {
163
+ limits;
164
+ nodes = [];
165
+ work = 0;
166
+ matches = 0;
167
+ input = 0;
168
+ constructor(patterns, options = {}, rawInputCodeUnits = 0, preflightWork = 0) {
169
+ this.limits = checkedLimits(options);
170
+ if (!Number.isSafeInteger(preflightWork) || preflightWork < 0)
171
+ throw new RangeError("Invalid mention preflight work.");
172
+ if (preflightWork > this.limits.maxWork)
173
+ this.fail("mention-index-work", this.limits.maxWork);
174
+ this.work = preflightWork;
175
+ if (!Number.isSafeInteger(rawInputCodeUnits) || rawInputCodeUnits < 0)
176
+ throw new RangeError("Invalid mention input length.");
177
+ if (rawInputCodeUnits > this.limits.maxInputCodeUnits)
178
+ this.fail("mention-input-code-units", this.limits.maxInputCodeUnits);
179
+ this.node();
180
+ for (const pattern of patterns) {
181
+ this.inputUnits(pattern.lowerPhrase.length);
182
+ let state = 0;
183
+ for (let index = 0;index < pattern.lowerPhrase.length; index += 1) {
184
+ this.step();
185
+ const character = pattern.lowerPhrase.charCodeAt(index);
186
+ let next = this.nodes[state].next.get(character);
187
+ if (next === undefined) {
188
+ next = this.node();
189
+ this.nodes[state].next.set(character, next);
190
+ }
191
+ state = next;
192
+ }
193
+ if (pattern.lowerPhrase.length === 0 || this.nodes[state].pattern !== undefined) {
194
+ throw new TypeError("Mention index requires nonempty, uniquely owned normalized phrases.");
195
+ }
196
+ this.nodes[state].pattern = pattern;
197
+ }
198
+ const queue = [...this.nodes[0].next.values()];
199
+ for (let cursor = 0;cursor < queue.length; cursor += 1) {
200
+ const state = queue[cursor];
201
+ for (const [character, child] of this.nodes[state].next) {
202
+ this.step();
203
+ let fallback = this.nodes[state].failure;
204
+ while (fallback !== 0 && !this.nodes[fallback].next.has(character)) {
205
+ this.step();
206
+ fallback = this.nodes[fallback].failure;
207
+ }
208
+ const failure = this.nodes[fallback].next.get(character) ?? 0;
209
+ this.nodes[child].failure = failure;
210
+ this.nodes[child].output = this.nodes[failure].pattern === undefined ? this.nodes[failure].output : failure;
211
+ queue.push(child);
212
+ }
213
+ }
214
+ }
215
+ fail(kind, limit) {
216
+ throw new MentionIndexBudgetError(kind, limit);
217
+ }
218
+ step() {
219
+ if (this.work >= this.limits.maxWork)
220
+ this.fail("mention-index-work", this.limits.maxWork);
221
+ this.work += 1;
222
+ }
223
+ node() {
224
+ if (this.nodes.length >= this.limits.maxNodes)
225
+ this.fail("mention-index-nodes", this.limits.maxNodes);
226
+ this.nodes.push({ next: new Map, failure: 0, output: -1, pattern: undefined });
227
+ return this.nodes.length - 1;
228
+ }
229
+ inputUnits(count) {
230
+ this.input += count;
231
+ if (this.input > this.limits.maxInputCodeUnits)
232
+ this.fail("mention-input-code-units", this.limits.maxInputCodeUnits);
233
+ }
234
+ newlineOffsets(originalText) {
235
+ const offsets = [];
236
+ for (let index = 0;index < originalText.length; index += 1) {
237
+ this.step();
238
+ if (originalText.charCodeAt(index) === 10)
239
+ offsets.push(index);
240
+ }
241
+ return offsets;
242
+ }
243
+ lineAt(offsets, offset) {
244
+ let low = 0, high = offsets.length;
245
+ while (low < high) {
246
+ this.step();
247
+ const middle = low + Math.floor((high - low) / 2);
248
+ if (offsets[middle] < offset)
249
+ low = middle + 1;
250
+ else
251
+ high = middle;
252
+ }
253
+ return low + 1;
254
+ }
255
+ scan(lowerText) {
256
+ this.inputUnits(lowerText.length);
257
+ const result = new Map;
258
+ let state = 0;
259
+ for (let index = 0;index < lowerText.length; index += 1) {
260
+ this.step();
261
+ const character = lowerText.charCodeAt(index);
262
+ while (state !== 0 && !this.nodes[state].next.has(character)) {
263
+ this.step();
264
+ state = this.nodes[state].failure;
265
+ }
266
+ state = this.nodes[state].next.get(character) ?? 0;
267
+ let output = this.nodes[state].pattern === undefined ? this.nodes[state].output : state;
268
+ while (output !== -1) {
269
+ if (this.matches >= this.limits.maxMatches)
270
+ this.fail("mention-matches", this.limits.maxMatches);
271
+ this.matches += 1;
272
+ const pattern = this.nodes[output].pattern;
273
+ const offset = index + 1 - pattern.lowerPhrase.length;
274
+ const existing = result.get(pattern.targetId);
275
+ if (cleanMentionBoundary(lowerText, pattern.lowerPhrase, offset) && (existing === undefined || pattern.rank < existing.pattern.rank)) {
276
+ result.set(pattern.targetId, { pattern, offset });
277
+ }
278
+ output = this.nodes[output].output;
279
+ }
280
+ }
281
+ return result;
282
+ }
283
+ }
284
+
116
285
  // src/graph.ts
117
286
  var catalogStart = "<!-- kb:catalog:start -->";
118
287
  var catalogEnd = "<!-- kb:catalog:end -->";
@@ -134,12 +303,15 @@ class VaultAnalysisBudgetError extends RangeError {
134
303
  function isMetadataObject(value) {
135
304
  return value !== null && typeof value === "object" && !Array.isArray(value);
136
305
  }
306
+ function isMetadataNumber(value) {
307
+ return Number.isFinite(value) && (!Number.isInteger(value) || Number.isSafeInteger(value));
308
+ }
137
309
  function parsedMetadataValue(value, ancestors) {
138
310
  if (value === null || typeof value === "string" || typeof value === "boolean") {
139
311
  return { ok: true, value };
140
312
  }
141
313
  if (typeof value === "number") {
142
- return Number.isFinite(value) && (!Number.isInteger(value) || Number.isSafeInteger(value)) ? { ok: true, value } : { ok: false };
314
+ return isMetadataNumber(value) ? { ok: true, value } : { ok: false };
143
315
  }
144
316
  if (typeof value !== "object" || ancestors.has(value))
145
317
  return { ok: false };
@@ -722,16 +894,10 @@ function compareRelationIssues(left, right) {
722
894
  const targetComparison = (left.target ?? "").localeCompare(right.target ?? "");
723
895
  return left.source.localeCompare(right.source) || left.line - right.line || left.kind.localeCompare(right.kind) || predicateComparison || targetComparison;
724
896
  }
725
- var wordCharacter = (value) => /[A-Za-z0-9]/.test(value);
726
897
  function phraseOffset(lowerHaystack, lowerPhrase) {
727
898
  let offset = lowerHaystack.indexOf(lowerPhrase);
728
899
  while (offset !== -1) {
729
- const before = offset === 0 ? "" : lowerHaystack[offset - 1] ?? "";
730
- const afterIndex = offset + lowerPhrase.length;
731
- const after = afterIndex >= lowerHaystack.length ? "" : lowerHaystack[afterIndex] ?? "";
732
- const startsClean = !wordCharacter(lowerPhrase[0] ?? "") || !wordCharacter(before);
733
- const endsClean = !wordCharacter(lowerPhrase.at(-1) ?? "") || !wordCharacter(after);
734
- if (startsClean && endsClean)
900
+ if (cleanMentionBoundary(lowerHaystack, lowerPhrase, offset))
735
901
  return offset;
736
902
  offset = lowerHaystack.indexOf(lowerPhrase, offset + 1);
737
903
  }
@@ -777,6 +943,19 @@ function checkedAnalysisLimit(value, hardMaximum, option) {
777
943
  return limit;
778
944
  }
779
945
  function analyzeVault(notes, options = {}) {
946
+ return analyzeVaultInternal(notes, options);
947
+ }
948
+ function analyzeVaultComplete(notes, options = {}) {
949
+ try {
950
+ return analyzeVaultInternal(notes, options, options.mentionIndexLimits ?? {});
951
+ } catch (error) {
952
+ if (error instanceof MentionIndexBudgetError) {
953
+ throw new VaultAnalysisBudgetError(error.kind, error.limit, error.message);
954
+ }
955
+ throw error;
956
+ }
957
+ }
958
+ function analyzeVaultInternal(notes, options, mentionIndexLimits) {
780
959
  const maxNotes = checkedAnalysisLimit(options.maxNotes, MAX_ANALYZED_NOTES, "maxNotes");
781
960
  const maxMentionPairs = checkedAnalysisLimit(options.maxMentionPairs, MAX_MENTION_PAIRS, "maxMentionPairs");
782
961
  const maxMentions = checkedAnalysisLimit(options.maxMentions, MAX_MENTIONS, "maxMentions");
@@ -784,6 +963,13 @@ function analyzeVault(notes, options = {}) {
784
963
  if (notes.length > maxNotes) {
785
964
  throw new VaultAnalysisBudgetError("notes", maxNotes, `Vault analysis exceeds the ${maxNotes} note limit.`);
786
965
  }
966
+ const mentionInput = mentionIndexLimits === undefined ? undefined : preflightMentionInput(function* () {
967
+ for (const note of notes) {
968
+ yield note.searchableText;
969
+ yield note.title;
970
+ yield* note.aliases;
971
+ }
972
+ }(), mentionIndexLimits);
787
973
  const catalogNoteId = withoutMarkdownExtension(normalizeVaultPath(options.catalogNoteId ?? "index"));
788
974
  const byId = new Map(notes.map((note) => [note.id, note]));
789
975
  const byBasename = new Map;
@@ -953,7 +1139,39 @@ function analyzeVault(notes, options = {}) {
953
1139
  const phrasesByTarget = scopedMentionNotes.length === 0 ? new Map : uniquePhrasesByTarget(suggestionNotes);
954
1140
  const mentions = [];
955
1141
  let mentionPairs = 0;
1142
+ const matcher = mentionIndexLimits === undefined ? undefined : new MentionMatcher([...phrasesByTarget].flatMap(([targetId, phrases]) => phrases.map((phrase, rank) => ({ ...phrase, targetId, rank }))), mentionIndexLimits, mentionInput.rawInputCodeUnits, mentionInput.work);
1143
+ const targetsById = new Map;
1144
+ if (matcher !== undefined)
1145
+ suggestionNotes.forEach((note, order) => {
1146
+ const targets = targetsById.get(note.id) ?? [];
1147
+ targets.push({ note, order });
1148
+ targetsById.set(note.id, targets);
1149
+ });
956
1150
  for (const source of suggestionNotes) {
1151
+ if (matcher !== undefined) {
1152
+ if (scopedMentionNotes.length === 0)
1153
+ continue;
1154
+ const found = matcher.scan(source.searchableText.toLocaleLowerCase("en-US"));
1155
+ const targets2 = [...found].flatMap(([id, match]) => (targetsById.get(id) ?? []).map((target) => ({ ...target, match }))).filter(({ note }) => source.id !== note.id && (options.mentionScope === undefined || scopedMentionIds.has(source.id) || scopedMentionIds.has(note.id))).sort((left, right) => left.order - right.order);
1156
+ let newlineOffsets;
1157
+ for (const { note: target, match } of targets2) {
1158
+ if (mentionPairs >= maxMentionPairs)
1159
+ throw new VaultAnalysisBudgetError("mention-pairs", maxMentionPairs, `Vault analysis exceeds the ${maxMentionPairs} mention-pair limit.`);
1160
+ mentionPairs += 1;
1161
+ if (linkedPairs.has(pairKey(source.id, target.id)))
1162
+ continue;
1163
+ if (mentions.length >= maxMentions)
1164
+ throw new VaultAnalysisBudgetError("mentions", maxMentions, `Vault analysis exceeds the ${maxMentions} mention limit.`);
1165
+ newlineOffsets ??= matcher.newlineOffsets(source.searchableText);
1166
+ mentions.push({
1167
+ source: source.path,
1168
+ target: target.path,
1169
+ phrase: match.pattern.phrase,
1170
+ line: matcher.lineAt(newlineOffsets, match.offset)
1171
+ });
1172
+ }
1173
+ continue;
1174
+ }
957
1175
  const targets = options.mentionScope === undefined || scopedMentionIds.has(source.id) ? suggestionNotes : scopedMentionNotes;
958
1176
  let lowerSearchableText;
959
1177
  for (const target of targets) {
@@ -1066,4 +1284,4 @@ function replaceCatalog(indexContent, catalog) {
1066
1284
  return indexContent.slice(0, start) + catalog + indexContent.slice(end + catalogEnd.length);
1067
1285
  }
1068
1286
 
1069
- export { MAX_PORTFOLIO_NAME_BYTES, MAX_DOCUMENT_ID_BYTES, portfolioVaultIdentity, parseVaultKey, parseDocumentId, documentIdState, formatQualifiedDocumentUri, parseQualifiedDocumentUri, portfolioDocumentIdentity, catalogStart, catalogEnd, MAX_ANALYZED_NOTES, MAX_CONNECTION_OBSERVATIONS, MAX_MENTION_PAIRS, MAX_MENTIONS, VaultAnalysisBudgetError, metadataValueFromUnknown, isCanonicalRelationPredicate, isCanonicalNoteId, normalizeVaultPath, searchableMarkdown, wikiLinks, parseNote, lookupNote, analyzeVault, renderCatalog, replaceCatalog };
1287
+ export { MAX_PORTFOLIO_NAME_BYTES, MAX_DOCUMENT_ID_BYTES, portfolioVaultIdentity, parseVaultKey, parseDocumentId, documentIdState, formatQualifiedDocumentUri, parseQualifiedDocumentUri, portfolioDocumentIdentity, catalogStart, catalogEnd, MAX_ANALYZED_NOTES, MAX_CONNECTION_OBSERVATIONS, MAX_MENTION_PAIRS, MAX_MENTIONS, VaultAnalysisBudgetError, isMetadataNumber, metadataValueFromUnknown, isCanonicalRelationPredicate, isCanonicalNoteId, normalizeVaultPath, searchableMarkdown, wikiLinks, parseNote, lookupNote, analyzeVault, analyzeVaultComplete, renderCatalog, replaceCatalog };
@@ -6,7 +6,7 @@ import {
6
6
  resolveRemote,
7
7
  rewriteContentWithStatus,
8
8
  scanImageSources
9
- } from "./index-hgve9rh2.js";
9
+ } from "./index-cd75vky9.js";
10
10
  import {
11
11
  FetchFailure,
12
12
  safeFetch
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  MAX_SEARCH_RESULTS,
4
4
  openKnowledgeBase
5
- } from "./index-q7tbg07z.js";
5
+ } from "./index-tvd2sqrx.js";
6
6
  import {
7
7
  MAX_EVALUATION_EVIDENCE_BYTES,
8
8
  redactEvaluationMachinePaths
@@ -12,7 +12,7 @@ import {
12
12
  } from "./index-1gwbassd.js";
13
13
  import {
14
14
  scanVault
15
- } from "./index-233z9wmn.js";
15
+ } from "./index-1s8mc4hz.js";
16
16
  import {
17
17
  MAX_REPOSITORY_MEMORY_DETAIL_LIMIT,
18
18
  MAX_REPOSITORY_MEMORY_GROUP_LIMIT,
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  fuseRankedCandidates
4
- } from "./index-vnybgywh.js";
4
+ } from "./index-ahyhryb8.js";
5
5
 
6
6
  // src/benchmark.ts
7
7
  var MAX_BENCHMARK_CASES = 500;
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  isolatedAgentBrowserEnvironment
4
- } from "./index-g5vsqmdy.js";
4
+ } from "./index-xwxy71ew.js";
5
5
  import {
6
6
  BoundedByteBuffer
7
7
  } from "./index-gh719d91.js";
@@ -4,7 +4,7 @@ import {
4
4
  } from "./index-h170byqw.js";
5
5
  import {
6
6
  packUntrustedSearchContext
7
- } from "./index-q7tbg07z.js";
7
+ } from "./index-tvd2sqrx.js";
8
8
 
9
9
  // src/workflows/decision-context.ts
10
10
  var decisionContextWorkflow = defineWorkflow({
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  isCanonicalNoteId,
7
7
  isCanonicalRelationPredicate
8
- } from "./index-qbssx940.js";
8
+ } from "./index-jvb7w0gg.js";
9
9
 
10
10
  // src/graph-authority-model.ts
11
11
  var GRAPH_LIMITS = Object.freeze({
@@ -2,11 +2,15 @@
2
2
  import {
3
3
  countWords,
4
4
  sniffImage
5
- } from "./index-f984hw45.js";
5
+ } from "./index-k86wepd8.js";
6
6
  import {
7
+ renderFailure,
8
+ sentence,
7
9
  slugify,
10
+ stderrStyle,
11
+ terminalOutput,
8
12
  yamlString
9
- } from "./index-hgve9rh2.js";
13
+ } from "./index-cd75vky9.js";
10
14
  import {
11
15
  safeFetch
12
16
  } from "./index-e5fbsywq.js";
@@ -1858,10 +1862,10 @@ async function preparePdfSource(input, options = {}, dependencies = {}) {
1858
1862
  }
1859
1863
 
1860
1864
  // src/pdf/cli.ts
1861
- var defaultOutput = {
1865
+ var defaultOutput = terminalOutput({
1862
1866
  stdout: (value) => process.stdout.write(value),
1863
1867
  stderr: (value) => process.stderr.write(value)
1864
- };
1868
+ });
1865
1869
  function safe(value) {
1866
1870
  return sanitizeTerminalLine(redactSensitiveText(value));
1867
1871
  }
@@ -1905,9 +1909,7 @@ function pdfCaptureSummary(outcome) {
1905
1909
  async function main(rawArguments = process.argv.slice(2), environment = process.env, output = defaultOutput, dependencies = {}) {
1906
1910
  const parsed = parsePdfArguments(rawArguments, environment);
1907
1911
  if (!parsed.ok) {
1908
- output.stderr(`error: ${safe(parsed.message)}
1909
-
1910
- ${sanitizeTerminalText(pdfUsage)}`);
1912
+ output.stderr(renderFailure(sentence(safe(parsed.message)), "wordcell pdf --help", stderrStyle(environment, output)));
1911
1913
  return 2;
1912
1914
  }
1913
1915
  const arguments_ = parsed.value;
@@ -1961,8 +1963,7 @@ ${sanitizeTerminalText(pdfUsage)}`);
1961
1963
  if (arguments_.json)
1962
1964
  output.stdout(terminalSafeJson({ ok: false, error: message }));
1963
1965
  else
1964
- output.stderr(`error: ${message}
1965
- `);
1966
+ output.stderr(renderFailure(message, "wordcell doctor", stderrStyle(environment, output)));
1966
1967
  return 1;
1967
1968
  } finally {
1968
1969
  preparedSource?.dispose();
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  scanVault
4
- } from "./index-233z9wmn.js";
4
+ } from "./index-1s8mc4hz.js";
5
5
  import {
6
6
  navigateLinks
7
7
  } from "./index-d13v9ckt.js";
@@ -39,7 +39,7 @@ import {
39
39
  import {
40
40
  lookupNote,
41
41
  normalizeVaultPath
42
- } from "./index-qbssx940.js";
42
+ } from "./index-jvb7w0gg.js";
43
43
 
44
44
  // src/publish.ts
45
45
  import { createHash } from "crypto";
@@ -5,7 +5,7 @@ import {
5
5
  MAX_SEARCH_RESULTS,
6
6
  openKnowledgeBase,
7
7
  validateKnowledgeBaseSearchHistory
8
- } from "./index-q7tbg07z.js";
8
+ } from "./index-tvd2sqrx.js";
9
9
  import {
10
10
  expandSearchRequest,
11
11
  parseSearchRules
@@ -15,10 +15,10 @@ import {
15
15
  } from "./index-1gwbassd.js";
16
16
  import {
17
17
  validateSearchQuery
18
- } from "./index-vnybgywh.js";
18
+ } from "./index-ahyhryb8.js";
19
19
  import {
20
20
  scanVault
21
- } from "./index-233z9wmn.js";
21
+ } from "./index-1s8mc4hz.js";
22
22
  import {
23
23
  validateQueryOptions
24
24
  } from "./index-48pz4jpc.js";
@@ -32,7 +32,7 @@ import {
32
32
  parseVaultKey,
33
33
  portfolioDocumentIdentity,
34
34
  portfolioVaultIdentity
35
- } from "./index-qbssx940.js";
35
+ } from "./index-jvb7w0gg.js";
36
36
 
37
37
  // src/portfolio.ts
38
38
  import { createHash as createHash2 } from "crypto";
@@ -1,20 +1,20 @@
1
1
  // @bun
2
2
  import {
3
3
  percolateVault
4
- } from "./index-jk1sgx36.js";
4
+ } from "./index-bdwcjvr4.js";
5
5
  import {
6
6
  createGraphSnapshot,
7
7
  openGraphAuthority
8
- } from "./index-xv80vzfp.js";
8
+ } from "./index-1er88ckw.js";
9
9
  import {
10
10
  GraphAuthorityError,
11
11
  validateGraphPercolationOptions
12
- } from "./index-tf4wzjew.js";
12
+ } from "./index-pgtm2nhf.js";
13
13
  import {
14
14
  analyzeVault,
15
15
  lookupNote,
16
16
  parseNote
17
- } from "./index-qbssx940.js";
17
+ } from "./index-jvb7w0gg.js";
18
18
 
19
19
  // src/graph-percolation.ts
20
20
  async function percolateWithGraph(snapshot, options) {
@@ -7,7 +7,7 @@ import {
7
7
  import {
8
8
  openSemanticSearchSession,
9
9
  recommendedEmbeddingModel
10
- } from "./index-rr9kzq4n.js";
10
+ } from "./index-fp732bgg.js";
11
11
  import {
12
12
  UntrustedContentBudgetError,
13
13
  createUntrustedToolResult
@@ -19,14 +19,14 @@ import {
19
19
  } from "./index-j70m75wd.js";
20
20
  import {
21
21
  percolateWithGraph
22
- } from "./index-djrcc1yf.js";
22
+ } from "./index-tcaq1c7f.js";
23
23
  import {
24
24
  openGraphAuthority
25
- } from "./index-xv80vzfp.js";
25
+ } from "./index-1er88ckw.js";
26
26
  import {
27
27
  validateGraphPercolationOptions,
28
28
  validateGraphQueryRequest
29
- } from "./index-tf4wzjew.js";
29
+ } from "./index-pgtm2nhf.js";
30
30
  import {
31
31
  GitHistoryError,
32
32
  gitHistoryForNotes,
@@ -41,10 +41,10 @@ import {
41
41
  fuseRankedCandidates,
42
42
  searchExactVault,
43
43
  validateSearchQuery
44
- } from "./index-vnybgywh.js";
44
+ } from "./index-ahyhryb8.js";
45
45
  import {
46
46
  scanVault
47
- } from "./index-233z9wmn.js";
47
+ } from "./index-1s8mc4hz.js";
48
48
  import {
49
49
  NavigationBudgetError,
50
50
  navigateLinks
@@ -54,7 +54,7 @@ import {
54
54
  } from "./index-48pz4jpc.js";
55
55
  import {
56
56
  lookupNote
57
- } from "./index-qbssx940.js";
57
+ } from "./index-jvb7w0gg.js";
58
58
 
59
59
  // src/sdk.ts
60
60
  import { resolve } from "path";