@arittr/glorp 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.
- package/LICENSE +21 -0
- package/README.md +23 -0
- package/bin/glorp.js +78 -0
- package/package.json +27 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Drew Ritter
|
|
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/README.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# glorp
|
|
2
|
+
|
|
3
|
+
A terminal pet fed by real Claude Code and Codex token usage.
|
|
4
|
+
|
|
5
|
+
It lives in your shell, hatches from a local seed, and grows from the work you actually do. No manual feeding — when you ship more code, your pet evolves.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g @arittr/glorp
|
|
11
|
+
glorp init
|
|
12
|
+
glorp watch
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
The npm package bundles the native binary for your platform plus the `ccusage` and `@ccusage/codex` helpers, so no extra setup is needed.
|
|
16
|
+
|
|
17
|
+
## Privacy
|
|
18
|
+
|
|
19
|
+
Glorp is local-only. No telemetry, no upload, no transcripts. It never stores prompt text, response text, tool-call payloads, or source files — only normalized numeric usage metadata.
|
|
20
|
+
|
|
21
|
+
## More
|
|
22
|
+
|
|
23
|
+
Source, documentation, and issues: https://github.com/arittr/glorp
|
package/bin/glorp.js
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { spawnSync } from "node:child_process";
|
|
3
|
+
import fs from "node:fs";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { createRequire } from "node:module";
|
|
6
|
+
import { fileURLToPath } from "node:url";
|
|
7
|
+
|
|
8
|
+
const require = createRequire(import.meta.url);
|
|
9
|
+
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
10
|
+
|
|
11
|
+
function platformKey() {
|
|
12
|
+
const arch = process.arch === "x64" ? "x64" : process.arch === "arm64" ? "arm64" : process.arch;
|
|
13
|
+
if (process.platform === "darwin") return `darwin-${arch}`;
|
|
14
|
+
if (process.platform === "linux") return `linux-${arch}`;
|
|
15
|
+
if (process.platform === "win32") return `win32-${arch}`;
|
|
16
|
+
throw new Error(`unsupported platform: ${process.platform}-${process.arch}`);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function platformPackageName() {
|
|
20
|
+
return `@arittr/glorp-${platformKey()}`;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function resolvePackageJson(pkg) {
|
|
24
|
+
try {
|
|
25
|
+
return require.resolve(`${pkg}/package.json`);
|
|
26
|
+
} catch {
|
|
27
|
+
if (!pkg.startsWith("@arittr/glorp-")) return undefined;
|
|
28
|
+
const local = path.resolve(here, "../../platform", platformKey(), "package.json");
|
|
29
|
+
return fs.existsSync(local) ? local : undefined;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function resolveNativeBinary(env) {
|
|
34
|
+
if (env.GLORP_NATIVE_BIN_FOR_TEST) return env.GLORP_NATIVE_BIN_FOR_TEST;
|
|
35
|
+
|
|
36
|
+
const pkgJson = resolvePackageJson(platformPackageName());
|
|
37
|
+
if (!pkgJson) throw new Error(`native glorp package missing for ${process.platform}-${process.arch}`);
|
|
38
|
+
|
|
39
|
+
const exe = process.platform === "win32" ? "glorp.exe" : "glorp";
|
|
40
|
+
const bin = path.join(path.dirname(pkgJson), "bin", exe);
|
|
41
|
+
if (!fs.existsSync(bin)) throw new Error(`native glorp binary missing at ${bin}`);
|
|
42
|
+
return bin;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function resolvePackageBin(pkg, binName) {
|
|
46
|
+
const pkgJsonPath = resolvePackageJson(pkg);
|
|
47
|
+
if (!pkgJsonPath) return undefined;
|
|
48
|
+
|
|
49
|
+
try {
|
|
50
|
+
const pkgJson = JSON.parse(fs.readFileSync(pkgJsonPath, "utf8"));
|
|
51
|
+
const rel = typeof pkgJson.bin === "string" ? pkgJson.bin : pkgJson.bin?.[binName];
|
|
52
|
+
return rel ? path.resolve(path.dirname(pkgJsonPath), rel) : undefined;
|
|
53
|
+
} catch {
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const env = { ...process.env };
|
|
59
|
+
if (env.GLORP_SKIP_BUNDLED_HELPERS_FOR_TEST !== "1") {
|
|
60
|
+
env.GLORP_CCUSAGE_BIN ??= resolvePackageBin("ccusage", "ccusage");
|
|
61
|
+
env.GLORP_CCUSAGE_CODEX_BIN ??= resolvePackageBin("@ccusage/codex", "ccusage-codex");
|
|
62
|
+
}
|
|
63
|
+
env.GLORP_NODE_BIN ??= process.execPath;
|
|
64
|
+
|
|
65
|
+
let native;
|
|
66
|
+
try {
|
|
67
|
+
native = resolveNativeBinary(env);
|
|
68
|
+
} catch (err) {
|
|
69
|
+
console.error(`glorp: ${err.message}`);
|
|
70
|
+
process.exit(1);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const child = spawnSync(native, process.argv.slice(2), { stdio: "inherit", env });
|
|
74
|
+
if (child.error) {
|
|
75
|
+
console.error(`glorp: ${child.error.message}`);
|
|
76
|
+
process.exit(1);
|
|
77
|
+
}
|
|
78
|
+
process.exit(child.status ?? 1);
|
package/package.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@arittr/glorp",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A terminal pet fed by real AI coding token usage",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"bin": {
|
|
7
|
+
"glorp": "bin/glorp.js"
|
|
8
|
+
},
|
|
9
|
+
"type": "module",
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"@ccusage/codex": "^18.0.11",
|
|
12
|
+
"ccusage": "^18.0.11"
|
|
13
|
+
},
|
|
14
|
+
"optionalDependencies": {
|
|
15
|
+
"@arittr/glorp-darwin-arm64": "0.1.0",
|
|
16
|
+
"@arittr/glorp-darwin-x64": "0.1.0",
|
|
17
|
+
"@arittr/glorp-linux-arm64": "0.1.0",
|
|
18
|
+
"@arittr/glorp-linux-x64": "0.1.0",
|
|
19
|
+
"@arittr/glorp-win32-x64": "0.1.0"
|
|
20
|
+
},
|
|
21
|
+
"scripts": {
|
|
22
|
+
"test": "node test/smoke.mjs"
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"bin/glorp.js"
|
|
26
|
+
]
|
|
27
|
+
}
|