vouchington-tooling 0.44.0 → 0.46.0
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 +10 -52
- package/dist/agent-blackboard/client.d.mts +6 -0
- package/dist/agent-blackboard/feedback-audit-source.d.mts +4 -10
- package/dist/agent-blackboard/feedback-audit-source.mjs +7 -18
- package/dist/agent-blackboard/feedback-compose-audit.mjs +6 -14
- package/dist/agent-blackboard/feedback-compose.d.mts +1 -4
- package/dist/agent-blackboard/feedback-compose.mjs +2 -5
- package/dist/agent-blackboard/feedback-fields.mjs +1 -1
- package/dist/agent-blackboard/feedback-identity.mjs +1 -1
- package/dist/agent-blackboard/feedback-journal-audit.d.mts +6 -8
- package/dist/agent-blackboard/feedback-journal-audit.mjs +9 -10
- package/dist/agent-blackboard/feedback-journal-sandbox.d.mts +2 -2
- package/dist/agent-blackboard/feedback-journal-sandbox.mjs +2 -2
- package/dist/agent-blackboard/feedback-outbox-rejected.mjs +1 -1
- package/dist/agent-blackboard/feedback-outbox.mjs +2 -2
- package/dist/agent-blackboard/index.d.mts +1 -1
- package/dist/audit-journal/ci-failures.d.mts +6 -0
- package/dist/{session-friction → audit-journal}/ci-failures.mjs +3 -9
- package/dist/{session-friction → audit-journal}/journal.d.mts +0 -1
- package/dist/{session-friction → audit-journal}/journal.mjs +1 -1
- package/dist/audit-journal/session-id.d.mts +1 -0
- package/dist/{session-friction → audit-journal}/session-id.mjs +0 -5
- package/dist/{session-friction → audit-journal}/text.d.mts +1 -4
- package/dist/{session-friction → audit-journal}/text.mjs +4 -22
- package/dist/audit-journal/types.d.mts +17 -0
- package/dist/cli/commands/gha-runtime-audit.mjs +2 -0
- package/dist/cli/usage.d.mts +1 -1
- package/dist/cli/usage.mjs +1 -1
- package/dist/gh-cli/env.d.mts +9 -0
- package/dist/gh-cli/env.mjs +12 -0
- package/dist/gh-cli/exec.d.mts +7 -4
- package/dist/gh-cli/exec.mjs +7 -5
- package/dist/gh-cli/index.d.mts +1 -0
- package/dist/gh-cli/index.mjs +1 -0
- package/dist/gha-post-review/github.mjs +2 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +2 -2
- package/dist/mcp-server/context.d.mts +5 -0
- package/dist/mcp-server/dispatch.d.mts +5 -0
- package/dist/mcp-server/dispatch.mjs +8 -1
- package/dist/mcp-server/fake-blackboard.test-helpers.d.mts +2 -0
- package/dist/mcp-server/fake-blackboard.test-helpers.mjs +3 -0
- package/dist/mcp-server/handlers-pr.d.mts +1 -1
- package/dist/mcp-server/handlers-pr.mjs +6 -97
- package/dist/mcp-server/handlers-retrospective-save.d.mts +10 -0
- package/dist/mcp-server/handlers-retrospective-save.mjs +138 -0
- package/dist/mcp-server/handlers-retrospective.d.mts +1 -12
- package/dist/mcp-server/handlers-retrospective.mjs +1 -154
- package/dist/mcp-server/handlers-session.mjs +25 -6
- package/dist/mcp-server/handlers-snapshot-cleanup.d.mts +7 -0
- package/dist/mcp-server/handlers-snapshot-cleanup.mjs +36 -0
- package/dist/mcp-server/harness.test-helpers.d.mts +3 -0
- package/dist/mcp-server/harness.test-helpers.mjs +2 -0
- package/dist/mcp-server/policy-run.d.mts +1 -0
- package/dist/mcp-server/policy-run.mjs +1 -0
- package/dist/mcp-server/pr-agent.d.mts +12 -0
- package/dist/mcp-server/pr-agent.mjs +34 -0
- package/dist/mcp-server/pr-body.d.mts +6 -2
- package/dist/mcp-server/pr-body.mjs +16 -5
- package/dist/mcp-server/pr-defaults.d.mts +3 -0
- package/dist/mcp-server/pr-defaults.mjs +7 -2
- package/dist/mcp-server/pr-gh.mjs +2 -1
- package/dist/mcp-server/pr-input.d.mts +14 -6
- package/dist/mcp-server/pr-input.mjs +22 -5
- package/dist/mcp-server/pr-live.d.mts +4 -1
- package/dist/mcp-server/pr-live.mjs +8 -3
- package/dist/mcp-server/pr-mode.d.mts +7 -0
- package/dist/mcp-server/pr-mode.mjs +34 -0
- package/dist/mcp-server/pr-no-source.d.mts +9 -0
- package/dist/mcp-server/pr-no-source.mjs +22 -0
- package/dist/mcp-server/pr-prepare.d.mts +25 -0
- package/dist/mcp-server/pr-prepare.mjs +124 -0
- package/dist/mcp-server/preview-registry.d.mts +25 -0
- package/dist/mcp-server/preview-registry.mjs +38 -0
- package/dist/mcp-server/retrospective-check.d.mts +3 -0
- package/dist/mcp-server/retrospective-check.mjs +38 -0
- package/dist/mcp-server/retrospective-input.mjs +2 -2
- package/dist/mcp-server/retrospective-preview.d.mts +17 -0
- package/dist/mcp-server/retrospective-preview.mjs +60 -0
- package/dist/mcp-server/server.mjs +1 -0
- package/dist/mcp-server/snapshot-registry.d.mts +25 -0
- package/dist/mcp-server/snapshot-registry.mjs +32 -0
- package/dist/mcp-server/tools-pr.mjs +28 -16
- package/dist/mcp-server/tools-retrospective.mjs +25 -5
- package/dist/mcp-server/tools.mjs +6 -0
- package/dist/{session-friction → private-files}/lock.mjs +3 -2
- package/dist/private-files/log-file.d.mts +3 -0
- package/dist/private-files/log-file.mjs +53 -0
- package/dist/{session-friction → private-files}/utf8.mjs +1 -1
- package/dist/retrospective-facts/exec.mjs +2 -1
- package/docs/mcp-server.md +112 -26
- package/package.json +3 -8
- package/skills/retrospective/SKILL.md +3 -1
- package/skills/retrospective-distill/SKILL.md +5 -0
- package/dist/session-friction/ci-failures.d.mts +0 -13
- package/dist/session-friction/classify.d.mts +0 -2
- package/dist/session-friction/classify.mjs +0 -98
- package/dist/session-friction/command-segments.d.mts +0 -3
- package/dist/session-friction/command-segments.mjs +0 -94
- package/dist/session-friction/coverage-ledger.d.mts +0 -10
- package/dist/session-friction/coverage-ledger.mjs +0 -75
- package/dist/session-friction/directory.d.mts +0 -1
- package/dist/session-friction/directory.mjs +0 -71
- package/dist/session-friction/index.d.mts +0 -6
- package/dist/session-friction/index.mjs +0 -5
- package/dist/session-friction/log-file.d.mts +0 -7
- package/dist/session-friction/log-file.mjs +0 -95
- package/dist/session-friction/log.d.mts +0 -8
- package/dist/session-friction/log.mjs +0 -163
- package/dist/session-friction/normalize.d.mts +0 -1
- package/dist/session-friction/normalize.mjs +0 -81
- package/dist/session-friction/report.d.mts +0 -16
- package/dist/session-friction/report.mjs +0 -91
- package/dist/session-friction/sandbox.d.mts +0 -3
- package/dist/session-friction/sandbox.mjs +0 -43
- package/dist/session-friction/session-id.d.mts +0 -2
- package/dist/session-friction/types.d.mts +0 -80
- /package/dist/{session-friction → audit-journal}/audit-block.d.mts +0 -0
- /package/dist/{session-friction → audit-journal}/audit-block.mjs +0 -0
- /package/dist/{session-friction → audit-journal}/audit-fit.d.mts +0 -0
- /package/dist/{session-friction → audit-journal}/audit-fit.mjs +0 -0
- /package/dist/{session-friction → audit-journal}/types.mjs +0 -0
- /package/dist/{session-friction → private-files}/lock.d.mts +0 -0
- /package/dist/{session-friction → private-files}/utf8.d.mts +0 -0
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { byteLength, fitFields, selectWithin } from "./audit-fit.mjs";
|
|
2
|
-
import { markdownAuditUnits } from "./text.mjs";
|
|
3
|
-
const SANDBOX_SECTION_HEADER = '## Sandbox & Permission Audit';
|
|
4
|
-
const SANDBOX_SECTION_MAX_BYTES = 3_000;
|
|
5
|
-
// Room for the `- kind (n)` group lines, which are rendered outside the per-event budget.
|
|
6
|
-
const GROUP_LINES_BYTES = 120;
|
|
7
|
-
// Below this an event line would keep little beyond its timestamp, so it is omitted and counted.
|
|
8
|
-
const MIN_EVENT_SHARE_BYTES = 120;
|
|
9
|
-
// Event line fields: command prefix, detail, timestamp. Cut detail first, the timestamp never.
|
|
10
|
-
const SHRINK_ORDER = [1, 0];
|
|
11
|
-
const KIND_ORDER = [
|
|
12
|
-
'sandbox-escalation',
|
|
13
|
-
'sandbox-failure',
|
|
14
|
-
'ambiguous-failure',
|
|
15
|
-
];
|
|
16
|
-
/** Reports dropped events as a group in the same shape as the rest, so omission is never silent. */
|
|
17
|
-
function omissionGroup(count) {
|
|
18
|
-
return `- omitted (${count})\n - see journal — ${count} events omitted to fit the size limit — n/a`;
|
|
19
|
-
}
|
|
20
|
-
export function buildSandboxSection(events, redact, maxBytes = SANDBOX_SECTION_MAX_BYTES) {
|
|
21
|
-
const observations = events.flatMap((event) => event.failure
|
|
22
|
-
? [event, { ...event, kind: event.failure.kind, detail: event.failure.detail }]
|
|
23
|
-
: [event]);
|
|
24
|
-
const render = (event, budgetBytes) => {
|
|
25
|
-
const outcome = event.kind === 'sandbox-escalation' ? ` — outcome: ${event.outcome ?? 'unknown'}` : '';
|
|
26
|
-
const [prefix, detail, timestamp] = fitFields([event.commandPrefix, event.detail, event.timestamp].map((field) => markdownAuditUnits(field, redact)), byteLength(` - — — ${outcome}`), budgetBytes, SHRINK_ORDER);
|
|
27
|
-
return ` - ${prefix} — ${detail} — ${timestamp}${outcome}`;
|
|
28
|
-
};
|
|
29
|
-
const total = Math.max(0, Math.min(maxBytes, SANDBOX_SECTION_MAX_BYTES) - GROUP_LINES_BYTES);
|
|
30
|
-
const { rendered, omitted } = selectWithin(observations, total, byteLength(omissionGroup(observations.length)) + 1, 1, MIN_EVENT_SHARE_BYTES, render);
|
|
31
|
-
const kept = observations
|
|
32
|
-
.slice(0, rendered.length)
|
|
33
|
-
.map((event, i) => ({ event, line: rendered[i] }));
|
|
34
|
-
const groups = KIND_ORDER.map((kind) => {
|
|
35
|
-
const selected = kept.filter(({ event }) => event.kind === kind);
|
|
36
|
-
return selected.length
|
|
37
|
-
? [`- ${kind} (${selected.length})`, ...selected.map(({ line }) => line)].join('\n')
|
|
38
|
-
: undefined;
|
|
39
|
-
}).filter((group) => group !== undefined);
|
|
40
|
-
if (omitted)
|
|
41
|
-
groups.push(omissionGroup(omitted));
|
|
42
|
-
return `${SANDBOX_SECTION_HEADER}\nEvents observed: ${observations.length}\n\n${groups.join('\n')}`;
|
|
43
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
export type FrictionEventKind = 'sandbox-escalation' | 'sandbox-failure' | 'ambiguous-failure';
|
|
2
|
-
export type FrictionEvent = {
|
|
3
|
-
kind: FrictionEventKind;
|
|
4
|
-
timestamp: string;
|
|
5
|
-
commandPrefix: string;
|
|
6
|
-
detail: string;
|
|
7
|
-
outcome?: 'requested' | 'approved' | 'denied' | 'unknown';
|
|
8
|
-
failure?: {
|
|
9
|
-
kind: 'sandbox-failure' | 'ambiguous-failure';
|
|
10
|
-
detail: string;
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
export type ToolResultObservation = {
|
|
14
|
-
type: 'tool-result';
|
|
15
|
-
command: string;
|
|
16
|
-
commandWrappers?: string[];
|
|
17
|
-
permissionOutcome?: 'approved' | 'denied';
|
|
18
|
-
escalationDetail?: string;
|
|
19
|
-
structuredStderr?: string;
|
|
20
|
-
};
|
|
21
|
-
export type PermissionRequestObservation = {
|
|
22
|
-
type: 'permission-request';
|
|
23
|
-
command: string;
|
|
24
|
-
commandWrappers?: string[];
|
|
25
|
-
};
|
|
26
|
-
export type FrictionObservation = ToolResultObservation | PermissionRequestObservation;
|
|
27
|
-
type FrictionLogCoverage = {
|
|
28
|
-
truncated: true;
|
|
29
|
-
droppedCount: number;
|
|
30
|
-
} | {
|
|
31
|
-
truncated?: false;
|
|
32
|
-
droppedCount?: never;
|
|
33
|
-
};
|
|
34
|
-
export type FrictionLogReadResult = {
|
|
35
|
-
status: 'absent';
|
|
36
|
-
} | ({
|
|
37
|
-
status: 'empty';
|
|
38
|
-
} & FrictionLogCoverage) | ({
|
|
39
|
-
status: 'events';
|
|
40
|
-
events: FrictionEvent[];
|
|
41
|
-
} & FrictionLogCoverage);
|
|
42
|
-
export type FrictionLogOptions = {
|
|
43
|
-
directory: string;
|
|
44
|
-
maxEvents?: number;
|
|
45
|
-
};
|
|
46
|
-
export type JournalEntry = {
|
|
47
|
-
data?: {
|
|
48
|
-
type?: unknown;
|
|
49
|
-
markdown?: unknown;
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
export type JournalLoadResult = {
|
|
53
|
-
status: 'ok';
|
|
54
|
-
entries: Iterable<JournalEntry> | AsyncIterable<JournalEntry>;
|
|
55
|
-
} | {
|
|
56
|
-
status: 'not-found';
|
|
57
|
-
};
|
|
58
|
-
export type JournalLoader = (sessionId: string) => JournalLoadResult | Promise<JournalLoadResult>;
|
|
59
|
-
export type SessionFrictionCoverage = {
|
|
60
|
-
journalStatus: 'complete' | 'partial' | 'unavailable';
|
|
61
|
-
frictionStatus: 'absent' | 'empty' | 'events' | 'unreadable';
|
|
62
|
-
truncated: boolean;
|
|
63
|
-
droppedCount?: number;
|
|
64
|
-
};
|
|
65
|
-
export type SessionFrictionReport = {
|
|
66
|
-
coverage: SessionFrictionCoverage;
|
|
67
|
-
markdown: string;
|
|
68
|
-
diagnostic?: string;
|
|
69
|
-
};
|
|
70
|
-
export type SessionFrictionReportOptions = FrictionLogOptions & {
|
|
71
|
-
journalLoader: JournalLoader;
|
|
72
|
-
/** Redacts raw field text before Markdown escaping, which would otherwise break matching. */
|
|
73
|
-
redact?: (value: string) => string;
|
|
74
|
-
/** Byte allowances for the CI and sandbox sections, as maximums over the built-in budgets. */
|
|
75
|
-
budgets?: {
|
|
76
|
-
ciBytes: number;
|
|
77
|
-
sandboxBytes: number;
|
|
78
|
-
};
|
|
79
|
-
};
|
|
80
|
-
export {};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|