@dsh-cc/claude-code-agents 0.5.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 +201 -0
- package/README.i18n.yaml +6 -0
- package/README.md +28 -0
- package/README.zh.md +28 -0
- package/lib/bundled/dsh-cc-guide.d.ts +4 -0
- package/lib/bundled/dsh-cc-guide.d.ts.map +1 -0
- package/lib/bundled/dsh-cc-guide.js +26 -0
- package/lib/bundled/dsh-cc-guide.js.map +1 -0
- package/lib/bundled/explore.d.ts +4 -0
- package/lib/bundled/explore.d.ts.map +1 -0
- package/lib/bundled/explore.js +28 -0
- package/lib/bundled/explore.js.map +1 -0
- package/lib/bundled/index.d.ts +23 -0
- package/lib/bundled/index.d.ts.map +1 -0
- package/lib/bundled/index.js +31 -0
- package/lib/bundled/index.js.map +1 -0
- package/lib/discovery.d.ts +56 -0
- package/lib/discovery.d.ts.map +1 -0
- package/lib/discovery.js +117 -0
- package/lib/discovery.js.map +1 -0
- package/lib/index.d.ts +45 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +40 -0
- package/lib/index.js.map +1 -0
- package/lib/invariant.d.ts +16 -0
- package/lib/invariant.d.ts.map +1 -0
- package/lib/invariant.js +22 -0
- package/lib/invariant.js.map +1 -0
- package/lib/parse.d.ts +51 -0
- package/lib/parse.d.ts.map +1 -0
- package/lib/parse.js +236 -0
- package/lib/parse.js.map +1 -0
- package/lib/restrict.d.ts +42 -0
- package/lib/restrict.d.ts.map +1 -0
- package/lib/restrict.js +78 -0
- package/lib/restrict.js.map +1 -0
- package/lib/types.d.ts +94 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/types.js +34 -0
- package/lib/types.js.map +1 -0
- package/package.json +58 -0
package/lib/types.d.ts
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared vocabulary for loading Claude Code's `.claude/agents/*.md` and
|
|
3
|
+
* `*.json` sub-agent definitions into the harness. The loader is a pure,
|
|
4
|
+
* filesystem-only translation: it produces one {@link AgentDefinition} per
|
|
5
|
+
* dispatched agent file, computing the effective tool restriction and the
|
|
6
|
+
* system prompt exactly as the source frontmatter declares them, so a later
|
|
7
|
+
* consumer (an agent preset row, a subagent driver) can mount them without
|
|
8
|
+
* re-reading agent semantics.
|
|
9
|
+
*
|
|
10
|
+
* Fields deliberately mirror the Claude Code agent schema so an existing
|
|
11
|
+
* `.claude/agents` tree ports without rewriting. Unknown frontmatter keys are
|
|
12
|
+
* ignored, not forwarded, so a definition authored against a newer Claude
|
|
13
|
+
* Code release degrades to the supported subset rather than failing to load.
|
|
14
|
+
*
|
|
15
|
+
* @module @dsh-cc/claude-code-agents/types
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* The layer an agent definition was discovered under; the precedence is
|
|
19
|
+
* `bundled` < `user` < `project` — a user-layer agent shadows its bundled
|
|
20
|
+
* namesake, and a project-layer agent shadows both.
|
|
21
|
+
*/
|
|
22
|
+
export type AgentSource = 'user' | 'project' | 'bundled';
|
|
23
|
+
/**
|
|
24
|
+
* The per-scope tool filter the loader computes from `tools` and
|
|
25
|
+
* `disallowedTools`. Structurally matches `@dsh-cc/tools`'s
|
|
26
|
+
* `ToolRestriction` (an `allow`/`deny` pair that intersects with sibling
|
|
27
|
+
* restrictions), so the value can be handed to a scoped `ctx.tools.restrict()`
|
|
28
|
+
* without translation. The loader declares it locally to stay dependency-free.
|
|
29
|
+
*/
|
|
30
|
+
export interface ToolRestriction {
|
|
31
|
+
/** Global tool names that stay visible; everything else is removed. */
|
|
32
|
+
readonly allow?: readonly string[];
|
|
33
|
+
/** Global tool names removed from visibility. */
|
|
34
|
+
readonly deny?: readonly string[];
|
|
35
|
+
}
|
|
36
|
+
/** Effort level accepted from frontmatter, modelled on CC's effort levels. */
|
|
37
|
+
export declare const EFFORT_LEVELS: readonly ["low", "medium", "high"];
|
|
38
|
+
/** A valid `effort` is one of the named levels or a positive integer. */
|
|
39
|
+
export type Effort = (typeof EFFORT_LEVELS)[number] | number;
|
|
40
|
+
/** Permission mode the agent demands, mirrored from CC's permission modes. */
|
|
41
|
+
export declare const PERMISSION_MODES: readonly ["default", "acceptEdits", "bypassPermissions", "plan"];
|
|
42
|
+
/** A valid `permissionMode`. */
|
|
43
|
+
export type PermissionMode = (typeof PERMISSION_MODES)[number];
|
|
44
|
+
/** Persistent memory scope an agent carries across sessions. */
|
|
45
|
+
export declare const MEMORY_SCOPES: readonly ["user", "project", "local"];
|
|
46
|
+
/** A valid `memory` scope. */
|
|
47
|
+
export type MemoryScope = (typeof MEMORY_SCOPES)[number];
|
|
48
|
+
/** The isolation modes the loader accepts; only `worktree` is portable. */
|
|
49
|
+
export declare const ISOLATION_MODES: readonly ["worktree"];
|
|
50
|
+
/** A valid `isolation`. */
|
|
51
|
+
export type IsolationMode = (typeof ISOLATION_MODES)[number];
|
|
52
|
+
/**
|
|
53
|
+
* One loaded Claude Code agent definition: the validated, translated record
|
|
54
|
+
* the loader returns and a consumer mounts.
|
|
55
|
+
*/
|
|
56
|
+
export interface AgentDefinition {
|
|
57
|
+
/** Unique agent type name, taken from the file's basename without extension. */
|
|
58
|
+
readonly agentType: string;
|
|
59
|
+
/** The frontmatter `description`, surfaced as the model's when-to-use guide. */
|
|
60
|
+
readonly whenToUse: string;
|
|
61
|
+
/** The system prompt: the markdown body, or the frontmatter `prompt` override. */
|
|
62
|
+
readonly systemPrompt: string;
|
|
63
|
+
/** The layer this definition was discovered under. */
|
|
64
|
+
readonly source: AgentSource;
|
|
65
|
+
/** The agent's own parent directory (the `.claude/agents` dir that held it). */
|
|
66
|
+
readonly baseDir: string;
|
|
67
|
+
/** Original file basename without extension (`{agentType}` for `.md`). */
|
|
68
|
+
readonly filename: string;
|
|
69
|
+
/** Effective tool restriction; present when `tools` and/or `disallowedTools` were. */
|
|
70
|
+
readonly toolRestriction?: ToolRestriction;
|
|
71
|
+
/** Skill names to preload, in declaration order. */
|
|
72
|
+
readonly skills?: readonly string[];
|
|
73
|
+
/** MCP server names this agent requires, referenced by name only. */
|
|
74
|
+
readonly mcpServers?: readonly string[];
|
|
75
|
+
/** Hooks declarations, passed through unmodified. */
|
|
76
|
+
readonly hooks?: Record<string, unknown>;
|
|
77
|
+
/** `model` as written, normalized lowercased-and-trimmed; `'inherit'` is literal. */
|
|
78
|
+
readonly model?: string;
|
|
79
|
+
/** Reasoning effort overrides, when declared. */
|
|
80
|
+
readonly effort?: Effort;
|
|
81
|
+
/** Permission mode the agent selects when it starts. */
|
|
82
|
+
readonly permissionMode?: PermissionMode;
|
|
83
|
+
/** Maximum agentic turns before stopping. */
|
|
84
|
+
readonly maxTurns?: number;
|
|
85
|
+
/** Initial prompt delivered as the first inbox message. */
|
|
86
|
+
readonly initialPrompt?: string;
|
|
87
|
+
/** Whether spawned runs should default to the background. */
|
|
88
|
+
readonly background?: boolean;
|
|
89
|
+
/** Persistent memory scope. */
|
|
90
|
+
readonly memory?: MemoryScope;
|
|
91
|
+
/** Isolation mode; `worktree` requires a provider that supports it. */
|
|
92
|
+
readonly isolation?: IsolationMode;
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,CAAA;AAExD;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC9B,uEAAuE;IACvE,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IAClC,iDAAiD;IACjD,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAClC;AAED,8EAA8E;AAC9E,eAAO,MAAM,aAAa,oCAIhB,CAAA;AAEV,yEAAyE;AACzE,MAAM,MAAM,MAAM,GAAG,C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,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,iDAAiD;IACjD,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IACxB,wDAAwD;IACxD,QAAQ,CAAC,cAAc,CAAC,EAAE,cAAc,CAAA;IACxC,6CAA6C;IAC7C,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;IAC1B,2DAA2D;IAC3D,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAA;IAC/B,6DAA6D;IAC7D,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAA;IAC7B,+BAA+B;IAC/B,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAA;IAC7B,uEAAuE;IACvE,QAAQ,CAAC,SAAS,CAAC,EAAE,aAAa,CAAA;CACnC"}
|
package/lib/types.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared vocabulary for loading Claude Code's `.claude/agents/*.md` and
|
|
3
|
+
* `*.json` sub-agent definitions into the harness. The loader is a pure,
|
|
4
|
+
* filesystem-only translation: it produces one {@link AgentDefinition} per
|
|
5
|
+
* dispatched agent file, computing the effective tool restriction and the
|
|
6
|
+
* system prompt exactly as the source frontmatter declares them, so a later
|
|
7
|
+
* consumer (an agent preset row, a subagent driver) can mount them without
|
|
8
|
+
* re-reading agent semantics.
|
|
9
|
+
*
|
|
10
|
+
* Fields deliberately mirror the Claude Code agent schema so an existing
|
|
11
|
+
* `.claude/agents` tree ports without rewriting. Unknown frontmatter keys are
|
|
12
|
+
* ignored, not forwarded, so a definition authored against a newer Claude
|
|
13
|
+
* Code release degrades to the supported subset rather than failing to load.
|
|
14
|
+
*
|
|
15
|
+
* @module @dsh-cc/claude-code-agents/types
|
|
16
|
+
*/
|
|
17
|
+
/** Effort level accepted from frontmatter, modelled on CC's effort levels. */
|
|
18
|
+
export const EFFORT_LEVELS = [
|
|
19
|
+
'low',
|
|
20
|
+
'medium',
|
|
21
|
+
'high',
|
|
22
|
+
];
|
|
23
|
+
/** Permission mode the agent demands, mirrored from CC's permission modes. */
|
|
24
|
+
export const PERMISSION_MODES = [
|
|
25
|
+
'default',
|
|
26
|
+
'acceptEdits',
|
|
27
|
+
'bypassPermissions',
|
|
28
|
+
'plan',
|
|
29
|
+
];
|
|
30
|
+
/** Persistent memory scope an agent carries across sessions. */
|
|
31
|
+
export const MEMORY_SCOPES = ['user', 'project', 'local'];
|
|
32
|
+
/** The isolation modes the loader accepts; only `worktree` is portable. */
|
|
33
|
+
export const ISOLATION_MODES = ['worktree'];
|
|
34
|
+
//# sourceMappingURL=types.js.map
|
package/lib/types.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAuBH,8EAA8E;AAC9E,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,KAAK;IACL,QAAQ;IACR,MAAM;CACE,CAAA;AAKV,8EAA8E;AAC9E,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,SAAS;IACT,aAAa;IACb,mBAAmB;IACnB,MAAM;CACE,CAAA;AAKV,gEAAgE;AAChE,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAU,CAAA;AAKlE,2EAA2E;AAC3E,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,UAAU,CAAU,CAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dsh-cc/claude-code-agents",
|
|
3
|
+
"description": "Load Claude Code `.claude/agents` definitions as agent presets for the DeepSeek Harness",
|
|
4
|
+
"version": "0.5.0",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/dsh-cc/dsh-cc.git",
|
|
8
|
+
"directory": "packages/preset/claude-code-agents"
|
|
9
|
+
},
|
|
10
|
+
"type": "module",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./lib/index.d.ts",
|
|
14
|
+
"default": "./lib/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./parse": {
|
|
17
|
+
"types": "./lib/parse.d.ts",
|
|
18
|
+
"default": "./lib/parse.js"
|
|
19
|
+
},
|
|
20
|
+
"./restrict": {
|
|
21
|
+
"types": "./lib/restrict.d.ts",
|
|
22
|
+
"default": "./lib/restrict.js"
|
|
23
|
+
},
|
|
24
|
+
"./discovery": {
|
|
25
|
+
"types": "./lib/discovery.d.ts",
|
|
26
|
+
"default": "./lib/discovery.js"
|
|
27
|
+
},
|
|
28
|
+
"./types": {
|
|
29
|
+
"types": "./lib/types.d.ts",
|
|
30
|
+
"default": "./lib/types.js"
|
|
31
|
+
},
|
|
32
|
+
"./invariant": {
|
|
33
|
+
"types": "./lib/invariant.d.ts",
|
|
34
|
+
"default": "./lib/invariant.js"
|
|
35
|
+
},
|
|
36
|
+
"./package.json": "./package.json"
|
|
37
|
+
},
|
|
38
|
+
"files": [
|
|
39
|
+
"lib"
|
|
40
|
+
],
|
|
41
|
+
"license": "Apache-2.0",
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"js-yaml": "^4.1.0"
|
|
44
|
+
},
|
|
45
|
+
"peerDependencies": {
|
|
46
|
+
"@deepseek-ai/cordis": ">=0.1.1-rc.2",
|
|
47
|
+
"@deepseek-ai/dsh-invariants": ">=0.1.1-rc.2",
|
|
48
|
+
"@dsh-cc/tools": "^0.5.0"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@deepseek-ai/cordis": "link:../../../../deepseek-harness/vendor/cordis",
|
|
52
|
+
"@deepseek-ai/dsh-invariants": "link:../../../../deepseek-harness/packages/runtime-diagnostics/invariants",
|
|
53
|
+
"@dsh-cc/tools": "^0.5.0"
|
|
54
|
+
},
|
|
55
|
+
"publishConfig": {
|
|
56
|
+
"access": "public"
|
|
57
|
+
}
|
|
58
|
+
}
|