mossbear 0.1.0-alpha.43 → 0.1.0-alpha.44
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/README.md +4 -2
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +28 -1
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/init.d.ts +0 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +111 -124
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/link.d.ts +11 -7
- package/dist/commands/link.d.ts.map +1 -1
- package/dist/commands/link.js +50 -10
- package/dist/commands/link.js.map +1 -1
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +29 -3
- package/dist/commands/sync.js.map +1 -1
- package/dist/dashboard-error.d.ts +111 -0
- package/dist/dashboard-error.d.ts.map +1 -0
- package/dist/dashboard-error.js +128 -0
- package/dist/dashboard-error.js.map +1 -0
- package/dist/dashboard-health.d.ts +29 -10
- package/dist/dashboard-health.d.ts.map +1 -1
- package/dist/dashboard-health.js +72 -11
- package/dist/dashboard-health.js.map +1 -1
- package/dist/docs/sync-docs.d.ts.map +1 -1
- package/dist/docs/sync-docs.js +2 -1
- package/dist/docs/sync-docs.js.map +1 -1
- package/dist/harness-writers.d.ts +1 -1
- package/dist/mcp/client.d.ts +0 -20
- package/dist/mcp/client.d.ts.map +1 -1
- package/dist/mcp/client.js +13 -36
- package/dist/mcp/client.js.map +1 -1
- package/dist/rules/guide-history-client.d.ts.map +1 -1
- package/dist/rules/guide-history-client.js +23 -14
- package/dist/rules/guide-history-client.js.map +1 -1
- package/dist/rules/import-client.d.ts.map +1 -1
- package/dist/rules/import-client.js +7 -1
- package/dist/rules/import-client.js.map +1 -1
- package/dist/rules/init-import.d.ts +25 -3
- package/dist/rules/init-import.d.ts.map +1 -1
- package/dist/rules/init-import.js +48 -3
- package/dist/rules/init-import.js.map +1 -1
- package/dist/rules/pull-bundle.d.ts.map +1 -1
- package/dist/rules/pull-bundle.js +2 -1
- package/dist/rules/pull-bundle.js.map +1 -1
- package/dist/rules/unlink-client.d.ts.map +1 -1
- package/dist/rules/unlink-client.js +22 -5
- package/dist/rules/unlink-client.js.map +1 -1
- package/dist/session-start/report.d.ts +8 -0
- package/dist/session-start/report.d.ts.map +1 -1
- package/dist/session-start/report.js +15 -7
- package/dist/session-start/report.js.map +1 -1
- package/dist/update/perform.d.ts.map +1 -1
- package/dist/update/perform.js +2 -3
- package/dist/update/perform.js.map +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# mossbear
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**One set of rules for every coding agent and every repo — graded against what your Claude Code runs actually did, with changes drafted for you to approve.**
|
|
4
|
+
|
|
5
|
+
Local-first CLI for [Mossbear](https://app.mossbear.io). The rules you already wrote (`AGENTS.md`, `CLAUDE.md`, `.cursorrules`, …) stay one copy across every repo and every agent, and every session the CLI hooks into is held against them.
|
|
4
6
|
|
|
5
7
|
The CLI is the on-device half of the product: it hooks into your agent's lifecycle, records what each tool call did, and syncs that record to your dashboard, which grades the run against your rules and skills. Your file contents, your diffs and your raw conversation transcripts never leave your machine — [Privacy](#privacy) lists exactly what does.
|
|
6
8
|
|
|
@@ -53,7 +55,7 @@ mossbear init # no token or account needed
|
|
|
53
55
|
mossbear doctor # verify hooks + config
|
|
54
56
|
```
|
|
55
57
|
|
|
56
|
-
`mossbear init` detects Claude Code, registers a PostToolUse action-logging hook plus Stop and SessionEnd hooks that run `mossbear sync`,
|
|
58
|
+
`mossbear init` detects Claude Code, registers a PostToolUse action-logging hook plus Stop and SessionEnd hooks that run `mossbear sync`, and installs a user-invocable Claude Code skill. It writes no guide file of its own — `AGENTS.md` is yours to create, or arrives from a bundle you subscribe to. Hooks, logging, and the local guide cache work without an account; grading needs one, because it runs on the dashboard.
|
|
57
59
|
|
|
58
60
|
The PostToolUse hook is written as the bare command `mossbear-hook`, a second binary this package installs alongside `mossbear`. It is a separate bin rather than an `mossbear hook` subcommand for two reasons: it runs once per tool call, where booting the full command tree would cost roughly 50ms every time; and a bare command resolved through `PATH` carries nothing machine-specific, so `.claude/settings.json` is identical on every machine and can be committed without churning.
|
|
59
61
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAsEA,eAAO,MAAM,aAAa;;;;;;;;;;;;EAgcxB,CAAA"}
|
package/dist/commands/doctor.js
CHANGED
|
@@ -13,11 +13,19 @@ import { resolveRepoRoot } from '../repo-root.js';
|
|
|
13
13
|
import { discoverGuideFiles } from '../rules/discover.js';
|
|
14
14
|
import { readSessionStartRecord } from '../session-start/record.js';
|
|
15
15
|
import { describeSessionStart } from '../session-start/report.js';
|
|
16
|
+
import { terminalWidth, wrapText } from '../terminal.js';
|
|
16
17
|
import { verifyDashboardToken } from '../token-verify.js';
|
|
17
18
|
import { detectBundledSkillDrift } from '../update/assets.js';
|
|
18
19
|
import { checkForUpdate, formatUpdateNotice } from '../update/notice.js';
|
|
19
20
|
import { formatUpdateSuccess, performUpdate, syncGeneratedAssets, } from '../update/perform.js';
|
|
20
21
|
import { CLI_VERSION } from '../version.js';
|
|
22
|
+
/**
|
|
23
|
+
* Where an `i` line's text starts: two spaces of indent, the glyph, two more.
|
|
24
|
+
*
|
|
25
|
+
* A continuation hangs here rather than at column 0, so a wrapped note stays
|
|
26
|
+
* visibly part of the line it belongs to.
|
|
27
|
+
*/
|
|
28
|
+
const INFO_TEXT_COLUMN = 5;
|
|
21
29
|
/**
|
|
22
30
|
* True when this project's Stop hooks upload the session (`mossbear sync`).
|
|
23
31
|
*
|
|
@@ -365,7 +373,26 @@ export const doctorCommand = defineCommand({
|
|
|
365
373
|
cliOnPath: mossbearBinPath !== null,
|
|
366
374
|
record: await readSessionStartRecord(),
|
|
367
375
|
})) {
|
|
368
|
-
|
|
376
|
+
// Wrapped here rather than in the report, and hanging to its own column
|
|
377
|
+
// rather than to zero.
|
|
378
|
+
//
|
|
379
|
+
// `describeSessionStart` returns one sentence per line and knows nothing
|
|
380
|
+
// about this command's ` i ` gutter; this is the only place that does,
|
|
381
|
+
// which is why the CLI output standard puts wrapping at the printer. A
|
|
382
|
+
// continuation flush left would dissolve the common region the indent
|
|
383
|
+
// creates, so every line after the first is padded to the same column the
|
|
384
|
+
// text starts in.
|
|
385
|
+
for (const [index, wrapped] of wrapText(line,
|
|
386
|
+
// Cannot go non-positive: `terminalWidth` floors at 40 and
|
|
387
|
+
// `INFO_TEXT_COLUMN` is 5, so this always leaves 35 columns to wrap
|
|
388
|
+
// into. Said the way the sibling helpers say it (`init.ts`'s `note`
|
|
389
|
+
// and `warnWrapped`), rather than by a second floor of this file's
|
|
390
|
+
// own: a `Math.max(…, 20)` stood here and could never take its right
|
|
391
|
+
// arm, so it read as a guard while the guard it described lived in
|
|
392
|
+
// `terminal.ts` (Codex, PR 1288).
|
|
393
|
+
terminalWidth() - INFO_TEXT_COLUMN).entries()) {
|
|
394
|
+
console.log(index === 0 ? ` i ${wrapped}` : `${' '.repeat(INFO_TEXT_COLUMN)}${wrapped}`);
|
|
395
|
+
}
|
|
369
396
|
}
|
|
370
397
|
// Repo-local skills are user-editable, so they are only reported (see
|
|
371
398
|
// update/assets.ts). The former machine-owned hook-script refresh is gone —
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAErC,OAAO,EACL,kBAAkB,EAClB,YAAY,EACZ,mBAAmB,EACnB,YAAY,GACb,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAA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;QAC3E,2EAA2E;QAC3E,0EAA0E;QAC1E,4EAA4E;QAC5E,wEAAwE;QACxE,oDAAoD;QACpD,OAAO,CAAC,GAAG,CACT,YAAY,KAAK,UAAU;YACzB,CAAC,CAAC,oHAAoH;YACtH,CAAC,CAAC,WAAW;gBACX,CAAC,CAAC,sBAAsB;gBACxB,CAAC,CAAC,iGAAiG,CACxG,CAAA;QAED,yEAAyE;QACzE,uEAAuE;QACvE,yEAAyE;QACzE,MAAM,MAAM,GAAG,MAAM,cAAc,EAAE,CAAA;QACrC,IAAI,CAAC,MAAM;YAAE,OAAM;QAEnB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAA;QAChD,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK;YAAE,OAAM;QAEhC,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAA;QAChE,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;YAChC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,MAAM,EAAE,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAA;YACjE,MAAM,mBAAmB,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA;QAC1C,CAAC;aAAM,IAAI,MAAM,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;YACtC,wEAAwE;YACxE,2DAA2D;YAC3D,OAAO,CAAC,IAAI,CACV,oBAAoB,MAAM,CAAC,MAAM,wBAAwB,MAAM,CAAC,OAAO,EAAE,CAC1E,CAAA;QACH,CAAC;IACH,CAAC;CACF,CAAC,CAAA"}
|
package/dist/commands/init.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export declare const AGENTS_MD_TEMPLATE = "# AGENTS.md\n\n## Rules\n\n<!-- Add rules below. Adopt them with `mossbear link` and the dashboard\n grades each session's actions against them. -->\n";
|
|
2
1
|
export declare const initCommand: import("citty").CommandDef<{
|
|
3
2
|
force: {
|
|
4
3
|
type: "boolean";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAsaA,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6gDtB,CAAA"}
|
package/dist/commands/init.js
CHANGED
|
@@ -26,7 +26,7 @@ import { ensureRepoIdKey, repoIdFromRoot } from '../repo-id.js';
|
|
|
26
26
|
import { resolveRepoRoot } from '../repo-root.js';
|
|
27
27
|
import { discoverGuideFiles, summarizeDiscoveryLocations } from '../rules/discover.js';
|
|
28
28
|
import { adoptable, managedRefusalSummary, resolveImportCandidates, } from '../rules/import-candidates.js';
|
|
29
|
-
import { formatImportSummary, importDiscoveredGuides } from '../rules/init-import.js';
|
|
29
|
+
import { formatImportFailure, formatImportSummary, importDiscoveredGuides, } from '../rules/init-import.js';
|
|
30
30
|
import { BUNDLED_SKILLS } from '../skill-template.js';
|
|
31
31
|
import { cyan, dim, displayWidth, green, terminalWidth, wrapText } from '../terminal.js';
|
|
32
32
|
import { verifyDashboardToken } from '../token-verify.js';
|
|
@@ -197,8 +197,7 @@ async function writeBundledSkills(cwd, overwrite, noOps) {
|
|
|
197
197
|
}
|
|
198
198
|
if (overwritten.length > 0) {
|
|
199
199
|
// Say what actually happened: this is an unprompted, unrecoverable
|
|
200
|
-
// overwrite, and "updated" reads as a merge.
|
|
201
|
-
// says "overwrote" for the same operation.
|
|
200
|
+
// overwrite, and "updated" reads as a merge.
|
|
202
201
|
console.log(did('overwrote', `.claude/skills/ — ${overwritten.join(', ')}`));
|
|
203
202
|
console.log(note('any local edits to those files are gone'));
|
|
204
203
|
}
|
|
@@ -220,21 +219,21 @@ async function writeBundledSkills(cwd, overwrite, noOps) {
|
|
|
220
219
|
/**
|
|
221
220
|
* The adoption verb, as it is spelled for users.
|
|
222
221
|
*
|
|
223
|
-
*
|
|
224
|
-
*
|
|
225
|
-
*
|
|
226
|
-
*
|
|
227
|
-
*
|
|
228
|
-
*
|
|
222
|
+
* One spelling across every line `init` prints, so a later rename is one edit
|
|
223
|
+
* rather than a hunt — `mossbear import` was missed in exactly that way before
|
|
224
|
+
* the 2026-08-21 rename.
|
|
225
|
+
*
|
|
226
|
+
* It used to carry a second, heavier job: it was interpolated into
|
|
227
|
+
* `AGENTS_MD_TEMPLATE`, the starter AGENTS.md `init` wrote into the user's own
|
|
228
|
+
* repo. That is why the constant exists at all. Committing a command name into
|
|
229
|
+
* someone else's repo means a rename leaves stale instructions in a file
|
|
230
|
+
* Mossbear can never reach again, and interpolation did not fix that — it only
|
|
231
|
+
* fixed copies written from then on. `init` no longer writes that file (step 4
|
|
232
|
+
* below says why), so nothing Mossbear generates carries this verb onto a
|
|
233
|
+
* user's disk any more, and the exposure is bounded to repos initialized before
|
|
234
|
+
* that change (`commands/link.ts` → `ADOPT_ALIAS_REMOVAL_CONDITION`).
|
|
229
235
|
*/
|
|
230
236
|
const ADOPT_VERB = 'mossbear link';
|
|
231
|
-
export const AGENTS_MD_TEMPLATE = `# AGENTS.md
|
|
232
|
-
|
|
233
|
-
## Rules
|
|
234
|
-
|
|
235
|
-
<!-- Add rules below. Adopt them with \`${ADOPT_VERB}\` and the dashboard
|
|
236
|
-
grades each session's actions against them. -->
|
|
237
|
-
`;
|
|
238
237
|
/**
|
|
239
238
|
* Ask which workspace this repo's guidance belongs to, and commit the answer.
|
|
240
239
|
*
|
|
@@ -308,12 +307,12 @@ async function offerWorkspaceDeclaration(client, cwd, dashboardUrl) {
|
|
|
308
307
|
export const initCommand = defineCommand({
|
|
309
308
|
meta: {
|
|
310
309
|
name: 'init',
|
|
311
|
-
description: 'Set up mossbear: install action logging hook and
|
|
310
|
+
description: 'Set up mossbear: install the action logging hook and wire this repo',
|
|
312
311
|
},
|
|
313
312
|
args: {
|
|
314
313
|
force: {
|
|
315
314
|
type: 'boolean',
|
|
316
|
-
description: 'Overwrite existing ~/.mossbear/config.json
|
|
315
|
+
description: 'Overwrite existing ~/.mossbear/config.json and .claude/skills/; ensure .agents/ exists',
|
|
317
316
|
default: false,
|
|
318
317
|
},
|
|
319
318
|
// Declared positively with `default: true` so `--no-skill` works. citty
|
|
@@ -328,7 +327,7 @@ export const initCommand = defineCommand({
|
|
|
328
327
|
},
|
|
329
328
|
'skills-only': {
|
|
330
329
|
type: 'boolean',
|
|
331
|
-
description: 'Rewrite only the bundled skills in .claude/skills/, touching nothing else — the safe way to clear skill drift after a CLI upgrade (`--force` would also reset ~/.mossbear/config.json
|
|
330
|
+
description: 'Rewrite only the bundled skills in .claude/skills/, touching nothing else — the safe way to clear skill drift after a CLI upgrade (`--force` would also reset ~/.mossbear/config.json)',
|
|
332
331
|
default: false,
|
|
333
332
|
},
|
|
334
333
|
'sync-hook': {
|
|
@@ -399,9 +398,9 @@ export const initCommand = defineCommand({
|
|
|
399
398
|
const noOps = [];
|
|
400
399
|
// `--skills-only` exists so a user clearing skill drift after an upgrade
|
|
401
400
|
// has a non-destructive path. The obvious alternative, `--force`, also
|
|
402
|
-
// rewrites ~/.mossbear/config.json from defaults
|
|
403
|
-
// token and every other setting
|
|
404
|
-
//
|
|
401
|
+
// rewrites ~/.mossbear/config.json from defaults, discarding the stored API
|
|
402
|
+
// token and every other setting. Refreshing two generated skill files
|
|
403
|
+
// should not cost anyone their credentials.
|
|
405
404
|
if (args['skills-only']) {
|
|
406
405
|
await writeBundledSkills(cwd, true, noOps);
|
|
407
406
|
reportNoOps(noOps);
|
|
@@ -412,11 +411,19 @@ export const initCommand = defineCommand({
|
|
|
412
411
|
const interactive = args.prompt && process.stdin.isTTY === true;
|
|
413
412
|
/** `--pull-guides`: restore without prompting, TTY or not. */
|
|
414
413
|
const forcedPull = args['pull-guides'] === true;
|
|
415
|
-
// 0. Scan for guide files the user already has, BEFORE
|
|
416
|
-
//
|
|
417
|
-
//
|
|
418
|
-
//
|
|
419
|
-
//
|
|
414
|
+
// 0. Scan for guide files the user already has, BEFORE step 3 materializes
|
|
415
|
+
// anything. A guide the subscription writes to disk is already in the
|
|
416
|
+
// dashboard, so offering to import it back would be offering the user
|
|
417
|
+
// their own guide as if it were new.
|
|
418
|
+
//
|
|
419
|
+
// This used to guard against a second hazard, and no longer needs to:
|
|
420
|
+
// step 4 wrote an AGENTS.md stub, and a scan afterwards offered init's
|
|
421
|
+
// own scaffolding as if the user had written it. Scanning first only
|
|
422
|
+
// ever fixed the *first* run — by run 2 the stub was on disk and the
|
|
423
|
+
// offer came back (`cli-second-init-imports-its-own-template`). The stub
|
|
424
|
+
// is gone rather than excluded, so there is nothing left to order
|
|
425
|
+
// around. The bundled skills below were never the problem: discovery
|
|
426
|
+
// drops them by reserved directory name, whenever it runs.
|
|
420
427
|
//
|
|
421
428
|
// The global roots (`~/.claude/skills`, `~/.cursor/rules`) are walked
|
|
422
429
|
// recursively and their contents read, so they are scanned only when the
|
|
@@ -1144,35 +1151,26 @@ export const initCommand = defineCommand({
|
|
|
1144
1151
|
// of its own nor shadows a valid token already in the config.
|
|
1145
1152
|
const token = await resolveToken(tokenFlagRejected ? '' : args.token).catch(() => '');
|
|
1146
1153
|
const hasToken = Boolean(token);
|
|
1147
|
-
/**
|
|
1148
|
-
* Repo-relative POSIX paths this run materialized from the subscription.
|
|
1149
|
-
*
|
|
1150
|
-
* Read off the reconciler's own report rather than re-derived here:
|
|
1151
|
-
* `DocsSyncBundleResult.wroteOutsideDir` is exactly "paths this pass wrote
|
|
1152
|
-
* outside the bundle directory", already spelled repo-relative
|
|
1153
|
-
* (`packages/cli/src/docs/sync-docs.ts:255`). A guide projected to
|
|
1154
|
-
* `AGENTS.md` lands there. Deriving the projection convention a second time
|
|
1155
|
-
* inside `init` is how the two would drift.
|
|
1156
|
-
*
|
|
1157
|
-
* Consumed by step 4, which must not write its template over a file the
|
|
1158
|
-
* user's own subscription just put there.
|
|
1159
|
-
*/
|
|
1160
|
-
const materializedPaths = new Set();
|
|
1161
1154
|
// 3. Offer subscription, and then materialize what was chosen.
|
|
1162
1155
|
//
|
|
1163
|
-
// **This
|
|
1164
|
-
// ordering
|
|
1165
|
-
// after them, the stub
|
|
1166
|
-
// resolution above is what everything dashboard-facing waits on —
|
|
1167
|
-
// reconciler
|
|
1168
|
-
// as a both-changed conflict, and the repo
|
|
1169
|
-
// instead of the user's guidance. That was
|
|
1170
|
-
// goal criterion 9, deferred by #593
|
|
1156
|
+
// **This ran before the `AGENTS.md` and `.agents/` steps, and that
|
|
1157
|
+
// ordering was the whole of `init-materialize-before-stub`.** Written
|
|
1158
|
+
// after them, the stub was on disk before materialization could run —
|
|
1159
|
+
// token resolution above is what everything dashboard-facing waits on —
|
|
1160
|
+
// so the reconciler met a local file it did not write, correctly
|
|
1161
|
+
// declined it as a both-changed conflict, and the repo ended holding
|
|
1162
|
+
// Mossbear's template instead of the user's guidance. That was
|
|
1163
|
+
// `unified-item-sync` slice 5's goal criterion 9, deferred by #593.
|
|
1164
|
+
//
|
|
1165
|
+
// **The stub it was ordered around no longer exists** (step 4 below says
|
|
1166
|
+
// why), so this is now the only writer of `AGENTS.md` in the command and
|
|
1167
|
+
// the ordering costs nothing to keep. What still depends on running here
|
|
1168
|
+
// is step 0: the scan has to see the repo before materialization adds to
|
|
1169
|
+
// it, or init offers the user their own subscribed guide back.
|
|
1171
1170
|
//
|
|
1172
1171
|
// A file the *user* wrote still wins its conflict report — that case is
|
|
1173
1172
|
// unchanged and deliberately so (`init-materialize-before-stub-plan.md` →
|
|
1174
|
-
// Approach).
|
|
1175
|
-
// written first and then treated as the user's work.
|
|
1173
|
+
// Approach).
|
|
1176
1174
|
//
|
|
1177
1175
|
// This used to be two steps: a one-shot restore through `mossbear guides
|
|
1178
1176
|
// export`'s engine, followed by the subscription offer. Slice 5 deleted
|
|
@@ -1297,9 +1295,6 @@ export const initCommand = defineCommand({
|
|
|
1297
1295
|
{ prune: false });
|
|
1298
1296
|
for (const bundleResult of docsResult.results) {
|
|
1299
1297
|
console.log(formatDocsSyncLine(bundleResult));
|
|
1300
|
-
for (const path of bundleResult.wroteOutsideDir) {
|
|
1301
|
-
materializedPaths.add(path);
|
|
1302
|
-
}
|
|
1303
1298
|
}
|
|
1304
1299
|
}
|
|
1305
1300
|
}
|
|
@@ -1321,39 +1316,19 @@ export const initCommand = defineCommand({
|
|
|
1321
1316
|
warnWrapped(describeRequestFailure(err, 'list your bundles', dashboardUrl, 'mossbear init'));
|
|
1322
1317
|
}
|
|
1323
1318
|
}
|
|
1324
|
-
// 4.
|
|
1319
|
+
// 4. .agents/
|
|
1325
1320
|
//
|
|
1326
|
-
//
|
|
1327
|
-
//
|
|
1328
|
-
//
|
|
1329
|
-
//
|
|
1330
|
-
//
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
// **`--force` does not reach this branch, and that is the point.** Its
|
|
1338
|
-
// contract is "replace an existing AGENTS.md with the template"
|
|
1339
|
-
// (`:99-103`), which is about a file that was already here when init
|
|
1340
|
-
// started — not about a guide the user's own subscription materialized
|
|
1341
|
-
// seconds ago in step 3. Without this clause the reorder would fix the
|
|
1342
|
-
// default path and leave `mossbear init --force --pull-guides` writing the
|
|
1343
|
-
// template over the real guide: the same bug reached through a flag.
|
|
1344
|
-
// `agentsMdExists` cannot express it, because it is true either way.
|
|
1345
|
-
console.log(' AGENTS.md materialized from your subscription — template not written');
|
|
1346
|
-
}
|
|
1347
|
-
else if (agentsMdExists && !args.force) {
|
|
1348
|
-
noOps.push({ subject: 'AGENTS.md', reason: 'force-overwrites' });
|
|
1349
|
-
}
|
|
1350
|
-
else {
|
|
1351
|
-
await writeFile(agentsMdPath, AGENTS_MD_TEMPLATE);
|
|
1352
|
-
if (agentsMdExists)
|
|
1353
|
-
clobberedGuidePaths.add('AGENTS.md');
|
|
1354
|
-
console.log(did(agentsMdExists ? 'overwrote' : 'created', 'AGENTS.md'));
|
|
1355
|
-
}
|
|
1356
|
-
// 5. .agents/
|
|
1321
|
+
// No AGENTS.md is written here, deliberately. `init` used to scaffold one
|
|
1322
|
+
// from a template, and every defect that followed came from the file being
|
|
1323
|
+
// Mossbear's rather than the user's: the second `init` offered to import it
|
|
1324
|
+
// as if the user had written it, a container restore refused to overwrite
|
|
1325
|
+
// it and started from the stub instead of the real guide, and the adopt
|
|
1326
|
+
// command it named was committed into a repo Mossbear can never reach
|
|
1327
|
+
// again, so a rename left stale instructions behind. It carried no rules,
|
|
1328
|
+
// so nothing downstream ever read it. The step that told a first user where
|
|
1329
|
+
// guidance goes is the "Next steps" block below, which always names
|
|
1330
|
+
// `mossbear link` — and unlike a file in someone's repo, that line can be
|
|
1331
|
+
// corrected in a release.
|
|
1357
1332
|
const agentsDirPath = join(cwd, '.agents');
|
|
1358
1333
|
const agentsDirExists = await access(agentsDirPath)
|
|
1359
1334
|
.then(() => true)
|
|
@@ -1370,41 +1345,33 @@ export const initCommand = defineCommand({
|
|
|
1370
1345
|
await writeFile(join(agentsDirPath, '.gitkeep'), '');
|
|
1371
1346
|
console.log(did('created', '.agents/'));
|
|
1372
1347
|
}
|
|
1373
|
-
//
|
|
1348
|
+
// 5. Claude Code skills (mossbear + context-layer round-trip skills)
|
|
1374
1349
|
//
|
|
1375
|
-
// **
|
|
1376
|
-
//
|
|
1377
|
-
// `--force` this can overwrite a file step 3 just materialized.
|
|
1350
|
+
// **Under `--force` this overwrites a file step 3 may have just
|
|
1351
|
+
// materialized, deliberately.** Step 3 runs first, so the window is real.
|
|
1378
1352
|
//
|
|
1379
|
-
//
|
|
1380
|
-
//
|
|
1381
|
-
//
|
|
1382
|
-
//
|
|
1383
|
-
//
|
|
1384
|
-
//
|
|
1385
|
-
//
|
|
1386
|
-
//
|
|
1387
|
-
//
|
|
1388
|
-
// exclusion.
|
|
1353
|
+
// It is much narrower than it looks, and an earlier version of this comment
|
|
1354
|
+
// overstated it (corrected on review of #610): it claimed `mossbear import`
|
|
1355
|
+
// would have filed Mossbear's own bundled skills as guides, since
|
|
1356
|
+
// `.claude/skills` is a discovery root. It does not — `discoverGuideFiles`
|
|
1357
|
+
// drops them by reserved directory name (`isBundledSkillPath`,
|
|
1358
|
+
// `rules/bundled-skills.ts:35`, applied at `rules/discover.ts:393`)
|
|
1359
|
+
// precisely so the CLI's tooling is never imported as user guidance. A
|
|
1360
|
+
// guide reaches one of these paths only by being given one deliberately in
|
|
1361
|
+
// the dashboard, or by an import predating that exclusion.
|
|
1389
1362
|
//
|
|
1390
|
-
//
|
|
1391
|
-
//
|
|
1363
|
+
// A bundled skill is *Mossbear's own artifact* and is expected to track the
|
|
1364
|
+
// installed CLI — the version-drift notice tells users to rewrite it
|
|
1365
|
+
// (`mossbear init --skills-only`), and `--force` documents `.claude/skills/`
|
|
1366
|
+
// as something it overwrites. Preserving a materialized copy here would pin
|
|
1367
|
+
// a stale skill and make the documented refresh path a no-op.
|
|
1392
1368
|
//
|
|
1393
|
-
//
|
|
1394
|
-
//
|
|
1395
|
-
// what my subscription just delivered".
|
|
1396
|
-
// - A bundled skill is *Mossbear's own artifact* and is expected to track the
|
|
1397
|
-
// installed CLI — the version-drift notice tells users to rewrite it
|
|
1398
|
-
// (`mossbear init --skills-only`), and `--force` documents `.claude/skills/`
|
|
1399
|
-
// as something it overwrites (`:102`). Preserving a materialized copy here
|
|
1400
|
-
// would pin a stale skill and make the documented refresh path a no-op.
|
|
1401
|
-
//
|
|
1402
|
-
// Named rather than left implicit, because "why does one path guard and the
|
|
1403
|
-
// other not" is the question a reader arrives with.
|
|
1369
|
+
// Named rather than left implicit, because "why does this overwrite what
|
|
1370
|
+
// step 3 delivered" is the question a reader arrives with.
|
|
1404
1371
|
if (args.skill) {
|
|
1405
1372
|
await writeBundledSkills(cwd, args.force, noOps);
|
|
1406
1373
|
}
|
|
1407
|
-
//
|
|
1374
|
+
// 6. Optional: ask whether to enable global rule discovery
|
|
1408
1375
|
if (interactive) {
|
|
1409
1376
|
const alreadyEnabled = await readConfigDiscoverGlobal().catch(() => false);
|
|
1410
1377
|
if (alreadyEnabled) {
|
|
@@ -1518,7 +1485,7 @@ export const initCommand = defineCommand({
|
|
|
1518
1485
|
}
|
|
1519
1486
|
}
|
|
1520
1487
|
}
|
|
1521
|
-
//
|
|
1488
|
+
// 7. Optional: import the guide files this repo already had (step 0's scan)
|
|
1522
1489
|
// into the dashboard. Most repos arrive with an AGENTS.md or CLAUDE.md
|
|
1523
1490
|
// already written, and without this the only way to get them in was to
|
|
1524
1491
|
// know `mossbear import` exists. Runs before the pull below so
|
|
@@ -1529,7 +1496,7 @@ export const initCommand = defineCommand({
|
|
|
1529
1496
|
// projected guide the placement record claims) is canonical in the
|
|
1530
1497
|
// dashboard, and re-importing it from disk would create a second guide row.
|
|
1531
1498
|
const importRoot = resolveRepoRoot(process.cwd());
|
|
1532
|
-
const initCandidates = await resolveImportCandidates(repoGuideFiles
|
|
1499
|
+
const initCandidates = await resolveImportCandidates(repoGuideFiles, importRoot);
|
|
1533
1500
|
const importableGuideFiles = adoptable(initCandidates).map((candidate) => candidate.file);
|
|
1534
1501
|
// Grouped by bundle, not one sentence per file: run against a copy of this
|
|
1535
1502
|
// repo on 2026-09-03 that was 24 sentences, each wrapping to two lines, for
|
|
@@ -1547,11 +1514,6 @@ export const initCommand = defineCommand({
|
|
|
1547
1514
|
console.log(wrapped.map((text, i) => (i === 0 ? ` ${text}` : pad + text)).join('\n'));
|
|
1548
1515
|
console.log(note(group.note));
|
|
1549
1516
|
}
|
|
1550
|
-
for (const file of repoGuideFiles) {
|
|
1551
|
-
if (clobberedGuidePaths.has(file.payloadPath)) {
|
|
1552
|
-
console.log(` ${file.displayPath} was replaced by --force — its previous contents are not imported.`);
|
|
1553
|
-
}
|
|
1554
|
-
}
|
|
1555
1517
|
if (hasToken && importableGuideFiles.length > 0 && args['import-guides'] !== false) {
|
|
1556
1518
|
let shouldImport = args['import-guides'] === true;
|
|
1557
1519
|
if (!shouldImport && interactive) {
|
|
@@ -1595,8 +1557,21 @@ export const initCommand = defineCommand({
|
|
|
1595
1557
|
console.log(line);
|
|
1596
1558
|
}
|
|
1597
1559
|
catch (err) {
|
|
1598
|
-
|
|
1599
|
-
|
|
1560
|
+
// Fourth site of the leak `describeRequestFailure` exists to close,
|
|
1561
|
+
// and the one that reaches an answer *about the request*: the import
|
|
1562
|
+
// route refuses a declared workspace this account cannot reach, and
|
|
1563
|
+
// refuses an import with two places to land, in sentences written for
|
|
1564
|
+
// whoever ran `mossbear init`. `errText` wrapped both in an HTTP
|
|
1565
|
+
// status and a JSON body. The retry it used to name on its own line is
|
|
1566
|
+
// now inside the sentence, or omitted where the server's own remedy
|
|
1567
|
+
// has to happen first.
|
|
1568
|
+
for (const line of formatImportFailure(err, {
|
|
1569
|
+
subject: 'import your guide files',
|
|
1570
|
+
dashboardUrl,
|
|
1571
|
+
retry: ADOPT_VERB,
|
|
1572
|
+
})) {
|
|
1573
|
+
console.warn(line);
|
|
1574
|
+
}
|
|
1600
1575
|
}
|
|
1601
1576
|
}
|
|
1602
1577
|
}
|
|
@@ -1687,7 +1662,19 @@ export const initCommand = defineCommand({
|
|
|
1687
1662
|
else {
|
|
1688
1663
|
console.log('\nDone. Next steps:');
|
|
1689
1664
|
}
|
|
1690
|
-
|
|
1665
|
+
// Read from disk rather than assumed either way. `init` no longer writes an
|
|
1666
|
+
// AGENTS.md, so "edit AGENTS.md" points at nothing in a fresh repo — but
|
|
1667
|
+
// step 3 may have just materialized one from the subscription, and an
|
|
1668
|
+
// unconditional "create it" then tells the user to start a second guide
|
|
1669
|
+
// file two lines above an offer to adopt the ones they already have
|
|
1670
|
+
// (caught in the shipped terminal capture, which is a repo with guide
|
|
1671
|
+
// files). One `access` is what keeps the sentence true in both.
|
|
1672
|
+
const rulesFileExists = await access(join(cwd, 'AGENTS.md'))
|
|
1673
|
+
.then(() => true)
|
|
1674
|
+
.catch(() => false);
|
|
1675
|
+
console.log(rulesFileExists
|
|
1676
|
+
? ' Edit AGENTS.md to add your rules'
|
|
1677
|
+
: ' Create AGENTS.md and write your rules in it');
|
|
1691
1678
|
for (const step of nextSteps) {
|
|
1692
1679
|
// Padded before colouring, never after: escape codes count toward
|
|
1693
1680
|
// `String.length` and occupy no columns, so padding a coloured string pads
|