@seed-hypermedia/client 0.0.117 → 0.0.119

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 (51) hide show
  1. package/dist/apps.d.ts +65 -0
  2. package/dist/apps.mjs +171 -0
  3. package/dist/auth.mjs +3 -3
  4. package/dist/auto-link.mjs +3 -3
  5. package/dist/blobs.mjs +2 -2
  6. package/dist/blocks-to-markdown.mjs +3 -3
  7. package/dist/capability.mjs +4 -4
  8. package/dist/{chunk-25Q3F35L.mjs → chunk-37I7X7G7.mjs} +1 -1
  9. package/dist/{chunk-HSDV6WEU.mjs → chunk-6RZWE7TK.mjs} +2 -2
  10. package/dist/{chunk-53V3XTMB.mjs → chunk-BFXGJBSN.mjs} +3 -3
  11. package/dist/{chunk-SJLLXOSE.mjs → chunk-F37OTY5W.mjs} +1 -1
  12. package/dist/{chunk-2JSUDZLE.mjs → chunk-G6DV3BU4.mjs} +1 -1
  13. package/dist/{chunk-DOQ6BCKU.mjs → chunk-IC3KRDNX.mjs} +2 -2
  14. package/dist/{chunk-LOAGYTC2.mjs → chunk-J2QF2I3H.mjs} +1 -1
  15. package/dist/{chunk-ASEEN3OZ.mjs → chunk-JLSJJMOD.mjs} +2 -2
  16. package/dist/{chunk-EKRKNALC.mjs → chunk-JMP3HYRE.mjs} +3 -3
  17. package/dist/{chunk-EBP7SWTZ.mjs → chunk-KTOBQK6C.mjs} +23 -2
  18. package/dist/{chunk-YVM3WBZH.mjs → chunk-MY2L74E7.mjs} +2 -2
  19. package/dist/{chunk-5LHO2KV6.mjs → chunk-P5EQ4NJ7.mjs} +1 -1
  20. package/dist/{chunk-7IKOUDLO.mjs → chunk-PON3NHRS.mjs} +1 -1
  21. package/dist/{chunk-PJI7DMX3.mjs → chunk-PTCL6IO7.mjs} +1 -1
  22. package/dist/{chunk-M2LRSKSU.mjs → chunk-PUKRJHZR.mjs} +1 -1
  23. package/dist/{chunk-X6SZZ5HV.mjs → chunk-RJ77FJD2.mjs} +1 -1
  24. package/dist/{chunk-MZMGRUTQ.mjs → chunk-TSK67IPM.mjs} +1 -1
  25. package/dist/{chunk-4UVOQIGJ.mjs → chunk-XJ4BKTVL.mjs} +1 -1
  26. package/dist/client.mjs +2 -2
  27. package/dist/comment.mjs +2 -2
  28. package/dist/document-state.d.ts +4 -4
  29. package/dist/document-state.mjs +2 -2
  30. package/dist/editorblock-to-hmblock.mjs +2 -2
  31. package/dist/hm-resolver.mjs +2 -2
  32. package/dist/hm-types.d.ts +396 -0
  33. package/dist/hm-types.mjs +1 -1
  34. package/dist/hmauth.mjs +3 -3
  35. package/dist/hmblock-to-editorblock.mjs +2 -2
  36. package/dist/index.mjs +15 -15
  37. package/dist/pdf-to-blocks.mjs +3 -3
  38. package/dist/resource-read.mjs +4 -4
  39. package/dist/schema-engine.mjs +2 -2
  40. package/dist/schema-registry.generated.mjs +1 -1
  41. package/dist/schema-resolve.mjs +4 -4
  42. package/dist/schema-subtypes.mjs +4 -4
  43. package/dist/schema-types.generated.d.ts +6 -0
  44. package/dist/signed-blob.mjs +2 -2
  45. package/dist/tei-to-blocks.mjs +2 -2
  46. package/dist/unicode.mjs +1 -1
  47. package/dist/vault-local.mjs +3 -3
  48. package/dist/vault-merge.mjs +3 -3
  49. package/dist/vault.mjs +3 -3
  50. package/package.json +1 -1
  51. package/dist/{chunk-NBCHK76Q.mjs → chunk-GBSWXJGU.mjs} +3 -3
