@portel/photon 1.19.0 → 1.20.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/dist/auto-ui/beam/routes/api-browse.d.ts.map +1 -1
- package/dist/auto-ui/beam/routes/api-browse.js +16 -4
- package/dist/auto-ui/beam/routes/api-browse.js.map +1 -1
- package/dist/auto-ui/beam/routes/api-config.d.ts.map +1 -1
- package/dist/auto-ui/beam/routes/api-config.js +165 -24
- package/dist/auto-ui/beam/routes/api-config.js.map +1 -1
- package/dist/auto-ui/beam/routes/api-marketplace.d.ts.map +1 -1
- package/dist/auto-ui/beam/routes/api-marketplace.js +14 -1
- package/dist/auto-ui/beam/routes/api-marketplace.js.map +1 -1
- package/dist/auto-ui/beam.d.ts.map +1 -1
- package/dist/auto-ui/beam.js +187 -77
- package/dist/auto-ui/beam.js.map +1 -1
- package/dist/auto-ui/bridge/index.d.ts.map +1 -1
- package/dist/auto-ui/bridge/index.js +17 -0
- package/dist/auto-ui/bridge/index.js.map +1 -1
- package/dist/auto-ui/bridge/renderers.d.ts.map +1 -1
- package/dist/auto-ui/bridge/renderers.js +12 -4
- package/dist/auto-ui/bridge/renderers.js.map +1 -1
- package/dist/auto-ui/streamable-http-transport.d.ts +1 -0
- package/dist/auto-ui/streamable-http-transport.d.ts.map +1 -1
- package/dist/auto-ui/streamable-http-transport.js +179 -44
- package/dist/auto-ui/streamable-http-transport.js.map +1 -1
- package/dist/auto-ui/types.d.ts +12 -0
- package/dist/auto-ui/types.d.ts.map +1 -1
- package/dist/auto-ui/types.js.map +1 -1
- package/dist/beam-form.bundle.js +63 -185
- package/dist/beam-form.bundle.js.map +4 -4
- package/dist/beam.bundle.js +2115 -761
- package/dist/beam.bundle.js.map +4 -4
- package/dist/capability-negotiator.d.ts +67 -0
- package/dist/capability-negotiator.d.ts.map +1 -0
- package/dist/capability-negotiator.js +104 -0
- package/dist/capability-negotiator.js.map +1 -0
- package/dist/channel-manager.d.ts +122 -0
- package/dist/channel-manager.d.ts.map +1 -0
- package/dist/channel-manager.js +266 -0
- package/dist/channel-manager.js.map +1 -0
- package/dist/cli/commands/beam.d.ts.map +1 -1
- package/dist/cli/commands/beam.js +47 -30
- package/dist/cli/commands/beam.js.map +1 -1
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/build.js +27 -2
- package/dist/cli/commands/build.js.map +1 -1
- package/dist/cli/commands/daemon.d.ts.map +1 -1
- package/dist/cli/commands/daemon.js +12 -6
- package/dist/cli/commands/daemon.js.map +1 -1
- package/dist/cli/commands/mcp.d.ts.map +1 -1
- package/dist/cli/commands/mcp.js +18 -6
- package/dist/cli/commands/mcp.js.map +1 -1
- package/dist/cli/commands/package.d.ts.map +1 -1
- package/dist/cli/commands/package.js +25 -7
- package/dist/cli/commands/package.js.map +1 -1
- package/dist/cli/commands/serve.d.ts.map +1 -1
- package/dist/cli/commands/serve.js +14 -2
- package/dist/cli/commands/serve.js.map +1 -1
- package/dist/cli-alias.d.ts.map +1 -1
- package/dist/cli-alias.js +2 -3
- package/dist/cli-alias.js.map +1 -1
- package/dist/context-store.d.ts +4 -4
- package/dist/context-store.d.ts.map +1 -1
- package/dist/context-store.js +18 -15
- package/dist/context-store.js.map +1 -1
- package/dist/context.d.ts +25 -2
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +69 -4
- package/dist/context.js.map +1 -1
- package/dist/daemon/client.d.ts.map +1 -1
- package/dist/daemon/client.js +16 -1
- package/dist/daemon/client.js.map +1 -1
- package/dist/daemon/manager.d.ts +2 -0
- package/dist/daemon/manager.d.ts.map +1 -1
- package/dist/daemon/manager.js +40 -8
- package/dist/daemon/manager.js.map +1 -1
- package/dist/daemon/server.js +89 -64
- package/dist/daemon/server.js.map +1 -1
- package/dist/daemon/worker-host.js +7 -0
- package/dist/daemon/worker-host.js.map +1 -1
- package/dist/daemon/worker-manager.d.ts.map +1 -1
- package/dist/daemon/worker-manager.js +79 -17
- package/dist/daemon/worker-manager.js.map +1 -1
- package/dist/daemon/worker-protocol.d.ts +3 -0
- package/dist/daemon/worker-protocol.d.ts.map +1 -1
- package/dist/deploy/cloudflare.d.ts.map +1 -1
- package/dist/deploy/cloudflare.js +2 -4
- package/dist/deploy/cloudflare.js.map +1 -1
- package/dist/loader.d.ts +11 -1
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.js +129 -13
- package/dist/loader.js.map +1 -1
- package/dist/marketplace-manager.d.ts +7 -1
- package/dist/marketplace-manager.d.ts.map +1 -1
- package/dist/marketplace-manager.js +165 -61
- package/dist/marketplace-manager.js.map +1 -1
- package/dist/namespace-migration.d.ts +1 -0
- package/dist/namespace-migration.d.ts.map +1 -1
- package/dist/namespace-migration.js +86 -0
- package/dist/namespace-migration.js.map +1 -1
- package/dist/photon-cli-runner.d.ts.map +1 -1
- package/dist/photon-cli-runner.js +40 -21
- package/dist/photon-cli-runner.js.map +1 -1
- package/dist/photon-doc-extractor.d.ts.map +1 -1
- package/dist/photon-doc-extractor.js +59 -15
- package/dist/photon-doc-extractor.js.map +1 -1
- package/dist/resource-server.d.ts +105 -0
- package/dist/resource-server.d.ts.map +1 -0
- package/dist/resource-server.js +723 -0
- package/dist/resource-server.js.map +1 -0
- package/dist/serv/auth/jwt.d.ts +2 -0
- package/dist/serv/auth/jwt.d.ts.map +1 -1
- package/dist/serv/auth/jwt.js +11 -5
- package/dist/serv/auth/jwt.js.map +1 -1
- package/dist/serv/vault/token-vault.d.ts +2 -0
- package/dist/serv/vault/token-vault.d.ts.map +1 -1
- package/dist/serv/vault/token-vault.js +6 -0
- package/dist/serv/vault/token-vault.js.map +1 -1
- package/dist/server.d.ts +20 -149
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +246 -1233
- package/dist/server.js.map +1 -1
- package/dist/shared/audit.d.ts.map +1 -1
- package/dist/shared/audit.js +7 -0
- package/dist/shared/audit.js.map +1 -1
- package/dist/shared/security.d.ts +10 -0
- package/dist/shared/security.d.ts.map +1 -1
- package/dist/shared/security.js +27 -0
- package/dist/shared/security.js.map +1 -1
- package/dist/shared-utils.d.ts +4 -0
- package/dist/shared-utils.d.ts.map +1 -1
- package/dist/shared-utils.js +22 -0
- package/dist/shared-utils.js.map +1 -1
- package/dist/task-executor.d.ts +69 -0
- package/dist/task-executor.d.ts.map +1 -0
- package/dist/task-executor.js +182 -0
- package/dist/task-executor.js.map +1 -0
- package/dist/template-manager.d.ts.map +1 -1
- package/dist/template-manager.js +56 -234
- package/dist/template-manager.js.map +1 -1
- package/dist/types/photon-instance.d.ts +50 -0
- package/dist/types/photon-instance.d.ts.map +1 -0
- package/dist/types/photon-instance.js +9 -0
- package/dist/types/photon-instance.js.map +1 -0
- package/dist/types/server-types.d.ts +61 -0
- package/dist/types/server-types.d.ts.map +1 -0
- package/dist/types/server-types.js +8 -0
- package/dist/types/server-types.js.map +1 -0
- package/package.json +3 -3
package/dist/beam-form.bundle.js
CHANGED
|
@@ -1787,187 +1787,24 @@ function showToast(message, type = "info", duration = 3e3, action) {
|
|
|
1787
1787
|
ToastManager.show(message, type, duration, action);
|
|
1788
1788
|
}
|
|
1789
1789
|
|
|
1790
|
-
// src/auto-ui/frontend/
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
});
|
|
1809
|
-
}
|
|
1810
|
-
_handleConfirm() {
|
|
1811
|
-
this.open = false;
|
|
1812
|
-
this._resolve?.(true);
|
|
1813
|
-
}
|
|
1814
|
-
_handleCancel() {
|
|
1815
|
-
this.open = false;
|
|
1816
|
-
this._resolve?.(false);
|
|
1817
|
-
}
|
|
1818
|
-
_handleKeydown(e5) {
|
|
1819
|
-
if (e5.key === "Escape") this._handleCancel();
|
|
1820
|
-
if (e5.key === "Enter") this._handleConfirm();
|
|
1821
|
-
}
|
|
1822
|
-
render() {
|
|
1823
|
-
return b2`
|
|
1824
|
-
<div class="dialog" @keydown=${(e5) => this._handleKeydown(e5)}>
|
|
1825
|
-
<div class="message">${this.message}</div>
|
|
1826
|
-
<div class="actions">
|
|
1827
|
-
<button class="btn-cancel" @click=${() => this._handleCancel()}>
|
|
1828
|
-
${this.cancelLabel}
|
|
1829
|
-
</button>
|
|
1830
|
-
<button
|
|
1831
|
-
class="btn-confirm ${this.destructive ? "destructive" : ""}"
|
|
1832
|
-
@click=${() => this._handleConfirm()}
|
|
1833
|
-
>
|
|
1834
|
-
${this.confirmLabel}
|
|
1835
|
-
</button>
|
|
1836
|
-
</div>
|
|
1837
|
-
</div>
|
|
1838
|
-
`;
|
|
1839
|
-
}
|
|
1840
|
-
};
|
|
1841
|
-
ConfirmDialog.styles = [
|
|
1842
|
-
theme,
|
|
1843
|
-
i`
|
|
1844
|
-
:host {
|
|
1845
|
-
display: none;
|
|
1846
|
-
}
|
|
1847
|
-
|
|
1848
|
-
@keyframes backdrop-in {
|
|
1849
|
-
from {
|
|
1850
|
-
opacity: 0;
|
|
1851
|
-
}
|
|
1852
|
-
to {
|
|
1853
|
-
opacity: 1;
|
|
1854
|
-
}
|
|
1855
|
-
}
|
|
1856
|
-
|
|
1857
|
-
@keyframes content-in {
|
|
1858
|
-
from {
|
|
1859
|
-
opacity: 0;
|
|
1860
|
-
transform: scale(0.95) translateY(8px);
|
|
1861
|
-
}
|
|
1862
|
-
to {
|
|
1863
|
-
opacity: 1;
|
|
1864
|
-
transform: scale(1) translateY(0);
|
|
1865
|
-
}
|
|
1866
|
-
}
|
|
1867
|
-
|
|
1868
|
-
:host([open]) {
|
|
1869
|
-
display: flex;
|
|
1870
|
-
position: fixed;
|
|
1871
|
-
inset: 0;
|
|
1872
|
-
background: rgba(0, 0, 0, 0.6);
|
|
1873
|
-
backdrop-filter: blur(4px);
|
|
1874
|
-
z-index: 10001;
|
|
1875
|
-
align-items: center;
|
|
1876
|
-
justify-content: center;
|
|
1877
|
-
animation: backdrop-in 0.15s ease-out both;
|
|
1878
|
-
}
|
|
1879
|
-
|
|
1880
|
-
.dialog {
|
|
1881
|
-
background: var(--bg-panel);
|
|
1882
|
-
border: 1px solid var(--border-glass);
|
|
1883
|
-
border-radius: var(--radius-md, 12px);
|
|
1884
|
-
padding: 24px;
|
|
1885
|
-
max-width: 400px;
|
|
1886
|
-
width: 90%;
|
|
1887
|
-
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
|
|
1888
|
-
animation: content-in 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
|
|
1889
|
-
animation-delay: 0.05s;
|
|
1890
|
-
}
|
|
1891
|
-
|
|
1892
|
-
.message {
|
|
1893
|
-
font-size: 14px;
|
|
1894
|
-
line-height: 1.5;
|
|
1895
|
-
color: var(--t-primary);
|
|
1896
|
-
margin-bottom: 20px;
|
|
1897
|
-
}
|
|
1898
|
-
|
|
1899
|
-
.actions {
|
|
1900
|
-
display: flex;
|
|
1901
|
-
justify-content: flex-end;
|
|
1902
|
-
gap: 8px;
|
|
1903
|
-
}
|
|
1904
|
-
|
|
1905
|
-
button {
|
|
1906
|
-
padding: 8px 16px;
|
|
1907
|
-
border-radius: var(--radius-sm, 6px);
|
|
1908
|
-
font-size: 13px;
|
|
1909
|
-
font-weight: 500;
|
|
1910
|
-
cursor: pointer;
|
|
1911
|
-
transition: all 0.15s ease;
|
|
1912
|
-
font-family: inherit;
|
|
1913
|
-
border: none;
|
|
1914
|
-
}
|
|
1915
|
-
|
|
1916
|
-
.btn-cancel {
|
|
1917
|
-
background: var(--bg-glass);
|
|
1918
|
-
color: var(--t-primary);
|
|
1919
|
-
border: 1px solid var(--border-glass);
|
|
1920
|
-
}
|
|
1921
|
-
|
|
1922
|
-
.btn-cancel:hover {
|
|
1923
|
-
background: var(--bg-glass-strong);
|
|
1924
|
-
}
|
|
1925
|
-
|
|
1926
|
-
.btn-confirm {
|
|
1927
|
-
background: var(--accent);
|
|
1928
|
-
color: #fff;
|
|
1929
|
-
}
|
|
1930
|
-
|
|
1931
|
-
.btn-confirm:hover {
|
|
1932
|
-
opacity: 0.9;
|
|
1933
|
-
}
|
|
1934
|
-
|
|
1935
|
-
.btn-confirm.destructive {
|
|
1936
|
-
background: hsl(0, 60%, 50%);
|
|
1937
|
-
}
|
|
1938
|
-
|
|
1939
|
-
.btn-confirm.destructive:hover {
|
|
1940
|
-
background: hsl(0, 60%, 45%);
|
|
1941
|
-
}
|
|
1942
|
-
`
|
|
1943
|
-
];
|
|
1944
|
-
__decorateClass([
|
|
1945
|
-
n4({ type: Boolean, reflect: true })
|
|
1946
|
-
], ConfirmDialog.prototype, "open", 2);
|
|
1947
|
-
__decorateClass([
|
|
1948
|
-
n4({ type: String })
|
|
1949
|
-
], ConfirmDialog.prototype, "message", 2);
|
|
1950
|
-
__decorateClass([
|
|
1951
|
-
n4({ type: String })
|
|
1952
|
-
], ConfirmDialog.prototype, "confirmLabel", 2);
|
|
1953
|
-
__decorateClass([
|
|
1954
|
-
n4({ type: String })
|
|
1955
|
-
], ConfirmDialog.prototype, "cancelLabel", 2);
|
|
1956
|
-
__decorateClass([
|
|
1957
|
-
n4({ type: Boolean })
|
|
1958
|
-
], ConfirmDialog.prototype, "destructive", 2);
|
|
1959
|
-
ConfirmDialog = __decorateClass([
|
|
1960
|
-
t3("confirm-dialog")
|
|
1961
|
-
], ConfirmDialog);
|
|
1962
|
-
async function confirmDialog(message, options) {
|
|
1963
|
-
const beamApp = document.querySelector("beam-app");
|
|
1964
|
-
const root = beamApp?.shadowRoot ?? document.body;
|
|
1965
|
-
let dialog = root.querySelector("confirm-dialog");
|
|
1966
|
-
if (!dialog) {
|
|
1967
|
-
dialog = document.createElement("confirm-dialog");
|
|
1968
|
-
root.appendChild(dialog);
|
|
1969
|
-
}
|
|
1970
|
-
return dialog.show(message, options);
|
|
1790
|
+
// src/auto-ui/frontend/utils/elicit.ts
|
|
1791
|
+
function elicit(data) {
|
|
1792
|
+
return new Promise((resolve) => {
|
|
1793
|
+
document.dispatchEvent(
|
|
1794
|
+
new CustomEvent("beam:elicit-local", {
|
|
1795
|
+
detail: { data, resolve }
|
|
1796
|
+
})
|
|
1797
|
+
);
|
|
1798
|
+
});
|
|
1799
|
+
}
|
|
1800
|
+
async function confirmElicit(message, options) {
|
|
1801
|
+
const result = await elicit({
|
|
1802
|
+
ask: "confirm",
|
|
1803
|
+
message,
|
|
1804
|
+
default: false,
|
|
1805
|
+
...options?.confirm && { placeholder: options.confirm }
|
|
1806
|
+
});
|
|
1807
|
+
return result.action === "accept" && result.value !== false;
|
|
1971
1808
|
}
|
|
1972
1809
|
|
|
1973
1810
|
// src/auto-ui/frontend/utils/format-label.ts
|
|
@@ -2116,6 +1953,7 @@ var InvokeForm = class extends i4 {
|
|
|
2116
1953
|
this.methodName = "";
|
|
2117
1954
|
this.rememberValues = false;
|
|
2118
1955
|
this.sharedValues = null;
|
|
1956
|
+
this.settingsLayout = false;
|
|
2119
1957
|
this._values = {};
|
|
2120
1958
|
this._initialValues = {};
|
|
2121
1959
|
this._passwordVisible = {};
|
|
@@ -2221,12 +2059,13 @@ var InvokeForm = class extends i4 {
|
|
|
2221
2059
|
const result = await mcpClient.callTool(`${this.photonName}/${toolName}`, {});
|
|
2222
2060
|
let values = [];
|
|
2223
2061
|
let data = result;
|
|
2224
|
-
|
|
2225
|
-
|
|
2062
|
+
const mcpResult = result;
|
|
2063
|
+
if (result && Array.isArray(mcpResult.content)) {
|
|
2064
|
+
if (mcpResult.isError) {
|
|
2226
2065
|
hasUnresolved = true;
|
|
2227
2066
|
continue;
|
|
2228
2067
|
}
|
|
2229
|
-
const textBlock =
|
|
2068
|
+
const textBlock = mcpResult.content.find((c4) => c4.type === "text");
|
|
2230
2069
|
if (textBlock?.text) {
|
|
2231
2070
|
try {
|
|
2232
2071
|
data = JSON.parse(textBlock.text);
|
|
@@ -2326,6 +2165,42 @@ var InvokeForm = class extends i4 {
|
|
|
2326
2165
|
const isRequired = Array.isArray(requiredList) ? requiredList.includes(key) : !!schema.required;
|
|
2327
2166
|
const error = this._errors[key];
|
|
2328
2167
|
const inputId = `field-${key}`;
|
|
2168
|
+
if (this.settingsLayout) {
|
|
2169
|
+
const isBoolean = schema.type === "boolean" || schema.type === '"boolean"';
|
|
2170
|
+
return b2`
|
|
2171
|
+
<div
|
|
2172
|
+
style="display: grid; grid-template-columns: 200px 1fr; border-bottom: 1px solid var(--border-glass); min-height: 48px;"
|
|
2173
|
+
>
|
|
2174
|
+
<div
|
|
2175
|
+
style="padding: 12px var(--space-md); display: flex; flex-direction: column; justify-content: center; background: var(--bg-glass);"
|
|
2176
|
+
>
|
|
2177
|
+
<label
|
|
2178
|
+
for=${inputId}
|
|
2179
|
+
style="font-size: var(--text-sm); font-weight: 600; color: var(--t-primary); margin: 0;"
|
|
2180
|
+
>
|
|
2181
|
+
${formatLabel(key)}
|
|
2182
|
+
</label>
|
|
2183
|
+
${schema.description ? b2`<span
|
|
2184
|
+
style="font-size: var(--text-2xs); color: var(--t-muted); margin-top: 2px; line-height: 1.3;"
|
|
2185
|
+
>${this._cleanDescription(schema.description, schema)}</span
|
|
2186
|
+
>` : ""}
|
|
2187
|
+
</div>
|
|
2188
|
+
<div
|
|
2189
|
+
style="padding: ${isBoolean ? "8px" : "6px"} var(--space-md); display: flex; align-items: center;"
|
|
2190
|
+
>
|
|
2191
|
+
${this._renderInput(key, schema, !!error, inputId)}
|
|
2192
|
+
${error ? b2`<div
|
|
2193
|
+
class="error-text"
|
|
2194
|
+
style="margin-left: 8px;"
|
|
2195
|
+
id="${inputId}-error"
|
|
2196
|
+
role="alert"
|
|
2197
|
+
>
|
|
2198
|
+
${error}
|
|
2199
|
+
</div>` : ""}
|
|
2200
|
+
</div>
|
|
2201
|
+
</div>
|
|
2202
|
+
`;
|
|
2203
|
+
}
|
|
2329
2204
|
return b2`
|
|
2330
2205
|
<div class="form-group">
|
|
2331
2206
|
<label for=${inputId}>
|
|
@@ -3562,7 +3437,7 @@ var InvokeForm = class extends i4 {
|
|
|
3562
3437
|
}
|
|
3563
3438
|
/** Cancel with dirty check. Called by parent chrome wrapper. */
|
|
3564
3439
|
async handleCancel() {
|
|
3565
|
-
if (this.isDirty && !await
|
|
3440
|
+
if (this.isDirty && !await confirmElicit("You have unsaved changes. Discard them?", {
|
|
3566
3441
|
confirm: "Discard",
|
|
3567
3442
|
destructive: true
|
|
3568
3443
|
})) {
|
|
@@ -4130,6 +4005,9 @@ __decorateClass([
|
|
|
4130
4005
|
__decorateClass([
|
|
4131
4006
|
n4({ type: Object })
|
|
4132
4007
|
], InvokeForm.prototype, "sharedValues", 2);
|
|
4008
|
+
__decorateClass([
|
|
4009
|
+
n4({ type: Boolean })
|
|
4010
|
+
], InvokeForm.prototype, "settingsLayout", 2);
|
|
4133
4011
|
__decorateClass([
|
|
4134
4012
|
r5()
|
|
4135
4013
|
], InvokeForm.prototype, "_values", 2);
|