@treeseed/dsh-chapters 0.2.7 → 0.2.9
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/docs/contract.md +40 -0
- package/lib/client.js +221 -27
- package/lib/client.js.map +1 -1
- package/lib/commands.js +26 -4
- package/lib/commands.js.map +1 -1
- package/lib/index.js +78 -5
- package/lib/index.js.map +1 -1
- package/lib/prompt-keys.d.ts +7 -0
- package/lib/prompt-keys.js +8 -0
- package/lib/prompt-keys.js.map +1 -0
- package/lib/prompt-push.d.ts +47 -0
- package/lib/prompt-push.js +115 -0
- package/lib/prompt-push.js.map +1 -0
- package/lib/prompt-runner.d.ts +4 -0
- package/lib/prompt-runner.js +5 -0
- package/lib/prompt-runner.js.map +1 -1
- package/lib/prompt-state.d.ts +10 -5
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {
|
|
2
|
+
if (typeof path === "string" && /^\.\.?\//.test(path)) {
|
|
3
|
+
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
|
|
4
|
+
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
|
|
5
|
+
});
|
|
6
|
+
}
|
|
7
|
+
return path;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* The push transport (#194): the bar's state as a durable plugin record + a projection fold.
|
|
11
|
+
*
|
|
12
|
+
* Probe-verified on host 0.2.1-rc.5 (spikes/push-probe/FINDINGS.md — four real boots):
|
|
13
|
+
* - `appendPluginRecord` commits `ignorable: true` records; unknown `plugin:` types are skipped by
|
|
14
|
+
* readers and rendered by nothing, so the steady state writes ZERO history nodes.
|
|
15
|
+
* - The function MUST come from the host's own module instance: the plugin's own copy at the
|
|
16
|
+
* IDENTICAL version throws `Receiver must be an instance of class Session` against a host
|
|
17
|
+
* session, and a bare import from a `link:` install resolves by realpath into the source tree
|
|
18
|
+
* (on a dev machine: a different host checkout than the running server). Hence the host-anchored
|
|
19
|
+
* createRequire recipe below, one try behind try/catch, failure = pull fallback for the process.
|
|
20
|
+
* - The projection is registered ONLY when the writer resolved — registration is the feature
|
|
21
|
+
* signal the client reads through the standard `useProjection` seat (undefined ⇒ pull schedule).
|
|
22
|
+
*/
|
|
23
|
+
import { createRequire } from 'node:module';
|
|
24
|
+
import { z } from 'zod';
|
|
25
|
+
/** The record grammar: lowercase segments, each starting with a letter or digit (host grammar). */
|
|
26
|
+
export const PROMPT_RECORD_TYPE = 'plugin:dsh-chapters/prompt';
|
|
27
|
+
/** Projection key — shared with the client through ONE module (src/prompt-keys.ts), never retyped. */
|
|
28
|
+
export { PROMPT_PROJECTION_KEY } from "./prompt-keys.js";
|
|
29
|
+
import { PROMPT_PROJECTION_KEY } from "./prompt-keys.js";
|
|
30
|
+
export function promptRecordPayload(facts) {
|
|
31
|
+
return { v: 1, ...facts };
|
|
32
|
+
}
|
|
33
|
+
/** Projection fold: ours last-wins (each record carries the WHOLE state), anything else is not ours. */
|
|
34
|
+
export function foldPromptRecord(state, event) {
|
|
35
|
+
if (event === null || event === undefined)
|
|
36
|
+
return state;
|
|
37
|
+
if (event.type !== PROMPT_RECORD_TYPE)
|
|
38
|
+
return state;
|
|
39
|
+
const d = event.data;
|
|
40
|
+
if (d === undefined || d === null || d.v !== 1 || typeof d.status !== 'string')
|
|
41
|
+
return state;
|
|
42
|
+
return d;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* The projection definition, duck-typed schemas included (the probe measured that the host's
|
|
46
|
+
* register accepts `{parse}` shapes; zod is not required and would be a second schema system here).
|
|
47
|
+
* Kept a value builder so the wiring can register it only when the writer resolved.
|
|
48
|
+
*/
|
|
49
|
+
const promptPayloadSchema = z.object({
|
|
50
|
+
v: z.literal(1),
|
|
51
|
+
status: z.enum(['off', 'analyzing', 'ready', 'failed']),
|
|
52
|
+
text: z.string(),
|
|
53
|
+
turnSeq: z.number().nullable(),
|
|
54
|
+
error: z.string(),
|
|
55
|
+
intent: z.enum(['worker-step', 'goal-edit']),
|
|
56
|
+
goalRevision: z.number().nullable(),
|
|
57
|
+
autorun: z.enum(['armed', 'disarmed']),
|
|
58
|
+
at: z.string(),
|
|
59
|
+
});
|
|
60
|
+
/**
|
|
61
|
+
* #218: REAL zod schemas, like the goal projection — the duck-typed `{parse}` shapes passed the
|
|
62
|
+
* server-side fold (the probe measured `stateOf` working) but the CLIENT delivery validates
|
|
63
|
+
* through `wire.viewSchema`, and an object that is not a real schema can fail that validation
|
|
64
|
+
* silently — killing the one hop this transport exists to provide. Same shape as the goal
|
|
65
|
+
* definition: stateSchema, init, apply, wire, stateVersion.
|
|
66
|
+
*/
|
|
67
|
+
export function promptProjectionDefinition() {
|
|
68
|
+
return {
|
|
69
|
+
key: PROMPT_PROJECTION_KEY,
|
|
70
|
+
stateSchema: promptPayloadSchema.nullable(),
|
|
71
|
+
init: () => null,
|
|
72
|
+
apply: (state, event) => foldPromptRecord(state, event),
|
|
73
|
+
wire: { viewSchema: promptPayloadSchema.nullable(), view: (s) => s },
|
|
74
|
+
stateVersion: 2,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Resolve the host's own `appendPluginRecord`, or nothing. The anchor is the host binary
|
|
79
|
+
* (`process.argv[1]`), NOT this module's resolution scope — the probe measured every alternative
|
|
80
|
+
* failing (own copy: foreign class; bare import: realpath into the source tree). Injectable seams
|
|
81
|
+
* for tests; a production call passes nothing and reads the process.
|
|
82
|
+
*/
|
|
83
|
+
export async function resolvePushWriter(seams) {
|
|
84
|
+
const anchor = seams?.anchor ?? process.argv[1] ?? process.execPath;
|
|
85
|
+
try {
|
|
86
|
+
const req = seams?.requireFn ?? ((a) => createRequire(a));
|
|
87
|
+
const resolved = req(anchor).resolve('@deepseek-ai/dsh-session');
|
|
88
|
+
const mod = await (seams?.importFn ?? ((r) => import(__rewriteRelativeImportExtension(r))))(resolved);
|
|
89
|
+
const fn = mod.appendPluginRecord ?? mod.default?.appendPluginRecord;
|
|
90
|
+
if (typeof fn !== 'function') {
|
|
91
|
+
seams?.log?.(`prompt push: host module resolved but appendPluginRecord is absent (${resolved}) — pull transport stands`);
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
const append = fn;
|
|
95
|
+
return {
|
|
96
|
+
append(session, payload) {
|
|
97
|
+
try {
|
|
98
|
+
append(session, PROMPT_RECORD_TYPE, payload);
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
catch (error) {
|
|
102
|
+
// A failed append is a degraded push, never a crashed bar: the row write already happened,
|
|
103
|
+
// the client's staleness-confirm pull covers the gap, and the reason is logged (#61).
|
|
104
|
+
seams?.log?.(`prompt push: append failed (${String(error?.message ?? error).slice(0, 140)}) — the pull schedule covers this session`);
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
catch (error) {
|
|
111
|
+
seams?.log?.(`prompt push: unavailable on this host (${String(error?.message ?? error).slice(0, 140)}) — pull transport stands`);
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=prompt-push.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-push.js","sourceRoot":"","sources":["../src/prompt-push.ts"],"names":[],"mappings":";;;;;;;;AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,mGAAmG;AACnG,MAAM,CAAC,MAAM,kBAAkB,GAAG,4BAA4B,CAAA;AAE9D,sGAAsG;AACtG,OAAO,EAAE,q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CAAC;YAC7B,KAAK,EAAE,GAAG,EAAE,CAAC,uEAAuE,QAAQ,2BAA2B,CAAC,CAAA;YACxH,OAAO,IAAI,CAAA;QACb,CAAC;QACD,MAAM,MAAM,GAAG,EAA+D,CAAA;QAC9E,OAAO;YACL,MAAM,CAAC,OAAO,EAAE,OAAO;gBACrB,IAAI,CAAC;oBACH,MAAM,CAAC,OAAO,EAAE,kBAAkB,EAAE,OAAO,CAAC,CAAA;oBAC5C,OAAO,IAAI,CAAA;gBACb,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,2FAA2F;oBAC3F,sFAAsF;oBACtF,KAAK,EAAE,GAAG,EAAE,CAAC,+BAA+B,MAAM,CAAE,KAAe,EAAE,OAAO,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,2CAA2C,CAAC,CAAA;oBAChJ,OAAO,KAAK,CAAA;gBACd,CAAC;YACH,CAAC;SACF,CAAA;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,KAAK,EAAE,GAAG,EAAE,CAAC,0CAA0C,MAAM,CAAE,KAAe,EAAE,OAAO,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,2BAA2B,CAAC,CAAA;QAC3I,OAAO,IAAI,CAAA;IACb,CAAC;AACH,CAAC"}
|
package/lib/prompt-runner.d.ts
CHANGED
|
@@ -34,6 +34,10 @@ export interface PromptRunnerDeps {
|
|
|
34
34
|
* row it is supposed to be showing.
|
|
35
35
|
*/
|
|
36
36
|
onReady?: (sessionId: string, state: PromptSuggestionState) => void;
|
|
37
|
+
/** #194: mirror every durable row write to the push transport. The wiring owns payload assembly
|
|
38
|
+
* and ordering; the runner only reports (session, id) at each write. Failures here must never
|
|
39
|
+
* affect the round — the pull schedule and its staleness confirm cover a dead push. */
|
|
40
|
+
pushRow?: (session: unknown, sessionId: string) => void;
|
|
37
41
|
now: () => string;
|
|
38
42
|
log?: (message: string) => void;
|
|
39
43
|
warn?: (message: string) => void;
|
package/lib/prompt-runner.js
CHANGED
|
@@ -44,6 +44,7 @@ export function makePromptRoundRunner(deps) {
|
|
|
44
44
|
deps.log?.(`prompt: turn ${String(turnSeq)} already claimed for ${id}`);
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
|
+
deps.pushRow?.(session, id);
|
|
47
48
|
try {
|
|
48
49
|
const out = await deps.generate(session, turnSeq);
|
|
49
50
|
if (out.ok && typeof out.text === 'string' && out.text !== '') {
|
|
@@ -57,22 +58,26 @@ export function makePromptRoundRunner(deps) {
|
|
|
57
58
|
intent: offer.intent, goalRevision: out.goalRevision ?? null,
|
|
58
59
|
};
|
|
59
60
|
await write(id, ready);
|
|
61
|
+
deps.pushRow?.(session, id);
|
|
60
62
|
deps.log?.(`prompt: recommended next step ready for ${id} (turn ${String(turnSeq)}, ${offer.intent})`);
|
|
61
63
|
deps.onReady?.(id, ready);
|
|
62
64
|
return;
|
|
63
65
|
}
|
|
64
66
|
if (out.quiet === true) {
|
|
65
67
|
await write(id, { ...noSuggestion, turnSeq: null });
|
|
68
|
+
deps.pushRow?.(session, id);
|
|
66
69
|
deps.log?.(`prompt: nothing to recommend for ${id} — bar stays silent`);
|
|
67
70
|
return;
|
|
68
71
|
}
|
|
69
72
|
await write(id, { ...noSuggestion, status: 'failed', turnSeq, error: out.reason ?? 'the suggestion call returned nothing', at: deps.now() });
|
|
73
|
+
deps.pushRow?.(session, id);
|
|
70
74
|
deps.warn?.(`prompt: generation failed for ${id}: ${out.reason ?? 'unknown'}`);
|
|
71
75
|
}
|
|
72
76
|
catch (error) {
|
|
73
77
|
// A failed generation is a DELIVERED failure (#61): the bar shows it, it does not vanish.
|
|
74
78
|
const message = String(error?.message ?? error).slice(0, 200);
|
|
75
79
|
await write(id, { ...noSuggestion, status: 'failed', turnSeq, error: message, at: deps.now() }).catch(() => undefined);
|
|
80
|
+
deps.pushRow?.(session, id);
|
|
76
81
|
deps.warn?.(`prompt: generation threw for ${id}: ${message}`);
|
|
77
82
|
}
|
|
78
83
|
});
|
package/lib/prompt-runner.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompt-runner.js","sourceRoot":"","sources":["../src/prompt-runner.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,aAAa,EAAE,YAAY,EAA8B,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"prompt-runner.js","sourceRoot":"","sources":["../src/prompt-runner.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,aAAa,EAAE,YAAY,EAA8B,MAAM,mBAAmB,CAAA;AAuC3F,MAAM,UAAU,qBAAqB,CAAC,IAAsB;IAC1D,MAAM,MAAM,GAAG,IAAI,GAAG,EAAyB,CAAA;IAC/C,MAAM,OAAO,GAAG,CAAC,EAAU,EAAE,GAAwB,EAAQ,EAAE;QAC7D,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,OAAO,CAAC,OAAO,EAAE,CAAA;QAChD,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;QAChC,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC,CAAA;IAC7D,CAAC,CAAA;IACD,MAAM,KAAK,GAAG,KAAK,EAAE,EAAU,EAAE,IAA2B,EAAiB,EAAE;QAC7E,MAAM,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,GAAG,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;IAC5E,CAAC,CAAA;IAED,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE;QACxB,IAAI,CAAC;YACH,MAAM,EAAE,GAAG,KAAoD,CAAA;YAC/D,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BAC3B,IAAI,CAAC,IAAI,EAAE,CAAC,gCAAgC,EAAE,KAAK,OAAO,EAAE,CAAC,CAAA;gBAC/D,CAAC;YACH,CAAC,CAAC,CAAA;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,IAAI,EAAE,CAAC,iCAAiC,MAAM,CAAE,KAAe,EAAE,OAAO,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAA;QAC1G,CAAC;IACH,CAAC,CAAA;AACH,CAAC"}
|
package/lib/prompt-state.d.ts
CHANGED
|
@@ -104,21 +104,26 @@ export interface PromptBarAccess {
|
|
|
104
104
|
autorun: 'armed' | 'disarmed';
|
|
105
105
|
fired: number;
|
|
106
106
|
}>;
|
|
107
|
+
/** #218: mirror a just-served state read into the push transport, so the NEXT mount reads the
|
|
108
|
+
* projection instead of pulling again — discovery self-extinguishes. Optional: a pull-only
|
|
109
|
+
* surface (no writer) simply does not implement it, and the caller's feature check makes that a
|
|
110
|
+
* no-op rather than an error. */
|
|
111
|
+
mirror?: (sessionId: string, session: unknown) => void;
|
|
107
112
|
/** `displaced` is the answer to "who starts the next turn": true when arming this loop also disarmed the
|
|
108
113
|
* goal driver's continuation, so the human is told which engine they just opted into. */
|
|
109
|
-
setAutorun(sessionId: string, on: boolean): {
|
|
114
|
+
setAutorun(sessionId: string, on: boolean, session?: unknown): {
|
|
110
115
|
autorun: 'armed' | 'disarmed';
|
|
111
116
|
fired: number;
|
|
112
117
|
displaced: boolean;
|
|
113
118
|
};
|
|
114
119
|
/** #113: the bar's Run. Submits the offer on screen as a HUMAN-authored user turn, through the same
|
|
115
120
|
* follow-up path autorun uses — one behavior for "run it", whether a keystroke or the loop came first. */
|
|
116
|
-
runNow(sessionId: string): Promise<{
|
|
121
|
+
runNow(sessionId: string, session?: unknown): Promise<{
|
|
117
122
|
ok: boolean;
|
|
118
123
|
text?: string;
|
|
119
124
|
reason?: string;
|
|
120
125
|
}>;
|
|
121
|
-
disarmHuman(sessionId: string): void;
|
|
122
|
-
setOff(sessionId: string): Promise<void>;
|
|
123
|
-
setOn(sessionId: string): Promise<void>;
|
|
126
|
+
disarmHuman(sessionId: string, session?: unknown): void;
|
|
127
|
+
setOff(sessionId: string, session?: unknown): Promise<void>;
|
|
128
|
+
setOn(sessionId: string, session?: unknown): Promise<void>;
|
|
124
129
|
}
|
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.9";
|
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.9';
|
|
10
10
|
//# sourceMappingURL=version.js.map
|