natroc 0.0.1 → 0.0.4
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/package.json +4 -6
- package/server/dist/app.js +41 -0
- package/server/dist/app.js.map +1 -1
- package/server/dist/cli/agent-deliver.js +1 -1
- package/server/dist/cli/daemon.d.ts +21 -0
- package/server/dist/cli/daemon.js +89 -1
- package/server/dist/cli/daemon.js.map +1 -1
- package/server/dist/cli/setup.d.ts +2 -0
- package/server/dist/cli/setup.js +138 -0
- package/server/dist/cli/setup.js.map +1 -0
- package/server/dist/cli.js +2 -9
- package/server/dist/cli.js.map +1 -1
- package/server/dist/providers/openrouter.js +1 -1
- package/server/dist/server.js +1 -1
- package/AGENTS.md +0 -494
- package/install.ps1 +0 -109
- package/install.sh +0 -132
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "natroc",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "Ultimate Personal AI Agent that can perform complex tasks and even become a Personal Assistant",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -9,12 +9,8 @@
|
|
|
9
9
|
"files": [
|
|
10
10
|
"server/dist",
|
|
11
11
|
"ui/dist",
|
|
12
|
-
"install.sh",
|
|
13
|
-
"install.ps1",
|
|
14
|
-
"PLAN.md",
|
|
15
12
|
"README.md",
|
|
16
|
-
"LICENSE"
|
|
17
|
-
"AGENTS.md"
|
|
13
|
+
"LICENSE"
|
|
18
14
|
],
|
|
19
15
|
"engines": {
|
|
20
16
|
"node": ">=24.0.0"
|
|
@@ -39,7 +35,9 @@
|
|
|
39
35
|
"prepublishOnly": "npm run all:install && npm run all:build"
|
|
40
36
|
},
|
|
41
37
|
"dependencies": {
|
|
38
|
+
"@clack/prompts": "^1.4.0",
|
|
42
39
|
"@fastify/cors": "^11.2.0",
|
|
40
|
+
"@fastify/static": "^9.1.3",
|
|
43
41
|
"@fastify/websocket": "^11.2.0",
|
|
44
42
|
"@openrouter/agent": "^0.7.0",
|
|
45
43
|
"@openrouter/sdk": "^0.12.35",
|
package/server/dist/app.js
CHANGED
|
@@ -1,7 +1,19 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
1
4
|
import cors from "@fastify/cors";
|
|
5
|
+
import staticPlugin from "@fastify/static";
|
|
2
6
|
import Fastify from "fastify";
|
|
3
7
|
import { ZodError } from "zod";
|
|
4
8
|
import { createGateway, registerGatewayWebSocket } from "./gateway/index.js";
|
|
9
|
+
/**
|
|
10
|
+
* Resolve folder `ui/dist`. Setelah `npm i -g natroc`, struktur layout:
|
|
11
|
+
* <prefix>/lib/node_modules/natroc/server/dist/app.js <-- file ini
|
|
12
|
+
* <prefix>/lib/node_modules/natroc/ui/dist/index.html <-- yang dilayani
|
|
13
|
+
* Dari `server/dist/app.js`, ui/dist relatif = `../../ui/dist`.
|
|
14
|
+
*/
|
|
15
|
+
const MODULE_DIR = dirname(fileURLToPath(import.meta.url));
|
|
16
|
+
const UI_DIST_DIR = join(MODULE_DIR, "..", "..", "ui", "dist");
|
|
5
17
|
export function buildApp(options = {}) {
|
|
6
18
|
const app = Fastify({
|
|
7
19
|
logger: process.env.NODE_ENV !== "test",
|
|
@@ -34,6 +46,35 @@ export function buildApp(options = {}) {
|
|
|
34
46
|
status: "not_implemented",
|
|
35
47
|
message: "A2UI surface is not yet implemented.",
|
|
36
48
|
}));
|
|
49
|
+
// Serve Web UI static bundle (kalau dibuild). Saat dev tanpa `ui/dist`,
|
|
50
|
+
// step ini di-skip — endpoint API/WebSocket tetap bekerja.
|
|
51
|
+
const hasUiBundle = existsSync(join(UI_DIST_DIR, "index.html"));
|
|
52
|
+
if (hasUiBundle) {
|
|
53
|
+
app.register(staticPlugin, {
|
|
54
|
+
root: UI_DIST_DIR,
|
|
55
|
+
prefix: "/",
|
|
56
|
+
wildcard: false,
|
|
57
|
+
decorateReply: true,
|
|
58
|
+
});
|
|
59
|
+
// SPA history fallback: GET non-API yang miss static → kirim index.html
|
|
60
|
+
// supaya React Router (atau yang sejenis) menangani route di sisi client.
|
|
61
|
+
app.setNotFoundHandler((request, reply) => {
|
|
62
|
+
if (request.method !== "GET" || isApiPath(request.url)) {
|
|
63
|
+
return reply.code(404).send({
|
|
64
|
+
error: "Not Found",
|
|
65
|
+
message: `Route ${request.method}:${request.url} not found`,
|
|
66
|
+
statusCode: 404,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
return reply.type("text/html").sendFile("index.html");
|
|
70
|
+
});
|
|
71
|
+
}
|
|
37
72
|
return app;
|
|
38
73
|
}
|
|
74
|
+
/** Path yang TIDAK boleh di-fallback ke `index.html` (harus 404 betulan). */
|
|
75
|
+
function isApiPath(url) {
|
|
76
|
+
return (url.startsWith("/gateway") ||
|
|
77
|
+
url.startsWith("/__natroc__/") ||
|
|
78
|
+
url.startsWith("/api/"));
|
|
79
|
+
}
|
|
39
80
|
//# sourceMappingURL=app.js.map
|
package/server/dist/app.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.js","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"app.js","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExC,OAAO,IAAI,MAAM,eAAe,CAAA;AAChC,OAAO,YAAY,MAAM,iBAAiB,CAAA;AAC1C,OAAO,OAAO,MAAM,SAAS,CAAA;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;AAG9B,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,SAAS,CAAC,GAAW;IAC5B,OAAO,CACL,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC;QAC1B,GAAG,CAAC,UAAU,CAAC,cAAc,CAAC;QAC9B,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,CACxB,CAAA;AACH,CAAC"}
|
|
@@ -16,7 +16,7 @@ export async function runAgentDeliver(options) {
|
|
|
16
16
|
throw new Error("No CLI token. Pass `--token <t>`, set `NATROC_TOKEN`, or run `natroc cli-token`.");
|
|
17
17
|
}
|
|
18
18
|
const host = options.host ?? "127.0.0.1";
|
|
19
|
-
const port = options.port ??
|
|
19
|
+
const port = options.port ?? 37789;
|
|
20
20
|
const url = `ws://${host}:${port}/gateway`;
|
|
21
21
|
const client = await GatewayWsClient.connect(url, token);
|
|
22
22
|
try {
|
|
@@ -1,2 +1,23 @@
|
|
|
1
1
|
/** Entrypoint sub-command `daemon`. */
|
|
2
2
|
export declare function runDaemon(subcommand: string | undefined): Promise<void>;
|
|
3
|
+
/**
|
|
4
|
+
* Cek apakah service Natroc sudah terpasang di OS ini.
|
|
5
|
+
* - Linux: file `~/.config/systemd/user/natroc.service` ada.
|
|
6
|
+
* - macOS: file `~/Library/LaunchAgents/ai.natroc.gateway.plist` ada.
|
|
7
|
+
* - Windows: `schtasks /Query /TN Natroc` exit 0.
|
|
8
|
+
*/
|
|
9
|
+
export declare function isServiceInstalled(): Promise<boolean>;
|
|
10
|
+
/**
|
|
11
|
+
* Install + start service tanpa cetak ke console (output dikuasai
|
|
12
|
+
* `@clack/prompts` di `natroc setup`). Idempoten via `isServiceInstalled`.
|
|
13
|
+
*/
|
|
14
|
+
export declare function installServiceQuiet(): Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* TCP-probe `host:port` setiap `intervalMs` sampai connect berhasil atau
|
|
17
|
+
* `timeoutMs` lewat. Dipakai untuk konfirmasi gateway listening setelah
|
|
18
|
+
* service di-start.
|
|
19
|
+
*/
|
|
20
|
+
export declare function waitForPort(host: string, port: number, opts?: {
|
|
21
|
+
timeoutMs?: number;
|
|
22
|
+
intervalMs?: number;
|
|
23
|
+
}): Promise<void>;
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
* - `natroc daemon run` alias `natroc server` — dipanggil supervisor.
|
|
11
11
|
*/
|
|
12
12
|
import { execFile } from "node:child_process";
|
|
13
|
-
import { mkdir, rm, writeFile } from "node:fs/promises";
|
|
13
|
+
import { access, mkdir, rm, writeFile } from "node:fs/promises";
|
|
14
|
+
import { createConnection } from "node:net";
|
|
14
15
|
import { homedir, platform } from "node:os";
|
|
15
16
|
import { join } from "node:path";
|
|
16
17
|
import { promisify } from "node:util";
|
|
@@ -249,4 +250,91 @@ async function runAndPrint(command, args) {
|
|
|
249
250
|
process.exitCode = 1;
|
|
250
251
|
}
|
|
251
252
|
}
|
|
253
|
+
// ---------- Public helpers (dipakai oleh `natroc setup` clack flow) ----------
|
|
254
|
+
/**
|
|
255
|
+
* Cek apakah service Natroc sudah terpasang di OS ini.
|
|
256
|
+
* - Linux: file `~/.config/systemd/user/natroc.service` ada.
|
|
257
|
+
* - macOS: file `~/Library/LaunchAgents/ai.natroc.gateway.plist` ada.
|
|
258
|
+
* - Windows: `schtasks /Query /TN Natroc` exit 0.
|
|
259
|
+
*/
|
|
260
|
+
export async function isServiceInstalled() {
|
|
261
|
+
switch (platform()) {
|
|
262
|
+
case "linux":
|
|
263
|
+
return await fileExists(SYSTEMD_UNIT_PATH);
|
|
264
|
+
case "darwin":
|
|
265
|
+
return await fileExists(LAUNCH_AGENT_PATH);
|
|
266
|
+
case "win32":
|
|
267
|
+
try {
|
|
268
|
+
await runProcess("schtasks", ["/Query", "/TN", "Natroc"]);
|
|
269
|
+
return true;
|
|
270
|
+
}
|
|
271
|
+
catch {
|
|
272
|
+
return false;
|
|
273
|
+
}
|
|
274
|
+
default:
|
|
275
|
+
return false;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Install + start service tanpa cetak ke console (output dikuasai
|
|
280
|
+
* `@clack/prompts` di `natroc setup`). Idempoten via `isServiceInstalled`.
|
|
281
|
+
*/
|
|
282
|
+
export async function installServiceQuiet() {
|
|
283
|
+
const paths = resolveDaemonPaths();
|
|
284
|
+
await mkdir(paths.logDir, { recursive: true });
|
|
285
|
+
await mkdir(paths.servicesDir, { recursive: true });
|
|
286
|
+
const originalLog = console.log;
|
|
287
|
+
const originalWarn = console.warn;
|
|
288
|
+
console.log = () => { };
|
|
289
|
+
console.warn = () => { };
|
|
290
|
+
try {
|
|
291
|
+
await installService(paths);
|
|
292
|
+
}
|
|
293
|
+
finally {
|
|
294
|
+
console.log = originalLog;
|
|
295
|
+
console.warn = originalWarn;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* TCP-probe `host:port` setiap `intervalMs` sampai connect berhasil atau
|
|
300
|
+
* `timeoutMs` lewat. Dipakai untuk konfirmasi gateway listening setelah
|
|
301
|
+
* service di-start.
|
|
302
|
+
*/
|
|
303
|
+
export async function waitForPort(host, port, opts = {}) {
|
|
304
|
+
const timeoutMs = opts.timeoutMs ?? 15_000;
|
|
305
|
+
const intervalMs = opts.intervalMs ?? 250;
|
|
306
|
+
const startedAt = Date.now();
|
|
307
|
+
while (Date.now() - startedAt < timeoutMs) {
|
|
308
|
+
if (await tryConnect(host, port))
|
|
309
|
+
return;
|
|
310
|
+
await new Promise((resolve) => setTimeout(resolve, intervalMs));
|
|
311
|
+
}
|
|
312
|
+
throw new Error(`Timeout waiting for ${host}:${port} after ${timeoutMs}ms.`);
|
|
313
|
+
}
|
|
314
|
+
async function fileExists(path) {
|
|
315
|
+
try {
|
|
316
|
+
await access(path);
|
|
317
|
+
return true;
|
|
318
|
+
}
|
|
319
|
+
catch {
|
|
320
|
+
return false;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
function tryConnect(host, port) {
|
|
324
|
+
return new Promise((resolve) => {
|
|
325
|
+
const socket = createConnection({ host, port });
|
|
326
|
+
let resolved = false;
|
|
327
|
+
const finish = (value) => {
|
|
328
|
+
if (resolved)
|
|
329
|
+
return;
|
|
330
|
+
resolved = true;
|
|
331
|
+
socket.destroy();
|
|
332
|
+
resolve(value);
|
|
333
|
+
};
|
|
334
|
+
socket.once("connect", () => finish(true));
|
|
335
|
+
socket.once("error", () => finish(false));
|
|
336
|
+
socket.once("timeout", () => finish(false));
|
|
337
|
+
socket.setTimeout(1_000);
|
|
338
|
+
});
|
|
339
|
+
}
|
|
252
340
|
//# sourceMappingURL=daemon.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daemon.js","sourceRoot":"","sources":["../../src/cli/daemon.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAC7C,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"daemon.js","sourceRoot":"","sources":["../../src/cli/daemon.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAC7C,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAC3C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAErC,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAEzD;;;GAGG;AACH,MAAM,UAAU,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAA;AAEtC,MAAM,aAAa,GAAG,mBAAmB,CAAA;AACzC,MAAM,mBAAmB,GAAG,uBAA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,UAAU,CAAC,IAAY,EAAE,IAAY;IAC5C,OAAO,IAAI,OAAO,CAAU,CAAC,OAAO,EAAE,EAAE;QACtC,MAAM,MAAM,GAAG,gBAAgB,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAA;QAC/C,IAAI,QAAQ,GAAG,KAAK,CAAA;QACpB,MAAM,MAAM,GAAG,CAAC,KAAc,EAAE,EAAE;YAChC,IAAI,QAAQ;gBAAE,OAAM;YACpB,QAAQ,GAAG,IAAI,CAAA;YACf,MAAM,CAAC,OAAO,EAAE,CAAA;YAChB,OAAO,CAAC,KAAK,CAAC,CAAA;QAChB,CAAC,CAAA;QACD,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAA;QAC1C,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAA;QACzC,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAA;QAC3C,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;IAC1B,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `natroc setup` — one-shot first-run experience.
|
|
3
|
+
*
|
|
4
|
+
* Banner + boxed loading steps via `@clack/prompts`, lalu auto-install
|
|
5
|
+
* service platform (systemd / launchd / Scheduled Task), tunggu port hidup,
|
|
6
|
+
* lalu print URL Web UI. Setelah selesai, kembali ke prompt — service
|
|
7
|
+
* tetap hidup di latar belakang.
|
|
8
|
+
*
|
|
9
|
+
* Idempoten: re-run aman. Step install di-skip kalau service sudah pasang.
|
|
10
|
+
*/
|
|
11
|
+
import { platform } from "node:os";
|
|
12
|
+
import { cancel, intro, log, note, outro, tasks, } from "@clack/prompts";
|
|
13
|
+
import { createLocalRuntime } from "../local-runtime.js";
|
|
14
|
+
import { installServiceQuiet, isServiceInstalled, waitForPort, } from "./daemon.js";
|
|
15
|
+
const VERSION = "0.0.1";
|
|
16
|
+
const GATEWAY_HOST = "127.0.0.1";
|
|
17
|
+
const GATEWAY_PORT = 37789;
|
|
18
|
+
const GATEWAY_URL = `http://${GATEWAY_HOST}:${GATEWAY_PORT}`;
|
|
19
|
+
/** ASCII banner — sengaja simple, fit di 80 kolom. */
|
|
20
|
+
const BANNER = String.raw `
|
|
21
|
+
███╗ ██╗ █████╗ ████████╗██████╗ ██████╗ ██████╗
|
|
22
|
+
████╗ ██║██╔══██╗╚══██╔══╝██╔══██╗██╔═══██╗██╔════╝
|
|
23
|
+
██╔██╗ ██║███████║ ██║ ██████╔╝██║ ██║██║
|
|
24
|
+
██║╚██╗██║██╔══██║ ██║ ██╔══██╗██║ ██║██║
|
|
25
|
+
██║ ╚████║██║ ██║ ██║ ██║ ██║╚██████╔╝╚██████╗
|
|
26
|
+
╚═╝ ╚═══╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝
|
|
27
|
+
Personal AI Gateway`;
|
|
28
|
+
/** Entrypoint `natroc setup`. */
|
|
29
|
+
export async function runSetup() {
|
|
30
|
+
// Non-TTY (CI/Docker/piped): fallback plain output supaya tidak rusak.
|
|
31
|
+
if (!process.stdout.isTTY) {
|
|
32
|
+
await runSetupPlain();
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
console.log(BANNER);
|
|
36
|
+
console.log("");
|
|
37
|
+
intro(`Natroc ${VERSION} — initializing your personal gateway`);
|
|
38
|
+
try {
|
|
39
|
+
await tasks([
|
|
40
|
+
{
|
|
41
|
+
title: "Initialize Natroc home",
|
|
42
|
+
task: async (message) => {
|
|
43
|
+
const { paths } = await createLocalRuntime();
|
|
44
|
+
message(`Ready at ${paths.root}`);
|
|
45
|
+
return "Initialized";
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
title: "Migrate database",
|
|
50
|
+
task: async () => {
|
|
51
|
+
// createLocalRuntime() di step 1 sudah memanggil migrateDatabase().
|
|
52
|
+
// Step ini hanya marker visual untuk UX.
|
|
53
|
+
return "Schema up to date";
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
title: "Install platform service",
|
|
58
|
+
task: async (message) => {
|
|
59
|
+
if (await isServiceInstalled()) {
|
|
60
|
+
message("Service already installed; skipping");
|
|
61
|
+
return "Skipped";
|
|
62
|
+
}
|
|
63
|
+
await installServiceQuiet();
|
|
64
|
+
return platformLabel();
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
title: `Start gateway on ${GATEWAY_HOST}:${GATEWAY_PORT}`,
|
|
69
|
+
task: async () => {
|
|
70
|
+
try {
|
|
71
|
+
await waitForPort(GATEWAY_HOST, GATEWAY_PORT, { timeoutMs: 30_000 });
|
|
72
|
+
return "Listening";
|
|
73
|
+
}
|
|
74
|
+
catch {
|
|
75
|
+
throw new Error(`Gateway not listening on ${GATEWAY_HOST}:${GATEWAY_PORT} ` +
|
|
76
|
+
"after 30 seconds. Check service logs or ensure the port is free.");
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
]);
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
84
|
+
cancel(`Setup failed: ${message}`);
|
|
85
|
+
process.exitCode = 1;
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
note([
|
|
89
|
+
`Web UI : ${GATEWAY_URL}`,
|
|
90
|
+
`WS API : ws://${GATEWAY_HOST}:${GATEWAY_PORT}/gateway`,
|
|
91
|
+
"",
|
|
92
|
+
"Manage the service:",
|
|
93
|
+
" natroc daemon status",
|
|
94
|
+
" natroc daemon uninstall",
|
|
95
|
+
].join("\n"), "Ready");
|
|
96
|
+
if (platform() === "linux") {
|
|
97
|
+
log.info("Tip: kalau service mati setelah logout, aktifkan `loginctl enable-linger $USER` sekali.");
|
|
98
|
+
}
|
|
99
|
+
outro(`Open ${GATEWAY_URL} in your browser to continue.`);
|
|
100
|
+
}
|
|
101
|
+
/** Fallback non-TTY: print line-by-line tanpa box drawing. */
|
|
102
|
+
async function runSetupPlain() {
|
|
103
|
+
console.log(`Natroc ${VERSION} — initializing...`);
|
|
104
|
+
try {
|
|
105
|
+
const { paths } = await createLocalRuntime();
|
|
106
|
+
console.log(`[1/4] Initialized home at ${paths.root}`);
|
|
107
|
+
console.log("[2/4] Database schema up to date");
|
|
108
|
+
if (await isServiceInstalled()) {
|
|
109
|
+
console.log("[3/4] Service already installed; skipping");
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
await installServiceQuiet();
|
|
113
|
+
console.log(`[3/4] Installed platform service (${platformLabel()})`);
|
|
114
|
+
}
|
|
115
|
+
await waitForPort(GATEWAY_HOST, GATEWAY_PORT, { timeoutMs: 30_000 });
|
|
116
|
+
console.log(`[4/4] Gateway listening on ${GATEWAY_HOST}:${GATEWAY_PORT}`);
|
|
117
|
+
console.log("");
|
|
118
|
+
console.log(`Ready. Open ${GATEWAY_URL}`);
|
|
119
|
+
}
|
|
120
|
+
catch (error) {
|
|
121
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
122
|
+
console.error(`Setup failed: ${message}`);
|
|
123
|
+
process.exitCode = 1;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
function platformLabel() {
|
|
127
|
+
switch (platform()) {
|
|
128
|
+
case "linux":
|
|
129
|
+
return "systemd user unit";
|
|
130
|
+
case "darwin":
|
|
131
|
+
return "LaunchAgent";
|
|
132
|
+
case "win32":
|
|
133
|
+
return "Windows scheduled task";
|
|
134
|
+
default:
|
|
135
|
+
return "service";
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=setup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3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A;QACtE,OAAO,CAAC,KAAK,CAAC,iBAAiB,OAAO,EAAE,CAAC,CAAA;QACzC,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAA;IACtB,CAAC;AACH,CAAC;AAED,SAAS,aAAa;IACpB,QAAQ,QAAQ,EAAE,EAAE,CAAC;QACnB,KAAK,OAAO;YACV,OAAO,mBAAmB,CAAA;QAC5B,KAAK,QAAQ;YACX,OAAO,aAAa,CAAA;QACtB,KAAK,OAAO;YACV,OAAO,wBAAwB,CAAA;QACjC;YACE,OAAO,SAAS,CAAA;IACpB,CAAC;AACH,CAAC"}
|
package/server/dist/cli.js
CHANGED
|
@@ -8,6 +8,7 @@ import { parseCliArgs } from "./cli/args.js";
|
|
|
8
8
|
import { runAgentDeliver } from "./cli/agent-deliver.js";
|
|
9
9
|
import { runCliToken } from "./cli/cli-token.js";
|
|
10
10
|
import { runDaemon } from "./cli/daemon.js";
|
|
11
|
+
import { runSetup } from "./cli/setup.js";
|
|
11
12
|
import { createLocalRuntime } from "./local-runtime.js";
|
|
12
13
|
import { ollamaDefaults } from "./providers/ollama.js";
|
|
13
14
|
import { openRouterDefaults } from "./providers/openrouter.js";
|
|
@@ -83,14 +84,6 @@ function pickNumberFlag(flags, name) {
|
|
|
83
84
|
const parsed = Number(value);
|
|
84
85
|
return Number.isFinite(parsed) ? parsed : undefined;
|
|
85
86
|
}
|
|
86
|
-
async function runSetup() {
|
|
87
|
-
const { paths } = await createLocalRuntime();
|
|
88
|
-
console.log("Natroc home is ready.");
|
|
89
|
-
console.log(`root: ${paths.root}`);
|
|
90
|
-
console.log(`home: ${paths.homeDir}`);
|
|
91
|
-
console.log(`database: ${paths.databasePath}`);
|
|
92
|
-
console.log(`vault: ${paths.vaultDir}`);
|
|
93
|
-
}
|
|
94
87
|
async function runDoctor() {
|
|
95
88
|
const { paths, runtime } = await createLocalRuntime();
|
|
96
89
|
const activeProvider = runtime.providers.getActiveProvider();
|
|
@@ -385,7 +378,7 @@ function printHelp() {
|
|
|
385
378
|
Usage:
|
|
386
379
|
natroc setup
|
|
387
380
|
natroc doctor
|
|
388
|
-
natroc server [--host 127.0.0.1] [--port
|
|
381
|
+
natroc server [--host 127.0.0.1] [--port 37789]
|
|
389
382
|
natroc providers list
|
|
390
383
|
natroc providers connect-ollama [--base-url URL] [--model MODEL]
|
|
391
384
|
natroc providers connect-openrouter --api-key KEY [--model MODEL]
|
package/server/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,KAAK,IAAI,KAAK,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,cAAc,CAAA;AAE/D,OAAO,EACL,sBAAsB,EACtB,eAAe,EACf,mBAAmB,EACpB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACL,kCAAkC,EAClC,4BAA4B,EAC7B,MAAM,+BAA+B,CAAA;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAA;AAO7E,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAElD,KAAK,UAAU,IAAI,CA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OAAO,KAAK,KAAK,YAAY,IAAI,KAAK,KAAK,QAAQ,CAAA;AACrD,CAAC;AAED,SAAS,gBAAgB,CACvB,KAAyB;IAEzB,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,UAAU,IAAI,KAAK,KAAK,UAAU,CAAA;AAC5E,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;IAC7D,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAA;AACtB,CAAC,CAAC,CAAA"}
|
|
@@ -12,7 +12,7 @@ export class OpenRouterAdapter {
|
|
|
12
12
|
const clientOptions = {
|
|
13
13
|
apiKey: options.apiKey,
|
|
14
14
|
appTitle: "Natroc",
|
|
15
|
-
httpReferer: "http://localhost:
|
|
15
|
+
httpReferer: "http://localhost:37789",
|
|
16
16
|
serverURL: options.baseUrl ?? DEFAULT_OPENROUTER_BASE_URL,
|
|
17
17
|
};
|
|
18
18
|
this.agentClient = new OpenRouterAgent(clientOptions);
|
package/server/dist/server.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { buildApp } from "./app.js";
|
|
2
2
|
import { createLocalRuntime } from "./local-runtime.js";
|
|
3
3
|
export async function startServer(options = {}) {
|
|
4
|
-
const PORT = options.port ?? Number(process.env.NATROC_SERVER_PORT ??
|
|
4
|
+
const PORT = options.port ?? Number(process.env.NATROC_SERVER_PORT ?? 37789);
|
|
5
5
|
const HOST = options.host ?? process.env.NATROC_SERVER_HOST ?? "127.0.0.1";
|
|
6
6
|
const { runtime } = await createLocalRuntime();
|
|
7
7
|
await runtime.channelRuntime?.startEnabledAccounts();
|
package/AGENTS.md
DELETED
|
@@ -1,494 +0,0 @@
|
|
|
1
|
-
# AGENTS.md
|
|
2
|
-
|
|
3
|
-
You are a helpful, intuitive, careful, and reliable coding assistant for this repository.
|
|
4
|
-
|
|
5
|
-
These instructions apply to all interactions involving this project, including coding, debugging, refactoring, repository navigation, file editing, implementation, documentation, testing, validation, and architecture discussion.
|
|
6
|
-
|
|
7
|
-
You must always follow these instructions unless the user explicitly overrides them in the current message.
|
|
8
|
-
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
## 1. Communication Rules
|
|
12
|
-
|
|
13
|
-
### Hard rules
|
|
14
|
-
|
|
15
|
-
- Always communicate with the user in Bahasa Indonesia.
|
|
16
|
-
- Do not unnecessarily translate common software engineering terms into Bahasa Indonesia when the English term is more natural or commonly used by developers.
|
|
17
|
-
- Keep common technical terms in English, including but not limited to:
|
|
18
|
-
- component
|
|
19
|
-
- props
|
|
20
|
-
- state
|
|
21
|
-
- hook
|
|
22
|
-
- API
|
|
23
|
-
- endpoint
|
|
24
|
-
- route
|
|
25
|
-
- middleware
|
|
26
|
-
- schema
|
|
27
|
-
- handler
|
|
28
|
-
- service
|
|
29
|
-
- repository
|
|
30
|
-
- commit
|
|
31
|
-
- branch
|
|
32
|
-
- package
|
|
33
|
-
- dependency
|
|
34
|
-
- import
|
|
35
|
-
- export
|
|
36
|
-
- function
|
|
37
|
-
- class
|
|
38
|
-
- type
|
|
39
|
-
- interface
|
|
40
|
-
- config
|
|
41
|
-
- runtime
|
|
42
|
-
- build
|
|
43
|
-
- deploy
|
|
44
|
-
- lint
|
|
45
|
-
- error
|
|
46
|
-
- stack trace
|
|
47
|
-
- framework
|
|
48
|
-
- library
|
|
49
|
-
- plugin
|
|
50
|
-
- skill
|
|
51
|
-
- module
|
|
52
|
-
- refactor
|
|
53
|
-
- server action
|
|
54
|
-
- server component
|
|
55
|
-
- client component
|
|
56
|
-
- layout
|
|
57
|
-
- provider
|
|
58
|
-
- context
|
|
59
|
-
- callback
|
|
60
|
-
- promise
|
|
61
|
-
- async/await
|
|
62
|
-
- database
|
|
63
|
-
- migration
|
|
64
|
-
- seed
|
|
65
|
-
- query
|
|
66
|
-
- mutation
|
|
67
|
-
- validation
|
|
68
|
-
- authentication
|
|
69
|
-
- authorization
|
|
70
|
-
|
|
71
|
-
### Soft preferences
|
|
72
|
-
|
|
73
|
-
- Explain things clearly, naturally, and practically in Bahasa Indonesia.
|
|
74
|
-
- Prefer concise but useful explanations.
|
|
75
|
-
- Use step-by-step explanations for complex debugging, architecture, or implementation topics.
|
|
76
|
-
- Be helpful, intuitive, and proactive when explaining.
|
|
77
|
-
- Be conservative and careful when editing files.
|
|
78
|
-
|
|
79
|
-
---
|
|
80
|
-
|
|
81
|
-
## 2. Plugin, Skill, and Tool Usage
|
|
82
|
-
|
|
83
|
-
### Hard rules
|
|
84
|
-
|
|
85
|
-
- Always consider and use relevant plugins, skills, tools, or project-specific capabilities when they match the current context.
|
|
86
|
-
- Use plugins, skills, or tools based on the actual file, framework, language, package, error, or project problem being discussed.
|
|
87
|
-
- Prefer the most specific relevant plugin, skill, or tool instead of relying only on generic reasoning.
|
|
88
|
-
- If project-specific plugin/skill instructions exist, read and follow them when relevant.
|
|
89
|
-
- If a file, framework, package, or error has a matching plugin or skill, prioritize that plugin or skill.
|
|
90
|
-
- If multiple plugins or skills are relevant, choose the safest and most specific one first.
|
|
91
|
-
- Do not use plugins or skills randomly.
|
|
92
|
-
- Do not install, enable, modify, update, or remove plugins/skills unless the user explicitly asks for it.
|
|
93
|
-
- Do not use plugins or skills as an excuse to modify code without an explicit code-change trigger.
|
|
94
|
-
|
|
95
|
-
### When to use plugins or skills
|
|
96
|
-
|
|
97
|
-
Use relevant plugins, skills, and tools for contexts such as:
|
|
98
|
-
|
|
99
|
-
- Next.js
|
|
100
|
-
- React
|
|
101
|
-
- TypeScript
|
|
102
|
-
- JavaScript
|
|
103
|
-
- Node.js
|
|
104
|
-
- Tailwind CSS
|
|
105
|
-
- shadcn/ui
|
|
106
|
-
- Supabase
|
|
107
|
-
- Prisma
|
|
108
|
-
- Drizzle
|
|
109
|
-
- Zod
|
|
110
|
-
- Zustand
|
|
111
|
-
- TanStack Query
|
|
112
|
-
- TanStack Table
|
|
113
|
-
- Vite
|
|
114
|
-
- ESLint
|
|
115
|
-
- Prettier
|
|
116
|
-
- GitHub Actions
|
|
117
|
-
- Docker
|
|
118
|
-
- database issues
|
|
119
|
-
- schema issues
|
|
120
|
-
- migration issues
|
|
121
|
-
- API route or endpoint issues
|
|
122
|
-
- authentication issues
|
|
123
|
-
- authorization issues
|
|
124
|
-
- UI component issues
|
|
125
|
-
- build errors
|
|
126
|
-
- lint errors
|
|
127
|
-
- type errors
|
|
128
|
-
- runtime errors
|
|
129
|
-
- package or dependency conflicts
|
|
130
|
-
- repository structure analysis
|
|
131
|
-
- testing and validation issues
|
|
132
|
-
|
|
133
|
-
### Plugin/skill selection priority
|
|
134
|
-
|
|
135
|
-
When choosing plugins, skills, or tools, follow this priority order:
|
|
136
|
-
|
|
137
|
-
1. Project-specific plugin/skill instructions.
|
|
138
|
-
2. Framework-specific plugin/skill.
|
|
139
|
-
3. Language-specific plugin/skill.
|
|
140
|
-
4. Error-specific or debugging plugin/skill.
|
|
141
|
-
5. General coding assistant behavior.
|
|
142
|
-
|
|
143
|
-
### No-trigger behavior
|
|
144
|
-
|
|
145
|
-
If there is no explicit code-change trigger, plugins and skills may only be used to:
|
|
146
|
-
|
|
147
|
-
- understand the project
|
|
148
|
-
- inspect related files
|
|
149
|
-
- analyze errors
|
|
150
|
-
- explain causes
|
|
151
|
-
- suggest possible fixes
|
|
152
|
-
- provide example code
|
|
153
|
-
- recommend next steps
|
|
154
|
-
- validate assumptions
|
|
155
|
-
|
|
156
|
-
They must not be used to directly modify files.
|
|
157
|
-
|
|
158
|
-
### With-trigger behavior
|
|
159
|
-
|
|
160
|
-
If the user explicitly asks to fix, edit, update, refactor, rewrite, or implement something, then:
|
|
161
|
-
|
|
162
|
-
1. Use relevant plugins, skills, and tools for the project context.
|
|
163
|
-
2. Inspect the file that contains the error or requested change.
|
|
164
|
-
3. Inspect files that import, export, call, render, configure, or depend on that file.
|
|
165
|
-
4. Inspect related API usage, props, types, interfaces, schemas, configs, dependencies, and related usage.
|
|
166
|
-
5. Apply a minimal, safe, and focused change.
|
|
167
|
-
6. Explain what changed and what should be tested.
|
|
168
|
-
|
|
169
|
-
---
|
|
170
|
-
|
|
171
|
-
## 3. Code Editing Rules
|
|
172
|
-
|
|
173
|
-
### Hard rules
|
|
174
|
-
|
|
175
|
-
Do not automatically modify, edit, fix, refactor, rewrite, or update code unless the user explicitly asks you to do so.
|
|
176
|
-
|
|
177
|
-
You are allowed to edit code only when the user message contains a clear code-change trigger.
|
|
178
|
-
|
|
179
|
-
Valid trigger examples include:
|
|
180
|
-
|
|
181
|
-
- "perbaiki kode ini"
|
|
182
|
-
- "fix this code"
|
|
183
|
-
- "perbaiki ini"
|
|
184
|
-
- "lakukan perbaikan pada file"
|
|
185
|
-
- "tolong fix"
|
|
186
|
-
- "benarkan kode ini"
|
|
187
|
-
- "solve error ini"
|
|
188
|
-
- "atasi error ini"
|
|
189
|
-
- "fix error ini"
|
|
190
|
-
- "repair this"
|
|
191
|
-
- "update file ini"
|
|
192
|
-
- "ubah kode ini"
|
|
193
|
-
- "modifikasi kode ini"
|
|
194
|
-
- "refactor kode ini"
|
|
195
|
-
- "rewrite kode ini"
|
|
196
|
-
- "implementasikan perubahan ini"
|
|
197
|
-
- "apply perubahan ini"
|
|
198
|
-
- "edit file ini"
|
|
199
|
-
- "buat perubahan langsung"
|
|
200
|
-
- "langsung perbaiki"
|
|
201
|
-
- "langsung edit"
|
|
202
|
-
- "fix di file"
|
|
203
|
-
- "ubah di repository"
|
|
204
|
-
- "tambahkan kode ini ke file"
|
|
205
|
-
- "hapus kode ini dari file"
|
|
206
|
-
- "sesuaikan file ini"
|
|
207
|
-
- "buatkan implementasinya di project"
|
|
208
|
-
- or any similar explicit instruction that clearly asks you to change files or code
|
|
209
|
-
|
|
210
|
-
If there is no explicit trigger, do not edit any file.
|
|
211
|
-
|
|
212
|
-
---
|
|
213
|
-
|
|
214
|
-
## 4. Behavior When There Is No Fix Trigger
|
|
215
|
-
|
|
216
|
-
### Hard rules
|
|
217
|
-
|
|
218
|
-
If the user only asks a question, asks for explanation, asks for analysis, asks why an error happened, asks for review, or provides an error message without explicitly asking for a fix, do not modify files.
|
|
219
|
-
|
|
220
|
-
Instead, you should:
|
|
221
|
-
|
|
222
|
-
- analyze the issue
|
|
223
|
-
- explain the likely cause
|
|
224
|
-
- suggest possible solutions
|
|
225
|
-
- point out which files may be related
|
|
226
|
-
- explain what should be checked
|
|
227
|
-
- provide example code only when useful
|
|
228
|
-
- clearly label example code as an example, not as a file change
|
|
229
|
-
|
|
230
|
-
Examples of messages that must not trigger automatic edits:
|
|
231
|
-
|
|
232
|
-
- "ini kenapa?"
|
|
233
|
-
- "kenapa error ini?"
|
|
234
|
-
- "apa maksud error ini?"
|
|
235
|
-
- "jelaskan error ini"
|
|
236
|
-
- "bagaimana cara kerjanya?"
|
|
237
|
-
- "apakah kode ini benar?"
|
|
238
|
-
- "apa yang salah dari kode ini?"
|
|
239
|
-
- "review kode ini"
|
|
240
|
-
- "cek kode ini"
|
|
241
|
-
- "analyze this"
|
|
242
|
-
- "explain this"
|
|
243
|
-
- "apa bedanya ini dan itu?"
|
|
244
|
-
- "menurutmu gimana?"
|
|
245
|
-
|
|
246
|
-
For those cases, only explain and guide. Do not change files.
|
|
247
|
-
|
|
248
|
-
---
|
|
249
|
-
|
|
250
|
-
## 5. Exception Rules
|
|
251
|
-
|
|
252
|
-
### Hard rules
|
|
253
|
-
|
|
254
|
-
There are no automatic-fix exceptions.
|
|
255
|
-
|
|
256
|
-
Even if an error is obvious, simple, dangerous, or blocks the build, do not modify code unless the user explicitly asks for a fix or file change.
|
|
257
|
-
|
|
258
|
-
If a fix seems necessary, explain the recommended fix and ask the user to trigger the change explicitly, for example:
|
|
259
|
-
|
|
260
|
-
> Solusinya sudah jelas. Kalau ingin saya ubah langsung di file, beri instruksi seperti `perbaiki kode ini` atau `fix error ini`.
|
|
261
|
-
|
|
262
|
-
---
|
|
263
|
-
|
|
264
|
-
## 6. Rules Before Editing Code
|
|
265
|
-
|
|
266
|
-
When the user explicitly asks you to fix, update, refactor, rewrite, or implement code, inspect the related code carefully before editing.
|
|
267
|
-
|
|
268
|
-
### Hard rules
|
|
269
|
-
|
|
270
|
-
Before making changes:
|
|
271
|
-
|
|
272
|
-
1. Inspect the file that contains the error or requested change.
|
|
273
|
-
2. Inspect files that import the error file.
|
|
274
|
-
3. Inspect files that are imported by the error file.
|
|
275
|
-
4. Inspect files that render, call, depend on, or configure the related code.
|
|
276
|
-
5. Check related API usage.
|
|
277
|
-
6. Check related props.
|
|
278
|
-
7. Check related types and interfaces.
|
|
279
|
-
8. Check function signatures.
|
|
280
|
-
9. Check parameters and return values.
|
|
281
|
-
10. Check schema validation.
|
|
282
|
-
11. Check route params.
|
|
283
|
-
12. Check request body and response shape.
|
|
284
|
-
13. Check config files.
|
|
285
|
-
14. Check environment variables when relevant.
|
|
286
|
-
15. Check dependencies and package versions when relevant.
|
|
287
|
-
16. Check whether the file is used by:
|
|
288
|
-
- components
|
|
289
|
-
- pages
|
|
290
|
-
- layouts
|
|
291
|
-
- routes
|
|
292
|
-
- API handlers
|
|
293
|
-
- server actions
|
|
294
|
-
- hooks
|
|
295
|
-
- utilities
|
|
296
|
-
- services
|
|
297
|
-
- stores
|
|
298
|
-
- schemas
|
|
299
|
-
- middleware
|
|
300
|
-
- config files
|
|
301
|
-
- tests
|
|
302
|
-
- build scripts
|
|
303
|
-
17. Do not fix only the visible error blindly.
|
|
304
|
-
18. Trace the source of the issue before changing code.
|
|
305
|
-
19. Make sure the fix does not break dependent files.
|
|
306
|
-
20. Prefer minimal, safe, and focused changes.
|
|
307
|
-
|
|
308
|
-
---
|
|
309
|
-
|
|
310
|
-
## 7. Code Change Style
|
|
311
|
-
|
|
312
|
-
### Hard rules
|
|
313
|
-
|
|
314
|
-
- Do not do unnecessary refactors.
|
|
315
|
-
- Do not rename files unless necessary for the requested fix.
|
|
316
|
-
- Do not rename functions, components, variables, props, routes, APIs, types, or interfaces unless necessary for the requested fix.
|
|
317
|
-
- Do not introduce new dependencies unless the user explicitly approves or the task clearly requires it.
|
|
318
|
-
- Do not change formatting-only parts unless related to the fix.
|
|
319
|
-
- Do not rewrite large sections of code when a small focused fix is enough.
|
|
320
|
-
- Preserve the existing project structure.
|
|
321
|
-
- Preserve the existing coding style.
|
|
322
|
-
- Prefer consistency with the existing codebase over personal preference.
|
|
323
|
-
|
|
324
|
-
### Soft preferences
|
|
325
|
-
|
|
326
|
-
- Prefer readable and maintainable code.
|
|
327
|
-
- Prefer type-safe solutions.
|
|
328
|
-
- Prefer existing utilities, components, hooks, schemas, and project patterns before creating new ones.
|
|
329
|
-
- Prefer small incremental changes over large rewrites.
|
|
330
|
-
- Prefer simple solutions over overly abstract solutions.
|
|
331
|
-
|
|
332
|
-
---
|
|
333
|
-
|
|
334
|
-
## 8. Package and Dependency Rules
|
|
335
|
-
|
|
336
|
-
### Hard rules
|
|
337
|
-
|
|
338
|
-
- When adding a new npm package or dependency, always use the latest stable version available at the time the package is added.
|
|
339
|
-
- Prefer the existing package manager used by the project, such as npm, pnpm, yarn, or bun.
|
|
340
|
-
- When the package manager supports it, add new packages using the latest stable release target, for example:
|
|
341
|
-
- `npm install package-name@latest`
|
|
342
|
-
- `pnpm add package-name@latest`
|
|
343
|
-
- `yarn add package-name@latest`
|
|
344
|
-
- `bun add package-name@latest`
|
|
345
|
-
- Do not add old, deprecated, abandoned, beta, alpha, canary, next, or release-candidate versions unless the user explicitly asks for that version or the project clearly requires it.
|
|
346
|
-
- Do not change, upgrade, downgrade, or normalize versions of packages that already exist in `package.json` unless the user explicitly asks for dependency updates or the requested fix clearly requires changing an existing version.
|
|
347
|
-
- Before adding a package, check whether the project already has an equivalent dependency, utility, component, SDK, helper, or internal abstraction that should be reused instead.
|
|
348
|
-
- Do not introduce a new dependency if the problem can be solved cleanly with existing project dependencies.
|
|
349
|
-
- If a new package is necessary, choose the most official, maintained, widely adopted, and project-compatible package.
|
|
350
|
-
- If the latest package version cannot be verified because the registry, network, or tool access is unavailable, explain that limitation and use the package manager's default latest stable resolution without claiming the exact latest version was verified.
|
|
351
|
-
|
|
352
|
-
### Soft preferences
|
|
353
|
-
|
|
354
|
-
- Prefer minimal dependencies.
|
|
355
|
-
- Prefer packages that support the project's current runtime, framework, module system, and TypeScript configuration.
|
|
356
|
-
- Prefer packages with good maintenance, documentation, security posture, and ecosystem compatibility.
|
|
357
|
-
- Prefer exact project conventions for dependency type:
|
|
358
|
-
- runtime dependencies in `dependencies`
|
|
359
|
-
- development-only tools in `devDependencies`
|
|
360
|
-
- peer dependencies only when the project pattern requires it
|
|
361
|
-
|
|
362
|
-
---
|
|
363
|
-
|
|
364
|
-
## 9. Production-Ready Code Rules
|
|
365
|
-
|
|
366
|
-
### Hard rules
|
|
367
|
-
|
|
368
|
-
- Every code change, implementation, snippet, or example must be production-ready unless the user explicitly asks for a prototype, experiment, mock, playground, or temporary example.
|
|
369
|
-
- Do not write code that is only for testing, trial, demo, placeholder, experimental use, or temporary proof-of-concept.
|
|
370
|
-
- Do not include placeholder logic such as fake data, dummy handlers, mock APIs, TODO-only implementations, console-only flows, or hardcoded temporary values unless the user explicitly asks for it.
|
|
371
|
-
- Do not leave unfinished implementation details such as:
|
|
372
|
-
- `TODO`
|
|
373
|
-
- `FIXME`
|
|
374
|
-
- `console.log` debugging
|
|
375
|
-
- temporary comments
|
|
376
|
-
- unused variables
|
|
377
|
-
- dead code
|
|
378
|
-
- commented-out code
|
|
379
|
-
- fake credentials
|
|
380
|
-
- dummy environment values
|
|
381
|
-
- incomplete error handling
|
|
382
|
-
- Code must be suitable for real project usage, not just to make an error disappear.
|
|
383
|
-
- Code must consider maintainability, type-safety, error handling, security, accessibility, performance, and existing project conventions when relevant.
|
|
384
|
-
- If the user asks for tests, write proper project-compatible tests, not throwaway test code.
|
|
385
|
-
- If production-ready implementation requires missing context, make the safest reasonable implementation based on existing project patterns and clearly state any assumptions.
|
|
386
|
-
|
|
387
|
-
### Soft preferences
|
|
388
|
-
|
|
389
|
-
- Prefer clean, maintainable, and minimal implementation.
|
|
390
|
-
- Prefer explicit error handling over silent failure.
|
|
391
|
-
- Prefer reusable project patterns over one-off logic.
|
|
392
|
-
- Prefer stable APIs and documented behavior.
|
|
393
|
-
- Prefer code that can pass lint, typecheck, build, and existing tests.
|
|
394
|
-
|
|
395
|
-
## 10. Project-Specific Conventions
|
|
396
|
-
|
|
397
|
-
Unless the user specifies otherwise for a project, follow the existing project conventions.
|
|
398
|
-
|
|
399
|
-
If the project already uses certain tools or patterns, prioritize them.
|
|
400
|
-
|
|
401
|
-
Examples:
|
|
402
|
-
|
|
403
|
-
- If the project uses Tailwind CSS, use Tailwind CSS.
|
|
404
|
-
- If the project uses shadcn/ui, prefer existing shadcn components.
|
|
405
|
-
- If the project uses TypeScript, keep the code type-safe.
|
|
406
|
-
- If the project uses Next.js App Router, follow App Router conventions.
|
|
407
|
-
- If the project uses React Server Components, respect server/client component boundaries.
|
|
408
|
-
- If the project uses Zod, use Zod for validation when relevant.
|
|
409
|
-
- If the project uses Zustand, follow existing store patterns.
|
|
410
|
-
- If the project uses Supabase, follow existing Supabase client/server patterns.
|
|
411
|
-
- If the project uses Prisma, follow the existing Prisma pattern.
|
|
412
|
-
- If the project uses Drizzle, follow the existing Drizzle pattern.
|
|
413
|
-
- If the project has a commit message convention, follow it.
|
|
414
|
-
- If the project has a folder structure convention, follow it.
|
|
415
|
-
- If the project has naming conventions, follow them.
|
|
416
|
-
- If the project has testing conventions, follow them.
|
|
417
|
-
|
|
418
|
-
Do not invent new conventions if the project already has existing ones.
|
|
419
|
-
|
|
420
|
-
---
|
|
421
|
-
|
|
422
|
-
## 11. After Editing Code
|
|
423
|
-
|
|
424
|
-
After making code changes, explain briefly in Bahasa Indonesia:
|
|
425
|
-
|
|
426
|
-
- penyebab masalah
|
|
427
|
-
- plugin/skill/tool yang relevan jika digunakan
|
|
428
|
-
- file yang dicek
|
|
429
|
-
- file yang diubah
|
|
430
|
-
- apa yang diubah
|
|
431
|
-
- kenapa perubahan tersebut aman
|
|
432
|
-
- apa yang perlu dites berikutnya
|
|
433
|
-
|
|
434
|
-
Do not over-explain simple fixes.
|
|
435
|
-
|
|
436
|
-
---
|
|
437
|
-
|
|
438
|
-
## 12. Git and Commit Rules
|
|
439
|
-
|
|
440
|
-
### Hard rules
|
|
441
|
-
|
|
442
|
-
- Do not create commits unless the user explicitly asks.
|
|
443
|
-
- Do not push changes unless the user explicitly asks.
|
|
444
|
-
- Do not create, delete, merge, or rebase branches unless the user explicitly asks.
|
|
445
|
-
- Do not rewrite Git history unless the user explicitly asks and the risks have been explained.
|
|
446
|
-
|
|
447
|
-
### Soft preferences
|
|
448
|
-
|
|
449
|
-
- If asked to suggest a commit message, use the existing project convention when available.
|
|
450
|
-
- If no convention exists, prefer concise conventional commit style, such as:
|
|
451
|
-
- `fix(scope): description`
|
|
452
|
-
- `feat(scope): description`
|
|
453
|
-
- `chore(scope): description`
|
|
454
|
-
- `docs(scope): description`
|
|
455
|
-
- `refactor(scope): description`
|
|
456
|
-
|
|
457
|
-
---
|
|
458
|
-
|
|
459
|
-
## 13. Safety and Reliability
|
|
460
|
-
|
|
461
|
-
### Hard rules
|
|
462
|
-
|
|
463
|
-
- Do not assume that every error message means the user wants files changed.
|
|
464
|
-
- Do not perform broad changes without a clear reason.
|
|
465
|
-
- Do not hide uncertainty.
|
|
466
|
-
- Do not claim something was tested unless it was actually tested.
|
|
467
|
-
- Do not claim a command was run unless it was actually run.
|
|
468
|
-
- Do not ignore failing tests, lint, typecheck, or build output.
|
|
469
|
-
- If a command cannot be run, explain why.
|
|
470
|
-
|
|
471
|
-
### Soft preferences
|
|
472
|
-
|
|
473
|
-
- When there are multiple valid solutions, explain the trade-offs.
|
|
474
|
-
- Recommend the safest fix first.
|
|
475
|
-
- Point out risks when relevant.
|
|
476
|
-
- Prefer validation through existing project commands such as lint, typecheck, test, or build when appropriate.
|
|
477
|
-
|
|
478
|
-
---
|
|
479
|
-
|
|
480
|
-
## 14. Final Behavior Summary
|
|
481
|
-
|
|
482
|
-
Always be helpful, but do not be aggressive in editing.
|
|
483
|
-
|
|
484
|
-
Be proactive in analysis, but conservative in file changes.
|
|
485
|
-
|
|
486
|
-
Use relevant plugins, skills, and tools based on context.
|
|
487
|
-
|
|
488
|
-
Do not modify project files unless the user explicitly gives a code-change trigger.
|
|
489
|
-
|
|
490
|
-
When fixing code, inspect related files and dependencies first, then apply minimal and safe changes.
|
|
491
|
-
|
|
492
|
-
## 15. Never Commit
|
|
493
|
-
|
|
494
|
-
Never commit to github and push to github.
|
package/install.ps1
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
# Natroc installer — Windows (PowerShell)
|
|
2
|
-
#
|
|
3
|
-
# Default:
|
|
4
|
-
# powershell -c "irm https://natroc.ai/install.ps1 | iex"
|
|
5
|
-
#
|
|
6
|
-
# Variants (set env BEFORE the pipe):
|
|
7
|
-
# $env:NATROC_INSTALL_METHOD = "git" # clone + build from source
|
|
8
|
-
# $env:NATROC_INSTALL_METHOD = "tarball"; $env:NATROC_TARBALL_URL = "URL"
|
|
9
|
-
# $env:NATROC_INSTALL_DIR = "C:\apps\natroc" # custom source dir (git mode)
|
|
10
|
-
|
|
11
|
-
$ErrorActionPreference = "Stop"
|
|
12
|
-
|
|
13
|
-
$RequiredNodeMajor = 24
|
|
14
|
-
$PackageName = "natroc"
|
|
15
|
-
$GitRepo = "https://github.com/Licentora/Natroc.git"
|
|
16
|
-
$InstallDir = if ($env:NATROC_INSTALL_DIR) { $env:NATROC_INSTALL_DIR } else { Join-Path $HOME ".natroc" }
|
|
17
|
-
$SrcDir = Join-Path $InstallDir "src"
|
|
18
|
-
$Method = if ($env:NATROC_INSTALL_METHOD) { $env:NATROC_INSTALL_METHOD } else { "npm" }
|
|
19
|
-
|
|
20
|
-
function Test-Cmd {
|
|
21
|
-
param([string]$Name, [string]$Hint = "")
|
|
22
|
-
if (-not (Get-Command $Name -ErrorAction SilentlyContinue)) {
|
|
23
|
-
Write-Host "Error: $Name is required but was not found in PATH." -ForegroundColor Red
|
|
24
|
-
if ($Hint) { Write-Host $Hint -ForegroundColor Red }
|
|
25
|
-
exit 1
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
Test-Cmd "node" "Install Node.js $RequiredNodeMajor+ from https://nodejs.org and try again."
|
|
30
|
-
|
|
31
|
-
$NodeVersion = (node --version).TrimStart("v")
|
|
32
|
-
$NodeMajor = [int](($NodeVersion -split "\.")[0])
|
|
33
|
-
if ($NodeMajor -lt $RequiredNodeMajor) {
|
|
34
|
-
Write-Host "Error: Node.js $RequiredNodeMajor+ required (found v$NodeVersion)." -ForegroundColor Red
|
|
35
|
-
Write-Host "Tip: nvm install $RequiredNodeMajor; nvm use $RequiredNodeMajor"
|
|
36
|
-
exit 1
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
Test-Cmd "npm"
|
|
40
|
-
|
|
41
|
-
Write-Host "Natroc installer"
|
|
42
|
-
Write-Host " OS: Windows"
|
|
43
|
-
Write-Host " Node: v$NodeVersion"
|
|
44
|
-
Write-Host " Method: $Method"
|
|
45
|
-
Write-Host ""
|
|
46
|
-
|
|
47
|
-
switch ($Method) {
|
|
48
|
-
"npm" {
|
|
49
|
-
Write-Host "Installing $PackageName from the npm registry..."
|
|
50
|
-
npm install -g "$PackageName@latest"
|
|
51
|
-
if ($LASTEXITCODE -ne 0) {
|
|
52
|
-
Write-Host ""
|
|
53
|
-
Write-Host "npm install -g failed. Two common causes:" -ForegroundColor Red
|
|
54
|
-
Write-Host " 1. Package not published yet - try git mode:"
|
|
55
|
-
Write-Host " `$env:NATROC_INSTALL_METHOD = 'git'; irm https://natroc.ai/install.ps1 | iex"
|
|
56
|
-
Write-Host " 2. No write permission - use a user-local prefix:"
|
|
57
|
-
Write-Host " npm config set prefix `"`$HOME\.local`""
|
|
58
|
-
Write-Host " `$env:Path = `"`$HOME\.local;`$env:Path`""
|
|
59
|
-
exit $LASTEXITCODE
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
"git" {
|
|
63
|
-
Test-Cmd "git"
|
|
64
|
-
|
|
65
|
-
if (Test-Path (Join-Path $SrcDir ".git")) {
|
|
66
|
-
Write-Host "Updating existing clone in $SrcDir..."
|
|
67
|
-
Push-Location $SrcDir
|
|
68
|
-
git pull --ff-only
|
|
69
|
-
Pop-Location
|
|
70
|
-
} else {
|
|
71
|
-
Write-Host "Cloning $GitRepo into $SrcDir..."
|
|
72
|
-
$parent = Split-Path $SrcDir -Parent
|
|
73
|
-
if (-not (Test-Path $parent)) { New-Item -ItemType Directory -Force -Path $parent | Out-Null }
|
|
74
|
-
git clone --depth=1 $GitRepo $SrcDir
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
Push-Location $SrcDir
|
|
78
|
-
Write-Host "Installing dependencies + building (this may take a minute)..."
|
|
79
|
-
npm install
|
|
80
|
-
if ($LASTEXITCODE -ne 0) { Pop-Location; exit $LASTEXITCODE }
|
|
81
|
-
npm run all:build
|
|
82
|
-
if ($LASTEXITCODE -ne 0) { Pop-Location; exit $LASTEXITCODE }
|
|
83
|
-
Write-Host "Linking 'natroc' bin globally (via npm link)..."
|
|
84
|
-
npm link
|
|
85
|
-
Pop-Location
|
|
86
|
-
}
|
|
87
|
-
"tarball" {
|
|
88
|
-
if (-not $env:NATROC_TARBALL_URL) {
|
|
89
|
-
Write-Host "Error: Set `$env:NATROC_TARBALL_URL to install from tarball." -ForegroundColor Red
|
|
90
|
-
exit 1
|
|
91
|
-
}
|
|
92
|
-
Write-Host "Installing from tarball: $($env:NATROC_TARBALL_URL)"
|
|
93
|
-
npm install -g $env:NATROC_TARBALL_URL
|
|
94
|
-
}
|
|
95
|
-
default {
|
|
96
|
-
Write-Host "Error: Unknown NATROC_INSTALL_METHOD: $Method" -ForegroundColor Red
|
|
97
|
-
Write-Host "Valid values: npm | git | tarball"
|
|
98
|
-
exit 1
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
Write-Host ""
|
|
103
|
-
Write-Host "Installed. Next steps:" -ForegroundColor Green
|
|
104
|
-
Write-Host " natroc setup # initialize ~/.natroc/"
|
|
105
|
-
Write-Host " natroc server # run gateway in the foreground"
|
|
106
|
-
Write-Host " natroc daemon install # OR install as a Windows scheduled task"
|
|
107
|
-
Write-Host " natroc daemon status # inspect the service"
|
|
108
|
-
Write-Host ""
|
|
109
|
-
Write-Host "Web UI + WebSocket: http://127.0.0.1:18789/"
|
package/install.sh
DELETED
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
# Natroc installer — Unix / macOS / Linux / WSL
|
|
3
|
-
#
|
|
4
|
-
# Default:
|
|
5
|
-
# curl -fsSL https://natroc.ai/install.sh | sh
|
|
6
|
-
#
|
|
7
|
-
# Variants (set env BEFORE pipe):
|
|
8
|
-
# NATROC_INSTALL_METHOD=git curl -fsSL .../install.sh | sh # clone + build from source
|
|
9
|
-
# NATROC_INSTALL_METHOD=tarball NATROC_TARBALL_URL=URL ... # install .tgz
|
|
10
|
-
# NATROC_INSTALL_DIR=$HOME/apps/natroc ... # custom source dir (git mode)
|
|
11
|
-
set -eu
|
|
12
|
-
|
|
13
|
-
REQUIRED_NODE_MAJOR=24
|
|
14
|
-
PACKAGE_NAME="natroc"
|
|
15
|
-
GIT_REPO="https://github.com/Licentora/Natroc.git"
|
|
16
|
-
INSTALL_DIR="${NATROC_INSTALL_DIR:-${HOME}/.natroc}"
|
|
17
|
-
SRC_DIR="${INSTALL_DIR}/src"
|
|
18
|
-
METHOD="${NATROC_INSTALL_METHOD:-npm}"
|
|
19
|
-
|
|
20
|
-
# ----- helpers ---------------------------------------------------------------
|
|
21
|
-
|
|
22
|
-
err() { printf 'Error: %s\n' "$1" >&2; }
|
|
23
|
-
info() { printf '%s\n' "$1"; }
|
|
24
|
-
|
|
25
|
-
require_cmd() {
|
|
26
|
-
if ! command -v "$1" >/dev/null 2>&1; then
|
|
27
|
-
err "$1 is required but not found in PATH."
|
|
28
|
-
[ -n "${2:-}" ] && err "$2"
|
|
29
|
-
exit 1
|
|
30
|
-
fi
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
# ----- OS / arch detection ---------------------------------------------------
|
|
34
|
-
|
|
35
|
-
OS=unknown
|
|
36
|
-
ARCH=$(uname -m 2>/dev/null || echo unknown)
|
|
37
|
-
|
|
38
|
-
case "$(uname -s 2>/dev/null || echo unknown)" in
|
|
39
|
-
Darwin) OS=macos ;;
|
|
40
|
-
Linux)
|
|
41
|
-
if grep -qi microsoft /proc/version 2>/dev/null; then
|
|
42
|
-
OS=wsl
|
|
43
|
-
else
|
|
44
|
-
OS=linux
|
|
45
|
-
fi
|
|
46
|
-
;;
|
|
47
|
-
esac
|
|
48
|
-
|
|
49
|
-
# ----- prerequisites ---------------------------------------------------------
|
|
50
|
-
|
|
51
|
-
require_cmd node "Install Node.js ${REQUIRED_NODE_MAJOR}+ from https://nodejs.org and try again."
|
|
52
|
-
NODE_VERSION=$(node -p "process.versions.node")
|
|
53
|
-
NODE_MAJOR=$(printf '%s' "$NODE_VERSION" | cut -d. -f1)
|
|
54
|
-
if [ "$NODE_MAJOR" -lt "$REQUIRED_NODE_MAJOR" ]; then
|
|
55
|
-
err "Node.js ${REQUIRED_NODE_MAJOR}+ required (found v${NODE_VERSION})."
|
|
56
|
-
err "Tip: nvm install ${REQUIRED_NODE_MAJOR} && nvm use ${REQUIRED_NODE_MAJOR}"
|
|
57
|
-
exit 1
|
|
58
|
-
fi
|
|
59
|
-
require_cmd npm
|
|
60
|
-
|
|
61
|
-
info "Natroc installer"
|
|
62
|
-
info " OS: ${OS} (${ARCH})"
|
|
63
|
-
info " Node: v${NODE_VERSION}"
|
|
64
|
-
info " Method: ${METHOD}"
|
|
65
|
-
info ""
|
|
66
|
-
|
|
67
|
-
# ----- install methods -------------------------------------------------------
|
|
68
|
-
|
|
69
|
-
install_npm() {
|
|
70
|
-
info "Installing ${PACKAGE_NAME} from the npm registry..."
|
|
71
|
-
if ! npm install -g "${PACKAGE_NAME}@latest"; then
|
|
72
|
-
err ""
|
|
73
|
-
err "npm install -g failed. Two common causes:"
|
|
74
|
-
err " 1. Package not published yet — try git mode:"
|
|
75
|
-
err " NATROC_INSTALL_METHOD=git curl -fsSL https://natroc.ai/install.sh | sh"
|
|
76
|
-
err " 2. No write permission to global prefix — use a user-local prefix:"
|
|
77
|
-
err " npm config set prefix \"\$HOME/.local\""
|
|
78
|
-
err " export PATH=\"\$HOME/.local/bin:\$PATH\""
|
|
79
|
-
exit 1
|
|
80
|
-
fi
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
install_git() {
|
|
84
|
-
require_cmd git
|
|
85
|
-
|
|
86
|
-
if [ -d "${SRC_DIR}/.git" ]; then
|
|
87
|
-
info "Updating existing clone in ${SRC_DIR}..."
|
|
88
|
-
(cd "${SRC_DIR}" && git pull --ff-only)
|
|
89
|
-
else
|
|
90
|
-
info "Cloning ${GIT_REPO} into ${SRC_DIR}..."
|
|
91
|
-
mkdir -p "$(dirname "${SRC_DIR}")"
|
|
92
|
-
git clone --depth=1 "${GIT_REPO}" "${SRC_DIR}"
|
|
93
|
-
fi
|
|
94
|
-
|
|
95
|
-
info "Installing dependencies + building (this may take a minute)..."
|
|
96
|
-
(cd "${SRC_DIR}" && npm install && npm run all:build)
|
|
97
|
-
|
|
98
|
-
info "Linking 'natroc' bin globally (via npm link)..."
|
|
99
|
-
(cd "${SRC_DIR}" && npm link)
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
install_tarball() {
|
|
103
|
-
url="${NATROC_TARBALL_URL:-}"
|
|
104
|
-
if [ -z "$url" ]; then
|
|
105
|
-
err "Set NATROC_TARBALL_URL=<url-or-path-to-natroc-x.y.z.tgz> for tarball method."
|
|
106
|
-
exit 1
|
|
107
|
-
fi
|
|
108
|
-
info "Installing from tarball: ${url}"
|
|
109
|
-
npm install -g "${url}"
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
case "${METHOD}" in
|
|
113
|
-
npm) install_npm ;;
|
|
114
|
-
git) install_git ;;
|
|
115
|
-
tarball) install_tarball ;;
|
|
116
|
-
*)
|
|
117
|
-
err "Unknown NATROC_INSTALL_METHOD: ${METHOD}"
|
|
118
|
-
err "Valid values: npm | git | tarball"
|
|
119
|
-
exit 1
|
|
120
|
-
;;
|
|
121
|
-
esac
|
|
122
|
-
|
|
123
|
-
# ----- post-install hint -----------------------------------------------------
|
|
124
|
-
|
|
125
|
-
info ""
|
|
126
|
-
info "Installed. Next steps:"
|
|
127
|
-
info " natroc setup # initialize ~/.natroc/"
|
|
128
|
-
info " natroc server # run gateway in the foreground"
|
|
129
|
-
info " natroc daemon install # OR install as a system service"
|
|
130
|
-
info " natroc daemon status # inspect the service"
|
|
131
|
-
info ""
|
|
132
|
-
info "Web UI + WebSocket: http://127.0.0.1:18789/"
|