@sharedots/cli 0.1.0 → 0.1.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/src/parser.ts ADDED
@@ -0,0 +1,77 @@
1
+ const BOOLEAN_FLAGS = new Set([
2
+ "help",
3
+ "h",
4
+ "yes",
5
+ "y",
6
+ "cluster",
7
+ "contributor",
8
+ "foreground",
9
+ "gpu",
10
+ "json",
11
+ ]);
12
+
13
+ export function parseFlags(argv: string[]): { positional: string[]; flags: Record<string, string | boolean> } {
14
+ const positional: string[] = [];
15
+ const flags: Record<string, string | boolean> = {};
16
+ let endOfFlags = false;
17
+
18
+ for (let i = 0; i < argv.length; i++) {
19
+ const arg = argv[i]!;
20
+
21
+ if (endOfFlags) {
22
+ positional.push(arg);
23
+ continue;
24
+ }
25
+
26
+ if (arg === "--") {
27
+ endOfFlags = true;
28
+ continue;
29
+ }
30
+
31
+ if (arg.startsWith("--")) {
32
+ const rest = arg.slice(2);
33
+ const eq = rest.indexOf("=");
34
+ if (eq !== -1) {
35
+ const key = rest.slice(0, eq);
36
+ const rawVal = rest.slice(eq + 1);
37
+ if (rawVal === "true") {
38
+ flags[key] = true;
39
+ } else if (rawVal === "false") {
40
+ flags[key] = false;
41
+ } else {
42
+ flags[key] = rawVal;
43
+ }
44
+ } else {
45
+ const key = rest;
46
+ if (BOOLEAN_FLAGS.has(key)) {
47
+ flags[key] = true;
48
+ } else {
49
+ const next = argv[i + 1];
50
+ if (next !== undefined && !next.startsWith("-")) {
51
+ flags[key] = next;
52
+ i++;
53
+ } else {
54
+ flags[key] = true;
55
+ }
56
+ }
57
+ }
58
+ } else if (arg.startsWith("-") && arg.length >= 2) {
59
+ const key = arg.slice(1);
60
+ if (BOOLEAN_FLAGS.has(key)) {
61
+ flags[key] = true;
62
+ } else {
63
+ const next = argv[i + 1];
64
+ if (next !== undefined && !next.startsWith("-")) {
65
+ flags[key] = next;
66
+ i++;
67
+ } else {
68
+ flags[key] = true;
69
+ }
70
+ }
71
+ } else {
72
+ positional.push(arg);
73
+ }
74
+ }
75
+ return { positional, flags };
76
+ }
77
+
@@ -0,0 +1,338 @@
1
+ import { execSync } from "node:child_process";
2
+ import os from "node:os";
3
+ import readline from "node:readline";
4
+ import { decodeInviteCode } from "@sharedots/protocol";
5
+ import { readConfig, startDaemonProcess, writeConfig } from "./daemon-runner.js";
6
+
7
+ export interface SystemSpecs {
8
+ cpuCores: number;
9
+ cpuModel: string;
10
+ totalMemoryBytes: number;
11
+ totalMemoryGb: number;
12
+ gpuDetected: boolean;
13
+ gpuName?: string;
14
+ osName: string;
15
+ }
16
+
17
+ export function probeSystemSpecs(): SystemSpecs {
18
+ const cpus = os.cpus();
19
+ const cpuCores = cpus.length;
20
+ const cpuModel = cpus[0]?.model || "Generic CPU";
21
+ const totalMemoryBytes = os.totalmem();
22
+ const totalMemoryGb = Math.round((totalMemoryBytes / (1024 ** 3)) * 10) / 10;
23
+ const osName = `${os.type()} ${os.release()} (${os.arch()})`;
24
+
25
+ let gpuDetected = false;
26
+ let gpuName: string | undefined;
27
+
28
+ // Check for nvidia-smi
29
+ try {
30
+ const smi = execSync("nvidia-smi --query-gpu=name --format=csv,noheader", {
31
+ encoding: "utf8",
32
+ stdio: ["pipe", "pipe", "ignore"],
33
+ timeout: 1500,
34
+ }).trim();
35
+ if (smi) {
36
+ gpuDetected = true;
37
+ gpuName = smi.split("\n")[0]?.trim();
38
+ }
39
+ } catch {
40
+ // No nvidia-smi, check Windows WMIC or PowerShell if win32
41
+ if (process.platform === "win32") {
42
+ try {
43
+ const winGpu = execSync(
44
+ 'powershell -NoProfile -Command "(Get-CimInstance Win32_VideoController | Select-Object -ExpandProperty Name)[0]"',
45
+ { encoding: "utf8", stdio: ["pipe", "pipe", "ignore"], timeout: 1500 },
46
+ ).trim();
47
+ if (winGpu && !winGpu.toLowerCase().includes("basic display") && !winGpu.toLowerCase().includes("remote")) {
48
+ gpuDetected = true;
49
+ gpuName = winGpu;
50
+ }
51
+ } catch {
52
+ // ignore
53
+ }
54
+ }
55
+ }
56
+
57
+ return {
58
+ cpuCores,
59
+ cpuModel,
60
+ totalMemoryBytes,
61
+ totalMemoryGb,
62
+ gpuDetected,
63
+ gpuName,
64
+ osName,
65
+ };
66
+ }
67
+
68
+ export async function detectCoordinator(customUrls: string[] = []): Promise<string | null> {
69
+ const candidateUrls = [
70
+ ...customUrls,
71
+ "http://127.0.0.1:4000",
72
+ "http://localhost:4000",
73
+ ];
74
+
75
+ // Try checking tailscale peers if tailscale is installed
76
+ try {
77
+ const tsOut = execSync("tailscale status --json", {
78
+ encoding: "utf8",
79
+ stdio: ["pipe", "pipe", "ignore"],
80
+ timeout: 1000,
81
+ });
82
+ const parsed = JSON.parse(tsOut) as { Peer?: Record<string, { TailscaleIPs?: string[] }> };
83
+ if (parsed.Peer) {
84
+ for (const peer of Object.values(parsed.Peer)) {
85
+ if (peer.TailscaleIPs && peer.TailscaleIPs[0]) {
86
+ candidateUrls.push(`http://${peer.TailscaleIPs[0]}:4000`);
87
+ }
88
+ }
89
+ }
90
+ } catch {
91
+ // Tailscale not running or not installed
92
+ }
93
+
94
+ for (const url of candidateUrls) {
95
+ try {
96
+ const res = await fetch(`${url.replace(/\/+$/, "")}/api/overview`, {
97
+ signal: AbortSignal.timeout(1000),
98
+ });
99
+ if (res.ok) {
100
+ return url.replace(/\/+$/, "");
101
+ }
102
+ } catch {
103
+ // transient unreachable
104
+ }
105
+ }
106
+
107
+ return null;
108
+ }
109
+
110
+ export interface UpWizardOptions {
111
+ cluster?: boolean;
112
+ contributor?: boolean;
113
+ joinCode?: string;
114
+ coordinator?: string;
115
+ yes?: boolean;
116
+ foreground?: boolean;
117
+ }
118
+
119
+ function promptUser(query: string): Promise<string> {
120
+ const rl = readline.createInterface({
121
+ input: process.stdin,
122
+ output: process.stdout,
123
+ });
124
+ return new Promise((res) => {
125
+ rl.question(query, (ans) => {
126
+ rl.close();
127
+ res(ans.trim());
128
+ });
129
+ });
130
+ }
131
+
132
+ export async function runUpWizard(options: UpWizardOptions = {}): Promise<void> {
133
+ console.log(`\n\x1b[1m\x1b[36m⚡ SHAREDOTS ZERO-CONFIG AUTO-DISCOVERY & LAUNCH WIZARD\x1b[0m\n`);
134
+
135
+ const specs = probeSystemSpecs();
136
+ console.log(`\x1b[32m✔ Host Hardware Detected:\x1b[0m`);
137
+ console.log(` • CPU: ${specs.cpuCores} cores (${specs.cpuModel})`);
138
+ console.log(` • Memory: ${specs.totalMemoryGb} GB`);
139
+ console.log(` • GPU: ${specs.gpuDetected ? (specs.gpuName ?? "Yes") : "None / Integrated"}`);
140
+ console.log(` • OS: ${specs.osName}\n`);
141
+
142
+ // Direct join code provided
143
+ if (options.joinCode) {
144
+ const decoded = decodeInviteCode(options.joinCode);
145
+ if (!decoded) {
146
+ console.error("\x1b[31m✖ Error: Invalid invite code provided.\x1b[0m");
147
+ process.exit(1);
148
+ }
149
+ console.log(`Configuring worker for room ${decoded.roomId} (${decoded.coordinatorUrl})...`);
150
+ writeConfig({
151
+ coordinator: decoded.coordinatorUrl,
152
+ roomId: decoded.roomId,
153
+ token: decoded.token,
154
+ joinedAt: new Date().toISOString(),
155
+ });
156
+ const started = startDaemonProcess({
157
+ coordinator: decoded.coordinatorUrl,
158
+ roomId: decoded.roomId,
159
+ token: decoded.token,
160
+ foreground: options.foreground,
161
+ });
162
+ if (started.pid) {
163
+ console.log(`\x1b[32m✔ Daemon running in background (PID ${started.pid}).\x1b[0m`);
164
+ console.log(`Run 'sharedots worker status' or 'sharedots tui' to monitor.\n`);
165
+ }
166
+ return;
167
+ }
168
+
169
+ // Explicit cluster flag
170
+ if (options.cluster) {
171
+ console.log(`Starting new local Sharedots cluster...`);
172
+ console.log(`Run 'pnpm coordinator:start' or launch coordinator on port 4000.\n`);
173
+ return;
174
+ }
175
+
176
+ // Explicit contributor mode flag
177
+ if (options.contributor) {
178
+ console.log(`Configuring auto-tuned contributor node...`);
179
+ const existing = readConfig();
180
+ const coord = options.coordinator ?? existing?.coordinator ?? "http://127.0.0.1:4000";
181
+ const room = existing?.roomId ?? "public-pool";
182
+ const token = existing?.token ?? "sec_public";
183
+
184
+ writeConfig({ coordinator: coord, roomId: room, token, joinedAt: new Date().toISOString() });
185
+ const started = startDaemonProcess({
186
+ coordinator: coord,
187
+ roomId: room,
188
+ token,
189
+ cpuLimit: 75,
190
+ foreground: options.foreground,
191
+ });
192
+ console.log(`\x1b[32m✔ Contributor node running (PID ${started.pid}). Contributing up to 75% CPU.\x1b[0m\n`);
193
+ return;
194
+ }
195
+
196
+ // Probe for active coordinators
197
+ process.stdout.write("Scanning local network and Tailscale mesh for active coordinators... ");
198
+ const detectedCoord = await detectCoordinator(options.coordinator ? [options.coordinator] : []);
199
+ if (detectedCoord) {
200
+ console.log(`\x1b[32mFound!\x1b[0m`);
201
+ console.log(`\x1b[1m\x1b[35m● Active coordinator discovered at: ${detectedCoord}\x1b[0m\n`);
202
+
203
+ let joinNow = options.yes;
204
+ if (!joinNow && process.stdin.isTTY) {
205
+ const ans = await promptUser(`Join active coordinator at ${detectedCoord}? [Y/n]: `);
206
+ joinNow = ans === "" || ans.toLowerCase().startsWith("y");
207
+ }
208
+
209
+ if (joinNow) {
210
+ // Fetch or probe active rooms
211
+ let roomId = "mesh-default";
212
+ let token = "sec_auto";
213
+ try {
214
+ const roomsRes = await fetch(`${detectedCoord}/api/rooms`, {
215
+ signal: AbortSignal.timeout(2000),
216
+ });
217
+ if (roomsRes.ok) {
218
+ const body = (await roomsRes.json()) as { rooms?: Array<{ roomId: string }> };
219
+ if (body.rooms && body.rooms.length > 0 && body.rooms[0]) {
220
+ roomId = body.rooms[0].roomId;
221
+ }
222
+ }
223
+ } catch {
224
+ // ignore
225
+ }
226
+
227
+ writeConfig({
228
+ coordinator: detectedCoord,
229
+ roomId,
230
+ token,
231
+ joinedAt: new Date().toISOString(),
232
+ });
233
+ const started = startDaemonProcess({
234
+ coordinator: detectedCoord,
235
+ roomId,
236
+ token,
237
+ foreground: options.foreground,
238
+ });
239
+ console.log(`\x1b[32m✔ Connected to cluster at ${detectedCoord} (room: ${roomId}).\x1b[0m`);
240
+ if (started.pid) {
241
+ console.log(`Worker daemon started (PID ${started.pid}). Run 'sharedots tui' to view dashboard.\n`);
242
+ }
243
+ return;
244
+ }
245
+ } else {
246
+ console.log(`None detected.`);
247
+ }
248
+
249
+ // Interactive selection if TTY
250
+ if (process.stdin.isTTY) {
251
+ console.log(`How do you want to run Sharedots?`);
252
+ console.log(` [1] Join existing mesh (paste invite code or enter URL)`);
253
+ console.log(` [2] Start new cluster (Coordinator + local Worker)`);
254
+ console.log(` [3] Contributor mode (Worker only, auto-tuned to 75% CPU)`);
255
+
256
+ const choice = await promptUser(`Select option [1-3] (default 1): `);
257
+
258
+ if (choice === "2") {
259
+ console.log(`Starting new local Sharedots cluster...`);
260
+ // Start cluster
261
+ console.log(`Run 'pnpm coordinator:start' or launch coordinator on port 4000.`);
262
+ return;
263
+ }
264
+
265
+ if (choice === "3") {
266
+ console.log(`Configuring auto-tuned contributor node...`);
267
+ const existing = readConfig();
268
+ const coord = existing?.coordinator ?? detectedCoord ?? "http://127.0.0.1:4000";
269
+ const room = existing?.roomId ?? "public-pool";
270
+ const token = existing?.token ?? "sec_public";
271
+
272
+ writeConfig({ coordinator: coord, roomId: room, token, joinedAt: new Date().toISOString() });
273
+ const started = startDaemonProcess({
274
+ coordinator: coord,
275
+ roomId: room,
276
+ token,
277
+ cpuLimit: 75,
278
+ foreground: options.foreground,
279
+ });
280
+ console.log(`\x1b[32m✔ Contributor node running (PID ${started.pid}). Contributing up to 75% CPU.\x1b[0m\n`);
281
+ return;
282
+ }
283
+
284
+ // Default option 1: join
285
+ const rawInput = await promptUser(`Paste Unified Invite Code ('sd_join_...') or Coordinator URL: `);
286
+ if (!rawInput) {
287
+ console.log("No input received. Exiting.");
288
+ return;
289
+ }
290
+ const decoded = decodeInviteCode(rawInput);
291
+ if (decoded) {
292
+ writeConfig({
293
+ coordinator: decoded.coordinatorUrl,
294
+ roomId: decoded.roomId,
295
+ token: decoded.token,
296
+ joinedAt: new Date().toISOString(),
297
+ });
298
+ const started = startDaemonProcess({
299
+ coordinator: decoded.coordinatorUrl,
300
+ roomId: decoded.roomId,
301
+ token: decoded.token,
302
+ foreground: options.foreground,
303
+ });
304
+ console.log(`\x1b[32m✔ Worker successfully configured and launched (PID ${started.pid}).\x1b[0m\n`);
305
+ return;
306
+ }
307
+
308
+ console.log(`Connecting to ${rawInput}...`);
309
+ writeConfig({
310
+ coordinator: rawInput,
311
+ roomId: "default-room",
312
+ token: "sec_default",
313
+ joinedAt: new Date().toISOString(),
314
+ });
315
+ startDaemonProcess({
316
+ coordinator: rawInput,
317
+ roomId: "default-room",
318
+ token: "sec_default",
319
+ foreground: options.foreground,
320
+ });
321
+ console.log(`\x1b[32m✔ Worker started.\x1b[0m\n`);
322
+ } else {
323
+ // Non-interactive fallback
324
+ const existing = readConfig();
325
+ const coord = existing?.coordinator ?? detectedCoord ?? "http://127.0.0.1:4000";
326
+ const room = existing?.roomId ?? "mesh-default";
327
+ const token = existing?.token ?? "sec_auto";
328
+
329
+ writeConfig({ coordinator: coord, roomId: room, token, joinedAt: new Date().toISOString() });
330
+ const started = startDaemonProcess({
331
+ coordinator: coord,
332
+ roomId: room,
333
+ token,
334
+ foreground: options.foreground,
335
+ });
336
+ console.log(`\x1b[32m✔ Sharedots started for room ${room} on ${coord} (PID ${started.pid}).\x1b[0m\n`);
337
+ }
338
+ }
package/LICENSE DELETED
@@ -1,195 +0,0 @@
1
- Apache License
2
- Version 2.0, January 2004
3
- http://www.apache.org/licenses/
4
-
5
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
- 1. Definitions.
8
-
9
- "License" shall mean the terms and conditions for use, reproduction,
10
- and distribution as defined by Sections 1 through 9 of this document.
11
-
12
- "Licensor" shall mean the copyright owner or entity authorized by
13
- the copyright owner that is granting the License.
14
-
15
- "Legal Entity" shall mean the union of the acting entity and all
16
- other entities that control, are controlled by, or are under common
17
- control with that entity. For the purposes of this definition,
18
- "control" means (i) the power, direct or indirect, to cause the
19
- direction or management of such entity, whether by contract or
20
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
- outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
- "You" (or "Your") shall mean an individual or Legal Entity
24
- exercising permissions granted by this License.
25
-
26
- "Source" form shall mean the preferred form for making modifications,
27
- including but not limited to software source code, documentation
28
- source, and configuration files.
29
-
30
- "Object" form shall mean any form resulting from mechanical
31
- transformation or translation of a Source form, including but
32
- not limited to compiled object code, generated documentation,
33
- and conversions to other media types.
34
-
35
- "Work" shall mean the work of authorship made available under
36
- the License, as indicated by a copyright notice that is included in
37
- or attached to the work (an example is provided in the Appendix below).
38
-
39
- "Derivative Works" shall mean any work, whether in Source or Object
40
- form, that is based on (or derived from) the Work and for which the
41
- editorial revisions, annotations, elaborations, or other modifications
42
- represent, as a whole, an original work of authorship. For the purposes
43
- of this License, Derivative Works shall not include works that remain
44
- separable from, or merely link (or bind by name) to the interfaces of,
45
- the Work and Derivative Works thereof.
46
-
47
- "Contribution" shall mean, as submitted to the Licensor for inclusion
48
- in the Work by the copyright owner or by an individual or Legal Entity
49
- authorized to submit on behalf of the copyright owner. For the purposes
50
- of this definition, "submitted" means any form of electronic, verbal,
51
- or written communication sent to the Licensor or its representatives,
52
- including but not limited to communication on electronic mailing lists,
53
- source code control systems, and issue tracking systems that are managed
54
- by, or on behalf of, the Licensor for the purpose of discussing and
55
- improving the Work, but excluding communication that is conspicuously
56
- marked or otherwise designated in writing by the copyright owner as
57
- "Not a Contribution."
58
-
59
- "Contributor" shall mean Licensor and any Legal Entity on behalf of
60
- whom a Contribution has been received by the Licensor and subsequently
61
- incorporated within the Work.
62
-
63
- 2. Grant of Copyright License. Subject to the terms and conditions of
64
- this License, each Contributor hereby grants to You a perpetual,
65
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
66
- copyright license to reproduce, prepare Derivative Works of,
67
- publicly display, publicly perform, sublicense, and distribute the
68
- Work and such Derivative Works in Source or Object form.
69
-
70
- 3. Grant of Patent License. Subject to the terms and conditions of
71
- this License, each Contributor hereby grants to You a perpetual,
72
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
73
- (except as stated in this section) patent license to make, have made,
74
- use, offer to sell, sell, import, and otherwise transfer the Work,
75
- where such license applies only to those patent claims licensable
76
- by such Contributor that are necessarily infringed by their
77
- Contribution(s) alone or by combination of their Contribution(s)
78
- with the Work to which such Contribution(s) was submitted. If You
79
- institute patent litigation against any entity (including a cross-claim
80
- or counterclaim in a lawsuit) alleging that the Work or any
81
- Contribution incorporated within the Work constitutes direct or
82
- contributory patent infringement, then any patent licenses granted
83
- to You under this License for that Work shall terminate as of the
84
- date such litigation is filed.
85
-
86
- 4. Redistribution. You may reproduce and distribute copies of the
87
- Work or Derivative Works thereof in any medium, with or without
88
- modifications, and in Source or Object form, provided that You
89
- meet the following conditions:
90
-
91
- (a) You must give any other recipients of the Work or Derivative
92
- Works a copy of this License; and
93
-
94
- (b) You must cause any modified files to carry prominent notices
95
- stating that You changed the files; and
96
-
97
- (c) You must retain, in the Source form of any Derivative Works
98
- that You distribute, all copyright, patent, trademark, and
99
- attribution notices from the Source form of the Work,
100
- excluding those notices that do not pertain to any part of
101
- the Derivative Works; and
102
-
103
- (d) If the Work includes a "NOTICE" text file as part of its
104
- distribution, You must include a readable copy of the
105
- attribution notices contained within such NOTICE file, in
106
- at least one of the following places: within a NOTICE text
107
- file distributed as part of the Derivative Works; within
108
- the Source form or documentation, if provided along with the
109
- Derivative Works; or, within a display generated by the
110
- Derivative Works, if and wherever such third-party notices
111
- normally appear. The contents of the NOTICE file are for
112
- informational purposes only and do not modify the License.
113
- You may add Your own attribution notices within Derivative
114
- Works that You distribute, alongside or as an addendum to
115
- the NOTICE text from the Work, provided that such additional
116
- attribution notices cannot be construed as modifying the License.
117
-
118
- You may add Your own license statement for Your modifications and
119
- may provide additional grant of rights to use, modify, and distribute
120
- Your modifications, or for such Derivative Works as a whole, under
121
- terms of Your choice, provided Your use, reproduction, and
122
- distribution of the Work otherwise complies with the conditions
123
- stated in this License.
124
-
125
- 5. Submission of Contributions. Unless You explicitly state otherwise,
126
- any Contribution intentionally submitted for inclusion in the Work
127
- by You to the Licensor shall be under the terms and conditions of
128
- this License, without any additional terms or conditions.
129
- Notwithstanding the above, nothing herein shall supersede or modify
130
- the terms of any separate license agreement you may have executed
131
- with Licensor regarding such Contributions.
132
-
133
- 6. Trademarks. This License does not grant permission to use the trade
134
- names, trademarks, service marks, or product names of the Licensor,
135
- except as required for reasonable and customary use in describing the
136
- origin of the Work and reproducing the content of the NOTICE file.
137
-
138
- 7. Disclaimer of Warranty. Unless required by applicable law or
139
- agreed to in writing, Licensor provides the Work (and each
140
- Contributor provides its Contributions) on an "AS IS" BASIS,
141
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
142
- implied, including, without limitation, any warranties or conditions
143
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
144
- PARTICULAR PURPOSE. You are solely responsible for determining the
145
- appropriateness of using or redistributing the Work and assume any
146
- risks associated with Your exercise of permissions under this License.
147
-
148
- 8. Limitation of Liability. In no event and under no legal theory,
149
- whether in tort (including negligence), contract, or otherwise,
150
- unless required by applicable law (such as deliberate and grossly
151
- negligent acts) or agreed to in writing, shall any Contributor be
152
- liable to You for damages, including any direct, indirect, special,
153
- incidental, or exemplary damages of any character arising as a
154
- result of this License or out of the use or inability to use the
155
- Work (including but not limited to damages for loss of goodwill,
156
- work stoppage, computer failure or malfunction, or all other
157
- commercial damages or losses), even if such Contributor has been
158
- advised of the possibility of such damages.
159
-
160
- 9. Accepting Warranty or Additional Liability. While redistributing
161
- the Work or Derivative Works thereof, You may choose to offer,
162
- and charge a fee for, acceptance of support, warranty, indemnity,
163
- or other liability obligations and/or rights consistent with this
164
- License. However, in accepting such obligations, You may act only
165
- on Your own behalf and on Your sole responsibility, not on behalf
166
- of any other Contributor, and only if You agree to indemnify,
167
- defend, and hold each Contributor harmless for any liability
168
- incurred by, or claims asserted against, such Contributor by reason
169
- of your accepting any such warranty or additional liability.
170
-
171
- END OF TERMS AND CONDITIONS
172
-
173
- APPENDIX: How to apply the Apache License to your work.
174
-
175
- To apply the Apache License to your work, attach the following
176
- boilerplate notice, with the fields enclosed by brackets "[]"
177
- replaced with your own identifying information. (Don't include
178
- the brackets!) The text should be enclosed in the appropriate
179
- comment syntax for the file format. Please also include a
180
- "NOTICE" file as part of your distribution, as well as a pointer
181
- to your git repository or project page for further information.
182
-
183
- Copyright 2026 Sharedots Contributors
184
-
185
- Licensed under the Apache License, Version 2.0 (the "License");
186
- you may not use this file except in compliance with the License.
187
- You may obtain a copy of the License at
188
-
189
- http://www.apache.org/licenses/LICENSE-2.0
190
-
191
- Unless required by applicable law or agreed to in writing, software
192
- distributed under the License is distributed on an "AS IS" BASIS,
193
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
194
- See the License for the specific language governing permissions and
195
- limitations under the License.