@toddzheng024/dscode-bundle 0.7.26 → 0.7.28
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/THIRD_PARTY_NOTICES.md +10 -10
- package/bootstrap.mjs +1 -1
- package/cordis.patch.yml +418 -45
- package/package.json +279 -245
- package/plugins/auto-review/index.mjs +8 -5
- package/plugins/code-review/index.mjs +1 -1
- package/plugins/computer-use/index.mjs +37 -0
- package/plugins/cordis-config/plain.mjs +31 -0
- package/plugins/exec/cli.mjs +1 -1
- package/plugins/grok/index.mjs +28 -24
- package/plugins/memory/index.mjs +1 -1
- package/plugins/message-source/kind.mjs +20 -0
- package/plugins/openrouter/adapter.mjs +29 -13
- package/plugins/openrouter/index.mjs +31 -28
- package/plugins/session-bridge/communication.mjs +6 -3
- package/plugins/session-bridge/server.mjs +3 -2
- package/plugins/session-bridge/tasks.mjs +3 -1
- package/plugins/session-cards/index.mjs +1 -1
- package/plugins/time-marks/index.mjs +3 -2
- package/plugins/time-marks/marks.mjs +6 -5
- package/plugins/triggers/config.mjs +1 -1
- package/plugins/triggers/tools.mjs +1 -1
- package/plugins/tui-tools/doctor.mjs +1 -1
- package/plugins/tui-tools/index.mjs +16 -4
- package/plugins/ultra/policy.mjs +16 -0
- package/vendor/bash/index.js +455 -186
- package/vendor/bash/types/background.d.ts +38 -7
- package/vendor/bash/types/index.d.ts +20 -4
- package/vendor/bash/types/render.d.ts +28 -9
- package/vendor/command-goal/index.js +3 -1
- package/vendor/deepseek/index.js +1378 -1246
- package/vendor/deepseek/types/adapter.d.ts +16 -155
- package/vendor/deepseek/types/config.d.ts +127 -0
- package/vendor/deepseek/types/defaults.d.ts +24 -0
- package/vendor/deepseek/types/file-store.d.ts +5 -3
- package/vendor/deepseek/types/files-api.d.ts +12 -9
- package/vendor/deepseek/types/image-tokens.d.ts +24 -9
- package/vendor/deepseek/types/images.d.ts +35 -0
- package/vendor/deepseek/types/index.d.ts +10 -94
- package/vendor/deepseek/types/messages-api.d.ts +10 -0
- package/vendor/deepseek/types/model-info.d.ts +16 -0
- package/vendor/deepseek/types/models.d.ts +4 -0
- package/vendor/deepseek/types/replay.d.ts +27 -0
- package/vendor/deepseek/types/request-extensions.d.ts +16 -0
- package/vendor/deepseek/types/request-files.d.ts +49 -0
- package/vendor/deepseek/types/request-pricing.d.ts +32 -20
- package/vendor/deepseek/types/serialize.d.ts +17 -82
- package/vendor/deepseek/types/sse.d.ts +6 -22
- package/vendor/deepseek/types/translate.d.ts +13 -36
- package/vendor/deepseek/types/transport.d.ts +15 -0
- package/vendor/deepseek/types/types.d.ts +106 -167
- package/vendor/deepseek/types/wire-types.d.ts +62 -0
- package/vendor/persistent/index.js +9 -3
- package/vendor/subagent/index.js +11 -8
- package/vendor/subagent/model-selection-settings.js +12 -38
- package/vendor/subagent/types/index.d.ts +4 -3
- package/vendor/subagent/types/model-selection-settings.d.ts +12 -10
- package/vendor/subagent-core/index.js +401 -264
- package/vendor/subagent-core/typert.host.js +103 -113
- package/vendor/subagent-core/typert.remote-client.d.ts +1 -3
- package/vendor/subagent-core/typert.remote-client.js +23 -69
- package/vendor/subagent-core/types/archive-admission.d.ts +16 -0
- package/vendor/subagent-core/types/archive-admission.js +151 -0
- package/vendor/subagent-core/types/assistant-output.d.ts +2 -2
- package/vendor/subagent-core/types/catalog.d.ts +17 -10
- package/vendor/subagent-core/types/catalog.js +12 -6
- package/vendor/subagent-core/types/child-agent.d.ts +8 -5
- package/vendor/subagent-core/types/child-agent.js +11 -5
- package/vendor/subagent-core/types/continuation-activation.d.ts +17 -1
- package/vendor/subagent-core/types/continuation-activation.js +41 -4
- package/vendor/subagent-core/types/continuation-messages.d.ts +1 -1
- package/vendor/subagent-core/types/continuation-messages.js +7 -3
- package/vendor/subagent-core/types/continuation.d.ts +1 -1
- package/vendor/subagent-core/types/continuation.js +2 -2
- package/vendor/subagent-core/types/control-types.d.ts +29 -36
- package/vendor/subagent-core/types/control-types.js +2 -3
- package/vendor/subagent-core/types/control.d.ts +2 -28
- package/vendor/subagent-core/types/control.js +3 -40
- package/vendor/subagent-core/types/index.d.ts +45 -41
- package/vendor/subagent-core/types/index.js +46 -82
- package/vendor/subagent-core/types/internal.d.ts +2 -2
- package/vendor/subagent-core/types/internal.js +2 -2
- package/vendor/subagent-core/types/lifecycle.d.ts +1 -1
- package/vendor/subagent-core/types/lifecycle.js +5 -3
- package/vendor/subagent-core/types/list-children.d.ts +15 -32
- package/vendor/subagent-core/types/list-children.js +45 -49
- package/vendor/subagent-core/types/out-of-process.d.ts +1 -1
- package/vendor/subagent-core/types/projection-types.d.ts +9 -1
- package/vendor/subagent-core/types/projection.d.ts +5 -0
- package/vendor/subagent-core/types/projection.js +10 -4
- package/vendor/subagent-core/types/run-settlement.js +1 -1
- package/vendor/subagent-core/types/types.d.ts +2 -2
- package/vendor/terminal/index.js +94 -30
- package/vendor/tui/lib/index.mjs +2 -1
- package/vendor/tui/lib/kernel-panels.mjs +1 -1
- package/vendor/tui/lib/render/projection.mjs +50 -36
- package/presets/dscode/agent.cordis.yml +0 -321
- package/presets/dscode/preset.yml +0 -3
|
@@ -6,9 +6,10 @@ import { readFile, readdir, access, stat } from 'node:fs/promises';
|
|
|
6
6
|
import { dirname, join, resolve } from 'node:path';
|
|
7
7
|
import { parse } from 'yaml';
|
|
8
8
|
import { createUserMessage } from '@deepseek-ai/dsh-llm';
|
|
9
|
-
import { standingMountFor } from '@deepseek-ai/dsh-agent-
|
|
9
|
+
import { standingMountFor } from '@deepseek-ai/dsh-agent-preset-registry';
|
|
10
10
|
import { hookEvents, validateHooks } from './hooks.mjs';
|
|
11
11
|
import { redact } from '../auto-review/policy.mjs';
|
|
12
|
+
import { plainConfig } from '../cordis-config/plain.mjs';
|
|
12
13
|
import { analyzeDoctorEvidence, collectDoctorEvidence, recordRuntimeLog } from './doctor.mjs';
|
|
13
14
|
|
|
14
15
|
export const name = 'dscode-tui-tools';
|
|
@@ -19,6 +20,14 @@ const fail = text => ({ kind: 'error', text });
|
|
|
19
20
|
const show = value => typeof value === 'string' ? value : JSON.stringify(value ?? null);
|
|
20
21
|
const exists = path => access(path).then(() => true, () => false);
|
|
21
22
|
|
|
23
|
+
/** Ancestor skill roots the preset's own expression reads, for a reader that cannot evaluate it. */
|
|
24
|
+
function ancestorDirsFrom(env) {
|
|
25
|
+
try {
|
|
26
|
+
const parsed = JSON.parse(env.DSCODE_SKILL_ANCESTOR_DIRS ?? '[]');
|
|
27
|
+
return Array.isArray(parsed) ? parsed : [];
|
|
28
|
+
} catch { return []; }
|
|
29
|
+
}
|
|
30
|
+
|
|
22
31
|
export async function findConflicts(cwd, configs, winners, env = process.env) {
|
|
23
32
|
let project = resolve(cwd);
|
|
24
33
|
while (!await exists(join(project, '.git')) && dirname(project) !== project) project = dirname(project);
|
|
@@ -33,7 +42,10 @@ export async function findConflicts(cwd, configs, winners, env = process.env) {
|
|
|
33
42
|
if (typeof dshHome === 'string') { const path = resolve(dshHome, 'skills'); roots.push(path); skipSystemRoots.add(path); }
|
|
34
43
|
if (typeof agentsHome === 'string') roots.push(resolve(agentsHome, 'skills'));
|
|
35
44
|
}
|
|
36
|
-
roots
|
|
45
|
+
// A preset declares its ancestor roots as a `!!js` expression over this variable, which
|
|
46
|
+
// a reader of the row cannot evaluate; the environment it reads is the same here.
|
|
47
|
+
const custom = Array.isArray(config.customSkillDirs) ? config.customSkillDirs : ancestorDirsFrom(env);
|
|
48
|
+
roots.push(...custom.filter(x => typeof x === 'string').map(x => resolve(x)));
|
|
37
49
|
const bundled = config.bundledSkillDir ?? (config.includeDefaultRoots !== false ? env.DSH_BUNDLED_SKILL_DIR : undefined);
|
|
38
50
|
if (typeof bundled === 'string') roots.push(resolve(bundled));
|
|
39
51
|
}
|
|
@@ -107,7 +119,7 @@ export function apply(ctx) {
|
|
|
107
119
|
// are handed to the agent, which then gets a turn to react to them.
|
|
108
120
|
const handover = redact(`[shell] $ ${rawInput.trim()}\n${result.text}`).slice(0, 8000);
|
|
109
121
|
try {
|
|
110
|
-
agent.followup(createUserMessage({ content: [{ type: 'text', text: handover }], source: { kind: '
|
|
122
|
+
agent.followup(createUserMessage({ content: [{ type: 'text', text: handover }], source: { kind: 'dscode-shell-exec' } }));
|
|
111
123
|
await ctx.get('sessions')?.flush?.(agent.session);
|
|
112
124
|
} catch (error) {
|
|
113
125
|
return fail(`shell: the command ran, but its output could not reach the agent (${error.message})`);
|
|
@@ -182,7 +194,7 @@ export function apply(ctx) {
|
|
|
182
194
|
const options = { cwd: agent.session.header.cwd ?? process.cwd(), scope: agent, signal };
|
|
183
195
|
const { skills, complete } = await ctx.skills.snapshot(options);
|
|
184
196
|
const arg = rawInput.trim();
|
|
185
|
-
if (arg === 'conflicts') return ok(await findConflicts(options.cwd, entries(agent).filter(e => !e.disabled && e.options.name === '@deepseek-ai/dsh-skill-filesystem').map(e => e.options.config
|
|
197
|
+
if (arg === 'conflicts') return ok(await findConflicts(options.cwd, entries(agent).filter(e => !e.disabled && e.options.name === '@deepseek-ai/dsh-skill-filesystem').map(e => plainConfig(e.options.config)), skills));
|
|
186
198
|
if (arg && arg !== 'list') {
|
|
187
199
|
const skill = await ctx.skills.get(arg, options);
|
|
188
200
|
return skill ? ok(`${skill.name}\n${skill.description}\nsource: ${skill.source}\nprovider: ${skill.provider}\npath: ${skill.path ?? '(provider managed)'}\ninvocation: ${show(skill.invocation)}`) : fail(`Unknown skill: ${arg}`);
|
package/plugins/ultra/policy.mjs
CHANGED
|
@@ -24,3 +24,19 @@ export function ultraRequest(options, messages) {
|
|
|
24
24
|
else copy.unshift({ role: 'system', content: ULTRA_POLICY });
|
|
25
25
|
return copy;
|
|
26
26
|
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* DSH 0.1.7 rewrote the DeepSeek adapter onto the Messages API, where the system
|
|
30
|
+
* prompt is a request field rather than a leading message. These two carry the same
|
|
31
|
+
* gates as the message-shaped pair above, which the OpenRouter and Grok adapters
|
|
32
|
+
* still use, and stay self-contained: `patch-runtime` embeds them by `toString()`.
|
|
33
|
+
*/
|
|
34
|
+
export function ultraSystem(options, system) {
|
|
35
|
+
if (options.reasoningEffort !== 'ultra' || options.purpose || !options.tools?.some(t => t.name === 'subagent' || t.name === 'subagent_fork')) return system;
|
|
36
|
+
return system.length === 0 ? ULTRA_POLICY : system + '\n\n' + ULTRA_POLICY;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function flashSystem(options, system) {
|
|
40
|
+
if (options.model !== 'deepseek-flash' || options.purpose || !options.sessionId) return system;
|
|
41
|
+
return system.length === 0 ? FLASH_POLICY : system + '\n\n' + FLASH_POLICY;
|
|
42
|
+
}
|