@agent-pattern-labs/leads-rig 0.1.3
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/.claude/agents/general-free.md +39 -0
- package/.claude/agents/general-paid.md +20 -0
- package/.claude/agents/glm-minimal.md +9 -0
- package/.claude/iso-route.resolved.json +21 -0
- package/.claude/settings.json +3 -0
- package/.codex/config.toml +24 -0
- package/.cursor/iso-route.md +17 -0
- package/.cursor/mcp.json +19 -0
- package/.cursor/rules/agent-general-free.mdc +38 -0
- package/.cursor/rules/agent-general-paid.mdc +19 -0
- package/.cursor/rules/agent-glm-minimal.mdc +8 -0
- package/.cursor/rules/main.mdc +61 -0
- package/.mcp.json +19 -0
- package/.opencode/agents/general-free.md +48 -0
- package/.opencode/agents/general-paid.md +29 -0
- package/.opencode/agents/glm-minimal.md +19 -0
- package/.opencode/instructions.md +3 -0
- package/.opencode/skills/lead-harness.md +56 -0
- package/.opencode/skills/public-leads.md +56 -0
- package/.pi/prompts/lead-harness.md +54 -0
- package/.pi/prompts/public-leads.md +54 -0
- package/.pi/skills/general-free/SKILL.md +38 -0
- package/.pi/skills/general-paid/SKILL.md +19 -0
- package/.pi/skills/glm-minimal/SKILL.md +8 -0
- package/AGENTS.md +56 -0
- package/CLAUDE.md +56 -0
- package/LICENSE +21 -0
- package/README.md +61 -0
- package/batch/README.md +37 -0
- package/batch/batch-prompt.md +19 -0
- package/batch/batch-runner.sh +18 -0
- package/bin/create-leads-harness.mjs +178 -0
- package/bin/lead-harness.mjs +201 -0
- package/bin/sync.mjs +150 -0
- package/config/profile.example.yml +34 -0
- package/docs/ARCHITECTURE.md +85 -0
- package/docs/CONSTRUCTION.md +40 -0
- package/docs/README.md +5 -0
- package/docs/SETUP.md +89 -0
- package/examples/README.md +9 -0
- package/examples/sample-leads.json +57 -0
- package/iso/agents/general-free.md +50 -0
- package/iso/agents/general-paid.md +31 -0
- package/iso/agents/glm-minimal.md +21 -0
- package/iso/commands/lead-harness.md +59 -0
- package/iso/commands/public-leads.md +59 -0
- package/iso/config.json +11 -0
- package/iso/instructions.md +56 -0
- package/iso/instructions.opencode.md +3 -0
- package/iso/mcp.json +16 -0
- package/lib/leadharness-crawler.mjs +911 -0
- package/lib/leadharness-ingest.mjs +157 -0
- package/lib/leadharness-leads.mjs +574 -0
- package/models.yaml +32 -0
- package/modes/_shared.md +50 -0
- package/modes/batch.md +34 -0
- package/modes/crawl.md +25 -0
- package/modes/ingest.md +33 -0
- package/modes/pipeline.md +27 -0
- package/modes/reference-local-helpers.md +13 -0
- package/modes/review.md +15 -0
- package/modes/setup.md +25 -0
- package/opencode.json +43 -0
- package/package.json +186 -0
- package/scripts/batch-orchestrator.mjs +558 -0
- package/scripts/crawl.mjs +129 -0
- package/scripts/ingest.mjs +48 -0
- package/scripts/manifest.mjs +71 -0
- package/scripts/pipeline.mjs +118 -0
- package/scripts/validate-leads.mjs +69 -0
- package/templates/canon.json +26 -0
- package/templates/capabilities.json +23 -0
- package/templates/context.json +20 -0
- package/templates/contracts.json +72 -0
- package/templates/facts.json +13 -0
- package/templates/index.json +13 -0
- package/templates/lead-schema.json +143 -0
- package/templates/lineage.json +10 -0
- package/templates/migrations.json +4 -0
- package/templates/postflight.json +11 -0
- package/templates/preflight.json +19 -0
- package/templates/prioritize.json +10 -0
- package/templates/redact.json +15 -0
- package/templates/score.json +18 -0
- package/templates/states.yml +25 -0
- package/templates/timeline.json +10 -0
- package/verify-pipeline.mjs +123 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"rules": [
|
|
4
|
+
{
|
|
5
|
+
"name": "admin-token",
|
|
6
|
+
"pattern": "(?i)(authorization:\\s*bearer\\s+)[A-Za-z0-9._~+\\/-]+",
|
|
7
|
+
"replacement": "$1[REDACTED]"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"name": "env-token",
|
|
11
|
+
"pattern": "(PUBLIC_LEADS_API_TOKEN=|LEAD_HARNESS_API_TOKEN=|ADMIN_API_TOKEN=)[^\\s]+",
|
|
12
|
+
"replacement": "$1[REDACTED]"
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"rubrics": [
|
|
4
|
+
{
|
|
5
|
+
"name": "lead-quality",
|
|
6
|
+
"scale": [1, 5],
|
|
7
|
+
"dimensions": [
|
|
8
|
+
{ "id": "source_quality", "weight": 0.3 },
|
|
9
|
+
{ "id": "person_specificity", "weight": 0.25 },
|
|
10
|
+
{ "id": "verification", "weight": 0.25 },
|
|
11
|
+
{ "id": "commercial_relevance", "weight": 0.2 }
|
|
12
|
+
],
|
|
13
|
+
"gates": {
|
|
14
|
+
"ingest": { "min": 2.5 }
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
states:
|
|
2
|
+
- id: discovered
|
|
3
|
+
label: Discovered
|
|
4
|
+
aliases: [found, queued]
|
|
5
|
+
- id: crawling
|
|
6
|
+
label: Crawling
|
|
7
|
+
aliases: [running, in_progress]
|
|
8
|
+
- id: extracted
|
|
9
|
+
label: Extracted
|
|
10
|
+
aliases: [parsed, collected]
|
|
11
|
+
- id: validated
|
|
12
|
+
label: Validated
|
|
13
|
+
aliases: [checked]
|
|
14
|
+
- id: ready_for_ingest
|
|
15
|
+
label: Ready for ingest
|
|
16
|
+
aliases: [ready]
|
|
17
|
+
- id: ingested
|
|
18
|
+
label: Ingested
|
|
19
|
+
aliases: [stored, submitted]
|
|
20
|
+
- id: failed
|
|
21
|
+
label: Failed
|
|
22
|
+
aliases: [error]
|
|
23
|
+
- id: skipped
|
|
24
|
+
label: Skipped
|
|
25
|
+
aliases: [skip]
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { existsSync } from 'fs';
|
|
4
|
+
import { readFileSync } from 'fs';
|
|
5
|
+
import { join } from 'path';
|
|
6
|
+
import {
|
|
7
|
+
discoverLeadArtifacts,
|
|
8
|
+
PROJECT_DIR,
|
|
9
|
+
readLeadArtifact,
|
|
10
|
+
relativeProjectPath,
|
|
11
|
+
validatePayload,
|
|
12
|
+
} from './lib/leadharness-leads.mjs';
|
|
13
|
+
|
|
14
|
+
let errors = 0;
|
|
15
|
+
let warnings = 0;
|
|
16
|
+
|
|
17
|
+
const requiredFiles = [
|
|
18
|
+
'package.json',
|
|
19
|
+
'bin/lead-harness.mjs',
|
|
20
|
+
'bin/sync.mjs',
|
|
21
|
+
'iso/instructions.md',
|
|
22
|
+
'iso/commands/public-leads.md',
|
|
23
|
+
'templates/lead-schema.json',
|
|
24
|
+
'templates/contracts.json',
|
|
25
|
+
'templates/states.yml',
|
|
26
|
+
'config/profile.example.yml',
|
|
27
|
+
'modes/_shared.md',
|
|
28
|
+
'modes/crawl.md',
|
|
29
|
+
'modes/pipeline.md',
|
|
30
|
+
'modes/batch.md',
|
|
31
|
+
'modes/ingest.md',
|
|
32
|
+
'batch/batch-prompt.md',
|
|
33
|
+
'batch/batch-runner.sh',
|
|
34
|
+
'scripts/crawl.mjs',
|
|
35
|
+
'scripts/pipeline.mjs',
|
|
36
|
+
'scripts/batch-orchestrator.mjs',
|
|
37
|
+
'docs/ARCHITECTURE.md',
|
|
38
|
+
];
|
|
39
|
+
|
|
40
|
+
for (const rel of requiredFiles) {
|
|
41
|
+
if (existsSync(join(PROJECT_DIR, rel))) ok(`${rel} exists`);
|
|
42
|
+
else error(`${rel} is missing`);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const artifacts = discoverLeadArtifacts(PROJECT_DIR);
|
|
46
|
+
if (artifacts.length === 0) {
|
|
47
|
+
ok('No lead artifacts found; fresh setup is valid');
|
|
48
|
+
} else {
|
|
49
|
+
for (const artifact of artifacts) {
|
|
50
|
+
verifyArtifact(artifact);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
verifyManifestIfPresent();
|
|
55
|
+
|
|
56
|
+
if (errors > 0) {
|
|
57
|
+
console.log(`\npublic-leads verify failed: ${errors} error(s), ${warnings} warning(s)`);
|
|
58
|
+
process.exit(1);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
console.log(`\npublic-leads verify passed: ${warnings} warning(s)`);
|
|
62
|
+
|
|
63
|
+
function verifyArtifact(path) {
|
|
64
|
+
try {
|
|
65
|
+
const payload = readLeadArtifact(path);
|
|
66
|
+
const result = validatePayload(payload);
|
|
67
|
+
for (const item of result.issues) {
|
|
68
|
+
const message = `${relativeProjectPath(path)} ${item.path}: ${item.code}: ${item.message}`;
|
|
69
|
+
if (item.severity === 'error') error(message);
|
|
70
|
+
else warn(message);
|
|
71
|
+
}
|
|
72
|
+
if (result.ok) {
|
|
73
|
+
ok(`${relativeProjectPath(path)} valid (${result.summary.leadCount} leads, ${result.summary.domainCount} domains)`);
|
|
74
|
+
}
|
|
75
|
+
} catch (error_) {
|
|
76
|
+
error(`${relativeProjectPath(path)}: ${error_ instanceof Error ? error_.message : String(error_)}`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function verifyManifestIfPresent() {
|
|
81
|
+
const path = join(PROJECT_DIR, 'data/lead-manifest.json');
|
|
82
|
+
if (!existsSync(path)) {
|
|
83
|
+
ok('Manifest not initialized');
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
try {
|
|
87
|
+
const manifest = JSON.parse(readFileSync(path, 'utf8'));
|
|
88
|
+
if (!Array.isArray(manifest.batches)) {
|
|
89
|
+
error('data/lead-manifest.json batches must be an array');
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
for (const batch of manifest.batches) {
|
|
93
|
+
if (!batch.input) {
|
|
94
|
+
error('manifest batch missing input');
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
const inputPath = join(PROJECT_DIR, batch.input);
|
|
98
|
+
if (!existsSync(inputPath)) {
|
|
99
|
+
error(`manifest input missing: ${batch.input}`);
|
|
100
|
+
}
|
|
101
|
+
if (batch.readyForIngest && batch.validation?.errors > 0) {
|
|
102
|
+
error(`manifest batch ${batch.id || batch.input} is readyForIngest with validation errors`);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
ok(`Manifest valid (${manifest.batches.length} batch records)`);
|
|
106
|
+
} catch (error_) {
|
|
107
|
+
error(`data/lead-manifest.json: ${error_ instanceof Error ? error_.message : String(error_)}`);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function ok(message) {
|
|
112
|
+
console.log(`OK ${message}`);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function warn(message) {
|
|
116
|
+
warnings++;
|
|
117
|
+
console.log(`WARN ${message}`);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function error(message) {
|
|
121
|
+
errors++;
|
|
122
|
+
console.log(`ERROR ${message}`);
|
|
123
|
+
}
|