greprag 5.47.0 → 5.49.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/dist/commands/assistant-reminder.d.ts +9 -0
- package/dist/commands/assistant-reminder.js +20 -0
- package/dist/commands/assistant-reminder.js.map +1 -0
- package/dist/commands/checkpoint-reminder.d.ts +14 -0
- package/dist/commands/checkpoint-reminder.js +50 -0
- package/dist/commands/checkpoint-reminder.js.map +1 -0
- package/dist/commands/crush.d.ts +9 -0
- package/dist/commands/crush.js +39 -0
- package/dist/commands/crush.js.map +1 -1
- package/dist/commands/frontdesk-reminder.d.ts +23 -0
- package/dist/commands/frontdesk-reminder.js +40 -0
- package/dist/commands/frontdesk-reminder.js.map +1 -0
- package/dist/commands/inbox-watch-supervisor.d.ts +25 -0
- package/dist/commands/inbox-watch-supervisor.js +112 -5
- package/dist/commands/inbox-watch-supervisor.js.map +1 -1
- package/dist/commands/init.js +47 -38
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/memory-reflex.d.ts +115 -0
- package/dist/commands/memory-reflex.js +243 -0
- package/dist/commands/memory-reflex.js.map +1 -0
- package/dist/commands/opencode-relay.d.ts +19 -4
- package/dist/commands/opencode-relay.js +56 -5
- package/dist/commands/opencode-relay.js.map +1 -1
- package/dist/commands/reminder-registry.d.ts +6 -2
- package/dist/commands/reminder-registry.js +20 -3
- package/dist/commands/reminder-registry.js.map +1 -1
- package/dist/commands/reminder-types.d.ts +27 -0
- package/dist/commands/setup-reminder.d.ts +9 -0
- package/dist/commands/setup-reminder.js +20 -0
- package/dist/commands/setup-reminder.js.map +1 -0
- package/dist/commands/watcher-registry.js +4 -2
- package/dist/commands/watcher-registry.js.map +1 -1
- package/dist/hook.js +329 -109
- package/dist/hook.js.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/opencode-plugin-crush.d.ts +88 -0
- package/dist/opencode-plugin-crush.js +193 -0
- package/dist/opencode-plugin-crush.js.map +1 -0
- package/dist/opencode-plugin.bundle.js +2132 -0
- package/dist/opencode-plugin.d.ts +6 -0
- package/dist/opencode-plugin.js +184 -51
- package/dist/opencode-plugin.js.map +1 -1
- package/dist/worktree-state.js +5 -5
- package/dist/worktree-state.js.map +1 -1
- package/package.json +3 -2
- package/scripts/bundle-opencode-plugin.mjs +54 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* bundle-opencode-plugin.mjs — produce the SINGLE self-contained opencode
|
|
3
|
+
* plugin artifact.
|
|
4
|
+
*
|
|
5
|
+
* WHY THIS EXISTS — opencode auto-loads every `.js` in
|
|
6
|
+
* `~/.config/opencode/plugins/` as a plugin, so greprag deploys exactly ONE
|
|
7
|
+
* file there: `greprag-memory.js`. A single deployed file cannot resolve a
|
|
8
|
+
* relative `require('./X')` under opencode's Bun loader, so for a long time the
|
|
9
|
+
* plugin loaded its internal deps (helpers → proc → crush engine) by ABSOLUTE
|
|
10
|
+
* path from `~/.greprag/`. Every new dep was a fresh chance to forget to deploy
|
|
11
|
+
* it — the `./proc` and `./crush` traps both shipped that way. This bundle kills
|
|
12
|
+
* the class: esbuild inlines `opencode-plugin.ts` + all its pure-JS internal
|
|
13
|
+
* deps into one file with zero sidecar requires (only Node builtins stay
|
|
14
|
+
* external, which Bun provides). The CLI itself is NOT bundled — the turn-capture
|
|
15
|
+
* daemon is the installed `greprag` binary spawned BY NAME, never required in.
|
|
16
|
+
*
|
|
17
|
+
* EXPORT CONTRACT — the source ends with `export = { id, server }`; esbuild
|
|
18
|
+
* compiles that to a clean `module.exports = { id, server }` with NO
|
|
19
|
+
* `__esModule` marker, which is exactly the shape opencode's `await import()`
|
|
20
|
+
* loader expects (`mod.default === { id, server }`). See
|
|
21
|
+
* adr/opencode-monitor-relay.md 2026-06-06 (f) for why the marker is fatal, and
|
|
22
|
+
* tests/test-opencode-bundle.cjs for the regression guard on that contract.
|
|
23
|
+
*
|
|
24
|
+
* adr: adr/opencode-monitor-relay.md (2026-06-20 bundle entry)
|
|
25
|
+
* adr: adr/opencode-context-compressor.md (2026-06-20 bundle entry)
|
|
26
|
+
*/
|
|
27
|
+
import { build } from 'esbuild';
|
|
28
|
+
import { fileURLToPath } from 'url';
|
|
29
|
+
import path from 'path';
|
|
30
|
+
|
|
31
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
32
|
+
const cliRoot = path.resolve(__dirname, '..');
|
|
33
|
+
|
|
34
|
+
await build({
|
|
35
|
+
entryPoints: [path.join(cliRoot, 'src', 'opencode-plugin.ts')],
|
|
36
|
+
outfile: path.join(cliRoot, 'dist', 'opencode-plugin.bundle.js'),
|
|
37
|
+
bundle: true,
|
|
38
|
+
platform: 'node',
|
|
39
|
+
// CommonJS so `export = { id, server }` → `module.exports = { id, server }`
|
|
40
|
+
// with no `__esModule` marker. opencode loads via `await import()`; a CJS
|
|
41
|
+
// module with no marker exposes `mod.default === module.exports` — the V1
|
|
42
|
+
// plugin object the loader's `readV1Plugin` reads.
|
|
43
|
+
format: 'cjs',
|
|
44
|
+
target: 'node18',
|
|
45
|
+
// No npm deps are reachable from the plugin's import graph (helpers/proc/crush
|
|
46
|
+
// are all pure local code; the crush engine is dep-free by design). Node
|
|
47
|
+
// builtins (fs, os, path, crypto, child_process, stream) stay external — Bun
|
|
48
|
+
// provides them. So nothing else needs externalizing; an unexpected external
|
|
49
|
+
// dep here would surface as an esbuild resolution error, which is the signal.
|
|
50
|
+
legalComments: 'none',
|
|
51
|
+
logLevel: 'warning',
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
console.log(' Bundled opencode plugin → packages/cli/dist/opencode-plugin.bundle.js (self-contained, zero sidecar requires)');
|