@cjhyy/code-shell-capability-coding 0.8.11 → 0.8.13

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.
@@ -1,7 +1,8 @@
1
- import { type AgentPreset, type BuiltinTool, type CapabilityModule } from "@cjhyy/code-shell-core/extension";
1
+ import { type AgentModule, type AgentPreset, type BuiltinTool } from "@cjhyy/code-shell-core/extension";
2
2
  export declare const CODING_TOOLS: readonly BuiltinTool[];
3
3
  /** Preserve the general host profile while adding coding-package tools tagged for it. */
4
4
  export declare const CODING_GENERAL_PRESET: AgentPreset;
5
5
  /** Full coding preset assembled from the core baseline plus this package's tools. */
6
6
  export declare const TERMINAL_CODING_PRESET: AgentPreset;
7
- export declare const CODING_CAPABILITY: CapabilityModule;
7
+ /** The coding product as a unified AgentModule. */
8
+ export declare function createCodingModule(): AgentModule;
@@ -151,33 +151,42 @@ export const TERMINAL_CODING_PRESET = {
151
151
  ...terminalCodingExposure.defaultPermissionRules,
152
152
  ],
153
153
  };
154
- export const CODING_CAPABILITY = {
155
- id: "coding",
156
- defaultPreset: "terminal-coding",
157
- tools: CODING_TOOLS,
158
- presets: [CODING_GENERAL_PRESET, TERMINAL_CODING_PRESET],
159
- promptSections: {
160
- coding: readFileSync(new URL("./prompt/coding.md", import.meta.url), "utf-8"),
161
- },
162
- dynamicContextProviders: [gitDynamicContextProvider],
163
- instructionBoundary: findCodingInstructionBoundary,
164
- createToolService: createCodingToolService,
165
- artifactDetectors: [codingArtifactDetector],
166
- fileHistory: [
167
- {
168
- toolName: "ApplyPatch",
169
- resolveTargets: (args, cwd) => typeof args.patch === "string" ? patchBackupTargets(args.patch, cwd) : [],
170
- },
171
- ],
172
- sessionWorkspace: {
173
- validateRoot: (root) => isGitWorktreeRoot(root),
174
- branchExists: (mainRoot, branch) => branchExists(mainRoot, branch),
175
- },
176
- adjustToolSelection: (names, context) => {
177
- if (context.host !== "desktop")
178
- return;
179
- names.delete("EnterWorktree");
180
- names.delete("ExitWorktree");
181
- names.add("SwitchSessionWorkspace");
154
+ const CODING_PROMPT_SECTIONS = {
155
+ coding: readFileSync(new URL("./prompt/coding.md", import.meta.url), "utf-8"),
156
+ };
157
+ const CODING_FILE_HISTORY = [
158
+ {
159
+ toolName: "ApplyPatch",
160
+ resolveTargets: (args, cwd) => typeof args.patch === "string" ? patchBackupTargets(args.patch, cwd) : [],
182
161
  },
162
+ ];
163
+ const CODING_SESSION_WORKSPACE = {
164
+ validateRoot: (root) => isGitWorktreeRoot(root),
165
+ branchExists: (mainRoot, branch) => branchExists(mainRoot, branch),
183
166
  };
167
+ function codingAdjustToolSelection(names, context) {
168
+ if (context.host !== "desktop")
169
+ return;
170
+ names.delete("EnterWorktree");
171
+ names.delete("ExitWorktree");
172
+ names.add("SwitchSessionWorkspace");
173
+ }
174
+ /** The coding product as a unified AgentModule. */
175
+ export function createCodingModule() {
176
+ return {
177
+ id: "coding",
178
+ engine: {
179
+ tools: CODING_TOOLS.map((tool) => ({ kind: "preset-tags", tool })),
180
+ presets: [CODING_GENERAL_PRESET, TERMINAL_CODING_PRESET],
181
+ defaultPreset: "terminal-coding",
182
+ promptSections: CODING_PROMPT_SECTIONS,
183
+ dynamicContextProviders: [gitDynamicContextProvider],
184
+ instructionBoundary: findCodingInstructionBoundary,
185
+ createToolService: createCodingToolService,
186
+ artifactDetectors: [codingArtifactDetector],
187
+ fileHistory: CODING_FILE_HISTORY,
188
+ sessionWorkspace: CODING_SESSION_WORKSPACE,
189
+ adjustToolSelection: codingAdjustToolSelection,
190
+ },
191
+ };
192
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cjhyy/code-shell-capability-coding",
3
- "version": "0.8.11",
3
+ "version": "0.8.13",
4
4
  "description": "Coding capability pack for the generic code-shell agent core.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -22,7 +22,6 @@
22
22
  "types": "./dist/index.orchestration.d.ts",
23
23
  "import": "./dist/index.orchestration.js"
24
24
  },
25
- "./bin/agent-server-stdio": "./dist/bin/agent-server-stdio.js",
26
25
  "./external-runtimes": {
27
26
  "types": "./dist/external-runtimes/index.d.ts",
28
27
  "import": "./dist/external-runtimes/index.js"
@@ -40,7 +39,7 @@
40
39
  "clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\""
41
40
  },
42
41
  "dependencies": {
43
- "@cjhyy/code-shell-core": "0.8.11"
42
+ "@cjhyy/code-shell-core": "0.8.13"
44
43
  },
45
44
  "engines": {
46
45
  "node": ">=20.10"
@@ -1 +0,0 @@
1
- export {};
@@ -1,4 +0,0 @@
1
- import { registerCapability } from "@cjhyy/code-shell-core/extension";
2
- import { CODING_CAPABILITY } from "../index.capability.js";
3
- registerCapability(CODING_CAPABILITY);
4
- await import("@cjhyy/code-shell-core/bin/agent-server-stdio");