@lmzhen/dsh-evolution-io-node 0.1.0-rc.1
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 +24 -0
- package/lib/index.js +63 -0
- package/lib/invariant.js +8 -0
- package/lib/types/index.d.ts +9 -0
- package/lib/types/invariant.d.ts +5 -0
- package/package.json +46 -0
package/README.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# @deepseek-ai/dsh-evolution-io-node
|
|
2
|
+
|
|
3
|
+
Local atomic node:fs IO provider
|
|
4
|
+
|
|
5
|
+
## Model Experience
|
|
6
|
+
|
|
7
|
+
### Indirect model surface
|
|
8
|
+
|
|
9
|
+
#### What the model sees
|
|
10
|
+
|
|
11
|
+
`@deepseek-ai/dsh-evolution-io-node` registers no direct prompt or tool schema itself. Model-visible effects are owned by the packages that consume this service.
|
|
12
|
+
|
|
13
|
+
#### Token effect
|
|
14
|
+
|
|
15
|
+
Zero direct token effect from this package; consumers add any model-visible tokens.
|
|
16
|
+
|
|
17
|
+
#### KV Cache effect
|
|
18
|
+
|
|
19
|
+
Independent of request-prefix construction. This package does not alter the assembled prompt or tool list.
|
|
20
|
+
|
|
21
|
+
## Known Limitations and Deferred Work
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
- - Local node:fs provider. Remote or shared media requires another `ctx.evolutionIo` provider.
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { cp, mkdir, readFile, readdir, rename, rm, writeFile } from "node:fs/promises";
|
|
2
|
+
import { dirname } from "node:path";
|
|
3
|
+
import { randomBytes } from "node:crypto";
|
|
4
|
+
//#region lib/types/index.js
|
|
5
|
+
/**
|
|
6
|
+
* Local atomic node:fs IO provider.
|
|
7
|
+
* @module @lmzhen/dsh-evolution-io-node
|
|
8
|
+
*/
|
|
9
|
+
const name = "evolution-io-node";
|
|
10
|
+
const inject = ["evolutionIo"];
|
|
11
|
+
function apply(ctx) {
|
|
12
|
+
const provider = {
|
|
13
|
+
name: "node",
|
|
14
|
+
async readText(path) {
|
|
15
|
+
try {
|
|
16
|
+
return await readFile(path, "utf8");
|
|
17
|
+
} catch {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
async writeText(path, content) {
|
|
22
|
+
await mkdir(dirname(path), { recursive: true });
|
|
23
|
+
const tmp = `${path}.${process.pid}.${randomBytes(6).toString("hex")}.tmp`;
|
|
24
|
+
await writeFile(tmp, content, "utf8");
|
|
25
|
+
await rename(tmp, path);
|
|
26
|
+
},
|
|
27
|
+
async remove(path) {
|
|
28
|
+
await rm(path, {
|
|
29
|
+
recursive: true,
|
|
30
|
+
force: true
|
|
31
|
+
});
|
|
32
|
+
},
|
|
33
|
+
async list(path) {
|
|
34
|
+
try {
|
|
35
|
+
return await readdir(path);
|
|
36
|
+
} catch {
|
|
37
|
+
return [];
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
async exists(path) {
|
|
41
|
+
try {
|
|
42
|
+
await readFile(path);
|
|
43
|
+
return true;
|
|
44
|
+
} catch {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
async rename(path, destination) {
|
|
49
|
+
await mkdir(dirname(destination), { recursive: true });
|
|
50
|
+
await rename(path, destination);
|
|
51
|
+
},
|
|
52
|
+
async copy(path, destination) {
|
|
53
|
+
await mkdir(dirname(destination), { recursive: true });
|
|
54
|
+
await cp(path, destination, {
|
|
55
|
+
recursive: true,
|
|
56
|
+
force: true
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
ctx.effect(() => ctx.evolutionIo.registerProvider(provider), "evolution-io-node.provider");
|
|
61
|
+
}
|
|
62
|
+
//#endregion
|
|
63
|
+
export { apply, inject, name };
|
package/lib/invariant.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//#region lib/types/invariant.js
|
|
2
|
+
const PACKAGE_NAME = "@deepseek-ai/dsh-evolution-io-node";
|
|
3
|
+
const name = "evolution-io-node-invariant";
|
|
4
|
+
const inject = ["invariants"];
|
|
5
|
+
const install = () => {};
|
|
6
|
+
const apply = (ctx) => Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install));
|
|
7
|
+
//#endregion
|
|
8
|
+
export { apply, inject, name };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Local atomic node:fs IO provider.
|
|
3
|
+
* @module @deepseek-ai/dsh-evolution-io-node
|
|
4
|
+
*/
|
|
5
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
6
|
+
export declare const name = "evolution-io-node";
|
|
7
|
+
export declare const inject: string[];
|
|
8
|
+
export declare function apply(ctx: Context): void;
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@lmzhen/dsh-evolution-io-node",
|
|
3
|
+
"description": "Local atomic node:fs IO provider (community build)",
|
|
4
|
+
"version": "0.1.0-rc.1",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/lmzhen/dsh-evolution.git",
|
|
11
|
+
"directory": "packages/dsh-evolution-io-node"
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"main": "lib/index.js",
|
|
15
|
+
"types": "lib/types/index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./lib/types/index.d.ts",
|
|
19
|
+
"default": "./lib/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./invariant": {
|
|
22
|
+
"types": "./lib/types/invariant.d.ts",
|
|
23
|
+
"default": "./lib/invariant.js"
|
|
24
|
+
},
|
|
25
|
+
"./package.json": "./package.json"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"lib/index.js",
|
|
29
|
+
"lib/invariant.js",
|
|
30
|
+
"lib/types/**/*.d.ts",
|
|
31
|
+
"lib/types/invariant.d.ts"
|
|
32
|
+
],
|
|
33
|
+
"license": "MIT",
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@deepseek-ai/schemastery": "^3.18.1"
|
|
36
|
+
},
|
|
37
|
+
"peerDependencies": {
|
|
38
|
+
"@deepseek-ai/dsh-invariants": "^0.1.0-rc.6",
|
|
39
|
+
"@deepseek-ai/cordis": "^4.0.1",
|
|
40
|
+
"@lmzhen/dsh-evolution-io": "^0.1.0-rc.1"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@deepseek-ai/dsh-invariants": "^0.1.0-rc.6",
|
|
44
|
+
"@lmzhen/dsh-evolution-io": "^0.1.0-rc.1"
|
|
45
|
+
}
|
|
46
|
+
}
|