@seed-hypermedia/client 0.0.113 → 0.0.115

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 (43) hide show
  1. package/dist/auto-link.mjs +3 -3
  2. package/dist/blocks-to-markdown.mjs +3 -2
  3. package/dist/capability.mjs +2 -2
  4. package/dist/{chunk-UHAYFVBP.mjs → chunk-3LMBGHBE.mjs} +75 -5
  5. package/dist/{chunk-3P4J4WDY.mjs → chunk-54K7Z3BG.mjs} +1 -1
  6. package/dist/{chunk-KMACFX6U.mjs → chunk-BGWUWAFJ.mjs} +1 -1
  7. package/dist/{chunk-URLWDK7P.mjs → chunk-BZOAANTM.mjs} +1 -1
  8. package/dist/{chunk-2PRZIGCZ.mjs → chunk-DQMPCZVZ.mjs} +14 -5
  9. package/dist/chunk-HSDV6WEU.mjs +10 -0
  10. package/dist/{chunk-5VBVPSXD.mjs → chunk-HZQXXBOH.mjs} +2 -2
  11. package/dist/chunk-JELXCUZJ.mjs +49 -0
  12. package/dist/{chunk-3TERIXHU.mjs → chunk-LWCFLZRZ.mjs} +7 -30
  13. package/dist/{chunk-OXZCRYUS.mjs → chunk-MJFOPYAB.mjs} +1 -1
  14. package/dist/{chunk-YF2CLLSQ.mjs → chunk-MTJRBDF2.mjs} +3 -3
  15. package/dist/{chunk-AUKAVTTK.mjs → chunk-MZMGRUTQ.mjs} +1 -1
  16. package/dist/{chunk-YC433TGZ.mjs → chunk-QIKOXXTT.mjs} +1 -1
  17. package/dist/{chunk-GLY3UZ3W.mjs → chunk-UQWQXOBZ.mjs} +1 -1
  18. package/dist/{chunk-LQTTR4ZP.mjs → chunk-V2XTXDGG.mjs} +1 -1
  19. package/dist/{chunk-NLH5MKTK.mjs → chunk-ZVPHEP3X.mjs} +1 -1
  20. package/dist/client.mjs +2 -2
  21. package/dist/comment.mjs +2 -2
  22. package/dist/document-state.mjs +2 -2
  23. package/dist/editorblock-to-hmblock.mjs +2 -2
  24. package/dist/hm-resolver.d.ts +13 -0
  25. package/dist/hm-resolver.mjs +6 -2
  26. package/dist/hm-types.d.ts +5 -452
  27. package/dist/hm-types.mjs +1 -3
  28. package/dist/hmblock-to-editorblock.mjs +2 -2
  29. package/dist/index.d.ts +1 -1
  30. package/dist/index.mjs +20 -16
  31. package/dist/pdf-to-blocks.mjs +3 -3
  32. package/dist/resource-read.mjs +4 -4
  33. package/dist/schema-engine.mjs +2 -2
  34. package/dist/schema-registry.generated.mjs +1 -1
  35. package/dist/schema-resolve.mjs +4 -4
  36. package/dist/schema-subtypes.mjs +4 -4
  37. package/dist/schema-types.generated.d.ts +14 -5
  38. package/dist/signed-blob.mjs +2 -2
  39. package/dist/tei-to-blocks.mjs +2 -2
  40. package/dist/unicode.mjs +1 -1
  41. package/package.json +1 -1
  42. package/dist/chunk-ALW35WVX.mjs +0 -75
  43. package/dist/chunk-MLR4UDOJ.mjs +0 -10
package/dist/hm-types.mjs CHANGED
@@ -68,7 +68,6 @@ import {
68
68
  HMDraftContentSchema,
69
69
  HMDraftMetaSchema,
70
70
  HMEmbedViewSchema,
71
- HMExternalCommentGroupSchema,
72
71
  HMGenerationInfoSchema,
73
72
  HMGetCIDInputSchema,
74
73
  HMGetCIDOutputSchema,
@@ -216,7 +215,7 @@ import {
216
215
  toNumber,
217
216
  unpackHmId,
218
217
  unpackedHmIdSchema
219
- } from "./chunk-3TERIXHU.mjs";
218
+ } from "./chunk-LWCFLZRZ.mjs";
220
219
  import "./chunk-AHQWDCHV.mjs";
