@mastra/deployer 1.23.0-alpha.0 → 1.23.0-alpha.1

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @mastra/deployer
2
2
 
3
+ ## 1.23.0-alpha.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`f32b9e1`](https://github.com/mastra-ai/mastra/commit/f32b9e115a3c754d1c8cfa3f4256fba87b09cfb7)]:
8
+ - @mastra/core@1.23.0-alpha.1
9
+ - @mastra/server@1.23.0-alpha.1
10
+
3
11
  ## 1.23.0-alpha.0
4
12
 
5
13
  ### Patch Changes
@@ -3,7 +3,7 @@ name: mastra-deployer
3
3
  description: Documentation for @mastra/deployer. Use when working with @mastra/deployer APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "@mastra/deployer"
6
- version: "1.23.0-alpha.0"
6
+ version: "1.23.0-alpha.1"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.23.0-alpha.0",
2
+ "version": "1.23.0-alpha.1",
3
3
  "package": "@mastra/deployer",
4
4
  "exports": {
5
5
  "Deps": {
@@ -3898,111 +3898,422 @@ async function rootHandler(c) {
3898
3898
  }
3899
3899
 
3900
3900
  // src/server/welcome.ts
3901
- var html2 = `
3901
+ function welcomeHtml(apiPrefix = "/api") {
3902
+ const prefix = "/" + apiPrefix.replace(/^\/+|\/+$/g, "");
3903
+ const prefixNoSlash = prefix.slice(1);
3904
+ return `
3902
3905
  <!doctype html>
3903
3906
  <html lang="en">
3904
3907
  <head>
3905
3908
  <meta charset="UTF-8" />
3906
3909
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
3907
- <title>Welcome to Mastra</title>
3908
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/inter-ui/3.19.3/inter.min.css" />
3910
+ <title>Mastra Server</title>
3909
3911
  <style>
3912
+ * { box-sizing: border-box; }
3913
+
3910
3914
  body {
3911
3915
  margin: 0;
3912
3916
  padding: 0;
3913
- background-color: #0d0d0d;
3914
- color: #ffffff;
3915
- font-family:
3916
- 'Inter',
3917
- -apple-system,
3918
- BlinkMacSystemFont,
3919
- system-ui,
3920
- sans-serif;
3917
+ background-color: #0a0a0a;
3918
+ color: #e4e4e7;
3919
+ font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
3921
3920
  min-height: 100vh;
3921
+ line-height: 1.6;
3922
+ }
3923
+
3924
+ .page {
3925
+ max-width: 720px;
3926
+ margin: 0 auto;
3927
+ padding: 3rem 1.5rem 4rem;
3928
+ }
3929
+
3930
+ header {
3931
+ margin-bottom: 2.5rem;
3932
+ }
3933
+
3934
+ header h1 {
3935
+ font-size: 1.75rem;
3936
+ font-weight: 600;
3937
+ margin: 0 0 0.25rem;
3938
+ color: #fff;
3939
+ }
3940
+
3941
+ header p {
3942
+ color: #71717a;
3943
+ font-size: 0.9rem;
3944
+ margin: 0;
3945
+ }
3946
+
3947
+ .status-bar {
3922
3948
  display: flex;
3923
- flex-direction: column;
3949
+ align-items: center;
3950
+ gap: 0.5rem;
3951
+ margin-top: 1rem;
3952
+ font-size: 0.8rem;
3953
+ color: #a1a1aa;
3924
3954
  }
3925
3955
 
3926
- main {
3927
- flex: 1;
3956
+ .status-dot {
3957
+ width: 8px;
3958
+ height: 8px;
3959
+ border-radius: 50%;
3960
+ background: #22c55e;
3961
+ flex-shrink: 0;
3962
+ }
3963
+
3964
+ section {
3965
+ margin-bottom: 2rem;
3966
+ }
3967
+
3968
+ section h2 {
3969
+ font-size: 0.75rem;
3970
+ font-weight: 600;
3971
+ text-transform: uppercase;
3972
+ letter-spacing: 0.05em;
3973
+ color: #71717a;
3974
+ margin: 0 0 0.75rem;
3975
+ }
3976
+
3977
+ .card {
3978
+ background: #18181b;
3979
+ border: 1px solid #27272a;
3980
+ border-radius: 8px;
3981
+ overflow: hidden;
3982
+ }
3983
+
3984
+ .card + .card {
3985
+ margin-top: 0.75rem;
3986
+ }
3987
+
3988
+ .card-row {
3989
+ display: flex;
3990
+ align-items: center;
3991
+ justify-content: space-between;
3992
+ padding: 0.75rem 1rem;
3993
+ gap: 0.75rem;
3994
+ }
3995
+
3996
+ .card-row + .card-row {
3997
+ border-top: 1px solid #27272a;
3998
+ }
3999
+
4000
+ .card-row-left {
3928
4001
  display: flex;
3929
- flex-direction: column;
3930
4002
  align-items: center;
3931
- justify-content: center;
3932
- padding: 2rem;
3933
- text-align: center;
4003
+ gap: 0.75rem;
4004
+ min-width: 0;
3934
4005
  }
3935
4006
 
3936
- h1 {
3937
- font-size: 4rem;
4007
+ .method {
4008
+ font-family: 'SF Mono', SFMono-Regular, ui-monospace, Menlo, monospace;
4009
+ font-size: 0.7rem;
3938
4010
  font-weight: 600;
3939
- margin: 0 0 1rem 0;
3940
- background: linear-gradient(to right, #fff, #ccc);
3941
- -webkit-background-clip: text;
3942
- -webkit-text-fill-color: transparent;
3943
- line-height: 1.2;
4011
+ padding: 2px 6px;
4012
+ border-radius: 4px;
4013
+ flex-shrink: 0;
3944
4014
  }
3945
4015
 
3946
- .subtitle {
3947
- color: #9ca3af;
3948
- font-size: 1.25rem;
3949
- max-width: 600px;
3950
- margin: 0 auto 3rem auto;
3951
- line-height: 1.6;
4016
+ .method-get { background: #052e16; color: #4ade80; }
4017
+ .method-post { background: #172554; color: #60a5fa; }
4018
+
4019
+ .endpoint-path {
4020
+ font-family: 'SF Mono', SFMono-Regular, ui-monospace, Menlo, monospace;
4021
+ font-size: 0.8rem;
4022
+ color: #d4d4d8;
4023
+ white-space: nowrap;
4024
+ overflow: hidden;
4025
+ text-overflow: ellipsis;
4026
+ }
4027
+
4028
+ .endpoint-desc {
4029
+ font-size: 0.75rem;
4030
+ color: #71717a;
4031
+ flex-shrink: 0;
4032
+ }
4033
+
4034
+ .curl-block {
4035
+ position: relative;
4036
+ background: #111113;
4037
+ border: 1px solid #27272a;
4038
+ border-radius: 8px;
4039
+ overflow: hidden;
4040
+ }
4041
+
4042
+ .curl-block + .curl-block {
4043
+ margin-top: 0.75rem;
3952
4044
  }
3953
4045
 
3954
- .docs-link {
3955
- background-color: #1a1a1a;
3956
- padding: 1rem 2rem;
3957
- border-radius: 0.5rem;
4046
+ .curl-label {
3958
4047
  display: flex;
3959
4048
  align-items: center;
3960
- gap: 1rem;
3961
- font-family: monospace;
3962
- font-size: 1rem;
3963
- color: #ffffff;
4049
+ justify-content: space-between;
4050
+ padding: 0.5rem 1rem;
4051
+ border-bottom: 1px solid #27272a;
4052
+ font-size: 0.75rem;
4053
+ color: #a1a1aa;
4054
+ }
4055
+
4056
+ .copy-btn {
4057
+ background: none;
4058
+ border: 1px solid #3f3f46;
4059
+ border-radius: 4px;
4060
+ color: #a1a1aa;
4061
+ font-size: 0.7rem;
4062
+ padding: 2px 8px;
4063
+ cursor: pointer;
4064
+ font-family: inherit;
4065
+ transition: all 0.15s;
4066
+ }
4067
+
4068
+ .copy-btn:hover {
4069
+ background: #27272a;
4070
+ color: #e4e4e7;
4071
+ }
4072
+
4073
+ .curl-code {
4074
+ padding: 0.75rem 1rem;
4075
+ font-family: 'SF Mono', SFMono-Regular, ui-monospace, Menlo, monospace;
4076
+ font-size: 0.8rem;
4077
+ line-height: 1.5;
4078
+ color: #d4d4d8;
4079
+ overflow-x: auto;
4080
+ white-space: pre;
4081
+ margin: 0;
4082
+ }
4083
+
4084
+ .curl-code .c-cmd { color: #a78bfa; }
4085
+ .curl-code .c-flag { color: #60a5fa; }
4086
+ .curl-code .c-url { color: #fbbf24; }
4087
+ .curl-code .c-str { color: #4ade80; }
4088
+
4089
+ .links-grid {
4090
+ display: grid;
4091
+ grid-template-columns: 1fr 1fr;
4092
+ gap: 0.75rem;
4093
+ }
4094
+
4095
+ .link-card {
4096
+ display: flex;
4097
+ align-items: center;
4098
+ gap: 0.75rem;
4099
+ padding: 0.875rem 1rem;
4100
+ background: #18181b;
4101
+ border: 1px solid #27272a;
4102
+ border-radius: 8px;
4103
+ color: #d4d4d8;
3964
4104
  text-decoration: none;
3965
- transition: background-color 0.2s;
4105
+ font-size: 0.85rem;
4106
+ transition: all 0.15s;
4107
+ }
4108
+
4109
+ .link-card:hover {
4110
+ background: #1f1f23;
4111
+ border-color: #3f3f46;
4112
+ color: #fff;
3966
4113
  }
3967
4114
 
3968
- .docs-link:hover {
3969
- background-color: #252525;
4115
+ .link-icon {
4116
+ flex-shrink: 0;
4117
+ width: 18px;
4118
+ height: 18px;
4119
+ color: #71717a;
3970
4120
  }
3971
4121
 
3972
- .arrow-icon {
3973
- transition: transform 0.2s;
4122
+ .link-card:hover .link-icon { color: #a1a1aa; }
4123
+
4124
+ footer {
4125
+ margin-top: 3rem;
4126
+ padding-top: 1.5rem;
4127
+ border-top: 1px solid #1c1c1f;
4128
+ font-size: 0.75rem;
4129
+ color: #52525b;
3974
4130
  }
3975
4131
 
3976
- .docs-link:hover .arrow-icon {
3977
- transform: translateX(4px);
4132
+ @media (max-width: 480px) {
4133
+ .page { padding: 2rem 1rem 3rem; }
4134
+ header h1 { font-size: 1.5rem; }
4135
+ .links-grid { grid-template-columns: 1fr; }
4136
+ .endpoint-desc { display: none; }
3978
4137
  }
3979
4138
  </style>
3980
4139
  </head>
3981
4140
  <body>
3982
- <main>
3983
- <h1>Welcome to Mastra</h1>
3984
- <p class="subtitle">
3985
- Prototype and productionize AI features with a modern JS/TS stack.
3986
- </p>
4141
+ <div class="page">
4142
+ <header>
4143
+ <h1>Mastra Server</h1>
4144
+ <p>Your server is running. Use the endpoints below to get started.</p>
4145
+ <div class="status-bar">
4146
+ <span class="status-dot"></span>
4147
+ <span id="base-url"></span>
4148
+ </div>
4149
+ </header>
4150
+
4151
+ <section>
4152
+ <h2>Quick Start</h2>
4153
+
4154
+ <div class="curl-block">
4155
+ <div class="curl-label">
4156
+ <span>Check server health</span>
4157
+ <button class="copy-btn" onclick="copyCode(this)">Copy</button>
4158
+ </div>
4159
+ <pre class="curl-code" data-tpl="curl <base>/health"><span class="c-cmd">curl</span> <span class="c-url" data-url="health"></span></pre>
4160
+ </div>
4161
+
4162
+ <div class="curl-block">
4163
+ <div class="curl-label">
4164
+ <span>List your agents</span>
4165
+ <button class="copy-btn" onclick="copyCode(this)">Copy</button>
4166
+ </div>
4167
+ <pre class="curl-code" data-tpl="curl <base>${prefix}/agents"><span class="c-cmd">curl</span> <span class="c-url" data-url="${prefixNoSlash}/agents"></span></pre>
4168
+ </div>
3987
4169
 
3988
- <a href="https://mastra.ai/docs" class="docs-link">
3989
- Browse the docs
3990
- <svg
3991
- class="arrow-icon"
3992
- width="20"
3993
- height="20"
3994
- viewBox="0 0 24 24"
3995
- fill="none"
3996
- stroke="currentColor"
3997
- strokeWidth="2"
3998
- >
3999
- <path d="M5 12h14M12 5l7 7-7 7" />
4000
- </svg>
4001
- </a>
4002
- </main>
4170
+ <div class="curl-block">
4171
+ <div class="curl-label">
4172
+ <span>Chat with an agent</span>
4173
+ <button class="copy-btn" onclick="copyCode(this)">Copy</button>
4174
+ </div>
4175
+ <pre class="curl-code" data-tpl="curl -X POST <base>${prefix}/agents/:agent-id/generate -H 'Content-Type: application/json' -d '{&quot;messages&quot;:[{&quot;role&quot;:&quot;user&quot;,&quot;content&quot;:&quot;Hello&quot;}]}'"><span class="c-cmd">curl</span> <span class="c-flag">-X POST</span> <span class="c-url" data-url="${prefixNoSlash}/agents/:agent-id/generate"></span> \\
4176
+ <span class="c-flag">-H</span> <span class="c-str">'Content-Type: application/json'</span> \\
4177
+ <span class="c-flag">-d</span> <span class="c-str">'{"messages":[{"role":"user","content":"Hello"}]}'</span></pre>
4178
+ </div>
4179
+
4180
+ <div class="curl-block">
4181
+ <div class="curl-label">
4182
+ <span>Stream an agent response</span>
4183
+ <button class="copy-btn" onclick="copyCode(this)">Copy</button>
4184
+ </div>
4185
+ <pre class="curl-code" data-tpl="curl -N -X POST <base>${prefix}/agents/:agent-id/stream -H 'Content-Type: application/json' -d '{&quot;messages&quot;:[{&quot;role&quot;:&quot;user&quot;,&quot;content&quot;:&quot;Hello&quot;}]}'"><span class="c-cmd">curl</span> <span class="c-flag">-N -X POST</span> <span class="c-url" data-url="${prefixNoSlash}/agents/:agent-id/stream"></span> \\
4186
+ <span class="c-flag">-H</span> <span class="c-str">'Content-Type: application/json'</span> \\
4187
+ <span class="c-flag">-d</span> <span class="c-str">'{"messages":[{"role":"user","content":"Hello"}]}'</span></pre>
4188
+ </div>
4189
+ </section>
4190
+
4191
+ <section>
4192
+ <h2>API Endpoints</h2>
4193
+ <div class="card">
4194
+ <div class="card-row">
4195
+ <div class="card-row-left">
4196
+ <span class="method method-get">GET</span>
4197
+ <span class="endpoint-path">${prefix}/agents</span>
4198
+ </div>
4199
+ <span class="endpoint-desc">List all agents</span>
4200
+ </div>
4201
+ <div class="card-row">
4202
+ <div class="card-row-left">
4203
+ <span class="method method-post">POST</span>
4204
+ <span class="endpoint-path">${prefix}/agents/:id/generate</span>
4205
+ </div>
4206
+ <span class="endpoint-desc">Generate a response</span>
4207
+ </div>
4208
+ <div class="card-row">
4209
+ <div class="card-row-left">
4210
+ <span class="method method-post">POST</span>
4211
+ <span class="endpoint-path">${prefix}/agents/:id/stream</span>
4212
+ </div>
4213
+ <span class="endpoint-desc">Stream a response</span>
4214
+ </div>
4215
+ <div class="card-row">
4216
+ <div class="card-row-left">
4217
+ <span class="method method-get">GET</span>
4218
+ <span class="endpoint-path">${prefix}/workflows</span>
4219
+ </div>
4220
+ <span class="endpoint-desc">List all workflows</span>
4221
+ </div>
4222
+ <div class="card-row">
4223
+ <div class="card-row-left">
4224
+ <span class="method method-post">POST</span>
4225
+ <span class="endpoint-path">${prefix}/workflows/:id/start</span>
4226
+ </div>
4227
+ <span class="endpoint-desc">Run a workflow</span>
4228
+ </div>
4229
+ <div class="card-row">
4230
+ <div class="card-row-left">
4231
+ <span class="method method-get">GET</span>
4232
+ <span class="endpoint-path">${prefix}/tools</span>
4233
+ </div>
4234
+ <span class="endpoint-desc">List all tools</span>
4235
+ </div>
4236
+ <div class="card-row">
4237
+ <div class="card-row-left">
4238
+ <span class="method method-post">POST</span>
4239
+ <span class="endpoint-path">${prefix}/tools/:id/execute</span>
4240
+ </div>
4241
+ <span class="endpoint-desc">Execute a tool</span>
4242
+ </div>
4243
+ <div class="card-row">
4244
+ <div class="card-row-left">
4245
+ <span class="method method-get">GET</span>
4246
+ <span class="endpoint-path">${prefix}/memory/threads</span>
4247
+ </div>
4248
+ <span class="endpoint-desc">List memory threads</span>
4249
+ </div>
4250
+ </div>
4251
+ </section>
4252
+
4253
+ <section>
4254
+ <h2>Resources</h2>
4255
+ <div class="links-grid">
4256
+ <a href="https://mastra.ai/docs" target="_blank" rel="noopener noreferrer" class="link-card">
4257
+ <svg class="link-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"/><path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"/></svg>
4258
+ Documentation
4259
+ </a>
4260
+ <a href="https://mastra.ai/docs/server-db/custom-api-routes" target="_blank" rel="noopener noreferrer" class="link-card">
4261
+ <svg class="link-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M16 18l6-6-6-6"/><path d="M8 6l-6 6 6 6"/></svg>
4262
+ Custom API Routes
4263
+ </a>
4264
+ <a href="https://mastra.ai/docs/agents/overview" target="_blank" rel="noopener noreferrer" class="link-card">
4265
+ <svg class="link-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"/><path d="M12 1v4m0 14v4m-7.8-15.4 2.8 2.8m9.6 9.6 2.8 2.8M1 12h4m14 0h4M4.2 19.8l2.8-2.8m9.6-9.6 2.8-2.8"/></svg>
4266
+ Agents Guide
4267
+ </a>
4268
+ <a href="https://mastra.ai/docs/workflows/overview" target="_blank" rel="noopener noreferrer" class="link-card">
4269
+ <svg class="link-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 3 21 3 21 8"/><line x1="4" y1="20" x2="21" y2="3"/><polyline points="21 16 21 21 16 21"/><line x1="15" y1="15" x2="21" y2="21"/><line x1="4" y1="4" x2="9" y2="9"/></svg>
4270
+ Workflows Guide
4271
+ </a>
4272
+ </div>
4273
+ </section>
4274
+
4275
+ <footer>
4276
+ Powered by <a href="https://mastra.ai" target="_blank" rel="noopener noreferrer" style="color:#71717a;">Mastra</a>
4277
+ </footer>
4278
+ </div>
4279
+
4280
+ <script>
4281
+ (function() {
4282
+ var base = location.origin;
4283
+ document.getElementById('base-url').textContent = base;
4284
+
4285
+ var els = document.querySelectorAll('[data-url]');
4286
+ for (var i = 0; i < els.length; i++) {
4287
+ els[i].textContent = base + '/' + els[i].getAttribute('data-url');
4288
+ }
4289
+
4290
+ var tpls = document.querySelectorAll('[data-tpl]');
4291
+ for (var i = 0; i < tpls.length; i++) {
4292
+ tpls[i].setAttribute('data-tpl', tpls[i].getAttribute('data-tpl').replace(/<base>/g, base));
4293
+ }
4294
+ })();
4295
+
4296
+ function copyCode(btn) {
4297
+ var pre = btn.closest('.curl-block').querySelector('.curl-code');
4298
+ var text = pre.getAttribute('data-tpl');
4299
+ if (!navigator.clipboard || !navigator.clipboard.writeText) {
4300
+ btn.textContent = 'Unavailable';
4301
+ setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
4302
+ return;
4303
+ }
4304
+ navigator.clipboard.writeText(text).then(function() {
4305
+ btn.textContent = 'Copied!';
4306
+ setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
4307
+ }).catch(function() {
4308
+ btn.textContent = 'Failed';
4309
+ setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
4310
+ });
4311
+ }
4312
+ </script>
4003
4313
  </body>
4004
4314
  </html>
4005
4315
  `;
4316
+ }
4006
4317
 
4007
4318
  // src/server/index.ts
4008
4319
  var getStudioPath = () => {
@@ -4305,7 +4616,7 @@ async function createHonoServer(mastra, options = {
4305
4616
  });
4306
4617
  return c.newResponse(indexHtml, 200, { "Content-Type": "text/html" });
4307
4618
  }
4308
- return c.newResponse(html2, 200, { "Content-Type": "text/html" });
4619
+ return c.newResponse(welcomeHtml(apiPrefix), 200, { "Content-Type": "text/html" });
4309
4620
  });
4310
4621
  if (options?.studio) {
4311
4622
  const studioRootPath = getStudioPath();