-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevvit.json
More file actions
126 lines (126 loc) · 3.84 KB
/
devvit.json
File metadata and controls
126 lines (126 loc) · 3.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
{
"$schema": "https://developers.reddit.com/schema/config-file.v1.json",
"name": "cm-devvit",
"server": {
"dir": "dist/server",
"entry": "index.cjs"
},
"post": {
"dir": "dist/client",
"entrypoints": {
"default": {
"entry": "index.html",
"height": "tall"
}
}
},
"permissions": {
"reddit": {
"enable": true,
"scope": "moderator"
},
"redis": true,
"http": {
"enable": true,
"domains": [
"i.redd.it",
"preview.redd.it",
"external-preview.redd.it",
"external-i.redd.it",
"api.openai.com"
]
}
},
"triggers": {
"onAppInstall": "/internal/triggers/app-install",
"onAppUpgrade": "/internal/triggers/app-upgrade",
"onPostSubmit": "/internal/triggers/post-submit",
"onCommentSubmit": "/internal/triggers/comment-submit"
},
"scheduler": {
"tasks": {
"refresh-config": {
"endpoint": "/internal/cron/refresh-config",
"cron": "*/5 * * * *"
},
"stats-rollup": {
"endpoint": "/internal/cron/stats-rollup",
"cron": "0 * * * *"
},
"image-hash-worker": {
"endpoint": "/internal/cron/image-hash-worker"
}
}
},
"menu": {
"items": [
{
"label": "ContextMod: Reload config from wiki",
"description": "Re-read the rule config from your sub's wiki page",
"location": "subreddit",
"forUserType": "moderator",
"endpoint": "/internal/menu/reload-config"
},
{
"label": "ContextMod: View recent actions",
"description": "See the last 50 mod actions taken by ContextMod",
"location": "subreddit",
"forUserType": "moderator",
"endpoint": "/internal/menu/recent-actions"
},
{
"label": "ContextMod: Test rules on this item",
"description": "Dry-run rules against this post or comment",
"location": [
"post",
"comment"
],
"forUserType": "moderator",
"endpoint": "/internal/menu/test-rules"
},
{
"label": "ContextMod: Simulate rule against history",
"description": "Paste a proposed rule; see how often it would have fired on recent posts",
"location": "subreddit",
"forUserType": "moderator",
"endpoint": "/internal/menu/simulate-rule"
},
{
"label": "ContextMod: Explain a rule with AI",
"description": "Paste a rule JSON5; OpenAI returns a plain-English explanation",
"location": "subreddit",
"forUserType": "moderator",
"endpoint": "/internal/menu/explain-rule"
},
{
"label": "ContextMod: Set OpenAI API key",
"description": "Set the OpenAI key for this sub (required for AI features). Stored encrypted in Redis.",
"location": "subreddit",
"forUserType": "moderator",
"endpoint": "/internal/menu/set-openai-key"
}
]
},
"forms": {
"testRules": "/internal/form/test-rules-submit",
"simulateRule": "/internal/form/simulate-rule-submit",
"explainRule": "/internal/form/explain-rule-submit",
"setOpenaiKey": "/internal/form/set-openai-key-submit"
},
"settings": {
"subreddit": {
"openai_api_key": {
"type": "string",
"label": "OpenAI API key (alternative — Devvit subreddit-scope strings can't be secrets, use mod menu instead)",
"helpText": "Prefer the 'ContextMod: Set OpenAI API key' mod menu — that stores the key in encrypted Redis. This Devvit subreddit setting is a fallback (plaintext at rest per Devvit limitation — subreddit-scope strings can't be marked isSecret in this Devvit version). Get a key at platform.openai.com/api-keys."
}
}
},
"scripts": {
"build": "vite build",
"dev": "vite build --watch"
},
"dev": {
"subreddit": "contextmod_vinh_dev"
}
}