@soulcraft/sdk 1.0.0 → 1.2.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 (112) hide show
  1. package/dist/client/index.d.ts +3 -0
  2. package/dist/client/index.d.ts.map +1 -1
  3. package/dist/client/index.js +2 -0
  4. package/dist/client/index.js.map +1 -1
  5. package/dist/index.d.ts +7 -6
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +1 -0
  8. package/dist/index.js.map +1 -1
  9. package/dist/modules/auth/service-token.d.ts +62 -0
  10. package/dist/modules/auth/service-token.d.ts.map +1 -0
  11. package/dist/modules/auth/service-token.js +99 -0
  12. package/dist/modules/auth/service-token.js.map +1 -0
  13. package/dist/modules/billing/firestore-provider.d.ts +60 -0
  14. package/dist/modules/billing/firestore-provider.d.ts.map +1 -0
  15. package/dist/modules/billing/firestore-provider.js +314 -0
  16. package/dist/modules/billing/firestore-provider.js.map +1 -0
  17. package/dist/modules/billing/index.d.ts +58 -0
  18. package/dist/modules/billing/index.d.ts.map +1 -0
  19. package/dist/modules/billing/index.js +164 -0
  20. package/dist/modules/billing/index.js.map +1 -0
  21. package/dist/modules/billing/local-provider.d.ts +38 -0
  22. package/dist/modules/billing/local-provider.d.ts.map +1 -0
  23. package/dist/modules/billing/local-provider.js +242 -0
  24. package/dist/modules/billing/local-provider.js.map +1 -0
  25. package/dist/modules/billing/portal-provider.d.ts +70 -0
  26. package/dist/modules/billing/portal-provider.d.ts.map +1 -0
  27. package/dist/modules/billing/portal-provider.js +204 -0
  28. package/dist/modules/billing/portal-provider.js.map +1 -0
  29. package/dist/modules/billing/types.d.ts +323 -3
  30. package/dist/modules/billing/types.d.ts.map +1 -1
  31. package/dist/modules/billing/types.js +22 -2
  32. package/dist/modules/billing/types.js.map +1 -1
  33. package/dist/modules/billing/usage-buffer.d.ts +72 -0
  34. package/dist/modules/billing/usage-buffer.d.ts.map +1 -0
  35. package/dist/modules/billing/usage-buffer.js +141 -0
  36. package/dist/modules/billing/usage-buffer.js.map +1 -0
  37. package/dist/modules/formats/types.d.ts +65 -3
  38. package/dist/modules/formats/types.d.ts.map +1 -1
  39. package/dist/modules/formats/types.js +40 -3
  40. package/dist/modules/formats/types.js.map +1 -1
  41. package/dist/modules/formats/wdoc.d.ts +263 -0
  42. package/dist/modules/formats/wdoc.d.ts.map +1 -0
  43. package/dist/modules/formats/wdoc.js +21 -0
  44. package/dist/modules/formats/wdoc.js.map +1 -0
  45. package/dist/modules/formats/wquiz.d.ts +122 -0
  46. package/dist/modules/formats/wquiz.d.ts.map +1 -0
  47. package/dist/modules/formats/wquiz.js +23 -0
  48. package/dist/modules/formats/wquiz.js.map +1 -0
  49. package/dist/modules/formats/wslide.d.ts +130 -0
  50. package/dist/modules/formats/wslide.d.ts.map +1 -0
  51. package/dist/modules/formats/wslide.js +23 -0
  52. package/dist/modules/formats/wslide.js.map +1 -0
  53. package/dist/modules/formats/wviz.d.ts +114 -0
  54. package/dist/modules/formats/wviz.d.ts.map +1 -0
  55. package/dist/modules/formats/wviz.js +21 -0
  56. package/dist/modules/formats/wviz.js.map +1 -0
  57. package/dist/modules/hall/browser.d.ts +88 -0
  58. package/dist/modules/hall/browser.d.ts.map +1 -0
  59. package/dist/modules/hall/browser.js +265 -0
  60. package/dist/modules/hall/browser.js.map +1 -0
  61. package/dist/modules/hall/protocol.d.ts +39 -0
  62. package/dist/modules/hall/protocol.d.ts.map +1 -0
  63. package/dist/modules/hall/protocol.js +52 -0
  64. package/dist/modules/hall/protocol.js.map +1 -0
  65. package/dist/modules/hall/server.d.ts +172 -0
  66. package/dist/modules/hall/server.d.ts.map +1 -0
  67. package/dist/modules/hall/server.js +457 -0
  68. package/dist/modules/hall/server.js.map +1 -0
  69. package/dist/modules/hall/types.d.ts +502 -31
  70. package/dist/modules/hall/types.d.ts.map +1 -1
  71. package/dist/modules/hall/types.js +13 -8
  72. package/dist/modules/hall/types.js.map +1 -1
  73. package/dist/modules/kits/index.d.ts +41 -0
  74. package/dist/modules/kits/index.d.ts.map +1 -0
  75. package/dist/modules/kits/index.js +85 -0
  76. package/dist/modules/kits/index.js.map +1 -0
  77. package/dist/modules/kits/types.d.ts +107 -3
  78. package/dist/modules/kits/types.d.ts.map +1 -1
  79. package/dist/modules/kits/types.js +15 -2
  80. package/dist/modules/kits/types.js.map +1 -1
  81. package/dist/modules/license/index.d.ts +53 -0
  82. package/dist/modules/license/index.d.ts.map +1 -0
  83. package/dist/modules/license/index.js +233 -0
  84. package/dist/modules/license/index.js.map +1 -0
  85. package/dist/modules/license/types.d.ts +222 -3
  86. package/dist/modules/license/types.d.ts.map +1 -1
  87. package/dist/modules/license/types.js +21 -2
  88. package/dist/modules/license/types.js.map +1 -1
  89. package/dist/modules/notifications/index.d.ts +40 -0
  90. package/dist/modules/notifications/index.d.ts.map +1 -0
  91. package/dist/modules/notifications/index.js +280 -0
  92. package/dist/modules/notifications/index.js.map +1 -0
  93. package/dist/modules/notifications/types.d.ts +152 -3
  94. package/dist/modules/notifications/types.d.ts.map +1 -1
  95. package/dist/modules/notifications/types.js +21 -2
  96. package/dist/modules/notifications/types.js.map +1 -1
  97. package/dist/server/create-sdk.d.ts +4 -0
  98. package/dist/server/create-sdk.d.ts.map +1 -1
  99. package/dist/server/create-sdk.js +19 -26
  100. package/dist/server/create-sdk.js.map +1 -1
  101. package/dist/server/hall-handlers.d.ts +90 -151
  102. package/dist/server/hall-handlers.d.ts.map +1 -1
  103. package/dist/server/hall-handlers.js +84 -204
  104. package/dist/server/hall-handlers.js.map +1 -1
  105. package/dist/server/index.d.ts +10 -2
  106. package/dist/server/index.d.ts.map +1 -1
  107. package/dist/server/index.js +9 -2
  108. package/dist/server/index.js.map +1 -1
  109. package/dist/types.d.ts +35 -25
  110. package/dist/types.d.ts.map +1 -1
  111. package/docs/USAGE.md +224 -1
  112. package/package.json +13 -5
