sh3-core 0.1.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 (134) hide show
  1. package/dist/Shell.svelte +185 -0
  2. package/dist/Shell.svelte.d.ts +4 -0
  3. package/dist/api.d.ts +22 -0
  4. package/dist/api.js +45 -0
  5. package/dist/apps/lifecycle.d.ts +37 -0
  6. package/dist/apps/lifecycle.js +153 -0
  7. package/dist/apps/registry.svelte.d.ts +37 -0
  8. package/dist/apps/registry.svelte.js +60 -0
  9. package/dist/apps/types.d.ts +61 -0
  10. package/dist/apps/types.js +10 -0
  11. package/dist/assets/icons.svg +1119 -0
  12. package/dist/auth/auth.svelte.d.ts +44 -0
  13. package/dist/auth/auth.svelte.js +119 -0
  14. package/dist/auth/index.d.ts +1 -0
  15. package/dist/auth/index.js +1 -0
  16. package/dist/build.d.ts +29 -0
  17. package/dist/build.js +85 -0
  18. package/dist/contract.d.ts +20 -0
  19. package/dist/contract.js +28 -0
  20. package/dist/documents/backends.d.ts +17 -0
  21. package/dist/documents/backends.js +156 -0
  22. package/dist/documents/config.d.ts +7 -0
  23. package/dist/documents/config.js +27 -0
  24. package/dist/documents/handle.d.ts +6 -0
  25. package/dist/documents/handle.js +154 -0
  26. package/dist/documents/http-backend.d.ts +22 -0
  27. package/dist/documents/http-backend.js +78 -0
  28. package/dist/documents/index.d.ts +6 -0
  29. package/dist/documents/index.js +8 -0
  30. package/dist/documents/notifications.d.ts +9 -0
  31. package/dist/documents/notifications.js +39 -0
  32. package/dist/documents/types.d.ts +97 -0
  33. package/dist/documents/types.js +12 -0
  34. package/dist/host-entry.d.ts +9 -0
  35. package/dist/host-entry.js +15 -0
  36. package/dist/host.d.ts +13 -0
  37. package/dist/host.js +73 -0
  38. package/dist/index.d.ts +2 -0
  39. package/dist/index.js +13 -0
  40. package/dist/layout/DragPreview.svelte +63 -0
  41. package/dist/layout/DragPreview.svelte.d.ts +3 -0
  42. package/dist/layout/LayoutRenderer.svelte +260 -0
  43. package/dist/layout/LayoutRenderer.svelte.d.ts +6 -0
  44. package/dist/layout/SlotContainer.svelte +140 -0
  45. package/dist/layout/SlotContainer.svelte.d.ts +8 -0
  46. package/dist/layout/SlotDropZone.svelte +122 -0
  47. package/dist/layout/SlotDropZone.svelte.d.ts +8 -0
  48. package/dist/layout/drag.svelte.d.ts +45 -0
  49. package/dist/layout/drag.svelte.js +191 -0
  50. package/dist/layout/inspection.d.ts +52 -0
  51. package/dist/layout/inspection.js +157 -0
  52. package/dist/layout/ops.d.ts +78 -0
  53. package/dist/layout/ops.js +281 -0
  54. package/dist/layout/slotHostPool.svelte.d.ts +36 -0
  55. package/dist/layout/slotHostPool.svelte.js +229 -0
  56. package/dist/layout/store.svelte.d.ts +39 -0
  57. package/dist/layout/store.svelte.js +150 -0
  58. package/dist/layout/tree-walk.d.ts +15 -0
  59. package/dist/layout/tree-walk.js +33 -0
  60. package/dist/layout/types.d.ts +108 -0
  61. package/dist/layout/types.js +25 -0
  62. package/dist/overlays/ModalFrame.svelte +87 -0
  63. package/dist/overlays/ModalFrame.svelte.d.ts +10 -0
  64. package/dist/overlays/PopupFrame.svelte +85 -0
  65. package/dist/overlays/PopupFrame.svelte.d.ts +10 -0
  66. package/dist/overlays/ToastItem.svelte +77 -0
  67. package/dist/overlays/ToastItem.svelte.d.ts +9 -0
  68. package/dist/overlays/focusTrap.d.ts +1 -0
  69. package/dist/overlays/focusTrap.js +64 -0
  70. package/dist/overlays/modal.d.ts +9 -0
  71. package/dist/overlays/modal.js +141 -0
  72. package/dist/overlays/popup.d.ts +9 -0
  73. package/dist/overlays/popup.js +108 -0
  74. package/dist/overlays/roots.d.ts +4 -0
  75. package/dist/overlays/roots.js +31 -0
  76. package/dist/overlays/toast.d.ts +6 -0
  77. package/dist/overlays/toast.js +93 -0
  78. package/dist/overlays/types.d.ts +31 -0
  79. package/dist/overlays/types.js +15 -0
  80. package/dist/primitives/.gitkeep +0 -0
  81. package/dist/primitives/ResizableSplitter.svelte +333 -0
  82. package/dist/primitives/ResizableSplitter.svelte.d.ts +35 -0
  83. package/dist/primitives/TabbedPanel.svelte +305 -0
  84. package/dist/primitives/TabbedPanel.svelte.d.ts +50 -0
  85. package/dist/registry/client.d.ts +74 -0
  86. package/dist/registry/client.js +118 -0
  87. package/dist/registry/index.d.ts +13 -0
  88. package/dist/registry/index.js +14 -0
  89. package/dist/registry/installer.d.ts +53 -0
  90. package/dist/registry/installer.js +170 -0
  91. package/dist/registry/integrity.d.ts +32 -0
  92. package/dist/registry/integrity.js +92 -0
  93. package/dist/registry/loader.d.ts +50 -0
  94. package/dist/registry/loader.js +145 -0
  95. package/dist/registry/schema.d.ts +47 -0
  96. package/dist/registry/schema.js +180 -0
  97. package/dist/registry/storage.d.ts +37 -0
  98. package/dist/registry/storage.js +101 -0
  99. package/dist/registry/types.d.ts +245 -0
  100. package/dist/registry/types.js +14 -0
  101. package/dist/registry-shard/RegistryView.svelte +561 -0
  102. package/dist/registry-shard/RegistryView.svelte.d.ts +3 -0
  103. package/dist/registry-shard/registryApp.d.ts +10 -0
  104. package/dist/registry-shard/registryApp.js +24 -0
  105. package/dist/registry-shard/registryShard.svelte.d.ts +45 -0
  106. package/dist/registry-shard/registryShard.svelte.js +125 -0
  107. package/dist/shards/activate.svelte.d.ts +45 -0
  108. package/dist/shards/activate.svelte.js +124 -0
  109. package/dist/shards/registry.d.ts +4 -0
  110. package/dist/shards/registry.js +28 -0
  111. package/dist/shards/types.d.ts +155 -0
  112. package/dist/shards/types.js +20 -0
  113. package/dist/shell-shard/ShellHome.svelte +285 -0
  114. package/dist/shell-shard/ShellHome.svelte.d.ts +3 -0
  115. package/dist/shell-shard/shellShard.svelte.d.ts +2 -0
  116. package/dist/shell-shard/shellShard.svelte.js +47 -0
  117. package/dist/shellRuntime.svelte.d.ts +27 -0
  118. package/dist/shellRuntime.svelte.js +27 -0
  119. package/dist/state/backends.d.ts +26 -0
  120. package/dist/state/backends.js +99 -0
  121. package/dist/state/types.d.ts +38 -0
  122. package/dist/state/types.js +15 -0
  123. package/dist/state/zones.svelte.d.ts +52 -0
  124. package/dist/state/zones.svelte.js +141 -0
  125. package/dist/store/InstalledView.svelte +201 -0
  126. package/dist/store/InstalledView.svelte.d.ts +3 -0
  127. package/dist/store/StoreView.svelte +470 -0
  128. package/dist/store/StoreView.svelte.d.ts +3 -0
  129. package/dist/store/storeApp.d.ts +11 -0
  130. package/dist/store/storeApp.js +26 -0
  131. package/dist/store/storeShard.svelte.d.ts +29 -0
  132. package/dist/store/storeShard.svelte.js +99 -0
  133. package/dist/tokens.css +79 -0
  134. package/package.json +50 -0
