lucid-extension-sdk 0.0.228 → 0.0.230

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/commandtypes.d.ts CHANGED
@@ -1103,10 +1103,19 @@ export type GetItemsAtQuery = {
1103
1103
  /** IDs of the items found */
1104
1104
  export type GetItemsAtResult = string[];
1105
1105
  export declare enum GetLLMContextType {
1106
- /** Get context in a format for LLMs where relationships among connected and contained items is preserved */
1106
+ /** Get context in a format for LLMs where relationships among connected and
1107
+ * contained items are preserved. Expand the scope of the selection to
1108
+ * include blocks contained by the selection as well as lines connecting
1109
+ * items in the selection. */
1107
1110
  Relational = 1,
1108
1111
  /** Get context containing only plain text displayed on the given items, more suitable for embeddings */
1109
- PlainText = 2
1112
+ PlainText = 2,
1113
+ /** Get context in a format for LLMs where relationships among connected and
1114
+ * contained items are preserved. Do not expand the scope of the selection,
1115
+ * other than to ensure relationships are represented. Text on selected
1116
+ * items will be included, but text on automatically added items will not.
1117
+ * */
1118
+ RelationalWithoutExpansion = 3
1110
1119
  }
1111
1120
  export type GetLLMContextFromItemsQuery = {
1112
1121
  /** Page ID to find closely-related items */
package/commandtypes.js CHANGED
@@ -137,10 +137,19 @@ var GetItemsAtSearchType;
137
137
  })(GetItemsAtSearchType || (exports.GetItemsAtSearchType = GetItemsAtSearchType = {}));
138
138
  var GetLLMContextType;
139
139
  (function (GetLLMContextType) {
140
- /** Get context in a format for LLMs where relationships among connected and contained items is preserved */
140
+ /** Get context in a format for LLMs where relationships among connected and
141
+ * contained items are preserved. Expand the scope of the selection to
142
+ * include blocks contained by the selection as well as lines connecting
143
+ * items in the selection. */
141
144
  GetLLMContextType[GetLLMContextType["Relational"] = 1] = "Relational";
142
145
  /** Get context containing only plain text displayed on the given items, more suitable for embeddings */
143
146
  GetLLMContextType[GetLLMContextType["PlainText"] = 2] = "PlainText";
147
+ /** Get context in a format for LLMs where relationships among connected and
148
+ * contained items are preserved. Do not expand the scope of the selection,
149
+ * other than to ensure relationships are represented. Text on selected
150
+ * items will be included, but text on automatically added items will not.
151
+ * */
152
+ GetLLMContextType[GetLLMContextType["RelationalWithoutExpansion"] = 3] = "RelationalWithoutExpansion";
144
153
  })(GetLLMContextType || (exports.GetLLMContextType = GetLLMContextType = {}));
145
154
  function isRawSendXHRResponse(val) {
146
155
  return (0, checks_1.isString)(val['url']) && (0, checks_1.isString)(val['t']) && (0, checks_1.isNumber)(val['s']) && (0, checks_1.isObject)(val['h']);
package/core/checks.d.ts CHANGED
@@ -134,7 +134,7 @@ export declare function isEmptyOrNullishObject(val: unknown): val is {};
134
134
  export declare function isAny(val: unknown): val is any;
135
135
  export declare function isUnknown(val: unknown): val is unknown;
136
136
  export declare function isPromise(val: unknown): val is Promise<unknown>;
137
- export declare function isLiteral<T extends string | number | symbol | true | false>(t: T): (x: unknown) => x is T;
137
+ export declare function isLiteral<T extends string | number | symbol | boolean>(t: T): (x: unknown) => x is T;
138
138
  type AbstractConstructor<T> = Function & {
139
139
  prototype: T;
140
140
  };
@@ -24,7 +24,7 @@ function serializeBaseFieldTypeDefinition(baseFieldType) {
24
24
  baseFieldType instanceof fieldtypearray_1.FieldTypeArray ||
25
25
  baseFieldType instanceof ndimensionalfieldtypearray_1.NDimensionalFieldTypeArray ||
26
26
  baseFieldType instanceof collectionenumfieldtype_1.CollectionEnumFieldType) {
27
- return baseFieldType.serialize();
27
+ return baseFieldType.toJSON();
28
28
  }
29
29
  return baseFieldType;
30
30
  }
@@ -22,7 +22,7 @@ export declare class CollectionEnumFieldType {
22
22
  */
23
23
  static readonly PRIMARY_KEY = CollectionEnumFieldNames.Id;
24
24
  constructor(collectionId: string);
25
- serialize(): SerializedCollectionEnumFieldType;
25
+ toJSON(): SerializedCollectionEnumFieldType;
26
26
  }
27
27
  export declare const isCollectionEnumFieldType: (fieldType: FieldTypeDefinition) => fieldType is CollectionEnumFieldType;
