dsh-loop-engine 1.0.0-rc2

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 (46) hide show
  1. package/README.md +151 -0
  2. package/README.zh.md +93 -0
  3. package/lib/client.js +403 -0
  4. package/lib/index.js +4310 -0
  5. package/lib/invariant.js +83 -0
  6. package/lib/types/client/LoopEngineBadge.d.ts +34 -0
  7. package/lib/types/client/LoopEngineSection.d.ts +34 -0
  8. package/lib/types/client/index.d.ts +28 -0
  9. package/lib/types/client/locales.d.ts +40 -0
  10. package/lib/types/client/store.d.ts +45 -0
  11. package/lib/types/commands.d.ts +32 -0
  12. package/lib/types/driver-core/ownership.d.ts +41 -0
  13. package/lib/types/driver-core/permission-knobs.d.ts +26 -0
  14. package/lib/types/driver-core/prompt.d.ts +23 -0
  15. package/lib/types/driver-core/skill-inject.d.ts +59 -0
  16. package/lib/types/engine-claude/agent.d.ts +102 -0
  17. package/lib/types/engine-claude/loop.d.ts +89 -0
  18. package/lib/types/engine-claude/mapping.d.ts +83 -0
  19. package/lib/types/engine-claude/permission.d.ts +41 -0
  20. package/lib/types/engine-claude/process.d.ts +59 -0
  21. package/lib/types/engine-claude/sdk.d.ts +57 -0
  22. package/lib/types/engine-claude/types.d.ts +18 -0
  23. package/lib/types/engine-codex/agent.d.ts +109 -0
  24. package/lib/types/engine-codex/appserver/client.d.ts +49 -0
  25. package/lib/types/engine-codex/appserver/mapping.d.ts +67 -0
  26. package/lib/types/engine-codex/appserver/thread.d.ts +66 -0
  27. package/lib/types/engine-codex/appserver/types.d.ts +215 -0
  28. package/lib/types/engine-codex/loop.d.ts +92 -0
  29. package/lib/types/engine-codex/permission.d.ts +32 -0
  30. package/lib/types/engine-codex/skills.d.ts +26 -0
  31. package/lib/types/engine-codex/types.d.ts +19 -0
  32. package/lib/types/engine-pi/agent.d.ts +125 -0
  33. package/lib/types/engine-pi/loop.d.ts +96 -0
  34. package/lib/types/engine-pi/permission.d.ts +43 -0
  35. package/lib/types/engine-pi/rpc/client.d.ts +105 -0
  36. package/lib/types/engine-pi/rpc/mapping.d.ts +37 -0
  37. package/lib/types/engine-pi/rpc/types.d.ts +235 -0
  38. package/lib/types/engine-pi/skills.d.ts +26 -0
  39. package/lib/types/engine-pi/types.d.ts +27 -0
  40. package/lib/types/index.d.ts +96 -0
  41. package/lib/types/invariant.d.ts +23 -0
  42. package/lib/types/namespace.d.ts +9 -0
  43. package/lib/types/patch-manager.d.ts +47 -0
  44. package/lib/types/settings.d.ts +29 -0
  45. package/lib/types/skills.d.ts +77 -0
  46. package/package.json +103 -0
@@ -0,0 +1,77 @@
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
+ /**
60
+ * Skill provider that discovers skills from Claude Code's standard locations:
61
+ * - `<project>/.claude/skills/` — project skills
62
+ * - `~/.claude/skills/` — personal skills
63
+ * Each location accepts both Claude Code layouts: a `<name>/SKILL.md`
64
+ * directory (its directory becomes the resource base) and a flat `<name>.md`
65
+ * file. `CLAUDE.md` in the project root is also read when it carries skill
66
+ * frontmatter.
67
+ */
68
+ export declare class ClaudeCodeSkillProvider implements SkillProvider {
69
+ private readonly control;
70
+ readonly name = "claude-code";
71
+ constructor(control: SkillProviderControl);
72
+ list(options: SkillLookupOptions): Promise<readonly SkillCandidate[]>;
73
+ get(candidate: SkillCandidate, _options: SkillLookupOptions): Promise<SkillDefinition | undefined>;
74
+ }
75
+ export declare function findProjectRoot(cwd: string): Promise<string>;
76
+ export default ClaudeCodeSkillProvider;
77
+ //# 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 drivers) maintained by @kuun993, zero main-repo changes",
4
+ "version": "1.0.0-rc2",
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
+ ],
34
+ "license": "MIT",
35
+ "scripts": {
36
+ "build": "node build.mjs",
37
+ "typecheck": "tsc -p tsconfig.build.json --noEmit",
38
+ "test": "vitest run",
39
+ "test:coverage": "vitest run --coverage"
40
+ },
41
+ "dsh": {
42
+ "bundle": {
43
+ "patch": "./cordis.patch.yml"
44
+ },
45
+ "client": {
46
+ "inject": [
47
+ "@deepseek-ai/dsh-client-locale",
48
+ "@deepseek-ai/dsh-client-runtime",
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-runtime/client",
56
+ "@deepseek-ai/dsh-client-ui-settings/client",
57
+ "@deepseek-ai/dsh-api-remotes/client",
58
+ "@deepseek-ai/dsh-settings/types"
59
+ ]
60
+ }
61
+ },
62
+ "dependencies": {
63
+ "@anthropic-ai/claude-agent-sdk": "0.3.220",
64
+ "@anthropic-ai/sdk": "0.93.0",
65
+ "@deepseek-ai/schemastery": "3.18.1",
66
+ "@earendil-works/pi-coding-agent": "0.84.3",
67
+ "@openai/codex": "0.149.1"
68
+ },
69
+ "peerDependencies": {
70
+ "@deepseek-ai/cordis": "^4.0.1",
71
+ "@deepseek-ai/dsh-agent": "0.1.1-rc.2",
72
+ "@deepseek-ai/dsh-invariants": "0.1.1-rc.2",
73
+ "@deepseek-ai/dsh-llm": "0.1.1-rc.2",
74
+ "@deepseek-ai/dsh-scope": "0.1.1-rc.2",
75
+ "@deepseek-ai/dsh-session": "0.1.1-rc.2",
76
+ "@deepseek-ai/dsh-session-persistence": "0.1.1-rc.2",
77
+ "@deepseek-ai/dsh-settings": "0.1.1-rc.2",
78
+ "@deepseek-ai/dsh-subprocess": "0.1.1-rc.2",
79
+ "@deepseek-ai/dsh-timeout": "0.1.1-rc.2"
80
+ },
81
+ "devDependencies": {
82
+ "@deepseek-ai/dsh-attachment": "0.1.1-rc.2",
83
+ "@deepseek-ai/dsh-client-locale": "0.1.1-rc.2",
84
+ "@deepseek-ai/dsh-client-runtime": "0.1.1-rc.2",
85
+ "@deepseek-ai/dsh-client-ui-conversation": "0.1.1-rc.2",
86
+ "@deepseek-ai/dsh-client-ui-primitives": "0.1.1-rc.2",
87
+ "@deepseek-ai/dsh-client-ui-settings": "0.1.1-rc.2",
88
+ "@deepseek-ai/dsh-client-ui-slots": "0.1.1-rc.2",
89
+ "@deepseek-ai/dsh-home-paths": "0.1.1-rc.2",
90
+ "@deepseek-ai/dsh-session-persistence-jsonl": "0.1.1-rc.2",
91
+ "@deepseek-ai/dsh-subprocess-local": "0.1.1-rc.2",
92
+ "@deepseek-ai/dsh-system-prompt": "0.1.1-rc.2",
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
+ }