@telora/daemon 0.17.33 → 0.17.36
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/build-info.json +4 -3
- package/dist/cli/connect.d.ts.map +1 -1
- package/dist/cli/connect.js +4 -0
- package/dist/cli/connect.js.map +1 -1
- package/dist/completion/event.d.ts.map +1 -1
- package/dist/completion/event.js +2 -8
- package/dist/completion/event.js.map +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +70 -41
- package/dist/config.js.map +1 -1
- package/dist/daemon-process.d.ts.map +1 -1
- package/dist/daemon-process.js +8 -0
- package/dist/daemon-process.js.map +1 -1
- package/dist/focus-engine.d.ts.map +1 -1
- package/dist/focus-engine.js +8 -10
- package/dist/focus-engine.js.map +1 -1
- package/dist/merge-back-loop.d.ts.map +1 -1
- package/dist/merge-back-loop.js +4 -10
- package/dist/merge-back-loop.js.map +1 -1
- package/dist/review-defect-detector.d.ts +4 -1
- package/dist/review-defect-detector.d.ts.map +1 -1
- package/dist/review-defect-detector.js +6 -8
- package/dist/review-defect-detector.js.map +1 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +0 -1
- package/dist/types/index.js.map +1 -1
- package/dist/unified-engine-lifecycle.d.ts.map +1 -1
- package/dist/unified-engine-lifecycle.js +2 -23
- package/dist/unified-engine-lifecycle.js.map +1 -1
- package/dist/unified-shell-config.d.ts +2 -7
- package/dist/unified-shell-config.d.ts.map +1 -1
- package/dist/unified-shell-config.js +2 -23
- package/dist/unified-shell-config.js.map +1 -1
- package/dist/unified-shell-status.d.ts.map +1 -1
- package/dist/unified-shell-status.js +2 -4
- package/dist/unified-shell-status.js.map +1 -1
- package/dist/unified-shell.d.ts.map +1 -1
- package/dist/unified-shell.js +0 -12
- package/dist/unified-shell.js.map +1 -1
- package/dist/version-check.d.ts.map +1 -1
- package/dist/version-check.js +6 -4
- package/dist/version-check.js.map +1 -1
- package/package.json +3 -3
- package/dist/pm/adaptive-poller.d.ts +0 -26
- package/dist/pm/adaptive-poller.d.ts.map +0 -1
- package/dist/pm/adaptive-poller.js +0 -53
- package/dist/pm/adaptive-poller.js.map +0 -1
- package/dist/pm/cascade-evaluator.d.ts +0 -29
- package/dist/pm/cascade-evaluator.d.ts.map +0 -1
- package/dist/pm/cascade-evaluator.js +0 -135
- package/dist/pm/cascade-evaluator.js.map +0 -1
- package/dist/pm/channel-email.d.ts +0 -42
- package/dist/pm/channel-email.d.ts.map +0 -1
- package/dist/pm/channel-email.js +0 -47
- package/dist/pm/channel-email.js.map +0 -1
- package/dist/pm/channel-slack.d.ts +0 -40
- package/dist/pm/channel-slack.d.ts.map +0 -1
- package/dist/pm/channel-slack.js +0 -46
- package/dist/pm/channel-slack.js.map +0 -1
- package/dist/pm/communication-drafter.d.ts +0 -44
- package/dist/pm/communication-drafter.d.ts.map +0 -1
- package/dist/pm/communication-drafter.js +0 -84
- package/dist/pm/communication-drafter.js.map +0 -1
- package/dist/pm/dialog-handler.d.ts +0 -32
- package/dist/pm/dialog-handler.d.ts.map +0 -1
- package/dist/pm/dialog-handler.js +0 -107
- package/dist/pm/dialog-handler.js.map +0 -1
- package/dist/pm/mitigation-correlator.d.ts +0 -29
- package/dist/pm/mitigation-correlator.d.ts.map +0 -1
- package/dist/pm/mitigation-correlator.js +0 -147
- package/dist/pm/mitigation-correlator.js.map +0 -1
- package/dist/pm/risk-scanner.d.ts +0 -28
- package/dist/pm/risk-scanner.d.ts.map +0 -1
- package/dist/pm/risk-scanner.js +0 -112
- package/dist/pm/risk-scanner.js.map +0 -1
- package/dist/pm-engine.d.ts +0 -96
- package/dist/pm-engine.d.ts.map +0 -1
- package/dist/pm-engine.js +0 -540
- package/dist/pm-engine.js.map +0 -1
- package/dist/pm-process.d.ts +0 -45
- package/dist/pm-process.d.ts.map +0 -1
- package/dist/pm-process.js +0 -195
- package/dist/pm-process.js.map +0 -1
- package/dist/pm-prompt-builder.d.ts +0 -23
- package/dist/pm-prompt-builder.d.ts.map +0 -1
- package/dist/pm-prompt-builder.js +0 -64
- package/dist/pm-prompt-builder.js.map +0 -1
- package/dist/types/pm.d.ts +0 -53
- package/dist/types/pm.d.ts.map +0 -1
- package/dist/types/pm.js +0 -10
- package/dist/types/pm.js.map +0 -1
package/dist/pm/channel-slack.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Slack channel adapter for the PM engine.
|
|
3
|
-
*
|
|
4
|
-
* Currently a stub implementation that logs outbound Slack messages and
|
|
5
|
-
* returns fake thread timestamps. The actual Slack API integration will
|
|
6
|
-
* be configured later. This stub allows the PM engine to test the full
|
|
7
|
-
* draft-approve-send flow without external dependencies.
|
|
8
|
-
*/
|
|
9
|
-
// ---------------------------------------------------------------------------
|
|
10
|
-
// Public API
|
|
11
|
-
// ---------------------------------------------------------------------------
|
|
12
|
-
/**
|
|
13
|
-
* Send a Slack message to a channel or user.
|
|
14
|
-
*
|
|
15
|
-
* STUB: Logs the message details and returns a fake thread timestamp.
|
|
16
|
-
* Replace with real Slack Web API call when integration is ready.
|
|
17
|
-
*/
|
|
18
|
-
export async function sendSlackMessage(config, channelOrUserId, text, threadTs) {
|
|
19
|
-
console.log(`[PM:Slack] Would send to=${channelOrUserId} thread=${threadTs ?? 'new'} ` +
|
|
20
|
-
`text="${text.slice(0, 80)}${text.length > 80 ? '...' : ''}"`);
|
|
21
|
-
return {
|
|
22
|
-
success: true,
|
|
23
|
-
threadTs: threadTs ?? `stub-${Date.now()}.000000`,
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Parse a Slack event webhook payload into a structured object.
|
|
28
|
-
*
|
|
29
|
-
* STUB: Extracts basic fields from the payload. Real implementation
|
|
30
|
-
* will handle Slack Events API verification, challenge responses,
|
|
31
|
-
* and event type dispatching.
|
|
32
|
-
*/
|
|
33
|
-
export function parseSlackEvent(payload) {
|
|
34
|
-
console.log('[PM:Slack] parseSlackEvent stub called');
|
|
35
|
-
const event = typeof payload.event === 'object' && payload.event !== null
|
|
36
|
-
? payload.event
|
|
37
|
-
: payload;
|
|
38
|
-
return {
|
|
39
|
-
type: typeof event.type === 'string' ? event.type : null,
|
|
40
|
-
userId: typeof event.user === 'string' ? event.user : null,
|
|
41
|
-
channelId: typeof event.channel === 'string' ? event.channel : null,
|
|
42
|
-
text: typeof event.text === 'string' ? event.text : null,
|
|
43
|
-
threadTs: typeof event.thread_ts === 'string' ? event.thread_ts : null,
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
//# sourceMappingURL=channel-slack.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"channel-slack.js","sourceRoot":"","sources":["../../src/pm/channel-slack.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAyBH,8EAA8E;AAC9E,aAAa;AACb,8EAA8E;AAE9E;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,MAAmB,EACnB,eAAuB,EACvB,IAAY,EACZ,QAAiB;IAEjB,OAAO,CAAC,GAAG,CACT,4BAA4B,eAAe,WAAW,QAAQ,IAAI,KAAK,GAAG;QAC1E,SAAS,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,CAC9D,CAAC;IAEF,OAAO;QACL,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,QAAQ,IAAI,QAAQ,IAAI,CAAC,GAAG,EAAE,SAAS;KAClD,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAC7B,OAAgC;IAEhC,OAAO,CAAC,GAAG,CAAC,wCAAwC,CAAC,CAAC;IAEtD,MAAM,KAAK,GAAG,OAAO,OAAO,CAAC,KAAK,KAAK,QAAQ,IAAI,OAAO,CAAC,KAAK,KAAK,IAAI;QACvE,CAAC,CAAC,OAAO,CAAC,KAAgC;QAC1C,CAAC,CAAC,OAAO,CAAC;IAEZ,OAAO;QACL,IAAI,EAAE,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI;QACxD,MAAM,EAAE,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI;QAC1D,SAAS,EAAE,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI;QACnE,IAAI,EAAE,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI;QACxD,QAAQ,EAAE,OAAO,KAAK,CAAC,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI;KACvE,CAAC;AACJ,CAAC"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Communication drafter -- generates draft outbound messages based on risk events.
|
|
3
|
-
*
|
|
4
|
-
* Template-based drafting that produces DraftCommunication objects for human
|
|
5
|
-
* approval before sending. The PM engine stores these via the API with
|
|
6
|
-
* status='draft'; actual sending happens only after approval.
|
|
7
|
-
*/
|
|
8
|
-
export interface DraftCommunication {
|
|
9
|
-
riskDependencyId: string;
|
|
10
|
-
direction: 'outbound';
|
|
11
|
-
channel: 'email' | 'slack';
|
|
12
|
-
subject: string;
|
|
13
|
-
body: string;
|
|
14
|
-
sender: string;
|
|
15
|
-
recipient: string;
|
|
16
|
-
status: 'draft';
|
|
17
|
-
}
|
|
18
|
-
export type CommunicationTrigger = {
|
|
19
|
-
type: 'risk_transition';
|
|
20
|
-
riskTitle: string;
|
|
21
|
-
fromStage: string;
|
|
22
|
-
toStage: string;
|
|
23
|
-
} | {
|
|
24
|
-
type: 'followup_due';
|
|
25
|
-
dependencyTitle: string;
|
|
26
|
-
ownerName: string;
|
|
27
|
-
daysPastDue: number;
|
|
28
|
-
} | {
|
|
29
|
-
type: 'resolution_summary';
|
|
30
|
-
riskTitle: string;
|
|
31
|
-
};
|
|
32
|
-
export interface DependencyContext {
|
|
33
|
-
title: string;
|
|
34
|
-
ownerName: string | null;
|
|
35
|
-
ownerContact: string | null;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Generate a draft communication for a given trigger and dependency context.
|
|
39
|
-
*
|
|
40
|
-
* Returns a DraftCommunication ready to be stored via the API. The draft
|
|
41
|
-
* uses the dependency's ownerContact as recipient (falls back to 'unknown').
|
|
42
|
-
*/
|
|
43
|
-
export declare function draftCommunication(trigger: CommunicationTrigger, dependency: DependencyContext, channel: 'email' | 'slack'): DraftCommunication;
|
|
44
|
-
//# sourceMappingURL=communication-drafter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"communication-drafter.d.ts","sourceRoot":"","sources":["../../src/pm/communication-drafter.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,MAAM,WAAW,kBAAkB;IACjC,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,UAAU,CAAC;IACtB,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,MAAM,oBAAoB,GAC5B;IAAE,IAAI,EAAE,iBAAiB,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAClF;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,eAAe,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GACzF;IAAE,IAAI,EAAE,oBAAoB,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtD,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AA+DD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,oBAAoB,EAC7B,UAAU,EAAE,iBAAiB,EAC7B,OAAO,EAAE,OAAO,GAAG,OAAO,GACzB,kBAAkB,CAmCpB"}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Communication drafter -- generates draft outbound messages based on risk events.
|
|
3
|
-
*
|
|
4
|
-
* Template-based drafting that produces DraftCommunication objects for human
|
|
5
|
-
* approval before sending. The PM engine stores these via the API with
|
|
6
|
-
* status='draft'; actual sending happens only after approval.
|
|
7
|
-
*/
|
|
8
|
-
// ---------------------------------------------------------------------------
|
|
9
|
-
// Template helpers
|
|
10
|
-
// ---------------------------------------------------------------------------
|
|
11
|
-
function buildRiskTransitionBody(trigger, dependency) {
|
|
12
|
-
const subject = `[Risk Alert] ${trigger.riskTitle} moved to ${trigger.toStage}`;
|
|
13
|
-
const ownerLine = dependency.ownerName
|
|
14
|
-
? `\n\nAs the owner of "${dependency.title}", please review the updated risk status and confirm whether any adjustments to your timeline or approach are needed.`
|
|
15
|
-
: '';
|
|
16
|
-
const body = `The risk "${trigger.riskTitle}" has transitioned from "${trigger.fromStage}" to "${trigger.toStage}".` +
|
|
17
|
-
`\n\nThis transition may affect the dependency "${dependency.title}". ` +
|
|
18
|
-
`Please review any downstream impacts and take appropriate action.` +
|
|
19
|
-
ownerLine +
|
|
20
|
-
`\n\nIf you have questions or need to escalate, reply to this message.`;
|
|
21
|
-
return { subject, body };
|
|
22
|
-
}
|
|
23
|
-
function buildFollowupBody(trigger, dependency) {
|
|
24
|
-
const subject = `Followup: ${trigger.dependencyTitle}`;
|
|
25
|
-
const daysLabel = trigger.daysPastDue === 1 ? '1 day' : `${trigger.daysPastDue} days`;
|
|
26
|
-
const body = `We're checking in on "${dependency.title}". ` +
|
|
27
|
-
`Last contact was ${daysLabel} ago.` +
|
|
28
|
-
`\n\nCould you provide an update on the current status? ` +
|
|
29
|
-
`Any changes to timeline or blockers would be helpful to know about.` +
|
|
30
|
-
`\n\nThank you.`;
|
|
31
|
-
return { subject, body };
|
|
32
|
-
}
|
|
33
|
-
function buildResolutionBody(trigger, dependency) {
|
|
34
|
-
const subject = `[Resolved] ${trigger.riskTitle}`;
|
|
35
|
-
const body = `The risk "${trigger.riskTitle}" has been resolved.` +
|
|
36
|
-
`\n\nThe dependency "${dependency.title}" is no longer tracked as an active concern. ` +
|
|
37
|
-
`No further action is required unless new information surfaces.` +
|
|
38
|
-
`\n\nThank you for your involvement in tracking this item.`;
|
|
39
|
-
return { subject, body };
|
|
40
|
-
}
|
|
41
|
-
// ---------------------------------------------------------------------------
|
|
42
|
-
// Public API
|
|
43
|
-
// ---------------------------------------------------------------------------
|
|
44
|
-
/**
|
|
45
|
-
* Generate a draft communication for a given trigger and dependency context.
|
|
46
|
-
*
|
|
47
|
-
* Returns a DraftCommunication ready to be stored via the API. The draft
|
|
48
|
-
* uses the dependency's ownerContact as recipient (falls back to 'unknown').
|
|
49
|
-
*/
|
|
50
|
-
export function draftCommunication(trigger, dependency, channel) {
|
|
51
|
-
let subject;
|
|
52
|
-
let body;
|
|
53
|
-
switch (trigger.type) {
|
|
54
|
-
case 'risk_transition': {
|
|
55
|
-
const result = buildRiskTransitionBody(trigger, dependency);
|
|
56
|
-
subject = result.subject;
|
|
57
|
-
body = result.body;
|
|
58
|
-
break;
|
|
59
|
-
}
|
|
60
|
-
case 'followup_due': {
|
|
61
|
-
const result = buildFollowupBody(trigger, dependency);
|
|
62
|
-
subject = result.subject;
|
|
63
|
-
body = result.body;
|
|
64
|
-
break;
|
|
65
|
-
}
|
|
66
|
-
case 'resolution_summary': {
|
|
67
|
-
const result = buildResolutionBody(trigger, dependency);
|
|
68
|
-
subject = result.subject;
|
|
69
|
-
body = result.body;
|
|
70
|
-
break;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
return {
|
|
74
|
-
riskDependencyId: '', // Caller sets this based on the dependency being processed
|
|
75
|
-
direction: 'outbound',
|
|
76
|
-
channel,
|
|
77
|
-
subject,
|
|
78
|
-
body,
|
|
79
|
-
sender: 'pm-engine',
|
|
80
|
-
recipient: dependency.ownerContact ?? 'unknown',
|
|
81
|
-
status: 'draft',
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
//# sourceMappingURL=communication-drafter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"communication-drafter.js","sourceRoot":"","sources":["../../src/pm/communication-drafter.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA4BH,8EAA8E;AAC9E,mBAAmB;AACnB,8EAA8E;AAE9E,SAAS,uBAAuB,CAC9B,OAAmE,EACnE,UAA6B;IAE7B,MAAM,OAAO,GAAG,gBAAgB,OAAO,CAAC,SAAS,aAAa,OAAO,CAAC,OAAO,EAAE,CAAC;IAEhF,MAAM,SAAS,GAAG,UAAU,CAAC,SAAS;QACpC,CAAC,CAAC,wBAAwB,UAAU,CAAC,KAAK,uHAAuH;QACjK,CAAC,CAAC,EAAE,CAAC;IAEP,MAAM,IAAI,GACR,aAAa,OAAO,CAAC,SAAS,4BAA4B,OAAO,CAAC,SAAS,SAAS,OAAO,CAAC,OAAO,IAAI;QACvG,kDAAkD,UAAU,CAAC,KAAK,KAAK;QACvE,mEAAmE;QACnE,SAAS;QACT,uEAAuE,CAAC;IAE1E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC3B,CAAC;AAED,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iB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;YACtD,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;YACzB,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;YACnB,MAAM;QACR,CAAC;QACD,KAAK,oBAAoB,CAAC,CAAC,CAAC;YAC1B,MAAM,MAAM,GAAG,mBAAmB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;YACxD,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;YACzB,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;YACnB,MAAM;QACR,CAAC;IACH,CAAC;IAED,OAAO;QACL,gBAAgB,EAAE,EAAE,EAAE,2DAA2D;QACjF,SAAS,EAAE,UAAU;QACrB,OAAO;QACP,OAAO;QACP,IAAI;QACJ,MAAM,EAAE,WAAW;QACnB,SAAS,EAAE,UAAU,CAAC,YAAY,IAAI,SAAS;QAC/C,MAAM,EAAE,OAAO;KAChB,CAAC;AACJ,CAAC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Dialog update handler -- parses human input about external conversations.
|
|
3
|
-
*
|
|
4
|
-
* Provides simple keyword-based matching to extract structured updates from
|
|
5
|
-
* free-text human messages. This is intentionally simple; LLM-enhanced
|
|
6
|
-
* parsing will replace the keyword approach later.
|
|
7
|
-
*/
|
|
8
|
-
export interface DialogUpdate {
|
|
9
|
-
riskId: string | null;
|
|
10
|
-
dependencyId: string | null;
|
|
11
|
-
statusUpdate: string | null;
|
|
12
|
-
notes: string;
|
|
13
|
-
contactName: string | null;
|
|
14
|
-
}
|
|
15
|
-
export interface RiskRef {
|
|
16
|
-
id: string;
|
|
17
|
-
title: string;
|
|
18
|
-
}
|
|
19
|
-
export interface DependencyRef {
|
|
20
|
-
id: string;
|
|
21
|
-
title: string;
|
|
22
|
-
riskId: string;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Parse a human dialog message to extract structured risk/dependency updates.
|
|
26
|
-
*
|
|
27
|
-
* Matches the message against known risk and dependency titles, extracts
|
|
28
|
-
* status keywords, and identifies contact names. This is a best-effort
|
|
29
|
-
* keyword parser; unmatched fields return null.
|
|
30
|
-
*/
|
|
31
|
-
export declare function parseDialogUpdate(humanMessage: string, risks: RiskRef[], dependencies: DependencyRef[]): DialogUpdate;
|
|
32
|
-
//# sourceMappingURL=dialog-handler.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dialog-handler.d.ts","sourceRoot":"","sources":["../../src/pm/dialog-handler.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAgGD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,OAAO,EAAE,EAChB,YAAY,EAAE,aAAa,EAAE,GAC5B,YAAY,CAiBd"}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Dialog update handler -- parses human input about external conversations.
|
|
3
|
-
*
|
|
4
|
-
* Provides simple keyword-based matching to extract structured updates from
|
|
5
|
-
* free-text human messages. This is intentionally simple; LLM-enhanced
|
|
6
|
-
* parsing will replace the keyword approach later.
|
|
7
|
-
*/
|
|
8
|
-
// ---------------------------------------------------------------------------
|
|
9
|
-
// Internal helpers
|
|
10
|
-
// ---------------------------------------------------------------------------
|
|
11
|
-
/** Status keywords mapped to normalized status values. */
|
|
12
|
-
const STATUS_KEYWORDS = {
|
|
13
|
-
done: 'resolved',
|
|
14
|
-
resolved: 'resolved',
|
|
15
|
-
completed: 'resolved',
|
|
16
|
-
fixed: 'resolved',
|
|
17
|
-
closed: 'resolved',
|
|
18
|
-
delayed: 'delayed',
|
|
19
|
-
postponed: 'delayed',
|
|
20
|
-
'pushed back': 'delayed',
|
|
21
|
-
blocked: 'blocked',
|
|
22
|
-
stuck: 'blocked',
|
|
23
|
-
'working on it': 'in_progress',
|
|
24
|
-
'in progress': 'in_progress',
|
|
25
|
-
started: 'in_progress',
|
|
26
|
-
'no update': 'waiting',
|
|
27
|
-
'no change': 'waiting',
|
|
28
|
-
};
|
|
29
|
-
/** Patterns that precede a contact name. */
|
|
30
|
-
const CONTACT_PATTERNS = [
|
|
31
|
-
/talked?\s+(?:to|with)\s+([A-Z][a-z]+(?:\s+[A-Z][a-z]+)?)/,
|
|
32
|
-
/spoke\s+(?:to|with)\s+([A-Z][a-z]+(?:\s+[A-Z][a-z]+)?)/,
|
|
33
|
-
/heard\s+(?:from|back\s+from)\s+([A-Z][a-z]+(?:\s+[A-Z][a-z]+)?)/,
|
|
34
|
-
/(?:met|meeting)\s+(?:with)\s+([A-Z][a-z]+(?:\s+[A-Z][a-z]+)?)/,
|
|
35
|
-
/email(?:ed)?\s+(?:from|by)\s+([A-Z][a-z]+(?:\s+[A-Z][a-z]+)?)/,
|
|
36
|
-
];
|
|
37
|
-
/**
|
|
38
|
-
* Find the best matching item by title within a message.
|
|
39
|
-
* Uses case-insensitive substring matching, preferring longer matches.
|
|
40
|
-
*/
|
|
41
|
-
function findBestMatch(message, items) {
|
|
42
|
-
const lowerMsg = message.toLowerCase();
|
|
43
|
-
let bestMatch = null;
|
|
44
|
-
let bestLength = 0;
|
|
45
|
-
for (const item of items) {
|
|
46
|
-
const lowerTitle = item.title.toLowerCase();
|
|
47
|
-
if (lowerMsg.includes(lowerTitle) && lowerTitle.length > bestLength) {
|
|
48
|
-
bestMatch = item;
|
|
49
|
-
bestLength = lowerTitle.length;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
return bestMatch;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Extract a status keyword from the message.
|
|
56
|
-
* Checks multi-word phrases first (longer matches win).
|
|
57
|
-
*/
|
|
58
|
-
function extractStatus(message) {
|
|
59
|
-
const lowerMsg = message.toLowerCase();
|
|
60
|
-
// Sort keywords by length descending so multi-word phrases match first
|
|
61
|
-
const sortedKeywords = Object.keys(STATUS_KEYWORDS).sort((a, b) => b.length - a.length);
|
|
62
|
-
for (const keyword of sortedKeywords) {
|
|
63
|
-
if (lowerMsg.includes(keyword)) {
|
|
64
|
-
return STATUS_KEYWORDS[keyword] ?? null;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
return null;
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Extract a contact name from the message using known patterns.
|
|
71
|
-
*/
|
|
72
|
-
function extractContactName(message) {
|
|
73
|
-
for (const pattern of CONTACT_PATTERNS) {
|
|
74
|
-
const match = message.match(pattern);
|
|
75
|
-
if (match?.[1]) {
|
|
76
|
-
return match[1];
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
return null;
|
|
80
|
-
}
|
|
81
|
-
// ---------------------------------------------------------------------------
|
|
82
|
-
// Public API
|
|
83
|
-
// ---------------------------------------------------------------------------
|
|
84
|
-
/**
|
|
85
|
-
* Parse a human dialog message to extract structured risk/dependency updates.
|
|
86
|
-
*
|
|
87
|
-
* Matches the message against known risk and dependency titles, extracts
|
|
88
|
-
* status keywords, and identifies contact names. This is a best-effort
|
|
89
|
-
* keyword parser; unmatched fields return null.
|
|
90
|
-
*/
|
|
91
|
-
export function parseDialogUpdate(humanMessage, risks, dependencies) {
|
|
92
|
-
// Match dependency first (more specific), then risk
|
|
93
|
-
const matchedDep = findBestMatch(humanMessage, dependencies);
|
|
94
|
-
const matchedRisk = matchedDep
|
|
95
|
-
? risks.find(r => r.id === matchedDep.riskId) ?? findBestMatch(humanMessage, risks)
|
|
96
|
-
: findBestMatch(humanMessage, risks);
|
|
97
|
-
const statusUpdate = extractStatus(humanMessage);
|
|
98
|
-
const contactName = extractContactName(humanMessage);
|
|
99
|
-
return {
|
|
100
|
-
riskId: matchedRisk?.id ?? matchedDep?.riskId ?? null,
|
|
101
|
-
dependencyId: matchedDep?.id ?? null,
|
|
102
|
-
statusUpdate,
|
|
103
|
-
notes: humanMessage,
|
|
104
|
-
contactName,
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
//# sourceMappingURL=dialog-handler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dialog-handler.js","sourceRoot":"","sources":["../../src/pm/dialog-handler.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAyBH,8EAA8E;AAC9E,mBAAmB;AACnB,8EAA8E;AAE9E,0DAA0D;AAC1D,MAAM,eAAe,GAA2B;IAC9C,IAAI,EAAE,UAAU;IAChB,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,UAAU;IACrB,KAAK,EAAE,UAAU;IACjB,MAAM,EAAE,UAAU;IAClB,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,SAAS;IACpB,aAAa,EAAE,SAAS;IACxB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,SAAS;IAChB,eAAe,EAAE,aAAa;IAC9B,aAAa,EAAE,aAAa;IAC5B,OAAO,EAAE,aAAa;IACtB,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE,SAAS;CACvB,CAAC;AAEF,4CAA4C;AAC5C,MAAM,gBAAgB,GAAG;IACvB,0DAA0D;IAC1D,wDAAwD;IACxD,iEAAiE;IACjE,+DAA+D;IAC/D,+DAA+D;CAChE,CAAC;AAEF;;;GAGG;AACH,SAAS,aAAa,CACpB,OAAe,EACf,KAAU;IAEV,MAA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QAClB,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED,8EAA8E;AAC9E,aAAa;AACb,8EAA8E;AAE9E;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAC/B,YAAoB,EACpB,KAAgB,EAChB,YAA6B;IAE7B,oDAAoD;IACpD,MAAM,UAAU,GAAG,aAAa,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;IAC7D,MAAM,WAAW,GAAG,UAAU;QAC5B,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,UAAU,CAAC,MAAM,CAAC,IAAI,aAAa,CAAC,YAAY,EAAE,KAAK,CAAC;QACnF,CAAC,CAAC,aAAa,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;IAEvC,MAAM,YAAY,GAAG,aAAa,CAAC,YAAY,CAAC,CAAC;IACjD,MAAM,WAAW,GAAG,kBAAkB,CAAC,YAAY,CAAC,CAAC;IAErD,OAAO;QACL,MAAM,EAAE,WAAW,EAAE,EAAE,IAAI,UAAU,EAAE,MAAM,IAAI,IAAI;QACrD,YAAY,EAAE,UAAU,EAAE,EAAE,IAAI,IAAI;QACpC,YAAY;QACZ,KAAK,EAAE,YAAY;QACnB,WAAW;KACZ,CAAC;AACJ,CAAC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Mitigation focus progress correlator.
|
|
3
|
-
*
|
|
4
|
-
* For each risk with linked focuses (via risk_focus_links), computes
|
|
5
|
-
* issue-level completion percentages and produces an overall assessment of
|
|
6
|
-
* whether the mitigation work is on track.
|
|
7
|
-
*/
|
|
8
|
-
export interface MitigationProgressReport {
|
|
9
|
-
riskId: string;
|
|
10
|
-
riskTitle: string;
|
|
11
|
-
riskStage: string;
|
|
12
|
-
focuses: Array<{
|
|
13
|
-
focusId: string;
|
|
14
|
-
focusName: string;
|
|
15
|
-
totalIssues: number;
|
|
16
|
-
doneIssues: number;
|
|
17
|
-
completionPct: number;
|
|
18
|
-
}>;
|
|
19
|
-
overallCompletionPct: number;
|
|
20
|
-
assessment: 'on_track' | 'at_risk' | 'behind' | 'no_mitigation';
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Correlate mitigation progress across all risks for a product.
|
|
24
|
-
*
|
|
25
|
-
* For each risk, looks up linked focuses, counts total and done issues
|
|
26
|
-
* across all deliveries in those focuses, and produces an assessment.
|
|
27
|
-
*/
|
|
28
|
-
export declare function correlateMitigationProgress(productId: string): Promise<MitigationProgressReport[]>;
|
|
29
|
-
//# sourceMappingURL=mitigation-correlator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mitigation-correlator.d.ts","sourceRoot":"","sources":["../../src/pm/mitigation-correlator.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAQH,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,KAAK,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;QAClB,WAAW,EAAE,MAAM,CAAC;QACpB,UAAU,EAAE,MAAM,CAAC;QACnB,aAAa,EAAE,MAAM,CAAC;KACvB,CAAC,CAAC;IACH,oBAAoB,EAAE,MAAM,CAAC;IAC7B,UAAU,EAAE,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,eAAe,CAAC;CACjE;AAuDD;;;;;GAKG;AACH,wBAAsB,2BAA2B,CAC/C,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,wBAAwB,EAAE,CAAC,CA2IrC"}
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Mitigation focus progress correlator.
|
|
3
|
-
*
|
|
4
|
-
* For each risk with linked focuses (via risk_focus_links), computes
|
|
5
|
-
* issue-level completion percentages and produces an overall assessment of
|
|
6
|
-
* whether the mitigation work is on track.
|
|
7
|
-
*/
|
|
8
|
-
import { callApi } from '../queries/shared.js';
|
|
9
|
-
// ---------------------------------------------------------------------------
|
|
10
|
-
// Public API
|
|
11
|
-
// ---------------------------------------------------------------------------
|
|
12
|
-
/**
|
|
13
|
-
* Correlate mitigation progress across all risks for a product.
|
|
14
|
-
*
|
|
15
|
-
* For each risk, looks up linked focuses, counts total and done issues
|
|
16
|
-
* across all deliveries in those focuses, and produces an assessment.
|
|
17
|
-
*/
|
|
18
|
-
export async function correlateMitigationProgress(productId) {
|
|
19
|
-
// 1. Get all risks
|
|
20
|
-
const risksResponse = await callApi('risk_list', {
|
|
21
|
-
productId,
|
|
22
|
-
limit: 500,
|
|
23
|
-
offset: 0,
|
|
24
|
-
});
|
|
25
|
-
const risks = risksResponse.risks;
|
|
26
|
-
if (risks.length === 0)
|
|
27
|
-
return [];
|
|
28
|
-
const reports = [];
|
|
29
|
-
for (const risk of risks) {
|
|
30
|
-
// Skip resolved risks
|
|
31
|
-
const stageName = risk.workflow_stage?.name ?? 'draft';
|
|
32
|
-
if (stageName === 'resolved')
|
|
33
|
-
continue;
|
|
34
|
-
// 2. Get focus links for this risk
|
|
35
|
-
let riskDetail;
|
|
36
|
-
try {
|
|
37
|
-
riskDetail = await callApi('risk_get', { riskId: risk.id });
|
|
38
|
-
}
|
|
39
|
-
catch {
|
|
40
|
-
continue; // Non-fatal
|
|
41
|
-
}
|
|
42
|
-
const focusLinks = riskDetail.focusLinks;
|
|
43
|
-
if (focusLinks.length === 0) {
|
|
44
|
-
reports.push({
|
|
45
|
-
riskId: risk.id,
|
|
46
|
-
riskTitle: risk.title,
|
|
47
|
-
riskStage: stageName,
|
|
48
|
-
focuses: [],
|
|
49
|
-
overallCompletionPct: 0,
|
|
50
|
-
assessment: 'no_mitigation',
|
|
51
|
-
});
|
|
52
|
-
continue;
|
|
53
|
-
}
|
|
54
|
-
// 3. For each linked focus, count issues
|
|
55
|
-
const focuses = [];
|
|
56
|
-
let totalIssuesAll = 0;
|
|
57
|
-
let doneIssuesAll = 0;
|
|
58
|
-
for (const link of focusLinks) {
|
|
59
|
-
try {
|
|
60
|
-
// Get deliveries for this focus
|
|
61
|
-
const deliveries = await callApi('delivery_list', {
|
|
62
|
-
productId,
|
|
63
|
-
focusId: link.focus_id,
|
|
64
|
-
limit: 500,
|
|
65
|
-
offset: 0,
|
|
66
|
-
});
|
|
67
|
-
let focusTotalIssues = 0;
|
|
68
|
-
let focusDoneIssues = 0;
|
|
69
|
-
let focusName = link.focus_id;
|
|
70
|
-
// Count issues across all deliveries
|
|
71
|
-
for (const delivery of deliveries.deliveries) {
|
|
72
|
-
try {
|
|
73
|
-
const issues = await callApi('issue_list', {
|
|
74
|
-
deliveryId: delivery.id,
|
|
75
|
-
limit: 500,
|
|
76
|
-
offset: 0,
|
|
77
|
-
});
|
|
78
|
-
// Only count task/bug issues, not context groups
|
|
79
|
-
for (const issue of issues.issues) {
|
|
80
|
-
if (issue.issue_type === 'context_group')
|
|
81
|
-
continue;
|
|
82
|
-
focusTotalIssues++;
|
|
83
|
-
if (issue.status === 'done') {
|
|
84
|
-
focusDoneIssues++;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
catch {
|
|
89
|
-
// Non-fatal: skip this delivery's issues
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
// Try to get focus name from the first delivery response
|
|
93
|
-
if (deliveries.deliveries.length > 0) {
|
|
94
|
-
try {
|
|
95
|
-
const focusResponse = await callApi('focus_get', { focusId: link.focus_id });
|
|
96
|
-
focusName = focusResponse.focus.name;
|
|
97
|
-
}
|
|
98
|
-
catch {
|
|
99
|
-
// Non-fatal: use ID as name
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
const completionPct = focusTotalIssues > 0
|
|
103
|
-
? Math.round((focusDoneIssues / focusTotalIssues) * 100)
|
|
104
|
-
: 0;
|
|
105
|
-
focuses.push({
|
|
106
|
-
focusId: link.focus_id,
|
|
107
|
-
focusName,
|
|
108
|
-
totalIssues: focusTotalIssues,
|
|
109
|
-
doneIssues: focusDoneIssues,
|
|
110
|
-
completionPct,
|
|
111
|
-
});
|
|
112
|
-
totalIssuesAll += focusTotalIssues;
|
|
113
|
-
doneIssuesAll += focusDoneIssues;
|
|
114
|
-
}
|
|
115
|
-
catch {
|
|
116
|
-
// Non-fatal: skip this focus
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
const overallCompletionPct = totalIssuesAll > 0
|
|
120
|
-
? Math.round((doneIssuesAll / totalIssuesAll) * 100)
|
|
121
|
-
: 0;
|
|
122
|
-
// Assess mitigation progress
|
|
123
|
-
let assessment;
|
|
124
|
-
if (focuses.length === 0) {
|
|
125
|
-
assessment = 'no_mitigation';
|
|
126
|
-
}
|
|
127
|
-
else if (overallCompletionPct >= 75) {
|
|
128
|
-
assessment = 'on_track';
|
|
129
|
-
}
|
|
130
|
-
else if (overallCompletionPct >= 40) {
|
|
131
|
-
assessment = 'at_risk';
|
|
132
|
-
}
|
|
133
|
-
else {
|
|
134
|
-
assessment = 'behind';
|
|
135
|
-
}
|
|
136
|
-
reports.push({
|
|
137
|
-
riskId: risk.id,
|
|
138
|
-
riskTitle: risk.title,
|
|
139
|
-
riskStage: stageName,
|
|
140
|
-
focuses,
|
|
141
|
-
overallCompletionPct,
|
|
142
|
-
assessment,
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
return reports;
|
|
146
|
-
}
|
|
147
|
-
//# sourceMappingURL=mitigation-correlator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mitigation-correlator.js","sourceRoot":"","sources":["../../src/pm/mitigation-correlator.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAsE/C,8EAA8E;AAC9E,aAAa;AACb,8EAA8E;AAE9E;;;;;GAKG;AACH,MAAM,CAAC,KA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X,CAAC,CAAC;IACL,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Risk dependency scanner -- core poll logic for the PM engine.
|
|
3
|
-
*
|
|
4
|
-
* Queries risk_dependencies for items needing follow-up or escalation,
|
|
5
|
-
* then produces prioritized RiskFollowupAction items that the PM engine
|
|
6
|
-
* can act on (log, notify, or surface to the UI).
|
|
7
|
-
*/
|
|
8
|
-
export interface RiskFollowupAction {
|
|
9
|
-
riskId: string;
|
|
10
|
-
riskTitle: string;
|
|
11
|
-
dependencyId: string;
|
|
12
|
-
dependencyTitle: string;
|
|
13
|
-
ownerName: string | null;
|
|
14
|
-
ownerContact: string | null;
|
|
15
|
-
status: string;
|
|
16
|
-
nextFollowupAt: string | null;
|
|
17
|
-
lastContactAt: string | null;
|
|
18
|
-
action: 'send_followup' | 'escalate' | 'update_status';
|
|
19
|
-
urgency: 'low' | 'medium' | 'high';
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Scan all risk dependencies for a product and return prioritized follow-up actions.
|
|
23
|
-
*
|
|
24
|
-
* Queries all non-resolved dependencies, then evaluates each against the
|
|
25
|
-
* urgency and action rules to produce a sorted list of recommended actions.
|
|
26
|
-
*/
|
|
27
|
-
export declare function scanRiskDependencies(productId: string): Promise<RiskFollowupAction[]>;
|
|
28
|
-
//# sourceMappingURL=risk-scanner.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"risk-scanner.d.ts","sourceRoot":"","sources":["../../src/pm/risk-scanner.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAQH,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,MAAM,EAAE,eAAe,GAAG,UAAU,GAAG,eAAe,CAAC;IACvD,OAAO,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;CACpC;AAgCD;;;;;GAKG;AACH,wBAAsB,oBAAoB,CACxC,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAgG/B"}
|