@stacksjs/types 0.75.72 → 0.75.73
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/ai.d.ts +25 -24
- package/dist/auth.d.ts +1 -0
- package/dist/cli.d.ts +1 -1
- package/dist/cron-jobs.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/search-engine.d.ts +50 -2
- package/package.json +5 -5
package/dist/ai.d.ts
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Amazon Bedrock model ids Bedrock currently serves, each in the form it is
|
|
3
|
+
* invoked by.
|
|
4
|
+
*
|
|
5
|
+
* Claude and the newer Nova and Llama generations are served only through an
|
|
6
|
+
* inference profile, so they are listed by profile id (`global.` or `us.`);
|
|
7
|
+
* invoking the bare `anthropic.*` model id is refused. The on-demand ids below
|
|
8
|
+
* are invocable as they are.
|
|
9
|
+
*
|
|
10
|
+
* Checked against `ListFoundationModels` and `ListInferenceProfiles` in
|
|
11
|
+
* us-east-1 on 2026-10-06. Every Claude 3 id, the Titan Text models and the
|
|
12
|
+
* Titan Image Generators this list used to carry had been retired, and
|
|
13
|
+
* `anthropic.claude-haiku-4-20250514-v1:0` never existed.
|
|
14
|
+
* `STACKS_BEDROCK_LIVE=1 bun test` re-checks the list against a live account.
|
|
15
|
+
*/
|
|
16
|
+
export declare const bedrockModels: readonly [unknown, 'global.anthropic.claude-sonnet-5-5', 'global.anthropic.claude-haiku-4-5-20251001-v1:0', 'us.anthropic.claude-opus-5-5', 'us.anthropic.claude-sonnet-5-5', 'us.anthropic.claude-haiku-4-5-20251001-v1:0', unknown, 'amazon.nova-lite-v1:0', 'amazon.nova-pro-v1:0', 'us.amazon.nova-premier-v1:0', 'global.amazon.nova-2-lite-v1:0', unknown, 'amazon.titan-embed-text-v1', 'amazon.titan-embed-image-v1', 'amazon.nova-2-multimodal-embeddings-v1:0', unknown, 'meta.llama3-70b-instruct-v1:0', 'us.meta.llama3-3-70b-instruct-v1:0', 'us.meta.llama4-maverick-17b-instruct-v1:0', 'us.meta.llama4-scout-17b-instruct-v1:0'];
|
|
1
17
|
/**
|
|
2
18
|
* **AI Options**
|
|
3
19
|
*
|
|
@@ -6,7 +22,7 @@
|
|
|
6
22
|
* have any questions, feel free to reach out via Discord or GitHub Discussions.
|
|
7
23
|
*/
|
|
8
24
|
export declare interface AiOptions {
|
|
9
|
-
default: 'anthropic' | 'openai' | 'ollama' | AiModel
|
|
25
|
+
default: 'anthropic' | 'openai' | 'ollama' | 'bedrock' | AiModel
|
|
10
26
|
models: AiModel[]
|
|
11
27
|
deploy: boolean
|
|
12
28
|
drivers?: {
|
|
@@ -28,30 +44,15 @@ export declare interface AiOptions {
|
|
|
28
44
|
model?: string
|
|
29
45
|
embeddingModel?: string
|
|
30
46
|
}
|
|
47
|
+
bedrock?: {
|
|
48
|
+
model?: string
|
|
49
|
+
region?: string
|
|
50
|
+
maxTokens?: number
|
|
51
|
+
}
|
|
31
52
|
}
|
|
32
53
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
| 'amazon.titan-text-express-v1'
|
|
37
|
-
| 'amazon.titan-text-premier-v1:0'
|
|
38
|
-
| 'amazon.titan-embed-image-v1'
|
|
39
|
-
| 'amazon.titan-image-generator-v1'
|
|
40
|
-
| 'amazon.titan-image-generator-v2:0'
|
|
41
|
-
// Anthropic Claude (current models via Bedrock)
|
|
42
|
-
| 'anthropic.claude-sonnet-4-20250514-v1:0'
|
|
43
|
-
| 'anthropic.claude-haiku-4-20250514-v1:0'
|
|
44
|
-
| 'anthropic.claude-3-5-sonnet-20241022-v2:0'
|
|
45
|
-
| 'anthropic.claude-3-5-haiku-20241022-v1:0'
|
|
46
|
-
| 'anthropic.claude-3-opus-20240229-v1:0'
|
|
47
|
-
| 'anthropic.claude-3-sonnet-20240229-v1:0'
|
|
48
|
-
| 'anthropic.claude-3-haiku-20240307-v1:0'
|
|
49
|
-
// Meta Llama 3
|
|
50
|
-
| 'meta.llama3-8b-instruct-v1:0'
|
|
51
|
-
| 'meta.llama3-70b-instruct-v1:0'
|
|
52
|
-
| 'meta.llama3-1-8b-instruct-v1:0'
|
|
53
|
-
| 'meta.llama3-1-70b-instruct-v1:0'
|
|
54
|
-
| 'meta.llama3-1-405b-instruct-v1:0'
|
|
55
|
-
// Allow custom model strings
|
|
54
|
+
export type BedrockModel = typeof bedrockModels[number];
|
|
55
|
+
declare type AiModel = | BedrockModel
|
|
56
|
+
// Any other model id, for Bedrock or a first-party provider
|
|
56
57
|
| (string & {});
|
|
57
58
|
export type AiConfig = Partial<AiOptions>;
|
package/dist/auth.d.ts
CHANGED
|
@@ -100,6 +100,7 @@ export declare interface AuthOptions {
|
|
|
100
100
|
tokenExpiry: number
|
|
101
101
|
refreshTokenExpiry?: number
|
|
102
102
|
idleTimeout?: number
|
|
103
|
+
rbacCacheTtl?: number
|
|
103
104
|
browserSession?: BrowserSessionConfig
|
|
104
105
|
oauthProvider?: OAuthProviderConfig
|
|
105
106
|
tokenRotation?: number
|
package/dist/cli.d.ts
CHANGED
|
@@ -95,7 +95,7 @@ export declare interface ScheduleOptions extends CliOptions {}
|
|
|
95
95
|
export declare interface TinkerOptions extends CliOptions {
|
|
96
96
|
eval?: string | boolean
|
|
97
97
|
print?: string | boolean
|
|
98
|
-
|
|
98
|
+
banner?: boolean
|
|
99
99
|
preload?: string
|
|
100
100
|
}
|
|
101
101
|
export declare interface TypesOptions extends CliOptions {}
|
package/dist/cron-jobs.d.ts
CHANGED
|
@@ -44,7 +44,7 @@ export type CronJobs = Jobs;
|
|
|
44
44
|
* `dispatch('a bare string')` and even `dispatch()` all compiled against a
|
|
45
45
|
* job that requires an address. The declared payload was decorative.
|
|
46
46
|
*/
|
|
47
|
-
export type JobHandler<T = unknown> = (_data: T) => Promise<any> | any;
|
|
47
|
+
export type JobHandler<T = unknown> = (_data: T, _context?: any) => Promise<any> | any;
|
|
48
48
|
/**
|
|
49
49
|
* Represents different backoff strategies for job retries
|
|
50
50
|
*/
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{e}from"./chunk-e1djnd5t.js";function a(n){return typeof n==="object"&&n!==null&&"id"in n&&"userId"in n&&"clientId"in n&&"scopes"in n}function
|
|
2
|
+
import{e}from"./chunk-e1djnd5t.js";var d=["global.anthropic.claude-opus-5-5","global.anthropic.claude-sonnet-5-5","global.anthropic.claude-haiku-4-5-20251001-v1:0","us.anthropic.claude-opus-5-5","us.anthropic.claude-sonnet-5-5","us.anthropic.claude-haiku-4-5-20251001-v1:0","amazon.nova-micro-v1:0","amazon.nova-lite-v1:0","amazon.nova-pro-v1:0","us.amazon.nova-premier-v1:0","global.amazon.nova-2-lite-v1:0","amazon.titan-embed-text-v2:0","amazon.titan-embed-text-v1","amazon.titan-embed-image-v1","amazon.nova-2-multimodal-embeddings-v1:0","meta.llama3-8b-instruct-v1:0","meta.llama3-70b-instruct-v1:0","us.meta.llama3-3-70b-instruct-v1:0","us.meta.llama4-maverick-17b-instruct-v1:0","us.meta.llama4-scout-17b-instruct-v1:0"];function a(n){return typeof n==="object"&&n!==null&&"id"in n&&"userId"in n&&"clientId"in n&&"scopes"in n}function c(n){return a(n)&&"abilities"in n}function u(n){return typeof n==="object"&&n!==null&&"id"in n&&"name"in n&&"secret"in n&&"redirect"in n}var i;((t)=>{t.Second="* * * * * *";t.FiveSeconds="*/5 * * * * *";t.TenSeconds="*/10 * * * * *";t.ThirtySeconds="*/30 * * * * *";t.Minute="* * * * *";t.TwoMinutes="*/2 * * * *";t.FiveMinutes="*/5 * * * *";t.TenMinutes="*/10 * * * *";t.FifteenMinutes="*/15 * * * *";t.ThirtyMinutes="*/30 * * * *";t.Hour="0 * * * *";t.HalfHour="0,30 * * * *";t.Day="0 0 * * *";t.Week="0 0 * * 0";t.Weekday="0 0 * * 1-5";t.Weekend="0 0 * * 0,6";t.Month="0 0 1 * *";t.Year="0 0 1 1 *"})(i||={});var s;((r)=>{r.Bluesky="bluesky";r.Discord="discord";r.Facebook="facebook";r.GitHub="github";r.Instagram="instagram";r.LinkedIn="linkedin";r.Mastodon="mastodon";r.Slack="slack";r.Twitter="twitter";r.YouTube="youtube"})(s||={});import{toString as l}from"@stacksjs/strings";function y(n){if(n===null)return"null";let o=l(n).slice(8,-1).toLowerCase();return typeof n==="object"||typeof n==="function"?o:typeof n}function h(n){return n}function k(n){return n}var v={development:{default:"sync",connections:{sync:{driver:"sync"}},failed:{driver:"database",table:"failed_jobs"}},production:{default:"redis",connections:{redis:{driver:"redis",prefix:"stacks:queue",concurrency:5,distributedLock:!0,metrics:{enabled:!0},defaultDeadLetterOptions:{enabled:!0,maxRetries:3}}},failed:{driver:"redis",prefix:"stacks:failed"},worker:{concurrency:5,shutdownTimeout:30000}},highPerformance:{default:"redis",connections:{redis:{driver:"redis",prefix:"stacks:queue",concurrency:20,distributedLock:!0,metrics:{enabled:!0,collectInterval:5000},horizontalScaling:{enabled:!0,maxWorkersPerInstance:20,jobsPerWorker:50},defaultDeadLetterOptions:{enabled:!0,maxRetries:5}}},failed:{driver:"redis",prefix:"stacks:failed"},worker:{concurrency:20,shutdownTimeout:60000}},database:{default:"database",connections:{database:{driver:"database",table:"jobs",queue:"default",retryAfter:90}},failed:{driver:"database",table:"failed_jobs"}}};var M={server:{development:{enabled:!0,mode:"server",debug:!0,server:{host:"localhost",port:6001,scheme:"ws",driver:"bun",rateLimit:{enabled:!1},healthCheck:{enabled:!0,path:"/health"}},channels:{public:!0,private:!0,presence:!0}},production:{enabled:!0,mode:"server",debug:!1,server:{host:"0.0.0.0",port:6001,scheme:"wss",driver:"bun",redis:{enabled:!0,prefix:"stacks:realtime:"},rateLimit:{enabled:!0,maxConnectionsPerIp:100,maxMessagesPerSecond:50,maxPayloadSize:65536},loadManagement:{maxConnections:1e4,backpressureThreshold:1000,messageQueueSize:1e4,gracefulShutdownTimeout:30000},autoScaling:{min:2,max:10,targetCPU:70},healthCheck:{enabled:!0,path:"/health",interval:30},metrics:{enabled:!0,port:9090,path:"/metrics"}},channels:{public:!0,private:!0,presence:!0}},highPerformance:{enabled:!0,mode:"server",server:{driver:"bun",redis:{enabled:!0,cluster:!0},rateLimit:{enabled:!0,maxConnectionsPerIp:500,maxMessagesPerSecond:200,maxPayloadSize:131072},loadManagement:{maxConnections:1e5,backpressureThreshold:5000,messageQueueSize:50000,gracefulShutdownTimeout:60000},autoScaling:{min:4,max:50,targetCPU:60}}},chat:{enabled:!0,mode:"server",server:{driver:"bun",redis:{enabled:!0},rateLimit:{enabled:!0,maxConnectionsPerIp:10,maxMessagesPerSecond:20},loadManagement:{maxConnections:50000}},channels:{public:!0,private:!0,presence:{enabled:!0,maxMembersPerChannel:500,memberInfoTtl:60}}},gaming:{enabled:!0,mode:"server",server:{driver:"bun",redis:{enabled:!0,cluster:!0},rateLimit:{enabled:!0,maxConnectionsPerIp:50,maxMessagesPerSecond:100},loadManagement:{maxConnections:50000,backpressureThreshold:2000,messageQueueSize:20000},autoScaling:{min:2,max:20,targetCPU:50}},channels:{public:!0,private:!0,presence:!0}}},serverless:{development:{enabled:!0,mode:"serverless",debug:!0,serverless:{connectionTimeout:3600,idleTimeout:600,stageName:"dev",memorySize:256,timeout:30},channels:{public:!0,private:!0,presence:!0}},production:{enabled:!0,mode:"serverless",debug:!1,serverless:{connectionTimeout:3600,idleTimeout:600,stageName:"production",memorySize:512,timeout:30,provisionedConcurrency:2},channels:{public:!0,private:!0,presence:!0}},notifications:{enabled:!0,mode:"serverless",serverless:{connectionTimeout:7200,idleTimeout:1800,memorySize:256,timeout:15},channels:{public:!0,private:!0,presence:!1}}}};var S={calendar:{github:"stacksjs/calendar",package:"@stacksjs/calendar",description:"Calendar links, ICS generation, and an STX calendar component"},table:{github:"stacksjs/table",package:"@stacksjs/table",description:"Typed table drivers and an STX data table component"}};export{i as Every,e as ExitCode,v as QueuePresets,M as RealtimePresets,s as SocialLinkIcon,d as bedrockModels,h as defineModel,k as defineModels,y as getTypeName,a as isAccessToken,u as isOAuthClient,c as isPersonalAccessToken,S as stackExtensionRegistry};
|
package/dist/search-engine.d.ts
CHANGED
|
@@ -71,19 +71,46 @@ export declare interface CreateIndexOptions extends IndexOptions {
|
|
|
71
71
|
settings?: Settings
|
|
72
72
|
sampleDocument?: Record<string, unknown>
|
|
73
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* The parameters every driver's `search()` reads.
|
|
76
|
+
*
|
|
77
|
+
* The ORM's `Model.search()` builder sends `{ q, limit, offset, filter }`, and
|
|
78
|
+
* the drivers used to each read their own subset of names - Meilisearch only
|
|
79
|
+
* `query` / `page` / `perPage` and an object filter - so a model search
|
|
80
|
+
* returned the first page of the whole index whatever was asked. These are the
|
|
81
|
+
* names all of them honour.
|
|
82
|
+
*
|
|
83
|
+
* Paging is `limit` + `offset`, or `perPage` + `page` (1-based). When both are
|
|
84
|
+
* given, `limit` / `offset` win. Unlisted keys are driver-specific extras
|
|
85
|
+
* (Typesense's `query_by`, Meilisearch's `attributesToRetrieve`, ...).
|
|
86
|
+
*/
|
|
87
|
+
export declare interface SearchEngineSearchParams {
|
|
88
|
+
q?: string
|
|
89
|
+
query?: string
|
|
90
|
+
limit?: number
|
|
91
|
+
offset?: number
|
|
92
|
+
page?: number
|
|
93
|
+
perPage?: number
|
|
94
|
+
filter?: SearchFilter
|
|
95
|
+
sort?: SearchSort
|
|
96
|
+
query_by?: string | string[]
|
|
97
|
+
queryBy?: string | string[]
|
|
98
|
+
[key: string]: unknown
|
|
99
|
+
}
|
|
74
100
|
export declare interface SearchEngineDriver {
|
|
75
101
|
client: () => Meilisearch
|
|
76
102
|
resetClient?: () => void
|
|
77
|
-
search: (index: string, params
|
|
103
|
+
search: (index: string, params?: SearchEngineSearchParams) => Promise<SearchResponse<Record<string, any>>>
|
|
78
104
|
createIndex: (name: string, options?: CreateIndexOptions) => MaybePromise<EnqueuedTask>
|
|
79
105
|
getIndex: (name: string) => Promise<Index<Record<string, any>>>
|
|
80
106
|
addDocument: (indexName: string, params: any) => Promise<EnqueuedTask>
|
|
81
107
|
updateDocuments: (indexName: string, params: DocumentOptions[]) => Promise<EnqueuedTask>
|
|
82
108
|
updateDocument: (indexName: string, params: DocumentOptions) => Promise<EnqueuedTask>
|
|
83
109
|
addDocuments: (indexName: string, params: any[]) => Promise<EnqueuedTask>
|
|
84
|
-
getDocument: (indexName: string, id: number, fields
|
|
110
|
+
getDocument: (indexName: string, id: number | string, fields?: any) => Promise<Record<string, any>>
|
|
85
111
|
deleteDocument: (indexName: string, id: number) => Promise<EnqueuedTask>
|
|
86
112
|
deleteDocuments: (indexName: string, filters: string | string[]) => Promise<EnqueuedTask>
|
|
113
|
+
deleteAllDocuments: (indexName: string) => Promise<EnqueuedTask>
|
|
87
114
|
updateIndex: (name: string, options: IndexOptions) => MaybePromise<EnqueuedTask>
|
|
88
115
|
deleteIndex: (name: string) => MaybePromise<EnqueuedTask>
|
|
89
116
|
listAllIndexes: () => MaybePromise<IndexesResults<Index[]>>
|
|
@@ -146,3 +173,24 @@ export declare interface SearchOptions {
|
|
|
146
173
|
shapeMany?: (models: any[]) => Record<string, unknown>[] | Promise<Record<string, unknown>[]>
|
|
147
174
|
}
|
|
148
175
|
export type SearchEngineConfig = Partial<SearchEngineOptions>;
|
|
176
|
+
/**
|
|
177
|
+
* A search filter, in one of three shapes.
|
|
178
|
+
*
|
|
179
|
+
* - A **string** is already written in the engine's own filter syntax
|
|
180
|
+
* (Meilisearch `status = 'published'`, Typesense `status:=published`,
|
|
181
|
+
* Algolia `status:published`, OpenSearch query-string) and is passed through
|
|
182
|
+
* untouched.
|
|
183
|
+
* - An **array of strings** is several such clauses, all of which must match.
|
|
184
|
+
* Meilisearch additionally reads a nested array as an OR group, as its own
|
|
185
|
+
* API does.
|
|
186
|
+
* - An **object** maps field names to the value each must equal (an array
|
|
187
|
+
* value means "any of these"). This is the only portable form: every driver
|
|
188
|
+
* translates it into its own syntax, validating the field names and escaping
|
|
189
|
+
* the values, so it is the one to build from user input.
|
|
190
|
+
*/
|
|
191
|
+
export type SearchFilter = string | Array<string | string[]> | Record<string, unknown>;
|
|
192
|
+
/**
|
|
193
|
+
* A sort order: engine syntax (`'price:asc'`), a list of those, or a
|
|
194
|
+
* `{ field: 'asc' | 'desc' }` map.
|
|
195
|
+
*/
|
|
196
|
+
export type SearchSort = string | string[] | Record<string, string>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/types",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.75.
|
|
4
|
+
"version": "0.75.73",
|
|
5
5
|
"description": "The Stacks framework types.",
|
|
6
6
|
"author": "Chris Breuer",
|
|
7
7
|
"contributors": [
|
|
@@ -58,9 +58,9 @@
|
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@stacksjs/bunpress": "^0.2.8",
|
|
60
60
|
"@stacksjs/clapp": "^0.2.12",
|
|
61
|
-
"@stacksjs/events": "0.75.
|
|
62
|
-
"@stacksjs/strings": "0.75.
|
|
63
|
-
"@stacksjs/stx": "^0.2.
|
|
61
|
+
"@stacksjs/events": "0.75.73",
|
|
62
|
+
"@stacksjs/strings": "0.75.73",
|
|
63
|
+
"@stacksjs/stx": "^0.2.374",
|
|
64
64
|
"@stacksjs/ts-validation": "^0.5.6",
|
|
65
65
|
"bun-query-builder": "^0.3.5"
|
|
66
66
|
},
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
}
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
|
-
"@stacksjs/validation": "0.75.
|
|
76
|
+
"@stacksjs/validation": "0.75.73",
|
|
77
77
|
"better-dx": "^0.2.24",
|
|
78
78
|
"meilisearch": "^0.62.0"
|
|
79
79
|
},
|