@@ -0,0 +1,245 @@
1
+ /**
2
+ * Registry protocol types.
3
+ *
4
+ * A registry is any static HTTP endpoint serving a `registry.json` index
5
+ * and pre-built ESM bundle files. These types define the wire format for
6
+ * the index document and the local metadata stored after installation.
7
+ *
8
+ * Registry flow:
9
+ * 1. Client fetches `<registryUrl>/registry.json` → `RegistryIndex`
10
+ * 2. User picks a `PackageEntry` and a `PackageVersion`
11
+ * 3. Client downloads `bundleUrl`, verifies `integrity`, hot-loads the ESM bundle
12
+ * 4. On success the client writes an `InstalledPackage` record to local storage
13
+ */
14
+ /**
15
+ * Top-level registry index document.
16
+ *
17
+ * Served as static JSON at the root of any SH3 registry endpoint.
18
+ * The `version` field gates forward compatibility — clients that do not
19
+ * recognise the version must refuse to load the index.
20
+ */
21
+ export interface RegistryIndex {
22
+ /**
23
+ * Protocol version discriminator. Currently always `1`.
24
+ * Future breaking changes increment this number.
25
+ */
26
+ version: 1;
27
+ /**
28
+ * All packages published to this registry.
29
+ * Order is not defined by the protocol; store UI should sort as needed.
30
+ */
31
+ packages: PackageEntry[];
32
+ }
33
+ /**
34
+ * A single package (shard or app) listed in the registry.
35
+ *
36
+ * A package has a stable `id` and may publish multiple `versions`. The
37
+ * store UI displays `label`, `description`, `author`, and optional `icon`.
38
+ */
39
+ export interface PackageEntry {
40
+ /**
41
+ * Unique, stable identifier for this package.
42
+ * Convention: `@author/package-name` or `plain-name`.
43
+ * Must not change across versions.
44
+ */
45
+ id: string;
46
+ /**
47
+ * Whether this package is a shard (module that contributes views/commands)
48
+ * or an app (composition document that wires shards into a layout).
49
+ */
50
+ type: 'shard' | 'app';
51
+ /**
52
+ * Human-readable display name shown in the store UI.
53
+ * Should be short (under 40 characters).
54
+ */
55
+ label: string;
56
+ /**
57
+ * Short description shown in the store UI.
58
+ * Should be one or two sentences, plain text.
59
+ */
60
+ description: string;
61
+ /**
62
+ * Author information. Extended fields (email, url) may be added
63
+ * in future protocol versions.
64
+ */
65
+ author: {
66
+ /** Human-readable author name. */
67
+ name: string;
68
+ };
69
+ /**
70
+ * Optional URL to a square icon image (PNG or SVG recommended).
71
+ * Displayed in the store package card. If omitted the store shows
72
+ * a generic placeholder.
73
+ */
74
+ icon?: string;
75
+ /**
76
+ * All published versions of this package, newest-first by convention.
77
+ * Must contain at least one entry.
78
+ */
79
+ versions: PackageVersion[];
80
+ }
81
+ /**
82
+ * A specific published version of a package.
83
+ *
84
+ * Each version ships a self-contained pre-built ESM bundle at `bundleUrl`.
85
+ * The `integrity` field is an SRI hash (sha384 recommended) used to verify
86
+ * the download before execution.
87
+ */
88
+ export interface PackageVersion {
89
+ /**
90
+ * Semver version string (e.g. `"1.2.3"`).
91
+ * Must be unique within a `PackageEntry.versions` array.
92
+ */
93
+ version: string;
94
+ /**
95
+ * The `sh3-framework` contract version this bundle was built against
96
+ * (e.g. `"0.1.0"`). The install API checks this against the running
97
+ * framework version and may warn or block on mismatch.
98
+ */
99
+ contractVersion: string;
100
+ /**
101
+ * Absolute or registry-relative URL to the pre-built ESM bundle.
102
+ * The client fetches this URL and verifies the download against `integrity`
103
+ * before executing.
104
+ */
105
+ bundleUrl: string;
106
+ /**
107
+ * SRI integrity hash for the bundle file.
108
+ * Format: `"<algorithm>-<base64digest>"` (e.g. `"sha384-abc123..."`).
109
+ * Algorithms: sha256, sha384 (recommended), sha512.
110
+ * See: https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity
111
+ */
112
+ integrity: string;
113
+ /**
114
+ * Other shards that must be installed and active before this package
115
+ * can be loaded. Optional — omit if the package has no dependencies.
116
+ *
117
+ * For apps: lists the shards the app's layout references.
118
+ * For shards: lists shards this shard imports from at runtime.
119
+ * Version ranges follow semver (e.g. `"^2.0.0"`, `">=1.0.0 <2.0.0"`).
120
+ */
121
+ requires?: RequiredDependency[];
122
+ }
123
+ /**
124
+ * A declared dependency on another shard with a semver version range.
125
+ *
126
+ * The install API resolves and validates all dependencies before loading
127
+ * the bundle, refusing to install if a dependency is missing or incompatible.
128
+ */
129
+ export interface RequiredDependency {
130
+ /**
131
+ * The shard id that must be present.
132
+ * Must match a `PackageEntry.id` in some available registry.
133
+ */
134
+ id: string;
135
+ /**
136
+ * Semver range the installed shard version must satisfy.
137
+ * Examples: `"^1.0.0"`, `">=2.0.0 <3.0.0"`, `"1.2.x"`.
138
+ * Uses standard semver range notation.
139
+ */
140
+ versionRange: string;
141
+ }
142
+ /**
143
+ * Metadata for an installed package, persisted in local storage.
144
+ *
145
+ * Written by the install API on successful installation. Used to show
146
+ * installed/update-available status in the store UI, and to reconstruct
147
+ * the package registry after a page reload without re-fetching remote indices.
148
+ */
149
+ export interface InstalledPackage {
150
+ /**
151
+ * Package id. Matches the `PackageEntry.id` from the registry.
152
+ */
153
+ id: string;
154
+ /**
155
+ * Whether this is a shard or an app.
156
+ */
157
+ type: 'shard' | 'app';
158
+ /**
159
+ * The version that was installed.
160
+ */
161
+ version: string;
162
+ /**
163
+ * URL of the registry this package was fetched from.
164
+ * Stored so the store UI can check for updates from the same source.
165
+ */
166
+ sourceRegistry: string;
167
+ /**
168
+ * The `sh3-framework` contract version the installed bundle was built
169
+ * against. Used to detect contract version mismatches after framework
170
+ * upgrades.
171
+ */
172
+ contractVersion: string;
173
+ /**
174
+ * ISO 8601 timestamp of when the package was installed.
175
+ * Example: `"2026-04-06T12:34:56.789Z"`.
176
+ */
177
+ installedAt: string;
178
+ }
179
+ /**
180
+ * Result of an install operation.
181
+ *
182
+ * Returned by the framework install API after attempting to download,
183
+ * verify, and hot-load a package bundle.
184
+ */
185
+ export interface InstallResult {
186
+ /**
187
+ * Whether the installation succeeded.
188
+ * On `false`, inspect `error` for the reason.
189
+ */
190
+ success: boolean;
191
+ /**
192
+ * The `InstalledPackage` record written to local storage on success.
193
+ * Undefined on failure.
194
+ */
195
+ package?: InstalledPackage;
196
+ /**
197
+ * Whether the package was activated in the current session without
198
+ * requiring a page reload. `false` means the user must reload before
199
+ * the package is usable.
200
+ */
201
+ hotLoaded: boolean;
202
+ /**
203
+ * Human-readable error message on failure.
204
+ * Undefined on success.
205
+ */
206
+ error?: string;
207
+ }
208
+ /**
209
+ * Metadata passed to the install API alongside the raw bundle bytes.
210
+ *
211
+ * Carries the provenance information needed to write an `InstalledPackage`
212
+ * record and to verify the download's integrity before execution.
213
+ */
214
+ export interface PackageMeta {
215
+ /**
216
+ * Package id. Matches `PackageEntry.id`.
217
+ */
218
+ id: string;
219
+ /**
220
+ * Whether this is a shard or an app.
221
+ */
222
+ type: 'shard' | 'app';
223
+ /**
224
+ * The version being installed. Matches `PackageVersion.version`.
225
+ */
226
+ version: string;
227
+ /**
228
+ * The `sh3-framework` contract version the bundle was built against.
229
+ */
230
+ contractVersion: string;
231
+ /**
232
+ * URL of the registry this package was fetched from.
233
+ */
234
+ sourceRegistry: string;
235
+ /**
236
+ * SRI hash to verify the downloaded bundle against before executing.
237
+ * Must match `PackageVersion.integrity`.
238
+ */
239
+ integrity: string;
240
+ /**
241
+ * Declared shard dependencies. Mirrors `PackageVersion.requires`.
242
+ * Undefined if no dependencies.
243
+ */
244
+ requires?: RequiredDependency[];
245
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Registry protocol types.
3
+ *
4
+ * A registry is any static HTTP endpoint serving a `registry.json` index
5
+ * and pre-built ESM bundle files. These types define the wire format for
6
+ * the index document and the local metadata stored after installation.
7
+ *
8
+ * Registry flow:
9
+ * 1. Client fetches `<registryUrl>/registry.json` → `RegistryIndex`
10
+ * 2. User picks a `PackageEntry` and a `PackageVersion`
11
+ * 3. Client downloads `bundleUrl`, verifies `integrity`, hot-loads the ESM bundle
12
+ * 4. On success the client writes an `InstalledPackage` record to local storage
13
+ */
14
+ export {};