@stina/extension-api 0.22.0 → 0.23.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.
- package/dist/{chunk-U3PEHSBG.js → chunk-DGUM43GV.js} +2 -8
- package/dist/chunk-DGUM43GV.js.map +1 -0
- package/dist/chunk-PTPOHFA4.js +9 -0
- package/dist/{chunk-U3PEHSBG.js.map → chunk-PTPOHFA4.js.map} +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/runtime.cjs +134 -41
- package/dist/runtime.cjs.map +1 -1
- package/dist/runtime.d.cts +2 -2
- package/dist/runtime.d.ts +2 -2
- package/dist/runtime.js +138 -43
- package/dist/runtime.js.map +1 -1
- package/dist/schemas/index.cjs +711 -0
- package/dist/schemas/index.cjs.map +1 -0
- package/dist/schemas/index.d.cts +4707 -0
- package/dist/schemas/index.d.ts +4707 -0
- package/dist/schemas/index.js +615 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/{types.tools-BXGZf8zc.d.cts → types.tools-6o0mTWW-.d.cts} +311 -85
- package/dist/{types.tools-BXGZf8zc.d.ts → types.tools-6o0mTWW-.d.ts} +311 -85
- package/package.json +16 -4
- package/schema/extension-manifest.schema.json +993 -0
- package/scripts/generate-schema.ts +41 -0
- package/src/background.test.ts +33 -0
- package/src/background.ts +24 -0
- package/src/index.ts +8 -2
- package/src/messages.ts +31 -4
- package/src/runtime.ts +149 -43
- package/src/schemas/components.schema.ts +465 -0
- package/src/schemas/contributions.schema.ts +473 -0
- package/src/schemas/index.ts +162 -0
- package/src/schemas/manifest.schema.ts +71 -0
- package/src/schemas/permissions.schema.ts +141 -0
- package/src/types.context.ts +36 -93
- package/src/types.contributions.ts +9 -0
- package/src/types.permissions.ts +1 -1
- package/src/types.storage.ts +287 -0
- package/src/types.ts +10 -2
- package/tsup.config.ts +1 -1
|
@@ -379,6 +379,15 @@ interface ExtensionContributions {
|
|
|
379
379
|
commands?: CommandDefinition[];
|
|
380
380
|
/** Prompt contributions for the system prompt */
|
|
381
381
|
prompts?: PromptContribution[];
|
|
382
|
+
/** Storage collection declarations */
|
|
383
|
+
storage?: {
|
|
384
|
+
collections: {
|
|
385
|
+
[name: string]: {
|
|
386
|
+
/** Fields to index for fast queries */
|
|
387
|
+
indexes?: string[];
|
|
388
|
+
};
|
|
389
|
+
};
|
|
390
|
+
};
|
|
382
391
|
}
|
|
383
392
|
/**
|
|
384
393
|
* Setting definition for the UI
|
|
@@ -819,6 +828,277 @@ type StreamEvent = {
|
|
|
819
828
|
message: string;
|
|
820
829
|
};
|
|
821
830
|
|
|
831
|
+
/**
|
|
832
|
+
* Storage Types
|
|
833
|
+
*
|
|
834
|
+
* Types for the new collection-based document storage API.
|
|
835
|
+
* Provides a MongoDB-inspired but simplified query syntax for extensions.
|
|
836
|
+
*/
|
|
837
|
+
/**
|
|
838
|
+
* Query syntax for filtering documents in a collection.
|
|
839
|
+
* Supports exact matching and comparison operators.
|
|
840
|
+
*
|
|
841
|
+
* @example
|
|
842
|
+
* // Exact match
|
|
843
|
+
* { status: "active" }
|
|
844
|
+
*
|
|
845
|
+
* @example
|
|
846
|
+
* // Comparison operators
|
|
847
|
+
* { age: { $gt: 18 }, status: { $in: ["active", "pending"] } }
|
|
848
|
+
*
|
|
849
|
+
* @example
|
|
850
|
+
* // String contains (case-insensitive)
|
|
851
|
+
* { name: { $contains: "john" } }
|
|
852
|
+
*/
|
|
853
|
+
interface Query {
|
|
854
|
+
[field: string]: unknown | {
|
|
855
|
+
$gt?: unknown;
|
|
856
|
+
} | {
|
|
857
|
+
$gte?: unknown;
|
|
858
|
+
} | {
|
|
859
|
+
$lt?: unknown;
|
|
860
|
+
} | {
|
|
861
|
+
$lte?: unknown;
|
|
862
|
+
} | {
|
|
863
|
+
$ne?: unknown;
|
|
864
|
+
} | {
|
|
865
|
+
$in?: unknown[];
|
|
866
|
+
} | {
|
|
867
|
+
$contains?: string;
|
|
868
|
+
};
|
|
869
|
+
}
|
|
870
|
+
/**
|
|
871
|
+
* Optional modifiers for query operations.
|
|
872
|
+
* Allows sorting, pagination, and limiting results.
|
|
873
|
+
*/
|
|
874
|
+
interface QueryOptions {
|
|
875
|
+
/**
|
|
876
|
+
* Sort results by one or more fields.
|
|
877
|
+
* @example { createdAt: 'desc', name: 'asc' }
|
|
878
|
+
*/
|
|
879
|
+
sort?: {
|
|
880
|
+
[field: string]: 'asc' | 'desc';
|
|
881
|
+
};
|
|
882
|
+
/**
|
|
883
|
+
* Maximum number of documents to return.
|
|
884
|
+
*/
|
|
885
|
+
limit?: number;
|
|
886
|
+
/**
|
|
887
|
+
* Number of documents to skip (for pagination).
|
|
888
|
+
*/
|
|
889
|
+
offset?: number;
|
|
890
|
+
}
|
|
891
|
+
/**
|
|
892
|
+
* Storage API for extension-scoped document storage.
|
|
893
|
+
* All operations are automatically scoped to the calling extension.
|
|
894
|
+
* Data is stored as JSON documents in collections.
|
|
895
|
+
*/
|
|
896
|
+
interface StorageAPI {
|
|
897
|
+
/**
|
|
898
|
+
* Store a document in a collection.
|
|
899
|
+
* Creates the document if it doesn't exist, or replaces it if it does.
|
|
900
|
+
*
|
|
901
|
+
* @param collection - The name of the collection
|
|
902
|
+
* @param id - Unique identifier for the document within the collection
|
|
903
|
+
* @param data - The document data to store
|
|
904
|
+
*
|
|
905
|
+
* @example
|
|
906
|
+
* await storage.put('users', 'user-123', { name: 'John', age: 30 })
|
|
907
|
+
*/
|
|
908
|
+
put<T extends object>(collection: string, id: string, data: T): Promise<void>;
|
|
909
|
+
/**
|
|
910
|
+
* Retrieve a document from a collection by its ID.
|
|
911
|
+
*
|
|
912
|
+
* @param collection - The name of the collection
|
|
913
|
+
* @param id - The document ID to retrieve
|
|
914
|
+
* @returns The document data, or undefined if not found
|
|
915
|
+
*
|
|
916
|
+
* @example
|
|
917
|
+
* const user = await storage.get<User>('users', 'user-123')
|
|
918
|
+
*/
|
|
919
|
+
get<T>(collection: string, id: string): Promise<T | undefined>;
|
|
920
|
+
/**
|
|
921
|
+
* Delete a document from a collection.
|
|
922
|
+
*
|
|
923
|
+
* @param collection - The name of the collection
|
|
924
|
+
* @param id - The document ID to delete
|
|
925
|
+
* @returns True if the document was deleted, false if it didn't exist
|
|
926
|
+
*
|
|
927
|
+
* @example
|
|
928
|
+
* const wasDeleted = await storage.delete('users', 'user-123')
|
|
929
|
+
*/
|
|
930
|
+
delete(collection: string, id: string): Promise<boolean>;
|
|
931
|
+
/**
|
|
932
|
+
* Find documents matching a query.
|
|
933
|
+
*
|
|
934
|
+
* @param collection - The name of the collection
|
|
935
|
+
* @param query - Optional query to filter documents
|
|
936
|
+
* @param options - Optional query modifiers (sort, limit, offset)
|
|
937
|
+
* @returns Array of matching documents
|
|
938
|
+
*
|
|
939
|
+
* @example
|
|
940
|
+
* // Find all active users, sorted by name
|
|
941
|
+
* const users = await storage.find<User>('users',
|
|
942
|
+
* { status: 'active' },
|
|
943
|
+
* { sort: { name: 'asc' }, limit: 10 }
|
|
944
|
+
* )
|
|
945
|
+
*/
|
|
946
|
+
find<T>(collection: string, query?: Query, options?: QueryOptions): Promise<T[]>;
|
|
947
|
+
/**
|
|
948
|
+
* Find a single document matching a query.
|
|
949
|
+
* Returns the first match if multiple documents match.
|
|
950
|
+
*
|
|
951
|
+
* @param collection - The name of the collection
|
|
952
|
+
* @param query - Query to filter documents
|
|
953
|
+
* @returns The first matching document, or undefined if none found
|
|
954
|
+
*
|
|
955
|
+
* @example
|
|
956
|
+
* const user = await storage.findOne<User>('users', { email: 'john@example.com' })
|
|
957
|
+
*/
|
|
958
|
+
findOne<T>(collection: string, query: Query): Promise<T | undefined>;
|
|
959
|
+
/**
|
|
960
|
+
* Count documents matching a query.
|
|
961
|
+
*
|
|
962
|
+
* @param collection - The name of the collection
|
|
963
|
+
* @param query - Optional query to filter documents
|
|
964
|
+
* @returns The number of matching documents
|
|
965
|
+
*
|
|
966
|
+
* @example
|
|
967
|
+
* const activeCount = await storage.count('users', { status: 'active' })
|
|
968
|
+
*/
|
|
969
|
+
count(collection: string, query?: Query): Promise<number>;
|
|
970
|
+
/**
|
|
971
|
+
* Store multiple documents in a collection in a single operation.
|
|
972
|
+
* More efficient than multiple individual put calls.
|
|
973
|
+
*
|
|
974
|
+
* @param collection - The name of the collection
|
|
975
|
+
* @param docs - Array of documents with their IDs
|
|
976
|
+
*
|
|
977
|
+
* @example
|
|
978
|
+
* await storage.putMany('users', [
|
|
979
|
+
* { id: 'user-1', data: { name: 'John' } },
|
|
980
|
+
* { id: 'user-2', data: { name: 'Jane' } }
|
|
981
|
+
* ])
|
|
982
|
+
*/
|
|
983
|
+
putMany<T extends object>(collection: string, docs: Array<{
|
|
984
|
+
id: string;
|
|
985
|
+
data: T;
|
|
986
|
+
}>): Promise<void>;
|
|
987
|
+
/**
|
|
988
|
+
* Delete multiple documents matching a query.
|
|
989
|
+
*
|
|
990
|
+
* @param collection - The name of the collection
|
|
991
|
+
* @param query - Query to match documents for deletion
|
|
992
|
+
* @returns The number of documents deleted
|
|
993
|
+
*
|
|
994
|
+
* @example
|
|
995
|
+
* const deleted = await storage.deleteMany('users', { status: 'inactive' })
|
|
996
|
+
*/
|
|
997
|
+
deleteMany(collection: string, query: Query): Promise<number>;
|
|
998
|
+
/**
|
|
999
|
+
* Drop an entire collection, deleting all its documents.
|
|
1000
|
+
* Use with caution - this operation cannot be undone.
|
|
1001
|
+
*
|
|
1002
|
+
* @param collection - The name of the collection to drop
|
|
1003
|
+
*
|
|
1004
|
+
* @example
|
|
1005
|
+
* await storage.dropCollection('temp-data')
|
|
1006
|
+
*/
|
|
1007
|
+
dropCollection(collection: string): Promise<void>;
|
|
1008
|
+
/**
|
|
1009
|
+
* List all collections owned by this extension.
|
|
1010
|
+
*
|
|
1011
|
+
* @returns Array of collection names
|
|
1012
|
+
*
|
|
1013
|
+
* @example
|
|
1014
|
+
* const collections = await storage.listCollections()
|
|
1015
|
+
* // ['users', 'settings', 'cache']
|
|
1016
|
+
*/
|
|
1017
|
+
listCollections(): Promise<string[]>;
|
|
1018
|
+
}
|
|
1019
|
+
/**
|
|
1020
|
+
* Secrets API for secure storage of sensitive values.
|
|
1021
|
+
* All operations are automatically scoped to the calling extension.
|
|
1022
|
+
* Values are encrypted at rest.
|
|
1023
|
+
*/
|
|
1024
|
+
interface SecretsAPI {
|
|
1025
|
+
/**
|
|
1026
|
+
* Store a secret value.
|
|
1027
|
+
* Creates the secret if it doesn't exist, or replaces it if it does.
|
|
1028
|
+
*
|
|
1029
|
+
* @param key - Unique key for the secret
|
|
1030
|
+
* @param value - The secret value to store
|
|
1031
|
+
*
|
|
1032
|
+
* @example
|
|
1033
|
+
* await secrets.set('api-key', 'sk-1234567890')
|
|
1034
|
+
*/
|
|
1035
|
+
set(key: string, value: string): Promise<void>;
|
|
1036
|
+
/**
|
|
1037
|
+
* Retrieve a secret value.
|
|
1038
|
+
*
|
|
1039
|
+
* @param key - The secret key to retrieve
|
|
1040
|
+
* @returns The secret value, or undefined if not found
|
|
1041
|
+
*
|
|
1042
|
+
* @example
|
|
1043
|
+
* const apiKey = await secrets.get('api-key')
|
|
1044
|
+
*/
|
|
1045
|
+
get(key: string): Promise<string | undefined>;
|
|
1046
|
+
/**
|
|
1047
|
+
* Delete a secret.
|
|
1048
|
+
*
|
|
1049
|
+
* @param key - The secret key to delete
|
|
1050
|
+
* @returns True if the secret was deleted, false if it didn't exist
|
|
1051
|
+
*
|
|
1052
|
+
* @example
|
|
1053
|
+
* const wasDeleted = await secrets.delete('api-key')
|
|
1054
|
+
*/
|
|
1055
|
+
delete(key: string): Promise<boolean>;
|
|
1056
|
+
/**
|
|
1057
|
+
* List all secret keys owned by this extension.
|
|
1058
|
+
* Only returns the keys, not the secret values.
|
|
1059
|
+
*
|
|
1060
|
+
* @returns Array of secret keys
|
|
1061
|
+
*
|
|
1062
|
+
* @example
|
|
1063
|
+
* const keys = await secrets.list()
|
|
1064
|
+
* // ['api-key', 'webhook-secret']
|
|
1065
|
+
*/
|
|
1066
|
+
list(): Promise<string[]>;
|
|
1067
|
+
}
|
|
1068
|
+
/**
|
|
1069
|
+
* Configuration for a storage collection in the extension manifest.
|
|
1070
|
+
* Allows extensions to declare collections and their indexing requirements.
|
|
1071
|
+
*/
|
|
1072
|
+
interface StorageCollectionConfig {
|
|
1073
|
+
/**
|
|
1074
|
+
* Fields that should be indexed for fast queries.
|
|
1075
|
+
* Indexed fields allow efficient filtering and sorting.
|
|
1076
|
+
*
|
|
1077
|
+
* @example ['status', 'createdAt', 'userId']
|
|
1078
|
+
*/
|
|
1079
|
+
indexes?: string[];
|
|
1080
|
+
}
|
|
1081
|
+
/**
|
|
1082
|
+
* Storage contributions section in the extension manifest.
|
|
1083
|
+
* Declares the collections an extension will use.
|
|
1084
|
+
*
|
|
1085
|
+
* @example
|
|
1086
|
+
* {
|
|
1087
|
+
* collections: {
|
|
1088
|
+
* users: { indexes: ['email', 'status'] },
|
|
1089
|
+
* settings: {}
|
|
1090
|
+
* }
|
|
1091
|
+
* }
|
|
1092
|
+
*/
|
|
1093
|
+
interface StorageContributions {
|
|
1094
|
+
/**
|
|
1095
|
+
* Map of collection names to their configuration.
|
|
1096
|
+
*/
|
|
1097
|
+
collections: {
|
|
1098
|
+
[name: string]: StorageCollectionConfig;
|
|
1099
|
+
};
|
|
1100
|
+
}
|
|
1101
|
+
|
|
822
1102
|
/**
|
|
823
1103
|
* Extension Context Types
|
|
824
1104
|
*
|
|
@@ -845,15 +1125,29 @@ interface Disposable {
|
|
|
845
1125
|
* - Makes code easier to reason about and debug
|
|
846
1126
|
* - Allows scheduler jobs to create context for the correct user
|
|
847
1127
|
*
|
|
1128
|
+
* ## Storage and Secrets
|
|
1129
|
+
*
|
|
1130
|
+
* The context provides both extension-scoped and user-scoped storage:
|
|
1131
|
+
* - `storage`: Extension-wide document storage (shared across all users)
|
|
1132
|
+
* - `userStorage`: User-specific document storage (isolated per user)
|
|
1133
|
+
* - `secrets`: Extension-wide secrets (shared across all users)
|
|
1134
|
+
* - `userSecrets`: User-specific secrets (isolated per user)
|
|
1135
|
+
*
|
|
848
1136
|
* @example
|
|
849
1137
|
* ```typescript
|
|
850
1138
|
* // In a tool execute handler:
|
|
851
1139
|
* execute: async (params, context) => {
|
|
852
|
-
*
|
|
853
|
-
*
|
|
854
|
-
*
|
|
855
|
-
*
|
|
856
|
-
*
|
|
1140
|
+
* // Extension-wide storage (shared across all users)
|
|
1141
|
+
* const config = await context.storage.get<Config>('settings', 'global-config')
|
|
1142
|
+
*
|
|
1143
|
+
* // User-specific storage (isolated per user)
|
|
1144
|
+
* const prefs = await context.userStorage.get<Preferences>('preferences', 'theme')
|
|
1145
|
+
* await context.userStorage.put('preferences', 'theme', { mode: 'dark' })
|
|
1146
|
+
*
|
|
1147
|
+
* // Secrets access
|
|
1148
|
+
* const apiKey = await context.secrets.get('api-key')
|
|
1149
|
+
* const userToken = await context.userSecrets.get('oauth-token')
|
|
1150
|
+
*
|
|
857
1151
|
* console.log(`Running in extension ${context.extension.id}`)
|
|
858
1152
|
* }
|
|
859
1153
|
* ```
|
|
@@ -871,6 +1165,14 @@ interface ExecutionContext {
|
|
|
871
1165
|
readonly version: string;
|
|
872
1166
|
readonly storagePath: string;
|
|
873
1167
|
};
|
|
1168
|
+
/** Extension-scoped storage (same for all users) */
|
|
1169
|
+
readonly storage: StorageAPI;
|
|
1170
|
+
/** User-scoped storage (isolated per user) */
|
|
1171
|
+
readonly userStorage: StorageAPI;
|
|
1172
|
+
/** Extension-scoped secrets */
|
|
1173
|
+
readonly secrets: SecretsAPI;
|
|
1174
|
+
/** User-scoped secrets */
|
|
1175
|
+
readonly userSecrets: SecretsAPI;
|
|
874
1176
|
}
|
|
875
1177
|
/**
|
|
876
1178
|
* Context provided to extension's activate function.
|
|
@@ -903,10 +1205,10 @@ interface ExtensionContext {
|
|
|
903
1205
|
readonly user?: UserAPI;
|
|
904
1206
|
/** Chat access (if permitted) */
|
|
905
1207
|
readonly chat?: ChatAPI;
|
|
906
|
-
/**
|
|
907
|
-
readonly database?: DatabaseAPI;
|
|
908
|
-
/** Local storage (if permitted) */
|
|
1208
|
+
/** Collection-based document storage (if permitted) */
|
|
909
1209
|
readonly storage?: StorageAPI;
|
|
1210
|
+
/** Secure secrets storage (if permitted) */
|
|
1211
|
+
readonly secrets?: SecretsAPI;
|
|
910
1212
|
/** Background workers (if permitted) */
|
|
911
1213
|
readonly backgroundWorkers?: BackgroundWorkersAPI;
|
|
912
1214
|
/** Logging (always available) */
|
|
@@ -1081,82 +1383,6 @@ interface ChatInstructionMessage {
|
|
|
1081
1383
|
interface ChatAPI {
|
|
1082
1384
|
appendInstruction(message: ChatInstructionMessage): Promise<void>;
|
|
1083
1385
|
}
|
|
1084
|
-
/**
|
|
1085
|
-
* Database API for extension-specific tables
|
|
1086
|
-
*/
|
|
1087
|
-
interface DatabaseAPI {
|
|
1088
|
-
/**
|
|
1089
|
-
* Execute a SQL query (only extension's prefixed tables allowed)
|
|
1090
|
-
*/
|
|
1091
|
-
execute<T = unknown>(sql: string, params?: unknown[]): Promise<T[]>;
|
|
1092
|
-
}
|
|
1093
|
-
/**
|
|
1094
|
-
* Simple key-value storage API with support for user-scoped storage.
|
|
1095
|
-
*
|
|
1096
|
-
* ## Global vs User-Scoped Storage
|
|
1097
|
-
*
|
|
1098
|
-
* Extensions have access to two types of storage:
|
|
1099
|
-
* - **Global storage**: Shared across all users, accessed via `get()`, `set()`, etc.
|
|
1100
|
-
* - **User-scoped storage**: Isolated per user, accessed via `getForUser()`, `setForUser()`, etc.
|
|
1101
|
-
*
|
|
1102
|
-
* Use global storage for extension-wide settings and user-scoped storage for
|
|
1103
|
-
* user preferences, session data, or any data that should be private to a user.
|
|
1104
|
-
*
|
|
1105
|
-
* @example
|
|
1106
|
-
* ```typescript
|
|
1107
|
-
* // Global storage (extension-wide)
|
|
1108
|
-
* await storage.set('apiEndpoint', 'https://api.example.com')
|
|
1109
|
-
* const endpoint = await storage.get<string>('apiEndpoint')
|
|
1110
|
-
*
|
|
1111
|
-
* // User-scoped storage (per-user)
|
|
1112
|
-
* if (context.userId) {
|
|
1113
|
-
* await storage.setForUser(context.userId, 'preferences', { theme: 'dark' })
|
|
1114
|
-
* const prefs = await storage.getForUser<Preferences>(context.userId, 'preferences')
|
|
1115
|
-
* }
|
|
1116
|
-
* ```
|
|
1117
|
-
*/
|
|
1118
|
-
interface StorageAPI {
|
|
1119
|
-
/**
|
|
1120
|
-
* Get a value by key (global/extension-scoped)
|
|
1121
|
-
*/
|
|
1122
|
-
get<T>(key: string): Promise<T | undefined>;
|
|
1123
|
-
/**
|
|
1124
|
-
* Set a value (global/extension-scoped)
|
|
1125
|
-
*/
|
|
1126
|
-
set(key: string, value: unknown): Promise<void>;
|
|
1127
|
-
/**
|
|
1128
|
-
* Delete a key (global/extension-scoped)
|
|
1129
|
-
*/
|
|
1130
|
-
delete(key: string): Promise<void>;
|
|
1131
|
-
/**
|
|
1132
|
-
* Get all keys (global/extension-scoped)
|
|
1133
|
-
*/
|
|
1134
|
-
keys(): Promise<string[]>;
|
|
1135
|
-
/**
|
|
1136
|
-
* Get a value by key for a specific user (user-scoped)
|
|
1137
|
-
* @param userId The user ID
|
|
1138
|
-
* @param key The storage key
|
|
1139
|
-
*/
|
|
1140
|
-
getForUser<T>(userId: string, key: string): Promise<T | undefined>;
|
|
1141
|
-
/**
|
|
1142
|
-
* Set a value for a specific user (user-scoped)
|
|
1143
|
-
* @param userId The user ID
|
|
1144
|
-
* @param key The storage key
|
|
1145
|
-
* @param value The value to store
|
|
1146
|
-
*/
|
|
1147
|
-
setForUser(userId: string, key: string, value: unknown): Promise<void>;
|
|
1148
|
-
/**
|
|
1149
|
-
* Delete a key for a specific user (user-scoped)
|
|
1150
|
-
* @param userId The user ID
|
|
1151
|
-
* @param key The storage key
|
|
1152
|
-
*/
|
|
1153
|
-
deleteForUser(userId: string, key: string): Promise<void>;
|
|
1154
|
-
/**
|
|
1155
|
-
* Get all keys for a specific user (user-scoped)
|
|
1156
|
-
* @param userId The user ID
|
|
1157
|
-
*/
|
|
1158
|
-
keysForUser(userId: string): Promise<string[]>;
|
|
1159
|
-
}
|
|
1160
1386
|
/**
|
|
1161
1387
|
* Logging API
|
|
1162
1388
|
*/
|
|
@@ -1429,4 +1655,4 @@ interface ActionResult {
|
|
|
1429
1655
|
error?: string;
|
|
1430
1656
|
}
|
|
1431
1657
|
|
|
1432
|
-
export { type
|
|
1658
|
+
export { type BackgroundTaskCallback as $, type ActionResult as A, type ExtensionContext as B, type ChatMessage as C, type Disposable as D, type ExtensionContributions as E, type SettingsAPI as F, type GetModelsOptions as G, type ProvidersAPI as H, type ToolsAPI as I, type ActionsAPI as J, type EventsAPI as K, type LocalizedString as L, type ModelInfo as M, type NetworkAPI as N, type SchedulerAPI as O, type PanelDefinition as P, type SchedulerJobRequest as Q, type SchedulerSchedule as R, type SchedulerFirePayload as S, type ToolResult as T, type UserAPI as U, type UserProfile as V, type ChatAPI as W, type ChatInstructionMessage as X, type LogAPI as Y, type BackgroundWorkersAPI as Z, type BackgroundTaskConfig as _, type ChatOptions as a, type BackgroundTaskContext as a0, type BackgroundTaskHealth as a1, type BackgroundRestartPolicy as a2, type Query as a3, type QueryOptions as a4, type StorageAPI as a5, type SecretsAPI as a6, type StorageCollectionConfig as a7, type StorageContributions as a8, type AIProvider as a9, type IconButtonProps as aA, type PanelAction as aB, type PanelProps as aC, type ToggleProps as aD, type CollapsibleProps as aE, type PillVariant as aF, type PillProps as aG, type CheckboxProps as aH, type MarkdownProps as aI, type ModalProps as aJ, type ConditionalGroupProps as aK, type ExecutionContext as aL, type ToolCall as aa, type Tool as ab, type Action as ac, type ExtensionModule as ad, type AllowedCSSProperty as ae, type ExtensionComponentStyle as af, type ExtensionComponentData as ag, type ExtensionComponentIterator as ah, type ExtensionComponentChildren as ai, type ExtensionActionCall as aj, type ExtensionActionRef as ak, type ExtensionDataSource as al, type ExtensionPanelDefinition as am, type HeaderProps as an, type LabelProps as ao, type ParagraphProps as ap, type ButtonProps as aq, type TextInputProps as ar, type DateTimeInputProps as as, type SelectProps as at, type VerticalStackProps as au, type HorizontalStackProps as av, type GridProps as aw, type DividerProps as ax, type IconProps as ay, type IconButtonType as az, type StreamEvent as b, type SettingDefinition as c, type SettingOptionsMapping as d, type SettingCreateMapping as e, type ToolSettingsViewDefinition as f, type ToolSettingsView as g, type ToolSettingsListView as h, type ToolSettingsListMapping as i, type ToolSettingsComponentView as j, type ToolSettingsActionDataSource as k, type PanelView as l, type PanelComponentView as m, type PanelActionDataSource as n, type PanelUnknownView as o, type ProviderDefinition as p, type PromptContribution as q, resolveLocalizedString as r, type PromptSection as s, type ToolDefinition as t, type CommandDefinition as u, type ProviderConfigSchema as v, type ProviderConfigProperty as w, type ProviderConfigPropertyType as x, type ProviderConfigSelectOption as y, type ProviderConfigValidation as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stina/extension-api",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -19,18 +19,30 @@
|
|
|
19
19
|
"types": "./dist/runtime.d.ts",
|
|
20
20
|
"import": "./dist/runtime.js",
|
|
21
21
|
"require": "./dist/runtime.cjs"
|
|
22
|
-
}
|
|
22
|
+
},
|
|
23
|
+
"./schemas": {
|
|
24
|
+
"types": "./dist/schemas/index.d.ts",
|
|
25
|
+
"import": "./dist/schemas/index.js",
|
|
26
|
+
"require": "./dist/schemas/index.cjs"
|
|
27
|
+
},
|
|
28
|
+
"./schema.json": "./schema/extension-manifest.schema.json"
|
|
23
29
|
},
|
|
24
30
|
"publishConfig": {
|
|
25
31
|
"access": "public"
|
|
26
32
|
},
|
|
27
33
|
"scripts": {
|
|
28
|
-
"build": "tsup",
|
|
34
|
+
"build": "tsup && pnpm build:schema",
|
|
35
|
+
"build:schema": "tsx scripts/generate-schema.ts",
|
|
29
36
|
"dev": "tsup --watch",
|
|
30
37
|
"typecheck": "tsc --noEmit"
|
|
31
38
|
},
|
|
32
39
|
"devDependencies": {
|
|
33
40
|
"tsup": "^8.0.0",
|
|
34
|
-
"
|
|
41
|
+
"tsx": "^4.21.0",
|
|
42
|
+
"typescript": "^5.3.0",
|
|
43
|
+
"zod-to-json-schema": "^3.25.1"
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"zod": "^3.25.76"
|
|
35
47
|
}
|
|
36
48
|
}
|