@vortex-os/base 0.1.0 → 0.3.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/LICENSE +1 -1
- package/README.md +151 -77
- package/bin/vortex.mjs +17 -0
- package/dist/catch-up-ZQN7HMMN.js +7 -0
- package/dist/catch-up-ZQN7HMMN.js.map +1 -0
- package/dist/chunk-6SO4DAWJ.js +32 -0
- package/dist/chunk-6SO4DAWJ.js.map +1 -0
- package/dist/index.d.ts +1639 -166
- package/dist/index.js +3687 -546
- package/dist/index.js.map +1 -1
- package/package.json +69 -61
- package/templates/commands/agenda.md +15 -0
- package/templates/commands/recall.md +17 -0
- package/templates/config/vortex.json +10 -0
- package/templates/routers/.cursorrules +14 -0
- package/templates/routers/AGENT.md +91 -0
- package/templates/routers/CLAUDE.md +16 -0
- package/templates/routers/CODEX.md +14 -0
- package/templates/routers/GEMINI.md +14 -0
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,77 +1,151 @@
|
|
|
1
|
-
# @vortex-os/base
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
1
|
+
# @vortex-os/base
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
__ __ _ _____ __
|
|
5
|
+
\ \ / ___ _ _| |_| __\ \/ /
|
|
6
|
+
\ V / _ | '_| _| _| > <
|
|
7
|
+
\_/\___|_| \__|___/_/\_\
|
|
8
|
+
Vortex absorbs context · EX executes it
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Base entry point for **VortEX** — a Multi-Agent Personal AI Work OS framework.
|
|
12
|
+
|
|
13
|
+
`@vortex-os/base` bundles the framework's 14 internal workspaces (core utilities, slash-command runtime, memory store, daily-log store, decision-log store, runbook store, link-rewriter, index-generator, data-linter, report-generator, two catalog modules, the proactive-curator proposal engine, and the session-rituals plugin) into a single installable package. Install once, get the whole framework.
|
|
14
|
+
|
|
15
|
+
## Install
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install @vortex-os/base
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Quick start — one install, then `init`
|
|
22
|
+
|
|
23
|
+
`@vortex-os/base` ships a `vortex` CLI, so a working instance is three steps:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install @vortex-os/base # install the framework into a new folder
|
|
27
|
+
npx vortex init # scaffold the instance (asks for name / role / task)
|
|
28
|
+
# then open your agent (e.g. `claude`) in that folder
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
`npx vortex init` is non-destructive and creates, in the current folder:
|
|
32
|
+
|
|
33
|
+
- the five per-agent router files — `AGENT.md`, `CLAUDE.md`, `CODEX.md`, `GEMINI.md`, `.cursorrules` — so any agent host finds VortEX's behavior contract (these are generic templates you personalize over time);
|
|
34
|
+
- the `data/` skeleton (`_memory/`, `worklog/`, `decision-log/`, `runbooks/`, `hubs/`, `inbox/`), your user-profile memory, and today's first worklog;
|
|
35
|
+
- `.claude/settings.json` with the session hooks wired as `npx --no-install -p @vortex-os/base vortex session-start` / `… session-end` (the `--no-install` flag and explicit `-p` package make the auto-firing hook fail closed rather than install or shadow), plus the agent-mediated slash-commands in `.claude/commands/`;
|
|
36
|
+
- `.agent/vortex.json` (auto-record config) and a minimal `package.json` with `"type":"module"` if none exists.
|
|
37
|
+
|
|
38
|
+
Pass the answers inline to skip the prompts:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npx vortex init --name "Alex" --role "engineer" --task "set up my work notes"
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Other CLI entry points (all run base-only — `/recall` lights up only when the optional add-on is installed):
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
npx vortex --list # list available commands
|
|
48
|
+
npx vortex status # instance state report
|
|
49
|
+
npx vortex session-start # start-of-session boot report (git pull + counts + catch-up)
|
|
50
|
+
npx vortex session-end # worklog safety net
|
|
51
|
+
npx vortex doctor # health diagnosis
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Library usage
|
|
55
|
+
|
|
56
|
+
```ts
|
|
57
|
+
import {
|
|
58
|
+
core,
|
|
59
|
+
slashCommands,
|
|
60
|
+
memorySystem,
|
|
61
|
+
worklog,
|
|
62
|
+
decisionLog,
|
|
63
|
+
proactiveCurator,
|
|
64
|
+
sessionRituals,
|
|
65
|
+
} from "@vortex-os/base";
|
|
66
|
+
|
|
67
|
+
// Use the slash-rituals registry against your own data directory
|
|
68
|
+
const registry = sessionRituals.createRitualRegistry();
|
|
69
|
+
const ctx = core.makeContext(process.cwd());
|
|
70
|
+
|
|
71
|
+
await slashCommands.runSlash("/session-start", { registry, context: ctx });
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Opt-in `/curate` surface
|
|
75
|
+
|
|
76
|
+
The `/curate` command is opt-in because it needs a host-supplied LLM adapter. To enable it on Claude Code, wire a sub-agent invoker:
|
|
77
|
+
|
|
78
|
+
```ts
|
|
79
|
+
import { proactiveCurator, sessionRituals } from "@vortex-os/base";
|
|
80
|
+
|
|
81
|
+
const llm = new proactiveCurator.ClaudeCodeLLMJudge(async ({ prompt }) => {
|
|
82
|
+
// Host-specific sub-agent invocation; return the sub-agent's raw answer.
|
|
83
|
+
return await invokeMySubAgent(prompt);
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
const registry = sessionRituals.createRitualRegistry({
|
|
87
|
+
curate: {
|
|
88
|
+
llm,
|
|
89
|
+
// Optional — supply the in-session insight surface with recent turns.
|
|
90
|
+
insightInputProvider: () => ({
|
|
91
|
+
recentTurns: myTurnBuffer.recent(20),
|
|
92
|
+
accumulatedTokens: myTurnBuffer.tokenCount(),
|
|
93
|
+
}),
|
|
94
|
+
},
|
|
95
|
+
});
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Without an `LLMJudge`, `/curate` is simply absent (graceful degradation); the rest of the rituals work unchanged.
|
|
99
|
+
|
|
100
|
+
## Exported namespaces
|
|
101
|
+
|
|
102
|
+
Each internal workspace is exposed as a top-level namespace on the package:
|
|
103
|
+
|
|
104
|
+
| Namespace | Source workspace | Role |
|
|
105
|
+
|---|---|---|
|
|
106
|
+
| `core` | `@vortex-os/core` | Frontmatter parser (BOM-safe), three-tier privacy filter, `ModuleContext` path resolver, shared types |
|
|
107
|
+
| `slashCommands` | `@vortex-os/slash-commands` | `Command`, `CommandRegistry`, `runSlash` primitives |
|
|
108
|
+
| `memorySystem` | `@vortex-os/memory-system` | Markdown-frontmatter memory store + `MEMORY.md` index writer + diff helpers |
|
|
109
|
+
| `dataLint` | `@vortex-os/data-lint` | Pluggable linter for markdown directories (frontmatter / privacy / wiki-link checks) |
|
|
110
|
+
| `aiCodingPitfalls` | `@vortex-os/ai-coding-pitfalls` | Typed catalog of AI coding pitfall patterns |
|
|
111
|
+
| `toolRules` | `@vortex-os/tool-rules` | Typed catalog of tool usage rules |
|
|
112
|
+
| `reportGenerator` | `@vortex-os/report-generator` | HTML reports with privacy-marker section filtering |
|
|
113
|
+
| `worklog` | `@vortex-os/worklog` | Daily work-log store with year/month layout |
|
|
114
|
+
| `decisionLog` | `@vortex-os/decision-log` | Decision-log store with template-driven entry creation |
|
|
115
|
+
| `indexGenerator` | `@vortex-os/index-generator` | `_INDEX.md` rendering (flat + nested modes) |
|
|
116
|
+
| `runbooks` | `@vortex-os/runbooks` | Runbook store with `last_tested`-based stale detection |
|
|
117
|
+
| `linkRewriter` | `@vortex-os/link-rewriter` | Wiki-link extract / resolve / check / rewrite |
|
|
118
|
+
| `proactiveCurator` | `@vortex-os/proactive-curator` | Topic-aware proposal engine — in-session insight capture + hub auto-curation with 4-action active placement (`create-folder` / `create-file` / `append-section` / `update-file`). Asymmetric LLM gate for hub thresholds (3 weak / 5 strong). Decline durability + Claude Code `LLMJudge` adapter. |
|
|
119
|
+
| `sessionRituals` | `@vortex-os/session-rituals` | Daily session-loop slash commands: `/session-start`, `/reindex`, `/decision`, `/log`, `/vortex`, `/curate`, `/recall` |
|
|
120
|
+
|
|
121
|
+
## Capability add-ons (Phase 11+)
|
|
122
|
+
|
|
123
|
+
Future capability clusters publish as siblings under the `@vortex-os` scope and install alongside the base. The base auto-detects installed add-ons at session-start:
|
|
124
|
+
|
|
125
|
+
- **`@vortex-os/memory-extended@0.5.0` (Phase 11) — shipped** — all five namespaces are live: `sqlite` (structured index + drift detection), `vector` (brute-force cosine backend, local `multilingual-e5-small` embedder), `recall` (two-stage hybrid `/recall` over memories *and* conversation sessions), `sessionArchive` (four first-party host adapters: Claude Code, Codex, Gemini, Claude Desktop), `consolidate` (post-session memory-candidate proposer). Peer-depends on this base. See [memory-extended-design.md](https://github.com/vortex-os-project/vortex/blob/main/docs/memory-extended-design.md).
|
|
126
|
+
- `@vortex-os/dev-toolkit` (Phase 12) — vibe coding + self-QA + CI/CD assistance.
|
|
127
|
+
- `@vortex-os/vision` (Phase 14, under review) — screen context + visual reasoning.
|
|
128
|
+
|
|
129
|
+
Each add-on installs alongside the base and extends what the agent can do without forcing a base upgrade.
|
|
130
|
+
|
|
131
|
+
## Privacy & network behavior
|
|
132
|
+
|
|
133
|
+
- **`vortex init` folder scan.** To suggest content you might want to import, `init` does a read-only scan for common notes-folder names (e.g. an Obsidian vault, a `notes/` directory) under your home directory. It only reads directory listings to count Markdown files and surface a hint — it never copies, modifies, or transmits anything. Import happens only when you explicitly run `vortex import --from <path>`.
|
|
134
|
+
- **No network calls in the base.** Base itself makes no outbound network requests. The optional `@vortex-os/memory-extended` add-on, when installed, may download an embedding model (read-only `GET` from `huggingface.co`, cacheable / offline-able via `HF_HUB_OFFLINE=1`) and feeds transcript excerpts to whatever LLM adapter you wire into its consolidation step. See that package's README for details.
|
|
135
|
+
|
|
136
|
+
## Packaging notes
|
|
137
|
+
|
|
138
|
+
- **Bundled**: all 14 workspaces are bundled into the published artifact via `tsup`. Consumers do not need to install workspace packages individually.
|
|
139
|
+
- **External dependency**: `yaml` is left as a runtime dependency (npm resolves it on install).
|
|
140
|
+
- **Format**: ESM only. `"type": "module"` in your consumer is required (or set up `.mjs`).
|
|
141
|
+
- **Types**: a single `dist/index.d.ts` exposes all namespace types.
|
|
142
|
+
|
|
143
|
+
## Related
|
|
144
|
+
|
|
145
|
+
- [VortEX framework repository](https://github.com/vortex-os-project/vortex) — source, design docs, integration template for instances
|
|
146
|
+
- [Phase 10 split plan v2](https://github.com/vortex-os-project/vortex/blob/main/docs/phase-10-split-plan.md) — capability-cluster packaging design
|
|
147
|
+
- [Memory-extended design](https://github.com/vortex-os-project/vortex/blob/main/docs/memory-extended-design.md) — Phase 11 (memory-extended add-on) reference
|
|
148
|
+
|
|
149
|
+
## License
|
|
150
|
+
|
|
151
|
+
MIT — see [LICENSE](./LICENSE).
|
package/bin/vortex.mjs
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// `vortex` — the CLI shipped by @vortex-os/base.
|
|
3
|
+
//
|
|
4
|
+
// `npm i @vortex-os/base` puts this on the instance's path (node_modules/.bin),
|
|
5
|
+
// so `npx vortex init` / `npx vortex session-start` / `npx vortex --list` work
|
|
6
|
+
// without any monorepo checkout. It is a thin wrapper over the canonical
|
|
7
|
+
// dispatch (`runVortexCli`), which is bundled into base from
|
|
8
|
+
// `@vortex-os/session-rituals` — exactly one source of truth for the CLI logic.
|
|
9
|
+
//
|
|
10
|
+
// The dispatch lazily probes the optional `@vortex-os/memory-extended` add-on:
|
|
11
|
+
// when it is installed alongside base, `/recall` lights up; on a lean base-only
|
|
12
|
+
// install the probe is caught and the CLI runs with every other command.
|
|
13
|
+
|
|
14
|
+
import { sessionRituals } from "../dist/index.js";
|
|
15
|
+
|
|
16
|
+
const code = await sessionRituals.runVortexCli(process.argv.slice(2));
|
|
17
|
+
process.exitCode = code;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __export = (target, all) => {
|
|
3
|
+
for (var name in all)
|
|
4
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
// ../plugins/session-rituals/dist/catch-up.js
|
|
8
|
+
async function catchUpSessions(ctx, opts) {
|
|
9
|
+
const { sessionArchive } = await import("@vortex-os/memory-extended");
|
|
10
|
+
const dataDir = ctx.dataDir;
|
|
11
|
+
const cwd = opts?.cwd ?? ctx.repoRoot;
|
|
12
|
+
const adapters = opts?.adapters ?? [sessionArchive.claudeCodeAdapter];
|
|
13
|
+
const ingestResult = await sessionArchive.ingest({ adapters, dataDir, cwd, env: opts?.env });
|
|
14
|
+
const store = new sessionArchive.SessionArchiveStore(dataDir);
|
|
15
|
+
let indexedPulled = 0;
|
|
16
|
+
try {
|
|
17
|
+
indexedPulled = store.reindexFromNormalized().indexed;
|
|
18
|
+
} finally {
|
|
19
|
+
store.close();
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
ingestedLocal: ingestResult.sessionsIngested,
|
|
23
|
+
indexedPulled,
|
|
24
|
+
errors: ingestResult.errors.length
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export {
|
|
29
|
+
__export,
|
|
30
|
+
catchUpSessions
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=chunk-6SO4DAWJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../plugins/session-rituals/src/catch-up.ts"],"sourcesContent":["import type { ModuleContext } from \"@vortex-os/core\";\n// Type-only — erased at compile time, so importing it does NOT pull the\n// `@vortex-os/memory-extended` add-on (or its native sqlite/level deps) into\n// the module graph of consumers that only need the types. The runtime engine\n// is loaded lazily inside the function body via `await import(...)`.\nimport type { sessionArchive } from \"@vortex-os/memory-extended\";\n\n/**\n * Start-of-session \"catch-up\": fold conversation transcripts into the local\n * search archive without the user ever having to wrap up a session.\n *\n * Two sources, one pass:\n * - **local (a)** — this machine's own transcripts that are not archived yet,\n * read from the agent's transcript store and scoped to the current project.\n * - **pulled (b)** — transcripts created on another machine that arrived as\n * normalized text via git sync. Their text is present but this machine's\n * DB (local, derived, gitignored) has never indexed them.\n *\n * Text only — vectorization is deferred to recall/rebuild so session start\n * stays fast. The whole step is gated by `autoRecord.archive` at the call site\n * and is best-effort: callers should treat a thrown archive backend (e.g. the\n * native sqlite module not built) as \"skip\", never as a fatal start error.\n */\nexport interface CatchUpResult {\n /** Local transcripts newly archived this run (source a). */\n readonly ingestedLocal: number;\n /** Normalized transcripts from another machine newly indexed (source b). */\n readonly indexedPulled: number;\n /** Per-session ingest errors (source a). */\n readonly errors: number;\n}\n\nexport interface CatchUpOptions {\n /** Restrict local ingest to one project's transcripts. Default: `ctx.repoRoot`. */\n readonly cwd?: string;\n /**\n * Transcript adapters for local ingest. Default: Claude Code only. Other\n * hosts (Codex, Gemini) can be added by a caller; tests inject fakes so the\n * scan never touches the real home directory.\n */\n readonly adapters?: sessionArchive.IngestParams[\"adapters\"];\n /** Adapter environment override (e.g. a sandbox HOME). Tests use this. */\n readonly env?: sessionArchive.IngestParams[\"env\"];\n}\n\nexport async function catchUpSessions(\n ctx: ModuleContext,\n opts?: CatchUpOptions,\n): Promise<CatchUpResult> {\n // Lazy-load the optional add-on. Base ships without `memory-extended`; this\n // import resolves only when the add-on is installed alongside it. The call\n // site already gates this step on `autoRecord.archive` and treats a thrown\n // backend as \"skip\", so a missing add-on surfaces as a normal load error\n // the caller can catch.\n const { sessionArchive } = await import(\"@vortex-os/memory-extended\");\n\n const dataDir = ctx.dataDir;\n const cwd = opts?.cwd ?? ctx.repoRoot;\n const adapters = opts?.adapters ?? [sessionArchive.claudeCodeAdapter];\n\n // (a) Ingest this machine's not-yet-archived transcripts for the current\n // project. Writes the normalized copy into the archive (which git syncs) and\n // a local DB row. Text only — no vectorization here.\n const ingestResult = await sessionArchive.ingest({ adapters, dataDir, cwd, env: opts?.env });\n\n // (b) Index normalized transcripts that arrived from another machine via git\n // pull — their text is on disk but this machine's DB has no row yet.\n const store = new sessionArchive.SessionArchiveStore(dataDir);\n let indexedPulled = 0;\n try {\n indexedPulled = store.reindexFromNormalized().indexed;\n } finally {\n store.close();\n }\n\n return {\n ingestedLocal: ingestResult.sessionsIngested,\n indexedPulled,\n errors: ingestResult.errors.length,\n };\n}\n"],"mappings":";;;;;;;AA6CA,eAAsB,gBACpB,KACA,MAAqB;AAOrB,QAAM,EAAE,eAAc,IAAK,MAAM,OAAO,4BAA4B;AAEpE,QAAM,UAAU,IAAI;AACpB,QAAM,MAAM,MAAM,OAAO,IAAI;AAC7B,QAAM,WAAW,MAAM,YAAY,CAAC,eAAe,iBAAiB;AAKpE,QAAM,eAAe,MAAM,eAAe,OAAO,EAAE,UAAU,SAAS,KAAK,KAAK,MAAM,IAAG,CAAE;AAI3F,QAAM,QAAQ,IAAI,eAAe,oBAAoB,OAAO;AAC5D,MAAI,gBAAgB;AACpB,MAAI;AACF,oBAAgB,MAAM,sBAAqB,EAAG;EAChD;AACE,UAAM,MAAK;EACb;AAEA,SAAO;IACL,eAAe,aAAa;IAC5B;IACA,QAAQ,aAAa,OAAO;;AAEhC;","names":[]}
|