jaypost 0.0.0 → 0.7.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/CHANGELOG.md +63 -0
- package/LICENSE +201 -0
- package/README.md +692 -1
- package/dist/cli.js +8398 -0
- package/dist/index.cjs +583 -0
- package/dist/index.d.cts +105 -0
- package/dist/index.d.ts +105 -0
- package/dist/index.js +579 -0
- package/install.sh +69 -0
- package/package.json +68 -3
package/install.sh
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# Installs the jaypost standalone binary to ~/.local/bin, then runs `jaypost init`.
|
|
3
|
+
# Usage: curl -fsSL https://unpkg.com/jaypost/install.sh | sh
|
|
4
|
+
# JAYPOST_RELEASE_URL overrides where the binaries come from (tests use it).
|
|
5
|
+
set -eu
|
|
6
|
+
|
|
7
|
+
release_url="${JAYPOST_RELEASE_URL:-https://github.com/bithyte/jaypost/releases/latest/download}"
|
|
8
|
+
bin_dir="$HOME/.local/bin"
|
|
9
|
+
|
|
10
|
+
fail() {
|
|
11
|
+
echo "jaypost install: $1" >&2
|
|
12
|
+
exit 1
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
case "$(uname -s)" in
|
|
16
|
+
Linux) os=linux ;;
|
|
17
|
+
Darwin) os=darwin ;;
|
|
18
|
+
*) fail "no binary for $(uname -s); use npx jaypost init instead (needs Node 24+)" ;;
|
|
19
|
+
esac
|
|
20
|
+
|
|
21
|
+
case "$(uname -m)" in
|
|
22
|
+
x86_64 | amd64) arch=x64 ;;
|
|
23
|
+
aarch64 | arm64) arch=arm64 ;;
|
|
24
|
+
*) fail "no binary for $(uname -m); use npx jaypost init instead (needs Node 24+)" ;;
|
|
25
|
+
esac
|
|
26
|
+
|
|
27
|
+
# A shell running under Rosetta reports x86_64 on Apple silicon; the native binary is better
|
|
28
|
+
if [ "$os" = darwin ] && [ "$arch" = x64 ] && [ "$(sysctl -n hw.optional.arm64 2>/dev/null)" = 1 ]; then
|
|
29
|
+
arch=arm64
|
|
30
|
+
fi
|
|
31
|
+
|
|
32
|
+
if command -v sha256sum >/dev/null 2>&1; then
|
|
33
|
+
hash_file() { sha256sum "$1" | cut -d' ' -f1; }
|
|
34
|
+
elif command -v shasum >/dev/null 2>&1; then
|
|
35
|
+
hash_file() { shasum -a 256 "$1" | cut -d' ' -f1; }
|
|
36
|
+
else
|
|
37
|
+
fail "needs sha256sum or shasum to check the download"
|
|
38
|
+
fi
|
|
39
|
+
|
|
40
|
+
asset="jaypost-$os-$arch.gz"
|
|
41
|
+
temp_dir=$(mktemp -d)
|
|
42
|
+
trap 'rm -rf "$temp_dir" "$bin_dir/jaypost.$$.tmp"' EXIT
|
|
43
|
+
|
|
44
|
+
echo "Downloading $asset"
|
|
45
|
+
for file in "$asset" SHA256SUMS; do
|
|
46
|
+
if ! curl -fsSL -o "$temp_dir/$file" "$release_url/$file"; then
|
|
47
|
+
fail "couldn't download $release_url/$file; if a release just came out, its binaries may still be uploading, so try again in a few minutes"
|
|
48
|
+
fi
|
|
49
|
+
done
|
|
50
|
+
|
|
51
|
+
expected=$(awk -v name="$asset" '$2 == name { print $1 }' "$temp_dir/SHA256SUMS")
|
|
52
|
+
actual=$(hash_file "$temp_dir/$asset")
|
|
53
|
+
if [ -z "$expected" ] || [ "$expected" != "$actual" ]; then
|
|
54
|
+
fail "checksum of $asset doesn't match SHA256SUMS"
|
|
55
|
+
fi
|
|
56
|
+
|
|
57
|
+
# Unpack next to the target and rename, so a running copy is never half-written
|
|
58
|
+
mkdir -p "$bin_dir"
|
|
59
|
+
gunzip -c "$temp_dir/$asset" >"$bin_dir/jaypost.$$.tmp"
|
|
60
|
+
chmod +x "$bin_dir/jaypost.$$.tmp"
|
|
61
|
+
mv -f "$bin_dir/jaypost.$$.tmp" "$bin_dir/jaypost"
|
|
62
|
+
echo "Installed $bin_dir/jaypost"
|
|
63
|
+
|
|
64
|
+
# stdin is this script when piped from curl, so init's prompts need the terminal
|
|
65
|
+
if ! (: </dev/tty) 2>/dev/null; then
|
|
66
|
+
echo "No terminal to set it up from; run $bin_dir/jaypost init"
|
|
67
|
+
exit 0
|
|
68
|
+
fi
|
|
69
|
+
"$bin_dir/jaypost" init </dev/tty
|
package/package.json
CHANGED
|
@@ -1,11 +1,76 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jaypost",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.7.0",
|
|
4
|
+
"description": "Local HTTP API that asks you a question on Telegram or Discord with buttons and returns your answer",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"approval",
|
|
7
|
+
"bot",
|
|
8
|
+
"discord",
|
|
9
|
+
"human-in-the-loop",
|
|
10
|
+
"telegram"
|
|
11
|
+
],
|
|
5
12
|
"license": "Apache-2.0",
|
|
6
13
|
"author": "Cozmin",
|
|
7
14
|
"repository": {
|
|
8
15
|
"type": "git",
|
|
9
16
|
"url": "git+https://github.com/bithyte/jaypost.git"
|
|
17
|
+
},
|
|
18
|
+
"bin": {
|
|
19
|
+
"jaypost": "dist/cli.js"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist",
|
|
23
|
+
"CHANGELOG.md",
|
|
24
|
+
"install.sh"
|
|
25
|
+
],
|
|
26
|
+
"type": "module",
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"import": {
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"default": "./dist/index.js"
|
|
32
|
+
},
|
|
33
|
+
"require": {
|
|
34
|
+
"types": "./dist/index.d.cts",
|
|
35
|
+
"default": "./dist/index.cjs"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"./package.json": "./package.json"
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@clack/prompts": "^1.8.1",
|
|
42
|
+
"@discordjs/core": "^2.6.0",
|
|
43
|
+
"@discordjs/rest": "^2.6.3",
|
|
44
|
+
"@discordjs/ws": "^2.0.4",
|
|
45
|
+
"@modelcontextprotocol/sdk": "^1.32.1",
|
|
46
|
+
"commander": "^15.0.0",
|
|
47
|
+
"fastify": "^5.12.7",
|
|
48
|
+
"grammy": "^1.46.0",
|
|
49
|
+
"yaml": "^2.9.1",
|
|
50
|
+
"zod": "^4.6.7"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@changesets/cli": "^3.0.3",
|
|
54
|
+
"@types/node": "24.19.2",
|
|
55
|
+
"punycode": "^2.3.1",
|
|
56
|
+
"typescript": "7.0.2",
|
|
57
|
+
"vite-plus": "1.3.0"
|
|
58
|
+
},
|
|
59
|
+
"engines": {
|
|
60
|
+
"node": ">=24.2"
|
|
61
|
+
},
|
|
62
|
+
"scripts": {
|
|
63
|
+
"start": "node src/cli.ts start",
|
|
64
|
+
"cli": "node src/cli.ts",
|
|
65
|
+
"test": "vp test",
|
|
66
|
+
"check": "vp check",
|
|
67
|
+
"build": "tsc -p tsconfig.build.json && vp pack",
|
|
68
|
+
"build:exe": "node scripts/build-exe.ts",
|
|
69
|
+
"openapi": "node scripts/openapi.ts",
|
|
70
|
+
"changeset": "changeset",
|
|
71
|
+
"version-packages": "changeset version && vp install --lockfile-only && vp run openapi",
|
|
72
|
+
"web:dev": "vp run --filter jaypost-site dev",
|
|
73
|
+
"web:build": "vp run --filter jaypost-site build",
|
|
74
|
+
"web:preview": "vp run --filter jaypost-site preview"
|
|
10
75
|
}
|
|
11
|
-
}
|
|
76
|
+
}
|