@llblab/pi-state-flow 0.16.2 → 0.17.0

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.
Files changed (110) hide show
  1. package/AGENTS.md +35 -37
  2. package/BACKLOG.md +5 -3
  3. package/CHANGELOG.md +15 -1
  4. package/README.md +11 -11
  5. package/dist/index.d.ts +6 -9
  6. package/dist/index.js +6 -9
  7. package/dist/lib/acquisition.d.ts +2 -2
  8. package/dist/lib/acquisition.js +21 -8
  9. package/dist/lib/artifact.d.ts +40 -24
  10. package/dist/lib/artifact.js +93 -63
  11. package/dist/lib/compaction.d.ts +4 -3
  12. package/dist/lib/compaction.js +9 -9
  13. package/dist/lib/config.d.ts +1 -1
  14. package/dist/lib/config.js +6 -5
  15. package/dist/lib/context.d.ts +8 -7
  16. package/dist/lib/context.js +56 -58
  17. package/dist/lib/continuation.js +12 -24
  18. package/dist/lib/durable.d.ts +7 -18
  19. package/dist/lib/durable.js +47 -78
  20. package/dist/lib/extension.d.ts +4 -6
  21. package/dist/lib/extension.js +241 -437
  22. package/dist/lib/git.d.ts +2 -72
  23. package/dist/lib/git.js +120 -499
  24. package/dist/lib/history.d.ts +2 -1
  25. package/dist/lib/history.js +4 -3
  26. package/dist/lib/json.d.ts +3 -0
  27. package/dist/lib/json.js +43 -22
  28. package/dist/lib/logging.d.ts +1 -5
  29. package/dist/lib/logging.js +0 -2
  30. package/dist/lib/memory.d.ts +1 -14
  31. package/dist/lib/memory.js +5 -37
  32. package/dist/lib/protocol.d.ts +2 -3
  33. package/dist/lib/protocol.js +14 -33
  34. package/dist/lib/query.d.ts +6 -6
  35. package/dist/lib/query.js +25 -21
  36. package/dist/lib/recovery.d.ts +3 -3
  37. package/dist/lib/recovery.js +15 -12
  38. package/dist/lib/rehydration.d.ts +2 -4
  39. package/dist/lib/rehydration.js +5 -1
  40. package/dist/lib/runtime.d.ts +26 -88
  41. package/dist/lib/runtime.js +159 -255
  42. package/dist/lib/skills.d.ts +0 -3
  43. package/dist/lib/skills.js +1 -47
  44. package/dist/lib/snapshot.d.ts +16 -33
  45. package/dist/lib/snapshot.js +48 -137
  46. package/dist/lib/state.d.ts +16 -11
  47. package/dist/lib/state.js +13 -14
  48. package/dist/lib/status.d.ts +1 -9
  49. package/dist/lib/status.js +15 -43
  50. package/dist/lib/storage.d.ts +5 -9
  51. package/dist/lib/storage.js +13 -45
  52. package/dist/lib/telegram.js +1 -1
  53. package/dist/lib/temporal.d.ts +15 -7
  54. package/dist/lib/temporal.js +104 -24
  55. package/dist/lib/transition.d.ts +0 -2
  56. package/dist/lib/transition.js +9 -12
  57. package/dist/package.json +9 -6
  58. package/dist/skills/state-flow-guide/SKILL.md +11 -17
  59. package/dist/skills/state-flow-memory/SKILL.md +8 -8
  60. package/docs/README.md +2 -2
  61. package/docs/architecture.md +64 -67
  62. package/docs/compatibility.md +41 -78
  63. package/docs/filesystem-recovery.md +12 -15
  64. package/docs/fork-contract.md +22 -27
  65. package/docs/lazy-state.md +25 -41
  66. package/docs/performance.md +38 -421
  67. package/docs/temporal-acceptance.md +33 -46
  68. package/docs/usage.md +38 -62
  69. package/index.ts +7 -71
  70. package/lib/acquisition.ts +26 -11
  71. package/lib/artifact.ts +116 -88
  72. package/lib/compaction.ts +12 -10
  73. package/lib/config.ts +6 -6
  74. package/lib/context.ts +52 -59
  75. package/lib/continuation.ts +11 -20
  76. package/lib/durable.ts +44 -86
  77. package/lib/extension.ts +237 -460
  78. package/lib/git.ts +110 -552
  79. package/lib/history.ts +4 -3
  80. package/lib/json.ts +39 -23
  81. package/lib/logging.ts +1 -7
  82. package/lib/memory.ts +5 -44
  83. package/lib/protocol.ts +15 -26
  84. package/lib/query.ts +26 -22
  85. package/lib/recovery.ts +17 -11
  86. package/lib/rehydration.ts +7 -5
  87. package/lib/runtime.ts +154 -254
  88. package/lib/skills.ts +1 -49
  89. package/lib/snapshot.ts +58 -142
  90. package/lib/state.ts +27 -19
  91. package/lib/status.ts +16 -54
  92. package/lib/storage.ts +12 -40
  93. package/lib/telegram.ts +1 -1
  94. package/lib/temporal.ts +104 -22
  95. package/lib/transition.ts +14 -24
  96. package/package.json +9 -6
  97. package/skills/state-flow-guide/SKILL.md +11 -17
  98. package/skills/state-flow-memory/SKILL.md +8 -8
  99. package/dist/lib/discovery.d.ts +0 -21
  100. package/dist/lib/discovery.js +0 -125
  101. package/dist/lib/maintenance.d.ts +0 -36
  102. package/dist/lib/maintenance.js +0 -98
  103. package/dist/lib/migration.d.ts +0 -13
  104. package/dist/lib/migration.js +0 -167
  105. package/dist/lib/publication.d.ts +0 -86
  106. package/dist/lib/publication.js +0 -437
  107. package/lib/discovery.ts +0 -133
  108. package/lib/maintenance.ts +0 -147
  109. package/lib/migration.ts +0 -171
  110. package/lib/publication.ts +0 -458