28
28
  export type SerializedCollectionEnumFieldType = {
@@ -22,7 +22,7 @@ class CollectionEnumFieldType {
22
22
  constructor(collectionId) {
23
23
  this.collectionId = collectionId;
24
24
  }
25
- serialize() {
25
+ toJSON() {
26
26
  return { [exports.CollectionEnumFieldTypeKey]: this.collectionId };
27
27
  }
28
28
  }
@@ -7,7 +7,7 @@ export declare abstract class BaseFieldTypeArray<Type> {
7
7
  protected abstract serializeType(t: Type): SerializedFieldTypeArraySubTypes;
8
8
  getInnerTypes(): Type[];
9
9
  getInnerNonArrayTypes(): Exclude<Type, BaseFieldTypeArray<Type>>[];
10
- serialize(): SerializedFieldTypeArray;
10
+ toJSON(): SerializedFieldTypeArray;
11
11
  }
12
12
  export type FieldTypeArraySubTypes = ScalarFieldTypeEnum | CollectionEnumFieldType | LiteralFieldType | FieldTypeArray<any>;
13
13
  export type SerializedFieldTypeArraySubTypes = ScalarFieldTypeEnum | SerializedLiteralFieldType | SerializedFieldTypeArray | SerializedCollectionEnumFieldType;
@@ -15,7 +15,7 @@ class BaseFieldTypeArray {
15
15
  getInnerNonArrayTypes() {
16
16
  return this.validTypesArray.filter((innerType) => !(innerType instanceof BaseFieldTypeArray));
17
17
  }
18
- serialize() {
18
+ toJSON() {
19
19
  return {
20
20
  'ND': false,
21
21
  'validTypes': this.validTypesArray.map((t) => this.serializeType(t)),
@@ -25,7 +25,7 @@ class BaseFieldTypeArray {
25
25
  exports.BaseFieldTypeArray = BaseFieldTypeArray;
26
26
  class FieldTypeArray extends BaseFieldTypeArray {
27
27
  serializeType(t) {
28
- return (0, scalarfieldtype_1.isScalarFieldTypeEnum)(t) ? t : t.serialize();
28
+ return (0, scalarfieldtype_1.isScalarFieldTypeEnum)(t) ? t : t.toJSON();
29
29
  }
30
30
  }
31
31
  exports.FieldTypeArray = FieldTypeArray;
@@ -6,7 +6,7 @@ export declare class LiteralFieldType {
6
6
  constructor(literal: boolean | number | string);
7
7
  getLiteral(): string | number | boolean;
8
8
  getScalarFieldType(): ScalarFieldTypeEnum;
9
- serialize(): SerializedLiteralFieldType;
9
+ toJSON(): SerializedLiteralFieldType;
10
10
  }
11
11
  export declare function isLiteralFieldType(fieldType: any): fieldType is LiteralFieldType;
12
12
  export type SerializedLiteralFieldType = string;
@@ -25,7 +25,7 @@ class LiteralFieldType {
25
25
  getScalarFieldType() {
26
26
  return this.scalarFieldType;
27
27
  }
28
- serialize() {
28
+ toJSON() {
29
29
  if (this.scalarFieldType === scalarfieldtype_1.ScalarFieldTypeEnum.STRING) {
30
30
  return LiteralFieldType.literalStringPrefix + this.literal;
31
31
  }
@@ -5,7 +5,7 @@ export declare class NDimensionalFieldTypeArray {
5
5
  constructor(validTypesArray: (ScalarFieldTypeEnum | LiteralFieldType)[]);
6
6
  getInnerTypes(): (ScalarFieldTypeEnum | LiteralFieldType | this)[];
7
7
  getInnerNonArrayTypes(): (ScalarFieldTypeEnum | LiteralFieldType)[];
8
- serialize(): SerializedNDimensionalFieldTypeArray;
8
+ toJSON(): SerializedNDimensionalFieldTypeArray;
9
9
  }
10
10
  export declare function isValidTypeForNDimensionalFieldTypeArray(fieldType: any): fieldType is ScalarFieldTypeEnum | LiteralFieldType;
11
11
  export declare function isNDimensionalFieldTypeArray(fieldType: any): fieldType is NDimensionalFieldTypeArray;
@@ -14,10 +14,10 @@ class NDimensionalFieldTypeArray {
14
14
  getInnerNonArrayTypes() {
15
15
  return this.validTypesArray.filter((innerType) => (0, scalarfieldtype_1.isScalarFieldTypeEnum)(innerType) || (0, literalfieldtype_1.isLiteralFieldType)(innerType));
16
16
  }
17
- serialize() {
17
+ toJSON() {
18
18
  return {
19
19
  'ND': true,
20
- 'validTypes': this.validTypesArray.map((t) => ((0, scalarfieldtype_1.isScalarFieldTypeEnum)(t) ? t : t.serialize())),
20
+ 'validTypes': this.validTypesArray.map((t) => ((0, scalarfieldtype_1.isScalarFieldTypeEnum)(t) ? t : t.toJSON())),
21
21
  };
22
22
  }
23
23
  }
@@ -7,7 +7,7 @@ export interface JsonObject {
7
7
  * @ignore
8
8
  */
9
9
  export interface JsonObjectConvertible {
10
- toJsonObject(): JsonObject;
10
+ toJSON(): JsonSerializable;
11
11
  }
12
12
  /**
13
13
  * Any type that can be natively converted to a string with JSON.stringify.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lucid-extension-sdk",
3
- "version": "0.0.228",
3
+ "version": "0.0.230",
4
4
  "description": "Utility classes for writing Lucid Software editor extensions",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",