@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.
Files changed (87) hide show
  1. package/.claude/agents/general-free.md +39 -0
  2. package/.claude/agents/general-paid.md +20 -0
  3. package/.claude/agents/glm-minimal.md +9 -0
  4. package/.claude/iso-route.resolved.json +21 -0
  5. package/.claude/settings.json +3 -0
  6. package/.codex/config.toml +24 -0
  7. package/.cursor/iso-route.md +17 -0
  8. package/.cursor/mcp.json +19 -0
  9. package/.cursor/rules/agent-general-free.mdc +38 -0
  10. package/.cursor/rules/agent-general-paid.mdc +19 -0
  11. package/.cursor/rules/agent-glm-minimal.mdc +8 -0
  12. package/.cursor/rules/main.mdc +61 -0
  13. package/.mcp.json +19 -0
  14. package/.opencode/agents/general-free.md +48 -0
  15. package/.opencode/agents/general-paid.md +29 -0
  16. package/.opencode/agents/glm-minimal.md +19 -0
  17. package/.opencode/instructions.md +3 -0
  18. package/.opencode/skills/lead-harness.md +56 -0
  19. package/.opencode/skills/public-leads.md +56 -0
  20. package/.pi/prompts/lead-harness.md +54 -0
  21. package/.pi/prompts/public-leads.md +54 -0
  22. package/.pi/skills/general-free/SKILL.md +38 -0
  23. package/.pi/skills/general-paid/SKILL.md +19 -0
  24. package/.pi/skills/glm-minimal/SKILL.md +8 -0
  25. package/AGENTS.md +56 -0
  26. package/CLAUDE.md +56 -0
  27. package/LICENSE +21 -0
  28. package/README.md +61 -0
  29. package/batch/README.md +37 -0
  30. package/batch/batch-prompt.md +19 -0
  31. package/batch/batch-runner.sh +18 -0
  32. package/bin/create-leads-harness.mjs +178 -0
  33. package/bin/lead-harness.mjs +201 -0
  34. package/bin/sync.mjs +150 -0
  35. package/config/profile.example.yml +34 -0
  36. package/docs/ARCHITECTURE.md +85 -0
  37. package/docs/CONSTRUCTION.md +40 -0
  38. package/docs/README.md +5 -0
  39. package/docs/SETUP.md +89 -0
  40. package/examples/README.md +9 -0
  41. package/examples/sample-leads.json +57 -0
  42. package/iso/agents/general-free.md +50 -0
  43. package/iso/agents/general-paid.md +31 -0
  44. package/iso/agents/glm-minimal.md +21 -0
  45. package/iso/commands/lead-harness.md +59 -0
  46. package/iso/commands/public-leads.md +59 -0
  47. package/iso/config.json +11 -0
  48. package/iso/instructions.md +56 -0
  49. package/iso/instructions.opencode.md +3 -0
  50. package/iso/mcp.json +16 -0
  51. package/lib/leadharness-crawler.mjs +911 -0
  52. package/lib/leadharness-ingest.mjs +157 -0
  53. package/lib/leadharness-leads.mjs +574 -0
  54. package/models.yaml +32 -0
  55. package/modes/_shared.md +50 -0
  56. package/modes/batch.md +34 -0
  57. package/modes/crawl.md +25 -0
  58. package/modes/ingest.md +33 -0
  59. package/modes/pipeline.md +27 -0
  60. package/modes/reference-local-helpers.md +13 -0
  61. package/modes/review.md +15 -0
  62. package/modes/setup.md +25 -0
  63. package/opencode.json +43 -0
  64. package/package.json +186 -0
  65. package/scripts/batch-orchestrator.mjs +558 -0
  66. package/scripts/crawl.mjs +129 -0
  67. package/scripts/ingest.mjs +48 -0
  68. package/scripts/manifest.mjs +71 -0
  69. package/scripts/pipeline.mjs +118 -0
  70. package/scripts/validate-leads.mjs +69 -0
  71. package/templates/canon.json +26 -0
  72. package/templates/capabilities.json +23 -0
  73. package/templates/context.json +20 -0
  74. package/templates/contracts.json +72 -0
  75. package/templates/facts.json +13 -0
  76. package/templates/index.json +13 -0
  77. package/templates/lead-schema.json +143 -0
  78. package/templates/lineage.json +10 -0
  79. package/templates/migrations.json +4 -0
  80. package/templates/postflight.json +11 -0
  81. package/templates/preflight.json +19 -0
  82. package/templates/prioritize.json +10 -0
  83. package/templates/redact.json +15 -0
  84. package/templates/score.json +18 -0
  85. package/templates/states.yml +25 -0
  86. package/templates/timeline.json +10 -0
  87. package/verify-pipeline.mjs +123 -0
