@hraness/wordcell 0.22.5 → 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 (76) hide show
  1. package/README.md +56 -18
  2. package/dist/authoring.js +2 -2
  3. package/dist/{authority-3ga47syb.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 +3 -1
  16. package/dist/{index-bcknqxrq.js → index-0eacgvpv.js} +9 -1
  17. package/dist/{index-f75zmmdr.js → index-1er88ckw.js} +4 -4
  18. package/dist/{index-8v6k9h4r.js → index-1s8mc4hz.js} +1 -1
  19. package/dist/{index-de2w8crk.js → index-2fmnttca.js} +82 -15
  20. package/dist/{index-aer0jdrq.js → index-ahyhryb8.js} +1 -1
  21. package/dist/{index-f7fnww7a.js → index-b0khj0h5.js} +164 -9
  22. package/dist/{index-qdb8f8va.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-n57tewfr.js → index-fp732bgg.js} +2 -2
  26. package/dist/{index-zy7an84p.js → index-jvb7w0gg.js} +5 -2
  27. package/dist/{index-f984hw45.js → index-k86wepd8.js} +1 -1
  28. package/dist/{index-1r5rnkfr.js → index-mnq2wy34.js} +2 -2
  29. package/dist/{index-p96kb6t2.js → index-nn67kzwa.js} +1 -1
  30. package/dist/{index-fc4dr114.js → index-nwrehke7.js} +1 -1
  31. package/dist/{index-n9kwenpt.js → index-p70t8j13.js} +1 -1
  32. package/dist/{index-pz2b2x0y.js → index-pgtm2nhf.js} +1 -1
  33. package/dist/{index-054mb7d3.js → index-qfqjfxaa.js} +10 -9
  34. package/dist/{index-xzvcw9ga.js → index-r0m5taz2.js} +2 -2
  35. package/dist/{index-h2qn3y3f.js → index-r4qs6vq4.js} +4 -4
  36. package/dist/{index-gtwqye5a.js → index-tcaq1c7f.js} +4 -4
  37. package/dist/{index-42tb8qqp.js → index-tvd2sqrx.js} +7 -7
  38. package/dist/{index-8bgnhjgq.js → index-vtwbapjr.js} +3810 -159
  39. package/dist/{index-g5vsqmdy.js → index-xwxy71ew.js} +190 -4
  40. package/dist/index.js +15 -13
  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-jf9v10j7.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 +11 -4
  53. package/skills/wordcell/AGENTS.md +1 -0
  54. package/skills/wordcell/SKILL.md +5 -3
  55. package/skills/wordcell/references/query.md +35 -1
  56. package/skills/wordcell/references/session-memory.md +207 -0
  57. package/src/authoring-import.ts +32 -0
  58. package/src/authoring-model.ts +185 -2
  59. package/src/authoring-program.ts +19 -7
  60. package/src/cli-help.ts +893 -0
  61. package/src/cli-intro.ts +1 -1
  62. package/src/cli-program.ts +571 -80
  63. package/src/cli-style.ts +132 -0
  64. package/src/clip/acquire.ts +20 -0
  65. package/src/clip/args.ts +3 -0
  66. package/src/clip/cli.ts +82 -5
  67. package/src/clip/cookie-permission.ts +241 -0
  68. package/src/clip/url-metadata-cli.ts +6 -5
  69. package/src/clip/url-metadata.ts +14 -0
  70. package/src/graph.ts +9 -4
  71. package/src/import-supermemory.ts +1629 -0
  72. package/src/mcp-server.ts +415 -0
  73. package/src/mcp-tools.ts +1122 -0
  74. package/src/pdf/cli.ts +5 -4
  75. package/src/support-profile.ts +1 -1
  76. package/src/support.ts +3 -0
@@ -4,12 +4,12 @@ import {
4
4
  MAX_NOTE_BYTES, NoteRevisionConflictError, addRelationToParts, assertCompatibleCreate,
5
5
  assertExpected, canonicalNoteId, canonicalRelationTarget, checkedExpectedRevision,
6
6
  existingDocumentId, frontmatter, isErrno, normalizeRelationPredicate, noteResult, pathFor, relationsFromParts,
7
- removeRelationFromParts, renderCreatedNote, renderFrontmatter, renderUpdatedNoteBody, requireRevision, revisionFor,
8
- sameQuarantinedSnapshot, sameSnapshot, withRecoveryPath,
7
+ removeRelationFromParts, renderCreatedNote, renderFrontmatter, renderUpdatedNoteBodyAndFields, requireRevision, revisionFor,
8
+ sameQuarantinedSnapshot, sameSnapshot, validateFrontmatterFieldUpdates, validateFrontmatterFields, withRecoveryPath,
9
9
  } from "./authoring-model.js";
10
10
  import type {
11
11
  AuthoringDependencies, AuthoringInstallContext, AuthoringOptions, CreateNoteInput,
12
- DirectoryIdentity, NoteAuthoringResult, NoteRevision, NoteSnapshot, RecoveryLocation, UpdateNoteBodyOptions, Vault,
12
+ DirectoryIdentity, FrontmatterFieldUpdates, FrontmatterFields, NoteAuthoringResult, NoteRevision, NoteSnapshot, RecoveryLocation, UpdateNoteBodyOptions, Vault,
13
13
  } from "./authoring-model.js";
14
14
  import type { NoteLock } from "./note-lock.js";
15
15
  import { parseDocumentId } from "./portfolio-identity.js";
@@ -211,12 +211,18 @@ function installNote(
211
211
  });
