@vortex-os/base 0.3.0 → 0.5.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/README.md +12 -8
- package/dist/catch-up-GDDKPZHJ.js +8 -0
- package/dist/{chunk-6SO4DAWJ.js → chunk-3L5DLEGP.js} +6 -9
- package/dist/chunk-3L5DLEGP.js.map +1 -0
- package/dist/chunk-PZ5AY32C.js +10 -0
- package/dist/chunk-PZ5AY32C.js.map +1 -0
- package/dist/index.d.ts +688 -30
- package/dist/index.js +2295 -419
- package/dist/index.js.map +1 -1
- package/dist/vectorize-PN4Y7XMO.js +30 -0
- package/dist/vectorize-PN4Y7XMO.js.map +1 -0
- package/package.json +2 -2
- package/templates/commands/curate.md +48 -0
- package/templates/commands/recall.md +31 -17
- package/templates/config/vortex.json +3 -0
- package/templates/manifest.json +51 -0
- package/templates/routers/.cursorrules +5 -5
- package/templates/routers/AGENTS.md +27 -0
- package/templates/routers/AI-RULES.md +127 -0
- package/templates/routers/CLAUDE.md +26 -3
- package/templates/routers/GEMINI.md +5 -3
- package/dist/catch-up-ZQN7HMMN.js +0 -7
- package/dist/chunk-6SO4DAWJ.js.map +0 -1
- package/templates/routers/AGENT.md +0 -91
- package/templates/routers/CODEX.md +0 -14
- /package/dist/{catch-up-ZQN7HMMN.js.map → catch-up-GDDKPZHJ.js.map} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -88,7 +88,7 @@ declare function moduleDir(ctx: ModuleContext, moduleName: string): string;
|
|
|
88
88
|
* Instance configuration for VortEX, read from `<agentDir>/vortex.json`.
|
|
89
89
|
*
|
|
90
90
|
* The config exists to give the user control over the **auto-maintained**
|
|
91
|
-
* operational behaviors (see `
|
|
91
|
+
* operational behaviors (see `AI-RULES.md` → "Default behaviors") without
|
|
92
92
|
* touching code: toggle any auto-record off, and declare how this machine's
|
|
93
93
|
* environment is detected. A fresh instance has no config file — everything
|
|
94
94
|
* is on, no environment — so the framework works out of the box and the file
|
|
@@ -108,6 +108,29 @@ interface AutoRecordConfig {
|
|
|
108
108
|
* rebuilt.
|
|
109
109
|
*/
|
|
110
110
|
readonly archive: boolean;
|
|
111
|
+
/**
|
|
112
|
+
* Auto-vectorize: at session start (after catch-up), embed any
|
|
113
|
+
* newly-archived sessions and memories so semantic recall — including the
|
|
114
|
+
* ambient "did we discuss this?" path — stays current without a manual
|
|
115
|
+
* rebuild. **Gated on the recall index already existing** (`_indexes/
|
|
116
|
+
* memory.sqlite`): until the user has set recall up once (which downloads the
|
|
117
|
+
* embedding model), this is a silent no-op, so it never triggers a download
|
|
118
|
+
* on its own. On by default; off → vectors only update on an explicit
|
|
119
|
+
* `/recall` / rebuild.
|
|
120
|
+
*/
|
|
121
|
+
readonly vectorize: boolean;
|
|
122
|
+
/**
|
|
123
|
+
* Auto-download the embedding model the FIRST time recall is set up. When
|
|
124
|
+
* `@vortex-os/memory-extended` is installed but the recall index does not
|
|
125
|
+
* exist yet, session start kicks off a **background** worker that downloads
|
|
126
|
+
* the model (~470 MB, once) and builds the index — so installing the add-on
|
|
127
|
+
* is itself the opt-in and search turns on without a manual `/recall`. The
|
|
128
|
+
* download never blocks session start (it runs detached). On by default; set
|
|
129
|
+
* `false` — or env `VORTEX_VECTORIZE_AUTO_DOWNLOAD=0` — to keep the first
|
|
130
|
+
* download manual (metered connections, CI). Independent of `vectorize`: if
|
|
131
|
+
* `vectorize` is off, nothing runs regardless.
|
|
132
|
+
*/
|
|
133
|
+
readonly vectorizeAutoDownload: boolean;
|
|
111
134
|
}
|
|
112
135
|
/**
|
|
113
136
|
* One environment label plus the signal that selects it. Rules are evaluated
|
|
@@ -129,8 +152,22 @@ interface EnvironmentRule {
|
|
|
129
152
|
readonly equals?: string;
|
|
130
153
|
};
|
|
131
154
|
}
|
|
155
|
+
/**
|
|
156
|
+
* Update-awareness behavior. `check` controls the once-per-session check for a
|
|
157
|
+
* newer published `@vortex-os/base`:
|
|
158
|
+
* - `"session"` (default): check the npm registry once at session start and,
|
|
159
|
+
* when a newer version exists, surface it (the agent then asks before any
|
|
160
|
+
* install — nothing is installed automatically). Offline → silent skip.
|
|
161
|
+
* - `"off"`: no automatic check, no network contact for updates.
|
|
162
|
+
* On either setting the local "templates not yet applied" notice (no network)
|
|
163
|
+
* and the on-demand `vortex check-updates` still work.
|
|
164
|
+
*/
|
|
165
|
+
interface UpdatesConfig {
|
|
166
|
+
readonly check: "session" | "off";
|
|
167
|
+
}
|
|
132
168
|
interface VortexConfig {
|
|
133
169
|
readonly autoRecord: AutoRecordConfig;
|
|
170
|
+
readonly updates: UpdatesConfig;
|
|
134
171
|
readonly environments: readonly EnvironmentRule[];
|
|
135
172
|
}
|
|
136
173
|
/** Path of the instance config file: `<agentDir>/vortex.json`. */
|
|
@@ -138,7 +175,9 @@ declare function vortexConfigPath(ctx: ModuleContext): string;
|
|
|
138
175
|
/**
|
|
139
176
|
* Load the instance config, merged over defaults. A missing, unreadable, or
|
|
140
177
|
* invalid file yields defaults (everything on, no environments) rather than
|
|
141
|
-
* throwing — config is opt-in tuning, never a prerequisite.
|
|
178
|
+
* throwing — config is opt-in tuning, never a prerequisite. Environment rules
|
|
179
|
+
* are validated individually; malformed ones are dropped so that a partly bad
|
|
180
|
+
* config still resolves rather than throwing in `resolveEnvironment`.
|
|
142
181
|
*/
|
|
143
182
|
declare function loadVortexConfig(ctx: ModuleContext): VortexConfig;
|
|
144
183
|
/**
|
|
@@ -153,6 +192,68 @@ declare function resolveEnvironment(config: VortexConfig, signals: {
|
|
|
153
192
|
readonly pathExists?: (p: string) => boolean;
|
|
154
193
|
}): string | null;
|
|
155
194
|
|
|
195
|
+
/**
|
|
196
|
+
* Options for {@link validateDataRelativePath}. Shaped so a future
|
|
197
|
+
* symlink-aware mode can be added WITHOUT changing any caller: today every
|
|
198
|
+
* caller passes no options (or `{}`) and gets the lexical check. When the
|
|
199
|
+
* realpath mode lands it becomes `{ resolveSymlinks: true }` and callers that
|
|
200
|
+
* want it opt in; the default stays lexical-only.
|
|
201
|
+
*
|
|
202
|
+
* The symlink/realpath ancestor check is intentionally DEFERRED for v1 — the
|
|
203
|
+
* lexical containment check (resolve + `path.relative`) already blocks
|
|
204
|
+
* traversal, absolute, and drive-qualified paths. A symlink *inside* `data/`
|
|
205
|
+
* pointing outside it is the remaining gap; closing it needs an async
|
|
206
|
+
* `realpath` walk, which this synchronous API leaves room for.
|
|
207
|
+
*/
|
|
208
|
+
interface ValidateDataRelativePathOptions {
|
|
209
|
+
/**
|
|
210
|
+
* Reserved for the deferred realpath/symlink-ancestor mode. Currently
|
|
211
|
+
* ignored — accepted now so enabling it later is not a breaking change.
|
|
212
|
+
*/
|
|
213
|
+
readonly resolveSymlinks?: boolean;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Validate an untrusted `data/`-relative path and return the vetted absolute
|
|
217
|
+
* path under `dataDir`, or throw a clear {@link Error}.
|
|
218
|
+
*
|
|
219
|
+
* Rejection rules (in order — the cheap lexical checks run before the
|
|
220
|
+
* resolve so a hostile input never even reaches `path.resolve`):
|
|
221
|
+
*
|
|
222
|
+
* 1. Not a non-empty string.
|
|
223
|
+
* 2. Contains a control character (U+0000–U+001F).
|
|
224
|
+
* 3. After normalizing `\` → `/`: empty, `.`, drive-qualified (`C:`),
|
|
225
|
+
* absolute, or has a leading separator.
|
|
226
|
+
* 4. Any segment is empty (collapsed `//`), `.`, or `..` (traversal).
|
|
227
|
+
* 5. The final segment (the filename) is empty.
|
|
228
|
+
* 6. The first segment is a system/meta dir (worklog, decision-log,
|
|
229
|
+
* runbooks, hubs, _memory, _templates, _proactive-curator) or starts
|
|
230
|
+
* with `_` (any reserved/meta dir).
|
|
231
|
+
*
|
|
232
|
+
* Then it resolves against `dataDir` and confirms containment using
|
|
233
|
+
* `path.relative` (NOT a string prefix — `data` vs `data-evil` would fool a
|
|
234
|
+
* prefix check). On Windows the relative check is done case-insensitively.
|
|
235
|
+
*
|
|
236
|
+
* @param dataDir Absolute path of the instance's `data/` directory.
|
|
237
|
+
* @param rel Untrusted `data/`-relative path (LLM- or agent-supplied).
|
|
238
|
+
* @returns The validated absolute path, guaranteed under `dataDir`.
|
|
239
|
+
*/
|
|
240
|
+
declare function validateDataRelativePath(dataDir: string, rel: string, _options?: ValidateDataRelativePathOptions): string;
|
|
241
|
+
/**
|
|
242
|
+
* Create a file exclusively (refusing to overwrite). Writes `body` with the
|
|
243
|
+
* `wx` flag so an existing target throws `EEXIST`, which is re-thrown as a
|
|
244
|
+
* clear "refusing to overwrite" error. Use for the create-file action where
|
|
245
|
+
* clobbering an existing document would be silent data loss.
|
|
246
|
+
*
|
|
247
|
+
* The caller is responsible for ensuring the parent directory exists (the
|
|
248
|
+
* create-file path in the curator does its own `mkdir` after validation).
|
|
249
|
+
*
|
|
250
|
+
* @param absPath Absolute target path (already validated by
|
|
251
|
+
* {@link validateDataRelativePath}).
|
|
252
|
+
* @param body File contents (UTF-8).
|
|
253
|
+
*/
|
|
254
|
+
declare function exclusiveCreateFile(absPath: string, body: string): Promise<void>;
|
|
255
|
+
declare function atomicWriteFile(absPath: string, body: string): Promise<void>;
|
|
256
|
+
|
|
156
257
|
//# sourceMappingURL=index.d.ts.map
|
|
157
258
|
|
|
158
259
|
type index_d$d_AutoRecordConfig = AutoRecordConfig;
|
|
@@ -160,7 +261,11 @@ type index_d$d_EnvironmentRule = EnvironmentRule;
|
|
|
160
261
|
type index_d$d_FrontmatterDoc<T = Record<string, unknown>> = FrontmatterDoc<T>;
|
|
161
262
|
type index_d$d_ModuleContext = ModuleContext;
|
|
162
263
|
type index_d$d_Privacy = Privacy;
|
|
264
|
+
type index_d$d_UpdatesConfig = UpdatesConfig;
|
|
265
|
+
type index_d$d_ValidateDataRelativePathOptions = ValidateDataRelativePathOptions;
|
|
163
266
|
type index_d$d_VortexConfig = VortexConfig;
|
|
267
|
+
declare const index_d$d_atomicWriteFile: typeof atomicWriteFile;
|
|
268
|
+
declare const index_d$d_exclusiveCreateFile: typeof exclusiveCreateFile;
|
|
164
269
|
declare const index_d$d_isVisibleAt: typeof isVisibleAt;
|
|
165
270
|
declare const index_d$d_loadVortexConfig: typeof loadVortexConfig;
|
|
166
271
|
declare const index_d$d_makeContext: typeof makeContext;
|
|
@@ -170,9 +275,10 @@ declare const index_d$d_normalizePrivacy: typeof normalizePrivacy;
|
|
|
170
275
|
declare const index_d$d_parseFrontmatter: typeof parseFrontmatter;
|
|
171
276
|
declare const index_d$d_resolveEnvironment: typeof resolveEnvironment;
|
|
172
277
|
declare const index_d$d_serializeFrontmatter: typeof serializeFrontmatter;
|
|
278
|
+
declare const index_d$d_validateDataRelativePath: typeof validateDataRelativePath;
|
|
173
279
|
declare const index_d$d_vortexConfigPath: typeof vortexConfigPath;
|
|
174
280
|
declare namespace index_d$d {
|
|
175
|
-
export { type index_d$d_AutoRecordConfig as AutoRecordConfig, type index_d$d_EnvironmentRule as EnvironmentRule, type index_d$d_FrontmatterDoc as FrontmatterDoc, type index_d$d_ModuleContext as ModuleContext, type index_d$d_Privacy as Privacy, type index_d$d_VortexConfig as VortexConfig, index_d$d_isVisibleAt as isVisibleAt, index_d$d_loadVortexConfig as loadVortexConfig, index_d$d_makeContext as makeContext, index_d$d_maxPrivacy as maxPrivacy, index_d$d_moduleDir as moduleDir, index_d$d_normalizePrivacy as normalizePrivacy, index_d$d_parseFrontmatter as parseFrontmatter, index_d$d_resolveEnvironment as resolveEnvironment, index_d$d_serializeFrontmatter as serializeFrontmatter, index_d$d_vortexConfigPath as vortexConfigPath };
|
|
281
|
+
export { type index_d$d_AutoRecordConfig as AutoRecordConfig, type index_d$d_EnvironmentRule as EnvironmentRule, type index_d$d_FrontmatterDoc as FrontmatterDoc, type index_d$d_ModuleContext as ModuleContext, type index_d$d_Privacy as Privacy, type index_d$d_UpdatesConfig as UpdatesConfig, type index_d$d_ValidateDataRelativePathOptions as ValidateDataRelativePathOptions, type index_d$d_VortexConfig as VortexConfig, index_d$d_atomicWriteFile as atomicWriteFile, index_d$d_exclusiveCreateFile as exclusiveCreateFile, index_d$d_isVisibleAt as isVisibleAt, index_d$d_loadVortexConfig as loadVortexConfig, index_d$d_makeContext as makeContext, index_d$d_maxPrivacy as maxPrivacy, index_d$d_moduleDir as moduleDir, index_d$d_normalizePrivacy as normalizePrivacy, index_d$d_parseFrontmatter as parseFrontmatter, index_d$d_resolveEnvironment as resolveEnvironment, index_d$d_serializeFrontmatter as serializeFrontmatter, index_d$d_validateDataRelativePath as validateDataRelativePath, index_d$d_vortexConfigPath as vortexConfigPath };
|
|
176
282
|
}
|
|
177
283
|
|
|
178
284
|
/**
|
|
@@ -470,7 +576,17 @@ declare function privacyValid(): LintRule;
|
|
|
470
576
|
interface WikiLinkResolvesOptions {
|
|
471
577
|
/** Directory under which valid link targets live. Searched recursively. */
|
|
472
578
|
readonly searchRoot: string;
|
|
473
|
-
/**
|
|
579
|
+
/**
|
|
580
|
+
* Target file extensions. Defaults to `[".md"]`.
|
|
581
|
+
*
|
|
582
|
+
* `.md` targets are keyed by basename (extension stripped) — `[[Foo]]`
|
|
583
|
+
* resolves `Foo.md`. Any non-`.md` extension listed here keeps its
|
|
584
|
+
* extension in the index, so `[[Foo.pdf]]` resolves `Foo.pdf` while a bare
|
|
585
|
+
* `[[Foo]]` never silently matches an attachment. Mirrors the resolution
|
|
586
|
+
* contract in `@vortex-os/link-rewriter` (`resolve.ts`). Pass attachment
|
|
587
|
+
* extensions here (e.g. `[".md", ".pdf", ".png"]`) so imported binaries are
|
|
588
|
+
* treated as valid link targets instead of false "unresolved" findings.
|
|
589
|
+
*/
|
|
474
590
|
readonly extensions?: readonly string[];
|
|
475
591
|
}
|
|
476
592
|
/**
|
|
@@ -484,6 +600,23 @@ interface WikiLinkResolvesOptions {
|
|
|
484
600
|
*/
|
|
485
601
|
declare function wikiLinkResolves(options: WikiLinkResolvesOptions): LintRule;
|
|
486
602
|
|
|
603
|
+
/**
|
|
604
|
+
* Rule for `data/_memory/*.md` entries: the memory `type` must be a TOP-LEVEL
|
|
605
|
+
* frontmatter field — the index generator and the recall layer read
|
|
606
|
+
* `frontmatter.type` — never nested under `metadata`, and never the generic
|
|
607
|
+
* `note` default (which silently misclassifies the memory in type-aware
|
|
608
|
+
* recall). Scoped to files under a `_memory/` directory; the generated indexes
|
|
609
|
+
* (`_INDEX.md`, `MEMORY.md`) and `_TEMPLATE*` skeletons are skipped, and files
|
|
610
|
+
* in any other directory pass untouched.
|
|
611
|
+
*
|
|
612
|
+
* It does NOT enforce a closed type vocabulary: instances may extend the set
|
|
613
|
+
* (e.g. `infra`, `work`), and the built-in `memory-system` accepts any string.
|
|
614
|
+
* The two things this guards are the observed drift modes — a `metadata.type`
|
|
615
|
+
* the code never reads, and the `type: note` leak from the harness-memory
|
|
616
|
+
* format — both of which `require-frontmatter`/`privacy-valid` let through.
|
|
617
|
+
*/
|
|
618
|
+
declare function memoryFrontmatter(): LintRule;
|
|
619
|
+
|
|
487
620
|
//# sourceMappingURL=index.d.ts.map
|
|
488
621
|
|
|
489
622
|
type index_d$a_LintFinding = LintFinding;
|
|
@@ -495,11 +628,12 @@ type index_d$a_RequireFrontmatterOptions = RequireFrontmatterOptions;
|
|
|
495
628
|
type index_d$a_Severity = Severity;
|
|
496
629
|
type index_d$a_WikiLinkResolvesOptions = WikiLinkResolvesOptions;
|
|
497
630
|
declare const index_d$a_lintDirectory: typeof lintDirectory;
|
|
631
|
+
declare const index_d$a_memoryFrontmatter: typeof memoryFrontmatter;
|
|
498
632
|
declare const index_d$a_privacyValid: typeof privacyValid;
|
|
499
633
|
declare const index_d$a_requireFrontmatter: typeof requireFrontmatter;
|
|
500
634
|
declare const index_d$a_wikiLinkResolves: typeof wikiLinkResolves;
|
|
501
635
|
declare namespace index_d$a {
|
|
502
|
-
export { type index_d$a_LintFinding as LintFinding, type index_d$a_LintInput as LintInput, type index_d$a_LintOptions as LintOptions, type index_d$a_LintReport as LintReport, type index_d$a_LintRule as LintRule, type index_d$a_RequireFrontmatterOptions as RequireFrontmatterOptions, type index_d$a_Severity as Severity, type index_d$a_WikiLinkResolvesOptions as WikiLinkResolvesOptions, index_d$a_lintDirectory as lintDirectory, index_d$a_privacyValid as privacyValid, index_d$a_requireFrontmatter as requireFrontmatter, index_d$a_wikiLinkResolves as wikiLinkResolves };
|
|
636
|
+
export { type index_d$a_LintFinding as LintFinding, type index_d$a_LintInput as LintInput, type index_d$a_LintOptions as LintOptions, type index_d$a_LintReport as LintReport, type index_d$a_LintRule as LintRule, type index_d$a_RequireFrontmatterOptions as RequireFrontmatterOptions, type index_d$a_Severity as Severity, type index_d$a_WikiLinkResolvesOptions as WikiLinkResolvesOptions, index_d$a_lintDirectory as lintDirectory, index_d$a_memoryFrontmatter as memoryFrontmatter, index_d$a_privacyValid as privacyValid, index_d$a_requireFrontmatter as requireFrontmatter, index_d$a_wikiLinkResolves as wikiLinkResolves };
|
|
503
637
|
}
|
|
504
638
|
|
|
505
639
|
type PitfallSeverity = "info" | "warning" | "error";
|
|
@@ -918,6 +1052,13 @@ interface IndexEntry {
|
|
|
918
1052
|
readonly type?: string;
|
|
919
1053
|
/** Frontmatter `updated` or `created` value, ISO `YYYY-MM-DD` when parseable. */
|
|
920
1054
|
readonly updated?: string;
|
|
1055
|
+
/**
|
|
1056
|
+
* Frontmatter `scope` value, if present. `always` marks a memory the agent
|
|
1057
|
+
* should load every session (the always-on tier); absent means on-demand
|
|
1058
|
+
* (load by relevance from the index). Surfaced as a column in `_INDEX.md`
|
|
1059
|
+
* only when some entry sets it.
|
|
1060
|
+
*/
|
|
1061
|
+
readonly scope?: string;
|
|
921
1062
|
}
|
|
922
1063
|
/**
|
|
923
1064
|
* Options controlling {@link scanDirectory}.
|
|
@@ -961,7 +1102,7 @@ interface RenderIndexInput {
|
|
|
961
1102
|
privacy?: "public" | "internal" | "personal" | string;
|
|
962
1103
|
/** Extra frontmatter tags besides the default `[index]`. */
|
|
963
1104
|
extraTags?: readonly string[];
|
|
964
|
-
/** Optional "
|
|
1105
|
+
/** Optional "Related" links rendered after the entry list. */
|
|
965
1106
|
related?: readonly string[];
|
|
966
1107
|
}
|
|
967
1108
|
|
|
@@ -994,14 +1135,14 @@ declare function scanDirectory(rootDir: string, opts?: ScanOptions): Promise<rea
|
|
|
994
1135
|
*
|
|
995
1136
|
* > <description>
|
|
996
1137
|
*
|
|
997
|
-
* ##
|
|
1138
|
+
* ## Items (<count>)
|
|
998
1139
|
*
|
|
999
|
-
* |
|
|
1140
|
+
* | File | Description | Updated |
|
|
1000
1141
|
* |---|---|---|
|
|
1001
1142
|
* | [[<name>]] | <description or title> | <updated> |
|
|
1002
1143
|
* ...
|
|
1003
1144
|
*
|
|
1004
|
-
* ##
|
|
1145
|
+
* ## Related (only if `related` is non-empty)
|
|
1005
1146
|
*
|
|
1006
1147
|
* - [[<related[0]>]]
|
|
1007
1148
|
* ...
|
|
@@ -1203,7 +1344,7 @@ declare function extractWikiLinks(body: string): readonly WikiLink[];
|
|
|
1203
1344
|
* bare wiki links like `[[Foo]]`, which Obsidian resolves by filename
|
|
1204
1345
|
* anywhere in the vault.
|
|
1205
1346
|
* - `byRelPath` — forward-slash relative path (no `.md`) → absolute path.
|
|
1206
|
-
* Used for path-aware wiki links like `[[
|
|
1347
|
+
* Used for path-aware wiki links like `[[some-topic/Foo]]` or
|
|
1207
1348
|
* `[[../Foo]]`, where the operator wrote a path on purpose to
|
|
1208
1349
|
* disambiguate.
|
|
1209
1350
|
*
|
|
@@ -1232,7 +1373,7 @@ interface BuildIndexOptions {
|
|
|
1232
1373
|
* lookup fails. Useful when the operator's wiki-link convention uses
|
|
1233
1374
|
* different casing than the on-disk layout (a frequent situation when
|
|
1234
1375
|
* content is migrated from one vault into another with renamed roots,
|
|
1235
|
-
* e.g. `[[
|
|
1376
|
+
* e.g. `[[Some-Topic/foo]]` vs `data/some-topic/foo.md`).
|
|
1236
1377
|
*
|
|
1237
1378
|
* Default: false. Bare-name lookup is unaffected — Obsidian historically
|
|
1238
1379
|
* treats bare names case-sensitively, and we keep that.
|
|
@@ -1354,9 +1495,9 @@ declare function topBrokenTargets(broken: readonly BrokenLink[], limit?: number)
|
|
|
1354
1495
|
*
|
|
1355
1496
|
* Examples:
|
|
1356
1497
|
* { "API-Tokens": "secrets/api-tokens" }
|
|
1357
|
-
* [[API-Tokens]]
|
|
1358
|
-
* [[API-Tokens
|
|
1359
|
-
* [[API-Tokens#A
|
|
1498
|
+
* [[API-Tokens]] → [[secrets/api-tokens]]
|
|
1499
|
+
* [[API-Tokens|alias]] → [[secrets/api-tokens|alias]]
|
|
1500
|
+
* [[API-Tokens#A|alias]] → [[secrets/api-tokens#A|alias]]
|
|
1360
1501
|
*
|
|
1361
1502
|
* Use the exact name string the operator wrote — no normalization is
|
|
1362
1503
|
* applied. If the same broken target appears with different spellings
|
|
@@ -1684,6 +1825,59 @@ type FingerprintInput = {
|
|
|
1684
1825
|
*/
|
|
1685
1826
|
declare function computeFingerprint(input: FingerprintInput): string;
|
|
1686
1827
|
|
|
1828
|
+
/**
|
|
1829
|
+
* Hardened, deterministic write helper for the curate value loop.
|
|
1830
|
+
*
|
|
1831
|
+
* This is the single gate every document write goes through — the
|
|
1832
|
+
* insight-proposer's `onAccept` and the `vortex curate-accept` CLI subcommand
|
|
1833
|
+
* both call {@link writeDocAction}. It does NOT decide *whether* to write
|
|
1834
|
+
* (that is the user's accept) and it does NOT consult an LLM. It takes a
|
|
1835
|
+
* concrete document action and either creates a new file (exclusive — refuses
|
|
1836
|
+
* to overwrite) or appends a section to an EXISTING markdown file.
|
|
1837
|
+
*
|
|
1838
|
+
* Path safety is enforced first, for BOTH actions, via
|
|
1839
|
+
* {@link validateDataRelativePath} from `@vortex-os/core`. A path that escapes
|
|
1840
|
+
* `data/`, is absolute/drive-qualified, or targets a system/meta directory is
|
|
1841
|
+
* rejected before any filesystem access — closing the path-traversal gap that
|
|
1842
|
+
* was previously only guarded by the insight-proposer's system-meta string
|
|
1843
|
+
* check.
|
|
1844
|
+
*
|
|
1845
|
+
* v1 scope (consensus): create-file + append-section only. No update-file
|
|
1846
|
+
* (whole-file replace = data loss) and no create-folder distinct path
|
|
1847
|
+
* (create-file's mkdir covers the new-folder case).
|
|
1848
|
+
*/
|
|
1849
|
+
/** A document write the user has accepted. Path is `data/`-relative. */
|
|
1850
|
+
type DocWriteAction = {
|
|
1851
|
+
readonly kind: "create-file";
|
|
1852
|
+
/** `data/`-relative path of the file to create (validated here). */
|
|
1853
|
+
readonly targetRelPath: string;
|
|
1854
|
+
readonly body: string;
|
|
1855
|
+
} | {
|
|
1856
|
+
readonly kind: "append-section";
|
|
1857
|
+
/** `data/`-relative path of an EXISTING file to append to (validated here). */
|
|
1858
|
+
readonly targetRelPath: string;
|
|
1859
|
+
readonly sectionHeader: string;
|
|
1860
|
+
readonly body: string;
|
|
1861
|
+
};
|
|
1862
|
+
interface WriteDocResult {
|
|
1863
|
+
/** Absolute path written. */
|
|
1864
|
+
readonly writtenPath: string;
|
|
1865
|
+
readonly kind: DocWriteAction["kind"];
|
|
1866
|
+
}
|
|
1867
|
+
/**
|
|
1868
|
+
* Apply a document write action against `<cwd>/data`, with path validation and
|
|
1869
|
+
* exclusive-create / append-to-existing semantics.
|
|
1870
|
+
*
|
|
1871
|
+
* - `create-file`: validate the path, `mkdir -p` the parent, then write with
|
|
1872
|
+
* {@link exclusiveCreateFile} (throws "refusing to overwrite" if it exists).
|
|
1873
|
+
* - `append-section`: validate the path, REQUIRE the file to already exist
|
|
1874
|
+
* (append-section never creates), then append a `## <sectionHeader>` block.
|
|
1875
|
+
*
|
|
1876
|
+
* @throws if the path is unsafe, if create-file's target exists, or if
|
|
1877
|
+
* append-section's target does not exist.
|
|
1878
|
+
*/
|
|
1879
|
+
declare function writeDocAction(cwd: string, action: DocWriteAction): Promise<WriteDocResult>;
|
|
1880
|
+
|
|
1687
1881
|
type ProposalKind = "capture-insight" | "create-hub";
|
|
1688
1882
|
interface DeclinedEntry {
|
|
1689
1883
|
/** ISO-8601 timestamp of when the user declined. */
|
|
@@ -2209,6 +2403,7 @@ declare const index_d$1_CodexLLMJudge: typeof CodexLLMJudge;
|
|
|
2209
2403
|
type index_d$1_CodexLLMJudgeError = CodexLLMJudgeError;
|
|
2210
2404
|
declare const index_d$1_CodexLLMJudgeError: typeof CodexLLMJudgeError;
|
|
2211
2405
|
type index_d$1_DeclinedEntry = DeclinedEntry;
|
|
2406
|
+
type index_d$1_DocWriteAction = DocWriteAction;
|
|
2212
2407
|
type index_d$1_ExpectedShape = ExpectedShape;
|
|
2213
2408
|
type index_d$1_FingerprintInput = FingerprintInput;
|
|
2214
2409
|
type index_d$1_GeminiLLMJudge = GeminiLLMJudge;
|
|
@@ -2243,6 +2438,7 @@ type index_d$1_TopicTreeSnapshot = TopicTreeSnapshot;
|
|
|
2243
2438
|
type index_d$1_TurnBuffer = TurnBuffer;
|
|
2244
2439
|
declare const index_d$1_TurnBuffer: typeof TurnBuffer;
|
|
2245
2440
|
type index_d$1_TurnRecord = TurnRecord;
|
|
2441
|
+
type index_d$1_WriteDocResult = WriteDocResult;
|
|
2246
2442
|
declare const index_d$1_computeFingerprint: typeof computeFingerprint;
|
|
2247
2443
|
declare const index_d$1_deriveQueryFromTurns: typeof deriveQueryFromTurns;
|
|
2248
2444
|
declare const index_d$1_frameForJudge: typeof frameForJudge;
|
|
@@ -2251,8 +2447,9 @@ declare const index_d$1_parseJudgeResponse: typeof parseJudgeResponse;
|
|
|
2251
2447
|
declare const index_d$1_recordAcceptance: typeof recordAcceptance;
|
|
2252
2448
|
declare const index_d$1_recordDecline: typeof recordDecline;
|
|
2253
2449
|
declare const index_d$1_resetDeclined: typeof resetDeclined;
|
|
2450
|
+
declare const index_d$1_writeDocAction: typeof writeDocAction;
|
|
2254
2451
|
declare namespace index_d$1 {
|
|
2255
|
-
export { type index_d$1_AcceptResult as AcceptResult, index_d$1_AmbientBackpressure as AmbientBackpressure, type index_d$1_AmbientRecallHit as AmbientRecallHit, type index_d$1_AmbientRecallResult as AmbientRecallResult, index_d$1_AmbientRecaller as AmbientRecaller, type index_d$1_AmbientRecallerOptions as AmbientRecallerOptions, index_d$1_ClaudeCodeLLMJudge as ClaudeCodeLLMJudge, index_d$1_ClaudeCodeLLMJudgeError as ClaudeCodeLLMJudgeError, type index_d$1_ClaudeCodeSubAgentInvoker as ClaudeCodeSubAgentInvoker, type index_d$1_ClaudeDesktopInvoker as ClaudeDesktopInvoker, index_d$1_ClaudeDesktopLLMJudge as ClaudeDesktopLLMJudge, index_d$1_ClaudeDesktopLLMJudgeError as ClaudeDesktopLLMJudgeError, type index_d$1_CodexCompletionInvoker as CodexCompletionInvoker, index_d$1_CodexLLMJudge as CodexLLMJudge, index_d$1_CodexLLMJudgeError as CodexLLMJudgeError, type index_d$1_DeclinedEntry as DeclinedEntry, type index_d$1_ExpectedShape as ExpectedShape, type index_d$1_FingerprintInput as FingerprintInput, index_d$1_GeminiLLMJudge as GeminiLLMJudge, index_d$1_GeminiLLMJudgeError as GeminiLLMJudgeError, type index_d$1_GeminiMcpInvoker as GeminiMcpInvoker, type index_d$1_HubInput as HubInput, type index_d$1_HubProposal as HubProposal, index_d$1_HubProposer as HubProposer, type index_d$1_HubProposerOptions as HubProposerOptions, type index_d$1_InjectedInvoker as InjectedInvoker, index_d$1_InjectedLLMJudge as InjectedLLMJudge, type index_d$1_InsightInput as InsightInput, type index_d$1_InsightProposal as InsightProposal, index_d$1_InsightProposer as InsightProposer, type index_d$1_InsightProposerOptions as InsightProposerOptions, type index_d$1_LLMJudge as LLMJudge, index_d$1_LLMJudgeError as LLMJudgeError, type index_d$1_Proposal as Proposal, type index_d$1_ProposalAction as ProposalAction, type index_d$1_ProposalKind as ProposalKind, type index_d$1_Proposer as Proposer, type index_d$1_ProposerContext as ProposerContext, type index_d$1_RecallFn as RecallFn, type index_d$1_RecallSuggestion as RecallSuggestion, type index_d$1_TopicTreeSnapshot as TopicTreeSnapshot, index_d$1_TurnBuffer as TurnBuffer, type index_d$1_TurnRecord as TurnRecord, index_d$1_computeFingerprint as computeFingerprint, index_d$1_deriveQueryFromTurns as deriveQueryFromTurns, index_d$1_frameForJudge as frameForJudge, index_d$1_loadDeclinedFingerprints as loadDeclinedFingerprints, index_d$1_parseJudgeResponse as parseJudgeResponse, index_d$1_recordAcceptance as recordAcceptance, index_d$1_recordDecline as recordDecline, index_d$1_resetDeclined as resetDeclined };
|
|
2452
|
+
export { type index_d$1_AcceptResult as AcceptResult, index_d$1_AmbientBackpressure as AmbientBackpressure, type index_d$1_AmbientRecallHit as AmbientRecallHit, type index_d$1_AmbientRecallResult as AmbientRecallResult, index_d$1_AmbientRecaller as AmbientRecaller, type index_d$1_AmbientRecallerOptions as AmbientRecallerOptions, index_d$1_ClaudeCodeLLMJudge as ClaudeCodeLLMJudge, index_d$1_ClaudeCodeLLMJudgeError as ClaudeCodeLLMJudgeError, type index_d$1_ClaudeCodeSubAgentInvoker as ClaudeCodeSubAgentInvoker, type index_d$1_ClaudeDesktopInvoker as ClaudeDesktopInvoker, index_d$1_ClaudeDesktopLLMJudge as ClaudeDesktopLLMJudge, index_d$1_ClaudeDesktopLLMJudgeError as ClaudeDesktopLLMJudgeError, type index_d$1_CodexCompletionInvoker as CodexCompletionInvoker, index_d$1_CodexLLMJudge as CodexLLMJudge, index_d$1_CodexLLMJudgeError as CodexLLMJudgeError, type index_d$1_DeclinedEntry as DeclinedEntry, type index_d$1_DocWriteAction as DocWriteAction, type index_d$1_ExpectedShape as ExpectedShape, type index_d$1_FingerprintInput as FingerprintInput, index_d$1_GeminiLLMJudge as GeminiLLMJudge, index_d$1_GeminiLLMJudgeError as GeminiLLMJudgeError, type index_d$1_GeminiMcpInvoker as GeminiMcpInvoker, type index_d$1_HubInput as HubInput, type index_d$1_HubProposal as HubProposal, index_d$1_HubProposer as HubProposer, type index_d$1_HubProposerOptions as HubProposerOptions, type index_d$1_InjectedInvoker as InjectedInvoker, index_d$1_InjectedLLMJudge as InjectedLLMJudge, type index_d$1_InsightInput as InsightInput, type index_d$1_InsightProposal as InsightProposal, index_d$1_InsightProposer as InsightProposer, type index_d$1_InsightProposerOptions as InsightProposerOptions, type index_d$1_LLMJudge as LLMJudge, index_d$1_LLMJudgeError as LLMJudgeError, type index_d$1_Proposal as Proposal, type index_d$1_ProposalAction as ProposalAction, type index_d$1_ProposalKind as ProposalKind, type index_d$1_Proposer as Proposer, type index_d$1_ProposerContext as ProposerContext, type index_d$1_RecallFn as RecallFn, type index_d$1_RecallSuggestion as RecallSuggestion, type index_d$1_TopicTreeSnapshot as TopicTreeSnapshot, index_d$1_TurnBuffer as TurnBuffer, type index_d$1_TurnRecord as TurnRecord, type index_d$1_WriteDocResult as WriteDocResult, index_d$1_computeFingerprint as computeFingerprint, index_d$1_deriveQueryFromTurns as deriveQueryFromTurns, index_d$1_frameForJudge as frameForJudge, index_d$1_loadDeclinedFingerprints as loadDeclinedFingerprints, index_d$1_parseJudgeResponse as parseJudgeResponse, index_d$1_recordAcceptance as recordAcceptance, index_d$1_recordDecline as recordDecline, index_d$1_resetDeclined as resetDeclined, index_d$1_writeDocAction as writeDocAction };
|
|
2256
2453
|
}
|
|
2257
2454
|
|
|
2258
2455
|
/**
|
|
@@ -2320,7 +2517,7 @@ declare function curateCommand(options: CurateOptions): Command<CurateResult>;
|
|
|
2320
2517
|
*
|
|
2321
2518
|
* Host integration:
|
|
2322
2519
|
* 1. Supply an embedder. `vector.createLocalEmbedder()` is the bundled
|
|
2323
|
-
* default (local
|
|
2520
|
+
* default (local multilingual e5-small, model downloads on first use); pass an
|
|
2324
2521
|
* OpenAI/Voyage adapter to use an API instead.
|
|
2325
2522
|
* 2. Pass it to `createRitualRegistry({ recall: { embed } })`. The command
|
|
2326
2523
|
* is registered only when an embedder is supplied — instances that have
|
|
@@ -2395,6 +2592,146 @@ declare function resolveRepoRoot(): string;
|
|
|
2395
2592
|
*/
|
|
2396
2593
|
declare function runVortexCli(argv: readonly string[], io?: CliIo): Promise<number>;
|
|
2397
2594
|
|
|
2595
|
+
/** The two document actions the v1 value loop supports. */
|
|
2596
|
+
type CurateActionKind = "create-file" | "append-section";
|
|
2597
|
+
/**
|
|
2598
|
+
* Serializable accepted-proposal payload — the contract between the agent and
|
|
2599
|
+
* the deterministic CLI. The agent builds it (after the user says yes); the
|
|
2600
|
+
* accept/preview path validates and acts on it. Plain data only so it can
|
|
2601
|
+
* round-trip through a CLI argument or a file.
|
|
2602
|
+
*
|
|
2603
|
+
* - `create-file`: needs `filename` (the new file's basename); `targetRelPath`
|
|
2604
|
+
* is the `data/`-relative FOLDER it goes in. `sectionHeader` is unused.
|
|
2605
|
+
* - `append-section`: `targetRelPath` is the `data/`-relative path of the
|
|
2606
|
+
* EXISTING file; `sectionHeader` is the `## ` heading to add. `filename`
|
|
2607
|
+
* is unused.
|
|
2608
|
+
*
|
|
2609
|
+
* `fingerprint` is the COARSE decline key (see {@link computeCurateFingerprint})
|
|
2610
|
+
* — the agent may omit it (the CLI recomputes), but if present it must match.
|
|
2611
|
+
*/
|
|
2612
|
+
interface CuratePayload {
|
|
2613
|
+
readonly action: CurateActionKind;
|
|
2614
|
+
/** Short topic slug (1-3 words). Part of the coarse fingerprint. */
|
|
2615
|
+
readonly topic: string;
|
|
2616
|
+
/**
|
|
2617
|
+
* `data/`-relative path. For create-file this is the destination FOLDER; for
|
|
2618
|
+
* append-section this is the existing FILE. Part of the coarse fingerprint.
|
|
2619
|
+
*/
|
|
2620
|
+
readonly targetRelPath: string;
|
|
2621
|
+
/** create-file only: basename of the file to create (e.g. `notes.md`). */
|
|
2622
|
+
readonly filename?: string;
|
|
2623
|
+
/** append-section only: section heading without the leading `## `. */
|
|
2624
|
+
readonly sectionHeader?: string;
|
|
2625
|
+
/** Document body to write (create-file) or section body (append-section). */
|
|
2626
|
+
readonly body: string;
|
|
2627
|
+
/** Optional coarse fingerprint; recomputed + checked if present. */
|
|
2628
|
+
readonly fingerprint?: string;
|
|
2629
|
+
}
|
|
2630
|
+
interface CuratePayloadValidation {
|
|
2631
|
+
readonly ok: boolean;
|
|
2632
|
+
readonly errors: readonly string[];
|
|
2633
|
+
/** The concrete `data/`-relative file path the action would touch. */
|
|
2634
|
+
readonly effectiveRelPath?: string;
|
|
2635
|
+
/** The recomputed coarse fingerprint. */
|
|
2636
|
+
readonly fingerprint?: string;
|
|
2637
|
+
}
|
|
2638
|
+
/**
|
|
2639
|
+
* Coarse decline fingerprint — `sha256(topic + "\n" + actionKind + "\n" +
|
|
2640
|
+
* targetRelPath)`, truncated to 16 hex chars. INTENTIONALLY coarse: it does
|
|
2641
|
+
* NOT include the body or the section header, so a re-proposal of the same
|
|
2642
|
+
* topic+action+target is recognized as the same proposal even if the wording
|
|
2643
|
+
* changed. Used identically by accept-record, decline, and the
|
|
2644
|
+
* previously-declined check, so a decline actually suppresses re-proposals.
|
|
2645
|
+
*
|
|
2646
|
+
* `targetRelPath` is normalized to forward slashes so work/home machines agree.
|
|
2647
|
+
*/
|
|
2648
|
+
declare function computeCurateFingerprint(topic: string, actionKind: CurateActionKind, targetRelPath: string): string;
|
|
2649
|
+
/**
|
|
2650
|
+
* Validate a payload at the CLI boundary (shape + light path sanity). Deeper
|
|
2651
|
+
* path safety (traversal/absolute/drive) is enforced authoritatively by
|
|
2652
|
+
* {@link writeDocAction} → `validateDataRelativePath` at write time; this layer
|
|
2653
|
+
* gives the agent a clear, early, write-nothing report and computes the coarse
|
|
2654
|
+
* fingerprint + effective file path.
|
|
2655
|
+
*/
|
|
2656
|
+
declare function validateCuratePayload(payload: CuratePayload): CuratePayloadValidation;
|
|
2657
|
+
interface CurateCandidate {
|
|
2658
|
+
/** `data/`-relative path of an existing document. */
|
|
2659
|
+
readonly relpath: string;
|
|
2660
|
+
/** Frontmatter `topic`, case-folded (lowercased) for matching; or null. */
|
|
2661
|
+
readonly topic: string | null;
|
|
2662
|
+
/** Frontmatter `tags`, case-folded. */
|
|
2663
|
+
readonly tags: readonly string[];
|
|
2664
|
+
}
|
|
2665
|
+
interface CurateCandidatesResult {
|
|
2666
|
+
readonly subcommand: "curate-candidates";
|
|
2667
|
+
readonly status: "ok";
|
|
2668
|
+
readonly candidates: readonly CurateCandidate[];
|
|
2669
|
+
/** True when the scan was capped by `maxEntries`. */
|
|
2670
|
+
readonly truncated: boolean;
|
|
2671
|
+
readonly nextActions: readonly string[];
|
|
2672
|
+
}
|
|
2673
|
+
interface CuratePreviewResult {
|
|
2674
|
+
readonly subcommand: "curate-preview";
|
|
2675
|
+
readonly status: "ok" | "invalid";
|
|
2676
|
+
readonly action?: CurateActionKind;
|
|
2677
|
+
readonly effectiveRelPath?: string;
|
|
2678
|
+
readonly fingerprint?: string;
|
|
2679
|
+
/** What would happen if accepted, in plain words. */
|
|
2680
|
+
readonly wouldDo?: string;
|
|
2681
|
+
/** True when this exact proposal was previously declined and not expired. */
|
|
2682
|
+
readonly previouslyDeclined: boolean;
|
|
2683
|
+
/** create-file: does the target already exist (accept would refuse)? */
|
|
2684
|
+
readonly targetExists?: boolean;
|
|
2685
|
+
readonly errors: readonly string[];
|
|
2686
|
+
readonly nextActions: readonly string[];
|
|
2687
|
+
}
|
|
2688
|
+
interface CurateAcceptResult {
|
|
2689
|
+
readonly subcommand: "curate-accept";
|
|
2690
|
+
readonly status: "written" | "refused" | "invalid";
|
|
2691
|
+
readonly action?: CurateActionKind;
|
|
2692
|
+
readonly writtenPath?: string;
|
|
2693
|
+
readonly fingerprint?: string;
|
|
2694
|
+
readonly errors: readonly string[];
|
|
2695
|
+
readonly nextActions: readonly string[];
|
|
2696
|
+
}
|
|
2697
|
+
interface CurateDeclineResult {
|
|
2698
|
+
readonly subcommand: "curate-decline";
|
|
2699
|
+
readonly status: "recorded" | "invalid";
|
|
2700
|
+
readonly fingerprint?: string;
|
|
2701
|
+
readonly errors: readonly string[];
|
|
2702
|
+
readonly nextActions: readonly string[];
|
|
2703
|
+
}
|
|
2704
|
+
/**
|
|
2705
|
+
* List existing user documents under `data/` the agent can choose to append
|
|
2706
|
+
* to (vs creating a new file). Walks `data/`, skipping reserved system/meta
|
|
2707
|
+
* directories and non-document files. Returns relpath + case-folded
|
|
2708
|
+
* frontmatter topic + tags so the agent can match the current work's topic to
|
|
2709
|
+
* an existing home without an LLM call.
|
|
2710
|
+
*/
|
|
2711
|
+
declare function runCurateCandidates(repoRoot: string, options?: {
|
|
2712
|
+
readonly maxEntries?: number;
|
|
2713
|
+
}): Promise<CurateCandidatesResult>;
|
|
2714
|
+
/**
|
|
2715
|
+
* Validate a payload and report what WOULD happen — writes nothing. Reports
|
|
2716
|
+
* the previously-declined state (coarse fingerprint, un-expired) so the agent
|
|
2717
|
+
* can suppress a re-proposal, and whether a create-file target already exists
|
|
2718
|
+
* (accept would refuse to overwrite).
|
|
2719
|
+
*/
|
|
2720
|
+
declare function runCuratePreview(repoRoot: string, payload: CuratePayload, now?: Date): Promise<CuratePreviewResult>;
|
|
2721
|
+
/**
|
|
2722
|
+
* Write an accepted proposal through the hardened shared gate, then record the
|
|
2723
|
+
* acceptance in the decline-store audit trail. Requires a valid payload — the
|
|
2724
|
+
* write path is never reachable without an explicit accepted-proposal payload.
|
|
2725
|
+
*/
|
|
2726
|
+
declare function runCurateAccept(repoRoot: string, payload: CuratePayload, now?: Date): Promise<CurateAcceptResult>;
|
|
2727
|
+
/**
|
|
2728
|
+
* Record a decline against the COARSE fingerprint so the same topic+action+
|
|
2729
|
+
* target is suppressed for the expiry window (30 days via decline-store). Body
|
|
2730
|
+
* and sectionHeader are not part of the fingerprint, so a re-worded proposal
|
|
2731
|
+
* of the same capture stays suppressed.
|
|
2732
|
+
*/
|
|
2733
|
+
declare function runCurateDecline(repoRoot: string, payload: CuratePayload, now?: Date): Promise<CurateDeclineResult>;
|
|
2734
|
+
|
|
2398
2735
|
/**
|
|
2399
2736
|
* Bridge the `@vortex-os/memory-extended` recall engine into a
|
|
2400
2737
|
* `@vortex-os/proactive-curator` {@link AmbientRecaller} — defined in the
|
|
@@ -2471,16 +2808,44 @@ interface GitPullResult {
|
|
|
2471
2808
|
readonly conflict: boolean;
|
|
2472
2809
|
}
|
|
2473
2810
|
interface SessionStartHookReport {
|
|
2811
|
+
/** ISO timestamp (kept for any internal use). */
|
|
2474
2812
|
readonly time: string;
|
|
2813
|
+
/** Human-readable LOCAL time for display, e.g. `2026-06-03 (Wed) 15:21 KST`. */
|
|
2814
|
+
readonly localTime: string;
|
|
2475
2815
|
readonly repoRoot: string;
|
|
2476
2816
|
readonly dataDir: string;
|
|
2477
2817
|
readonly counts: Readonly<Record<string, number>>;
|
|
2478
2818
|
readonly missing: readonly string[];
|
|
2479
2819
|
readonly recentWorklog: RecentWorklog | null;
|
|
2820
|
+
/**
|
|
2821
|
+
* Up to 3 short "next up" lines lifted from the MOST RECENT worklog's
|
|
2822
|
+
* hand-off section (else its unchecked tasks), each capped — the
|
|
2823
|
+
* "what you were about to do" pointer. Honest-empty when nothing is captured.
|
|
2824
|
+
*/
|
|
2825
|
+
readonly nextUp: readonly string[];
|
|
2480
2826
|
/** Worklog dates (`YYYY-MM-DD`) present within the gap window — for backfill detection. */
|
|
2481
2827
|
readonly recentWorklogDates: readonly string[];
|
|
2482
2828
|
/** Resolved environment label (e.g. home/work), or null when none is configured. */
|
|
2483
2829
|
readonly environment: string | null;
|
|
2830
|
+
/**
|
|
2831
|
+
* The always-on tier: `_memory/` memories marked `scope: always`, **with
|
|
2832
|
+
* their bodies**, so session start actually loads them (not just names them)
|
|
2833
|
+
* — see AI-RULES.md → "data/ layout" → memory loading. Capped for size; the
|
|
2834
|
+
* on-demand rest stays in `_INDEX.md`. Each body is trimmed (and truncated
|
|
2835
|
+
* past a per-rule cap, flagged by `truncated`).
|
|
2836
|
+
*/
|
|
2837
|
+
readonly alwaysOnRules: readonly {
|
|
2838
|
+
readonly slug: string;
|
|
2839
|
+
readonly body: string;
|
|
2840
|
+
readonly truncated: boolean;
|
|
2841
|
+
}[];
|
|
2842
|
+
/** Always-on memories dropped because the count exceeded the cap (0 = none). */
|
|
2843
|
+
readonly alwaysOnOverflow: number;
|
|
2844
|
+
/**
|
|
2845
|
+
* The on-demand index looks stale — suggest `reindex`. True when memories
|
|
2846
|
+
* exist but `_INDEX.md` is missing, or a `_memory/*.md` is newer than it.
|
|
2847
|
+
*/
|
|
2848
|
+
readonly memoryIndexStale: boolean;
|
|
2484
2849
|
}
|
|
2485
2850
|
/**
|
|
2486
2851
|
* Gather the read-only facts for a start-of-session report: data-dir counts,
|
|
@@ -2501,7 +2866,7 @@ declare function detectWorklogGaps(commitDays: readonly string[], presentDates:
|
|
|
2501
2866
|
/**
|
|
2502
2867
|
* Render a session-start report as a compact markdown block for a host hook
|
|
2503
2868
|
* to inject as session context. A pull conflict and any worklog gaps are
|
|
2504
|
-
* surfaced as warnings (the agent acts on the gaps — see
|
|
2869
|
+
* surfaced as warnings (the agent acts on the gaps — see AI-RULES.md).
|
|
2505
2870
|
*/
|
|
2506
2871
|
declare function renderSessionStartReport(report: SessionStartHookReport, extras?: {
|
|
2507
2872
|
readonly git?: GitPullResult | null;
|
|
@@ -2511,6 +2876,39 @@ declare function renderSessionStartReport(report: SessionStartHookReport, extras
|
|
|
2511
2876
|
readonly indexedPulled: number;
|
|
2512
2877
|
readonly errors: number;
|
|
2513
2878
|
};
|
|
2879
|
+
readonly vectorized?: {
|
|
2880
|
+
readonly memories: number;
|
|
2881
|
+
readonly sessionChunks: number;
|
|
2882
|
+
};
|
|
2883
|
+
/**
|
|
2884
|
+
* A first-time recall setup (model download + index build) was just started
|
|
2885
|
+
* in the background (the add-on is installed but the index didn't exist yet).
|
|
2886
|
+
*/
|
|
2887
|
+
readonly vectorizeSetup?: boolean;
|
|
2888
|
+
/**
|
|
2889
|
+
* Update lifecycle "signal 1" (local, no network): framework templates that
|
|
2890
|
+
* the installed package has but this instance hasn't applied yet. `pending`
|
|
2891
|
+
* = files that would be cleanly refreshed; `conflicts` = files the user
|
|
2892
|
+
* edited (an update would offer those as `<file>.new`).
|
|
2893
|
+
*/
|
|
2894
|
+
readonly templateUpdate?: {
|
|
2895
|
+
readonly pending: number;
|
|
2896
|
+
readonly conflicts: number;
|
|
2897
|
+
readonly toVersion?: string;
|
|
2898
|
+
};
|
|
2899
|
+
/**
|
|
2900
|
+
* Update lifecycle "signal 2" (network): a newer `@vortex-os/base` is
|
|
2901
|
+
* published than the one installed. Shown only when `newer` is true; the
|
|
2902
|
+
* agent then asks before running `command` (nothing installs automatically).
|
|
2903
|
+
*/
|
|
2904
|
+
readonly updateCheck?: {
|
|
2905
|
+
readonly package: string;
|
|
2906
|
+
readonly installed: string | null;
|
|
2907
|
+
readonly latest: string | null;
|
|
2908
|
+
readonly newer: boolean;
|
|
2909
|
+
readonly command: string | null;
|
|
2910
|
+
readonly registry: string;
|
|
2911
|
+
};
|
|
2514
2912
|
}): string;
|
|
2515
2913
|
|
|
2516
2914
|
/**
|
|
@@ -2544,7 +2942,10 @@ declare function ensureWorklogEntry(ctx: ModuleContext, opts?: {
|
|
|
2544
2942
|
*
|
|
2545
2943
|
* Two sources, one pass:
|
|
2546
2944
|
* - **local (a)** — this machine's own transcripts that are not archived yet,
|
|
2547
|
-
* read from
|
|
2945
|
+
* read from every detected agent host's transcript store (Claude Code,
|
|
2946
|
+
* Codex, Gemini) and scoped to the current project. Because all hosts are
|
|
2947
|
+
* swept on every start, a single Claude Code session-start also folds in the
|
|
2948
|
+
* Codex/Gemini sessions you ran in the same project, into one archive.
|
|
2548
2949
|
* - **pulled (b)** — transcripts created on another machine that arrived as
|
|
2549
2950
|
* normalized text via git sync. Their text is present but this machine's
|
|
2550
2951
|
* DB (local, derived, gitignored) has never indexed them.
|
|
@@ -2566,9 +2967,12 @@ interface CatchUpOptions {
|
|
|
2566
2967
|
/** Restrict local ingest to one project's transcripts. Default: `ctx.repoRoot`. */
|
|
2567
2968
|
readonly cwd?: string;
|
|
2568
2969
|
/**
|
|
2569
|
-
* Transcript adapters for local ingest. Default: Claude Code
|
|
2570
|
-
*
|
|
2571
|
-
*
|
|
2970
|
+
* Transcript adapters for local ingest. Default: all CLI hosts — Claude Code,
|
|
2971
|
+
* Codex, and Gemini. Each adapter's `detect()` returns false when its host is
|
|
2972
|
+
* absent, so registering all three is ~free on a machine that only uses one.
|
|
2973
|
+
* (Claude Desktop is opt-in — it needs the `classic-level` dependency — so it
|
|
2974
|
+
* is not in the default set; a caller can add it.) Tests inject fakes (or a
|
|
2975
|
+
* sandbox `env.home`) so the scan never touches the real home directory.
|
|
2572
2976
|
*/
|
|
2573
2977
|
readonly adapters?: sessionArchive.IngestParams["adapters"];
|
|
2574
2978
|
/** Adapter environment override (e.g. a sandbox HOME). Tests use this. */
|
|
@@ -2708,8 +3112,8 @@ interface AgendaReport {
|
|
|
2708
3112
|
} | null;
|
|
2709
3113
|
/**
|
|
2710
3114
|
* "Next up" lines lifted from the most recent worklog's hand-off section
|
|
2711
|
-
* (`##
|
|
2712
|
-
*
|
|
3115
|
+
* (`## Next` / a `📋`-marked heading) — the planned-work pointer, mirroring
|
|
3116
|
+
* a worklog hand-off block. Empty if none.
|
|
2713
3117
|
*/
|
|
2714
3118
|
readonly nextUp: readonly string[];
|
|
2715
3119
|
/** Date of the worklog the nextUp lines came from (or null). */
|
|
@@ -2739,11 +3143,12 @@ interface CollectAgendaOptions {
|
|
|
2739
3143
|
*/
|
|
2740
3144
|
/**
|
|
2741
3145
|
* Lift the "next up / hand-off" section from a worklog body — the planned-work
|
|
2742
|
-
* pointer the agent leaves at wind-down (mirrors
|
|
2743
|
-
*
|
|
2744
|
-
*
|
|
2745
|
-
* content lines (bullets de-marked, blanks dropped),
|
|
2746
|
-
* section. Stops at the next heading of the
|
|
3146
|
+
* pointer the agent leaves at wind-down (mirrors a worklog hand-off block).
|
|
3147
|
+
* Matches a heading whose text contains any of the cue terms (English and
|
|
3148
|
+
* Korean: "next", "next up", "todo", "다음 작업", "다음 세션", "후속", "📋").
|
|
3149
|
+
* Returns the section's content lines (bullets de-marked, blanks dropped),
|
|
3150
|
+
* capped. Empty if no such section. Stops at the next heading of the
|
|
3151
|
+
* same-or-higher level.
|
|
2747
3152
|
*/
|
|
2748
3153
|
declare function extractNextUp(body: string, max?: number): string[];
|
|
2749
3154
|
/**
|
|
@@ -2775,6 +3180,154 @@ declare function renderAgenda(report: AgendaReport): string;
|
|
|
2775
3180
|
*/
|
|
2776
3181
|
declare const agendaCommand: Command<AgendaReport>;
|
|
2777
3182
|
|
|
3183
|
+
/** Schema tag for the ownership manifest; bump on a breaking shape change. */
|
|
3184
|
+
declare const OWNERSHIP_SCHEMA = "vortex-ownership/1";
|
|
3185
|
+
/** A single framework-owned file the instance tracks for updates. */
|
|
3186
|
+
interface OwnershipEntry {
|
|
3187
|
+
/** Stable id across path moves — currently the template-relative path. */
|
|
3188
|
+
readonly templateId: string;
|
|
3189
|
+
/** Instance destination, repoRoot-relative, forward-slashed (portable). */
|
|
3190
|
+
readonly path: string;
|
|
3191
|
+
/** sha256 of the shipped template when this entry was last reconciled. */
|
|
3192
|
+
readonly sourceSha256: string;
|
|
3193
|
+
/**
|
|
3194
|
+
* When the on-disk file equals the current template, this holds that hash
|
|
3195
|
+
* (the copy is pristine — safe to refresh, since identical content has
|
|
3196
|
+
* nothing to lose, and the first time the user edits it the hash diverges
|
|
3197
|
+
* and it becomes a conflict instead). `null` means the on-disk file diverges
|
|
3198
|
+
* from the template — a foreign / user-owned file we never auto-replace.
|
|
3199
|
+
*/
|
|
3200
|
+
readonly installedSha256: string | null;
|
|
3201
|
+
}
|
|
3202
|
+
interface OwnershipManifest {
|
|
3203
|
+
readonly schema: string;
|
|
3204
|
+
/** The `@vortex-os/base` version whose template index this reconciles to. */
|
|
3205
|
+
readonly baseVersion: string;
|
|
3206
|
+
/** ISO timestamp the manifest was written. */
|
|
3207
|
+
readonly generatedAt: string;
|
|
3208
|
+
readonly files: readonly OwnershipEntry[];
|
|
3209
|
+
}
|
|
3210
|
+
type UpdateFileActionKind = "replace" | "restore" | "install" | "conflict" | "locally-modified" | "unmanaged" | "removed-upstream" | "unchanged";
|
|
3211
|
+
interface UpdateFileAction {
|
|
3212
|
+
readonly path: string;
|
|
3213
|
+
readonly templateId: string;
|
|
3214
|
+
readonly action: UpdateFileActionKind;
|
|
3215
|
+
readonly detail?: string;
|
|
3216
|
+
/** For `replace` (or a backed-up `.new`): where the prior bytes were saved. */
|
|
3217
|
+
readonly backupPath?: string;
|
|
3218
|
+
/** For `conflict`: the `<file>.new` carrying the new template content. */
|
|
3219
|
+
readonly newFilePath?: string;
|
|
3220
|
+
/** Set when applying this file threw — the file was NOT changed destructively. */
|
|
3221
|
+
readonly error?: string;
|
|
3222
|
+
}
|
|
3223
|
+
interface VortexUpdateResult {
|
|
3224
|
+
readonly subcommand: "update";
|
|
3225
|
+
readonly status: "ok" | "updated" | "conflicts" | "dry-run" | "no-manifest" | "no-templates";
|
|
3226
|
+
readonly mode: "templates-only";
|
|
3227
|
+
readonly dryRun: boolean;
|
|
3228
|
+
/** Instance's recorded base version before the update (manifest baseVersion). */
|
|
3229
|
+
readonly fromVersion?: string;
|
|
3230
|
+
/** Shipped template index's base version (what we reconcile to). */
|
|
3231
|
+
readonly toVersion?: string;
|
|
3232
|
+
readonly actions: readonly UpdateFileAction[];
|
|
3233
|
+
readonly summary: {
|
|
3234
|
+
readonly replaced: number;
|
|
3235
|
+
readonly restored: number;
|
|
3236
|
+
readonly installed: number;
|
|
3237
|
+
readonly conflicts: number;
|
|
3238
|
+
readonly unchanged: number;
|
|
3239
|
+
readonly unmanaged: number;
|
|
3240
|
+
readonly locallyModified: number;
|
|
3241
|
+
readonly removedUpstream: number;
|
|
3242
|
+
/** Files whose apply threw (left unchanged) — surfaces a partial run. */
|
|
3243
|
+
readonly errors: number;
|
|
3244
|
+
};
|
|
3245
|
+
readonly nextActions: readonly string[];
|
|
3246
|
+
}
|
|
3247
|
+
/** Absolute path of the instance ownership manifest. */
|
|
3248
|
+
declare function ownershipManifestPath(ctx: ModuleContext): string;
|
|
3249
|
+
/**
|
|
3250
|
+
* Map a template-relative path (as listed in the template index, e.g.
|
|
3251
|
+
* `routers/AGENTS.md`) to the instance destination, repoRoot-relative. The
|
|
3252
|
+
* SINGLE place that knows the init copy layout — `init` (manifest writer) and
|
|
3253
|
+
* `update` both derive destinations here, so they can never drift apart.
|
|
3254
|
+
*
|
|
3255
|
+
* Returns `null` for paths that are not copied into an instance (the index file
|
|
3256
|
+
* itself, or any unrecognized top-level dir) — those are not framework-owned
|
|
3257
|
+
* instance files and are skipped.
|
|
3258
|
+
*/
|
|
3259
|
+
declare function templateDestRelPath(templateRelPath: string): string | null;
|
|
3260
|
+
/**
|
|
3261
|
+
* Reconcile the shipped template index against what is currently on disk and
|
|
3262
|
+
* produce an ownership manifest. For each framework-owned file:
|
|
3263
|
+
* - `sourceSha256` is the hash of the actual shipped template file (computed
|
|
3264
|
+
* fresh, not trusted from the index — robust to a stale index);
|
|
3265
|
+
* - `installedSha256` is `sourceSha256` when the on-disk copy matches the
|
|
3266
|
+
* template (pristine — whether `init` wrote it or the user already had the
|
|
3267
|
+
* identical stock content; either way there is nothing to lose), and `null`
|
|
3268
|
+
* when the slot is missing or holds a divergent foreign file.
|
|
3269
|
+
*
|
|
3270
|
+
* Used by `init` to write the manifest from day one. Pure read — never writes.
|
|
3271
|
+
*/
|
|
3272
|
+
declare function buildOwnershipManifest(ctx: ModuleContext, templatesDir: string): Promise<OwnershipManifest | null>;
|
|
3273
|
+
/**
|
|
3274
|
+
* Build and atomically write the ownership manifest for this instance. Called
|
|
3275
|
+
* by `vortex init` (best-effort — a failure never blocks init). Returns the
|
|
3276
|
+
* written path and file count, or `null` when there is no template index to
|
|
3277
|
+
* reconcile against (a dev tree without a built `templates/manifest.json`).
|
|
3278
|
+
*/
|
|
3279
|
+
declare function writeOwnershipManifest(ctx: ModuleContext, templatesDir: string | null): Promise<{
|
|
3280
|
+
path: string;
|
|
3281
|
+
fileCount: number;
|
|
3282
|
+
} | null>;
|
|
3283
|
+
/** Read-only health snapshot of the ownership manifest vs what's on disk. */
|
|
3284
|
+
interface OwnershipDiagnosis {
|
|
3285
|
+
/** Whether an ownership manifest exists and parsed. */
|
|
3286
|
+
readonly present: boolean;
|
|
3287
|
+
/** The manifest file exists on disk but could not be parsed/validated. */
|
|
3288
|
+
readonly malformed: boolean;
|
|
3289
|
+
readonly total: number;
|
|
3290
|
+
/** Tracked file on disk still equals the recorded copy (safe to refresh). */
|
|
3291
|
+
readonly pristine: number;
|
|
3292
|
+
/** Tracked file on disk diverges from the recorded copy (user edited it). */
|
|
3293
|
+
readonly modified: number;
|
|
3294
|
+
/** Tracked file is gone from disk (an update would restore it). */
|
|
3295
|
+
readonly missing: number;
|
|
3296
|
+
/** Slot recorded as foreign (installedSha256 === null) — never auto-managed. */
|
|
3297
|
+
readonly unmanaged: number;
|
|
3298
|
+
}
|
|
3299
|
+
/**
|
|
3300
|
+
* Inspect the ownership manifest against the current instance files — a pure
|
|
3301
|
+
* read used by `vortex doctor` to report whether the instance's framework
|
|
3302
|
+
* files are stock, user-edited, missing, or foreign. No template index needed
|
|
3303
|
+
* (it compares disk to the recorded `installedSha256`, not to a new template).
|
|
3304
|
+
*/
|
|
3305
|
+
declare function inspectOwnership(ctx: ModuleContext): Promise<OwnershipDiagnosis>;
|
|
3306
|
+
/**
|
|
3307
|
+
* Adopt / repair the ownership manifest for an instance that lacks one (e.g.
|
|
3308
|
+
* created before the update lifecycle existed). Conservative by design: it does
|
|
3309
|
+
* NOTHING when a manifest already exists — rewriting could downgrade a tracked-
|
|
3310
|
+
* but-edited file to "foreign" and lose its update path — so a healthy instance
|
|
3311
|
+
* is never disturbed. Only a missing/unreadable manifest is (re)built from the
|
|
3312
|
+
* current on-disk state (diverged files recorded as foreign/null, never falsely
|
|
3313
|
+
* claimed pristine). `vortex update --templates-only` is the way to refresh once
|
|
3314
|
+
* a manifest exists.
|
|
3315
|
+
*/
|
|
3316
|
+
declare function repairOwnershipManifest(ctx: ModuleContext, templatesDir: string | null): Promise<{
|
|
3317
|
+
status: "created" | "already-present" | "unreadable" | "no-templates";
|
|
3318
|
+
path?: string;
|
|
3319
|
+
fileCount?: number;
|
|
3320
|
+
}>;
|
|
3321
|
+
/**
|
|
3322
|
+
* `vortex update --templates-only` — refresh framework-owned templates from the
|
|
3323
|
+
* currently-installed package, hash-guarded so user edits are never lost. Two
|
|
3324
|
+
* phases: PLAN (all reads — safe in dry-run) then APPLY (writes, skipped in
|
|
3325
|
+
* dry-run), with the manifest written LAST and always reflecting real disk.
|
|
3326
|
+
*/
|
|
3327
|
+
declare function runTemplatesUpdate(ctx: ModuleContext, templatesDir: string | null, options?: {
|
|
3328
|
+
dryRun?: boolean;
|
|
3329
|
+
}): Promise<VortexUpdateResult>;
|
|
3330
|
+
|
|
2778
3331
|
/**
|
|
2779
3332
|
* `/vortex <sub>` — Root command for VortEX instance operations.
|
|
2780
3333
|
*
|
|
@@ -2878,8 +3431,13 @@ interface VortexImportResult {
|
|
|
2878
3431
|
};
|
|
2879
3432
|
readonly frontmatterInjected: number;
|
|
2880
3433
|
readonly frontmatterPreserved: number;
|
|
3434
|
+
readonly attachmentsCopied: number;
|
|
3435
|
+
readonly skippedSecrets: readonly string[];
|
|
3436
|
+
readonly skippedLarge: readonly string[];
|
|
2881
3437
|
readonly systemDirsCreated: readonly string[];
|
|
2882
3438
|
readonly skipped: number;
|
|
3439
|
+
readonly collisions: number;
|
|
3440
|
+
readonly collidedFiles: readonly string[];
|
|
2883
3441
|
readonly links?: {
|
|
2884
3442
|
readonly filesScanned: number;
|
|
2885
3443
|
readonly total: number;
|
|
@@ -2930,9 +3488,73 @@ interface VortexSyncResult {
|
|
|
2930
3488
|
readonly failedAt?: VortexSyncStepId;
|
|
2931
3489
|
readonly nextActions: readonly string[];
|
|
2932
3490
|
}
|
|
2933
|
-
type VortexResult = VortexInitResult | VortexStatusResult | VortexImportResult | VortexDoctorResult | VortexSyncResult | VortexPlannedResult | VortexHelpResult;
|
|
3491
|
+
type VortexResult = VortexInitResult | VortexStatusResult | VortexImportResult | VortexDoctorResult | VortexSyncResult | VortexUpdateResult | VortexPlannedResult | VortexHelpResult;
|
|
2934
3492
|
declare const vortexCommand: Command<VortexResult>;
|
|
2935
3493
|
|
|
3494
|
+
interface UpdateCheckResult {
|
|
3495
|
+
readonly package: string;
|
|
3496
|
+
/** Installed base version (from the shipped template index), or null if unknown. */
|
|
3497
|
+
readonly installed: string | null;
|
|
3498
|
+
/** Latest published version, or null when the check was skipped/failed/offline. */
|
|
3499
|
+
readonly latest: string | null;
|
|
3500
|
+
/** True only when `latest` is a strictly-greater stable version than `installed`. */
|
|
3501
|
+
readonly newer: boolean;
|
|
3502
|
+
/** Exact command to apply the update — present only when `newer`. */
|
|
3503
|
+
readonly command: string | null;
|
|
3504
|
+
/** Disclosed: where the check looked (honest about the network contact). */
|
|
3505
|
+
readonly registry: string;
|
|
3506
|
+
}
|
|
3507
|
+
/**
|
|
3508
|
+
* Installed base version = the `baseVersion` recorded in the shipped template
|
|
3509
|
+
* index (`templates/manifest.json`). This is signal 1's source of truth too,
|
|
3510
|
+
* and it travels with the running binary, so it can't disagree with the version
|
|
3511
|
+
* actually executing (local or global/npx). Unreadable/invalid → null.
|
|
3512
|
+
*/
|
|
3513
|
+
declare function readInstalledBaseVersion(templatesDir?: string | null): string | null;
|
|
3514
|
+
/**
|
|
3515
|
+
* Query the registry for the latest published `@vortex-os/base` version via
|
|
3516
|
+
* `npm view`. Bounded by `NPM_TIMEOUT_MS`; any failure (offline, no npm,
|
|
3517
|
+
* timeout, non-JSON) returns null so the caller stays silent. Never throws.
|
|
3518
|
+
*/
|
|
3519
|
+
declare function queryNpmLatest(repoRoot: string): string | null;
|
|
3520
|
+
/**
|
|
3521
|
+
* Compare two versions: -1 (a<b), 0 (a==b), 1 (a>b), or null if either is
|
|
3522
|
+
* unparseable. Numeric core left-to-right; on an equal core a RELEASE outranks
|
|
3523
|
+
* a PRERELEASE of the same core. We deliberately do NOT implement full SemVer
|
|
3524
|
+
* §11 prerelease-vs-prerelease ordering — two prereleases of the same core
|
|
3525
|
+
* compare EQUAL here. That is fine because the surfacing policy
|
|
3526
|
+
* ({@link isStableUpdate}) only ever offers a STABLE `latest`, so a
|
|
3527
|
+
* prerelease→prerelease "upgrade" is never surfaced regardless; the §11
|
|
3528
|
+
* tag-ordering is the most bug-prone part, so omitting it removes risk.
|
|
3529
|
+
*/
|
|
3530
|
+
declare function compareSemver(a: string, b: string): -1 | 0 | 1 | null;
|
|
3531
|
+
/** True only when `latest` is a strictly-greater version than `installed`. Null-safe → false. */
|
|
3532
|
+
declare function isNewer(latest: string | null, installed: string | null): boolean;
|
|
3533
|
+
/**
|
|
3534
|
+
* The SURFACING policy: only offer a STABLE newer release. A prerelease
|
|
3535
|
+
* `latest` (e.g. `2.0.0-beta.1`) is never surfaced — VortEX never nudges users
|
|
3536
|
+
* onto a beta — even when its core is higher. Upgrading FROM a prerelease TO a
|
|
3537
|
+
* stable release of the same-or-higher core IS surfaced (because `latest` is
|
|
3538
|
+
* then stable). Null/unparseable → false. This is what `checkBaseUpdate` uses
|
|
3539
|
+
* to decide `newer`.
|
|
3540
|
+
*/
|
|
3541
|
+
declare function isStableUpdate(latest: string | null, installed: string | null): boolean;
|
|
3542
|
+
/**
|
|
3543
|
+
* The exact, copy-pasteable command to apply the update, detected from the
|
|
3544
|
+
* instance: package manager by lockfile, local vs global by whether base sits
|
|
3545
|
+
* in this folder's node_modules. Always chained with `npx vortex update` so the
|
|
3546
|
+
* new package's templates get applied right after the install. Pure (no
|
|
3547
|
+
* network); the string is surfaced verbatim and the CLI never runs it.
|
|
3548
|
+
*/
|
|
3549
|
+
declare function buildInstallCommand(repoRoot: string): string;
|
|
3550
|
+
/**
|
|
3551
|
+
* Run the once-per-session update check. The CALLER decides whether to call
|
|
3552
|
+
* (session start gates on `updates.check`; `vortex check-updates` forces it).
|
|
3553
|
+
* Never throws — returns a result with `latest: null` / `newer: false` when the
|
|
3554
|
+
* registry can't be reached, so the caller simply shows nothing.
|
|
3555
|
+
*/
|
|
3556
|
+
declare function checkBaseUpdate(ctx: ModuleContext): UpdateCheckResult;
|
|
3557
|
+
|
|
2936
3558
|
//# sourceMappingURL=index.d.ts.map
|
|
2937
3559
|
|
|
2938
3560
|
type index_d_AgendaReport = AgendaReport;
|
|
@@ -2942,15 +3564,27 @@ type index_d_CatchUpResult = CatchUpResult;
|
|
|
2942
3564
|
type index_d_ClaudeSettings = ClaudeSettings;
|
|
2943
3565
|
type index_d_CliIo = CliIo;
|
|
2944
3566
|
type index_d_CollectAgendaOptions = CollectAgendaOptions;
|
|
3567
|
+
type index_d_CurateAcceptResult = CurateAcceptResult;
|
|
3568
|
+
type index_d_CurateActionKind = CurateActionKind;
|
|
2945
3569
|
type index_d_CurateAnyProposal = CurateAnyProposal;
|
|
3570
|
+
type index_d_CurateCandidate = CurateCandidate;
|
|
3571
|
+
type index_d_CurateCandidatesResult = CurateCandidatesResult;
|
|
3572
|
+
type index_d_CurateDeclineResult = CurateDeclineResult;
|
|
2946
3573
|
type index_d_CurateOptions = CurateOptions;
|
|
3574
|
+
type index_d_CuratePayload = CuratePayload;
|
|
3575
|
+
type index_d_CuratePayloadValidation = CuratePayloadValidation;
|
|
3576
|
+
type index_d_CuratePreviewResult = CuratePreviewResult;
|
|
2947
3577
|
type index_d_CurateResult = CurateResult;
|
|
2948
3578
|
type index_d_EnsureHooksResult = EnsureHooksResult;
|
|
2949
3579
|
type index_d_EnsureWorklogResult = EnsureWorklogResult;
|
|
2950
3580
|
type index_d_GitPullResult = GitPullResult;
|
|
2951
3581
|
type index_d_NewDecisionResult = NewDecisionResult;
|
|
3582
|
+
declare const index_d_OWNERSHIP_SCHEMA: typeof OWNERSHIP_SCHEMA;
|
|
2952
3583
|
type index_d_OpenDecision = OpenDecision;
|
|
2953
3584
|
type index_d_OpenTask = OpenTask;
|
|
3585
|
+
type index_d_OwnershipDiagnosis = OwnershipDiagnosis;
|
|
3586
|
+
type index_d_OwnershipEntry = OwnershipEntry;
|
|
3587
|
+
type index_d_OwnershipManifest = OwnershipManifest;
|
|
2954
3588
|
type index_d_RecallOptions = RecallOptions;
|
|
2955
3589
|
type index_d_RecentWorklog = RecentWorklog;
|
|
2956
3590
|
type index_d_ReindexResult = ReindexResult;
|
|
@@ -2959,6 +3593,9 @@ declare const index_d_SESSION_END_COMMAND: typeof SESSION_END_COMMAND;
|
|
|
2959
3593
|
declare const index_d_SESSION_START_COMMAND: typeof SESSION_START_COMMAND;
|
|
2960
3594
|
type index_d_SessionStartHookReport = SessionStartHookReport;
|
|
2961
3595
|
type index_d_SessionStartReport = SessionStartReport;
|
|
3596
|
+
type index_d_UpdateCheckResult = UpdateCheckResult;
|
|
3597
|
+
type index_d_UpdateFileAction = UpdateFileAction;
|
|
3598
|
+
type index_d_UpdateFileActionKind = UpdateFileActionKind;
|
|
2962
3599
|
type index_d_VortexHelpResult = VortexHelpResult;
|
|
2963
3600
|
type index_d_VortexInitResult = VortexInitResult;
|
|
2964
3601
|
type index_d_VortexPlannedResult = VortexPlannedResult;
|
|
@@ -2967,12 +3604,18 @@ type index_d_VortexSyncResult = VortexSyncResult;
|
|
|
2967
3604
|
type index_d_VortexSyncStep = VortexSyncStep;
|
|
2968
3605
|
type index_d_VortexSyncStepId = VortexSyncStepId;
|
|
2969
3606
|
type index_d_VortexSyncStepStatus = VortexSyncStepStatus;
|
|
3607
|
+
type index_d_VortexUpdateResult = VortexUpdateResult;
|
|
2970
3608
|
type index_d_WorklogAppendResult = WorklogAppendResult;
|
|
2971
3609
|
declare const index_d_agendaCommand: typeof agendaCommand;
|
|
3610
|
+
declare const index_d_buildInstallCommand: typeof buildInstallCommand;
|
|
3611
|
+
declare const index_d_buildOwnershipManifest: typeof buildOwnershipManifest;
|
|
2972
3612
|
declare const index_d_buildRegistry: typeof buildRegistry;
|
|
2973
3613
|
declare const index_d_catchUpSessions: typeof catchUpSessions;
|
|
3614
|
+
declare const index_d_checkBaseUpdate: typeof checkBaseUpdate;
|
|
2974
3615
|
declare const index_d_collectAgenda: typeof collectAgenda;
|
|
2975
3616
|
declare const index_d_collectSessionStartReport: typeof collectSessionStartReport;
|
|
3617
|
+
declare const index_d_compareSemver: typeof compareSemver;
|
|
3618
|
+
declare const index_d_computeCurateFingerprint: typeof computeCurateFingerprint;
|
|
2976
3619
|
declare const index_d_createAmbientRecaller: typeof createAmbientRecaller;
|
|
2977
3620
|
declare const index_d_createRitualRegistry: typeof createRitualRegistry;
|
|
2978
3621
|
declare const index_d_curateCommand: typeof curateCommand;
|
|
@@ -2982,19 +3625,34 @@ declare const index_d_ensureVortexHooks: typeof ensureVortexHooks;
|
|
|
2982
3625
|
declare const index_d_ensureWorklogEntry: typeof ensureWorklogEntry;
|
|
2983
3626
|
declare const index_d_extractNextUp: typeof extractNextUp;
|
|
2984
3627
|
declare const index_d_extractOpenTasks: typeof extractOpenTasks;
|
|
3628
|
+
declare const index_d_inspectOwnership: typeof inspectOwnership;
|
|
3629
|
+
declare const index_d_isNewer: typeof isNewer;
|
|
3630
|
+
declare const index_d_isStableUpdate: typeof isStableUpdate;
|
|
2985
3631
|
declare const index_d_logCommand: typeof logCommand;
|
|
3632
|
+
declare const index_d_ownershipManifestPath: typeof ownershipManifestPath;
|
|
2986
3633
|
declare const index_d_parseSettings: typeof parseSettings;
|
|
3634
|
+
declare const index_d_queryNpmLatest: typeof queryNpmLatest;
|
|
3635
|
+
declare const index_d_readInstalledBaseVersion: typeof readInstalledBaseVersion;
|
|
2987
3636
|
declare const index_d_recallCommand: typeof recallCommand;
|
|
2988
3637
|
declare const index_d_reindexCommand: typeof reindexCommand;
|
|
2989
3638
|
declare const index_d_renderAgenda: typeof renderAgenda;
|
|
2990
3639
|
declare const index_d_renderSessionStartReport: typeof renderSessionStartReport;
|
|
3640
|
+
declare const index_d_repairOwnershipManifest: typeof repairOwnershipManifest;
|
|
2991
3641
|
declare const index_d_resolveRepoRoot: typeof resolveRepoRoot;
|
|
3642
|
+
declare const index_d_runCurateAccept: typeof runCurateAccept;
|
|
3643
|
+
declare const index_d_runCurateCandidates: typeof runCurateCandidates;
|
|
3644
|
+
declare const index_d_runCurateDecline: typeof runCurateDecline;
|
|
3645
|
+
declare const index_d_runCuratePreview: typeof runCuratePreview;
|
|
3646
|
+
declare const index_d_runTemplatesUpdate: typeof runTemplatesUpdate;
|
|
2992
3647
|
declare const index_d_runVortexCli: typeof runVortexCli;
|
|
2993
3648
|
declare const index_d_serializeSettings: typeof serializeSettings;
|
|
2994
3649
|
declare const index_d_sessionStartCommand: typeof sessionStartCommand;
|
|
3650
|
+
declare const index_d_templateDestRelPath: typeof templateDestRelPath;
|
|
3651
|
+
declare const index_d_validateCuratePayload: typeof validateCuratePayload;
|
|
2995
3652
|
declare const index_d_vortexCommand: typeof vortexCommand;
|
|
3653
|
+
declare const index_d_writeOwnershipManifest: typeof writeOwnershipManifest;
|
|
2996
3654
|
declare namespace index_d {
|
|
2997
|
-
export { type index_d_AgendaReport as AgendaReport, type index_d_AmbientRecallFactoryOptions as AmbientRecallFactoryOptions, type index_d_CatchUpOptions as CatchUpOptions, type index_d_CatchUpResult as CatchUpResult, type index_d_ClaudeSettings as ClaudeSettings, type index_d_CliIo as CliIo, type index_d_CollectAgendaOptions as CollectAgendaOptions, type index_d_CurateAnyProposal as CurateAnyProposal, type index_d_CurateOptions as CurateOptions, type index_d_CurateResult as CurateResult, type index_d_EnsureHooksResult as EnsureHooksResult, type index_d_EnsureWorklogResult as EnsureWorklogResult, type index_d_GitPullResult as GitPullResult, type index_d_NewDecisionResult as NewDecisionResult, type index_d_OpenDecision as OpenDecision, type index_d_OpenTask as OpenTask, type index_d_RecallOptions as RecallOptions, type index_d_RecentWorklog as RecentWorklog, type index_d_ReindexResult as ReindexResult, type index_d_RitualRegistryOptions as RitualRegistryOptions, index_d_SESSION_END_COMMAND as SESSION_END_COMMAND, index_d_SESSION_START_COMMAND as SESSION_START_COMMAND, type index_d_SessionStartHookReport as SessionStartHookReport, type index_d_SessionStartReport as SessionStartReport, type index_d_VortexHelpResult as VortexHelpResult, type index_d_VortexInitResult as VortexInitResult, type index_d_VortexPlannedResult as VortexPlannedResult, type index_d_VortexResult as VortexResult, type index_d_VortexSyncResult as VortexSyncResult, type index_d_VortexSyncStep as VortexSyncStep, type index_d_VortexSyncStepId as VortexSyncStepId, type index_d_VortexSyncStepStatus as VortexSyncStepStatus, type index_d_WorklogAppendResult as WorklogAppendResult, index_d_agendaCommand as agendaCommand, index_d_buildRegistry as buildRegistry, index_d_catchUpSessions as catchUpSessions, index_d_collectAgenda as collectAgenda, index_d_collectSessionStartReport as collectSessionStartReport, index_d_createAmbientRecaller as createAmbientRecaller, index_d_createRitualRegistry as createRitualRegistry, index_d_curateCommand as curateCommand, index_d_decisionCommand as decisionCommand, index_d_detectWorklogGaps as detectWorklogGaps, index_d_ensureVortexHooks as ensureVortexHooks, index_d_ensureWorklogEntry as ensureWorklogEntry, index_d_extractNextUp as extractNextUp, index_d_extractOpenTasks as extractOpenTasks, index_d_logCommand as logCommand, index_d_parseSettings as parseSettings, index_d_recallCommand as recallCommand, index_d_reindexCommand as reindexCommand, index_d_renderAgenda as renderAgenda, index_d_renderSessionStartReport as renderSessionStartReport, index_d_resolveRepoRoot as resolveRepoRoot, index_d_runVortexCli as runVortexCli, index_d_serializeSettings as serializeSettings, index_d_sessionStartCommand as sessionStartCommand, index_d_vortexCommand as vortexCommand };
|
|
3655
|
+
export { type index_d_AgendaReport as AgendaReport, type index_d_AmbientRecallFactoryOptions as AmbientRecallFactoryOptions, type index_d_CatchUpOptions as CatchUpOptions, type index_d_CatchUpResult as CatchUpResult, type index_d_ClaudeSettings as ClaudeSettings, type index_d_CliIo as CliIo, type index_d_CollectAgendaOptions as CollectAgendaOptions, type index_d_CurateAcceptResult as CurateAcceptResult, type index_d_CurateActionKind as CurateActionKind, type index_d_CurateAnyProposal as CurateAnyProposal, type index_d_CurateCandidate as CurateCandidate, type index_d_CurateCandidatesResult as CurateCandidatesResult, type index_d_CurateDeclineResult as CurateDeclineResult, type index_d_CurateOptions as CurateOptions, type index_d_CuratePayload as CuratePayload, type index_d_CuratePayloadValidation as CuratePayloadValidation, type index_d_CuratePreviewResult as CuratePreviewResult, type index_d_CurateResult as CurateResult, type index_d_EnsureHooksResult as EnsureHooksResult, type index_d_EnsureWorklogResult as EnsureWorklogResult, type index_d_GitPullResult as GitPullResult, type index_d_NewDecisionResult as NewDecisionResult, index_d_OWNERSHIP_SCHEMA as OWNERSHIP_SCHEMA, type index_d_OpenDecision as OpenDecision, type index_d_OpenTask as OpenTask, type index_d_OwnershipDiagnosis as OwnershipDiagnosis, type index_d_OwnershipEntry as OwnershipEntry, type index_d_OwnershipManifest as OwnershipManifest, type index_d_RecallOptions as RecallOptions, type index_d_RecentWorklog as RecentWorklog, type index_d_ReindexResult as ReindexResult, type index_d_RitualRegistryOptions as RitualRegistryOptions, index_d_SESSION_END_COMMAND as SESSION_END_COMMAND, index_d_SESSION_START_COMMAND as SESSION_START_COMMAND, type index_d_SessionStartHookReport as SessionStartHookReport, type index_d_SessionStartReport as SessionStartReport, type index_d_UpdateCheckResult as UpdateCheckResult, type index_d_UpdateFileAction as UpdateFileAction, type index_d_UpdateFileActionKind as UpdateFileActionKind, type index_d_VortexHelpResult as VortexHelpResult, type index_d_VortexInitResult as VortexInitResult, type index_d_VortexPlannedResult as VortexPlannedResult, type index_d_VortexResult as VortexResult, type index_d_VortexSyncResult as VortexSyncResult, type index_d_VortexSyncStep as VortexSyncStep, type index_d_VortexSyncStepId as VortexSyncStepId, type index_d_VortexSyncStepStatus as VortexSyncStepStatus, type index_d_VortexUpdateResult as VortexUpdateResult, type index_d_WorklogAppendResult as WorklogAppendResult, index_d_agendaCommand as agendaCommand, index_d_buildInstallCommand as buildInstallCommand, index_d_buildOwnershipManifest as buildOwnershipManifest, index_d_buildRegistry as buildRegistry, index_d_catchUpSessions as catchUpSessions, index_d_checkBaseUpdate as checkBaseUpdate, index_d_collectAgenda as collectAgenda, index_d_collectSessionStartReport as collectSessionStartReport, index_d_compareSemver as compareSemver, index_d_computeCurateFingerprint as computeCurateFingerprint, index_d_createAmbientRecaller as createAmbientRecaller, index_d_createRitualRegistry as createRitualRegistry, index_d_curateCommand as curateCommand, index_d_decisionCommand as decisionCommand, index_d_detectWorklogGaps as detectWorklogGaps, index_d_ensureVortexHooks as ensureVortexHooks, index_d_ensureWorklogEntry as ensureWorklogEntry, index_d_extractNextUp as extractNextUp, index_d_extractOpenTasks as extractOpenTasks, index_d_inspectOwnership as inspectOwnership, index_d_isNewer as isNewer, index_d_isStableUpdate as isStableUpdate, index_d_logCommand as logCommand, index_d_ownershipManifestPath as ownershipManifestPath, index_d_parseSettings as parseSettings, index_d_queryNpmLatest as queryNpmLatest, index_d_readInstalledBaseVersion as readInstalledBaseVersion, index_d_recallCommand as recallCommand, index_d_reindexCommand as reindexCommand, index_d_renderAgenda as renderAgenda, index_d_renderSessionStartReport as renderSessionStartReport, index_d_repairOwnershipManifest as repairOwnershipManifest, index_d_resolveRepoRoot as resolveRepoRoot, index_d_runCurateAccept as runCurateAccept, index_d_runCurateCandidates as runCurateCandidates, index_d_runCurateDecline as runCurateDecline, index_d_runCuratePreview as runCuratePreview, index_d_runTemplatesUpdate as runTemplatesUpdate, index_d_runVortexCli as runVortexCli, index_d_serializeSettings as serializeSettings, index_d_sessionStartCommand as sessionStartCommand, index_d_templateDestRelPath as templateDestRelPath, index_d_validateCuratePayload as validateCuratePayload, index_d_vortexCommand as vortexCommand, index_d_writeOwnershipManifest as writeOwnershipManifest };
|
|
2998
3656
|
}
|
|
2999
3657
|
|
|
3000
3658
|
export { index_d$9 as aiCodingPitfalls, index_d$d as core, index_d$a as dataLint, index_d$5 as decisionLog, index_d$4 as indexGenerator, index_d$2 as linkRewriter, index_d$b as memorySystem, index_d$1 as proactiveCurator, index_d$7 as reportGenerator, index_d$3 as runbooks, index_d as sessionRituals, index_d$c as slashCommands, index_d$8 as toolRules, index_d$6 as worklog };
|