package/modes/crawl.md ADDED
@@ -0,0 +1,25 @@
1
+ # Crawl Mode
2
+
3
+ Use this for one or more assigned domains.
4
+
5
+ ## Procedure
6
+
7
+ 1. Normalize the domain to lowercase without protocol or `www.`.
8
+ 2. Visit only bounded public pages from the official site.
9
+ 3. Prefer the deterministic crawler when no browser-only blocker exists:
10
+ `npx public-leads crawl --input data/domains.tsv --out data/lead-results.json`
11
+ 4. Extract public email addresses, person names/titles when visible nearby, contact forms, source URLs, page titles, evidence snippets, and warnings.
12
+ 5. Emit a JSON payload matching `templates/lead-schema.json`.
13
+ 6. Save the payload to `data/lead-results.json` for single-domain runs or `batch/lead-results-{id}.json` for batch workers.
14
+ 7. Run `npx public-leads validate --input <artifact>`.
15
+ 8. Return the artifact path and validation status.
16
+
17
+ ## Output Contract
18
+
19
+ For worker/batch mode, end with one JSON status line:
20
+
21
+ ```json
22
+ {"id":"<id>","status":"completed|failed","domain":"example.com","leadCount":0,"artifact":"batch/lead-results-<id>.json","error":null}
23
+ ```
24
+
25
+ No source-backed lead should be described only in prose.
@@ -0,0 +1,33 @@
1
+ # Ingest Mode
2
+
3
+ Use this when the user asks to store validated leads in a configured ingest API.
4
+
5
+ ## Preflight
6
+
7
+ 1. Validate the artifact:
8
+ ```bash
9
+ npx public-leads validate --input <artifact>
10
+ ```
11
+ 2. Update the manifest:
12
+ ```bash
13
+ npx public-leads manifest --input <artifact>
14
+ ```
15
+ 3. Confirm ingest credentials and request settings are available through `config/profile.yml` and the configured environment variable. Do not print token values.
16
+
17
+ ## Dry Run
18
+
19
+ Use dry-run before live ingest unless the user explicitly requested live submission:
20
+
21
+ ```bash
22
+ npx public-leads ingest --input <artifact> --dry-run --out data/ingest-response.json
23
+ ```
24
+
25
+ ## Live Ingest
26
+
27
+ ```bash
28
+ npx public-leads ingest --input <artifact> --target-project /path/to/cold-agent-leads --out data/ingest-response.json
29
+ ```
30
+
31
+ ## Output
32
+
33
+ Return HTTP status, job ID if present, lead count, and response artifact path.
@@ -0,0 +1,27 @@
1
+ # Pipeline Mode
2
+
3
+ Use this when the user supplies a list of domains or wants the local domain queue processed.
4
+
5
+ ## Inputs
6
+
7
+ Read domains from the first available source:
8
+
9
+ 1. Domains in the user's request.
10
+ 2. `data/domains.tsv` with columns `domain`, optional `company`, optional `notes`.
11
+ 3. `data/pipeline.md` checkbox lines such as `- [ ] example.com | Example | notes`.
12
+
13
+ ## Procedure
14
+
15
+ 1. Build a deduped candidate list.
16
+ 2. Drop domains already represented in the manifest unless the user asks to retry.
17
+ 3. Prefer the deterministic end-to-end command for normal public pages:
18
+ `npx public-leads pipeline --input data/domains.tsv --out data/lead-results.json`
19
+ 4. Use browser/MCP workers only when the deterministic crawler cannot reach a public page or the site requires rendering.
20
+ 5. For browser-heavy batch work, use `batch/batch-runner.sh --parallel 2`.
21
+ 6. Validate every artifact with `npx public-leads validate`.
22
+ 7. Merge validated artifacts into a manifest with `npx public-leads manifest --input <artifact>`.
23
+ 8. Ingest with `npx public-leads pipeline --ingest --target-project /path/to/cold-agent-leads` only when upload is requested.
24
+
25
+ ## Output
26
+
27
+ List processed artifact paths, validation status, manifest path, and the next ingest command.
@@ -0,0 +1,13 @@
1
+ # Local Helper Reference
2
+
3
+ Use deterministic helpers instead of repeating schema logic in prompts.
4
+
5
+ | Need | Command |
6
+ |---|---|
7
+ | Validate a lead artifact | `npx public-leads validate --input <file>` |
8
+ | Build/update manifest | `npx public-leads manifest --input <file>` |
9
+ | Dry-run ingest | `npx public-leads ingest --input <file> --dry-run` |
10
+ | Live ingest | `npx public-leads ingest --input <file>` |
11
+ | Full gate | `npx public-leads verify` |
12
+ | Batch dry-run | `batch/batch-runner.sh --dry-run` |
13
+ | Batch execute | `batch/batch-runner.sh --parallel 2` |
@@ -0,0 +1,15 @@
1
+ # Review Mode
2
+
3
+ Use this to inspect local lead artifacts, manifest state, or ingest responses.
4
+
5
+ ## Procedure
6
+
7
+ 1. Run `npx public-leads verify`.
8
+ 2. Inspect `data/lead-manifest.json` if present.
9
+ 3. Validate any specific artifact requested by the user.
10
+ 4. Summarize counts by domain and `emailType`.
11
+ 5. Surface validation errors before summaries.
12
+
13
+ ## Output
14
+
15
+ Findings first, then concise summary and next action.
package/modes/setup.md ADDED
@@ -0,0 +1,25 @@
1
+ # Setup Mode
2
+
3
+ Use this when the user asks to configure or inspect the lead harness.
4
+
5
+ ## Checklist
6
+
7
+ 1. Confirm `config/profile.yml` exists. If it is missing, copy from `config/profile.example.yml` in a consumer project.
8
+ 2. Confirm at least one domain input exists:
9
+ - `data/domains.tsv`
10
+ - `data/pipeline.md`
11
+ - direct domains in the user request
12
+ 3. Confirm the ingest API settings:
13
+ - `api.base_url`
14
+ - `api.ingest_path`
15
+ - `api.operator_email`
16
+ - `api.operator_email_header`
17
+ - `api.auth_header`
18
+ - `api.auth_scheme`
19
+ - `api.auth_token_env`
20
+ - `api.target_project` when using a local Cold Agent Leads checkout for `.env` credentials
21
+ 4. Run `npx public-leads verify`.
22
+
23
+ ## Output
24
+
25
+ Return a concise setup status with missing files, the command to run next, and no secrets.
package/opencode.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "$schema": "https://opencode.ai/config.json",
3
+ "model": "opencode-go/deepseek-v4-flash",
4
+ "agent": {
5
+ "fast": {
6
+ "model": "opencode-go/deepseek-v4-flash"
7
+ },
8
+ "quality": {
9
+ "model": "opencode-go/deepseek-v4-flash"
10
+ },
11
+ "minimal": {
12
+ "model": "opencode-go/deepseek-v4-flash"
13
+ }
14
+ },
15
+ "mcp": {
16
+ "geometra": {
17
+ "type": "local",
18
+ "command": [
19
+ "npx",
20
+ "-y",
21
+ "@geometra/mcp@1.61.3"
22
+ ],
23
+ "environment": {}
24
+ },
25
+ "state-trace": {
26
+ "type": "local",
27
+ "command": [
28
+ "state-trace-mcp"
29
+ ],
30
+ "environment": {
31
+ "STATE_TRACE_STORAGE_PATH": ".state-trace/memory.db",
32
+ "STATE_TRACE_NAMESPACE": "public-leads-harness",
33
+ "STATE_TRACE_CAPACITY_LIMIT": "256"
34
+ }
35
+ }
36
+ },
37
+ "instructions": [
38
+ "templates/lead-schema.json",
39
+ "templates/states.yml",
40
+ ".opencode/instructions.md"
41
+ ],
42
+ "small_model": "opencode-go/deepseek-v4-flash"
43
+ }
package/package.json ADDED
@@ -0,0 +1,186 @@
1
+ {
2
+ "name": "@agent-pattern-labs/leads-rig",
3
+ "version": "0.1.3",
4
+ "description": "Agentic public-web lead discovery harness with portable ingest artifacts",
5
+ "type": "module",
6
+ "author": "Razroo",
7
+ "homepage": "https://github.com/Agent-Pattern-Labs/leads-rig#readme",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/Agent-Pattern-Labs/leads-rig.git"
11
+ },
12
+ "bugs": {
13
+ "url": "https://github.com/Agent-Pattern-Labs/leads-rig/issues"
14
+ },
15
+ "publishConfig": {
16
+ "access": "public"
17
+ },
18
+ "bin": {
19
+ "public-leads": "bin/lead-harness.mjs",
20
+ "create-public-leads-harness": "bin/create-leads-harness.mjs",
21
+ "lead-harness": "bin/lead-harness.mjs",
22
+ "create-leads-harness": "bin/create-leads-harness.mjs"
23
+ },
24
+ "scripts": {
25
+ "verify": "node verify-pipeline.mjs",
26
+ "build:config": "iso-route build models.yaml --out . && iso-harness build",
27
+ "smoke:iso": "iso-route build models.yaml --out . --dry-run && iso-harness build --dry-run",
28
+ "lead:crawl": "node bin/lead-harness.mjs crawl",
29
+ "lead:pipeline": "node bin/lead-harness.mjs pipeline",
30
+ "lead:validate": "node bin/lead-harness.mjs validate",
31
+ "lead:manifest": "node bin/lead-harness.mjs manifest",
32
+ "lead:ingest": "node bin/lead-harness.mjs ingest",
33
+ "batch": "batch/batch-runner.sh",
34
+ "trace:list": "node bin/lead-harness.mjs trace:list",
35
+ "trace:stats": "node bin/lead-harness.mjs trace:stats",
36
+ "trace:show": "node bin/lead-harness.mjs trace:show",
37
+ "guard:audit": "node bin/lead-harness.mjs guard:audit",
38
+ "guard:explain": "node bin/lead-harness.mjs guard:explain",
39
+ "ledger:status": "node bin/lead-harness.mjs ledger:status",
40
+ "ledger:rebuild": "node bin/lead-harness.mjs ledger:rebuild",
41
+ "ledger:verify": "node bin/lead-harness.mjs ledger:verify",
42
+ "capabilities:list": "node bin/lead-harness.mjs capabilities:list",
43
+ "capabilities:explain": "node bin/lead-harness.mjs capabilities:explain",
44
+ "capabilities:check": "node bin/lead-harness.mjs capabilities:check",
45
+ "context:list": "node bin/lead-harness.mjs context:list",
46
+ "context:explain": "node bin/lead-harness.mjs context:explain",
47
+ "context:plan": "node bin/lead-harness.mjs context:plan",
48
+ "context:check": "node bin/lead-harness.mjs context:check",
49
+ "context:render": "node bin/lead-harness.mjs context:render",
50
+ "cache:key": "node bin/lead-harness.mjs cache:key",
51
+ "cache:has": "node bin/lead-harness.mjs cache:has",
52
+ "cache:get": "node bin/lead-harness.mjs cache:get",
53
+ "cache:put": "node bin/lead-harness.mjs cache:put",
54
+ "cache:status": "node bin/lead-harness.mjs cache:status",
55
+ "cache:list": "node bin/lead-harness.mjs cache:list",
56
+ "cache:verify": "node bin/lead-harness.mjs cache:verify",
57
+ "cache:prune": "node bin/lead-harness.mjs cache:prune",
58
+ "index:build": "node bin/lead-harness.mjs index:build",
59
+ "index:status": "node bin/lead-harness.mjs index:status",
60
+ "index:query": "node bin/lead-harness.mjs index:query",
61
+ "index:has": "node bin/lead-harness.mjs index:has",
62
+ "index:verify": "node bin/lead-harness.mjs index:verify",
63
+ "facts:build": "node bin/lead-harness.mjs facts:build",
64
+ "facts:status": "node bin/lead-harness.mjs facts:status",
65
+ "facts:query": "node bin/lead-harness.mjs facts:query",
66
+ "facts:has": "node bin/lead-harness.mjs facts:has",
67
+ "facts:verify": "node bin/lead-harness.mjs facts:verify",
68
+ "score:compute": "node bin/lead-harness.mjs score:compute",
69
+ "score:verify": "node bin/lead-harness.mjs score:verify",
70
+ "score:check": "node bin/lead-harness.mjs score:check",
71
+ "score:gate": "node bin/lead-harness.mjs score:gate",
72
+ "score:compare": "node bin/lead-harness.mjs score:compare",
73
+ "score:explain": "node bin/lead-harness.mjs score:explain",
74
+ "canon:normalize": "node bin/lead-harness.mjs canon:normalize",
75
+ "canon:key": "node bin/lead-harness.mjs canon:key",
76
+ "canon:compare": "node bin/lead-harness.mjs canon:compare",
77
+ "canon:explain": "node bin/lead-harness.mjs canon:explain",
78
+ "preflight:plan": "node bin/lead-harness.mjs preflight:plan",
79
+ "preflight:check": "node bin/lead-harness.mjs preflight:check",
80
+ "preflight:explain": "node bin/lead-harness.mjs preflight:explain",
81
+ "postflight:status": "node bin/lead-harness.mjs postflight:status",
82
+ "postflight:check": "node bin/lead-harness.mjs postflight:check",
83
+ "postflight:explain": "node bin/lead-harness.mjs postflight:explain",
84
+ "timeline:status": "node bin/lead-harness.mjs timeline:status",
85
+ "timeline:build": "node bin/lead-harness.mjs timeline:build",
86
+ "timeline:plan": "node bin/lead-harness.mjs timeline:plan",
87
+ "timeline:due": "node bin/lead-harness.mjs timeline:due",
88
+ "timeline:check": "node bin/lead-harness.mjs timeline:check",
89
+ "timeline:verify": "node bin/lead-harness.mjs timeline:verify",
90
+ "prioritize:status": "node bin/lead-harness.mjs prioritize:status",
91
+ "prioritize:items": "node bin/lead-harness.mjs prioritize:items",
92
+ "prioritize:build": "node bin/lead-harness.mjs prioritize:build",
93
+ "prioritize:rank": "node bin/lead-harness.mjs prioritize:rank",
94
+ "prioritize:select": "node bin/lead-harness.mjs prioritize:select",
95
+ "prioritize:check": "node bin/lead-harness.mjs prioritize:check",
96
+ "prioritize:verify": "node bin/lead-harness.mjs prioritize:verify",
97
+ "lineage:status": "node bin/lead-harness.mjs lineage:status",
98
+ "lineage:record": "node bin/lead-harness.mjs lineage:record",
99
+ "lineage:check": "node bin/lead-harness.mjs lineage:check",
100
+ "lineage:stale": "node bin/lead-harness.mjs lineage:stale",
101
+ "lineage:verify": "node bin/lead-harness.mjs lineage:verify",
102
+ "redact:scan": "node bin/lead-harness.mjs redact:scan",
103
+ "redact:verify": "node bin/lead-harness.mjs redact:verify",
104
+ "redact:apply": "node bin/lead-harness.mjs redact:apply",
105
+ "migrate:plan": "node bin/lead-harness.mjs migrate:plan",
106
+ "migrate:apply": "node bin/lead-harness.mjs migrate:apply",
107
+ "migrate:check": "node bin/lead-harness.mjs migrate:check",
108
+ "prepack": "npm run build:config",
109
+ "postinstall": "node bin/sync.mjs"
110
+ },
111
+ "files": [
112
+ "bin/",
113
+ "iso/",
114
+ "models.yaml",
115
+ ".claude/settings.json",
116
+ ".claude/iso-route.resolved.json",
117
+ ".claude/agents/",
118
+ ".cursor/mcp.json",
119
+ ".cursor/rules/",
120
+ ".cursor/iso-route.md",
121
+ ".opencode/",
122
+ ".codex/",
123
+ ".pi/",
124
+ ".mcp.json",
125
+ "CLAUDE.md",
126
+ "AGENTS.md",
127
+ "opencode.json",
128
+ "modes/",
129
+ "templates/",
130
+ "config/profile.example.yml",
131
+ "batch/batch-prompt.md",
132
+ "batch/batch-runner.sh",
133
+ "batch/README.md",
134
+ "docs/",
135
+ "examples/",
136
+ "lib/",
137
+ "scripts/",
138
+ "verify-pipeline.mjs",
139
+ "README.md",
140
+ "LICENSE"
141
+ ],
142
+ "keywords": [
143
+ "ai",
144
+ "agentic",
145
+ "lead-discovery",
146
+ "public-source",
147
+ "contact-discovery",
148
+ "automation"
149
+ ],
150
+ "license": "MIT",
151
+ "engines": {
152
+ "node": ">=20.6.0"
153
+ },
154
+ "overrides": {
155
+ "fast-uri": "3.1.2"
156
+ },
157
+ "dependencies": {
158
+ "@razroo/iso-cache": "^0.1.0",
159
+ "@razroo/iso-canon": "^0.1.0",
160
+ "@razroo/iso-capabilities": "^0.1.0",
161
+ "@razroo/iso-context": "^0.1.0",
162
+ "@razroo/iso-contract": "^0.1.0",
163
+ "@razroo/iso-facts": "^0.1.0",
164
+ "@razroo/iso-guard": "^0.1.0",
165
+ "@razroo/iso-index": "^0.1.0",
166
+ "@razroo/iso-ledger": "^0.1.0",
167
+ "@razroo/iso-lineage": "^0.1.0",
168
+ "@razroo/iso-migrate": "^0.1.0",
169
+ "@razroo/iso-orchestrator": "^0.2.0",
170
+ "@razroo/iso-postflight": "^0.1.0",
171
+ "@razroo/iso-preflight": "^0.1.0",
172
+ "@razroo/iso-prioritize": "^0.1.0",
173
+ "@razroo/iso-redact": "^0.1.0",
174
+ "@razroo/iso-score": "^0.1.0",
175
+ "@razroo/iso-timeline": "^0.1.0",
176
+ "@razroo/iso-trace": "^0.5.0",
177
+ "playwright": "^1.58.1"
178
+ },
179
+ "devDependencies": {
180
+ "@razroo/agentmd": "^0.3.0",
181
+ "@razroo/iso": "^0.3.1",
182
+ "@razroo/iso-eval": "^0.4.0",
183
+ "@razroo/iso-harness": "^0.8.0",
184
+ "@razroo/iso-route": "^0.5.3"
185
+ }
186
+ }