@harbinger-ai/harbinger 0.1.2 → 0.1.4
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/lib/bounty/actions.js +45 -0
- package/lib/chat/actions.js +715 -0
- package/lib/chat/components/agents-page.js +918 -0
- package/lib/chat/components/agents-page.jsx +869 -0
- package/lib/chat/components/app-sidebar.js +17 -1
- package/lib/chat/components/app-sidebar.jsx +19 -1
- package/lib/chat/components/icons.js +145 -0
- package/lib/chat/components/icons.jsx +171 -0
- package/lib/chat/components/index.js +2 -0
- package/lib/chat/components/mcp-page.js +383 -55
- package/lib/chat/components/mcp-page.jsx +404 -101
- package/lib/chat/components/page-layout.js +41 -2
- package/lib/chat/components/page-layout.jsx +40 -2
- package/lib/chat/components/settings-layout.js +3 -2
- package/lib/chat/components/settings-layout.jsx +2 -1
- package/lib/chat/components/settings-providers-page.js +872 -0
- package/lib/chat/components/settings-providers-page.jsx +917 -0
- package/lib/chat/components/settings-secrets-page.js +91 -66
- package/lib/chat/components/settings-secrets-page.jsx +83 -72
- package/lib/chat/components/targets-page.js +554 -96
- package/lib/chat/components/targets-page.jsx +464 -114
- package/lib/mcp/actions.js +120 -0
- package/lib/mcp/registry.js +164 -0
- package/package.json +1 -1
package/lib/bounty/actions.js
CHANGED
|
@@ -98,6 +98,51 @@ export async function getFindingCounts() {
|
|
|
98
98
|
return dbCounts();
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
+
// ── Target Counts ───────────────────────────────────────────────────────────
|
|
102
|
+
|
|
103
|
+
export async function getProgramTargetCounts() {
|
|
104
|
+
await requireAuth();
|
|
105
|
+
const { getDb } = await import('../db/index.js');
|
|
106
|
+
const db = getDb();
|
|
107
|
+
const rows = db.prepare(`
|
|
108
|
+
SELECT program_id, COUNT(*) as total,
|
|
109
|
+
SUM(CASE WHEN status = 'in_scope' THEN 1 ELSE 0 END) as in_scope,
|
|
110
|
+
SUM(CASE WHEN status = 'out_of_scope' THEN 1 ELSE 0 END) as out_of_scope
|
|
111
|
+
FROM targets WHERE program_id IS NOT NULL
|
|
112
|
+
GROUP BY program_id
|
|
113
|
+
`).all();
|
|
114
|
+
const counts = {};
|
|
115
|
+
for (const r of rows) {
|
|
116
|
+
counts[r.program_id] = { total: r.total, inScope: r.in_scope, outOfScope: r.out_of_scope };
|
|
117
|
+
}
|
|
118
|
+
return counts;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export async function bulkImportTargets(programId, items) {
|
|
122
|
+
await requireAuth();
|
|
123
|
+
if (!programId || !Array.isArray(items) || items.length === 0) return { imported: 0 };
|
|
124
|
+
const { createTarget: dbCreate } = await import('./targets.js');
|
|
125
|
+
let imported = 0;
|
|
126
|
+
for (const item of items) {
|
|
127
|
+
if (!item.value) continue;
|
|
128
|
+
dbCreate({
|
|
129
|
+
programId,
|
|
130
|
+
type: item.type || 'domain',
|
|
131
|
+
value: item.value.trim(),
|
|
132
|
+
status: item.status || 'in_scope',
|
|
133
|
+
notes: item.notes || null,
|
|
134
|
+
});
|
|
135
|
+
imported++;
|
|
136
|
+
}
|
|
137
|
+
return { imported };
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export async function exportTargets(programId) {
|
|
141
|
+
await requireAuth();
|
|
142
|
+
const { getTargets: dbGet } = await import('./targets.js');
|
|
143
|
+
return dbGet(programId);
|
|
144
|
+
}
|
|
145
|
+
|
|
101
146
|
// ── Target Sync ─────────────────────────────────────────────────────────────
|
|
102
147
|
|
|
103
148
|
export async function syncTargetsFromPlatform(platform, options = {}) {
|