dreamteamer 0.33.0 → 0.33.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/src/compile.js +17 -7
- package/src/history.js +3 -3
- package/src/records.js +5 -1
- package/src/store.js +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dreamteamer",
|
|
3
|
-
"version": "0.33.
|
|
3
|
+
"version": "0.33.1",
|
|
4
4
|
"description": "A workspace compiler for coding agents — schema-validated records as plain files over git, compiled into every harness",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Gilad Khen <giladkhen@gmail.com>",
|
package/src/compile.js
CHANGED
|
@@ -251,6 +251,9 @@ function dataOwningModules(sources, fail, rel) {
|
|
|
251
251
|
return owners;
|
|
252
252
|
}
|
|
253
253
|
|
|
254
|
+
/** A relative path spelled with `/` on every OS — Windows' `path.relative` and `path.join` use `\`. */
|
|
255
|
+
const toPosix = (p) => p.split(path.sep).join('/');
|
|
256
|
+
|
|
254
257
|
/** The git repo that will hold a module's records: nearest `.git` at or above the module root,
|
|
255
258
|
* as a workspace-relative path (`.` = the workspace itself). `.git` may be a FILE — worktrees
|
|
256
259
|
* and submodules write a pointer file rather than a directory — so existsSync, not isDirectory. */
|
|
@@ -258,7 +261,7 @@ export function repoRootOf(moduleRoot, wsRoot) {
|
|
|
258
261
|
const stop = path.resolve(wsRoot);
|
|
259
262
|
let dir = path.resolve(moduleRoot);
|
|
260
263
|
while (dir.startsWith(stop)) {
|
|
261
|
-
if (fs.existsSync(path.join(dir, '.git'))) return path.relative(stop, dir) || '.';
|
|
264
|
+
if (fs.existsSync(path.join(dir, '.git'))) return toPosix(path.relative(stop, dir)) || '.';
|
|
262
265
|
if (dir === stop) break;
|
|
263
266
|
dir = path.dirname(dir);
|
|
264
267
|
}
|
|
@@ -280,7 +283,9 @@ export function compile(ws) {
|
|
|
280
283
|
const prevManifest = readManifest(root);
|
|
281
284
|
const config = pkg.dreamteamer ?? {};
|
|
282
285
|
const harnesses = config.harnesses ?? ['claude-code'];
|
|
283
|
-
|
|
286
|
+
// workspace-relative and POSIX on every OS: these paths are stored (manifest sources, module
|
|
287
|
+
// records, storage paths) and compared with `/`-joined prefixes — see addEntry
|
|
288
|
+
const rel = (p) => toPosix(path.relative(root, p));
|
|
284
289
|
|
|
285
290
|
/** ⚠ YAML, WITH THE FILE IN THE MESSAGE. js-yaml reports `line:column` and a snippet and never a
|
|
286
291
|
* path, so one stray tab in a workspace of a hundred sources was an mtime bisect. Every parse of
|
|
@@ -544,7 +549,12 @@ export function compile(ws) {
|
|
|
544
549
|
/** collection descriptors collected per name, a base and its overlays: name -> [{src, doc, moduleName}] */
|
|
545
550
|
const descriptorGroups = new Map();
|
|
546
551
|
|
|
552
|
+
// ⚠ A runtime key is a POSIX path on every OS. Every reader of `entries` — the mixin, skill,
|
|
553
|
+
// command and ui-view passes below, the harness adapters, extensions — matches it with `/`, and
|
|
554
|
+
// `path.join` spells it with `\` on Windows, where no mixin loaded and the collections and skills
|
|
555
|
+
// indexes came out empty.
|
|
547
556
|
function addEntry(runtimePath, srcPath) {
|
|
557
|
+
runtimePath = toPosix(runtimePath);
|
|
548
558
|
if (entries.has(runtimePath)) {
|
|
549
559
|
const [, kind, entity] = /^([^/]+)\/([^/]+)/.exec(runtimePath) ?? [];
|
|
550
560
|
const entityId = (entity ?? '').replace(/\.[^.]+\.(yaml|md|json)$/, '');
|
|
@@ -772,7 +782,7 @@ export function compile(ws) {
|
|
|
772
782
|
const engineName = engineId().replace(/@[^@]*$/, '');
|
|
773
783
|
const wsDir = config.workspace_module;
|
|
774
784
|
const wsModuleName = wsDir
|
|
775
|
-
? sources.find((s) => rel(s.root) === path.join('modules', wsDir))?.name
|
|
785
|
+
? sources.find((s) => rel(s.root) === path.posix.join('modules', wsDir))?.name
|
|
776
786
|
: pkg.name;
|
|
777
787
|
// a declared git module whose clone is absent is an UNINSTALLED workspace (a fresh clone), so a
|
|
778
788
|
// collection error there is named with the install, not left reading as a broken reference
|
|
@@ -791,7 +801,7 @@ export function compile(ws) {
|
|
|
791
801
|
counts.collections = 0;
|
|
792
802
|
const mergedCount = [...compiledColls.values()].filter((c) => c.compiled.overlaid_by.length).length;
|
|
793
803
|
for (const [name, c] of compiledColls) {
|
|
794
|
-
entries.set(path.join('collections', `${name}.collection.yaml`), { sources: c.sources, bytes: Buffer.from(dump(c.doc, { noRefs: true })) });
|
|
804
|
+
entries.set(path.posix.join('collections', `${name}.collection.yaml`), { sources: c.sources, bytes: Buffer.from(dump(c.doc, { noRefs: true })) });
|
|
795
805
|
counts.collections++;
|
|
796
806
|
}
|
|
797
807
|
|
|
@@ -868,7 +878,7 @@ export function compile(ws) {
|
|
|
868
878
|
// stale immediately after a clean compile — the one signal that has to stay trustworthy.
|
|
869
879
|
const pkgPath = path.join(source.root, 'package.json');
|
|
870
880
|
const pkgBytes = fs.existsSync(pkgPath) ? fs.readFileSync(pkgPath) : bytes;
|
|
871
|
-
entries.set(path.join('modules', `${id}.module.yaml`), {
|
|
881
|
+
entries.set(path.posix.join('modules', `${id}.module.yaml`), {
|
|
872
882
|
sources: [{ path: rel(pkgPath), hash: sha256(pkgBytes) }],
|
|
873
883
|
bytes,
|
|
874
884
|
});
|
|
@@ -921,7 +931,7 @@ export function compile(ws) {
|
|
|
921
931
|
// `compiled.display`: its display merged over its collection's.
|
|
922
932
|
const collectionOf = (ref) => {
|
|
923
933
|
const name = String(ref ?? '').replace(/^collections\//, '');
|
|
924
|
-
const e = name && entries.get(path.join('collections', `${name}.collection.yaml`));
|
|
934
|
+
const e = name && entries.get(path.posix.join('collections', `${name}.collection.yaml`));
|
|
925
935
|
return e ? load(e.bytes.toString('utf8')) : null;
|
|
926
936
|
};
|
|
927
937
|
const fieldsKnown = (d) => (d ? fieldsOf(d) : undefined);
|
|
@@ -1182,7 +1192,7 @@ export function staleness(root) {
|
|
|
1182
1192
|
const entityId = relEntity.replace(/\.[^.]+\.(yaml|md|json)$/, '');
|
|
1183
1193
|
if (disabledEntities.has(`${kind}/${entityId}`)) continue;
|
|
1184
1194
|
}
|
|
1185
|
-
const relPath = path.relative(root, f);
|
|
1195
|
+
const relPath = toPosix(path.relative(root, f));
|
|
1186
1196
|
if (!known.has(relPath)) stale.push(`${relPath} (new, uncompiled)`);
|
|
1187
1197
|
}
|
|
1188
1198
|
}
|
package/src/history.js
CHANGED
|
@@ -24,10 +24,10 @@ const FORMAT = '%H%x00%an%x00%aI%x00%s';
|
|
|
24
24
|
* genuinely changes when any of them does, so all of them are followed.
|
|
25
25
|
*/
|
|
26
26
|
function trackedPaths(store, file) {
|
|
27
|
-
const rel = path.relative(store.root, file);
|
|
28
|
-
if (!rel.startsWith(RUNTIME_DIR
|
|
27
|
+
const rel = path.relative(store.root, file).split(path.sep).join('/'); // git pathspecs take `/` on every OS
|
|
28
|
+
if (!rel.startsWith(`${RUNTIME_DIR}/`)) return [rel];
|
|
29
29
|
try {
|
|
30
|
-
const key = rel.split(
|
|
30
|
+
const key = rel.split('/').slice(1).join('/'); // drop the `.dreamteamer/` prefix
|
|
31
31
|
const sources = readManifest(store.root)?.entries?.[key]?.sources ?? [];
|
|
32
32
|
const paths = sources.map((s) => (typeof s === 'string' ? s : s?.path)).filter(Boolean);
|
|
33
33
|
return paths.length ? paths : [rel];
|
package/src/records.js
CHANGED
|
@@ -67,8 +67,12 @@ export const MAX_RECORD_BYTES = 204800;
|
|
|
67
67
|
*
|
|
68
68
|
* `format: binary` records are opaque bytes whose extension is whatever was imported, so their tail is
|
|
69
69
|
* `.<suffix>.<ONE extension segment>` — one, because `x.asset.tar.gz` in the folder is an archive
|
|
70
|
-
* someone dropped there, and calling it a record would hide it from `check`'s stray report.
|
|
70
|
+
* someone dropped there, and calling it a record would hide it from `check`'s stray report.
|
|
71
|
+
*
|
|
72
|
+
* An id is a POSIX path on every OS: callers hand in `path.relative` output, which on Windows is
|
|
73
|
+
* `2026\10\x.note.md` — an id no reference, pattern or `dt get` would ever match. */
|
|
71
74
|
export function idFromRecordPath(d, relPath) {
|
|
75
|
+
relPath = relPath.split(path.sep).join('/');
|
|
72
76
|
const { suffix, format } = storageOf(d);
|
|
73
77
|
if (format === 'binary') {
|
|
74
78
|
const lit = suffix.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
package/src/store.js
CHANGED
|
@@ -589,7 +589,8 @@ export class Store {
|
|
|
589
589
|
const { fields: currentFields, file } = this.read(collection, id);
|
|
590
590
|
// A placed record may have sat in ANOTHER parent's folder at `hash` — the move is what is being
|
|
591
591
|
// reverted — so the historical path is looked up in that commit's tree, not assumed to be today's.
|
|
592
|
-
|
|
592
|
+
// `<rev>:<path>` takes `/` on every OS — Windows' path.relative spells it with `\`
|
|
593
|
+
const relPath = this.pathAt(d, id, hash) ?? path.relative(this.root, file).split(path.sep).join('/');
|
|
593
594
|
let previousContent;
|
|
594
595
|
try {
|
|
595
596
|
previousContent = execFileSync('git', ['show', `${hash}:${relPath}`], { cwd: this.root, stdio: QUIET }).toString();
|