@treeseed/dsh-chapters 0.2.3 → 0.2.4
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/lib/client.js +2 -2
- package/lib/client.js.map +1 -1
- package/lib/commands.js +23 -5
- package/lib/commands.js.map +1 -1
- package/lib/enrich.js +13 -3
- package/lib/enrich.js.map +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +92 -6
- package/lib/index.js.map +1 -1
- package/lib/prompt-loop.js +7 -1
- package/lib/prompt-loop.js.map +1 -1
- package/lib/prompt.d.ts +119 -18
- package/lib/prompt.js +203 -72
- package/lib/prompt.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
package/lib/prompt.d.ts
CHANGED
|
@@ -40,19 +40,25 @@ export interface PromptConfig {
|
|
|
40
40
|
contextChars: number;
|
|
41
41
|
/** cap on the accepted recommendation; over-cap is invalid, never truncated. */
|
|
42
42
|
maxChars: number;
|
|
43
|
+
/** #188: share of the model's context window the derived input budget takes. */
|
|
44
|
+
contextRatio: number;
|
|
43
45
|
}
|
|
44
46
|
export interface PromptDeps {
|
|
45
47
|
getSetting(key: string): string | undefined;
|
|
46
48
|
putSetting(key: string, value: string): Promise<void>;
|
|
47
49
|
deleteSetting(key: string): Promise<void>;
|
|
48
|
-
/**
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
/** #188 REVERSES the old economy on the maintainer's direction: the chapter history of the
|
|
51
|
+
* ANCESTOR PATH (a continuation mid-goal inherits its lineage, not an empty list), each entry
|
|
52
|
+
* carrying its plots — an index a model cannot research is worthless, so the trajectory rides
|
|
53
|
+
* inside the assembly instead. */
|
|
54
|
+
chaptersOf(session: SuggestSession): Promise<ChapterHistoryEntry[]>;
|
|
55
|
+
/** #188: the selected model's real context window, for the derived budget; null ⇒ no window
|
|
56
|
+
* known ⇒ the config fallback, loudly sourced. Absent dep ⇒ same fallback. */
|
|
57
|
+
resolveWindow?(route: PromptRoute): Promise<number | null>;
|
|
58
|
+
/** #188: the core rules in force for this session (the block a rebuilt head renders from). */
|
|
59
|
+
rulesOf?(session: SuggestSession): Promise<string>;
|
|
60
|
+
/** #188: the active plan text, when one governs the session. */
|
|
61
|
+
planOf?(session: SuggestSession): Promise<string>;
|
|
56
62
|
config: PromptConfig;
|
|
57
63
|
/** The last route the conversation used on this plane, or null. */
|
|
58
64
|
conversationRoute(): PromptRoute | null;
|
|
@@ -64,7 +70,8 @@ export interface PromptDeps {
|
|
|
64
70
|
* surface events (what the working model sees — the same view the defining model reads). */
|
|
65
71
|
export interface SuggestSession {
|
|
66
72
|
id: string;
|
|
67
|
-
title?: string | undefined;
|
|
73
|
+
title?: string | undefined; /** #188: the workspace the chapter paths resolve against (the caller's cwd). */
|
|
74
|
+
cwd?: string | undefined;
|
|
68
75
|
events: SessionEventLike[]; /** #113: when a goal governs the session, the constraint on the next step — see `goalDirectiveOf`. Text, not a goal object: goal semantics stay in one module. */
|
|
69
76
|
goalDirective?: string | undefined;
|
|
70
77
|
}
|
|
@@ -79,8 +86,16 @@ export interface PromptSurface {
|
|
|
79
86
|
suggest(session: SuggestSession): Promise<PromptSuggestionResult>;
|
|
80
87
|
/** #113: the Suggested Next Step bar's server-side access — the row plus the process-local loop flags. */
|
|
81
88
|
bar?: import('./prompt-state.ts').PromptBarAccess;
|
|
82
|
-
/** the
|
|
83
|
-
|
|
89
|
+
/** #188: the EFFECTIVE caps with their sources, so an output can state the number it validated
|
|
90
|
+
* against AND where it came from (stored beside the model, derived from its window, or config). */
|
|
91
|
+
limits(route: PromptRoute | null): Promise<PromptLimits & {
|
|
92
|
+
sources: PromptLimitSources;
|
|
93
|
+
}>;
|
|
94
|
+
/** #188: the caps ride beside the model — stored strings ('' deletes), validated by the caller. */
|
|
95
|
+
setCaps?(opts: {
|
|
96
|
+
maxChars?: string | null;
|
|
97
|
+
contextChars?: string | null;
|
|
98
|
+
}): Promise<void>;
|
|
84
99
|
/** One line for /chapters-status — ON names the model, OFF names the command. */
|
|
85
100
|
statusLine(): string;
|
|
86
101
|
}
|
|
@@ -110,16 +125,73 @@ export declare function tailFromEvents(events: SessionEventLike[]): {
|
|
|
110
125
|
role: 'user' | 'assistant';
|
|
111
126
|
text: string;
|
|
112
127
|
}[];
|
|
128
|
+
/** One chapter of the assembled history (#188): the index facts PLUS the trajectory. A model that
|
|
129
|
+
* cannot research gains nothing from an index it cannot follow — so each chapter carries its plots. */
|
|
130
|
+
export interface ChapterHistoryEntry {
|
|
131
|
+
number: number;
|
|
132
|
+
title: string;
|
|
133
|
+
summary: string;
|
|
134
|
+
plots: string[];
|
|
135
|
+
}
|
|
136
|
+
/** The settings keys the caps ride beside the model in (#188): switch models, switch its caps. */
|
|
137
|
+
export declare const PROMPT_MAXCHARS_KEY = "prompt.maxChars";
|
|
138
|
+
export declare const PROMPT_CONTEXTCHARS_KEY = "prompt.contextChars";
|
|
139
|
+
/**
|
|
140
|
+
* Extract a chapter's trajectory from its archived bytes, deterministically: every line-start `PLOT:`
|
|
141
|
+
* in order, consecutive duplicates collapsed (a checkpoint carries the plot forward verbatim — a
|
|
142
|
+
* repeat, not a new fact). Zero model tokens, works on chapters archived before this feature existed,
|
|
143
|
+
* and prose that merely mentions the word mid-line is not a plot line.
|
|
144
|
+
*/
|
|
145
|
+
export declare function extractPlots(body: string): string[];
|
|
146
|
+
export interface PromptLimitSources {
|
|
147
|
+
maxChars: 'stored' | 'config';
|
|
148
|
+
contextChars: 'stored' | 'derived' | 'config';
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* The caps resolution chain (#188): stored-beside-the-model → derived from the model's REAL context
|
|
152
|
+
* window (`window × ratio` tokens at the repo's one estimator, 4 chars/token) → config fallback. A
|
|
153
|
+
* 1M-window model and a 32K model get budgets 30× apart from ONE rule; a garbage stored value is
|
|
154
|
+
* ignored rather than parsed into a NaN budget; and the source of each number is reported, because a
|
|
155
|
+
* cap nobody can attribute is a cap nobody can tune.
|
|
156
|
+
*/
|
|
157
|
+
export declare function resolvePromptLimits(input: {
|
|
158
|
+
config: {
|
|
159
|
+
maxChars: number;
|
|
160
|
+
contextChars: number;
|
|
161
|
+
contextRatio: number;
|
|
162
|
+
};
|
|
163
|
+
window?: number | null;
|
|
164
|
+
stored?: {
|
|
165
|
+
maxChars?: string;
|
|
166
|
+
contextChars?: string;
|
|
167
|
+
};
|
|
168
|
+
}): {
|
|
169
|
+
maxChars: number;
|
|
170
|
+
contextChars: number;
|
|
171
|
+
sources: PromptLimitSources;
|
|
172
|
+
};
|
|
173
|
+
/**
|
|
174
|
+
* The LAST turn, whole (#188): from the final human request through every assistant text that
|
|
175
|
+
* followed it. Reuses the tail's defusing machinery (host-injected context screened, reminder spans
|
|
176
|
+
* stripped) and then keeps only the closing exchange — the present the director must follow from.
|
|
177
|
+
* Never sliced: a message enters whole or the assembly refuses.
|
|
178
|
+
*/
|
|
179
|
+
export declare function lastTurnFromEvents(events: SessionEventLike[]): {
|
|
180
|
+
role: 'user' | 'assistant';
|
|
181
|
+
text: string;
|
|
182
|
+
}[];
|
|
113
183
|
export interface SuggestFacts {
|
|
114
184
|
/** #113: the active goal's constraint on the next step, already worded. Absent ⇒ no goal block. */
|
|
115
185
|
goalDirective?: string | undefined;
|
|
186
|
+
/** #188: the active plan text, when one governs the session. */
|
|
187
|
+
plan?: string | undefined;
|
|
188
|
+
/** #188: the core rules in force — the same block a rebuilt head renders from. */
|
|
189
|
+
rules?: string | undefined;
|
|
116
190
|
title?: string | undefined;
|
|
117
|
-
chapters
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}[];
|
|
122
|
-
tail: {
|
|
191
|
+
/** The ancestor path's chapters, oldest first, each with its plots (#188). */
|
|
192
|
+
chapters: ChapterHistoryEntry[];
|
|
193
|
+
/** The last turn whole: the human's request through the final response (#188 — never sliced). */
|
|
194
|
+
lastTurn: {
|
|
123
195
|
role: 'user' | 'assistant';
|
|
124
196
|
text: string;
|
|
125
197
|
}[];
|
|
@@ -130,7 +202,23 @@ export interface SuggestFacts {
|
|
|
130
202
|
* messages; every drop is ANNOUNCED in the input itself — a silent squeeze
|
|
131
203
|
* would make the answer look derived from bytes that were never sent.
|
|
132
204
|
*/
|
|
133
|
-
|
|
205
|
+
/**
|
|
206
|
+
* Assemble the director's whole world (#188). Deterministic: same facts ⇒ same bytes.
|
|
207
|
+
*
|
|
208
|
+
* Two invariants the old assembly violated and this one exists to keep:
|
|
209
|
+
* - ZERO TRUNCATION. Nothing the model reads is ever sliced — the old 500-char per-message ellipsis
|
|
210
|
+
* is a hallucination invite and is gone. Messages and chapters enter whole or not at all.
|
|
211
|
+
* - The budget is enforced ONLY by the drop ladder: over budget, the OLDEST chapter goes first (the
|
|
212
|
+
* recent trajectory is what leads), each drop ANNOUNCED in the input itself. The protected set —
|
|
213
|
+
* skeleton, goal (objective whole; the old 600-char slice was itself a truncation), plan, rules,
|
|
214
|
+
* last turn — never slices; if it alone cannot fit, the suggestion REFUSES with the numbers.
|
|
215
|
+
* A refused suggestion costs one turn; a truncated one poisons the next.
|
|
216
|
+
*/
|
|
217
|
+
export declare function buildSuggestInput(facts: SuggestFacts, budgetChars: number, maxChars: number): {
|
|
218
|
+
input: string;
|
|
219
|
+
} | {
|
|
220
|
+
refusal: string;
|
|
221
|
+
};
|
|
134
222
|
/**
|
|
135
223
|
* Validate one answer. A wrapping code fence or one pair of wrapping quotes is
|
|
136
224
|
* formatting noise and comes off; the rest is the human's next prompt verbatim.
|
|
@@ -158,3 +246,16 @@ export declare function promptChaptersOf(state: SessionState): {
|
|
|
158
246
|
title: string;
|
|
159
247
|
summary: string;
|
|
160
248
|
}[];
|
|
249
|
+
/**
|
|
250
|
+
* The ancestor path's chapters with their plots (#188), oldest line first. `rows` is the lineage
|
|
251
|
+
* root-first INCLUDING the live session; `readBody` fetches one chapter's archived bytes so the
|
|
252
|
+
* plots come out of the durable archive itself — deterministic, zero model tokens, and it works on
|
|
253
|
+
* chapters archived before this feature existed. A body that cannot be read contributes its index
|
|
254
|
+
* facts with no plots: a missing file degrades the trajectory, never the assembly.
|
|
255
|
+
*/
|
|
256
|
+
export declare function promptChaptersForLineage(opts: {
|
|
257
|
+
rows: {
|
|
258
|
+
chapters: SessionState['chapters'];
|
|
259
|
+
}[];
|
|
260
|
+
readBody: (path: string) => string | null;
|
|
261
|
+
}): ChapterHistoryEntry[];
|
package/lib/prompt.js
CHANGED
|
@@ -75,86 +75,148 @@ export function tailFromEvents(events) {
|
|
|
75
75
|
}
|
|
76
76
|
return out;
|
|
77
77
|
}
|
|
78
|
-
/**
|
|
79
|
-
|
|
80
|
-
const
|
|
78
|
+
/** The settings keys the caps ride beside the model in (#188): switch models, switch its caps. */
|
|
79
|
+
export const PROMPT_MAXCHARS_KEY = 'prompt.maxChars';
|
|
80
|
+
export const PROMPT_CONTEXTCHARS_KEY = 'prompt.contextChars';
|
|
81
|
+
/**
|
|
82
|
+
* Extract a chapter's trajectory from its archived bytes, deterministically: every line-start `PLOT:`
|
|
83
|
+
* in order, consecutive duplicates collapsed (a checkpoint carries the plot forward verbatim — a
|
|
84
|
+
* repeat, not a new fact). Zero model tokens, works on chapters archived before this feature existed,
|
|
85
|
+
* and prose that merely mentions the word mid-line is not a plot line.
|
|
86
|
+
*/
|
|
87
|
+
export function extractPlots(body) {
|
|
88
|
+
const out = [];
|
|
89
|
+
for (const raw of body.split('\n')) {
|
|
90
|
+
const m = /^PLOT:[ \t]*(.+)$/.exec(raw.trim());
|
|
91
|
+
if (m === null)
|
|
92
|
+
continue;
|
|
93
|
+
const t = m[1].trim();
|
|
94
|
+
if (t === '')
|
|
95
|
+
continue;
|
|
96
|
+
if (out.length > 0 && out[out.length - 1] === t)
|
|
97
|
+
continue;
|
|
98
|
+
out.push(t);
|
|
99
|
+
}
|
|
100
|
+
return out;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* The caps resolution chain (#188): stored-beside-the-model → derived from the model's REAL context
|
|
104
|
+
* window (`window × ratio` tokens at the repo's one estimator, 4 chars/token) → config fallback. A
|
|
105
|
+
* 1M-window model and a 32K model get budgets 30× apart from ONE rule; a garbage stored value is
|
|
106
|
+
* ignored rather than parsed into a NaN budget; and the source of each number is reported, because a
|
|
107
|
+
* cap nobody can attribute is a cap nobody can tune.
|
|
108
|
+
*/
|
|
109
|
+
export function resolvePromptLimits(input) {
|
|
110
|
+
const posInt = (v) => {
|
|
111
|
+
if (v === undefined)
|
|
112
|
+
return null;
|
|
113
|
+
const t = v.trim();
|
|
114
|
+
if (!/^\d+$/.test(t))
|
|
115
|
+
return null;
|
|
116
|
+
const n = Number(t);
|
|
117
|
+
return Number.isFinite(n) && n > 0 ? n : null;
|
|
118
|
+
};
|
|
119
|
+
const sm = posInt(input.stored?.maxChars);
|
|
120
|
+
const sc = posInt(input.stored?.contextChars);
|
|
121
|
+
const w = input.window;
|
|
122
|
+
const derived = w !== undefined && w !== null && Number.isFinite(w) && w > 0
|
|
123
|
+
? Math.floor(w * input.config.contextRatio * 4)
|
|
124
|
+
: null;
|
|
125
|
+
const useDerived = derived !== null && derived > 0;
|
|
126
|
+
return {
|
|
127
|
+
maxChars: sm ?? input.config.maxChars,
|
|
128
|
+
contextChars: sc ?? (useDerived ? derived : input.config.contextChars),
|
|
129
|
+
sources: {
|
|
130
|
+
maxChars: sm !== null ? 'stored' : 'config',
|
|
131
|
+
contextChars: sc !== null ? 'stored' : (useDerived ? 'derived' : 'config'),
|
|
132
|
+
},
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* The LAST turn, whole (#188): from the final human request through every assistant text that
|
|
137
|
+
* followed it. Reuses the tail's defusing machinery (host-injected context screened, reminder spans
|
|
138
|
+
* stripped) and then keeps only the closing exchange — the present the director must follow from.
|
|
139
|
+
* Never sliced: a message enters whole or the assembly refuses.
|
|
140
|
+
*/
|
|
141
|
+
export function lastTurnFromEvents(events) {
|
|
142
|
+
const tail = tailFromEvents(events);
|
|
143
|
+
let from = -1;
|
|
144
|
+
for (let i = tail.length - 1; i >= 0; i--) {
|
|
145
|
+
if (tail[i].role === 'user') {
|
|
146
|
+
from = i;
|
|
147
|
+
break;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return from === -1 ? tail : tail.slice(from);
|
|
151
|
+
}
|
|
81
152
|
/**
|
|
82
153
|
* Assemble the auxiliary input: deterministic (same facts ⇒ same bytes), hard
|
|
83
154
|
* total ≤ `capChars`. Oldest chapter lines drop first, then oldest tail
|
|
84
155
|
* messages; every drop is ANNOUNCED in the input itself — a silent squeeze
|
|
85
156
|
* would make the answer look derived from bytes that were never sent.
|
|
86
157
|
*/
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
158
|
+
/**
|
|
159
|
+
* Assemble the director's whole world (#188). Deterministic: same facts ⇒ same bytes.
|
|
160
|
+
*
|
|
161
|
+
* Two invariants the old assembly violated and this one exists to keep:
|
|
162
|
+
* - ZERO TRUNCATION. Nothing the model reads is ever sliced — the old 500-char per-message ellipsis
|
|
163
|
+
* is a hallucination invite and is gone. Messages and chapters enter whole or not at all.
|
|
164
|
+
* - The budget is enforced ONLY by the drop ladder: over budget, the OLDEST chapter goes first (the
|
|
165
|
+
* recent trajectory is what leads), each drop ANNOUNCED in the input itself. The protected set —
|
|
166
|
+
* skeleton, goal (objective whole; the old 600-char slice was itself a truncation), plan, rules,
|
|
167
|
+
* last turn — never slices; if it alone cannot fit, the suggestion REFUSES with the numbers.
|
|
168
|
+
* A refused suggestion costs one turn; a truncated one poisons the next.
|
|
169
|
+
*/
|
|
170
|
+
export function buildSuggestInput(facts, budgetChars, maxChars) {
|
|
171
|
+
const head = 'You are the second reader of a DSH session — a model that DEFINES the next step and never executes it.';
|
|
172
|
+
const replyRules = `Write the ONE next prompt the human should send. A single imperative request; plain text; at most ${maxChars} characters; no preamble, no quotes, no markdown; it must follow from the latest state and propose nothing already done. Reply with ONLY that prompt. If it changes the standing objective, prefix it with GOAL: (the human sends those; autorun will not). Do not use the prefix for an ordinary next step.`;
|
|
173
|
+
const chapterBlock = (dropOldest) => {
|
|
174
|
+
const cs = facts.chapters.slice(dropOldest);
|
|
175
|
+
if (cs.length === 0)
|
|
176
|
+
return ['## Where it has been (no chapters yet)'];
|
|
177
|
+
const out = ['## Where it has been (chapters, oldest first — title, summary, and the plots that carry the trajectory)'];
|
|
178
|
+
for (const c of cs) {
|
|
179
|
+
out.push(`${c.number}. ${c.title} — ${c.summary}`);
|
|
180
|
+
if (c.plots.length > 0) {
|
|
181
|
+
out.push(' Plots:');
|
|
182
|
+
for (const pl of c.plots)
|
|
183
|
+
out.push(` - ${pl}`);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
return out;
|
|
187
|
+
};
|
|
188
|
+
const assemble = (dropOldest) => {
|
|
97
189
|
const parts = [
|
|
98
190
|
head,
|
|
99
191
|
'',
|
|
100
192
|
`## Session${facts.title !== undefined && facts.title !== '' ? `: ${facts.title}` : ''}`,
|
|
101
|
-
// #113: the goal is stated BEFORE the history
|
|
102
|
-
//
|
|
103
|
-
|
|
104
|
-
...(facts.
|
|
105
|
-
|
|
106
|
-
: []),
|
|
193
|
+
// #113: the goal is stated BEFORE the history — it decides whether a candidate next step counts
|
|
194
|
+
// as progress, so it is never a footnote. #188: the plan and the standing orders ride with it.
|
|
195
|
+
...(facts.goalDirective !== undefined && facts.goalDirective !== '' ? ['', String(facts.goalDirective)] : []),
|
|
196
|
+
...(facts.plan !== undefined && facts.plan !== '' ? ['', '## Active plan', String(facts.plan)] : []),
|
|
197
|
+
...(facts.rules !== undefined && facts.rules !== '' ? ['', '## Standing orders', String(facts.rules)] : []),
|
|
107
198
|
'',
|
|
108
|
-
|
|
109
|
-
...chapters.map((c) => `${c.number}. ${c.title} — ${c.summary}`),
|
|
199
|
+
...chapterBlock(dropOldest),
|
|
110
200
|
'',
|
|
111
|
-
|
|
112
|
-
|
|
201
|
+
...(facts.lastTurn.length > 0
|
|
202
|
+
? ['## Last turn (request through final response)', ...facts.lastTurn.map((m) => `${m.role === 'user' ? 'Human' : 'Assistant'}: ${m.text}`)]
|
|
203
|
+
: ['## Last turn (empty)']),
|
|
113
204
|
];
|
|
114
|
-
if (
|
|
115
|
-
parts.push(
|
|
116
|
-
|
|
205
|
+
if (dropOldest > 0) {
|
|
206
|
+
parts.push(`(older chapters dropped to fit the ${budgetChars}-char budget: ${dropOldest} chapter(s) — the recent trajectory leads)`);
|
|
207
|
+
}
|
|
208
|
+
parts.push('', replyRules);
|
|
117
209
|
return parts.join('\n');
|
|
118
210
|
};
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
for (;;) {
|
|
124
|
-
const announce = droppedChapters + droppedTail === 0
|
|
125
|
-
? ''
|
|
126
|
-
: `\n(older context dropped to fit the ${capChars}-char budget: ${droppedChapters} chapter line(s), ${droppedTail} message(s))`;
|
|
127
|
-
const input = render(announce);
|
|
128
|
-
if (input.length <= capChars)
|
|
129
|
-
return input;
|
|
130
|
-
if (chapters.length > 0) {
|
|
131
|
-
chapters.shift();
|
|
132
|
-
droppedChapters += 1;
|
|
133
|
-
continue;
|
|
134
|
-
}
|
|
135
|
-
if (tail.length > 1) {
|
|
136
|
-
tail.shift();
|
|
137
|
-
droppedTail += 1;
|
|
138
|
-
continue;
|
|
139
|
-
}
|
|
140
|
-
if (msgCap > 40) {
|
|
141
|
-
msgCap = Math.max(40, Math.floor(msgCap / 2));
|
|
142
|
-
continue;
|
|
143
|
-
}
|
|
144
|
-
if (tail.length === 1) {
|
|
145
|
-
tail = [];
|
|
146
|
-
droppedTail += 1;
|
|
147
|
-
continue;
|
|
148
|
-
}
|
|
149
|
-
// Every compressible part is gone and the input is STILL over cap: the fixed frame (head + rules +
|
|
150
|
-
// section scaffolding) alone exceeds `promptContextChars`. That was previously returned in silence,
|
|
151
|
-
// which is the #61 class exactly — the code knows, and says nothing. It cannot be truncated (invariant:
|
|
152
|
-
// refuse or announce, never clip), so it announces what happened and how to fix it. Surfaced by my own
|
|
153
|
-
// added rules text, which is how I found it: a longer frame made a tight fixture impossible to fit.
|
|
154
|
-
return input.length > capChars
|
|
155
|
-
? `${input}\n(frame alone exceeds the ${String(capChars)}-char budget by ${String(input.length - capChars)} chars — raise promptContextChars; nothing was truncated)`
|
|
156
|
-
: input;
|
|
211
|
+
for (let drop = 0; drop <= facts.chapters.length; drop++) {
|
|
212
|
+
const input = assemble(drop);
|
|
213
|
+
if (input.length <= budgetChars)
|
|
214
|
+
return { input };
|
|
157
215
|
}
|
|
216
|
+
const floor = assemble(facts.chapters.length).length;
|
|
217
|
+
return {
|
|
218
|
+
refusal: `the suggestion input cannot fit — the protected context (goal, plan, rules, last turn) assembles to ${floor} chars, exceeding the ${budgetChars}-char budget with all ${facts.chapters.length} chapter(s) already dropped. Refusing rather than truncating (#188): raise the budget or set a larger model with /chapters-prompt model.`,
|
|
219
|
+
};
|
|
158
220
|
}
|
|
159
221
|
/**
|
|
160
222
|
* Validate one answer. A wrapping code fence or one pair of wrapping quotes is
|
|
@@ -186,6 +248,29 @@ export function createPromptSurface(deps) {
|
|
|
186
248
|
const inflight = new Map();
|
|
187
249
|
const refuse = (reason, quiet = false) => ({ ok: false, text: reason, ...(quiet ? { quiet: true } : {}) });
|
|
188
250
|
const effective = () => effectivePromptSpec(deps.getSetting(PROMPT_SETTING_KEY), deps.config.model);
|
|
251
|
+
// #188: one resolution for BOTH the run path and `limits()` — stored beside the model, then the
|
|
252
|
+
// model's real window by ratio, then config. Two ladders would drift; one cannot.
|
|
253
|
+
const resolveLimits = async (route) => {
|
|
254
|
+
const storedMax = deps.getSetting(PROMPT_MAXCHARS_KEY);
|
|
255
|
+
const storedCtx = deps.getSetting(PROMPT_CONTEXTCHARS_KEY);
|
|
256
|
+
let window = null;
|
|
257
|
+
if (route !== null && deps.resolveWindow !== undefined) {
|
|
258
|
+
try {
|
|
259
|
+
window = await deps.resolveWindow(route);
|
|
260
|
+
}
|
|
261
|
+
catch {
|
|
262
|
+
window = null;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
return resolvePromptLimits({
|
|
266
|
+
config: { maxChars: deps.config.maxChars, contextChars: deps.config.contextChars, contextRatio: deps.config.contextRatio },
|
|
267
|
+
window,
|
|
268
|
+
stored: {
|
|
269
|
+
...(storedMax !== undefined ? { maxChars: storedMax } : {}),
|
|
270
|
+
...(storedCtx !== undefined ? { contextChars: storedCtx } : {}),
|
|
271
|
+
},
|
|
272
|
+
});
|
|
273
|
+
};
|
|
189
274
|
const run = async (session, seq) => {
|
|
190
275
|
const { spec } = effective();
|
|
191
276
|
const { route, reason } = resolvePromptRoute(spec, deps.conversationRoute());
|
|
@@ -193,23 +278,38 @@ export function createPromptSurface(deps) {
|
|
|
193
278
|
return refuse(`prompt suggestions cannot run: ${reason ?? 'no route'}`);
|
|
194
279
|
let input;
|
|
195
280
|
let chaptersCount = 0;
|
|
281
|
+
// Defaults, so a refusal inside the try still leaves a truthful cap for the retry line.
|
|
282
|
+
let limits = { maxChars: deps.config.maxChars, contextChars: deps.config.contextChars };
|
|
196
283
|
try {
|
|
197
|
-
const chapters = await deps.chaptersOf(session
|
|
284
|
+
const chapters = await deps.chaptersOf(session);
|
|
198
285
|
chaptersCount = chapters.length;
|
|
199
|
-
|
|
200
|
-
|
|
286
|
+
limits = await resolveLimits(route);
|
|
287
|
+
const lastTurn = lastTurnFromEvents(session.events);
|
|
288
|
+
const rules = deps.rulesOf !== undefined ? await deps.rulesOf(session) : '';
|
|
289
|
+
const plan = deps.planOf !== undefined ? await deps.planOf(session) : '';
|
|
290
|
+
const built = buildSuggestInput({
|
|
291
|
+
...(session.title !== undefined ? { title: session.title } : {}),
|
|
292
|
+
...(session.goalDirective !== undefined ? { goalDirective: session.goalDirective } : {}),
|
|
293
|
+
...(plan !== '' ? { plan } : {}),
|
|
294
|
+
...(rules !== '' ? { rules } : {}),
|
|
295
|
+
chapters,
|
|
296
|
+
lastTurn,
|
|
297
|
+
}, limits.contextChars, limits.maxChars);
|
|
298
|
+
if ('refusal' in built)
|
|
299
|
+
return refuse(`no recommendation: ${built.refusal}`);
|
|
300
|
+
input = built.input;
|
|
201
301
|
}
|
|
202
302
|
catch (error) {
|
|
203
303
|
return refuse(`could not assemble the context: ${String(error?.message ?? error).slice(0, 160)}`);
|
|
204
304
|
}
|
|
205
|
-
const cap = `Remember: reply with ONLY the suggested prompt, plain text, at most ${
|
|
305
|
+
const cap = `Remember: reply with ONLY the suggested prompt, plain text, at most ${limits.maxChars} characters.`;
|
|
206
306
|
try {
|
|
207
307
|
let text = await deps.fetch(input, route);
|
|
208
|
-
let verdict = validateSuggestion(text,
|
|
308
|
+
let verdict = validateSuggestion(text, limits.maxChars);
|
|
209
309
|
if (!verdict.ok) {
|
|
210
|
-
deps.warn?.(`prompt retry (${verdict.reason}) after ${chaptersCount} chapter
|
|
310
|
+
deps.warn?.(`prompt retry (${verdict.reason}) after ${chaptersCount} chapter(s) + last turn`);
|
|
211
311
|
text = await deps.fetch(`${input}\n${cap}`, route);
|
|
212
|
-
verdict = validateSuggestion(text,
|
|
312
|
+
verdict = validateSuggestion(text, limits.maxChars);
|
|
213
313
|
}
|
|
214
314
|
if (!verdict.ok)
|
|
215
315
|
return refuse(`no recommendation: ${verdict.reason}`);
|
|
@@ -261,7 +361,21 @@ export function createPromptSurface(deps) {
|
|
|
261
361
|
inflight.set(session.id, job);
|
|
262
362
|
return await job;
|
|
263
363
|
},
|
|
264
|
-
limits: () => (
|
|
364
|
+
limits: (route) => resolveLimits(route),
|
|
365
|
+
setCaps: async (opts) => {
|
|
366
|
+
if (opts.maxChars !== undefined) {
|
|
367
|
+
if (opts.maxChars === null || opts.maxChars === '')
|
|
368
|
+
await deps.deleteSetting(PROMPT_MAXCHARS_KEY);
|
|
369
|
+
else
|
|
370
|
+
await deps.putSetting(PROMPT_MAXCHARS_KEY, opts.maxChars);
|
|
371
|
+
}
|
|
372
|
+
if (opts.contextChars !== undefined) {
|
|
373
|
+
if (opts.contextChars === null || opts.contextChars === '')
|
|
374
|
+
await deps.deleteSetting(PROMPT_CONTEXTCHARS_KEY);
|
|
375
|
+
else
|
|
376
|
+
await deps.putSetting(PROMPT_CONTEXTCHARS_KEY, opts.contextChars);
|
|
377
|
+
}
|
|
378
|
+
},
|
|
265
379
|
statusLine() {
|
|
266
380
|
const { spec, source } = effective();
|
|
267
381
|
if (spec === '')
|
|
@@ -274,4 +388,21 @@ export function createPromptSurface(deps) {
|
|
|
274
388
|
export function promptChaptersOf(state) {
|
|
275
389
|
return state.chapters.filter(isActiveChapter).map((c) => ({ number: c.number, title: c.title, summary: c.summary }));
|
|
276
390
|
}
|
|
391
|
+
/**
|
|
392
|
+
* The ancestor path's chapters with their plots (#188), oldest line first. `rows` is the lineage
|
|
393
|
+
* root-first INCLUDING the live session; `readBody` fetches one chapter's archived bytes so the
|
|
394
|
+
* plots come out of the durable archive itself — deterministic, zero model tokens, and it works on
|
|
395
|
+
* chapters archived before this feature existed. A body that cannot be read contributes its index
|
|
396
|
+
* facts with no plots: a missing file degrades the trajectory, never the assembly.
|
|
397
|
+
*/
|
|
398
|
+
export function promptChaptersForLineage(opts) {
|
|
399
|
+
const out = [];
|
|
400
|
+
for (const row of opts.rows) {
|
|
401
|
+
for (const c of row.chapters.filter(isActiveChapter)) {
|
|
402
|
+
const body = opts.readBody(c.path) ?? '';
|
|
403
|
+
out.push({ number: c.number, title: c.title, summary: c.summary, plots: body === '' ? [] : extractPlots(body) });
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
return out;
|
|
407
|
+
}
|
|
277
408
|
//# sourceMappingURL=prompt.js.map
|
package/lib/prompt.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../src/prompt.ts"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AAI,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;QAClH,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC"}
|
package/lib/version.d.ts
CHANGED
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
* reader cannot recover later, so it belongs in the bytes. A row in tests asserts this literal equals
|
|
7
7
|
* `package.json`'s version — the one place a hand-mirrored constant must never be allowed to drift.
|
|
8
8
|
*/
|
|
9
|
-
export declare const PLUGIN_VERSION = "0.2.
|
|
9
|
+
export declare const PLUGIN_VERSION = "0.2.4";
|
package/lib/version.js
CHANGED
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
* reader cannot recover later, so it belongs in the bytes. A row in tests asserts this literal equals
|
|
7
7
|
* `package.json`'s version — the one place a hand-mirrored constant must never be allowed to drift.
|
|
8
8
|
*/
|
|
9
|
-
export const PLUGIN_VERSION = '0.2.
|
|
9
|
+
export const PLUGIN_VERSION = '0.2.4';
|
|
10
10
|
//# sourceMappingURL=version.js.map
|