@panguard-ai/panguard-chat 0.1.0
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/agent/chat-agent.d.ts +69 -0
- package/dist/agent/chat-agent.d.ts.map +1 -0
- package/dist/agent/chat-agent.js +477 -0
- package/dist/agent/chat-agent.js.map +1 -0
- package/dist/agent/formatter.d.ts +59 -0
- package/dist/agent/formatter.d.ts.map +1 -0
- package/dist/agent/formatter.js +399 -0
- package/dist/agent/formatter.js.map +1 -0
- package/dist/agent/index.d.ts +10 -0
- package/dist/agent/index.d.ts.map +1 -0
- package/dist/agent/index.js +10 -0
- package/dist/agent/index.js.map +1 -0
- package/dist/agent/prompts.d.ts +27 -0
- package/dist/agent/prompts.d.ts.map +1 -0
- package/dist/agent/prompts.js +164 -0
- package/dist/agent/prompts.js.map +1 -0
- package/dist/channels/email.d.ts +47 -0
- package/dist/channels/email.d.ts.map +1 -0
- package/dist/channels/email.js +250 -0
- package/dist/channels/email.js.map +1 -0
- package/dist/channels/index.d.ts +11 -0
- package/dist/channels/index.d.ts.map +1 -0
- package/dist/channels/index.js +11 -0
- package/dist/channels/index.js.map +1 -0
- package/dist/channels/line.d.ts.map +1 -0
- package/dist/channels/slack.d.ts +67 -0
- package/dist/channels/slack.d.ts.map +1 -0
- package/dist/channels/slack.js +269 -0
- package/dist/channels/slack.js.map +1 -0
- package/dist/channels/telegram.d.ts +69 -0
- package/dist/channels/telegram.d.ts.map +1 -0
- package/dist/channels/telegram.js +244 -0
- package/dist/channels/telegram.js.map +1 -0
- package/dist/channels/webhook.d.ts +70 -0
- package/dist/channels/webhook.d.ts.map +1 -0
- package/dist/channels/webhook.js +224 -0
- package/dist/channels/webhook.js.map +1 -0
- package/dist/cli/index.d.ts +22 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +337 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +41 -0
- package/dist/index.js.map +1 -0
- package/dist/onboarding/index.d.ts +9 -0
- package/dist/onboarding/index.d.ts.map +1 -0
- package/dist/onboarding/index.js +8 -0
- package/dist/onboarding/index.js.map +1 -0
- package/dist/onboarding/setup-flow.d.ts +65 -0
- package/dist/onboarding/setup-flow.d.ts.map +1 -0
- package/dist/onboarding/setup-flow.js +362 -0
- package/dist/onboarding/setup-flow.js.map +1 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +2 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/webhook-server.d.ts +46 -0
- package/dist/server/webhook-server.d.ts.map +1 -0
- package/dist/server/webhook-server.js +150 -0
- package/dist/server/webhook-server.js.map +1 -0
- package/dist/skills/index.d.ts +47 -0
- package/dist/skills/index.d.ts.map +1 -0
- package/dist/skills/index.js +313 -0
- package/dist/skills/index.js.map +1 -0
- package/dist/templates/alert-templates.d.ts +40 -0
- package/dist/templates/alert-templates.d.ts.map +1 -0
- package/dist/templates/alert-templates.js +159 -0
- package/dist/templates/alert-templates.js.map +1 -0
- package/dist/templates/index.d.ts +9 -0
- package/dist/templates/index.d.ts.map +1 -0
- package/dist/templates/index.js +8 -0
- package/dist/templates/index.js.map +1 -0
- package/dist/types.d.ts +246 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +8 -0
- package/dist/types.js.map +1 -0
- package/package.json +34 -0
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Alert Message Templates
|
|
3
|
+
* 告警訊息模板
|
|
4
|
+
*
|
|
5
|
+
* Pre-built templates for common security alert scenarios.
|
|
6
|
+
* Each template provides human-friendly descriptions for common attacks.
|
|
7
|
+
* 常見安全告警場景的預建模板。
|
|
8
|
+
* 每個模板提供常見攻擊的人性化描述。
|
|
9
|
+
*
|
|
10
|
+
* @module @panguard-ai/panguard-chat/templates/alert-templates
|
|
11
|
+
*/
|
|
12
|
+
// ---------------------------------------------------------------------------
|
|
13
|
+
// Alert Templates
|
|
14
|
+
// 告警模板
|
|
15
|
+
// ---------------------------------------------------------------------------
|
|
16
|
+
/** Built-in alert templates for common attack scenarios / 常見攻擊場景的內建告警模板 */
|
|
17
|
+
export const ALERT_TEMPLATES = [
|
|
18
|
+
{
|
|
19
|
+
attackType: 'ssh_brute_force',
|
|
20
|
+
humanSummary: {
|
|
21
|
+
'zh-TW': '有人正在嘗試猜你的密碼登入。已嘗試 {{count}} 次,全部失敗。',
|
|
22
|
+
en: 'Someone is trying to guess your login password. {{count}} attempts, all failed.',
|
|
23
|
+
},
|
|
24
|
+
analogy: {
|
|
25
|
+
'zh-TW': '就像有人在嘗試所有鑰匙組合來開你家的門',
|
|
26
|
+
en: "It's like someone trying every key combination to open your front door",
|
|
27
|
+
},
|
|
28
|
+
recommendedAction: {
|
|
29
|
+
'zh-TW': '建議啟用雙因素認證,並檢查所有帳號密碼強度。',
|
|
30
|
+
en: 'We recommend enabling two-factor authentication and checking all account password strength.',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
attackType: 'ransomware_detected',
|
|
35
|
+
humanSummary: {
|
|
36
|
+
'zh-TW': '發現一個勒索病毒({{variant}} 類型)。已在它加密檔案之前攔截並隔離。',
|
|
37
|
+
en: 'A ransomware variant ({{variant}} type) was detected. It was intercepted and quarantined before encrypting files.',
|
|
38
|
+
},
|
|
39
|
+
analogy: {
|
|
40
|
+
'zh-TW': '就像在小偷把你的檔案鎖進保險箱之前抓到了他',
|
|
41
|
+
en: 'Like catching a thief before they could lock your files in a safe',
|
|
42
|
+
},
|
|
43
|
+
recommendedAction: {
|
|
44
|
+
'zh-TW': '建議檢查最近的備份是否完整,確保所有系統已更新到最新版本。',
|
|
45
|
+
en: 'We recommend verifying your recent backups are complete and ensuring all systems are up to date.',
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
attackType: 'sql_injection',
|
|
50
|
+
humanSummary: {
|
|
51
|
+
'zh-TW': '有人試圖透過你的網站竊取資料庫中的資料。已成功阻擋。',
|
|
52
|
+
en: 'Someone attempted to steal data from your database through your website. Successfully blocked.',
|
|
53
|
+
},
|
|
54
|
+
analogy: {
|
|
55
|
+
'zh-TW': '就像有人試圖用特殊技巧讓你的網站說出不該說的秘密',
|
|
56
|
+
en: "Like someone trying to trick your website into revealing secrets it shouldn't",
|
|
57
|
+
},
|
|
58
|
+
recommendedAction: {
|
|
59
|
+
'zh-TW': '建議更新網站應用程式,並檢查是否有未修復的安全漏洞。',
|
|
60
|
+
en: 'We recommend updating your web application and checking for unpatched security vulnerabilities.',
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
attackType: 'suspicious_outbound',
|
|
65
|
+
humanSummary: {
|
|
66
|
+
'zh-TW': '你的伺服器正在嘗試連線到一個它從來沒連過的可疑地址。這不正常。已阻止此連線。',
|
|
67
|
+
en: 'Your server is trying to connect to a suspicious address it has never contacted before. This is unusual. Connection blocked.',
|
|
68
|
+
},
|
|
69
|
+
analogy: {
|
|
70
|
+
'zh-TW': '就像發現你家的電話半夜自動撥打一個陌生號碼',
|
|
71
|
+
en: 'Like discovering your phone is making calls to an unknown number in the middle of the night',
|
|
72
|
+
},
|
|
73
|
+
recommendedAction: {
|
|
74
|
+
'zh-TW': '建議檢查伺服器上最近安裝的軟體和正在執行的程序。',
|
|
75
|
+
en: 'We recommend checking recently installed software and running processes on the server.',
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
attackType: 'encoded_command',
|
|
80
|
+
humanSummary: {
|
|
81
|
+
'zh-TW': '有個程式試圖在背景執行一段加密的指令。這通常是駭客在做的事。已阻止執行。',
|
|
82
|
+
en: 'A program tried to execute an encoded command in the background. This is typically attacker behavior. Execution blocked.',
|
|
83
|
+
},
|
|
84
|
+
analogy: {
|
|
85
|
+
'zh-TW': '就像有人在你的電腦上偷偷執行一段用密碼寫的指令',
|
|
86
|
+
en: 'Like someone secretly running coded instructions on your computer',
|
|
87
|
+
},
|
|
88
|
+
recommendedAction: {
|
|
89
|
+
'zh-TW': '建議掃描整台電腦,檢查是否有其他可疑程式。',
|
|
90
|
+
en: 'We recommend scanning the entire system for other suspicious programs.',
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
attackType: 'privilege_escalation',
|
|
95
|
+
humanSummary: {
|
|
96
|
+
'zh-TW': '一個普通程式試圖取得系統最高權限。這可能是攻擊者在嘗試控制你的電腦。已阻止。',
|
|
97
|
+
en: 'A regular program tried to gain system administrator privileges. This could be an attacker trying to take control. Blocked.',
|
|
98
|
+
},
|
|
99
|
+
analogy: {
|
|
100
|
+
'zh-TW': '就像一個普通員工試圖偷走公司保險箱的鑰匙',
|
|
101
|
+
en: 'Like a regular employee trying to steal the keys to the company safe',
|
|
102
|
+
},
|
|
103
|
+
recommendedAction: {
|
|
104
|
+
'zh-TW': '建議檢查該程式的來源,並確認系統上的帳號權限設定是否正確。',
|
|
105
|
+
en: "We recommend checking the program's origin and verifying account permission settings on the system.",
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
attackType: 'data_exfiltration',
|
|
110
|
+
humanSummary: {
|
|
111
|
+
'zh-TW': '偵測到大量資料正在被傳送到外部。已暫停傳輸並等待您的確認。',
|
|
112
|
+
en: 'Large amounts of data were being transmitted externally. Transfer suspended pending your confirmation.',
|
|
113
|
+
},
|
|
114
|
+
analogy: {
|
|
115
|
+
'zh-TW': '就像發現有人正在把你辦公室的文件一箱一箱搬出去',
|
|
116
|
+
en: 'Like discovering someone is carrying boxes of your office documents out the back door',
|
|
117
|
+
},
|
|
118
|
+
recommendedAction: {
|
|
119
|
+
'zh-TW': '請確認這是否為正常的資料傳輸。如果不是,建議立即調查資料外洩的範圍。',
|
|
120
|
+
en: 'Please confirm whether this is a legitimate data transfer. If not, we recommend immediately investigating the scope of data exposure.',
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
];
|
|
124
|
+
// ---------------------------------------------------------------------------
|
|
125
|
+
// Template Lookup
|
|
126
|
+
// 模板查詢
|
|
127
|
+
// ---------------------------------------------------------------------------
|
|
128
|
+
/**
|
|
129
|
+
* Find an alert template by attack type
|
|
130
|
+
* 依攻擊類型查找告警模板
|
|
131
|
+
*
|
|
132
|
+
* @param attackType - The attack type identifier / 攻擊類型識別碼
|
|
133
|
+
* @returns Alert template or undefined / 告警模板或 undefined
|
|
134
|
+
*/
|
|
135
|
+
export function findAlertTemplate(attackType) {
|
|
136
|
+
return ALERT_TEMPLATES.find((t) => t.attackType === attackType);
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Get the human-friendly summary for an attack type
|
|
140
|
+
* 取得攻擊類型的人性化摘要
|
|
141
|
+
*
|
|
142
|
+
* @param attackType - The attack type / 攻擊類型
|
|
143
|
+
* @param language - Target language / 目標語言
|
|
144
|
+
* @param params - Template parameters / 模板參數
|
|
145
|
+
* @returns Human-friendly summary or undefined / 人性化摘要或 undefined
|
|
146
|
+
*/
|
|
147
|
+
export function getHumanSummary(attackType, language, params) {
|
|
148
|
+
const template = findAlertTemplate(attackType);
|
|
149
|
+
if (!template)
|
|
150
|
+
return undefined;
|
|
151
|
+
let text = template.humanSummary[language];
|
|
152
|
+
if (params) {
|
|
153
|
+
for (const [key, value] of Object.entries(params)) {
|
|
154
|
+
text = text.replace(`{{${key}}}`, String(value));
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return text;
|
|
158
|
+
}
|
|
159
|
+
//# sourceMappingURL=alert-templates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert-templates.js","sourceRoot":"","sources":["../../src/templates/alert-templates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAiBH,8EAA8E;AAC9E,kBAAkB;AAClB,OAAO;AACP,8EAA8E;AAE9E,2EAA2E;AAC3E,MAAM,CAAC,MAAM,eAAe,GAA6B;IACvD;QACE,UAAU,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CAAC,MAAM,CAAC,EAAE,CAAC;YAClD,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACnD,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Message Templates Module
|
|
3
|
+
* 訊息模板模組
|
|
4
|
+
*
|
|
5
|
+
* @module @panguard-ai/panguard-chat/templates
|
|
6
|
+
*/
|
|
7
|
+
export { ALERT_TEMPLATES, findAlertTemplate, getHumanSummary } from './alert-templates.js';
|
|
8
|
+
export type { AlertTemplate } from './alert-templates.js';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/templates/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC3F,YAAY,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/templates/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PanguardChat Type Definitions
|
|
3
|
+
* PanguardChat 型別定義
|
|
4
|
+
*
|
|
5
|
+
* @module @panguard-ai/panguard-chat
|
|
6
|
+
*/
|
|
7
|
+
/** User type determines the tone and detail level of messages.
|
|
8
|
+
* 用戶類型決定訊息語氣和細節層級。 */
|
|
9
|
+
export type UserType = 'developer' | 'boss' | 'it_admin';
|
|
10
|
+
/** Supported notification channel.
|
|
11
|
+
* 支援的通知管道。 */
|
|
12
|
+
export type ChannelType = 'telegram' | 'slack' | 'email' | 'webhook';
|
|
13
|
+
/** Supported language for messages.
|
|
14
|
+
* 訊息支援的語言。 */
|
|
15
|
+
export type MessageLanguage = 'zh-TW' | 'en';
|
|
16
|
+
/** Notification preferences for a user.
|
|
17
|
+
* 用戶的通知偏好設定。 */
|
|
18
|
+
export interface NotificationPreferences {
|
|
19
|
+
/** Push critical alerts immediately (default: true).
|
|
20
|
+
* 即時推送高危告警(預設 true)。 */
|
|
21
|
+
readonly criticalAlerts: boolean;
|
|
22
|
+
/** Daily summary (default: true).
|
|
23
|
+
* 每日摘要(預設 true)。 */
|
|
24
|
+
readonly dailySummary: boolean;
|
|
25
|
+
/** Weekly summary (default: true).
|
|
26
|
+
* 每週摘要(預設 true)。 */
|
|
27
|
+
readonly weeklySummary: boolean;
|
|
28
|
+
/** Peaceful "all clear" report when nothing happened (default: true).
|
|
29
|
+
* 無事報平安報告(預設 true)。 */
|
|
30
|
+
readonly peacefulReport: boolean;
|
|
31
|
+
}
|
|
32
|
+
/** User profile for tone adaptation.
|
|
33
|
+
* 用戶資料,用於語氣適配。 */
|
|
34
|
+
export interface UserProfile {
|
|
35
|
+
readonly type: UserType;
|
|
36
|
+
readonly language: MessageLanguage;
|
|
37
|
+
readonly notificationChannel: ChannelType;
|
|
38
|
+
readonly preferences: NotificationPreferences;
|
|
39
|
+
}
|
|
40
|
+
/** Severity level for alert display.
|
|
41
|
+
* 告警顯示的嚴重等級。 */
|
|
42
|
+
export type AlertSeverity = 'critical' | 'warning' | 'info';
|
|
43
|
+
/** Quick reply option for interactive channels.
|
|
44
|
+
* 互動管道的快速回覆選項。 */
|
|
45
|
+
export interface QuickReply {
|
|
46
|
+
readonly label: string;
|
|
47
|
+
readonly action: string;
|
|
48
|
+
}
|
|
49
|
+
/** Attachment for messages (PDF reports, screenshots).
|
|
50
|
+
* 訊息附件(PDF 報告、截圖等)。 */
|
|
51
|
+
export interface MessageAttachment {
|
|
52
|
+
readonly type: 'pdf' | 'image' | 'text';
|
|
53
|
+
readonly filename: string;
|
|
54
|
+
readonly data: Buffer;
|
|
55
|
+
}
|
|
56
|
+
/** Formatted message for sending via any channel.
|
|
57
|
+
* 透過任何管道發送的格式化訊息。 */
|
|
58
|
+
export interface FormattedMessage {
|
|
59
|
+
readonly text: string;
|
|
60
|
+
readonly severity?: AlertSeverity;
|
|
61
|
+
readonly quickReplies?: readonly QuickReply[];
|
|
62
|
+
readonly attachments?: readonly MessageAttachment[];
|
|
63
|
+
}
|
|
64
|
+
/** Threat alert payload for the Chat Agent.
|
|
65
|
+
* Chat Agent 的威脅告警資料。 */
|
|
66
|
+
export interface ThreatAlert {
|
|
67
|
+
readonly conclusion: 'benign' | 'suspicious' | 'malicious';
|
|
68
|
+
readonly confidence: number;
|
|
69
|
+
readonly humanSummary: string;
|
|
70
|
+
readonly reasoning: string;
|
|
71
|
+
readonly recommendedAction: string;
|
|
72
|
+
readonly mitreTechnique?: string;
|
|
73
|
+
readonly severity: 'info' | 'low' | 'medium' | 'high' | 'critical';
|
|
74
|
+
readonly eventDescription: string;
|
|
75
|
+
readonly actionsTaken?: readonly string[];
|
|
76
|
+
readonly timestamp: string;
|
|
77
|
+
}
|
|
78
|
+
/** Daily or weekly summary payload.
|
|
79
|
+
* 日報或週報摘要資料。 */
|
|
80
|
+
export interface SummaryReport {
|
|
81
|
+
readonly period: 'daily' | 'weekly';
|
|
82
|
+
readonly startDate: string;
|
|
83
|
+
readonly endDate: string;
|
|
84
|
+
readonly totalEvents: number;
|
|
85
|
+
readonly threatsBlocked: number;
|
|
86
|
+
readonly suspiciousEvents: number;
|
|
87
|
+
readonly topAttackSources: readonly AttackSource[];
|
|
88
|
+
readonly actionsTaken: readonly ActionSummary[];
|
|
89
|
+
readonly estimatedDamageAvoided?: number;
|
|
90
|
+
readonly trendComparison?: TrendComparison;
|
|
91
|
+
readonly newThreatsDiscovered?: readonly string[];
|
|
92
|
+
readonly recommendations?: readonly string[];
|
|
93
|
+
}
|
|
94
|
+
/** Attack source entry in summary.
|
|
95
|
+
* 摘要中的攻擊來源條目。 */
|
|
96
|
+
export interface AttackSource {
|
|
97
|
+
readonly ip: string;
|
|
98
|
+
readonly count: number;
|
|
99
|
+
readonly country?: string;
|
|
100
|
+
}
|
|
101
|
+
/** Action summary entry.
|
|
102
|
+
* 動作摘要條目。 */
|
|
103
|
+
export interface ActionSummary {
|
|
104
|
+
readonly action: string;
|
|
105
|
+
readonly count: number;
|
|
106
|
+
}
|
|
107
|
+
/** Trend comparison data.
|
|
108
|
+
* 趨勢比較資料。 */
|
|
109
|
+
export interface TrendComparison {
|
|
110
|
+
readonly thisPeriod: number;
|
|
111
|
+
readonly lastPeriod: number;
|
|
112
|
+
readonly changePercent: number;
|
|
113
|
+
}
|
|
114
|
+
/** Learning period progress notification.
|
|
115
|
+
* 學習期進度通知。 */
|
|
116
|
+
export interface LearningProgress {
|
|
117
|
+
readonly day: number;
|
|
118
|
+
readonly totalDays: number;
|
|
119
|
+
readonly patternsRecorded: number;
|
|
120
|
+
readonly eventsAnalyzed: number;
|
|
121
|
+
readonly notableFindings: number;
|
|
122
|
+
}
|
|
123
|
+
/** User confirmation request (Respond Agent asks Chat Agent to confirm).
|
|
124
|
+
* 用戶確認請求(Respond Agent 請 Chat Agent 確認)。 */
|
|
125
|
+
export interface ConfirmationRequest {
|
|
126
|
+
readonly verdictId: string;
|
|
127
|
+
readonly conclusion: 'suspicious' | 'malicious';
|
|
128
|
+
readonly confidence: number;
|
|
129
|
+
readonly humanSummary: string;
|
|
130
|
+
readonly proposedAction: string;
|
|
131
|
+
readonly expiresAt: string;
|
|
132
|
+
}
|
|
133
|
+
/** User confirmation response.
|
|
134
|
+
* 用戶確認回應。 */
|
|
135
|
+
export interface ConfirmationResponse {
|
|
136
|
+
readonly verdictId: string;
|
|
137
|
+
readonly confirmed: boolean;
|
|
138
|
+
readonly reason?: string;
|
|
139
|
+
readonly respondedAt: string;
|
|
140
|
+
}
|
|
141
|
+
/** Context for follow-up question (low token cost).
|
|
142
|
+
* 追問的上下文(低 token 成本)。 */
|
|
143
|
+
export interface FollowUpContext {
|
|
144
|
+
readonly verdictId: string;
|
|
145
|
+
readonly originalAlert: ThreatAlert;
|
|
146
|
+
readonly conversationHistory: readonly ConversationTurn[];
|
|
147
|
+
}
|
|
148
|
+
/** A single conversation turn.
|
|
149
|
+
* 一輪對話。 */
|
|
150
|
+
export interface ConversationTurn {
|
|
151
|
+
readonly role: 'user' | 'assistant';
|
|
152
|
+
readonly content: string;
|
|
153
|
+
readonly timestamp: string;
|
|
154
|
+
}
|
|
155
|
+
/** Unified messaging channel interface for all platforms.
|
|
156
|
+
* 所有平台的統一通訊管道介面。 */
|
|
157
|
+
export interface MessagingChannel {
|
|
158
|
+
/** Channel identifier.
|
|
159
|
+
* 管道識別碼。 */
|
|
160
|
+
readonly channelType: ChannelType;
|
|
161
|
+
/** Send a formatted message.
|
|
162
|
+
* 發送格式化訊息。 */
|
|
163
|
+
sendMessage(userId: string, message: FormattedMessage): Promise<ChannelResult>;
|
|
164
|
+
/** Send a threat alert.
|
|
165
|
+
* 發送威脅告警。 */
|
|
166
|
+
sendAlert(userId: string, alert: ThreatAlert): Promise<ChannelResult>;
|
|
167
|
+
/** Send a file (PDF report etc).
|
|
168
|
+
* 發送檔案(PDF 報告等)。 */
|
|
169
|
+
sendFile(userId: string, file: Buffer, filename: string): Promise<ChannelResult>;
|
|
170
|
+
/** Register a handler for incoming replies.
|
|
171
|
+
* 註冊收到回覆的處理器。 */
|
|
172
|
+
onReply(handler: ReplyHandler): void;
|
|
173
|
+
}
|
|
174
|
+
/** Reply handler callback type.
|
|
175
|
+
* 回覆處理器的回呼型別。 */
|
|
176
|
+
export type ReplyHandler = (userId: string, text: string) => Promise<string>;
|
|
177
|
+
/** Result of a channel send operation.
|
|
178
|
+
* 管道發送操作的結果。 */
|
|
179
|
+
export interface ChannelResult {
|
|
180
|
+
readonly success: boolean;
|
|
181
|
+
readonly channel: ChannelType;
|
|
182
|
+
readonly error?: string;
|
|
183
|
+
readonly messageId?: string;
|
|
184
|
+
}
|
|
185
|
+
/** Webhook authentication method.
|
|
186
|
+
* Webhook 認證方式。 */
|
|
187
|
+
export type WebhookAuthMethod = 'bearer_token' | 'mtls' | 'hmac_signature';
|
|
188
|
+
/** Webhook channel configuration.
|
|
189
|
+
* Webhook 管道配置。 */
|
|
190
|
+
export interface WebhookConfig {
|
|
191
|
+
readonly endpoint: string;
|
|
192
|
+
readonly authMethod: WebhookAuthMethod;
|
|
193
|
+
readonly secret: string;
|
|
194
|
+
readonly headers?: Readonly<Record<string, string>>;
|
|
195
|
+
}
|
|
196
|
+
/** LLM provider interface for chat follow-up (optional). */
|
|
197
|
+
export interface ChatLLMProvider {
|
|
198
|
+
analyze(prompt: string, context?: string): Promise<{
|
|
199
|
+
summary: string;
|
|
200
|
+
}>;
|
|
201
|
+
isAvailable(): Promise<boolean>;
|
|
202
|
+
}
|
|
203
|
+
/** Full PanguardChat configuration.
|
|
204
|
+
* 完整 PanguardChat 配置。 */
|
|
205
|
+
export interface ChatConfig {
|
|
206
|
+
readonly userProfile: UserProfile;
|
|
207
|
+
readonly channels: ChannelConfigs;
|
|
208
|
+
readonly maxFollowUpTokens: number;
|
|
209
|
+
readonly systemPromptOverride?: string;
|
|
210
|
+
readonly llmProvider?: ChatLLMProvider;
|
|
211
|
+
}
|
|
212
|
+
/** Per-channel configuration.
|
|
213
|
+
* 各管道配置。 */
|
|
214
|
+
export interface ChannelConfigs {
|
|
215
|
+
readonly telegram?: TelegramChannelConfig;
|
|
216
|
+
readonly slack?: SlackChannelConfig;
|
|
217
|
+
readonly email?: EmailChannelConfig;
|
|
218
|
+
readonly webhook?: WebhookConfig;
|
|
219
|
+
}
|
|
220
|
+
/** Telegram Bot configuration.
|
|
221
|
+
* Telegram Bot 配置。 */
|
|
222
|
+
export interface TelegramChannelConfig {
|
|
223
|
+
readonly botToken: string;
|
|
224
|
+
readonly chatId: string;
|
|
225
|
+
}
|
|
226
|
+
/** Slack App configuration.
|
|
227
|
+
* Slack App 配置。 */
|
|
228
|
+
export interface SlackChannelConfig {
|
|
229
|
+
readonly botToken: string;
|
|
230
|
+
readonly signingSecret: string;
|
|
231
|
+
readonly defaultChannel: string;
|
|
232
|
+
}
|
|
233
|
+
/** Email channel configuration.
|
|
234
|
+
* Email 管道配置。 */
|
|
235
|
+
export interface EmailChannelConfig {
|
|
236
|
+
readonly host: string;
|
|
237
|
+
readonly port: number;
|
|
238
|
+
readonly secure: boolean;
|
|
239
|
+
readonly auth: {
|
|
240
|
+
readonly user: string;
|
|
241
|
+
readonly pass: string;
|
|
242
|
+
};
|
|
243
|
+
readonly from: string;
|
|
244
|
+
readonly to: readonly string[];
|
|
245
|
+
}
|
|
246
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH;uBACuB;AACvB,MAAM,MAAM,QAAQ,GAAG,WAAW,GAAG,MAAM,GAAG,UAAU,CAAC;AAEzD;eACe;AACf,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,OAAO,GAAG,OAAO,GAAG,SAAS,CAAC;AAErE;eACe;AACf,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,IAAI,CAAC;AAE7C;iBACiB;AACjB,MAAM,WAAW,uBAAuB;IACtC;6BACyB;IACzB,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC;yBACqB;IACrB,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B;yBACqB;IACrB,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAChC;4BACwB;IACxB,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;CAClC;AAED;mBACmB;AACnB,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EA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C;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAChE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,EAAE,SAAS,MAAM,EAAE,CAAC;CAChC"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@panguard-ai/panguard-chat",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "AI security assistant via messaging platforms / 透過通訊軟體管理資安的 AI 助手",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"bin": {
|
|
9
|
+
"panguard-chat": "./dist/cli/index.js"
|
|
10
|
+
},
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"access": "public"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"package.json",
|
|
17
|
+
"README.md"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "tsc --build",
|
|
21
|
+
"clean": "rm -rf dist tsconfig.tsbuildinfo",
|
|
22
|
+
"typecheck": "tsc --noEmit",
|
|
23
|
+
"test": "vitest run",
|
|
24
|
+
"dev": "tsc --build --watch",
|
|
25
|
+
"prepublishOnly": "pnpm run build"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@panguard-ai/core": "workspace:*"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@types/node": "^22.14.0",
|
|
32
|
+
"typescript": "~5.7.3"
|
|
33
|
+
}
|
|
34
|
+
}
|