@tangle-network/agent-app 0.60.142 → 0.60.143
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/dist/assistant/index.js +6 -9
- package/dist/assistant/index.js.map +1 -1
- package/dist/chat-routes/index.js +55 -4
- package/dist/chat-routes/index.js.map +1 -1
- package/dist/chat-routes/reasoning-clock.d.ts +31 -0
- package/dist/{chunk-EGEULRT2.js → chunk-T4JJXUJI.js} +971 -850
- package/dist/chunk-T4JJXUJI.js.map +1 -0
- package/dist/web-react/chat-stream.d.ts +49 -0
- package/dist/web-react/index.d.ts +11 -5
- package/dist/web-react/index.js +7 -1
- package/dist/web-react/reasoning-row.d.ts +34 -0
- package/package.json +1 -1
- package/dist/chunk-EGEULRT2.js.map +0 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* When each reasoning run of a turn started and ended, so every chat producer
|
|
3
|
+
* persists one reasoning part shape: `{ type: 'reasoning', text, time: { start, end } }`
|
|
4
|
+
* (`ChatReasoningPart` in `/chat-store`).
|
|
5
|
+
*
|
|
6
|
+
* The engine (`./router-producer`) and the sandbox (`./sandbox-producer`) both
|
|
7
|
+
* stream reasoning live as `{ type: 'reasoning', text }` deltas. This clock gives
|
|
8
|
+
* their persisted parts the same timing: a run starts at its first delta and
|
|
9
|
+
* ends when anything else streams (answer text, a tool) or the turn ends. A
|
|
10
|
+
* harness that timed its own part keeps its times; the clock fills only what it
|
|
11
|
+
* left out. `/web-react` reads the result back (`chatReasoningFromParts`), so a
|
|
12
|
+
* reloaded turn shows how long the model thought.
|
|
13
|
+
*
|
|
14
|
+
* Import-free, so the browser-safe chat stream can share the part's type.
|
|
15
|
+
*/
|
|
16
|
+
/** Start and end, in epoch milliseconds, of one reasoning run. */
|
|
17
|
+
export interface ReasoningRunTime {
|
|
18
|
+
start?: number;
|
|
19
|
+
end?: number;
|
|
20
|
+
}
|
|
21
|
+
/** The clock one producer keeps for one turn. `K` is how the producer names a run: a part key or the part itself. */
|
|
22
|
+
export interface ReasoningClock<K> {
|
|
23
|
+
/** A reasoning delta for `run` streamed. Starts its clock on the first; ends any other open run. */
|
|
24
|
+
reasoning(run: K): void;
|
|
25
|
+
/** Something other than reasoning streamed, or the turn ended: the open run is over, at `at` (default now). */
|
|
26
|
+
settle(at?: number): void;
|
|
27
|
+
/** The run's time, the part's own `start` and `end` winning where it has them. */
|
|
28
|
+
time(run: K, own?: ReasoningRunTime): ReasoningRunTime | undefined;
|
|
29
|
+
}
|
|
30
|
+
/** A clock for one turn's reasoning runs. */
|
|
31
|
+
export declare function createReasoningClock<K>(now?: () => number): ReasoningClock<K>;
|