delimit-cli 4.1.15 → 4.1.17
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 +258 -3
- package/bin/delimit-os.sh +105 -0
- package/bin/delimit-setup.js +53 -5
- package/gateway/ai/ledger_propose.py +240 -0
- package/gateway/ai/reddit_proxy.py +106 -0
- package/gateway/ai/siem_streaming.py +290 -0
- package/gateway/ai/social_daemon.py +189 -0
- package/gateway/core/spec_health.py +624 -0
- package/lib/cross-model-hooks.js +22 -14
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
# `</>` Delimit
|
|
1
|
+
# `</>` Delimit
|
|
2
|
+
|
|
3
|
+
Stop re-explaining your codebase every session. Memory, tasks, and governance that persist across Claude Code, Codex, Cursor, and Gemini CLI.
|
|
4
|
+
|
|
5
|
+
|
|
2
6
|
---
|
|
3
7
|
|
|
4
8
|
## Think and Build
|
|
@@ -10,5 +14,256 @@ The universal command for the Delimit Swarm. When you say **"Think and Build"**,
|
|
|
10
14
|
- **"Vault"**: Manage local secrets and API keys (AES-256 encrypted).
|
|
11
15
|
|
|
12
16
|
Works across any configuration — from a single model on a budget to an enterprise swarm of 4+ models.
|
|
13
|
-
|
|
14
|
-
|
|
17
|
+
|
|
18
|
+
[](https://www.npmjs.com/package/delimit-cli)
|
|
19
|
+
[](https://github.com/marketplace/actions/delimit-api-governance)
|
|
20
|
+
[](https://opensource.org/licenses/MIT)
|
|
21
|
+
[](https://glama.ai/mcp/servers/delimit-ai/delimit)
|
|
22
|
+
[](https://github.com/marketplace/actions/delimit-api-governance)
|
|
23
|
+
|
|
24
|
+
<p align="center">
|
|
25
|
+
<img src="docs/demo.gif" alt="Delimit detecting breaking API changes" width="700">
|
|
26
|
+
</p>
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Try it in 2 minutes
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npx delimit-cli scan # Instant health grade for your API spec
|
|
34
|
+
npx delimit-cli demo # See governance in action — no setup needed
|
|
35
|
+
npx delimit-cli setup # Configure your AI assistants
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
No API keys. No account. No config files.
|
|
39
|
+
|
|
40
|
+
### Pick your first win
|
|
41
|
+
|
|
42
|
+
**Protect my API** — catch breaking changes before merge:
|
|
43
|
+
```bash
|
|
44
|
+
npx delimit-cli try
|
|
45
|
+
# Creates a sample API, introduces breaking changes, shows what gets blocked.
|
|
46
|
+
# Saves a governance report to delimit-report.md
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
**Watch for drift** — detect spec changes without review:
|
|
50
|
+
```bash
|
|
51
|
+
npx delimit-cli init # Sets up governance + drift baseline
|
|
52
|
+
# Weekly drift checks run automatically via GitHub Action
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
**Run PR copilot** — governance gates on every pull request:
|
|
56
|
+
```yaml
|
|
57
|
+
# .github/workflows/api-governance.yml
|
|
58
|
+
- uses: delimit-ai/delimit-action@v1
|
|
59
|
+
with:
|
|
60
|
+
spec: api/openapi.yaml
|
|
61
|
+
# Posts gate status, violations, and remediation in PR comments
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## What's New in v4.1
|
|
67
|
+
|
|
68
|
+
- **TUI** -- terminal-native Ventures panel, real `delimit think` and `delimit build` commands
|
|
69
|
+
- **Security hardening** -- notify.py stubbed in npm, axios pinned against supply chain attacks
|
|
70
|
+
- **Free tier restructure** -- deliberations use Gemini Flash + GPT-4o-mini (cost: <$20/mo)
|
|
71
|
+
- **Zero-config onboarding** -- auto-detect framework, scan, and first evidence in one command
|
|
72
|
+
- **Auto-approve tools** -- `delimit setup` configures permissions for Claude Code, Codex, and Gemini CLI
|
|
73
|
+
|
|
74
|
+
### v4.0
|
|
75
|
+
|
|
76
|
+
- **Toolcard Delta Cache** -- SHA256 schema hashing, delta-only transmission, saves tokens
|
|
77
|
+
- **Session Phoenix** -- cross-model session resurrection with soul capture
|
|
78
|
+
- **Handoff Receipts** -- structured acknowledgment protocol between agents
|
|
79
|
+
- **Cross-Model Audit** -- 3 lenses (security, correctness, governance) with deterministic synthesis
|
|
80
|
+
- **4-model deliberation** -- Claude + Grok + Gemini + Codex debate until consensus
|
|
81
|
+
- **Universal Swarm Triggers** -- "Think and Build", "Keep building", "Ask Delimit"
|
|
82
|
+
- **187 MCP tools** -- governance, context, shipping, observability, orchestration, and swarm
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## GitHub Action
|
|
87
|
+
|
|
88
|
+
Zero-config -- auto-detects your OpenAPI spec:
|
|
89
|
+
|
|
90
|
+
```yaml
|
|
91
|
+
- uses: delimit-ai/delimit-action@v1
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Or with full configuration:
|
|
95
|
+
|
|
96
|
+
```yaml
|
|
97
|
+
name: API Contract Check
|
|
98
|
+
on: pull_request
|
|
99
|
+
|
|
100
|
+
jobs:
|
|
101
|
+
delimit:
|
|
102
|
+
runs-on: ubuntu-latest
|
|
103
|
+
permissions:
|
|
104
|
+
pull-requests: write
|
|
105
|
+
steps:
|
|
106
|
+
- uses: actions/checkout@v4
|
|
107
|
+
with:
|
|
108
|
+
fetch-depth: 0
|
|
109
|
+
- uses: delimit-ai/delimit-action@v1
|
|
110
|
+
with:
|
|
111
|
+
spec: api/openapi.yaml
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
That's it. Delimit auto-fetches the base branch spec, diffs it, and posts a PR comment with breaking changes, semver classification, migration guides, and governance gate results.
|
|
115
|
+
|
|
116
|
+
[View on GitHub Marketplace](https://github.com/marketplace/actions/delimit-api-governance) | [See a live demo (23 breaking changes)](https://github.com/delimit-ai/delimit-action-demo/pull/2)
|
|
117
|
+
|
|
118
|
+
### Example PR comment
|
|
119
|
+
|
|
120
|
+
> **Breaking Changes Detected**
|
|
121
|
+
>
|
|
122
|
+
> | Change | Path | Severity |
|
|
123
|
+
> |--------|------|----------|
|
|
124
|
+
> | endpoint_removed | `DELETE /pets/{petId}` | error |
|
|
125
|
+
> | type_changed | `/pets:GET:200[].id` (string -> integer) | warning |
|
|
126
|
+
> | enum_value_removed | `/pets:GET:200[].status` | warning |
|
|
127
|
+
>
|
|
128
|
+
> **Semver**: MAJOR (1.0.0 -> 2.0.0)
|
|
129
|
+
>
|
|
130
|
+
> **Migration Guide**: 3 steps to update your integration
|
|
131
|
+
>
|
|
132
|
+
> ### Governance Gates
|
|
133
|
+
> | Gate | Status | Chain |
|
|
134
|
+
> |------|--------|-------|
|
|
135
|
+
> | API Lint | Pass/Fail | lint -> semver -> gov_evaluate |
|
|
136
|
+
> | Policy Compliance | Pass/Fail | policy -> evidence_collect |
|
|
137
|
+
> | Security Audit | Pass | security_audit -> evidence_collect |
|
|
138
|
+
> | Deploy Readiness | Ready/Blocked | deploy_plan -> security_audit |
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## CLI commands
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
npx delimit-cli scan # Instant spec health grade + recommendations
|
|
146
|
+
npx delimit-cli quickstart # Clone demo project + guided walkthrough
|
|
147
|
+
npx delimit-cli try # Zero-risk demo — saves governance report
|
|
148
|
+
npx delimit-cli demo # Self-contained governance demo
|
|
149
|
+
npx delimit-cli init # Guided wizard with compliance templates
|
|
150
|
+
npx delimit-cli init --preset strict # Initialize with strict policy
|
|
151
|
+
npx delimit-cli setup # Install into all AI assistants
|
|
152
|
+
npx delimit-cli setup --dry-run # Preview changes first
|
|
153
|
+
npx delimit-cli lint api/openapi.yaml # Check for breaking changes
|
|
154
|
+
npx delimit-cli diff old.yaml new.yaml # Compare two specs
|
|
155
|
+
npx delimit-cli explain old.yaml new.yaml # Generate migration guide
|
|
156
|
+
npx delimit-cli doctor # Check setup health
|
|
157
|
+
npx delimit-cli uninstall --dry-run # Preview removal
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### What the MCP toolkit adds
|
|
161
|
+
|
|
162
|
+
When installed into your AI coding assistant, Delimit provides tools across two tiers:
|
|
163
|
+
|
|
164
|
+
#### Free (no account needed)
|
|
165
|
+
|
|
166
|
+
- **API governance** -- lint, diff, policy enforcement, semver classification
|
|
167
|
+
- **Persistent ledger** -- track tasks across sessions, shared between all AI assistants
|
|
168
|
+
- **Zero-spec extraction** -- generate OpenAPI specs from FastAPI, Express, or NestJS source
|
|
169
|
+
- **Project scan** -- auto-detect specs, frameworks, security issues, and tests
|
|
170
|
+
- **Quickstart** -- guided first-run that proves value in 60 seconds
|
|
171
|
+
|
|
172
|
+
#### Pro
|
|
173
|
+
|
|
174
|
+
- **Multi-model deliberation** -- AI models debate until they agree (free: Gemini Flash + GPT-4o-mini; BYOK: any models)
|
|
175
|
+
- **Security audit** -- dependency scanning, secret detection, SAST analysis
|
|
176
|
+
- **Test verification** -- confirms tests ran, measures coverage, generates new tests
|
|
177
|
+
- **Memory & vault** -- persistent context and encrypted secrets across sessions
|
|
178
|
+
- **Evidence collection** -- governance audit trail for compliance
|
|
179
|
+
- **Deploy pipeline** -- governed build, publish, and rollback
|
|
180
|
+
- **OS layer** -- agent identity, execution plans, approval gates
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
## What It Detects
|
|
185
|
+
|
|
186
|
+
27 change types (17 breaking, 10 non-breaking) -- deterministic rules, not AI inference. Same input always produces the same result.
|
|
187
|
+
|
|
188
|
+
### Breaking Changes
|
|
189
|
+
|
|
190
|
+
| # | Change Type | Example |
|
|
191
|
+
|---|-------------|---------|
|
|
192
|
+
| 1 | `endpoint_removed` | `DELETE /users/{id}` removed entirely |
|
|
193
|
+
| 2 | `method_removed` | `PATCH /orders` no longer exists |
|
|
194
|
+
| 3 | `required_param_added` | New required header on `GET /items` |
|
|
195
|
+
| 4 | `param_removed` | `sort` query parameter removed |
|
|
196
|
+
| 5 | `response_removed` | `200 OK` response dropped |
|
|
197
|
+
| 6 | `required_field_added` | Request body now requires `tenant_id` |
|
|
198
|
+
| 7 | `field_removed` | `email` dropped from response object |
|
|
199
|
+
| 8 | `type_changed` | `id` went from `string` to `integer` |
|
|
200
|
+
| 9 | `format_changed` | `date-time` changed to `date` |
|
|
201
|
+
| 10 | `enum_value_removed` | `status: "pending"` no longer valid |
|
|
202
|
+
| 11 | `param_type_changed` | Query param `limit` changed from `integer` to `string` |
|
|
203
|
+
| 12 | `param_required_changed` | `filter` param became required |
|
|
204
|
+
| 13 | `response_type_changed` | Response `data` changed from `array` to `object` |
|
|
205
|
+
| 14 | `security_removed` | OAuth2 security scheme removed |
|
|
206
|
+
| 15 | `security_scope_removed` | `write:pets` scope removed from OAuth2 |
|
|
207
|
+
| 16 | `max_length_decreased` | `name` maxLength reduced from 255 to 100 |
|
|
208
|
+
| 17 | `min_length_increased` | `code` minLength increased from 1 to 5 |
|
|
209
|
+
|
|
210
|
+
### Non-Breaking Changes
|
|
211
|
+
|
|
212
|
+
| # | Change Type | Example |
|
|
213
|
+
|---|-------------|---------|
|
|
214
|
+
| 18 | `endpoint_added` | New `POST /webhooks` endpoint |
|
|
215
|
+
| 19 | `method_added` | `PATCH /users/{id}` method added |
|
|
216
|
+
| 20 | `optional_param_added` | Optional `format` query param added |
|
|
217
|
+
| 21 | `response_added` | `201 Created` response added |
|
|
218
|
+
| 22 | `optional_field_added` | Optional `nickname` field added to response |
|
|
219
|
+
| 23 | `enum_value_added` | `status: "archived"` value added |
|
|
220
|
+
| 24 | `description_changed` | Updated description for `/health` endpoint |
|
|
221
|
+
| 25 | `security_added` | API key security scheme added |
|
|
222
|
+
| 26 | `deprecated_added` | `GET /v1/users` marked as deprecated |
|
|
223
|
+
| 27 | `default_changed` | Default value for `page_size` changed from 10 to 20 |
|
|
224
|
+
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
## Policy presets
|
|
228
|
+
|
|
229
|
+
```bash
|
|
230
|
+
npx delimit-cli init --preset strict # All violations are errors
|
|
231
|
+
npx delimit-cli init --preset default # Balanced (default)
|
|
232
|
+
npx delimit-cli init --preset relaxed # All violations are warnings
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
Or write custom rules in `.delimit/policies.yml`:
|
|
236
|
+
|
|
237
|
+
```yaml
|
|
238
|
+
rules:
|
|
239
|
+
- id: freeze_v1
|
|
240
|
+
name: Freeze V1 API
|
|
241
|
+
change_types: [endpoint_removed, method_removed, field_removed]
|
|
242
|
+
severity: error
|
|
243
|
+
action: forbid
|
|
244
|
+
conditions:
|
|
245
|
+
path_pattern: "^/v1/.*"
|
|
246
|
+
message: "V1 API is frozen. Changes must be made in V2."
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
## Supported formats
|
|
252
|
+
|
|
253
|
+
- OpenAPI 3.0 and 3.1
|
|
254
|
+
- Swagger 2.0
|
|
255
|
+
- YAML and JSON
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## Links
|
|
260
|
+
|
|
261
|
+
- [delimit.ai](https://delimit.ai) -- homepage
|
|
262
|
+
- [Dashboard](https://app.delimit.ai) -- governance console
|
|
263
|
+
- [Docs](https://delimit.ai/docs) -- full documentation
|
|
264
|
+
- [GitHub Action](https://github.com/marketplace/actions/delimit-api-governance) -- Marketplace listing
|
|
265
|
+
- [Quickstart](https://github.com/delimit-ai/delimit-mcp-server) -- try it in 2 minutes
|
|
266
|
+
- [npm](https://www.npmjs.com/package/delimit-cli) -- CLI package
|
|
267
|
+
- [Pricing](https://delimit.ai/pricing) -- free tier + Pro
|
|
268
|
+
|
|
269
|
+
MIT License
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Delimit OS — the AI developer operating system
|
|
3
|
+
# Type 'delimit' to launch the TUI, or 'delimit <command>' for CLI tools
|
|
4
|
+
#
|
|
5
|
+
# Usage:
|
|
6
|
+
# delimit → Launch TUI (interactive terminal dashboard)
|
|
7
|
+
# delimit --quick → Quick status (non-interactive)
|
|
8
|
+
# delimit think → Trigger deliberation
|
|
9
|
+
# delimit build → Start autonomous build loop
|
|
10
|
+
# delimit ask <query> → Ask the swarm
|
|
11
|
+
# delimit lint <spec> → Lint an API spec
|
|
12
|
+
# delimit init → Initialize governance in current repo
|
|
13
|
+
# delimit setup → Configure AI assistants
|
|
14
|
+
|
|
15
|
+
set -e
|
|
16
|
+
|
|
17
|
+
DELIMIT_HOME="${DELIMIT_HOME:-$HOME/.delimit}"
|
|
18
|
+
GATEWAY="$DELIMIT_HOME/server/ai"
|
|
19
|
+
|
|
20
|
+
# If no args, launch TUI (interactive if terminal, quick if piped)
|
|
21
|
+
if [ $# -eq 0 ]; then
|
|
22
|
+
if [ -f "$GATEWAY/tui.py" ]; then
|
|
23
|
+
if [ -t 1 ] && [ -t 0 ]; then
|
|
24
|
+
cd "$DELIMIT_HOME/server" && exec python3 -m ai.tui
|
|
25
|
+
else
|
|
26
|
+
cd "$DELIMIT_HOME/server" && exec python3 -m ai.tui --quick
|
|
27
|
+
fi
|
|
28
|
+
else
|
|
29
|
+
# Fallback to npm CLI
|
|
30
|
+
exec delimit-cli "$@"
|
|
31
|
+
fi
|
|
32
|
+
fi
|
|
33
|
+
|
|
34
|
+
# Route commands
|
|
35
|
+
case "$1" in
|
|
36
|
+
--quick|-q)
|
|
37
|
+
if [ -f "$GATEWAY/tui.py" ]; then
|
|
38
|
+
cd "$DELIMIT_HOME/server" && exec python3 -m ai.tui --quick
|
|
39
|
+
else
|
|
40
|
+
exec delimit-cli status
|
|
41
|
+
fi
|
|
42
|
+
;;
|
|
43
|
+
think|deliberate)
|
|
44
|
+
shift
|
|
45
|
+
QUESTION="${*:-What should we build next based on the current ledger and signals?}"
|
|
46
|
+
echo "[Delimit OS] Triggering deliberation..."
|
|
47
|
+
cd "$DELIMIT_HOME/server" && python3 -c "
|
|
48
|
+
from ai.deliberation import deliberate
|
|
49
|
+
import json
|
|
50
|
+
result = deliberate('''$QUESTION''', mode='dialogue', max_rounds=3)
|
|
51
|
+
if 'error' in result:
|
|
52
|
+
print(f'Error: {result[\"error\"]}')
|
|
53
|
+
elif result.get('mode') == 'single_model_reflection':
|
|
54
|
+
print(f'Model: {result.get(\"model\", \"?\")}')
|
|
55
|
+
print(f'\\nAdvocate:\\n{result.get(\"advocate\", \"\")[:500]}')
|
|
56
|
+
print(f'\\nCritic:\\n{result.get(\"critic\", \"\")[:500]}')
|
|
57
|
+
print(f'\\nSynthesis:\\n{result.get(\"synthesis\", \"\")}')
|
|
58
|
+
else:
|
|
59
|
+
print(f'Verdict: {result.get(\"final_verdict\", \"no consensus\")[:500]}')
|
|
60
|
+
print(f'Rounds: {result.get(\"rounds\", 0)}')
|
|
61
|
+
" 2>&1
|
|
62
|
+
;;
|
|
63
|
+
build|loop)
|
|
64
|
+
shift
|
|
65
|
+
echo "[Delimit OS] Starting autonomous build loop..."
|
|
66
|
+
echo "Checking ledger for next task..."
|
|
67
|
+
cd "$DELIMIT_HOME/server" && python3 -c "
|
|
68
|
+
from ai.ledger_manager import get_context
|
|
69
|
+
import json
|
|
70
|
+
result = get_context()
|
|
71
|
+
items = result.get('next_up', [])
|
|
72
|
+
if items:
|
|
73
|
+
print(f'Next up: {items[0].get(\"id\", \"?\")} [{items[0].get(\"priority\", \"?\")}] {items[0].get(\"title\", \"?\")[:60]}')
|
|
74
|
+
print(f'Total open: {result.get(\"open_items\", 0)}')
|
|
75
|
+
else:
|
|
76
|
+
print('Ledger is clear — nothing to build.')
|
|
77
|
+
" 2>&1
|
|
78
|
+
;;
|
|
79
|
+
ask)
|
|
80
|
+
shift
|
|
81
|
+
QUERY="$*"
|
|
82
|
+
if [ -z "$QUERY" ]; then
|
|
83
|
+
echo "Usage: delimit ask <question>"
|
|
84
|
+
exit 1
|
|
85
|
+
fi
|
|
86
|
+
echo "[Delimit OS] Checking context..."
|
|
87
|
+
cd "$DELIMIT_HOME/server" && python3 -c "
|
|
88
|
+
from ai.ledger_manager import get_context
|
|
89
|
+
import json
|
|
90
|
+
result = get_context()
|
|
91
|
+
print(json.dumps(result, indent=2)[:2000])
|
|
92
|
+
" 2>&1
|
|
93
|
+
;;
|
|
94
|
+
status)
|
|
95
|
+
if [ -f "$GATEWAY/tui.py" ]; then
|
|
96
|
+
cd "$GATEWAY/.." && exec python3 -m ai.tui --quick
|
|
97
|
+
else
|
|
98
|
+
exec delimit-cli status
|
|
99
|
+
fi
|
|
100
|
+
;;
|
|
101
|
+
*)
|
|
102
|
+
# Pass through to delimit-cli for all other commands
|
|
103
|
+
exec delimit-cli "$@"
|
|
104
|
+
;;
|
|
105
|
+
esac
|
package/bin/delimit-setup.js
CHANGED
|
@@ -800,11 +800,21 @@ exit 127
|
|
|
800
800
|
await logp(` ${green('✓')} Governance shims updated`);
|
|
801
801
|
} else {
|
|
802
802
|
log(` ${green('✓')} Governance wrapping enabled`);
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
// Activate shims in current session by setting PATH
|
|
806
|
+
process.env.PATH = `${shimsDir}:${process.env.PATH}`;
|
|
807
|
+
|
|
808
|
+
// Verify the shim is reachable
|
|
809
|
+
try {
|
|
810
|
+
const which = execSync(`which claude 2>/dev/null`, { encoding: 'utf-8', timeout: 3000 }).trim();
|
|
811
|
+
if (which.includes('.delimit/shims')) {
|
|
812
|
+
log(` ${green('✓')} Shim active: ${dim(which)}`);
|
|
813
|
+
} else {
|
|
814
|
+
log(` ${yellow('⚠')} Shim not in PATH yet — run: ${green('source ~/.bashrc')}`);
|
|
815
|
+
}
|
|
816
|
+
} catch {
|
|
817
|
+
log(` ${dim(' Run')} ${green('source ~/.bashrc')} ${dim('to activate the governance banner')}`);
|
|
808
818
|
}
|
|
809
819
|
} else {
|
|
810
820
|
log(` ${dim(' Skipped. Enable later: delimit shims enable')}`);
|
|
@@ -1170,6 +1180,44 @@ exit 127
|
|
|
1170
1180
|
log('');
|
|
1171
1181
|
log(` ${bold('Keep Building.')}`);
|
|
1172
1182
|
log('');
|
|
1183
|
+
|
|
1184
|
+
// Show governance banner preview
|
|
1185
|
+
const shimFile = path.join(DELIMIT_HOME, 'shims', 'claude');
|
|
1186
|
+
if (fs.existsSync(shimFile)) {
|
|
1187
|
+
log(dim(' --- Governance Banner Preview ---'));
|
|
1188
|
+
try {
|
|
1189
|
+
// Run the shim with DELIMIT_WRAPPED=true so it exits after banner
|
|
1190
|
+
// We simulate the banner directly instead
|
|
1191
|
+
const toolCount = (() => {
|
|
1192
|
+
try {
|
|
1193
|
+
const srv = fs.readFileSync(path.join(DELIMIT_HOME, 'server', 'ai', 'server.py'), 'utf-8');
|
|
1194
|
+
return (srv.match(/@mcp\.tool/g) || []).length + (srv.match(/mcp\.tool\(\)\(/g) || []).length;
|
|
1195
|
+
} catch { return 0; }
|
|
1196
|
+
})();
|
|
1197
|
+
const version = require('../package.json').version;
|
|
1198
|
+
const purple = '\x1b[35m', magenta = '\x1b[91m', orange = '\x1b[33m';
|
|
1199
|
+
const bold2 = '\x1b[1m', dim2 = '\x1b[2m', reset = '\x1b[0m', green2 = '\x1b[32m';
|
|
1200
|
+
console.log('');
|
|
1201
|
+
console.log(` ${purple}${bold2} ____ ________ ______ _____________${reset}`);
|
|
1202
|
+
console.log(` ${purple}${bold2} / __ \\/ ____/ / / _/ |/ / _/_ __/${reset}`);
|
|
1203
|
+
console.log(` ${magenta}${bold2} / / / / __/ / / / // /|_/ // / / / ${reset}`);
|
|
1204
|
+
console.log(` ${magenta}${bold2} / /_/ / /___/ /____/ // / / // / / / ${reset}`);
|
|
1205
|
+
console.log(` ${orange}${bold2}/_____/_____/_____/___/_/ /_/___/ /_/ ${reset}`);
|
|
1206
|
+
console.log(` ${dim2}v${version}${reset}`);
|
|
1207
|
+
console.log('');
|
|
1208
|
+
console.log(` ${purple}${bold2}[Delimit]${reset} ${dim2}Executing governance check...${reset}`);
|
|
1209
|
+
console.log(` ${purple}${bold2}[Delimit]${reset} ${orange}Mode: advisory${reset}`);
|
|
1210
|
+
console.log(` ${purple}${bold2}[Delimit]${reset} ${dim2}MCP server: ${toolCount} tools${reset}`);
|
|
1211
|
+
console.log(` ${magenta}${bold2}[Delimit]${reset} ${magenta}═══════════════════════════════════════════${reset}`);
|
|
1212
|
+
console.log(` ${magenta}${bold2}[Delimit]${reset} ${purple}<${magenta}/${orange}>${reset} ${bold2}GOVERNANCE ACTIVE: CLAUDE${reset}`);
|
|
1213
|
+
console.log(` ${magenta}${bold2}[Delimit]${reset} ${magenta}═══════════════════════════════════════════${reset}`);
|
|
1214
|
+
console.log(` ${green2}${bold2}[Delimit]${reset} ${green2}✓ Allowed${reset}`);
|
|
1215
|
+
console.log('');
|
|
1216
|
+
log(dim(' This banner appears before each AI session.'));
|
|
1217
|
+
log(dim(' If you don\'t see it, run: source ~/.bashrc'));
|
|
1218
|
+
} catch {}
|
|
1219
|
+
log('');
|
|
1220
|
+
}
|
|
1173
1221
|
}
|
|
1174
1222
|
|
|
1175
1223
|
// LED-213: Import canonical template from shared module
|