@klars/agentobs 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Container entrypoint for the hosted deployment (Dockerfile / docker-compose).
3
+ *
4
+ * Distinct from `agentobs dashboard`, which is the local single-user server:
5
+ * this binds 0.0.0.0 because it sits behind Caddy inside a container network,
6
+ * and it reads configuration from the environment rather than CLI flags.
7
+ *
8
+ * Note it currently serves the same local-first dashboard against the
9
+ * container's own SQLite file. The team/account layer that uses DATABASE_URL
10
+ * is not built yet - see docs/ROADMAP.md - so this deploys as a working
11
+ * single-tenant instance rather than pretending to a multi-tenant one.
12
+ */
13
+ import { startDashboard } from './index.js';
14
+ const port = Number(process.env.PORT ?? 8080);
15
+ // 0.0.0.0 is correct here and only here: the container is not directly
16
+ // exposed, Caddy terminates TLS in front of it, and the compose file never
17
+ // publishes this port to the host.
18
+ const host = process.env.HOST ?? '0.0.0.0';
19
+ // A token is always required on a non-loopback bind. Fail at startup rather
20
+ // than booting a server that answers every request with 401: a silently
21
+ // unauthorized container looks like a broken deploy, and the operator would
22
+ // have no hint that the missing variable is the cause.
23
+ const token = process.env.AGENTOBS_DASHBOARD_TOKEN ?? null;
24
+ if (host !== '127.0.0.1' && host !== 'localhost' && host !== '::1' && !token) {
25
+ console.error(`agentobs: refusing to start on ${host} without AGENTOBS_DASHBOARD_TOKEN.\n` +
26
+ `This server would be reachable beyond loopback, so a token is required.\n` +
27
+ `Generate one with: openssl rand -hex 32\n` +
28
+ `Then set AGENTOBS_DASHBOARD_TOKEN in the deployment .env.`);
29
+ process.exit(1);
30
+ }
31
+ const { port: actual } = await startDashboard({ port, host, token });
32
+ console.log(`agentobs server listening on ${host}:${actual}`);
33
+ for (const signal of ['SIGINT', 'SIGTERM']) {
34
+ process.on(signal, () => {
35
+ console.log(`received ${signal}, shutting down`);
36
+ process.exit(0);
37
+ });
38
+ }
39
+ //# sourceMappingURL=standalone.js.map
package/package.json ADDED
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "@klars/agentobs",
3
+ "version": "0.1.0",
4
+ "description": "Observability and control layer for AI coding agents - see every tool call, token, and dollar your agents spend, and stop them before they do something risky.",
5
+ "license": "MIT",
6
+ "author": "Klars AI",
7
+ "homepage": "https://github.com/klars-ai/agentobs",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/klars-ai/agentobs.git"
11
+ },
12
+ "keywords": [
13
+ "ai",
14
+ "agents",
15
+ "observability",
16
+ "claude-code",
17
+ "llm",
18
+ "cost-tracking",
19
+ "guardrails"
20
+ ],
21
+ "type": "module",
22
+ "engines": {
23
+ "node": ">=22.5"
24
+ },
25
+ "bin": {
26
+ "agentobs": "./bin/agentobs",
27
+ "agentobs-hook": "./bin/agentobs-hook"
28
+ },
29
+ "files": [
30
+ "dist/**/*.js",
31
+ "!dist/**/*.test.js",
32
+ "dist/core/schema.sql",
33
+ "dist/server/public",
34
+ "bin",
35
+ "README.md",
36
+ "LICENSE"
37
+ ],
38
+ "scripts": {
39
+ "build": "tsc -p tsconfig.json && npm run copy:assets",
40
+ "copy:assets": "node scripts/copy-assets.mjs",
41
+ "dev": "tsc -p tsconfig.json --watch",
42
+ "test": "npm run build && node --test \"dist/**/*.test.js\"",
43
+ "prepublishOnly": "npm run build"
44
+ },
45
+ "dependencies": {
46
+ "commander": "^12.1.0"
47
+ },
48
+ "devDependencies": {
49
+ "@types/node": "^22.10.0",
50
+ "typescript": "^5.7.0"
51
+ }
52
+ }