@toddzheng024/dscode-bundle 0.1.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/LICENSE +21 -0
- package/README.md +5 -0
- package/THIRD_PARTY_NOTICES.md +11 -0
- package/bin/apply_patch +4 -0
- package/bootstrap.mjs +21 -0
- package/cordis.patch.yml +756 -0
- package/package.json +327 -0
- package/plugins/auto-review/audit.mjs +20 -0
- package/plugins/auto-review/index.mjs +181 -0
- package/plugins/auto-review/policy.mjs +59 -0
- package/plugins/dscode/index.mjs +35 -0
- package/plugins/session-metrics/index.mjs +44 -0
- package/plugins/session-metrics/pricing.mjs +18 -0
- package/plugins/session-metrics/store.mjs +24 -0
- package/plugins/session-metrics/view.mjs +58 -0
- package/plugins/tui-tools/hooks.mjs +23 -0
- package/plugins/tui-tools/index.mjs +164 -0
- package/plugins/ultra/policy.mjs +11 -0
- package/presets/dscode/agent.cordis.yml +288 -0
- package/presets/dscode/preset.yml +3 -0
- package/vendor/bash/LICENSE +21 -0
- package/vendor/bash/index.js +449 -0
- package/vendor/bash/types/background.d.ts +19 -0
- package/vendor/bash/types/index.d.ts +22 -0
- package/vendor/bash/types/render.d.ts +38 -0
- package/vendor/deepseek/LICENSE +21 -0
- package/vendor/deepseek/index.js +2102 -0
- package/vendor/deepseek/types/adapter.d.ts +163 -0
- package/vendor/deepseek/types/file-id.d.ts +19 -0
- package/vendor/deepseek/types/file-store.d.ts +83 -0
- package/vendor/deepseek/types/files-api.d.ts +103 -0
- package/vendor/deepseek/types/image-tokens.d.ts +19 -0
- package/vendor/deepseek/types/index.d.ts +106 -0
- package/vendor/deepseek/types/request-pricing.d.ts +48 -0
- package/vendor/deepseek/types/serialize.d.ts +85 -0
- package/vendor/deepseek/types/sse.d.ts +24 -0
- package/vendor/deepseek/types/translate.d.ts +37 -0
- package/vendor/deepseek/types/types.d.ts +178 -0
- package/vendor/deepseek/types/upload-index.d.ts +68 -0
- package/vendor/persistent/LICENSE +21 -0
- package/vendor/persistent/index.js +386 -0
- package/vendor/persistent/types/index.d.ts +24 -0
- package/vendor/tui/LICENSE +21 -0
- package/vendor/tui/devtools-CdTl3MNy.mjs +3643 -0
- package/vendor/tui/index.mjs +39105 -0
- package/vendor/tui/invariant.mjs +21 -0
- package/vendor/tui/rolldown-runtime-CMFfr-1z.mjs +26 -0
- package/vendor/tui/startup.mjs +109 -0
- package/vendor/tui/theme-DCT8Y2xf.mjs +628 -0
- package/vendor/tui/types/app.d.ts +304 -0
- package/vendor/tui/types/approval.d.ts +59 -0
- package/vendor/tui/types/attachments.d.ts +52 -0
- package/vendor/tui/types/authorization-panel.d.ts +22 -0
- package/vendor/tui/types/authorization.d.ts +36 -0
- package/vendor/tui/types/commands.d.ts +52 -0
- package/vendor/tui/types/editor-keys.d.ts +105 -0
- package/vendor/tui/types/editor.d.ts +6 -0
- package/vendor/tui/types/fork.d.ts +8 -0
- package/vendor/tui/types/git-workflow.d.ts +32 -0
- package/vendor/tui/types/history.d.ts +97 -0
- package/vendor/tui/types/index.d.ts +124 -0
- package/vendor/tui/types/input-split.d.ts +54 -0
- package/vendor/tui/types/internals.d.ts +26 -0
- package/vendor/tui/types/invariant.d.ts +15 -0
- package/vendor/tui/types/kernel-panels.d.ts +167 -0
- package/vendor/tui/types/keyboard.d.ts +80 -0
- package/vendor/tui/types/mentions.d.ts +81 -0
- package/vendor/tui/types/model-capabilities.d.ts +82 -0
- package/vendor/tui/types/models.d.ts +119 -0
- package/vendor/tui/types/permissions.d.ts +27 -0
- package/vendor/tui/types/plugin-inventory.d.ts +11 -0
- package/vendor/tui/types/presets.d.ts +22 -0
- package/vendor/tui/types/provider-settings.d.ts +239 -0
- package/vendor/tui/types/questions.d.ts +54 -0
- package/vendor/tui/types/render/animations.d.ts +265 -0
- package/vendor/tui/types/render/editor.d.ts +162 -0
- package/vendor/tui/types/render/export.d.ts +9 -0
- package/vendor/tui/types/render/fuzzy.d.ts +21 -0
- package/vendor/tui/types/render/inspector.d.ts +36 -0
- package/vendor/tui/types/render/lines.d.ts +66 -0
- package/vendor/tui/types/render/markdown.d.ts +29 -0
- package/vendor/tui/types/render/projection.d.ts +461 -0
- package/vendor/tui/types/render/status.d.ts +196 -0
- package/vendor/tui/types/render/text.d.ts +58 -0
- package/vendor/tui/types/render/tool-detail.d.ts +94 -0
- package/vendor/tui/types/render/tool-preview.d.ts +28 -0
- package/vendor/tui/types/render/width.d.ts +29 -0
- package/vendor/tui/types/session-directory.d.ts +173 -0
- package/vendor/tui/types/session-switch.d.ts +17 -0
- package/vendor/tui/types/settings-file.d.ts +41 -0
- package/vendor/tui/types/skills.d.ts +47 -0
- package/vendor/tui/types/startup.d.ts +65 -0
- package/vendor/tui/types/store.d.ts +58 -0
- package/vendor/tui/types/subagents.d.ts +70 -0
- package/vendor/tui/types/theme-panel.d.ts +24 -0
- package/vendor/tui/types/theme.d.ts +215 -0
- package/vendor/tui/types/version.d.ts +18 -0
- package/vendor/tui/types/whale-glyph.d.ts +6 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//#region src/invariant.ts
|
|
2
|
+
const PACKAGE_NAME = "dsh-code";
|
|
3
|
+
/** Cordis companion plugin name. */
|
|
4
|
+
const name = "tui-invariant";
|
|
5
|
+
/** Service required before the companion can register. */
|
|
6
|
+
const inject = ["invariants"];
|
|
7
|
+
/**
|
|
8
|
+
* No runtime invariant beyond the projection's own contract: the TUI renders
|
|
9
|
+
* only from `session/event` (model-visible means logged), so the display
|
|
10
|
+
* relation the renderer could desync from is already asserted by the session
|
|
11
|
+
* log's projection invariants; this companion registers nothing.
|
|
12
|
+
*/
|
|
13
|
+
const install = () => {};
|
|
14
|
+
/**
|
|
15
|
+
* Register this package's invariant companion.
|
|
16
|
+
* @param ctx - Cordis context carrying the invariant service.
|
|
17
|
+
* @returns the installed registration's disposer after setup succeeds.
|
|
18
|
+
*/
|
|
19
|
+
const apply = (ctx) => Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install));
|
|
20
|
+
//#endregion
|
|
21
|
+
export { apply, inject, name };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
//#region \0rolldown/runtime.js
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
12
|
+
key = keys[i];
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
14
|
+
get: ((k) => from[k]).bind(null, key),
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
|
21
|
+
value: mod,
|
|
22
|
+
enumerable: true
|
|
23
|
+
}) : target, mod));
|
|
24
|
+
var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
|
|
25
|
+
//#endregion
|
|
26
|
+
export { __require as n, __toESM as r, __commonJSMin as t };
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { t as THEME_NAMES } from "./theme-DCT8Y2xf.mjs";
|
|
2
|
+
import { Command } from "commander";
|
|
3
|
+
import { parseCmdline } from "@deepseek-ai/dsh-cmdline";
|
|
4
|
+
//#region src/startup.ts
|
|
5
|
+
/**
|
|
6
|
+
* The interactive terminal app's command-line provider: parses `--resume`,
|
|
7
|
+
* `--continue`, `--session`, `--mode`, `--theme`, `--image`, an optional
|
|
8
|
+
* initial prompt, and `--help`, then
|
|
9
|
+
* publishes {@link TUI_STARTUP_SERVICE} for the runner to consume lazily.
|
|
10
|
+
* Follows the headless bundle's startup shape (a commander action publishing
|
|
11
|
+
* a service through {@link parseCmdline}).
|
|
12
|
+
*
|
|
13
|
+
* Semantics:
|
|
14
|
+
* - `--resume <id|prefix>` — continue the persisted session whose id or unique
|
|
15
|
+
* id-prefix matches; the TUI replays its transcript and appends to the same
|
|
16
|
+
* durable log.
|
|
17
|
+
* - `--continue` / `-c` — resume the most recently modified persisted session
|
|
18
|
+
* whose project directory matches the current working directory.
|
|
19
|
+
* - `--session <id>` — create a new session under an explicit identity (the
|
|
20
|
+
* id must not exist yet).
|
|
21
|
+
* - `--theme <dark|light|auto>` — the color palette; auto follows the
|
|
22
|
+
* terminal (dark fallback until OSC-11 detection lands).
|
|
23
|
+
* - no flags — a fresh session with a minted id.
|
|
24
|
+
*
|
|
25
|
+
* @module @deepseek-ai/dsh-tui/startup
|
|
26
|
+
*/
|
|
27
|
+
/** Stable Cordis plugin name. */
|
|
28
|
+
const name = "tui-startup";
|
|
29
|
+
/** Services required before the invocation can be resolved. */
|
|
30
|
+
const inject = ["cmdlineArgs"];
|
|
31
|
+
/** Service provided by this plugin and injected by the terminal runner. */
|
|
32
|
+
const TUI_STARTUP_SERVICE = "tuiStartup";
|
|
33
|
+
/** Pure option policy shared by Commander and tests. */
|
|
34
|
+
function resolveTuiStartup(options) {
|
|
35
|
+
if ([
|
|
36
|
+
options.resume !== void 0,
|
|
37
|
+
options.continue === true,
|
|
38
|
+
options.session !== void 0
|
|
39
|
+
].filter(Boolean).length > 1) throw new Error("--resume, --continue, and --session are mutually exclusive");
|
|
40
|
+
if (options.session === "") throw new Error("--session needs an id");
|
|
41
|
+
if (options.resume === "") throw new Error("--resume needs a session id or id prefix");
|
|
42
|
+
if (options.mode === "") throw new Error("--mode needs a preset id");
|
|
43
|
+
if (options.mode !== void 0 && (options.resume !== void 0 || options.continue === true)) throw new Error("--mode applies only to a new session; it cannot be combined with --resume or --continue");
|
|
44
|
+
if (options.theme !== void 0 && !THEME_NAMES.includes(options.theme)) throw new Error("--theme must be dark, light, or auto");
|
|
45
|
+
const input = {
|
|
46
|
+
...options.theme === void 0 ? {} : { theme: options.theme },
|
|
47
|
+
...options.prompt === void 0 || options.prompt.trim() === "" ? {} : { prompt: options.prompt.trim() },
|
|
48
|
+
...options.images === void 0 || options.images.length === 0 ? {} : { images: [...options.images] }
|
|
49
|
+
};
|
|
50
|
+
return options.resume !== void 0 ? {
|
|
51
|
+
kind: "resume",
|
|
52
|
+
sessionId: options.resume,
|
|
53
|
+
...input
|
|
54
|
+
} : options.continue === true ? {
|
|
55
|
+
kind: "latest",
|
|
56
|
+
...input
|
|
57
|
+
} : options.session !== void 0 ? {
|
|
58
|
+
kind: "named",
|
|
59
|
+
sessionId: options.session,
|
|
60
|
+
...options.mode === void 0 ? {} : { mode: options.mode },
|
|
61
|
+
...input
|
|
62
|
+
} : {
|
|
63
|
+
kind: "fresh",
|
|
64
|
+
...options.mode === void 0 ? {} : { mode: options.mode },
|
|
65
|
+
...input
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* This app's command: the launcher's flags this app owns, its description,
|
|
70
|
+
* and its help text.
|
|
71
|
+
* @returns a fresh program, so one process can parse more than once (tests).
|
|
72
|
+
*/
|
|
73
|
+
function tuiCommand() {
|
|
74
|
+
return new Command().name("dsh --profile cli").description("DeepSeek Harness CLI core: the interactive coding terminal.").helpOption("-h, --help", "show this help").option("-r, --resume <session>", "resume the persisted session with this id (or unique id prefix)").option("-c, --continue", "resume the most recent persisted session for this working directory").option("--session <id>", "create a new session under this explicit id").option("--mode <preset>", "agent preset for a newly created session").option("--theme <name>", "color theme: dark (default), light, or auto").option("-i, --image <path>", "attach an image to the initial prompt (repeatable)", (path, paths) => [...paths, path], []).argument("[prompt...]", "initial prompt; sends immediately after startup").addHelpText("after", `
|
|
75
|
+
Examples:
|
|
76
|
+
dsh --profile cli fresh session, minted id
|
|
77
|
+
dsh --profile cli --resume abc123 resume session by id prefix
|
|
78
|
+
dsh --profile cli --continue resume the latest local session
|
|
79
|
+
dsh --profile cli --mode minimal fresh session using the minimal preset
|
|
80
|
+
dsh --profile cli --theme light light palette for bright terminals
|
|
81
|
+
dsh --profile cli "explain this repo" start and send an initial prompt
|
|
82
|
+
dsh --profile cli -i diagram.png "review this diagram"
|
|
83
|
+
`);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Parse the invocation and publish the startup service. Mutual exclusions are
|
|
87
|
+
* usage errors rejected from the action before anything is provided.
|
|
88
|
+
* @param ctx - plugin context carrying the command line and exit request.
|
|
89
|
+
*/
|
|
90
|
+
function apply(ctx) {
|
|
91
|
+
const program = tuiCommand();
|
|
92
|
+
program.action((prompt) => {
|
|
93
|
+
const options = {
|
|
94
|
+
...program.opts(),
|
|
95
|
+
prompt: prompt.join(" ")
|
|
96
|
+
};
|
|
97
|
+
let startup;
|
|
98
|
+
try {
|
|
99
|
+
startup = resolveTuiStartup(options);
|
|
100
|
+
} catch (error) {
|
|
101
|
+
program.error(`error: ${error instanceof Error ? error.message : String(error)}`);
|
|
102
|
+
}
|
|
103
|
+
if (startup === void 0) return;
|
|
104
|
+
ctx.provide(TUI_STARTUP_SERVICE, { startup });
|
|
105
|
+
});
|
|
106
|
+
parseCmdline(ctx, program);
|
|
107
|
+
}
|
|
108
|
+
//#endregion
|
|
109
|
+
export { apply, inject, name, resolveTuiStartup };
|