@iiiokojiadbi/shift 0.34.0 → 0.34.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/package.json +1 -1
- package/store.ts +4 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iiiokojiadbi/shift",
|
|
3
|
-
"version": "0.34.
|
|
3
|
+
"version": "0.34.1",
|
|
4
4
|
"description": "The agent decides by itself when to shift: it keeps a work board and task folders, writes a letter to itself, and continues from where it stopped.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
package/store.ts
CHANGED
|
@@ -74,12 +74,14 @@ export function projectAt(root: string): Promise<Project> {
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
// The file a write goes to: a link's target, through a chain of links, even one not there yet; a cycle of links is
|
|
77
|
-
// refused, never written over.
|
|
77
|
+
// refused, never written over. As many links as the system follows: 40, and the file they end at.
|
|
78
|
+
const MAX_LINKS = 40
|
|
79
|
+
|
|
78
80
|
async function through(path: string): Promise<string> {
|
|
79
81
|
const real = await realpath(path).catch(() => null)
|
|
80
82
|
if (real !== null) return real
|
|
81
83
|
let at = path
|
|
82
|
-
for (let hop = 0; hop
|
|
84
|
+
for (let hop = 0; hop <= MAX_LINKS; hop++) {
|
|
83
85
|
const link = await readlink(at).catch(() => null)
|
|
84
86
|
if (link === null) return at
|
|
85
87
|
at = resolve(dirname(at), link)
|