@forwardimpact/basecamp 0.2.0 → 1.0.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.
@@ -1,108 +0,0 @@
1
- #!/bin/bash
2
- set -e
3
-
4
- # Basecamp Installer (development / repo context)
5
- #
6
- # Sets up scheduler config, default knowledge base, and LaunchAgent for local
7
- # development. The compiled binary is installed via the .pkg installer instead.
8
- #
9
- # This script is for engineers running from the repo with deno or node.
10
-
11
- SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
12
- APP_NAME="fit-basecamp"
13
- BASECAMP_HOME="$HOME/.fit/basecamp"
14
- DEFAULT_KB="$HOME/Documents/Personal"
15
-
16
- echo ""
17
- echo "Basecamp Installer (dev)"
18
- echo "========================"
19
- echo ""
20
-
21
- # ---------------------------------------------------------------------------
22
- # 1. Set up scheduler home
23
- # ---------------------------------------------------------------------------
24
-
25
- echo "Setting up scheduler home at $BASECAMP_HOME ..."
26
- mkdir -p "$BASECAMP_HOME/logs"
27
-
28
- # ---------------------------------------------------------------------------
29
- # 2. Copy scheduler config (single source of truth: config/scheduler.json)
30
- # ---------------------------------------------------------------------------
31
-
32
- CONFIG_SRC=""
33
- if [ -f "$SCRIPT_DIR/../config/scheduler.json" ]; then
34
- CONFIG_SRC="$SCRIPT_DIR/../config/scheduler.json"
35
- fi
36
-
37
- if [ ! -f "$BASECAMP_HOME/scheduler.json" ]; then
38
- if [ -n "$CONFIG_SRC" ]; then
39
- cp "$CONFIG_SRC" "$BASECAMP_HOME/scheduler.json"
40
- echo " Created $BASECAMP_HOME/scheduler.json"
41
- else
42
- echo " Warning: config/scheduler.json not found, skipping config setup."
43
- fi
44
- else
45
- echo " Scheduler config already exists, skipping."
46
- fi
47
-
48
- # ---------------------------------------------------------------------------
49
- # 3. Initialize state file
50
- # ---------------------------------------------------------------------------
51
-
52
- if [ ! -f "$BASECAMP_HOME/state.json" ]; then
53
- echo '{ "tasks": {} }' > "$BASECAMP_HOME/state.json"
54
- echo " Created $BASECAMP_HOME/state.json"
55
- fi
56
-
57
- # ---------------------------------------------------------------------------
58
- # 4. Initialize default knowledge base
59
- # ---------------------------------------------------------------------------
60
-
61
- echo ""
62
- if [ ! -d "$DEFAULT_KB" ]; then
63
- echo "Initializing default knowledge base at $DEFAULT_KB ..."
64
- SCHEDULER="$SCRIPT_DIR/../basecamp.js"
65
- if command -v deno &>/dev/null && [ -f "$SCHEDULER" ]; then
66
- deno run --allow-all "$SCHEDULER" --init "$DEFAULT_KB"
67
- elif command -v node &>/dev/null && [ -f "$SCHEDULER" ]; then
68
- node "$SCHEDULER" --init "$DEFAULT_KB"
69
- else
70
- echo " Neither deno nor node found, skipping KB initialization."
71
- fi
72
- else
73
- echo "Basecamp already initialized at $DEFAULT_KB/"
74
- fi
75
-
76
- # ---------------------------------------------------------------------------
77
- # 5. Install LaunchAgent
78
- # ---------------------------------------------------------------------------
79
-
80
- echo ""
81
- echo "Installing background scheduler (LaunchAgent)..."
82
- SCHEDULER="$SCRIPT_DIR/../basecamp.js"
83
- if command -v deno &>/dev/null && [ -f "$SCHEDULER" ]; then
84
- deno run --allow-all "$SCHEDULER" --install-launchd
85
- elif command -v node &>/dev/null && [ -f "$SCHEDULER" ]; then
86
- node "$SCHEDULER" --install-launchd
87
- else
88
- echo " Neither deno nor node found, skipping LaunchAgent install."
89
- fi
90
-
91
- # ---------------------------------------------------------------------------
92
- # Summary
93
- # ---------------------------------------------------------------------------
94
-
95
- echo ""
96
- echo "Done! Basecamp is installed."
97
- echo ""
98
- echo " Config: $BASECAMP_HOME/scheduler.json"
99
- echo " Knowledge: $DEFAULT_KB/"
100
- echo " Logs: $BASECAMP_HOME/logs/"
101
- echo ""
102
- echo "Next steps:"
103
- echo " 1. Edit $DEFAULT_KB/USER.md with your name, email, and domain"
104
- echo " 2. Edit $BASECAMP_HOME/scheduler.json to configure tasks"
105
- echo " 3. Run the scheduler: deno run --allow-all basecamp.js --status"
106
- echo " 4. Start the daemon: deno run --allow-all basecamp.js --install-launchd"
107
- echo " 5. Open your KB: cd $DEFAULT_KB && claude"
108
- echo ""
@@ -1,62 +0,0 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <style>
5
- body {
6
- font-family:
7
- -apple-system,
8
- Helvetica Neue,
9
- sans-serif;
10
- padding: 20px;
11
- color: #1d1d1f;
12
- }
13
- h1 {
14
- font-size: 22px;
15
- font-weight: 600;
16
- margin-bottom: 16px;
17
- }
18
- p {
19
- font-size: 14px;
20
- line-height: 1.6;
21
- color: #424245;
22
- }
23
- code {
24
- font-family:
25
- SF Mono,
26
- Menlo,
27
- monospace;
28
- font-size: 13px;
29
- background: #f5f5f7;
30
- padding: 2px 6px;
31
- border-radius: 4px;
32
- }
33
- .cmd {
34
- margin: 8px 0 8px 16px;
35
- }
36
- .note {
37
- font-size: 12px;
38
- color: #86868b;
39
- margin-top: 20px;
40
- }
41
- </style>
42
- </head>
43
- <body>
44
- <h1>Basecamp is installed</h1>
45
- <p>
46
- The scheduler is running in the background and will start automatically on
47
- login.
48
- </p>
49
- <p><strong>Next steps:</strong></p>
50
- <p>1. Edit your identity file:</p>
51
- <p class="cmd"><code>vim ~/Documents/Personal/USER.md</code></p>
52
- <p>2. Configure scheduled tasks:</p>
53
- <p class="cmd"><code>vim ~/.fit/basecamp/scheduler.json</code></p>
54
- <p>3. Check scheduler status:</p>
55
- <p class="cmd"><code>fit-basecamp --status</code></p>
56
- <p>4. Open your knowledge base interactively:</p>
57
- <p class="cmd"><code>cd ~/Documents/Personal &amp;&amp; claude</code></p>
58
- <p class="note">
59
- To uninstall, run: <code>/usr/local/share/fit-basecamp/uninstall.sh</code>
60
- </p>
61
- </body>
62
- </html>
@@ -1,64 +0,0 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <style>
5
- body {
6
- font-family:
7
- -apple-system,
8
- Helvetica Neue,
9
- sans-serif;
10
- padding: 20px;
11
- color: #1d1d1f;
12
- }
13
- h1 {
14
- font-size: 22px;
15
- font-weight: 600;
16
- margin-bottom: 16px;
17
- }
18
- p {
19
- font-size: 14px;
20
- line-height: 1.6;
21
- color: #424245;
22
- }
23
- ul {
24
- font-size: 14px;
25
- line-height: 1.8;
26
- color: #424245;
27
- padding-left: 20px;
28
- }
29
- .note {
30
- font-size: 12px;
31
- color: #86868b;
32
- margin-top: 20px;
33
- }
34
- </style>
35
- </head>
36
- <body>
37
- <h1>Basecamp</h1>
38
- <p>
39
- Personal knowledge system with scheduled AI tasks. No server, no database.
40
- just plain files, markdown, and Claude Code.
41
- </p>
42
- <p>This installer will:</p>
43
- <ul>
44
- <li>
45
- Install the <code>fit-basecamp</code> binary to
46
- <code>/usr/local/bin/</code>
47
- </li>
48
- <li>
49
- Set up the scheduler configuration at <code>~/.fit/basecamp/</code>
50
- </li>
51
- <li>
52
- Initialize a default knowledge base at
53
- <code>~/Documents/Personal/</code>
54
- </li>
55
- <li>
56
- Install a LaunchAgent so the scheduler runs automatically on login
57
- </li>
58
- </ul>
59
- <p class="note">
60
- Requires the Claude Code CLI (<code>claude</code>) to be installed and
61
- authenticated.
62
- </p>
63
- </body>
64
- </html>
@@ -1,84 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Basecamp postinstall script — runs as root after macOS pkg installation.
4
- #
5
- # Sets up per-user config, default knowledge base, and LaunchAgent for the
6
- # console user (the person who double-clicked the installer).
7
-
8
- REAL_USER=$(/usr/bin/stat -f "%Su" /dev/console)
9
- REAL_HOME=$(/usr/bin/dscl . -read "/Users/$REAL_USER" NFSHomeDirectory | /usr/bin/awk '{print $2}')
10
-
11
- BASECAMP_HOME="$REAL_HOME/.fit/basecamp"
12
- DEFAULT_KB="$REAL_HOME/Documents/Personal"
13
- SHARE_DIR="/usr/local/share/fit-basecamp"
14
- BINARY="/usr/local/bin/fit-basecamp"
15
- STATUS_MENU_BINARY="/usr/local/bin/BasecampStatus"
16
-
17
- # --- Config home -------------------------------------------------------------
18
-
19
- /usr/bin/sudo -u "$REAL_USER" /bin/mkdir -p "$BASECAMP_HOME/logs"
20
-
21
- if [ ! -f "$BASECAMP_HOME/scheduler.json" ] && [ -f "$SHARE_DIR/config/scheduler.json" ]; then
22
- /usr/bin/sudo -u "$REAL_USER" /bin/cp "$SHARE_DIR/config/scheduler.json" "$BASECAMP_HOME/scheduler.json"
23
- fi
24
-
25
- if [ ! -f "$BASECAMP_HOME/state.json" ]; then
26
- echo '{ "tasks": {} }' | /usr/bin/sudo -u "$REAL_USER" /usr/bin/tee "$BASECAMP_HOME/state.json" > /dev/null
27
- fi
28
-
29
- # --- Default knowledge base --------------------------------------------------
30
-
31
- if [ ! -d "$DEFAULT_KB" ]; then
32
- /usr/bin/sudo -u "$REAL_USER" "$BINARY" --init "$DEFAULT_KB" 2>/dev/null || true
33
- fi
34
-
35
- # --- LaunchAgent (runs as user, not root) ------------------------------------
36
-
37
- PLIST="$REAL_HOME/Library/LaunchAgents/com.fit-basecamp.scheduler.plist"
38
- if [ -f "$PLIST" ]; then
39
- # Upgrade: binary already replaced by pkg payload. Kill the old daemon and
40
- # let KeepAlive restart it with the new binary. No plist rewrite needed.
41
- /usr/bin/killall fit-basecamp 2>/dev/null || true
42
- else
43
- # Fresh install: create plist and load it.
44
- /usr/bin/sudo -u "$REAL_USER" "$BINARY" --install-launchd 2>/dev/null || true
45
- fi
46
-
47
- # --- Status menu LaunchAgent (runs as user, not root) -----------------------
48
-
49
- STATUS_PLIST="$REAL_HOME/Library/LaunchAgents/com.fit-basecamp.status-menu.plist"
50
-
51
- if [ -f "$STATUS_MENU_BINARY" ]; then
52
- # Kill old status menu if running (picks up new binary on relaunch)
53
- /usr/bin/killall BasecampStatus 2>/dev/null || true
54
-
55
- # Write LaunchAgent plist
56
- /usr/bin/sudo -u "$REAL_USER" /usr/bin/tee "$STATUS_PLIST" > /dev/null <<PLIST
57
- <?xml version="1.0" encoding="UTF-8"?>
58
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
59
- <plist version="1.0">
60
- <dict>
61
- <key>Label</key>
62
- <string>com.fit-basecamp.status-menu</string>
63
- <key>ProgramArguments</key>
64
- <array>
65
- <string>/usr/local/bin/BasecampStatus</string>
66
- </array>
67
- <key>RunAtLoad</key>
68
- <true/>
69
- <key>KeepAlive</key>
70
- <true/>
71
- <key>StandardOutPath</key>
72
- <string>$BASECAMP_HOME/logs/status-menu-stdout.log</string>
73
- <key>StandardErrorPath</key>
74
- <string>$BASECAMP_HOME/logs/status-menu-stderr.log</string>
75
- </dict>
76
- </plist>
77
- PLIST
78
-
79
- # Load the LaunchAgent (unload first for upgrades)
80
- /usr/bin/sudo -u "$REAL_USER" /usr/bin/launchctl unload "$STATUS_PLIST" 2>/dev/null || true
81
- /usr/bin/sudo -u "$REAL_USER" /usr/bin/launchctl load "$STATUS_PLIST"
82
- fi
83
-
84
- exit 0
@@ -1,73 +0,0 @@
1
- #!/bin/bash
2
- set -e
3
-
4
- # Basecamp Uninstaller
5
- #
6
- # Removes the binary, LaunchAgent, and shared data installed by the .pkg.
7
- # User data at ~/Documents/Personal/ and config at ~/.fit/basecamp/ are preserved.
8
-
9
- APP_NAME="${1:-fit-basecamp}"
10
- PLIST_NAME="${2:-com.fit-basecamp.scheduler}"
11
-
12
- echo ""
13
- echo "Basecamp Uninstaller"
14
- echo "====================="
15
- echo ""
16
-
17
- # Remove LaunchAgent
18
- PLIST="$HOME/Library/LaunchAgents/$PLIST_NAME.plist"
19
- if [ -f "$PLIST" ]; then
20
- launchctl unload "$PLIST" 2>/dev/null || true
21
- rm -f "$PLIST"
22
- echo " Removed LaunchAgent"
23
- else
24
- echo " LaunchAgent not found, skipping."
25
- fi
26
-
27
- # Remove status menu LaunchAgent
28
- STATUS_PLIST="$HOME/Library/LaunchAgents/com.fit-basecamp.status-menu.plist"
29
- if [ -f "$STATUS_PLIST" ]; then
30
- launchctl unload "$STATUS_PLIST" 2>/dev/null || true
31
- rm -f "$STATUS_PLIST"
32
- echo " Removed status menu LaunchAgent"
33
- fi
34
- killall BasecampStatus 2>/dev/null || true
35
- if [ -f "/usr/local/bin/BasecampStatus" ]; then
36
- sudo rm -f "/usr/local/bin/BasecampStatus"
37
- echo " Removed /usr/local/bin/BasecampStatus"
38
- fi
39
-
40
- # Remove stale socket file
41
- # Socket path: ~/.fit/basecamp/basecamp.sock (must match SOCKET_PATH in basecamp.js)
42
- rm -f "$HOME/.fit/basecamp/basecamp.sock"
43
-
44
- # Remove binary
45
- if [ -f "/usr/local/bin/$APP_NAME" ]; then
46
- sudo rm -f "/usr/local/bin/$APP_NAME"
47
- echo " Removed /usr/local/bin/$APP_NAME"
48
- else
49
- echo " Binary not found at /usr/local/bin/$APP_NAME, skipping."
50
- fi
51
-
52
- # Remove shared data (default config template, this uninstall script's installed copy)
53
- if [ -d "/usr/local/share/fit-basecamp" ]; then
54
- sudo rm -rf "/usr/local/share/fit-basecamp"
55
- echo " Removed /usr/local/share/fit-basecamp/"
56
- else
57
- echo " Shared data not found, skipping."
58
- fi
59
-
60
- # Forget pkg receipt
61
- pkgutil --pkgs 2>/dev/null | grep -q "com.fit-basecamp.scheduler" && {
62
- sudo pkgutil --forget "com.fit-basecamp.scheduler" >/dev/null 2>&1
63
- echo " Removed installer receipt"
64
- } || true
65
-
66
- echo ""
67
- echo "Basecamp uninstalled."
68
- echo "Your data at ~/Documents/Personal/ has been preserved."
69
- echo "Your config at ~/.fit/basecamp/ has been preserved."
70
- echo ""
71
- echo "To remove all data: rm -rf ~/Documents/Personal/"
72
- echo "To remove all config: rm -rf ~/.fit/basecamp/"
73
- echo ""