dev-flow-deepseek 0.1.0 → 0.5.2
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 +111 -113
- package/cordis.patch.yml +2 -26
- package/lib/authorization.mjs +117 -0
- package/lib/index.mjs +114 -0
- package/lib/paths.mjs +121 -0
- package/lib/runtime.mjs +103 -0
- package/lib/tool-names.mjs +43 -0
- package/package.json +40 -43
- package/runtime/darwin-arm64/dev-flow +0 -0
- package/skills/dev-flow/SKILL.md +412 -57
- package/skills/dev-flow/references/method-profiles.md +153 -0
- package/skills/dev-flow/references/node-payloads.md +305 -0
- package/lib/backend-client.js +0 -139
- package/lib/canonical-json.js +0 -61
- package/lib/compatibility.js +0 -47
- package/lib/environment.js +0 -50
- package/lib/proxy.js +0 -87
- package/lib/result-envelope.js +0 -105
- package/skills/dev-flow/references/activation-and-routing.md +0 -89
package/lib/runtime.mjs
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { execFile as execFileCallback } from "node:child_process";
|
|
2
|
+
import { lstat, realpath, stat } from "node:fs/promises";
|
|
3
|
+
import { dirname, join } from "node:path";
|
|
4
|
+
import { promisify } from "node:util";
|
|
5
|
+
|
|
6
|
+
import { containedPath, packageRootFromModule } from "./paths.mjs";
|
|
7
|
+
|
|
8
|
+
export const SUPPORTED_RUNTIME_KEY = "darwin-arm64";
|
|
9
|
+
|
|
10
|
+
const execFile = promisify(execFileCallback);
|
|
11
|
+
const semverPattern = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/u;
|
|
12
|
+
|
|
13
|
+
export async function selectPackagedRuntime({
|
|
14
|
+
packageRoot = packageRootFromModule(import.meta.url),
|
|
15
|
+
platform = process.platform,
|
|
16
|
+
arch = process.arch,
|
|
17
|
+
} = {}) {
|
|
18
|
+
const runtimeKey = `${platform}-${arch}`;
|
|
19
|
+
if (runtimeKey !== SUPPORTED_RUNTIME_KEY) {
|
|
20
|
+
throw new Error(`unsupported platform ${runtimeKey}; dev-flow-deepseek supports ${SUPPORTED_RUNTIME_KEY}`);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const canonicalPackageRoot = await canonicalPackageDirectory(packageRoot);
|
|
24
|
+
return Object.freeze({
|
|
25
|
+
packageRoot: canonicalPackageRoot,
|
|
26
|
+
runtimeKey,
|
|
27
|
+
runtimePath: containedPath(
|
|
28
|
+
canonicalPackageRoot,
|
|
29
|
+
join(canonicalPackageRoot, "runtime", runtimeKey, "dev-flow"),
|
|
30
|
+
"packaged Core runtime",
|
|
31
|
+
),
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export async function preflightPackagedCore(
|
|
36
|
+
selection,
|
|
37
|
+
{
|
|
38
|
+
environment = process.env,
|
|
39
|
+
currentDirectory = dirname(selection?.runtimePath ?? "."),
|
|
40
|
+
} = {},
|
|
41
|
+
) {
|
|
42
|
+
if (!selection || selection.runtimeKey !== SUPPORTED_RUNTIME_KEY) {
|
|
43
|
+
throw new Error("packaged Core selection must use darwin-arm64");
|
|
44
|
+
}
|
|
45
|
+
const expectedRuntimePath = containedPath(
|
|
46
|
+
selection.packageRoot,
|
|
47
|
+
join(selection.packageRoot, "runtime", SUPPORTED_RUNTIME_KEY, "dev-flow"),
|
|
48
|
+
"packaged Core runtime",
|
|
49
|
+
);
|
|
50
|
+
if (selection.runtimePath !== expectedRuntimePath) {
|
|
51
|
+
throw new Error("packaged Core must use the exact package-relative runtime path");
|
|
52
|
+
}
|
|
53
|
+
await assertRegularExecutableFile(selection.runtimePath);
|
|
54
|
+
|
|
55
|
+
let stdout;
|
|
56
|
+
try {
|
|
57
|
+
({ stdout } = await execFile(selection.runtimePath, ["version"], {
|
|
58
|
+
cwd: currentDirectory,
|
|
59
|
+
env: environment,
|
|
60
|
+
encoding: "utf8",
|
|
61
|
+
maxBuffer: 64 * 1024,
|
|
62
|
+
windowsHide: true,
|
|
63
|
+
}));
|
|
64
|
+
} catch (error) {
|
|
65
|
+
throw new Error("packaged Core version preflight failed", { cause: error });
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const match = /^dev-flow (\S+)\n?$/u.exec(stdout);
|
|
69
|
+
if (!match || !semverPattern.test(match[1])) {
|
|
70
|
+
throw new Error("packaged Core returned an invalid version line");
|
|
71
|
+
}
|
|
72
|
+
return Object.freeze({ ...selection, version: match[1] });
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
async function canonicalPackageDirectory(path) {
|
|
76
|
+
try {
|
|
77
|
+
const canonical = await realpath(path);
|
|
78
|
+
const info = await stat(canonical);
|
|
79
|
+
if (!info.isDirectory()) throw new Error("not a directory");
|
|
80
|
+
return canonical;
|
|
81
|
+
} catch (error) {
|
|
82
|
+
throw new Error("package root must name an existing directory", { cause: error });
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
async function assertRegularExecutableFile(path) {
|
|
87
|
+
let info;
|
|
88
|
+
try {
|
|
89
|
+
info = await lstat(path);
|
|
90
|
+
} catch (error) {
|
|
91
|
+
throw new Error("packaged Core must be a regular executable file", { cause: error });
|
|
92
|
+
}
|
|
93
|
+
if (!info.isFile() || info.isSymbolicLink()) {
|
|
94
|
+
throw new Error("packaged Core must be a regular executable file");
|
|
95
|
+
}
|
|
96
|
+
if ((info.mode & 0o111) === 0) {
|
|
97
|
+
throw new Error("packaged Core must have executable mode");
|
|
98
|
+
}
|
|
99
|
+
const canonical = await realpath(path);
|
|
100
|
+
if (canonical !== path) {
|
|
101
|
+
throw new Error("packaged Core must use a canonical package-relative runtime path");
|
|
102
|
+
}
|
|
103
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export const DEV_FLOW_SERVER_NAME = "dev_flow";
|
|
2
|
+
export const DEV_FLOW_TOOL_NAMESPACE_PREFIX = `mcp__${DEV_FLOW_SERVER_NAME}__`;
|
|
3
|
+
|
|
4
|
+
export const DEV_FLOW_RAW_TOOL_NAMES = Object.freeze([
|
|
5
|
+
"dev_flow_server_info",
|
|
6
|
+
"dev_flow_open_task",
|
|
7
|
+
"dev_flow_get_task",
|
|
8
|
+
"dev_flow_get_next_action",
|
|
9
|
+
"dev_flow_apply_action",
|
|
10
|
+
"dev_flow_cancel_task",
|
|
11
|
+
]);
|
|
12
|
+
|
|
13
|
+
export const DEV_FLOW_QUALIFIED_TOOL_NAMES = Object.freeze(
|
|
14
|
+
DEV_FLOW_RAW_TOOL_NAMES.map((rawName) => `${DEV_FLOW_TOOL_NAMESPACE_PREFIX}${rawName}`),
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
const expectedQualifiedTools = new Set(DEV_FLOW_QUALIFIED_TOOL_NAMES);
|
|
18
|
+
|
|
19
|
+
export function isDevFlowNamespaceTool(name) {
|
|
20
|
+
return typeof name === "string" && name.startsWith(DEV_FLOW_TOOL_NAMESPACE_PREFIX);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function isExpectedDevFlowTool(name) {
|
|
24
|
+
return expectedQualifiedTools.has(name);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function assertQualifiedToolCatalog(toolNames, { allowUnavailable = false } = {}) {
|
|
28
|
+
const namespaceTools = [...toolNames]
|
|
29
|
+
.filter(isDevFlowNamespaceTool)
|
|
30
|
+
.sort();
|
|
31
|
+
if (allowUnavailable && namespaceTools.length === 0) return Object.freeze([]);
|
|
32
|
+
|
|
33
|
+
const expected = [...DEV_FLOW_QUALIFIED_TOOL_NAMES].sort();
|
|
34
|
+
if (
|
|
35
|
+
namespaceTools.length !== expected.length
|
|
36
|
+
|| namespaceTools.some((name, index) => name !== expected[index])
|
|
37
|
+
) {
|
|
38
|
+
throw new Error(
|
|
39
|
+
`Dev Flow tool catalog mismatch: received ${JSON.stringify(namespaceTools)}; expected ${JSON.stringify(expected)}`,
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
return DEV_FLOW_QUALIFIED_TOOL_NAMES;
|
|
43
|
+
}
|
package/package.json
CHANGED
|
@@ -1,58 +1,55 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dev-flow-deepseek",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.5.2",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "Explicit DeepSeek Harness adapter for the Dev Flow process graph.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "lib/index.mjs",
|
|
9
|
+
"files": [
|
|
10
|
+
"LICENSE",
|
|
11
|
+
"README.md",
|
|
12
|
+
"cordis.patch.yml",
|
|
13
|
+
"lib/authorization.mjs",
|
|
14
|
+
"lib/index.mjs",
|
|
15
|
+
"lib/paths.mjs",
|
|
16
|
+
"lib/runtime.mjs",
|
|
17
|
+
"lib/tool-names.mjs",
|
|
18
|
+
"runtime/darwin-arm64/dev-flow",
|
|
19
|
+
"skills/dev-flow/SKILL.md",
|
|
20
|
+
"skills/dev-flow/references/method-profiles.md",
|
|
21
|
+
"skills/dev-flow/references/node-payloads.md"
|
|
13
22
|
],
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"url": "https://github.com/Innocent-children/dev-flow-deepseek/issues"
|
|
20
|
-
},
|
|
21
|
-
"homepage": "https://github.com/Innocent-children/dev-flow-deepseek#readme",
|
|
22
|
-
"publishConfig": {
|
|
23
|
-
"access": "public",
|
|
24
|
-
"tag": "latest"
|
|
23
|
+
"scripts": {
|
|
24
|
+
"test": "node --test tests/*.test.mjs",
|
|
25
|
+
"test:package": "node --test tests/package-contract.test.mjs",
|
|
26
|
+
"test:bundle": "node --test tests/bundle-contract.test.mjs",
|
|
27
|
+
"pack:dry": "pnpm pack --dry-run --json"
|
|
25
28
|
},
|
|
26
29
|
"engines": {
|
|
27
|
-
"node": "
|
|
30
|
+
"node": ">=24"
|
|
28
31
|
},
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"cordis.patch.yml",
|
|
32
|
-
"skills/",
|
|
33
|
-
"README.md",
|
|
34
|
-
"LICENSE"
|
|
32
|
+
"os": [
|
|
33
|
+
"darwin"
|
|
35
34
|
],
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"js-yaml": "4.1.0",
|
|
43
|
-
"tsdown": "0.15.4",
|
|
44
|
-
"typescript": "5.8.3"
|
|
35
|
+
"cpu": [
|
|
36
|
+
"arm64"
|
|
37
|
+
],
|
|
38
|
+
"publishConfig": {
|
|
39
|
+
"access": "public",
|
|
40
|
+
"registry": "https://registry.npmjs.org/"
|
|
45
41
|
},
|
|
46
42
|
"dsh": {
|
|
47
43
|
"bundle": {
|
|
48
44
|
"patch": "./cordis.patch.yml"
|
|
49
45
|
}
|
|
50
46
|
},
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
"
|
|
56
|
-
"
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"@deepseek-ai/dsh-mcp-client": ">=0.1.0-rc.6"
|
|
49
|
+
},
|
|
50
|
+
"peerDependencies": {
|
|
51
|
+
"@deepseek-ai/cordis": ">=4.0.1 <5.0.0",
|
|
52
|
+
"@deepseek-ai/dsh-skill": ">=0.1.0-rc.6",
|
|
53
|
+
"@deepseek-ai/dsh-tools": ">=0.1.0-rc.6"
|
|
57
54
|
}
|
|
58
|
-
}
|
|
55
|
+
}
|
|
Binary file
|