@lmzhen/dsh-evolution-io 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 +31 -0
- package/lib/invariant.js +8 -0
- package/lib/types/index.d.ts +28 -0
- package/lib/types/invariant.d.ts +5 -0
- package/package.json +44 -0
package/README.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# @deepseek-ai/dsh-evolution-io
|
|
2
|
+
|
|
3
|
+
IO seam for evolution providers
|
|
4
|
+
|
|
5
|
+
## Model Experience
|
|
6
|
+
|
|
7
|
+
### Indirect model surface
|
|
8
|
+
|
|
9
|
+
#### What the model sees
|
|
10
|
+
|
|
11
|
+
`@deepseek-ai/dsh-evolution-io` 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
|
+
- No known durable consumer gaps at this time. Runtime contracts are covered by package and boundary tests.
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Service } from "@deepseek-ai/cordis";
|
|
2
|
+
//#region lib/types/index.js
|
|
3
|
+
/**
|
|
4
|
+
* IO seam for evolution providers.
|
|
5
|
+
* @module @lmzhen/dsh-evolution-io
|
|
6
|
+
*/
|
|
7
|
+
var EvolutionIoRegistry = class extends Service {
|
|
8
|
+
providers = /* @__PURE__ */ new Map();
|
|
9
|
+
constructor(ctx) {
|
|
10
|
+
super(ctx, "evolutionIo");
|
|
11
|
+
}
|
|
12
|
+
registerProvider(provider) {
|
|
13
|
+
if (this.providers.has(provider.name)) throw new Error(`evolution IO provider "${provider.name}" already registered`);
|
|
14
|
+
this.providers.set(provider.name, provider);
|
|
15
|
+
return () => {
|
|
16
|
+
if (this.providers.get(provider.name) === provider) this.providers.delete(provider.name);
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
provider(name) {
|
|
20
|
+
if (name) {
|
|
21
|
+
const provider = this.providers.get(name);
|
|
22
|
+
if (provider) return provider;
|
|
23
|
+
throw new Error(`evolution IO provider "${name}" is not registered`);
|
|
24
|
+
}
|
|
25
|
+
const first = this.providers.values().next().value;
|
|
26
|
+
if (!first) throw new Error("no evolution IO provider registered");
|
|
27
|
+
return first;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
//#endregion
|
|
31
|
+
export { EvolutionIoRegistry, EvolutionIoRegistry as default };
|
package/lib/invariant.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//#region lib/types/invariant.js
|
|
2
|
+
const PACKAGE_NAME = "@deepseek-ai/dsh-evolution-io";
|
|
3
|
+
const name = "evolution-io-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,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IO seam for evolution providers.
|
|
3
|
+
* @module @deepseek-ai/dsh-evolution-io
|
|
4
|
+
*/
|
|
5
|
+
import { Context, Service } from '@deepseek-ai/cordis';
|
|
6
|
+
export interface EvolutionIo {
|
|
7
|
+
readonly name: string;
|
|
8
|
+
readText(path: string, signal?: AbortSignal): Promise<string | null>;
|
|
9
|
+
writeText(path: string, content: string, signal?: AbortSignal): Promise<void>;
|
|
10
|
+
remove(path: string): Promise<void>;
|
|
11
|
+
list(path: string): Promise<string[]>;
|
|
12
|
+
exists(path: string): Promise<boolean>;
|
|
13
|
+
rename(path: string, destination: string): Promise<void>;
|
|
14
|
+
copy(path: string, destination: string): Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
declare module '@deepseek-ai/cordis' {
|
|
17
|
+
interface Context {
|
|
18
|
+
evolutionIo: EvolutionIoRegistry;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export declare class EvolutionIoRegistry extends Service {
|
|
22
|
+
private readonly providers;
|
|
23
|
+
constructor(ctx: Context);
|
|
24
|
+
registerProvider(provider: EvolutionIo): () => void;
|
|
25
|
+
provider(name?: string): EvolutionIo;
|
|
26
|
+
}
|
|
27
|
+
export default EvolutionIoRegistry;
|
|
28
|
+
//# sourceMappingURL=index.d.ts.map
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@lmzhen/dsh-evolution-io",
|
|
3
|
+
"description": "IO seam for evolution providers (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"
|
|
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
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@deepseek-ai/dsh-invariants": "^0.1.0-rc.6"
|
|
43
|
+
}
|
|
44
|
+
}
|