212
212
  }
213
213
 
214
+ /**
215
+ * `fields` is internal: extra top-level frontmatter keys owned by an importer.
216
+ * The public `createNote` never passes it.
217
+ */
214
218
  export function createNoteProgram(
215
219
  platform: AuthoringPlatform, root: string, input: CreateNoteInput, options: AuthoringOptions,
220
+ fields?: FrontmatterFields,
216
221
  ): Effect.Effect<NoteAuthoringResult, AuthoringFailure> {
217
222
  return Effect.gen(function*() {
218
223
  const vault = yield* authoringNative(() => platform.resolveVault(root));
219
224
  const id = yield* authoringSync(() => canonicalNoteId(input.id));
225
+ const extra = yield* authoringSync(() => validateFrontmatterFields(fields));
220
226
  const requestedDocumentId = yield* authoringSync(() => input.documentId === undefined ? undefined : parseDocumentId(input.documentId));
221
227
  const expected = yield* authoringSync(() => checkedExpectedRevision(options));
222
228
  const dependencies = yield* authoringSync(() => platform.dependenciesFor(options.dependencies));
@@ -227,12 +233,12 @@ export function createNoteProgram(
227
233
  const existing = yield* authoringNative(() => platform.readOptionalSnapshot(vault, id));
228
234
  if (existing !== null) {
229
235
  yield* authoringSync(() => assertExpected(existing, expected));
230
- const compatible = yield* authoringSync(() => assertCompatibleCreate(existing, input, requestedDocumentId));
236
+ const compatible = yield* authoringSync(() => assertCompatibleCreate(existing, input, requestedDocumentId, extra));
231
237
  return yield* authoringSync(() => noteResult(existing, compatible.relations, false, compatible.documentId));
232
238
  }
233
239
  if (expected !== undefined) return yield* fail(new NoteRevisionConflictError(`${id}.md`, expected, null));
234
240
  const documentId = yield* authoringSync(() => requestedDocumentId ?? parseDocumentId(dependencies.documentId()));
235
- const content = yield* authoringSync(() => renderCreatedNote(input, documentId));
241
+ const content = yield* authoringSync(() => renderCreatedNote(input, documentId, extra));
236
242
  const revision = yield* installNote(platform, vault, id, content, null, lock, dependencies);
237
243
  return { changed: true, path: `${id}.md`, revision, relations: [], documentId };
238
244
  }),
@@ -277,12 +283,18 @@ export function editNoteRelationProgram(
277
283
  });
278
284
  }
279
285
 
286
+ /**
287
+ * `fields` is internal: top-level frontmatter keys (and `title`) set in the
288
+ * same atomic write, where `null` deletes a key. The public `updateNoteBody`
289
+ * never passes it, so the authored frontmatter bytes stay untouched there.
290
+ */
280
291
  export function updateNoteBodyProgram(
281
292
  platform: AuthoringPlatform, root: string, idInput: string, body: string,
282
- options: UpdateNoteBodyOptions,
293
+ options: UpdateNoteBodyOptions, fields?: FrontmatterFieldUpdates,
283
294
  ): Effect.Effect<NoteAuthoringResult, AuthoringFailure> {
284
295
  return Effect.gen(function*() {
285
296
  const id = yield* authoringSync(() => canonicalNoteId(idInput));
297
+ const updates = yield* authoringSync(() => validateFrontmatterFieldUpdates(fields));
286
298
  const expected = yield* authoringSync(() => {
287
299
  if (typeof options?.expectedRevision !== "string") {
288
300
  throw new TypeError("expectedRevision is required for a note body update");
@@ -302,7 +314,7 @@ export function updateNoteBodyProgram(
302
314
  if (identity.kind === "invalid") return yield* fail(new TypeError("the note has an invalid document_id"));
303
315
  const documentId = identity.kind === "valid" ? identity.documentId : undefined;
304
316
  const relations = yield* authoringSync(() => relationsFromParts(parts, source.relativePath));
305
- const content = yield* authoringSync(() => renderUpdatedNoteBody(source, parts, body));
317
+ const content = yield* authoringSync(() => renderUpdatedNoteBodyAndFields(source, parts, body, updates));
306
318
  if (content === source.content) return yield* authoringSync(() => noteResult(source, relations, false, documentId));
307
319
  const revision = yield* installNote(platform, vault, id, content, source, lock, dependencies);
308
320
  return yield* authoringSync(() => noteResult({ relativePath: source.relativePath, revision }, relations, true, documentId));