forbocai 0.0.4 → 0.0.5

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/dist/cli.d.mts ADDED
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node
package/dist/cli.d.ts ADDED
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node
package/dist/cli.js ADDED
@@ -0,0 +1,57 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
18
+ // If the importer is in node compatibility mode or this is not an ESM
19
+ // file that has been converted to a CommonJS file using a Babel-
20
+ // compatible transform (i.e. "__esModule" has not been set), then set
21
+ // "default" to the CommonJS "module.exports" for node compatibility.
22
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
23
+ mod
24
+ ));
25
+
26
+ // src/cli.ts
27
+ var import_https = __toESM(require("https"));
28
+ var API_URL = "https://api-iptznd9tt-seandinwiddie1s-projects.vercel.app";
29
+ var args = process.argv.slice(2);
30
+ var command = args[0];
31
+ var subcommand = args[1];
32
+ if (command === "api" && subcommand === "status") {
33
+ console.log(`> Checking API Status (${API_URL})...`);
34
+ import_https.default.get(API_URL, (res) => {
35
+ let data = "";
36
+ res.on("data", (chunk) => data += chunk);
37
+ res.on("end", () => {
38
+ try {
39
+ if (res.statusCode !== 200) {
40
+ console.error(`> Error: Server returned ${res.statusCode} (Likely Vercel Auth Protected)`);
41
+ process.exit(1);
42
+ }
43
+ const json = JSON.parse(data);
44
+ console.log(`> Status: \x1B[32m${json.status.toUpperCase()}\x1B[0m`);
45
+ console.log(`> Message: ${json.message}`);
46
+ console.log(`> Version: ${json.version}`);
47
+ } catch (e) {
48
+ console.error("> Error: Invalid JSON response from server.");
49
+ console.log(data.substring(0, 100) + "...");
50
+ }
51
+ });
52
+ }).on("error", (e) => {
53
+ console.error(`> Error: ${e.message}`);
54
+ });
55
+ } else {
56
+ console.log("Usage: forbocai api status");
57
+ }
package/dist/cli.mjs ADDED
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/cli.ts
4
+ import https from "https";
5
+ var API_URL = "https://api-iptznd9tt-seandinwiddie1s-projects.vercel.app";
6
+ var args = process.argv.slice(2);
7
+ var command = args[0];
8
+ var subcommand = args[1];
9
+ if (command === "api" && subcommand === "status") {
10
+ console.log(`> Checking API Status (${API_URL})...`);
11
+ https.get(API_URL, (res) => {
12
+ let data = "";
13
+ res.on("data", (chunk) => data += chunk);
14
+ res.on("end", () => {
15
+ try {
16
+ if (res.statusCode !== 200) {
17
+ console.error(`> Error: Server returned ${res.statusCode} (Likely Vercel Auth Protected)`);
18
+ process.exit(1);
19
+ }
20
+ const json = JSON.parse(data);
21
+ console.log(`> Status: \x1B[32m${json.status.toUpperCase()}\x1B[0m`);
22
+ console.log(`> Message: ${json.message}`);
23
+ console.log(`> Version: ${json.version}`);
24
+ } catch (e) {
25
+ console.error("> Error: Invalid JSON response from server.");
26
+ console.log(data.substring(0, 100) + "...");
27
+ }
28
+ });
29
+ }).on("error", (e) => {
30
+ console.error(`> Error: ${e.message}`);
31
+ });
32
+ } else {
33
+ console.log("Usage: forbocai api status");
34
+ }
package/package.json CHANGED
@@ -1,12 +1,15 @@
1
1
  {
2
2
  "name": "forbocai",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "The Infrastructure Layer for Autonomous AI Characters",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
7
7
  "types": "dist/index.d.ts",
8
+ "bin": {
9
+ "forbocai": "dist/cli.js"
10
+ },
8
11
  "scripts": {
9
- "build": "tsup src/index.ts --format cjs,esm --dts",
12
+ "build": "tsup src/index.ts src/cli.ts --format cjs,esm --dts",
10
13
  "dev": "tsup src/index.ts --watch",
11
14
  "test": "echo 'No tests yet'",
12
15
  "postinstall": "node postinstall.js"
package/postinstall.js CHANGED
@@ -13,6 +13,8 @@ try {
13
13
  > Connecting into the Neuro-Symbolic Grid...
14
14
  > Status: ONLINE
15
15
 
16
+ Run 'forbocai api status' to verify connection.
17
+
16
18
  Welcome to the Future of NPC Intelligence.
17
19
  `;
18
20
  fs.writeSync(tty, msg);