oh-my-second-brain 0.1.5
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/adapters/README.md +98 -0
- package/adapters/claude-code/.claude-plugin/plugin.json +24 -0
- package/adapters/claude-code/CLAUDE.md +26 -0
- package/adapters/claude-code/skills/capture/SKILL.md +50 -0
- package/adapters/claude-code/skills/define/SKILL.md +51 -0
- package/adapters/claude-code/skills/doctor/SKILL.md +58 -0
- package/adapters/claude-code/skills/retrieve/SKILL.md +55 -0
- package/adapters/claude-code/skills/setup/SKILL.md +71 -0
- package/adapters/claude-code/skills/uninstall/SKILL.md +34 -0
- package/adapters/codex/.codex-plugin/plugin.json +8 -0
- package/adapters/codex/.mcp.json +14 -0
- package/adapters/codex/AGENTS.md +16 -0
- package/adapters/codex/rules/oms.md +25 -0
- package/adapters/codex/skills/oms-capture/SKILL.md +16 -0
- package/adapters/codex/skills/oms-doctor/SKILL.md +14 -0
- package/adapters/codex/skills/oms-install/SKILL.md +19 -0
- package/adapters/codex/skills/oms-retrieve/SKILL.md +10 -0
- package/adapters/codex/skills/oms-setup/SKILL.md +22 -0
- package/adapters/codex/skills/oms-uninstall/SKILL.md +20 -0
- package/adapters/hermes/README.md +8 -0
- package/adapters/hermes/SOUL.md +19 -0
- package/adapters/hermes/manifest.json +7 -0
- package/adapters/hermes/skills/capture/SKILL.md +16 -0
- package/adapters/hermes/skills/doctor/SKILL.md +14 -0
- package/adapters/hermes/skills/install/SKILL.md +19 -0
- package/adapters/hermes/skills/retrieve/SKILL.md +10 -0
- package/adapters/hermes/skills/setup/SKILL.md +22 -0
- package/adapters/hermes/skills/uninstall/SKILL.md +20 -0
- package/core/AGENTS.md +110 -0
- package/core/agents/librarian.md +43 -0
- package/core/agents/retriever.md +62 -0
- package/core/ontology/concepts/inbox.yaml +4 -0
- package/core/ontology/concepts/literature.yaml +27 -0
- package/core/ontology/taxonomy.yaml +11 -0
- package/core/skills/capture/SKILL.md +48 -0
- package/core/skills/define/SKILL.md +59 -0
- package/core/skills/doctor/SKILL.md +49 -0
- package/core/skills/retrieve/SKILL.md +56 -0
- package/core/skills/setup/SKILL.md +44 -0
- package/core/skills/uninstall/SKILL.md +34 -0
- package/dist/adapt/HostAdapter.d.ts +21 -0
- package/dist/adapt/HostAdapter.js +10 -0
- package/dist/adapt/HostAdapter.js.map +1 -0
- package/dist/adapt/claudeCode.d.ts +9 -0
- package/dist/adapt/claudeCode.js +15 -0
- package/dist/adapt/claudeCode.js.map +1 -0
- package/dist/adapt/codex.d.ts +9 -0
- package/dist/adapt/codex.js +15 -0
- package/dist/adapt/codex.js.map +1 -0
- package/dist/adapt/hermes.d.ts +9 -0
- package/dist/adapt/hermes.js +15 -0
- package/dist/adapt/hermes.js.map +1 -0
- package/dist/capture/safe.d.ts +36 -0
- package/dist/capture/safe.js +167 -0
- package/dist/capture/safe.js.map +1 -0
- package/dist/cli/oms.d.ts +18 -0
- package/dist/cli/oms.js +401 -0
- package/dist/cli/oms.js.map +1 -0
- package/dist/conventions/frontmatter.d.ts +15 -0
- package/dist/conventions/frontmatter.js +23 -0
- package/dist/conventions/frontmatter.js.map +1 -0
- package/dist/conventions/validate.d.ts +24 -0
- package/dist/conventions/validate.js +88 -0
- package/dist/conventions/validate.js.map +1 -0
- package/dist/graph/cache.d.ts +98 -0
- package/dist/graph/cache.js +347 -0
- package/dist/graph/cache.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/install/hosts.d.ts +27 -0
- package/dist/install/hosts.js +465 -0
- package/dist/install/hosts.js.map +1 -0
- package/dist/mcp/server.d.ts +8 -0
- package/dist/mcp/server.js +461 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/ontology/loader.d.ts +13 -0
- package/dist/ontology/loader.js +63 -0
- package/dist/ontology/loader.js.map +1 -0
- package/dist/ontology/resolver.d.ts +13 -0
- package/dist/ontology/resolver.js +37 -0
- package/dist/ontology/resolver.js.map +1 -0
- package/dist/ontology/types.d.ts +72 -0
- package/dist/ontology/types.js +12 -0
- package/dist/ontology/types.js.map +1 -0
- package/docs/install.md +115 -0
- package/docs/release.md +91 -0
- package/package.json +64 -0
- package/scripts/install.sh +49 -0
- package/scripts/uninstall.sh +57 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Oh My Second Brain convention format — the semantic ontology, adapted from ouroboros.
|
|
3
|
+
*
|
|
4
|
+
* A vault's convention is declarative data the user owns (lives in `vault/.oms/`).
|
|
5
|
+
* Oh My Second Brain ships defaults in `core/ontology/` and enforces whatever the user declares.
|
|
6
|
+
*
|
|
7
|
+
* The format is deliberately semantic, not structural: every concept and folder
|
|
8
|
+
* carries a declared `intent` so a host agent reads *why* knowledge lives somewhere,
|
|
9
|
+
* not just *where*. "The folder itself is information."
|
|
10
|
+
*/
|
|
11
|
+
/** Supported scalar/collection kinds for a frontmatter field. */
|
|
12
|
+
export type FieldType = "string" | "url" | "date" | "list" | "number" | "boolean";
|
|
13
|
+
/** Optional normalization applied to a field value before/at validation. */
|
|
14
|
+
export type Normalize = "kebab" | "lower" | "trim";
|
|
15
|
+
/**
|
|
16
|
+
* One frontmatter key, modeled on ouroboros's `OntologyField`.
|
|
17
|
+
* Each field is itself a unit of convention — users grow a convention field-by-field.
|
|
18
|
+
*/
|
|
19
|
+
export interface OntologyField {
|
|
20
|
+
/** The frontmatter key name. */
|
|
21
|
+
name: string;
|
|
22
|
+
/** Value kind. */
|
|
23
|
+
type: FieldType;
|
|
24
|
+
/** Whether the key must be present and non-empty. Defaults to false. */
|
|
25
|
+
required?: boolean;
|
|
26
|
+
/** Semantic intent: what this field is FOR (ouroboros `description`). */
|
|
27
|
+
intent: string;
|
|
28
|
+
/** Optional value normalization for list/string fields. */
|
|
29
|
+
normalize?: Normalize;
|
|
30
|
+
/** If true, the field must not change once written (advisory in v0). */
|
|
31
|
+
immutable?: boolean;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* A pre-declared, named retrieval view — NOT a query filter.
|
|
35
|
+
* Mirrors ouroboros's `OntologyLens`: a concept declares which fields matter
|
|
36
|
+
* for which retrieval purpose (e.g. `synthesis`, `audit`).
|
|
37
|
+
*/
|
|
38
|
+
export interface OntologyLens {
|
|
39
|
+
name: string;
|
|
40
|
+
/** When this lens should be activated during retrieval. */
|
|
41
|
+
intent: string;
|
|
42
|
+
/** Subset of the concept's field names surfaced by this lens. */
|
|
43
|
+
fields: string[];
|
|
44
|
+
}
|
|
45
|
+
/** A note-type carrying explicit intent, its fields, lenses, and folder binding. */
|
|
46
|
+
export interface Concept {
|
|
47
|
+
/** Concept identifier (e.g. `literature`). */
|
|
48
|
+
concept: string;
|
|
49
|
+
/** What this knowledge is FOR. */
|
|
50
|
+
intent: string;
|
|
51
|
+
/** Folder this concept is bound to (relative to vault root). */
|
|
52
|
+
folder: string;
|
|
53
|
+
fields: OntologyField[];
|
|
54
|
+
lenses?: OntologyLens[];
|
|
55
|
+
}
|
|
56
|
+
/** Per-folder declaration: a folder is information, so it declares its intent. */
|
|
57
|
+
export interface FolderBinding {
|
|
58
|
+
/** Why this folder exists / what kind of knowledge it holds. */
|
|
59
|
+
intent: string;
|
|
60
|
+
/** Concept name(s) bound here, or null when not yet assigned (e.g. `inbox`). */
|
|
61
|
+
concept: string | string[] | null;
|
|
62
|
+
}
|
|
63
|
+
/** Folder ↔ concept map with per-folder intent. */
|
|
64
|
+
export interface Taxonomy {
|
|
65
|
+
version: number;
|
|
66
|
+
folders: Record<string, FolderBinding>;
|
|
67
|
+
}
|
|
68
|
+
/** A fully loaded convention: the taxonomy plus every concept, keyed by name. */
|
|
69
|
+
export interface Ontology {
|
|
70
|
+
taxonomy: Taxonomy;
|
|
71
|
+
concepts: Map<string, Concept>;
|
|
72
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Oh My Second Brain convention format — the semantic ontology, adapted from ouroboros.
|
|
3
|
+
*
|
|
4
|
+
* A vault's convention is declarative data the user owns (lives in `vault/.oms/`).
|
|
5
|
+
* Oh My Second Brain ships defaults in `core/ontology/` and enforces whatever the user declares.
|
|
6
|
+
*
|
|
7
|
+
* The format is deliberately semantic, not structural: every concept and folder
|
|
8
|
+
* carries a declared `intent` so a host agent reads *why* knowledge lives somewhere,
|
|
9
|
+
* not just *where*. "The folder itself is information."
|
|
10
|
+
*/
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/ontology/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"}
|
package/docs/install.md
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# Install Oh My Second Brain
|
|
2
|
+
|
|
3
|
+
Oh My Second Brain v0 is distributed as one npm/GitHub-release package that contains the CLI/runtime, the default ontology, host adapter assets, host-native skill/rule bundles, and shell installers. Claude Code, Codex, and Hermes all install an `oms` host surface for Oh My Second Brain backed by the same MCP capture/retrieve runtime.
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
- Node.js 18 or newer.
|
|
8
|
+
- `npm` on `PATH`.
|
|
9
|
+
- An Obsidian vault, or any folder of Markdown notes.
|
|
10
|
+
- Optional host CLIs: `claude`, `codex`, `hermes`.
|
|
11
|
+
|
|
12
|
+
## One-line install
|
|
13
|
+
|
|
14
|
+
Until npm publishing is unblocked, the installer installs the GitHub release tarball asset by default:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
curl -fsSL https://raw.githubusercontent.com/GoBeromsu/oms/main/scripts/install.sh | bash
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Useful overrides:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# Pick one host instead of auto-detection.
|
|
24
|
+
curl -fsSL https://raw.githubusercontent.com/GoBeromsu/oms/main/scripts/install.sh | bash -s -- --runtime claude
|
|
25
|
+
|
|
26
|
+
# Install every host adapter and point Oh My Second Brain at a specific vault.
|
|
27
|
+
curl -fsSL https://raw.githubusercontent.com/GoBeromsu/oms/main/scripts/install.sh | bash -s -- --runtime all --vault /path/to/vault
|
|
28
|
+
|
|
29
|
+
# Also execute external host CLIs where available, e.g. claude plugin/mcp commands.
|
|
30
|
+
curl -fsSL https://raw.githubusercontent.com/GoBeromsu/oms/main/scripts/install.sh | bash -s -- --runtime all --vault /path/to/vault --execute
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Environment knobs:
|
|
34
|
+
|
|
35
|
+
| Variable | Meaning |
|
|
36
|
+
| --- | --- |
|
|
37
|
+
| `OMS_PACKAGE_SPEC` | npm package spec or tarball URL to install globally |
|
|
38
|
+
| `OMS_INSTALL_RUNTIME` | `auto`, `all`, `claude`, `codex`, or `hermes` |
|
|
39
|
+
| `OMS_VAULT` | vault path used for MCP registration |
|
|
40
|
+
| `OMS_EXECUTE_EXTERNAL=1` | allow host CLI commands such as `claude plugin install` |
|
|
41
|
+
|
|
42
|
+
## CLI install
|
|
43
|
+
|
|
44
|
+
From a checkout or installed package:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
npm ci
|
|
48
|
+
npm run build
|
|
49
|
+
npx -y https://github.com/GoBeromsu/oms/releases/download/oms-v0.1.5/oms-0.1.5.tgz install --runtime all --vault /path/to/vault --dry-run
|
|
50
|
+
npx -y https://github.com/GoBeromsu/oms/releases/download/oms-v0.1.5/oms-0.1.5.tgz install --runtime all --vault /path/to/vault --yes
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Runtime selection follows the Ouroboros pattern:
|
|
54
|
+
|
|
55
|
+
1. Explicit `--runtime` wins.
|
|
56
|
+
2. `auto` detects `claude`, `codex`, and `hermes` on `PATH`.
|
|
57
|
+
3. If nothing is detected, `auto` defaults to Claude Code for conservative first-run behavior; use `--runtime all` to install every host surface.
|
|
58
|
+
4. `all` installs every known adapter surface.
|
|
59
|
+
|
|
60
|
+
## What install writes
|
|
61
|
+
|
|
62
|
+
| Host | Install behavior |
|
|
63
|
+
| --- | --- |
|
|
64
|
+
| Claude Code | Upserts `~/.claude/mcp.json` entry for `oms`; prints Claude plugin/MCP commands; with `--execute`, runs `claude plugin install` and `claude mcp add` when the CLI is available. |
|
|
65
|
+
| Codex | Installs `~/.codex/rules/oms.md`, `~/.codex/skills/oms-*`, copies adapter files to `~/.codex/plugins/oms`, and writes a managed `[mcp_servers.oms]` block plus `OMS_AGENT_RUNTIME=codex` env in `~/.codex/config.toml`. |
|
|
66
|
+
| Hermes | Installs `~/.hermes/skills/knowledge-management/oms/`, copies adapter files to `~/.hermes/adapters/oms`, and writes `mcp_servers.oms` in `~/.hermes/config.yaml`. |
|
|
67
|
+
|
|
68
|
+
All host writes are namespaced under `oms` and are reversible with `oms uninstall`.
|
|
69
|
+
|
|
70
|
+
## Legacy setup flow
|
|
71
|
+
|
|
72
|
+
`setup` still adopts a vault into the Oh My Second Brain ontology and can print the Claude Code plan:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
npx -y https://github.com/GoBeromsu/oms/releases/download/oms-v0.1.5/oms-0.1.5.tgz setup --vault /path/to/vault --yes --install-claude
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Typical printed commands look like:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
claude plugin install /path/to/oms/adapters/claude-code
|
|
82
|
+
claude mcp add oms -- npx -y https://github.com/GoBeromsu/oms/releases/download/oms-v0.1.5/oms-0.1.5.tgz mcp --vault /path/to/vault
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Uninstall
|
|
86
|
+
|
|
87
|
+
Preview first:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
oms uninstall --runtime all --dry-run
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Remove host registrations and adapter files:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
oms uninstall --runtime all --yes
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
One-line uninstall:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
curl -fsSL https://raw.githubusercontent.com/GoBeromsu/oms/main/scripts/uninstall.sh | bash -s -- --yes
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
The uninstaller removes Oh My Second Brain host registrations and adapter files. It does **not** remove vault notes or `vault/.oms/` ontology data. Pass `--keep-package` to the shell uninstaller if you want to keep the globally installed package.
|
|
106
|
+
|
|
107
|
+
## Verify the install
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
npx -y https://github.com/GoBeromsu/oms/releases/download/oms-v0.1.5/oms-0.1.5.tgz doctor --vault /path/to/vault
|
|
111
|
+
oms install --runtime all --vault /path/to/vault --dry-run
|
|
112
|
+
claude plugin validate adapters/claude-code
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Inside a host runtime, verify the MCP server by listing MCP tools or asking for Oh My Second Brain graph/status. The server exposes status, graph build, axis retrieval, lazy note loading, contract validation, and gated capture tools.
|
package/docs/release.md
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# Release Oh My Second Brain
|
|
2
|
+
|
|
3
|
+
Oh My Second Brain releases are npm-first and Claude Code validated. The release process must prove the published tarball works, not merely the repository checkout.
|
|
4
|
+
|
|
5
|
+
## Release contract
|
|
6
|
+
|
|
7
|
+
The npm package root is the runtime asset root. A releasable tarball must include:
|
|
8
|
+
|
|
9
|
+
- `dist/cli/oms.js`
|
|
10
|
+
- `dist/mcp/server.js`
|
|
11
|
+
- `core/ontology/taxonomy.yaml`
|
|
12
|
+
- `core/ontology/concepts/`
|
|
13
|
+
- `adapters/claude-code/.claude-plugin/plugin.json`
|
|
14
|
+
- every Claude adapter `skills/*/SKILL.md`
|
|
15
|
+
- `docs/install.md`
|
|
16
|
+
- `docs/release.md`
|
|
17
|
+
- `scripts/install.sh`
|
|
18
|
+
- `scripts/uninstall.sh`
|
|
19
|
+
|
|
20
|
+
Codex and Hermes adapter files are packaged as host-native skill/rule bundles plus MCP registrations; release notes must describe the exact installed paths and avoid claiming behavior beyond the shipped skills and MCP tools.
|
|
21
|
+
|
|
22
|
+
## Local release gate
|
|
23
|
+
|
|
24
|
+
Run this before tagging or publishing:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npm run release:check
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
`release:check` runs:
|
|
31
|
+
|
|
32
|
+
1. `npm run lint`
|
|
33
|
+
2. `npm run build`
|
|
34
|
+
3. `npm test`
|
|
35
|
+
4. `npm run audit`
|
|
36
|
+
5. `npm run release:pack`
|
|
37
|
+
6. `npm run release:artifact-smoke`
|
|
38
|
+
7. `npm run release:plugin`
|
|
39
|
+
|
|
40
|
+
`release:pack` inspects `npm pack --dry-run --json` and fails if required runtime assets are missing. `release:artifact-smoke` creates a real tarball, unpacks it into a temp directory, installs production dependencies there, and runs setup, host install dry-run, and MCP smoke from the extracted package root.
|
|
41
|
+
|
|
42
|
+
## Claude plugin validation
|
|
43
|
+
|
|
44
|
+
Preferred validation:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
claude plugin validate adapters/claude-code
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
If a release environment cannot run the Claude CLI, publishing is blocked unless an explicit validation attestation is provided through `OMS_PLUGIN_VALIDATION_ATTESTATION`.
|
|
51
|
+
|
|
52
|
+
Required attestation fields:
|
|
53
|
+
|
|
54
|
+
```json
|
|
55
|
+
{
|
|
56
|
+
"actor": "person-or-bot",
|
|
57
|
+
"timestamp": "2026-06-02T00:00:00Z",
|
|
58
|
+
"command": "claude plugin validate adapters/claude-code",
|
|
59
|
+
"pluginPath": "adapters/claude-code",
|
|
60
|
+
"claudeVersion": "optional version string",
|
|
61
|
+
"exitCode": 0,
|
|
62
|
+
"warnings": ["optional warning text"],
|
|
63
|
+
"artifact": "optional log path or URL"
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## GitHub release workflow
|
|
68
|
+
|
|
69
|
+
The v0 release workflow is **manual dispatch only** so the operator must provide the Claude plugin validation attestation explicitly when the GitHub runner cannot run Claude Code itself. It is credential-gated and uses npm provenance:
|
|
70
|
+
|
|
71
|
+
- It runs only through `workflow_dispatch`.
|
|
72
|
+
- It requires `plugin_validation_attestation` input.
|
|
73
|
+
- It runs the full release gate before publish.
|
|
74
|
+
- It requires `NPM_TOKEN`.
|
|
75
|
+
- It requires `id-token: write` for provenance.
|
|
76
|
+
- It refuses to publish `0.0.0`; bump to a real semver first.
|
|
77
|
+
- It runs `npm publish --provenance --access public` only in the publish job.
|
|
78
|
+
- It blocks publish if Claude plugin validation was skipped without attestation.
|
|
79
|
+
|
|
80
|
+
## Version and package-name preflight
|
|
81
|
+
|
|
82
|
+
Before the first public release:
|
|
83
|
+
|
|
84
|
+
1. Verify that the scoped `oms` npm package name is available to the publisher.
|
|
85
|
+
2. Bump `package.json` to a real semver release.
|
|
86
|
+
3. Keep `adapters/claude-code/.claude-plugin/plugin.json` version in sync with `package.json` unless a future ADR deliberately splits package/plugin versioning.
|
|
87
|
+
4. Confirm release notes list Codex rules/skills and Hermes skill-bundle install paths, plus the MCP registration files that make capture/retrieve tools available.
|
|
88
|
+
|
|
89
|
+
## Rollback posture
|
|
90
|
+
|
|
91
|
+
Do not rely on npm unpublish as a normal rollback path. Prefer publishing a fixed patch release and documenting any broken version in release notes.
|
package/package.json
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "oh-my-second-brain",
|
|
3
|
+
"version": "0.1.5",
|
|
4
|
+
"description": "Oh My Second Brain: a host-agnostic, user-owned convention layer for Obsidian and plain-markdown knowledge vaults.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"bin": {
|
|
8
|
+
"oms": "dist/cli/oms.js"
|
|
9
|
+
},
|
|
10
|
+
"main": "dist/index.js",
|
|
11
|
+
"types": "dist/index.d.ts",
|
|
12
|
+
"files": [
|
|
13
|
+
"dist",
|
|
14
|
+
"core",
|
|
15
|
+
"adapters",
|
|
16
|
+
"docs/install.md",
|
|
17
|
+
"docs/release.md",
|
|
18
|
+
"scripts/install.sh",
|
|
19
|
+
"scripts/uninstall.sh"
|
|
20
|
+
],
|
|
21
|
+
"engines": {
|
|
22
|
+
"node": ">=18"
|
|
23
|
+
},
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "node scripts/clean-dist.mjs && tsc -p tsconfig.json",
|
|
26
|
+
"lint": "tsc -p tsconfig.json --noEmit",
|
|
27
|
+
"test": "vitest run",
|
|
28
|
+
"audit": "npm audit --omit=dev",
|
|
29
|
+
"release:pack": "node scripts/release-pack.mjs",
|
|
30
|
+
"release:setup-smoke": "node scripts/release-artifact-smoke.mjs --setup-only",
|
|
31
|
+
"release:mcp-smoke": "node scripts/release-artifact-smoke.mjs --mcp-only",
|
|
32
|
+
"release:artifact-smoke": "node scripts/release-artifact-smoke.mjs",
|
|
33
|
+
"release:plugin": "node scripts/release-plugin.mjs",
|
|
34
|
+
"release:check": "npm run lint && npm run build && npm test && npm run audit && npm run release:pack && npm run release:artifact-smoke && npm run release:plugin"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
38
|
+
"yaml": "^2.5.0"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@types/node": "^20.14.0",
|
|
42
|
+
"typescript": "^5.5.0",
|
|
43
|
+
"vitest": "^2.0.0"
|
|
44
|
+
},
|
|
45
|
+
"repository": {
|
|
46
|
+
"type": "git",
|
|
47
|
+
"url": "git+https://github.com/GoBeromsu/oms.git"
|
|
48
|
+
},
|
|
49
|
+
"homepage": "https://github.com/GoBeromsu/oms#readme",
|
|
50
|
+
"bugs": {
|
|
51
|
+
"url": "https://github.com/GoBeromsu/oms/issues"
|
|
52
|
+
},
|
|
53
|
+
"keywords": [
|
|
54
|
+
"obsidian",
|
|
55
|
+
"knowledge-base",
|
|
56
|
+
"mcp",
|
|
57
|
+
"frontmatter",
|
|
58
|
+
"markdown",
|
|
59
|
+
"claude-code"
|
|
60
|
+
],
|
|
61
|
+
"publishConfig": {
|
|
62
|
+
"access": "public"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Oh My Second Brain installer — installs the package and registers host adapters.
|
|
3
|
+
# Usage: curl -fsSL https://raw.githubusercontent.com/GoBeromsu/oms/main/scripts/install.sh | bash
|
|
4
|
+
set -euo pipefail
|
|
5
|
+
|
|
6
|
+
PACKAGE_SPEC="${OMS_PACKAGE_SPEC:-https://github.com/GoBeromsu/oms/releases/download/oms-v0.1.5/oms-0.1.5.tgz}"
|
|
7
|
+
RUNTIME="${OMS_INSTALL_RUNTIME:-auto}"
|
|
8
|
+
VAULT="${OMS_VAULT:-$PWD}"
|
|
9
|
+
EXECUTE="${OMS_EXECUTE_EXTERNAL:-0}"
|
|
10
|
+
|
|
11
|
+
while [ "$#" -gt 0 ]; do
|
|
12
|
+
case "$1" in
|
|
13
|
+
--runtime) RUNTIME="${2:-}"; shift 2 ;;
|
|
14
|
+
--runtime=*) RUNTIME="${1#--runtime=}"; shift ;;
|
|
15
|
+
--vault) VAULT="${2:-}"; shift 2 ;;
|
|
16
|
+
--vault=*) VAULT="${1#--vault=}"; shift ;;
|
|
17
|
+
--package) PACKAGE_SPEC="${2:-}"; shift 2 ;;
|
|
18
|
+
--package=*) PACKAGE_SPEC="${1#--package=}"; shift ;;
|
|
19
|
+
--execute) EXECUTE=1; shift ;;
|
|
20
|
+
*) shift ;;
|
|
21
|
+
esac
|
|
22
|
+
done
|
|
23
|
+
|
|
24
|
+
if ! command -v npm >/dev/null 2>&1; then
|
|
25
|
+
echo "Error: npm is required to install Oh My Second Brain." >&2
|
|
26
|
+
exit 1
|
|
27
|
+
fi
|
|
28
|
+
|
|
29
|
+
echo "Oh My Second Brain Installer"
|
|
30
|
+
echo " package: $PACKAGE_SPEC"
|
|
31
|
+
echo " runtime: $RUNTIME"
|
|
32
|
+
echo " vault: $VAULT"
|
|
33
|
+
echo
|
|
34
|
+
|
|
35
|
+
npm install -g "$PACKAGE_SPEC"
|
|
36
|
+
|
|
37
|
+
ARGS=(install --runtime "$RUNTIME" --vault "$VAULT" --yes)
|
|
38
|
+
if [ "$EXECUTE" = "1" ]; then
|
|
39
|
+
ARGS+=(--execute)
|
|
40
|
+
fi
|
|
41
|
+
|
|
42
|
+
if command -v oms >/dev/null 2>&1; then
|
|
43
|
+
oms "${ARGS[@]}"
|
|
44
|
+
else
|
|
45
|
+
oms "${ARGS[@]}"
|
|
46
|
+
fi
|
|
47
|
+
|
|
48
|
+
echo
|
|
49
|
+
echo "Oh My Second Brain install complete. Run: oms doctor --vault \"$VAULT\""
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Oh My Second Brain uninstaller — removes host adapter registrations and optionally the package.
|
|
3
|
+
# Usage: curl -fsSL https://raw.githubusercontent.com/GoBeromsu/oms/main/scripts/uninstall.sh | bash
|
|
4
|
+
set -euo pipefail
|
|
5
|
+
|
|
6
|
+
RUNTIME="${OMS_UNINSTALL_RUNTIME:-all}"
|
|
7
|
+
VAULT="${OMS_VAULT:-$PWD}"
|
|
8
|
+
REMOVE_PACKAGE="${OMS_REMOVE_PACKAGE:-1}"
|
|
9
|
+
EXECUTE="${OMS_EXECUTE_EXTERNAL:-0}"
|
|
10
|
+
YES="${OMS_UNINSTALL_CONFIRM:-0}"
|
|
11
|
+
|
|
12
|
+
while [ "$#" -gt 0 ]; do
|
|
13
|
+
case "$1" in
|
|
14
|
+
--runtime) RUNTIME="${2:-}"; shift 2 ;;
|
|
15
|
+
--runtime=*) RUNTIME="${1#--runtime=}"; shift ;;
|
|
16
|
+
--vault) VAULT="${2:-}"; shift 2 ;;
|
|
17
|
+
--vault=*) VAULT="${1#--vault=}"; shift ;;
|
|
18
|
+
--keep-package) REMOVE_PACKAGE=0; shift ;;
|
|
19
|
+
--execute) EXECUTE=1; shift ;;
|
|
20
|
+
-y|--yes) YES=1; shift ;;
|
|
21
|
+
*) shift ;;
|
|
22
|
+
esac
|
|
23
|
+
done
|
|
24
|
+
|
|
25
|
+
if [ "$YES" != "1" ]; then
|
|
26
|
+
if [ -t 0 ]; then
|
|
27
|
+
printf 'Remove Oh My Second Brain host registrations for runtime=%s? (y/N) ' "$RUNTIME"
|
|
28
|
+
read -r REPLY
|
|
29
|
+
elif [ -c /dev/tty ]; then
|
|
30
|
+
printf 'Remove Oh My Second Brain host registrations for runtime=%s? (y/N) ' "$RUNTIME" >&2
|
|
31
|
+
read -r REPLY < /dev/tty
|
|
32
|
+
else
|
|
33
|
+
echo "Non-interactive uninstall requires --yes or OMS_UNINSTALL_CONFIRM=1." >&2
|
|
34
|
+
exit 1
|
|
35
|
+
fi
|
|
36
|
+
case "$REPLY" in
|
|
37
|
+
y|Y|yes|YES) ;;
|
|
38
|
+
*) echo "Cancelled."; exit 0 ;;
|
|
39
|
+
esac
|
|
40
|
+
fi
|
|
41
|
+
|
|
42
|
+
ARGS=(uninstall --runtime "$RUNTIME" --vault "$VAULT" --yes)
|
|
43
|
+
if [ "$EXECUTE" = "1" ]; then
|
|
44
|
+
ARGS+=(--execute)
|
|
45
|
+
fi
|
|
46
|
+
|
|
47
|
+
if command -v oms >/dev/null 2>&1; then
|
|
48
|
+
oms "${ARGS[@]}"
|
|
49
|
+
else
|
|
50
|
+
echo "oms binary not found; skipping host deregistration." >&2
|
|
51
|
+
fi
|
|
52
|
+
|
|
53
|
+
if [ "$REMOVE_PACKAGE" = "1" ] && command -v npm >/dev/null 2>&1; then
|
|
54
|
+
npm uninstall -g oms || true
|
|
55
|
+
fi
|
|
56
|
+
|
|
57
|
+
echo "Oh My Second Brain uninstall complete. Vault content was not removed."
|