@tdacorp/hyle-sdk 0.8.1 → 0.11.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 (41) hide show
  1. package/README.md +82 -4
  2. package/bin/hyle-sdk-engage-keygen.mjs +3 -0
  3. package/dist/check-routes-bin.js +6 -1
  4. package/dist/{chunk-EBNIKRQH.js → chunk-N7ZQUAGM.js} +46 -2
  5. package/dist/chunk-R5EMI4HQ.js +61 -0
  6. package/dist/{chunk-LGW2KP4X.js → chunk-S3LT6G4M.js} +601 -77
  7. package/dist/{chunk-N4QYPO7S.js → chunk-S7PCCEHP.js} +3 -2
  8. package/dist/comments.cjs +1048 -0
  9. package/dist/comments.d.cts +152 -0
  10. package/dist/comments.d.ts +152 -0
  11. package/dist/comments.js +1025 -0
  12. package/dist/docs-enhance.cjs +97 -0
  13. package/dist/docs-enhance.d.cts +16 -0
  14. package/dist/docs-enhance.d.ts +16 -0
  15. package/dist/docs-enhance.js +73 -0
  16. package/dist/{types-DnPzhrFx.d.cts → embed-BC8Tlc6A.d.cts} +44 -3
  17. package/dist/{types-BoyBWF2F.d.ts → embed-CwSzvBUO.d.ts} +44 -3
  18. package/dist/engage-keygen-bin.js +67 -0
  19. package/dist/index.cjs +27 -1
  20. package/dist/index.d.cts +13 -3
  21. package/dist/index.d.ts +13 -3
  22. package/dist/index.js +5 -1
  23. package/dist/mermaid-diagram.js +9 -54
  24. package/dist/next.cjs +988 -66
  25. package/dist/next.d.cts +149 -6
  26. package/dist/next.d.ts +149 -6
  27. package/dist/next.js +391 -12
  28. package/dist/react.cjs +403 -75
  29. package/dist/react.d.cts +141 -33
  30. package/dist/react.d.ts +141 -33
  31. package/dist/react.js +7 -1
  32. package/dist/{resolve-36-Ng1H0.d.cts → resolve-BYL8jMg0.d.ts} +2 -2
  33. package/dist/{resolve-1rQntRBh.d.ts → resolve-Ra8-y2U-.d.cts} +2 -2
  34. package/dist/styles.css +149 -21
  35. package/dist/{types-CwBCPh6K.d.cts → types-C72FwzOd.d.cts} +71 -1
  36. package/dist/{types-CwBCPh6K.d.ts → types-C72FwzOd.d.ts} +71 -1
  37. package/dist/use-cache.cjs +9 -4
  38. package/dist/use-cache.d.cts +2 -2
  39. package/dist/use-cache.d.ts +2 -2
  40. package/dist/use-cache.js +5 -5
  41. package/package.json +4 -3
package/dist/styles.css CHANGED
@@ -185,38 +185,49 @@
185
185
  .hyle-docs{display:grid;grid-template-columns:minmax(0,1fr);gap:24px 48px}
186
186
  .hyle-docs>*{min-width:0}
187
187
  .hyle-docs-main>*{max-width:var(--h-measure)}
188
- .hyle-nav-d{display:none}
189
- .hyle-nav-m{border:var(--h-border-width) solid var(--h-border);border-radius:var(--h-radius);background:var(--h-surface)}
190
- .hyle-nav-m>summary{display:flex;align-items:center;gap:8px;height:44px;padding:0 16px;cursor:pointer;font-size:14px;font-weight:600;list-style:none}
191
- .hyle-nav-m>summary::-webkit-details-marker{display:none}
192
- .hyle-nav-m>summary .cur{color:var(--h-text-muted);font-weight:400;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
193
- .hyle-nav-m>summary .hyle-chev{margin-left:auto}
194
- .hyle-nav-m[open]>summary .hyle-chev{transform:rotate(180deg)}
195
- .hyle-nav-m[open]>summary{border-bottom:1px solid var(--h-hairline)}
196
- .hyle-nav-m .hyle-tree{padding:12px}
197
- .hyle-side-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:12px}
198
- .hyle-side-head b{font-size:15px;font-weight:600}
188
+ .hyle-docs-main>.hyle-docs-end{display:block;height:1px}
189
+ .hyle-updated{display:flex;align-items:center;gap:8px;margin-top:16px;font-size:14px;color:var(--h-text-muted)}
190
+
191
+ /* sidebar: a popover drawer in a narrow mount (top layer, so a container's containment cannot trap it), a sticky column in a wide one */
192
+ .hyle-nav-bar{display:flex;align-items:center;gap:8px;width:100%;height:44px;padding:0 16px;border:var(--h-border-width) solid var(--h-border);border-radius:var(--h-radius);background:var(--h-surface);color:var(--h-text);font:600 14px/1 var(--h-font-sans);text-align:left;cursor:pointer}
193
+ .hyle-nav-bar .cur{min-width:0;overflow:hidden;color:var(--h-text-muted);font-weight:400;text-overflow:ellipsis;white-space:nowrap}
194
+ .hyle-nav-bar .hyle-chev{margin-left:auto}
195
+ .hyle-nav-d{color:var(--h-text);font-family:var(--h-font-sans);font-size:var(--h-font-size);line-height:var(--h-line-height)}
196
+ .hyle-nav-d:popover-open{display:block;position:fixed;inset:0 auto 0 0;width:min(320px,86vw);max-width:none;height:100dvh;max-height:none;margin:0;padding:16px;overflow:auto;overscroll-behavior:contain;border:0;border-right:var(--h-border-width) solid var(--h-border);border-radius:0;background:var(--h-surface);color:var(--h-text);box-shadow:var(--h-shadow)}
197
+ .hyle-nav-d::backdrop{background:rgb(0 0 0/.5)}
198
+ html:has(.hyle-nav-d:popover-open){overflow:hidden}
199
+ .hyle-nav-x{display:inline-grid;place-items:center;flex:none;width:32px;height:32px;margin-left:auto;padding:0;border:var(--h-border-width) solid var(--h-border);border-radius:var(--h-radius);background:transparent;color:var(--h-text);cursor:pointer}
200
+ .hyle-nav-x:hover{background:var(--h-surface-2)}
201
+ .hyle-side-head{display:flex;align-items:center;gap:8px;margin-bottom:12px}
202
+ .hyle-side-head b{min-width:0;font-size:15px;font-weight:600;overflow-wrap:anywhere}
199
203
  .hyle-side-slot{margin-bottom:12px}
