@vortex-os/base 0.7.2 → 0.9.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 CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 vortex-os-project
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 vortex-os-project
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -128,7 +128,7 @@ Each internal workspace is exposed as a top-level namespace on the package:
128
128
  | `runbooks` | `@vortex-os/runbooks` | Runbook store with `last_tested`-based stale detection |
129
129
  | `linkRewriter` | `@vortex-os/link-rewriter` | Wiki-link extract / resolve / check / rewrite |
130
130
  | `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. |
131
- | `sessionRituals` | `@vortex-os/session-rituals` | Daily session-loop slash commands: `/session-start`, `/reindex`, `/decision`, `/log`, `/vortex`, `/curate`, `/recall` |
131
+ | `sessionRituals` | `@vortex-os/session-rituals` | Daily session-loop slash commands: `/session-start`, `/log`, `/handoff`, `/decision`, `/agenda`, `/reindex`, `/resume`, `/vortex`, `/curate`, `/recall` |
132
132
 
133
133
  ## Capability add-ons
134
134
 
package/bin/vortex.mjs CHANGED
@@ -1,17 +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;
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;
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  catchUpSessions
3
- } from "./chunk-7SNLVGBO.js";
3
+ } from "./chunk-3L5DLEGP.js";
4
4
  import "./chunk-PZ5AY32C.js";
5
5
  export {
6
6
  catchUpSessions
7
7
  };
8
- //# sourceMappingURL=catch-up-KIHTAUPX.js.map
8
+ //# sourceMappingURL=catch-up-GDDKPZHJ.js.map
@@ -26,4 +26,4 @@ async function catchUpSessions(ctx, opts) {
26
26
  export {
27
27
  catchUpSessions
28
28
  };
29
- //# sourceMappingURL=chunk-7SNLVGBO.js.map
29
+ //# sourceMappingURL=chunk-3L5DLEGP.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 every detected agent host's transcript store (Claude Code,\n * Codex, Gemini) and scoped to the current project. Because all hosts are\n * swept on every start, a single Claude Code session-start also folds in the\n * Codex/Gemini sessions you ran in the same project, into one archive.\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: all CLI hosts — Claude Code,\n * Codex, and Gemini. Each adapter's `detect()` returns false when its host is\n * absent, so registering all three is ~free on a machine that only uses one.\n * (Claude Desktop is opt-in — it needs the `classic-level` dependency — so it\n * is not in the default set; a caller can add it.) Tests inject fakes (or a\n * sandbox `env.home`) so the 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 ?? [\n sessionArchive.claudeCodeAdapter,\n sessionArchive.codexAdapter,\n sessionArchive.geminiAdapter,\n ];\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":";AAmDA,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;IACjC,eAAe;IACf,eAAe;IACf,eAAe;;AAMjB,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":[]}
package/dist/index.d.ts CHANGED
@@ -146,6 +146,20 @@ interface AutoRecordConfig {
146
146
  * wait for you to merge.
147
147
  */
148
148
  readonly commitFrameworkChanges: boolean;
149
+ /**
150
+ * Use the dedicated session hand-off store (`data/_handoff/`) — a forward-
151
+ * looking baton kept separate from the worklog. On by default. When off,
152
+ * hand-offs fall back to the legacy `## 다음 작업` worklog section and no
153
+ * auto-archiving runs.
154
+ */
155
+ readonly handoff: boolean;
156
+ /**
157
+ * Days a hand-off stays "active" before session start sweeps it to
158
+ * `_handoff/_archive/` (deterministic, age-based — git keeps the history).
159
+ * Default 7 (covers a week-long absence); set lower to tidy faster, higher to
160
+ * keep more around. A non-positive / malformed value falls back to the default.
161
+ */
162
+ readonly handoffRetentionDays: number;
149
163
  }