221
220
  import "./chunk-7P6ASYW6.mjs";
222
221
  export {
@@ -289,7 +288,6 @@ export {
289
288
  HMDraftContentSchema,
290
289
  HMDraftMetaSchema,
291
290
  HMEmbedViewSchema,
292
- HMExternalCommentGroupSchema,
293
291
  HMGenerationInfoSchema,
294
292
  HMGetCIDInputSchema,
295
293
  HMGetCIDOutputSchema,
@@ -2,8 +2,8 @@ import {
2
2
  annotationContains,
3
3
  hmBlockToEditorBlock,
4
4
  hmBlocksToEditorContent
5
- } from "./chunk-URLWDK7P.mjs";
6
- import "./chunk-3TERIXHU.mjs";
5
+ } from "./chunk-BZOAANTM.mjs";
6
+ import "./chunk-LWCFLZRZ.mjs";
7
7
  import "./chunk-AHQWDCHV.mjs";
8
8
  import "./chunk-7P6ASYW6.mjs";
9
9
  export {
package/dist/index.d.ts CHANGED
@@ -25,7 +25,7 @@ export { codePointLength, entityQueryPathToHmIdPath, getHMQueryString, hmIdPathT
25
25
  export type { HMRequest, HMSigner, UnpackedHypermediaId } from './hm-types';
26
26
  export { toHMSigner, toPrincipalSigner } from './signer';
27
27
  export type { AnySigner, PrincipalSigner } from './signer';
28
- export { resolveHypermediaUrl, resolveId } from './hm-resolver';
28
+ export { resolveHypermediaUrl, resolveId, hmDomainUrlToWebUrl, extractCommentIdFromUrl } from './hm-resolver';
29
29
  export type { DomainResolverFn, DomainIdChangedCallback, ResolveOptions, ResolvedUrl } from './hm-resolver';
30
30
  export { resolveIdWithClient } from './resource-read';
31
31
  export type { ResolveIdWithClientOptions, ResolvedIdWithClient } from './resource-read';
package/dist/index.mjs CHANGED
@@ -1,20 +1,20 @@
1
1
  import {
2
2
  pdfToBlocks
3
- } from "./chunk-GLY3UZ3W.mjs";
3
+ } from "./chunk-UQWQXOBZ.mjs";
4
4
  import {
5
5
  teiToBlocks
6
- } from "./chunk-YC433TGZ.mjs";
6
+ } from "./chunk-QIKOXXTT.mjs";
7
7
  import {
8
8
  embeddedPdfToBlocks
9
9
  } from "./chunk-2FJBS3V7.mjs";
10
10
  import {
11
11
  resolveIdWithClient
12
- } from "./chunk-ALW35WVX.mjs";
12
+ } from "./chunk-JELXCUZJ.mjs";
13
13
  import {
14
14
  annotationContains,
15
15
  hmBlockToEditorBlock,
16
16
  hmBlocksToEditorContent
17
- } from "./chunk-URLWDK7P.mjs";
17
+ } from "./chunk-BZOAANTM.mjs";
18
18
  import {
19
19
  keyfile_exports
20
20
  } from "./chunk-EY6RQVAP.mjs";
@@ -36,7 +36,7 @@ import {
36
36
  import {
37
37
  editorBlockToHMBlock,
38
38
  editorBlocksToHMBlockNodes
39
- } from "./chunk-3P4J4WDY.mjs";
39
+ } from "./chunk-54K7Z3BG.mjs";
40
40
  import {
41
41
  encryption_exports
42
42
  } from "./chunk-UOL3F6XQ.mjs";
@@ -53,13 +53,9 @@ import {
53
53
  isGrobidAvailable,
54
54
  processFulltextDocument
55
55
  } from "./chunk-PPAY4WZX.mjs";
