Pre-launch — Gluecron is in final validation. Public signups and git hosting for non-owner users open after launch review.
CodeIssuesDiscussionsWikiPull RequestsProjectsCommitsActionsReleasesContributorsPulse● GatesSecuritySettingsDeploymentsPipelineInsightsAgents✨ Explain✨ Ask AI✨ Workspace✨ Spec✨ Tests▓ Debt Map✨ NL Search🏛 Archaeology
claude/adoring-hopper-5x74bqclaude/affectionate-feynman-ykrf1hclaude/architecture-audit-design-wxprenclaude/build-status-update-3MXsfclaude/charming-meitner-mllb5rclaude/compare-gate-gluecron-s4mFQclaude/confident-faraday-tikcwbclaude/continue-work-XMTlIclaude/crontech-gluecron-deploy-7MIECclaude/crontech-platform-setup-SeKfwclaude/design-2026claude/ecstatic-ptolemy-jMdigclaude/enhance-github-integration-QNHdGclaude/fix-aa-loop-issue-PonMQclaude/fix-actions-and-processclaude/fix-desktop-errors-XqoW8claude/fix-red-workflowsclaude/fix-website-access-6FKJNclaude/gatetest-integration-hardeningclaude/github-audit-improvements-bDFr9claude/gluecron-launch-status-FoMRlclaude/hopeful-lamport-olfCTclaude/issue-to-pr-and-protectionsclaude/jolly-heisenberg-2sg1Qclaude/launch-preparation-QmTb6claude/new-session-xk1l7claude/plan-platform-architecture-kkN4yclaude/platform-analysis-roadmap-1nUGLclaude/platform-launch-assessment-8dWV8claude/polish-platform-release-AeDrUclaude/resume-previous-work-KzyLwclaude/review-crontech-handoff-qYEVqclaude/review-project-completeness-lHhS2claude/review-readme-docs-ulqPKclaude/serene-edison-rj87weclaude/setup-multi-repo-dev-BCwNQclaude/ship-fixes-and-tests-Jvz1cclaude/site-audit-competitive-pctlwgclaude/site-migration-vercel-XstpKclaude/standalone-product-repos-XHFTDcopilot/feat-smart-empty-states-keyboard-first-enhancementcopilot/feat-smart-morning-digest-review-context-restorecopilot/fix-and-process-workflowscopilot/update-ai-powered-code-reviewfeat/debt-mapfeat/push-policy-codeowners-hardeningfeat/smart-digest-contextfeat/stage-impactfeat/t1-secret-migrationfeat/u-polishfeat/w-self-hostfeat/w2-claude-configfix/agent-journey-orphan-sweepgatetest/auto-fix-1776586424172gatetest/auto-fix-1776586534814gatetest/auto-fix-1776590685143gatetest/auto-fix-1776590808199mainops/redeploy-retriggerstyle/dxt-cta-themeworktree-agent-a3377aad30d55da26worktree-agent-a7ef607b7ee1d6c74
developer-program.tsx22.7 KB · 688 lines
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
/**
 * Developer Program page — /developer-program
 *
 * "Build on Gluecron. Earn revenue."
 * Three sections: Publish an agent · Revenue share · Partner badge.
 * CTA: partner application form (logs for now; no DB write required).
 *
 * Pure server-rendered. Dark theme. No new dependencies.
 * All CSS scoped under .devprog-* to avoid leaking into app views.
 */

import { Hono } from "hono";
import { Layout } from "../views/layout";
import { softAuth } from "../middleware/auth";
import type { AuthEnv } from "../middleware/auth";

const developerProgram = new Hono<AuthEnv>();

developerProgram.use("*", softAuth);

