@inerrata-corporation/errata 2.0.0-dev.56 → 2.0.0-dev.57

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 (2) hide show
  1. package/errata.mjs +28 -4
  2. package/package.json +1 -1
package/errata.mjs CHANGED
@@ -21216,6 +21216,16 @@ var init_client = __esm({
21216
21216
  * resolvable member ids. AUTHED. Always HTTP 200 — the `status` field
21217
21217
  * discriminates outcomes (incl. the autophagy-floor refusal, which is a
21218
21218
  * normal "not enough collective grounding yet" result, not an error). */
21219
+ /** Durable skills pinned to this workspace's cloud project (bodies included).
21220
+ * The daemon claims these on its skill-sync tick and installs them into
21221
+ * `.errata/skills/`, unioned into the collective set (never pruned). Returns
21222
+ * an empty set when nothing is pinned or the project isn't linked. */
21223
+ async getSkillPins(projectId) {
21224
+ return this.json(
21225
+ "GET",
21226
+ `/v2/skill-pins?projectId=${encodeURIComponent(projectId)}`
21227
+ );
21228
+ }
21219
21229
  async induceSkill(body2) {
21220
21230
  return this.json("POST", "/v2/skills/induce", body2);
21221
21231
  }
@@ -42362,11 +42372,11 @@ function readSkillManifest(manifestPath) {
42362
42372
  return [];
42363
42373
  }
42364
42374
  }
42365
- async function syncSkills(paths, client, seed) {
42375
+ async function syncSkills(paths, client, seed, pins = []) {
42366
42376
  const res = await client.getSkills(void 0, seed);
42367
42377
  const staleDaemon = res.staleDaemon && res.latestDaemonVersion ? { latest: res.latestDaemonVersion } : void 0;
42368
42378
  mkdirSync5(paths.skillsDir, { recursive: true });
42369
- if (res.skills.length === 0) {
42379
+ if (res.skills.length === 0 && pins.length === 0) {
42370
42380
  const existing = readdirSync6(paths.skillsDir).filter((f) => f.endsWith(".md"));
42371
42381
  if (existing.length > 0) return { written: 0, pruned: 0, ...staleDaemon ? { staleDaemon } : {} };
42372
42382
  }
@@ -42384,6 +42394,19 @@ async function syncSkills(paths, client, seed) {
42384
42394
  file: `skills/${fileName}`
42385
42395
  });
42386
42396
  }
42397
+ for (const p of pins) {
42398
+ const fileName = skillFileName(p.id);
42399
+ if (keep.has(fileName)) continue;
42400
+ keep.add(fileName);
42401
+ writeFileSync10(join18(paths.skillsDir, fileName), p.markdown, "utf8");
42402
+ rows.push({
42403
+ id: p.id,
42404
+ title: p.title,
42405
+ layer: p.layer,
42406
+ confidence: p.confidence,
42407
+ file: `skills/${fileName}`
42408
+ });
42409
+ }
42387
42410
  let pruned = 0;
42388
42411
  for (const f of readdirSync6(paths.skillsDir)) {
42389
42412
  if (!f.endsWith(".md")) continue;
@@ -42820,7 +42843,7 @@ function startLoopLagMonitor(thresholdMs = 1e3) {
42820
42843
  }
42821
42844
 
42822
42845
  // src/engine.ts
42823
- var DAEMON_VERSION = true ? "2.0.0-dev.56" : "2.0.0-alpha.0";
42846
+ var DAEMON_VERSION = true ? "2.0.0-dev.57" : "2.0.0-alpha.0";
42824
42847
  var IGNORED_PATH = /[\\/](?:\.git|node_modules|\.errata|\.claude|\.codex|\.cursor|\.turbo|\.next|dist|coverage|test-results|playwright-report|__pycache__)(?:[\\/]|$)/;
42825
42848
  var IGNORED_NOISE = /castalia\.db|eventlog\.sqlite|turn-cursors/;
42826
42849
  var GIT_OP_MUTE_MS = 4e3;
@@ -43802,7 +43825,8 @@ function createWorkspaceEngine(opts) {
43802
43825
  const cloudId = p.attrs["cloudNodeId"];
43803
43826
  return typeof cloudId === "string" && cloudId !== p.id ? [p.id, cloudId] : [p.id];
43804
43827
  });
43805
- return syncSkills(paths, cloud, skillSeed);
43828
+ const pins = profile?.projectId ? await cloud.getSkillPins(profile.projectId).then((r) => r.pins).catch(() => []) : [];
43829
+ return syncSkills(paths, cloud, skillSeed, pins);
43806
43830
  };
43807
43831
  return {
43808
43832
  profile,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inerrata-corporation/errata",
3
- "version": "2.0.0-dev.56",
3
+ "version": "2.0.0-dev.57",
4
4
  "description": "errata - local-first observation engine for AI coding agents",
5
5
  "type": "module",
6
6
  "bin": {