mossbear 0.1.0-alpha.35 → 0.1.0-alpha.38
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 +2 -0
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +52 -12
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +133 -39
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/pull.js +2 -2
- package/dist/commands/pull.js.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +22 -2
- package/dist/commands/status.js.map +1 -1
- package/dist/config.d.ts +36 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +45 -0
- package/dist/config.js.map +1 -1
- package/dist/docs/bundle-by-name.d.ts +25 -2
- package/dist/docs/bundle-by-name.d.ts.map +1 -1
- package/dist/docs/bundle-by-name.js +20 -3
- package/dist/docs/bundle-by-name.js.map +1 -1
- package/dist/docs/global-namespace.d.ts +232 -0
- package/dist/docs/global-namespace.d.ts.map +1 -0
- package/dist/docs/global-namespace.js +535 -0
- package/dist/docs/global-namespace.js.map +1 -0
- package/dist/docs/global-status.d.ts +67 -0
- package/dist/docs/global-status.d.ts.map +1 -0
- package/dist/docs/global-status.js +93 -0
- package/dist/docs/global-status.js.map +1 -0
- package/dist/docs/sync-docs.d.ts +23 -0
- package/dist/docs/sync-docs.d.ts.map +1 -1
- package/dist/docs/sync-docs.js +65 -1
- package/dist/docs/sync-docs.js.map +1 -1
- package/dist/docs/sync-plan.d.ts +29 -0
- package/dist/docs/sync-plan.d.ts.map +1 -1
- package/dist/docs/sync-plan.js +41 -1
- package/dist/docs/sync-plan.js.map +1 -1
- package/dist/harness-formats/antigravity.d.ts +119 -0
- package/dist/harness-formats/antigravity.d.ts.map +1 -0
- package/dist/harness-formats/antigravity.js +209 -0
- package/dist/harness-formats/antigravity.js.map +1 -0
- package/dist/harness-manifest-schema.d.ts +64 -0
- package/dist/harness-manifest-schema.d.ts.map +1 -0
- package/dist/harness-manifest-schema.js +81 -0
- package/dist/harness-manifest-schema.js.map +1 -0
- package/dist/harness-writers.d.ts +12 -68
- package/dist/harness-writers.d.ts.map +1 -1
- package/dist/harness-writers.js +20 -83
- package/dist/harness-writers.js.map +1 -1
- package/dist/harnesses.d.ts +255 -49
- package/dist/harnesses.d.ts.map +1 -1
- package/dist/harnesses.js +315 -57
- package/dist/harnesses.js.map +1 -1
- package/dist/hook-bin.js +17 -1
- package/dist/hook-bin.js.map +1 -1
- package/dist/hook-logger.d.ts +2 -0
- package/dist/hook-logger.d.ts.map +1 -1
- package/dist/hook-logger.js +21 -6
- package/dist/hook-logger.js.map +1 -1
- package/dist/hooks-settings.d.ts +41 -9
- package/dist/hooks-settings.d.ts.map +1 -1
- package/dist/hooks-settings.js +54 -11
- package/dist/hooks-settings.js.map +1 -1
- package/dist/init/wire-harnesses.d.ts +51 -35
- package/dist/init/wire-harnesses.d.ts.map +1 -1
- package/dist/init/wire-harnesses.js +144 -113
- package/dist/init/wire-harnesses.js.map +1 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +180 -71
- package/dist/mcp/server.js.map +1 -1
- package/dist/project-hooks.d.ts +35 -13
- package/dist/project-hooks.d.ts.map +1 -1
- package/dist/project-hooks.js +114 -49
- package/dist/project-hooks.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -10,6 +10,8 @@ The CLI is the on-device half of the product: it hooks into your agent's lifecyc
|
|
|
10
10
|
npm install -g mossbear
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
+
There is no stable release yet: this installs an alpha, and breaking changes can land on it without a deprecation window.
|
|
14
|
+
|
|
13
15
|
A global install is required (not just `npx`). The hooks `mossbear init` registers run from your agent's session by name — `mossbear-hook` on every tool call, `mossbear sync` at the end of each turn and of the session — so both binaries must be on `PATH`. Node 20+ required.
|
|
14
16
|
|
|
15
17
|
## Staying up to date
|
|
@@ -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":"AA6DA,eAAO,MAAM,aAAa;;;;;;;;;;;;EAyaxB,CAAA"}
|
package/dist/commands/doctor.js
CHANGED
|
@@ -4,8 +4,7 @@ import { describeDashboardHealth } from '../dashboard-health.js';
|
|
|
4
4
|
import { describeGuideDelivery } from '../docs/delivery-check.js';
|
|
5
5
|
import { classifyUnresolvedSubscription, repoBundleIds, unresolvedSubscriptionMessage, } from '../docs/delivery.js';
|
|
6
6
|
import { collidesWithHomeConfig, readRepoDocsConfig } from '../docs/repo-config.js';
|
|
7
|
-
import { CODEX_TRUST_NOTE } from '../
|
|
8
|
-
import { harnessDefinition } from '../harnesses.js';
|
|
7
|
+
import { CODEX_TRUST_NOTE, harnessDefinition, loggerCommand } from '../harnesses.js';
|
|
9
8
|
import { MOSSBEAR_HOOK_COMMAND, MOSSBEAR_SYNC_COMMAND, sessionStartHookAlreadyPulls, sessionStartHookUpdatesCli, sessionStartHookBootstraps, stopHookUploadsActions, } from '../hooks-settings.js';
|
|
10
9
|
import { createContextClient } from '../mcp/client.js';
|
|
11
10
|
import { resolveOnPath } from '../path-resolve.js';
|
|
@@ -60,19 +59,56 @@ export const doctorCommand = defineCommand({
|
|
|
60
59
|
const wiredHarnesses = harnessWiring.filter((harness) => harness.logsActions);
|
|
61
60
|
const codexWired = wiredHarnesses.some((harness) => harness.id === 'codex');
|
|
62
61
|
// Names the event per harness rather than just the file, because the event
|
|
63
|
-
// is the thing that differs between them — `PostToolUse
|
|
64
|
-
// `post_tool_use` are the same hook under
|
|
65
|
-
// user checks their own config against. The sibling checks below are
|
|
62
|
+
// is the thing that differs between them — Claude Code's `PostToolUse` and
|
|
63
|
+
// Codex's `post_tool_use` are the same hook under two names — and it is
|
|
64
|
+
// what a user checks their own config against. The sibling checks below are
|
|
66
65
|
// Claude Code's alone and keep their own wording.
|
|
67
66
|
const wiredHarnessDetail = wiredHarnesses
|
|
68
67
|
.map((harness) => {
|
|
69
|
-
const
|
|
70
|
-
|
|
68
|
+
const manifest = harnessDefinition(harness.id);
|
|
69
|
+
const outbound = manifest.outbound;
|
|
70
|
+
const detail = outbound
|
|
71
|
+
? `${outbound.projectConfig} ${outbound.events.logger} hook (${loggerCommand(manifest)})`
|
|
72
|
+
: `${MOSSBEAR_HOOK_COMMAND} hook`;
|
|
73
|
+
// An entry that logs but names no field map is reported as the problem
|
|
74
|
+
// it is, not folded into the wired list: `mossbear-hook` would read
|
|
75
|
+
// this harness's payload with Claude Code's field names, resolve
|
|
76
|
+
// nothing, and log every session under `'unknown'` — one merged run
|
|
77
|
+
// per machine, graded as if it meant something.
|
|
78
|
+
const suffix = harness.fieldMapOk
|
|
79
|
+
? ''
|
|
80
|
+
: ` — missing \`--harness ${manifest.id}\`, so its payload reads as empty; re-run \`mossbear init\``;
|
|
81
|
+
return `${manifest.label} — ${detail}${suffix}`;
|
|
71
82
|
})
|
|
72
83
|
.join('; ');
|
|
73
84
|
const hooksConfigured = wiredHarnesses.length > 0;
|
|
85
|
+
// Claude Code's alone, and gated on Claude Code being wired rather than on
|
|
86
|
+
// *any* harness. `PostToolUseFailure` is a Claude Code event — no other
|
|
87
|
+
// harness has one — so in an Antigravity- or Codex-only repo this check was
|
|
88
|
+
// reporting a hook that cannot exist as missing, failing `doctor` with a
|
|
89
|
+
// remedy ("run `mossbear init` to add it") that could only be satisfied by
|
|
90
|
+
// wiring a different harness than the one the repo uses.
|
|
91
|
+
const claudeCodeWired = wiredHarnesses.some((harness) => harness.id === 'claude_code');
|
|
74
92
|
const failureHookConfigured = detectLoggerHook(projectHooks, 'PostToolUseFailure') !== null;
|
|
75
|
-
|
|
93
|
+
// The upload question is every harness's, so it is answered from every
|
|
94
|
+
// wired harness's own config rather than from `.claude/settings.json`.
|
|
95
|
+
// Reading only Claude Code's file told an Antigravity repo its actions were
|
|
96
|
+
// never uploaded while its `.agents/hooks.json` Stop hook was uploading
|
|
97
|
+
// them — a false red on the exact state `mossbear init --platform
|
|
98
|
+
// antigravity` produces.
|
|
99
|
+
const uploadConfigured = detectUploadHook(projectHooks) ||
|
|
100
|
+
wiredHarnesses.some((harness) => harness.uploadsRun);
|
|
101
|
+
// Named per harness so the reader can open the file the check just read.
|
|
102
|
+
// Claude Code is listed through `detectUploadHook` rather than its wiring
|
|
103
|
+
// row because that reader knows about `--no-actions`/`--dry-run` Stop
|
|
104
|
+
// hooks, which mention `mossbear sync` and upload nothing.
|
|
105
|
+
const uploadingConfigs = [
|
|
106
|
+
...(detectUploadHook(projectHooks) ? ['.claude/settings.json'] : []),
|
|
107
|
+
...wiredHarnesses
|
|
108
|
+
.filter((harness) => harness.uploadsRun && harness.id !== 'claude_code')
|
|
109
|
+
.map((harness) => harnessDefinition(harness.id).outbound?.projectConfig)
|
|
110
|
+
.filter((path) => path !== undefined),
|
|
111
|
+
];
|
|
76
112
|
// Reported rather than checked — see `describeSessionStart`. This hook is
|
|
77
113
|
// the one `mossbear init` lets a user decline, and its absence is
|
|
78
114
|
// indistinguishable from having declined it.
|
|
@@ -206,7 +242,7 @@ export const doctorCommand = defineCommand({
|
|
|
206
242
|
// inert case reported as healthy.
|
|
207
243
|
//
|
|
208
244
|
// Passes on *any* wired harness, not on Claude Code specifically: a
|
|
209
|
-
//
|
|
245
|
+
// Codex-only repo is correctly set up, and failing it here would be
|
|
210
246
|
// the check telling a working repo it is broken. Which harnesses those
|
|
211
247
|
// are is the detail line's job.
|
|
212
248
|
ok: hooksConfigured && runnerOk,
|
|
@@ -219,7 +255,7 @@ export const doctorCommand = defineCommand({
|
|
|
219
255
|
// Only meaningful once the logger is wired: with no PostToolUse hook
|
|
220
256
|
// there is nothing to upload, and the check above already says so. Two
|
|
221
257
|
// failures for one cause would just make the output harder to act on.
|
|
222
|
-
...(
|
|
258
|
+
...(claudeCodeWired
|
|
223
259
|
? [
|
|
224
260
|
{
|
|
225
261
|
// PostToolUse fires only after a tool call succeeds; a failing
|
|
@@ -237,6 +273,10 @@ export const doctorCommand = defineCommand({
|
|
|
237
273
|
? `.claude/settings.json has PostToolUseFailure hook (${MOSSBEAR_HOOK_COMMAND})`
|
|
238
274
|
: `${MOSSBEAR_HOOK_COMMAND} not on PATH — reinstall globally (npm install -g mossbear)`,
|
|
239
275
|
},
|
|
276
|
+
]
|
|
277
|
+
: []),
|
|
278
|
+
...(hooksConfigured
|
|
279
|
+
? [
|
|
240
280
|
{
|
|
241
281
|
label: 'Session uploads to the dashboard',
|
|
242
282
|
// Configured is not the same as able to run. The runner check
|
|
@@ -246,10 +286,10 @@ export const doctorCommand = defineCommand({
|
|
|
246
286
|
// case `missingHookPathWarning` already covers for init.
|
|
247
287
|
ok: uploadConfigured && mossbearBinPath !== null,
|
|
248
288
|
detail: !uploadConfigured
|
|
249
|
-
? `actions are being logged to ~/.mossbear/runs/ and never uploaded — run \`mossbear init\` to add the \`${MOSSBEAR_SYNC_COMMAND}\` Stop hook. If you upload some other way, this check will keep reporting.`
|
|
289
|
+
? `actions are being logged to ~/.mossbear/runs/ and never uploaded — run \`mossbear init\` to add the \`${MOSSBEAR_SYNC_COMMAND}\` Stop hook to ${wiredHarnesses.map((harness) => harnessDefinition(harness.id).label).join(', ')}. If you upload some other way, this check will keep reporting.`
|
|
250
290
|
: mossbearBinPath === null
|
|
251
291
|
? '`mossbear` is not on PATH, so the configured Stop hook fails with command-not-found and nothing uploads — reinstall globally (npm install -g mossbear)'
|
|
252
|
-
:
|
|
292
|
+
: `${uploadingConfigs.join(', ')} has a Stop hook (${MOSSBEAR_SYNC_COMMAND})`,
|
|
253
293
|
},
|
|
254
294
|
]
|
|
255
295
|
: []),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/commands/doctor.ts"],"names":[],"mappings":"AAAA,O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C,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"}
|
|
@@ -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":"AAuOA,eAAO,MAAM,kBAAkB,+JAM9B,CAAA;AAED,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAm8CtB,CAAA"}
|
package/dist/commands/init.js
CHANGED
|
@@ -4,20 +4,21 @@ import { join } from 'node:path';
|
|
|
4
4
|
import { createInterface } from 'node:readline/promises';
|
|
5
5
|
import { PROTOCOL_VERSION } from '@mossbear/protocol';
|
|
6
6
|
import { defineCommand } from 'citty';
|
|
7
|
-
import { MOSSBEAR_CONFIG_MODE, DEFAULT_DASHBOARD_URL, MOSSBEAR_DASHBOARD_URL_ENV, ensureMossbearDir, normalizeDashboardUrl, readConfigDashboardUrl, readEnvDashboardUrl, readConfigDiscoverGlobal, removeConfigEvalSection, resolveDashboardUrl, resolveToken, writeConfigDashboardUrl, writeConfigDiscoverGlobal, writeConfigToken, } from '../config.js';
|
|
7
|
+
import { MOSSBEAR_CONFIG_MODE, DEFAULT_DASHBOARD_URL, MOSSBEAR_DASHBOARD_URL_ENV, ensureMossbearDir, normalizeDashboardUrl, readConfigDashboardUrl, readEnvDashboardUrl, readConfigDiscoverGlobal, removeConfigEvalSection, resolveDashboardUrl, resolveToken, writeConfigDashboardUrl, writeConfigDiscoverGlobal, writeConfigToken, readGlobalDeliveryConsent, writeGlobalDeliveryConsent, } from '../config.js';
|
|
8
8
|
import { deliveryBundles, legacySubscribedSlugs, legacySubscriptionMessage, repoBundleIds, } from '../docs/delivery.js';
|
|
9
|
+
import { globalSkillsRoot, namespaceDir } from '../docs/global-namespace.js';
|
|
9
10
|
import { readRepoDocsConfig, readRepoProjectId } from '../docs/repo-config.js';
|
|
10
11
|
import { resolveInitSubscriptionSelection, subscribeBundleSelections, } from '../docs/subscribe.js';
|
|
11
12
|
import { formatDocsSyncLine, syncSubscribedDocs } from '../docs/sync-docs.js';
|
|
12
13
|
import { errText } from '../err-text.js';
|
|
13
|
-
import { detectHarnesses, harnessDefinition, parsePlatformFlag, resolveHarnessSelection, } from '../harnesses.js';
|
|
14
|
+
import { detectHarnesses, harnessDefinition, harnessOffers, loggerCommand, parseHarnessSelection, parsePlatformFlag, resolveHarnessSelection, } from '../harnesses.js';
|
|
14
15
|
import { MOSSBEAR_HOOK_COMMAND, MOSSBEAR_SESSION_END_COMMAND, MOSSBEAR_SESSION_START_COMMAND, MOSSBEAR_SYNC_COMMAND, hookGroupsHaveCommand, mergeMossbearHookEntry, mergeMossbearLoggerHook, missingHookPathWarning, pruneStaleHooks, sessionStartHookAlreadyPulls, staleHookWarning, legacyFreshnessHookNote, supersededSessionStartWarning, SUPERSEDED_SESSION_START_COMMANDS, stopHookUploadsActions, } from '../hooks-settings.js';
|
|
15
|
-
import {
|
|
16
|
+
import { wireHarness } from '../init/wire-harnesses.js';
|
|
16
17
|
import { createContextClient } from '../mcp/client.js';
|
|
17
|
-
import { MOSSBEAR_CONFIG, MOSSBEAR_HOME, MOSSBEAR_RUNS_DIR } from '../mossbear-paths.js';
|
|
18
|
+
import { MOSSBEAR_CONFIG, MOSSBEAR_GLOBAL_DIR, MOSSBEAR_HOME, MOSSBEAR_RUNS_DIR, } from '../mossbear-paths.js';
|
|
18
19
|
import { resolveOnPath } from '../path-resolve.js';
|
|
19
20
|
import { ensureProjectId } from '../project-id.js';
|
|
20
|
-
import { askLine } from '../prompt.js';
|
|
21
|
+
import { askLine, confirmYesNo } from '../prompt.js';
|
|
21
22
|
import { ensureRepoIdKey, repoIdFromRoot } from '../repo-id.js';
|
|
22
23
|
import { resolveRepoRoot } from '../repo-root.js';
|
|
23
24
|
import { discoverGuideFiles } from '../rules/discover.js';
|
|
@@ -210,7 +211,7 @@ export const initCommand = defineCommand({
|
|
|
210
211
|
},
|
|
211
212
|
platform: {
|
|
212
213
|
type: 'string',
|
|
213
|
-
description: 'Comma-separated harnesses to wire, overriding detection: claude_code,
|
|
214
|
+
description: 'Comma-separated harnesses to wire, overriding detection: claude_code, codex. Required when there is no TTY and the repo has no harness config to detect',
|
|
214
215
|
valueHint: 'list',
|
|
215
216
|
default: '',
|
|
216
217
|
},
|
|
@@ -286,7 +287,7 @@ export const initCommand = defineCommand({
|
|
|
286
287
|
// No eval-provider block: grading runs on the server against what `mossbear
|
|
287
288
|
// sync` uploads, so nothing here needs an LLM key.
|
|
288
289
|
// No `platform` field. It was written unconditionally as the string
|
|
289
|
-
// `'claude_code'`, so the moment `init` wires a
|
|
290
|
+
// `'claude_code'`, so the moment `init` wires a Codex-only repo it would
|
|
290
291
|
// name a harness that repo does not use — and a second copy of a fact the
|
|
291
292
|
// hook files already hold is the dual-write CLAUDE.md's Simplicity section
|
|
292
293
|
// names. `mossbear status` and `doctor` read the config files instead
|
|
@@ -315,7 +316,17 @@ export const initCommand = defineCommand({
|
|
|
315
316
|
}
|
|
316
317
|
}
|
|
317
318
|
else {
|
|
318
|
-
|
|
319
|
+
// `--force` resets the config, but consent is not config: it is an answer
|
|
320
|
+
// a person gave, and a scripted `init --force` has nobody present to give
|
|
321
|
+
// it again. Wiping it silently would stop delivering a user's global
|
|
322
|
+
// guides with no message, and would re-open a question the next
|
|
323
|
+
// interactive run then re-asks — the attrition loop the three-state answer
|
|
324
|
+
// exists to prevent. Carried across, so only an explicit re-answer at the
|
|
325
|
+
// prompt changes it.
|
|
326
|
+
const priorConsent = await readGlobalDeliveryConsent().catch(() => null);
|
|
327
|
+
await writeFile(MOSSBEAR_CONFIG, JSON.stringify(priorConsent === null
|
|
328
|
+
? config
|
|
329
|
+
: { ...config, globalDelivery: { consented: priorConsent } }, null, 2) + '\n', {
|
|
319
330
|
mode: MOSSBEAR_CONFIG_MODE,
|
|
320
331
|
});
|
|
321
332
|
await chmod(MOSSBEAR_CONFIG, MOSSBEAR_CONFIG_MODE).catch(() => { });
|
|
@@ -490,17 +501,46 @@ export const initCommand = defineCommand({
|
|
|
490
501
|
const resolution = resolveHarnessSelection({ detected, requested, interactive });
|
|
491
502
|
let wiring = resolution.ids;
|
|
492
503
|
if (resolution.confirm) {
|
|
493
|
-
//
|
|
494
|
-
//
|
|
495
|
-
//
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
//
|
|
500
|
-
|
|
501
|
-
|
|
504
|
+
// One numbered list, answered with one line, rather than a yes/no over
|
|
505
|
+
// the whole set. The yes/no could not express "wire Codex but not that
|
|
506
|
+
// other thing", and had nothing to say about a harness detection found
|
|
507
|
+
// and `init` cannot write. A numbered list also keeps the interaction
|
|
508
|
+
// inside `askLine` — `prompt.ts` has no multi-select primitive, and a
|
|
509
|
+
// raw-mode one would be untestable — and reads the same under `NO_COLOR`
|
|
510
|
+
// and in a pipe, where position carries the structure.
|
|
511
|
+
const offers = harnessOffers(resolution);
|
|
512
|
+
const width = Math.max(...offers.map((offer) => offer.label.length));
|
|
513
|
+
let printedMachineHeading = false;
|
|
514
|
+
console.log('\nDetected in this repo:');
|
|
515
|
+
offers.forEach((offer, index) => {
|
|
516
|
+
if (!offer.inRepo && !printedMachineHeading) {
|
|
517
|
+
console.log('Also installed on this machine:');
|
|
518
|
+
printedMachineHeading = true;
|
|
519
|
+
}
|
|
520
|
+
// A wireable row names the file it will write; a prompt-only row says
|
|
521
|
+
// there is nothing to write, because naming a path there would promise
|
|
522
|
+
// a file this run cannot produce.
|
|
523
|
+
const detail = offer.path
|
|
524
|
+
? `→ ${offer.path}`
|
|
525
|
+
: ' prompt-only — nothing to write yet';
|
|
526
|
+
console.log(` ${index + 1}. ${offer.label.padEnd(width)} ${detail}`);
|
|
527
|
+
});
|
|
528
|
+
const preselected = offers
|
|
529
|
+
.map((offer, index) => (offer.preselected ? String(index + 1) : null))
|
|
530
|
+
.filter((label) => label !== null);
|
|
531
|
+
const answer = await askLine(`\nWire which? [${preselected.join(',')}] (Enter to accept, \`none\` to skip): `);
|
|
532
|
+
const selection = parseHarnessSelection(answer, offers);
|
|
533
|
+
if (!selection.ok) {
|
|
534
|
+
// Refused rather than reinterpreted: a user who typed `5` and silently
|
|
535
|
+
// got the default wired would have no way to tell that from having
|
|
536
|
+
// typed it correctly.
|
|
537
|
+
console.error(` ${selection.message}`);
|
|
538
|
+
process.exitCode = 1;
|
|
539
|
+
return;
|
|
540
|
+
}
|
|
541
|
+
wiring = selection.ids;
|
|
542
|
+
if (wiring.length === 0) {
|
|
502
543
|
console.log(' skipped hook setup — `mossbear init --platform <harness>` to wire one');
|
|
503
|
-
wiring = [];
|
|
504
544
|
}
|
|
505
545
|
}
|
|
506
546
|
const wireClaudeCode = wiring.includes('claude_code');
|
|
@@ -514,8 +554,8 @@ export const initCommand = defineCommand({
|
|
|
514
554
|
* **Two lists rather than one boolean**, because "no hooks were installed"
|
|
515
555
|
* and "Claude Code's hooks were not installed" are different sentences and
|
|
516
556
|
* the second one is often the true one: the harness loop below is not gated
|
|
517
|
-
* on Claude Code succeeding, so a repo using
|
|
518
|
-
*
|
|
557
|
+
* on Claude Code succeeding, so a repo using Codex as well still gets its
|
|
558
|
+
* Codex hooks when `.claude/settings.json` is corrupt. Claiming *nothing*
|
|
519
559
|
* will be recorded there is false, and it is false in the command's final
|
|
520
560
|
* verdict, which is the worst place to be wrong.
|
|
521
561
|
*
|
|
@@ -534,7 +574,7 @@ export const initCommand = defineCommand({
|
|
|
534
574
|
// Bare command, resolved through PATH from the `mossbear-hook` bin. Nothing
|
|
535
575
|
// machine-specific, so this file is identical everywhere and safe to
|
|
536
576
|
// commit.
|
|
537
|
-
command:
|
|
577
|
+
command: loggerCommand(harnessDefinition('claude_code')),
|
|
538
578
|
timeout: 5,
|
|
539
579
|
};
|
|
540
580
|
try {
|
|
@@ -900,20 +940,12 @@ export const initCommand = defineCommand({
|
|
|
900
940
|
if (id === 'claude_code')
|
|
901
941
|
continue;
|
|
902
942
|
try {
|
|
903
|
-
// The same opt-out
|
|
904
|
-
// `--no-session-start-hook`
|
|
905
|
-
//
|
|
906
|
-
//
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
const optIns = {
|
|
910
|
-
sessionStart: args['session-start-hook'] !== false,
|
|
911
|
-
sessionEnd: args['session-end-hook'] !== false,
|
|
912
|
-
sync: args['sync-hook'] !== false,
|
|
913
|
-
};
|
|
914
|
-
const written = id === 'gemini_cli'
|
|
915
|
-
? await wireGeminiCli(cwd, optIns)
|
|
916
|
-
: await wireCodex(cwd, optIns);
|
|
943
|
+
// The same opt-out flag that gates Claude Code's Stop entry. Codex
|
|
944
|
+
// has no session-scoped event, so `--no-session-start-hook` and
|
|
945
|
+
// `--no-session-end-hook` have nothing to decline here and are not
|
|
946
|
+
// passed on — see `HookOptIns` in `init/wire-harnesses.ts`.
|
|
947
|
+
const optIns = { sync: args['sync-hook'] !== false };
|
|
948
|
+
const written = await wireHarness(cwd, harnessDefinition(id), optIns);
|
|
917
949
|
if (written.unreadable) {
|
|
918
950
|
console.warn(` ${written.unreadable}`);
|
|
919
951
|
hookWiringFailedFor.push(harnessDefinition(id).label);
|
|
@@ -924,9 +956,12 @@ export const initCommand = defineCommand({
|
|
|
924
956
|
console.log(note(`${written.installed.length} hook${written.installed.length === 1 ? '' : 's'}: ${written.installed.join(', ')}`));
|
|
925
957
|
// Printed on the run that writes the file, for the same reason the
|
|
926
958
|
// SessionStart consent notice is: it names a step the user still owes,
|
|
927
|
-
// and `doctor` reporting it later is a worse place to learn it.
|
|
928
|
-
|
|
929
|
-
|
|
959
|
+
// and `doctor` reporting it later is a worse place to learn it. Read
|
|
960
|
+
// off the manifest rather than branched on the id, so a harness with
|
|
961
|
+
// its own outstanding step says so without an edit here.
|
|
962
|
+
const writeNote = harnessDefinition(id).outbound?.writeNote;
|
|
963
|
+
if (writeNote)
|
|
964
|
+
console.log(note(writeNote));
|
|
930
965
|
}
|
|
931
966
|
if (written.present.length > 0) {
|
|
932
967
|
console.log(` kept ${written.present.join(', ')} in ${written.path}`);
|
|
@@ -937,7 +972,7 @@ export const initCommand = defineCommand({
|
|
|
937
972
|
}
|
|
938
973
|
}
|
|
939
974
|
catch {
|
|
940
|
-
console.warn(` warning: could not update ${harnessDefinition(id).projectConfig}`);
|
|
975
|
+
console.warn(` warning: could not update ${harnessDefinition(id).outbound?.projectConfig ?? id}`);
|
|
941
976
|
// Same reasoning as the Claude Code catch above: a harness this run set
|
|
942
977
|
// out to wire and could not is a failed setup, whichever harness it is.
|
|
943
978
|
hookWiringFailedFor.push(harnessDefinition(id).label);
|
|
@@ -1227,6 +1262,65 @@ export const initCommand = defineCommand({
|
|
|
1227
1262
|
}
|
|
1228
1263
|
}
|
|
1229
1264
|
}
|
|
1265
|
+
// 7b. Optional: ask whether Mossbear may keep a namespace of its own under
|
|
1266
|
+
// the harness's global skills root, so a `global`-scoped guide is
|
|
1267
|
+
// available in every repo without landing in any git working tree
|
|
1268
|
+
// (`global-guide-delivery-plan.md`).
|
|
1269
|
+
//
|
|
1270
|
+
// **This prompt exists here and nowhere else, and that is a security
|
|
1271
|
+
// property rather than a UX choice.** A persistent write grant into
|
|
1272
|
+
// `~/.claude/` is a prompt-injection primitive whose payoff is agent
|
|
1273
|
+
// instructions on every future session on this machine
|
|
1274
|
+
// (`guide-write-side-identity-plan.md` → "the hard rule that
|
|
1275
|
+
// survives"). `init` is attended and user-initiated; no agent-callable
|
|
1276
|
+
// path — not `mossbear mcp`, not a hook, not `sync` — may ask this or
|
|
1277
|
+
// answer it.
|
|
1278
|
+
//
|
|
1279
|
+
// Asked once. A recorded `false` is a decision, not a not-yet, so it is
|
|
1280
|
+
// never re-prompted: re-asking every run is how a refusal becomes a yes
|
|
1281
|
+
// by attrition. `mossbear init --force` clears the config and therefore
|
|
1282
|
+
// the answer, which is the deliberate way to change your mind.
|
|
1283
|
+
if (interactive) {
|
|
1284
|
+
const decided = await readGlobalDeliveryConsent().catch(() => null);
|
|
1285
|
+
if (decided === true) {
|
|
1286
|
+
console.log(` ${globalSkillsRoot()}: Mossbear namespace already allowed`);
|
|
1287
|
+
}
|
|
1288
|
+
else if (decided === false) {
|
|
1289
|
+
console.log(` ${globalSkillsRoot()}: Mossbear namespace declined — not asking again`);
|
|
1290
|
+
console.log(note('`mossbear init --force` clears the answer if you change your mind'));
|
|
1291
|
+
}
|
|
1292
|
+
else {
|
|
1293
|
+
// Every clause names something true and something the reader can act
|
|
1294
|
+
// on: where it goes, that it is a directory of ours beside theirs, what
|
|
1295
|
+
// it is for, and that declining costs them nothing they have today.
|
|
1296
|
+
console.log(`\nGuides you scope to every repo need somewhere outside git to live.\n` +
|
|
1297
|
+
`Mossbear can keep them in a directory of its own at\n` +
|
|
1298
|
+
` ${namespaceDir()}\n` +
|
|
1299
|
+
`beside any skills you wrote yourself, which it never reads or changes.\n` +
|
|
1300
|
+
`They load as \`mossbear:<name>\`, so they cannot collide with yours.`);
|
|
1301
|
+
const allowed = await confirmYesNo('Allow that? [y/N] ');
|
|
1302
|
+
try {
|
|
1303
|
+
await writeGlobalDeliveryConsent(allowed);
|
|
1304
|
+
if (allowed) {
|
|
1305
|
+
console.log(did('allowed', `${namespaceDir()} — global guides will be delivered here`));
|
|
1306
|
+
}
|
|
1307
|
+
else {
|
|
1308
|
+
// Not a failure, and not phrased as one: declining leaves global
|
|
1309
|
+
// guides where they already are, in `~/.mossbear/global/`, which
|
|
1310
|
+
// no harness reads. Say that rather than implying something broke.
|
|
1311
|
+
console.log(' declined — nothing will be written outside this repo');
|
|
1312
|
+
console.log(note(`guides scoped to every repo stay in ${MOSSBEAR_GLOBAL_DIR}, where no agent reads them`));
|
|
1313
|
+
}
|
|
1314
|
+
}
|
|
1315
|
+
catch (err) {
|
|
1316
|
+
// The answer could not be recorded, so nothing may act on it: the
|
|
1317
|
+
// delivery path refuses on anything but a recorded yes, which is the
|
|
1318
|
+
// safe direction. Say what that means rather than only what failed.
|
|
1319
|
+
console.warn(` warning: could not record your answer — ${errText(err)}\n` +
|
|
1320
|
+
' nothing will be written outside this repo until it can be recorded');
|
|
1321
|
+
}
|
|
1322
|
+
}
|
|
1323
|
+
}
|
|
1230
1324
|
// 8. Optional: import the guide files this repo already had (step 0's scan)
|
|
1231
1325
|
// into the dashboard. Most repos arrive with an AGENTS.md or CLAUDE.md
|
|
1232
1326
|
// already written, and without this the only way to get them in was to
|