// ─── Page-scoped styles ───────────────────────────────────────────────────────
const devprogCss = `
  .devprog-wrap { max-width: 1060px; margin: 0 auto; padding: 0 24px 80px; }

  /* ─── Hero ─── */
  .devprog-hero {
    position: relative;
    margin: 4px 0 48px;
    padding: 64px 48px 56px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    text-align: center;
  }
  .devprog-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #8c6dff 30%, #36c5d6 70%, transparent 100%);
    opacity: 0.85;
    pointer-events: none;
  }
  .devprog-hero-bg {
    position: absolute;
    inset: -30% -10% auto auto;
    width: 500px; height: 500px;
    pointer-events: none;
    z-index: 0;
  }
  .devprog-hero-orb {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(140,109,255,0.24), rgba(54,197,214,0.10) 45%, transparent 70%);
    filter: blur(90px);
    opacity: 0.7;
    animation: devprogOrbDrift 14s ease-in-out infinite;
  }
  .devprog-hero-orb-2 {
    position: absolute;
    inset: auto auto -20% -12%;
    width: 340px; height: 340px;
    background: radial-gradient(circle, rgba(54,197,214,0.18), rgba(140,109,255,0.06) 50%, transparent 75%);
    filter: blur(70px);
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
    animation: devprogOrbDrift2 18s ease-in-out infinite;
  }
  @keyframes devprogOrbDrift {
    0%, 100% { transform: scale(1) translate(0, 0); opacity: 0.6; }
    50%      { transform: scale(1.10) translate(-12px, 10px); opacity: 0.88; }
  }
  @keyframes devprogOrbDrift2 {
    0%, 100% { transform: scale(1) translate(0, 0); opacity: 0.40; }
    50%      { transform: scale(1.08) translate(14px, -8px); opacity: 0.65; }
  }
  @media (prefers-reduced-motion: reduce) {
    .devprog-hero-orb, .devprog-hero-orb-2 { animation: none; }
  }
  .devprog-hero-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }
  .devprog-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--accent);
  }
  .devprog-hero-eyebrow-dot {
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px rgba(140,109,255,0.7);
  }
  .devprog-hero-title {
    font-family: var(--font-display);
    font-size: clamp(36px, 5.5vw, 68px);
    font-weight: 800;
    letter-spacing: -0.036em;
    line-height: 0.96;
    color: var(--text-strong);
    max-width: 780px;
    margin: 0;
  }
  .devprog-hero-title .gradient-text {
    background-image: linear-gradient(135deg, #a48bff 0%, #8c6dff 50%, #36c5d6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
  .devprog-hero-sub {
    font-size: 17px;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 560px;
    margin: 0;
  }
  .devprog-hero-ctas {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 8px;
  }

  /* ─── Section cards (the three value props) ─── */
  .devprog-sections {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 48px;
  }
  .devprog-card {
    position: relative;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow: hidden;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
  }
  .devprog-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #8c6dff 30%, #36c5d6 70%, transparent 100%);
    opacity: 0;
    transition: opacity 180ms ease;
    pointer-events: none;
  }
  .devprog-card:hover {
    border-color: rgba(140,109,255,0.40);
    box-shadow: 0 14px 32px -16px rgba(0,0,0,0.55), 0 0 24px -8px rgba(140,109,255,0.18);
    transform: translateY(-2px);
  }
  .devprog-card:hover::before { opacity: 0.85; }
  .devprog-card-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: var(--accent-gradient-soft, rgba(140,109,255,0.12));
    border: 1px solid rgba(140,109,255,0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    flex-shrink: 0;
  }
  .devprog-card-eyebrow {
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--accent);
  }
  .devprog-card-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.018em;
    color: var(--text-strong);
    margin: 0;
    line-height: 1.2;
  }
  .devprog-card-body {
    font-size: 14.5px;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
    flex: 1;
  }
  .devprog-card-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-link);
    text-decoration: none;
    transition: color 120ms ease, gap 120ms ease;
    margin-top: 4px;
  }
  .devprog-card-link:hover {
    color: var(--accent-hover);
    gap: 8px;
    text-decoration: none;
  }

  /* ─── Revenue highlight strip ─── */
  .devprog-revenue-strip {
    display: flex;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 48px;
    background: var(--bg-elevated);
  }
  .devprog-revenue-pct {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 28px 36px;
    flex: 0 0 auto;
    border-right: 1px solid var(--border);
  }
  .devprog-revenue-num {
    font-family: var(--font-display);
    font-size: 52px;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
    background-image: linear-gradient(135deg, #a48bff 0%, #36c5d6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
  .devprog-revenue-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    text-align: center;
  }
  .devprog-revenue-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 28px 32px;
    gap: 8px;
  }
  .devprog-revenue-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.018em;
    color: var(--text-strong);
    margin: 0;
  }
  .devprog-revenue-desc {
    font-size: 14.5px;
    color: var(--text-muted);
    line-height: 1.55;
    margin: 0;
    max-width: 520px;
  }

  /* ─── Application form card ─── */
  .devprog-apply {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 44px 48px;
    position: relative;
    overflow: hidden;
  }
  .devprog-apply::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #8c6dff 30%, #36c5d6 70%, transparent 100%);
    opacity: 0.75;
    pointer-events: none;
  }
  .devprog-apply-inner { max-width: 640px; }
  .devprog-apply-eyebrow {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 12px;
  }
  .devprog-apply-title {
    font-family: var(--font-display);
    font-size: clamp(24px, 3.5vw, 36px);
    font-weight: 800;
    letter-spacing: -0.028em;
    line-height: 1.1;
    color: var(--text-strong);
    margin: 0 0 10px;
  }
  .devprog-apply-sub {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0 0 28px;
  }
  .devprog-form { display: flex; flex-direction: column; gap: 16px; }
  .devprog-field { display: flex; flex-direction: column; gap: 6px; }
  .devprog-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-strong);
    letter-spacing: -0.008em;
  }
  .devprog-input,
  .devprog-textarea {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 9px 12px;
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--text);
    transition: border-color 120ms ease, box-shadow 120ms ease;
    width: 100%;
  }
  .devprog-input::placeholder,
  .devprog-textarea::placeholder { color: var(--text-faint); }
  .devprog-input:focus,
  .devprog-textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: var(--ring);
  }
  .devprog-textarea { resize: vertical; min-height: 90px; }
  .devprog-form-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
    flex-wrap: wrap;
  }
  .devprog-form-note {
    font-size: 12.5px;
    color: var(--text-faint);
    line-height: 1.5;
  }
  .devprog-success {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: rgba(52,211,153,0.06);
    border: 1px solid rgba(52,211,153,0.28);
    border-radius: 12px;
    padding: 18px 20px;
    font-size: 14.5px;
    color: var(--text-strong);
    line-height: 1.55;
  }
  .devprog-success-icon {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: rgba(52,211,153,0.15);
    border: 1px solid rgba(52,211,153,0.35);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    color: #34d399;
  }

  /* ─── Docs link strip ─── */
  .devprog-docs-strip {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 24px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-top: 28px;
    font-size: 14px;
  }
  .devprog-docs-strip-icon { color: var(--accent); flex-shrink: 0; }
  .devprog-docs-strip-text { flex: 1; color: var(--text-muted); }
  .devprog-docs-strip-link {
    font-weight: 600;
    color: var(--text-link);
    white-space: nowrap;
  }

  @media (max-width: 640px) {
    .devprog-hero { padding: 40px 24px 36px; }
    .devprog-apply { padding: 32px 24px; }
    .devprog-revenue-strip { flex-direction: column; }
    .devprog-revenue-pct { border-right: none; border-bottom: 1px solid var(--border); }
  }
`;