56
- import {
57
- resolveHypermediaUrl,
58
- resolveId
59
- } from "./chunk-UHAYFVBP.mjs";
60
56
  import {
61
57
  createSeedClient
62
- } from "./chunk-OXZCRYUS.mjs";
58
+ } from "./chunk-MJFOPYAB.mjs";
63
59
  import {
64
60
  SeedClientError,
65
61
  SeedNetworkError,
@@ -71,7 +67,7 @@ import {
71
67
  deleteComment,
72
68
  trimTrailingEmptyBlocks,
73
69
  updateComment
74
- } from "./chunk-NLH5MKTK.mjs";
70
+ } from "./chunk-ZVPHEP3X.mjs";
75
71
  import {
76
72
  AnnotationSet,
77
73
  addSpanToAnnotation,
@@ -92,7 +88,7 @@ import {
92
88
  documentContainsLinkToChild,
93
89
  documentHasSelfQuery,
94
90
  shouldAutoLinkParent
95
- } from "./chunk-5VBVPSXD.mjs";
91
+ } from "./chunk-HZQXXBOH.mjs";
96
92
  import {
97
93
  createChange,
98
94
  createChangeOps,
@@ -114,7 +110,7 @@ import {
114
110
  followToDocument,
115
111
  resolveDocumentState,
116
112
  resolveEditableDocument
117
- } from "./chunk-KMACFX6U.mjs";
113
+ } from "./chunk-BGWUWAFJ.mjs";
118
114
  import "./chunk-2MD3FXKB.mjs";
119
115
  import {
120
116
  computeReplaceOps,
@@ -133,11 +129,17 @@ import {
133
129
  emitFrontmatter,
134
130
  parseDraftFilename,
135
131
  slugify
136
- } from "./chunk-2PRZIGCZ.mjs";
132
+ } from "./chunk-DQMPCZVZ.mjs";
133
+ import {
134
+ extractCommentIdFromUrl,
135
+ hmDomainUrlToWebUrl,
136
+ resolveHypermediaUrl,
137
+ resolveId
138
+ } from "./chunk-3LMBGHBE.mjs";
137
139
  import {
138
140
  createCapability,
139
141
  resolveCapability
140
- } from "./chunk-LQTTR4ZP.mjs";
142
+ } from "./chunk-V2XTXDGG.mjs";
141
143
  import "./chunk-LVAHHQIK.mjs";
142
144
  import "./chunk-NBCHK76Q.mjs";
143
145
  import {
@@ -157,7 +159,7 @@ import {
157
159
  parseFragment,
158
160
  serializeBlockRange,
159
161
  unpackHmId
160
- } from "./chunk-3TERIXHU.mjs";
162
+ } from "./chunk-LWCFLZRZ.mjs";
161
163
  import "./chunk-AHQWDCHV.mjs";
162
164
  import "./chunk-3TPCJCVO.mjs";
163
165
  import "./chunk-7P6ASYW6.mjs";
@@ -211,6 +213,7 @@ export {
211
213
  embeddedPdfToBlocks,
212
214
  emitFrontmatter,
213
215
  entityQueryPathToHmIdPath,
216
+ extractCommentIdFromUrl,
214
217
  fileToIpfsBlobs,
215
218
  filesToIpfsBlobs,
216
219
  flattenToOperations,
@@ -222,6 +225,7 @@ export {
222
225
  hmBlockNodeToBlockNode,
223
226
  hmBlockToEditorBlock,
224
227
  hmBlocksToEditorContent,
228
+ hmDomainUrlToWebUrl,
225
229
  hmIdPathToEntityQueryPath,
226
230
  isGrobidAvailable,
227
231
  isSurrogate,
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  pdfToBlocks
3
- } from "./chunk-GLY3UZ3W.mjs";
4
- import "./chunk-YC433TGZ.mjs";
3
+ } from "./chunk-UQWQXOBZ.mjs";
4
+ import "./chunk-QIKOXXTT.mjs";
5
5
  import "./chunk-2FJBS3V7.mjs";
