delimit-cli 3.14.43 → 3.14.45

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.
@@ -37,7 +37,7 @@ INBOX_ROUTING_FILE = Path.home() / ".delimit" / "inbox_routing.jsonl"
37
37
  IMAP_HOST = "mail.spacemail.com"
38
38
  IMAP_PORT = 993
39
39
  IMAP_USER = "pro@delimit.ai"
40
- FORWARD_TO = os.environ.get("DELIMIT_FORWARD_TO", "")
40
+ FORWARD_TO = "configured-email@example.com"
41
41
 
42
42
  # Domains/senders whose emails require owner action
43
43
  OWNER_ACTION_DOMAINS = {
@@ -61,7 +61,7 @@ OWNER_ACTION_DOMAINS = {
61
61
  }
62
62
 
63
63
  OWNER_ACTION_SENDERS = {
64
- os.environ.get("DELIMIT_FORWARD_TO", ""),
64
+ "configured-email@example.com",
65
65
  }
66
66
 
67
67
  # Subject patterns that indicate owner-action (compiled once)
@@ -222,7 +222,8 @@ def send_email(
222
222
  """Send an email notification via SMTP.
223
223
 
224
224
  Args:
225
- to: Recipient email address. Falls back to DELIMIT_SMTP_TO env var.
225
+ to: Recipient email address. Falls back to DELIMIT_SMTP_TO or
226
+ configured-email@example.com.
226
227
  subject: Email subject line.
227
228
  body: Email body text (preferred). Falls back to 'message' for
228
229
  backward compatibility.
@@ -257,7 +258,7 @@ def send_email(
257
258
  smtp_pass = os.environ.get("DELIMIT_SMTP_PASS", "")
258
259
  smtp_from = os.environ.get("DELIMIT_SMTP_FROM", "")
259
260
 
260
- smtp_to = to or os.environ.get("DELIMIT_SMTP_TO", "")
261
+ smtp_to = to or os.environ.get("DELIMIT_SMTP_TO", "configured-email@example.com")
261
262
 
262
263
  if not all([smtp_host, smtp_from, smtp_to]):
263
264
  record = {
@@ -5886,7 +5886,7 @@ def delimit_notify(channel: str = "webhook", message: str = "",
5886
5886
  subject: Subject line (email only). Use [ACTION], [INFO], [ALERT] prefix.
5887
5887
  event_type: Event category for filtering.
5888
5888
  to: Recipient email address (email only). Overrides default DELIMIT_SMTP_TO.
5889
- Send to any address — leave empty for default (uses DELIMIT_SMTP_TO env var).
5889
+ Send to any address — leave empty for default (configured-email@example.com).
5890
5890
  from_account: Sender account key from ~/.delimit/secrets/smtp-all.json
5891
5891
  (e.g. 'pro@delimit.ai', '<configured-email>'). Email only.
5892
5892
  """
@@ -5994,7 +5994,7 @@ def delimit_notify_inbox(action: str = "status", limit: int = 10,
5994
5994
  """Check inbound email inbox, classify, and route (Pro).
5995
5995
 
5996
5996
  Polls pro@delimit.ai via IMAP. Classifies emails as owner-action
5997
- (forwards to configured email) or non-owner (stays in inbox).
5997
+ (forwards to configured-email@example.com) or non-owner (stays in inbox).
5998
5998
 
5999
5999
  Args:
6000
6000
  action: 'status' (show inbox state), 'poll' (classify and optionally forward),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "delimit-cli",
3
3
  "mcpName": "io.github.delimit-ai/delimit-mcp-server",
4
- "version": "3.14.43",
4
+ "version": "3.14.45",
5
5
  "description": "Unify Claude Code, Codex, Cursor, and Gemini CLI with persistent context, governance, and multi-model debate.",
6
6
  "main": "index.js",
7
7
  "files": [
@@ -9,6 +9,10 @@
9
9
  "lib/",
10
10
  "adapters/",
11
11
  "gateway/",
12
+ "!gateway/ai/social_target.py",
13
+ "!gateway/ai/social.py",
14
+ "!gateway/ai/founding_users.py",
15
+ "!gateway/ai/inbox_daemon.py",
12
16
  "scripts/",
13
17
  "server.json",
14
18
  "README.md",
@@ -21,6 +25,7 @@
21
25
  },
22
26
  "scripts": {
23
27
  "postinstall": "node scripts/postinstall.js",
28
+ "prepublishOnly": "bash scripts/security-check.sh",
24
29
  "test": "node --test tests/setup-onboarding.test.js tests/setup-matrix.test.js tests/config-export-import.test.js tests/cross-model-hooks.test.js tests/golden-path.test.js"
25
30
  },
26
31
  "keywords": [
@@ -0,0 +1,66 @@
1
+ #!/bin/bash
2
+ # Pre-publish security check — blocks npm publish if secrets are found
3
+ # Run: bash scripts/security-check.sh
4
+
5
+ set -euo pipefail
6
+
7
+ echo "🔍 Delimit pre-publish security scan..."
8
+
9
+ FAIL=0
10
+
11
+ # Pack to temp and scan the actual tarball contents
12
+ TMPDIR=$(mktemp -d)
13
+ npm pack --pack-destination "$TMPDIR" --quiet 2>/dev/null
14
+ TARBALL=$(ls "$TMPDIR"/*.tgz)
15
+ tar -xzf "$TARBALL" -C "$TMPDIR"
16
+
17
+ # 1. Credential patterns
18
+ echo -n " Credentials... "
19
+ if grep -rEi '(password|passwd|secret|api_key|apikey)\s*[:=]\s*["\x27][^"\x27]{4,}' "$TMPDIR/package/" --include="*.py" --include="*.js" --include="*.json" 2>/dev/null | grep -v 'environ\|getenv\|process\.env\|os\.environ\|<configured\|example\|placeholder\|REDACTED\|\${credentials\|credentials\.\|security-scan-ignore'; then
20
+ echo "❌ FOUND CREDENTIALS"
21
+ FAIL=1
22
+ else
23
+ echo "✅ clean"
24
+ fi
25
+
26
+ # 2. Blocklist terms
27
+ echo -n " Blocklist... "
28
+ BLOCKLIST="jamsonsholdings|Bladabah|Domainvested26|Delimit26|home/jamsons|infracore|crypttrx|\.wr_env"
29
+ if grep -rEi "$BLOCKLIST" "$TMPDIR/package/" --include="*.py" --include="*.js" --include="*.json" 2>/dev/null; then
30
+ echo "❌ BLOCKED TERMS FOUND"
31
+ FAIL=1
32
+ else
33
+ echo "✅ clean"
34
+ fi
35
+
36
+ # 3. PII (email addresses that aren't examples)
37
+ echo -n " PII... "
38
+ if grep -rEi '[a-z0-9._%+-]+@(gmail|yahoo|hotmail|outlook|proton|jamsons|wire\.report|domainvested)' "$TMPDIR/package/" --include="*.py" --include="*.js" --include="*.json" 2>/dev/null | grep -v "example\|placeholder\|<configured\|noreply"; then
39
+ echo "❌ PII FOUND"
40
+ FAIL=1
41
+ else
42
+ echo "✅ clean"
43
+ fi
44
+
45
+ # 4. Proprietary files that shouldn't ship
46
+ echo -n " Proprietary files... "
47
+ PROPRIETARY="social_target\.py|social\.py|founding_users\.py|inbox_daemon\.py"
48
+ if find "$TMPDIR/package/" -name "*.py" | grep -Ei "$PROPRIETARY" 2>/dev/null; then
49
+ echo "❌ PROPRIETARY FILES IN PACKAGE"
50
+ FAIL=1
51
+ else
52
+ echo "✅ clean"
53
+ fi
54
+
55
+ # Cleanup
56
+ rm -rf "$TMPDIR"
57
+
58
+ if [ $FAIL -ne 0 ]; then
59
+ echo ""
60
+ echo "❌ SECURITY CHECK FAILED — do not publish"
61
+ exit 1
62
+ fi
63
+
64
+ echo ""
65
+ echo "✅ All security checks passed"
66
+ exit 0
@@ -1,163 +0,0 @@
1
- """Founding User tracker — manages the 25 founding user slots.
2
-
3
- Monitors Supabase for new signups, sends welcome emails,
4
- tracks slots remaining, and manages the 12-month term.
5
- """
6
- import json
7
- import os
8
- import smtplib
9
- import imaplib
10
- from email.mime.text import MIMEText
11
- from email.mime.multipart import MIMEMultipart
12
- from pathlib import Path
13
- from datetime import datetime, timezone
14
-
15
- SECRETS_DIR = Path.home() / ".delimit" / "secrets"
16
- FOUNDING_USERS_FILE = Path.home() / ".delimit" / "founding_users.json"
17
- MAX_FOUNDING_USERS = 25
18
- SMTP_HOST = "mail.spacemail.com"
19
- SMTP_PORT = 465
20
- IMAP_HOST = "mail.spacemail.com"
21
- EMAIL = "pro@delimit.ai"
22
-
23
-
24
- def _load_creds():
25
- """Load email credentials."""
26
- return {"email": EMAIL, "password": os.environ.get("DELIMIT_FOUNDING_PASSWORD", "")}
27
-
28
-
29
- def _load_founding_users() -> dict:
30
- """Load founding users registry."""
31
- if FOUNDING_USERS_FILE.exists():
32
- return json.loads(FOUNDING_USERS_FILE.read_text())
33
- return {"users": [], "created_at": datetime.now(timezone.utc).isoformat()}
34
-
35
-
36
- def _save_founding_users(data: dict):
37
- """Save founding users registry."""
38
- FOUNDING_USERS_FILE.parent.mkdir(parents=True, exist_ok=True)
39
- FOUNDING_USERS_FILE.write_text(json.dumps(data, indent=2))
40
-
41
-
42
- def get_status() -> dict:
43
- """Get founding user program status."""
44
- data = _load_founding_users()
45
- users = data.get("users", [])
46
- return {
47
- "total_slots": MAX_FOUNDING_USERS,
48
- "claimed": len(users),
49
- "remaining": MAX_FOUNDING_USERS - len(users),
50
- "users": [{"email": u["email"], "name": u.get("name", ""), "joined": u["joined_at"]} for u in users],
51
- }
52
-
53
-
54
- def register_founding_user(email: str, name: str = "", github_username: str = "") -> dict:
55
- """Register a new founding user."""
56
- data = _load_founding_users()
57
- users = data.get("users", [])
58
-
59
- if len(users) >= MAX_FOUNDING_USERS:
60
- return {"error": "All 25 founding user spots are claimed.", "remaining": 0}
61
-
62
- if any(u["email"] == email for u in users):
63
- return {"error": "Already registered as a founding user.", "email": email}
64
-
65
- user = {
66
- "email": email,
67
- "name": name,
68
- "github_username": github_username,
69
- "joined_at": datetime.now(timezone.utc).isoformat(),
70
- "term_months": 12,
71
- "status": "active",
72
- }
73
- users.append(user)
74
- data["users"] = users
75
- _save_founding_users(data)
76
-
77
- # Send welcome email
78
- try:
79
- _send_welcome_email(email, name)
80
- except Exception:
81
- pass # Don't fail registration if email fails
82
-
83
- return {
84
- "registered": True,
85
- "email": email,
86
- "slot": len(users),
87
- "remaining": MAX_FOUNDING_USERS - len(users),
88
- }
89
-
90
-
91
- def _send_welcome_email(to_email: str, name: str = ""):
92
- """Send welcome email to new founding user."""
93
- creds = _load_creds()
94
- greeting = f"Hi {name}," if name else "Hi,"
95
-
96
- html = f"""
97
- <div style="font-family: -apple-system, sans-serif; max-width: 600px; margin: 0 auto; background: #0a0a1a; color: #e5e7eb; padding: 40px; border-radius: 12px;">
98
- <div style="text-align: center; margin-bottom: 32px;">
99
- <span style="font-size: 32px; font-weight: 800; background: linear-gradient(135deg, #3b82f6, #8b5cf6); -webkit-background-clip: text; -webkit-text-fill-color: transparent;">
100
- &lt;/&gt; Delimit
101
- </span>
102
- </div>
103
-
104
- <h1 style="color: #fff; font-size: 24px; margin-bottom: 16px;">Welcome, Founding User</h1>
105
-
106
- <p>{greeting}</p>
107
-
108
- <p>You're one of 25 founding users getting full access to Delimit for 12 months. That includes:</p>
109
-
110
- <ul style="line-height: 2;">
111
- <li>Full enterprise dashboard (app.delimit.ai)</li>
112
- <li>106 MCP tools across Claude Code, Codex, Cursor, Gemini CLI</li>
113
- <li>Multi-model deliberation</li>
114
- <li>Team management, audit trail, policy editor</li>
115
- <li>Priority feedback channel</li>
116
- <li>Permanent Founding User badge</li>
117
- </ul>
118
-
119
- <div style="background: #1a1a2e; border: 1px solid #374151; border-radius: 8px; padding: 16px; margin: 24px 0;">
120
- <p style="margin: 0; font-family: monospace; color: #22c55e;">$ npx delimit-cli setup</p>
121
- </div>
122
-
123
- <p>Questions? Reply to this email — it goes straight to the founder.</p>
124
-
125
- <p style="color: #9ca3af; font-size: 14px; margin-top: 32px;">
126
- — The Delimit Team<br>
127
- delimit.ai
128
- </p>
129
- </div>
130
- """
131
-
132
- msg = MIMEMultipart("alternative")
133
- msg["From"] = f"Delimit <{EMAIL}>"
134
- msg["To"] = to_email
135
- msg["Subject"] = "Welcome to Delimit — You're a Founding User"
136
- msg.attach(MIMEText(html, "html"))
137
-
138
- with smtplib.SMTP_SSL(SMTP_HOST, SMTP_PORT) as server:
139
- server.login(creds["email"], creds["password"])
140
- server.send_message(msg)
141
-
142
-
143
- def check_inbox() -> list:
144
- """Check pro@delimit.ai inbox for new messages."""
145
- creds = _load_creds()
146
- try:
147
- mail = imaplib.IMAP4_SSL(IMAP_HOST, 993)
148
- mail.login(creds["email"], creds["password"])
149
- mail.select("inbox")
150
- status, messages = mail.search(None, "UNSEEN")
151
- if not messages[0]:
152
- mail.logout()
153
- return []
154
-
155
- results = []
156
- for mid in messages[0].split():
157
- status, data = mail.fetch(mid, "(BODY[HEADER.FIELDS (FROM SUBJECT DATE)])")
158
- header = data[0][1].decode()
159
- results.append(header.strip())
160
- mail.logout()
161
- return results
162
- except Exception as e:
163
- return [{"error": str(e)}]