// ─── Route: GET /developer-program ───────────────────────────────────────────
developerProgram.get("/developer-program", (c) => {
  const user = c.get("user");
  const applied = c.req.query("applied") === "1";

  return c.html(
    <Layout
      title="Developer Program"
      user={user}
      description="Build AI agents on Gluecron, list them in the marketplace, and keep 70% of every sale. Apply for the partner program today."
    >
      <style dangerouslySetInnerHTML={{ __html: devprogCss }} />
      <div class="devprog-wrap">

        {/* ── Hero ── */}
        <section class="devprog-hero" aria-labelledby="devprog-hero-h">
          <div class="devprog-hero-bg" aria-hidden="true">
            <div class="devprog-hero-orb" />
            <div class="devprog-hero-orb-2" />
          </div>
          <div class="devprog-hero-inner">
            <div class="devprog-hero-eyebrow">
              <span class="devprog-hero-eyebrow-dot" aria-hidden="true" />
              Gluecron Developer Program
            </div>
            <h1 id="devprog-hero-h" class="devprog-hero-title">
              Build on Gluecron.{" "}
              <span class="gradient-text">Earn revenue.</span>
            </h1>
            <p class="devprog-hero-sub">
              List your AI agent in the Gluecron marketplace. Set your price. Ship
              to thousands of developer teams already using Gluecron for their daily
              workflow.
            </p>
            <div class="devprog-hero-ctas">
              <a href="#apply" class="btn btn-primary btn-xl">
                Apply for partner status
                <span aria-hidden="true">{" →"}</span>
              </a>
              <a href="/help#agents" class="btn btn-secondary btn-xl">
                Read the docs
              </a>
            </div>
          </div>
        </section>

        {/* ── Three sections ── */}
        <div class="devprog-sections">
          {/* 1 — Publish an agent */}
          <div class="devprog-card">
            <div class="devprog-card-icon" aria-hidden="true">
              <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round">
                <path d="M12 2l2.39 5.95L20 9l-4.5 3.9L17 19l-5-3.2L7 19l1.5-6.1L4 9l5.61-1.05L12 2z" />
              </svg>
            </div>
            <div class="devprog-card-eyebrow">Step 1</div>
            <h2 class="devprog-card-title">Publish an agent</h2>
            <p class="devprog-card-body">
              List your AI agent in the Gluecron marketplace. Set your price.
              Gluecron takes 30% — you keep 70%. Your agent is discoverable
              by every developer on the platform the moment it's approved.
            </p>
            <a href="/marketplace/agents/new" class="devprog-card-link">
              Publish your first agent
              <span aria-hidden="true"></span>
            </a>
          </div>

          {/* 2 — Revenue share */}
          <div class="devprog-card">
            <div class="devprog-card-icon" aria-hidden="true">
              <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round">
                <line x1="12" y1="1" x2="12" y2="23" />
                <path d="M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6" />
              </svg>
            </div>
            <div class="devprog-card-eyebrow">How you earn</div>
            <h2 class="devprog-card-title">Revenue share</h2>
            <p class="devprog-card-body">
              The 30% platform cut is already in the schema. When your agent is
              installed by a team, you earn automatically — no invoicing, no
              chasing payments. Payouts go out monthly to your connected account.
            </p>
            <a href="/help#agents" class="devprog-card-link">
              See payout docs
              <span aria-hidden="true"></span>
            </a>
          </div>

          {/* 3 — Partner badge */}
          <div class="devprog-card">
            <div class="devprog-card-icon" aria-hidden="true">
              <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round">
                <path d="M12 2.5l8 3.5v6c0 5-3.5 8.5-8 9.5-4.5-1-8-4.5-8-9.5v-6z" />
                <path d="M9 12l2 2 4-4" />
              </svg>
            </div>
            <div class="devprog-card-eyebrow">Verified status</div>
            <h2 class="devprog-card-title">gluecron-partner badge</h2>
            <p class="devprog-card-body">
              Verified partners get a badge on their profile and priority
              placement in the marketplace. The badge signals to buyers that
              your agent has been reviewed by the Gluecron team and meets our
              quality and security bar.
            </p>
            <a href="#apply" class="devprog-card-link">
              Apply now
              <span aria-hidden="true"></span>
            </a>
          </div>
        </div>

        {/* ── Revenue highlight strip ── */}
        <div class="devprog-revenue-strip" aria-label="Revenue split: you keep 70%">
          <div class="devprog-revenue-pct">
            <div class="devprog-revenue-num">70%</div>
            <div class="devprog-revenue-label">you keep</div>
          </div>
          <div class="devprog-revenue-body">
            <h2 class="devprog-revenue-title">The math is simple.</h2>
            <p class="devprog-revenue-desc">
              Gluecron takes 30% to cover infrastructure, payments, and
              marketplace distribution. You keep 70% of every subscription or
              one-time purchase — no hidden fees, no surprise deductions. The
              split is encoded in the platform schema and applied automatically
              at payout time.
            </p>
          </div>
        </div>

        {/* ── Application form ── */}
        <section id="apply" class="devprog-apply" aria-labelledby="devprog-apply-h">
          <div class="devprog-apply-inner">
            <div class="devprog-apply-eyebrow">Partner application</div>
            <h2 id="devprog-apply-h" class="devprog-apply-title">
              Apply for partner status
            </h2>
            <p class="devprog-apply-sub">
              Tell us about the agent you're building. We review every
              application within 5 business days and reply to the email on your
              Gluecron account.
            </p>

            {applied ? (
              <div class="devprog-success" role="alert">
                <div class="devprog-success-icon" aria-hidden="true"></div>
                <div>
                  <strong>Application received.</strong> We'll review your
                  submission and reply within 5 business days. Keep building!
                </div>
              </div>
            ) : (
              <form
                method="post"
                action="/developer-program"
                class="devprog-form"
              >
                <div class="devprog-field">
                  <label class="devprog-label" for="dp-agent-name">
                    Agent name
                  </label>
                  <input
                    id="dp-agent-name"
                    name="agent_name"
                    type="text"
                    class="devprog-input"
                    placeholder="e.g. PR Summarizer Pro"
                    required
                    maxlength={120}
                  />
                </div>
                <div class="devprog-field">
                  <label class="devprog-label" for="dp-agent-desc">
                    What does it do?
                  </label>
                  <textarea
                    id="dp-agent-desc"
                    name="agent_description"
                    class="devprog-textarea"
                    placeholder="Describe your agent in 2–4 sentences. What problem does it solve? Who is it for?"
                    required
                    maxlength={800}
                  />
                </div>
                <div class="devprog-field">
                  <label class="devprog-label" for="dp-pricing">
                    Pricing model
                  </label>
                  <input
                    id="dp-pricing"
                    name="pricing_model"
                    type="text"
                    class="devprog-input"
                    placeholder='e.g. "$9/mo per seat" or "one-time $49"'
                    maxlength={120}
                  />
                </div>
                <div class="devprog-field">
                  <label class="devprog-label" for="dp-repo">
                    Gluecron repo or demo URL
                  </label>
                  <input
                    id="dp-repo"
                    name="repo_url"
                    type="url"
                    class="devprog-input"
                    placeholder="https://gluecron.com/you/your-agent"
                  />
                </div>
                <div class="devprog-form-actions">
                  <button type="submit" class="btn btn-primary">
                    Submit application
                  </button>
                  <p class="devprog-form-note">
                    We'll reply to the email on your Gluecron account.
                    Applications are reviewed manually — no bots.
                  </p>
                </div>
              </form>
            )}

            {/* Docs link */}
            <div class="devprog-docs-strip" role="complementary">
              <svg class="devprog-docs-strip-icon" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
                <path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" />
                <polyline points="14 2 14 8 20 8" />
                <line x1="16" y1="13" x2="8" y2="13" />
                <line x1="16" y1="17" x2="8" y2="17" />
                <polyline points="10 9 9 9 8 9" />
              </svg>
              <span class="devprog-docs-strip-text">
                Want to start building before applying?
              </span>
              <a href="/help#agents" class="devprog-docs-strip-link">
                Read the agent publishing docs →
              </a>
            </div>
          </div>
        </section>

      </div>
    </Layout>
  );
});

// ─── Route: POST /developer-program ──────────────────────────────────────────
// Logs the application for now. Future: insert into partner_applications table.
developerProgram.post("/developer-program", async (c) => {
  const user = c.get("user");
  const body = await c.req.parseBody();

  // Log the application so it's visible in server output / observability
  console.log("[developer-program] partner application received", {
    userId: user?.id ?? null,
    username: user?.username ?? null,
    agentName: body["agent_name"],
    pricingModel: body["pricing_model"],
    repoUrl: body["repo_url"],
    // description intentionally omitted from log to keep it brief
    at: new Date().toISOString(),
  });

  return c.redirect("/developer-program?applied=1");
});

export default developerProgram;