6
6
  import "./chunk-PPAY4WZX.mjs";
7
- import "./chunk-3TERIXHU.mjs";
7
+ import "./chunk-LWCFLZRZ.mjs";
8
8
  import "./chunk-AHQWDCHV.mjs";
9
9
  import "./chunk-7P6ASYW6.mjs";
10
10
  export {
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  resolveIdWithClient
3
- } from "./chunk-ALW35WVX.mjs";
4
- import "./chunk-UHAYFVBP.mjs";
5
- import "./chunk-OXZCRYUS.mjs";
3
+ } from "./chunk-JELXCUZJ.mjs";
4
+ import "./chunk-MJFOPYAB.mjs";
6
5
  import "./chunk-CBELM7KX.mjs";
7
6
  import "./chunk-O5MHN2EO.mjs";
8
7
  import "./chunk-PJ2RFT5A.mjs";
8
+ import "./chunk-3LMBGHBE.mjs";
9
9
  import "./chunk-LVAHHQIK.mjs";
10
10
  import "./chunk-DR3HJ6BV.mjs";
11
- import "./chunk-3TERIXHU.mjs";
11
+ import "./chunk-LWCFLZRZ.mjs";
12
12
  import "./chunk-AHQWDCHV.mjs";
13
13
  import "./chunk-7P6ASYW6.mjs";
14
14
  export {
@@ -35,11 +35,11 @@ import {
35
35
  typeOf,
36
36
  validate,
37
37
  validateAdvisory
38
- } from "./chunk-AUKAVTTK.mjs";
38
+ } from "./chunk-MZMGRUTQ.mjs";
39
39
  import {
40
40
  HM_SCHEMAS,
41
41
  HM_SCHEMA_MANIFEST
42
- } from "./chunk-MLR4UDOJ.mjs";
42
+ } from "./chunk-HSDV6WEU.mjs";
43
43
  import "./chunk-7P6ASYW6.mjs";
44
44
  export {
45
45
  HM_SCHEMAS,
@@ -2,7 +2,7 @@ import {
2
2
  HM_SCHEMAS,
3
3
  HM_SCHEMA_MANIFEST,
4
4
  HM_SCHEMA_PAGES
5
- } from "./chunk-MLR4UDOJ.mjs";
5
+ } from "./chunk-HSDV6WEU.mjs";
6
6
  import "./chunk-7P6ASYW6.mjs";
7
7
  export {
8
8
  HM_SCHEMAS,
@@ -17,11 +17,11 @@ import {
17
17
  resolveSchemaRef,
18
18
  schemaDefinitionCid,
19
19
  withoutSchemaLink
20
- } from "./chunk-YF2CLLSQ.mjs";
21
- import "./chunk-AUKAVTTK.mjs";
22
- import "./chunk-MLR4UDOJ.mjs";
20
+ } from "./chunk-MTJRBDF2.mjs";
21
+ import "./chunk-MZMGRUTQ.mjs";
22
+ import "./chunk-HSDV6WEU.mjs";
23
23
  import "./chunk-VWSAFDOL.mjs";
24
- import "./chunk-3TERIXHU.mjs";
24
+ import "./chunk-LWCFLZRZ.mjs";
25
25
  import "./chunk-AHQWDCHV.mjs";
26
26
  import "./chunk-7P6ASYW6.mjs";
27
27
  export {
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  classifyRef
3
- } from "./chunk-YF2CLLSQ.mjs";
3
+ } from "./chunk-MTJRBDF2.mjs";
4
4
  import {
5
5
  kindOf,
6
6
  nameForCid,
7
7
  nameToUrl,
8
8
  schemaCid
9
- } from "./chunk-AUKAVTTK.mjs";
9
+ } from "./chunk-MZMGRUTQ.mjs";
10
10
  import {
11
11
  HM_SCHEMAS
12
- } from "./chunk-MLR4UDOJ.mjs";
12
+ } from "./chunk-HSDV6WEU.mjs";
13
13
  import "./chunk-VWSAFDOL.mjs";
