dsh-loop-engine 1.0.0-rc10
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 +121 -0
- package/README.zh.md +38 -0
- package/cordis.patch.yml +3 -0
- package/lib/client.js +37506 -0
- package/lib/index.js +6412 -0
- package/lib/invariant.js +108 -0
- package/lib/types/client/LoopEngineBadge.d.ts +34 -0
- package/lib/types/client/LoopEngineComposerSelect.d.ts +40 -0
- package/lib/types/client/LoopEngineSection.d.ts +34 -0
- package/lib/types/client/index.d.ts +29 -0
- package/lib/types/client/locales.d.ts +46 -0
- package/lib/types/client/store.d.ts +58 -0
- package/lib/types/commands.d.ts +69 -0
- package/lib/types/driver-core/context-files.d.ts +62 -0
- package/lib/types/driver-core/ownership.d.ts +40 -0
- package/lib/types/driver-core/permission-knobs.d.ts +26 -0
- package/lib/types/driver-core/prompt.d.ts +23 -0
- package/lib/types/driver-core/skill-inject.d.ts +59 -0
- package/lib/types/engine-claude/agent.d.ts +104 -0
- package/lib/types/engine-claude/loop.d.ts +111 -0
- package/lib/types/engine-claude/mapping.d.ts +83 -0
- package/lib/types/engine-claude/permission.d.ts +41 -0
- package/lib/types/engine-claude/process.d.ts +59 -0
- package/lib/types/engine-claude/sdk.d.ts +57 -0
- package/lib/types/engine-claude/types.d.ts +18 -0
- package/lib/types/engine-codex/agent.d.ts +111 -0
- package/lib/types/engine-codex/appserver/client.d.ts +49 -0
- package/lib/types/engine-codex/appserver/mapping.d.ts +67 -0
- package/lib/types/engine-codex/appserver/thread.d.ts +66 -0
- package/lib/types/engine-codex/appserver/types.d.ts +215 -0
- package/lib/types/engine-codex/loop.d.ts +114 -0
- package/lib/types/engine-codex/permission.d.ts +32 -0
- package/lib/types/engine-codex/skills.d.ts +29 -0
- package/lib/types/engine-codex/types.d.ts +19 -0
- package/lib/types/engine-kimi/acp/client.d.ts +76 -0
- package/lib/types/engine-kimi/acp/mapping.d.ts +44 -0
- package/lib/types/engine-kimi/acp/types.d.ts +95 -0
- package/lib/types/engine-kimi/agent.d.ts +123 -0
- package/lib/types/engine-kimi/commands.d.ts +40 -0
- package/lib/types/engine-kimi/loop.d.ts +108 -0
- package/lib/types/engine-kimi/mapping.d.ts +71 -0
- package/lib/types/engine-kimi/permission.d.ts +28 -0
- package/lib/types/engine-kimi/process.d.ts +61 -0
- package/lib/types/engine-kimi/skills.d.ts +57 -0
- package/lib/types/engine-kimi/types.d.ts +23 -0
- package/lib/types/engine-pi/agent.d.ts +135 -0
- package/lib/types/engine-pi/loop.d.ts +123 -0
- package/lib/types/engine-pi/permission.d.ts +43 -0
- package/lib/types/engine-pi/probe.d.ts +23 -0
- package/lib/types/engine-pi/rpc/client.d.ts +105 -0
- package/lib/types/engine-pi/rpc/mapping.d.ts +37 -0
- package/lib/types/engine-pi/rpc/types.d.ts +235 -0
- package/lib/types/engine-pi/skills.d.ts +55 -0
- package/lib/types/engine-pi/types.d.ts +27 -0
- package/lib/types/index.d.ts +114 -0
- package/lib/types/invariant.d.ts +23 -0
- package/lib/types/namespace.d.ts +9 -0
- package/lib/types/patch-manager.d.ts +59 -0
- package/lib/types/preset.d.ts +73 -0
- package/lib/types/provider-route.d.ts +49 -0
- package/lib/types/settings.d.ts +31 -0
- package/lib/types/skills.d.ts +93 -0
- package/package.json +103 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared loop-engine identity, namespace, and schema.
|
|
3
|
+
*
|
|
4
|
+
* The namespace literal lives in the zero-import `./namespace.ts` so both
|
|
5
|
+
* halves agree on the section name: the node half brands it as a
|
|
6
|
+
* `SettingsNamespace`, while the browser half imports the same literal
|
|
7
|
+
* without pulling the host-side `dsh-settings` service into the client
|
|
8
|
+
* bundle (cross-plugin value imports go through cordis services, and
|
|
9
|
+
* `settings-scope.ts` follows the same discipline).
|
|
10
|
+
*
|
|
11
|
+
* @module dsh-loop-engine/settings
|
|
12
|
+
*/
|
|
13
|
+
import z from '@deepseek-ai/schemastery';
|
|
14
|
+
import type { SettingsNamespace } from '@deepseek-ai/dsh-settings';
|
|
15
|
+
export { LOOP_ENGINE_SETTINGS_NAMESPACE_LITERAL } from './namespace.ts';
|
|
16
|
+
/** The installed engine driving new Agent turns. */
|
|
17
|
+
export declare const LOOP_ENGINE_IDS: readonly ["in-process", "claude-code", "codex", "pi", "kimi"];
|
|
18
|
+
/** Installed agent loop engine id. */
|
|
19
|
+
export type LoopEngineId = (typeof LOOP_ENGINE_IDS)[number];
|
|
20
|
+
/** Stored and composed loop engine selection. */
|
|
21
|
+
export interface LoopEngineSettings {
|
|
22
|
+
/** The engine future Agents are created on. */
|
|
23
|
+
engine: LoopEngineId;
|
|
24
|
+
/** Whether the composer's loop engine picker is shown on the chat page. */
|
|
25
|
+
showInComposer: boolean;
|
|
26
|
+
}
|
|
27
|
+
/** Schema of the loop engine settings section. */
|
|
28
|
+
export declare const LOOP_ENGINE_SETTINGS_SCHEMA: z<LoopEngineSettings>;
|
|
29
|
+
/** The shared literal branded as a settings namespace on the node side. */
|
|
30
|
+
export declare function loopEngineSettingsNamespace(): SettingsNamespace;
|
|
31
|
+
//# sourceMappingURL=settings.d.ts.map
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Claude Code skill provider: discovers skills from the project's `.claude/`
|
|
3
|
+
* directory, the user-level `~/.claude/skills/` directory, and the project's
|
|
4
|
+
* `CLAUDE.md` file, using the same YAML-frontmatter + markdown format as DSH
|
|
5
|
+
* skills.
|
|
6
|
+
*
|
|
7
|
+
* @module dsh-loop-engine/skills
|
|
8
|
+
*/
|
|
9
|
+
export interface SkillInvocationPolicy {
|
|
10
|
+
readonly modelInvocable: boolean;
|
|
11
|
+
readonly userInvocable: boolean;
|
|
12
|
+
}
|
|
13
|
+
export type SkillSource = string;
|
|
14
|
+
export interface SkillCandidate {
|
|
15
|
+
readonly name: string;
|
|
16
|
+
readonly description: string;
|
|
17
|
+
readonly whenToUse?: string;
|
|
18
|
+
readonly invocation: SkillInvocationPolicy;
|
|
19
|
+
readonly source: SkillSource;
|
|
20
|
+
readonly provider: string;
|
|
21
|
+
readonly rank: number;
|
|
22
|
+
readonly locator: unknown;
|
|
23
|
+
readonly path?: string;
|
|
24
|
+
readonly resourceBase?: {
|
|
25
|
+
readonly kind: string;
|
|
26
|
+
readonly path: string;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export interface SkillDefinition {
|
|
30
|
+
readonly name: string;
|
|
31
|
+
readonly description: string;
|
|
32
|
+
readonly whenToUse?: string;
|
|
33
|
+
readonly invocation: SkillInvocationPolicy;
|
|
34
|
+
readonly source: SkillSource;
|
|
35
|
+
readonly provider: string;
|
|
36
|
+
readonly content: string;
|
|
37
|
+
readonly path?: string;
|
|
38
|
+
readonly resourceBase?: {
|
|
39
|
+
readonly kind: string;
|
|
40
|
+
readonly path: string;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export interface SkillLookupOptions {
|
|
44
|
+
readonly cwd?: string;
|
|
45
|
+
readonly signal?: AbortSignal;
|
|
46
|
+
}
|
|
47
|
+
export interface SkillProvider {
|
|
48
|
+
readonly name: string;
|
|
49
|
+
list(options: SkillLookupOptions): Promise<readonly SkillCandidate[] | {
|
|
50
|
+
candidates: readonly SkillCandidate[];
|
|
51
|
+
complete: boolean;
|
|
52
|
+
}>;
|
|
53
|
+
get(candidate: SkillCandidate, options: SkillLookupOptions): Promise<SkillDefinition | undefined>;
|
|
54
|
+
}
|
|
55
|
+
export interface SkillProviderControl {
|
|
56
|
+
readonly signal: AbortSignal;
|
|
57
|
+
invalidate(): void;
|
|
58
|
+
}
|
|
59
|
+
/** One parsed agents-skill standard skill: frontmatter metadata plus the body. */
|
|
60
|
+
export interface ParsedSkill {
|
|
61
|
+
name: string;
|
|
62
|
+
description: string;
|
|
63
|
+
whenToUse?: string;
|
|
64
|
+
invocation: SkillInvocationPolicy;
|
|
65
|
+
content: string;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Parse one agents-skill standard file: YAML frontmatter (`name`,
|
|
69
|
+
* `description`, optional `whenToUse`/`disable-model-invocation`/
|
|
70
|
+
* `user-invocable`) plus the markdown body.
|
|
71
|
+
* @param raw - the raw file content.
|
|
72
|
+
* @returns the parsed skill, or `undefined` when the file is not a skill.
|
|
73
|
+
*/
|
|
74
|
+
export declare function parseSkillFile(raw: string): ParsedSkill | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* Skill provider that discovers skills from Claude Code's standard locations:
|
|
77
|
+
* - `<project>/.claude/skills/` — project skills
|
|
78
|
+
* - `~/.claude/skills/` — personal skills
|
|
79
|
+
* Each location accepts both Claude Code layouts: a `<name>/SKILL.md`
|
|
80
|
+
* directory (its directory becomes the resource base) and a flat `<name>.md`
|
|
81
|
+
* file. `CLAUDE.md` in the project root is also read when it carries skill
|
|
82
|
+
* frontmatter.
|
|
83
|
+
*/
|
|
84
|
+
export declare class ClaudeCodeSkillProvider implements SkillProvider {
|
|
85
|
+
private readonly control;
|
|
86
|
+
readonly name = "claude-code";
|
|
87
|
+
constructor(control: SkillProviderControl);
|
|
88
|
+
list(options: SkillLookupOptions): Promise<readonly SkillCandidate[]>;
|
|
89
|
+
get(candidate: SkillCandidate, _options: SkillLookupOptions): Promise<SkillDefinition | undefined>;
|
|
90
|
+
}
|
|
91
|
+
export declare function findProjectRoot(cwd: string): Promise<string>;
|
|
92
|
+
export default ClaudeCodeSkillProvider;
|
|
93
|
+
//# sourceMappingURL=skills.d.ts.map
|
package/package.json
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "dsh-loop-engine",
|
|
3
|
+
"description": "Web-switchable agent loop engine selection for the DeepSeek Harness - out-of-tree plugin (Claude Code / Codex / Pi / Kimi Code drivers) maintained by @kuun993, zero main-repo changes",
|
|
4
|
+
"version": "1.0.0-rc10",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"repository": "github:kuun993/dsh-loop-engine",
|
|
9
|
+
"type": "module",
|
|
10
|
+
"main": "lib/index.js",
|
|
11
|
+
"types": "lib/types/index.d.ts",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./lib/types/index.d.ts",
|
|
15
|
+
"default": "./lib/index.js"
|
|
16
|
+
},
|
|
17
|
+
"./invariant": {
|
|
18
|
+
"types": "./lib/types/invariant.d.ts",
|
|
19
|
+
"default": "./lib/invariant.js"
|
|
20
|
+
},
|
|
21
|
+
"./client": {
|
|
22
|
+
"types": "./lib/types/client/index.d.ts",
|
|
23
|
+
"default": "./lib/client.js"
|
|
24
|
+
},
|
|
25
|
+
"./src/*": "./src/*",
|
|
26
|
+
"./package.json": "./package.json"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"lib/index.js",
|
|
30
|
+
"lib/invariant.js",
|
|
31
|
+
"lib/client.js",
|
|
32
|
+
"lib/types/**/*.d.ts",
|
|
33
|
+
"cordis.patch.yml"
|
|
34
|
+
],
|
|
35
|
+
"license": "MIT",
|
|
36
|
+
"scripts": {
|
|
37
|
+
"build": "node build.mjs",
|
|
38
|
+
"typecheck": "tsc -p tsconfig.build.json --noEmit",
|
|
39
|
+
"test": "vitest run",
|
|
40
|
+
"test:coverage": "vitest run --coverage"
|
|
41
|
+
},
|
|
42
|
+
"dsh": {
|
|
43
|
+
"bundle": {
|
|
44
|
+
"patch": "./cordis.patch.yml"
|
|
45
|
+
},
|
|
46
|
+
"client": {
|
|
47
|
+
"inject": [
|
|
48
|
+
"@deepseek-ai/dsh-client-locale",
|
|
49
|
+
"@deepseek-ai/dsh-client-ui-settings",
|
|
50
|
+
"@deepseek-ai/dsh-api-remotes"
|
|
51
|
+
],
|
|
52
|
+
"platform": "web",
|
|
53
|
+
"external": [
|
|
54
|
+
"@deepseek-ai/dsh-client-locale/client",
|
|
55
|
+
"@deepseek-ai/dsh-client-ui-settings/client",
|
|
56
|
+
"@deepseek-ai/dsh-api-remotes/client",
|
|
57
|
+
"@deepseek-ai/dsh-settings/types"
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"dependencies": {
|
|
62
|
+
"@anthropic-ai/claude-agent-sdk": "0.3.220",
|
|
63
|
+
"@anthropic-ai/sdk": "0.93.0",
|
|
64
|
+
"@deepseek-ai/schemastery": "3.18.1",
|
|
65
|
+
"@earendil-works/pi-coding-agent": "0.84.3",
|
|
66
|
+
"@openai/codex": "0.149.1"
|
|
67
|
+
},
|
|
68
|
+
"peerDependencies": {
|
|
69
|
+
"@deepseek-ai/cordis": "^4.0.1",
|
|
70
|
+
"@deepseek-ai/dsh-agent": "0.1.2-rc.1",
|
|
71
|
+
"@deepseek-ai/dsh-invariants": "0.1.2-rc.1",
|
|
72
|
+
"@deepseek-ai/dsh-llm": "0.1.2-rc.1",
|
|
73
|
+
"@deepseek-ai/dsh-scope": "0.1.2-rc.1",
|
|
74
|
+
"@deepseek-ai/dsh-session": "0.1.2-rc.1",
|
|
75
|
+
"@deepseek-ai/dsh-session-persistence": "0.1.2-rc.1",
|
|
76
|
+
"@deepseek-ai/dsh-settings": "0.1.2-rc.1",
|
|
77
|
+
"@deepseek-ai/dsh-subprocess": "0.1.2-rc.1",
|
|
78
|
+
"@deepseek-ai/dsh-timeout": "0.1.2-rc.1"
|
|
79
|
+
},
|
|
80
|
+
"devDependencies": {
|
|
81
|
+
"@deepseek-ai/dsh-attachment": "0.1.2-rc.1",
|
|
82
|
+
"@deepseek-ai/dsh-client-locale": "0.1.2-rc.1",
|
|
83
|
+
"@deepseek-ai/dsh-client-store": "0.1.2-rc.1",
|
|
84
|
+
"@deepseek-ai/dsh-client-ui-renderer": "0.1.2-rc.1",
|
|
85
|
+
"@deepseek-ai/dsh-client-ui-conversation": "0.1.2-rc.1",
|
|
86
|
+
"@deepseek-ai/dsh-client-ui-primitives": "0.1.2-rc.1",
|
|
87
|
+
"@deepseek-ai/dsh-client-ui-settings": "0.1.2-rc.1",
|
|
88
|
+
"@deepseek-ai/dsh-client-ui-slots": "0.1.2-rc.1",
|
|
89
|
+
"@deepseek-ai/dsh-home-paths": "0.1.2-rc.1",
|
|
90
|
+
"@deepseek-ai/dsh-session-persistence-jsonl": "0.1.2-rc.1",
|
|
91
|
+
"@deepseek-ai/dsh-subprocess-local": "0.1.2-rc.1",
|
|
92
|
+
"@deepseek-ai/dsh-system-prompt": "0.1.2-rc.1",
|
|
93
|
+
"@types/node": "^22.20.0",
|
|
94
|
+
"@types/react": "^19.0.0",
|
|
95
|
+
"@vitest/coverage-v8": "^4.1.8",
|
|
96
|
+
"esbuild": "^0.28.2",
|
|
97
|
+
"tsx": "^4.22.4",
|
|
98
|
+
"typescript": "^6.0.3",
|
|
99
|
+
"vite": "^7.0.0",
|
|
100
|
+
"vite-tsconfig-paths": "^6.1.1",
|
|
101
|
+
"vitest": "^4.1.8"
|
|
102
|
+
}
|
|
103
|
+
}
|