spine-framework 0.2.8 → 0.3.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,70 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/**
|
|
3
|
+
* @module config/signals
|
|
4
|
+
* @audience installer
|
|
5
|
+
* @layer cli
|
|
6
|
+
* @stability stable
|
|
7
|
+
*
|
|
8
|
+
* Signal endpoint configuration for framework install tracking and engagement.
|
|
9
|
+
*
|
|
10
|
+
* The public framework sends anonymous signals to a configurable endpoint.
|
|
11
|
+
* Private Cortex instances receive and process these signals.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
export interface SignalConfig {
|
|
15
|
+
endpoint: string
|
|
16
|
+
timeout: number
|
|
17
|
+
retryAttempts: number
|
|
18
|
+
batchSize: number
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const signalConfig: SignalConfig = {
|
|
22
|
+
endpoint: process.env.SPINE_SIGNAL_ENDPOINT || 'https://cortex.spine-framework.com',
|
|
23
|
+
timeout: 5000,
|
|
24
|
+
retryAttempts: 3,
|
|
25
|
+
batchSize: 10,
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Engagement signal types with scores
|
|
29
|
+
export const engagementSignals = {
|
|
30
|
+
framework_installed: { score: 1, description: 'Framework npm install completion' },
|
|
31
|
+
framework_initialized: { score: 3, description: 'First successful startup' },
|
|
32
|
+
framework_connected_db: { score: 5, description: 'Database connection success' },
|
|
33
|
+
app_install: { score: 4, description: 'App installation' },
|
|
34
|
+
app_initialized: { score: 4, description: 'App first load' },
|
|
35
|
+
app_first_action: { score: 6, description: 'First feature usage' },
|
|
36
|
+
account_created: { score: 8, description: 'Anonymous → identified migration' },
|
|
37
|
+
first_deploy: { score: 10, description: 'Production deployment' },
|
|
38
|
+
team_collaboration: { score: 12, description: 'Multi-user usage' },
|
|
39
|
+
} as const
|
|
40
|
+
|
|
41
|
+
export type EngagementSignalType = keyof typeof engagementSignals
|
|
42
|
+
|
|
43
|
+
// Claim trigger thresholds
|
|
44
|
+
export const claimTriggers = {
|
|
45
|
+
immediate: 0, // User explicitly runs `spine-framework claim`
|
|
46
|
+
gentle_nudge: 3, // After first successful startup
|
|
47
|
+
value_realized: 5, // After database connection
|
|
48
|
+
ecosystem_engaged: 8, // After app installation
|
|
49
|
+
power_user: 10, // After regular usage patterns
|
|
50
|
+
} as const
|
|
51
|
+
|
|
52
|
+
export interface EngagementEntry {
|
|
53
|
+
type: EngagementSignalType
|
|
54
|
+
timestamp: string
|
|
55
|
+
score: number
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface EngagementData {
|
|
59
|
+
framework_install_serial: string
|
|
60
|
+
engagement_score: number
|
|
61
|
+
signals: EngagementEntry[]
|
|
62
|
+
claim_status: 'anonymous' | 'claimed' | 'pending'
|
|
63
|
+
last_claim_prompt?: string
|
|
64
|
+
account_id?: string
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface ClaimPrompt {
|
|
68
|
+
timing: keyof typeof claimTriggers
|
|
69
|
+
message: string
|
|
70
|
+
}
|
|
@@ -1278,3 +1278,20 @@ BEGIN
|
|
|
1278
1278
|
ORDER BY e.embedding <=> p_query_embedding LIMIT p_limit;
|
|
1279
1279
|
END;
|
|
1280
1280
|
$$;
|
|
1281
|
+
|
|
1282
|
+
-- ---------------------------------------------------------------------------
|
|
1283
|
+
-- Role Grants
|
|
1284
|
+
-- Raw SQL migrations bypass Supabase's automatic grant setup. These grants
|
|
1285
|
+
-- are required for the PostgREST API to function with anon/service_role keys.
|
|
1286
|
+
-- ---------------------------------------------------------------------------
|
|
1287
|
+
GRANT USAGE ON SCHEMA public TO anon, authenticated, service_role;
|
|
1288
|
+
GRANT ALL ON ALL TABLES IN SCHEMA public TO service_role;
|
|
1289
|
+
GRANT ALL ON ALL SEQUENCES IN SCHEMA public TO service_role;
|
|
1290
|
+
GRANT ALL ON ALL FUNCTIONS IN SCHEMA public TO service_role;
|
|
1291
|
+
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO authenticated;
|
|
1292
|
+
GRANT SELECT ON ALL TABLES IN SCHEMA public TO anon;
|
|
1293
|
+
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON TABLES TO service_role;
|
|
1294
|
+
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT, INSERT, UPDATE, DELETE ON TABLES TO authenticated;
|
|
1295
|
+
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO anon;
|
|
1296
|
+
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON SEQUENCES TO service_role, authenticated;
|
|
1297
|
+
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON FUNCTIONS TO service_role, authenticated;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "spine-framework",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Spine — enterprise application framework built on Supabase + Netlify + React",
|
|
6
6
|
"type": "module",
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
"bin/",
|
|
52
52
|
"dist/",
|
|
53
53
|
".framework/cli/",
|
|
54
|
+
".framework/config/",
|
|
54
55
|
".framework/functions/",
|
|
55
56
|
".framework/migrations/",
|
|
56
57
|
".framework/docs/",
|