@@ -0,0 +1,122 @@
1
+ /**
2
+ * @module formats/wquiz
3
+ * @description Type definitions for the WQUIZ (Workshop Quiz) document format.
4
+ *
5
+ * WQUIZ documents are portable assessment and quiz definitions. They support
6
+ * multiple-choice, true/false, short-answer, and essay question types, with
7
+ * per-question point values, optional explanations, and configurable scoring.
8
+ *
9
+ * WQUIZ files are stored in the VFS with the `.wquiz.json` extension. Academy
10
+ * uses them for module assessments; Workshop can render them for self-check quizzes.
11
+ *
12
+ * Question content supports rich formatting via WDOC blocks, enabling code
13
+ * snippets, images, and callouts inside questions and answer choices.
14
+ *
15
+ * @example Reading a WQUIZ from the VFS
16
+ * ```typescript
17
+ * const buf = await sdk.vfs.readFile('/assessments/module-1.wquiz.json')
18
+ * const quiz: WquizDocument = JSON.parse(buf.toString('utf-8'))
19
+ * console.log(`${quiz.questions.length} questions, ${quiz.scoring.totalPoints} points`)
20
+ * ```
21
+ */
22
+ import type { WdocBlock } from './wdoc.js';
23
+ /**
24
+ * A WQUIZ assessment document.
25
+ */
26
+ export interface WquizDocument {
27
+ /** Format discriminator. Always `'wquiz'`. */
28
+ format: 'wquiz';
29
+ /** Schema version. Currently `'1.0'`. */
30
+ version: '1.0';
31
+ /** Quiz title. */
32
+ title: string;
33
+ /** Optional description shown to the learner before starting. */
34
+ description?: string;
35
+ /** ISO 8601 creation timestamp. */
36
+ createdAt?: string;
37
+ /** ISO 8601 last-modified timestamp. */
38
+ updatedAt?: string;
39
+ /** Ordered list of questions. */
40
+ questions: WquizQuestion[];
41
+ /** Scoring configuration. */
42
+ scoring: WquizScoringRules;
43
+ /** Optional metadata for product-specific use (e.g. Academy module ID). */
44
+ metadata?: Record<string, unknown>;
45
+ }
46
+ /**
47
+ * Question type discriminant.
48
+ *
49
+ * - `multiple-choice` — One or more correct answers from a fixed list
50
+ * - `true-false` — Binary correct/incorrect assertion
51
+ * - `short-answer` — Free-text response, graded by exact match or AI review
52
+ * - `essay` — Long-form free-text response, graded by human or AI review
53
+ */
54
+ export type WquizQuestionType = 'multiple-choice' | 'true-false' | 'short-answer' | 'essay';
55
+ /**
56
+ * A single quiz question.
57
+ */
58
+ export interface WquizQuestion {
59
+ /** Stable unique identifier for this question. */
60
+ id: string;
61
+ /** Question type. */
62
+ type: WquizQuestionType;
63
+ /** Plain-text question stem (used as fallback when `content` is absent). */
64
+ text: string;
65
+ /** Rich-text question content (WDOC blocks). When present, rendered instead of `text`. */
66
+ content?: WdocBlock[];
67
+ /** Available answer choices (for `multiple-choice` and `true-false` types). */
68
+ answers: WquizAnswer[];
69
+ /**
70
+ * IDs of correct answer choices.
71
+ * - For `multiple-choice`: one or more answer IDs.
72
+ * - For `true-false`: one of the two generated answer IDs.
73
+ * - For `short-answer`: the accepted text strings (exact match).
74
+ * - For `essay`: omit; graded externally.
75
+ */
76
+ correct?: string[];
77
+ /** Explanation shown after the learner answers (Markdown or plain text). */
78
+ explanation?: string;
79
+ /** Point value for this question. Defaults to `1`. */
80
+ points?: number;
81
+ /** Whether to randomize the order of `answers` when presenting. Defaults to `false`. */
82
+ shuffleAnswers?: boolean;
83
+ }
84
+ /**
85
+ * A single answer choice within a question.
86
+ */
87
+ export interface WquizAnswer {
88
+ /** Stable unique identifier for this answer choice. */
89
+ id: string;
90
+ /** Plain-text answer label (used as fallback when `content` is absent). */
91
+ text: string;
92
+ /** Rich-text answer content (WDOC blocks). When present, rendered instead of `text`. */
93
+ content?: WdocBlock[];
94
+ /** Per-choice feedback shown after the learner answers. */
95
+ feedback?: string;
96
+ /**
97
+ * Partial-credit weight (0–1) for this answer choice.
98
+ * Only used when `WquizScoringRules.allowPartialCredit` is `true`.
99
+ * A weight of `1.0` means full credit; `0.5` means half credit.
100
+ */
101
+ weight?: number;
102
+ }
103
+ /**
104
+ * Scoring rules for the entire quiz.
105
+ */
106
+ export interface WquizScoringRules {
107
+ /** Minimum score (as a percentage 0–100) required to pass. */
108
+ passingScore: number;
109
+ /** Total possible points across all questions. */
110
+ totalPoints: number;
111
+ /** Whether partial credit is allowed on multi-select questions. Defaults to `false`. */
112
+ allowPartialCredit?: boolean;
113
+ /** Whether to penalize wrong answers (negative marking). Defaults to `false`. */
114
+ negativeMark?: boolean;
115
+ /** Maximum number of attempts allowed. `0` = unlimited. Defaults to `0`. */
116
+ maxAttempts?: number;
117
+ /** Time limit in seconds. `0` = no limit. Defaults to `0`. */
118
+ timeLimitSeconds?: number;
119
+ /** Whether to randomize question order when presenting. Defaults to `false`. */
120
+ shuffleQuestions?: boolean;
121
+ }
122
+ //# sourceMappingURL=wquiz.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wquiz.d.ts","sourceRoot":"","sources":["../../../src/modules/formats/wquiz.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAM1C;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,8CAA8C;IAC9C,MAAM,EAAE,OAAO,CAAA;IACf,yCAAyC;IACzC,OAAO,EAAE,KAAK,CAAA;IACd,kBAAkB;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,iEAAiE;IACjE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,mCAAmC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,wCAAwC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,iCAAiC;IACjC,SAAS,EAAE,aAAa,EAAE,CAAA;IAC1B,6BAA6B;IAC7B,OAAO,EAAE,iBAAiB,CAAA;IAC1B,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACnC;AAMD;;;;;;;GAOG;AACH,MAAM,MAAM,iBAAiB,GAAG,iBAAiB,GAAG,YAAY,GAAG,cAAc,GAAG,OAAO,CAAA;AAE3F;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,kDAAkD;IAClD,EAAE,EAAE,MAAM,CAAA;IACV,qBAAqB;IACrB,IAAI,EAAE,iBAAiB,CAAA;IACvB,4EAA4E;IAC5E,IAAI,EAAE,MAAM,CAAA;IACZ,0FAA0F;IAC1F,OAAO,CAAC,EAAE,SAAS,EAAE,CAAA;IACrB,+EAA+E;IAC/E,OAAO,EAAE,WAAW,EAAE,CAAA;IACtB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAClB,4EAA4E;IAC5E,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,sDAAsD;IACtD,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,wFAAwF;IACxF,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,uDAAuD;IACvD,EAAE,EAAE,MAAM,CAAA;IACV,2EAA2E;IAC3E,IAAI,EAAE,MAAM,CAAA;IACZ,wFAAwF;IACxF,OAAO,CAAC,EAAE,SAAS,EAAE,CAAA;IACrB,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAMD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,8DAA8D;IAC9D,YAAY,EAAE,MAAM,CAAA;IACpB,kDAAkD;IAClD,WAAW,EAAE,MAAM,CAAA;IACnB,wFAAwF;IACxF,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,iFAAiF;IACjF,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,4EAA4E;IAC5E,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,8DAA8D;IAC9D,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,gFAAgF;IAChF,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @module formats/wquiz
3
+ * @description Type definitions for the WQUIZ (Workshop Quiz) document format.
4
+ *
5
+ * WQUIZ documents are portable assessment and quiz definitions. They support
6
+ * multiple-choice, true/false, short-answer, and essay question types, with
7
+ * per-question point values, optional explanations, and configurable scoring.
8
+ *
9
+ * WQUIZ files are stored in the VFS with the `.wquiz.json` extension. Academy
10
+ * uses them for module assessments; Workshop can render them for self-check quizzes.
11
+ *
12
+ * Question content supports rich formatting via WDOC blocks, enabling code
13
+ * snippets, images, and callouts inside questions and answer choices.
14
+ *
15
+ * @example Reading a WQUIZ from the VFS
16
+ * ```typescript
17
+ * const buf = await sdk.vfs.readFile('/assessments/module-1.wquiz.json')
18
+ * const quiz: WquizDocument = JSON.parse(buf.toString('utf-8'))
19
+ * console.log(`${quiz.questions.length} questions, ${quiz.scoring.totalPoints} points`)
20
+ * ```
21
+ */
22
+ export {};
23
+ //# sourceMappingURL=wquiz.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wquiz.js","sourceRoot":"","sources":["../../../src/modules/formats/wquiz.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG"}
@@ -0,0 +1,130 @@
1
+ /**
2
+ * @module formats/wslide
3
+ * @description Type definitions for the WSLIDE (Workshop Slide Deck) document format.
4
+ *
5
+ * WSLIDE documents are portable slide presentations. Each slide contains rich
6
+ * content blocks (in WDOC format), a layout preset, optional background, and
7
+ * transition configuration.
8
+ *
9
+ * WSLIDE files are stored in the VFS with the `.wslide.json` extension and can
10
+ * be rendered by any Soulcraft product that embeds the Workshop slideshow viewer.
11
+ *
12
+ * Content blocks within each slide reuse the WDOC block types — the same block
13
+ * system that powers the Workshop document editor applies inside slides.
14
+ *
15
+ * @example Reading a WSLIDE document from the VFS
16
+ * ```typescript
17
+ * const buf = await sdk.vfs.readFile('/presentations/onboarding.wslide.json')
18
+ * const deck: WslideDocument = JSON.parse(buf.toString('utf-8'))
19
+ * console.log(`${deck.slides.length} slides`)
20
+ * ```
21
+ */
22
+ import type { WdocBlock } from './wdoc.js';
23
+ /**
24
+ * Predefined layout preset for a slide.
25
+ *
26
+ * - `title` — Centered title + subtitle
27
+ * - `content` — Title bar + full content area below
28
+ * - `two-column` — Title bar + two equal-width content columns
29
+ * - `image-left` — Image panel on the left, content on the right
30
+ * - `image-right` — Content on the left, image panel on the right
31
+ * - `image-full` — Full-bleed background image with overlaid text
32
+ * - `blank` — No preset layout; positions are fully custom
33
+ */
34
+ export type WslideLayout = 'title' | 'content' | 'two-column' | 'image-left' | 'image-right' | 'image-full' | 'blank';
35
+ /**
36
+ * Slide-to-slide transition animation.
37
+ *
38
+ * - `none` — Instant cut
39
+ * - `fade` — Cross-fade dissolve
40
+ * - `slide` / `slide-left` — Slide the new content in from the right
41
+ * - `slide-right` — Slide the new content in from the left
42
+ * - `slide-up` / `slide-down` — Vertical slide
43
+ * - `zoom` / `zoom-in` — Zoom in from center
44
+ * - `zoom-out` — Zoom out to reveal next slide
45
+ */
46
+ export type WslideTransition = 'none' | 'fade' | 'slide' | 'slide-left' | 'slide-right' | 'slide-up' | 'slide-down' | 'zoom' | 'zoom-in' | 'zoom-out';
47
+ /**
48
+ * A WSLIDE presentation document.
49
+ */
50
+ export interface WslideDocument {
51
+ /** Format discriminator. Always `'wslide'`. */
52
+ format: 'wslide';
53
+ /** Schema version. Currently `'1.0'`. */
54
+ version: '1.0';
55
+ /** Presentation title. */
56
+ title?: string;
57
+ /** Author name or user ID. */
58
+ author?: string;
59
+ /** ISO 8601 creation timestamp. */
60
+ createdAt?: string;
61
+ /** ISO 8601 last-modified timestamp. */
62
+ updatedAt?: string;
63
+ /** Ordered list of slides. */
64
+ slides: WslideSlide[];
65
+ /** Presentation-level display settings. */
66
+ config?: WslideConfig;
67
+ }
68
+ /**
69
+ * A single slide in a WSLIDE presentation.
70
+ */
71
+ export interface WslideSlide {
72
+ /** Unique slide identifier (stable across reorders). */
73
+ id: string;
74
+ /** Slide title shown in the navigation/outline panel. */
75
+ title: string;
76
+ /** Rich content blocks (WDOC format). */
77
+ content: WdocBlock[];
78
+ /** Speaker notes (plain text or Markdown). Not shown to the audience. */
79
+ notes?: string;
80
+ /** Background override for this slide (overrides the presentation default). */
81
+ background?: WslideBackground;
82
+ /** Layout preset for this slide. */
83
+ layout?: WslideLayout;
84
+ /** Transition to use when advancing TO this slide. */
85
+ transition?: WslideTransition;
86
+ /** Arbitrary per-slide metadata for product-specific use. */
87
+ metadata?: Record<string, unknown>;
88
+ }
89
+ /**
90
+ * Slide background configuration.
91
+ */
92
+ export interface WslideBackground {
93
+ /** Background type. */
94
+ type: 'color' | 'gradient' | 'image';
95
+ /**
96
+ * Background value:
97
+ * - `color`: CSS hex or named color, e.g. `'#1a1a2e'`
98
+ * - `gradient`: CSS gradient string, e.g. `'linear-gradient(135deg, #1a1a2e, #16213e)'`
99
+ * - `image`: URL or VFS path to an image file
100
+ */
101
+ value: string;
102
+ /** Opacity for image backgrounds (0–1). Defaults to 1. */
103
+ opacity?: number;
104
+ }
105
+ /**
106
+ * Presentation-level display configuration.
107
+ */
108
+ export interface WslideConfig {
109
+ /** Auto-advance interval in seconds. `0` = manual navigation. Defaults to `0`. */
110
+ autoAdvance?: number;
111
+ /** Show slide numbers in the viewer. Defaults to `true`. */
112
+ showSlideNumbers?: boolean;
113
+ /** Show a progress bar across the bottom. Defaults to `true`. */
114
+ showProgress?: boolean;
115
+ /** Show previous/next navigation arrows. Defaults to `true`. */
116
+ showNavigation?: boolean;
117
+ /** Show the speaker notes panel. Defaults to `false`. */
118
+ showNotes?: boolean;
119
+ /** Enable keyboard navigation (arrow keys, space). Defaults to `true`. */
120
+ keyboardNavigation?: boolean;
121
+ /** Loop back to the first slide after the last. Defaults to `false`. */
122
+ loop?: boolean;
123
+ /** Default transition for all slides (overridden per-slide by `WslideSlide.transition`). */
124
+ defaultTransition?: WslideTransition;
125
+ /** Slide aspect ratio. Defaults to `'16:9'`. */
126
+ aspectRatio?: '16:9' | '4:3' | '16:10' | 'auto';
127
+ /** Color theme. Defaults to `'auto'` (follows system preference). */
128
+ theme?: 'dark' | 'light' | 'auto';
129
+ }
130
+ //# sourceMappingURL=wslide.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wslide.d.ts","sourceRoot":"","sources":["../../../src/modules/formats/wslide.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAM1C;;;;;;;;;;GAUG;AACH,MAAM,MAAM,YAAY,GACpB,OAAO,GACP,SAAS,GACT,YAAY,GACZ,YAAY,GACZ,aAAa,GACb,YAAY,GACZ,OAAO,CAAA;AAEX;;;;;;;;;;GAUG;AACH,MAAM,MAAM,gBAAgB,GACxB,MAAM,GACN,MAAM,GACN,OAAO,GACP,YAAY,GACZ,aAAa,GACb,UAAU,GACV,YAAY,GACZ,MAAM,GACN,SAAS,GACT,UAAU,CAAA;AAMd;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,+CAA+C;IAC/C,MAAM,EAAE,QAAQ,CAAA;IAChB,yCAAyC;IACzC,OAAO,EAAE,KAAK,CAAA;IACd,0BAA0B;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,8BAA8B;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,mCAAmC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,wCAAwC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,8BAA8B;IAC9B,MAAM,EAAE,WAAW,EAAE,CAAA;IACrB,2CAA2C;IAC3C,MAAM,CAAC,EAAE,YAAY,CAAA;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,wDAAwD;IACxD,EAAE,EAAE,MAAM,CAAA;IACV,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAA;IACb,yCAAyC;IACzC,OAAO,EAAE,SAAS,EAAE,CAAA;IACpB,yEAAyE;IACzE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,+EAA+E;IAC/E,UAAU,CAAC,EAAE,gBAAgB,CAAA;IAC7B,oCAAoC;IACpC,MAAM,CAAC,EAAE,YAAY,CAAA;IACrB,sDAAsD;IACtD,UAAU,CAAC,EAAE,gBAAgB,CAAA;IAC7B,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,uBAAuB;IACvB,IAAI,EAAE,OAAO,GAAG,UAAU,GAAG,OAAO,CAAA;IACpC;;;;;OAKG;IACH,KAAK,EAAE,MAAM,CAAA;IACb,0DAA0D;IAC1D,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,kFAAkF;IAClF,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,4DAA4D;IAC5D,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,iEAAiE;IACjE,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,gEAAgE;IAChE,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,yDAAyD;IACzD,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,0EAA0E;IAC1E,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,wEAAwE;IACxE,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,4FAA4F;IAC5F,iBAAiB,CAAC,EAAE,gBAAgB,CAAA;IACpC,gDAAgD;IAChD,WAAW,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,CAAA;IAC/C,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAA;CAClC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @module formats/wslide
3
+ * @description Type definitions for the WSLIDE (Workshop Slide Deck) document format.
4
+ *
5
+ * WSLIDE documents are portable slide presentations. Each slide contains rich
6
+ * content blocks (in WDOC format), a layout preset, optional background, and
7
+ * transition configuration.
8
+ *
9
+ * WSLIDE files are stored in the VFS with the `.wslide.json` extension and can
10
+ * be rendered by any Soulcraft product that embeds the Workshop slideshow viewer.
11
+ *
12
+ * Content blocks within each slide reuse the WDOC block types — the same block
13
+ * system that powers the Workshop document editor applies inside slides.
14
+ *
15
+ * @example Reading a WSLIDE document from the VFS
16
+ * ```typescript
17
+ * const buf = await sdk.vfs.readFile('/presentations/onboarding.wslide.json')
18
+ * const deck: WslideDocument = JSON.parse(buf.toString('utf-8'))
19
+ * console.log(`${deck.slides.length} slides`)
20
+ * ```
21
+ */
22
+ export {};
23
+ //# sourceMappingURL=wslide.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wslide.js","sourceRoot":"","sources":["../../../src/modules/formats/wslide.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG"}
@@ -0,0 +1,114 @@
1
+ /**
2
+ * @module formats/wviz
3
+ * @description Type definitions for the WVIZ (Soulcraft Visualization) document format.
4
+ *
5
+ * WVIZ documents are portable, self-contained graph snapshots. They capture a
6
+ * filtered view of a Brainy knowledge graph — entities and edges — along with
7
+ * enough metadata to render them in any Soulcraft view (graph, mindmap, tree, etc.)
8
+ * without requiring a live Brainy connection.
9
+ *
10
+ * WVIZ files are stored in the VFS with the `.wviz.json` extension and can be
11
+ * exported from Workshop's Explore panel or generated programmatically.
12
+ *
13
+ * @example Reading a WVIZ document from the VFS
14
+ * ```typescript
15
+ * const buf = await sdk.vfs.readFile('/visualizations/product-graph.wviz.json')
16
+ * const viz: WvizDocument = JSON.parse(buf.toString('utf-8'))
17
+ * console.log(viz.entities.length) // number of nodes
18
+ * ```
19
+ */
20
+ /**
21
+ * The rendering mode to use when displaying a WVIZ document.
22
+ *
23
+ * - `graph` — Force-directed node-link diagram (default)
24
+ * - `mindmap` — Radial tree rooted at a central concept
25
+ * - `tree` — Hierarchical top-down tree layout
26
+ * - `tapestry` — Narrative woven-thread visualization (Soulcraft-specific)
27
+ * - `workflow` — Left-to-right directed flow
28
+ * - `board` — Kanban-style column layout
29
+ * - `list` — Flat list view with metadata columns
30
+ * - `table` — Sortable tabular grid
31
+ * - `gallery` — Card grid with thumbnails
32
+ * - `calendar` — Date-based calendar view
33
+ * - `timeline` — Chronological timeline
34
+ */
35
+ export type WvizViewType = 'graph' | 'mindmap' | 'tree' | 'tapestry' | 'workflow' | 'board' | 'list' | 'table' | 'gallery' | 'calendar' | 'timeline';
36
+ /**
37
+ * A self-contained visualization document.
38
+ *
39
+ * Entities and edges are snapshotted at export time. They are NOT live references
40
+ * to a Brainy graph — rendering does not require a Brainy connection.
41
+ */
42
+ export interface WvizDocument {
43
+ /** Format discriminator. Always `'wviz'`. */
44
+ format: 'wviz';
45
+ /** Schema version. Currently `'1.0'`. */
46
+ version: '1.0';
47
+ /** Human-readable document title. */
48
+ title?: string;
49
+ /** Which view type to render this document with. */
50
+ viewType: WvizViewType;
51
+ /**
52
+ * View-specific configuration (layout algorithm, color scheme, label settings, etc.).
53
+ * Shape is view-type-specific and interpreted by the rendering component.
54
+ */
55
+ viewConfig: Record<string, unknown>;
56
+ /** Snapshotted entity list. These are not live Brainy entity references. */
57
+ entities: WvizEntity[];
58
+ /** Edges connecting entities. */
59
+ edges: WvizEdge[];
60
+ /**
61
+ * Saved node positions for force-directed layouts.
62
+ * Key is entity ID; value is `{ x, y }` in canvas coordinates.
63
+ * When present, the layout is pinned rather than recalculated on each render.
64
+ */
65
+ positions?: Record<string, {
66
+ x: number;
67
+ y: number;
68
+ }>;
69
+ /**
70
+ * Provenance metadata describing where this snapshot came from.
71
+ * Recorded at export time; not updated when entities change in Brainy.
72
+ */
73
+ snapshot?: WvizSnapshot;
74
+ }
75
+ /**
76
+ * A single entity (node) in a WVIZ document.
77
+ */
78
+ export interface WvizEntity {
79
+ /** Unique identifier within this document (matches the Brainy entity ID at export time). */
80
+ id: string;
81
+ /** Brainy NounType string (e.g. `'concept'`, `'person'`, `'task'`). */
82
+ type: string;
83
+ /** Human-readable name shown as the node label. */
84
+ name: string;
85
+ /** Additional metadata fields captured at export time. */
86
+ metadata?: Record<string, unknown>;
87
+ }
88
+ /**
89
+ * A directed edge (relationship) between two entities in a WVIZ document.
90
+ */
91
+ export interface WvizEdge {
92
+ /** Source entity ID. Must match a `WvizEntity.id` in the same document. */
93
+ from: string;
94
+ /** Target entity ID. Must match a `WvizEntity.id` in the same document. */
95
+ to: string;
96
+ /** Brainy VerbType string describing the relationship (e.g. `'relatesTo'`, `'blocks'`). */
97
+ verb: string;
98
+ }
99
+ /**
100
+ * Provenance metadata for a WVIZ snapshot.
101
+ */
102
+ export interface WvizSnapshot {
103
+ /** ISO 8601 timestamp when this snapshot was taken. */
104
+ createdAt: string;
105
+ /** Workspace ID the entities were exported from. */
106
+ sourceWorkspace?: string;
107
+ /** Collection or workbench name at time of export. */
108
+ sourceWorkbench?: string;
109
+ /** Total entity count in the source (may differ from `entities.length` after filtering). */
110
+ entityCount: number;
111
+ /** Total edge count in the source. */
112
+ edgeCount: number;
113
+ }
114
+ //# sourceMappingURL=wviz.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wviz.d.ts","sourceRoot":"","sources":["../../../src/modules/formats/wviz.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAMH;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,YAAY,GACpB,OAAO,GACP,SAAS,GACT,MAAM,GACN,UAAU,GACV,UAAU,GACV,OAAO,GACP,MAAM,GACN,OAAO,GACP,SAAS,GACT,UAAU,GACV,UAAU,CAAA;AAMd;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,6CAA6C;IAC7C,MAAM,EAAE,MAAM,CAAA;IACd,yCAAyC;IACzC,OAAO,EAAE,KAAK,CAAA;IACd,qCAAqC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,oDAAoD;IACpD,QAAQ,EAAE,YAAY,CAAA;IACtB;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACnC,4EAA4E;IAC5E,QAAQ,EAAE,UAAU,EAAE,CAAA;IACtB,iCAAiC;IACjC,KAAK,EAAE,QAAQ,EAAE,CAAA;IACjB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACpD;;;OAGG;IACH,QAAQ,CAAC,EAAE,YAAY,CAAA;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,4FAA4F;IAC5F,EAAE,EAAE,MAAM,CAAA;IACV,uEAAuE;IACvE,IAAI,EAAE,MAAM,CAAA;IACZ,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAA;IACZ,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,2EAA2E;IAC3E,IAAI,EAAE,MAAM,CAAA;IACZ,2EAA2E;IAC3E,EAAE,EAAE,MAAM,CAAA;IACV,2FAA2F;IAC3F,IAAI,EAAE,MAAM,CAAA;CACb;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,uDAAuD;IACvD,SAAS,EAAE,MAAM,CAAA;IACjB,oDAAoD;IACpD,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,sDAAsD;IACtD,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,4FAA4F;IAC5F,WAAW,EAAE,MAAM,CAAA;IACnB,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAA;CAClB"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @module formats/wviz
3
+ * @description Type definitions for the WVIZ (Soulcraft Visualization) document format.
4
+ *
5
+ * WVIZ documents are portable, self-contained graph snapshots. They capture a
6
+ * filtered view of a Brainy knowledge graph — entities and edges — along with
7
+ * enough metadata to render them in any Soulcraft view (graph, mindmap, tree, etc.)
8
+ * without requiring a live Brainy connection.
9
+ *
10
+ * WVIZ files are stored in the VFS with the `.wviz.json` extension and can be
11
+ * exported from Workshop's Explore panel or generated programmatically.
12
+ *
13
+ * @example Reading a WVIZ document from the VFS
14
+ * ```typescript
15
+ * const buf = await sdk.vfs.readFile('/visualizations/product-graph.wviz.json')
16
+ * const viz: WvizDocument = JSON.parse(buf.toString('utf-8'))
17
+ * console.log(viz.entities.length) // number of nodes
18
+ * ```
19
+ */
20
+ export {};
21
+ //# sourceMappingURL=wviz.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wviz.js","sourceRoot":"","sources":["../../../src/modules/formats/wviz.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG"}
@@ -0,0 +1,88 @@
1
+ /**
2
+ * @module modules/hall/browser
3
+ * @description Browser-side Hall room client — joins a WebRTC room via a session token.
4
+ *
5
+ * `joinHallRoom` is the browser entry point for Hall real-time communication.
6
+ * It opens a WebSocket to the Hall signaling endpoint, negotiates a WebRTC peer
7
+ * connection via offer/answer/ICE, and returns a `HallRoomHandle` with typed events
8
+ * for tracks, transcripts, concept mentions, and room lifecycle.
9
+ *
10
+ * **Auth model:** The browser never sees the product's shared secret. The product
11
+ * backend mints a short-lived HMAC session token (via `sdk.hall.createSessionToken`)
12
+ * and passes it to the browser. The browser passes the token to `joinHallRoom` — that
13
+ * is the only browser credential.
14
+ *
15
+ * This module has no server-only dependencies and is safe to bundle for the browser.
16
+ * It does require `RTCPeerConnection` and `WebSocket` to be available (standard in
17
+ * all modern browsers; not available in Node.js without polyfills).
18
+ *
19
+ * @example
20
+ * ```typescript
21
+ * import { joinHallRoom } from '@soulcraft/sdk/client'
22
+ *
23
+ * // 1. Get token from product backend:
24
+ * const { token, hallUrl } = await fetch('/api/session/join').then(r => r.json())
25
+ *
26
+ * // 2. Get camera + mic:
27
+ * const stream = await navigator.mediaDevices.getUserMedia({ video: true, audio: true })
28
+ *
29
+ * // 3. Join room:
30
+ * const room = await joinHallRoom({ token, hallUrl })
31
+ * room.addStream(stream)
32
+ *
33
+ * // 4. Handle events:
34
+ * room.on('trackAdded', ({ peerId, streams }) => {
35
+ * document.getElementById(`video-${peerId}`).srcObject = streams[0]
36
+ * })
37
+ * room.on('transcript', ({ peerId, text, isFinal }) => {
38
+ * if (isFinal) appendCaption(peerId, text)
39
+ * })
40
+ * room.on('conceptMention', ({ nodeId, confidence }) => pulseGraphNode(nodeId, confidence))
41
+ *
42
+ * // 5. On leave:
43
+ * room.close()
44
+ * ```
45
+ */
46
+ import type { HallRoomHandle } from './types.js';
47
+ /**
48
+ * Options for {@link joinHallRoom}.
49
+ */
50
+ export interface JoinHallRoomOptions {
51
+ /**
52
+ * The session token issued by the product backend via `sdk.hall.createSessionToken()`.
53
+ * Embedded in the Hall WebSocket URL — never sent as a header or query param separately.
54
+ */
55
+ token: string;
56
+ /**
57
+ * The Hall server WebSocket base URL (e.g. `"wss://hall.soulcraft.com"`).
58
+ * Provided by the product backend alongside the token.
59
+ */
60
+ hallUrl: string;
61
+ /**
62
+ * Optional RTCConfiguration overrides (e.g. additional STUN/TURN servers).
63
+ * Hall's in-process TURN server is always included automatically via the signaling handshake.
64
+ * Pass additional servers here if you have a separate STUN/TURN setup.
65
+ */
66
+ iceServers?: RTCIceServer[];
67
+ }
68
+ /**
69
+ * Join a Hall room from the browser using a session token.
70
+ *
71
+ * Opens a WebSocket to `{hallUrl}/ws/session/{token}`, creates an `RTCPeerConnection`,
72
+ * performs the offer/answer/ICE exchange, and resolves once the peer connection reaches
73
+ * `connected` state. Returns a {@link HallRoomHandle} with typed events.
74
+ *
75
+ * @param options - Token, Hall URL, and optional ICE server overrides.
76
+ * @returns A connected `HallRoomHandle`.
77
+ * @throws {Error} If the signaling handshake fails or the connection times out.
78
+ *
79
+ * @example
80
+ * ```typescript
81
+ * const room = await joinHallRoom({ token, hallUrl: 'wss://hall.soulcraft.com' })
82
+ * room.addStream(localStream)
83
+ * room.on('trackAdded', ({ peerId, streams }) => renderVideo(peerId, streams[0]))
84
+ * room.on('transcript', ({ text, isFinal }) => { if (isFinal) showCaption(text) })
85
+ * ```
86
+ */
87
+ export declare function joinHallRoom(options: JoinHallRoomOptions): Promise<HallRoomHandle>;
88
+ //# sourceMappingURL=browser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../../src/modules/hall/browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH,OAAO,KAAK,EACV,cAAc,EAQf,MAAM,YAAY,CAAA;AAoBnB;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAA;IACf;;;;OAIG;IACH,UAAU,CAAC,EAAE,YAAY,EAAE,CAAA;CAC5B;AAgFD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,cAAc,CAAC,CAgIxF"}