@@ -10,17 +10,17 @@ import {
10
10
  schemaForCid,
11
11
  structFields,
12
12
  validate
13
- } from "./chunk-MZMGRUTQ.mjs";
13
+ } from "./chunk-TSK67IPM.mjs";
14
14
  import {
15
15
  HM_SCHEMAS
16
- } from "./chunk-HSDV6WEU.mjs";
16
+ } from "./chunk-6RZWE7TK.mjs";
17
17
  import {
18
18
  parseCidString
19
19
  } from "./chunk-VWSAFDOL.mjs";
20
20
  import {
21
21
  packHmId,
22
22
  unpackHmId
23
- } from "./chunk-EBP7SWTZ.mjs";
23
+ } from "./chunk-KTOBQK6C.mjs";
24
24
 
25
25
  // src/schema-resolve.ts
26
26
  var DAG_CBOR_CODE = 113;
@@ -7,7 +7,7 @@ import {
7
7
  codePointLength,
8
8
  parseHMQueryFiltersJSON,
9
9
  toNumber
10
- } from "./chunk-EBP7SWTZ.mjs";
10
+ } from "./chunk-KTOBQK6C.mjs";
11
11
 
12
12
  // src/editorblock-to-hmblock.ts
13
13
  function toHMBlockType(editorBlockType) {
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  principalFromEd25519,
6
6
  principalToString
7
- } from "./chunk-NBCHK76Q.mjs";
7
+ } from "./chunk-GBSWXJGU.mjs";
8
8
 
9
9
  // src/vault.ts
10
10
  import * as dagCBOR from "@ipld/dag-cbor";
@@ -7,12 +7,12 @@ import {
7
7
  } from "./chunk-PJ2RFT5A.mjs";
8
8
  import {
9
9
  resolveDocumentState
10
- } from "./chunk-25Q3F35L.mjs";
10
+ } from "./chunk-37I7X7G7.mjs";
11
11
  import {
12
12
  entityQueryPathToHmIdPath,
13
13
  packHmId,
14
14
  unpackHmId
15
- } from "./chunk-EBP7SWTZ.mjs";
15
+ } from "./chunk-KTOBQK6C.mjs";
16
16
 
17
17
  // src/auto-link.ts
18
18
  import { CID } from "multiformats/cid";
@@ -9,7 +9,7 @@ import {
9
9
  import {
10
10
  hmIdPathToEntityQueryPath,
11
11
  packHmId
12
- } from "./chunk-EBP7SWTZ.mjs";
12
+ } from "./chunk-KTOBQK6C.mjs";
13
13
 
14
14
  // src/comment.ts
15
15
  import { decode as cborDecode, encode as cborEncode } from "@ipld/dag-cbor";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  resolveId
3
- } from "./chunk-5LHO2KV6.mjs";
3
+ } from "./chunk-P5EQ4NJ7.mjs";
4
4
  import {
5
5
  normalizeQuerySort,
6
6
  unpackHmId
7
- } from "./chunk-EBP7SWTZ.mjs";
7
+ } from "./chunk-KTOBQK6C.mjs";
8
8
 
9
9
  // src/blocks-to-markdown.ts
10
10
  import { stringify as stringifyYaml } from "yaml";
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  createSeedClient
3
- } from "./chunk-M2LRSKSU.mjs";
3
+ } from "./chunk-PUKRJHZR.mjs";
4
4
  import {
5
5
  extractCommentIdFromUrl,
6
6
  hmDomainUrlToWebUrl,
7
7
  resolveId
8
- } from "./chunk-5LHO2KV6.mjs";
8
+ } from "./chunk-P5EQ4NJ7.mjs";
9
9
  import {
10
10
  unpackHmId
11
- } from "./chunk-EBP7SWTZ.mjs";
11
+ } from "./chunk-KTOBQK6C.mjs";
12
12
 
13
13
  // src/resource-read.ts
