@profullstack/agenticjobs 0.1.1 → 0.2.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,152 @@
1
+ #!/bin/sh
2
+ # agenticjobs installer.
3
+ #
4
+ # curl -fsSL https://agenticjobs.work/install.sh | sh
5
+ #
6
+ # Installs the `agenticjobs` CLI and the `agenticjobs-mcp` stdio server under
7
+ # your home directory. No root, no package manager, no system files touched.
8
+ # Updating is `agenticjobs update` and removing is `agenticjobs uninstall`,
9
+ # which runs a script this installer leaves behind.
10
+ #
11
+ # sh -s -- --version X install a specific release
12
+ # sh -s -- --prefix DIR install root (default: ~/.local)
13
+ set -eu
14
+
15
+ PKG="@profullstack/agenticjobs"
16
+ SITE="${AGENTICJOBS_SITE:-https://agenticjobs.work}"
17
+ PREFIX="${AGENTICJOBS_PREFIX:-$HOME/.local}"
18
+ VERSION="${AGENTICJOBS_VERSION:-}"
19
+
20
+ while [ $# -gt 0 ]; do
21
+ case "$1" in
22
+ --version) VERSION="${2:?--version needs a value}"; shift ;;
23
+ --prefix) PREFIX="${2:?--prefix needs a value}"; shift ;;
24
+ -h|--help) sed -n '2,13p' "$0" 2>/dev/null || echo "See $SITE"; exit 0 ;;
25
+ *) echo "unknown option: $1" >&2; exit 64 ;;
26
+ esac
27
+ shift
28
+ done
29
+
30
+ say() { printf '%s\n' "$*"; }
31
+ fail() { printf 'error: %s\n' "$*" >&2; exit 1; }
32
+
33
+ # --- what this machine has ----------------------------------------------------
34
+
35
+ case "$(uname -s)" in
36
+ Linux|Darwin) : ;;
37
+ *) fail "unsupported operating system: $(uname -s). Linux and macOS are supported." ;;
38
+ esac
39
+
40
+ # The board is pure JavaScript, so there is no per-architecture build and no
41
+ # tarball to pick. What it does need is a Node new enough to run it.
42
+ command -v node >/dev/null 2>&1 || fail "Node 24 or newer is required, and node was not found.
43
+ Debian/Ubuntu: https://github.com/nodesource/distributions
44
+ macOS: brew install node
45
+ Any: https://mise.jdx.dev"
46
+
47
+ NODE_MAJOR=$(node -p 'process.versions.node.split(".")[0]' 2>/dev/null || echo 0)
48
+ if [ "$NODE_MAJOR" -lt 24 ]; then
49
+ fail "Node 24 or newer is required; this is $(node -v).
50
+ agenticjobs runs unbundled ES modules and uses Node 24 APIs."
51
+ fi
52
+
53
+ command -v npm >/dev/null 2>&1 || fail "npm is required (it ships with Node)."
54
+
55
+ SHARE="$PREFIX/share/agenticjobs"
56
+ BIN="$PREFIX/bin"
57
+ mkdir -p "$SHARE" "$BIN"
58
+
59
+ # --- install ------------------------------------------------------------------
60
+
61
+ SPEC="$PKG"
62
+ [ -n "$VERSION" ] && SPEC="$PKG@$VERSION"
63
+
64
+ say "Installing $SPEC into $SHARE ..."
65
+
66
+ # Installed into a private tree rather than globally, so this cannot fight with
67
+ # a system npm prefix, cannot need root, and can be removed by deleting one
68
+ # directory. --omit=dev because nothing here builds from source.
69
+ rm -rf "$SHARE/node_modules" "$SHARE/package.json" "$SHARE/package-lock.json"
70
+ cd "$SHARE"
71
+ printf '{\n "name": "agenticjobs-install",\n "private": true\n}\n' > package.json
72
+ npm install --silent --no-audit --no-fund --omit=dev "$SPEC" >/dev/null 2>&1 ||
73
+ npm install --no-audit --no-fund --omit=dev "$SPEC" ||
74
+ fail "npm could not install $SPEC"
75
+
76
+ PKG_DIR="$SHARE/node_modules/$PKG"
77
+ [ -d "$PKG_DIR" ] || fail "$SPEC installed but $PKG_DIR is missing."
78
+
79
+ INSTALLED=$(node -p "require('$PKG_DIR/package.json').version" 2>/dev/null || echo "unknown")
80
+
81
+ # --- shims --------------------------------------------------------------------
82
+ #
83
+ # Written here rather than symlinked, so the CLI always runs against the copy
84
+ # this installer put down even if npm's own bin links change underneath.
85
+
86
+ for cmd in agenticjobs agenticjobs-mcp; do
87
+ entry="$PKG_DIR/bin/$cmd.mjs"
88
+ [ -f "$entry" ] || fail "$SPEC does not contain bin/$cmd.mjs"
89
+ cat > "$BIN/$cmd" <<SHIM
90
+ #!/bin/sh
91
+ # $cmd. Written by the installer; \`agenticjobs uninstall\` removes it.
92
+ AGENTICJOBS_HOME="$SHARE" exec node "$entry" "\$@"
93
+ SHIM
94
+ chmod 0755 "$BIN/$cmd"
95
+ done
96
+
97
+ # --- what was installed, and how to remove it ---------------------------------
98
+
99
+ PATHS="$BIN/agenticjobs
100
+ $BIN/agenticjobs-mcp
101
+ $SHARE"
102
+
103
+ INSTALLED_AT=$(date -u +%Y-%m-%dT%H:%M:%SZ)
104
+ {
105
+ printf '{\n'
106
+ printf ' "package": "%s",\n' "$PKG"
107
+ printf ' "version": "%s",\n' "$INSTALLED"
108
+ printf ' "installer": "%s/install.sh",\n' "$SITE"
109
+ printf ' "installedAt": "%s",\n' "$INSTALLED_AT"
110
+ printf ' "prefix": "%s",\n' "$PREFIX"
111
+ printf ' "paths": [\n'
112
+ printf '%s\n' "$PATHS" | sed 's/.*/ "&",/' | sed '$ s/,$//'
113
+ printf ' ]\n}\n'
114
+ } > "$SHARE/manifest.json"
115
+
116
+ # Written at install time by the thing that knew exactly what it created, so
117
+ # removal is exact and works with no network. A tool that needs the internet to
118
+ # uninstall itself is one you cannot remove on a plane.
119
+ {
120
+ echo '#!/bin/sh'
121
+ echo '# Removes agenticjobs. Written by the installer.'
122
+ echo '# Your config and your saved logins are NOT touched:'
123
+ echo '# ~/.config/agenticjobs/'
124
+ echo 'set -eu'
125
+ printf '%s\n' "$PATHS" | sed 's|.*|rm -rf "&"|'
126
+ echo 'echo "agenticjobs removed. Your boards and tokens are still in ~/.config/agenticjobs."'
127
+ } > "$SHARE/uninstall.sh"
128
+ chmod 0755 "$SHARE/uninstall.sh"
129
+
130
+ # --- report -------------------------------------------------------------------
131
+
132
+ say ""
133
+ say "Installed agenticjobs $INSTALLED"
134
+ say ""
135
+
136
+ case ":$PATH:" in
137
+ *":$BIN:"*)
138
+ say "Next:"
139
+ say " agenticjobs signup create an account on $SITE"
140
+ say " agenticjobs search rust search it"
141
+ ;;
142
+ *)
143
+ say "$BIN is not on your PATH. Add it:"
144
+ say " echo 'export PATH=\"$BIN:\$PATH\"' >> ~/.profile && . ~/.profile"
145
+ say ""
146
+ say "Or run it directly: $BIN/agenticjobs signup"
147
+ ;;
148
+ esac
149
+
150
+ say ""
151
+ say "Update with \`agenticjobs update\`, remove with \`agenticjobs uninstall\`."
152
+ say "Docs: $SITE/docs"