14
14
  import {
15
15
  unpackHmId
16
- } from "./chunk-3TERIXHU.mjs";
16
+ } from "./chunk-LWCFLZRZ.mjs";
17
17
  import "./chunk-AHQWDCHV.mjs";
18
18
  import "./chunk-7P6ASYW6.mjs";
19
19
 
@@ -15,6 +15,19 @@ export type HMBytes = Uint8Array | {
15
15
  * Schema: hm://hyper.media/account
16
16
  */
17
17
  export type HMAccount = string;
18
+ /**
19
+ * Seed Agents
20
+ * Seed Agents is the hosted agent runtime that lets an account run language-model agents which read and write Hypermedia through the Seed API with their own signing keys.
21
+ * Resource attributes for an agent mounted at a Hypermedia document. The server must also register the agent at this exact document ID.
22
+ * Schema: hm://hyper.media/agent
23
+ */
24
+ export type HMAgent = {
25
+ type: 'hm://hyper.media/agent';
26
+ /** HTTP(S) agent server registering this resource's exact versionless HMID as the agent ID. */
27
+ agentServerUrl: HMUrl;
28
+ } & {
29
+ [key: string]: HMValue;
30
+ };
18
31
  /**
19
32
  * Blob
20
33
  * The signed envelope every Hypermedia blob extends, with a type tag, the signer's public key, an Ed25519 signature over the canonical CBOR with the signature zeroed, and a millisecond timestamp.
@@ -1182,12 +1195,8 @@ export type HMMetadata = {
1182
1195
  cover?: HMIpfsUrl;
1183
1196
  /** The web address a space is published at; set on the home document when a site is registered. */
1184
1197
  siteUrl?: HMUrl;
1185
- /** The agents server this space advertises to its readers (an http(s) origin); clients connect to it beside their own servers. */
1198
+ /** The agents server that hosts the agent this document mounts (an http(s) origin); set with `type: hm://hyper.media/agent`. */
1186
1199
  agentServerUrl?: HMUrl;
1187
- /** Agents this space publishes to its readers: `{[agentId]: order}`, each id an agent on `agentServerUrl`; a removed agent leaves a null behind. */
1188
- spaceAgents?: {
1189
- [key: string]: HMValue;
1190
- };
1191
1200
  /** The attributes schema THIS document conforms to: the hm:// URL of a schema document (or ipfs://<cid> of a schema blob) whose struct describes the document's attributes. */
1192
1201
  attributesSchema?: HMHmUrl;
1193
1202
  /** The attributes schema this document's direct CHILDREN conform to (hm:// URL or ipfs://<cid>). A child may declare its own `attributesSchema` instead. */
@@ -5,8 +5,8 @@ import {
5
5
  literalValue,
6
6
  resolveSchema,
7
7
  structFields
8
- } from "./chunk-AUKAVTTK.mjs";
9
- import "./chunk-MLR4UDOJ.mjs";
8
+ } from "./chunk-MZMGRUTQ.mjs";
9
+ import "./chunk-HSDV6WEU.mjs";
10
10
  import {
11
11
  dagJsonToIpld,
12
12
  findSeedIndexerCollision
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  teiToBlocks
3
- } from "./chunk-YC433TGZ.mjs";
4
- import "./chunk-3TERIXHU.mjs";
3
+ } from "./chunk-QIKOXXTT.mjs";
4
+ import "./chunk-LWCFLZRZ.mjs";
5
5
  import "./chunk-AHQWDCHV.mjs";
6
6
  import "./chunk-7P6ASYW6.mjs";
7
7
  export {
package/dist/unicode.mjs CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  import {
8
8
  codePointLength,
9
9
  isSurrogate
10
- } from "./chunk-3TERIXHU.mjs";
10
+ } from "./chunk-LWCFLZRZ.mjs";
11
11
  import "./chunk-AHQWDCHV.mjs";
12
12
  import "./chunk-7P6ASYW6.mjs";
