dsh-edge 0.1.1 → 0.1.3
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.i18n.yaml +2 -2
- package/README.md +4 -4
- package/README.zh.md +4 -4
- package/THIRD_PARTY_NOTICES.md +2 -2
- package/dist/index.html +1 -1
- package/dist/plugins/@deepseek-ai/dsh-client-locale/client.js +4 -4
- package/dist/plugins/@deepseek-ai/dsh-client-ui-agent-preset/client.js +35 -35
- package/dist/plugins/@deepseek-ai/dsh-client-ui-commands/client.js +8 -8
- package/dist/plugins/@deepseek-ai/dsh-client-ui-conversation/client.js +164 -164
- package/dist/plugins/@deepseek-ai/dsh-client-ui-deliverables/client.js +6 -6
- package/dist/plugins/@deepseek-ai/dsh-client-ui-input-trigger/client.js +7 -7
- package/dist/plugins/@deepseek-ai/dsh-client-ui-jobs/client.js +9 -9
- package/dist/plugins/@deepseek-ai/dsh-client-ui-layout/client.js +4 -4
- package/dist/plugins/@deepseek-ai/dsh-client-ui-model-selection/client.js +20 -20
- package/dist/plugins/@deepseek-ai/dsh-client-ui-permission-presets/client.js +3 -3
- package/dist/plugins/@deepseek-ai/dsh-client-ui-settings-general/client.js +15 -15
- package/dist/plugins/@deepseek-ai/dsh-client-ui-sidebar/client.js +13 -13
- package/dist/plugins/@deepseek-ai/dsh-client-ui-skill/client.js +11 -11
- package/dist/plugins/@deepseek-ai/dsh-client-ui-subagent/client.js +17 -17
- package/dist/plugins/@deepseek-ai/dsh-client-ui-theme/client.js +4 -4
- package/dist/plugins/@deepseek-ai/dsh-client-ui-tool/client.js +37 -37
- package/dist/plugins/@deepseek-ai/dsh-client-ui-trajectory/client.js +142 -142
- package/dist/plugins/@deepseek-ai/dsh-client-ui-user-questions/client.js +26 -26
- package/dist/plugins/@deepseek-ai/dsh-client-ui-workflow-run/client.js +14 -14
- package/dist/plugins/@deepseek-ai/dsh-client-ui-workspace/client.js +54 -54
- package/dist/plugins/dsh-edge-client-ui/client.js +5 -5
- package/package.json +18 -17
- package/scripts/bundle.mjs +41 -8
- package/scripts/cli.d.mts +1 -0
- package/scripts/cli.mjs +37 -6
- package/scripts/install.d.mts +6 -6
- package/scripts/install.mjs +36 -19
- package/scripts/smoke-installed.mjs +47 -0
- package/scripts/verify-packed.mjs +11 -2
- package/scripts/wrangler-config.d.mts +19 -2
- package/scripts/wrangler-config.mjs +68 -27
- package/worker/direct/index.js +2347 -0
- package/worker/isolated/index.js +44491 -0
- package/src/agent.ts +0 -119
- package/src/auth.ts +0 -352
- package/src/deepseek.ts +0 -231
- package/src/deployment.ts +0 -147
- package/src/direct-shell-core-empty.ts +0 -10
- package/src/direct-shell-protocol.ts +0 -5
- package/src/direct-shell.ts +0 -341
- package/src/do-session-persistence.ts +0 -1064
- package/src/edge-api.ts +0 -796
- package/src/edge-credentials.ts +0 -56
- package/src/edge-remotes.ts +0 -41
- package/src/edge-workspace-store.ts +0 -339
- package/src/http.ts +0 -212
- package/src/index.ts +0 -196
- package/src/instance.ts +0 -1007
- package/src/isolated-direct-shell-unavailable.ts +0 -11
- package/src/protocol.ts +0 -39
- package/src/release.ts +0 -9
- package/src/session-store.ts +0 -1110
- package/src/sse.ts +0 -86
- package/src/web-search.ts +0 -38
- package/src/workspace.ts +0 -270
|
@@ -10,11 +10,76 @@ const DIRECT_SHELL_CORE_REPLACEMENT = 'src/direct-shell-core-empty.ts'
|
|
|
10
10
|
const ISOLATED_DIRECT_SHELL = './direct-shell.ts'
|
|
11
11
|
const ISOLATED_DIRECT_SHELL_REPLACEMENT = 'src/isolated-direct-shell-unavailable.ts'
|
|
12
12
|
const RESERVED_ALIASES = new Set([DIRECT_SHELL_CORE, ISOLATED_DIRECT_SHELL])
|
|
13
|
+
const WORKER_ARTIFACTS = Object.freeze({
|
|
14
|
+
direct: 'worker/direct/index.js',
|
|
15
|
+
isolated: 'worker/isolated/index.js',
|
|
16
|
+
})
|
|
13
17
|
|
|
14
|
-
/** Render one
|
|
15
|
-
export function
|
|
18
|
+
/** Render one mode-specific build configuration from the repository source. */
|
|
19
|
+
export function renderSourceModeWranglerConfig(mode, source, options = {}) {
|
|
16
20
|
requireRuntimeMode(mode)
|
|
17
21
|
const root = options.appDirectory ?? appDirectory
|
|
22
|
+
const parsed = parseSourceConfig(source)
|
|
23
|
+
const config = structuredClone(parsed)
|
|
24
|
+
delete config.$schema
|
|
25
|
+
config.main = resolve(root, parsed.main)
|
|
26
|
+
config.assets.directory = resolve(root, parsed.assets.directory)
|
|
27
|
+
config.minify = true
|
|
28
|
+
if (mode === 'direct') {
|
|
29
|
+
config.alias = {
|
|
30
|
+
...config.alias,
|
|
31
|
+
[DIRECT_SHELL_CORE]: resolve(root, DIRECT_SHELL_CORE_REPLACEMENT),
|
|
32
|
+
}
|
|
33
|
+
} else {
|
|
34
|
+
config.alias = {
|
|
35
|
+
...config.alias,
|
|
36
|
+
[ISOLATED_DIRECT_SHELL]: resolve(root, ISOLATED_DIRECT_SHELL_REPLACEMENT),
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return `${JSON.stringify(config, undefined, 2)}\n`
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** Render an upload configuration that deploys the released Worker without rebuilding it. */
|
|
43
|
+
export function renderPrebuiltModeWranglerConfig(mode, source, options = {}) {
|
|
44
|
+
requireRuntimeMode(mode)
|
|
45
|
+
const root = options.appDirectory ?? appDirectory
|
|
46
|
+
const parsed = parseSourceConfig(source)
|
|
47
|
+
const config = structuredClone(parsed)
|
|
48
|
+
delete config.$schema
|
|
49
|
+
delete config.alias
|
|
50
|
+
delete config.minify
|
|
51
|
+
config.main = resolve(root, WORKER_ARTIFACTS[mode])
|
|
52
|
+
config.assets.directory = resolve(root, parsed.assets.directory)
|
|
53
|
+
config.no_bundle = true
|
|
54
|
+
config.find_additional_modules = false
|
|
55
|
+
return `${JSON.stringify(config, undefined, 2)}\n`
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** Write the source configuration used to build one released Worker artifact. */
|
|
59
|
+
export async function writeSourceModeWranglerConfig(mode, destination, options = {}) {
|
|
60
|
+
const source = await readFile(options.sourceConfigPath ?? sourceConfigPath, 'utf8')
|
|
61
|
+
const rendered = renderSourceModeWranglerConfig(mode, source, options)
|
|
62
|
+
await writePrivateConfig(destination, rendered)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** Write the private no-bundle configuration used by one installation attempt. */
|
|
66
|
+
export async function writePrebuiltModeWranglerConfig(mode, destination, options = {}) {
|
|
67
|
+
const source = await readFile(options.sourceConfigPath ?? sourceConfigPath, 'utf8')
|
|
68
|
+
const rendered = renderPrebuiltModeWranglerConfig(mode, source, options)
|
|
69
|
+
await writePrivateConfig(destination, rendered)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** Return the released entrypoint for a runtime mode. */
|
|
73
|
+
export function workerArtifactPath(mode, options = {}) {
|
|
74
|
+
requireRuntimeMode(mode)
|
|
75
|
+
return resolve(options.appDirectory ?? appDirectory, WORKER_ARTIFACTS[mode])
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
async function writePrivateConfig(destination, rendered) {
|
|
79
|
+
await writeFile(destination, rendered, { encoding: 'utf8', mode: 0o600, flag: 'wx' })
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function parseSourceConfig(source) {
|
|
18
83
|
const errors = []
|
|
19
84
|
const parsed = parse(source, errors, {
|
|
20
85
|
allowEmptyContent: false,
|
|
@@ -42,31 +107,7 @@ export function renderModeWranglerConfig(mode, source, options = {}) {
|
|
|
42
107
|
if (reservedAlias !== undefined) {
|
|
43
108
|
throw new Error(`wrangler.jsonc reserves the ${reservedAlias} alias for mode builds.`)
|
|
44
109
|
}
|
|
45
|
-
|
|
46
|
-
const config = structuredClone(parsed)
|
|
47
|
-
delete config.$schema
|
|
48
|
-
config.main = resolve(root, parsed.main)
|
|
49
|
-
config.assets.directory = resolve(root, parsed.assets.directory)
|
|
50
|
-
config.minify = true
|
|
51
|
-
if (mode === 'direct') {
|
|
52
|
-
config.alias = {
|
|
53
|
-
...config.alias,
|
|
54
|
-
[DIRECT_SHELL_CORE]: resolve(root, DIRECT_SHELL_CORE_REPLACEMENT),
|
|
55
|
-
}
|
|
56
|
-
} else {
|
|
57
|
-
config.alias = {
|
|
58
|
-
...config.alias,
|
|
59
|
-
[ISOLATED_DIRECT_SHELL]: resolve(root, ISOLATED_DIRECT_SHELL_REPLACEMENT),
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
return `${JSON.stringify(config, undefined, 2)}\n`
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/** Write the private Wrangler configuration used by one installation attempt. */
|
|
66
|
-
export async function writeModeWranglerConfig(mode, destination, options = {}) {
|
|
67
|
-
const source = await readFile(options.sourceConfigPath ?? sourceConfigPath, 'utf8')
|
|
68
|
-
const rendered = renderModeWranglerConfig(mode, source, options)
|
|
69
|
-
await writeFile(destination, rendered, { encoding: 'utf8', mode: 0o600, flag: 'wx' })
|
|
110
|
+
return parsed
|
|
70
111
|
}
|
|
71
112
|
|
|
72
113
|
function requireRuntimeMode(mode) {
|