14
14
  async function resolveIdWithClient(rawId, options = {}) {
@@ -294,12 +294,21 @@ var HMDocumentMetadataSchema = z.object({
294
294
  * found by querying its documents for this type; nothing else registers an agent with a space.
295
295
  */
296
296
  agentServerUrl: z.string().optional(),
297
- /** Resource type; custom HTML pages use hm://hyper.media/page. */
297
+ /**
298
+ * Resource type: hm://hyper.media/page (custom HTML page), hm://hyper.media/app (an app, whose
299
+ * card embeds list its tools and pages) or hm://hyper.media/tool (an app's tool).
300
+ */
298
301
  type: z.string().optional(),
299
302
  /** UnixFS folder whose index.html runs as an isolated custom HTML page. */
300
303
  html: z.string().optional(),
301
- /** Published HM struct schema describing the page's URL input. */
304
+ /** Published HM struct schema describing a page's URL input or a tool's input. */
302
305
  inputSchema: z.string().optional(),
306
+ /** Published HM struct schema describing what a tool returns. */
307
+ outputSchema: z.string().optional(),
308
+ /** UnixFS folder whose index.ts default-exports a tool's async function. */
309
+ code: z.string().optional(),
310
+ /** hm:// URL of the app's own page that its Home tab shows. */
311
+ homePage: z.string().optional(),
303
312
  layout: z.union([z.literal("Seed/Experimental/Newspaper"), z.literal("")]).optional(),
304
313
  displayPublishTime: z.string().optional(),
305
314
  displayAuthor: z.string().optional(),
@@ -307,6 +316,9 @@ var HMDocumentMetadataSchema = z.object({
307
316
  seedExperimentalHomeOrder: z.union([z.literal("UpdatedFirst"), z.literal("CreatedFirst")]).optional(),
308
317
  showOutline: z.boolean().optional(),
309
318
  showActivity: z.boolean().optional(),
319
+ showConversations: z.boolean().optional(),
320
+ showDocumentBrowser: z.boolean().optional(),
321
+ showCollectionControls: z.boolean().optional(),
310
322
  contentWidth: z.union([z.literal("S"), z.literal("M"), z.literal("L")]).optional(),
311
323
  childrenType: HMBlockChildrenTypeSchema.optional(),
312
324
  theme: z.object({
@@ -336,6 +348,12 @@ var DOCUMENT_ATTRIBUTE_DESCRIPTIONS = {
336
348
  cover: "Wide cover image shown in headers and cards.",
337
349
  siteUrl: "Published website URL for a space.",
338
350
  agentServerUrl: "Agents server that hosts the agent this document mounts.",
351
+ type: "Resource type, such as a custom HTML page, an app or a tool.",
352
+ html: "UnixFS folder holding a custom HTML page.",
353
+ inputSchema: "Schema of the input a page or tool takes.",
354
+ outputSchema: "Schema of what a tool returns.",
355
+ code: "UnixFS folder holding a tool\u2019s code, entry point index.ts.",
356
+ homePage: "The app page its Home tab shows.",
339
357
  layout: "Legacy space header layout setting.",
340
358
  displayPublishTime: "Publication date shown to readers.",
341
359
  displayAuthor: "Author byline shown to readers.",
@@ -343,6 +361,9 @@ var DOCUMENT_ATTRIBUTE_DESCRIPTIONS = {
343
361
  seedExperimentalHomeOrder: "Legacy ordering preference for a space home page.",
344
362
  showOutline: "Whether to show the document outline.",
345
363
  showActivity: "Whether to show document activity and tools.",
364
+ showConversations: "Whether readers may start and join conversations on the space\u2019s documents.",
365
+ showDocumentBrowser: "Whether the sidebar with the space\u2019s document browser starts open when readers arrive.",
366
+ showCollectionControls: "Whether collections offer readers search, filter, sort and view controls.",
346
367
  contentWidth: "Width of the document content area.",
347
368
  childrenType: "Layout of the document\u2019s root-level blocks.",
348
369
  theme: "Visual settings for a space.",
@@ -3,11 +3,11 @@ import {
3
3
  } from "./chunk-LVAHHQIK.mjs";
4
4
  import {
5
5
  createCapability
6
- } from "./chunk-NBCHK76Q.mjs";
6
+ } from "./chunk-GBSWXJGU.mjs";
7
7
  import {
8
8
  entityQueryPathToHmIdPath,
9
9
  packBaseId
10
- } from "./chunk-EBP7SWTZ.mjs";
10
+ } from "./chunk-KTOBQK6C.mjs";
11
11
 
12
12
  // src/capability.ts
13
13
  import { base58btc } from "multiformats/bases/base58";
@@ -2,7 +2,7 @@ import {
2
2
  entityQueryPathToHmIdPath,
3
3
  parseFragment,
4
4
  unpackHmId
5
- } from "./chunk-EBP7SWTZ.mjs";
5
+ } from "./chunk-KTOBQK6C.mjs";
6
6
  import {
7
7
  pageParamsFromUrl
8
8
  } from "./chunk-AHQWDCHV.mjs";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  codePointLength
3
- } from "./chunk-EBP7SWTZ.mjs";
3
+ } from "./chunk-KTOBQK6C.mjs";
4
4
 
5
5
  // src/tei-to-blocks.ts
6
6
  function generateBlockId() {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  getSupportedHMQueryFilters,
3
3
  isSurrogate
4
- } from "./chunk-EBP7SWTZ.mjs";
4
+ } from "./chunk-KTOBQK6C.mjs";
5
5
 
6
6
  // src/hmblock-to-editorblock.ts
7
7
  function toEditorBlockType(hmBlockType) {
@@ -15,7 +15,7 @@ import {
15
15
  HMActionSchema,
16
16
  HMRequestSchema,
17
17
  packHmId
18
- } from "./chunk-EBP7SWTZ.mjs";
18
+ } from "./chunk-KTOBQK6C.mjs";
19
19
 
20
20
  // src/client.ts
21
21
  import { encode as cborEncode } from "@ipld/dag-cbor";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  teiToBlocks
3
- } from "./chunk-7IKOUDLO.mjs";
3
+ } from "./chunk-PON3NHRS.mjs";
4
4
  import {
5
5
  embeddedPdfToBlocks
6
6
  } from "./chunk-2FJBS3V7.mjs";
@@ -2,7 +2,7 @@ import {
2
2
  HM_SCHEMAS,
3
3
  HM_SCHEMA_MANIFEST,
4
4
  HM_SCHEMA_PAGES
5
- } from "./chunk-HSDV6WEU.mjs";
5
+ } from "./chunk-6RZWE7TK.mjs";
6
6
 
