lumiverse-spindle-types 0.6.49 → 0.6.51

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.
@@ -0,0 +1,31 @@
1
+ /** Frontend-only metadata; does not describe the backend server's platform. */
2
+ export declare const SPINDLE_CLIENT_HOST_CAPABILITIES: Readonly<{
3
+ readonly "client-info-v1": 1;
4
+ }>;
5
+ export type SpindleClientKind = "browser" | "pwa" | "desktop" | "mobile";
6
+ export type SpindleClientPlatform = "ios" | "android" | "macos" | "windows" | "linux" | "unknown";
7
+ /** A frozen snapshot of the document running this extension. */
8
+ export interface SpindleClientInfo {
9
+ /** Native shells take precedence over PWA display modes. */
10
+ readonly kind: SpindleClientKind;
11
+ /** Native identity when available, otherwise best-effort browser OS detection. */
12
+ readonly platform: SpindleClientPlatform;
13
+ /** Mobile OS/device identity, independent of viewport width; true for mobile apps too. */
14
+ readonly isMobile: boolean;
15
+ /**
16
+ * Callable native transports present in this document. These flags do not grant
17
+ * permissions or guarantee any particular command; also check the feature's
18
+ * host capability and availability API (for example, systemAudio.isAvailable()).
19
+ * Browser tabs and PWAs report false for every bridge.
20
+ */
21
+ readonly bridges: {
22
+ readonly desktop: boolean;
23
+ readonly ios: boolean;
24
+ readonly android: boolean;
25
+ };
26
+ }
27
+ /** Permission-free client detection, available with client-info-v1. */
28
+ export interface SpindleClientAPI {
29
+ /** Read current signals on each call without prompting or invoking native commands. */
30
+ getInfo(): SpindleClientInfo;
31
+ }
package/dist/client.js ADDED
@@ -0,0 +1,4 @@
1
+ /** Frontend-only metadata; does not describe the backend server's platform. */
2
+ export const SPINDLE_CLIENT_HOST_CAPABILITIES = Object.freeze({
3
+ "client-info-v1": 1,
4
+ });
@@ -1,4 +1,26 @@
1
1
  /** Native typed Decision API. Requires decisions permission and decisions-v1 host capability. */
2
+ /**
3
+ * An image in `DecisionEvaluationInput.assets`. Requires the decision-images-v1 host capability and a TypeSafe connection.
4
+ * `image_id` sends a stored Lumiverse image (PNG or JPEG) without moving its bytes through the worker; it requires the images permission.
5
+ */
6
+ export type DecisionImageAsset = {
7
+ type?: "image";
8
+ format: "png" | "jpg" | "jpeg";
9
+ data_base64: string;
10
+ } | {
11
+ type?: "image";
12
+ image_id: string;
13
+ };
14
+ /**
15
+ * The edges in a `box` answer. A `box` question finds one target in an image; it needs an image asset and a Jev 1.14 model such as `jev-preview`.
16
+ * Edges are fractions of the image's width (left, right) and height (top, bottom), measured from the top-left corner.
17
+ */
18
+ export interface DecisionBox {
19
+ top: number;
20
+ bottom: number;
21
+ left: number;
22
+ right: number;
23
+ }
2
24
  export type DecisionJsonValue = null | boolean | number | string | DecisionJsonValue[] | {
3
25
  [key: string]: DecisionJsonValue;
4
26
  };
@@ -21,6 +43,9 @@ export type DecisionQuestion = {
21
43
  true: DecisionDescription;
22
44
  false: DecisionDescription;
23
45
  };
46
+ } | {
47
+ type: "box";
48
+ instructions: DecisionDescription;
24
49
  };
