@toddzheng024/dscode-bundle 0.4.0 → 0.6.0
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/THIRD_PARTY_NOTICES.md +15 -0
- package/cordis.patch.yml +3 -3
- package/package.json +7 -1
- package/plugins/clipboard-image/clipboard-image.swift +56 -0
- package/plugins/clipboard-image/index.mjs +70 -0
- package/plugins/code-review/git.mjs +95 -0
- package/plugins/code-review/index.mjs +88 -0
- package/plugins/dscode/index.mjs +57 -5
- package/plugins/email-tools/index.mjs +2 -2
- package/plugins/exec/index.mjs +107 -0
- package/plugins/session-metrics/index.mjs +6 -2
- package/plugins/session-metrics/rate.mjs +62 -0
- package/plugins/session-metrics/view.mjs +15 -9
- package/plugins/tui-tools/doctor-cli.mjs +22 -0
- package/plugins/tui-tools/doctor.mjs +141 -0
- package/plugins/tui-tools/index.mjs +14 -6
- package/plugins/ultra/policy.mjs +13 -2
- package/plugins/worktree-subagent/worktree.mjs +50 -0
- package/presets/dscode/agent.cordis.yml +14 -3
- package/vendor/deepseek/index.js +12 -2
- package/vendor/subagent/index.js +39 -12
- package/vendor/subagent-core/LICENSE +21 -0
- package/vendor/subagent-core/index.js +3232 -0
- package/vendor/subagent-core/invariant.js +76 -0
- package/vendor/subagent-core/typert.host.d.ts +3 -0
- package/vendor/subagent-core/typert.host.js +964 -0
- package/vendor/subagent-core/typert.remote-client.d.ts +27 -0
- package/vendor/subagent-core/typert.remote-client.js +160 -0
- package/vendor/subagent-core/types/assistant-output.d.ts +48 -0
- package/vendor/subagent-core/types/assistant-output.js +73 -0
- package/vendor/subagent-core/types/catalog.d.ts +77 -0
- package/vendor/subagent-core/types/catalog.js +103 -0
- package/vendor/subagent-core/types/child-agent.d.ts +150 -0
- package/vendor/subagent-core/types/child-agent.js +207 -0
- package/vendor/subagent-core/types/client.d.ts +8 -0
- package/vendor/subagent-core/types/client.js +7 -0
- package/vendor/subagent-core/types/continuation-activation.d.ts +251 -0
- package/vendor/subagent-core/types/continuation-activation.js +663 -0
- package/vendor/subagent-core/types/continuation-messages.d.ts +62 -0
- package/vendor/subagent-core/types/continuation-messages.js +102 -0
- package/vendor/subagent-core/types/continuation.d.ts +124 -0
- package/vendor/subagent-core/types/continuation.js +455 -0
- package/vendor/subagent-core/types/control-types.d.ts +146 -0
- package/vendor/subagent-core/types/control-types.js +9 -0
- package/vendor/subagent-core/types/control.d.ts +71 -0
- package/vendor/subagent-core/types/control.js +116 -0
- package/vendor/subagent-core/types/depth.d.ts +31 -0
- package/vendor/subagent-core/types/depth.js +39 -0
- package/vendor/subagent-core/types/descriptor.d.ts +144 -0
- package/vendor/subagent-core/types/descriptor.js +193 -0
- package/vendor/subagent-core/types/error.d.ts +11 -0
- package/vendor/subagent-core/types/error.js +14 -0
- package/vendor/subagent-core/types/inbox.d.ts +43 -0
- package/vendor/subagent-core/types/inbox.js +61 -0
- package/vendor/subagent-core/types/index.d.ts +316 -0
- package/vendor/subagent-core/types/index.js +511 -0
- package/vendor/subagent-core/types/internal.d.ts +58 -0
- package/vendor/subagent-core/types/internal.js +58 -0
- package/vendor/subagent-core/types/invariant.d.ts +13 -0
- package/vendor/subagent-core/types/invariant.js +91 -0
- package/vendor/subagent-core/types/lifecycle.d.ts +113 -0
- package/vendor/subagent-core/types/lifecycle.js +178 -0
- package/vendor/subagent-core/types/list-children.d.ts +65 -0
- package/vendor/subagent-core/types/list-children.js +381 -0
- package/vendor/subagent-core/types/out-of-process.d.ts +118 -0
- package/vendor/subagent-core/types/out-of-process.js +219 -0
- package/vendor/subagent-core/types/projection-types.d.ts +74 -0
- package/vendor/subagent-core/types/projection-types.js +7 -0
- package/vendor/subagent-core/types/projection.d.ts +95 -0
- package/vendor/subagent-core/types/projection.js +151 -0
- package/vendor/subagent-core/types/run-settlement.d.ts +17 -0
- package/vendor/subagent-core/types/run-settlement.js +70 -0
- package/vendor/subagent-core/types/types.d.ts +377 -0
- package/vendor/subagent-core/types/types.js +19 -0
- package/vendor/subagent-driver/LICENSE +21 -0
- package/vendor/subagent-driver/index.js +255 -0
- package/vendor/subagent-driver/types/index.d.ts +33 -0
- package/vendor/subagent-driver/types/structured.d.ts +42 -0
- package/vendor/subagent-fork/LICENSE +21 -0
- package/vendor/subagent-fork/index.js +61 -0
- package/vendor/subagent-fork/types/index.d.ts +20 -0
- package/vendor/subagent-spawn/LICENSE +21 -0
- package/vendor/subagent-spawn/index.js +45 -0
- package/vendor/subagent-spawn/types/index.d.ts +19 -0
- package/vendor/terminal/LICENSE +21 -0
- package/vendor/terminal/index.js +1013 -0
- package/vendor/terminal/types/config.d.ts +71 -0
- package/vendor/terminal/types/index.d.ts +36 -0
- package/vendor/terminal/types/sanitize.d.ts +47 -0
- package/vendor/terminal/types/session.d.ts +87 -0
- package/vendor/tui/dscode-clipboard-image/clipboard-image.swift +56 -0
- package/vendor/tui/dscode-clipboard-image/index.mjs +70 -0
- package/vendor/tui/index.mjs +341 -93
package/vendor/subagent/index.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
// dscode-child-name-v1
|
|
2
|
+
// dscode-child-worktree-v3
|
|
1
3
|
// dscode-child-effort-v1
|
|
4
|
+
import { createChildWorktree, discardCleanChildWorktree } from "../../plugins/worktree-subagent/worktree.mjs";
|
|
2
5
|
import z from "@deepseek-ai/schemastery";
|
|
3
6
|
import { scopeChainOf, scopeOf } from "@deepseek-ai/dsh-scope";
|
|
4
7
|
import { defineTool } from "@deepseek-ai/dsh-tools";
|
|
5
8
|
import { SessionSeq } from "@deepseek-ai/dsh-session";
|
|
6
|
-
import { assertSubagentMaxDepth, parentAgentOptionsForDelegation, settleRun } from "
|
|
9
|
+
import { assertSubagentMaxDepth, parentAgentOptionsForDelegation, settleRun } from "../subagent-core/index.js";
|
|
7
10
|
import { ReasoningEffortId } from "@deepseek-ai/dsh-llm";
|
|
8
11
|
import { z as z$1 } from "zod";
|
|
9
12
|
z.object({
|
|
@@ -398,8 +401,13 @@ function apply(ctx, config, session) {
|
|
|
398
401
|
subagentProvider,
|
|
399
402
|
disposeTool: runtimeCtx.tools.register(defineTool({
|
|
400
403
|
name: toolName,
|
|
401
|
-
description: wording.description + (backgroundEnabled ? continuable ? " This tool runs in the background by default, immediately returns a durable subagent id, and keeps the child conversation available for later turns. When that run settles, the runtime sends the parent a notice containing its outcome and any final assistant message; `send_message` steers the child's nearest step while it is running and starts a turn while it is idle. Set `run_in_background: false` only when your next action depends on receiving the result." : " This call waits for the result by default. Set `run_in_background: true` to return a job id; collect with `job_output` and stop with `job_kill`." : " This call waits for the subagent and returns its result.") + choiceDescription,
|
|
404
|
+
description: wording.description + (backgroundEnabled ? continuable ? " This tool runs in the background by default, immediately returns a durable subagent id, and keeps the child conversation available for later turns. When that run settles, the runtime sends the parent a notice containing its outcome and any final assistant message; `send_message` steers the child's nearest step while it is running and starts a turn while it is idle. Set `run_in_background: false` only when your next action depends on receiving the result." : " This call waits for the result by default. Set `run_in_background: true` to return a job id; collect with `job_output` and stop with `job_kill`." : " This call waits for the subagent and returns its result.") + choiceDescription + (continuable && (config.provider === "spawn" || config.provider === "fork") ? " Set worktree: true for an isolated Git checkout when agents edit in parallel. It starts at HEAD and refuses a dirty parent workspace; omit for read-only tasks or when the child needs uncommitted parent edits. You must inspect and integrate its changes; the worktree remains after completion." : ""),
|
|
402
405
|
parameters: {
|
|
406
|
+
name: {
|
|
407
|
+
type: "string",
|
|
408
|
+
required: true,
|
|
409
|
+
description: "Unique name you give this child: 1-10 characters, letters, digits and underscores only, starting and ending with a letter (for example read_code). Address the child as /name in send_message and interrupt_agent."
|
|
410
|
+
},
|
|
403
411
|
description: {
|
|
404
412
|
type: "string",
|
|
405
413
|
required: true,
|
|
@@ -428,6 +436,10 @@ function apply(ctx, config, session) {
|
|
|
428
436
|
type: "string",
|
|
429
437
|
description: "Reasoning effort for this child only, validated against its model. Omit to inherit. Prefer low for bounded tasks, high for difficult work, max for exceptional uncertainty. Provider/model remain unchanged."
|
|
430
438
|
} } : {},
|
|
439
|
+
...continuable && (config.provider === "spawn" || config.provider === "fork") ? { worktree: {
|
|
440
|
+
type: "boolean",
|
|
441
|
+
description: "Create an isolated Git worktree for this child at clean HEAD. Choose for parallel editing; omit or set false for read-only work or tasks requiring uncommitted parent changes. Parent must integrate the result."
|
|
442
|
+
} } : {},
|
|
431
443
|
...backgroundEnabled ? { run_in_background: {
|
|
432
444
|
type: "boolean",
|
|
433
445
|
description: continuable ? "Whether to run in the background and return a durable subagent id immediately. Defaults to true. Set false to wait for the result when your next action depends on it." : "Whether to run as a background job and return its id. Defaults to false; collect with job_output or stop with job_kill."
|
|
@@ -444,7 +456,8 @@ function apply(ctx, config, session) {
|
|
|
444
456
|
required: true,
|
|
445
457
|
const: "background"
|
|
446
458
|
},
|
|
447
|
-
|
|
459
|
+
worktree: { type: "string" },
|
|
460
|
+
jobId: {
|
|
448
461
|
type: "string",
|
|
449
462
|
required: true
|
|
450
463
|
}
|
|
@@ -459,7 +472,8 @@ function apply(ctx, config, session) {
|
|
|
459
472
|
required: true,
|
|
460
473
|
const: "continuable"
|
|
461
474
|
},
|
|
462
|
-
|
|
475
|
+
worktree: { type: "string" },
|
|
476
|
+
subagentId: {
|
|
463
477
|
type: "string",
|
|
464
478
|
required: true
|
|
465
479
|
}
|
|
@@ -474,7 +488,8 @@ function apply(ctx, config, session) {
|
|
|
474
488
|
required: true,
|
|
475
489
|
const: "foreground"
|
|
476
490
|
},
|
|
477
|
-
|
|
491
|
+
worktree: { type: "string" },
|
|
492
|
+
runId: {
|
|
478
493
|
type: "string",
|
|
479
494
|
required: true
|
|
480
495
|
},
|
|
@@ -488,13 +503,16 @@ function apply(ctx, config, session) {
|
|
|
488
503
|
] },
|
|
489
504
|
render: (_args, value) => [{
|
|
490
505
|
type: "text",
|
|
491
|
-
text: value.kind === "background" ? `started background subagent job ${value.jobId}` : value.kind === "continuable" ? `started subagent ${value.subagentId}` : outputValueText(value.output)
|
|
506
|
+
text: (value.kind === "background" ? `started background subagent job ${value.jobId}` : value.kind === "continuable" ? `started subagent /${_args.name} (${value.subagentId})` : outputValueText(value.output)) + (value.worktree ? `
|
|
507
|
+
Worktree: ${value.worktree}
|
|
508
|
+
Inspect and integrate its changes before removing it.` : "")
|
|
492
509
|
}]
|
|
493
510
|
},
|
|
494
511
|
isConcurrencySafe: () => true,
|
|
495
512
|
async execute(args, exec) {
|
|
496
513
|
const parent = exec.agent;
|
|
497
514
|
if (!parent) throw new Error("subagent tool requires a calling agent (exec.agent was undefined)");
|
|
515
|
+
if (typeof args.name !== "string" || !/^[A-Za-z](?:[A-Za-z0-9_]{0,8}[A-Za-z])?$/.test(args.name)) throw new Error("name must be 1-10 characters of letters, digits or underscores, starting and ending with a letter");
|
|
498
516
|
const modelRequest = args;
|
|
499
517
|
const parentOptions = parentAgentOptionsForDelegation(parent);
|
|
500
518
|
const requiresRoutePreflight = hasDelegationModelRequest(modelRequest) || hasConfiguredLlmSelection(config.agentOptions);
|
|
@@ -510,9 +528,12 @@ function apply(ctx, config, session) {
|
|
|
510
528
|
if (runtimeCtx.subagents.getProvider(config.provider) !== subagentProvider) throw new Error(`subagent provider "${config.provider}" changed while resolving the child LLM route; retry the delegation`);
|
|
511
529
|
}
|
|
512
530
|
exec.signal.throwIfAborted();
|
|
531
|
+
if (args.worktree === true && !(continuable && (config.provider === "spawn" || config.provider === "fork"))) throw new Error("worktree is unavailable for this subagent provider");
|
|
532
|
+
const childWorktree = args.worktree === true ? await createChildWorktree(parent.session.header.cwd, exec.signal) : void 0;
|
|
513
533
|
const maxDepth = typeof config.maxDepth === "number" ? config.maxDepth : void 0;
|
|
514
534
|
const request = {
|
|
515
|
-
label: args.description,
|
|
535
|
+
label: "/" + args.name + " · " + args.description,
|
|
536
|
+
...childWorktree ? { workspaceCwd: childWorktree.cwd } : {},
|
|
516
537
|
prompt: [{
|
|
517
538
|
type: "text",
|
|
518
539
|
text: args.prompt
|
|
@@ -523,6 +544,7 @@ function apply(ctx, config, session) {
|
|
|
523
544
|
...config.toolFilter !== void 0 ? { toolFilter: config.toolFilter } : {},
|
|
524
545
|
...maxDepth !== void 0 ? { maxDepth } : {}
|
|
525
546
|
};
|
|
547
|
+
try {
|
|
526
548
|
if (resolveDelegationRun(args, {
|
|
527
549
|
backgroundEnabled,
|
|
528
550
|
continuable
|
|
@@ -531,10 +553,11 @@ function apply(ctx, config, session) {
|
|
|
531
553
|
kind: "continuable",
|
|
532
554
|
subagentId: (await runtimeCtx.subagents.startContinuable({
|
|
533
555
|
provider: config.provider,
|
|
534
|
-
label: args.description,
|
|
556
|
+
label: "/" + args.name + " · " + args.description,
|
|
535
557
|
request,
|
|
536
558
|
signal: exec.signal
|
|
537
|
-
})).childId
|
|
559
|
+
})).childId,
|
|
560
|
+
...childWorktree ? { worktree: childWorktree.cwd } : {}
|
|
538
561
|
};
|
|
539
562
|
const jobs = runtimeCtx.get("jobs");
|
|
540
563
|
if (jobs === void 0) throw new Error("background jobs unavailable: load @deepseek-ai/dsh-jobs and @deepseek-ai/dsh-tool-jobs");
|
|
@@ -542,7 +565,7 @@ function apply(ctx, config, session) {
|
|
|
542
565
|
kind: "background",
|
|
543
566
|
jobId: jobs.start({
|
|
544
567
|
kind: "subagent",
|
|
545
|
-
label: args.description,
|
|
568
|
+
label: "/" + args.name + " · " + args.description,
|
|
546
569
|
owner: parent,
|
|
547
570
|
run: () => {
|
|
548
571
|
const controller = new AbortController();
|
|
@@ -559,10 +582,14 @@ function apply(ctx, config, session) {
|
|
|
559
582
|
})
|
|
560
583
|
};
|
|
561
584
|
}
|
|
562
|
-
return settleForegroundRun(await runtimeCtx.subagents.start(config.provider, {
|
|
585
|
+
return { ...await settleForegroundRun(await runtimeCtx.subagents.start(config.provider, {
|
|
563
586
|
...request,
|
|
564
587
|
signal: exec.signal
|
|
565
|
-
}));
|
|
588
|
+
})), ...childWorktree ? { worktree: childWorktree.cwd } : {} };
|
|
589
|
+
} catch (error) {
|
|
590
|
+
if (childWorktree && !await discardCleanChildWorktree(childWorktree)) throw new Error(`${String(error)}; child worktree retained at ${childWorktree.cwd}`, { cause: error });
|
|
591
|
+
throw error;
|
|
592
|
+
}
|
|
566
593
|
}
|
|
567
594
|
}))
|
|
568
595
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 DeepSeek
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|