@autumnsgrove/lyra 0.2.0 → 0.3.1

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 (138) hide show
  1. package/dist/adapters/cloudflare/index.d.ts +1 -0
  2. package/dist/adapters/cloudflare/index.d.ts.map +1 -1
  3. package/dist/adapters/cloudflare/index.js +1 -0
  4. package/dist/adapters/cloudflare/index.js.map +1 -1
  5. package/dist/adapters/cloudflare/session.d.ts +102 -0
  6. package/dist/adapters/cloudflare/session.d.ts.map +1 -0
  7. package/dist/adapters/cloudflare/session.js +595 -0
  8. package/dist/adapters/cloudflare/session.js.map +1 -0
  9. package/dist/core/approval.d.ts +38 -0
  10. package/dist/core/approval.d.ts.map +1 -0
  11. package/dist/core/approval.js +47 -0
  12. package/dist/core/approval.js.map +1 -0
  13. package/dist/core/compaction.d.ts +193 -0
  14. package/dist/core/compaction.d.ts.map +1 -0
  15. package/dist/core/compaction.js +460 -0
  16. package/dist/core/compaction.js.map +1 -0
  17. package/dist/core/define-recipe.d.ts +8 -1
  18. package/dist/core/define-recipe.d.ts.map +1 -1
  19. package/dist/core/define-recipe.js +13 -0
  20. package/dist/core/define-recipe.js.map +1 -1
  21. package/dist/core/events.d.ts +32 -2
  22. package/dist/core/events.d.ts.map +1 -1
  23. package/dist/core/events.js +16 -1
  24. package/dist/core/events.js.map +1 -1
  25. package/dist/core/execute-tools.d.ts +7 -0
  26. package/dist/core/execute-tools.d.ts.map +1 -1
  27. package/dist/core/execute-tools.js +6 -0
  28. package/dist/core/execute-tools.js.map +1 -1
  29. package/dist/core/hash.d.ts +10 -0
  30. package/dist/core/hash.d.ts.map +1 -0
  31. package/dist/core/hash.js +14 -0
  32. package/dist/core/hash.js.map +1 -0
  33. package/dist/core/model.d.ts +12 -0
  34. package/dist/core/model.d.ts.map +1 -1
  35. package/dist/core/propose.d.ts +29 -0
  36. package/dist/core/propose.d.ts.map +1 -0
  37. package/dist/core/propose.js +75 -0
  38. package/dist/core/propose.js.map +1 -0
  39. package/dist/core/recipe.d.ts +2 -0
  40. package/dist/core/recipe.d.ts.map +1 -1
  41. package/dist/core/recipe.js +5 -8
  42. package/dist/core/recipe.js.map +1 -1
  43. package/dist/core/resume.d.ts +19 -1
  44. package/dist/core/resume.d.ts.map +1 -1
  45. package/dist/core/resume.js +64 -6
  46. package/dist/core/resume.js.map +1 -1
  47. package/dist/core/retry.d.ts +9 -0
  48. package/dist/core/retry.d.ts.map +1 -0
  49. package/dist/core/retry.js +9 -0
  50. package/dist/core/retry.js.map +1 -0
  51. package/dist/core/run-handle.d.ts +5 -0
  52. package/dist/core/run-handle.d.ts.map +1 -1
  53. package/dist/core/run-handle.js +1 -0
  54. package/dist/core/run-handle.js.map +1 -1
  55. package/dist/core/run.d.ts +29 -2
  56. package/dist/core/run.d.ts.map +1 -1
  57. package/dist/core/run.js +526 -132
  58. package/dist/core/run.js.map +1 -1
  59. package/dist/core/runtime.d.ts +12 -0
  60. package/dist/core/runtime.d.ts.map +1 -1
  61. package/dist/core/runtime.js +34 -2
  62. package/dist/core/runtime.js.map +1 -1
  63. package/dist/core/tool.d.ts +55 -0
  64. package/dist/core/tool.d.ts.map +1 -1
  65. package/dist/core/tool.js +16 -0
  66. package/dist/core/tool.js.map +1 -1
  67. package/dist/core/usage.d.ts +27 -0
  68. package/dist/core/usage.d.ts.map +1 -0
  69. package/dist/core/usage.js +67 -0
  70. package/dist/core/usage.js.map +1 -0
  71. package/dist/index.d.ts +7 -0
  72. package/dist/index.d.ts.map +1 -1
  73. package/dist/index.js +7 -0
  74. package/dist/index.js.map +1 -1
  75. package/dist/protocol/answers.d.ts +33 -0
  76. package/dist/protocol/answers.d.ts.map +1 -0
  77. package/dist/protocol/answers.js +86 -0
  78. package/dist/protocol/answers.js.map +1 -0
  79. package/dist/protocol/commands.d.ts +84 -0
  80. package/dist/protocol/commands.d.ts.map +1 -0
  81. package/dist/protocol/commands.js +232 -0
  82. package/dist/protocol/commands.js.map +1 -0
  83. package/dist/protocol/events.d.ts +145 -0
  84. package/dist/protocol/events.d.ts.map +1 -0
  85. package/dist/protocol/events.js +195 -0
  86. package/dist/protocol/events.js.map +1 -0
  87. package/dist/protocol/frames.d.ts +72 -0
  88. package/dist/protocol/frames.d.ts.map +1 -0
  89. package/dist/protocol/frames.js +134 -0
  90. package/dist/protocol/frames.js.map +1 -0
  91. package/dist/protocol/http.d.ts +52 -0
  92. package/dist/protocol/http.d.ts.map +1 -0
  93. package/dist/protocol/http.js +357 -0
  94. package/dist/protocol/http.js.map +1 -0
  95. package/dist/protocol/reader.d.ts +35 -0
  96. package/dist/protocol/reader.d.ts.map +1 -0
  97. package/dist/protocol/reader.js +71 -0
  98. package/dist/protocol/reader.js.map +1 -0
  99. package/dist/protocol/session.d.ts +85 -0
  100. package/dist/protocol/session.d.ts.map +1 -0
  101. package/dist/protocol/session.js +801 -0
  102. package/dist/protocol/session.js.map +1 -0
  103. package/dist/record/entries.d.ts +110 -2
  104. package/dist/record/entries.d.ts.map +1 -1
  105. package/dist/record/entries.js +337 -10
  106. package/dist/record/entries.js.map +1 -1
  107. package/dist/record/replay.d.ts +6 -0
  108. package/dist/record/replay.d.ts.map +1 -1
  109. package/dist/record/replay.js +11 -3
  110. package/dist/record/replay.js.map +1 -1
  111. package/dist/record/truncate.d.ts +12 -0
  112. package/dist/record/truncate.d.ts.map +1 -1
  113. package/dist/record/truncate.js +72 -1
  114. package/dist/record/truncate.js.map +1 -1
  115. package/dist/testkit/fake-model-server.d.ts +17 -0
  116. package/dist/testkit/fake-model-server.d.ts.map +1 -1
  117. package/dist/testkit/fake-model-server.js +33 -7
  118. package/dist/testkit/fake-model-server.js.map +1 -1
  119. package/dist/testkit/index.d.ts +9 -1
  120. package/dist/testkit/index.d.ts.map +1 -1
  121. package/dist/testkit/index.js +9 -1
  122. package/dist/testkit/index.js.map +1 -1
  123. package/dist/testkit/model.d.ts +18 -0
  124. package/dist/testkit/model.d.ts.map +1 -1
  125. package/dist/testkit/model.js +47 -1
  126. package/dist/testkit/model.js.map +1 -1
  127. package/dist/testkit/scenario.d.ts +26 -2
  128. package/dist/testkit/scenario.d.ts.map +1 -1
  129. package/dist/testkit/scenario.js +97 -14
  130. package/dist/testkit/scenario.js.map +1 -1
  131. package/dist/testkit/timeline-recipe.d.ts.map +1 -1
  132. package/dist/testkit/timeline-recipe.js +3 -0
  133. package/dist/testkit/timeline-recipe.js.map +1 -1
  134. package/dist/testkit/tools.d.ts +15 -1
  135. package/dist/testkit/tools.d.ts.map +1 -1
  136. package/dist/testkit/tools.js +19 -0
  137. package/dist/testkit/tools.js.map +1 -1
  138. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"approval.d.ts","sourceRoot":"","sources":["../../src/core/approval.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAEnD,oEAAoE;AACpE,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC;AAElD,kFAAkF;AAClF,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,WAAW,CAAC;AAEzD,eAAO,MAAM,aAAa,EAAE,SAAS,UAAU,EAA6B,CAAC;AAC7E,eAAO,MAAM,UAAU,EAAE,SAAS,QAAQ,EAAsC,CAAC;AAEjF,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,UAAU,CAEhE;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,QAAQ,CAE5D;AAED,uFAAuF;AACvF,wBAAgB,cAAc,CAAC,IAAI,EAAE,QAAQ,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,CAEjF;AAED;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,aAAa,EAAE,UAAU,GAAG,SAAS,GAAG,UAAU,CAEtF;AAED,6DAA6D;AAC7D,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,CAEzD;AAED,iFAAiF;AACjF,wBAAgB,cAAc,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAEjD;AAED,gFAAgF;AAChF,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAEvD"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * What a tool may do without a person, and how a run asks (docs/approvals.md,
3
+ * decisions 34, 35 and 85).
4
+ *
5
+ * One mechanism covers both an approval of a risky call and a question only a
6
+ * person can answer: the run saves a request in the record and parks, and the
7
+ * answer decides what happens next. This module is the part that is a pure
8
+ * decision — which policy governs one call — so the loop and the tests agree on
9
+ * one rule rather than each reading the fields for itself.
10
+ */
11
+ export const TOOL_POLICIES = ["allow", "ask", "deny"];
12
+ export const TOOL_RISKS = ["reads", "changes", "dangerous"];
13
+ export function isToolPolicy(value) {
14
+ return TOOL_POLICIES.some((known) => known === value);
15
+ }
16
+ export function isToolRisk(value) {
17
+ return TOOL_RISKS.some((known) => known === value);
18
+ }
19
+ /** How a risk label shapes the default: a change or a danger asks, a read does not. */
20
+ export function policyFromRisk(risk) {
21
+ return risk === "changes" || risk === "dangerous" ? "ask" : undefined;
22
+ }
23
+ /**
24
+ * The policy that governs one call.
25
+ *
26
+ * The tool's own word wins, then its risk label, then the recipe's default, and a
27
+ * tool that says nothing is allowed. That last rule is deliberate: every tool built
28
+ * before this slice is silent, and silence meaning "ask" would stop every existing
29
+ * recipe at its first call. A caller who wants asking says so (decision 135's
30
+ * sibling, recorded with this slice).
31
+ */
32
+ export function policyOf(tool, recipeDefault) {
33
+ return tool.policy ?? policyFromRisk(tool.risk) ?? recipeDefault ?? "allow";
34
+ }
35
+ /** What the model reads when a call was not run, and why. */
36
+ export function deniedOutcome(reason) {
37
+ return { isError: true, content: `this call was denied and did not run: ${reason}` };
38
+ }
39
+ /** The reason a denied call gives, which names the tool so a model can adapt. */
40
+ export function deniedByRecipe(tool) {
41
+ return `the recipe does not allow the ${tool.spec.name} tool, so nothing ran`;
42
+ }
43
+ /** The reason a call that needed a person gives when there is nobody to ask. */
44
+ export function deniedWithoutAPerson(tool) {
45
+ return `the ${tool.spec.name} tool needs a person's approval and nothing can deliver the question, so nothing ran`;
46
+ }
47
+ //# sourceMappingURL=approval.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"approval.js","sourceRoot":"","sources":["../../src/core/approval.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAUH,MAAM,CAAC,MAAM,aAAa,GAA0B,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AAC7E,MAAM,CAAC,MAAM,UAAU,GAAwB,CAAC,OAAO,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;AAEjF,MAAM,UAAU,YAAY,CAAC,KAAc;IAC1C,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;AACvD,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,KAAc;IACxC,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;AACpD,CAAC;AAED,uFAAuF;AACvF,MAAM,UAAU,cAAc,CAAC,IAA0B;IACxD,OAAO,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AACvE,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAU,EAAE,aAAqC;IACzE,OAAO,IAAI,CAAC,MAAM,IAAI,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,aAAa,IAAI,OAAO,CAAC;AAC7E,CAAC;AAED,6DAA6D;AAC7D,MAAM,UAAU,aAAa,CAAC,MAAc;IAC3C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,yCAAyC,MAAM,EAAE,EAAE,CAAC;AACtF,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,cAAc,CAAC,IAAU;IACxC,OAAO,iCAAiC,IAAI,CAAC,IAAI,CAAC,IAAI,uBAAuB,CAAC;AAC/E,CAAC;AAED,gFAAgF;AAChF,MAAM,UAAU,oBAAoB,CAAC,IAAU;IAC9C,OAAO,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,sFAAsF,CAAC;AACpH,CAAC"}
@@ -0,0 +1,193 @@
1
+ /**
2
+ * The cut, and what a history is guessed to cost (docs/context-size.md, decisions
3
+ * 39 to 41).
4
+ *
5
+ * Compaction never deletes from the record. It writes a `compaction` entry naming
6
+ * the first entry the model still sees, and the view is built from that pointer,
7
+ * so replay and the record keep everything (decision 39). This module is the pure
8
+ * half of that: how many tokens a piece of text is guessed to cost, and where the
9
+ * cut may fall.
10
+ *
11
+ * The estimate is four characters to a token. It is a smoke alarm rather than
12
+ * billing: the trigger adds it to the input tokens the provider reported for the
13
+ * last request, so it only has to be roughly right about what arrived since.
14
+ *
15
+ * A cut is only allowed to start a step, never to land on a tool result: a result
16
+ * whose call was summarized away would leave the model with an answer to a
17
+ * question it cannot see, and a provider refuses that (CMP02).
18
+ */
19
+ import type { Clock, Ids } from "./clock.js";
20
+ import type { ConversationMessage } from "./conversation.js";
21
+ import type { ModelError, ModelSlot, Usage } from "./model.js";
22
+ import { type Result } from "./result.js";
23
+ import type { CompactionEntry, RecordEntry } from "../record/entries.js";
24
+ import type { Tool } from "./tool.js";
25
+ /** How many tokens a piece of text is guessed to cost, rounded up. */
26
+ export declare function estimateTokens(text: string): number;
27
+ /**
28
+ * What one entry costs the model. A status, a note, a pin and a compaction are in
29
+ * the record but never in the conversation, so they are free here too.
30
+ */
31
+ export declare function entryTokens(entry: RecordEntry): number;
32
+ /** Where a compaction cuts: the first entry kept, its position, and how many it replaces. */
33
+ export interface Cut {
34
+ /** The id of the first entry the model still sees, which the entry stores. */
35
+ firstKept: string;
36
+ /** That entry's position in the list the cut was chosen from. */
37
+ index: number;
38
+ /** How many entries before the cut the summary stands in for. */
39
+ replaces: number;
40
+ }
41
+ /**
42
+ * Where to cut a history so the model keeps at most `keepTokens` of it.
43
+ *
44
+ * Nothing is cut when the whole history already fits, which is the common case
45
+ * and also what an empty history and one that is a single step return: cutting
46
+ * a history down to itself would only spend a summary call.
47
+ */
48
+ export declare function chooseCut(entries: readonly RecordEntry[], keepTokens: number): Cut | undefined;
49
+ /**
50
+ * What the model sees of a record: the latest summary, what each tool says its
51
+ * state is, and the entries from the compaction's pointer on (decision 39).
52
+ */
53
+ export interface ModelView {
54
+ /** The entries kept verbatim, oldest first: where a later cut is chosen from. */
55
+ entries: RecordEntry[];
56
+ /** The latest summary, when the record has a compaction in it. */
57
+ summary: string | undefined;
58
+ /** What each tool rendered as its current state, in the order given. */
59
+ stateTexts: readonly string[];
60
+ /** The conversation to send, in order. The system text is the caller's. */
61
+ messages: ConversationMessage[];
62
+ }
63
+ /**
64
+ * Build the view of a record. Everything before the latest `compaction`'s pointer
65
+ * is left out of the conversation but stays in the record, so replay still
66
+ * rebuilds tool state from every saved result (CMP07).
67
+ *
68
+ * A pointer that names no entry in the path is treated as the end of the
69
+ * compaction entry itself rather than as an error: a record whose chain is
70
+ * damaged is already noted by the loader, and showing the model too much is
71
+ * safer than showing it nothing.
72
+ */
73
+ export declare function buildView(path: readonly RecordEntry[], stateTexts?: readonly string[]): ModelView;
74
+ /** The default cap on what the model reads from one tool result (decision 40). */
75
+ export declare const DEFAULT_RESULT_CAP_BYTES = 51200;
76
+ /**
77
+ * What each tool says the recipe's state is, already labelled for the model
78
+ * (decision 40).
79
+ *
80
+ * A tool that throws here loses its state text and not the run: this runs while a
81
+ * view is being built, and a view is not worth failing a run over.
82
+ */
83
+ export declare function currentStateTexts(tools: readonly Tool[], state: unknown): string[];
84
+ /** The most one old entry may take in a summary request, in estimated tokens. */
85
+ export declare const SUMMARY_ENTRY_TOKENS = 8000;
86
+ /**
87
+ * What a summary call is given: the previous summary, which it updates rather
88
+ * than restarts, and the steps since it, oldest first (decision 40).
89
+ *
90
+ * An old tool result is cut to a per-entry cap so the summary call itself fits in
91
+ * the window it is trying to save. That loses detail, and the record keeps it:
92
+ * `notes.md` says why the tradeoff was taken.
93
+ */
94
+ export declare function summaryMaterial(view: ModelView, cut: Cut): string;
95
+ /**
96
+ * How a recipe shapes compaction. Every field is optional: the defaults are
97
+ * Nova's numbers, chosen at step 7 and recorded in `decisions.md`.
98
+ */
99
+ export interface CompactionSettings {
100
+ /** The model's context window, when the recipe knows it and the slot does not. */
101
+ contextWindow?: number;
102
+ /** How close to the window a run may come before it compacts. */
103
+ reserveTokens?: number;
104
+ /** How much of the most recent history to keep verbatim, in estimated tokens. */
105
+ keepTokens?: number;
106
+ /** The model that writes the summary, when it is not the run's own. */
107
+ model?: string;
108
+ /** The recipe's own summarizer instructions, replacing the default. */
109
+ instructions?: string;
110
+ }
111
+ /** `max(16384, 10% of the window)`, which is Nova's reserve (decision 41). */
112
+ export declare function defaultReserveTokens(window: number): number;
113
+ /** What the run keeps if a recipe says nothing: Nova's 20000 tokens (decision 41). */
114
+ export declare const DEFAULT_KEEP_TOKENS = 20000;
115
+ /** A recipe's compaction settings, checked once so a bad one fails fast (LIM03's rule). */
116
+ export declare function validateCompactionSettings(settings: CompactionSettings): Result<CompactionSettings>;
117
+ /**
118
+ * The instructions the summarizer is given when a recipe does not replace them.
119
+ *
120
+ * Shaped for a Lyra run rather than a coding chat: the goal is pinned in the system
121
+ * text and never summarized, the tools can hand back their own exact state, and
122
+ * what is left is progress, decisions and what is open (decision 40).
123
+ */
124
+ export declare const DEFAULT_SUMMARY_INSTRUCTIONS: string;
125
+ /** What the model is asked for when the run compacts itself. */
126
+ export interface Summarizer {
127
+ model: ModelSlot;
128
+ /** The model to ask, when the recipe names one. */
129
+ modelName?: string;
130
+ instructions: string;
131
+ }
132
+ export interface Summary {
133
+ summary: string;
134
+ /** The model that answered, which the entry records. */
135
+ model: string;
136
+ usage: Usage;
137
+ }
138
+ /**
139
+ * Ask the model for a summary, retrying a retryable failure the way the loop's own
140
+ * requests are retried (decision 26).
141
+ *
142
+ * An answer that is empty or only whitespace is a failure rather than a summary: a
143
+ * run that continued on it would have thrown away the history it meant to keep,
144
+ * and there is no smaller answer to fall back on.
145
+ */
146
+ export declare function summarize(options: {
147
+ summarizer: Summarizer;
148
+ material: string;
149
+ clock: Clock;
150
+ signal: AbortSignal;
151
+ /** Told about each wait, so a host can show it the way it shows a turn's retry. */
152
+ onRetry?: (attempt: number, delayMs: number, error: ModelError) => void;
153
+ }): Promise<Result<Summary, ModelError>>;
154
+ /** Whether the conversation is close enough to the window to compact (decision 41). */
155
+ export declare function shouldCompact(estimate: number, window: number, reserveTokens: number): boolean;
156
+ /** The tokens a conversation is guessed to cost. */
157
+ export declare function estimateConversation(messages: readonly ConversationMessage[]): number;
158
+ /**
159
+ * What was added since the last request: the reply it produced, and every message
160
+ * after it. A provider's reported input tokens only cover that request, so this is
161
+ * the part it could not know about (decision 41).
162
+ */
163
+ export declare function estimateSinceLastReply(messages: readonly ConversationMessage[]): number;
164
+ /** What a manual compaction was asked to do, over a record that is not running. */
165
+ export interface ManualCompaction {
166
+ /** The record's active path, oldest first. */
167
+ path: readonly RecordEntry[];
168
+ /** The id the new entry links to, which is the record's last entry. */
169
+ parent: string | null;
170
+ model: ModelSlot;
171
+ /** The model a host runs, when the recipe does not name its own summarizer. */
172
+ modelName?: string;
173
+ clock: Clock;
174
+ ids: Ids;
175
+ /** The summarizer's instructions: the recipe's own, or the default. */
176
+ instructions: string;
177
+ /** How much of the most recent history to keep verbatim. */
178
+ keepTokens: number;
179
+ /** A person's own words for this one summary, added to the instructions. */
180
+ extraInstructions?: string;
181
+ }
182
+ /**
183
+ * Summarize a record now, because a person asked (decision 42).
184
+ *
185
+ * It answers `undefined` when there is nothing to cut, which is not a failure: a
186
+ * short history is already the view. The entry it makes is not appended here, so
187
+ * the caller decides what a write failure means; it is `trigger: "manual"`, and a
188
+ * person's extra instructions are recorded by their hash like any other.
189
+ */
190
+ export declare function compactRecord(options: ManualCompaction): Promise<Result<{
191
+ entry: CompactionEntry;
192
+ } | undefined, ModelError>>;
193
+ //# sourceMappingURL=compaction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compaction.d.ts","sourceRoot":"","sources":["../../src/core/compaction.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,EAAE,UAAU,EAA4B,SAAS,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAGzF,OAAO,EAAiB,KAAK,MAAM,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAMtC,sEAAsE;AACtE,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAmBtD;AAOD,6FAA6F;AAC7F,MAAM,WAAW,GAAG;IACnB,8EAA8E;IAC9E,SAAS,EAAE,MAAM,CAAC;IAClB,iEAAiE;IACjE,KAAK,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,QAAQ,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,SAAS,WAAW,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,GAAG,GAAG,SAAS,CA6C9F;AAKD;;;GAGG;AACH,MAAM,WAAW,SAAS;IACzB,iFAAiF;IACjF,OAAO,EAAE,W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