25
50
  export type DecisionAnswer = {
26
51
  type: "choice";
@@ -36,6 +61,10 @@ export type DecisionAnswer = {
36
61
  } | {
37
62
  type: "noul";
38
63
  noul: number;
64
+ } | {
65
+ type: "box";
66
+ box: DecisionBox;
67
+ confidence: number;
39
68
  };
40
69
  export type DecisionAnswerFor<Q extends DecisionQuestion> = Q extends {
41
70
  type: "choice";
@@ -49,6 +78,10 @@ export type DecisionAnswerFor<Q extends DecisionQuestion> = Q extends {
49
78
  type: "score";
50
79
  } ? Extract<DecisionAnswer, {
51
80
  type: "score";
81
+ }> : Q extends {
82
+ type: "box";
83
+ } ? Extract<DecisionAnswer, {
84
+ type: "box";
52
85
  }> : Extract<DecisionAnswer, {
53
86
  type: "noul";
54
87
  }>;
@@ -72,6 +105,8 @@ export interface DecisionEvaluationInput<Q extends Record<string, DecisionQuesti
72
105
  model?: string;
73
106
  state: DecisionState;
74
107
  questions: Q;
108
+ /** Images keyed by a reference string; every reference must appear in `state`, `instructions`, or `criteria`. */
109
+ assets?: Record<string, DecisionImageAsset>;
75
110
  userId?: string;
76
111
  }
77
112
  export interface DecisionConnectionProfileDTO {
package/dist/dom.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import type { SpindleSTTAPI } from "./speech-to-text.js";
2
2
  import type { SpindleSystemAudioAPI } from "./system-audio.js";
3
+ import type { SpindleClientAPI } from "./client.js";
3
4
  import type { SpindleFileDownloadAPI } from "./file-transfers.js";
4
5
  import type { ChatDTO, ChatMessageDTO, ChatUpdateDTO, ConnectionProfileDTO, LlmMessageDTO, PromptBlockDTO, PromptVariableValuesDTO, RequestInitDTO, TokenCountOptionsDTO, TokenCountResultDTO, WorldBookCreateDTO, WorldBookDTO, WorldBookEntryCreateDTO, WorldBookEntryDTO, WorldBookEntryUpdateDTO, WorldBookUpdateDTO } from "./api.js";
5
6
  import type { SpindleComponentsHelper } from "./components.js";
@@ -1044,6 +1045,8 @@ export interface SpindleRecentChatsPage<TRow = SpindleRecentChat> {
1044
1045
  }
1045
1046
  /** Context object provided to frontend extension modules */
1046
1047
  export interface SpindleFrontendContext {
1048
+ /** Current frontend client identity and native bridge discovery. Feature-detect client-info-v1. */
1049
+ readonly client?: SpindleClientAPI;
1047
1050
  /** Native downloads of completed backend files. Available with file-transfers-v1. */
1048
1051
  readonly files: SpindleFileDownloadAPI;
1049
1052
  /** Host-managed STT. Feature-detect speech-to-text-v1; unavailable on older hosts. */
package/dist/host.js CHANGED
@@ -12,6 +12,7 @@ export const SPINDLE_HOST_CAPABILITIES = Object.freeze({
12
12
  "frontend-runtime-capabilities-v1": 1,
13
13
  "mcp-servers-v1": 1,
14
14
  "decisions-v1": 1,
15
+ "decision-images-v1": 1,
15
16
  "file-transfers-v1": 1,
16
17
  });
17
18
  /** Structured error code returned when host compatibility validation fails. */
package/dist/index.d.ts CHANGED
@@ -1,7 +1,9 @@
1
- export type { DecisionJsonValue, DecisionDescription, DecisionState, DecisionQuestion, DecisionAnswer, DecisionAnswerFor, DecisionAnswers, DecisionResult, DecisionEvaluationInput, DecisionConnectionProfileDTO, DecisionModelDTO, DecisionProviderDTO, SpindleDecisionsAPI, DecisionWorkerMessage } from "./decisions.js";
1
+ export type { DecisionImageAsset, DecisionBox, DecisionJsonValue, DecisionDescription, DecisionState, DecisionQuestion, DecisionAnswer, DecisionAnswerFor, DecisionAnswers, DecisionResult, DecisionEvaluationInput, DecisionConnectionProfileDTO, DecisionModelDTO, DecisionProviderDTO, SpindleDecisionsAPI, DecisionWorkerMessage } from "./decisions.js";
2
2
  export type { SpindleManifest, SpindlePermission, SpindleCapability, } from "./manifest.js";
3
3
  export { IDENTIFIER_PATTERN, validateIdentifier, } from "./manifest.js";
4
4
  export type { LumiverseVersionInfo, SpindleHostDescriptorV1, SpindleHostLocale, SpindleHostLocaleAPI, } from "./host.js";
5
+ export type { SpindleClientKind, SpindleClientPlatform, SpindleClientInfo, SpindleClientAPI } from "./client.js";
6
+ export { SPINDLE_CLIENT_HOST_CAPABILITIES } from "./client.js";
5
7
  export type { SpindleFileRef, SpindleFileSource, FileOperationOptions, FileFetchOptions, SpindleFileCreateInput, SpindleFileChunk, SpindleArchiveEntry, ArchiveCreateOptions, ArchiveExtractOptions, SpindleArchiveExtractedEntry, SpindleFilesAPI, SpindleArchivesAPI, SpindleFileDownloadAPI, FileTransferWorkerMessage, } from "./file-transfers.js";
6
8
  export { SPINDLE_FILE_CHUNK_BYTES, SPINDLE_FILE_MAX_BYTES, SPINDLE_FILE_DEFAULT_MAX_BYTES, SPINDLE_FILE_TTL_MS, SPINDLE_FILE_MAX_COUNT, } from "./file-transfers.js";
7
9
  export { SPINDLE_HOST_CAPABILITIES, SPINDLE_COMPATIBILITY_ERROR_CODE, } from "./host.js";
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  export { IDENTIFIER_PATTERN, validateIdentifier, } from "./manifest.js";
2
+ export { SPINDLE_CLIENT_HOST_CAPABILITIES } from "./client.js";
2
3
  export { SPINDLE_FILE_CHUNK_BYTES, SPINDLE_FILE_MAX_BYTES, SPINDLE_FILE_DEFAULT_MAX_BYTES, SPINDLE_FILE_TTL_MS, SPINDLE_FILE_MAX_COUNT, } from "./file-transfers.js";
3
4
  export { SPINDLE_HOST_CAPABILITIES, SPINDLE_COMPATIBILITY_ERROR_CODE, } from "./host.js";
4
5
  export { SPINDLE_THEME_AUTHORING_HOST_CAPABILITIES } from "./theme.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lumiverse-spindle-types",
3
- "version": "0.6.49",
3
+ "version": "0.6.51",
4
4
  "type": "module",
5
5
  "types": "./dist/index.d.ts",
6
6
  "keywords": [