draken 0.3.0 → 0.4.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.
Files changed (57) hide show
  1. package/ACCEPTANCE.md +2 -2
  2. package/CHANGELOG.md +32 -0
  3. package/MEMORY.md +6 -4
  4. package/README.md +10 -6
  5. package/SETUP.md +1 -1
  6. package/VOICE.md +1 -1
  7. package/dist/memory/automatic.d.ts +11 -5
  8. package/dist/memory/automatic.d.ts.map +1 -1
  9. package/dist/memory/automatic.js +64 -20
  10. package/dist/memory/automatic.js.map +1 -1
  11. package/dist/routes/live-voice.d.ts.map +1 -1
  12. package/dist/routes/live-voice.js +7 -1
  13. package/dist/routes/live-voice.js.map +1 -1
  14. package/dist/routes/memory.d.ts.map +1 -1
  15. package/dist/routes/memory.js +12 -2
  16. package/dist/routes/memory.js.map +1 -1
  17. package/dist/routes/sync.d.ts.map +1 -1
  18. package/dist/routes/sync.js +23 -7
  19. package/dist/routes/sync.js.map +1 -1
  20. package/dist/sync/answer-references.d.ts +10 -0
  21. package/dist/sync/answer-references.d.ts.map +1 -0
  22. package/dist/sync/answer-references.js +47 -0
  23. package/dist/sync/answer-references.js.map +1 -0
  24. package/dist/sync/automatic.d.ts +7 -0
  25. package/dist/sync/automatic.d.ts.map +1 -0
  26. package/dist/sync/automatic.js +56 -0
  27. package/dist/sync/automatic.js.map +1 -0
  28. package/dist/sync/cost.d.ts +2 -1
  29. package/dist/sync/cost.d.ts.map +1 -1
  30. package/dist/sync/cost.js +10 -6
  31. package/dist/sync/cost.js.map +1 -1
  32. package/dist/sync/manager.d.ts +4 -1
  33. package/dist/sync/manager.d.ts.map +1 -1
  34. package/dist/sync/manager.js +32 -23
  35. package/dist/sync/manager.js.map +1 -1
  36. package/dist/sync/store.d.ts +8 -1
  37. package/dist/sync/store.d.ts.map +1 -1
  38. package/dist/sync/store.js +50 -4
  39. package/dist/sync/store.js.map +1 -1
  40. package/dist/sync/tree.d.ts.map +1 -1
  41. package/dist/sync/tree.js +13 -7
  42. package/dist/sync/tree.js.map +1 -1
  43. package/dist/sync/usage.d.ts +6 -0
  44. package/dist/sync/usage.d.ts.map +1 -0
  45. package/dist/sync/usage.js +91 -0
  46. package/dist/sync/usage.js.map +1 -0
  47. package/dist/types.d.ts +37 -2
  48. package/dist/types.d.ts.map +1 -1
  49. package/package.json +1 -1
  50. package/public/assets/index-BCDcSZkB.css +1 -0
  51. package/public/assets/index-SXgKBqZw.js +131 -0
  52. package/public/assets/{persona-BVIfx5k8.js → persona-BgbqhiLa.js} +1 -1
  53. package/public/index.html +3 -3
  54. package/public/persona.html +3 -3
  55. package/public/assets/index-CYCbTSh1.js +0 -131
  56. package/public/assets/index-DntUQtGK.css +0 -1
  57. /package/public/assets/{index-BQFBaSKm.js → index-S46UUaj8.js} +0 -0
package/ACCEPTANCE.md CHANGED
@@ -15,8 +15,8 @@ The release workflow requires a strict stable version already committed consiste
15
15
  Use disposable histories first. Real-provider checks below require the operator's explicit sign-in and consent.
16
16
 
17
17
  - [ ] **Useful, qualified briefing:** distinguish what was proposed, attempted, tested, deployed, and still unresolved. Inspect original evidence and a late correction; verify the summary preserves chronology and qualifications rather than sounding more certain.
18
- - [ ] **Explicit permissions:** Codex/Claude imports stay off until independently enabled. Opening Settings/setup/status does not scan transcript bodies, prepare a snapshot, download an embedding model, call a provider, or request a microphone. Background indexing permission is separate from source permission.
19
- - [ ] **Small tails and restart:** fewer than 64 distinct changed source records wait indefinitely in the background. Session bookkeeping and frozen aliases do not multiply the count. Foreground preparation handles smaller tails. Restart does not make an unchanged archive new again.
18
+ - [ ] **Explicit permissions:** Codex/Claude imports stay off until independently enabled. Opening Settings/setup/status does not scan transcript bodies, prepare a snapshot, download an embedding model, call a provider, or request a microphone. The single indexing-and-briefing permission is separate from agent-source permission; legacy local-only opt-in alone cannot start paid preparation.
19
+ - [ ] **Automatic preparation and restart:** an already indexed backlog of 64 waiting entries still gets a briefing. Smaller new tails wait unless a 64-source-change batch is due; unfinished owned preparation resumes from cache. Session bookkeeping and aliases do not multiply the change count. Joining an unchanged ready batch makes no new briefing call. Foreground tails get a new immutable snapshot. Model failure pauses paid retries until an explicit action, including across restart. Review and notes remain untouched.
20
20
  - [ ] **Evidence availability:** removing/changing a frozen original fails visibly; no cached-source fallback invents availability. Notes/discussion remain inspectable. Restore the exact original and verify recovery without regenerated evidence or review.
21
21
  - [ ] **Import completeness:** a source larger than 32 MiB reaches its captured tail before a new snapshot or call readiness. Cancellation retains committed chunks without marking a partial import complete; retry resumes. An unfinished final record is deferred; an oversized or unreadable record blocks preparation. Later appends do not cause an endless chase.
22
22
  - [ ] **Useful retrieval:** replay project-status and follow-up questions with older identical user questions and acknowledgements present. Confirm original project evidence, latest recorded work, technical definitions and concrete remaining work—not just source IDs. Include duplicate passages, ambiguous topics, project switches, explicit conversation recall, source readback and per-turn source lists. Passing transport tests alone is insufficient.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,37 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.0
