runbrief 0.1.1 → 0.1.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/README.md +3 -3
- package/dist/cli.js +186 -75
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,13 +13,13 @@ name used in the install command.
|
|
|
13
13
|
Claude Code:
|
|
14
14
|
|
|
15
15
|
```sh
|
|
16
|
-
claude mcp add --transport stdio --scope user brief -- npx -y runbrief@0.1.
|
|
16
|
+
claude mcp add --transport stdio --scope user brief -- npx -y runbrief@0.1.2
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
Codex:
|
|
20
20
|
|
|
21
21
|
```sh
|
|
22
|
-
codex mcp add brief -- npx -y runbrief@0.1.
|
|
22
|
+
codex mcp add brief -- npx -y runbrief@0.1.2
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
Generic MCP configuration:
|
|
@@ -29,7 +29,7 @@ Generic MCP configuration:
|
|
|
29
29
|
"mcpServers": {
|
|
30
30
|
"brief": {
|
|
31
31
|
"command": "npx",
|
|
32
|
-
"args": ["-y", "runbrief@0.1.
|
|
32
|
+
"args": ["-y", "runbrief@0.1.2"]
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
}
|
package/dist/cli.js
CHANGED
|
@@ -7491,15 +7491,15 @@ function criticalPathBoost(filePath) {
|
|
|
7491
7491
|
return 0;
|
|
7492
7492
|
}
|
|
7493
7493
|
function compactMetadata(metadata) {
|
|
7494
|
-
const
|
|
7494
|
+
const compact2 = {};
|
|
7495
7495
|
for (const [key, value] of Object.entries(metadata)) {
|
|
7496
7496
|
if (Array.isArray(value) && value.length === 0)
|
|
7497
7497
|
continue;
|
|
7498
7498
|
if (value === "" || value === null)
|
|
7499
7499
|
continue;
|
|
7500
|
-
|
|
7500
|
+
compact2[key] = value;
|
|
7501
7501
|
}
|
|
7502
|
-
return Object.keys(
|
|
7502
|
+
return Object.keys(compact2).length > 0 ? compact2 : void 0;
|
|
7503
7503
|
}
|
|
7504
7504
|
function isCodeFilePath(filePath) {
|
|
7505
7505
|
return /\.(?:[tj]sx?|py|go|rb|sql|graphql|gql)$/.test(filePath.replaceAll("\\", "/"));
|
|
@@ -13084,7 +13084,7 @@ function compactProtectedMapNodes(map, protectedMapPaths) {
|
|
|
13084
13084
|
function compactProtectedMapMetadata(metadata) {
|
|
13085
13085
|
if (!metadata)
|
|
13086
13086
|
return void 0;
|
|
13087
|
-
const
|
|
13087
|
+
const compact2 = {};
|
|
13088
13088
|
for (const key of [
|
|
13089
13089
|
"sourcePath",
|
|
13090
13090
|
"symbolKind",
|
|
@@ -13095,7 +13095,7 @@ function compactProtectedMapMetadata(metadata) {
|
|
|
13095
13095
|
]) {
|
|
13096
13096
|
const value = metadata[key];
|
|
13097
13097
|
if (value !== void 0)
|
|
13098
|
-
|
|
13098
|
+
compact2[key] = value;
|
|
13099
13099
|
}
|
|
13100
13100
|
for (const key of [
|
|
13101
13101
|
"evidenceKinds",
|
|
@@ -13124,9 +13124,9 @@ function compactProtectedMapMetadata(metadata) {
|
|
|
13124
13124
|
]) {
|
|
13125
13125
|
const value = metadata[key];
|
|
13126
13126
|
if (Array.isArray(value))
|
|
13127
|
-
|
|
13127
|
+
compact2[key] = value.slice(0, 2);
|
|
13128
13128
|
}
|
|
13129
|
-
return
|
|
13129
|
+
return compact2;
|
|
13130
13130
|
}
|
|
13131
13131
|
function refreshContextPacketDerivedFields(packet) {
|
|
13132
13132
|
packet.summary = summarizeContext(packet.task, packet.rules, packet.suggestedTests, packet.map);
|
|
@@ -13302,17 +13302,17 @@ function compactWikiPageForContext(page2) {
|
|
|
13302
13302
|
function compactMetadata2(metadata) {
|
|
13303
13303
|
if (!metadata)
|
|
13304
13304
|
return void 0;
|
|
13305
|
-
const
|
|
13305
|
+
const compact2 = {};
|
|
13306
13306
|
for (const [key, value] of Object.entries(metadata)) {
|
|
13307
13307
|
if (!contextMetadataKeys.has(key))
|
|
13308
13308
|
continue;
|
|
13309
13309
|
if (Array.isArray(value)) {
|
|
13310
|
-
|
|
13310
|
+
compact2[key] = value.slice(0, metadataArrayLimit(key));
|
|
13311
13311
|
} else {
|
|
13312
|
-
|
|
13312
|
+
compact2[key] = value;
|
|
13313
13313
|
}
|
|
13314
13314
|
}
|
|
13315
|
-
return
|
|
13315
|
+
return compact2;
|
|
13316
13316
|
}
|
|
13317
13317
|
function metadataArrayLimit(key) {
|
|
13318
13318
|
if (["imports", "importedBy"].includes(key))
|
|
@@ -26220,7 +26220,7 @@ var init_agentSetup = __esm({
|
|
|
26220
26220
|
"ide",
|
|
26221
26221
|
"generic"
|
|
26222
26222
|
];
|
|
26223
|
-
briefPublishedPackageSpec = "runbrief@0.1.
|
|
26223
|
+
briefPublishedPackageSpec = "runbrief@0.1.2";
|
|
26224
26224
|
TARGET_LABELS = {
|
|
26225
26225
|
terminal: "Terminal agent",
|
|
26226
26226
|
vscode: "VS Code",
|
|
@@ -28164,6 +28164,102 @@ var init_agentBeforeYouCode = __esm({
|
|
|
28164
28164
|
}
|
|
28165
28165
|
});
|
|
28166
28166
|
|
|
28167
|
+
// ../core/dist/agentWorkPacket.js
|
|
28168
|
+
function buildAgentWorkPacket(input) {
|
|
28169
|
+
const before = input.beforeYouCode;
|
|
28170
|
+
const rules = [
|
|
28171
|
+
...(before.teamGuidance?.applied ?? []).map((item) => ({
|
|
28172
|
+
rule: item.label,
|
|
28173
|
+
source: `team:${item.kind}`
|
|
28174
|
+
})),
|
|
28175
|
+
...before.productOperatingContext.productRules.map((item) => ({
|
|
28176
|
+
rule: item.rule,
|
|
28177
|
+
source: item.source
|
|
28178
|
+
}))
|
|
28179
|
+
].slice(0, 3);
|
|
28180
|
+
const tests = before.exactTests.length > 0 ? before.exactTests.slice(0, 3).map((test) => ({
|
|
28181
|
+
command: compact(test.command, 180),
|
|
28182
|
+
reason: compact(test.reason, 180),
|
|
28183
|
+
confidence: test.confidence
|
|
28184
|
+
})) : before.likelyTests.slice(0, 3).map((command2) => ({
|
|
28185
|
+
command: compact(command2, 180),
|
|
28186
|
+
reason: "Nearest validation signal Brief found for this task.",
|
|
28187
|
+
confidence: "medium"
|
|
28188
|
+
}));
|
|
28189
|
+
const acceptance = unique2([
|
|
28190
|
+
...before.productOperatingContext.acceptanceCriteria,
|
|
28191
|
+
...before.validationChecklist
|
|
28192
|
+
]).slice(0, 3);
|
|
28193
|
+
const stopConditions = unique2([
|
|
28194
|
+
...before.stopSignals,
|
|
28195
|
+
...before.productOperatingContext.stopSignals
|
|
28196
|
+
]).slice(0, 3);
|
|
28197
|
+
const nextAction = input.nextAction ?? before.next ?? "Inspect the listed files and make the reuse decision before editing.";
|
|
28198
|
+
const packet = {
|
|
28199
|
+
schemaVersion: 1,
|
|
28200
|
+
objective: compact(input.task, 240),
|
|
28201
|
+
interpretation: compact(input.interpretation ?? before.productOperatingContext.summary ?? before.headline, 160),
|
|
28202
|
+
target: {
|
|
28203
|
+
repoRoot: before.target.repoRoot,
|
|
28204
|
+
repoName: before.target.repoName,
|
|
28205
|
+
...before.target.branch ? { branch: before.target.branch } : {},
|
|
28206
|
+
...before.target.baseRef ? { baseRef: before.target.baseRef } : {},
|
|
28207
|
+
dirty: before.target.dirty,
|
|
28208
|
+
changedFiles: before.target.changedFiles.slice(0, 4)
|
|
28209
|
+
},
|
|
28210
|
+
inspectFirst: before.inspectFirst.slice(0, 3).map((item) => ({
|
|
28211
|
+
path: item.path,
|
|
28212
|
+
why: compact(item.why, 160)
|
|
28213
|
+
})),
|
|
28214
|
+
reuse: {
|
|
28215
|
+
status: before.reuseFirst.status,
|
|
28216
|
+
decision: compact(before.reuseFirst.decision, 220),
|
|
28217
|
+
candidates: before.reuseFirst.candidates.slice(0, 2).map((item) => ({
|
|
28218
|
+
path: item.path,
|
|
28219
|
+
action: compact(item.action, 140),
|
|
28220
|
+
why: compact(item.why, 140)
|
|
28221
|
+
}))
|
|
28222
|
+
},
|
|
28223
|
+
rules,
|
|
28224
|
+
tests,
|
|
28225
|
+
acceptance,
|
|
28226
|
+
stopConditions,
|
|
28227
|
+
nextAction: compact(nextAction, 200)
|
|
28228
|
+
};
|
|
28229
|
+
const compactText = formatAgentWorkPacket(packet);
|
|
28230
|
+
return { ...packet, compactText, lineCount: compactText.split("\n").length };
|
|
28231
|
+
}
|
|
28232
|
+
function formatAgentWorkPacket(packet) {
|
|
28233
|
+
const lines = [
|
|
28234
|
+
`Objective: ${packet.objective}`,
|
|
28235
|
+
`Target: ${packet.target.repoName}${packet.target.branch ? ` @ ${packet.target.branch}` : ""} (${packet.target.dirty ? "dirty" : "clean"})`,
|
|
28236
|
+
`Interpretation: ${packet.interpretation}`,
|
|
28237
|
+
`Inspect first: ${inlineList(packet.inspectFirst.map((item) => `${item.path} - ${item.why}`))}`,
|
|
28238
|
+
`Reuse (${packet.reuse.status}): ${packet.reuse.decision}; ${inlineList(packet.reuse.candidates.map((item) => `${item.path} - ${item.action}`))}`,
|
|
28239
|
+
`Rules: ${inlineList(packet.rules.map((item) => `${item.rule} [${item.source}]`))}`,
|
|
28240
|
+
`Focused tests: ${inlineList(packet.tests.map((item) => `${item.command} - ${item.reason}`))}`,
|
|
28241
|
+
`Acceptance: ${inlineList(packet.acceptance)}`,
|
|
28242
|
+
`Stop if: ${inlineList(packet.stopConditions)}`,
|
|
28243
|
+
`Next: ${packet.nextAction}`
|
|
28244
|
+
];
|
|
28245
|
+
return lines.join("\n");
|
|
28246
|
+
}
|
|
28247
|
+
function inlineList(items) {
|
|
28248
|
+
return items.length > 0 ? items.join("; ") : "none found";
|
|
28249
|
+
}
|
|
28250
|
+
function compact(value, maxLength) {
|
|
28251
|
+
const normalized = value.replace(/\s+/g, " ").trim();
|
|
28252
|
+
return normalized.length <= maxLength ? normalized : `${normalized.slice(0, maxLength - 3).trimEnd()}...`;
|
|
28253
|
+
}
|
|
28254
|
+
function unique2(values) {
|
|
28255
|
+
return [...new Set(values.map((value) => value.trim()).filter(Boolean))];
|
|
28256
|
+
}
|
|
28257
|
+
var init_agentWorkPacket = __esm({
|
|
28258
|
+
"../core/dist/agentWorkPacket.js"() {
|
|
28259
|
+
"use strict";
|
|
28260
|
+
}
|
|
28261
|
+
});
|
|
28262
|
+
|
|
28167
28263
|
// ../core/dist/ticketMissionRuntime.js
|
|
28168
28264
|
var init_ticketMissionRuntime = __esm({
|
|
28169
28265
|
"../core/dist/ticketMissionRuntime.js"() {
|
|
@@ -28803,7 +28899,7 @@ function codeMapBetaReadiness(input) {
|
|
|
28803
28899
|
score: Math.min(100, Math.round((betaScore + input.qualityScore) / 2)),
|
|
28804
28900
|
summary: status === "beta_plus" ? "Beta+ ready: agents have source-grounded code surfaces, parser facts, ownership, validation, operational context, and focused map proof." : status === "beta" ? "Beta: source-grounded enough to use, with remaining proof gaps that should be explicit in missions." : status === "alpha" ? "Alpha: useful orientation, but agents need narrower source, proof, or operational context before autonomous edits." : "Blocked: this map is not safe to use as architecture proof yet.",
|
|
28805
28901
|
checks,
|
|
28806
|
-
blockingGaps:
|
|
28902
|
+
blockingGaps: unique3(blockingGaps),
|
|
28807
28903
|
nextActions: status === "beta_plus" ? [
|
|
28808
28904
|
"Use this map as the pre-edit context gate for agent missions.",
|
|
28809
28905
|
"Preserve mapQuality.betaReadiness in review_diff and save_handoff proof."
|
|
@@ -28876,7 +28972,7 @@ function metadataList(node, key) {
|
|
|
28876
28972
|
return [];
|
|
28877
28973
|
return value.filter((item) => typeof item === "string");
|
|
28878
28974
|
}
|
|
28879
|
-
function
|
|
28975
|
+
function unique3(items) {
|
|
28880
28976
|
return [...new Set(items)];
|
|
28881
28977
|
}
|
|
28882
28978
|
var CODE_SURFACE_TYPES2, SOURCE_AWARE_TYPES, OBSERVABILITY_SYSTEMS, TICKET_SYSTEMS, DATA_SYSTEMS;
|
|
@@ -29907,12 +30003,12 @@ function humanQuestionsFor(advisory, omittedFindingCount) {
|
|
|
29907
30003
|
return unique(questions.map((question) => compactReviewQuestion(question))).slice(0, 8);
|
|
29908
30004
|
}
|
|
29909
30005
|
function compactReviewQuestion(value, maxLength = 800) {
|
|
29910
|
-
const
|
|
29911
|
-
if (
|
|
29912
|
-
return
|
|
30006
|
+
const compact2 = value.replace(/\s+/g, " ").trim();
|
|
30007
|
+
if (compact2.length <= maxLength)
|
|
30008
|
+
return compact2;
|
|
29913
30009
|
if (maxLength <= 3)
|
|
29914
|
-
return
|
|
29915
|
-
return `${
|
|
30010
|
+
return compact2.slice(0, maxLength);
|
|
30011
|
+
return `${compact2.slice(0, maxLength - 3).trimEnd()}...`;
|
|
29916
30012
|
}
|
|
29917
30013
|
function reviewReadinessScore(counts, proofStatus, review) {
|
|
29918
30014
|
const penalty = counts.blocker * 35 + counts.high * 28 + counts.medium * 12 + counts.low * 5 + counts.info * 1 + review.omittedFindingCount * 2;
|
|
@@ -32978,6 +33074,7 @@ var init_dist2 = __esm({
|
|
|
32978
33074
|
init_missionPlan();
|
|
32979
33075
|
init_agentStart();
|
|
32980
33076
|
init_agentBeforeYouCode();
|
|
33077
|
+
init_agentWorkPacket();
|
|
32981
33078
|
init_productOperatingContext();
|
|
32982
33079
|
init_ticketMissionRuntime();
|
|
32983
33080
|
init_governance();
|
|
@@ -34821,9 +34918,9 @@ var init_serverInstructions = __esm({
|
|
|
34821
34918
|
"../mcp/src/serverInstructions.ts"() {
|
|
34822
34919
|
"use strict";
|
|
34823
34920
|
briefMcpInstructions = [
|
|
34824
|
-
"Brief is the default repo-context, reuse, review, and handoff companion for non-trivial coding work. Do not wait for the user to repeat 'use Brief'.",
|
|
34921
|
+
"Brief is the default repo-context, reuse, review, and handoff companion for non-trivial coding work. This is the normal path, not an optional reminder. Do not wait for the user to repeat 'use Brief'.",
|
|
34825
34922
|
"At the first Brief-relevant task in a session, call brief.install_status once and confirm the repo target and connector freshness.",
|
|
34826
|
-
"
|
|
34923
|
+
"When the user asks for non-trivial work, call brief.next with the user's actual request before inspecting or editing files, then follow its compact workPacket and recommendation. Keep micro changes lightweight.",
|
|
34827
34924
|
"Before creating a helper, component, route, workflow, command, or skill, use the returned reuse candidates or call brief.reference_implementations and brief.codebase_map.",
|
|
34828
34925
|
"Refresh Brief context when the task, files, risk, or validation plan changes.",
|
|
34829
34926
|
"Before a meaningful handoff, call brief.review_diff. Save and verify a handoff only for multi-step, high-risk, or durable work.",
|
|
@@ -34861,7 +34958,7 @@ function compactBlockedInstallStatus(input) {
|
|
|
34861
34958
|
fresh: input.serverFreshness.status === "current",
|
|
34862
34959
|
summary: input.connectorReadiness.summary
|
|
34863
34960
|
},
|
|
34864
|
-
next:
|
|
34961
|
+
next: unique4(input.repoTarget.next).slice(0, 2),
|
|
34865
34962
|
detailHint: "Open a Git repository or pass its path, then run install-status again."
|
|
34866
34963
|
};
|
|
34867
34964
|
}
|
|
@@ -34873,10 +34970,10 @@ function compactInstallStatus(input) {
|
|
|
34873
34970
|
const mcpContractActive = input.serverInstructionsActive && input.connectorReadiness.safeToUseBrief;
|
|
34874
34971
|
const totalMapCandidates = stats.mapTotalCandidateCount ?? stats.mapNodeCount + (stats.mapOmittedCount ?? 0);
|
|
34875
34972
|
const mapCoveragePercent = totalMapCandidates ? Math.round(stats.mapNodeCount / totalMapCandidates * 100) : 100;
|
|
34876
|
-
const repoGuidanceSignals =
|
|
34973
|
+
const repoGuidanceSignals = unique4(
|
|
34877
34974
|
input.workflowWiring.surfaces.filter((surface) => surface.kind === "always_on_guidance").flatMap((surface) => surface.signals)
|
|
34878
34975
|
);
|
|
34879
|
-
const next =
|
|
34976
|
+
const next = unique4([
|
|
34880
34977
|
...blocked ? [input.connectorReadiness.firstAction] : [],
|
|
34881
34978
|
...cloudIssue ? [cloudIssue] : [],
|
|
34882
34979
|
...input.readiness.nextBestActions,
|
|
@@ -34923,7 +35020,7 @@ function compactInstallStatus(input) {
|
|
|
34923
35020
|
score: input.readiness.score,
|
|
34924
35021
|
verdict: input.readiness.verdict,
|
|
34925
35022
|
summary: input.readiness.summary,
|
|
34926
|
-
gaps:
|
|
35023
|
+
gaps: unique4([
|
|
34927
35024
|
...input.readiness.quickWins,
|
|
34928
35025
|
...input.readiness.nextBestActions
|
|
34929
35026
|
]).slice(0, 3)
|
|
@@ -34950,7 +35047,7 @@ function compactInstallStatus(input) {
|
|
|
34950
35047
|
detailHint: 'Use detail: "expanded" in MCP or --full in the CLI only when diagnosing setup, workflow wiring, or receipt history.'
|
|
34951
35048
|
};
|
|
34952
35049
|
}
|
|
34953
|
-
function
|
|
35050
|
+
function unique4(values) {
|
|
34954
35051
|
return [...new Set(values.filter((value) => value.trim()))];
|
|
34955
35052
|
}
|
|
34956
35053
|
var briefConnectorVersion;
|
|
@@ -34958,7 +35055,7 @@ var init_installStatus = __esm({
|
|
|
34958
35055
|
"../mcp/src/installStatus.ts"() {
|
|
34959
35056
|
"use strict";
|
|
34960
35057
|
init_serverInstructions();
|
|
34961
|
-
briefConnectorVersion = "0.1.
|
|
35058
|
+
briefConnectorVersion = "0.1.2";
|
|
34962
35059
|
}
|
|
34963
35060
|
});
|
|
34964
35061
|
|
|
@@ -34981,24 +35078,26 @@ function buildCompactStartEnvelope(input) {
|
|
|
34981
35078
|
...start.intent.autonomy ? { autonomy: start.intent.autonomy } : {},
|
|
34982
35079
|
...start.intent.reviewBar ? { reviewBar: start.intent.reviewBar } : {}
|
|
34983
35080
|
},
|
|
35081
|
+
workPacket: (() => {
|
|
35082
|
+
const packet = buildAgentWorkPacket({
|
|
35083
|
+
task: start.normalizedInput.task,
|
|
35084
|
+
beforeYouCode,
|
|
35085
|
+
interpretation: start.summary,
|
|
35086
|
+
nextAction: input.next
|
|
35087
|
+
});
|
|
35088
|
+
return {
|
|
35089
|
+
schemaVersion: packet.schemaVersion,
|
|
35090
|
+
compactText: packet.compactText
|
|
35091
|
+
};
|
|
35092
|
+
})(),
|
|
34984
35093
|
inspectFirst: beforeYouCode.inspectFirst.slice(0, 3).map((item) => ({
|
|
34985
35094
|
path: item.path,
|
|
34986
35095
|
why: compactLine(item.why, 160)
|
|
34987
35096
|
})),
|
|
34988
|
-
reuse: beforeYouCode.reuseFirst.candidates.slice(0, 2).map((item) => ({
|
|
34989
|
-
path: item.path,
|
|
34990
|
-
action: compactLine(item.action, 160)
|
|
34991
|
-
})),
|
|
34992
|
-
reuseDecision: compactLine(beforeYouCode.reuseFirst.decision, 240),
|
|
34993
|
-
sharedContext: summarizeBeforeYouCodeSharedContext(
|
|
34994
|
-
beforeYouCode.teamGuidance
|
|
34995
|
-
),
|
|
34996
|
-
referenceFirst: summarizeBeforeYouCodeReferences(beforeYouCode),
|
|
34997
35097
|
validation: beforeYouCode.likelyTests.slice(0, 3),
|
|
34998
35098
|
result: input.result,
|
|
34999
|
-
|
|
35000
|
-
|
|
35001
|
-
detailHint: 'Request expanded detail only when needed: CLI --json/--full or MCP detail: "expanded".'
|
|
35099
|
+
next: compactLine(input.next, 240),
|
|
35100
|
+
detailHint: 'Expand with MCP detail: "expanded" or CLI --full.'
|
|
35002
35101
|
};
|
|
35003
35102
|
}
|
|
35004
35103
|
function formatCompactStartText(envelope) {
|
|
@@ -35013,26 +35112,13 @@ function formatCompactStartText(envelope) {
|
|
|
35013
35112
|
`Target: ${target} | ${envelope.target.dirty ? "dirty" : "clean"}`,
|
|
35014
35113
|
`Job: ${envelope.job}`,
|
|
35015
35114
|
`Route: ${route}`,
|
|
35016
|
-
|
|
35017
|
-
...listLines(
|
|
35018
|
-
envelope.inspectFirst.map((item) => `${item.path} - ${item.why}`)
|
|
35019
|
-
),
|
|
35020
|
-
"Reuse:",
|
|
35021
|
-
...listLines(envelope.reuse.map((item) => `${item.path} - ${item.action}`)),
|
|
35022
|
-
`Reuse decision: ${envelope.reuseDecision}`,
|
|
35023
|
-
`Shared context: ${envelope.sharedContext.status === "applied" ? envelope.sharedContext.applied.map((item) => item.label).join(", ") : envelope.sharedContext.status}`,
|
|
35024
|
-
`Saved reference: ${envelope.referenceFirst.status === "matched" ? envelope.referenceFirst.references.map((reference) => reference.title).join(", ") : envelope.referenceFirst.status}`,
|
|
35025
|
-
"Validate:",
|
|
35026
|
-
...listLines(envelope.validation),
|
|
35115
|
+
envelope.workPacket.compactText,
|
|
35027
35116
|
`Result: ${envelope.result.summary}`,
|
|
35028
35117
|
`Next: ${envelope.next}`,
|
|
35029
35118
|
`Details: ${envelope.detailHint}`
|
|
35030
35119
|
];
|
|
35031
35120
|
return lines.join("\n");
|
|
35032
35121
|
}
|
|
35033
|
-
function listLines(items) {
|
|
35034
|
-
return items.length > 0 ? items.map((item) => `- ${item}`) : ["- none"];
|
|
35035
|
-
}
|
|
35036
35122
|
function compactLine(value, maxLength) {
|
|
35037
35123
|
const normalized = value.replace(/\s+/g, " ").trim();
|
|
35038
35124
|
if (normalized.length <= maxLength) return normalized;
|
|
@@ -35464,7 +35550,7 @@ function renderWikiRefreshWorkflow(options2 = {}) {
|
|
|
35464
35550
|
" with:",
|
|
35465
35551
|
" node-version: 22",
|
|
35466
35552
|
" - name: Refresh wiki",
|
|
35467
|
-
' run: npx -y runbrief@0.1.
|
|
35553
|
+
' run: npx -y runbrief@0.1.2 wiki init --repo "$GITHUB_WORKSPACE" --update --no-agent-files',
|
|
35468
35554
|
" - name: Open refresh PR",
|
|
35469
35555
|
" uses: peter-evans/create-pull-request@22a9089034f40e5a961c8808d113e2c98fb63676 # v7.0.11",
|
|
35470
35556
|
" with:",
|
|
@@ -35564,7 +35650,7 @@ function resolveHandoffAutofill(repoRoot, input) {
|
|
|
35564
35650
|
sources,
|
|
35565
35651
|
missionReceiptId,
|
|
35566
35652
|
reviewReceiptId,
|
|
35567
|
-
autoFilled:
|
|
35653
|
+
autoFilled: unique5(autoFilled)
|
|
35568
35654
|
});
|
|
35569
35655
|
}
|
|
35570
35656
|
function bestMatchingReceipt(receipts, kind, input) {
|
|
@@ -35644,10 +35730,10 @@ function compactResult(result) {
|
|
|
35644
35730
|
}
|
|
35645
35731
|
function cleanValues(values, limit = 300) {
|
|
35646
35732
|
if (!values) return void 0;
|
|
35647
|
-
const cleaned =
|
|
35733
|
+
const cleaned = unique5(values.map((value) => value.trim()).filter(Boolean)).sort().slice(0, limit);
|
|
35648
35734
|
return cleaned.length > 0 ? cleaned : void 0;
|
|
35649
35735
|
}
|
|
35650
|
-
function
|
|
35736
|
+
function unique5(values) {
|
|
35651
35737
|
return [...new Set(values)];
|
|
35652
35738
|
}
|
|
35653
35739
|
function normalizeText(value) {
|
|
@@ -35704,35 +35790,35 @@ function compactCodebaseMapResponse(input) {
|
|
|
35704
35790
|
};
|
|
35705
35791
|
}
|
|
35706
35792
|
function formatCompactCodebaseMap(input) {
|
|
35707
|
-
const
|
|
35793
|
+
const compact2 = compactCodebaseMapResponse(input);
|
|
35708
35794
|
const lines = [
|
|
35709
|
-
`Codebase map: ${
|
|
35710
|
-
`Target: ${
|
|
35795
|
+
`Codebase map: ${compact2.summary}`,
|
|
35796
|
+
`Target: ${compact2.target.repoName} | ${compact2.target.repoRoot}${compact2.target.mapPartial ? " | partial map" : ""}`,
|
|
35711
35797
|
"Inspect first:",
|
|
35712
|
-
...
|
|
35713
|
-
|
|
35798
|
+
...listLines(
|
|
35799
|
+
compact2.inspectFirst,
|
|
35714
35800
|
(item) => `${item.path} - ${item.reason}`,
|
|
35715
35801
|
"No focused source matched; narrow the query before editing."
|
|
35716
35802
|
),
|
|
35717
35803
|
"Reuse before creating:",
|
|
35718
|
-
...
|
|
35719
|
-
|
|
35804
|
+
...listLines(
|
|
35805
|
+
compact2.reuse.candidates,
|
|
35720
35806
|
(item) => `${item.path}${item.symbols.length > 0 ? ` - ${item.symbols.join(", ")}` : ""}`,
|
|
35721
35807
|
"No reusable primitive is proven yet; run a narrower map query."
|
|
35722
35808
|
),
|
|
35723
35809
|
"Validate:",
|
|
35724
|
-
...
|
|
35725
|
-
|
|
35810
|
+
...listLines(
|
|
35811
|
+
compact2.validate,
|
|
35726
35812
|
(item) => item,
|
|
35727
35813
|
"No focused validation command was found."
|
|
35728
35814
|
),
|
|
35729
|
-
...
|
|
35815
|
+
...compact2.warnings.length > 0 ? ["Warnings:", ...listLines(compact2.warnings, (item) => item, "")] : [],
|
|
35730
35816
|
"Next:",
|
|
35731
|
-
...
|
|
35817
|
+
...listLines(compact2.next, (item) => item, "Inspect the first source.")
|
|
35732
35818
|
];
|
|
35733
35819
|
return lines.slice(0, 30).join("\n");
|
|
35734
35820
|
}
|
|
35735
|
-
function
|
|
35821
|
+
function listLines(items, render, empty) {
|
|
35736
35822
|
if (items.length === 0) return empty ? [`- ${empty}`] : [];
|
|
35737
35823
|
return items.map((item) => `- ${render(item)}`);
|
|
35738
35824
|
}
|
|
@@ -36673,7 +36759,7 @@ var init_server = __esm({
|
|
|
36673
36759
|
server = new McpServer(
|
|
36674
36760
|
{
|
|
36675
36761
|
name: "brief",
|
|
36676
|
-
version: "0.1.
|
|
36762
|
+
version: "0.1.2"
|
|
36677
36763
|
},
|
|
36678
36764
|
{
|
|
36679
36765
|
instructions: briefMcpInstructions
|
|
@@ -37439,6 +37525,12 @@ var init_server = __esm({
|
|
|
37439
37525
|
}) : void 0;
|
|
37440
37526
|
const autoEngage = buildAgentAutoEngagementPlan(scan, skillLearning);
|
|
37441
37527
|
const workflowWiring = evaluateAgentWorkflowWiring(scan);
|
|
37528
|
+
const workPacket = buildAgentWorkPacket({
|
|
37529
|
+
task,
|
|
37530
|
+
beforeYouCode,
|
|
37531
|
+
interpretation: recommendation.reason,
|
|
37532
|
+
nextAction: `Call ${recommendation.mcpTool} next. ${recommendation.stopUntil}`
|
|
37533
|
+
});
|
|
37442
37534
|
const fullResponse = {
|
|
37443
37535
|
status: "brief_next",
|
|
37444
37536
|
repoRoot,
|
|
@@ -37447,6 +37539,7 @@ var init_server = __esm({
|
|
|
37447
37539
|
stage: resolvedStage,
|
|
37448
37540
|
recommendation,
|
|
37449
37541
|
cockpit: beforeYouCode.cockpit,
|
|
37542
|
+
workPacket,
|
|
37450
37543
|
beforeYouCode: summarizeBeforeYouCodeForStart(beforeYouCode),
|
|
37451
37544
|
...start && recommendation.mcpTool !== "brief.before_you_code" ? { start: summarizeStartForStart(start) } : {},
|
|
37452
37545
|
...readinessPreview ? { readinessPreview } : {},
|
|
@@ -37470,6 +37563,7 @@ var init_server = __esm({
|
|
|
37470
37563
|
},
|
|
37471
37564
|
stage: resolvedStage,
|
|
37472
37565
|
recommendation,
|
|
37566
|
+
workPacket,
|
|
37473
37567
|
cockpit: {
|
|
37474
37568
|
taskSize: beforeYouCode.cockpit.taskSize,
|
|
37475
37569
|
mode: beforeYouCode.cockpit.mode,
|
|
@@ -37491,7 +37585,8 @@ var init_server = __esm({
|
|
|
37491
37585
|
taskClasses: beforeYouCode.productOperatingContext.taskClasses
|
|
37492
37586
|
},
|
|
37493
37587
|
autoEngage: {
|
|
37494
|
-
status:
|
|
37588
|
+
status: autoEngage.status,
|
|
37589
|
+
workflowWiring: workflowWiring.status,
|
|
37495
37590
|
firstCall: "brief.next",
|
|
37496
37591
|
beforeEditing: "brief.before_you_code or brief.start",
|
|
37497
37592
|
beforeHandoff: "brief.review_diff",
|
|
@@ -39670,6 +39765,12 @@ async function runCli(commandName, commandArgs) {
|
|
|
39670
39765
|
beforeYouCode,
|
|
39671
39766
|
baseRef
|
|
39672
39767
|
});
|
|
39768
|
+
const workPacket = buildAgentWorkPacket({
|
|
39769
|
+
task,
|
|
39770
|
+
beforeYouCode,
|
|
39771
|
+
interpretation: recommendation.reason,
|
|
39772
|
+
nextAction: recommendation.stopUntil
|
|
39773
|
+
});
|
|
39673
39774
|
const fullResponse = {
|
|
39674
39775
|
status: "brief_next",
|
|
39675
39776
|
repoRoot,
|
|
@@ -39678,6 +39779,7 @@ async function runCli(commandName, commandArgs) {
|
|
|
39678
39779
|
stage,
|
|
39679
39780
|
recommendation,
|
|
39680
39781
|
cockpit: beforeYouCode.cockpit,
|
|
39782
|
+
workPacket,
|
|
39681
39783
|
beforeYouCode: summarizeBeforeYouCodeForCli(beforeYouCode),
|
|
39682
39784
|
...start && recommendation.mcpTool !== "brief.before_you_code" ? { start: summarizeStartForCli(start) } : {},
|
|
39683
39785
|
workflowWiring: summarizeWorkflowWiringForCli(workflowWiring),
|
|
@@ -39700,6 +39802,11 @@ async function runCli(commandName, commandArgs) {
|
|
|
39700
39802
|
},
|
|
39701
39803
|
stage,
|
|
39702
39804
|
recommendation,
|
|
39805
|
+
workPacket: {
|
|
39806
|
+
schemaVersion: workPacket.schemaVersion,
|
|
39807
|
+
compactText: workPacket.compactText,
|
|
39808
|
+
lineCount: workPacket.lineCount
|
|
39809
|
+
},
|
|
39703
39810
|
cockpit: {
|
|
39704
39811
|
taskSize: beforeYouCode.cockpit.taskSize,
|
|
39705
39812
|
mode: beforeYouCode.cockpit.mode,
|
|
@@ -39726,7 +39833,11 @@ async function runCli(commandName, commandArgs) {
|
|
|
39726
39833
|
autoEngage: {
|
|
39727
39834
|
status: autoEngage.status,
|
|
39728
39835
|
chatFeedback: autoEngage.chatFeedback.slice(0, 1),
|
|
39729
|
-
finalRecapPolicy:
|
|
39836
|
+
finalRecapPolicy: {
|
|
39837
|
+
maxLines: autoEngage.finalRecapPolicy.maxLines,
|
|
39838
|
+
defaultTemplate: autoEngage.finalRecapPolicy.defaultTemplate,
|
|
39839
|
+
fallbackWhenNotHelpful: autoEngage.finalRecapPolicy.fallbackWhenNotHelpful
|
|
39840
|
+
}
|
|
39730
39841
|
},
|
|
39731
39842
|
referenceFirst: summarizeBeforeYouCodeReferences(beforeYouCode),
|
|
39732
39843
|
...learnedWorkflow ? {
|
|
@@ -40881,14 +40992,14 @@ async function runCli(commandName, commandArgs) {
|
|
|
40881
40992
|
if (isCommand(commandName, "workflow-wiring", "workflow_wiring")) {
|
|
40882
40993
|
const scan = scanRepo(repoRoot, { maxFiles: 400 });
|
|
40883
40994
|
const workflowWiring = evaluateAgentWorkflowWiring(scan);
|
|
40884
|
-
const
|
|
40995
|
+
const compact2 = hasFlag(commandArgs, "compact") && !hasFlag(commandArgs, "full");
|
|
40885
40996
|
const explicitlyExpanded = hasFlag(commandArgs, "full");
|
|
40886
40997
|
printJson({
|
|
40887
40998
|
status: "workflow_wiring",
|
|
40888
40999
|
repoRoot,
|
|
40889
41000
|
repoName: scan.repoName,
|
|
40890
|
-
workflowWiring:
|
|
40891
|
-
...
|
|
41001
|
+
workflowWiring: compact2 ? summarizeAgentWorkflowWiring(workflowWiring) : workflowWiring,
|
|
41002
|
+
...compact2 ? {
|
|
40892
41003
|
detailHint: "Use --full only when diagnosing wiring evidence, contracts, or copyable prompts."
|
|
40893
41004
|
} : explicitlyExpanded ? { detail: "expanded" } : {
|
|
40894
41005
|
compatibility: "Expanded detail was returned for backward compatibility. Use --compact for the agent-safe response."
|