lumiverse-spindle-types 0.6.75 → 0.6.77

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.
package/dist/api.d.ts CHANGED
@@ -5044,6 +5044,15 @@ export type WorkerToHost = import("./live-activities.js").LiveActivityWorkerMess
5044
5044
  type: "media_video_from_image_audio";
5045
5045
  requestId: string;
5046
5046
  input: MediaCreateVideoFromImageAndAudioRequestDTO;
5047
+ } | {
5048
+ type: "theme_references";
5049
+ requestId: string;
5050
+ input: import("./theme-references.js").ThemeReferencesRequest;
5051
+ } | {
5052
+ type: "theme_authoring";
5053
+ requestId: string;
5054
+ input: import("./theme-authoring.js").ThemeAuthoringHostRequest;
5055
+ userId?: string;
5047
5056
  } | {
5048
5057
  type: "theme_apply";
5049
5058
  requestId: string;
@@ -5077,7 +5086,7 @@ export type WorkerToHost = import("./live-activities.js").LiveActivityWorkerMess
5077
5086
  } | {
5078
5087
  type: "commands_unregister";
5079
5088
  commandIds: string[];
5080
- } | {
5089
+ } | import("./uuid.js").UUIDWorkerMessage | {
5081
5090
  type: "version_get_backend";
5082
5091
  requestId: string;
5083
5092
  } | {
package/dist/host.js CHANGED
@@ -1,4 +1,5 @@
1
1
  export const SPINDLE_HOST_CAPABILITIES = Object.freeze({
2
+ "uuid-v1": 1,
2
3
  "message-preset-context-v1": 1,
3
4
  "chat-swipe-variables-v1": 1,
4
5
  "generation-message-sessions-v1": 1,
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export type { LiveActivityPresentation, LiveActivityStartInput, LiveActivityResult, LiveActivityStatus, SpindleLiveActivitiesAPI, LiveActivityWorkerMessage } from "./live-activities.js";
2
2
  export type { DecisionImageAsset, DecisionBox, DecisionJsonValue, DecisionDescription, DecisionState, DecisionQuestion, DecisionAnswer, DecisionAnswerFor, DecisionAnswers, DecisionResult, DecisionEvaluationInput, DecisionConnectionProfileDTO, DecisionModelDTO, DecisionProviderDTO, SpindleDecisionsAPI, DecisionWorkerMessage } from "./decisions.js";
3
3
  export type { EmbeddingConnectionDTO, EmbeddingsEmbedInput, EmbeddingsEmbedResult, SpindleEmbeddingsAPI, EmbeddingsWorkerMessage } from "./embeddings.js";
4
+ export type { SpindleUUIDAPI, UUIDWorkerMessage } from "./uuid.js";
4
5
  export type { SpindleManifest, SpindlePermission, SpindleCapability, } from "./manifest.js";
5
6
  export { IDENTIFIER_PATTERN, validateIdentifier, } from "./manifest.js";
6
7
  export type { LumiverseVersionInfo, SpindleHostDescriptorV1, SpindleHostLocale, SpindleHostLocaleAPI, } from "./host.js";
@@ -42,3 +43,6 @@ export { SPINDLE_SYSTEM_AUDIO_HOST_CAPABILITIES } from "./system-audio.js";
42
43
  export type { MessageGenerationInputDTO, MessageGenerationResultDTO } from "./api.js";
43
44
  export { SPINDLE_CONNECTION_ORGANIZATION_HOST_CAPABILITIES } from './connection-organization.js';
44
45
  export type { SpindleConnectionOrganizationSnapshot, SpindleConnectionOrganizationOptions, SpindleBackendConnectionOrganizationOptions, SpindleConnectionOrganizationAPI, SpindleConnectionOrganizationError, SpindleConnectionOrganizationErrorCode } from './connection-organization.js';
46
+ export type * from "./theme-authoring.js";
47
+ export type * from "./theme-references.js";
48
+ export type { ThemeInspectionOptions, ThemeInspectionResult } from "./theme.js";
@@ -135,6 +135,8 @@ export interface SpindleConnectionsAPI {
135
135
  }
136
136
  /** The global `spindle` object available in backend extension workers */
137
137
  export interface SpindleAPI {
138
+ /** Backend UUID v4/v7 generation (free tier; host capability: uuid-v1). */
139
+ readonly uuid: import("./uuid.js").SpindleUUIDAPI;
138
140
  /** Typed Decision models (permission: decisions; host capability: decisions-v1). */
139
141
  decisions: import("./decisions.js").SpindleDecisionsAPI;
140
142
  /** Embed text with the user's embedding connections (permission: embeddings; host capability: embeddings-v1). */
@@ -1975,6 +1977,10 @@ export interface SpindleAPI {
1975
1977
  * ```
1976
1978
  */
1977
1979
  theme: {
1980
+ /** Persistent backend edits. Mutations require app_manipulation. */
1981
+ readonly authoring?: import("./theme-authoring.js").ThemeAuthoringAPI;
1982
+ /** Read-only public build references, independent of persistent authoring. */
1983
+ readonly references?: import("./theme-references.js").ThemeReferencesAPI;
1978
1984
  /**
1979
1985
  * Apply CSS variable overrides on top of the user's current theme.
1980
1986
  * Subsequent calls merge with (and overwrite) any previously applied
@@ -0,0 +1,225 @@
1
+ export interface SpindleThemeConfiguration {
2
+ id: string;
3
+ name: string;
4
+ mode: 'light' | 'dark' | 'system';
5
+ accent: {
6
+ h: number;
7
+ s: number;
8
+ l: number;
9
+ };
10
+ radiusScale: number;
11
+ enableGlass: boolean;
12
+ fontScale: number;
13
+ uiScale?: number;
14
+ liquidGlass?: boolean;
15
+ characterAware?: boolean;
16
+ baseColors?: Partial<Record<'primary' | 'secondary' | 'background' | 'backgroundDeep' | 'text' | 'danger' | 'success' | 'warning' | 'speech' | 'thoughts', string>>;
17
+ baseColorsByMode?: {
18
+ dark?: SpindleThemeConfiguration['baseColors'];
19
+ light?: SpindleThemeConfiguration['baseColors'];
20
+ };
21
+ statusColors?: {
22
+ danger?: string;
23
+ success?: string;
24
+ warning?: string;
25
+ };
26
+ desktopBackground?: {
27
+ color: string;
28
+ blur?: boolean;
29
+ blurIntensity?: 'subtle' | 'balanced' | 'strong';
30
+ };
31
+ renderingMode?: 'efficiency' | 'balanced' | 'quality';
32
+ }
33
+ export interface SpindleThemeDraft {
34
+ name: string;
35
+ author?: string;
36
+ description?: string;
37
+ theme?: SpindleThemeConfiguration | null;
38
+ globalCSS?: string;
39
+ globalEnabled?: boolean;
40
+ components?: Record<string, {
41
+ css: string;
42
+ enabled?: boolean;
43
+ } | null>;
44
+ assetBundleId?: string | null;
45
+ }
46
+ export interface SpindleThemeState {
47
+ defaultTheme: SpindleThemeConfiguration;
48
+ revision: string;
49
+ theme: SpindleThemeConfiguration | null;
50
+ customCSS: {
51
+ css: string;
52
+ enabled: boolean;
53
+ bundleId: string | null;
54
+ revision: number;
55
+ };
56
+ components: Record<string, {
57
+ css: string;
58
+ tsx: string;
59
+ enabled: boolean;
60
+ }>;
61
+ backups: Array<{
62
+ id: string;
63
+ name: string;
64
+ createdAt: number;
65
+ }>;
66
+ }
67
+ export interface SpindleThemeInstallOptions {
68
+ expectedRevision?: string;
69
+ mode?: 'merge' | 'replace';
70
+ apply?: boolean;
71
+ saveToLibrary?: boolean;
72
+ }
73
+ export interface SpindleThemeInstallResult {
74
+ applied: boolean;
75
+ savedToLibrary: boolean;
76
+ savedThemeId?: string;
77
+ backupId?: string;
78
+ revision: string;
79
+ bundleId: string;
80
+ warnings: string[];
81
+ }
82
+ export interface ThemeAuthoringAsset {
83
+ id: string;
84
+ bundleId: string;
85
+ slug: string;
86
+ originalFilename: string;
87
+ mimeType: string;
88
+ sizeBytes: number;
89
+ tags: string[];
90
+ metadata: Record<string, unknown>;
91
+ cssPath: string;
92
+ contentUrl: string;
93
+ }
94
+ export interface ThemeAuthoringAssetPatch {
95
+ slug?: string;
96
+ tags?: string[];
97
+ metadata?: Record<string, unknown>;
98
+ }
99
+ export interface ThemeAuthoringOperations {
100
+ state: {
101
+ args: Record<string, never>;
102
+ result: SpindleThemeState;
103
+ };
104
+ validate: {
105
+ args: {
106
+ draft: SpindleThemeDraft;
107
+ };
108
+ result: {
109
+ warnings: string[];
110
+ };
111
+ };
112
+ install: {
113
+ args: {
114
+ draft: SpindleThemeDraft;
115
+ options?: SpindleThemeInstallOptions;
116
+ };
117
+ result: SpindleThemeInstallResult;
118
+ };
119
+ backup: {
120
+ args: {
121
+ name?: string;
122
+ };
123
+ result: {
124
+ backupId: string;
125
+ revision: string;
126
+ };
127
+ };
128
+ restore: {
129
+ args: {
130
+ backupId: string;
131
+ expectedRevision: string;
132
+ };
133
+ result: {
134
+ backupId: string;
135
+ revision: string;
136
+ };
137
+ };
138
+ export_current: {
139
+ args: Record<string, never>;
140
+ result: Uint8Array;
141
+ };
142
+ export_draft: {
143
+ args: {
144
+ draft: SpindleThemeDraft;
145
+ };
146
+ result: Uint8Array;
147
+ };
148
+ import: {
149
+ args: {
150
+ bytes: Uint8Array;
151
+ };
152
+ result: {
153
+ draft: SpindleThemeDraft;
154
+ assets: ThemeAuthoringAsset[];
155
+ warnings: string[];
156
+ };
157
+ };
158
+ asset_list: {
159
+ args: {
160
+ bundleId?: string;
161
+ };
162
+ result: ThemeAuthoringAsset[];
163
+ };
164
+ asset_create_bundle: {
165
+ args: Record<string, never>;
166
+ result: {
167
+ bundleId: string;
168
+ };
169
+ };
170
+ asset_upload: {
171
+ args: {
172
+ bundleId: string;
173
+ name: string;
174
+ mimeType: string;
175
+ bytes: Uint8Array;
176
+ } & ThemeAuthoringAssetPatch;
177
+ result: ThemeAuthoringAsset;
178
+ };
179
+ asset_update: {
180
+ args: {
181
+ id: string;
182
+ patch: ThemeAuthoringAssetPatch;
183
+ };
184
+ result: ThemeAuthoringAsset;
185
+ };
186
+ asset_delete: {
187
+ args: {
188
+ id: string;
189
+ };
190
+ result: {
191
+ deleted: boolean;
192
+ };
193
+ };
194
+ asset_optimize: {
195
+ args: {
196
+ id: string;
197
+ };
198
+ result: ThemeAuthoringAsset;
199
+ };
200
+ asset_download: {
201
+ args: {
202
+ id: string;
203
+ };
204
+ result: Uint8Array;
205
+ };
206
+ }
207
+ export type ThemeAuthoringOperation = keyof ThemeAuthoringOperations;
208
+ export type ThemeAuthoringRequest<K extends ThemeAuthoringOperation = ThemeAuthoringOperation> = {
209
+ [P in K]: {
210
+ operation: P;
211
+ args: ThemeAuthoringOperations[P]['args'];
212
+ };
213
+ }[K];
214
+ export interface ThemeAuthoringAPI {
215
+ readonly version: 1;
216
+ request<K extends ThemeAuthoringOperation>(input: ThemeAuthoringRequest<K>, userId?: string): Promise<ThemeAuthoringOperations[K]['result']>;
217
+ }
218
+ export type ThemeAuthoringHostRequest = Exclude<ThemeAuthoringRequest, {
219
+ operation: 'import';
220
+ }> | {
221
+ operation: 'import';
222
+ args: {
223
+ pack: unknown;
224
+ };
225
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,96 @@
1
+ export interface SpindleThemeComponentReference {
2
+ id: string;
3
+ category: string;
4
+ rootSelector: string | null;
5
+ classSelectors: Record<string, string>;
6
+ parts: string[];
7
+ sources: string[];
8
+ template: string;
9
+ props: unknown[];
10
+ build: {
11
+ version: string;
12
+ hash: string;
13
+ };
14
+ }
15
+ export interface ThemeReferencesOperations {
16
+ components: {
17
+ args: {
18
+ query?: string;
19
+ offset?: number;
20
+ limit?: number;
21
+ };
22
+ result: {
23
+ total: number;
24
+ items: Array<{
25
+ id: string;
26
+ category: string;
27
+ rootSelector: string | null;
28
+ }>;
29
+ };
30
+ };
31
+ component: {
32
+ args: {
33
+ id: string;
34
+ };
35
+ result: SpindleThemeComponentReference;
36
+ };
37
+ variables: {
38
+ args: {
39
+ query?: string;
40
+ };
41
+ result: Array<{
42
+ name: string;
43
+ defaultValue: string;
44
+ }>;
45
+ };
46
+ search: {
47
+ args: {
48
+ query: string;
49
+ kind?: 'source' | 'doc';
50
+ offset?: number;
51
+ limit?: number;
52
+ };
53
+ result: {
54
+ total: number;
55
+ items: Array<{
56
+ kind: string;
57
+ path: string;
58
+ line: number;
59
+ excerpt: string;
60
+ }>;
61
+ build: {
62
+ version: string;
63
+ hash: string;
64
+ };
65
+ };
66
+ };
67
+ read: {
68
+ args: {
69
+ kind: 'source' | 'doc';
70
+ path: string;
71
+ startLine?: number;
72
+ lineCount?: number;
73
+ };
74
+ result: {
75
+ text: string;
76
+ totalLines: number;
77
+ startLine: number;
78
+ endLine: number;
79
+ build: {
80
+ version: string;
81
+ hash: string;
82
+ };
83
+ };
84
+ };
85
+ }
86
+ export type ThemeReferencesOperation = keyof ThemeReferencesOperations;
87
+ export type ThemeReferencesRequest<K extends ThemeReferencesOperation = ThemeReferencesOperation> = {
88
+ [P in K]: {
89
+ operation: P;
90
+ args: ThemeReferencesOperations[P]['args'];
91
+ };
92
+ }[K];
93
+ export interface ThemeReferencesAPI {
94
+ readonly version: 1;
95
+ request<K extends ThemeReferencesOperation>(input: ThemeReferencesRequest<K>): Promise<ThemeReferencesOperations[K]['result']>;
96
+ }
@@ -0,0 +1 @@
1
+ export {};
package/dist/theme.d.ts CHANGED
@@ -2,6 +2,7 @@ import type { SpindleUploadFile } from "./dom.js";
2
2
  /** Frontend-only host capabilities for the native theme-authoring context. */
3
3
  export declare const SPINDLE_THEME_AUTHORING_HOST_CAPABILITIES: Readonly<{
4
4
  readonly "theme-assets-v1": 1;
5
+ readonly "theme-inspection-v1": 1;
5
6
  readonly "theme-packs-v1": 1;
6
7
  readonly "theme-catalog-v1": 1;
7
8
  readonly "theme-editor-navigation-v1": 1;
@@ -91,6 +92,8 @@ export interface SpindleThemeEditorOptions {
91
92
  * `spindle.theme` live-presentation API.
92
93
  */
93
94
  export interface SpindleThemeAuthoringAPI {
95
+ /** Requires theme-inspection-v1 and app_manipulation in an active browser context. */
96
+ inspect?(options: ThemeInspectionOptions): ThemeInspectionResult;
94
97
  /** Requires host capability `theme-assets-v1`. Mutations require `app_manipulation`. */
95
98
  readonly assets: {
96
99
  getActiveBundleId(): string | null;
@@ -116,3 +119,22 @@ export interface SpindleThemeAuthoringAPI {
116
119
  /** Requires host capability `theme-editor-navigation-v1`. */
117
120
  openEditor(options?: SpindleThemeEditorOptions): boolean;
118
121
  }
122
+ export interface ThemeInspectionOptions {
123
+ selector: string;
124
+ properties?: string[];
125
+ limit?: number;
126
+ }
127
+ export interface ThemeInspectionResult {
128
+ count: number;
129
+ matches: Array<{
130
+ tag: string;
131
+ visible: boolean;
132
+ rect: {
133
+ x: number;
134
+ y: number;
135
+ width: number;
136
+ height: number;
137
+ };
138
+ styles: Record<string, string>;
139
+ }>;
140
+ }
package/dist/theme.js CHANGED
@@ -1,6 +1,7 @@
1
1
  /** Frontend-only host capabilities for the native theme-authoring context. */
2
2
  export const SPINDLE_THEME_AUTHORING_HOST_CAPABILITIES = Object.freeze({
3
3
  "theme-assets-v1": 1,
4
+ "theme-inspection-v1": 1,
4
5
  "theme-packs-v1": 1,
5
6
  "theme-catalog-v1": 1,
6
7
  "theme-editor-navigation-v1": 1,
package/dist/uuid.d.ts ADDED
@@ -0,0 +1,12 @@
1
+ /** Backend UUID generation (free tier — no permission needed). */
2
+ export interface SpindleUUIDAPI {
3
+ /** Generate a random UUID v4 string using the backend's UUID helper. */
4
+ v4(): Promise<string>;
5
+ /** Generate a timestamp-ordered UUID v7 string using the backend's UUID helper. */
6
+ v7(): Promise<string>;
7
+ }
8
+ export type UUIDWorkerMessage = {
9
+ type: "uuid_generate";
10
+ requestId: string;
11
+ version: 4 | 7;
12
+ };
package/dist/uuid.js ADDED
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lumiverse-spindle-types",
3
- "version": "0.6.75",
3
+ "version": "0.6.77",
4
4
  "type": "module",
5
5
  "types": "./dist/index.d.ts",
6
6
  "keywords": [