lumiverse-spindle-types 0.6.50 → 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.
@@ -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/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,4 +1,4 @@
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";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lumiverse-spindle-types",
3
- "version": "0.6.50",
3
+ "version": "0.6.51",
4
4
  "type": "module",
5
5
  "types": "./dist/index.d.ts",
6
6
  "keywords": [