package/dist/lib/git.d.ts CHANGED
@@ -1,72 +1,2 @@
1
- import { type DurableFileBase } from "./durable.ts";
2
- import { type ArtifactProvenanceRegistry } from "./artifact.ts";
3
- import { type ScopeStream, type TemporalState } from "./temporal.ts";
4
- import { type SessionRuntime, type Snapshot } from "./snapshot.ts";
5
- import type { StateScope } from "./state.ts";
6
- export interface GitPushResult {
7
- status: "pushed" | "local" | "pending";
8
- commit: string;
9
- error?: string;
10
- }
11
- /** Explicit start only: initialize this exact root, preserving existing files and ancestor Git. */
12
- export declare function initializeGitRepository(repositoryRoot: string): void;
13
- export interface TemporalGitBase {
14
- head?: string;
15
- files: DurableFileBase[];
16
- }
17
- export interface TemporalRevisionLoad {
18
- base: TemporalGitBase;
19
- scopes: Record<StateScope, ScopeStream | undefined>;
20
- runtime?: {
21
- document: SessionRuntime;
22
- revision: string;
23
- };
24
- /** Runtime-owned artifact provenance retained at this revision. */
25
- provenance: Record<StateScope, ArtifactProvenanceRegistry>;
26
- }
27
- export declare function captureTemporalGitBase(cwd: string, sessionId: string, repositoryRoot: string, sessionKey?: string): TemporalGitBase;
28
- /** Cold scope-stream reconstruction from canonical revision paths only. */
29
- export declare function loadTemporalRevision(cwd: string, sessionId: string, repositoryRoot: string, revision: string, sessionKey?: string): TemporalRevisionLoad;
30
- export interface StorageMigrationPublication {
31
- commit?: string;
32
- push?: GitPushResult;
33
- scopes: StateScope[];
34
- }
35
- /** Explicit migration entrypoint; initialization adopts it only with the temporal writer cutover. */
36
- export declare function migrateLegacyStorageToGit(cwd: string, sessionId: string, repositoryRoot: string, sessionKey?: string): StorageMigrationPublication;
37
- /** Explicit current-file adoption, not reconstruction or invention of pre-Git history. */
38
- export declare function adoptFileStateToGit(cwd: string, sessionId: string, repositoryRoot: string, revision: string, snapshot: Snapshot, sessionKey?: string, push?: boolean): {
39
- commit?: string;
40
- push?: GitPushResult;
41
- revision: string;
42
- view: {
43
- scopes: Record<StateScope, ScopeStream>;
44
- lineage: import("./temporal.ts").TransitionBoundary[];
45
- };
46
- provenance: Record<StateScope, ArtifactProvenanceRegistry>;
47
- base: {
48
- head: string | undefined;
49
- files: DurableFileBase[];
50
- };
51
- };
52
- /** Persist selected streams from one validated view, never derive checkpoints from current state. */
53
- export declare function publishTemporalStateToGit(cwd: string, sessionId: string, view: TemporalState, scopes: readonly StateScope[], base: TemporalGitBase, repositoryRoot: string, runtime?: SessionRuntime, sessionKey?: string, push?: boolean, provenance?: Readonly<Record<StateScope, ArtifactProvenanceRegistry>>): {
54
- base: TemporalGitBase;
55
- commit?: string;
56
- push?: GitPushResult;
57
- };
58
- export declare function resolveGitPushDestination(repositoryRoot: string): {
59
- gitCommonDir: string;
60
- remote: string;
61
- ref: string;
62
- } | undefined;
63
- /** Read-only publication policy; configuration errors are not local-only success. */
64
- export declare function isLocalGitRepository(repositoryRoot: string): boolean;
65
- /** Push an already-created commit exactly; failures are publication state, not transition rejection. */
66
- export declare function isGitCommitAncestor(repositoryRoot: string, ancestor: string, descendant: string): boolean;
67
- /** Own one non-interactive exact-target push; cancellation is not confirmation of child exit. */
68
- export declare function pushGitTarget(repositoryRoot: string, destination: {
69
- remote: string;
70
- ref: string;
71
- }, commit: string, signal?: AbortSignal): Promise<void>;
72
- export declare function pushGitCommit(repositoryRoot: string, commit: string): GitPushResult;
1
+ /** Commit only current State Flow-owned files; never changes canonical acceptance. */
2
+ export declare function backupCurrentStateFlowFiles(repositoryRoot: string): string | undefined;