4
+
5
+ This release prepares conversations in the background, makes preparation usage visible, and improves text-answer reference handling.
6
+
7
+ ### One automatic preparation mode
8
+
9
+ - **Automatically prepare conversations** combines source discovery, local search indexing, summary batches and the next briefing. Home shows the actual stage, entry progress, model invocations, errors and last completion.
10
+ - Start a batch at 64 source changes or waiting entries, resume interrupted owned work from cache, and reuse an untouched ready briefing when you join. Small new tails wait for foreground preparation or a full batch; there is no timed flush.
11
+ - Foreground work takes priority. Provider failures require an explicit retry rather than an endless paid loop. Existing conversations, notes and frozen snapshots are not rewritten.
12
+ - This mode uses the configured pi summary/final models and their quota or API billing within the saved invocation limit. Existing local-index-only permission does **not** authorize it: enable the replacement switch explicitly. Agent/session exclusions remain independent. No automatic microphone, call, user question, note saving or review.
13
+
14
+ ### Preparation usage in Settings
15
+
16
+ - A wider, responsive Settings dialog shows completed batches, entries, model requests, active preparation and estimated cost, with charts and bucket details.
17
+ - Look back 6 hours, 1 day, 7 days or 14 days, grouped into 1-hour, 6-hour or 24-hour UTC buckets. The dashboard refreshes every 15 seconds only while Settings is open.
18
+ - Include automatic and manual preparation, retries, failed work and discarded snapshots. Count a snapshot's first successful briefing preparation once; rebuilding it adds cost without another completed batch.
19
+ - New requests receive durable timestamps and a pending accounting record. Older timing is labelled approximate; missing pricing remains unavailable or a partial subtotal, never a guessed zero.
20
+ - Costs are recorded API-price estimates, not invoices, subscription charges or quota balances. Chat, native voice, post-conversation recaps and local machine/network costs are excluded. Opening the dashboard reads metadata only; it does not start preparation.
21
+
22
+ ### More reliable text-answer references
23
+
24
+ - Give the final model short, stable per-answer labels and map them back to admitted original-source references before saving an answer. Historical citations inside quoted text do not authorize new references.
25
+ - Handle bad/missing citations and ignored later reports in one bounded correction through the same final model and invocation/cancellation budget. Unknown references are not guessed or silently removed; rejected drafts are not saved.
26
+ - Show the actual source-reference correction stage. Error wording describes validation failure rather than asserting that a reference was invented. Citation checks still do not independently verify every claim, and native voice retains its separate lookup path.
27
+
28
+ ### Upgrading from 0.3.0
29
+
30
+ - **No new database tables, columns or schema migration.** Existing SQLite run records, JSON metrics and settings storage are reused. No dependency changes.
31
+ - Existing histories, conversations, notes, review state, cached summaries and compatible search vectors are retained. Older usage records are not rewritten or backfilled from current prices.
32
+ - Node.js 22.19+ and npm remain required. Back up original logs and Draken data, wait for active work to finish, stop the server, upgrade and restart. No automatic boot startup or hot reload is added.
33
+ - Automated qualification does not establish exhaustive real-model answer quality, future account quota or physical-device voice acceptance.
34
+
3
35
  ## 0.3.0
4
36
 
5
37
  This release adds a separate text-chat experience and improves how Draken prepares history and checks later updates.
package/MEMORY.md CHANGED
@@ -16,11 +16,13 @@ Opening/reloading a page does not itself download the model, compute embeddings
16
16
 
17
17
  ### Optional background indexing
18
18
 
19
- **Settings → Automatically index history**, available from the top bar on every page, is off by default. Its explicit, persistent opt-in authorizes local scanning and embedding (including the first-use model download) while the server runs, even with no browser open. It does not run provider summaries, create/extend frozen syncs, transcribe audio or advance review. Agent logs are already text; summary generation still happens on the explicit sync action and remains separately costed.
19
+ **Settings → Automatically prepare conversations** is the single opt-in for scanning, local indexing, summary batches and the final briefing. It is off by default and works while the server runs, even without a browser. It uses the configured pi summary/final models and their quota or API billing within the saved per-run invocation limit, and may download the pinned local embedding model on first use. It creates new immutable sync snapshots; existing snapshots, discussions and notes are not rewritten. It never starts audio, a call or review. Earlier local-index-only permission is not silently upgraded to paid model permission: the replacement switch records the combined scope.
20
20
 
21
- The app's single scheduler checks once a minute when no sync, call or foreground history work is active. A background batch requires at least 64 changed source records, regardless of how long they have waited. There is no timed flush. Smaller pending batches wait for a sync, **Prepare history**, or search; that foreground path has no minimum batch size. Background indexing records the same history readiness used by calls. If anything still needs preparation, Call remains disabled—clicking it cannot start a hidden indexing job. Metadata hashes detect additions, edits and removals once per original source entry (or discussion/note record). Session/file bookkeeping does not add records, and frozen aliases coalesce with the original rather than multiplying the count. Actual indexing still reconstructs and verifies admitted source bytes. Unchanged checks do not start an embedding request. Source records and embedding passages are different counts. New sessions from enabled agents retain the collector's included-by-default behavior; per-agent/per-session exclusions and the existing baseline remain respected. Codex and Claude sources require separate explicit opt-in in **Settings → Agents & sessions**, even if background indexing is already enabled. Summarization continues to use pi. See [SOURCES.md](SOURCES.md).
21
+ The app's single scheduler checks once a minute when no sync, call or foreground history work is active. A new background batch requires at least 64 changed source records or 64 entries waiting for a briefing, regardless of elapsed time; unfinished owned batches resume from their cached work. An already indexed backlog still receives its briefing. There is no timed flush. Smaller pending batches wait for a sync, **Prepare history**, or search; that foreground path has no minimum batch size. Background indexing records the same history readiness used by calls. If anything still needs preparation, Call remains disabled—clicking it cannot start a hidden indexing job. Metadata hashes detect additions, edits and removals once per original source entry (or discussion/note record). Session/file bookkeeping does not add records, and frozen aliases coalesce with the original rather than multiplying the count. Actual indexing still reconstructs and verifies admitted source bytes. Unchanged checks do not start an embedding request. Source records and embedding passages are different counts. New sessions from enabled agents retain the collector's included-by-default behavior; per-agent/per-session exclusions and the existing baseline remain respected. Codex and Claude sources require separate explicit opt-in in **Settings → Agents & sessions**, even if background indexing is already enabled. Summarization continues to use pi. See [SOURCES.md](SOURCES.md).
22
22
 
23
- Foreground history requests preempt an active background request, waiting for the old child to exit before replacement. Disabling aborts only owned background embedding work; a scan already in progress may finish, but cannot start an embedding batch afterward. Completed vector commits remain reusable. Failures are visible and retry no sooner than five minutes; foreground preemption waits at least one minute. Shutdown awaits the owned scan/work within the existing bounded server shutdown. Reads of settings/progress start no jobs. The preference is a small `sync_settings` entry. A hash-only checkpoint in the derived search database survives restart and advances only after successful unscoped/current-call preparation; a historical or source-filtered search cannot replace it. It is scheduling metadata, not review coverage or a substitute for source verification. Progress remains process-local. An older index without a checkpoint waits for one foreground call preparation or unfiltered history search instead of treating its cached archive as newly changed. Unchanged preparations do not rewrite the checkpoint. There is no original-text copy, new provider, model substitution, vector conversion or timed small-batch flush.
23
+ Foreground requests preempt and await the owned automatic job, including its provider call. Disabling cancels only that automatic job; completed vectors and summary nodes remain reusable. A provider/briefing failure is durably paused until explicit retry, rather than repeating paid calls on a timer. Local preparation failures retry no sooner than five minutes; foreground preemption waits at least one minute. Shutdown awaits owned work. Settings/progress GETs remain metadata-only. Home shows the same combined pipeline as Settings, including actual summary counts and model-call budget; last completion and unfinished snapshot ownership survive restart. A ready untouched automatic snapshot is claimed once by the Home conversation action, preserving delivery idempotency and avoiding another briefing call. New arrivals belong to a new snapshot; earlier batches come along as qualified, lossy recaps, with originals available through retrieval.
24
+
25
+ The hash-only search checkpoint still advances only after successful global preparation. Missing older checkpoints can be established by the combined opt-in's preparation pass, reusing compatible vectors. Snapshot ownership uses private `auto:` request IDs until a foreground request claims the batch; it is not review coverage. Existing user conversations are not adopted as unfinished background jobs. No source-text copy, provider substitution, vector conversion or timed small-batch flush is introduced.
24
26
 
