@rezless/vm 0.1.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 +202 -0
- package/NOTICE +32 -0
- package/dist/builtins/base64.d.ts +25 -0
- package/dist/builtins/base64.d.ts.map +1 -0
- package/dist/builtins/base64.js +43 -0
- package/dist/builtins/base64.js.map +1 -0
- package/dist/builtins/chat.d.ts +10 -0
- package/dist/builtins/chat.d.ts.map +1 -0
- package/dist/builtins/chat.js +36 -0
- package/dist/builtins/chat.js.map +1 -0
- package/dist/builtins/dataserver.d.ts +26 -0
- package/dist/builtins/dataserver.d.ts.map +1 -0
- package/dist/builtins/dataserver.js +20 -0
- package/dist/builtins/dataserver.js.map +1 -0
- package/dist/builtins/detected.d.ts +40 -0
- package/dist/builtins/detected.d.ts.map +1 -0
- package/dist/builtins/detected.js +23 -0
- package/dist/builtins/detected.js.map +1 -0
- package/dist/builtins/hash.d.ts +6 -0
- package/dist/builtins/hash.d.ts.map +1 -0
- package/dist/builtins/hash.js +34 -0
- package/dist/builtins/hash.js.map +1 -0
- package/dist/builtins/http.d.ts +40 -0
- package/dist/builtins/http.d.ts.map +1 -0
- package/dist/builtins/http.js +87 -0
- package/dist/builtins/http.js.map +1 -0
- package/dist/builtins/identity.d.ts +14 -0
- package/dist/builtins/identity.d.ts.map +1 -0
- package/dist/builtins/identity.js +17 -0
- package/dist/builtins/identity.js.map +1 -0
- package/dist/builtins/index.d.ts +8 -0
- package/dist/builtins/index.d.ts.map +1 -0
- package/dist/builtins/index.js +232 -0
- package/dist/builtins/index.js.map +1 -0
- package/dist/builtins/inventory.d.ts +33 -0
- package/dist/builtins/inventory.d.ts.map +1 -0
- package/dist/builtins/inventory.js +134 -0
- package/dist/builtins/inventory.js.map +1 -0
- package/dist/builtins/json.d.ts +7 -0
- package/dist/builtins/json.d.ts.map +1 -0
- package/dist/builtins/json.js +690 -0
- package/dist/builtins/json.js.map +1 -0
- package/dist/builtins/link-info.d.ts +10 -0
- package/dist/builtins/link-info.d.ts.map +1 -0
- package/dist/builtins/link-info.js +26 -0
- package/dist/builtins/link-info.js.map +1 -0
- package/dist/builtins/linked.d.ts +23 -0
- package/dist/builtins/linked.d.ts.map +1 -0
- package/dist/builtins/linked.js +20 -0
- package/dist/builtins/linked.js.map +1 -0
- package/dist/builtins/linksetdata.d.ts +20 -0
- package/dist/builtins/linksetdata.d.ts.map +1 -0
- package/dist/builtins/linksetdata.js +196 -0
- package/dist/builtins/linksetdata.js.map +1 -0
- package/dist/builtins/listen.d.ts +33 -0
- package/dist/builtins/listen.d.ts.map +1 -0
- package/dist/builtins/listen.js +45 -0
- package/dist/builtins/listen.js.map +1 -0
- package/dist/builtins/lists.d.ts +37 -0
- package/dist/builtins/lists.d.ts.map +1 -0
- package/dist/builtins/lists.js +275 -0
- package/dist/builtins/lists.js.map +1 -0
- package/dist/builtins/math.d.ts +32 -0
- package/dist/builtins/math.d.ts.map +1 -0
- package/dist/builtins/math.js +104 -0
- package/dist/builtins/math.js.map +1 -0
- package/dist/builtins/object.d.ts +29 -0
- package/dist/builtins/object.d.ts.map +1 -0
- package/dist/builtins/object.js +50 -0
- package/dist/builtins/object.js.map +1 -0
- package/dist/builtins/prim-accessors.d.ts +56 -0
- package/dist/builtins/prim-accessors.d.ts.map +1 -0
- package/dist/builtins/prim-accessors.js +353 -0
- package/dist/builtins/prim-accessors.js.map +1 -0
- package/dist/builtins/prim-params.d.ts +12 -0
- package/dist/builtins/prim-params.d.ts.map +1 -0
- package/dist/builtins/prim-params.js +124 -0
- package/dist/builtins/prim-params.js.map +1 -0
- package/dist/builtins/script-control.d.ts +13 -0
- package/dist/builtins/script-control.d.ts.map +1 -0
- package/dist/builtins/script-control.js +41 -0
- package/dist/builtins/script-control.js.map +1 -0
- package/dist/builtins/strings.d.ts +23 -0
- package/dist/builtins/strings.d.ts.map +1 -0
- package/dist/builtins/strings.js +130 -0
- package/dist/builtins/strings.js.map +1 -0
- package/dist/builtins/time.d.ts +28 -0
- package/dist/builtins/time.d.ts.map +1 -0
- package/dist/builtins/time.js +54 -0
- package/dist/builtins/time.js.map +1 -0
- package/dist/clock.d.ts +75 -0
- package/dist/clock.d.ts.map +1 -0
- package/dist/clock.js +125 -0
- package/dist/clock.js.map +1 -0
- package/dist/coverage.d.ts +110 -0
- package/dist/coverage.d.ts.map +1 -0
- package/dist/coverage.js +221 -0
- package/dist/coverage.js.map +1 -0
- package/dist/dispatch.d.ts +19 -0
- package/dist/dispatch.d.ts.map +1 -0
- package/dist/dispatch.js +42 -0
- package/dist/dispatch.js.map +1 -0
- package/dist/env.d.ts +33 -0
- package/dist/env.d.ts.map +1 -0
- package/dist/env.js +76 -0
- package/dist/env.js.map +1 -0
- package/dist/generated/constants.d.ts +967 -0
- package/dist/generated/constants.d.ts.map +1 -0
- package/dist/generated/constants.js +969 -0
- package/dist/generated/constants.js.map +1 -0
- package/dist/generated/constants_table.d.ts +11 -0
- package/dist/generated/constants_table.d.ts.map +1 -0
- package/dist/generated/constants_table.js +978 -0
- package/dist/generated/constants_table.js.map +1 -0
- package/dist/generated/events.d.ts +545 -0
- package/dist/generated/events.d.ts.map +1 -0
- package/dist/generated/events.js +49 -0
- package/dist/generated/events.js.map +1 -0
- package/dist/generated/functions.d.ts +6051 -0
- package/dist/generated/functions.d.ts.map +1 -0
- package/dist/generated/functions.js +526 -0
- package/dist/generated/functions.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/interpreter.d.ts +39 -0
- package/dist/interpreter.d.ts.map +1 -0
- package/dist/interpreter.js +381 -0
- package/dist/interpreter.js.map +1 -0
- package/dist/inventory.d.ts +52 -0
- package/dist/inventory.d.ts.map +1 -0
- package/dist/inventory.js +45 -0
- package/dist/inventory.js.map +1 -0
- package/dist/linkset.d.ts +89 -0
- package/dist/linkset.d.ts.map +1 -0
- package/dist/linkset.js +179 -0
- package/dist/linkset.js.map +1 -0
- package/dist/prim-params.d.ts +221 -0
- package/dist/prim-params.d.ts.map +1 -0
- package/dist/prim-params.js +852 -0
- package/dist/prim-params.js.map +1 -0
- package/dist/prim.d.ts +79 -0
- package/dist/prim.d.ts.map +1 -0
- package/dist/prim.js +96 -0
- package/dist/prim.js.map +1 -0
- package/dist/random.d.ts +16 -0
- package/dist/random.d.ts.map +1 -0
- package/dist/random.js +29 -0
- package/dist/random.js.map +1 -0
- package/dist/runtime.d.ts +108 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +2 -0
- package/dist/runtime.js.map +1 -0
- package/dist/script.d.ts +248 -0
- package/dist/script.d.ts.map +1 -0
- package/dist/script.js +667 -0
- package/dist/script.js.map +1 -0
- package/dist/values/coerce.d.ts +22 -0
- package/dist/values/coerce.d.ts.map +1 -0
- package/dist/values/coerce.js +184 -0
- package/dist/values/coerce.js.map +1 -0
- package/dist/values/format.d.ts +20 -0
- package/dist/values/format.d.ts.map +1 -0
- package/dist/values/format.js +47 -0
- package/dist/values/format.js.map +1 -0
- package/dist/values/ops.d.ts +19 -0
- package/dist/values/ops.d.ts.map +1 -0
- package/dist/values/ops.js +345 -0
- package/dist/values/ops.js.map +1 -0
- package/dist/values/types.d.ts +39 -0
- package/dist/values/types.d.ts.map +1 -0
- package/dist/values/types.js +68 -0
- package/dist/values/types.js.map +1 -0
- package/package.json +52 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/NOTICE
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
rezless
|
|
2
|
+
Copyright 2026 The rezless contributors
|
|
3
|
+
|
|
4
|
+
This product is licensed under the Apache License, Version 2.0 (see LICENSE).
|
|
5
|
+
|
|
6
|
+
================================================================================
|
|
7
|
+
|
|
8
|
+
Third-party content
|
|
9
|
+
-------------------
|
|
10
|
+
|
|
11
|
+
This repository vendors and uses content from the Sei-Lisa/kwdb project
|
|
12
|
+
(https://github.com/Sei-Lisa/kwdb), which is licensed under the GNU Lesser
|
|
13
|
+
General Public License (LGPL) version 3 or later.
|
|
14
|
+
|
|
15
|
+
Copyright (C) 2012 Linden Research, Inc.
|
|
16
|
+
Copyright (C) 2013-2025 Sei Lisa.
|
|
17
|
+
Copyright (C) 2017-2023 Mako Nozaki.
|
|
18
|
+
Copyright (C) 2023-2023 Alex Carpenter.
|
|
19
|
+
|
|
20
|
+
The vendored data file and any output mechanically derived from it remain
|
|
21
|
+
under their original LGPL-3.0-or-later license:
|
|
22
|
+
|
|
23
|
+
vendor/kwdb.xml (the data file)
|
|
24
|
+
packages/vm/src/generated/constants.ts (derived)
|
|
25
|
+
packages/vm/src/generated/constants_table.ts (derived)
|
|
26
|
+
packages/vm/src/generated/functions.ts (derived)
|
|
27
|
+
packages/vm/src/generated/events.ts (derived)
|
|
28
|
+
|
|
29
|
+
Full LGPL-3.0 text: https://www.gnu.org/licenses/lgpl-3.0.html
|
|
30
|
+
Attribution detail: vendor/LICENSE-kwdb
|
|
31
|
+
|
|
32
|
+
Second Life is a registered trademark of Linden Research, Inc.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { BuiltinImpl } from '../runtime.js';
|
|
2
|
+
/**
|
|
3
|
+
* Base64 encode/decode builtins. LSL's base64 alphabet matches RFC 4648
|
|
4
|
+
* standard (Node's `Buffer` default). Padding behaviour: LSL pads with `=`,
|
|
5
|
+
* which Buffer also produces.
|
|
6
|
+
*/
|
|
7
|
+
export declare const llStringToBase64: BuiltinImpl;
|
|
8
|
+
export declare const llBase64ToString: BuiltinImpl;
|
|
9
|
+
/**
|
|
10
|
+
* llIntegerToBase64(integer x) — encodes the 32-bit big-endian
|
|
11
|
+
* representation of x as 6 base64 chars (24 bits → 4 chars × 6 bits, padded
|
|
12
|
+
* to 4 chars per encoding round). LSL's specific output is 8 chars: e.g.
|
|
13
|
+
* llIntegerToBase64(0) → "AAAAAA=="
|
|
14
|
+
* llIntegerToBase64(0xFF) → "AAAA/w==" (no — actually "/w==" right-aligned)
|
|
15
|
+
*
|
|
16
|
+
* The reference output is the standard base64 encoding of the 4-byte
|
|
17
|
+
* big-endian integer.
|
|
18
|
+
*/
|
|
19
|
+
export declare const llIntegerToBase64: BuiltinImpl;
|
|
20
|
+
/**
|
|
21
|
+
* llBase64ToInteger(string s) — inverse of llIntegerToBase64.
|
|
22
|
+
* Returns 0 if the input doesn't decode to at least 4 bytes.
|
|
23
|
+
*/
|
|
24
|
+
export declare const llBase64ToInteger: BuiltinImpl;
|
|
25
|
+
//# sourceMappingURL=base64.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base64.d.ts","sourceRoot":"","sources":["../../src/builtins/base64.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAGhD;;;;GAIG;AAEH,eAAO,MAAM,gBAAgB,EAAE,WAG9B,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,WAI9B,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,EAAE,WAK/B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,WAK/B,CAAA"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { toInt32 } from '../values/types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Base64 encode/decode builtins. LSL's base64 alphabet matches RFC 4648
|
|
4
|
+
* standard (Node's `Buffer` default). Padding behaviour: LSL pads with `=`,
|
|
5
|
+
* which Buffer also produces.
|
|
6
|
+
*/
|
|
7
|
+
export const llStringToBase64 = (_ctx, args) => {
|
|
8
|
+
const s = args[0] ?? '';
|
|
9
|
+
return Buffer.from(s, 'utf8').toString('base64');
|
|
10
|
+
};
|
|
11
|
+
export const llBase64ToString = (_ctx, args) => {
|
|
12
|
+
const s = args[0] ?? '';
|
|
13
|
+
// LSL silently tolerates malformed input; Buffer does too.
|
|
14
|
+
return Buffer.from(s, 'base64').toString('utf8');
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* llIntegerToBase64(integer x) — encodes the 32-bit big-endian
|
|
18
|
+
* representation of x as 6 base64 chars (24 bits → 4 chars × 6 bits, padded
|
|
19
|
+
* to 4 chars per encoding round). LSL's specific output is 8 chars: e.g.
|
|
20
|
+
* llIntegerToBase64(0) → "AAAAAA=="
|
|
21
|
+
* llIntegerToBase64(0xFF) → "AAAA/w==" (no — actually "/w==" right-aligned)
|
|
22
|
+
*
|
|
23
|
+
* The reference output is the standard base64 encoding of the 4-byte
|
|
24
|
+
* big-endian integer.
|
|
25
|
+
*/
|
|
26
|
+
export const llIntegerToBase64 = (_ctx, args) => {
|
|
27
|
+
const x = toInt32(args[0] ?? 0);
|
|
28
|
+
const buf = Buffer.alloc(4);
|
|
29
|
+
buf.writeInt32BE(x, 0);
|
|
30
|
+
return buf.toString('base64');
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* llBase64ToInteger(string s) — inverse of llIntegerToBase64.
|
|
34
|
+
* Returns 0 if the input doesn't decode to at least 4 bytes.
|
|
35
|
+
*/
|
|
36
|
+
export const llBase64ToInteger = (_ctx, args) => {
|
|
37
|
+
const s = args[0] ?? '';
|
|
38
|
+
const buf = Buffer.from(s, 'base64');
|
|
39
|
+
if (buf.length < 4)
|
|
40
|
+
return 0;
|
|
41
|
+
return buf.readInt32BE(0);
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=base64.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base64.js","source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CAAC,CAAC,EAAE,QAAQ,CAAC,CAAA;IACpC,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,CAAC,CAAA;IAC5B,OAAO,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAA;AAC3B,CAAC,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { BuiltinImpl } from '../runtime.js';
|
|
2
|
+
/** llSay(integer channel, string msg) — captures into ScriptState.chat. */
|
|
3
|
+
export declare const llSay: BuiltinImpl;
|
|
4
|
+
/** llShout(integer channel, string msg) */
|
|
5
|
+
export declare const llShout: BuiltinImpl;
|
|
6
|
+
/** llWhisper(integer channel, string msg) */
|
|
7
|
+
export declare const llWhisper: BuiltinImpl;
|
|
8
|
+
/** llOwnerSay(string msg) — channel 0 by convention; LSL routes it privately to the owner. */
|
|
9
|
+
export declare const llOwnerSay: BuiltinImpl;
|
|
10
|
+
//# sourceMappingURL=chat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../src/builtins/chat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAGhD,2EAA2E;AAC3E,eAAO,MAAM,KAAK,EAAE,WAKnB,CAAA;AAED,2CAA2C;AAC3C,eAAO,MAAM,OAAO,EAAE,WAOrB,CAAA;AAED,6CAA6C;AAC7C,eAAO,MAAM,SAAS,EAAE,WAOvB,CAAA;AAED,8FAA8F;AAC9F,eAAO,MAAM,UAAU,EAAE,WAOxB,CAAA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { PUBLIC_CHANNEL } from '../generated/constants.js';
|
|
2
|
+
/** llSay(integer channel, string msg) — captures into ScriptState.chat. */
|
|
3
|
+
export const llSay = (ctx, args) => {
|
|
4
|
+
const channel = args[0] ?? 0;
|
|
5
|
+
const text = args[1] ?? '';
|
|
6
|
+
ctx.state.chat.push({ channel, text, type: 'say' });
|
|
7
|
+
return undefined;
|
|
8
|
+
};
|
|
9
|
+
/** llShout(integer channel, string msg) */
|
|
10
|
+
export const llShout = (ctx, args) => {
|
|
11
|
+
ctx.state.chat.push({
|
|
12
|
+
channel: args[0] ?? 0,
|
|
13
|
+
text: args[1] ?? '',
|
|
14
|
+
type: 'shout',
|
|
15
|
+
});
|
|
16
|
+
return undefined;
|
|
17
|
+
};
|
|
18
|
+
/** llWhisper(integer channel, string msg) */
|
|
19
|
+
export const llWhisper = (ctx, args) => {
|
|
20
|
+
ctx.state.chat.push({
|
|
21
|
+
channel: args[0] ?? 0,
|
|
22
|
+
text: args[1] ?? '',
|
|
23
|
+
type: 'whisper',
|
|
24
|
+
});
|
|
25
|
+
return undefined;
|
|
26
|
+
};
|
|
27
|
+
/** llOwnerSay(string msg) — channel 0 by convention; LSL routes it privately to the owner. */
|
|
28
|
+
export const llOwnerSay = (ctx, args) => {
|
|
29
|
+
ctx.state.chat.push({
|
|
30
|
+
channel: PUBLIC_CHANNEL,
|
|
31
|
+
text: args[0] ?? '',
|
|
32
|
+
type: 'ownerSay',
|
|
33
|
+
});
|
|
34
|
+
return undefined;
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=chat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat.js","sourceRoot":"","sources":["../../src/builtins/chat.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAE1D,2EAA2E;AAC3E,MAAM,CAAC,MAAM,KAAK,GAAgB,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;IAC9C,MAAM,OAAO,GAAI,IAAI,CAAC,CAAC,CAAwB,IAAI,CAAC,CAAA;IACpD,MAAM,IAAI,GAAI,IAAI,CAAC,CAAC,CAAwB,IAAI,EAAE,CAAA;IAClD,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAA;IACnD,OAAO,SAAS,CAAA;AAClB,CAAC,CAAA;AAED,2CAA2C;AAC3C,MAAM,CAAC,MAAM,OAAO,GAAgB,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;IAChD,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;QAClB,OAAO,EAAG,IAAI,CAAC,CAAC,CAAwB,IAAI,CAAC;QAC7C,IAAI,EAAG,IAAI,CAAC,CAAC,CAAwB,IAAI,EAAE;QAC3C,IAAI,EAAE,OAAO;KACd,CAAC,CAAA;IACF,OAAO,SAAS,CAAA;AAClB,CAAC,CAAA;AAED,6CAA6C;AAC7C,MAAM,CAAC,MAAM,SAAS,GAAgB,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;IAClD,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;QAClB,OAAO,EAAG,IAAI,CAAC,CAAC,CAAwB,IAAI,CAAC;QAC7C,IAAI,EAAG,IAAI,CAAC,CAAC,CAAwB,IAAI,EAAE;QAC3C,IAAI,EAAE,SAAS;KAChB,CAAC,CAAA;IACF,OAAO,SAAS,CAAA;AAClB,CAAC,CAAA;AAED,8FAA8F;AAC9F,MAAM,CAAC,MAAM,UAAU,GAAgB,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;IACnD,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;QAClB,OAAO,EAAE,cAAc;QACvB,IAAI,EAAG,IAAI,CAAC,CAAC,CAAwB,IAAI,EAAE;QAC3C,IAAI,EAAE,UAAU;KACjB,CAAC,CAAA;IACF,OAAO,SAAS,CAAA;AAClB,CAAC,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { BuiltinImpl } from '../runtime.js';
|
|
2
|
+
/**
|
|
3
|
+
* A pending dataserver request. LSL has a small zoo of llRequest*
|
|
4
|
+
* functions that each return a key and later fire the `dataserver` event
|
|
5
|
+
* with the result. We model them all the same way: capture the request,
|
|
6
|
+
* generate a key, expose for tests to respond to via Script.respondToDataserver.
|
|
7
|
+
*/
|
|
8
|
+
export interface DataserverRequestEntry {
|
|
9
|
+
readonly key: string;
|
|
10
|
+
/** "agent_data", "inventory_data", "simulator_data", … — origin builtin name. */
|
|
11
|
+
readonly source: string;
|
|
12
|
+
/** Raw arguments captured for assertion convenience. */
|
|
13
|
+
readonly args: ReadonlyArray<unknown>;
|
|
14
|
+
fulfilled: boolean;
|
|
15
|
+
}
|
|
16
|
+
/** llRequestAgentData(key id, integer data) → request key */
|
|
17
|
+
export declare const llRequestAgentData: BuiltinImpl;
|
|
18
|
+
/** llRequestInventoryData(string name) → request key */
|
|
19
|
+
export declare const llRequestInventoryData: BuiltinImpl;
|
|
20
|
+
/** llRequestSimulatorData(string region, integer data) → request key */
|
|
21
|
+
export declare const llRequestSimulatorData: BuiltinImpl;
|
|
22
|
+
/** llRequestUsername(key id) → request key */
|
|
23
|
+
export declare const llRequestUsername: BuiltinImpl;
|
|
24
|
+
/** llRequestDisplayName(key id) → request key */
|
|
25
|
+
export declare const llRequestDisplayName: BuiltinImpl;
|
|
26
|
+
//# sourceMappingURL=dataserver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataserver.d.ts","sourceRoot":"","sources":["../../src/builtins/dataserver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAEhD;;;;;GAKG;AACH,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,iFAAiF;IACjF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,wDAAwD;IACxD,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC,OAAO,CAAC,CAAA;IACrC,SAAS,EAAE,OAAO,CAAA;CACnB;AAiBD,6DAA6D;AAC7D,eAAO,MAAM,kBAAkB,EAAE,WACc,CAAA;AAE/C,wDAAwD;AACxD,eAAO,MAAM,sBAAsB,EAAE,WACK,CAAA;AAE1C,wEAAwE;AACxE,eAAO,MAAM,sBAAsB,EAAE,WACc,CAAA;AAEnD,8CAA8C;AAC9C,eAAO,MAAM,iBAAiB,EAAE,WACI,CAAA;AAEpC,iDAAiD;AACjD,eAAO,MAAM,oBAAoB,EAAE,WACK,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
function nextKey(state) {
|
|
2
|
+
state.dataserverKeyCounter += 1;
|
|
3
|
+
return `data-req-${String(state.dataserverKeyCounter).padStart(8, '0')}`;
|
|
4
|
+
}
|
|
5
|
+
function record(ctx, source, args) {
|
|
6
|
+
const key = nextKey(ctx.state);
|
|
7
|
+
ctx.state.dataserverRequests.push({ key, source, args, fulfilled: false });
|
|
8
|
+
return key;
|
|
9
|
+
}
|
|
10
|
+
/** llRequestAgentData(key id, integer data) → request key */
|
|
11
|
+
export const llRequestAgentData = (ctx, args) => record(ctx, 'agent_data', [args[0], args[1]]);
|
|
12
|
+
/** llRequestInventoryData(string name) → request key */
|
|
13
|
+
export const llRequestInventoryData = (ctx, args) => record(ctx, 'inventory_data', [args[0]]);
|
|
14
|
+
/** llRequestSimulatorData(string region, integer data) → request key */
|
|
15
|
+
export const llRequestSimulatorData = (ctx, args) => record(ctx, 'simulator_data', [args[0], args[1]]);
|
|
16
|
+
/** llRequestUsername(key id) → request key */
|
|
17
|
+
export const llRequestUsername = (ctx, args) => record(ctx, 'username', [args[0]]);
|
|
18
|
+
/** llRequestDisplayName(key id) → request key */
|
|
19
|
+
export const llRequestDisplayName = (ctx, args) => record(ctx, 'display_name', [args[0]]);
|
|
20
|
+
//# sourceMappingURL=dataserver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataserver.js","sourceRoot":"","sources":["../../src/builtins/dataserver.ts"],"names":[],"mappings":"AAiBA,SAAS,OAAO,CAAC,KAAuC;IACtD,KAAK,CAAC,oBAAoB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AAA;AAEpC,iDAAiD;AACjD,MAAM,CAAC,MAAM,oBAAoB,GAAgB,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAC7D,MAAM,CAAC,GAAG,EAAE,cAAc,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { BuiltinImpl } from '../runtime.js';
|
|
2
|
+
import type { Vector, Rotation } from '../values/types.js';
|
|
3
|
+
/**
|
|
4
|
+
* One entry in the per-handler "detected" context — the data exposed to
|
|
5
|
+
* llDetected* family functions while a touch / sensor / collision handler
|
|
6
|
+
* is running. Tests provide this via the event payload (e.g.
|
|
7
|
+
* `s.fire('touch_start', { num_detected: 1, detected: [{...}] })`).
|
|
8
|
+
*/
|
|
9
|
+
export interface DetectedEntry {
|
|
10
|
+
readonly key: string;
|
|
11
|
+
readonly name: string;
|
|
12
|
+
readonly owner?: string;
|
|
13
|
+
readonly group?: string;
|
|
14
|
+
readonly pos?: Vector;
|
|
15
|
+
readonly rot?: Rotation;
|
|
16
|
+
readonly vel?: Vector;
|
|
17
|
+
readonly type?: number;
|
|
18
|
+
readonly linkNumber?: number;
|
|
19
|
+
readonly grab?: Vector;
|
|
20
|
+
readonly touchPos?: Vector;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Per-handler detected context. The interpreter sets this before invoking
|
|
24
|
+
* a touch / sensor / collision handler and clears it on return.
|
|
25
|
+
*/
|
|
26
|
+
export interface DetectedContext {
|
|
27
|
+
readonly entries: ReadonlyArray<DetectedEntry>;
|
|
28
|
+
}
|
|
29
|
+
export declare const llDetectedKey: BuiltinImpl;
|
|
30
|
+
export declare const llDetectedName: BuiltinImpl;
|
|
31
|
+
export declare const llDetectedOwner: BuiltinImpl;
|
|
32
|
+
export declare const llDetectedGroup: BuiltinImpl;
|
|
33
|
+
export declare const llDetectedPos: BuiltinImpl;
|
|
34
|
+
export declare const llDetectedRot: BuiltinImpl;
|
|
35
|
+
export declare const llDetectedVel: BuiltinImpl;
|
|
36
|
+
export declare const llDetectedType: BuiltinImpl;
|
|
37
|
+
export declare const llDetectedLinkNumber: BuiltinImpl;
|
|
38
|
+
export declare const llDetectedGrab: BuiltinImpl;
|
|
39
|
+
export declare const llDetectedTouchPos: BuiltinImpl;
|
|
40
|
+
//# sourceMappingURL=detected.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detected.d.ts","sourceRoot":"","sources":["../../src/builtins/detected.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAG1D;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAA;IACvB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAC3B;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC,aAAa,CAAC,CAAA;CAC/C;AAgBD,eAAO,MAAM,aAAa,EAAE,WAA8D,CAAA;AAC1F,eAAO,MAAM,cAAc,EAAE,WAAyD,CAAA;AACtF,eAAO,MAAM,eAAe,EAAE,WACgC,CAAA;AAC9D,eAAO,MAAM,eAAe,EAAE,WAAgE,CAAA;AAC9F,eAAO,MAAM,aAAa,EAAE,WAAiE,CAAA;AAC7F,eAAO,MAAM,aAAa,EAAE,WAAmE,CAAA;AAC/F,eAAO,MAAM,aAAa,EAAE,WAAiE,CAAA;AAC7F,eAAO,MAAM,cAAc,EAAE,WAAwD,CAAA;AACrF,eAAO,MAAM,oBAAoB,EAAE,WACA,CAAA;AACnC,eAAO,MAAM,cAAc,EAAE,WAAkE,CAAA;AAC/F,eAAO,MAAM,kBAAkB,EAAE,WACU,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ZERO_VECTOR, ZERO_ROTATION, NULL_KEY } from '../values/types.js';
|
|
2
|
+
function get(ctx) {
|
|
3
|
+
return ctx.state.detectedStack[ctx.state.detectedStack.length - 1]?.entries ?? [];
|
|
4
|
+
}
|
|
5
|
+
function entry(ctx, args) {
|
|
6
|
+
const i = args[0] ?? 0;
|
|
7
|
+
const list = get(ctx);
|
|
8
|
+
if (i < 0 || i >= list.length)
|
|
9
|
+
return undefined;
|
|
10
|
+
return list[i];
|
|
11
|
+
}
|
|
12
|
+
export const llDetectedKey = (ctx, args) => entry(ctx, args)?.key ?? NULL_KEY;
|
|
13
|
+
export const llDetectedName = (ctx, args) => entry(ctx, args)?.name ?? '';
|
|
14
|
+
export const llDetectedOwner = (ctx, args) => entry(ctx, args)?.owner ?? entry(ctx, args)?.key ?? NULL_KEY;
|
|
15
|
+
export const llDetectedGroup = (ctx, args) => entry(ctx, args)?.group ?? NULL_KEY;
|
|
16
|
+
export const llDetectedPos = (ctx, args) => entry(ctx, args)?.pos ?? ZERO_VECTOR;
|
|
17
|
+
export const llDetectedRot = (ctx, args) => entry(ctx, args)?.rot ?? ZERO_ROTATION;
|
|
18
|
+
export const llDetectedVel = (ctx, args) => entry(ctx, args)?.vel ?? ZERO_VECTOR;
|
|
19
|
+
export const llDetectedType = (ctx, args) => entry(ctx, args)?.type ?? 0;
|
|
20
|
+
export const llDetectedLinkNumber = (ctx, args) => entry(ctx, args)?.linkNumber ?? 0;
|
|
21
|
+
export const llDetectedGrab = (ctx, args) => entry(ctx, args)?.grab ?? ZERO_VECTOR;
|
|
22
|
+
export const llDetectedTouchPos = (ctx, args) => entry(ctx, args)?.touchPos ?? ZERO_VECTOR;
|
|
23
|
+
//# sourceMappingURL=detected.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detected.js","sourceRoot":"","sources":["../../src/builtins/detected.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AA8BzE,SAAS,GAAG,CAAC,GAA+B;IAC1C,OAAO,GAAG,CAAC,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,OAAO,IAAI,EAAE,CAAA;AACnF,CAAC;AAED,SAAS,KAAK,CACZ,GAA+B,EAC/B,IAA4B;IAE5B,MAAM,CAAC,GAAI,IAAI,CAAC,CAAC,CAAwB,IAAI,CAAC,CAAA;IAC9C,MAAM,IAAI,GAAG,GAAG,CAAC,GAAG,CAAC,CAAA;IACrB,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM;QAAE,OAAO,SAAS,CAAA;IAC/C,OAAO,IAAI,CAAC,CAAC,CAAC,CAAA;AAChB,CAAC;AAED,MAAM,CAAC,MAAM,aAAa,GAAgB,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,GAAG,IAAI,QAAQ,CAAA;AAC1F,MAAM,CAAC,MAAM,cAAc,GAAgB,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,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AAE,IAAI,IAAI,WAAW,CAAA;AAC/F,MAAM,CAAC,MAAM,kBAAkB,GAAgB,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAC3D,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,QAAQ,IAAI,WAAW,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { BuiltinImpl } from '../runtime.js';
|
|
2
|
+
export declare const llMD5String: BuiltinImpl;
|
|
3
|
+
export declare const llSHA1String: BuiltinImpl;
|
|
4
|
+
export declare const llSHA256String: BuiltinImpl;
|
|
5
|
+
export declare const llHMAC: BuiltinImpl;
|
|
6
|
+
//# sourceMappingURL=hash.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../../src/builtins/hash.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAShD,eAAO,MAAM,WAAW,EAAE,WAOzB,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,WAG1B,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,WAG5B,CAAA;AAED,eAAO,MAAM,MAAM,EAAE,WASpB,CAAA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { createHash, createHmac } from 'node:crypto';
|
|
2
|
+
/**
|
|
3
|
+
* Hash and HMAC builtins. LSL uses UTF-8 byte representation of strings as
|
|
4
|
+
* input; Node's crypto handles that naturally with `update(str, 'utf8')`.
|
|
5
|
+
*/
|
|
6
|
+
const lowerHex = (h) => h.digest('hex');
|
|
7
|
+
export const llMD5String = (_ctx, args) => {
|
|
8
|
+
const message = args[0] ?? '';
|
|
9
|
+
const nonce = args[1] ?? 0;
|
|
10
|
+
// LSL: llMD5String("foo", 1) digests "foo:1"
|
|
11
|
+
const h = createHash('md5');
|
|
12
|
+
h.update(`${message}:${nonce}`, 'utf8');
|
|
13
|
+
return lowerHex(h);
|
|
14
|
+
};
|
|
15
|
+
export const llSHA1String = (_ctx, args) => {
|
|
16
|
+
const message = args[0] ?? '';
|
|
17
|
+
return lowerHex(createHash('sha1').update(message, 'utf8'));
|
|
18
|
+
};
|
|
19
|
+
export const llSHA256String = (_ctx, args) => {
|
|
20
|
+
const message = args[0] ?? '';
|
|
21
|
+
return lowerHex(createHash('sha256').update(message, 'utf8'));
|
|
22
|
+
};
|
|
23
|
+
export const llHMAC = (_ctx, args) => {
|
|
24
|
+
const key = args[0] ?? '';
|
|
25
|
+
const message = args[1] ?? '';
|
|
26
|
+
const algo = (args[2] ?? 'sha256').toLowerCase();
|
|
27
|
+
const supported = new Set(['md5', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512']);
|
|
28
|
+
if (!supported.has(algo))
|
|
29
|
+
return '';
|
|
30
|
+
// Per kwdb: llHMAC returns the *Base64*-encoded HMAC, unlike the other
|
|
31
|
+
// hash builtins which return lowercase hex.
|
|
32
|
+
return createHmac(algo, key).update(message, 'utf8').digest('base64');
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=hash.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hash.js","sourceRoot":"","sources":["../../src/builtins/hash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAGpD;;;GAGG;AAEH,MAAM,QAAQ,GAAG,CAAC,CAA0D,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AAEhG,MAAM,CAAC,MAAM,WAAW,GAAgB,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE;IACrD,MAAM,OAAO,GAAI,IAAI,CAAC,CAAC,CAAwB,IAAI,EAAE,CAAA;IACrD,MAAM,KAAK,GAAI,IAAI,CAAC,CAAC,CAAwB,IAAI,CAAC,CAAA;IAClD,6CAA6C;IAC7C,MAAM,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,CAAA;IAC3B,CA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CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;AACvE,CAAC,CAAA"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { BuiltinImpl } from '../runtime.js';
|
|
2
|
+
import type { LslValue } from '../values/types.js';
|
|
3
|
+
import { NULL_KEY } from '../values/types.js';
|
|
4
|
+
/**
|
|
5
|
+
* Captured outgoing HTTP request, exposed via Script.httpRequests so tests
|
|
6
|
+
* can assert on what the script fired off, and reply to it via
|
|
7
|
+
* Script.respondToHttp.
|
|
8
|
+
*/
|
|
9
|
+
export interface HttpRequestEntry {
|
|
10
|
+
/** Request key returned by llHTTPRequest; used to match the response. */
|
|
11
|
+
readonly key: string;
|
|
12
|
+
readonly url: string;
|
|
13
|
+
/** Default `GET`; overridden by HTTP_METHOD in the options list. */
|
|
14
|
+
readonly method: string;
|
|
15
|
+
readonly body: string;
|
|
16
|
+
/** Default `text/plain;charset=utf-8`; overridden by HTTP_MIMETYPE. */
|
|
17
|
+
readonly mimetype: string;
|
|
18
|
+
/** Custom headers from HTTP_CUSTOM_HEADER pairs in the options list. */
|
|
19
|
+
readonly headers: ReadonlyArray<readonly [name: string, value: string]>;
|
|
20
|
+
/** Raw, unparsed options list as passed to llHTTPRequest, for completeness. */
|
|
21
|
+
readonly rawOptions: ReadonlyArray<LslValue>;
|
|
22
|
+
/** Whether a response has been fed back to this request yet. */
|
|
23
|
+
fulfilled: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* llHTTPRequest(string url, list options, string body) → key
|
|
27
|
+
*
|
|
28
|
+
* Captures the request into ScriptState.httpRequests and returns a
|
|
29
|
+
* deterministic key. Tests respond via Script.respondToHttp(key, ...),
|
|
30
|
+
* which schedules an http_response event.
|
|
31
|
+
*/
|
|
32
|
+
export declare const llHTTPRequest: BuiltinImpl;
|
|
33
|
+
/**
|
|
34
|
+
* llHTTPResponse(key request_id, integer status, string body) — used by
|
|
35
|
+
* scripts that hold an inbound HTTP request from llRequestURL. Captured
|
|
36
|
+
* but not otherwise modelled (no inbound URL feature in this PR).
|
|
37
|
+
*/
|
|
38
|
+
export declare const llHTTPResponse: BuiltinImpl;
|
|
39
|
+
export { NULL_KEY as HTTP_NULL_KEY };
|
|
40
|
+
//# sourceMappingURL=http.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/builtins/http.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAO7C;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,yEAAyE;IACzE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,oEAAoE;IACpE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,uEAAuE;IACvE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,wEAAwE;IACxE,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAA;IACvE,+EAA+E;IAC/E,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAA;IAC5C,gEAAgE;IAChE,SAAS,EAAE,OAAO,CAAA;CACnB;AA0DD;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,EAAE,WAiB3B,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,WAE5B,CAAA;AAED,OAAO,EAAE,QAAQ,IAAI,aAAa,EAAE,CAAA"}
|