@sprigr/cli 0.1.2

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,115 @@
1
+ /**
2
+ * Local copies of the manifest validators.
3
+ *
4
+ * Why not import from @sprigr/team-shared:
5
+ * The CLI is published to npm as @sprigr/cli; @sprigr/team-shared is
6
+ * a workspace package and is NOT published. tsc emits unbundled JS
7
+ * that retains the bare-specifier import, which would break for npm
8
+ * consumers. Inlining the validators is small (the surface is well
9
+ * bounded) and keeps the published CLI self-contained.
10
+ *
11
+ * Source of truth lives in packages/shared/src/utils/marketplace.ts.
12
+ * If you change the regexes / shape there, update them here too.
13
+ * Both copies are covered by tests so a drift will surface as a
14
+ * test failure.
15
+ */
16
+ export type AppRuntimeTier = 'ssr' | 'static';
17
+ export type AppRuntimeFramework = 'next' | 'astro' | 'remix' | 'static';
18
+ export interface AppCrossTenantToolDeclaration {
19
+ tool_name: string;
20
+ resource_type: string;
21
+ action?: 'read' | 'write' | 'act';
22
+ description: string;
23
+ input_schema: Record<string, unknown>;
24
+ output_schema?: Record<string, unknown>;
25
+ }
26
+ export interface AppDependencyDeclaration {
27
+ app: string;
28
+ tools: string[];
29
+ required: boolean;
30
+ reason?: string;
31
+ }
32
+ export interface AppMigrationDeclaration {
33
+ file: string;
34
+ version: number;
35
+ description?: string;
36
+ }
37
+ export interface AppSecretDeclaration {
38
+ key: string;
39
+ label: string;
40
+ type: 'secret' | 'text';
41
+ required: boolean;
42
+ description?: string;
43
+ }
44
+ export interface AppWebhookDeclaration {
45
+ path: string;
46
+ signature: {
47
+ header: string;
48
+ algorithm: 'sha256' | 'sha1';
49
+ secret_ref: string;
50
+ };
51
+ handler_tool: string;
52
+ }
53
+ export interface AppScheduleDeclaration {
54
+ name: string;
55
+ cron: string;
56
+ timezone?: string;
57
+ tool: string;
58
+ scope?: 'per_install' | 'per_tenant';
59
+ }
60
+ export interface AppAgentScheduleDeclaration {
61
+ name: string;
62
+ cron: string;
63
+ prompt: string;
64
+ agentSlug?: string;
65
+ taskType?: 'message' | 'reminder' | 'pipe' | 'script';
66
+ timezone?: string;
67
+ enabled?: boolean;
68
+ }
69
+ /** A subset of AppManifest sufficient for client-side validation. */
70
+ export interface AppManifest {
71
+ sprigr_app: {
72
+ version: string;
73
+ };
74
+ metadata: {
75
+ name: string;
76
+ slug: string;
77
+ version: string;
78
+ description: string;
79
+ author: {
80
+ name: string;
81
+ email?: string;
82
+ };
83
+ icon?: string;
84
+ category?: string;
85
+ tags?: string[];
86
+ };
87
+ kind?: 'tool' | 'integration' | 'agent';
88
+ runtime: {
89
+ entry: string;
90
+ tier?: AppRuntimeTier;
91
+ framework?: AppRuntimeFramework;
92
+ };
93
+ permissions?: {
94
+ scopes: string[];
95
+ network_domains?: string[];
96
+ };
97
+ cross_tenant_tools?: AppCrossTenantToolDeclaration[];
98
+ app_dependencies?: AppDependencyDeclaration[];
99
+ migrations?: AppMigrationDeclaration[];
100
+ secrets?: AppSecretDeclaration[];
101
+ webhooks?: AppWebhookDeclaration[];
102
+ schedules?: AppScheduleDeclaration[];
103
+ agent_schedules?: AppAgentScheduleDeclaration[];
104
+ [key: string]: unknown;
105
+ }
106
+ export declare const CROSS_TENANT_TOOL_NAME_REGEX: RegExp;
107
+ export declare const DEFAULT_APP_RUNTIME_TIER: AppRuntimeTier;
108
+ export declare function validateRuntimeTier(tier: AppRuntimeTier | undefined): string | null;
109
+ export declare function validateCrossTenantTools(tools: AppCrossTenantToolDeclaration[] | undefined): string | null;
110
+ export declare function validateAppDependencies(deps: AppDependencyDeclaration[] | undefined): string | null;
111
+ export declare function validateMigrations(migrations: AppMigrationDeclaration[] | undefined): string | null;
112
+ export declare function validateSecrets(secrets: AppSecretDeclaration[] | undefined): string | null;
113
+ export declare function validateWebhooks(webhooks: AppWebhookDeclaration[] | undefined, declaredSecretKeys?: ReadonlySet<string> | null): string | null;
114
+ export declare function validateAgentSchedules(agentSchedules: AppAgentScheduleDeclaration[] | undefined): string | null;
115
+ export declare function validateSchedules(schedules: AppScheduleDeclaration[] | undefined): string | null;
@@ -0,0 +1,262 @@
1
+ /**
2
+ * Local copies of the manifest validators.
3
+ *
4
+ * Why not import from @sprigr/team-shared:
5
+ * The CLI is published to npm as @sprigr/cli; @sprigr/team-shared is
6
+ * a workspace package and is NOT published. tsc emits unbundled JS
7
+ * that retains the bare-specifier import, which would break for npm
8
+ * consumers. Inlining the validators is small (the surface is well
9
+ * bounded) and keeps the published CLI self-contained.
10
+ *
11
+ * Source of truth lives in packages/shared/src/utils/marketplace.ts.
12
+ * If you change the regexes / shape there, update them here too.
13
+ * Both copies are covered by tests so a drift will surface as a
14
+ * test failure.
15
+ */
16
+ // ─── Regexes (mirror packages/shared) ──────────────────────────────────────
17
+ export const CROSS_TENANT_TOOL_NAME_REGEX = /^[a-z][a-z0-9]*(_[a-z0-9]+)+$/;
18
+ const APP_SLUG_RX = /^[a-z][a-z0-9]*(-[a-z0-9]+)*$/;
19
+ const SECRET_KEY_RX = /^[A-Z][A-Z0-9_]*$/;
20
+ const WEBHOOK_PATH_RX = /^\/[a-zA-Z0-9_\-/]+$/;
21
+ const SCHEDULE_NAME_RX = /^[a-z][a-z0-9_]*$/;
22
+ const MIGRATION_FILE_RX = /^migrations\/[a-zA-Z0-9_\-.]+\.sql$/;
23
+ export const DEFAULT_APP_RUNTIME_TIER = 'ssr';
24
+ // ─── Validators ────────────────────────────────────────────────────────────
25
+ export function validateRuntimeTier(tier) {
26
+ if (tier === undefined)
27
+ return null;
28
+ if (tier !== 'ssr' && tier !== 'static') {
29
+ return `runtime.tier must be 'ssr' or 'static' — got "${tier}"`;
30
+ }
31
+ return null;
32
+ }
33
+ export function validateCrossTenantTools(tools) {
34
+ if (!tools)
35
+ return null;
36
+ if (!Array.isArray(tools))
37
+ return 'cross_tenant_tools must be an array';
38
+ const seen = new Set();
39
+ for (const t of tools) {
40
+ if (!t || typeof t !== 'object')
41
+ return 'cross_tenant_tools entry must be an object';
42
+ if (!t.tool_name)
43
+ return 'cross_tenant_tools entry missing tool_name';
44
+ if (!CROSS_TENANT_TOOL_NAME_REGEX.test(t.tool_name)) {
45
+ return `cross_tenant_tools tool_name "${t.tool_name}" is invalid — must be lowercase app-prefix snake_case (e.g. ascs_inventory_get_stock_level)`;
46
+ }
47
+ if (seen.has(t.tool_name)) {
48
+ return `cross_tenant_tools tool_name "${t.tool_name}" is duplicated`;
49
+ }
50
+ seen.add(t.tool_name);
51
+ if (!t.resource_type || typeof t.resource_type !== 'string') {
52
+ return `cross_tenant_tools "${t.tool_name}" missing resource_type`;
53
+ }
54
+ if (!t.description || typeof t.description !== 'string') {
55
+ return `cross_tenant_tools "${t.tool_name}" missing description`;
56
+ }
57
+ if (!t.input_schema || typeof t.input_schema !== 'object') {
58
+ return `cross_tenant_tools "${t.tool_name}" missing input_schema`;
59
+ }
60
+ if (t.action !== undefined && !['read', 'write', 'act'].includes(t.action)) {
61
+ return `cross_tenant_tools "${t.tool_name}" has invalid action "${t.action}"`;
62
+ }
63
+ }
64
+ return null;
65
+ }
66
+ export function validateAppDependencies(deps) {
67
+ if (!deps)
68
+ return null;
69
+ if (!Array.isArray(deps))
70
+ return 'app_dependencies must be an array';
71
+ const seen = new Set();
72
+ for (const d of deps) {
73
+ if (!d || typeof d !== 'object')
74
+ return 'app_dependencies entry must be an object';
75
+ if (!d.app || typeof d.app !== 'string')
76
+ return 'app_dependencies entry missing app';
77
+ if (!APP_SLUG_RX.test(d.app)) {
78
+ return `app_dependencies entry has invalid app slug "${d.app}"`;
79
+ }
80
+ if (typeof d.required !== 'boolean') {
81
+ return `app_dependencies entry "${d.app}" must specify required: boolean`;
82
+ }
83
+ if (!Array.isArray(d.tools) || d.tools.length === 0) {
84
+ return `app_dependencies entry "${d.app}" must specify tools: non-empty string[]`;
85
+ }
86
+ for (const t of d.tools) {
87
+ if (typeof t !== 'string' || !CROSS_TENANT_TOOL_NAME_REGEX.test(t)) {
88
+ return `app_dependencies "${d.app}" tool name "${t}" is invalid — must be lowercase app-prefix snake_case`;
89
+ }
90
+ const key = `${d.app}::${t}`;
91
+ if (seen.has(key)) {
92
+ return `app_dependencies has duplicate (app, tool) pair: ${d.app} → ${t}`;
93
+ }
94
+ seen.add(key);
95
+ }
96
+ }
97
+ return null;
98
+ }
99
+ export function validateMigrations(migrations) {
100
+ if (!migrations)
101
+ return null;
102
+ if (!Array.isArray(migrations))
103
+ return 'migrations must be an array';
104
+ const seenVersions = new Set();
105
+ for (const m of migrations) {
106
+ if (!m || typeof m !== 'object')
107
+ return 'migrations entry must be an object';
108
+ if (!m.file || typeof m.file !== 'string' || !MIGRATION_FILE_RX.test(m.file)) {
109
+ return `migrations entry has invalid file "${m.file}" — must be migrations/<name>.sql`;
110
+ }
111
+ if (typeof m.version !== 'number' || !Number.isInteger(m.version) || m.version < 0) {
112
+ return `migrations entry "${m.file}" has invalid version — must be a non-negative integer`;
113
+ }
114
+ if (seenVersions.has(m.version)) {
115
+ return `migrations entry "${m.file}" duplicates version ${m.version}`;
116
+ }
117
+ seenVersions.add(m.version);
118
+ }
119
+ return null;
120
+ }
121
+ export function validateSecrets(secrets) {
122
+ if (!secrets)
123
+ return null;
124
+ if (!Array.isArray(secrets))
125
+ return 'secrets must be an array';
126
+ const seen = new Set();
127
+ for (const s of secrets) {
128
+ if (!s || typeof s !== 'object')
129
+ return 'secrets entry must be an object';
130
+ if (!s.key || typeof s.key !== 'string' || !SECRET_KEY_RX.test(s.key)) {
131
+ return `secrets entry has invalid key "${s.key}" — must be SHOUTY_SNAKE_CASE`;
132
+ }
133
+ if (seen.has(s.key)) {
134
+ return `secrets entry "${s.key}" is duplicated`;
135
+ }
136
+ seen.add(s.key);
137
+ if (s.type !== 'secret' && s.type !== 'text') {
138
+ return `secrets entry "${s.key}" has invalid type "${s.type}"`;
139
+ }
140
+ if (typeof s.required !== 'boolean') {
141
+ return `secrets entry "${s.key}" must specify required: boolean`;
142
+ }
143
+ if (!s.label || typeof s.label !== 'string') {
144
+ return `secrets entry "${s.key}" missing label`;
145
+ }
146
+ }
147
+ return null;
148
+ }
149
+ export function validateWebhooks(webhooks, declaredSecretKeys = null) {
150
+ if (!webhooks)
151
+ return null;
152
+ if (!Array.isArray(webhooks))
153
+ return 'webhooks must be an array';
154
+ const seenPaths = new Set();
155
+ for (const w of webhooks) {
156
+ if (!w || typeof w !== 'object')
157
+ return 'webhooks entry must be an object';
158
+ if (!w.path || typeof w.path !== 'string' || !WEBHOOK_PATH_RX.test(w.path)) {
159
+ return `webhooks entry has invalid path "${w.path}" — must start with / and contain only [a-zA-Z0-9_-/]`;
160
+ }
161
+ if (seenPaths.has(w.path)) {
162
+ return `webhooks entry path "${w.path}" is duplicated`;
163
+ }
164
+ seenPaths.add(w.path);
165
+ if (!w.signature || typeof w.signature !== 'object') {
166
+ return `webhooks entry "${w.path}" missing signature`;
167
+ }
168
+ if (!w.signature.header || typeof w.signature.header !== 'string') {
169
+ return `webhooks entry "${w.path}" missing signature.header`;
170
+ }
171
+ if (w.signature.algorithm !== 'sha256' && w.signature.algorithm !== 'sha1') {
172
+ return `webhooks entry "${w.path}" has invalid signature.algorithm "${w.signature.algorithm}"`;
173
+ }
174
+ if (!w.signature.secret_ref || typeof w.signature.secret_ref !== 'string') {
175
+ return `webhooks entry "${w.path}" missing signature.secret_ref`;
176
+ }
177
+ if (declaredSecretKeys && !declaredSecretKeys.has(w.signature.secret_ref)) {
178
+ return `webhooks entry "${w.path}" signature.secret_ref "${w.signature.secret_ref}" does not match any secret key`;
179
+ }
180
+ if (!w.handler_tool || typeof w.handler_tool !== 'string') {
181
+ return `webhooks entry "${w.path}" missing handler_tool`;
182
+ }
183
+ if (!CROSS_TENANT_TOOL_NAME_REGEX.test(w.handler_tool)) {
184
+ return `webhooks entry "${w.path}" handler_tool "${w.handler_tool}" is invalid — must be lowercase app-prefix snake_case`;
185
+ }
186
+ }
187
+ return null;
188
+ }
189
+ export function validateAgentSchedules(agentSchedules) {
190
+ if (!agentSchedules)
191
+ return null;
192
+ if (!Array.isArray(agentSchedules))
193
+ return 'agent_schedules must be an array';
194
+ const seen = new Set();
195
+ for (const s of agentSchedules) {
196
+ if (!s || typeof s !== 'object')
197
+ return 'agent_schedules entry must be an object';
198
+ if (!s.name || typeof s.name !== 'string' || !SCHEDULE_NAME_RX.test(s.name)) {
199
+ return `agent_schedules entry has invalid name "${s.name}" — must be lowercase snake_case`;
200
+ }
201
+ if (seen.has(s.name))
202
+ return `agent_schedules entry "${s.name}" is duplicated`;
203
+ seen.add(s.name);
204
+ if (!s.cron || typeof s.cron !== 'string') {
205
+ return `agent_schedules entry "${s.name}" missing cron`;
206
+ }
207
+ const fields = s.cron.trim().split(/\s+/);
208
+ if (fields.length !== 5) {
209
+ return `agent_schedules entry "${s.name}" cron must have 5 whitespace-separated fields, got ${fields.length}`;
210
+ }
211
+ const taskType = s.taskType ?? 'message';
212
+ if (!['message', 'reminder', 'pipe', 'script'].includes(taskType)) {
213
+ return `agent_schedules entry "${s.name}" has invalid taskType "${taskType}"`;
214
+ }
215
+ if (taskType === 'message' && (!s.prompt || typeof s.prompt !== 'string')) {
216
+ return `agent_schedules entry "${s.name}" missing prompt (required for taskType=message)`;
217
+ }
218
+ if (s.timezone !== undefined && typeof s.timezone !== 'string') {
219
+ return `agent_schedules entry "${s.name}" has invalid timezone`;
220
+ }
221
+ if (s.agentSlug !== undefined && (typeof s.agentSlug !== 'string' || !s.agentSlug)) {
222
+ return `agent_schedules entry "${s.name}" has invalid agentSlug`;
223
+ }
224
+ if (s.enabled !== undefined && typeof s.enabled !== 'boolean') {
225
+ return `agent_schedules entry "${s.name}" has invalid enabled (must be boolean)`;
226
+ }
227
+ }
228
+ return null;
229
+ }
230
+ export function validateSchedules(schedules) {
231
+ if (!schedules)
232
+ return null;
233
+ if (!Array.isArray(schedules))
234
+ return 'schedules must be an array';
235
+ const seen = new Set();
236
+ for (const s of schedules) {
237
+ if (!s || typeof s !== 'object')
238
+ return 'schedules entry must be an object';
239
+ if (!s.name || typeof s.name !== 'string' || !SCHEDULE_NAME_RX.test(s.name)) {
240
+ return `schedules entry has invalid name "${s.name}" — must be lowercase snake_case`;
241
+ }
242
+ if (seen.has(s.name)) {
243
+ return `schedules entry "${s.name}" is duplicated`;
244
+ }
245
+ seen.add(s.name);
246
+ if (!s.cron || typeof s.cron !== 'string') {
247
+ return `schedules entry "${s.name}" missing cron`;
248
+ }
249
+ const fields = s.cron.trim().split(/\s+/);
250
+ if (fields.length !== 5) {
251
+ return `schedules entry "${s.name}" cron must have 5 whitespace-separated fields, got ${fields.length}`;
252
+ }
253
+ if (!s.tool || typeof s.tool !== 'string' || !CROSS_TENANT_TOOL_NAME_REGEX.test(s.tool)) {
254
+ return `schedules entry "${s.name}" tool "${s.tool}" is invalid — must be lowercase app-prefix snake_case`;
255
+ }
256
+ if (s.scope !== undefined && s.scope !== 'per_install' && s.scope !== 'per_tenant') {
257
+ return `schedules entry "${s.name}" has invalid scope "${s.scope}"`;
258
+ }
259
+ }
260
+ return null;
261
+ }
262
+ //# sourceMappingURL=manifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AA4FH,8EAA8E;AAE9E,MAAM,CAAC,MAAM,4BAA4B,GAAG,+BAA+B,CAAC;AAC5E,MAAM,WAAW,GAAG,+BAA+B,CAAC;AACpD,MAAM,aAAa,GAAG,mBAAmB,CAAC;AAC1C,MAAM,eAAe,GAAG,sBAAsB,CAAC;AAC/C,MAAM,gBAAgB,GAAG,mBAAmB,CAAC;AAC7C,MAAM,iBAAiB,GAAG,qCAAqC,CAAC;AAEhE,MAAM,CAAC,MAAM,wBAAwB,GAAmB,KAAK,CAAC;AAE9D,8EAA8E;AAE9E,MAAM,UAAU,mBAAmB,CAAC,IAAgC;IAClE,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACpC,IAAI,IAAI,KAAK,KAAK,IAAI,I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AC7G,CAAC;QACD,IAAI,CAAC,CAAC,KAAK,KAAK,SAAS,IAAI,CAAC,CAAC,KAAK,KAAK,aAAa,IAAI,CAAC,CAAC,KAAK,KAAK,YAAY,EAAE,CAAC;YACnF,OAAO,oBAAoB,CAAC,CAAC,IAAI,wBAAwB,CAAC,CAAC,KAAK,GAAG,CAAC;QACtE,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
package/package.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "@sprigr/cli",
3
+ "version": "0.1.2",
4
+ "description": "Sprigr Team CLI — deploy static sites and Next.js apps to Sprigr Tenant Hosting from your terminal.",
5
+ "type": "module",
6
+ "bin": {
7
+ "sprigr": "./dist/bin.js"
8
+ },
9
+ "files": [
10
+ "dist",
11
+ "README.md"
12
+ ],
13
+ "scripts": {
14
+ "build": "tsc && chmod +x dist/bin.js",
15
+ "dev": "tsx src/bin.ts",
16
+ "test:unit": "vitest run",
17
+ "typecheck": "tsc --noEmit",
18
+ "prepublishOnly": "npm run build"
19
+ },
20
+ "engines": {
21
+ "node": ">=20"
22
+ },
23
+ "devDependencies": {
24
+ "@sprigr/team-shared": "workspace:*",
25
+ "@types/node": "^22.0.0",
26
+ "tsx": "^4.0.0",
27
+ "typescript": "^5.5.0",
28
+ "vitest": "^3.2.4"
29
+ },
30
+ "publishConfig": {
31
+ "access": "public"
32
+ },
33
+ "keywords": [
34
+ "sprigr",
35
+ "cli",
36
+ "deploy",
37
+ "static-site",
38
+ "nextjs",
39
+ "opennext",
40
+ "cloudflare-workers",
41
+ "edge",
42
+ "tenant-hosting"
43
+ ],
44
+ "license": "MIT",
45
+ "homepage": "https://sprigr.com",
46
+ "repository": {
47
+ "type": "git",
48
+ "url": "git+https://github.com/greben99/sprigr-team.git",
49
+ "directory": "apps/cli"
50
+ },
51
+ "bugs": {
52
+ "url": "https://github.com/greben99/sprigr-team/issues"
53
+ }
54
+ }