25
27
  A failed preparation/search reports an error. If a session file changed, moved or disappeared, scan sessions again before retrying; stale derived text is not a substitute for a verified source. Otherwise retry the question or **Prepare history**; completed embeddings are reused automatically. Cancel preparation on the sync page to stop that work. Cancelling a search or text reply stops its owned work too. Reloading does not start a call. An older cache without a call-readiness record needs one preparation pass, which reuses its compatible vectors. A completed index over a partial import is not sufficient: foreground call preparation first drains bounded import chunks to captured file ends. Missing, changed or incomplete originals block readiness. Later appends do not force preparation to chase a live stream forever; the call uses its displayed cutoff, and new work waits for another preparation. A ready sync offers **Refresh history** for an explicit local-only update without regenerating its briefing. See [SOURCES.md](SOURCES.md).
26
28
 
@@ -40,7 +42,7 @@ Text status questions additionally check for later related original assistant na
40
42
 
41
43
  Packets retain contiguous excerpts and, when clipped, separately labelled ending excerpts with original offsets so closing qualifications survive. An earlier linked checkpoint is omitted if its selected follow-ups cannot fit. Omitted candidates/threads are disclosed; no-match never establishes that no later completion record exists. These are language-dependent lexical candidates over admitted projections, not exhaustive whole-log or cross-session semantic verification.
42
44
 
43
- If a text answer cites a linked old checkpoint but ignores its supplied follow-ups, including an E/C alias of that same original record, Draken permits **one repair using the same final model and invocation/cancellation budget**. The rejected draft is never saved or shown. A second failure is visible and retains the user question without an assistant answer. **Checking later updates** identifies that repair stage. It can consume one additional final-model request; chat/repair usage remains outside the preparation-only estimate. This citation-consistency check is not proof that every claim is true. The larger packet and repair apply to text replies, **not** streaming native voice, whose separate 7,000-byte lookup budget is unchanged.
45
+ Final answers use a stable per-request `R1`, `R2`, … label catalog, mapped by Draken to the admitted E/C/H source references before validation and persistence. Source excerpts, earlier briefings and discussion are quoted data: their embedded citation syntax does not create labels. Explicit source requests are mapped into the same catalog. Unknown labels are neither guessed nor dropped. If a text answer has missing/out-of-catalog citations or cites a linked old checkpoint while ignoring supplied later reports (including E/C aliases), Draken permits **one combined correction using the same final model and invocation/cancellation budget**. The rejected draft is never saved or shown. A second failure is visible and retains the user question without an assistant answer. **Checking source references** or **Checking later updates** identifies the actual correction stage. It can consume one additional final-model request; chat/repair usage remains outside the preparation-only estimate. This citation-consistency check is not proof that every claim is true. The larger packet and repair apply to text replies, **not** streaming native voice, whose separate 7,000-byte lookup budget is unchanged.
44
46
 
45
47
  Chat readiness checks the prepared receipt at its captured cutoff. New chat messages beyond that cutoff are passed directly as recent conversation and do not force an index rebuild on every turn. Original-file identity/import cursors, selection changes, missing originals and edits to already captured records still invalidate readiness. Fresh native-call readiness keeps its stricter current-record check. Both readiness endpoints only read metadata. Refresh is explicit; chat does not silently refresh the corpus, regenerate a briefing or switch providers.
46
48
 
package/README.md CHANGED
@@ -10,7 +10,7 @@ A local-first engineering sync across your **pi, Codex CLI and Claude Code sessi
10
10
 
11
11
  **Sync with Draken → call or chat → keep a short recap.**
12
12
 
