@velinussage/locus-agent-skill 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.
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { cp, mkdir, readFile, rm } from "node:fs/promises";
|
|
3
|
+
import { existsSync } from "node:fs";
|
|
4
|
+
import os from "node:os";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
import { fileURLToPath } from "node:url";
|
|
7
|
+
|
|
8
|
+
const packageRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
|
9
|
+
const bundledSkillDir = path.join(packageRoot, "skill", "locus-agent-tools");
|
|
10
|
+
const skillName = "locus-agent-tools";
|
|
11
|
+
|
|
12
|
+
function usage() {
|
|
13
|
+
return `Usage:
|
|
14
|
+
npx @velinussage/locus-agent-skill add [--target <skills-root>] [--force]
|
|
15
|
+
npx @velinussage/locus-agent-skill install [--target <skills-root>] [--force]
|
|
16
|
+
npx @velinussage/locus-agent-skill --print
|
|
17
|
+
|
|
18
|
+
Options:
|
|
19
|
+
--target <dir> Skills root to install into. Defaults to $CODEX_HOME/skills or ~/.codex/skills.
|
|
20
|
+
--force Replace an existing locus-agent-tools skill directory.
|
|
21
|
+
--print Print the bundled SKILL.md to stdout without writing files.
|
|
22
|
+
--help Show this help.
|
|
23
|
+
`;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function parseArgs(argv) {
|
|
27
|
+
const args = [...argv];
|
|
28
|
+
const parsed = {
|
|
29
|
+
command: "add",
|
|
30
|
+
force: false,
|
|
31
|
+
print: false,
|
|
32
|
+
target: undefined,
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
if (args[0] && !args[0].startsWith("-")) {
|
|
36
|
+
parsed.command = args.shift();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
40
|
+
const arg = args[index];
|
|
41
|
+
if (arg === "--help" || arg === "-h") parsed.command = "help";
|
|
42
|
+
else if (arg === "--force") parsed.force = true;
|
|
43
|
+
else if (arg === "--print") parsed.print = true;
|
|
44
|
+
else if (arg === "--target") {
|
|
45
|
+
const value = args[index + 1];
|
|
46
|
+
if (!value || value.startsWith("-")) {
|
|
47
|
+
throw new Error("--target requires a directory path.");
|
|
48
|
+
}
|
|
49
|
+
parsed.target = value;
|
|
50
|
+
index += 1;
|
|
51
|
+
} else {
|
|
52
|
+
throw new Error(`Unknown argument: ${arg}`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return parsed;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function defaultSkillsRoot() {
|
|
60
|
+
if (process.env.CODEX_HOME) return path.join(process.env.CODEX_HOME, "skills");
|
|
61
|
+
return path.join(os.homedir(), ".codex", "skills");
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
async function printSkill() {
|
|
65
|
+
process.stdout.write(await readFile(path.join(bundledSkillDir, "SKILL.md"), "utf8"));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
async function installSkill({ target, force }) {
|
|
69
|
+
const skillsRoot = path.resolve(target || defaultSkillsRoot());
|
|
70
|
+
const destination = path.join(skillsRoot, skillName);
|
|
71
|
+
|
|
72
|
+
if (existsSync(destination)) {
|
|
73
|
+
if (!force) {
|
|
74
|
+
console.log(`Locus skill already exists at ${destination}`);
|
|
75
|
+
console.log("Use --force to replace it.");
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
await rm(destination, { recursive: true, force: true });
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
await mkdir(skillsRoot, { recursive: true });
|
|
82
|
+
await cp(bundledSkillDir, destination, { recursive: true });
|
|
83
|
+
console.log(`Installed ${skillName} to ${destination}`);
|
|
84
|
+
console.log("Next: restart or refresh your agent skill catalog, then ask for Locus MCP/free-tool help.");
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
async function main() {
|
|
88
|
+
const parsed = parseArgs(process.argv.slice(2));
|
|
89
|
+
|
|
90
|
+
if (parsed.command === "help") {
|
|
91
|
+
process.stdout.write(usage());
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if (parsed.print) {
|
|
96
|
+
await printSkill();
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
if (parsed.command !== "add" && parsed.command !== "install") {
|
|
101
|
+
throw new Error(`Unknown command: ${parsed.command}\n\n${usage()}`);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
await installSkill(parsed);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
main().catch((error) => {
|
|
108
|
+
console.error(error instanceof Error ? error.message : String(error));
|
|
109
|
+
process.exitCode = 1;
|
|
110
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@velinussage/locus-agent-skill",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Install the Locus agent skill for MCP, free tools, and x402-paid property-context workflows.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"locus-agent-skill": "bin/locus-agent-skill.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"bin/",
|
|
11
|
+
"skill/"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"test": "node --test test/*.test.mjs",
|
|
15
|
+
"pack:check": "npm pack --dry-run"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"locus",
|
|
19
|
+
"mcp",
|
|
20
|
+
"x402",
|
|
21
|
+
"real-estate",
|
|
22
|
+
"agent-tools",
|
|
23
|
+
"public-records"
|
|
24
|
+
],
|
|
25
|
+
"license": "UNLICENSED",
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: locus-agent-tools
|
|
3
|
+
description: Use when an agent needs to connect to Locus over MCP, REST, A2A, AgentCash, x402, or free tools for cited property and local-government context. Triggers include Locus MCP, mcp.locus.report, locus free tools, locus_execute, locus_search_tools, x402 Locus reports, real-estate due diligence, coverage preflight, lane availability, source-card checks, parcel/zoning/flood/permit/tax/policy context, and address-first public-record workflows.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Locus Agent Tools
|
|
7
|
+
|
|
8
|
+
Use Locus when a place-based workflow needs cited public-record context: taxes, parcels, zoning, flood, environmental records, permits, development activity, transportation projects, local policy, source coverage, or monitoring. Locus returns awareness and verification steps, not a verdict.
|
|
9
|
+
|
|
10
|
+
Do not use Locus to score, rank, screen, value, predict, or label a person, property, block, or neighborhood as safe or unsafe.
|
|
11
|
+
|
|
12
|
+
## Quick connect
|
|
13
|
+
|
|
14
|
+
Install this skill in Codex-style agents with:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npx @velinussage/locus-agent-skill add
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Remote MCP server:
|
|
21
|
+
|
|
22
|
+
```json
|
|
23
|
+
{
|
|
24
|
+
"mcpServers": {
|
|
25
|
+
"locus": {
|
|
26
|
+
"type": "http",
|
|
27
|
+
"url": "https://mcp.locus.report/mcp"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Authoritative live discovery:
|
|
34
|
+
|
|
35
|
+
- MCP catalog: <https://mcp.locus.report/catalog>
|
|
36
|
+
- Free REST catalog: <https://api.locus.report/tools/list>
|
|
37
|
+
- Paid tool index: <https://api.locus.report/.well-known/ai-tool/index.json>
|
|
38
|
+
- A2A Agent Card: <https://api.locus.report/.well-known/agent-card.json>
|
|
39
|
+
- API base: <https://api.locus.report>
|
|
40
|
+
|
|
41
|
+
The live catalogs are authoritative for tool names, schemas, prices, and endpoints. Do not copy stale tool definitions into prompts.
|
|
42
|
+
|
|
43
|
+
## MCP tool pattern
|
|
44
|
+
|
|
45
|
+
The remote MCP server exposes two tools:
|
|
46
|
+
|
|
47
|
+
1. `locus_search_tools` — search the live catalog across free and paid capabilities.
|
|
48
|
+
2. `locus_execute` — run one selected catalog tool by exact name.
|
|
49
|
+
|
|
50
|
+
Use this loop:
|
|
51
|
+
|
|
52
|
+
```text
|
|
53
|
+
place + user goal
|
|
54
|
+
-> search the live catalog
|
|
55
|
+
-> choose the smallest useful tool
|
|
56
|
+
-> run free coverage/source diagnostics before paid analysis
|
|
57
|
+
-> execute one tool
|
|
58
|
+
-> answer only from returned artifacts
|
|
59
|
+
-> show caveats and verify-next steps
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Example discovery call:
|
|
63
|
+
|
|
64
|
+
```json
|
|
65
|
+
{
|
|
66
|
+
"query": "coverage parcel flood zoning permits Raleigh address",
|
|
67
|
+
"tier": "all",
|
|
68
|
+
"limit": 8
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Example execution call:
|
|
73
|
+
|
|
74
|
+
```json
|
|
75
|
+
{
|
|
76
|
+
"name": "locus_lane_availability",
|
|
77
|
+
"arguments": {
|
|
78
|
+
"place": "1 E Edenton St, Raleigh, NC 27601"
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Free tools first
|
|
84
|
+
|
|
85
|
+
Prefer free tools for discovery, coverage, source-card status, citation provenance, policy-source checks, parcel diagnostics, environmental preflights, and not-covered responses. Useful starting points:
|
|
86
|
+
|
|
87
|
+
- `locus_lane_availability` — per-address preflight showing which lanes and paid tools can return data here, with buy signals.
|
|
88
|
+
- `locus_coverage_check` — coverage status for one place.
|
|
89
|
+
- `locus_coverage_map` — registry-level coverage map.
|
|
90
|
+
- `locus_source_card_status` / citation and provenance tools — source health and evidence diagnostics.
|
|
91
|
+
|
|
92
|
+
Free REST fallback:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
curl https://api.locus.report/tools/list
|
|
96
|
+
|
|
97
|
+
curl -X POST https://api.locus.report/tools/call \
|
|
98
|
+
-H 'content-type: application/json' \
|
|
99
|
+
-d '{"name":"locus_lane_availability","arguments":{"place":"1 E Edenton St, Raleigh, NC 27601"}}'
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Free tools are read-only or bounded participation endpoints. They do not return full paid briefs or compiled place reports.
|
|
103
|
+
|
|
104
|
+
## Paid tools and x402
|
|
105
|
+
|
|
106
|
+
Paid tools include place reports, local trend briefs, local policy briefs, before-you-sign bundles, and environmental context products. Use the paid tool index for current names, schemas, prices, and manifests.
|
|
107
|
+
|
|
108
|
+
When a paid call returns an x402 challenge:
|
|
109
|
+
|
|
110
|
+
- Show the user the tool name, price, chain/network, asset, recipient, and what will be generated.
|
|
111
|
+
- Do not auto-pay or retry automatically.
|
|
112
|
+
- Retry only after explicit user authorization and wallet/payment context.
|
|
113
|
+
- Preserve settlement proof and any returned report headers or artifact URLs.
|
|
114
|
+
|
|
115
|
+
Unsupported or discovery-only places should return free diagnostics instead of a silent charge.
|
|
116
|
+
|
|
117
|
+
## Answer boundaries
|
|
118
|
+
|
|
119
|
+
Keep answers in this shape:
|
|
120
|
+
|
|
121
|
+
- What Locus returned from cited artifacts.
|
|
122
|
+
- Why it may matter for the property question.
|
|
123
|
+
- Source names, official URLs or locators, fetched timestamps, and caveats when returned.
|
|
124
|
+
- What to verify next with an agency, landlord, insurer, contractor, seller, property manager, counsel, or another relevant source.
|
|
125
|
+
|
|
126
|
+
Redirect these asks back to records plus verification questions:
|
|
127
|
+
|
|
128
|
+
- Safe/unsafe, dangerous, good/bad, score, ranking, prediction, valuation, or investment conclusions.
|
|
129
|
+
- Tenant, employment, lending, insurance, background-check, or eligibility recommendations.
|
|
130
|
+
- Named-person dossiers, mugshots, exact victim/suspect addresses, or scraped personal profiles.
|
|
131
|
+
- Legal advice or claims that a user must or should take a legal action.
|
|
132
|
+
|
|
133
|
+
## Failure handling
|
|
134
|
+
|
|
135
|
+
- Unsupported place: return the diagnostic and name coverage or source gaps.
|
|
136
|
+
- Empty result: say no matching records were returned by that source, not that no records exist.
|
|
137
|
+
- Source conflict: show both records and name the agency/source to verify with.
|
|
138
|
+
- Payment challenge: ask for authorization before retrying.
|
|
139
|
+
- User asks for a verdict: decline that part and offer property-context records plus verification questions.
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
interface:
|
|
2
|
+
display_name: "Locus Agent Tools"
|
|
3
|
+
short_description: "Use Locus MCP, free tools, and paid x402 property-context APIs."
|
|
4
|
+
default_prompt: "Use Locus to discover current property-context tools, check free coverage, and call the smallest cited tool for the user goal."
|