@agentxjs/portagent 0.0.2
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 +21 -0
- package/bin/portagent.js +2 -0
- package/dist/chunk-7D4SUZUM.js +38 -0
- package/dist/chunk-7D4SUZUM.js.map +1 -0
- package/dist/cli/index.js +43 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/public/assets/index-BEpPZXDY.js +245 -0
- package/dist/public/assets/index-BEpPZXDY.js.map +1 -0
- package/dist/public/assets/index-CwJV4aRD.css +1 -0
- package/dist/public/favicon.svg +4 -0
- package/dist/public/index.html +14 -0
- package/dist/server/index.js +642 -0
- package/dist/server/index.js.map +1 -0
- package/package.json +63 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Deepractice
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/bin/portagent.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
8
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
9
|
+
}) : x)(function(x) {
|
|
10
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
11
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
12
|
+
});
|
|
13
|
+
var __commonJS = (cb, mod) => function __require2() {
|
|
14
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
15
|
+
};
|
|
16
|
+
var __copyProps = (to, from, except, desc) => {
|
|
17
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
18
|
+
for (let key of __getOwnPropNames(from))
|
|
19
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
20
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
21
|
+
}
|
|
22
|
+
return to;
|
|
23
|
+
};
|
|
24
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
25
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
26
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
27
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
28
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
29
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
30
|
+
mod
|
|
31
|
+
));
|
|
32
|
+
|
|
33
|
+
export {
|
|
34
|
+
__require,
|
|
35
|
+
__commonJS,
|
|
36
|
+
__toESM
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=chunk-7D4SUZUM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/cli/index.ts
|
|
4
|
+
import { Command } from "commander";
|
|
5
|
+
import { config } from "dotenv";
|
|
6
|
+
import { existsSync } from "fs";
|
|
7
|
+
import { resolve } from "path";
|
|
8
|
+
var program = new Command();
|
|
9
|
+
program.name("portagent").description("Portagent - AgentX Portal Application").version("0.0.1").option("-p, --port <port>", "Port to listen on", "5200").option("-e, --env-file <path>", "Path to environment file").option("--password <password>", "Set login password (or use PORTAGENT_PASSWORD env var)").option("--jwt-secret <secret>", "JWT secret for token signing (or use JWT_SECRET env var)").option("--api-key <key>", "LLM provider API key (or use LLM_PROVIDER_KEY env var)").option("--api-url <url>", "LLM provider base URL (or use LLM_PROVIDER_URL env var)").option("--model <model>", "LLM model name (or use LLM_PROVIDER_MODEL env var)").action(async (options) => {
|
|
10
|
+
if (options.envFile) {
|
|
11
|
+
const envPath = resolve(process.cwd(), options.envFile);
|
|
12
|
+
if (!existsSync(envPath)) {
|
|
13
|
+
console.error(`Error: Environment file not found: ${envPath}`);
|
|
14
|
+
process.exit(1);
|
|
15
|
+
}
|
|
16
|
+
config({ path: envPath });
|
|
17
|
+
} else {
|
|
18
|
+
config({ path: resolve(process.cwd(), ".env") });
|
|
19
|
+
config({ path: resolve(process.cwd(), ".env.local") });
|
|
20
|
+
}
|
|
21
|
+
if (options.port) {
|
|
22
|
+
process.env.PORT = options.port;
|
|
23
|
+
}
|
|
24
|
+
if (options.password) {
|
|
25
|
+
process.env.PORTAGENT_PASSWORD = options.password;
|
|
26
|
+
}
|
|
27
|
+
if (options.jwtSecret) {
|
|
28
|
+
process.env.JWT_SECRET = options.jwtSecret;
|
|
29
|
+
}
|
|
30
|
+
if (options.apiKey) {
|
|
31
|
+
process.env.LLM_PROVIDER_KEY = options.apiKey;
|
|
32
|
+
}
|
|
33
|
+
if (options.apiUrl) {
|
|
34
|
+
process.env.LLM_PROVIDER_URL = options.apiUrl;
|
|
35
|
+
}
|
|
36
|
+
if (options.model) {
|
|
37
|
+
process.env.LLM_PROVIDER_MODEL = options.model;
|
|
38
|
+
}
|
|
39
|
+
const { startServer } = await import("../server/index.js");
|
|
40
|
+
await startServer();
|
|
41
|
+
});
|
|
42
|
+
program.parse();
|
|
43
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/cli/index.ts"],"sourcesContent":["#!/usr/bin/env node\n/**\n * Portagent CLI\n *\n * Command-line interface for running the Portagent server.\n *\n * Usage:\n * portagent # Start with defaults\n * portagent -p 3000 # Custom port\n * portagent --env-file .env.prod # Load custom env file\n */\n\nimport { Command } from \"commander\";\nimport { config } from \"dotenv\";\nimport { existsSync } from \"fs\";\nimport { resolve } from \"path\";\n\nconst program = new Command();\n\nprogram\n .name(\"portagent\")\n .description(\"Portagent - AgentX Portal Application\")\n .version(\"0.0.1\")\n .option(\"-p, --port <port>\", \"Port to listen on\", \"5200\")\n .option(\"-e, --env-file <path>\", \"Path to environment file\")\n .option(\"--password <password>\", \"Set login password (or use PORTAGENT_PASSWORD env var)\")\n .option(\"--jwt-secret <secret>\", \"JWT secret for token signing (or use JWT_SECRET env var)\")\n .option(\"--api-key <key>\", \"LLM provider API key (or use LLM_PROVIDER_KEY env var)\")\n .option(\"--api-url <url>\", \"LLM provider base URL (or use LLM_PROVIDER_URL env var)\")\n .option(\"--model <model>\", \"LLM model name (or use LLM_PROVIDER_MODEL env var)\")\n .action(async (options) => {\n // Load env file (CLI option takes priority, then defaults)\n if (options.envFile) {\n const envPath = resolve(process.cwd(), options.envFile);\n if (!existsSync(envPath)) {\n console.error(`Error: Environment file not found: ${envPath}`);\n process.exit(1);\n }\n config({ path: envPath });\n } else {\n // Default: load .env and .env.local from current directory\n config({ path: resolve(process.cwd(), \".env\") });\n config({ path: resolve(process.cwd(), \".env.local\") });\n }\n\n // Set environment variables from CLI options (override env file)\n if (options.port) {\n process.env.PORT = options.port;\n }\n if (options.password) {\n process.env.PORTAGENT_PASSWORD = options.password;\n }\n if (options.jwtSecret) {\n process.env.JWT_SECRET = options.jwtSecret;\n }\n if (options.apiKey) {\n process.env.LLM_PROVIDER_KEY = options.apiKey;\n }\n if (options.apiUrl) {\n process.env.LLM_PROVIDER_URL = options.apiUrl;\n }\n if (options.model) {\n process.env.LLM_PROVIDER_MODEL = options.model;\n }\n\n // Import and start server\n const { startServer } = await import(\"../server/index.js\");\n await startServer();\n });\n\nprogram.parse();\n"],"mappings":";;;AAYA,SAAS,eAAe;AACxB,SAAS,cAAc;AACvB,SAAS,kBAAkB;AAC3B,SAAS,eAAe;AAExB,IAAM,UAAU,IAAI,QAAQ;AAE5B,QACG,KAAK,WAAW,EAChB,YAAY,uCAAuC,EACnD,QAAQ,OAAO,EACf,OAAO,qBAAqB,qBAAqB,MAAM,EACvD,OAAO,yBAAyB,0BAA0B,EAC1D,OAAO,yBAAyB,wDAAwD,EACxF,OAAO,yBAAyB,0DAA0D,EAC1F,OAAO,mBAAmB,wDAAwD,EAClF,OAAO,mBAAmB,yDAAyD,EACnF,OAAO,mBAAmB,oDAAoD,EAC9E,OAAO,OAAO,YAAY;AAEzB,MAAI,QAAQ,SAAS;AACnB,UAAM,UAAU,QAAQ,QAAQ,IAAI,GAAG,QAAQ,OAAO;AACtD,QAA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