obsidian-lean-coder 0.1.0 → 0.1.1

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 CHANGED
@@ -2,7 +2,20 @@
2
2
 
3
3
  All notable changes to OLC (Obsidian Lean Coder) are recorded here.
4
4
  OLC is pre-release: versions are `0.x` until a controlled-testing release says otherwise.
5
- `package.json` keeps `"private": true` — npm publishing is a separate explicitly approved action, never automatic.
5
+ `package.json` shipped `"private": true` through 0.1.0; the flag was removed at publish time with explicit user approval, and 0.1.0 is live as [`obsidian-lean-coder`](https://www.npmjs.com/package/obsidian-lean-coder). Publishing a new version is still a separate explicitly approved action, never automatic.
6
+
7
+ ## [0.1.1] — 2026-10-13 — plugin entrypoint fix
8
+
9
+ Fixes npm-package activation (reported: `npm install` worked but nothing appeared in OpenCode).
10
+ The package-root entrypoint `dist/index.js` exported only `OLC_VERSION`, so npm loaders —
11
+ which resolve the package root — never saw the plugin default export and ignored the package.
12
+ `src/index.ts` now re-exports the plugin default alongside `OLC_VERSION`.
13
+ Agents/skills still appear only via the project-local `.opencode` copy (by design, OLC-012).
14
+
15
+ - **Verification:** typecheck clean, build OK, mock-ctx plugin load (`id=olc`, correct payload),
16
+ full suite 140/140 pass, real-loader test (`loading plugin`, zero `failed to load plugin`).
17
+ - **Upgrade:** `npm install obsidian-lean-coder@0.1.1`, then list the package in `opencode.json`
18
+ `plugins` (see README §2).
6
19
 
7
20
  ## [0.1.0] — 2026-10-13 — MVP pre-release
8
21
 
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # OLC — Obsidian Lean Coder
2
2
 
3
- OpenCode extension for project-scoped planning, memory, and safe Git checkpoints. Work in progress — pre-release, not on npm.
3
+ OpenCode extension for project-scoped planning, memory, and safe Git checkpoints. On npm as `obsidian-lean-coder` (v0.1.1 fixes plugin activation — see CHANGELOG).
4
4
 
5
5
  ## Three separate steps
6
6
 
@@ -9,7 +9,7 @@ Do not confuse these. They are different operations with different commands:
9
9
  | # | Step | What it does | Command |
10
10
  |---|------|--------------|---------|
11
11
  | 1 | **Dev install** | Install npm deps to hack on OLC itself | `npm ci && npm run build` |
12
- | 2 | **Plugin activation** | Load this checkout as an OpenCode plugin (local dev path) | config snippet below |
12
+ | 2 | **Plugin activation** | Load OLC as an OpenCode plugin | `npm i obsidian-lean-coder` + `opencode.json` snippet below |
13
13
  | 3 | **Project init** | Register one app repo + vault with OLC (`initProject`, idempotent, create-only) | via the `olc-init` skill in OpenCode (the tested path) |
14
14
 
15
15
  ## 1. Dev install
@@ -26,30 +26,46 @@ npm run typecheck
26
26
 
27
27
  Expected: build clean, typecheck clean. `npm test` runs the full suite (currently 140 tests). `npm pack --dry-run` shows what would ship (`dist/`, `agents/`, `skills/`, `templates/`).
28
28
 
29
- > npm publish is blocked: `package.json` has `"private": true`. Removing that flag needs a separate explicit approval — never publish by accident.
29
+ > Published on npm as `obsidian-lean-coder` (MIT). Republishing needs a separate explicit approval — never publish by accident.
30
30
 
31
- ## 2. Plugin activation (local dev path)
31
+ ## 2. Plugin activation
32
32
 
33
- OLC is **not on npm**. Until a scoped name is reserved (DECISIONS.md #1), the only supported activation is the local-file path: an `index.js` under `.opencode/plugins/<name>/` auto-loads with no install step (proven in OLC-011, re-verified in OLC-071 against the packed tarball). The plugin entrypoint is `dist/plugin.js` (`src/plugin.ts` → `Plugin.define({ id: "olc" })`, one read-only `olc_status` tool, zero writes on load). Note `dist/index.js` only exports `OLC_VERSION` — it is not the plugin entrypoint.
33
+ ```sh
34
+ npm install obsidian-lean-coder
35
+ ```
34
36
 
35
- In your consuming project (replace `/home/you/olc` with your OLC checkout):
37
+ Then list it in your project's `opencode.json` (npm loaders resolve the package root `dist/index.js`, which since v0.1.1 carries the plugin default export alongside `OLC_VERSION`):
36
38
 
37
- ```sh
38
- PKG=/home/you/olc # your OLC checkout — build it first (step 1)
39
- mkdir -p .opencode/plugins/olc
40
- printf '%s\n' 'export { default } from "file://'"$PKG"'/dist/plugin.js";' > .opencode/plugins/olc/index.js
41
- printf '%s\n' '{ "type": "module", "dependencies": { "@opencode/plugin": "2.0.27" } }' > .opencode/plugins/olc/package.json
39
+ ```json
40
+ {
41
+ "plugins": ["obsidian-lean-coder"]
42
+ }
42
43
  ```
43
44
 
44
45
  Verify it loads (from the consuming project directory; the model call itself will fail without account funds, but plugin loading happens first):
45
46
 
46
47
  ```sh
47
- OPENCODE_LOG_LEVEL=DEBUG opencode run --standalone "hi" --print-logs 2>&1 | grep -E "loading plugin.*plugins/olc|failed to load plugin"
48
+ OPENCODE_LOG_LEVEL=DEBUG opencode run --standalone "hi" --print-logs 2>&1 | grep -E "loading plugin.*obsidian-lean-coder|failed to load plugin"
48
49
  ```
49
50
 
50
- Expected: a `loading plugin ... .opencode/plugins/olc/index.js` line and **zero** `failed to load plugin` lines.
51
+ Expected: a `loading plugin ... obsidian-lean-coder` line and **zero** `failed to load plugin` lines. (Verified 2026-10-13 via the equivalent local-file shape against the real loader; npm-registry install itself verified in OLC-071.)
52
+
53
+ > `npm install` alone shows nothing in OpenCode — that is normal. The package must be listed under `plugins`, and agents/skills never auto-appear: they are project-local files you copy yourself (next step). No restart or rebuild needed after editing `opencode.json`.
54
+
55
+ ### Local dev path (this checkout, no npm)
56
+
57
+ An `index.js` under `.opencode/plugins/<name>/` auto-loads with no install step (proven in OLC-011, re-verified in OLC-071). The plugin entrypoint is `dist/plugin.js` (`src/plugin.ts` → `Plugin.define({ id: "olc" })`, one read-only `olc_status` tool, zero writes on load).
58
+
59
+ In your consuming project (replace `/home/you/olc` with your OLC checkout):
60
+
61
+ ```sh
62
+ PKG=/home/you/olc # your OLC checkout — build it first (step 1)
63
+ mkdir -p .opencode/plugins/olc
64
+ printf '%s\n' 'export { default } from "file://'"$PKG"'/dist/plugin.js";' > .opencode/plugins/olc/index.js
65
+ printf '%s\n' '{ "type": "module", "dependencies": { "@opencode/plugin": "2.0.27" } }' > .opencode/plugins/olc/package.json
66
+ ```
51
67
 
52
- > Not supported (verified 2026-10-12, OLC-071): pointing `opencode.json` `plugins` (or `plugin`) at the package directory — bare path or `file://` URL — produced zero load attempts in this build, so there is nothing to verify there yet. npm-package activation is untestable until a name is reserved AND the entrypoint is wired (`dist/index.js` currently has no plugin default export; npm loaders resolve `dist/index.js`).
68
+ Verify with the same `grep` as above, expecting `.opencode/plugins/olc/index.js` in the loading line.
53
69
 
54
70
  Then place the agent/skill resources project-locally (DECISIONS.md #2 — programmatic registration was rejected for MVP):
55
71
 
@@ -74,7 +90,7 @@ Supported versions: OpenCode 2.x with the V2 plugin API. OLC pins `@opencode/plu
74
90
 
75
91
  `initProject` (`src/init/index.ts`) registers one app repo + vault. It is idempotent and **create-only**: existing files are reported `preserved`, never overwritten. Anything needing a human choice comes back as `status: "needs-decision"` — no prompting inside the module.
76
92
 
77
- Run it via the `olc-init` skill inside OpenCode (recommended — the only tested path for MVP). A programmatic import is not yet wired: the package entrypoint (`dist/index.js`) currently exports only `OLC_VERSION`, and `initProject` lives in `src/init/index.ts` for internal/agent use.
93
+ Run it via the `olc-init` skill inside OpenCode (recommended — the only tested path for MVP). A programmatic import is not yet wired: the package entrypoint (`dist/index.js`) exports `OLC_VERSION` plus the plugin default, and `initProject` lives in `src/init/index.ts` for internal/agent use.
78
94
 
79
95
  What it creates (only when missing):
80
96
 
package/dist/index.d.ts CHANGED
@@ -1,5 +1,14 @@
1
1
  /**
2
2
  * OLC package entrypoint. Thin on purpose — see docs/PRD.md §8 for planned
3
3
  * module layout (config, core, git, logging, tools, validation).
4
+ *
5
+ * The plugin default export is re-exported here (not only from
6
+ * `./plugin.js`) because OpenCode's npm loader resolves the package root,
7
+ * i.e. `dist/index.js` — without a `default` export carrying `{ id, setup }`
8
+ * the loader ignores the package entirely (found by OLC-071 smoke test:
9
+ * zero load attempts for 0.1.0). `OLC_VERSION` is only consumed inside
10
+ * `plugin.ts` tool `execute` (deferred to call time), so this re-export
11
+ * cycle is safe under ESM live bindings.
4
12
  */
5
- export declare const OLC_VERSION = "0.1.0";
13
+ export declare const OLC_VERSION = "0.1.1";
14
+ export { default } from "./plugin.js";
package/dist/index.js CHANGED
@@ -1,5 +1,14 @@
1
1
  /**
2
2
  * OLC package entrypoint. Thin on purpose — see docs/PRD.md §8 for planned
3
3
  * module layout (config, core, git, logging, tools, validation).
4
+ *
5
+ * The plugin default export is re-exported here (not only from
6
+ * `./plugin.js`) because OpenCode's npm loader resolves the package root,
7
+ * i.e. `dist/index.js` — without a `default` export carrying `{ id, setup }`
8
+ * the loader ignores the package entirely (found by OLC-071 smoke test:
9
+ * zero load attempts for 0.1.0). `OLC_VERSION` is only consumed inside
10
+ * `plugin.ts` tool `execute` (deferred to call time), so this re-export
11
+ * cycle is safe under ESM live bindings.
4
12
  */
5
- export const OLC_VERSION = "0.1.0";
13
+ export const OLC_VERSION = "0.1.1";
14
+ export { default } from "./plugin.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "obsidian-lean-coder",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Obsidian Lean Coder — OpenCode extension for project-scoped planning, memory, and safe Git checkpoints.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",