@portel/photon 1.25.0 → 1.26.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/README.md +1 -1
- package/dist/beam-form.bundle.js +11 -1
- package/dist/beam-form.bundle.js.map +2 -2
- package/dist/beam.bundle.js +80 -55
- package/dist/beam.bundle.js.map +4 -4
- package/dist/cli/commands/host.d.ts.map +1 -1
- package/dist/cli/commands/host.js +2 -0
- package/dist/cli/commands/host.js.map +1 -1
- package/dist/cli/commands/ps.d.ts.map +1 -1
- package/dist/cli/commands/ps.js +15 -0
- package/dist/cli/commands/ps.js.map +1 -1
- package/dist/daemon/client.d.ts +6 -0
- package/dist/daemon/client.d.ts.map +1 -1
- package/dist/daemon/client.js.map +1 -1
- package/dist/daemon/server.js +57 -1
- package/dist/daemon/server.js.map +1 -1
- package/dist/deploy/cloudflare.d.ts +7 -0
- package/dist/deploy/cloudflare.d.ts.map +1 -1
- package/dist/deploy/cloudflare.js +337 -37
- package/dist/deploy/cloudflare.js.map +1 -1
- package/dist/loader.d.ts +5 -0
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.js +38 -5
- package/dist/loader.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +40 -0
- package/dist/server.js.map +1 -1
- package/dist/types/server-types.d.ts +6 -0
- package/dist/types/server-types.d.ts.map +1 -1
- package/package.json +1 -1
- package/templates/cloudflare/worker.ts.template +927 -134
- package/templates/cloudflare/wrangler.toml.template +21 -0
package/dist/beam.bundle.js
CHANGED
|
@@ -32936,6 +32936,52 @@ function buildBeamRoutePath(photon, methodName, splitPanelMethodNames = []) {
|
|
|
32936
32936
|
return "/" + baseSegments.map((segment) => encodeURIComponent(segment)).join("/") + "/" + methodSegments.join("+");
|
|
32937
32937
|
}
|
|
32938
32938
|
|
|
32939
|
+
// src/auto-ui/frontend/utils/format-label.ts
|
|
32940
|
+
function formatLabel(name2) {
|
|
32941
|
+
if (!name2) return name2;
|
|
32942
|
+
let cleaned = name2.replace(/^_+/, "");
|
|
32943
|
+
let spaced = cleaned.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2");
|
|
32944
|
+
spaced = spaced.replace(/[_-]+/g, " ");
|
|
32945
|
+
let result = spaced.split(/\s+/).map((word) => {
|
|
32946
|
+
if (!word) return "";
|
|
32947
|
+
const upper = word.toUpperCase();
|
|
32948
|
+
if ([
|
|
32949
|
+
"AI",
|
|
32950
|
+
"ID",
|
|
32951
|
+
"IDS",
|
|
32952
|
+
"URL",
|
|
32953
|
+
"API",
|
|
32954
|
+
"UI",
|
|
32955
|
+
"IP",
|
|
32956
|
+
"HTTP",
|
|
32957
|
+
"HTTPS",
|
|
32958
|
+
"JSON",
|
|
32959
|
+
"XML",
|
|
32960
|
+
"HTML",
|
|
32961
|
+
"CSS",
|
|
32962
|
+
"SQL",
|
|
32963
|
+
"MCP",
|
|
32964
|
+
"SSH",
|
|
32965
|
+
"CLI",
|
|
32966
|
+
"MD",
|
|
32967
|
+
"PR",
|
|
32968
|
+
"CI",
|
|
32969
|
+
"CD",
|
|
32970
|
+
"ENV",
|
|
32971
|
+
"SDK",
|
|
32972
|
+
"OS",
|
|
32973
|
+
"DB",
|
|
32974
|
+
"IO",
|
|
32975
|
+
"GIT"
|
|
32976
|
+
].includes(upper)) {
|
|
32977
|
+
if (upper === "IDS") return "IDs";
|
|
32978
|
+
return upper;
|
|
32979
|
+
}
|
|
32980
|
+
return word.charAt(0).toUpperCase() + word.slice(1);
|
|
32981
|
+
}).join(" ");
|
|
32982
|
+
return result;
|
|
32983
|
+
}
|
|
32984
|
+
|
|
32939
32985
|
// src/auto-ui/frontend/components/beam-app.ts
|
|
32940
32986
|
var THEME_STORAGE_KEY = "beam-theme";
|
|
32941
32987
|
var PROTOCOL_STORAGE_KEY = "beam-protocol";
|
|
@@ -36751,7 +36797,7 @@ ${photon.errorMessage || "Unknown error"}</pre
|
|
|
36751
36797
|
style="display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid var(--border-glass); background: var(--bg-glass); flex-shrink: 0;"
|
|
36752
36798
|
>
|
|
36753
36799
|
<span style="font-size: 12px; font-weight: 500; color: var(--t-primary);"
|
|
36754
|
-
>${this._selectedMethod.name}</span
|
|
36800
|
+
>${this._selectedMethod.title || formatLabel(this._selectedMethod.name)}</span
|
|
36755
36801
|
>
|
|
36756
36802
|
<div style="position: relative; flex-shrink: 0;">
|
|
36757
36803
|
<button
|
|
@@ -37151,7 +37197,7 @@ ${photon.errorMessage || "Unknown error"}</pre
|
|
|
37151
37197
|
*/
|
|
37152
37198
|
_renderDescription(description) {
|
|
37153
37199
|
if (!description) return b2``;
|
|
37154
|
-
const cleaned = description.replace(/^\s*@\w+[^\n]*/gm, "").replace(
|
|
37200
|
+
const cleaned = description.replace(/^\s*@\w+[^\n]*/gm, "").replace(/(?:\s+@[\w.]+(?:\s+(?!@)[\w.]+)*)+\s*$/, "").replace(/[ \t]{2,}/g, " ").replace(/ (- (?!\d))/g, "\n$1").replace(/ (\d+\. )/g, "\n$1").trim();
|
|
37155
37201
|
if (!cleaned) return b2``;
|
|
37156
37202
|
const marked2 = window.marked;
|
|
37157
37203
|
if (marked2) {
|
|
@@ -37338,9 +37384,11 @@ ${photon.errorMessage || "Unknown error"}</pre
|
|
|
37338
37384
|
>
|
|
37339
37385
|
${opts.allMethods?.map(
|
|
37340
37386
|
(m3) => b2`<option .selected=${m3.name === opts.method.name} value=${m3.name}>
|
|
37341
|
-
${m3.name}
|
|
37387
|
+
${m3.title || formatLabel(m3.name)}
|
|
37342
37388
|
</option>`
|
|
37343
|
-
) || b2`<option value=${opts.method.name}
|
|
37389
|
+
) || b2`<option value=${opts.method.name}>
|
|
37390
|
+
${opts.method.title || formatLabel(opts.method.name)}
|
|
37391
|
+
</option>`}
|
|
37344
37392
|
</select>
|
|
37345
37393
|
|
|
37346
37394
|
<div style="flex: 1;"></div>
|
|
@@ -43620,7 +43668,7 @@ var MethodCard = class extends i4 {
|
|
|
43620
43668
|
style="${isTyped ? `--type-accent: ${typeAccent}` : ""}"
|
|
43621
43669
|
role="button"
|
|
43622
43670
|
tabindex="0"
|
|
43623
|
-
aria-label="${this.method.name}${hasDescription ? ": " + this._renderDescription(this.method.description) : ""}"
|
|
43671
|
+
aria-label="${this.method.title || formatLabel(this.method.name)}${hasDescription ? ": " + this._renderDescription(this.method.description) : ""}"
|
|
43624
43672
|
@click=${(e8) => this._handleCardClick(e8)}
|
|
43625
43673
|
@keydown=${(e8) => this._handleCardKeydown(e8)}
|
|
43626
43674
|
>
|
|
@@ -43638,7 +43686,9 @@ var MethodCard = class extends i4 {
|
|
|
43638
43686
|
` : ""}
|
|
43639
43687
|
<span class="${this.editable ? "editable" : ""}">
|
|
43640
43688
|
<h3 class="title">
|
|
43641
|
-
<span class="title-name"
|
|
43689
|
+
<span class="title-name"
|
|
43690
|
+
>${this.method.title || formatLabel(this.method.name)}</span
|
|
43691
|
+
>${this._renderParamSignature()}
|
|
43642
43692
|
</h3>
|
|
43643
43693
|
${this.editable ? b2`<span
|
|
43644
43694
|
class="edit-pencil"
|
|
@@ -43850,7 +43900,7 @@ var MethodCard = class extends i4 {
|
|
|
43850
43900
|
);
|
|
43851
43901
|
}
|
|
43852
43902
|
_renderDescription(description) {
|
|
43853
|
-
let text = description.replace(/\*\*(.+?)\*\*/g, "$1").replace(/__(.+?)__/g, "$1").replace(/\*(.+?)\*/g, "$1").replace(/`@(\w[^`]*)`/g, "`$1`").replace(/`([^`]*)`/g, "$1").replace(/\[([^\]]+)\]\([^)]+\)/g, "$1").replace(/^\s*@\w+[^\n]*/gm, "").replace(
|
|
43903
|
+
let text = description.replace(/\*\*(.+?)\*\*/g, "$1").replace(/__(.+?)__/g, "$1").replace(/\*(.+?)\*/g, "$1").replace(/`@(\w[^`]*)`/g, "`$1`").replace(/`([^`]*)`/g, "$1").replace(/\[([^\]]+)\]\([^)]+\)/g, "$1").replace(/^\s*@\w+[^\n]*/gm, "").replace(/(?:\s+@[\w.]+(?:\s+(?!@)[\w.]+)*)+\s*$/, "").replace(/\*{1,2}/g, "").replace(/`/g, "").replace(/^#{1,6}\s+/gm, "").replace(/\s--\s/g, " \u2014 ").replace(/\s{2,}/g, " ").trim();
|
|
43854
43904
|
return text;
|
|
43855
43905
|
}
|
|
43856
43906
|
_handleDescriptionEditClick(e8) {
|
|
@@ -44329,44 +44379,6 @@ var o8 = (o9) => o9 ?? A;
|
|
|
44329
44379
|
|
|
44330
44380
|
// src/auto-ui/frontend/components/invoke-form.ts
|
|
44331
44381
|
init_styles();
|
|
44332
|
-
|
|
44333
|
-
// src/auto-ui/frontend/utils/format-label.ts
|
|
44334
|
-
function formatLabel(name2) {
|
|
44335
|
-
if (!name2) return name2;
|
|
44336
|
-
let cleaned = name2.replace(/^_+/, "");
|
|
44337
|
-
let spaced = cleaned.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2");
|
|
44338
|
-
spaced = spaced.replace(/[_-]+/g, " ");
|
|
44339
|
-
let result = spaced.split(/\s+/).map((word) => {
|
|
44340
|
-
if (!word) return "";
|
|
44341
|
-
const upper = word.toUpperCase();
|
|
44342
|
-
if ([
|
|
44343
|
-
"AI",
|
|
44344
|
-
"ID",
|
|
44345
|
-
"IDS",
|
|
44346
|
-
"URL",
|
|
44347
|
-
"API",
|
|
44348
|
-
"UI",
|
|
44349
|
-
"IP",
|
|
44350
|
-
"HTTP",
|
|
44351
|
-
"HTTPS",
|
|
44352
|
-
"JSON",
|
|
44353
|
-
"XML",
|
|
44354
|
-
"HTML",
|
|
44355
|
-
"CSS",
|
|
44356
|
-
"SQL",
|
|
44357
|
-
"MCP",
|
|
44358
|
-
"SSH",
|
|
44359
|
-
"CLI"
|
|
44360
|
-
].includes(upper)) {
|
|
44361
|
-
if (upper === "IDS") return "IDs";
|
|
44362
|
-
return upper;
|
|
44363
|
-
}
|
|
44364
|
-
return word.charAt(0).toUpperCase() + word.slice(1);
|
|
44365
|
-
}).join(" ");
|
|
44366
|
-
return result;
|
|
44367
|
-
}
|
|
44368
|
-
|
|
44369
|
-
// src/auto-ui/frontend/components/invoke-form.ts
|
|
44370
44382
|
function capitalizeEnumValue(val) {
|
|
44371
44383
|
return formatLabel(val);
|
|
44372
44384
|
}
|
|
@@ -51749,6 +51761,14 @@ ${footerText || pageNum ? `<div class="slide-footer"><span>${footerText || ""}</
|
|
|
51749
51761
|
if (this._isMermaidString(text)) {
|
|
51750
51762
|
return this._renderMermaid(text);
|
|
51751
51763
|
}
|
|
51764
|
+
const isScalar = typeof data === "number" || typeof data === "boolean" || typeof data === "string" && !text.includes("\n") && text.length < 120;
|
|
51765
|
+
if (isScalar) {
|
|
51766
|
+
return b2`<div
|
|
51767
|
+
style="display:inline-block;background:var(--bg-glass);border:1px solid var(--border-glass);border-radius:var(--radius-md);padding:var(--space-sm) var(--space-md);font-size:var(--text-lg);font-weight:500;font-family:var(--font-mono);color:var(--t-primary);"
|
|
51768
|
+
>
|
|
51769
|
+
${this._highlightText(text)}
|
|
51770
|
+
</div>`;
|
|
51771
|
+
}
|
|
51752
51772
|
return this._highlightText(text);
|
|
51753
51773
|
}
|
|
51754
51774
|
_renderErrorCard(message) {
|
|
@@ -52304,6 +52324,8 @@ ${footerText || pageNum ? `<div class="slide-footer"><span>${footerText || ""}</
|
|
|
52304
52324
|
}
|
|
52305
52325
|
_formatCellValue(value, key, highlight = false) {
|
|
52306
52326
|
if (value === null || value === void 0) return "\u2014";
|
|
52327
|
+
if (value === "" || typeof value === "object" && !Array.isArray(value) && Object.keys(value).length === 0)
|
|
52328
|
+
return "\u2014";
|
|
52307
52329
|
if (typeof value === "boolean") return value ? "\u2713" : "\u2717";
|
|
52308
52330
|
const pipes = this._getColumnPipes();
|
|
52309
52331
|
if (pipes.size > 0) {
|
|
@@ -52327,10 +52349,13 @@ ${footerText || pageNum ? `<div class="slide-footer"><span>${footerText || ""}</
|
|
|
52327
52349
|
</div>
|
|
52328
52350
|
`;
|
|
52329
52351
|
}
|
|
52330
|
-
|
|
52352
|
+
const isDateKey = this._isDateField(key);
|
|
52353
|
+
const isIsoString = typeof value === "string" && /^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?)?$/.test(value);
|
|
52354
|
+
if ((isDateKey || isIsoString) && (typeof value === "string" || typeof value === "number")) {
|
|
52331
52355
|
const date5 = new Date(value);
|
|
52332
52356
|
if (!isNaN(date5.getTime())) {
|
|
52333
|
-
const
|
|
52357
|
+
const isDateOnly = typeof value === "string" && /^\d{4}-\d{2}-\d{2}$/.test(value) || key.toLowerCase().endsWith("date");
|
|
52358
|
+
const dateStr = isDateOnly ? date5.toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric" }) : date5.toLocaleString();
|
|
52334
52359
|
return highlight ? this._highlightText(dateStr) : dateStr;
|
|
52335
52360
|
}
|
|
52336
52361
|
}
|
|
@@ -52514,7 +52539,7 @@ ${str}</pre
|
|
|
52514
52539
|
}
|
|
52515
52540
|
_isDateField(key) {
|
|
52516
52541
|
const lower = key.toLowerCase();
|
|
52517
|
-
return lower.endsWith("at") || lower.endsWith("date") || lower.endsWith("time") || lower === "created" || lower === "updated" || lower === "modified" || lower === "timestamp" || lower === "expires" || lower === "since";
|
|
52542
|
+
return lower.endsWith("at") || lower.endsWith("date") || lower.endsWith("time") || lower.endsWith("run") || lower === "created" || lower === "updated" || lower === "modified" || lower === "timestamp" || lower === "expires" || lower === "since";
|
|
52518
52543
|
}
|
|
52519
52544
|
_isUrlField(key) {
|
|
52520
52545
|
const lower = key.toLowerCase();
|
|
@@ -59018,7 +59043,7 @@ var DaemonPanel = class extends i4 {
|
|
|
59018
59043
|
<table>
|
|
59019
59044
|
<thead>
|
|
59020
59045
|
<tr>
|
|
59021
|
-
<th>
|
|
59046
|
+
<th>Location</th>
|
|
59022
59047
|
<th>Photon</th>
|
|
59023
59048
|
<th>Method</th>
|
|
59024
59049
|
<th>Cron</th>
|
|
@@ -59036,7 +59061,7 @@ var DaemonPanel = class extends i4 {
|
|
|
59036
59061
|
<tr>
|
|
59037
59062
|
<td>${tilde(r7.workingDir)}</td>
|
|
59038
59063
|
<td>${r7.photon}</td>
|
|
59039
|
-
<td>${r7.method}</td>
|
|
59064
|
+
<td>${formatLabel(r7.method)}</td>
|
|
59040
59065
|
<td><code>${r7.cron}</code></td>
|
|
59041
59066
|
<td>${formatWhen(r7.nextRun)}</td>
|
|
59042
59067
|
<td>${formatWhen(r7.lastRun)}</td>
|
|
@@ -59071,7 +59096,7 @@ var DaemonPanel = class extends i4 {
|
|
|
59071
59096
|
<table>
|
|
59072
59097
|
<thead>
|
|
59073
59098
|
<tr>
|
|
59074
|
-
<th>
|
|
59099
|
+
<th>Location</th>
|
|
59075
59100
|
<th>Photon</th>
|
|
59076
59101
|
<th>Method</th>
|
|
59077
59102
|
<th>Cron</th>
|
|
@@ -59086,7 +59111,7 @@ var DaemonPanel = class extends i4 {
|
|
|
59086
59111
|
<tr>
|
|
59087
59112
|
<td>${tilde(r7.workingDir)}</td>
|
|
59088
59113
|
<td>${r7.photon}</td>
|
|
59089
|
-
<td>${r7.method}</td>
|
|
59114
|
+
<td>${formatLabel(r7.method)}</td>
|
|
59090
59115
|
<td><code>${r7.cron}</code></td>
|
|
59091
59116
|
<td class="actions">
|
|
59092
59117
|
<button @click=${() => this._scheduleAction("enable", r7.photon, r7.method)}>
|
|
@@ -59109,7 +59134,7 @@ var DaemonPanel = class extends i4 {
|
|
|
59109
59134
|
<table>
|
|
59110
59135
|
<thead>
|
|
59111
59136
|
<tr>
|
|
59112
|
-
<th>
|
|
59137
|
+
<th>Location</th>
|
|
59113
59138
|
<th>Photon</th>
|
|
59114
59139
|
<th>Route</th>
|
|
59115
59140
|
<th>Method</th>
|
|
@@ -59124,7 +59149,7 @@ var DaemonPanel = class extends i4 {
|
|
|
59124
59149
|
<td>${tilde(r7.workingDir)}</td>
|
|
59125
59150
|
<td>${r7.photon}</td>
|
|
59126
59151
|
<td><code>${r7.route}</code></td>
|
|
59127
|
-
<td>${r7.method}</td>
|
|
59152
|
+
<td>${formatLabel(r7.method)}</td>
|
|
59128
59153
|
</tr>
|
|
59129
59154
|
`
|
|
59130
59155
|
)}
|
|
@@ -59141,7 +59166,7 @@ var DaemonPanel = class extends i4 {
|
|
|
59141
59166
|
<table>
|
|
59142
59167
|
<thead>
|
|
59143
59168
|
<tr>
|
|
59144
|
-
<th>
|
|
59169
|
+
<th>Location</th>
|
|
59145
59170
|
<th>Photon</th>
|
|
59146
59171
|
<th>Instances</th>
|
|
59147
59172
|
</tr>
|