@toddzheng024/dscode-bundle 0.7.27 → 0.7.29

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.
Files changed (103) hide show
  1. package/README.md +1 -1
  2. package/THIRD_PARTY_NOTICES.md +10 -10
  3. package/bootstrap.mjs +1 -1
  4. package/cordis.patch.yml +433 -46
  5. package/package.json +280 -245
  6. package/plugins/account/index.mjs +178 -0
  7. package/plugins/account/state.mjs +123 -0
  8. package/plugins/auto-review/index.mjs +8 -5
  9. package/plugins/code-review/index.mjs +1 -1
  10. package/plugins/computer-use/index.mjs +37 -0
  11. package/plugins/cordis-config/plain.mjs +31 -0
  12. package/plugins/dscode/index.mjs +1 -1
  13. package/plugins/exec/cli.mjs +1 -1
  14. package/plugins/grok/index.mjs +28 -24
  15. package/plugins/i18n/messages.mjs +204 -0
  16. package/plugins/memory/index.mjs +1 -1
  17. package/plugins/message-source/kind.mjs +20 -0
  18. package/plugins/openrouter/adapter.mjs +29 -13
  19. package/plugins/openrouter/index.mjs +31 -28
  20. package/plugins/session-bridge/communication.mjs +6 -3
  21. package/plugins/session-bridge/server.mjs +3 -2
  22. package/plugins/session-bridge/tasks.mjs +3 -1
  23. package/plugins/session-cards/index.mjs +1 -1
  24. package/plugins/time-marks/index.mjs +3 -2
  25. package/plugins/time-marks/marks.mjs +6 -5
  26. package/plugins/triggers/config.mjs +1 -1
  27. package/plugins/triggers/tools.mjs +1 -1
  28. package/plugins/tui-tools/doctor.mjs +1 -1
  29. package/plugins/tui-tools/index.mjs +16 -4
  30. package/plugins/ultra/policy.mjs +16 -0
  31. package/vendor/bash/index.js +455 -186
  32. package/vendor/bash/types/background.d.ts +38 -7
  33. package/vendor/bash/types/index.d.ts +20 -4
  34. package/vendor/bash/types/render.d.ts +28 -9
  35. package/vendor/command-goal/index.js +3 -1
  36. package/vendor/deepseek/index.js +1378 -1246
  37. package/vendor/deepseek/types/adapter.d.ts +16 -155
  38. package/vendor/deepseek/types/config.d.ts +127 -0
  39. package/vendor/deepseek/types/defaults.d.ts +24 -0
  40. package/vendor/deepseek/types/file-store.d.ts +5 -3
  41. package/vendor/deepseek/types/files-api.d.ts +12 -9
  42. package/vendor/deepseek/types/image-tokens.d.ts +24 -9
  43. package/vendor/deepseek/types/images.d.ts +35 -0
  44. package/vendor/deepseek/types/index.d.ts +10 -94
  45. package/vendor/deepseek/types/messages-api.d.ts +10 -0
  46. package/vendor/deepseek/types/model-info.d.ts +16 -0
  47. package/vendor/deepseek/types/models.d.ts +4 -0
  48. package/vendor/deepseek/types/replay.d.ts +27 -0
  49. package/vendor/deepseek/types/request-extensions.d.ts +16 -0
  50. package/vendor/deepseek/types/request-files.d.ts +49 -0
  51. package/vendor/deepseek/types/request-pricing.d.ts +32 -20
  52. package/vendor/deepseek/types/serialize.d.ts +17 -82
  53. package/vendor/deepseek/types/sse.d.ts +6 -22
  54. package/vendor/deepseek/types/translate.d.ts +13 -36
  55. package/vendor/deepseek/types/transport.d.ts +15 -0
  56. package/vendor/deepseek/types/types.d.ts +106 -167
  57. package/vendor/deepseek/types/wire-types.d.ts +62 -0
  58. package/vendor/persistent/index.js +9 -3
  59. package/vendor/subagent/index.js +11 -8
  60. package/vendor/subagent/model-selection-settings.js +12 -38
  61. package/vendor/subagent/types/index.d.ts +4 -3
  62. package/vendor/subagent/types/model-selection-settings.d.ts +12 -10
  63. package/vendor/subagent-core/index.js +401 -264
  64. package/vendor/subagent-core/typert.host.js +103 -113
  65. package/vendor/subagent-core/typert.remote-client.d.ts +1 -3
  66. package/vendor/subagent-core/typert.remote-client.js +23 -69
  67. package/vendor/subagent-core/types/archive-admission.d.ts +16 -0
  68. package/vendor/subagent-core/types/archive-admission.js +151 -0
  69. package/vendor/subagent-core/types/assistant-output.d.ts +2 -2
  70. package/vendor/subagent-core/types/catalog.d.ts +17 -10
  71. package/vendor/subagent-core/types/catalog.js +12 -6
  72. package/vendor/subagent-core/types/child-agent.d.ts +8 -5
  73. package/vendor/subagent-core/types/child-agent.js +11 -5
  74. package/vendor/subagent-core/types/continuation-activation.d.ts +17 -1
  75. package/vendor/subagent-core/types/continuation-activation.js +41 -4
  76. package/vendor/subagent-core/types/continuation-messages.d.ts +1 -1
  77. package/vendor/subagent-core/types/continuation-messages.js +7 -3
  78. package/vendor/subagent-core/types/continuation.d.ts +1 -1
  79. package/vendor/subagent-core/types/continuation.js +2 -2
  80. package/vendor/subagent-core/types/control-types.d.ts +29 -36
  81. package/vendor/subagent-core/types/control-types.js +2 -3
  82. package/vendor/subagent-core/types/control.d.ts +2 -28
  83. package/vendor/subagent-core/types/control.js +3 -40
  84. package/vendor/subagent-core/types/index.d.ts +45 -41
  85. package/vendor/subagent-core/types/index.js +46 -82
  86. package/vendor/subagent-core/types/internal.d.ts +2 -2
  87. package/vendor/subagent-core/types/internal.js +2 -2
  88. package/vendor/subagent-core/types/lifecycle.d.ts +1 -1
  89. package/vendor/subagent-core/types/lifecycle.js +5 -3
  90. package/vendor/subagent-core/types/list-children.d.ts +15 -32
  91. package/vendor/subagent-core/types/list-children.js +45 -49
  92. package/vendor/subagent-core/types/out-of-process.d.ts +1 -1
  93. package/vendor/subagent-core/types/projection-types.d.ts +9 -1
  94. package/vendor/subagent-core/types/projection.d.ts +5 -0
  95. package/vendor/subagent-core/types/projection.js +10 -4
  96. package/vendor/subagent-core/types/run-settlement.js +1 -1
  97. package/vendor/subagent-core/types/types.d.ts +2 -2
  98. package/vendor/terminal/index.js +94 -30
  99. package/vendor/tui/lib/index.mjs +2 -1
  100. package/vendor/tui/lib/kernel-panels.mjs +1 -1
  101. package/vendor/tui/lib/render/projection.mjs +50 -36
  102. package/presets/dscode/agent.cordis.yml +0 -321
  103. 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-presets';
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.push(...(config.customSkillDirs ?? []).filter(x => typeof x === 'string').map(x => resolve(x)));
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: 'plugin', plugin: 'dscode-shell-exec' } }));
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 ?? {}), skills));
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}`);
@@ -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
+ }