7
7
  // src/schema-engine.ts
8
8
  var LIBRARY_AUTHORITY = "hyper.media";
@@ -8,7 +8,7 @@ import {
8
8
  principalFromEd25519,
9
9
  principalFromString,
10
10
  principalToString
11
- } from "./chunk-NBCHK76Q.mjs";
11
+ } from "./chunk-GBSWXJGU.mjs";
12
12
  import {
13
13
  encode as encode2
14
14
  } from "./chunk-3TPCJCVO.mjs";
package/dist/client.mjs CHANGED
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  createSeedClient,
3
3
  deserializeQueryString
4
- } from "./chunk-M2LRSKSU.mjs";
4
+ } from "./chunk-PUKRJHZR.mjs";
5
5
  import "./chunk-CBELM7KX.mjs";
6
6
  import "./chunk-O5MHN2EO.mjs";
7
7
  import "./chunk-PJ2RFT5A.mjs";
8
8
  import "./chunk-LVAHHQIK.mjs";
9
9
  import "./chunk-DR3HJ6BV.mjs";
10
- import "./chunk-EBP7SWTZ.mjs";
10
+ import "./chunk-KTOBQK6C.mjs";
11
11
  import "./chunk-AHQWDCHV.mjs";
12
12
  import "./chunk-7P6ASYW6.mjs";
13
13
  export {
package/dist/comment.mjs CHANGED
@@ -4,11 +4,11 @@ import {
4
4
  deleteComment,
5
5
  trimTrailingEmptyBlocks,
6
6
  updateComment
7
- } from "./chunk-LOAGYTC2.mjs";
7
+ } from "./chunk-J2QF2I3H.mjs";
8
8
  import "./chunk-JKKS35IS.mjs";
9
9
  import "./chunk-LVAHHQIK.mjs";
10
10
  import "./chunk-DR3HJ6BV.mjs";
11
- import "./chunk-EBP7SWTZ.mjs";
11
+ import "./chunk-KTOBQK6C.mjs";
12
12
  import "./chunk-AHQWDCHV.mjs";
13
13
  import "./chunk-7P6ASYW6.mjs";
