mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-05 15:44:28 +00:00
feat(sandbox): default Network Sandbox to off and add settings toggle switch (#304)
This commit is contained in:
+3
@@ -472,6 +472,9 @@ export * from "./failed_to_update_sandbox_settings.js";
|
||||
export * from "./domain_already_exists.js";
|
||||
export * from "./network_sandbox.js";
|
||||
export * from "./network_sandbox_description.js";
|
||||
export * from "./enable_network_sandbox.js";
|
||||
export * from "./network_sandbox_enabled_description.js";
|
||||
export * from "./network_sandbox_disabled_notice.js";
|
||||
export * from "./add_domain.js";
|
||||
export * from "./allowed_domains.js";
|
||||
export * from "./no_custom_domains_allowed.js";
|
||||
|
||||
+3
@@ -474,6 +474,9 @@ export * from './failed_to_update_sandbox_settings.js'
|
||||
export * from './domain_already_exists.js'
|
||||
export * from './network_sandbox.js'
|
||||
export * from './network_sandbox_description.js'
|
||||
export * from './enable_network_sandbox.js'
|
||||
export * from './network_sandbox_enabled_description.js'
|
||||
export * from './network_sandbox_disabled_notice.js'
|
||||
export * from './add_domain.js'
|
||||
export * from './allowed_domains.js'
|
||||
export * from './no_custom_domains_allowed.js'
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Enable Network Sandbox" |
|
||||
*
|
||||
* @param {Enable_Network_SandboxInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const enable_network_sandbox: ((inputs?: Enable_Network_SandboxInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Enable_Network_SandboxInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type Enable_Network_SandboxInputs = {};
|
||||
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} Enable_Network_SandboxInputs */
|
||||
|
||||
const en_enable_network_sandbox = /** @type {(inputs: Enable_Network_SandboxInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`Enable Network Sandbox`)
|
||||
};
|
||||
|
||||
const zh_enable_network_sandbox = /** @type {(inputs: Enable_Network_SandboxInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`启用网络沙箱`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Enable Network Sandbox" |
|
||||
*
|
||||
* @param {Enable_Network_SandboxInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const enable_network_sandbox = /** @type {((inputs?: Enable_Network_SandboxInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Enable_Network_SandboxInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_enable_network_sandbox(inputs)
|
||||
return zh_enable_network_sandbox(inputs)
|
||||
});
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Configure allowed domains for the sandboxed agent. By default, only essential domains are allowed." |
|
||||
* | "Configure domain access controls for the sandboxed agent." |
|
||||
*
|
||||
* @param {Network_Sandbox_DescriptionInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
|
||||
@@ -6,17 +6,17 @@ import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
/** @typedef {{}} Network_Sandbox_DescriptionInputs */
|
||||
|
||||
const en_network_sandbox_description = /** @type {(inputs: Network_Sandbox_DescriptionInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`Configure allowed domains for the sandboxed agent. By default, only essential domains are allowed.`)
|
||||
return /** @type {LocalizedString} */ (`Configure domain access controls for the sandboxed agent.`)
|
||||
};
|
||||
|
||||
const zh_network_sandbox_description = /** @type {(inputs: Network_Sandbox_DescriptionInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`配置沙箱智能体的允许域名。默认情况下,仅允许必要域名。`)
|
||||
return /** @type {LocalizedString} */ (`配置沙箱智能体的域名访问控制。`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Configure allowed domains for the sandboxed agent. By default, only essential domains are allowed." |
|
||||
* | "Configure domain access controls for the sandboxed agent." |
|
||||
*
|
||||
* @param {Network_Sandbox_DescriptionInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Network Sandbox is currently OFF. All outbound network requests from agent scripts are permitted without restrictions." |
|
||||
*
|
||||
* @param {Network_Sandbox_Disabled_NoticeInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const network_sandbox_disabled_notice: ((inputs?: Network_Sandbox_Disabled_NoticeInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Network_Sandbox_Disabled_NoticeInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type Network_Sandbox_Disabled_NoticeInputs = {};
|
||||
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} Network_Sandbox_Disabled_NoticeInputs */
|
||||
|
||||
const en_network_sandbox_disabled_notice = /** @type {(inputs: Network_Sandbox_Disabled_NoticeInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`Network Sandbox is currently OFF. All outbound network requests from agent scripts are permitted without restrictions.`)
|
||||
};
|
||||
|
||||
const zh_network_sandbox_disabled_notice = /** @type {(inputs: Network_Sandbox_Disabled_NoticeInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`网络沙箱目前处于关闭状态。智能体脚本的所有出站网络请求均不受限制。`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "Network Sandbox is currently OFF. All outbound network requests from agent scripts are permitted without restrictions." |
|
||||
*
|
||||
* @param {Network_Sandbox_Disabled_NoticeInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const network_sandbox_disabled_notice = /** @type {((inputs?: Network_Sandbox_Disabled_NoticeInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Network_Sandbox_Disabled_NoticeInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_network_sandbox_disabled_notice(inputs)
|
||||
return zh_network_sandbox_disabled_notice(inputs)
|
||||
});
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "When enabled, network requests from the agent are restricted to allowed domains. When disabled, all network requests are permitted." |
|
||||
*
|
||||
* @param {Network_Sandbox_Enabled_DescriptionInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const network_sandbox_enabled_description: ((inputs?: Network_Sandbox_Enabled_DescriptionInputs, options?: {
|
||||
locale?: "en" | "zh";
|
||||
}) => LocalizedString) & import("../runtime.js").MessageMetadata<Network_Sandbox_Enabled_DescriptionInputs, {
|
||||
locale?: "en" | "zh";
|
||||
}, {}>;
|
||||
export type LocalizedString = import("../runtime.js").LocalizedString;
|
||||
export type Network_Sandbox_Enabled_DescriptionInputs = {};
|
||||
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
import { getLocale, experimentalStaticLocale } from '../runtime.js';
|
||||
|
||||
/** @typedef {import('../runtime.js').LocalizedString} LocalizedString */
|
||||
|
||||
/** @typedef {{}} Network_Sandbox_Enabled_DescriptionInputs */
|
||||
|
||||
const en_network_sandbox_enabled_description = /** @type {(inputs: Network_Sandbox_Enabled_DescriptionInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`When enabled, network requests from the agent are restricted to allowed domains. When disabled, all network requests are permitted.`)
|
||||
};
|
||||
|
||||
const zh_network_sandbox_enabled_description = /** @type {(inputs: Network_Sandbox_Enabled_DescriptionInputs) => LocalizedString} */ () => {
|
||||
return /** @type {LocalizedString} */ (`启用后,智能体的网络请求将受限于允许的域名列表。禁用时,允许所有网络请求。`)
|
||||
};
|
||||
|
||||
/**
|
||||
* | output |
|
||||
* | --- |
|
||||
* | "When enabled, network requests from the agent are restricted to allowed domains. When disabled, all network requests are permitted." |
|
||||
*
|
||||
* @param {Network_Sandbox_Enabled_DescriptionInputs} inputs
|
||||
* @param {{ locale?: "en" | "zh" }} options
|
||||
* @returns {LocalizedString}
|
||||
*/
|
||||
export const network_sandbox_enabled_description = /** @type {((inputs?: Network_Sandbox_Enabled_DescriptionInputs, options?: { locale?: "en" | "zh" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Network_Sandbox_Enabled_DescriptionInputs, { locale?: "en" | "zh" }, {}>} */ ((inputs = {}, options = {}) => {
|
||||
const locale = experimentalStaticLocale ?? options.locale ?? getLocale()
|
||||
if (locale === "en") return en_network_sandbox_enabled_description(inputs)
|
||||
return zh_network_sandbox_enabled_description(inputs)
|
||||
});
|
||||
Reference in New Issue
Block a user