osborn 0.9.285 → 0.9.290

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.
@@ -98,6 +98,8 @@ export declare const catalogOrigin: (e: {
98
98
  }) => string;
99
99
  /** The same catalog file at any commit. */
100
100
  export declare const unpinnedOrigin: (origin: string) => string;
101
+ /** The commit a catalog origin is pinned to. */
102
+ export declare const pinnedSha: (origin: string) => string;
101
103
  /** Validates user_agents rows. Disabled rows are skipped; every other dropped
102
104
  * row is reported with its reason (a core name: core agents cannot be overridden). */
103
105
  export declare function parseUserAgents(rows: unknown, core: CoreAgents): {
@@ -85,8 +85,11 @@ export const describeRoles = () => ({
85
85
  // ── Catalog origins: forked_from of an agent installed from a store catalog ────
86
86
  // '<source>:<owner>/<repo>@<sha>/<path>' (user_agents check, migration 016).
87
87
  export const catalogOrigin = (e) => `${e.source}:${e.repo}@${e.sha}/${e.path}`;
88
+ const PIN = /@([0-9a-f]{7,40})\//;
88
89
  /** The same catalog file at any commit. */
89
- export const unpinnedOrigin = (origin) => origin.replace(/@[0-9a-f]{7,40}\//, '/');
90
+ export const unpinnedOrigin = (origin) => origin.replace(PIN, '/');
91
+ /** The commit a catalog origin is pinned to. */
92
+ export const pinnedSha = (origin) => PIN.exec(origin)?.[1];
90
93
  /** Where a user agent came from, for people: its built-in parent's name, or 'owner/repo @sha7'. */
91
94
  const originLabel = (forkedFrom, core) => {
92
95
  if (coreRole(forkedFrom, core))
@@ -703,9 +703,9 @@ export const NAMED_AGENTS = {
703
703
  'GROW THE LIBRARY OVER TIME: where coverage is missing for the behavior being verified,',
704
704
  'CREATE a targeted regression test so the suite accumulates over time.',
705
705
  '',
706
- 'AGENT TEST SUITE REALITY: as of now there is NO test suite for the agent (CLAUDE.md: "There is no test',
707
- 'suite"). You MAY write minimal `agent/tests/*.test.ts` files runnable via `npx tsx` (e.g.',
708
- '`npx tsx agent/tests/my-feature.test.ts`). Do NOT attempt to wire a `package.json` "test" script —',
706
+ 'TEST SUITES: find the runner the repo actually has (step 1). Some packages have an aggregate `npm test`;',
707
+ 'others hold standalone `*.test.ts` files run one at a time with `npx tsx`. Write new ones the same way as',
708
+ 'the ones already there. Do NOT wire a `package.json` "test" script —',
709
709
  'that is a config write, is gate-denied, and is a WRITER task. Instead, FLAG that need as a follow-up.',
710
710
  'If standing up even a minimal runner is out of scope for the change under test, report it as a',
711
711
  'COVERAGE GAP rather than half-installing infra.',
package/dist/index.js CHANGED
@@ -39,7 +39,7 @@ import { isSafeArtifactPath } from './lib/safe-artifact-path.js';
39
39
  import { cleanupHousekeeping } from './housekeeping.js';
40
40
  import { createSTT, createTTS } from './voice-io.js';
41
41
  import { createClaudeLLM, NAMED_AGENTS, applyTurbo, requestAuthRestart } from './claude-llm.js';
42
- import { SOURCES, loadCatalog, findEntry, installSkill, agentDraft, recommend, skillProvenance, installedIds } from './store-catalog.js';
42
+ import { SOURCES, loadCatalog, findEntry, installSkill, agentDraft, recommend, skillProvenance, installedIds, findUpdates } from './store-catalog.js';
43
43
  import { parseUserAgents, mergeAgents, describeAgents, describeRoles, coreRole, AGENT_LIMITS, storeWriteRefusal, storeWriteOriginAllowed, coreSkillNames, skillForkedFrom, forkSkill, removeUserSkill, addUserSkill, readUserSkill, parseFrontMatter, storeName } from './agent-store.js';
44
44
  import { clearPipelineFastBrainSession, prewarmBM25Index } from './pipeline-fastbrain.js';
45
45
  import { ensureClaudeAuth, applyAuthFallback, replayInFlightAuth, startClaudeAuthOnDemand, isOnDemandAuthInFlight, probeActiveProviderKey } from './claude-auth.js';
@@ -809,6 +809,13 @@ function startApiServer(workingDir, port) {
809
809
  const skills = loadSkillsList(homedir());
810
810
  const myAgents = (url.searchParams.get('agents') || '').split(',').map(storeName).filter(Boolean).slice(0, 50);
811
811
  const installed = installedIds(entries, new Set(skills.map((s) => s.folder)), url.searchParams.getAll('origin').slice(0, 50));
812
+ // Each store agent row arrives as "<name> <forked_from>"; skills are read from their provenance.
813
+ const rows = url.searchParams.getAll('row').slice(0, 50).map((r) => { const i = r.indexOf(' '); return i > 0 ? { name: storeName(r.slice(0, i)), origin: r.slice(i + 1) } : null; }).filter((r) => r?.name && r.origin);
814
+ // Never held up by GitHub: what is not known within 3s shows on a later load (reads are cached).
815
+ const updates = await Promise.race([
816
+ findUpdates(entries, homeSkillsDir(), skills.filter((s) => s.installedFrom).map((s) => s.folder), rows),
817
+ new Promise((r) => setTimeout(() => r([]), 3000)),
818
+ ]);
812
819
  const signals = [
813
820
  ...skills.map((s) => ({ text: `${s.folder} ${s.name} ${s.description}`, reason: `because you use the ${s.folder} skill` })),
814
821
  ...myAgents.map((n) => ({ text: n, reason: `because you have the ${n} agent` })),
@@ -821,6 +828,7 @@ function startApiServer(workingDir, port) {
821
828
  }),
822
829
  entries,
823
830
  installed: [...installed],
831
+ updates,
824
832
  recommended: recommend(entries, signals, installed),
825
833
  });
826
834
  }
@@ -846,7 +854,8 @@ function startApiServer(workingDir, port) {
846
854
  return reply(400, { error: `this agent's prompt is ${found.body.length} characters; the limit is ${AGENT_LIMITS.prompt}` });
847
855
  if (found.entry.kind === 'agent')
848
856
  return reply(200, { draft: agentDraft(found.entry, found.body) });
849
- const out = await installSkill(found.entry, homeSkillsDir(), coreSkillNames(PKG_SKILLS_DIR));
857
+ // update=1 replaces the copy this entry installed before (one-click update).
858
+ const out = await installSkill(found.entry, homeSkillsDir(), coreSkillNames(PKG_SKILLS_DIR), undefined, { update: url.searchParams.get('update') === '1' });
850
859
  return reply('ok' in out ? 200 : 400, { ...out, skills: loadSkillsList(homedir()) });
851
860
  }
852
861
  return reply(404, { error: 'not found' });
@@ -1 +1 @@
1
- The `{{agent}}` sub-agent (writer role) just finished. Before you finalize, you MUST now use the Task tool to: (1) RUN the tester's tests against the new implementation and report PASS/FAIL; (2) dispatch the `steward` on the diff (diff mode), passing the task and, for a fix, its root cause and evidence — it refactors toward reuse and returns CLEAN, REFACTORED or BLOCK; (3) if it REFACTORED, RUN the tests again; (4) dispatch the `reviewer` on the final diff for a VERDICT. If the steward returns BLOCK, stop and ask the user the decision it names. If tests FAIL or the reviewer REJECTs, dispatch the `{{agent}}` to fix and then re-verify (steward included) — at most 2 fix rounds, after which surface the outcome to the user rather than looping. In any PR description, put the steward's ROOT CAUSE under Why, and its NET-NEW and REMOVED lists under those headings.
1
+ The `{{agent}}` sub-agent (writer role) just finished. Before you finalize, you MUST now use the Task tool to: (1) RUN the tester's tests against the new implementation and report PASS/FAIL; (2) dispatch the `steward` on the diff (diff mode), passing the task and, for a fix, its root cause and evidence — it refactors toward reuse and returns CLEAN, REFACTORED or BLOCK; (3) if it REFACTORED, RUN the tests again; (4) dispatch the `reviewer` on the final diff for a VERDICT. If the steward returns BLOCK, stop and ask the user the decision it names. If tests FAIL or the reviewer REJECTs, dispatch the `{{agent}}` to fix and then re-verify (steward included) — at most 2 fix rounds, after which surface the outcome to the user rather than looping. Re-dispatching the steward, paste its previous SETTLED lines into the task so a refuted item is not raised again. In any PR description, put the steward's ROOT CAUSE under Why, and its NET-NEW and REMOVED lists under those headings.
@@ -85,8 +85,6 @@ files are hotspots, they move over time. HISTORY says which checks ran and which
85
85
  6. Single source of truth: if the diff adds a second copy of a rule (validation, error codes, config,
86
86
  constants), merge it into the existing copy. CLEAN requires an empty DUPLICATES list, except unservable
87
87
  cross-package copies with their reason.
88
- Every pass, including a re-run after REFACTORED, reviews the WHOLE diff (the full range), not only the newest
89
- commit; a request to "check only the last commit" does not narrow your sign-off.
90
88
  7. Symptoms and repeats: a change whose effect is to tolerate a failure (a wider timeout, a retry, a fallback, a
91
89
  delay, a guard, a raised limit, a swallowed error, a silenced alert), alone or with cosmetic edits, needs the
92
90
  root cause: which mechanism in the touched code fails, with evidence (a measurement, log or reproduction)
@@ -116,9 +114,9 @@ files are hotspots, they move over time. HISTORY says which checks ran and which
116
114
  HISTORY; only a claim you made no attempt to break blocks CLEAN.
117
115
 
118
116
  ## Tests before sign-off
119
- Run every test suite the repo has for the touched packages (in this repo: each `agent/tests/*.test.ts` and
120
- `frontend/tests/*.test.ts` with `npx tsx`, plus `npx tsc --noEmit` for agent and frontend), not a chosen few, and
121
- list the results in TESTS. A test that cannot run here is listed with the reason. A failing test blocks sign-off.
117
+ Tests are the tester's job: cite its result instead of re-running the suites. With no result to cite, or to check
118
+ an edit of your own, run only the suites covering what you touched, in the foreground under a time limit. TESTS
119
+ lists what you ran or cited, and what could not run and why. A failing test blocks sign-off.
122
120
 
123
121
  ## Bash
124
122
  Read-only inspection (git diff/log/show/grep, gh issue/pr list|view, tsc --noEmit, tests) plus the sign-off
@@ -130,6 +128,11 @@ for this exact content (any later edit invalidates it; the commit/push/PR gate c
130
128
  ${SIGNOFF_COMMAND}
131
129
  Never sign off on BLOCK. If you REFACTORED, the orchestrator re-runs the tests and the reviewer, not you.
132
130
 
131
+ ## Bounded rounds
132
+ After round 1, review the delta since your last sign-off, not the feature again, and carry SETTLED forward:
133
+ repeat the earlier rounds' lines verbatim and add yours; re-raise one only with new evidence. Your sign-off still
134
+ covers the whole tree.
135
+
133
136
  ## What to return
134
137
  VERDICT: CLEAN | REFACTORED | BLOCK — <one line>
135
138
  INVENTORY: <every added definition> → reused <existing> | NET-NEW: <reason> (files covered: <list>)
@@ -137,9 +140,11 @@ DUPLICATES: <definition> duplicates <path:line> → consolidated | kept: <why it
137
140
  BEHAVIOUR: <removed/rewritten block> → moved to / replaced by / dropped (<cited request>) (or none)
138
141
  REMOVED: <what you cut and why> (or none)
139
142
  IMPACT: <changed symbol> → <every usage found> → <updated / ok / broken + why>; SIBLINGS: <other copies of the logic> → <updated / out of scope>
140
- TESTS: <suite> → pass/fail/could not run (why), for every suite
143
+ TESTS: <suite> → pass/fail/could not run (why), for each one you ran, or the tester's result you are citing
141
144
  LINES: +<added> -<removed> before → after, excluding test files (*.test.*, *.spec.*, tests/), then tests separately
142
145
  HISTORY: churn, re-touched lines (hunks checked / found), fix chains followed, missing coupled files, related issues/PRs, and any check that could not run
143
146
  CHALLENGED: <claim> → <command run to break it> → held / broke (fixed) / could not run (why)
147
+ SETTLED: <item dropped> → <file:line that refuted it> (or none)
148
+ STEPS: <what you read or ran → how long>, in order, then the total
144
149
  ROOT CAUSE: for a fix, the cause, its evidence and the chain it ends; for a feature, "new feature, no earlier fault"
145
150
  For BLOCK, name the decision a human has to make.
@@ -36,6 +36,8 @@ export interface Snapshot {
36
36
  paths: string[];
37
37
  }
38
38
  type Reader = (path: string) => Promise<string | null>;
39
+ /** An entry's rev: its main file's text and its file list. A commit elsewhere in the repo leaves it alone. */
40
+ export declare const revOf: (md: string, files: string[]) => string;
39
41
  /** Turns a repo snapshot into catalog entries (pure apart from `read`). Returns the bodies too. */
40
42
  export declare function normaliseSource(src: CatalogSource, snap: Snapshot, read: Reader): Promise<{
41
43
  entries: CatalogEntry[];
@@ -69,7 +71,9 @@ export declare const PROVENANCE_FILE = ".store-provenance.json";
69
71
  /** A file path inside a skill: relative, no '..', no hidden segments, no backslashes. */
70
72
  export declare function safeRelPath(rel: string): boolean;
71
73
  /** Copies a catalog skill into skillsDir/<name>/ at its pinned sha, with a provenance file. */
72
- export declare function installSkill(entry: CatalogEntry, skillsDir: string, coreSkills: Set<string>, fetchFile?: (path: string) => Promise<Buffer | null>): Promise<{
74
+ export declare function installSkill(entry: CatalogEntry, skillsDir: string, coreSkills: Set<string>, fetchFile?: (path: string) => Promise<Buffer | null>, opts?: {
75
+ update?: boolean;
76
+ }): Promise<{
73
77
  ok: true;
74
78
  name: string;
75
79
  } | {
@@ -80,6 +84,28 @@ export declare function skillProvenance(skillsDir: string, folder: string): {
80
84
  repo: string;
81
85
  sha: string;
82
86
  } | undefined;
87
+ /** An installed skill folder or user agent whose catalog entry changed since it was installed.
88
+ * base: an agent's draft fields at its pinned commit, so the UI can tell a row the user edited. */
89
+ export interface StoreUpdate {
90
+ id: string;
91
+ kind: EntryKind;
92
+ target: string;
93
+ from: string;
94
+ to: string;
95
+ base?: {
96
+ prompt: string;
97
+ tools: string[];
98
+ model: string;
99
+ description: string;
100
+ };
101
+ }
102
+ /** Installed store skills (by folder) and agents (by forked_from) whose entry's text or file list
103
+ * moved on since the commit they were installed at. An older install without a stored rev has
104
+ * it worked out once from that commit. A commit that leaves the entry alone is no update. */
105
+ export declare function findUpdates(entries: CatalogEntry[], skillsDir: string, skillFolders: string[], agents: {
106
+ name: string;
107
+ origin: string;
108
+ }[], readAt?: (repo: string, sha: string) => Reader): Promise<StoreUpdate[]>;
83
109
  /** A user_agents draft for a catalog agent; the frontend saves it. Its role starts from its tools (draftRole). */
84
110
  export declare function agentDraft(entry: CatalogEntry, body: string): {
85
111
  name: string;
@@ -10,7 +10,7 @@ import { dirname, join, resolve, sep, posix } from 'node:path';
10
10
  import { promisify } from 'node:util';
11
11
  import MiniSearch from 'minisearch';
12
12
  import { STOPWORDS } from './stopwords.js';
13
- import { storeName, draftRole, isAgentModel, parseFrontMatter, catalogOrigin, unpinnedOrigin, AGENT_LIMITS } from './agent-store.js';
13
+ import { storeName, draftRole, isAgentModel, parseFrontMatter, catalogOrigin, unpinnedOrigin, pinnedSha, AGENT_LIMITS } from './agent-store.js';
14
14
  const run = promisify(execFile);
15
15
  export const SOURCES = [
16
16
  { id: 'anthropic-skills', label: 'Anthropic skills', repo: 'anthropics/skills', trust: 'anthropic', skill: /^skills\/[^/]+\/SKILL\.md$/ },
@@ -26,6 +26,8 @@ export const SOURCES = [
26
26
  // ── Parsing ──────────────────────────────────────────────────────────────────
27
27
  const str = (v) => (Array.isArray(v) ? v.join(', ') : String(v ?? '')).trim();
28
28
  const list = (v) => (Array.isArray(v) ? v : String(v ?? '').split(',')).map((t) => String(t).trim()).filter(Boolean);
29
+ /** A skill's or agent's tools, from its front matter. */
30
+ const toolsOf = (meta) => list(meta.tools ?? meta['allowed-tools']);
29
31
  const SCRIPT_EXT = /\.(py|sh|bash|zsh|js|mjs|cjs|ts|rb|pl|ps1|php)$/i;
30
32
  const isHidden = (rel) => rel.split('/').some((s) => s.startsWith('.'));
31
33
  function detectLicense(text) {
@@ -51,6 +53,8 @@ async function mapLimit(items, n, fn) {
51
53
  }));
52
54
  return out;
53
55
  }
56
+ /** An entry's rev: its main file's text and its file list. A commit elsewhere in the repo leaves it alone. */
57
+ export const revOf = (md, files) => createHash('sha256').update(md).update('\0' + files.join('\n')).digest('hex').slice(0, 16);
54
58
  /** Turns a repo snapshot into catalog entries (pure apart from `read`). Returns the bodies too. */
55
59
  export async function normaliseSource(src, snap, read) {
56
60
  let failed = 0, tooLarge = 0;
@@ -84,7 +88,7 @@ export async function normaliseSource(src, snap, read) {
84
88
  const files = h.kind === 'skill'
85
89
  ? paths.filter((p) => p.startsWith(dir + '/')).map((p) => p.slice(dir.length + 1)).filter((r) => !isHidden(r))
86
90
  : [posix.basename(h.file)];
87
- const tools = list(meta.tools ?? meta['allowed-tools']);
91
+ const tools = toolsOf(meta);
88
92
  // Out of scope: anything that needs an MCP server.
89
93
  if (tools.some((t) => /^mcp__/.test(t)) || paths.some((p) => p.startsWith(dir + '/') && posix.basename(p) === '.mcp.json'))
90
94
  return null;
@@ -99,7 +103,7 @@ export async function normaliseSource(src, snap, read) {
99
103
  description: str(meta.description).slice(0, 600),
100
104
  tools, ...(str(meta.model) ? { model: str(meta.model) } : {}),
101
105
  files, repo: src.repo, path: dir, sha: snap.sha,
102
- rev: createHash('sha256').update(md).update('\0' + files.join('\n')).digest('hex').slice(0, 16),
106
+ rev: revOf(md, files),
103
107
  license: ownLicense ? (/LICENSE/i.test(ownLicense) ? 'See LICENSE.txt' : ownLicense.slice(0, 40)) : (files.some((f) => /^LICEN[CS]E/i.test(f)) ? 'See LICENSE.txt' : repoLicense || 'Unknown'),
104
108
  scripts: files.filter((f) => f.startsWith('scripts/') || SCRIPT_EXT.test(f)),
105
109
  trust: src.trust,
@@ -235,7 +239,7 @@ export function safeRelPath(rel) {
235
239
  return parts.every((p) => p && p !== '.' && p !== '..' && !p.startsWith('.'));
236
240
  }
237
241
  /** Copies a catalog skill into skillsDir/<name>/ at its pinned sha, with a provenance file. */
238
- export async function installSkill(entry, skillsDir, coreSkills, fetchFile = (p) => rawBytes(entry.repo, entry.sha, p)) {
242
+ export async function installSkill(entry, skillsDir, coreSkills, fetchFile = (p) => rawBytes(entry.repo, entry.sha, p), opts = {}) {
239
243
  if (entry.kind !== 'skill')
240
244
  return { error: 'not a skill' };
241
245
  const name = storeName(entry.name);
@@ -244,7 +248,13 @@ export async function installSkill(entry, skillsDir, coreSkills, fetchFile = (p)
244
248
  if (coreSkills.has(name))
245
249
  return { error: `${name} is a built-in skill name — fork the built-in instead` };
246
250
  const dst = join(skillsDir, name);
247
- if (existsSync(dst))
251
+ if (opts.update) {
252
+ // An update replaces only a folder this store installed from the same file.
253
+ const p = readProvenance(skillsDir, name);
254
+ if (!p || p.source !== entry.source || p.path !== entry.path)
255
+ return { error: `${name} was not installed from this catalog entry` };
256
+ }
257
+ else if (existsSync(dst))
248
258
  return { error: `a skill named ${name} is already installed` };
249
259
  if (!entry.files.includes('SKILL.md'))
250
260
  return { error: 'skill has no SKILL.md' };
@@ -279,24 +289,92 @@ export async function installSkill(entry, skillsDir, coreSkills, fetchFile = (p)
279
289
  }
280
290
  writeFileSync(join(tmp, PROVENANCE_FILE), JSON.stringify({
281
291
  source: entry.source, repo: entry.repo, sha: entry.sha, path: entry.path, license: entry.license,
282
- files: entry.files, scripts: entry.scripts, installedAt: new Date().toISOString(),
292
+ files: entry.files, scripts: entry.scripts, rev: entry.rev, installedAt: new Date().toISOString(),
283
293
  }, null, 2));
284
- renameSync(tmp, dst);
294
+ if (!opts.update) {
295
+ renameSync(tmp, dst);
296
+ return { ok: true, name };
297
+ }
298
+ // Swap: the old copy is moved aside first and put back if the new one cannot take its place.
299
+ const old = `${tmp}-old`;
300
+ renameSync(dst, old);
301
+ try {
302
+ renameSync(tmp, dst);
303
+ }
304
+ catch (e) {
305
+ renameSync(old, dst);
306
+ throw e;
307
+ }
308
+ rmSync(old, { recursive: true, force: true });
285
309
  return { ok: true, name };
286
310
  }
287
311
  finally {
288
312
  rmSync(tmp, { recursive: true, force: true });
289
313
  }
290
314
  }
291
- export function skillProvenance(skillsDir, folder) {
315
+ function readProvenance(skillsDir, folder) {
292
316
  try {
293
317
  const p = JSON.parse(readFileSync(join(skillsDir, folder, PROVENANCE_FILE), 'utf-8'));
294
- return p?.source && p?.sha ? { source: String(p.source), repo: String(p.repo), sha: String(p.sha) } : undefined;
318
+ if (!p?.source || !p?.sha)
319
+ return undefined;
320
+ return { source: String(p.source), repo: String(p.repo), sha: String(p.sha), path: String(p.path || ''), files: Array.isArray(p.files) ? p.files.map(String) : [], ...(p.rev ? { rev: String(p.rev) } : {}) };
295
321
  }
296
322
  catch {
297
323
  return undefined;
298
324
  }
299
325
  }
326
+ export function skillProvenance(skillsDir, folder) {
327
+ const p = readProvenance(skillsDir, folder);
328
+ return p && { source: p.source, repo: p.repo, sha: p.sha };
329
+ }
330
+ // A file at a pinned commit never changes, so it is remembered for the life of the process.
331
+ // A failed read is remembered for a few minutes, so a rate limit does not cost every catalog load.
332
+ const RETRY_MS = 5 * 60 * 1000;
333
+ const pinnedReads = new Map();
334
+ function readAtCommit(kind, repo, sha, path, files, read) {
335
+ const key = `${repo}@${sha}/${path}`;
336
+ const hit = pinnedReads.get(key);
337
+ if (hit && !(hit.failedAt && Date.now() - hit.failedAt > RETRY_MS))
338
+ return hit.p;
339
+ const rec = { p: read(kind === 'skill' ? `${path}/SKILL.md` : path).then((md) => (md == null ? null : { rev: revOf(md, files), md }), () => null), failedAt: 0 };
340
+ rec.p.then((r) => { if (!r)
341
+ rec.failedAt = Date.now(); });
342
+ if (pinnedReads.size >= 500)
343
+ pinnedReads.clear(); // bounded: the shas come from the caller
344
+ pinnedReads.set(key, rec);
345
+ return rec.p;
346
+ }
347
+ const pick = ({ prompt, tools, model, description }) => ({ prompt, tools, model, description });
348
+ /** Installed store skills (by folder) and agents (by forked_from) whose entry's text or file list
349
+ * moved on since the commit they were installed at. An older install without a stored rev has
350
+ * it worked out once from that commit. A commit that leaves the entry alone is no update. */
351
+ export async function findUpdates(entries, skillsDir, skillFolders, agents, readAt = rawReader) {
352
+ const byOrigin = new Map(entries.map((e) => [unpinnedOrigin(catalogOrigin(e)), e]));
353
+ const checks = [];
354
+ for (const folder of skillFolders) {
355
+ const p = readProvenance(skillsDir, folder);
356
+ const e = p && entries.find((x) => x.kind === 'skill' && x.source === p.source && x.path === p.path);
357
+ // A skill renamed upstream would install into another folder, so it is not offered as an update.
358
+ if (e && p.sha !== e.sha && storeName(e.name) === folder)
359
+ checks.push({ e, target: folder, sha: p.sha, rev: p.rev, files: p.files });
360
+ }
361
+ for (const a of agents) {
362
+ const e = byOrigin.get(unpinnedOrigin(a.origin));
363
+ const sha = pinnedSha(a.origin);
364
+ if (e?.kind === 'agent' && sha && sha !== e.sha)
365
+ checks.push({ e, target: a.name, sha, files: e.files });
366
+ }
367
+ const out = await mapLimit(checks, 6, async (c) => {
368
+ const old = c.rev ? null : await readAtCommit(c.e.kind, c.e.repo, c.sha, c.e.path, c.files, readAt(c.e.repo, c.sha));
369
+ const was = c.rev ?? old?.rev;
370
+ if (!was || was === c.e.rev)
371
+ return null;
372
+ const fm = c.e.kind === 'agent' && old ? parseFrontMatter(old.md) : null;
373
+ return { id: c.e.id, kind: c.e.kind, target: c.target, from: c.sha, to: c.e.sha,
374
+ ...(fm ? { base: pick(agentDraft({ ...c.e, tools: toolsOf(fm.meta), model: str(fm.meta.model) || undefined, description: str(fm.meta.description) }, fm.body.trim())) } : {}) };
375
+ });
376
+ return out.filter((u) => !!u);
377
+ }
300
378
  /** A user_agents draft for a catalog agent; the frontend saves it. Its role starts from its tools (draftRole). */
301
379
  export function agentDraft(entry, body) {
302
380
  const tools = entry.tools.filter((t) => !/^mcp__/.test(t));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "osborn",
3
- "version": "0.9.285",
3
+ "version": "0.9.290",
4
4
  "description": "Voice AI coding assistant - local agent that connects to Osborn frontend",
5
5
  "type": "module",
6
6
  "bin": {