@thecorporation/agent 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/README.md +47 -0
- package/bin/corp.mjs +37 -0
- package/extension/AGENT.md +30 -0
- package/extension/corp.ts +1510 -0
- package/package.json +36 -0
package/README.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# @thecorporation/agent
|
|
2
|
+
|
|
3
|
+
Corporate governance agent powered by [Pi](https://github.com/nicholasgasior/pi-coding-agent). Adds 35 tools for entity formation, equity management, payroll, compliance, and more.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm i -g @mariozechner/pi-coding-agent @thecorporation/agent
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
corp # interactive mode — launches Pi with corporate tools
|
|
15
|
+
corp -p "list entities" # one-shot mode
|
|
16
|
+
corp -p "form an LLC" # guided entity formation
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
The `corp` command:
|
|
20
|
+
|
|
21
|
+
1. Copies the corporate tools extension into your project's `.pi/extensions/`
|
|
22
|
+
2. Seeds `.pi/AGENT.md` with corporate context (only if not already present)
|
|
23
|
+
3. Launches `pi` with all arguments forwarded
|
|
24
|
+
|
|
25
|
+
## Configuration
|
|
26
|
+
|
|
27
|
+
Create `~/.corp/config.json`:
|
|
28
|
+
|
|
29
|
+
```json
|
|
30
|
+
{
|
|
31
|
+
"api_url": "https://api.thecorporation.ai",
|
|
32
|
+
"api_key": "your-api-key",
|
|
33
|
+
"workspace_id": "your-workspace-id"
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Or use environment variables: `CORP_API_URL`, `CORP_CONFIG_DIR`.
|
|
38
|
+
|
|
39
|
+
## What's Included
|
|
40
|
+
|
|
41
|
+
- **30 corporate tools** — entities, equity, documents, finance, compliance, agents
|
|
42
|
+
- **5 slash commands** — `/corp-status`, `/corp-login`, `/corp-switch`, `/corp-entities`, `/corp-agents`
|
|
43
|
+
- **Write-tool confirmation gating** — destructive operations require user approval
|
|
44
|
+
|
|
45
|
+
## License
|
|
46
|
+
|
|
47
|
+
MIT
|
package/bin/corp.mjs
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { dirname, join } from "node:path";
|
|
5
|
+
import { existsSync, mkdirSync, copyFileSync } from "node:fs";
|
|
6
|
+
import { execFileSync } from "node:child_process";
|
|
7
|
+
|
|
8
|
+
const pkgDir = dirname(dirname(fileURLToPath(import.meta.url)));
|
|
9
|
+
const extDir = join(pkgDir, "extension");
|
|
10
|
+
|
|
11
|
+
// Ensure .pi/extensions/ exists in cwd
|
|
12
|
+
const targetExtDir = join(process.cwd(), ".pi", "extensions");
|
|
13
|
+
mkdirSync(targetExtDir, { recursive: true });
|
|
14
|
+
|
|
15
|
+
// Always copy corp.ts (keep current with installed package version)
|
|
16
|
+
copyFileSync(join(extDir, "corp.ts"), join(targetExtDir, "corp.ts"));
|
|
17
|
+
|
|
18
|
+
// Copy AGENT.md only if not present (don't overwrite user customizations)
|
|
19
|
+
const targetAgent = join(process.cwd(), ".pi", "AGENT.md");
|
|
20
|
+
if (!existsSync(targetAgent)) {
|
|
21
|
+
copyFileSync(join(extDir, "AGENT.md"), targetAgent);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Launch pi, forwarding all arguments
|
|
25
|
+
try {
|
|
26
|
+
execFileSync("pi", process.argv.slice(2), { stdio: "inherit" });
|
|
27
|
+
} catch (err) {
|
|
28
|
+
if (err.code === "ENOENT") {
|
|
29
|
+
console.error(
|
|
30
|
+
"Error: 'pi' not found. Install the Pi coding agent first:\n\n" +
|
|
31
|
+
" npm i -g @mariozechner/pi-coding-agent\n"
|
|
32
|
+
);
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
|
35
|
+
// pi exited with non-zero — propagate the exit code
|
|
36
|
+
process.exit(err.status ?? 1);
|
|
37
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# TheCorporation — Pi Agent Context
|
|
2
|
+
|
|
3
|
+
You are a corporate governance assistant for TheCorporation, an agentic corporate governance platform.
|
|
4
|
+
|
|
5
|
+
## Tool Categories
|
|
6
|
+
|
|
7
|
+
**Read tools** (auto-approved): get_workspace_status, list_entities, get_cap_table, list_documents, list_safe_notes, list_agents, get_checklist, get_document_link, get_signing_link, list_obligations, get_billing_status
|
|
8
|
+
|
|
9
|
+
**Entity lifecycle**: form_entity, convert_entity, dissolve_entity
|
|
10
|
+
**Equity**: issue_equity, transfer_shares, issue_safe, calculate_distribution
|
|
11
|
+
**Finance**: create_invoice, run_payroll, submit_payment, open_bank_account, reconcile_ledger
|
|
12
|
+
**Documents & compliance**: generate_contract, file_tax_document, track_deadline, classify_contractor, get_signing_link
|
|
13
|
+
**Governance**: convene_meeting, cast_vote, schedule_meeting
|
|
14
|
+
**Agents**: create_agent, send_agent_message, update_agent, add_agent_skill
|
|
15
|
+
**Workspace**: update_checklist
|
|
16
|
+
|
|
17
|
+
## Key Rules
|
|
18
|
+
|
|
19
|
+
- All monetary values are in **integer cents** ($1,000 = 100000).
|
|
20
|
+
- Write tools require user confirmation — a dialog will appear automatically.
|
|
21
|
+
- Documents can ONLY be signed through signing links. You CANNOT sign on behalf of users.
|
|
22
|
+
- Use `get_signing_link` to generate a URL; present it to the user.
|
|
23
|
+
- Before calling `form_entity`, always collect member names, emails, roles, and ownership allocations.
|
|
24
|
+
- For LLCs, ownership percentages must total 100% (1.0). Default jurisdiction: US-WY.
|
|
25
|
+
- For Corporations, default jurisdiction: US-DE.
|
|
26
|
+
- After major actions, suggest logical next steps. Never just say "done."
|
|
27
|
+
- After entity formation: suggest signing documents, then EIN, bank account, equity.
|
|
28
|
+
- After document generation: present signing links immediately.
|
|
29
|
+
- NEVER create an agent to answer a question you can answer yourself.
|
|
30
|
+
- Agents are for delegating recurring tasks the user explicitly requests.
|