@awebai/oats 0.29.0 → 0.29.2
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/bin/oats.mjs +2 -1
- package/capabilities/oats-aweb/bin/oats-aweb.mjs +204 -53
- package/capabilities/oats-aweb/injects/aweb.md +39 -74
- package/capabilities/oats-aweb/lib/binding-wire.mjs +15 -4
- package/capabilities/oats-aweb/lib/personal-team.mjs +19 -0
- package/capabilities/oats-aweb/lib/wake-receive.mjs +56 -0
- package/capabilities/oats-aweb/oats.json +7 -6
- package/capabilities/oats-aweb/skills/VENDORED.md +6 -1
- package/capabilities/oats-aweb/skills/aweb-team-membership/SKILL.md +21 -11
- package/capabilities/oats-aweb/skills/oats-aweb/SKILL.md +217 -0
- package/docs/desktop-cli-api.md +20 -4
- package/docs/packages.md +1 -1
- package/docs/release-notes/v0.29.1.md +79 -0
- package/docs/release-notes/v0.29.2.md +51 -0
- package/lib/instance-git.mjs +30 -1
- package/package-catalog.json +1 -1
- package/package.json +1 -1
package/lib/instance-git.mjs
CHANGED
|
@@ -138,6 +138,33 @@ function remoteOf(work, branch) {
|
|
|
138
138
|
if (!url) return null;
|
|
139
139
|
return { name, url, ...parseRemoteUrl(url), source: configured && configured !== "." ? "branch-upstream" : "origin" };
|
|
140
140
|
}
|
|
141
|
+
/** Per-file line counts (0.29.1), from ONE `git diff <captured HEAD> --numstat -z -M`: the working tree
|
|
142
|
+
* against the observed commit, staged and unstaged combined. That is the same baseline as the status letters
|
|
143
|
+
* and `oats instance diff`. An unborn tree counts against the empty tree (`hash-object` without -w writes nothing).
|
|
144
|
+
* → Map path → { additions, deletions, binary }, keyed by the NEW path for a rename; null when git failed.
|
|
145
|
+
* -z records: "A\tD\tpath\0", or "A\tD\t\0old\0new\0" for a rename; "-\t-" is a binary file. */
|
|
146
|
+
function lineCounts(work, headOid) {
|
|
147
|
+
const against = headOid ?? trim(git(work, ["hash-object", "-t", "tree", "/dev/null"], { allowFail: true }));
|
|
148
|
+
if (!against) return null;
|
|
149
|
+
const raw = git(work, ["diff", against, "--numstat", "-z", "-M", "--"], { allowFail: true });
|
|
150
|
+
if (raw === null) return null;
|
|
151
|
+
const counts = new Map(), recs = raw.split("\0");
|
|
152
|
+
for (let i = 0; i < recs.length;) {
|
|
153
|
+
const m = /^(-|\d+)\t(-|\d+)\t([\s\S]*)$/.exec(recs[i++]);
|
|
154
|
+
if (!m) continue;
|
|
155
|
+
let path = m[3];
|
|
156
|
+
if (path === "") { i++; path = recs[i++]; } // a rename: skip the old path, key the new one
|
|
157
|
+
if (typeof path !== "string" || !path) continue;
|
|
158
|
+
counts.set(path, m[1] === "-" ? { additions: null, deletions: null, binary: true } : { additions: Number(m[1]), deletions: Number(m[2]), binary: false });
|
|
159
|
+
}
|
|
160
|
+
return counts;
|
|
161
|
+
}
|
|
162
|
+
/** An entry's counts: untracked (no baseline; contents are not read) and submodules have none (all null). */
|
|
163
|
+
function countsOf(counts, entry) {
|
|
164
|
+
if (entry.kind === "untracked" || entry.submodule) return { additions: null, deletions: null, binary: null };
|
|
165
|
+
return counts?.get(entry.path) ?? { additions: null, deletions: null, binary: null };
|
|
166
|
+
}
|
|
167
|
+
|
|
141
168
|
function fileId(revision, indexOid, entry) {
|
|
142
169
|
return createHash("sha256").update(`${revision}\0${indexOid}\0${entry.kind}\0${entry.path}\0${entry.origPath ?? ""}`).digest("hex").slice(0, 24);
|
|
143
170
|
}
|
|
@@ -164,7 +191,8 @@ export function observeInstanceGit(home) {
|
|
|
164
191
|
const counts = mergeBase ? countRange(work, `${base.ref}...HEAD`) : null;
|
|
165
192
|
baseComparison = { ref: base.ref, source: base.source, mergeBase, ahead: counts ? counts.right : null, behind: counts ? counts.left : null };
|
|
166
193
|
}
|
|
167
|
-
const
|
|
194
|
+
const counts = lineCounts(work, headOid);
|
|
195
|
+
const files = entries.filter((e) => e.kind !== "ignored").map((e) => ({ id: fileId(revision, indexOid, e), ...e, ...countsOf(counts, e) }));
|
|
168
196
|
const summary = { changed: 0, renamed: 0, copied: 0, unmerged: 0, untracked: 0 };
|
|
169
197
|
for (const f of files) summary[f.kind]++;
|
|
170
198
|
return {
|
|
@@ -178,6 +206,7 @@ export function observeInstanceGit(home) {
|
|
|
178
206
|
notes: [
|
|
179
207
|
...(upstream.ref === null ? ["no upstream configured: upstream ahead/behind are unknown, not zero"] : []),
|
|
180
208
|
...(baseComparison.ref === null ? ["no default branch found (origin/HEAD, origin/main, origin/master, main, master): base comparison unknown"] : []),
|
|
209
|
+
...(counts === null ? ["line counts unavailable (git diff --numstat failed): additions/deletions are unknown, not zero"] : []),
|
|
181
210
|
],
|
|
182
211
|
};
|
|
183
212
|
}
|
package/package-catalog.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awebai/oats",
|
|
3
|
-
"version": "0.29.
|
|
3
|
+
"version": "0.29.2",
|
|
4
4
|
"description": "OATS (Open Agent Team Specification) — durable souls, disposable instances, targetable capability packages, and the runtime-neutral oats CLI/kernel.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agents",
|