13
- **Draken 0.3.0** adds **Chat instead**, complete history preparation and better text-status evidence reconciliation. See [the release notes](CHANGELOG.md#030).
13
+ **Draken 0.4.0** adds combined automatic preparation, a preparation-usage dashboard and more reliable text-answer references. See [the release notes](CHANGELOG.md#040).
14
14
 
15
15
  The home page is compact history cards. Each sync has its own `/syncs/:id` URL, with the full briefing, conversations, notes and evidence behind it. **Search history** (`/history`) adds local semantic + keyword retrieval across retained older records, with dated source links. It prepares itself automatically—no enable/update buttons or search-mode choices. Progress counts only new or changed passages, with cached history shown separately and a measured time estimate. Local indexing reuses existing vectors and uses up to two embedding lanes/six CPU threads on sufficiently capable machines; smaller machines stay single-lane. Text questions and calls use it by default. See [MEMORY.md](MEMORY.md) for source scope, first-use download and limitations.
16
16
 
@@ -22,7 +22,7 @@ Draken remembers which evidence a finished sync covered, what you decided, and w
22
22
 
23
23
  Requires Node.js **22.19+** and npm. Session-log indexing and evidence review do not require a model or pi executable. Generated briefings and discussion use **pi 1.4+**. Existing configured pi works unchanged; otherwise **`draken setup`** installs a pinned private runtime and **`draken login`** opens pi’s own authentication interface. See [SETUP.md](SETUP.md) for the full first-run flow, private directories and recovery.
24
24
 
25
- > **Upgrading?** Back up your original agent logs and Draken data first. Versions **0.1.6 and earlier** are the old task dashboard, not this application. See [what changed in 0.3.0](CHANGELOG.md#030).
25
+ > **Upgrading?** Back up your original agent logs and Draken data first. Versions **0.1.6 and earlier** are the old task dashboard, not this application. See [what changed in 0.4.0](CHANGELOG.md#040).
26
26
 
27
27
  ```sh
28
28
  npm install -g draken
@@ -54,7 +54,9 @@ Run setup/login as the server’s user with the same environment. `draken status
54
54
  4. Return home for compact cards, or open any `/syncs/:id` independently. Reopening/reloading a URL never starts capture. **Call Draken** resumes discussion of that frozen snapshot without collecting later activity.
55
55
  5. Use **Chat instead** for a separate text conversation, or expand the detail sections to inspect the briefing/evidence and explicitly save **Decisions** and **Carry into the next sync**. **Mark reviewed** is separate and optional before starting another sync; only that explicit action advances coverage.
56
56
 
57
- **Settings** in the top bar is available on every page. **Settings → Automatically index history** optionally scans and prepares local search in the background while the server is running. It is off by default and survives restarts when enabled. Checks run once a minute while idle; background batches require at least 64 changed source records, with no timed flush. Smaller pending batches are prepared on demand when you sync, start a call or search. Foreground syncs/calls/searches take priority; completed embeddings survive cancellation. This is local scanning/embedding only, not automatic summaries, transcription, new syncs or review. The final aggregation still runs on Sync with Draken. First use may download the pinned search model. New sessions from enabled agents are selected by default; per-agent and per-session exclusions remain respected.
57
+ **Settings → Automatically prepare conversations** is one mode for the whole preparation pipeline: scan history, update local search, summarize new entries and prepare the opening briefing before you arrive. It is off by default and persists across restarts. Checks run once a minute while idle; 64 changed source records or waiting entries trigger a batch, and interrupted batches resume from cache. Smaller new tails wait for foreground preparation, with no timed flush. Home and Settings show the current stage, summary progress and last completed batch. Joining an unchanged prepared batch reuses its snapshot and briefing; later entries get a new snapshot with the earlier preparation as historical context. Existing conversations, notes and frozen evidence are never rewritten or marked reviewed. Calls and foreground work take priority.
58
+
59
+ This single opt-in authorizes **configured pi summary/final model use**, including account quota or API billing, bounded by each snapshot's saved invocation limit (120 by default). Provider failures pause automatic retries until an explicit retry; completed work is retained. There is no microphone capture or automatic call. An older local-index-only opt-in does not silently authorize this wider scope: enable the replacement switch once after upgrading. First use may download the pinned local search model. Agent/session exclusions remain respected; enabling other agents still requires their own source consent.
58
60
 
59
61
  **Settings → Agents & sessions** shows each supported agent’s configured directories, recorded sessions, workspace/file paths, last recorded changes, unreviewed counts, inclusion choices and missing-source status. **Scan enabled agents** explicitly refreshes this inventory; opening Settings only reads recorded metadata and directory presence. Readers support **pi v3 JSONL, self-contained Codex CLI rollouts and Claude Code transcripts**. Codex and Claude history require explicit per-agent opt-in; existing pi choices are preserved. The panel shows directory presence separately from recorded sessions, not an installation claim. Summaries still use pi. See [SOURCES.md](SOURCES.md) for paths, supported layouts, migration and limitations. Source selection/scanning lives in this settings panel. A fresh installation includes all indexed history; an existing fixed baseline is preserved. There are no ordinary model/budget controls or extra inference permission checkboxes. Failed preparation keeps its snapshot and cached work; retry explicitly. Opening a link after preparation requires an explicit call click.
60
62
 
@@ -70,7 +72,7 @@ A square Draken portrait accompanies replies. **Searching your prepared history*
70
72
 
71
73
  Replies use the sync's configured final text model through pi, with the briefing, recent conversation and project-aware original-history retrieval. The prepared archive has a displayed cutoff; new chat messages are supplied directly without rebuilding corpus embeddings after every turn. **Refresh history** admits later work. Changed, excluded or unavailable original sources still block readiness. Chat never opens a native call, implicitly regenerates a ready briefing, saves decisions or marks evidence reviewed. Chat quota/cost is separate from the preparation-only **Est. cost**.
72
74
 
73
- For status questions, text chat checks later related original reports before repeating old blockers, including follow-ups to a report that was itself superseded. Client implementation, backend foundations, delivery enablement and device acceptance are kept distinct. If a draft cites a linked old checkpoint without addressing its supplied follow-ups, it gets one bounded same-model repair or fails visibly without saving that draft. Retrieval and citation consistency do not independently verify the agent's claims; see [MEMORY.md](MEMORY.md#separate-text-chat) for bounds and voice differences.
75
+ For status questions, text chat checks later related original reports before repeating old blockers, including follow-ups to a report that was itself superseded. Client implementation, backend foundations, delivery enablement and device acceptance are kept distinct. The final model uses short per-answer reference labels, which Draken maps back to admitted original links; quoted historical citations never authorize new references. Bad/missing citations and ignored later follow-ups share one bounded same-model correction, with the same label catalog in both calls. A second validation failure remains visible without saving an unsupported draft. Retrieval and citation consistency do not independently verify the agent's claims; see [MEMORY.md](MEMORY.md#separate-text-chat) for bounds and voice differences.
74
76
 
75
77
  ### Model integration
76
78
 
@@ -109,6 +111,8 @@ Each run also retains metadata-only request timings, model/task/stage and repair
109
111
 
110
112
  Each sync card and detail page shows **Est. cost** for its preparation: chunk summaries, consolidation, preparation-time prior recaps, final briefing, and retries/rebuilds for that sync. Later questions, voice calls, standalone conversation recaps and local embeddings are excluded. Preparation consumes pi's bounded JSON event stream and saves only numeric usage, returned model names and the catalog-based USD estimate alongside existing metrics—not raw events, prompts, thinking or signatures. Reasoning is a subset of output, not an extra charge; provider cache reads/writes are distinct from Draken cache hits (which make no new request). The total uses prices reported at call time, never today's prices applied to old calls. **This is an API-equivalent estimate, not a subscription charge, quota measurement or provider invoice.** Missing/zero-filled usage or unavailable catalog pricing stays unavailable; mixed or interrupted records show a partial subtotal. Older syncs cannot be honestly backfilled from the padded planning estimates.
111
113
 
114
+ Settings includes a **Preparation usage** dashboard with 6-hour, 1-day, 7-day and 14-day lookbacks, and 1-hour, 6-hour or 24-hour UTC buckets. It shows completed briefing batches, model requests and their recorded API-price estimate, across automatic and manual preparation—including retries, failed work and discarded snapshots. A batch is a snapshot's first successful briefing preparation; rebuilds add cost without counting it again. It is not proof of review or current call readiness. Request costs are placed at their start time, and completed batches at their completion time. New requests have durable timestamps, including pending/interrupted requests; older metrics use the run start and are explicitly approximate. Missing usage/pricing is unavailable or a partial subtotal, never a fabricated zero or a backfill from today's prices. These are estimates, not invoices or subscription/quota balances. Chat, native voice, post-conversation recaps and local machine/network costs are excluded. Opening Settings and changing the time range only read accounting metadata; polling stops when it closes.
115
+
112
116
  The final model receives bounded summaries, raw verification excerpts, saved decisions, and recent conversation—not the entire transcript. Questions additionally retrieve up to 16 raw snapshot entries and automatically receive a bounded hybrid-search packet from retained earlier history, with separate global H citations. The separate chat surface requires prepared history and uses its captured cutoff; ordinary standalone search and the older discussion API can prepare the local index as needed. Wider history is not added to the frozen snapshot. Final citation validation checks reference existence and, for text status replies, whether cited checkpoints address their supplied follow-ups. Neither check proves that every claim is actually supported.
113
117
 
114
118
  The manager is a **read-only conversation**, not a worker. Its responses distinguish intent, attempts, agent-reported implementation, and observed validation, with clickable evidence references. Model-generated claims still need human review. Draken does not independently run tests or verify Git/CI/deployment state.
@@ -117,7 +121,7 @@ The manager is a **read-only conversation**, not a worker. Its responses disting
117
121
 
118
122
  The new workflow freezes the three most recent non-discarded syncs' briefing, discussion and explicit notes at snapshot creation. Their full supplied text passes through cached bounded map/reduce recap jobs; it does not silently select only the final messages. This remains **lossy summarization**, not exhaustive recall or independent verification. Recaps are 1–5 short lines (at most 600 characters), labelled historical summaries rather than agreement. Old source IDs are not treated as this snapshot's citations. Original histories remain available at their own URLs.
119
123
 
120
- The card shows a short recap, or an explicitly labelled briefing preview until one exists, with its body clamped to three visual lines. A changed conversation marks an older recap as stale. Closing the call UI requests an asynchronous recap using the cheap model (maximum 32 invocations, also bounded by the sync's saved ceiling); interrupted browser exits cannot guarantee that request. **Make recap / Refresh recap** retries explicitly, and the next sync recomputes changed prior inputs from cache. Recaps never change notes, source snapshots or coverage. No scheduled provider-summary inference is introduced; optional background work only prepares local search. Native recall can reuse these prior-sync recaps, but cannot quote original words from them; historical lookup automatically retrieves retained original excerpts across sessions and syncs through the local hybrid index, separately from frozen discussion and recaps; see [MEMORY.md](MEMORY.md).
124
+ The card shows a short recap, or an explicitly labelled briefing preview until one exists, with its body clamped to three visual lines. A changed conversation marks an older recap as stale. Closing the call UI requests an asynchronous recap using the cheap model (maximum 32 invocations, also bounded by the sync's saved ceiling); interrupted browser exits cannot guarantee that request. **Make recap / Refresh recap** retries explicitly, and the next sync recomputes changed prior inputs from cache. Recaps never change notes, source snapshots or coverage. The single automatic-preparation opt-in also permits these preparation recaps and briefing model calls in the background; merely browsing does not. Native recall can reuse these prior-sync recaps, but cannot quote original words from them; historical lookup automatically retrieves retained original excerpts across sessions and syncs through the local hybrid index, separately from frozen discussion and recaps; see [MEMORY.md](MEMORY.md).
121
125
 
122
126
  The migration adds presentation/recap-cache tables and removes the single-open-sync index without rewriting original rows. Once multiple open snapshots exist, do not blindly downgrade to the old one-open-sync schema. ChatGPT is the only voice engine. Removing the old engine does not remove its historical records, and updating the app does not require restoring an old database.
123
127
 
@@ -155,7 +159,7 @@ Current limits: discovery is eight directories deep; each scan reads up to 32 Mi
155
159
 
156
160
  Session logs can contain private source code, prompts, command output, and credentials.
157
161
 
158
- - **Provider-model use starts through Sync with Draken, preparation/retry, Ask, Call or recap actions.** The combined action prepares previous recaps and a new briefing before calling; closing the call UI requests a derived recap. Voice turns do not invoke pi. Calls open a persistent OpenAI audio session at call start; idle/quota accounting is not established. There is no separate permission checkbox. Scanning and reading evidence stay local. History lookup automatically prepares/updates a local embedding index when needed; first use downloads pinned public weights. Text questions and calls receive relevant historical excerpts by default through their existing model. Merely opening a page performs no embedding inference; an explicitly enabled server-side background indexing schedule runs independently of browsing.
162
+ - **Provider-model use starts through conversation/preparation actions or the explicitly enabled combined automatic-preparation mode.** The combined action prepares previous recaps and a new briefing before calling; closing the call UI requests a derived recap. Voice turns do not invoke pi. Calls open a persistent OpenAI audio session at call start; idle/quota accounting is not established. There is no separate permission checkbox. Scanning and reading evidence stay local. History lookup automatically prepares/updates a local embedding index when needed; first use downloads pinned public weights. Text questions and calls receive relevant historical excerpts by default through their existing model. Merely opening a page performs no embedding inference; the explicitly enabled automatic-preparation schedule runs independently of browsing and can also use the configured summary/final models.
159
163
  - Thinking blocks, system prompts, images, and opaque signatures are not indexed. Tool-call arguments are minimized; common secret patterns are redacted. **This is best-effort, not a guarantee that the remaining text is safe to share.** Inspect evidence and exclude sensitive sessions before calling a provider.
160
164
  - SQLite contains verified live-session and frozen-snapshot pointers, cached summaries, run metadata, decisions and conversations—not copies of original agent entry bodies. It lives outside the checkout in `~/.draken/draken.db` by default. **Original agent JSONL files are the authoritative archive, including for old snapshots.** Back up both those files and Draken's private state. Missing/changed originals are labelled unavailable; discussion and notes remain accessible, but generating replies, calling or reviewing that snapshot requires restoring its evidence. Search stores passage hashes, unique vectors, source links and contentless keyword postings, not passage bodies. See [MEMORY.md](MEMORY.md) for migration and storage details. There is no in-app retention/purge UI yet.
161
165
  - The server defaults to loopback with **no dashboard login**. Explicitly configured credentials (or `DRAKEN_NO_AUTH=false`) retain authentication even on loopback. Local API access still rejects cross-origin requests and unexpected Host headers.
package/SETUP.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Draken uses **pi for summaries, preparation recaps and text discussion**, regardless of which coding agent produced the imported history. It does not implement provider OAuth, translate another agent's credentials, or run Claude/Codex to summarize.
4
4
 
5
- > This guide is for **Draken 0.3.0**. Versions **0.1.6 and earlier** are the old task dashboard. Before upgrading, back up your original agent logs and Draken data; see [what changed](CHANGELOG.md#030).
5
+ > This guide is for **Draken 0.4.0**. Versions **0.1.6 and earlier** are the old task dashboard. Before upgrading, back up your original agent logs and Draken data; see [what changed](CHANGELOG.md#040).
6
6
 
7
7
  ## Install and start
8
8
 
package/VOICE.md CHANGED
@@ -47,7 +47,7 @@ One call may be active at a time, with a 30-minute limit, at most 60 user messag
47
47
 
48
48
  ## Evidence, records and recap
49
49
 
50
- - Voice questions do **not** start pi, local transcription or local synthesis. The call receives a bounded briefing, saved notes and source excerpts. Explicit source/history questions can request more data from the same frozen snapshot. Calls use bounded semantic + keyword retrieval across retained older records, using the local index described in [MEMORY.md](MEMORY.md). The local model/index must be prepared before calling is enabled; first preparation may take minutes. During the call, retrieval uses that prepared cutoff and verifies original sources without building new corpus embeddings. Expand **Conversation & details** for the full transcript, sources and any later history progress. Optional **Settings → Automatically index history** prepares that same call/search history in idle batches of at least 64 changed source records; it never starts capture, calls or provider summaries. Smaller batches wait for explicit preparation, and keep Call disabled if history is not ready. This block starts collapsed for every call; its progress polling reads metadata only. Those dated excerpts also go to ChatGPT; they are not new snapshot evidence. The embedding runtime is text-only and is not a replacement speech engine.
50
+ - Voice questions do **not** start pi, local transcription or local synthesis. The call receives a bounded briefing, saved notes and source excerpts. Explicit source/history questions can request more data from the same frozen snapshot. Calls use bounded semantic + keyword retrieval across retained older records, using the local index described in [MEMORY.md](MEMORY.md). The local model/index must be prepared before calling is enabled; first preparation may take minutes. During the call, retrieval uses that prepared cutoff and verifies original sources without building new corpus embeddings. Expand **Conversation & details** for the full transcript, sources and any later history progress. Optional **Settings → Automatically prepare conversations** prepares both that history and a new briefing in one idle pipeline, starting new batches at 64 source changes or waiting entries and resuming incomplete owned batches. It uses the configured pi summary/final models before the conversation, but never starts capture, calls or review. Smaller batches wait for explicit preparation, and keep Call disabled if history is not ready. This block starts collapsed for every call; its progress polling reads metadata only. Those dated excerpts also go to ChatGPT; they are not new snapshot evidence. The embedding runtime is text-only and is not a replacement speech engine.
51
51
  - The read-only lookup service is not a coding model or a general web search. Tool-execution and approval requests are denied. Calls cannot edit files, deploy work, save decisions by model instruction, finish syncs or advance coverage.
52
52
  - Speech may paraphrase. **Sources supplied** means context was given to the model, not that every spoken claim was verified. Responses are not held for whole-answer JSON validation before playback.
53
53
  - History stores ordered user/assistant messages with generated/interrupted labels. It does not invent question–answer pairs, exact played words, human hearing or agreement. Historical records from the retired engine retain their original playback reports and are labelled separately.
@@ -10,11 +10,16 @@ interface Operations {
10
10
  stamp(before: string): Map<string, string>;
11
11
  baseline?(): Map<string, string> | undefined;
12
12
  prepare(before: string, signal: AbortSignal): Promise<void>;
13
+ waiting?(): number;
14
+ unfinished?(): boolean;
15
+ briefing?(signal: AbortSignal): Promise<void>;
16
+ problem?(): string;
17
+ completed?(at: string): void;
13
18
  }
14
- /** Local cache preparation, never snapshot creation or a provider-model call.
15
- * At least 64 changed source records are required, regardless of elapsed time.
16
- * Smaller tails wait for a foreground sync/call/search or more source changes.
17
- * Only one job exists, with cancellation scoped to its own history request. */
19
+ /** One opted-in pipeline: source discovery, local search and a ready briefing.
20
+ * Full batches start at 64 changes or waiting entries; interrupted work resumes.
21
+ * Smaller new tails wait for foreground preparation, with no timed flush.
22
+ * Provider failures require explicit retry; cancellation retains cached work. */
18
23
  declare class AutoIndexer {
19
24
  private ops;
20
25
  state: State;
@@ -26,12 +31,13 @@ declare class AutoIndexer {
26
31
  tick(): Promise<void>;
27
32
  pause(): void;
28
33
  stop(): Promise<void>;
34
+ retry(): void;
29
35
  private run;
30
36
  }
31
37
  export declare function createAutoIndexer(ops: Operations): AutoIndexer;
32
38
  export declare function startBackgroundIndexing(): void;
33
39
  export declare function stopBackgroundIndexing(): Promise<void>;
34
- export declare function yieldBackgroundIndexing(): void;
40
+ export declare function yieldBackgroundIndexing(): Promise<void>;
35
41
  export declare function autoIndexSettings(): AutoIndexSettings;
36
42
  export declare function setAutoIndex(value: unknown): AutoIndexSettings;
37
43
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"automatic.d.ts","sourceRoot":"","sources":["../../src/memory/automatic.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAGlD,KAAK,KAAK,GAAG,IAAI,CAAC,iBAAiB,EAAE,OAAO,GAAG,iBAAiB,GAAG,mBAAmB,GAAG,OAAO,CAAC,CAAC;AAClG,UAAU,UAAU;IAClB,OAAO,IAAI,OAAO,CAAC;IAAC,IAAI,IAAI,OAAO,CAAC;IAAC,GAAG,IAAI,MAAM,CAAC;IACnD,IAAI,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC;QAAE,QAAQ,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;IAC3D,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3C,QAAQ,CAAC,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;IAC7C,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7D;AAGD;;;+EAG+E;AAC/E,cAAM,WAAW;IAMH,OAAO,CAAC,GAAG;IALvB,KAAK,QAAa;IAClB,OAAO,CAA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AAC,IAAI,MAAM,CAAC;IACnB,UAAU,CAAC,IAAI,OAAO,CAAC;IACvB,QAAQ,CAAC,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C,OAAO,CAAC,IAAI,MAAM,CAAC;IACnB,SAAS,CAAC,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAGD;;;iFAGiF;AACjF,cAAM,WAAW;IAMH,OAAO,CAAC,GAAG;IALvB,KAAK,QAAa;IAClB,OAAO,CAAC,QAAQ,CAAC,CAAsB;IACvC,OAAO,CAAC,OAAO,CAAK;IACpB,OAAO,CAAC,IAAI,CAAC,CAAkB;IAC/B,OAAO,CAAC,GAAG,CAAC,CAAgB;gBACR,GAAG,EAAE,UAAU;IAC7B,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAW3B,KAAK;IAIC,IAAI;IACV,KAAK;YACS,GAAG;CAmDlB;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,UAAU,eAAkC;AAMnF,wBAAgB,uBAAuB,SAStC;AACD,wBAAsB,sBAAsB,kBAG3C;AACD,wBAAsB,uBAAuB,kBAA4B;AACzE,wBAAgB,iBAAiB,IAAI,iBAAiB,CAUrD;AACD,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,iBAAiB,CAW9D"}
@@ -10,13 +10,14 @@ const schema_1 = require("../db/schema");
10
10
  const stamps_1 = require("./stamps");
11
11
  const collector_1 = require("../sync/collector");
12
12
  const store_1 = require("../sync/store");
13
+ const automatic_1 = require("../sync/automatic");
13
14
  const service_1 = require("./service");
14
15
  const CHECK_MS = 60_000, RETRY_MS = 5 * 60_000, BATCH = 64;
15
16
  const initial = () => ({ phase: 'off', pending_records: 0, last_completed_at: null, error: '' });
16
- /** Local cache preparation, never snapshot creation or a provider-model call.
17
- * At least 64 changed source records are required, regardless of elapsed time.
18
- * Smaller tails wait for a foreground sync/call/search or more source changes.
19
- * Only one job exists, with cancellation scoped to its own history request. */
17
+ /** One opted-in pipeline: source discovery, local search and a ready briefing.
18
+ * Full batches start at 64 changes or waiting entries; interrupted work resumes.
19
+ * Smaller new tails wait for foreground preparation, with no timed flush.
20
+ * Provider failures require explicit retry; cancellation retains cached work. */
20
21
  class AutoIndexer {
21
22
  ops;
22
23
  state = initial();
@@ -38,6 +39,12 @@ class AutoIndexer {
38
39
  this.state.phase = 'paused';
39
40
  return Promise.resolve();
40
41
  }
42
+ const problem = this.ops.problem?.();
43
+ if (problem) {
44
+ this.state.phase = 'error';
45
+ this.state.error = problem;
46
+ return;
47
+ }
41
48
  if (this.ops.now() < this.retryAt)
42
49
  return Promise.resolve();
43
50
  const life = new AbortController();
@@ -51,6 +58,8 @@ class AutoIndexer {
51
58
  this.state.phase = this.life ? 'stopping' : this.ops.enabled() ? 'paused' : 'off';
52
59
  }
53
60
  async stop() { this.pause(); await this.job; }
61
+ retry() { this.retryAt = 0; this.state.error = ''; if (!this.job)
62
+ this.state.phase = this.ops.enabled() ? 'waiting' : 'off'; }
54
63
  async run(signal) {
55
64
  try {
56
65
  this.state.phase = 'scanning';
@@ -62,7 +71,7 @@ class AutoIndexer {
62
71
  throw new Error('Scan incomplete');
63
72
  const before = new Date(this.ops.now()).toISOString();
64
73
  const baseline = this.ops.baseline ? this.ops.baseline() : this.baseline;
65
- if (this.ops.baseline && !baseline) {
74
+ if (this.ops.baseline && !baseline && !this.ops.briefing) {
66
75
  this.state.phase = 'waiting';
67
76
  this.state.pending_records = 0;
68
77
  this.state.error = 'Prepare history once with a foreground call or unfiltered history search to establish the background checkpoint for this older index.';
@@ -77,8 +86,9 @@ class AutoIndexer {
77
86
  for (const key of baseline.keys())
78
87
  if (!current.has(key))
79
88
  changed++;
80
- this.state.pending_records = changed;
81
- if (changed < BATCH) {
89
+ const waiting = this.ops.waiting?.() || 0, unfinished = this.ops.unfinished?.() || false;
90
+ this.state.pending_records = Math.max(changed, waiting);
91
+ if (changed < BATCH && waiting < BATCH && !unfinished) {
82
92
  this.state.phase = 'waiting';
83
93
  return;
84
94
  }
@@ -86,21 +96,38 @@ class AutoIndexer {
86
96
  this.state.phase = 'paused';
87
97
  return;
88
98
  }
89
- this.state.phase = 'indexing';
90
- await this.ops.prepare(before, signal);
99
+ if (changed >= BATCH || !baseline) {
100
+ this.state.phase = 'indexing';
101
+ await this.ops.prepare(before, signal);
102
+ this.baseline = current;
103
+ }
104
+ if (signal.aborted || !this.ops.enabled())
105
+ return;
106
+ if (this.ops.briefing && (waiting > 0 || unfinished)) {
107
+ if (!this.ops.idle())
108
+ throw new store_1.HttpError(409, 'Foreground work has priority');
109
+ this.state.phase = 'briefing';
110
+ await this.ops.briefing(signal);
111
+ }
91
112
  if (signal.aborted || !this.ops.enabled())
92
113
  return;
93
- this.baseline = current;
94
- this.state = { phase: 'waiting', pending_records: 0, last_completed_at: new Date(this.ops.now()).toISOString(), error: '' };
114
+ const completed = new Date(this.ops.now()).toISOString();
115
+ this.ops.completed?.(completed);
116
+ this.state = { phase: 'waiting', pending_records: 0, last_completed_at: completed, error: '' };
95
117
  }
96
118
  catch (error) {
97
- if (!signal.aborted && error instanceof store_1.HttpError && error.status === 409) {
119
+ const problem = this.ops.problem?.();
120
+ if (!signal.aborted && problem) {
121
+ this.state.phase = 'error';
122
+ this.state.error = problem;
123
+ }
124
+ else if (!signal.aborted && error instanceof store_1.HttpError && error.status === 409) {
98
125
  this.state.phase = 'paused';
99
126
  this.retryAt = this.ops.now() + CHECK_MS;
100
127
  }
101
128
  else if (!signal.aborted) {
102
129
  this.state.phase = 'error';
103
- this.state.error = 'Background indexing could not finish. Check session sources and model availability. Completed work is retained; retry in five minutes.';
130
+ this.state.error = 'Automatic preparation could not finish. Check session sources and model availability. Completed work is retained; local preparation retries in five minutes.';
104
131
  this.retryAt = this.ops.now() + RETRY_MS;
105
132
  }
106
133
  }
@@ -111,13 +138,17 @@ class AutoIndexer {
111
138
  }
112
139
  }
113
140
  function createAutoIndexer(ops) { return new AutoIndexer(ops); }
114
- const enabled = () => (0, schema_1.getDb)().prepare("SELECT value FROM sync_settings WHERE key='auto_index'").get()?.value === 'true';
141
+ // Old local-index-only consent must not silently become paid model consent on
142
+ // another installation. The same single switch records the new combined scope.
143
+ const enabled = () => (0, schema_1.getDb)().prepare("SELECT value FROM sync_settings WHERE key='auto_prepare_conversations'").get()?.value === 'true';
115
144
  let worker, timer;
116
145
  function startBackgroundIndexing() {
117
146
  if (timer)
118
147
  return;
119
148
  worker = createAutoIndexer({ enabled, idle: () => !store_1.busySyncs.size && !store_1.activeVoiceSyncs.size && !(0, service_1.historyProgress)().active && !(0, service_1.historyProgress)().queued,
120
- now: Date.now, scan: collector_1.scanSessions, stamp: before => (0, stamps_1.sourceStamps)((0, schema_1.getDb)(), before), baseline: () => (0, stamps_1.loadSourceCheckpoint)((0, schema_1.getDataDir)()), prepare: (before, signal) => (0, service_1.prepareHistory)(before, signal, true) });
149
+ now: Date.now, scan: collector_1.scanSessions, stamp: before => (0, stamps_1.sourceStamps)((0, schema_1.getDb)(), before), baseline: () => (0, stamps_1.loadSourceCheckpoint)((0, schema_1.getDataDir)()), prepare: (before, signal) => (0, service_1.prepareHistory)(before, signal, true),
150
+ waiting: store_1.availableCount, unfinished: () => (0, automatic_1.pendingAutomaticBriefing)() !== undefined, briefing: automatic_1.prepareAutomaticBriefing, problem: automatic_1.automaticBriefingError,
151
+ completed: at => { (0, schema_1.getDb)().prepare("INSERT INTO sync_settings(key,value) VALUES ('auto_last_completed',?) ON CONFLICT(key) DO UPDATE SET value=excluded.value").run(at); } });
121
152
  timer = setInterval(() => {
122
153
  void worker?.tick().catch(() => {
123
154
  if (worker) {
@@ -135,20 +166,33 @@ async function stopBackgroundIndexing() {
135
166
  worker = undefined;
136
167
  await prior?.stop();
137
168
  }
138
- function yieldBackgroundIndexing() { worker?.pause(); }
169
+ async function yieldBackgroundIndexing() { await worker?.stop(); }
139
170
  function autoIndexSettings() {
140
- const on = enabled();
171
+ const on = enabled(), syncId = [...store_1.backgroundSyncs][0] ?? (0, automatic_1.pendingAutomaticBriefing)() ?? null;
172
+ const progress = syncId === null ? null : (0, schema_1.getDb)().prepare('SELECT stage,processed_entries AS completed,total_entries AS total,invocations,max_invocations FROM sync_runs WHERE sync_id=? ORDER BY id DESC LIMIT 1').get(syncId);
173
+ const prepared = (0, store_1.automaticSyncId)(true), problem = on ? (0, automatic_1.automaticBriefingError)() : '';
174
+ const last = (0, schema_1.getDb)().prepare("SELECT value FROM sync_settings WHERE key='auto_last_completed'").get();
141
175
  return { enabled: on, check_seconds: CHECK_MS / 1000, batch_records: BATCH,
142
- ...(worker?.state || initial()), ...(!on && worker?.state.phase !== 'stopping' ? { phase: 'off' }
143
- : on && (!worker || worker.state.phase === 'off') ? { phase: 'waiting' } : {}) };
176
+ pending_entries: (0, store_1.availableCount)(), sync_id: syncId, ready_sync_id: prepared !== undefined && (0, service_1.historyReadiness)(true).ready ? prepared : null, progress: progress || null,
177
+ ...(worker?.state || initial()), last_completed_at: worker?.state.last_completed_at || last?.value || null, ...(!on && worker?.state.phase !== 'stopping' ? { phase: 'off' }
178
+ : on && (!worker || worker.state.phase === 'off') ? { phase: 'waiting' } : {}),
179
+ ...(problem ? { phase: 'error', error: problem } : {}) };
144
180
  }
145
181
  function setAutoIndex(value) {
146
182
  if (typeof value !== 'boolean')
147
183
  throw new store_1.HttpError(400, 'enabled must be a boolean');
148
- (0, schema_1.getDb)().prepare("INSERT INTO sync_settings(key,value) VALUES ('auto_index',?) ON CONFLICT(key) DO UPDATE SET value=excluded.value").run(String(value));
184
+ (0, schema_1.getDb)().transaction(() => {
185
+ const save = (0, schema_1.getDb)().prepare('INSERT INTO sync_settings(key,value) VALUES (?,?) ON CONFLICT(key) DO UPDATE SET value=excluded.value');
186
+ for (const key of ['auto_index', 'auto_prepare_conversations'])
187
+ save.run(key, String(value));
188
+ })();
149
189
  startBackgroundIndexing();
150
190
  if (!value)
151
191
  worker.pause();
192
+ else {
193
+ (0, automatic_1.retryAutomaticBriefing)();
194
+ worker.retry();
195
+ }
152
196
  // The periodic server timer owns work; neither GET nor rendering starts a job.
153
197
  return autoIndexSettings();
154
198
  }
@@ -1 +1 @@
1
- {"version":3,"file":"automatic.js","sourceRoot":"","sources":["../../src/memory/automatic.ts"],"names":[],"mappings":";;AAkFA,8CAAmF;AAInF,0DAOC;AACD,wDAGC;AACD,0DAA8D;AAC9D,8CAKC;AACD,oCAOC;AAhHD,yCAAiD;AACjD,qCAA8D;AAC9D,iDAAiD;AACjD,yCAAuE;AACvE,uCAA4D;AAG5D,MAAM,QAAQ,GAAG,MAAM,EAAE,QAAQ,GAAG,CAAC,GAAG,MAAM,EAAE,KAAK,GAAG,EAAE,CAAC;AAS3D,MAAM,OAAO,GAAG,GAAU,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC,EAAE,iBAAiB,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;AAExG;;;+EAG+E;AAC/E,MAAM,WAAW;IAMK;IALpB,KAAK,GAAG,OAAO,EAAE,CAAC;IACV,QAAQ,CAAuB;IAC/B,OAAO,GAAG,CAAC,CAAC;IACZ,IAAI,CAAmB;IACvB,GAAG,CAAiB;IAC5B,YAAoB,GAAe;QAAf,QAAG,GAAH,GAAG,CAAY;IAAG,CAAC;IACvC,KAAK,CAAC,IAAI;QACR,IAAI,IAAI,CAAC,GAAG;YAAE,OAAO,IAAI,CAAC,GAAG,CAAC;QAC9B,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,CAAC;YAAC,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;YAAC,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;QAAC,CAAC;QAChF,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC;YAAC,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,QAAQ,CAAC;YAAC,OAAO,OAAO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AAI,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IAC/F,CAAC,CAAC,EAAE,CAAC;IACL,uBAAuB,EAAE,CAAC;IAC1B,IAAI,CAAC,KAAK;QAAE,MAAO,CAAC,KAAK,EAAE,CAAC;SACvB,CAAC;QAAC,IAAA,kCAAsB,GAAE,CAAC;QAAC,MAAO,CAAC,KAAK,EAAE,CAAC;IAAC,CAAC;IACnD,+EAA+E;IAC/E,OAAO,iBAAiB,EAAE,CAAC;AAC7B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"live-voice.d.ts","sourceRoot":"","sources":["../../src/routes/live-voice.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,MAAM,4CAAW,CAAC;AA0BxB,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"live-voice.d.ts","sourceRoot":"","sources":["../../src/routes/live-voice.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,MAAM,4CAAW,CAAC;AA8BxB,eAAe,MAAM,CAAC"}
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const express_1 = require("express");
4
4
  const store_1 = require("../sync/store");
5
5
  const live_1 = require("../voice/live");
6
+ const automatic_1 = require("../memory/automatic");
6
7
  const router = (0, express_1.Router)();
7
8
  const route = (fn) => (req, res, next) => { Promise.resolve().then(() => fn(req, res)).catch(next); };
8
9
  const id = (value) => { if (typeof value !== 'string' || !/^[a-f0-9-]{36}$/.test(value))
@@ -27,7 +28,12 @@ router.post('/calls', route(async (req, res) => {
27
28
  if (Object.keys(req.body || {}).some(key => !['syncId', 'requestId'].includes(key)))
28
29
  throw new store_1.HttpError(400, 'Unknown call option. Refresh the page.');
29
30
  const requestId = req.body?.requestId === undefined ? undefined : id(req.body.requestId);
30
- const result = await connected(res, signal => (0, live_1.createLiveCall)(number(req.body?.syncId, 1), signal, requestId));
31
+ const syncId = number(req.body?.syncId, 1);
32
+ const result = await connected(res, async (signal) => {
33
+ await (0, automatic_1.yieldBackgroundIndexing)();
34
+ signal.throwIfAborted();
35
+ return (0, live_1.createLiveCall)(syncId, signal, requestId);
36
+ });
31
37
  res.status(201).json(result);
32
38
  }));
33
39
  router.post('/calls/:id/connect', route(async (req, res) => {
@@ -1 +1 @@
1
- {"version":3,"file":"live-voice.js","sourceRoot":"","sources":["../../src/routes/live-voice.ts"],"names":[],"mappings":";;AAAA,qCAAkE;AAClE,yCAA0C;AAC1C,wCAA4I;AAC5I,MAAM,MAAM,GAAG,IAAA,gBAAM,GAAE,CAAC;AACxB,MAAM,KAAK,GAAG,CAAC,EAA+D,EAAE,EAAE,CAAC,CAAC,GAAY,EAAE,GAAa,EAAE,IAAkB,EAAE,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AACpM,MAAM,EAAE,GAAG,CAAC,KAAc,EAAE,EAAE,GAAG,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC;IAAE,MAAM,IAAI,iBAAS,CAAC,GAAG,EAAE,yBAAyB,CAAC,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;AACvK,MAAM,MAAM,GAAG,CAAC,KAAc,EAAE,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,MAAM,CAAC,gBAAgB,EAAE,EAAE,GAAG,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,GAAG;IAAE,MAAM,IAAI,iBAAS,CAAC,GAAG,EAAE,4BAA4B,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;A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AC,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACzH,kBAAe,MAAM,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../src/routes/memory.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,MAAM,4CAAW,CAAC;AASxB,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../src/routes/memory.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,MAAM,4CAAW,CAAC;AAgBxB,eAAe,MAAM,CAAC"}
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const express_1 = require("express");
4
4
  const service_1 = require("../memory/service");
5
+ const automatic_1 = require("../memory/automatic");
5
6
  const router = (0, express_1.Router)();
6
7
  const route = (handler) => (req, res, next) => {
7
8
  const abort = new AbortController();
@@ -12,7 +13,16 @@ const route = (handler) => (req, res, next) => {
12
13
  };
13
14
  // Metadata only: never starts a worker, downloads a model or queues behind it.
14
15
  router.get('/progress', (_req, res) => res.json((0, service_1.historyProgress)()));
15
- router.post('/search', route(async (req, res, signal) => res.json(await (0, service_1.searchHistory)((0, service_1.validateHistoryQuery)(req.body), signal))));
16
- router.get('/records/:ref', route(async (req, res, signal) => res.json(await (0, service_1.readHistory)(String(req.params.ref), req.query.offset === undefined ? 0 : Number(req.query.offset), signal))));
16
+ router.post('/search', route(async (req, res, signal) => {
17
+ const query = (0, service_1.validateHistoryQuery)(req.body);
18
+ await (0, automatic_1.yieldBackgroundIndexing)();
19
+ signal.throwIfAborted();
20
+ res.json(await (0, service_1.searchHistory)(query, signal));
21
+ }));
22
+ router.get('/records/:ref', route(async (req, res, signal) => {
23
+ await (0, automatic_1.yieldBackgroundIndexing)();
24
+ signal.throwIfAborted();
25
+ res.json(await (0, service_1.readHistory)(String(req.params.ref), req.query.offset === undefined ? 0 : Number(req.query.offset), signal));
26
+ }));
17
27
  exports.default = router;
18
28
  //# sourceMappingURL=memory.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"memory.js","sourceRoot":"","sources":["../../src/routes/memory.ts"],"names":[],"mappings":";;AAAA,qCAAiF;AACjF,+CAAsG;AACtG,MAAM,MAAM,GAAG,IAAA,gBAAM,GAAE,CAAC;AACxB,MAAM,KAAK,GAAG,CAAC,OAAyF,EAAE,EAAE,CAAC,CAAC,GAAY,EAAE,GAAa,EAAE,IAAkB,EAAE,EAAE;IAC/J,MAAM,KAAK,GAAG,IAAI,eAAe,EAAE,CAAC;IAAC,MAAM,MAAM,GAAG,GAAG,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,aAAa;QAAE,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;IAAC,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC9H,KAAK,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;AACzH,CAAC,CAAC;AACF,+EAA+E;AAC/E,MAAM,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,IAAA,yBAAe,GAAE,CAAC,CAAC,CAAC;AACpE,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,IAAA,uBAAa,EAAC,IAAA,8BAAoB,EAAC,GAAG,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC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ts","sourceRoot":"","sources":["../../src/routes/sync.ts"],"names":[],"mappings":"AAUA,QAAA,MAAM,MAAM,4CAAW,CAAC;AA6HxB,eAAe,MAAM,CAAC"}