14
14
  export {
@@ -21,7 +21,7 @@ export type DocumentState = {
21
21
  /**
22
22
  * Resolves the current document state including head depth.
23
23
  */
24
- export declare function resolveDocumentState(client: SeedClient, targetId: string): Promise<DocumentState>;
24
+ export declare function resolveDocumentState(client: Pick<SeedClient, 'request'>, targetId: string): Promise<DocumentState>;
25
25
  /** A document address resolved through redirects to the document it currently presents. */
26
26
  export type FollowedDocument = {
27
27
  /** The address that was resolved — where a new Ref should be published to affect this path. */
@@ -80,7 +80,7 @@ export type FollowedResource = {
80
80
  * address: the content belongs to `targetId`, and a write to `id` behaves differently from a write
81
81
  * to `targetId` (see {@link describeRedirect}). Callers surface `redirects` to the user or agent.
82
82
  */
83
- export declare function followRedirects(client: SeedClient, id: UnpackedHypermediaId): Promise<FollowedResource>;
83
+ export declare function followRedirects(client: Pick<SeedClient, 'request'>, id: UnpackedHypermediaId): Promise<FollowedResource>;
84
84
  /**
85
85
  * One plain sentence explaining a followed redirect and what a write to either address does —
86
86
  * shared by the CLI and the agents read tool so every surface tells the same story.
@@ -94,7 +94,7 @@ export declare function describeRedirect(followed: Pick<FollowedResource, 'id' |
94
94
  * `type: 'redirect'`. Operations on such a path (edit, fork, move, delete) act on the redirect
95
95
  * target's document, so this follows the chain (bounded, cycle-safe) to that document.
96
96
  */
97
- export declare function followToDocument(client: SeedClient, id: UnpackedHypermediaId): Promise<FollowedDocument>;
97
+ export declare function followToDocument(client: Pick<SeedClient, 'request'>, id: UnpackedHypermediaId): Promise<FollowedDocument>;
98
98
  /**
99
99
  * Resolves an address to the state needed to edit the document there, following redirects.
100
100
  *
@@ -102,4 +102,4 @@ export declare function followToDocument(client: SeedClient, id: UnpackedHyperme
102
102
  * path has no changes of its own — `ListChanges` returns nothing for it) and publish a Version
103
103
  * Ref at the source path with a fresh generation, which supersedes the redirect Ref.
104
104
  */
105
- export declare function resolveEditableDocument(client: SeedClient, id: UnpackedHypermediaId): Promise<EditableDocumentBase>;
105
+ export declare function resolveEditableDocument(client: Pick<SeedClient, 'request'>, id: UnpackedHypermediaId): Promise<EditableDocumentBase>;
@@ -4,8 +4,8 @@ import {
4
4
  followToDocument,
5
5
  resolveDocumentState,
6
6
  resolveEditableDocument
7
- } from "./chunk-25Q3F35L.mjs";
8
- import "./chunk-EBP7SWTZ.mjs";
7
+ } from "./chunk-37I7X7G7.mjs";
8
+ import "./chunk-KTOBQK6C.mjs";
9
9
  import "./chunk-AHQWDCHV.mjs";
10
10
  import "./chunk-7P6ASYW6.mjs";
11
11
  export {
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  editorBlockToHMBlock,
3
3
  editorBlocksToHMBlockNodes
4
- } from "./chunk-SJLLXOSE.mjs";
4
+ } from "./chunk-F37OTY5W.mjs";
5
5
  import "./chunk-JKKS35IS.mjs";
6
- import "./chunk-EBP7SWTZ.mjs";
6
+ import "./chunk-KTOBQK6C.mjs";
7
7
  import "./chunk-AHQWDCHV.mjs";
8
8
  import "./chunk-7P6ASYW6.mjs";
9
9
  export {
@@ -3,8 +3,8 @@ import {
3
3
  hmDomainUrlToWebUrl,
4
4
  resolveHypermediaUrl,
5
5
  resolveId
6
- } from "./chunk-5LHO2KV6.mjs";
7
- import "./chunk-EBP7SWTZ.mjs";
6
+ } from "./chunk-P5EQ4NJ7.mjs";
7
+ import "./chunk-KTOBQK6C.mjs";
8
8
  import "./chunk-AHQWDCHV.mjs";
9
9
  import "./chunk-7P6ASYW6.mjs";
10
10
  export {