@forwardimpact/basecamp 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.
Files changed (36) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +229 -0
  3. package/build.js +124 -0
  4. package/config/scheduler.json +28 -0
  5. package/package.json +37 -0
  6. package/scheduler.js +552 -0
  7. package/scripts/build-pkg.sh +117 -0
  8. package/scripts/compile.sh +26 -0
  9. package/scripts/install.sh +108 -0
  10. package/scripts/pkg-resources/conclusion.html +62 -0
  11. package/scripts/pkg-resources/welcome.html +64 -0
  12. package/scripts/postinstall +46 -0
  13. package/scripts/uninstall.sh +56 -0
  14. package/template/.claude/settings.json +40 -0
  15. package/template/.claude/skills/create-presentations/SKILL.md +75 -0
  16. package/template/.claude/skills/create-presentations/references/slide.css +35 -0
  17. package/template/.claude/skills/create-presentations/scripts/convert-to-pdf.js +32 -0
  18. package/template/.claude/skills/doc-collab/SKILL.md +112 -0
  19. package/template/.claude/skills/draft-emails/SKILL.md +191 -0
  20. package/template/.claude/skills/draft-emails/scripts/scan-emails.sh +33 -0
  21. package/template/.claude/skills/extract-entities/SKILL.md +466 -0
  22. package/template/.claude/skills/extract-entities/references/TEMPLATES.md +131 -0
  23. package/template/.claude/skills/extract-entities/scripts/state.py +100 -0
  24. package/template/.claude/skills/meeting-prep/SKILL.md +135 -0
  25. package/template/.claude/skills/organize-files/SKILL.md +146 -0
  26. package/template/.claude/skills/organize-files/scripts/organize-by-type.sh +42 -0
  27. package/template/.claude/skills/organize-files/scripts/summarize.sh +21 -0
  28. package/template/.claude/skills/sync-apple-calendar/SKILL.md +101 -0
  29. package/template/.claude/skills/sync-apple-calendar/references/SCHEMA.md +80 -0
  30. package/template/.claude/skills/sync-apple-calendar/scripts/sync.py +233 -0
  31. package/template/.claude/skills/sync-apple-mail/SKILL.md +131 -0
  32. package/template/.claude/skills/sync-apple-mail/references/SCHEMA.md +88 -0
  33. package/template/.claude/skills/sync-apple-mail/scripts/parse-emlx.py +104 -0
  34. package/template/.claude/skills/sync-apple-mail/scripts/sync.py +348 -0
  35. package/template/CLAUDE.md +152 -0
  36. package/template/USER.md +5 -0
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to the Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Dick Olsson
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,229 @@
1
+ # @forwardimpact/basecamp
2
+
3
+ A personal knowledge system that runs as scheduled Claude Code tasks. No server,
4
+ no database — just plain files, markdown, and the `claude` CLI. Compiles to a
5
+ standalone executable via Deno.
6
+
7
+ Part of the [Forward Impact](https://www.forwardimpact.team) monorepo.
8
+
9
+ ## Architecture
10
+
11
+ ```
12
+ ~/.fit/basecamp/ # Scheduler home (central config)
13
+ ├── scheduler.json # Task definitions
14
+ ├── state.json # Task run state
15
+ └── logs/ # Scheduler logs
16
+
17
+ ~/Documents/Personal/ # Default personal knowledge base
18
+ ├── CLAUDE.md # Claude Code instructions for this KB
19
+ ├── knowledge/ # The knowledge graph (Obsidian-compatible)
20
+ │ ├── People/
21
+ │ ├── Organizations/
22
+ │ ├── Projects/
23
+ │ └── Topics/
24
+ ├── .claude/skills/ # Claude Code skill files (auto-discovered)
25
+ └── drafts/ # Email drafts
26
+
27
+ ~/Documents/Team/ # Example knowledge base for team work
28
+ ├── CLAUDE.md
29
+ ├── knowledge/
30
+ ├── .claude/skills/
31
+ └── ...
32
+ ```
33
+
34
+ The scheduler is the only real code — a single JavaScript file. Everything else
35
+ is markdown, JSON, and skill files. Knowledge bases are self-contained
36
+ directories that can live anywhere on disk. Synced data and processing state
37
+ live in `~/.cache/fit/basecamp/`, keeping KB directories clean — only the parsed
38
+ knowledge graph, notes, documents, and drafts belong in the KB.
39
+
40
+ ## Install from Package
41
+
42
+ The easiest way to install is from the pre-built macOS installer package:
43
+
44
+ 1. Double-click `basecamp-1.0.0-arm64.pkg` (or `basecamp-1.0.0-x86_64.pkg`)
45
+ 2. Follow the installer prompts
46
+
47
+ The installer places the `basecamp` binary in `/usr/local/bin/`, initializes
48
+ `~/Documents/Personal/` as the default knowledge base, and installs a
49
+ LaunchAgent so the scheduler runs automatically on login.
50
+
51
+ To uninstall, run `/usr/local/share/basecamp/uninstall.sh`.
52
+
53
+ ## Install from Source
54
+
55
+ ```bash
56
+ cd apps/basecamp
57
+ ./scripts/install.sh
58
+
59
+ # Configure your identity
60
+ vi ~/Documents/Personal/USER.md
61
+
62
+ # Start the daemon
63
+ npx fit-basecamp --install-launchd
64
+
65
+ # Open your KB interactively
66
+ cd ~/Documents/Personal && claude
67
+ ```
68
+
69
+ ## Building
70
+
71
+ Requires [Deno](https://deno.com) >= 2.x.
72
+
73
+ ```bash
74
+ # Build standalone executable (current architecture)
75
+ npm run build # or: deno task build
76
+
77
+ # Build executable + macOS installer package (.pkg)
78
+ npm run build:pkg # or: deno task build:pkg
79
+
80
+ # Build for both arm64 and x86_64 + packages
81
+ npm run build:all # or: deno task build:all
82
+ ```
83
+
84
+ Output goes to `dist/`:
85
+
86
+ ```
87
+ dist/
88
+ ├── basecamp-aarch64-apple-darwin # arm64 binary
89
+ ├── basecamp-x86_64-apple-darwin # x86_64 binary
90
+ ├── basecamp-1.0.0-arm64.pkg # arm64 installer package
91
+ └── basecamp-1.0.0-x86_64.pkg # x86_64 installer package
92
+ ```
93
+
94
+ The compiled binary is fully self-contained — it embeds the `template/`
95
+ directory (CLAUDE.md, skills) so `basecamp --init <path>` works without any
96
+ source files present.
97
+
98
+ ## Multiple Knowledge Bases
99
+
100
+ The scheduler can run tasks across multiple knowledge bases. Each KB is an
101
+ independent directory with its own CLAUDE.md, skills, and knowledge graph.
102
+
103
+ ### Adding a new KB
104
+
105
+ ```bash
106
+ # Initialize a new knowledge base
107
+ npx fit-basecamp --init ~/Documents/Team
108
+
109
+ # Edit the scheduler config to register it
110
+ vi ~/.fit/basecamp/scheduler.json
111
+ ```
112
+
113
+ ### Scheduler config format
114
+
115
+ `~/.fit/basecamp/scheduler.json`:
116
+
117
+ ```json
118
+ {
119
+ "tasks": {
120
+ "sync-personal-mail": {
121
+ "kb": "~/Documents/Personal",
122
+ "schedule": { "type": "interval", "minutes": 5 },
123
+ "enabled": true,
124
+ "agent": null,
125
+ "skill": "sync-apple-mail",
126
+ "prompt": "Sync Apple Mail."
127
+ },
128
+ "sync-team-calendar": {
129
+ "kb": "~/Documents/Team",
130
+ "schedule": { "type": "interval", "minutes": 10 },
131
+ "enabled": true,
132
+ "agent": null,
133
+ "skill": "sync-apple-calendar",
134
+ "prompt": "Sync Apple Calendar."
135
+ }
136
+ }
137
+ }
138
+ ```
139
+
140
+ ### Task fields
141
+
142
+ | Field | Required | Description |
143
+ | ---------- | -------- | --------------------------------------------------------------- |
144
+ | `kb` | yes | Path to the knowledge base directory (supports `~`) |
145
+ | `schedule` | yes | When to run (`interval`, `cron`, or `once`) |
146
+ | `prompt` | yes | The prompt sent to Claude |
147
+ | `enabled` | no | Set to `false` to disable. Default: `true` |
148
+ | `agent` | no | Claude sub-agent name (passed as `--agent`) |
149
+ | `skill` | no | Skill name (matches `.claude/skills/<name>/SKILL.md` in the KB) |
150
+
151
+ ### Schedule types
152
+
153
+ ```json
154
+ { "type": "interval", "minutes": 5 }
155
+ { "type": "cron", "expression": "0 8 * * *" }
156
+ { "type": "once", "runAt": "2025-02-12T10:00:00Z" }
157
+ ```
158
+
159
+ ## Agents
160
+
161
+ Set the `agent` field on a task to use a specific Claude sub-agent. The value is
162
+ passed as `--agent <name>` to the `claude` CLI.
163
+
164
+ ```json
165
+ {
166
+ "sync-personal-mail": {
167
+ "kb": "~/Documents/Personal",
168
+ "agent": "basecamp-sync",
169
+ "schedule": { "type": "interval", "minutes": 5 },
170
+ "skill": "sync-apple-mail",
171
+ "prompt": "Sync Apple Mail."
172
+ }
173
+ }
174
+ ```
175
+
176
+ ## CLI Reference
177
+
178
+ ```
179
+ fit-basecamp Run due tasks once and exit
180
+ fit-basecamp --daemon Run continuously (poll every 60s)
181
+ fit-basecamp --run <task> Run a specific task immediately
182
+ fit-basecamp --init <path> Initialize a new knowledge base
183
+ fit-basecamp --install-launchd Install macOS LaunchAgent for auto-start
184
+ fit-basecamp --uninstall-launchd Remove macOS LaunchAgent
185
+ fit-basecamp --status Show knowledge bases and task status
186
+ fit-basecamp --help Show this help
187
+ ```
188
+
189
+ When running from source, use `node scheduler.js` or `npx fit-basecamp` instead
190
+ of `fit-basecamp`.
191
+
192
+ ## How It Works
193
+
194
+ 1. The scheduler reads `~/.fit/basecamp/scheduler.json` for task configs
195
+ 2. For each due task, it invokes the `claude` CLI with `--print` mode
196
+ 3. If a skill is set, its name is included in the prompt (Claude auto-discovers
197
+ the SKILL.md file)
198
+ 4. The claude CLI runs with `cwd` set to the target KB directory
199
+ 5. Claude reads the KB's `CLAUDE.md` for context, executes the task, and writes
200
+ results
201
+ 6. State (last run times, status) is tracked in `~/.fit/basecamp/state.json`
202
+
203
+ ## Skills
204
+
205
+ Skills are Claude Code-native `SKILL.md` files that are auto-discovered from
206
+ `.claude/skills/<name>/SKILL.md` inside each knowledge base. The default KB
207
+ ships with these skills:
208
+
209
+ | Skill | Directory | Purpose |
210
+ | ---------------------- | ---------------------- | ---------------------------------------------- |
211
+ | Sync Apple Mail | `sync-apple-mail` | Sync Apple Mail threads via SQLite |
212
+ | Sync Apple Calendar | `sync-apple-calendar` | Sync Apple Calendar events via SQLite |
213
+ | Extract Entities | `extract-entities` | Process synced data into knowledge graph notes |
214
+ | Draft Emails | `draft-emails` | Draft email responses using knowledge context |
215
+ | Meeting Prep | `meeting-prep` | Prepare briefings for upcoming meetings |
216
+ | Create Presentations | `create-presentations` | Create slide decks as PDF |
217
+ | Document Collaboration | `doc-collab` | Document creation and collaboration |
218
+ | Organize Files | `organize-files` | File organization and cleanup |
219
+
220
+ ## Requirements
221
+
222
+ - Claude CLI (`claude`) installed and authenticated
223
+ - macOS (for Apple Mail/Calendar sync and launchd)
224
+ - Node.js >= 18 (for running from source) or the standalone binary
225
+ - Deno >= 2.x (for building the standalone binary)
226
+
227
+ ## License
228
+
229
+ Apache-2.0
package/build.js ADDED
@@ -0,0 +1,124 @@
1
+ #!/usr/bin/env -S deno run --allow-all
2
+
3
+ // Build script for Basecamp.
4
+ //
5
+ // Usage:
6
+ // deno run --allow-all build.js Build standalone executable (current arch)
7
+ // deno run --allow-all build.js --pkg Build executable + macOS .pkg installer
8
+ // deno run --allow-all build.js --all Build for both arm64 and x86_64 + .pkg
9
+ //
10
+ // Or via deno tasks:
11
+ // deno task build
12
+ // deno task build:pkg
13
+
14
+ import { existsSync, mkdirSync } from "node:fs";
15
+ import { join, dirname } from "node:path";
16
+ import { execSync } from "node:child_process";
17
+
18
+ const __dirname =
19
+ import.meta.dirname || dirname(new URL(import.meta.url).pathname);
20
+ const DIST_DIR = join(__dirname, "dist");
21
+ const APP_NAME = "fit-basecamp";
22
+ const VERSION = "1.0.0";
23
+
24
+ // ---------------------------------------------------------------------------
25
+ // Helpers
26
+ // ---------------------------------------------------------------------------
27
+
28
+ function ensureDir(dir) {
29
+ if (!existsSync(dir)) mkdirSync(dir, { recursive: true });
30
+ }
31
+
32
+ function run(cmd, opts = {}) {
33
+ console.log(` $ ${cmd}`);
34
+ return execSync(cmd, { encoding: "utf8", stdio: "inherit", ...opts });
35
+ }
36
+
37
+ function runCapture(cmd) {
38
+ return execSync(cmd, {
39
+ encoding: "utf8",
40
+ stdio: ["pipe", "pipe", "pipe"],
41
+ }).trim();
42
+ }
43
+
44
+ // ---------------------------------------------------------------------------
45
+ // Compile standalone binary
46
+ // ---------------------------------------------------------------------------
47
+
48
+ function compile(target = null) {
49
+ const arch = target || detectArch();
50
+ const outputName = target ? `${APP_NAME}-${arch}` : APP_NAME;
51
+ const outputPath = join(DIST_DIR, outputName);
52
+
53
+ console.log(`\nCompiling ${APP_NAME} for ${arch}...`);
54
+ ensureDir(DIST_DIR);
55
+
56
+ const cmd = [
57
+ "deno compile",
58
+ "--allow-all",
59
+ `--target ${arch}`,
60
+ `--output "${outputPath}"`,
61
+ "--include template/",
62
+ "scheduler.js",
63
+ ].join(" ");
64
+
65
+ run(cmd, { cwd: __dirname });
66
+
67
+ console.log(` -> ${outputPath}`);
68
+ return outputPath;
69
+ }
70
+
71
+ function detectArch() {
72
+ const arch = runCapture("uname -m");
73
+ if (arch === "arm64") return "aarch64-apple-darwin";
74
+ return "x86_64-apple-darwin";
75
+ }
76
+
77
+ // ---------------------------------------------------------------------------
78
+ // Build macOS installer package (.pkg)
79
+ // ---------------------------------------------------------------------------
80
+
81
+ function buildPKG(binaryPath, arch) {
82
+ const archShort = arch.includes("aarch64") ? "arm64" : "x86_64";
83
+ const pkgName = `${APP_NAME}-${VERSION}-${archShort}.pkg`;
84
+
85
+ console.log(`\nBuilding pkg: ${pkgName}...`);
86
+
87
+ const buildPkg = join(__dirname, "scripts", "build-pkg.sh");
88
+ run(`"${buildPkg}" "${DIST_DIR}" "${APP_NAME}" "${VERSION}" "${arch}"`, {
89
+ cwd: __dirname,
90
+ });
91
+
92
+ console.log(` -> ${join(DIST_DIR, pkgName)}`);
93
+ return join(DIST_DIR, pkgName);
94
+ }
95
+
96
+ // ---------------------------------------------------------------------------
97
+ // CLI
98
+ // ---------------------------------------------------------------------------
99
+
100
+ const args = Deno?.args || process.argv.slice(2);
101
+ const wantPKG = args.includes("--pkg");
102
+ const wantAll = args.includes("--all");
103
+
104
+ console.log(`Basecamp Build (v${VERSION})`);
105
+ console.log("==========================");
106
+
107
+ if (wantAll) {
108
+ // Build for both architectures
109
+ const targets = ["aarch64-apple-darwin", "x86_64-apple-darwin"];
110
+ for (const target of targets) {
111
+ const binary = compile(target);
112
+ buildPKG(binary, target);
113
+ }
114
+ } else {
115
+ // Build for current architecture
116
+ const arch = detectArch();
117
+ const binary = compile(arch);
118
+
119
+ if (wantPKG) {
120
+ buildPKG(binary, arch);
121
+ }
122
+ }
123
+
124
+ console.log("\nBuild complete! Output in dist/");
@@ -0,0 +1,28 @@
1
+ {
2
+ "tasks": {
3
+ "sync-apple-mail": {
4
+ "kb": "~/Documents/Personal",
5
+ "schedule": { "type": "interval", "minutes": 5 },
6
+ "enabled": true,
7
+ "agent": null,
8
+ "skill": "sync-apple-mail",
9
+ "prompt": "Sync Apple Mail. Only process new threads since last sync."
10
+ },
11
+ "sync-apple-calendar": {
12
+ "kb": "~/Documents/Personal",
13
+ "schedule": { "type": "interval", "minutes": 5 },
14
+ "enabled": true,
15
+ "agent": null,
16
+ "skill": "sync-apple-calendar",
17
+ "prompt": "Sync Apple Calendar events. Export events from the past 14 days and next 14 days."
18
+ },
19
+ "extract-entities": {
20
+ "kb": "~/Documents/Personal",
21
+ "schedule": { "type": "interval", "minutes": 15 },
22
+ "enabled": true,
23
+ "agent": null,
24
+ "skill": "extract-entities",
25
+ "prompt": "Process any new synced data (emails and calendar events) into knowledge graph notes."
26
+ }
27
+ }
28
+ }
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "@forwardimpact/basecamp",
3
+ "version": "0.1.0",
4
+ "description": "Claude Code-native personal knowledge system with scheduled tasks",
5
+ "license": "Apache-2.0",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/forwardimpact/monorepo",
9
+ "directory": "apps/basecamp"
10
+ },
11
+ "homepage": "https://www.forwardimpact.team/basecamp",
12
+ "type": "module",
13
+ "main": "scheduler.js",
14
+ "bin": {
15
+ "fit-basecamp": "./scheduler.js"
16
+ },
17
+ "scripts": {
18
+ "start": "node scheduler.js",
19
+ "status": "node scheduler.js --status",
20
+ "build": "deno run --allow-all build.js",
21
+ "build:pkg": "deno run --allow-all build.js --pkg",
22
+ "build:all": "deno run --allow-all build.js --all",
23
+ "install:basecamp": "./scripts/install.sh",
24
+ "scheduler:install": "node scheduler.js --install-launchd",
25
+ "scheduler:uninstall": "node scheduler.js --uninstall-launchd"
26
+ },
27
+ "files": [
28
+ "scheduler.js",
29
+ "build.js",
30
+ "config/",
31
+ "scripts/",
32
+ "template/"
33
+ ],
34
+ "engines": {
35
+ "node": ">=18.0.0"
36
+ }
37
+ }