@pellux/goodvibes-sdk 0.18.42 → 0.18.46
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/_internal/daemon/runtime-route-types.d.ts +7 -0
- package/dist/_internal/daemon/runtime-route-types.d.ts.map +1 -1
- package/dist/_internal/daemon/runtime-session-routes.d.ts.map +1 -1
- package/dist/_internal/daemon/runtime-session-routes.js +43 -0
- package/dist/_internal/platform/companion/companion-chat-manager.d.ts +94 -0
- package/dist/_internal/platform/companion/companion-chat-manager.d.ts.map +1 -0
- package/dist/_internal/platform/companion/companion-chat-manager.js +291 -0
- package/dist/_internal/platform/companion/companion-chat-route-types.d.ts +31 -0
- package/dist/_internal/platform/companion/companion-chat-route-types.d.ts.map +1 -0
- package/dist/_internal/platform/companion/companion-chat-route-types.js +6 -0
- package/dist/_internal/platform/companion/companion-chat-routes.d.ts +23 -0
- package/dist/_internal/platform/companion/companion-chat-routes.d.ts.map +1 -0
- package/dist/_internal/platform/companion/companion-chat-routes.js +133 -0
- package/dist/_internal/platform/companion/companion-chat-types.d.ts +108 -0
- package/dist/_internal/platform/companion/companion-chat-types.d.ts.map +1 -0
- package/dist/_internal/platform/companion/companion-chat-types.js +11 -0
- package/dist/_internal/platform/companion/index.d.ts +6 -0
- package/dist/_internal/platform/companion/index.d.ts.map +1 -0
- package/dist/_internal/platform/companion/index.js +2 -0
- package/dist/_internal/platform/config/manager.d.ts +12 -0
- package/dist/_internal/platform/config/manager.d.ts.map +1 -1
- package/dist/_internal/platform/config/manager.js +30 -0
- package/dist/_internal/platform/control-plane/conversation-message.d.ts +29 -0
- package/dist/_internal/platform/control-plane/conversation-message.d.ts.map +1 -0
- package/dist/_internal/platform/control-plane/conversation-message.js +9 -0
- package/dist/_internal/platform/control-plane/index.d.ts +1 -0
- package/dist/_internal/platform/control-plane/index.d.ts.map +1 -1
- package/dist/_internal/platform/control-plane/session-broker.d.ts +7 -0
- package/dist/_internal/platform/control-plane/session-broker.d.ts.map +1 -1
- package/dist/_internal/platform/control-plane/session-broker.js +102 -11
- package/dist/_internal/platform/control-plane/session-types.d.ts +11 -1
- package/dist/_internal/platform/control-plane/session-types.d.ts.map +1 -1
- package/dist/_internal/platform/daemon/facade-composition.d.ts.map +1 -1
- package/dist/_internal/platform/daemon/facade-composition.js +7 -0
- package/dist/_internal/platform/daemon/facade.d.ts +21 -0
- package/dist/_internal/platform/daemon/facade.d.ts.map +1 -1
- package/dist/_internal/platform/daemon/facade.js +107 -1
- package/dist/_internal/platform/daemon/host-mode-watcher.d.ts +49 -0
- package/dist/_internal/platform/daemon/host-mode-watcher.d.ts.map +1 -0
- package/dist/_internal/platform/daemon/host-mode-watcher.js +41 -0
- package/dist/_internal/platform/daemon/http/router.d.ts +7 -0
- package/dist/_internal/platform/daemon/http/router.d.ts.map +1 -1
- package/dist/_internal/platform/daemon/http/router.js +34 -0
- package/dist/_internal/platform/daemon/http/runtime-route-types.d.ts +7 -0
- package/dist/_internal/platform/daemon/http/runtime-route-types.d.ts.map +1 -1
- package/dist/_internal/platform/daemon/http-listener.d.ts +17 -0
- package/dist/_internal/platform/daemon/http-listener.d.ts.map +1 -1
- package/dist/_internal/platform/daemon/http-listener.js +87 -1
- package/dist/_internal/platform/providers/auto-register.d.ts +2 -3
- package/dist/_internal/platform/providers/auto-register.d.ts.map +1 -1
- package/dist/_internal/platform/providers/auto-register.js +1 -8
- package/dist/_internal/platform/providers/index.d.ts +1 -0
- package/dist/_internal/platform/providers/index.d.ts.map +1 -1
- package/dist/_internal/platform/providers/index.js +1 -0
- package/dist/_internal/platform/providers/provider-api.d.ts +4 -0
- package/dist/_internal/platform/providers/provider-api.d.ts.map +1 -1
- package/dist/_internal/platform/providers/provider-not-found-error.d.ts +16 -0
- package/dist/_internal/platform/providers/provider-not-found-error.d.ts.map +1 -0
- package/dist/_internal/platform/providers/provider-not-found-error.js +24 -0
- package/dist/_internal/platform/providers/registry.d.ts +44 -2
- package/dist/_internal/platform/providers/registry.d.ts.map +1 -1
- package/dist/_internal/platform/providers/registry.js +73 -13
- package/dist/_internal/platform/runtime/contracts/migrations/event-envelope.d.ts +1 -1
- package/dist/_internal/platform/runtime/contracts/version.d.ts +1 -1
- package/dist/_internal/platform/runtime/contracts/version.js +1 -1
- package/dist/_internal/platform/runtime/events/domain-map.d.ts +10 -0
- package/dist/_internal/platform/runtime/events/domain-map.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/events/index.d.ts +1 -1
- package/dist/_internal/platform/runtime/events/index.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/index.d.ts +1 -1
- package/dist/_internal/platform/runtime/index.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/tasks/adapters/agent-adapter.d.ts +12 -0
- package/dist/_internal/platform/runtime/tasks/adapters/agent-adapter.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/tasks/adapters/agent-adapter.js +48 -0
- package/dist/_internal/platform/version.js +1 -1
- package/dist/_internal/transport-realtime/runtime-events.d.ts +3 -2
- package/dist/_internal/transport-realtime/runtime-events.d.ts.map +1 -1
- package/dist/client.d.ts +19 -3
- package/dist/client.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -18,6 +18,7 @@ export class SharedSessionBroker {
|
|
|
18
18
|
loaded = false;
|
|
19
19
|
_gcInterval = null;
|
|
20
20
|
_busUnsubs = [];
|
|
21
|
+
_busAttached = false;
|
|
21
22
|
/** Default idle threshold for zero-message sessions (ms). */
|
|
22
23
|
_idleEmptyMs;
|
|
23
24
|
/** Default idle threshold for sessions with content (ms). */
|
|
@@ -41,6 +42,25 @@ export class SharedSessionBroker {
|
|
|
41
42
|
setEventPublisher(publisher) {
|
|
42
43
|
this.eventPublisher = publisher;
|
|
43
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* M3: Gracefully stop the broker — clears GC interval, tears down bus subscriptions,
|
|
47
|
+
* and persists state. Call from DaemonServer.stop().
|
|
48
|
+
*/
|
|
49
|
+
async stop() {
|
|
50
|
+
if (this._gcInterval) {
|
|
51
|
+
clearInterval(this._gcInterval);
|
|
52
|
+
this._gcInterval = null;
|
|
53
|
+
}
|
|
54
|
+
for (const u of this._busUnsubs) {
|
|
55
|
+
try {
|
|
56
|
+
u();
|
|
57
|
+
}
|
|
58
|
+
catch { }
|
|
59
|
+
}
|
|
60
|
+
this._busUnsubs = [];
|
|
61
|
+
this._busAttached = false;
|
|
62
|
+
await this.persist();
|
|
63
|
+
}
|
|
44
64
|
/**
|
|
45
65
|
* Wire the broker to a RuntimeEventBus so agent terminal events automatically
|
|
46
66
|
* reconcile session inputs and task state.
|
|
@@ -53,29 +73,54 @@ export class SharedSessionBroker {
|
|
|
53
73
|
* Return `null` when the agent is not associated with a shared session.
|
|
54
74
|
*/
|
|
55
75
|
attachRuntimeBus(bus, sessionResolver) {
|
|
76
|
+
// m3: idempotent — second call is a no-op with a warning
|
|
77
|
+
if (this._busAttached) {
|
|
78
|
+
console.warn('[SharedSessionBroker] attachRuntimeBus called more than once — ignoring duplicate call');
|
|
79
|
+
return () => { };
|
|
80
|
+
}
|
|
81
|
+
this._busAttached = true;
|
|
56
82
|
const onCompleted = bus.on('AGENT_COMPLETED', (envelope) => {
|
|
83
|
+
// m2: runtime type guard
|
|
84
|
+
if (typeof envelope.payload?.agentId !== 'string')
|
|
85
|
+
return;
|
|
57
86
|
const sessionId = sessionResolver(envelope.payload.agentId);
|
|
58
87
|
if (!sessionId)
|
|
59
88
|
return;
|
|
60
|
-
|
|
89
|
+
// m1: catch to prevent unhandled rejections
|
|
90
|
+
this.completeAgent(sessionId, envelope.payload.agentId, envelope.payload.output ?? '', { status: 'completed', durationMs: envelope.payload.durationMs }).catch((err) => {
|
|
91
|
+
console.error('[SharedSessionBroker] completeAgent error on AGENT_COMPLETED', err);
|
|
92
|
+
});
|
|
61
93
|
});
|
|
62
94
|
const onFailed = bus.on('AGENT_FAILED', (envelope) => {
|
|
95
|
+
// m2: runtime type guard
|
|
96
|
+
if (typeof envelope.payload?.agentId !== 'string')
|
|
97
|
+
return;
|
|
63
98
|
const sessionId = sessionResolver(envelope.payload.agentId);
|
|
64
99
|
if (!sessionId)
|
|
65
100
|
return;
|
|
66
|
-
|
|
101
|
+
// m1: catch to prevent unhandled rejections
|
|
102
|
+
this.completeAgent(sessionId, envelope.payload.agentId, envelope.payload.error, { status: 'failed', durationMs: envelope.payload.durationMs }).catch((err) => {
|
|
103
|
+
console.error('[SharedSessionBroker] completeAgent error on AGENT_FAILED', err);
|
|
104
|
+
});
|
|
67
105
|
});
|
|
68
106
|
const onCancelled = bus.on('AGENT_CANCELLED', (envelope) => {
|
|
107
|
+
// m2: runtime type guard
|
|
108
|
+
if (typeof envelope.payload?.agentId !== 'string')
|
|
109
|
+
return;
|
|
69
110
|
const sessionId = sessionResolver(envelope.payload.agentId);
|
|
70
111
|
if (!sessionId)
|
|
71
112
|
return;
|
|
72
|
-
|
|
113
|
+
// m1: catch to prevent unhandled rejections
|
|
114
|
+
this.completeAgent(sessionId, envelope.payload.agentId, envelope.payload.reason ?? 'cancelled', { status: 'cancelled' }).catch((err) => {
|
|
115
|
+
console.error('[SharedSessionBroker] completeAgent error on AGENT_CANCELLED', err);
|
|
116
|
+
});
|
|
73
117
|
});
|
|
74
118
|
this._busUnsubs.push(onCompleted, onFailed, onCancelled);
|
|
75
119
|
return () => {
|
|
76
120
|
onCompleted();
|
|
77
121
|
onFailed();
|
|
78
122
|
onCancelled();
|
|
123
|
+
this._busAttached = false;
|
|
79
124
|
this._busUnsubs = this._busUnsubs.filter((fn) => fn !== onCompleted && fn !== onFailed && fn !== onCancelled);
|
|
80
125
|
};
|
|
81
126
|
}
|
|
@@ -100,8 +145,31 @@ export class SharedSessionBroker {
|
|
|
100
145
|
this.inputs.set(sessionId, bucket);
|
|
101
146
|
}
|
|
102
147
|
this.loaded = true;
|
|
148
|
+
// M2: startup reconciliation — cancel inputs stuck in spawned/delivered from a prior run
|
|
149
|
+
const restartReason = 'daemon restart — agent state unknown';
|
|
150
|
+
for (const [sessionId, bucket] of this.inputs.entries()) {
|
|
151
|
+
let changed = false;
|
|
152
|
+
for (let i = 0; i < bucket.length; i++) {
|
|
153
|
+
const entry = bucket[i];
|
|
154
|
+
if (entry.state === 'spawned' || entry.state === 'delivered') {
|
|
155
|
+
bucket[i] = { ...entry, state: 'cancelled', updatedAt: Date.now(), error: restartReason };
|
|
156
|
+
changed = true;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
if (changed)
|
|
160
|
+
this.refreshPendingInputCount(sessionId);
|
|
161
|
+
}
|
|
162
|
+
for (const [sessionId, session] of this.sessions.entries()) {
|
|
163
|
+
if (session.activeAgentId) {
|
|
164
|
+
this.sessions.set(sessionId, { ...session, activeAgentId: undefined, updatedAt: Date.now() });
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
await this.persist();
|
|
103
168
|
if (!this._gcInterval) {
|
|
104
|
-
|
|
169
|
+
// M3: .unref() so the GC interval does not keep the process alive past shutdown
|
|
170
|
+
const iv = setInterval(() => { this._gcSweep(); }, 60_000);
|
|
171
|
+
iv.unref?.();
|
|
172
|
+
this._gcInterval = iv;
|
|
105
173
|
}
|
|
106
174
|
}
|
|
107
175
|
listSessions(limit = 100) {
|
|
@@ -159,6 +227,7 @@ export class SharedSessionBroker {
|
|
|
159
227
|
const routeIds = input.routeBinding?.id ? [input.routeBinding.id] : [];
|
|
160
228
|
const session = {
|
|
161
229
|
id: sessionId,
|
|
230
|
+
kind: input.kind ?? 'tui',
|
|
162
231
|
title: input.title?.trim() || input.routeBinding?.title || `Session ${sessionId}`,
|
|
163
232
|
status: 'active',
|
|
164
233
|
createdAt: now,
|
|
@@ -191,12 +260,15 @@ export class SharedSessionBroker {
|
|
|
191
260
|
const session = this.sessions.get(sessionId);
|
|
192
261
|
if (!session)
|
|
193
262
|
return null;
|
|
263
|
+
this._touch(sessionId); // M4: uniform touch before mutation
|
|
264
|
+
const touched = this.sessions.get(sessionId); // re-fetch after touch
|
|
265
|
+
const now = Date.now();
|
|
194
266
|
const updated = {
|
|
195
|
-
...
|
|
267
|
+
...touched,
|
|
196
268
|
status: 'closed',
|
|
197
269
|
activeAgentId: undefined,
|
|
198
|
-
updatedAt:
|
|
199
|
-
closedAt:
|
|
270
|
+
updatedAt: now,
|
|
271
|
+
closedAt: now,
|
|
200
272
|
};
|
|
201
273
|
this.sessions.set(sessionId, updated);
|
|
202
274
|
await this.persist();
|
|
@@ -271,13 +343,16 @@ export class SharedSessionBroker {
|
|
|
271
343
|
agentId,
|
|
272
344
|
metadata,
|
|
273
345
|
});
|
|
346
|
+
const now = Date.now();
|
|
274
347
|
const updated = {
|
|
275
348
|
...(this.sessions.get(sessionId) ?? session),
|
|
276
349
|
activeAgentId: (this.sessions.get(sessionId)?.activeAgentId === agentId) ? undefined : this.sessions.get(sessionId)?.activeAgentId,
|
|
277
350
|
lastAgentId: agentId,
|
|
278
|
-
updatedAt:
|
|
351
|
+
updatedAt: now,
|
|
352
|
+
lastActivityAt: now, // M4: completeAgent explicitly updates lastActivityAt
|
|
279
353
|
...(metadata.status === 'failed' ? { lastError: body } : {}),
|
|
280
354
|
};
|
|
355
|
+
this._touch(sessionId); // M4: touch after mutation
|
|
281
356
|
this.sessions.set(sessionId, updated);
|
|
282
357
|
const finalizedInputs = this.finalizeAgentInputs(sessionId, agentId, metadata.status === 'failed' ? 'failed' : metadata.status === 'cancelled' ? 'cancelled' : 'completed', metadata.status === 'failed' ? body : undefined);
|
|
283
358
|
await this.persist();
|
|
@@ -373,6 +448,7 @@ export class SharedSessionBroker {
|
|
|
373
448
|
return message;
|
|
374
449
|
}
|
|
375
450
|
async attachParticipantAndRoute(session, input, binding) {
|
|
451
|
+
this._touch(session.id); // M4
|
|
376
452
|
const existing = this.sessions.get(session.id) ?? session;
|
|
377
453
|
const nextRouteIds = binding?.id
|
|
378
454
|
? [...new Set([...existing.routeIds, binding.id])]
|
|
@@ -604,6 +680,7 @@ export class SharedSessionBroker {
|
|
|
604
680
|
};
|
|
605
681
|
}
|
|
606
682
|
recordInput(sessionId, intent, input, routeId, causationId) {
|
|
683
|
+
this._touch(sessionId); // M4
|
|
607
684
|
const id = `sin-${randomUUID().slice(0, 8)}`;
|
|
608
685
|
const entry = {
|
|
609
686
|
id,
|
|
@@ -642,6 +719,7 @@ export class SharedSessionBroker {
|
|
|
642
719
|
bucket[index] = updated;
|
|
643
720
|
this.inputs.set(sessionId, bucket);
|
|
644
721
|
this.refreshPendingInputCount(sessionId);
|
|
722
|
+
this._touch(sessionId); // M4
|
|
645
723
|
return updated;
|
|
646
724
|
}
|
|
647
725
|
claimNextQueuedInput(sessionId, agentId) {
|
|
@@ -649,17 +727,20 @@ export class SharedSessionBroker {
|
|
|
649
727
|
const next = bucket.find((entry) => entry.state === 'queued');
|
|
650
728
|
if (!next)
|
|
651
729
|
return null;
|
|
652
|
-
|
|
730
|
+
const result = this.updateInput(sessionId, next.id, (entry) => ({
|
|
653
731
|
...entry,
|
|
654
732
|
state: 'spawned',
|
|
655
733
|
activeAgentId: agentId,
|
|
656
734
|
updatedAt: Date.now(),
|
|
657
735
|
}));
|
|
736
|
+
this._touch(sessionId); // M4
|
|
737
|
+
return result;
|
|
658
738
|
}
|
|
659
739
|
finalizeAgentInputs(sessionId, agentId, nextState, error) {
|
|
660
740
|
const bucket = this.inputs.get(sessionId);
|
|
661
741
|
if (!bucket)
|
|
662
742
|
return [];
|
|
743
|
+
this._touch(sessionId); // M4: ensure direct callers also bump session timestamps
|
|
663
744
|
let changed = false;
|
|
664
745
|
const updatedInputs = [];
|
|
665
746
|
for (let index = 0; index < bucket.length; index += 1) {
|
|
@@ -710,6 +791,14 @@ export class SharedSessionBroker {
|
|
|
710
791
|
await this.persist();
|
|
711
792
|
return claimed ? { input: claimed, agentId: spawned.agentId } : null;
|
|
712
793
|
}
|
|
794
|
+
// M4: touch helper — bumps lastActivityAt + updatedAt on a session
|
|
795
|
+
_touch(sessionId) {
|
|
796
|
+
const s = this.sessions.get(sessionId);
|
|
797
|
+
if (!s)
|
|
798
|
+
return;
|
|
799
|
+
const now = Date.now();
|
|
800
|
+
this.sessions.set(sessionId, { ...s, lastActivityAt: now, updatedAt: now });
|
|
801
|
+
}
|
|
713
802
|
refreshPendingInputCount(sessionId) {
|
|
714
803
|
const session = this.sessions.get(sessionId);
|
|
715
804
|
if (!session)
|
|
@@ -735,11 +824,14 @@ export class SharedSessionBroker {
|
|
|
735
824
|
*/
|
|
736
825
|
_gcSweep() {
|
|
737
826
|
const now = Date.now();
|
|
827
|
+
let anyChanged = false; // m4: track changed inline, not a second O(n) scan
|
|
738
828
|
for (const [sessionId, session] of this.sessions.entries()) {
|
|
739
829
|
if (session.status !== 'active')
|
|
740
830
|
continue;
|
|
741
831
|
if (session.activeAgentId)
|
|
742
832
|
continue; // live agent — leave it
|
|
833
|
+
if (session.pendingInputCount > 0)
|
|
834
|
+
continue; // M4: never close sessions with pending inputs
|
|
743
835
|
const idle = now - session.lastActivityAt;
|
|
744
836
|
let reason = null;
|
|
745
837
|
if (session.messageCount === 0 && idle >= this._idleEmptyMs) {
|
|
@@ -759,9 +851,8 @@ export class SharedSessionBroker {
|
|
|
759
851
|
};
|
|
760
852
|
this.sessions.set(sessionId, closed);
|
|
761
853
|
this.publishUpdate('session-closed', { ...closed, reason });
|
|
854
|
+
anyChanged = true; // m4: set during loop, not a second scan
|
|
762
855
|
}
|
|
763
|
-
// Persist after a sweep only when something changed.
|
|
764
|
-
const anyChanged = [...this.sessions.values()].some((s) => s.status === 'closed' && s.closedAt && now - s.closedAt < 2_000);
|
|
765
856
|
if (anyChanged) {
|
|
766
857
|
void this.persist();
|
|
767
858
|
}
|
|
@@ -26,8 +26,16 @@ export interface SharedSessionMessage {
|
|
|
26
26
|
readonly displayName?: string;
|
|
27
27
|
readonly metadata: Record<string, unknown>;
|
|
28
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* Discriminates the session origin.
|
|
31
|
+
* - 'tui': created by the operator TUI (default for existing sessions)
|
|
32
|
+
* - 'companion-task': created via task-submit flow (agent spawn)
|
|
33
|
+
* - 'companion-chat': created via companion chat-mode API (no agent spawn; uses per-session orchestrator)
|
|
34
|
+
*/
|
|
35
|
+
export type SharedSessionKind = 'tui' | 'companion-task' | 'companion-chat';
|
|
29
36
|
export interface SharedSessionRecord {
|
|
30
37
|
readonly id: string;
|
|
38
|
+
readonly kind: SharedSessionKind;
|
|
31
39
|
readonly title: string;
|
|
32
40
|
readonly status: SharedSessionStatus;
|
|
33
41
|
readonly createdAt: number;
|
|
@@ -36,7 +44,9 @@ export interface SharedSessionRecord {
|
|
|
36
44
|
readonly closedAt?: number;
|
|
37
45
|
/**
|
|
38
46
|
* Epoch ms of the most recent activity on this session.
|
|
39
|
-
* Updated on every
|
|
47
|
+
* Updated on every session-level mutation (createSession, bindAgent,
|
|
48
|
+
* appendMessage, recordInput, updateInput, claimNextQueuedInput,
|
|
49
|
+
* attachParticipantAndRoute, closeSession, completeAgent).
|
|
40
50
|
* Used by the idle-session GC sweep to decide when to close ghost sessions.
|
|
41
51
|
*/
|
|
42
52
|
readonly lastActivityAt: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-types.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/control-plane/session-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,KAAK,EACV,wBAAwB,EACxB,wBAAwB,EACxB,0BAA0B,EAC3B,MAAM,sBAAsB,CAAC;AAE9B,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,QAAQ,CAAC;AACtD,MAAM,MAAM,wBAAwB,GAAG,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAC;AAEvE,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,WAAW,EAAE,qBAAqB,CAAC;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CAAC,OAAO,CAAC,EAAE,0BAA0B,CAAC;CAC/C;AAED,MAAM,WAAW,8BAA+B,SAAQ,+BAA+B;IACrF,QAAQ,CAAC,kBAAkB,CAAC,EAAE,OAAO,CAAC;CACvC;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,WAAW,CAAC,EAAE,qBAAqB,CAAC;IAC7C,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;CAClC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"facade-composition.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/daemon/facade-composition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,mDAAmD,CAAC;AACpF,OAAO,EACL,yBAAyB,EACzB,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrG,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,6BAA6B,EAC7B,qBAAqB,EACrB,oBAAoB,EACpB,mBAAmB,EACnB,eAAe,EAChB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,uBAAuB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AAC;KAC7B,KAAK,IAAI,CAAC;CACZ,GAAG,IAAI,CAoBP"}
|
|
@@ -52,6 +52,13 @@ export function resolveDaemonFacadeRuntime(config, fallbackConfigManager) {
|
|
|
52
52
|
},
|
|
53
53
|
});
|
|
54
54
|
runtimeServices.knowledgeService.attachRuntimeBus(runtimeBus);
|
|
55
|
+
runtimeServices.sessionBroker.attachRuntimeBus(runtimeBus, (agentId) => {
|
|
56
|
+
for (const s of runtimeServices.sessionBroker.listSessions(1000)) {
|
|
57
|
+
if (s.activeAgentId === agentId)
|
|
58
|
+
return s.id;
|
|
59
|
+
}
|
|
60
|
+
return null;
|
|
61
|
+
});
|
|
55
62
|
runtimeServices.routeBindings.attachRuntime({
|
|
56
63
|
runtimeBus,
|
|
57
64
|
runtimeStore,
|
|
@@ -57,8 +57,18 @@ export declare class DaemonServer {
|
|
|
57
57
|
private readonly transportEventsHelper;
|
|
58
58
|
private readonly httpRouter;
|
|
59
59
|
private replyPoller;
|
|
60
|
+
private agentTaskAdapter;
|
|
61
|
+
private agentTaskAdapterUnsub;
|
|
60
62
|
private tlsState;
|
|
61
63
|
private approvalBrokerUnsubscribe;
|
|
64
|
+
/** Unsubscribe from controlPlane config key watchers; cleared on stop(). */
|
|
65
|
+
private _configWatchUnsub;
|
|
66
|
+
/** True while a config-driven restart is in progress — prevents re-entrancy. */
|
|
67
|
+
private _restarting;
|
|
68
|
+
/** Awaitable promise for the active restart cycle; null when idle. */
|
|
69
|
+
private _restartingPromise;
|
|
70
|
+
/** True if a config change arrived while _restarting was set; triggers a second cycle. */
|
|
71
|
+
private _restartDirty;
|
|
62
72
|
constructor(config?: DaemonConfig, _configManager?: ConfigManager);
|
|
63
73
|
listRecentControlPlaneEvents(limit?: number): readonly import('../control-plane/gateway.js').ControlPlaneRecentEvent[];
|
|
64
74
|
/**
|
|
@@ -78,7 +88,18 @@ export declare class DaemonServer {
|
|
|
78
88
|
* against a 10-second timeout so a hung service cannot block the full
|
|
79
89
|
* shutdown sequence (C1 fix).
|
|
80
90
|
*/
|
|
91
|
+
/**
|
|
92
|
+
* Wait for any in-progress config-driven restart to settle.
|
|
93
|
+
* Callers that change config mid-flight and need to know when the server
|
|
94
|
+
* has rebounded should await this before inspecting state.
|
|
95
|
+
*/
|
|
96
|
+
waitForRestart(): Promise<void>;
|
|
81
97
|
stop(): Promise<void>;
|
|
98
|
+
/**
|
|
99
|
+
* Subscribe to controlPlane binding keys and restart the server on change.
|
|
100
|
+
* Called once from start() after the server is up. Clears itself on stop().
|
|
101
|
+
*/
|
|
102
|
+
private _attachControlPlaneConfigWatcher;
|
|
82
103
|
/**
|
|
83
104
|
* Returns true if the server is currently running.
|
|
84
105
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"facade.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/daemon/facade.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"facade.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/daemon/facade.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAiD1D,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAuB,MAAM,YAAY,CAAC;AAexF;;;;;;;;GAQG;AACH,qBAAa,YAAY;IA4DX,OAAO,CAAC,MAAM;IA3D1B,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,MAAM,CAA6C;IAC3D,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAkB;IAClD,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAA2B;IAC9D,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,SAAS,CAAuB;IACxC,OAAO,CAAC,QAAQ,CAAkB;IAClC,O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,SAAS;IAIjB,OAAO,CAAC,2BAA2B;IAInC,OAAO,CAAC,YAAY;YAIN,iBAAiB;IAI/B,OAAO,CAAC,8BAA8B;IAStC,OAAO,CAAC,uBAAuB;IAI/B,OAAO,CAAC,yBAAyB;IAWjC,OAAO,CAAC,+BAA+B;IAOvC,OAAO,CAAC,+BAA+B;YAOzB,kCAAkC;IAUhD,OAAO,CAAC,gCAAgC;YAM1B,+BAA+B;YAe/B,uBAAuB;YAoBvB,aAAa;YAIb,iBAAiB;YAIjB,aAAa;YAIb,qBAAqB;IAInC,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,iBAAiB;YAuBX,oBAAoB;IAgClC,OAAO,CAAC,aAAa;IAqBrB,OAAO,CAAC,oBAAoB;IAe5B,OAAO,CAAC,qBAAqB;IAY7B,OAAO,CAAC,sBAAsB;YAGhB,yBAAyB;IAGvC,OAAO,CAAC,iBAAiB;IAGzB,OAAO,CAAC,kBAAkB;CAG3B"}
|
|
@@ -4,11 +4,14 @@ import { summarizeError } from '@pellux/goodvibes-sdk/platform/utils/error-displ
|
|
|
4
4
|
import { AgentManager } from '../tools/agent/index.js';
|
|
5
5
|
import {} from '../runtime/remote/index.js';
|
|
6
6
|
import { isSurfaceDeliveryEnabled } from './surface-policy.js';
|
|
7
|
+
import { AgentTaskAdapter } from '../runtime/tasks/adapters/agent-adapter.js';
|
|
7
8
|
import { configureDaemonSessionContinuation, createDaemonFacadeCollaborators, resolveDaemonFacadeRuntime, } from './facade-composition.js';
|
|
8
9
|
import { GlobalNetworkTransportInstaller, resolveInboundTlsContext, } from '../runtime/network/index.js';
|
|
9
10
|
import { createRuntimeServices } from '../runtime/services.js';
|
|
10
11
|
import { readAutomationReasoningEffort, readAutomationWakeMode, readExternalContentSource, readStringList, } from './helpers.js';
|
|
11
12
|
import { requirePortAvailable } from './port-check.js';
|
|
13
|
+
import { resolveHostBinding } from './host-resolver.js';
|
|
14
|
+
import { createHostModeRestartWatcher } from './host-mode-watcher.js';
|
|
12
15
|
// ---------------------------------------------------------------------------
|
|
13
16
|
// DaemonServer
|
|
14
17
|
// ---------------------------------------------------------------------------
|
|
@@ -69,8 +72,18 @@ export class DaemonServer {
|
|
|
69
72
|
transportEventsHelper;
|
|
70
73
|
httpRouter;
|
|
71
74
|
replyPoller = null;
|
|
75
|
+
agentTaskAdapter = null;
|
|
76
|
+
agentTaskAdapterUnsub = null;
|
|
72
77
|
tlsState = null;
|
|
73
78
|
approvalBrokerUnsubscribe = null;
|
|
79
|
+
/** Unsubscribe from controlPlane config key watchers; cleared on stop(). */
|
|
80
|
+
_configWatchUnsub = null;
|
|
81
|
+
/** True while a config-driven restart is in progress — prevents re-entrancy. */
|
|
82
|
+
_restarting = false;
|
|
83
|
+
/** Awaitable promise for the active restart cycle; null when idle. */
|
|
84
|
+
_restartingPromise = null;
|
|
85
|
+
/** True if a config change arrived while _restarting was set; triggers a second cycle. */
|
|
86
|
+
_restartDirty = false;
|
|
74
87
|
constructor(config = {}, _configManager) {
|
|
75
88
|
this.config = config;
|
|
76
89
|
const resolved = resolveDaemonFacadeRuntime(config, _configManager);
|
|
@@ -137,6 +150,12 @@ export class DaemonServer {
|
|
|
137
150
|
this.httpRouter = collaborators.httpRouter;
|
|
138
151
|
this.providerRuntime = collaborators.providerRuntime;
|
|
139
152
|
this.builtinChannels = collaborators.builtinChannels;
|
|
153
|
+
// M1: Wire AgentTaskAdapter to the RuntimeEventBus so task records reach
|
|
154
|
+
// terminal states when their backing agent finishes.
|
|
155
|
+
this.agentTaskAdapter = new AgentTaskAdapter(this.runtimeStore);
|
|
156
|
+
this.agentTaskAdapterUnsub = this.agentTaskAdapter.attachRuntimeBus(this.runtimeBus);
|
|
157
|
+
// M2: Mark any tasks that were 'running' at startup as aborted (daemon restart)
|
|
158
|
+
this.agentTaskAdapter.reconcileOnRestart();
|
|
140
159
|
configureDaemonSessionContinuation({
|
|
141
160
|
sessionBroker: this.sessionBroker,
|
|
142
161
|
trySpawnAgent: (input, logLabel, sessionId) => this.trySpawnAgent(input, logLabel, sessionId),
|
|
@@ -209,7 +228,10 @@ export class DaemonServer {
|
|
|
209
228
|
runtimeStore: this.runtimeStore,
|
|
210
229
|
});
|
|
211
230
|
const self = this;
|
|
212
|
-
|
|
231
|
+
// Skip real OS port check when a mock serveFactory is injected (test-only path).
|
|
232
|
+
if (this.serveFactory === Bun.serve) {
|
|
233
|
+
await requirePortAvailable(this.port, this.host, 'daemon');
|
|
234
|
+
}
|
|
213
235
|
this.transportEventsHelper.emitTransportInitializing();
|
|
214
236
|
try {
|
|
215
237
|
this.tlsState = resolveInboundTlsContext(this.configManager, 'controlPlane');
|
|
@@ -270,6 +292,7 @@ export class DaemonServer {
|
|
|
270
292
|
this.watcherRegistry.startWatcher('daemon-heartbeat');
|
|
271
293
|
}
|
|
272
294
|
this.controlPlaneGateway.setServerState({ enabled: true, host: this.host, port: this.port });
|
|
295
|
+
this._attachControlPlaneConfigWatcher();
|
|
273
296
|
this.transportEventsHelper.emitTransportConnected();
|
|
274
297
|
logger.info('DaemonServer started', {
|
|
275
298
|
port: this.port,
|
|
@@ -308,9 +331,27 @@ export class DaemonServer {
|
|
|
308
331
|
* against a 10-second timeout so a hung service cannot block the full
|
|
309
332
|
* shutdown sequence (C1 fix).
|
|
310
333
|
*/
|
|
334
|
+
/**
|
|
335
|
+
* Wait for any in-progress config-driven restart to settle.
|
|
336
|
+
* Callers that change config mid-flight and need to know when the server
|
|
337
|
+
* has rebounded should await this before inspecting state.
|
|
338
|
+
*/
|
|
339
|
+
async waitForRestart() {
|
|
340
|
+
// Loop to handle dirty-flag chained restarts: each cycle may spawn another.
|
|
341
|
+
while (this._restartingPromise)
|
|
342
|
+
await this._restartingPromise;
|
|
343
|
+
}
|
|
311
344
|
async stop() {
|
|
312
345
|
if (this.server === null)
|
|
313
346
|
return;
|
|
347
|
+
// Tear down config watcher only on intentional stop, not mid-restart.
|
|
348
|
+
// During a restart cycle (_restarting=true) the watcher must stay active so
|
|
349
|
+
// config changes that arrive between stop() and the subsequent start() can be
|
|
350
|
+
// captured by the dirty flag.
|
|
351
|
+
if (!this._restarting) {
|
|
352
|
+
this._configWatchUnsub?.();
|
|
353
|
+
this._configWatchUnsub = null;
|
|
354
|
+
}
|
|
314
355
|
// Synchronous pre-stop teardown
|
|
315
356
|
this.watcherRegistry.stopWatcher('daemon-heartbeat', 'daemon-stopped');
|
|
316
357
|
if (this.replyPoller !== null) {
|
|
@@ -326,6 +367,10 @@ export class DaemonServer {
|
|
|
326
367
|
// when the server socket closes. We stop what we can in reverse start order.
|
|
327
368
|
this.providerRuntime.stopAll();
|
|
328
369
|
this.automationManager.stop();
|
|
370
|
+
// M1+M3: tear down adapter bus subscription and sessionBroker GC interval
|
|
371
|
+
this.agentTaskAdapterUnsub?.();
|
|
372
|
+
this.agentTaskAdapterUnsub = null;
|
|
373
|
+
await this.sessionBroker.stop();
|
|
329
374
|
this.server.stop(true);
|
|
330
375
|
this.server = null;
|
|
331
376
|
this.tlsState = null;
|
|
@@ -333,6 +378,63 @@ export class DaemonServer {
|
|
|
333
378
|
this.transportEventsHelper.emitTransportDisconnected('Daemon server stopped', false);
|
|
334
379
|
logger.info('DaemonServer stopped');
|
|
335
380
|
}
|
|
381
|
+
/**
|
|
382
|
+
* Subscribe to controlPlane binding keys and restart the server on change.
|
|
383
|
+
* Called once from start() after the server is up. Clears itself on stop().
|
|
384
|
+
*/
|
|
385
|
+
_attachControlPlaneConfigWatcher() {
|
|
386
|
+
if (this._configWatchUnsub)
|
|
387
|
+
return; // idempotent
|
|
388
|
+
const restart = () => {
|
|
389
|
+
if (this._restarting) {
|
|
390
|
+
// A change arrived mid-restart — queue a second cycle via dirty flag.
|
|
391
|
+
// Check _restarting BEFORE isRunning: stop() runs synchronously inside the
|
|
392
|
+
// restart IIFE, so isRunning may be false even while a restart is in progress.
|
|
393
|
+
this._restartDirty = true;
|
|
394
|
+
return;
|
|
395
|
+
}
|
|
396
|
+
if (!this.isRunning)
|
|
397
|
+
return;
|
|
398
|
+
this._restarting = true;
|
|
399
|
+
this._restartingPromise = (async () => {
|
|
400
|
+
try {
|
|
401
|
+
logger.info('DaemonServer: controlPlane binding changed, restarting daemon server…');
|
|
402
|
+
await this.stop();
|
|
403
|
+
// Re-resolve host/port from updated config
|
|
404
|
+
const newBinding = resolveHostBinding(this.configManager.get('controlPlane.hostMode') ?? 'local', String(this.configManager.get('controlPlane.host') ?? '127.0.0.1'), Number(this.configManager.get('controlPlane.port') ?? 3421), 'controlPlane');
|
|
405
|
+
this.host = newBinding.host;
|
|
406
|
+
this.port = newBinding.port;
|
|
407
|
+
await this.start();
|
|
408
|
+
}
|
|
409
|
+
catch (err) {
|
|
410
|
+
logger.error('DaemonServer: restart after config change failed', { error: summarizeError(err) });
|
|
411
|
+
}
|
|
412
|
+
finally {
|
|
413
|
+
this._restarting = false;
|
|
414
|
+
// If a config change arrived while we were restarting, kick off a second
|
|
415
|
+
// cycle BEFORE nulling _restartingPromise so waitForRestart() chains correctly.
|
|
416
|
+
if (this._restartDirty) {
|
|
417
|
+
this._restartDirty = false;
|
|
418
|
+
restart(); // sets this._restartingPromise to the new cycle
|
|
419
|
+
}
|
|
420
|
+
else {
|
|
421
|
+
this._restartingPromise = null;
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
})();
|
|
425
|
+
};
|
|
426
|
+
// getIsRunning must also return true while a restart cycle is in progress
|
|
427
|
+
// (_restarting=true) so that config changes arriving mid-restart reach the
|
|
428
|
+
// dirty-flag path inside `restart`. When the server is intentionally stopped
|
|
429
|
+
// (not mid-restart) isRunning and _restarting are both false.
|
|
430
|
+
const watcher = createHostModeRestartWatcher({
|
|
431
|
+
configManager: this.configManager,
|
|
432
|
+
keys: ['controlPlane.hostMode', 'controlPlane.host', 'controlPlane.port'],
|
|
433
|
+
onRestart: restart,
|
|
434
|
+
getIsRunning: () => this.isRunning || this._restarting,
|
|
435
|
+
});
|
|
436
|
+
this._configWatchUnsub = () => watcher.unsubscribe();
|
|
437
|
+
}
|
|
336
438
|
/**
|
|
337
439
|
* Returns true if the server is currently running.
|
|
338
440
|
*/
|
|
@@ -443,6 +545,10 @@ export class DaemonServer {
|
|
|
443
545
|
: input;
|
|
444
546
|
const record = this.agentManager.spawn(spawnInput);
|
|
445
547
|
this.syncSpawnedAgentTask(record, sessionId);
|
|
548
|
+
// M1: Register agent with AgentTaskAdapter so bus events can transition its task
|
|
549
|
+
if (this.agentTaskAdapter) {
|
|
550
|
+
this.agentTaskAdapter.wrapAgent(record.id, record.task, { sessionId: sessionId ?? 'daemon' });
|
|
551
|
+
}
|
|
446
552
|
return record;
|
|
447
553
|
}
|
|
448
554
|
catch (err) {
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* host-mode-watcher.ts
|
|
3
|
+
*
|
|
4
|
+
* Shared helper that creates a config-key watcher for host-mode restart logic.
|
|
5
|
+
* Extracted so the restart guard + dirty-flag loop-back pattern can be tested
|
|
6
|
+
* independently of DaemonServer or HttpListener.
|
|
7
|
+
*
|
|
8
|
+
* Both facade.ts and http-listener.ts delegate to this helper, passing their
|
|
9
|
+
* own `onRestart` closure and `getIsRunning` accessor.
|
|
10
|
+
*/
|
|
11
|
+
import type { ConfigManager } from '../config/manager.js';
|
|
12
|
+
import type { ConfigKey } from '@pellux/goodvibes-sdk/platform/config/schema';
|
|
13
|
+
export interface HostModeWatcherOptions {
|
|
14
|
+
/** The ConfigManager to subscribe on. */
|
|
15
|
+
configManager: ConfigManager;
|
|
16
|
+
/** Config keys that should trigger a restart when changed. */
|
|
17
|
+
keys: ConfigKey[];
|
|
18
|
+
/**
|
|
19
|
+
* Called when a key change is detected and the server is running.
|
|
20
|
+
* The implementation is responsible for performing stop + restart.
|
|
21
|
+
* The caller is responsible for re-entrancy / dirty-flag semantics: if a
|
|
22
|
+
* new change arrives while a prior restart is in progress, `onRestart`
|
|
23
|
+
* will be invoked again. The caller must either guard against overlapping
|
|
24
|
+
* cycles or queue the second cycle via its own dirty-flag mechanism.
|
|
25
|
+
*/
|
|
26
|
+
onRestart: () => void;
|
|
27
|
+
/** Returns true when the server/listener is currently running. */
|
|
28
|
+
getIsRunning: () => boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface HostModeWatcherHandle {
|
|
31
|
+
/** Detach all subscriptions — safe to call multiple times. */
|
|
32
|
+
unsubscribe: () => void;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Create a host-mode restart watcher.
|
|
36
|
+
*
|
|
37
|
+
* Behaviour:
|
|
38
|
+
* - Subscribes to each key in `keys`.
|
|
39
|
+
* - When a key changes and `getIsRunning()` is true, calls `onRestart()`.
|
|
40
|
+
* - The caller's `onRestart` implementation handles re-entrancy / dirty-flag
|
|
41
|
+
* logic internally (the watcher does NOT duplicate that logic).
|
|
42
|
+
* - `unsubscribe()` removes all subscriptions; subsequent key changes are
|
|
43
|
+
* silently ignored.
|
|
44
|
+
*
|
|
45
|
+
* @param opts - Watcher configuration.
|
|
46
|
+
* @returns A handle with an `unsubscribe` method.
|
|
47
|
+
*/
|
|
48
|
+
export declare function createHostModeRestartWatcher(opts: HostModeWatcherOptions): HostModeWatcherHandle;
|
|
49
|
+
//# sourceMappingURL=host-mode-watcher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host-mode-watcher.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/daemon/host-mode-watcher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8CAA8C,CAAC;AAE9E,MAAM,WAAW,sBAAsB;IACrC,yCAAyC;IACzC,aAAa,EAAE,aAAa,CAAC;IAC7B,8DAA8D;IAC9D,IAAI,EAAE,SAAS,EAAE,CAAC;IAClB;;;;;;;OAOG;IACH,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,kEAAkE;IAClE,YAAY,EAAE,MAAM,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,qBAAqB;IACpC,8DAA8D;IAC9D,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,sBAAsB,GAAG,qBAAqB,CAiBhG"}
|