13
13
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seed-hypermedia/client",
3
- "version": "0.0.113",
3
+ "version": "0.0.115",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/seed-hypermedia/seed",
@@ -1,75 +0,0 @@
1
- import {
2
- resolveId
3
- } from "./chunk-UHAYFVBP.mjs";
4
- import {
5
- createSeedClient
6
- } from "./chunk-OXZCRYUS.mjs";
7
- import {
8
- unpackHmId
9
- } from "./chunk-3TERIXHU.mjs";
10
-
11
- // src/resource-read.ts
12
- async function resolveIdWithClient(rawId, options = {}) {
13
- const commentId = extractCommentIdFromReadableUrl(rawId);
14
- const parsed = commentId ? commentIdToHmId(commentId) : unpackHmId(rawId);
15
- if (parsed) {
16
- if (isWebUrl(rawId)) {
17
- const origin2 = new URL(rawId).origin;
18
- return { id: parsed, client: createSeedClient(origin2), serverUrl: origin2 };
19
- }
20
- const client = options.client ?? createSeedClient(normalizeServerUrl(options.serverUrl || "https://hyper.media"));
21
- return { id: parsed, client, serverUrl: client.baseUrl };
22
- }
23
- const id = await resolveId(rawId, { domainResolver: options.domainResolver });
24
- const origin = new URL(rawId).origin;
25
- return { id, client: createSeedClient(origin), serverUrl: origin };
26
- }
27
- var COMMENT_VIEW_TERMS = /* @__PURE__ */ new Set([":comments", ":comment", ":discussions"]);
28
- function extractCommentIdFromReadableUrl(rawId) {
29
- if (isWebUrl(rawId)) {
30
- const url = new URL(rawId);
31
- const panelCommentId = extractCommentIdFromPanel(url.searchParams.get("panel"));
32
- if (panelCommentId) return panelCommentId;
33
- return extractCommentIdFromPath(url.pathname.split("/").filter(Boolean));
34
- }
35
- const [withoutHash] = rawId.split("#");
36
- const [withoutQuery] = withoutHash.split("?");
37
- const parsed = unpackHmId(withoutQuery);
38
- return (parsed == null ? void 0 : parsed.path) ? extractCommentIdFromPath(parsed.path) : null;
39
- }
40
- function extractCommentIdFromPanel(panel) {
41
- if (!panel) return null;
42
- const [viewTerm, first, second] = panel.split("/");
43
- if (viewTerm !== "comments" && viewTerm !== "comment" && viewTerm !== "discussions") return null;
44
- if (first && second) return `${first}/${second}`;
45
- return first || null;
46
- }
47
- function extractCommentIdFromPath(pathParts) {
48
- if (pathParts.length >= 3) {
49
- const thirdToLast = pathParts[pathParts.length - 3];
50
- if (thirdToLast && COMMENT_VIEW_TERMS.has(thirdToLast)) {
51
- return `${pathParts[pathParts.length - 2]}/${pathParts[pathParts.length - 1]}`;
52
- }
53
- }
54
- if (pathParts.length >= 2) {
55
- const secondToLast = pathParts[pathParts.length - 2];
56
- if (secondToLast && COMMENT_VIEW_TERMS.has(secondToLast)) return pathParts[pathParts.length - 1] || null;
57
- }
58
- return null;
59
- }
60
- function commentIdToHmId(commentId) {
61
- const parsed = unpackHmId(`hm://${commentId}`);
62
- if (!parsed) throw new Error(`Invalid comment ID: ${commentId}`);
63
- return parsed;
64
- }
65
- function isWebUrl(rawId) {
66
- return rawId.startsWith("http://") || rawId.startsWith("https://");
67
- }
68
- function normalizeServerUrl(serverUrl) {
69
- const withScheme = serverUrl.startsWith("http://") || serverUrl.startsWith("https://") ? serverUrl : `https://${serverUrl}`;
70
- return withScheme.replace(/\/+$/, "");
71
- }
72
-
73
- export {
74
- resolveIdWithClient
75
- };