204
+ @supports not selector(:popover-open){.hyle-nav-d{display:block;margin-bottom:0}.hyle-nav-bar,.hyle-nav-x{display:none}}
205
+
206
+ /* tree: the summary toggles (chevron), the link inside it navigates; the page's own group and its ancestors start open */
200
207
  .hyle-tree{font-size:14px;line-height:1.4}
201
208
  .hyle-tree ul{display:block}
202
- .hyle-tree details{margin-top:12px}
203
- .hyle-tree summary{display:flex;align-items:center;gap:8px;min-height:32px;padding:0 12px;margin-left:-12px;cursor:pointer;font-weight:600;color:var(--h-text);list-style:none;border-radius:min(var(--h-radius),6px)}
209
+ .hyle-tree li+li{margin-top:2px}
210
+ .hyle-tree ul ul{margin:2px 0 0 14px;padding-left:8px;border-left:1px solid var(--h-hairline)}
211
+ .hyle-tree summary{display:flex;align-items:center;list-style:none;cursor:pointer;border-radius:min(var(--h-radius),6px)}
204
212
  .hyle-tree summary::-webkit-details-marker{display:none}
205
- .hyle-tree summary .hyle-ic{width:14px;height:14px;color:var(--h-text-faint)}
206
- .hyle-tree details[open]>summary .hyle-ic{transform:rotate(90deg)}
207
213
  .hyle-tree summary:hover{background:var(--h-surface-2)}
208
- .hyle-tree ul ul{margin-left:0;padding-left:12px;border-left:1px solid var(--h-hairline);margin-top:4px}
209
- .hyle-tree li a{display:flex;align-items:center;min-height:32px;padding:4px 12px;margin-left:-12px;border-radius:min(var(--h-radius),6px);color:var(--h-text-muted);text-decoration:none}
210
- .hyle-tree li a:hover{background:var(--h-surface-2);color:var(--h-text)}
211
- .hyle-tree li a[aria-current="page"]{background:var(--h-surface-2);color:var(--h-text);font-weight:600}
214
+ .hyle-tree summary .hyle-ic{flex:none;box-sizing:content-box;width:14px;height:14px;padding:9px;color:var(--h-text-faint)}
215
+ .hyle-tree details[open]>summary .hyle-ic{transform:rotate(90deg)}
216
+ .hyle-tree a{display:flex;align-items:center;flex:1;min-width:0;min-height:32px;padding:4px 12px;border-radius:min(var(--h-radius),6px);color:var(--h-text-muted);text-decoration:none;overflow-wrap:anywhere}
217
+ .hyle-tree summary a{padding-left:0}
218
+ .hyle-tree li>a{padding-left:32px}
219
+ .hyle-tree a:hover{color:var(--h-text)}
220
+ .hyle-tree li>a:hover{background:var(--h-surface-2)}
221
+ .hyle-tree a[aria-current="page"]{color:var(--h-text);font-weight:600}
222
+ .hyle-tree li>a[aria-current="page"],.hyle-tree summary:has(>a[aria-current="page"]){background:var(--h-surface-2);box-shadow:inset 2px 0 0 var(--h-accent)}
212
223
  .hyle-tree li a .hyle-badge{margin-left:auto;height:20px;font-size:11px}
213
224
  .hyle-docs-main .hyle-crumbs{margin-bottom:16px}
214
225
  .hyle-docs-main .hyle-title{font-size:calc(var(--h-h1-size) * .9)}
215
226
  .hyle-docs .hyle-banner{margin-bottom:24px}
216
227
  @container hyle (min-width:760px){
217
228
  .hyle-docs{grid-template-columns:var(--h-nav-width) minmax(0,1fr)}
218
- .hyle-nav-m{display:none}
219
- .hyle-nav-d{display:block;position:sticky;top:calc(var(--h-sticky-top) + 24px);align-self:start;max-height:calc(100vh - var(--h-sticky-top) - 48px);overflow:auto;padding-right:16px}
229
+ .hyle-nav-bar,.hyle-nav-x{display:none}
230
+ .hyle-nav-d{display:block;position:sticky;inset:auto;top:calc(var(--h-sticky-top) + 24px);align-self:start;width:auto;height:auto;max-height:calc(100vh - var(--h-sticky-top) - 48px);margin:0;padding:0 16px 0 0;overflow:auto;border:0;background:transparent}
220
231
  }
