codsh-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/lib/index.js +1272 -146
- package/lib/types/clipboard-image.d.ts +44 -0
- package/lib/types/console.d.ts +19 -3
- package/lib/types/keys.d.ts +8 -0
- package/lib/types/prompt.d.ts +86 -1
- package/lib/types/screen.d.ts +111 -5
- package/lib/types/ship.d.ts +15 -0
- package/lib/types/todos.d.ts +49 -0
- package/lib/types/transcript.d.ts +84 -0
- package/lib/types/vision.d.ts +83 -0
- package/package.json +48 -46
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a pasted image becomes when the model cannot see.
|
|
3
|
+
*
|
|
4
|
+
* The default DeepSeek routes are text-only, so codsh gives an image two
|
|
5
|
+
* honest lives. It is always saved to a stable file the agent's tools can
|
|
6
|
+
* touch — inspect, commit, embed. And when a vision sidecar is configured
|
|
7
|
+
* (`CODSH_VISION_*`: any OpenAI-compatible multimodal endpoint), the image is
|
|
8
|
+
* also described into text the model can actually read: everything in it
|
|
9
|
+
* transcribed, structure narrated. Both ride the same message the person
|
|
10
|
+
* sent, so they persist in durable history and survive `--resume`.
|
|
11
|
+
* @module codsh-bundle/src/vision
|
|
12
|
+
*/
|
|
13
|
+
import type { EncodedImageAttachment, ImageAttachmentLimits } from '@deepseek-ai/dsh-attachment/types';
|
|
14
|
+
/** A vision sidecar: an OpenAI-compatible endpoint that can see. */
|
|
15
|
+
export interface VisionConfig {
|
|
16
|
+
/** The API base, e.g. `https://open.bigmodel.cn/api/paas/v4`. */
|
|
17
|
+
baseUrl: string;
|
|
18
|
+
/** Bearer token; absent for endpoints that need none (local ollama). */
|
|
19
|
+
apiKey?: string;
|
|
20
|
+
/** The multimodal model to ask. */
|
|
21
|
+
model: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The sidecar from the environment, or undefined when none is configured.
|
|
25
|
+
* @param env - the process environment.
|
|
26
|
+
* @returns the config when both the base URL and the model are set.
|
|
27
|
+
*/
|
|
28
|
+
export declare function visionConfigFromEnv(env: Record<string, string | undefined>): VisionConfig | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Ask the sidecar what an image shows.
|
|
31
|
+
* @param image - the encoded image.
|
|
32
|
+
* @param config - which endpoint and model to ask.
|
|
33
|
+
* @param signal - cancels the request, on top of the built-in timeout.
|
|
34
|
+
* @returns the description.
|
|
35
|
+
* @throws on timeout, a non-2xx answer, or an answer with no text.
|
|
36
|
+
*/
|
|
37
|
+
export declare function describeImage(image: EncodedImageAttachment, config: VisionConfig, signal?: AbortSignal): Promise<string>;
|
|
38
|
+
/**
|
|
39
|
+
* The upstream store's default admission limits, for use when no store is
|
|
40
|
+
* mounted: the sidecar payload is bounded by the same line either way.
|
|
41
|
+
*/
|
|
42
|
+
export declare const DEFAULT_IMAGE_LIMITS: ImageAttachmentLimits;
|
|
43
|
+
/**
|
|
44
|
+
* Save a pasted image where the agent's tools can reach it.
|
|
45
|
+
*
|
|
46
|
+
* The original bytes, never a downscaled copy — the person may want the asset
|
|
47
|
+
* itself committed. Content-addressed under the dsh home so a repeated paste
|
|
48
|
+
* dedupes, nothing lands in the workspace uninvited, and the path stays valid
|
|
49
|
+
* for `--resume`.
|
|
50
|
+
* @param image - the encoded image.
|
|
51
|
+
* @returns the absolute path of the saved file.
|
|
52
|
+
*/
|
|
53
|
+
export declare function savePastedImage(image: EncodedImageAttachment): Promise<string>;
|
|
54
|
+
/**
|
|
55
|
+
* The context block a pasted image contributes on a text-only route.
|
|
56
|
+
*
|
|
57
|
+
* The same XMLish convention the `!` passthrough uses: the model reads the
|
|
58
|
+
* path (its tools can open the file), the dimensions, and — when the sidecar
|
|
59
|
+
* ran — the description standing in for sight.
|
|
60
|
+
* @param id - the `[Image #N]` number the person's text references.
|
|
61
|
+
* @param image - the encoded image.
|
|
62
|
+
* @param at - where the file was saved and what is known about it.
|
|
63
|
+
* @returns the block text.
|
|
64
|
+
*/
|
|
65
|
+
export declare function pastedImageBlock(id: number, image: EncodedImageAttachment, at: {
|
|
66
|
+
path: string;
|
|
67
|
+
width?: number;
|
|
68
|
+
height?: number;
|
|
69
|
+
description?: string;
|
|
70
|
+
}): string;
|
|
71
|
+
/**
|
|
72
|
+
* Shrink an image until the attachment store will admit it.
|
|
73
|
+
*
|
|
74
|
+
* Retina screenshots exceed the deployed routes' 2000-pixel side limit as a
|
|
75
|
+
* matter of course, and refusing them would make the feature useless on the
|
|
76
|
+
* machines most likely to use it. The downscale re-encodes as PNG; a copy
|
|
77
|
+
* still over the byte limit falls back to JPEG, which is what a photograph
|
|
78
|
+
* that big actually is.
|
|
79
|
+
* @param image - the encoded image.
|
|
80
|
+
* @param limits - the store's admission limits.
|
|
81
|
+
* @returns the image, downscaled only when it had to be.
|
|
82
|
+
*/
|
|
83
|
+
export declare function fitWithinLimits(image: EncodedImageAttachment, limits: ImageAttachmentLimits): Promise<EncodedImageAttachment>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codsh-bundle",
|
|
3
3
|
"description": "The codsh runtime: the interactive TTY surface and code-cli agent preset, installed into a dsh profile. Users install codsh-cli (the launcher) — this package is what it registers.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.6.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "lib/index.js",
|
|
@@ -38,59 +38,61 @@
|
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@deepseek-ai/dsh-agent-instructions": "^0.1.0-rc.
|
|
42
|
-
"@deepseek-ai/dsh-agent-presets": "^0.1.0-rc.
|
|
43
|
-
"@deepseek-ai/dsh-
|
|
44
|
-
"@deepseek-ai/dsh-
|
|
45
|
-
"@deepseek-ai/dsh-
|
|
46
|
-
"@deepseek-ai/dsh-
|
|
47
|
-
"@deepseek-ai/dsh-compaction-
|
|
48
|
-
"@deepseek-ai/dsh-
|
|
49
|
-
"@deepseek-ai/dsh-lsp
|
|
50
|
-
"@deepseek-ai/dsh-
|
|
51
|
-
"@deepseek-ai/dsh-
|
|
52
|
-
"@deepseek-ai/dsh-
|
|
53
|
-
"@deepseek-ai/dsh-
|
|
54
|
-
"@deepseek-ai/dsh-terminal
|
|
55
|
-
"@deepseek-ai/dsh-
|
|
56
|
-
"@deepseek-ai/dsh-tool-
|
|
57
|
-
"@deepseek-ai/dsh-tool-
|
|
58
|
-
"@deepseek-ai/dsh-tool-fs
|
|
59
|
-
"@deepseek-ai/dsh-tool-
|
|
60
|
-
"@deepseek-ai/dsh-tool-
|
|
61
|
-
"@deepseek-ai/dsh-tool-
|
|
62
|
-
"@deepseek-ai/dsh-tool-
|
|
63
|
-
"@deepseek-ai/dsh-tool-
|
|
64
|
-
"@deepseek-ai/dsh-tool-
|
|
65
|
-
"@deepseek-ai/dsh-tool-
|
|
66
|
-
"@deepseek-ai/dsh-tool-subagent
|
|
67
|
-
"@deepseek-ai/dsh-tool-
|
|
68
|
-
"@deepseek-ai/dsh-tool-
|
|
69
|
-
"@deepseek-ai/dsh-tool-
|
|
70
|
-
"@deepseek-ai/dsh-tool-
|
|
71
|
-
"@deepseek-ai/dsh-workflow
|
|
41
|
+
"@deepseek-ai/dsh-agent-instructions": "^0.1.0-rc.8",
|
|
42
|
+
"@deepseek-ai/dsh-agent-presets": "^0.1.0-rc.8",
|
|
43
|
+
"@deepseek-ai/dsh-attachment": "^0.1.0-rc.8",
|
|
44
|
+
"@deepseek-ai/dsh-cmdline": "^0.1.0-rc.8",
|
|
45
|
+
"@deepseek-ai/dsh-code-runtime-worker-thread": "^0.1.0-rc.8",
|
|
46
|
+
"@deepseek-ai/dsh-command-compact": "^0.1.0-rc.8",
|
|
47
|
+
"@deepseek-ai/dsh-compaction-basic": "^0.1.0-rc.8",
|
|
48
|
+
"@deepseek-ai/dsh-compaction-tool-result-pruner": "^0.1.0-rc.8",
|
|
49
|
+
"@deepseek-ai/dsh-lsp": "^0.1.0-rc.8",
|
|
50
|
+
"@deepseek-ai/dsh-lsp-stdio": "^0.1.0-rc.8",
|
|
51
|
+
"@deepseek-ai/dsh-persona": "^0.1.0-rc.8",
|
|
52
|
+
"@deepseek-ai/dsh-plan-mode": "^0.1.0-rc.8",
|
|
53
|
+
"@deepseek-ai/dsh-skill-filesystem": "^0.1.0-rc.8",
|
|
54
|
+
"@deepseek-ai/dsh-terminal": "^0.1.0-rc.8",
|
|
55
|
+
"@deepseek-ai/dsh-terminal-bash": "^0.1.0-rc.8",
|
|
56
|
+
"@deepseek-ai/dsh-tool-ask-user": "^0.1.0-rc.8",
|
|
57
|
+
"@deepseek-ai/dsh-tool-bash": "^0.1.0-rc.8",
|
|
58
|
+
"@deepseek-ai/dsh-tool-fs": "^0.1.0-rc.8",
|
|
59
|
+
"@deepseek-ai/dsh-tool-fs-search": "^0.1.0-rc.8",
|
|
60
|
+
"@deepseek-ai/dsh-tool-goal": "^0.1.0-rc.8",
|
|
61
|
+
"@deepseek-ai/dsh-tool-jobs": "^0.1.0-rc.8",
|
|
62
|
+
"@deepseek-ai/dsh-tool-lsp": "^0.1.0-rc.8",
|
|
63
|
+
"@deepseek-ai/dsh-tool-pwsh": "^0.1.0-rc.8",
|
|
64
|
+
"@deepseek-ai/dsh-tool-ralph": "^0.1.0-rc.8",
|
|
65
|
+
"@deepseek-ai/dsh-tool-skill": "^0.1.0-rc.8",
|
|
66
|
+
"@deepseek-ai/dsh-tool-subagent": "^0.1.0-rc.8",
|
|
67
|
+
"@deepseek-ai/dsh-tool-subagent-control": "^0.1.0-rc.8",
|
|
68
|
+
"@deepseek-ai/dsh-tool-terminal": "^0.1.0-rc.8",
|
|
69
|
+
"@deepseek-ai/dsh-tool-todo": "^0.1.0-rc.8",
|
|
70
|
+
"@deepseek-ai/dsh-tool-web": "^0.1.0-rc.8",
|
|
71
|
+
"@deepseek-ai/dsh-tool-workflow": "^0.1.0-rc.8",
|
|
72
|
+
"@deepseek-ai/dsh-workflow-worker-thread": "^0.1.0-rc.8",
|
|
72
73
|
"@deepseek-ai/schemastery": "^3.18.1",
|
|
73
74
|
"commander": "^15.0.0",
|
|
74
75
|
"diff": "^9.0.0",
|
|
76
|
+
"sharp": "^0.35.3",
|
|
75
77
|
"string-width": "^8.2.2"
|
|
76
78
|
},
|
|
77
79
|
"peerDependencies": {
|
|
78
80
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
79
81
|
"@deepseek-ai/cordis-plugin-loader": "^1.0.2",
|
|
80
|
-
"@deepseek-ai/dsh-agent": "^0.1.0-rc.
|
|
81
|
-
"@deepseek-ai/dsh-agent-default-model": "^0.1.0-rc.
|
|
82
|
-
"@deepseek-ai/dsh-commands": "^0.1.0-rc.
|
|
83
|
-
"@deepseek-ai/dsh-home-paths": "^0.1.0-rc.
|
|
84
|
-
"@deepseek-ai/dsh-invariants": "^0.1.0-rc.
|
|
85
|
-
"@deepseek-ai/dsh-llm": "^0.1.0-rc.
|
|
86
|
-
"@deepseek-ai/dsh-permission-presets": "^0.1.0-rc.
|
|
87
|
-
"@deepseek-ai/dsh-session": "^0.1.0-rc.
|
|
88
|
-
"@deepseek-ai/dsh-session-projection": "^0.1.0-rc.
|
|
89
|
-
"@deepseek-ai/dsh-session-query": "^0.1.0-rc.
|
|
90
|
-
"@deepseek-ai/dsh-token-meter": "^0.1.0-rc.
|
|
91
|
-
"@deepseek-ai/dsh-tools": "^0.1.0-rc.
|
|
92
|
-
"@deepseek-ai/dsh-user-approval": "^0.1.0-rc.
|
|
93
|
-
"@deepseek-ai/dsh-user-questions": "^0.1.0-rc.
|
|
82
|
+
"@deepseek-ai/dsh-agent": "^0.1.0-rc.8",
|
|
83
|
+
"@deepseek-ai/dsh-agent-default-model": "^0.1.0-rc.8",
|
|
84
|
+
"@deepseek-ai/dsh-commands": "^0.1.0-rc.8",
|
|
85
|
+
"@deepseek-ai/dsh-home-paths": "^0.1.0-rc.8",
|
|
86
|
+
"@deepseek-ai/dsh-invariants": "^0.1.0-rc.8",
|
|
87
|
+
"@deepseek-ai/dsh-llm": "^0.1.0-rc.8",
|
|
88
|
+
"@deepseek-ai/dsh-permission-presets": "^0.1.0-rc.8",
|
|
89
|
+
"@deepseek-ai/dsh-session": "^0.1.0-rc.8",
|
|
90
|
+
"@deepseek-ai/dsh-session-projection": "^0.1.0-rc.8",
|
|
91
|
+
"@deepseek-ai/dsh-session-query": "^0.1.0-rc.8",
|
|
92
|
+
"@deepseek-ai/dsh-token-meter": "^0.1.0-rc.8",
|
|
93
|
+
"@deepseek-ai/dsh-tools": "^0.1.0-rc.8",
|
|
94
|
+
"@deepseek-ai/dsh-user-approval": "^0.1.0-rc.8",
|
|
95
|
+
"@deepseek-ai/dsh-user-questions": "^0.1.0-rc.8"
|
|
94
96
|
},
|
|
95
97
|
"engines": {
|
|
96
98
|
"node": ">=22.19"
|