Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions API-SPEC.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# API-SPEC

## Endpoints
- `GET /api-v2/dashboard/keys`
- `POST /api-v2/dashboard/keys-create`
- `DELETE /api-v2/dashboard/keys/{keyId}`
- `GET /api-v2/dashboard/stats`

## Firestore Schema

### `users/{uid}`
```json
{
"uid": "...",
"email": "...",
"role": "consumer|developer|enterprise_admin",
"tosAcceptedVersion": "2026-01",
"privacyAcceptedVersion": "2026-01",
"clinicalDisclaimerAcceptedVersion": "2026-01",
"createdAt": "ISO-8601",
"lastLoginAt": "ISO-8601"
}
```

### `apikeys/{keyId}`
```ts
{
keyHash: string,
keyHint: string,
userId: string,
label: string,
tier: "free" | "pro" | "enterprise",
stripeCustomerId?: string,
stripeSubscriptionId?: string | null,
scopes: string[],
monthlyUsage: number,
rateLimitMonthly: number | null,
isActive: boolean,
createdAt: string,
lastUsedAt: string | null,
environment?: "production" | "staging" | "testing",
displayName?: string,
expiresAt?: string | null,
lastRotatedAt?: string | null,
rotationCount?: number
}
```

### `usageAggregates/{(userId or keyId)-(YYYY-MM-DD)}`
- Aggregated stats.

## Logic
- Generate plain API key once, hash with SHA-256, store hash + metadata.
- Email plain key via Resend.
- Middleware: validates key, enforces rateLimitMonthly, increments usage.
35 changes: 35 additions & 0 deletions GODMODE-COLAB.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# GODMODE-COLAB (Human OS JSON)

## Canonical Structure
All engine calls must output this structure:

```ts
{
input: {
birthData: ...,
people: ...,
journal?: string
},
telemetry: {
// NASA vectors
},
seda: {
score: number,
band: string,
safetyAction: {
mode: string
}
},
orbit: {
geometry: ...,
frictionMatrix: ...,
pressurePoints: ...
},
meta: ...
}
```

## Safety Rules
- When `seda.band == "clinical_crisis"` or `seda.score <= 30`:
- Suppress interpretive/esoteric content.
- Switch to **Grounding Mode** UI (somatic guidance only).
Loading