221
232
  @container hyle (min-width:1100px){
222
233
  .hyle-docs{grid-template-columns:var(--h-nav-width) minmax(0,1fr) var(--h-toc-width)}
@@ -482,3 +493,120 @@ html.hyle-viewer-lock:has(.hv-shell:fullscreen){scrollbar-gutter:auto}
482
493
  .hv-legend .hv-sel{color:var(--hv-accent)}
483
494
  .hv-legend .hv-up{color:var(--hv-up)}
484
495
  .hv-legend .hv-down{color:var(--hv-down)}
496
+
497
+ /* ===== Comments (engagement) =====
498
+ Hand-maintained, outside the generated token block. Public variables are --hyle-comments-* (not yet in site_tokens.py, DECISIONS 72).
499
+ Everything else reads --h-* only. Rendered by ArticlePage when the workspace enables engagement, between the article body and the pager. */
500
+ .hyle-comments{
501
+ --hc-indent:var(--hyle-comments-indent,24px);
502
+ --hc-gap:var(--hyle-comments-gap,20px);
503
+ --hc-avatar:var(--hyle-comments-avatar-size,32px);
504
+ --hc-rule:var(--hyle-comments-rule,var(--h-hairline));
505
+ --hc-held:var(--hyle-comments-held,var(--h-warn));
506
+ --hc-like-on:var(--hyle-comments-like-on,var(--h-link));
507
+ margin-top:64px;padding-top:32px;border-top:1px solid var(--h-hairline)}
508
+ .hyle-cm-head{display:flex;flex-wrap:wrap;align-items:center;gap:12px 16px;justify-content:space-between}
509
+ .hyle-cm-head h2{font-family:var(--h-font-heading);font-weight:600;font-size:20px;line-height:1.3;letter-spacing:var(--h-heading-tracking);display:flex;align-items:center;gap:12px}
510
+ .hyle-cm-count{font:500 12px/1 var(--h-font-mono);color:var(--h-text-muted);padding:4px 8px;border:var(--h-border-width) solid var(--h-border);border-radius:min(var(--h-radius),6px);background:var(--h-surface-2)}
511
+ .hyle-comments .hyle-banner{margin-top:16px}
512
+ .hyle-comments .hyle-banner[data-kind="bad"]{background:color-mix(in srgb,var(--h-bad) 9%,var(--h-surface));border-color:color-mix(in srgb,var(--h-bad) 35%,var(--h-border))}
513
+ .hyle-comments .hyle-banner[data-kind="bad"]>.hyle-ic{color:var(--h-bad)}
514
+ .hyle-banner .hyle-bt{flex:1;min-width:0}
515
+ .hyle-banner .hyle-bt p+p{margin-top:4px}
516
+ .hyle-banner .hyle-btn{flex:none;margin-left:auto}
517
+ /* buttons inside comments: quiet, 32px tall (40px on narrow mounts for touch) */
518
+ .hyle-cm-btn{display:inline-flex;align-items:center;gap:8px;height:32px;padding:0 8px;border:0;border-radius:min(var(--h-radius),6px);background:transparent;color:var(--h-text-muted);font:500 13px/1 var(--h-font-sans);cursor:pointer;text-decoration:none}
519
+ .hyle-cm-acts>:first-child{margin-left:-8px}
520
+ .hyle-cm-btn:hover{background:var(--h-surface-2);color:var(--h-text)}
521
+ .hyle-cm-btn[aria-pressed="true"]{background:var(--h-surface-2);color:var(--h-text)}
522
+ .hyle-cm-btn[aria-pressed="true"] .hyle-ic{fill:var(--hc-like-on);stroke:var(--hc-like-on)}
523
+ .hyle-cm-btn[aria-disabled="true"]{color:var(--h-text-faint);cursor:default;pointer-events:none}
524
+ .hyle-cm-btn .hyle-ic{width:16px;height:16px}
525
+ .hyle-cm-btn.danger:hover{color:var(--h-bad)}
526
+ .hyle-cm-btn.cnt{font-variant-numeric:tabular-nums}
527
+ /* article-level like */
528
+ .hyle-react{display:flex;align-items:center;gap:12px;margin-top:24px}
529
+ .hyle-react .hyle-btn[aria-pressed="true"]{background:var(--h-surface-2);font-weight:600}
530
+ .hyle-react .hyle-btn[aria-pressed="true"] .hyle-ic{fill:var(--hc-like-on);stroke:var(--hc-like-on)}
531
+ .hyle-react small{font-size:13px;color:var(--h-text-muted)}
532
+ /* composer */
533
+ .hyle-cm-compose{display:grid;grid-template-columns:var(--hc-avatar) minmax(0,1fr);gap:12px;margin-top:24px}
534
+ .hyle-cm-compose .hyle-avatar,.hyle-cm .hyle-avatar{font-size:11px}
535
+ .hyle-cm-compose .hyle-avatar{width:var(--hc-avatar);height:var(--hc-avatar)}
536
+ .hyle-cm-as{font-size:13px;color:var(--h-text-muted);margin-bottom:8px}
537
+ .hyle-cm-as b{color:var(--h-text);font-weight:600}
538
+ .hyle-cm-input{display:block;width:100%;min-height:96px;padding:12px;border:var(--h-border-width) solid var(--h-border);border-radius:var(--h-radius);background:var(--h-surface);color:var(--h-text);font:400 15px/1.5 var(--h-font-sans);resize:vertical}
539
+ .hyle-cm-input::placeholder{color:var(--h-text-faint)}
540
+ .hyle-cm-input:hover{border-color:var(--h-text-faint)}
541
+ .hyle-cm-input[aria-invalid="true"]{border-color:var(--h-bad)}
542
+ .hyle-cm-input:disabled{background:transparent;color:var(--h-text-faint);cursor:not-allowed}
543
+ .hyle-cm-foot{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px;margin-top:8px;font-size:13px;color:var(--h-text-muted)}
544
+ .hyle-cm-foot .grow{flex:1;min-width:200px}
545
+ .hyle-cm-foot .cnt{font-variant-numeric:tabular-nums;font-family:var(--h-font-mono);font-size:12px;color:var(--h-text-faint)}
546
+ .hyle-cm-err{display:flex;gap:8px;align-items:flex-start;margin-top:8px;font-size:14px;color:var(--h-bad)}
547
+ .hyle-cm-err .hyle-ic{margin-top:2px}
548
+ /* signed-out prompt */
549
+ .hyle-cm-signin{display:flex;flex-wrap:wrap;align-items:center;gap:12px 24px;justify-content:space-between;margin-top:24px;padding:16px;border:var(--h-border-width) solid var(--h-border);border-radius:var(--h-radius-lg);background:var(--h-surface)}
550
+ .hyle-cm-signin p{font-size:15px;line-height:1.5;color:var(--h-text-muted);max-width:44ch}
551
+ .hyle-cm-signin b{color:var(--h-text);font-weight:600;display:block}
552
+ /* thread */
553
+ .hyle-cm-list{margin-top:8px}
554
+ .hyle-cm-list .hyle-cm-list{margin-top:0;margin-left:calc(var(--hc-avatar) / 2);padding-left:var(--hc-indent);border-left:1px solid var(--hc-rule)}
555
+ .hyle-cm{padding-top:var(--hc-gap)}
556
+ .hyle-cm>article{display:grid;grid-template-columns:var(--hc-avatar) minmax(0,1fr);column-gap:12px}
557
+ .hyle-cm .hyle-avatar{width:var(--hc-avatar);height:var(--hc-avatar);font-size:12px}
558
+ .hyle-cm-main{min-width:0}
559
+ .hyle-cm-by{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 8px;font-size:14px;line-height:1.4;color:var(--h-text-muted)}
560
+ .hyle-cm-by b{color:var(--h-text);font-weight:600}
561
+ .hyle-cm-by a{color:var(--h-text-muted);text-underline-offset:3px}
562
+ .hyle-cm-tag{font:500 11px/1 var(--h-font-sans);padding:2px 6px;border-radius:min(var(--h-radius),4px);border:var(--h-border-width) solid var(--h-border);color:var(--h-text-muted)}
563
+ .hyle-cm-body{margin-top:4px;font-size:15px;line-height:1.6;color:var(--h-text);overflow-wrap:anywhere}
564
+ .hyle-cm-body>*+*{margin-top:8px}
565
+ .hyle-cm-body a{color:var(--h-link);text-underline-offset:3px}
566
+ .hyle-cm-body code{font:400 .875em var(--h-font-mono);padding:1px 4px;border-radius:4px;background:var(--h-code-bg);border:1px solid var(--h-code-border)}
567
+ .hyle-cm-body blockquote{padding-left:12px;border-left:2px solid var(--h-border);color:var(--h-text-muted)}
568
+ .hyle-cm-acts{display:flex;flex-wrap:wrap;align-items:center;gap:0 8px;margin-top:4px}
569
+ .hyle-cm-acts .sp{flex:1}
570
+ .hyle-cm-acts small{font-size:12px;color:var(--h-text-faint)}
571
+ .hyle-cm-depth{font-size:13px;color:var(--h-text-faint);padding:0 8px}
572
+ /* tombstones */
573
+ .hyle-cm[data-status="deleted"] .hyle-avatar,.hyle-cm[data-status="removed"] .hyle-avatar{background:transparent;border-style:dashed;color:var(--h-text-faint)}
574
+ .hyle-cm[data-status="deleted"] .hyle-cm-body,.hyle-cm[data-status="removed"] .hyle-cm-body{margin-top:0;font-style:italic;color:var(--h-text-muted)}
575
+ .hyle-cm[data-status="deleted"] .hyle-cm-by,.hyle-cm[data-status="removed"] .hyle-cm-by{display:none}
576
+ .hyle-cm[data-status="deleted"] .hyle-cm-main,.hyle-cm[data-status="removed"] .hyle-cm-main{align-self:center}
577
+ /* held for moderation (only its author sees it) */
578
+ .hyle-cm[data-status="held"]>article{padding:12px;margin-left:-12px;margin-right:-12px;border:1px dashed color-mix(in srgb,var(--hc-held) 55%,var(--h-border));border-radius:var(--h-radius);background:color-mix(in srgb,var(--hc-held) 7%,transparent)}
579
+ .hyle-cm-held{display:flex;align-items:center;gap:8px;margin-top:8px;font-size:13px;line-height:1.4;color:var(--h-text-muted)}
580
+ .hyle-cm-held .hyle-ic{color:var(--hc-held)}
581
+ .hyle-cm-held b{color:var(--h-text);font-weight:600}
582
+ .hyle-cm-more{margin-top:var(--hc-gap)}
583
+ .hyle-cm-more .hyle-btn{height:32px}
584
+ /* empty and loading */
585
+ .hyle-cm-empty{display:grid;justify-items:start;gap:4px;margin-top:24px;padding:24px 0;border-top:1px solid var(--h-hairline);color:var(--h-text-muted);font-size:15px}
586
+ .hyle-cm-empty b{color:var(--h-text);font-weight:600}
587
+ .hyle-sk{display:block;background:var(--h-surface-2);border-radius:4px}
588
+ .hyle-cm-sk{display:grid;grid-template-columns:var(--hc-avatar) minmax(0,1fr);column-gap:12px;padding-top:var(--hc-gap)}
589
+ .hyle-cm-sk .hyle-sk.c{width:var(--hc-avatar);height:var(--hc-avatar);border-radius:50%}
590
+ .hyle-cm-sk .hyle-sk.l{height:12px;margin-top:8px}
591
+ @media (prefers-reduced-motion:no-preference){.hyle-sk{animation:hyle-sk 1.4s ease-in-out infinite}@keyframes hyle-sk{50%{opacity:.5}}}
592
+ @container hyle (max-width:640px){
593
+ .hyle-comments{--hc-avatar:var(--hyle-comments-avatar-size,24px);--hc-indent:var(--hyle-comments-indent,8px);margin-top:48px}
594
+ .hyle-cm>article,.hyle-cm-compose,.hyle-cm-sk{column-gap:8px}
595
+ .hyle-cm-btn{height:40px}
596
+ .hyle-cm-signin .hyle-btn,.hyle-banner .hyle-btn{width:100%;margin-left:0}
597
+ .hyle-banner{flex-wrap:wrap}
598
+ .hyle-cm[data-status="held"]>article{margin-inline:-8px;padding:8px}
599
+ }
600
+ .hyle-cm-note{margin-top:16px;font-size:13px;color:var(--h-text-muted)}
601
+ .hyle-cm-reply,.hyle-cm-main>.hyle-cm-compose{margin-top:12px}
602
+
603
+ /* ---- embeds (HyleList, HyleArticle, HyleComments): no page frame; the host owns width, padding and the page's headings ---- */
604
+ .hyle-embed .hyle-title{font-size:var(--h-h2-size);line-height:1.3}
605
+ .hyle-embed>.hyle-title+.hyle-items,.hyle-embed .hyle-head+.hyle-body{margin-top:16px}
606
+ .hyle-embed .hyle-item{margin-inline:0}
607
+ .hyle-embed .hyle-more{display:inline-block;margin-top:16px;font-weight:500;color:var(--h-link);text-underline-offset:3px}
608
+ .hyle-embed>.hyle-comments{margin-top:0}
609
+ .hyle-embed[data-layout="grid"] .hyle-items{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:var(--h-gutter)}
610
+ .hyle-embed[data-layout="grid"] .hyle-items>li{border:var(--h-border-width) solid var(--h-border);border-radius:var(--h-radius-lg)}
611
+ .hyle-embed[data-layout="grid"] .hyle-item{grid-template-columns:minmax(0,1fr);gap:4px;height:100%;padding:16px}
612
+ .hyle-embed[data-layout="grid"] .hyle-item time{order:-1;font-size:13px;line-height:1.4}
@@ -16,6 +16,18 @@ interface NavItem {
16
16
  readonly title: string;
17
17
  readonly canonical_path: string;
18
18
  }
19
+ /** One page of the section's navigation tree; `children` are its effective children in sibling order. */
20
+ interface NavNode extends NavItem {
21
+ readonly children: readonly NavNode[];
22
+ }
23
+ /**
24
+ * The whole section's navigation for the article's locale (hidden pages excluded, their children promoted).
25
+ * `truncated` (with empty `items`) means the section is too large to send as one tree.
26
+ */
27
+ interface NavTree {
28
+ readonly truncated: boolean;
29
+ readonly items: readonly NavNode[];
30
+ }
19
31
  interface Breadcrumb {
20
32
  readonly title: string;
21
33
  readonly canonical_path: string;
@@ -59,6 +71,8 @@ interface ResolvedArticle {
59
71
  readonly children: readonly NavItem[];
60
72
  readonly prev: NavItem | null;
61
73
  readonly next: NavItem | null;
74
+ /** Present only when requested with `nav: "tree"` (the docs layout does); absent from every other response. */
75
+ readonly nav?: NavTree;
62
76
  readonly alternates: readonly Alternate[];
63
77
  readonly fallback?: Fallback;
64
78
  readonly cache: CacheInfo;
@@ -120,5 +134,61 @@ interface Mounts {
120
134
  readonly cache: CacheInfo;
121
135
  }
122
136
  type MountsResult = Mounts | ResolvedDisabled;
137
+ /** One comment of `GET /cp1/engage/comments` (docs/cp1-spec.md section 3.11), in thread order. */
138
+ interface EngageComment {
139
+ readonly id: string;
140
+ readonly parent_id: string | null;
141
+ /** 1 to 4. */
142
+ readonly depth: number;
143
+ /** An immutable author-name string, read if a hyle sends it; the contract on main is `author: { name }`, which is read the same way. */
144
+ readonly author_name?: string | null;
145
+ readonly author?: {
146
+ readonly name: string;
147
+ } | null;
148
+ readonly created_at: string;
149
+ readonly edited_at: string | null;
150
+ readonly like_count: number;
151
+ /** A hidden or deleted comment kept only because a visible reply hangs from it: no body, no author. */
152
+ readonly removed: boolean;
153
+ /** On a tombstone only: who removed it. Absent on a live comment. */
154
+ readonly removed_by?: "moderator" | "author";
155
+ readonly body: {
156
+ readonly format: "hast";
157
+ readonly tree: unknown;
158
+ } | null;
159
+ /** Viewer members: present on a live comment only when the listing was fetched for a known reader. */
160
+ readonly mine?: boolean;
161
+ readonly liked_by_me?: boolean;
162
+ /** ISO instant until which the reader may edit, or null. */
163
+ readonly can_edit_until?: string | null;
164
+ }
165
+ /** One of the reader's own held comments (`mine_held`): never part of `comments`, never counted. */
166
+ interface EngageHeldComment {
167
+ readonly id: string;
168
+ readonly parent_id: string | null;
169
+ readonly depth: number;
170
+ readonly author_name: string | null;
171
+ readonly created_at: string;
172
+ readonly edited_at: string | null;
173
+ readonly can_edit_until: string | null;
174
+ readonly body: {
175
+ readonly format: "hast";
176
+ readonly tree: unknown;
177
+ } | null;
178
+ }
179
+ /** `data` of `GET /cp1/engage/comments`. */
180
+ interface EngageListing {
181
+ readonly cp: 1;
182
+ readonly kind: "comments";
183
+ readonly publication_id: string;
184
+ readonly comment_count: number;
185
+ readonly like_count: number;
186
+ /** More than the 500 listed comments exist. */
187
+ readonly truncated: boolean;
188
+ readonly comments: readonly EngageComment[];
189
+ /** Viewer members: absent from the public listing (anonymous, banned or unknown reader, or a rate-limited viewer read). */
190
+ readonly liked_by_me?: boolean;
191
+ readonly mine_held?: readonly EngageHeldComment[];
192
+ }
123
193
 
124
- export type { Alternate as A, Breadcrumb as B, CacheInfo as C, Fallback as F, ListItem as L, MountsResult as M, NavItem as N, Resolved as R, TocEntry as T, ArticleContent as a, Mount as b, Mounts as c, ResolvedArticle as d, ResolvedDisabled as e, ResolvedList as f, ResolvedNotFound as g, ResolvedRedirect as h };
194
+ export type { Alternate as A, Breadcrumb as B, CacheInfo as C, EngageComment as E, Fallback as F, ListItem as L, MountsResult as M, NavItem as N, Resolved as R, TocEntry as T, ArticleContent as a, EngageHeldComment as b, EngageListing as c, Mount as d, Mounts as e, NavNode as f, NavTree as g, ResolvedArticle as h, ResolvedDisabled as i, ResolvedList as j, ResolvedNotFound as k, ResolvedRedirect as l };
@@ -16,6 +16,18 @@ interface NavItem {
16
16
  readonly title: string;
17
17
  readonly canonical_path: string;
18
18
  }
19
+ /** One page of the section's navigation tree; `children` are its effective children in sibling order. */
20
+ interface NavNode extends NavItem {
21
+ readonly children: readonly NavNode[];
22
+ }
23
+ /**
24
+ * The whole section's navigation for the article's locale (hidden pages excluded, their children promoted).
25
+ * `truncated` (with empty `items`) means the section is too large to send as one tree.
26
+ */
27
+ interface NavTree {
28
+ readonly truncated: boolean;
29
+ readonly items: readonly NavNode[];
30
+ }
19
31
  interface Breadcrumb {
20
32
  readonly title: string;
21
33
  readonly canonical_path: string;
@@ -59,6 +71,8 @@ interface ResolvedArticle {
59
71
  readonly children: readonly NavItem[];
60
72
  readonly prev: NavItem | null;
61
73
  readonly next: NavItem | null;
74
+ /** Present only when requested with `nav: "tree"` (the docs layout does); absent from every other response. */
75
+ readonly nav?: NavTree;
62
76
  readonly alternates: readonly Alternate[];
63
77
  readonly fallback?: Fallback;
64
78
  readonly cache: CacheInfo;
@@ -120,5 +134,61 @@ interface Mounts {
120
134
  readonly cache: CacheInfo;
121
135
  }
122
136
  type MountsResult = Mounts | ResolvedDisabled;
137
+ /** One comment of `GET /cp1/engage/comments` (docs/cp1-spec.md section 3.11), in thread order. */
138
+ interface EngageComment {
139
+ readonly id: string;
140
+ readonly parent_id: string | null;
141
+ /** 1 to 4. */
142
+ readonly depth: number;
143
+ /** An immutable author-name string, read if a hyle sends it; the contract on main is `author: { name }`, which is read the same way. */
144
+ readonly author_name?: string | null;
145
+ readonly author?: {
146
+ readonly name: string;
147
+ } | null;
148
+ readonly created_at: string;
149
+ readonly edited_at: string | null;
150
+ readonly like_count: number;
151
+ /** A hidden or deleted comment kept only because a visible reply hangs from it: no body, no author. */
152
+ readonly removed: boolean;
153
+ /** On a tombstone only: who removed it. Absent on a live comment. */
154
+ readonly removed_by?: "moderator" | "author";
155
+ readonly body: {
156
+ readonly format: "hast";
157
+ readonly tree: unknown;
158
+ } | null;
159
+ /** Viewer members: present on a live comment only when the listing was fetched for a known reader. */
160
+ readonly mine?: boolean;
161
+ readonly liked_by_me?: boolean;
162
+ /** ISO instant until which the reader may edit, or null. */
163
+ readonly can_edit_until?: string | null;
164
+ }
165
+ /** One of the reader's own held comments (`mine_held`): never part of `comments`, never counted. */
166
+ interface EngageHeldComment {
167
+ readonly id: string;
168
+ readonly parent_id: string | null;
169
+ readonly depth: number;
170
+ readonly author_name: string | null;
171
+ readonly created_at: string;
172
+ readonly edited_at: string | null;
173
+ readonly can_edit_until: string | null;
174
+ readonly body: {
175
+ readonly format: "hast";
176
+ readonly tree: unknown;
177
+ } | null;
178
+ }
179
+ /** `data` of `GET /cp1/engage/comments`. */
180
+ interface EngageListing {
181
+ readonly cp: 1;
182
+ readonly kind: "comments";
183
+ readonly publication_id: string;
184
+ readonly comment_count: number;
185
+ readonly like_count: number;
186
+ /** More than the 500 listed comments exist. */
187
+ readonly truncated: boolean;
188
+ readonly comments: readonly EngageComment[];
189
+ /** Viewer members: absent from the public listing (anonymous, banned or unknown reader, or a rate-limited viewer read). */
190
+ readonly liked_by_me?: boolean;
191
+ readonly mine_held?: readonly EngageHeldComment[];
192
+ }
123
193
 
124
- export type { Alternate as A, Breadcrumb as B, CacheInfo as C, Fallback as F, ListItem as L, MountsResult as M, NavItem as N, Resolved as R, TocEntry as T, ArticleContent as a, Mount as b, Mounts as c, ResolvedArticle as d, ResolvedDisabled as e, ResolvedList as f, ResolvedNotFound as g, ResolvedRedirect as h };
194
+ export type { Alternate as A, Breadcrumb as B, CacheInfo as C, EngageComment as E, Fallback as F, ListItem as L, MountsResult as M, NavItem as N, Resolved as R, TocEntry as T, ArticleContent as a, EngageHeldComment as b, EngageListing as c, Mount as d, Mounts as e, NavNode as f, NavTree as g, ResolvedArticle as h, ResolvedDisabled as i, ResolvedList as j, ResolvedNotFound as k, ResolvedRedirect as l };
@@ -117,11 +117,16 @@ function createHyleClient(options) {
117
117
  const query = new URLSearchParams({ path: opts.path });
118
118
  if (opts.locale !== void 0) query.set("locale", opts.locale);
119
119
  if (opts.format !== void 0) query.set("format", opts.format);
120
+ if (opts.nav !== void 0) query.set("nav", opts.nav);
120
121
  if (opts.cursor !== void 0) query.set("cursor", opts.cursor);
121
122
  if (opts.limit !== void 0) query.set("limit", String(opts.limit));
122
123
  const reply = await get("/cp1/read/resolve", query, opts.init);
123
124
  const data = reply.parsed?.data;
124
- if (data && data.cp === 1 && typeof data.kind === "string" && KINDS.has(data.kind)) return data;
125
+ if (data && data.cp === 1 && typeof data.kind === "string" && KINDS.has(data.kind)) {
126
+ const resolved = data;
127
+ if (resolved.kind === "article" && resolved.content.format === "html" && opts.format !== "html") throw failure(reply);
128
+ return resolved;
129
+ }
125
130
  throw failure(reply);
126
131
  }
127
132
  async function mounts(opts = {}) {
@@ -157,11 +162,11 @@ var MAX_TAGS = 128;
157
162
  var DISABLED_REVALIDATE = 30;
158
163
  var tokens = /* @__PURE__ */ new Map();
159
164
  var keyOf = (baseUrl, workspaceId) => `${baseUrl}\0${workspaceId}`;
160
- async function resolveCached(baseUrl, workspaceId, path, locale, limit, cursor, revalidate) {
165
+ async function resolveCached(baseUrl, workspaceId, path, locale, limit, cursor, nav, revalidate) {
161
166
  "use cache";
162
167
  const token = tokens.get(keyOf(baseUrl, workspaceId));
163
168
  if (!token) throw new Error("hyle: unknown cache configuration");
164
- const result = await createHyleClient({ baseUrl, token }).resolve({ path, ...locale ? { locale } : {}, ...limit > 0 ? { limit } : {}, ...cursor ? { cursor } : {} });
169
+ const result = await createHyleClient({ baseUrl, token }).resolve({ path, ...locale ? { locale } : {}, ...limit > 0 ? { limit } : {}, ...cursor ? { cursor } : {}, ...nav === "tree" ? { nav: "tree" } : {} });
165
170
  if (result.kind !== "disabled") (0, import_cache.cacheTag)(...result.cache.tags.filter(isValidCacheTag).slice(0, MAX_TAGS));
166
171
  (0, import_cache.cacheLife)({ stale: 30, revalidate: result.kind === "disabled" ? Math.min(revalidate, DISABLED_REVALIDATE) : revalidate });
167
172
  return result;
@@ -169,7 +174,7 @@ async function resolveCached(baseUrl, workspaceId, path, locale, limit, cursor,
169
174
  function cachedResolver(options) {
170
175
  tokens.set(keyOf(options.baseUrl, options.workspaceId), options.token);
171
176
  const revalidate = options.revalidate ?? DEFAULT_REVALIDATE;
172
- return (path, locale, limit, cursor) => resolveCached(options.baseUrl, options.workspaceId, path, locale ?? "", limit ?? 0, cursor ?? "", revalidate);
177
+ return (path, locale, limit, cursor, nav) => resolveCached(options.baseUrl, options.workspaceId, path, locale ?? "", limit ?? 0, cursor ?? "", nav ?? "", revalidate);
173
178
  }
174
179
  // Annotate the CommonJS export names for ESM import in node:
175
180
  0 && (module.exports = {
@@ -1,5 +1,5 @@
1
- import { H as HyleResolver } from './resolve-36-Ng1H0.cjs';
2
- import './types-CwBCPh6K.cjs';
1
+ import { H as HyleResolver } from './resolve-Ra8-y2U-.cjs';
2
+ import './types-C72FwzOd.cjs';
3
3
 
4
4
  /**
5
5
  * The exact caching strategy: a `'use cache'` function that fetches, then tags its own entry with the tags the response
@@ -1,5 +1,5 @@
1
- import { H as HyleResolver } from './resolve-1rQntRBh.js';
2
- import './types-CwBCPh6K.js';
1
+ import { H as HyleResolver } from './resolve-BYL8jMg0.js';
2
+ import './types-C72FwzOd.js';
3
3
 
4
4
  /**
5
5
  * The exact caching strategy: a `'use cache'` function that fetches, then tags its own entry with the tags the response
package/dist/use-cache.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  DEFAULT_REVALIDATE
3
- } from "./chunk-N4QYPO7S.js";
3
+ } from "./chunk-S7PCCEHP.js";
4
4
  import {
5
5
  createHyleClient,
6
6
  isValidCacheTag
7
- } from "./chunk-EBNIKRQH.js";
7
+ } from "./chunk-N7ZQUAGM.js";
8
8
  import "./chunk-67IOIAVW.js";
9
9
 
10
10
  // src/next/use-cache.ts
@@ -13,11 +13,11 @@ var MAX_TAGS = 128;
13
13
  var DISABLED_REVALIDATE = 30;
14
14
  var tokens = /* @__PURE__ */ new Map();
15
15
  var keyOf = (baseUrl, workspaceId) => `${baseUrl}\0${workspaceId}`;
16
- async function resolveCached(baseUrl, workspaceId, path, locale, limit, cursor, revalidate) {
16
+ async function resolveCached(baseUrl, workspaceId, path, locale, limit, cursor, nav, revalidate) {
17
17
  "use cache";
18
18
  const token = tokens.get(keyOf(baseUrl, workspaceId));
19
19
  if (!token) throw new Error("hyle: unknown cache configuration");
20
- const result = await createHyleClient({ baseUrl, token }).resolve({ path, ...locale ? { locale } : {}, ...limit > 0 ? { limit } : {}, ...cursor ? { cursor } : {} });
20
+ const result = await createHyleClient({ baseUrl, token }).resolve({ path, ...locale ? { locale } : {}, ...limit > 0 ? { limit } : {}, ...cursor ? { cursor } : {}, ...nav === "tree" ? { nav: "tree" } : {} });
21
21
  if (result.kind !== "disabled") cacheTag(...result.cache.tags.filter(isValidCacheTag).slice(0, MAX_TAGS));
22
22
  cacheLife({ stale: 30, revalidate: result.kind === "disabled" ? Math.min(revalidate, DISABLED_REVALIDATE) : revalidate });
23
23
  return result;
@@ -25,7 +25,7 @@ async function resolveCached(baseUrl, workspaceId, path, locale, limit, cursor,
25
25
  function cachedResolver(options) {
26
26
  tokens.set(keyOf(options.baseUrl, options.workspaceId), options.token);
27
27
  const revalidate = options.revalidate ?? DEFAULT_REVALIDATE;
28
- return (path, locale, limit, cursor) => resolveCached(options.baseUrl, options.workspaceId, path, locale ?? "", limit ?? 0, cursor ?? "", revalidate);
28
+ return (path, locale, limit, cursor, nav) => resolveCached(options.baseUrl, options.workspaceId, path, locale ?? "", limit ?? 0, cursor ?? "", nav ?? "", revalidate);
29
29
  }
30
30
  export {
31
31
  cachedResolver
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tdacorp/hyle-sdk",
3
- "version": "0.8.1",
3
+ "version": "0.11.0",
4
4
  "description": "hyle SDK: a typed client for hyle's resolve endpoint, a hast renderer for React, and a Next.js catch-all page with tag-based revalidation.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -64,7 +64,8 @@
64
64
  "./package.json": "./package.json"
65
65
  },
66
66
  "bin": {
67
- "hyle-sdk-check-routes": "./bin/hyle-sdk-check-routes.mjs"
67
+ "hyle-sdk-check-routes": "./bin/hyle-sdk-check-routes.mjs",
68
+ "hyle-sdk-engage-keygen": "./bin/hyle-sdk-engage-keygen.mjs"
68
69
  },
69
70
  "main": "./dist/index.cjs",
70
71
  "module": "./dist/index.js",
@@ -101,7 +102,7 @@
101
102
  "tsup": "^8.5.1",
102
103
  "typescript": "^5.9.3",
103
104
  "vitest": "^4.1.10",
104
- "@hyle/renderer": "0.2.0"
105
+ "@hyle/renderer": "0.3.0"
105
106
  },
106
107
  "keywords": [
107
108
  "hyle",