@moss-dev/moss-wasm 0.10.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/LICENSE.txt +168 -0
- package/moss_wasm.d.ts +107 -0
- package/moss_wasm.js +1185 -0
- package/moss_wasm_bg.wasm +0 -0
- package/package.json +23 -0
package/LICENSE.txt
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
Copyright (c) 2025 InferEdge Inc.
|
|
2
|
+
Required Notice: Copyright InferEdge Inc. (https://inferedge.dev)
|
|
3
|
+
Licensor Line of Business: InferEdge MOSS Runtime (https://inferedge.dev)
|
|
4
|
+
|
|
5
|
+
# PolyForm Shield License 1.0.0
|
|
6
|
+
|
|
7
|
+
<https://polyformproject.org/licenses/shield/1.0.0>
|
|
8
|
+
|
|
9
|
+
## Acceptance
|
|
10
|
+
|
|
11
|
+
In order to get any license under these terms, you must agree
|
|
12
|
+
to them as both strict obligations and conditions to all
|
|
13
|
+
your licenses.
|
|
14
|
+
|
|
15
|
+
## Copyright License
|
|
16
|
+
|
|
17
|
+
The licensor grants you a copyright license for the
|
|
18
|
+
software to do everything you might do with the software
|
|
19
|
+
that would otherwise infringe the licensor's copyright
|
|
20
|
+
in it for any permitted purpose. However, you may
|
|
21
|
+
only distribute the software according to [Distribution
|
|
22
|
+
License](#distribution-license) and make changes or new works
|
|
23
|
+
based on the software according to [Changes and New Works
|
|
24
|
+
License](#changes-and-new-works-license).
|
|
25
|
+
|
|
26
|
+
## Distribution License
|
|
27
|
+
|
|
28
|
+
The licensor grants you an additional copyright license
|
|
29
|
+
to distribute copies of the software. Your license
|
|
30
|
+
to distribute covers distributing the software with
|
|
31
|
+
changes and new works permitted by [Changes and New Works
|
|
32
|
+
License](#changes-and-new-works-license).
|
|
33
|
+
|
|
34
|
+
## Notices
|
|
35
|
+
|
|
36
|
+
You must ensure that anyone who gets a copy of any part of
|
|
37
|
+
the software from you also gets a copy of these terms or the
|
|
38
|
+
URL for them above, as well as copies of any plain-text lines
|
|
39
|
+
beginning with `Required Notice:` that the licensor provided
|
|
40
|
+
with the software. For example:
|
|
41
|
+
|
|
42
|
+
> Required Notice: Copyright Yoyodyne, Inc. (http://example.com)
|
|
43
|
+
|
|
44
|
+
## Changes and New Works License
|
|
45
|
+
|
|
46
|
+
The licensor grants you an additional copyright license to
|
|
47
|
+
make changes and new works based on the software for any
|
|
48
|
+
permitted purpose.
|
|
49
|
+
|
|
50
|
+
## Patent License
|
|
51
|
+
|
|
52
|
+
The licensor grants you a patent license for the software that
|
|
53
|
+
covers patent claims the licensor can license, or becomes able
|
|
54
|
+
to license, that you would infringe by using the software.
|
|
55
|
+
|
|
56
|
+
## Noncompete
|
|
57
|
+
|
|
58
|
+
Any purpose is a permitted purpose, except for providing any
|
|
59
|
+
product that competes with the software or any product the
|
|
60
|
+
licensor or any of its affiliates provides using the software.
|
|
61
|
+
|
|
62
|
+
## Competition
|
|
63
|
+
|
|
64
|
+
Goods and services compete even when they provide functionality
|
|
65
|
+
through different kinds of interfaces or for different technical
|
|
66
|
+
platforms. Applications can compete with services, libraries
|
|
67
|
+
with plugins, frameworks with development tools, and so on,
|
|
68
|
+
even if they're written in different programming languages
|
|
69
|
+
or for different computer architectures. Goods and services
|
|
70
|
+
compete even when provided free of charge. If you market a
|
|
71
|
+
product as a practical substitute for the software or another
|
|
72
|
+
product, it definitely competes.
|
|
73
|
+
|
|
74
|
+
## New Products
|
|
75
|
+
|
|
76
|
+
If you are using the software to provide a product that does
|
|
77
|
+
not compete, but the licensor or any of its affiliates brings
|
|
78
|
+
your product into competition by providing a new version of
|
|
79
|
+
the software or another product using the software, you may
|
|
80
|
+
continue using versions of the software available under these
|
|
81
|
+
terms beforehand to provide your competing product, but not
|
|
82
|
+
any later versions.
|
|
83
|
+
|
|
84
|
+
## Discontinued Products
|
|
85
|
+
|
|
86
|
+
You may begin using the software to compete with a product
|
|
87
|
+
or service that the licensor or any of its affiliates has
|
|
88
|
+
stopped providing, unless the licensor includes a plain-text
|
|
89
|
+
line beginning with `Licensor Line of Business:` with the
|
|
90
|
+
software that mentions that line of business. For example:
|
|
91
|
+
|
|
92
|
+
> Licensor Line of Business: YoyodyneCMS Content Management
|
|
93
|
+
System (http://example.com/cms)
|
|
94
|
+
|
|
95
|
+
## Sales of Business
|
|
96
|
+
|
|
97
|
+
If the licensor or any of its affiliates sells a line of
|
|
98
|
+
business developing the software or using the software
|
|
99
|
+
to provide a product, the buyer can also enforce
|
|
100
|
+
[Noncompete](#noncompete) for that product.
|
|
101
|
+
|
|
102
|
+
## Fair Use
|
|
103
|
+
|
|
104
|
+
You may have "fair use" rights for the software under the
|
|
105
|
+
law. These terms do not limit them.
|
|
106
|
+
|
|
107
|
+
## No Other Rights
|
|
108
|
+
|
|
109
|
+
These terms do not allow you to sublicense or transfer any of
|
|
110
|
+
your licenses to anyone else, or prevent the licensor from
|
|
111
|
+
granting licenses to anyone else. These terms do not imply
|
|
112
|
+
any other licenses.
|
|
113
|
+
|
|
114
|
+
## Patent Defense
|
|
115
|
+
|
|
116
|
+
If you make any written claim that the software infringes or
|
|
117
|
+
contributes to infringement of any patent, your patent license
|
|
118
|
+
for the software granted under these terms ends immediately. If
|
|
119
|
+
your company makes such a claim, your patent license ends
|
|
120
|
+
immediately for work on behalf of your company.
|
|
121
|
+
|
|
122
|
+
## Violations
|
|
123
|
+
|
|
124
|
+
The first time you are notified in writing that you have
|
|
125
|
+
violated any of these terms, or done anything with the software
|
|
126
|
+
not covered by your licenses, your licenses can nonetheless
|
|
127
|
+
continue if you come into full compliance with these terms,
|
|
128
|
+
and take practical steps to correct past violations, within
|
|
129
|
+
32 days of receiving notice. Otherwise, all your licenses
|
|
130
|
+
end immediately.
|
|
131
|
+
|
|
132
|
+
## No Liability
|
|
133
|
+
|
|
134
|
+
***As far as the law allows, the software comes as is, without
|
|
135
|
+
any warranty or condition, and the licensor will not be liable
|
|
136
|
+
to you for any damages arising out of these terms or the use
|
|
137
|
+
or nature of the software, under any kind of legal claim.***
|
|
138
|
+
|
|
139
|
+
## Definitions
|
|
140
|
+
|
|
141
|
+
The **licensor** is the individual or entity offering these
|
|
142
|
+
terms, and the **software** is the software the licensor makes
|
|
143
|
+
available under these terms.
|
|
144
|
+
|
|
145
|
+
A **product** can be a good or service, or a combination
|
|
146
|
+
of them.
|
|
147
|
+
|
|
148
|
+
**You** refers to the individual or entity agreeing to these
|
|
149
|
+
terms.
|
|
150
|
+
|
|
151
|
+
**Your company** is any legal entity, sole proprietorship,
|
|
152
|
+
or other kind of organization that you work for, plus all
|
|
153
|
+
its affiliates.
|
|
154
|
+
|
|
155
|
+
**Affiliates** means the other organizations than an
|
|
156
|
+
organization has control over, is under the control of, or is
|
|
157
|
+
under common control with.
|
|
158
|
+
|
|
159
|
+
**Control** means ownership of substantially all the assets of
|
|
160
|
+
an entity, or the power to direct its management and policies
|
|
161
|
+
by vote, contract, or otherwise. Control can be direct or
|
|
162
|
+
indirect.
|
|
163
|
+
|
|
164
|
+
**Your licenses** are all the licenses granted to you for the
|
|
165
|
+
software under these terms.
|
|
166
|
+
|
|
167
|
+
**Use** means anything you do with the software requiring one
|
|
168
|
+
of your licenses.
|
package/moss_wasm.d.ts
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
export class IndexManager {
|
|
5
|
+
free(): void;
|
|
6
|
+
[Symbol.dispose](): void;
|
|
7
|
+
getIndexInfo(index_name: string): Promise<any>;
|
|
8
|
+
hasIndex(index_name: string): Promise<any>;
|
|
9
|
+
loadIndex(index_name: string): Promise<any>;
|
|
10
|
+
constructor(project_id: string, project_key: string);
|
|
11
|
+
query(index_name: string, query_text: string, query_embedding: Float32Array, top_k: number | null | undefined, alpha: number | null | undefined, filter: any): Promise<any>;
|
|
12
|
+
refreshIndex(index_name: string): Promise<any>;
|
|
13
|
+
unloadIndex(index_name: string): Promise<any>;
|
|
14
|
+
static withBaseUrl(project_id: string, project_key: string, base_url: string): IndexManager;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export class ManageClient {
|
|
18
|
+
free(): void;
|
|
19
|
+
[Symbol.dispose](): void;
|
|
20
|
+
addDocs(name: string, docs: any, upsert?: boolean | null): Promise<any>;
|
|
21
|
+
createIndex(name: string, docs: any, model_id: string): Promise<any>;
|
|
22
|
+
createIndexFromFiles(name: string, files: any, model_id: string): Promise<any>;
|
|
23
|
+
deleteDocs(name: string, doc_ids: string[]): Promise<any>;
|
|
24
|
+
deleteIndex(name: string): Promise<any>;
|
|
25
|
+
getDocs(name: string, doc_ids?: string[] | null): Promise<any>;
|
|
26
|
+
getIndex(name: string): Promise<any>;
|
|
27
|
+
getJobStatus(job_id: string): Promise<any>;
|
|
28
|
+
listIndexes(): Promise<any>;
|
|
29
|
+
constructor(project_id: string, project_key: string);
|
|
30
|
+
static withBaseUrl(project_id: string, project_key: string, base_url: string): ManageClient;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export class Tokenizer {
|
|
34
|
+
free(): void;
|
|
35
|
+
[Symbol.dispose](): void;
|
|
36
|
+
constructor(tokenizer_json: Uint8Array);
|
|
37
|
+
tokenize(text: string): any;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function poolAndNormalize(token_embeddings: Float32Array, attention_mask: Int32Array, hidden_dim: number): Float32Array;
|
|
41
|
+
|
|
42
|
+
export function sdk_version(): string;
|
|
43
|
+
|
|
44
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
45
|
+
|
|
46
|
+
export interface InitOutput {
|
|
47
|
+
readonly memory: WebAssembly.Memory;
|
|
48
|
+
readonly poolAndNormalize: (a: number, b: number, c: number, d: number, e: number) => [number, number, number, number];
|
|
49
|
+
readonly __wbg_indexmanager_free: (a: number, b: number) => void;
|
|
50
|
+
readonly indexmanager_getIndexInfo: (a: number, b: number, c: number) => any;
|
|
51
|
+
readonly indexmanager_hasIndex: (a: number, b: number, c: number) => any;
|
|
52
|
+
readonly indexmanager_loadIndex: (a: number, b: number, c: number) => any;
|
|
53
|
+
readonly indexmanager_new: (a: number, b: number, c: number, d: number) => number;
|
|
54
|
+
readonly indexmanager_query: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: any) => any;
|
|
55
|
+
readonly indexmanager_refreshIndex: (a: number, b: number, c: number) => any;
|
|
56
|
+
readonly indexmanager_unloadIndex: (a: number, b: number, c: number) => any;
|
|
57
|
+
readonly indexmanager_withBaseUrl: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
|
|
58
|
+
readonly __wbg_manageclient_free: (a: number, b: number) => void;
|
|
59
|
+
readonly manageclient_addDocs: (a: number, b: number, c: number, d: any, e: number) => any;
|
|
60
|
+
readonly manageclient_createIndex: (a: number, b: number, c: number, d: any, e: number, f: number) => any;
|
|
61
|
+
readonly manageclient_createIndexFromFiles: (a: number, b: number, c: number, d: any, e: number, f: number) => any;
|
|
62
|
+
readonly manageclient_deleteDocs: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
63
|
+
readonly manageclient_deleteIndex: (a: number, b: number, c: number) => any;
|
|
64
|
+
readonly manageclient_getDocs: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
65
|
+
readonly manageclient_getIndex: (a: number, b: number, c: number) => any;
|
|
66
|
+
readonly manageclient_getJobStatus: (a: number, b: number, c: number) => any;
|
|
67
|
+
readonly manageclient_listIndexes: (a: number) => any;
|
|
68
|
+
readonly manageclient_new: (a: number, b: number, c: number, d: number) => number;
|
|
69
|
+
readonly manageclient_withBaseUrl: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
|
|
70
|
+
readonly sdk_version: () => [number, number];
|
|
71
|
+
readonly __wbg_tokenizer_free: (a: number, b: number) => void;
|
|
72
|
+
readonly tokenizer_new: (a: number, b: number) => [number, number, number];
|
|
73
|
+
readonly tokenizer_tokenize: (a: number, b: number, c: number) => [number, number, number];
|
|
74
|
+
readonly wasm_bindgen__convert__closures_____invoke__h2c99d349e8a87fd1: (a: number, b: number, c: any) => [number, number];
|
|
75
|
+
readonly wasm_bindgen__convert__closures_____invoke__h068729b61954c03c: (a: number, b: number, c: any, d: any) => void;
|
|
76
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
77
|
+
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
78
|
+
readonly __wbindgen_exn_store: (a: number) => void;
|
|
79
|
+
readonly __externref_table_alloc: () => number;
|
|
80
|
+
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
81
|
+
readonly __wbindgen_destroy_closure: (a: number, b: number) => void;
|
|
82
|
+
readonly __externref_table_dealloc: (a: number) => void;
|
|
83
|
+
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
84
|
+
readonly __wbindgen_start: () => void;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
91
|
+
* a precompiled `WebAssembly.Module`.
|
|
92
|
+
*
|
|
93
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
94
|
+
*
|
|
95
|
+
* @returns {InitOutput}
|
|
96
|
+
*/
|
|
97
|
+
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
101
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
102
|
+
*
|
|
103
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
104
|
+
*
|
|
105
|
+
* @returns {Promise<InitOutput>}
|
|
106
|
+
*/
|
|
107
|
+
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|