@liquidmetal-ai/drizzle 0.2.12 → 0.3.1
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/CHANGELOG.md +20 -0
- package/dist/appify/parse.d.ts.map +1 -1
- package/dist/appify/parse.test.js +1 -1
- package/dist/codestore.d.ts +2 -2
- package/dist/codestore.d.ts.map +1 -1
- package/dist/codestore.js +17 -10
- package/dist/liquidmetal/v1alpha1/catalog_pb.d.ts +61 -61
- package/dist/liquidmetal/v1alpha1/catalog_pb.d.ts.map +1 -1
- package/dist/liquidmetal/v1alpha1/catalog_pb.js +149 -51
- package/dist/liquidmetal/v1alpha1/object_pb.d.ts +16 -16
- package/dist/liquidmetal/v1alpha1/object_pb.d.ts.map +1 -1
- package/dist/liquidmetal/v1alpha1/object_pb.js +32 -12
- package/dist/liquidmetal/v1alpha1/rainbow_auth_pb.d.ts +17 -17
- package/dist/liquidmetal/v1alpha1/rainbow_auth_pb.d.ts.map +1 -1
- package/dist/liquidmetal/v1alpha1/rainbow_auth_pb.js +32 -12
- package/dist/liquidmetal/v1alpha1/raindrop_pb.d.ts +4 -4
- package/dist/liquidmetal/v1alpha1/raindrop_pb.d.ts.map +1 -1
- package/dist/liquidmetal/v1alpha1/raindrop_pb.js +8 -4
- package/dist/liquidmetal/v1alpha1/search_agent_pb.d.ts +19 -19
- package/dist/liquidmetal/v1alpha1/search_agent_pb.d.ts.map +1 -1
- package/dist/liquidmetal/v1alpha1/search_agent_pb.js +40 -14
- package/dist/ulid.d.ts +7 -0
- package/dist/ulid.d.ts.map +1 -0
- package/dist/ulid.js +107 -0
- package/dist/ulid.test.d.ts +2 -0
- package/dist/ulid.test.d.ts.map +1 -0
- package/dist/ulid.test.js +60 -0
- package/package.json +3 -3
- package/src/appify/parse.test.ts +1 -1
- package/src/appify/parse.ts +1 -1
- package/src/codestore.ts +24 -13
- package/src/liquidmetal/v1alpha1/catalog_pb.ts +182 -140
- package/src/liquidmetal/v1alpha1/object_pb.ts +47 -37
- package/src/liquidmetal/v1alpha1/rainbow_auth_pb.ts +67 -53
- package/src/liquidmetal/v1alpha1/raindrop_pb.ts +14 -10
- package/src/liquidmetal/v1alpha1/search_agent_pb.ts +55 -42
- package/src/ulid.test.ts +68 -0
- package/src/ulid.ts +110 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/.turbo/turbo-lint.log +0 -6
- package/.turbo/turbo-test.log +0 -303
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { GenFile, GenMessage, GenService } from
|
|
2
|
-
import type { Message } from
|
|
1
|
+
import type { GenFile, GenMessage, GenService } from '@bufbuild/protobuf/codegenv1';
|
|
2
|
+
import type { Message } from '@bufbuild/protobuf';
|
|
3
3
|
/**
|
|
4
4
|
* Describes the file liquidmetal/v1alpha1/search_agent.proto.
|
|
5
5
|
*/
|
|
@@ -11,7 +11,7 @@ export declare const file_liquidmetal_v1alpha1_search_agent: GenFile;
|
|
|
11
11
|
*
|
|
12
12
|
* @generated from message liquidmetal.v1alpha1.DocumentChatRequest
|
|
13
13
|
*/
|
|
14
|
-
export type DocumentChatRequest = Message<
|
|
14
|
+
export type DocumentChatRequest = Message<'liquidmetal.v1alpha1.DocumentChatRequest'> & {
|
|
15
15
|
/**
|
|
16
16
|
* The storage bucket containing the target document
|
|
17
17
|
* Must be a valid, registered Smart Bucket
|
|
@@ -61,7 +61,7 @@ export declare const DocumentChatRequestSchema: GenMessage<DocumentChatRequest>;
|
|
|
61
61
|
*
|
|
62
62
|
* @generated from message liquidmetal.v1alpha1.DocumentChatResponse
|
|
63
63
|
*/
|
|
64
|
-
export type DocumentChatResponse = Message<
|
|
64
|
+
export type DocumentChatResponse = Message<'liquidmetal.v1alpha1.DocumentChatResponse'> & {
|
|
65
65
|
/**
|
|
66
66
|
* AI-generated response that may include:
|
|
67
67
|
* - Direct document quotes
|
|
@@ -86,7 +86,7 @@ export declare const DocumentChatResponseSchema: GenMessage<DocumentChatResponse
|
|
|
86
86
|
*
|
|
87
87
|
* @generated from message liquidmetal.v1alpha1.RagSearchRequest
|
|
88
88
|
*/
|
|
89
|
-
export type RagSearchRequest = Message<
|
|
89
|
+
export type RagSearchRequest = Message<'liquidmetal.v1alpha1.RagSearchRequest'> & {
|
|
90
90
|
/**
|
|
91
91
|
* Natural language query or question
|
|
92
92
|
* Can include complex criteria and relationships
|
|
@@ -129,7 +129,7 @@ export declare const RagSearchRequestSchema: GenMessage<RagSearchRequest>;
|
|
|
129
129
|
*
|
|
130
130
|
* @generated from message liquidmetal.v1alpha1.RagSearchResponse
|
|
131
131
|
*/
|
|
132
|
-
export type RagSearchResponse = Message<
|
|
132
|
+
export type RagSearchResponse = Message<'liquidmetal.v1alpha1.RagSearchResponse'> & {
|
|
133
133
|
/**
|
|
134
134
|
* Ordered list of relevant text segments
|
|
135
135
|
* Each result includes full context and metadata
|
|
@@ -150,7 +150,7 @@ export declare const RagSearchResponseSchema: GenMessage<RagSearchResponse>;
|
|
|
150
150
|
*
|
|
151
151
|
* @generated from message liquidmetal.v1alpha1.TextResult
|
|
152
152
|
*/
|
|
153
|
-
export type TextResult = Message<
|
|
153
|
+
export type TextResult = Message<'liquidmetal.v1alpha1.TextResult'> & {
|
|
154
154
|
/**
|
|
155
155
|
* Unique identifier for this text segment
|
|
156
156
|
* Used for deduplication and result tracking
|
|
@@ -213,7 +213,7 @@ export declare const TextResultSchema: GenMessage<TextResult>;
|
|
|
213
213
|
*
|
|
214
214
|
* @generated from message liquidmetal.v1alpha1.PaginationInfo
|
|
215
215
|
*/
|
|
216
|
-
export type PaginationInfo = Message<
|
|
216
|
+
export type PaginationInfo = Message<'liquidmetal.v1alpha1.PaginationInfo'> & {
|
|
217
217
|
/**
|
|
218
218
|
* Total number of available results
|
|
219
219
|
*
|
|
@@ -259,7 +259,7 @@ export declare const PaginationInfoSchema: GenMessage<PaginationInfo>;
|
|
|
259
259
|
*
|
|
260
260
|
* @generated from message liquidmetal.v1alpha1.CreatePageSummaryRequest
|
|
261
261
|
*/
|
|
262
|
-
export type CreatePageSummaryRequest = Message<
|
|
262
|
+
export type CreatePageSummaryRequest = Message<'liquidmetal.v1alpha1.CreatePageSummaryRequest'> & {
|
|
263
263
|
/**
|
|
264
264
|
* Target page number (1-based)
|
|
265
265
|
*
|
|
@@ -299,7 +299,7 @@ export declare const CreatePageSummaryRequestSchema: GenMessage<CreatePageSummar
|
|
|
299
299
|
*
|
|
300
300
|
* @generated from message liquidmetal.v1alpha1.CreatePageSummaryResponse
|
|
301
301
|
*/
|
|
302
|
-
export type CreatePageSummaryResponse = Message<
|
|
302
|
+
export type CreatePageSummaryResponse = Message<'liquidmetal.v1alpha1.CreatePageSummaryResponse'> & {
|
|
303
303
|
/**
|
|
304
304
|
* AI-generated summary including:
|
|
305
305
|
* - Key themes and topics
|
|
@@ -323,7 +323,7 @@ export declare const CreatePageSummaryResponseSchema: GenMessage<CreatePageSumma
|
|
|
323
323
|
*
|
|
324
324
|
* @generated from message liquidmetal.v1alpha1.RunSupervisorAgentRequest
|
|
325
325
|
*/
|
|
326
|
-
export type RunSupervisorAgentRequest = Message<
|
|
326
|
+
export type RunSupervisorAgentRequest = Message<'liquidmetal.v1alpha1.RunSupervisorAgentRequest'> & {
|
|
327
327
|
/**
|
|
328
328
|
* Natural language search query
|
|
329
329
|
* Can include complex criteria
|
|
@@ -365,7 +365,7 @@ export declare const RunSupervisorAgentRequestSchema: GenMessage<RunSupervisorAg
|
|
|
365
365
|
*
|
|
366
366
|
* @generated from message liquidmetal.v1alpha1.RunSupervisorAgentResponse
|
|
367
367
|
*/
|
|
368
|
-
export type RunSupervisorAgentResponse = Message<
|
|
368
|
+
export type RunSupervisorAgentResponse = Message<'liquidmetal.v1alpha1.RunSupervisorAgentResponse'> & {
|
|
369
369
|
/**
|
|
370
370
|
* Matched results with metadata
|
|
371
371
|
*
|
|
@@ -390,7 +390,7 @@ export declare const RunSupervisorAgentResponseSchema: GenMessage<RunSupervisorA
|
|
|
390
390
|
*
|
|
391
391
|
* @generated from message liquidmetal.v1alpha1.GetPaginatedResultsRequest
|
|
392
392
|
*/
|
|
393
|
-
export type GetPaginatedResultsRequest = Message<
|
|
393
|
+
export type GetPaginatedResultsRequest = Message<'liquidmetal.v1alpha1.GetPaginatedResultsRequest'> & {
|
|
394
394
|
/**
|
|
395
395
|
* Original search session identifier
|
|
396
396
|
*
|
|
@@ -429,7 +429,7 @@ export declare const GetPaginatedResultsRequestSchema: GenMessage<GetPaginatedRe
|
|
|
429
429
|
*
|
|
430
430
|
* @generated from message liquidmetal.v1alpha1.GetPaginatedResultsResponse
|
|
431
431
|
*/
|
|
432
|
-
export type GetPaginatedResultsResponse = Message<
|
|
432
|
+
export type GetPaginatedResultsResponse = Message<'liquidmetal.v1alpha1.GetPaginatedResultsResponse'> & {
|
|
433
433
|
/**
|
|
434
434
|
* Page results with full metadata
|
|
435
435
|
*
|
|
@@ -488,7 +488,7 @@ export declare const SearchAgentService: GenService<{
|
|
|
488
488
|
* @generated from rpc liquidmetal.v1alpha1.SearchAgentService.DocumentChat
|
|
489
489
|
*/
|
|
490
490
|
documentChat: {
|
|
491
|
-
methodKind:
|
|
491
|
+
methodKind: 'unary';
|
|
492
492
|
input: typeof DocumentChatRequestSchema;
|
|
493
493
|
output: typeof DocumentChatResponseSchema;
|
|
494
494
|
};
|
|
@@ -513,7 +513,7 @@ export declare const SearchAgentService: GenService<{
|
|
|
513
513
|
* @generated from rpc liquidmetal.v1alpha1.SearchAgentService.RagSearch
|
|
514
514
|
*/
|
|
515
515
|
ragSearch: {
|
|
516
|
-
methodKind:
|
|
516
|
+
methodKind: 'unary';
|
|
517
517
|
input: typeof RagSearchRequestSchema;
|
|
518
518
|
output: typeof RagSearchResponseSchema;
|
|
519
519
|
};
|
|
@@ -538,7 +538,7 @@ export declare const SearchAgentService: GenService<{
|
|
|
538
538
|
* @generated from rpc liquidmetal.v1alpha1.SearchAgentService.CreatePageSummary
|
|
539
539
|
*/
|
|
540
540
|
createPageSummary: {
|
|
541
|
-
methodKind:
|
|
541
|
+
methodKind: 'unary';
|
|
542
542
|
input: typeof CreatePageSummaryRequestSchema;
|
|
543
543
|
output: typeof CreatePageSummaryResponseSchema;
|
|
544
544
|
};
|
|
@@ -564,7 +564,7 @@ export declare const SearchAgentService: GenService<{
|
|
|
564
564
|
* @generated from rpc liquidmetal.v1alpha1.SearchAgentService.RunSupervisorAgent
|
|
565
565
|
*/
|
|
566
566
|
runSupervisorAgent: {
|
|
567
|
-
methodKind:
|
|
567
|
+
methodKind: 'unary';
|
|
568
568
|
input: typeof RunSupervisorAgentRequestSchema;
|
|
569
569
|
output: typeof RunSupervisorAgentResponseSchema;
|
|
570
570
|
};
|
|
@@ -583,7 +583,7 @@ export declare const SearchAgentService: GenService<{
|
|
|
583
583
|
* @generated from rpc liquidmetal.v1alpha1.SearchAgentService.GetPaginatedResults
|
|
584
584
|
*/
|
|
585
585
|
getPaginatedResults: {
|
|
586
|
-
methodKind:
|
|
586
|
+
methodKind: 'unary';
|
|
587
587
|
input: typeof GetPaginatedResultsRequestSchema;
|
|
588
588
|
output: typeof GetPaginatedResultsResponseSchema;
|
|
589
589
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search_agent_pb.d.ts","sourceRoot":"","sources":["../../../src/liquidmetal/v1alpha1/search_agent_pb.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAEpF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAElD;;GAEG;AACH,eAAO,MAAM,sCAAsC,EAAE,
|
|
1
|
+
{"version":3,"file":"search_agent_pb.d.ts","sourceRoot":"","sources":["../../../src/liquidmetal/v1alpha1/search_agent_pb.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAEpF,OAAO,KAAK,EAAE,OAAO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kB,EAAE;QAClB,UAAU,EAAE,OAAO,CAAC;QACpB,KAAK,EAAE,OAAO,+BAA+B,CAAC;QAC9C,MAAM,EAAE,OAAO,gCAAgC,CAAC;KACjD,CAAC;IACF;;;;;;;;;;;;;OAaG;IACH,mBAAmB,EAAE;QACnB,UAAU,EAAE,OAAO,CAAC;QACpB,KAAK,EAAE,OAAO,gCAAgC,CAAC;QAC/C,MAAM,EAAE,OAAO,iCAAiC,CAAC;KAClD,CAAC;CACH,CAAwE,CAAC"}
|
|
@@ -1,71 +1,97 @@
|
|
|
1
1
|
// @generated by protoc-gen-es v2.2.5 with parameter "target=ts,import_extension=.js"
|
|
2
2
|
// @generated from file liquidmetal/v1alpha1/search_agent.proto (package liquidmetal.v1alpha1, syntax proto3)
|
|
3
3
|
/* eslint-disable */
|
|
4
|
-
import { fileDesc, messageDesc, serviceDesc } from
|
|
4
|
+
import { fileDesc, messageDesc, serviceDesc } from '@bufbuild/protobuf/codegenv1';
|
|
5
5
|
/**
|
|
6
6
|
* Describes the file liquidmetal/v1alpha1/search_agent.proto.
|
|
7
7
|
*/
|
|
8
|
-
export const file_liquidmetal_v1alpha1_search_agent =
|
|
8
|
+
export const file_liquidmetal_v1alpha1_search_agent =
|
|
9
|
+
/*@__PURE__*/
|
|
10
|
+
fileDesc('CidsaXF1aWRtZXRhbC92MWFscGhhMS9zZWFyY2hfYWdlbnQucHJvdG8SFGxpcXVpZG1ldGFsLnYxYWxwaGExIogBChNEb2N1bWVudENoYXRSZXF1ZXN0EhEKCWJ1Y2tldF9pZBgBIAEoCRIRCglvYmplY3RfaWQYAiABKAkSDQoFaW5wdXQYAyABKAkSEgoKcmVxdWVzdF9pZBgEIAEoCRIPCgd1c2VyX2lkGAUgASgJEhcKD29yZ2FuaXphdGlvbl9pZBgGIAEoCSImChREb2N1bWVudENoYXRSZXNwb25zZRIOCgZhbnN3ZXIYASABKAkicwoQUmFnU2VhcmNoUmVxdWVzdBINCgVpbnB1dBgBIAEoCRISCgpyZX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nZpc29yQWdlbnQSLy5saXF1aWRtZXRhbC52MWFscGhhMS5SdW5TdXBlcnZpc29yQWdlbnRSZXF1ZXN0GjAubGlxdWlkbWV0YWwudjFhbHBoYTEuUnVuU3VwZXJ2aXNvckFnZW50UmVzcG9uc2USegoTR2V0UGFnaW5hdGVkUmVzdWx0cxIwLmxpcXVpZG1ldGFsLnYxYWxwaGExLkdldFBhZ2luYXRlZFJlc3VsdHNSZXF1ZXN0GjEubGlxdWlkbWV0YWwudjFhbHBoYTEuR2V0UGFnaW5hdGVkUmVzdWx0c1Jlc3BvbnNlQp0BChhjb20ubGlxdWlkbWV0YWwudjFhbHBoYTFCEFNlYXJjaEFnZW50UHJvdG9QAaICA0xYWKoCFExpcXVpZG1ldGFsLlYxYWxwaGExygIUTGlxdWlkbWV0YWxcVjFhbHBoYTHiAiBMaXF1aWRtZXRhbFxWMWFscGhhMVxHUEJNZXRhZGF0YeoCFUxpcXVpZG1ldGFsOjpWMWFscGhhMWIGcHJvdG8z');
|
|
9
11
|
/**
|
|
10
12
|
* Describes the message liquidmetal.v1alpha1.DocumentChatRequest.
|
|
11
13
|
* Use `create(DocumentChatRequestSchema)` to create a new message.
|
|
12
14
|
*/
|
|
13
|
-
export const DocumentChatRequestSchema =
|
|
15
|
+
export const DocumentChatRequestSchema =
|
|
16
|
+
/*@__PURE__*/
|
|
17
|
+
messageDesc(file_liquidmetal_v1alpha1_search_agent, 0);
|
|
14
18
|
/**
|
|
15
19
|
* Describes the message liquidmetal.v1alpha1.DocumentChatResponse.
|
|
16
20
|
* Use `create(DocumentChatResponseSchema)` to create a new message.
|
|
17
21
|
*/
|
|
18
|
-
export const DocumentChatResponseSchema =
|
|
22
|
+
export const DocumentChatResponseSchema =
|
|
23
|
+
/*@__PURE__*/
|
|
24
|
+
messageDesc(file_liquidmetal_v1alpha1_search_agent, 1);
|
|
19
25
|
/**
|
|
20
26
|
* Describes the message liquidmetal.v1alpha1.RagSearchRequest.
|
|
21
27
|
* Use `create(RagSearchRequestSchema)` to create a new message.
|
|
22
28
|
*/
|
|
23
|
-
export const RagSearchRequestSchema =
|
|
29
|
+
export const RagSearchRequestSchema =
|
|
30
|
+
/*@__PURE__*/
|
|
31
|
+
messageDesc(file_liquidmetal_v1alpha1_search_agent, 2);
|
|
24
32
|
/**
|
|
25
33
|
* Describes the message liquidmetal.v1alpha1.RagSearchResponse.
|
|
26
34
|
* Use `create(RagSearchResponseSchema)` to create a new message.
|
|
27
35
|
*/
|
|
28
|
-
export const RagSearchResponseSchema =
|
|
36
|
+
export const RagSearchResponseSchema =
|
|
37
|
+
/*@__PURE__*/
|
|
38
|
+
messageDesc(file_liquidmetal_v1alpha1_search_agent, 3);
|
|
29
39
|
/**
|
|
30
40
|
* Describes the message liquidmetal.v1alpha1.TextResult.
|
|
31
41
|
* Use `create(TextResultSchema)` to create a new message.
|
|
32
42
|
*/
|
|
33
|
-
export const TextResultSchema =
|
|
43
|
+
export const TextResultSchema =
|
|
44
|
+
/*@__PURE__*/
|
|
45
|
+
messageDesc(file_liquidmetal_v1alpha1_search_agent, 4);
|
|
34
46
|
/**
|
|
35
47
|
* Describes the message liquidmetal.v1alpha1.PaginationInfo.
|
|
36
48
|
* Use `create(PaginationInfoSchema)` to create a new message.
|
|
37
49
|
*/
|
|
38
|
-
export const PaginationInfoSchema =
|
|
50
|
+
export const PaginationInfoSchema =
|
|
51
|
+
/*@__PURE__*/
|
|
52
|
+
messageDesc(file_liquidmetal_v1alpha1_search_agent, 5);
|
|
39
53
|
/**
|
|
40
54
|
* Describes the message liquidmetal.v1alpha1.CreatePageSummaryRequest.
|
|
41
55
|
* Use `create(CreatePageSummaryRequestSchema)` to create a new message.
|
|
42
56
|
*/
|
|
43
|
-
export const CreatePageSummaryRequestSchema =
|
|
57
|
+
export const CreatePageSummaryRequestSchema =
|
|
58
|
+
/*@__PURE__*/
|
|
59
|
+
messageDesc(file_liquidmetal_v1alpha1_search_agent, 6);
|
|
44
60
|
/**
|
|
45
61
|
* Describes the message liquidmetal.v1alpha1.CreatePageSummaryResponse.
|
|
46
62
|
* Use `create(CreatePageSummaryResponseSchema)` to create a new message.
|
|
47
63
|
*/
|
|
48
|
-
export const CreatePageSummaryResponseSchema =
|
|
64
|
+
export const CreatePageSummaryResponseSchema =
|
|
65
|
+
/*@__PURE__*/
|
|
66
|
+
messageDesc(file_liquidmetal_v1alpha1_search_agent, 7);
|
|
49
67
|
/**
|
|
50
68
|
* Describes the message liquidmetal.v1alpha1.RunSupervisorAgentRequest.
|
|
51
69
|
* Use `create(RunSupervisorAgentRequestSchema)` to create a new message.
|
|
52
70
|
*/
|
|
53
|
-
export const RunSupervisorAgentRequestSchema =
|
|
71
|
+
export const RunSupervisorAgentRequestSchema =
|
|
72
|
+
/*@__PURE__*/
|
|
73
|
+
messageDesc(file_liquidmetal_v1alpha1_search_agent, 8);
|
|
54
74
|
/**
|
|
55
75
|
* Describes the message liquidmetal.v1alpha1.RunSupervisorAgentResponse.
|
|
56
76
|
* Use `create(RunSupervisorAgentResponseSchema)` to create a new message.
|
|
57
77
|
*/
|
|
58
|
-
export const RunSupervisorAgentResponseSchema =
|
|
78
|
+
export const RunSupervisorAgentResponseSchema =
|
|
79
|
+
/*@__PURE__*/
|
|
80
|
+
messageDesc(file_liquidmetal_v1alpha1_search_agent, 9);
|
|
59
81
|
/**
|
|
60
82
|
* Describes the message liquidmetal.v1alpha1.GetPaginatedResultsRequest.
|
|
61
83
|
* Use `create(GetPaginatedResultsRequestSchema)` to create a new message.
|
|
62
84
|
*/
|
|
63
|
-
export const GetPaginatedResultsRequestSchema =
|
|
85
|
+
export const GetPaginatedResultsRequestSchema =
|
|
86
|
+
/*@__PURE__*/
|
|
87
|
+
messageDesc(file_liquidmetal_v1alpha1_search_agent, 10);
|
|
64
88
|
/**
|
|
65
89
|
* Describes the message liquidmetal.v1alpha1.GetPaginatedResultsResponse.
|
|
66
90
|
* Use `create(GetPaginatedResultsResponseSchema)` to create a new message.
|
|
67
91
|
*/
|
|
68
|
-
export const GetPaginatedResultsResponseSchema =
|
|
92
|
+
export const GetPaginatedResultsResponseSchema =
|
|
93
|
+
/*@__PURE__*/
|
|
94
|
+
messageDesc(file_liquidmetal_v1alpha1_search_agent, 11);
|
|
69
95
|
/**
|
|
70
96
|
* SearchAgentService provides the core functionality for Smart Buckets - Raindrop's intelligent
|
|
71
97
|
* object storage service designed specifically for AI applications. When files are uploaded
|
package/dist/ulid.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function monotonic(): () => string;
|
|
2
|
+
export declare const ulid: () => string;
|
|
3
|
+
export declare function ulidBatch(count: number): string[];
|
|
4
|
+
export declare function decodeTimeToMilliseconds(id: string): number;
|
|
5
|
+
export declare function decodeTimeToDate(id: string): Date;
|
|
6
|
+
export declare function incrementBase32(str: string): string;
|
|
7
|
+
//# sourceMappingURL=ulid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ulid.d.ts","sourceRoot":"","sources":["../src/ulid.ts"],"names":[],"mappings":"AAsBA,wBAAgB,SAAS,IAAI,MAAM,MAAM,CAaxC;AAED,eAAO,MAAM,IAAI,QAfkB,MAeJ,CAAC;AAEhC,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAMjD;AAED,wBAAgB,wBAAwB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAa3D;AAED,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAEjD;AAwBD,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAqBnD"}
|
package/dist/ulid.js
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
// This gives monotonic ULIDs that are sortable by time and unique across
|
|
2
|
+
// multiple instances of the application. The ids are 26 characters long
|
|
3
|
+
// and contain a 10 character timestamp followed by 16 random characters.
|
|
4
|
+
// The timestamp is encoded in base32 and the random characters are also
|
|
5
|
+
// encoded in base32. The timestamp is the number of milliseconds since
|
|
6
|
+
// the Unix epoch and the random characters are generated using the
|
|
7
|
+
// crypto.getRandomValues function that Cloudflare supports.
|
|
8
|
+
//
|
|
9
|
+
// See https://developers.cloudflare.com/workers/runtime-apis/web-crypto/
|
|
10
|
+
// See https://github.com/ulid/spec
|
|
11
|
+
//
|
|
12
|
+
// This has been cross-checked against the reference implementation but
|
|
13
|
+
// the reference implementation uses a different / configurable random number
|
|
14
|
+
// generator, and supports non-monotonic ids. This implementation is simpler
|
|
15
|
+
// and only supports monotonic ids, and Cloudflare's platform.
|
|
16
|
+
const BASE32_ENCODING = '0123456789abcdefghjkmnpqrstvwxyz';
|
|
17
|
+
const ENCODING_LEN = BASE32_ENCODING.length;
|
|
18
|
+
const TIME_MAX = Math.pow(2, 48) - 1;
|
|
19
|
+
const TIME_LEN = 10;
|
|
20
|
+
const RANDOM_LEN = 16;
|
|
21
|
+
export function monotonic() {
|
|
22
|
+
let lastTime = 0;
|
|
23
|
+
let lastRandom;
|
|
24
|
+
return function ulid() {
|
|
25
|
+
const seed = new Date().getTime();
|
|
26
|
+
if (seed <= lastTime) {
|
|
27
|
+
lastRandom = incrementBase32(lastRandom);
|
|
28
|
+
return encodeTime(lastTime) + lastRandom;
|
|
29
|
+
}
|
|
30
|
+
lastTime = seed;
|
|
31
|
+
lastRandom = encodeRandom();
|
|
32
|
+
return encodeTime(seed) + lastRandom;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export const ulid = monotonic();
|
|
36
|
+
export function ulidBatch(count) {
|
|
37
|
+
const batch = [];
|
|
38
|
+
for (let i = 0; i < count; i++) {
|
|
39
|
+
batch.push(ulid());
|
|
40
|
+
}
|
|
41
|
+
return batch;
|
|
42
|
+
}
|
|
43
|
+
export function decodeTimeToMilliseconds(id) {
|
|
44
|
+
if (id.length !== TIME_LEN + RANDOM_LEN)
|
|
45
|
+
throw new Error('malformed ulid');
|
|
46
|
+
const time = id
|
|
47
|
+
.substring(0, TIME_LEN)
|
|
48
|
+
.split('')
|
|
49
|
+
.reverse()
|
|
50
|
+
.reduce((carry, char, index) => {
|
|
51
|
+
const encodingIndex = BASE32_ENCODING.indexOf(char);
|
|
52
|
+
if (encodingIndex === -1)
|
|
53
|
+
throw new Error('invalid character found: ' + char);
|
|
54
|
+
return (carry += encodingIndex * Math.pow(ENCODING_LEN, index));
|
|
55
|
+
}, 0);
|
|
56
|
+
if (time > TIME_MAX)
|
|
57
|
+
throw new Error('malformed ulid, timestamp too large');
|
|
58
|
+
return time;
|
|
59
|
+
}
|
|
60
|
+
export function decodeTimeToDate(id) {
|
|
61
|
+
return new Date(decodeTimeToMilliseconds(id));
|
|
62
|
+
}
|
|
63
|
+
function encodeRandom() {
|
|
64
|
+
const bytes = crypto.getRandomValues(new Uint8Array(RANDOM_LEN));
|
|
65
|
+
let str = '';
|
|
66
|
+
for (let i = 0; i < RANDOM_LEN; i++) {
|
|
67
|
+
str = str + BASE32_ENCODING[bytes[i] % ENCODING_LEN];
|
|
68
|
+
}
|
|
69
|
+
return str;
|
|
70
|
+
}
|
|
71
|
+
function encodeTime(ms) {
|
|
72
|
+
if (ms > TIME_MAX)
|
|
73
|
+
throw new Error('cannot encode time greater than ' + TIME_MAX);
|
|
74
|
+
if (ms < 0)
|
|
75
|
+
throw new Error('time must be positive');
|
|
76
|
+
let mod;
|
|
77
|
+
let str = '';
|
|
78
|
+
for (let len = TIME_LEN; len > 0; len--) {
|
|
79
|
+
mod = ms % ENCODING_LEN;
|
|
80
|
+
str = BASE32_ENCODING[mod] + str;
|
|
81
|
+
ms = (ms - mod) / ENCODING_LEN;
|
|
82
|
+
}
|
|
83
|
+
return str;
|
|
84
|
+
}
|
|
85
|
+
export function incrementBase32(str) {
|
|
86
|
+
function replaceCharAt(str, index, char) {
|
|
87
|
+
if (index > str.length - 1)
|
|
88
|
+
return str;
|
|
89
|
+
return str.substring(0, index) + char + str.substring(index + 1);
|
|
90
|
+
}
|
|
91
|
+
const maxCharIndex = ENCODING_LEN - 1;
|
|
92
|
+
let index = str ? str.length : 0;
|
|
93
|
+
let char;
|
|
94
|
+
let charIndex;
|
|
95
|
+
while (index-- >= 0) {
|
|
96
|
+
char = str[index];
|
|
97
|
+
charIndex = BASE32_ENCODING.indexOf(char);
|
|
98
|
+
if (charIndex === -1)
|
|
99
|
+
throw new Error('incorrectly encoded string');
|
|
100
|
+
if (charIndex === maxCharIndex) {
|
|
101
|
+
str = replaceCharAt(str, index, BASE32_ENCODING[0]);
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
return replaceCharAt(str, index, BASE32_ENCODING[charIndex + 1]);
|
|
105
|
+
}
|
|
106
|
+
return str;
|
|
107
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ulid.test.d.ts","sourceRoot":"","sources":["../src/ulid.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { describe, expect, it, test } from 'vitest';
|
|
2
|
+
import { decodeTimeToDate, decodeTimeToMilliseconds, incrementBase32, ulid, ulidBatch } from './ulid';
|
|
3
|
+
const BASE32_ENCODING = ' 0123456789abcdefghjkmnpqrstvwxyz';
|
|
4
|
+
const TIME_MAX = Math.pow(2, 48) - 1;
|
|
5
|
+
const TIME_LEN = 10;
|
|
6
|
+
const RANDOM_LEN = 16;
|
|
7
|
+
const ULID_LEN = TIME_LEN + RANDOM_LEN;
|
|
8
|
+
test('ulid is valid', () => {
|
|
9
|
+
const id = ulid();
|
|
10
|
+
expect(id.length).toBe(TIME_LEN + RANDOM_LEN);
|
|
11
|
+
for (let i = 0; i < ULID_LEN; i++) {
|
|
12
|
+
expect(BASE32_ENCODING.includes(id[i])).toBe(true);
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
test('ulidBatch are all valid', () => {
|
|
16
|
+
const ids = ulidBatch(10);
|
|
17
|
+
expect(ids.length).toBe(10);
|
|
18
|
+
for (const id of ids) {
|
|
19
|
+
expect(id.length).toBe(ULID_LEN);
|
|
20
|
+
for (let i = 0; i < ULID_LEN; i++) {
|
|
21
|
+
expect(BASE32_ENCODING.includes(id[i])).toBe(true);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
test('all ids are unique', () => {
|
|
26
|
+
const ids = ulidBatch(1000);
|
|
27
|
+
const set = new Set(ids);
|
|
28
|
+
expect(set.size).toBe(ids.length);
|
|
29
|
+
});
|
|
30
|
+
test('time is monotonic', () => {
|
|
31
|
+
const ids = ulidBatch(1000);
|
|
32
|
+
let lastTime = 0;
|
|
33
|
+
for (const id of ids) {
|
|
34
|
+
const time = decodeTimeToMilliseconds(id);
|
|
35
|
+
expect(time).toBeGreaterThanOrEqual(lastTime);
|
|
36
|
+
lastTime = time;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
test('time less than max and greater than test start time', () => {
|
|
40
|
+
const now = new Date().getTime();
|
|
41
|
+
const id = ulid();
|
|
42
|
+
const time = decodeTimeToMilliseconds(id);
|
|
43
|
+
expect(time).toBeGreaterThanOrEqual(now);
|
|
44
|
+
expect(time).toBeLessThanOrEqual(TIME_MAX);
|
|
45
|
+
});
|
|
46
|
+
test('decoding to date', () => {
|
|
47
|
+
const now = new Date().getTime();
|
|
48
|
+
const id = ulid();
|
|
49
|
+
const time = decodeTimeToDate(id).getTime();
|
|
50
|
+
expect(time).toBeGreaterThanOrEqual(now);
|
|
51
|
+
expect(time).toBeLessThanOrEqual(TIME_MAX);
|
|
52
|
+
});
|
|
53
|
+
describe('incrementBase32', () => {
|
|
54
|
+
it('increments single-digit strings', () => {
|
|
55
|
+
expect(incrementBase32('0')).toBe('1');
|
|
56
|
+
});
|
|
57
|
+
it('increments multiple-digit strings', () => {
|
|
58
|
+
expect(incrementBase32('aaaaa')).toBe('aaaab');
|
|
59
|
+
});
|
|
60
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@liquidmetal-ai/drizzle",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Raindrop core operational libraries",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"vitest": "^2.1.1"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"
|
|
36
|
+
"fflate": "^0.8.2"
|
|
37
37
|
},
|
|
38
38
|
"exports": {
|
|
39
39
|
".": {
|
|
@@ -45,4 +45,4 @@
|
|
|
45
45
|
"types": "./dist/*.d.ts"
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
}
|
|
48
|
+
}
|
package/src/appify/parse.test.ts
CHANGED
package/src/appify/parse.ts
CHANGED
|
@@ -221,7 +221,7 @@ export type PropertyNode = BaseNode & {
|
|
|
221
221
|
operator: TokenOperator;
|
|
222
222
|
key: Extract<Token, { type: 'identifier' | 'string' }>;
|
|
223
223
|
value: ExpressionNode | Extract<Token, { type: 'string' | 'number' | 'boolean' }> | ArrayNode | ObjectNode;
|
|
224
|
-
}
|
|
224
|
+
};
|
|
225
225
|
|
|
226
226
|
export type ExpressionNode = BaseNode & {
|
|
227
227
|
type: 'expression';
|
package/src/codestore.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import crypto from 'crypto';
|
|
2
|
-
import
|
|
2
|
+
import { zipSync, unzipSync } from 'fflate';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* CodeStore represents a collection of code bundles mapped by handler names
|
|
@@ -107,12 +107,18 @@ export abstract class BundleBase implements ReadableBundle {
|
|
|
107
107
|
* @param bundle The bundle to archive
|
|
108
108
|
* @returns Promise resolving to the ZIP file contents as an ArrayBuffer
|
|
109
109
|
*/
|
|
110
|
-
export async function archive(bundle: ReadableBundle): Promise<
|
|
111
|
-
const
|
|
110
|
+
export async function archive(bundle: ReadableBundle): Promise<ArrayBufferLike> {
|
|
111
|
+
const files: Record<string, Uint8Array> = {};
|
|
112
|
+
|
|
113
|
+
// Collect all files
|
|
112
114
|
for await (const file of bundle) {
|
|
113
|
-
|
|
115
|
+
const content = await file.read();
|
|
116
|
+
files[file.name] = new Uint8Array(content);
|
|
114
117
|
}
|
|
115
|
-
|
|
118
|
+
|
|
119
|
+
// Use zipSync to directly get the zipped data
|
|
120
|
+
const zipped = zipSync(files);
|
|
121
|
+
return zipped.buffer;
|
|
116
122
|
}
|
|
117
123
|
|
|
118
124
|
/**
|
|
@@ -120,13 +126,18 @@ export async function archive(bundle: ReadableBundle): Promise<ArrayBuffer> {
|
|
|
120
126
|
* @param zipBuffer The ZIP file contents as an ArrayBuffer
|
|
121
127
|
* @param bundle The target bundle to write the extracted files to
|
|
122
128
|
*/
|
|
123
|
-
export async function unarchive(zipBuffer:
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
129
|
+
export async function unarchive(zipBuffer: ArrayBufferLike, bundle: WritableBundle): Promise<void> {
|
|
130
|
+
// Convert ArrayBuffer to Uint8Array for fflate
|
|
131
|
+
const zipData = new Uint8Array(zipBuffer);
|
|
132
|
+
|
|
133
|
+
// Use unzipSync to directly get the unzipped data
|
|
134
|
+
const unzipped = unzipSync(zipData);
|
|
135
|
+
|
|
136
|
+
// Process each file in the unzipped data
|
|
137
|
+
for (const [filename, content] of Object.entries(unzipped)) {
|
|
138
|
+
// Skip directories (if any)
|
|
139
|
+
if (filename.endsWith('/')) continue;
|
|
140
|
+
|
|
141
|
+
await bundle.write(filename, Buffer.from(content));
|
|
131
142
|
}
|
|
132
143
|
}
|