@lmzhen/dsh-evolution-io 0.3.21 → 0.3.23

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.
@@ -3,45 +3,24 @@
3
3
  * @module @lmzhen/dsh-evolution-io
4
4
  */
5
5
  import { Context, Service } from '@deepseek-ai/cordis';
6
- export interface EvolutionIo {
6
+ import type { EvolutionIoLike } from '@lmzhen/dsh-evolution-core';
7
+ /**
8
+ * The family's IO seam. Everything except `transact` is single-sourced from
9
+ * core `EvolutionIoLike` (0.3.23 G1.3, F-340): the seam no longer redeclares
10
+ * `size`/`isSymlink`/`mtime` or their `this: void` and null-vs-undefined
11
+ * contracts, so a drift between seam and core in those fields is impossible by
12
+ * construction. `name` stays seam-only and is added here.
13
+ *
14
+ * `transact` stays intentionally narrower than core: seam backends (e.g.
15
+ * `nodeEvolutionIo`) are uniformly async, so the task may return only a
16
+ * `Promise`. Core additionally allows a sync return (0.3.16 S1.14 X-1); the
17
+ * bidirectional-await-compatible consumers live in `transactIo` and the
18
+ * evolution IO adapter.
19
+ */
20
+ export type EvolutionIo = Omit<EvolutionIoLike, 'transact'> & {
7
21
  readonly name: string;
8
- readText(path: string): Promise<string | null>;
9
- writeText(path: string, content: string): 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
- * Optional byte-size probe for the read guard. Return the file's size in
17
- * bytes, or `null` when unknown (unsupported backend, missing file, stat
18
- * failure). An implementation without this probe gets no read guard.
19
- */
20
- size?(path: string): Promise<number | null>;
21
- /**
22
- * Optional atomic read-modify-write (rc.50 P2-2): the read and the write run
23
- * inside a single cross-process lock so two processes sharing DSH_HOME
24
- * cannot interleave their RMW sequences. Backends without it fall back to
25
- * plain read+write and the consumer keeps its single-process chain as the
26
- * second layer. Mirrors `EvolutionIoLike.transact` in core — providers that
27
- * implement it (e.g. `nodeEvolutionIo`) expose it here, and consumers read
28
- * it through `transactIo` / the evolution IO adapter.
29
- */
30
22
  transact?(this: void, path: string, task: (current: string | null) => Promise<string | null>): Promise<void>;
31
- /**
32
- * Optional symlink probe (G7). `true` = the path is a symlink, `false` = a
33
- * real entry, `null` = guard not applicable. Consumers treat `null` as
34
- * "let it through". Mirrors `EvolutionIoLike.isSymlink`.
35
- */
36
- isSymlink?(this: void, path: string): Promise<boolean | null>;
37
- /**
38
- * Optional mtime-generation probe (0.3.18, E-71): milliseconds since epoch
39
- * of the path's mtime, or `null` when unknown (unsupported backend, missing
40
- * path, stat failure). Consumers use it as a cheap invalidation stamp for a
41
- * cached listing. Mirrors `EvolutionIoLike.mtime`.
42
- */
43
- mtime?(this: void, path: string): Promise<number | null>;
44
- }
23
+ };
45
24
  declare module '@deepseek-ai/cordis' {
46
25
  interface Context {
47
26
  evolutionIo: EvolutionIoRegistry;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lmzhen/dsh-evolution-io",
3
3
  "description": "IO seam for evolution providers (community build)",
4
- "version": "0.3.21",
4
+ "version": "0.3.23",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -29,7 +29,9 @@
29
29
  "lib/types/**/*.d.ts"
30
30
  ],
31
31
  "license": "MIT",
32
- "dependencies": {},
32
+ "dependencies": {
33
+ "@lmzhen/dsh-evolution-core": "^0.3.23"
34
+ },
33
35
  "peerDependencies": {
34
36
  "@deepseek-ai/dsh-invariants": "^0.1.1-rc.2",
35
37
  "@deepseek-ai/cordis": "^4.0.1"