150
164
  /**
151
165
  * One environment label plus the signal that selects it. Rules are evaluated
@@ -896,11 +910,14 @@ interface WorklogFrontmatter {
896
910
  * A parsed worklog entry.
897
911
  *
898
912
  * `date` is the ISO date portion of the filename (`YYYY-MM-DD`).
913
+ * `time` is the optional `HHMM` creation-time segment (`YYYY-MM-DD_HHMM-…`);
914
+ * absent on legacy names that predate the time convention.
899
915
  * `keyword` is the trailing slug portion of the filename without `.md`.
900
916
  * `path` is the absolute path of the file on disk.
901
917
  */
902
918
  interface WorklogEntry {
903
919
  readonly date: string;
920
+ readonly time?: string;
904
921
  readonly keyword: string;
905
922
  readonly path: string;
906
923
  readonly frontmatter: WorklogFrontmatter;
@@ -929,7 +946,7 @@ declare class WorklogStore {
929
946
  /** Most recent entry by date (descending), then keyword (descending). */
930
947
  getLatest(): Promise<WorklogEntry | undefined>;
931
948
  /** Resolve the file path for a given (date, keyword), without creating it. */
932
- pathFor(date: string, keyword: string): string;
949
+ pathFor(date: string, keyword: string, time?: string): string;
933
950
  private listSubdirs;
934
951
  private entriesIn;
935
952
  }
@@ -3034,11 +3051,30 @@ interface SessionStartHookReport {
3034
3051
  readonly dataDir: string;
3035
3052
  readonly counts: Readonly<Record<string, number>>;
3036
3053
  readonly missing: readonly string[];
3054
+ /**
3055
+ * The single "most recent" worklog pointer — the representative of the latest
3056
+ * day (the full set is in {@link recentWorklogs}). Null when there are none.
3057
+ */
3037
3058
  readonly recentWorklog: RecentWorklog | null;
3038
3059
  /**
3039
- * Up to 3 short "next up" lines lifted from the MOST RECENT worklog's
3040
- * hand-off section (else its unchecked tasks), each capped the
3041
- * "what you were about to do" pointer. Honest-empty when nothing is captured.
3060
+ * EVERY worklog sharing the latest day (a day can hold several topic/session
3061
+ * worklogs). Sorted by path; `recentWorklog` is its representative. The render
3062
+ * lists them all when there is more than one, so a same-day worklog is never
3063
+ * hidden behind another (it used to surface only the lexically-greatest file).
3064
+ */
3065
+ readonly recentWorklogs: readonly RecentWorklog[];
3066
+ /**
3067
+ * Same-day worklogs beyond the read cap that were NOT opened (0 normally) —
3068
+ * so the rendered count stays honest on a pathological day. See
3069
+ * {@link recentWorklogs}.
3070
+ */
3071
+ readonly recentWorklogsOmitted: number;
3072
+ /**
3073
+ * Short "next up" lines for the "what you were about to do" pointer —
3074
+ * aggregated across ALL of the latest day's worklogs (round-robin, so each
3075
+ * contributes its top step), from each one's hand-off section (else its
3076
+ * unchecked tasks), each sanitized and capped. Honest-empty when nothing is
3077
+ * captured.
3042
3078
  */
3043
3079
  readonly nextUp: readonly string[];
3044
3080
  /** Worklog dates (`YYYY-MM-DD`) present within the gap window — for backfill detection. */
@@ -3077,6 +3113,22 @@ interface SessionStartHookReport {
3077
3113
  * exist but `_INDEX.md` is missing, or a `_memory/*.md` is newer than it.
3078
3114
  */
3079
3115
  readonly memoryIndexStale: boolean;
3116
+ /**
3117
+ * Active session hand-offs (`data/_handoff/`, newest first) — the forward-
3118
+ * looking "resume from here" batons, kept separate from the worklog. Each
3119
+ * carries a SANITIZED title and its next-step lines. Multiple are NORMAL
3120
+ * (concurrent sessions). When any exist they are the canonical resume surface
3121
+ * and the render shows them in place of the worklog-derived `nextUp`.
3122
+ */
3123
+ readonly handoffs: readonly {
3124
+ readonly date: string;
3125
+ readonly time: string;
3126
+ readonly path: string;
3127
+ readonly title: string;
3128
+ readonly nextUp: readonly string[];
3129
+ }[];
3130
+ /** Active hand-offs beyond the surfaced cap (0 = none). */
3131
+ readonly handoffsOmitted: number;
3080
3132
  }
3081
3133
  /**
3082
3134
  * Gather the read-only facts for a start-of-session report: data-dir counts,
@@ -3114,7 +3166,18 @@ declare function countUncommitted(porcelain: string, ignore?: (repoRelPosixPath:
3114
3166
  */
3115
3167
  declare function renderSessionStartReport(report: SessionStartHookReport, extras?: {
3116
3168
  readonly git?: GitPullResult | null;
3169
+ /**
3170
+ * Installed `@vortex-os/base` version (resolved locally, no network — from
3171
+ * the shipped template index). Rendered as an always-present line so the
3172
+ * running framework version is visible EVERY session, not only when an
3173
+ * update happens to be available (the 📦/⬆️ lines below appear only then).
3174
+ */
3175
+ readonly baseVersion?: string | null;
3117
3176
  readonly missingWorklogDays?: readonly string[];
3177
+ /** Hand-offs swept to `_handoff/_archive/` by the age-based prune this run. */
3178
+ readonly handoffPrune?: {
3179
+ readonly archived: number;
3180
+ };
3118
3181
  readonly catchUp?: {
3119
3182
  readonly ingestedLocal: number;
3120
3183
  readonly indexedPulled: number;
@@ -3292,6 +3355,94 @@ interface WorklogAppendResult {
3292
3355
  */
3293
3356
  declare const logCommand: Command<WorklogAppendResult>;
3294
3357
 
3358
+ interface HandoffCreateResult {
3359
+ readonly path: string;
3360
+ readonly date: string;
3361
+ readonly time: string;
3362
+ }
3363
+ /**
3364
+ * `/handoff [title]` — Create a new, empty session hand-off file under
3365
+ * `data/_handoff/` (named `YYYY-MM-DD_HHMM.md`, with a `-2` suffix only on a
3366
+ * same-minute collision) and return its path for the agent to fill in.
3367
+ *
3368
+ * Deliberately small, mirroring `/log`: the host creates the file SAFELY
3369
+ * (atomic exclusive create, so a concurrent session never clobbers another's
3370
+ * baton), and the agent writes the actual hand-off content into the returned
3371
+ * file. The hand-off is a forward-looking baton kept separate from the worklog;
3372
+ * old ones are swept to `_handoff/_archive/` automatically at session start.
3373
+ */
3374
+ declare const handoffCommand: Command<HandoffCreateResult>;
3375
+
3376
+ /**
3377
+ * Session hand-off store: `data/_handoff/`.
3378
+ *
3379
+ * A hand-off is a forward-looking baton — "where this session stopped and what
3380
+ * the next one should pick up" — kept SEPARATE from the worklog (the permanent,
3381
+ * backward-looking record). One file per session, named
3382
+ * `YYYY-MM-DD_HHMM.md` (a `-2`/`-3` suffix is added only when two sessions wrap
3383
+ * in the same minute, so a concurrent session never clobbers another's baton).
3384
+ * The file is created with an EXCLUSIVE open (`wx`) so that collision handling
3385
+ * is atomic, not an LLM ritual. Old hand-offs are swept to `_handoff/_archive/`
3386
+ * by {@link pruneHandoffs} (deterministic, age-based) — git keeps the history.
3387
+ *
3388
+ * Design rationale + the alternatives rejected (carry-forward, archive-on-
3389
+ * consume): decision-log `2026-06-07-핸드오프-세션단위-분리-자동정리`.
3390
+ */
3391
+ declare const HANDOFF_DIR = "_handoff";
3392
+ declare const HANDOFF_ARCHIVE_DIR = "_archive";
3393
+ interface HandoffWriteResult {
3394
+ readonly path: string;
3395
+ readonly name: string;
3396
+ readonly date: string;
3397
+ readonly time: string;
3398
+ }
3399
+ /**
3400
+ * Create a new, EMPTY-skeleton hand-off file and return its path for the agent
3401
+ * to fill in (mirrors `/log`: the host creates the file safely, the agent writes
3402
+ * the content). Atomic exclusive create; on a same-minute collision a numeric
3403
+ * suffix is appended so a concurrent session's file is never overwritten.
3404
+ */
3405
+ declare function createHandoffSkeleton(dataDir: string, opts?: {
3406
+ readonly now?: Date;
3407
+ readonly title?: string;
3408
+ }): Promise<HandoffWriteResult>;
3409
+ interface HandoffSummary {
3410
+ readonly date: string;
3411
+ readonly time: string;
3412
+ /** Path relative to the data dir, e.g. `_handoff/2026-06-07_1604.md`. */
3413
+ readonly relPath: string;
3414
+ /** First `# ` heading, else the filename. RAW — the caller sanitizes. */
3415
+ readonly title: string;
3416
+ /** Hand-off `## 다음 작업` lines (via {@link extractNextUp}). RAW. */
3417
+ readonly nextUp: readonly string[];
3418
+ }
3419
+ /**
3420
+ * List the ACTIVE hand-offs (everything under `_handoff/` except `_archive/`),
3421
+ * newest first. Returns up to `max` summaries with the count omitted beyond it,
3422
+ * so a busy stretch of many small hand-offs stays a bounded pointer at session
3423
+ * start. Multiple active hand-offs are NORMAL (concurrent sessions) — the caller
3424
+ * surfaces them all, not as an exceptional state.
3425
+ */
3426
+ declare function scanHandoffs(dataDir: string, opts?: {
3427
+ readonly max?: number;
3428
+ }): Promise<{
3429
+ active: HandoffSummary[];
3430
+ omitted: number;
3431
+ }>;
3432
+ /**
3433
+ * Sweep hand-offs older than `retentionDays` into `_handoff/_archive/`
3434
+ * (deterministic, age-based — NOT an LLM step, so it cannot drift). Idempotent
3435
+ * and concurrency-tolerant: a file already moved by a racing session is simply
3436
+ * skipped. Git keeps the full history, so this is a working-tree tidy, not a
3437
+ * destructive delete. Returns how many were archived.
3438
+ */
3439
+ declare function pruneHandoffs(dataDir: string, opts: {
3440
+ readonly now?: Date;
3441
+ readonly retentionDays: number;
3442
+ }): Promise<{
3443
+ archived: number;
3444
+ }>;
3445
+
3295
3446
  /**
3296
3447
  * "What should I do today?" — a read-only synthesis over existing records
3297
3448
  * (worklog + decision-log + open `- [ ]` checkboxes), the P2 work-management
@@ -3360,7 +3511,9 @@ interface CollectAgendaOptions {
3360
3511
  * Korean: "next", "next up", "todo", "다음 작업", "다음 세션", "후속", "📋").
3361
3512
  * Returns the section's content lines (bullets de-marked, blanks dropped),
3362
3513
  * capped. Empty if no such section. Stops at the next heading of the
3363
- * same-or-higher level.
3514
+ * same-or-higher level. A CHECKED checkbox (`- [x]`) under the heading is
3515
+ * completed work, not "next up", so it is skipped; an unchecked `- [ ]` and
3516
+ * plain bullets/prose are kept.
3364
3517
  */
3365
3518
  declare function extractNextUp(body: string, max?: number): string[];
3366
3519
  /**
@@ -3368,19 +3521,30 @@ declare function extractNextUp(body: string, max?: number): string[];
3368
3521
  * worklog body. Checked items (`- [x]`) are ignored. Returns the trimmed label.
3369
3522
  */
3370
3523
  declare function extractOpenTasks(body: string): string[];
3524
+ /**
3525
+ * Merge the "next up" pointers of SEVERAL worklogs (e.g. every entry sharing the
3526
+ * latest day) into one bounded, fair list — so a day with multiple topic/session
3527
+ * worklogs doesn't bury all but one hand-off (the old "pick the single
3528
+ * lexically-greatest file" bug). Per worklog the hand-off section
3529
+ * (`extractNextUp`) is preferred; with `fallbackToOpenTasks` (default on) a
3530
+ * worklog lacking a `## Next`-style heading contributes its own unchecked tasks
3531
+ * instead, so it still surfaces. The per-worklog queues are merged ROUND-ROBIN
3532
+ * (one item from each, then the seconds, …) up to `maxTotal`, so every worklog
3533
+ * gets its top step in before any gets a second. Order across worklogs follows
3534
+ * the input order — callers pass a deterministic (path-sorted) group.
3535
+ *
3536
+ * `fallbackToOpenTasks: false` is for callers (like `/agenda`) that already list
3537
+ * open tasks separately, to avoid showing the same task twice.
3538
+ */
3539
+ declare function aggregateHandoff(bodies: readonly string[], maxTotal: number, opts?: {
3540
+ readonly fallbackToOpenTasks?: boolean;
3541
+ }): string[];
3371
3542
  /**
3372
3543
  * Collect the agenda inputs. Read-only; tolerant of missing dirs (both stores
3373
3544
  * return empty rather than throwing), so a brand-new instance yields an empty —
3374
3545
  * but well-formed — report.
3375
3546
  */
3376
3547
  declare function collectAgenda(ctx: ModuleContext, opts?: CollectAgendaOptions): Promise<AgendaReport>;
3377
- /**
3378
- * Render the agenda as a compact markdown block. Branches on data state so the
3379
- * output is sensible whether the instance is brand-new, quiet, or busy:
3380
- * - brand-new (no records) → a short "getting started" nudge
3381
- * - records but nothing open → "you're clear" + last activity
3382
- * - open tasks / decisions → an actionable list
3383
- */
3384
3548
  declare function renderAgenda(report: AgendaReport): string;
3385
3549
 
3386
3550
  /**
@@ -3812,6 +3976,11 @@ type index_d_CurateResult = CurateResult;
3812
3976
  type index_d_EnsureHooksResult = EnsureHooksResult;
3813
3977
  type index_d_EnsureWorklogResult = EnsureWorklogResult;
3814
3978
  type index_d_GitPullResult = GitPullResult;
3979
+ declare const index_d_HANDOFF_ARCHIVE_DIR: typeof HANDOFF_ARCHIVE_DIR;
3980
+ declare const index_d_HANDOFF_DIR: typeof HANDOFF_DIR;
3981
+ type index_d_HandoffCreateResult = HandoffCreateResult;
3982
+ type index_d_HandoffSummary = HandoffSummary;
3983
+ type index_d_HandoffWriteResult = HandoffWriteResult;
3815
3984
  type index_d_NewDecisionResult = NewDecisionResult;
3816
3985
  declare const index_d_OWNERSHIP_SCHEMA: typeof OWNERSHIP_SCHEMA;
3817
3986
  type index_d_OpenDecision = OpenDecision;
@@ -3841,6 +4010,7 @@ type index_d_VortexSyncStepStatus = VortexSyncStepStatus;
3841
4010
  type index_d_VortexUpdateResult = VortexUpdateResult;
3842
4011
  type index_d_WorklogAppendResult = WorklogAppendResult;
3843
4012
  declare const index_d_agendaCommand: typeof agendaCommand;
4013
+ declare const index_d_aggregateHandoff: typeof aggregateHandoff;
3844
4014
  declare const index_d_applyGlobalSetup: typeof applyGlobalSetup;
3845
4015
  declare const index_d_argvToSlash: typeof argvToSlash;
3846
4016
  declare const index_d_buildInstallCommand: typeof buildInstallCommand;
@@ -3855,6 +4025,7 @@ declare const index_d_compareSemver: typeof compareSemver;
3855
4025
  declare const index_d_computeCurateFingerprint: typeof computeCurateFingerprint;
3856
4026
  declare const index_d_countUncommitted: typeof countUncommitted;
3857
4027
  declare const index_d_createAmbientRecaller: typeof createAmbientRecaller;
4028
+ declare const index_d_createHandoffSkeleton: typeof createHandoffSkeleton;
3858
4029
  declare const index_d_createRitualRegistry: typeof createRitualRegistry;
3859
4030
  declare const index_d_curateCommand: typeof curateCommand;
3860
4031
  declare const index_d_decisionCommand: typeof decisionCommand;
@@ -3868,6 +4039,7 @@ declare const index_d_globalMemoryPath: typeof globalMemoryPath;
3868
4039
  declare const index_d_globalSettingsHasHook: typeof globalSettingsHasHook;
3869
4040
  declare const index_d_globalSettingsPath: typeof globalSettingsPath;
3870
4041
  declare const index_d_globalStatePath: typeof globalStatePath;
4042
+ declare const index_d_handoffCommand: typeof handoffCommand;
3871
4043
  declare const index_d_inspectGlobalSetup: typeof inspectGlobalSetup;
3872
4044
  declare const index_d_inspectOwnership: typeof inspectOwnership;
3873
4045
  declare const index_d_isInstanceRoot: typeof isInstanceRoot;
@@ -3877,6 +4049,7 @@ declare const index_d_logCommand: typeof logCommand;
3877
4049
  declare const index_d_ownershipManifestPath: typeof ownershipManifestPath;
3878
4050
  declare const index_d_parseAdoptArgs: typeof parseAdoptArgs;
3879
4051
  declare const index_d_parseSettings: typeof parseSettings;
4052
+ declare const index_d_pruneHandoffs: typeof pruneHandoffs;
3880
4053
  declare const index_d_queryNpmLatest: typeof queryNpmLatest;
3881
4054
  declare const index_d_readGlobalInstancePointer: typeof readGlobalInstancePointer;
3882
4055
  declare const index_d_readInstalledBaseVersion: typeof readInstalledBaseVersion;
@@ -3894,6 +4067,7 @@ declare const index_d_runCurateDecline: typeof runCurateDecline;
3894
4067
  declare const index_d_runCuratePreview: typeof runCuratePreview;
3895
4068
  declare const index_d_runTemplatesUpdate: typeof runTemplatesUpdate;
3896
4069
  declare const index_d_runVortexCli: typeof runVortexCli;
4070
+ declare const index_d_scanHandoffs: typeof scanHandoffs;
3897
4071
  declare const index_d_serializeSettings: typeof serializeSettings;
3898
4072
  declare const index_d_sessionStartCommand: typeof sessionStartCommand;
3899
4073
  declare const index_d_templateDestRelPath: typeof templateDestRelPath;
@@ -3902,7 +4076,7 @@ declare const index_d_validateCuratePayload: typeof validateCuratePayload;
3902
4076
  declare const index_d_vortexCommand: typeof vortexCommand;
3903
4077
  declare const index_d_writeOwnershipManifest: typeof writeOwnershipManifest;
3904
4078
  declare namespace index_d {
3905
- 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_applyGlobalSetup as applyGlobalSetup, index_d_argvToSlash as argvToSlash, 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_collectCarryover as collectCarryover, index_d_collectSessionStartReport as collectSessionStartReport, index_d_compareSemver as compareSemver, index_d_computeCurateFingerprint as computeCurateFingerprint, index_d_countUncommitted as countUncommitted, index_d_createAmbientRecaller as createAmbientRecaller, index_d_createRitualRegistry as createRitualRegistry, index_d_curateCommand as curateCommand, index_d_decisionCommand as decisionCommand, index_d_detectInterruptedGitOp as detectInterruptedGitOp, 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_globalMemoryPath as globalMemoryPath, index_d_globalSettingsHasHook as globalSettingsHasHook, index_d_globalSettingsPath as globalSettingsPath, index_d_globalStatePath as globalStatePath, index_d_inspectGlobalSetup as inspectGlobalSetup, index_d_inspectOwnership as inspectOwnership, index_d_isInstanceRoot as isInstanceRoot, index_d_isNewer as isNewer, index_d_isStableUpdate as isStableUpdate, index_d_logCommand as logCommand, index_d_ownershipManifestPath as ownershipManifestPath, index_d_parseAdoptArgs as parseAdoptArgs, index_d_parseSettings as parseSettings, index_d_queryNpmLatest as queryNpmLatest, index_d_readGlobalInstancePointer as readGlobalInstancePointer, index_d_readInstalledBaseVersion as readInstalledBaseVersion, index_d_recallCommand as recallCommand, index_d_recordGlobalSetupDecline as recordGlobalSetupDecline, index_d_reindexCommand as reindexCommand, index_d_renderAgenda as renderAgenda, index_d_renderGlobalBlock as renderGlobalBlock, 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_upsertGlobalBlock as upsertGlobalBlock, index_d_validateCuratePayload as validateCuratePayload, index_d_vortexCommand as vortexCommand, index_d_writeOwnershipManifest as writeOwnershipManifest };
4079
+ 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, index_d_HANDOFF_ARCHIVE_DIR as HANDOFF_ARCHIVE_DIR, index_d_HANDOFF_DIR as HANDOFF_DIR, type index_d_HandoffCreateResult as HandoffCreateResult, type index_d_HandoffSummary as HandoffSummary, type index_d_HandoffWriteResult as HandoffWriteResult, 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_aggregateHandoff as aggregateHandoff, index_d_applyGlobalSetup as applyGlobalSetup, index_d_argvToSlash as argvToSlash, 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_collectCarryover as collectCarryover, index_d_collectSessionStartReport as collectSessionStartReport, index_d_compareSemver as compareSemver, index_d_computeCurateFingerprint as computeCurateFingerprint, index_d_countUncommitted as countUncommitted, index_d_createAmbientRecaller as createAmbientRecaller, index_d_createHandoffSkeleton as createHandoffSkeleton, index_d_createRitualRegistry as createRitualRegistry, index_d_curateCommand as curateCommand, index_d_decisionCommand as decisionCommand, index_d_detectInterruptedGitOp as detectInterruptedGitOp, 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_globalMemoryPath as globalMemoryPath, index_d_globalSettingsHasHook as globalSettingsHasHook, index_d_globalSettingsPath as globalSettingsPath, index_d_globalStatePath as globalStatePath, index_d_handoffCommand as handoffCommand, index_d_inspectGlobalSetup as inspectGlobalSetup, index_d_inspectOwnership as inspectOwnership, index_d_isInstanceRoot as isInstanceRoot, index_d_isNewer as isNewer, index_d_isStableUpdate as isStableUpdate, index_d_logCommand as logCommand, index_d_ownershipManifestPath as ownershipManifestPath, index_d_parseAdoptArgs as parseAdoptArgs, index_d_parseSettings as parseSettings, index_d_pruneHandoffs as pruneHandoffs, index_d_queryNpmLatest as queryNpmLatest, index_d_readGlobalInstancePointer as readGlobalInstancePointer, index_d_readInstalledBaseVersion as readInstalledBaseVersion, index_d_recallCommand as recallCommand, index_d_recordGlobalSetupDecline as recordGlobalSetupDecline, index_d_reindexCommand as reindexCommand, index_d_renderAgenda as renderAgenda, index_d_renderGlobalBlock as renderGlobalBlock, 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_scanHandoffs as scanHandoffs, index_d_serializeSettings as serializeSettings, index_d_sessionStartCommand as sessionStartCommand, index_d_templateDestRelPath as templateDestRelPath, index_d_upsertGlobalBlock as upsertGlobalBlock, index_d_validateCuratePayload as validateCuratePayload, index_d_vortexCommand as vortexCommand, index_d_writeOwnershipManifest as writeOwnershipManifest };
3906
4080
  }
3907
4081
 
3908
4082
  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 };