From 2b601d6b9a23ee274b56743e81cb6b60e7d046c2 Mon Sep 17 00:00:00 2001 From: Adam Spiers Date: Wed, 28 Jan 2026 11:02:22 +1300 Subject: [PATCH 1/2] chore(sdk-core): enhance RichText changeset --- .changeset/add-richtext-utility.md | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.changeset/add-richtext-utility.md b/.changeset/add-richtext-utility.md index 3628600d..26990b71 100644 --- a/.changeset/add-richtext-utility.md +++ b/.changeset/add-richtext-utility.md @@ -4,9 +4,24 @@ Add RichText utility functions for auto-detecting facets from text +**0.x Versioning Note:** This is a non-breaking addition. No existing APIs are modified or removed. + New utility functions to simplify creating rich text facets: - `createFacetsFromText(text, agent?)` - async function that auto-detects URLs, hashtags, and @mentions. If an agent is - provided, resolves mentions to DIDs. -- `createFacetsFromTextSync(text)` - sync function for fast detection without mention resolution + provided, resolves mentions to DIDs; otherwise mentions use the handle string as the DID. +- `createFacetsFromTextSync(text)` - sync function for fast detection without mention resolution (mentions use handle as + DID) - Re-exports `RichText` class from `@atproto/api` for advanced use cases + +**Usage:** + +```typescript +import { createFacetsFromText, createFacetsFromTextSync } from "@hypercerts-org/sdk-core"; + +// Sync (no DID resolution) +const facets = createFacetsFromTextSync("Check out #hypercerts by @alice"); + +// Async with DID resolution (requires authenticated agent) +const facets = await createFacetsFromText("Check out #hypercerts by @alice", agent); +``` From a2b707475e86e3c445d5db2cfe02d2930c978365 Mon Sep 17 00:00:00 2001 From: Adam Spiers Date: Wed, 18 Feb 2026 19:25:40 +0000 Subject: [PATCH 2/2] fix(docs): rename duplicate const facets variables in changeset example CodeRabbit flagged that both const declarations in the same block scope caused a TS/ES6 redeclaration error. Rename to facetsSync/facetsAsync. --- .changeset/add-richtext-utility.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.changeset/add-richtext-utility.md b/.changeset/add-richtext-utility.md index 26990b71..7fd01575 100644 --- a/.changeset/add-richtext-utility.md +++ b/.changeset/add-richtext-utility.md @@ -20,8 +20,8 @@ New utility functions to simplify creating rich text facets: import { createFacetsFromText, createFacetsFromTextSync } from "@hypercerts-org/sdk-core"; // Sync (no DID resolution) -const facets = createFacetsFromTextSync("Check out #hypercerts by @alice"); +const facetsSync = createFacetsFromTextSync("Check out #hypercerts by @alice"); // Async with DID resolution (requires authenticated agent) -const facets = await createFacetsFromText("Check out #hypercerts by @alice", agent); +const facetsAsync = await createFacetsFromText("Check out #hypercerts by @alice", agent); ```