@pagelines/sdk 1.0.654 → 1.0.656

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.
@@ -2,7 +2,7 @@ import { ComputedRef, Ref } from 'vue';
2
2
  import { AgentConfig, ChatToolActivityData, SettingsObject } from '@pagelines/core';
3
3
  import { PageLinesSDK } from '../sdkClient';
4
4
  import { AgentMode, ChatAttachment, ChatMessage, TextConnectionState, Agent } from './schema';
5
- import { WorkJournalModel, WorkJournalOutcome } from './work-journal';
5
+ import { LiveTurnBlock, WorkJournalModel, WorkJournalOutcome } from './work-journal';
6
6
  import { VoiceRecorderController } from './VoiceRecorderController';
7
7
  /**
8
8
  * Structured error payload surfaced by the chat stream. Matches the
@@ -87,7 +87,9 @@ export declare class AgentChatController extends SettingsObject<AgentChatControl
87
87
  private boundaryTimer?;
88
88
  private readonly nowMs;
89
89
  private readonly toolActivityTiming;
90
- private readonly isStreamingText;
90
+ private readonly lastVisibleProgressAtMs;
91
+ private readonly liveSegments;
92
+ readonly liveStreamMessageId: import('vue').ShallowRef<string | undefined, string | undefined>;
91
93
  private conversationId?;
92
94
  textState: Ref<TextConnectionState>;
93
95
  agentMode: Ref<AgentMode>;
@@ -100,6 +102,12 @@ export declare class AgentChatController extends SettingsObject<AgentChatControl
100
102
  * Task 7 owns `stopped`.
101
103
  */
102
104
  readonly workJournal: ComputedRef<WorkJournalModel | undefined>;
105
+ /**
106
+ * Interleaved live progression (mockup 28c) — only while the turn is
107
+ * running. Terminal outcomes (stopped / failed live) keep the single
108
+ * journal from `workJournal`; the canonical row owns completed endings.
109
+ */
110
+ readonly liveTurnBlocks: ComputedRef<LiveTurnBlock[]>;
103
111
  readonly canUseComposer: ComputedRef<boolean>;
104
112
  readonly canAttachFile: ComputedRef<boolean>;
105
113
  readonly canRecordAudio: ComputedRef<boolean>;
@@ -148,7 +156,7 @@ export declare class AgentChatController extends SettingsObject<AgentChatControl
148
156
  firstMessage: string;
149
157
  };
150
158
  private updateState;
151
- private resetToolActivityTiming;
159
+ private resetWorkJournalTiming;
152
160
  private resetState;
153
161
  /**
154
162
  * Wake exactly once at the live journal's next slow/long boundary, recompute,
@@ -177,6 +185,7 @@ export declare class AgentChatController extends SettingsObject<AgentChatControl
177
185
  workJournalFor(args: {
178
186
  activities?: ChatToolActivityData[];
179
187
  outcome: WorkJournalOutcome;
188
+ includeFailureNote?: boolean;
180
189
  }): WorkJournalModel | undefined;
181
190
  private setupModeWatcher;
182
191
  private setupAvailabilityWatcher;
@@ -13,12 +13,8 @@ import { ChatToolActivityData } from '@pagelines/core';
13
13
  * hint); it never creates a milestone. Real completions create milestones;
14
14
  * time may reveal the one transient wait tip after the slow boundary.
15
15
  *
16
- * `streamingText` marks that the assistant's reply is actively streaming under
17
- * the journal (the Swift twin must mirror this rule). While it is true and the
18
- * turn is running, the deltas ARE the progress: the wait tip and the leave hint
19
- * are both suppressed, and only a genuinely in-flight tool keeps the active tip
20
- * (milestones still render). Boundaries are still returned so the wait clock
21
- * resumes the instant streaming stops.
16
+ * `lastVisibleProgressAtMs` records the latest tool event or assistant delta the
17
+ * user could see. It resets the quiet boundary without hiding a later stall.
22
18
  */
23
19
  export type WorkJournalOutcome = 'running' | 'completed' | 'failed' | 'stopped';
24
20
  export type WorkJournalTone = 'done' | 'active' | 'failed' | 'stopped' | 'completed';
@@ -53,16 +49,53 @@ export declare function durableJournalOutcome(msg: {
53
49
  */
54
50
  export declare const WORK_JOURNAL_COPY: {
55
51
  readonly waiting: "Waiting for results";
52
+ readonly finishing: "Finishing up";
56
53
  readonly completed: "Work complete";
57
54
  readonly failed: "Couldn’t finish";
58
55
  readonly stopped: "Stopped";
59
56
  readonly notifyHint: "Taking longer than usual. You can leave and I’ll notify you when it’s ready.";
60
- readonly leaveHint: "You can leave this chat while I work.";
57
+ readonly leaveHint: "Taking longer than usual. You can leave this chat while I work.";
61
58
  };
62
59
  export declare function buildWorkJournalModel(args: {
63
60
  activities: ChatToolActivityData[];
64
61
  outcome: WorkJournalOutcome;
65
62
  nowMs: number;
66
63
  canNotifyOnCompletion: boolean;
67
- streamingText?: boolean;
64
+ lastVisibleProgressAtMs?: number;
65
+ includeFailureNote?: boolean;
68
66
  }): WorkJournalModel;
67
+ /** One ordered slice of a live turn: what the controller observed arrive. */
68
+ export type LiveTurnSegment = {
69
+ kind: 'text';
70
+ content: string;
71
+ } | {
72
+ kind: 'work';
73
+ activityIds: string[];
74
+ };
75
+ /** One rendered block of the interleaved live progression (mockup 28c). */
76
+ export type LiveTurnBlock = {
77
+ kind: 'text';
78
+ content: string;
79
+ } | {
80
+ kind: 'work';
81
+ journal: WorkJournalModel;
82
+ };
83
+ /**
84
+ * Interleaved live-turn projection: each completed work group sits above the
85
+ * text it produced, the next group opens beneath that text, and only the tail
86
+ * block may carry the terminal (spinner / wait ladder). Blocks above the tail
87
+ * are immutable evidence. The Swift twin must mirror this rule.
88
+ *
89
+ * A tail of streaming text renders no loading block while deltas visibly
90
+ * arrive; once the quiet boundary passes, an empty live group supplies the
91
+ * honest Finishing up state at the tail. With no segmentation (restored
92
+ * threads, unsegmented producers) the whole activity set renders as one live
93
+ * group — the pre-progression shape.
94
+ */
95
+ export declare function buildLiveTurnBlocks(args: {
96
+ segments: LiveTurnSegment[];
97
+ activities: ChatToolActivityData[];
98
+ nowMs: number;
99
+ canNotifyOnCompletion: boolean;
100
+ lastVisibleProgressAtMs?: number;
101
+ }): LiveTurnBlock[];