@revfleet/hscli 0.9.8 → 0.11.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/CHANGELOG.md +132 -0
- package/README.md +142 -13
- package/SECURITY.md +14 -3
- package/dist/cli.js +3 -3
- package/dist/cli.js.map +1 -1
- package/dist/cloud/cloud-run-caller-contract.d.ts +28 -0
- package/dist/cloud/cloud-run-caller-contract.js +35 -0
- package/dist/cloud/cloud-run-caller-contract.js.map +1 -0
- package/dist/cloud/main.d.ts +1 -0
- package/dist/cloud/main.js +15 -0
- package/dist/cloud/main.js.map +1 -0
- package/dist/cloud/server.d.ts +5 -0
- package/dist/cloud/server.js +133 -0
- package/dist/cloud/server.js.map +1 -0
- package/dist/commands/agent/access-baseline.d.ts +47 -0
- package/dist/commands/agent/access-baseline.js +238 -0
- package/dist/commands/agent/access-baseline.js.map +1 -0
- package/dist/commands/agent/index.js +99 -11
- package/dist/commands/agent/index.js.map +1 -1
- package/dist/commands/agent/recipes.d.ts +7 -1
- package/dist/commands/agent/recipes.js +57 -1
- package/dist/commands/agent/recipes.js.map +1 -1
- package/dist/commands/agent/reporting-joinability.d.ts +129 -0
- package/dist/commands/agent/reporting-joinability.js +412 -0
- package/dist/commands/agent/reporting-joinability.js.map +1 -0
- package/dist/commands/agent/runner.d.ts +1 -0
- package/dist/commands/agent/runner.js +181 -27
- package/dist/commands/agent/runner.js.map +1 -1
- package/dist/commands/audit/index.js +2 -1
- package/dist/commands/audit/index.js.map +1 -1
- package/dist/commands/auth/index.d.ts +6 -2
- package/dist/commands/auth/index.js +172 -57
- package/dist/commands/auth/index.js.map +1 -1
- package/dist/commands/backup/index.js +6 -8
- package/dist/commands/backup/index.js.map +1 -1
- package/dist/commands/crm/describe.js +3 -3
- package/dist/commands/crm/describe.js.map +1 -1
- package/dist/commands/crm/index.js +2 -0
- package/dist/commands/crm/index.js.map +1 -1
- package/dist/commands/crm/record-layouts.d.ts +3 -0
- package/dist/commands/crm/record-layouts.js +246 -0
- package/dist/commands/crm/record-layouts.js.map +1 -0
- package/dist/commands/crm/shared.d.ts +1 -0
- package/dist/commands/crm/shared.js +7 -3
- package/dist/commands/crm/shared.js.map +1 -1
- package/dist/commands/crm/sync.js +170 -27
- package/dist/commands/crm/sync.js.map +1 -1
- package/dist/commands/doctor/index.js +5 -5
- package/dist/commands/doctor/index.js.map +1 -1
- package/dist/commands/internal/index.js +20 -6
- package/dist/commands/internal/index.js.map +1 -1
- package/dist/commands/internal-session.d.ts +4 -0
- package/dist/commands/internal-session.js +27 -0
- package/dist/commands/internal-session.js.map +1 -1
- package/dist/commands/lists/index.js +18 -0
- package/dist/commands/lists/index.js.map +1 -1
- package/dist/commands/marketing/index.js +5 -5
- package/dist/commands/marketing/index.js.map +1 -1
- package/dist/commands/mcp.d.ts +2 -1
- package/dist/commands/mcp.js +49 -5
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/sales/index.js +2 -0
- package/dist/commands/sales/index.js.map +1 -1
- package/dist/commands/sales/views.d.ts +3 -0
- package/dist/commands/sales/views.js +263 -0
- package/dist/commands/sales/views.js.map +1 -0
- package/dist/commands/settings/index.js +20 -0
- package/dist/commands/settings/index.js.map +1 -1
- package/dist/commands/trace/index.js +11 -4
- package/dist/commands/trace/index.js.map +1 -1
- package/dist/commands/workflows/index.js +2 -0
- package/dist/commands/workflows/index.js.map +1 -1
- package/dist/commands/workflows/internal.d.ts +3 -0
- package/dist/commands/workflows/internal.js +332 -0
- package/dist/commands/workflows/internal.js.map +1 -0
- package/dist/core/auth.d.ts +18 -2
- package/dist/core/auth.js +96 -3
- package/dist/core/auth.js.map +1 -1
- package/dist/core/bounded-response.d.ts +2 -0
- package/dist/core/bounded-response.js +37 -0
- package/dist/core/bounded-response.js.map +1 -0
- package/dist/core/capabilities.d.ts +8 -0
- package/dist/core/capabilities.js +31 -3
- package/dist/core/capabilities.js.map +1 -1
- package/dist/core/http.d.ts +16 -0
- package/dist/core/http.js +151 -35
- package/dist/core/http.js.map +1 -1
- package/dist/core/output.js +20 -4
- package/dist/core/output.js.map +1 -1
- package/dist/core/permissions.js +15 -1
- package/dist/core/permissions.js.map +1 -1
- package/dist/core/policy.js +8 -0
- package/dist/core/policy.js.map +1 -1
- package/dist/core/request-path.d.ts +13 -0
- package/dist/core/request-path.js +90 -0
- package/dist/core/request-path.js.map +1 -0
- package/dist/core/schema-cache.js +6 -2
- package/dist/core/schema-cache.js.map +1 -1
- package/dist/core/vault.js +10 -5
- package/dist/core/vault.js.map +1 -1
- package/dist/core/version.d.ts +1 -0
- package/dist/core/version.js +3 -0
- package/dist/core/version.js.map +1 -0
- package/dist/mcp/compat-hubspot.d.ts +5 -14
- package/dist/mcp/compat-hubspot.js +19 -16
- package/dist/mcp/compat-hubspot.js.map +1 -1
- package/dist/mcp/diagnostics.d.ts +157 -0
- package/dist/mcp/diagnostics.js +200 -0
- package/dist/mcp/diagnostics.js.map +1 -0
- package/dist/mcp/ecosystem.d.ts +107 -0
- package/dist/mcp/ecosystem.js +127 -0
- package/dist/mcp/ecosystem.js.map +1 -0
- package/dist/mcp/ext-tools.d.ts +4 -3
- package/dist/mcp/ext-tools.js +20 -8
- package/dist/mcp/ext-tools.js.map +1 -1
- package/dist/mcp/profiles.d.ts +9 -0
- package/dist/mcp/profiles.js +38 -4
- package/dist/mcp/profiles.js.map +1 -1
- package/dist/mcp/server.d.ts +118 -1
- package/dist/mcp/server.js +67 -10
- package/dist/mcp/server.js.map +1 -1
- package/docs/CAPABILITY_LIBRARY.md +7 -1
- package/docs/CLOUD_RUN.md +188 -0
- package/docs/COMMAND_TREE.md +20 -6
- package/docs/COMPARISON.md +14 -6
- package/docs/COOKBOOK.md +46 -2
- package/docs/INTERNAL-ENDPOINTS-DISCOVERY.md +59 -0
- package/docs/INTERNAL-ENDPOINTS.md +13 -0
- package/docs/INTERNAL_ENDPOINTS.md +23 -5
- package/docs/MCP.md +48 -6
- package/docs/MCP_TOOL_CATALOG.md +188 -186
- package/docs/OPERATIONAL_PLAYBOOKS.md +9 -8
- package/docs/PORTAL_BACKUP.md +26 -2
- package/docs/RELEASE_GOVERNANCE.md +7 -0
- package/docs/SAFETY_MODEL.md +23 -4
- package/docs/TUTORIALS/secure-agent-writes.md +3 -2
- package/docs/VALIDATION_BOUNDARIES.md +101 -0
- package/docs/policy-templates/compliance-strict.json +7 -0
- package/examples/cloud-run-mcp-caller.mjs +71 -0
- package/package.json +11 -8
|
@@ -0,0 +1,412 @@
|
|
|
1
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
2
|
+
import { chmodSync, existsSync, mkdirSync, readdirSync, readFileSync, statSync, writeFileSync } from "node:fs";
|
|
3
|
+
import { dirname, join, resolve } from "node:path";
|
|
4
|
+
import { getApiBaseUrl, getHscliHomeDir, getToken } from "../../core/auth.js";
|
|
5
|
+
import { HubSpotClient } from "../../core/http.js";
|
|
6
|
+
import { CliError } from "../../core/output.js";
|
|
7
|
+
const MAX_EVIDENCE_BYTES = 1024 * 1024;
|
|
8
|
+
const READ_ONLY_RECHECK = [
|
|
9
|
+
"hscli agent plan reporting-joinability",
|
|
10
|
+
"hscli --profile <approved-profile> agent run reporting-joinability --confirm-read-only",
|
|
11
|
+
];
|
|
12
|
+
const PROBES = [
|
|
13
|
+
{
|
|
14
|
+
id: "sequence_surface",
|
|
15
|
+
label: "Sequence API surface",
|
|
16
|
+
mode: "not_probed",
|
|
17
|
+
evidenceGap: "The documented sequence-list request requires a user identity. This contract never derives, stores, or sends an identity, so it does not make a sequence request.",
|
|
18
|
+
humanDecisionPrompt: "Decide whether a separately approved, identity-bearing sequence review is necessary before relying on this surface operationally.",
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
id: "meeting_schema",
|
|
22
|
+
label: "Meeting metadata surface",
|
|
23
|
+
mode: "status_only",
|
|
24
|
+
path: "/crm/v3/properties/meetings/hs_meeting_title",
|
|
25
|
+
evidenceGap: "This status does not inspect a meeting record or prove that meetings are populated.",
|
|
26
|
+
humanDecisionPrompt: "Confirm that meeting records and their capture process are in scope for a separately approved review.",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: "deal_schema",
|
|
30
|
+
label: "Deal metadata surface",
|
|
31
|
+
mode: "status_only",
|
|
32
|
+
path: "/crm/v3/properties/deals/dealname",
|
|
33
|
+
evidenceGap: "This status does not inspect a deal record or prove pipeline data completeness.",
|
|
34
|
+
humanDecisionPrompt: "Confirm that deal records and the intended reporting population are in scope for a separately approved review.",
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
id: "meeting_deal_association_definition",
|
|
38
|
+
label: "Meeting-to-deal association definition",
|
|
39
|
+
mode: "status_only",
|
|
40
|
+
path: "/crm/v4/associations/meetings/deals/labels",
|
|
41
|
+
evidenceGap: "This status checks only whether association definitions are readable; it does not count or inspect associations between records.",
|
|
42
|
+
humanDecisionPrompt: "Decide whether a separately approved aggregate association-count review is needed before relying on this relation operationally.",
|
|
43
|
+
},
|
|
44
|
+
];
|
|
45
|
+
const UNAVAILABLE_EVIDENCE = {
|
|
46
|
+
missing_scope_or_permission: "The public read was rejected by authentication or authorization. This does not distinguish scope, permission, or a product prerequisite.",
|
|
47
|
+
unsupported_endpoint_or_subscription: "The public endpoint was unavailable. This does not distinguish an unsupported endpoint from a subscription or product prerequisite.",
|
|
48
|
+
api_failure: "The public read did not yield usable reachability evidence because of an API, service, or network failure.",
|
|
49
|
+
not_probed: "No approved public read was completed for this evidence item.",
|
|
50
|
+
};
|
|
51
|
+
export function buildReportingJoinabilityEvidence(input) {
|
|
52
|
+
if (!isIsoDateTime(input.startedAt)
|
|
53
|
+
|| !isIsoDateTime(input.completedAt)
|
|
54
|
+
|| !validRunId(input.runId)
|
|
55
|
+
|| (input.probes.sequence_surface !== undefined && input.probes.sequence_surface !== "not_probed")
|
|
56
|
+
|| Object.values(input.probes).some((status) => status !== undefined && !validObservedStatus(status))) {
|
|
57
|
+
throw new CliError("REPORTING_JOINABILITY_INPUT_INVALID", "Reporting joinability requires a valid aggregate run identifier and timestamps.");
|
|
58
|
+
}
|
|
59
|
+
const probes = PROBES.map((definition) => buildProbe(definition, input.probes[definition.id] ?? "not_probed"));
|
|
60
|
+
const collected = probes.filter((probe) => probe.observedStatus !== "not_probed").length;
|
|
61
|
+
const failed = probes.filter((probe) => probe.observedStatus === "api_failure").length;
|
|
62
|
+
const missing = probes.length - collected;
|
|
63
|
+
const status = failed === 0 ? "completed" : "completed_with_errors";
|
|
64
|
+
const unsigned = {
|
|
65
|
+
schema: "hscli.reporting-joinability/v1",
|
|
66
|
+
source: { product: "hscli", recipe: "reporting-joinability" },
|
|
67
|
+
run: {
|
|
68
|
+
id: input.runId,
|
|
69
|
+
status,
|
|
70
|
+
startedAt: input.startedAt,
|
|
71
|
+
completedAt: input.completedAt,
|
|
72
|
+
},
|
|
73
|
+
coverage: {
|
|
74
|
+
status: collected === probes.length && failed === 0 ? "complete" : "partial",
|
|
75
|
+
collected,
|
|
76
|
+
missing,
|
|
77
|
+
failed,
|
|
78
|
+
},
|
|
79
|
+
probes,
|
|
80
|
+
links: [
|
|
81
|
+
buildSequenceToMeetingLink(probes),
|
|
82
|
+
buildMeetingToDealLink(probes),
|
|
83
|
+
],
|
|
84
|
+
reportInventory: {
|
|
85
|
+
status: "unavailable",
|
|
86
|
+
attributionCorrectness: "unavailable",
|
|
87
|
+
detail: "This contract does not audit HubSpot native report/dashboard UI. Report inventory and attribution correctness are unavailable and never inferred.",
|
|
88
|
+
},
|
|
89
|
+
privacy: {
|
|
90
|
+
aggregateStatusOnly: true,
|
|
91
|
+
containsCrmRows: false,
|
|
92
|
+
containsRecordIds: false,
|
|
93
|
+
containsResponseBodies: false,
|
|
94
|
+
containsCredentials: false,
|
|
95
|
+
containsTokens: false,
|
|
96
|
+
containsCookies: false,
|
|
97
|
+
containsProfileIdentity: false,
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
return {
|
|
101
|
+
...unsigned,
|
|
102
|
+
digest: {
|
|
103
|
+
algorithm: "sha256",
|
|
104
|
+
value: createHash("sha256").update(stableStringify(unsigned)).digest("hex"),
|
|
105
|
+
},
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
export async function runReportingJoinability(ctx, options) {
|
|
109
|
+
if (!options.confirmReadOnly) {
|
|
110
|
+
throw new CliError("REPORTING_JOINABILITY_READ_CONFIRMATION_REQUIRED", "Review 'hscli agent plan reporting-joinability' first, then rerun with --confirm-read-only.");
|
|
111
|
+
}
|
|
112
|
+
const runId = randomUUID();
|
|
113
|
+
const startedAt = new Date().toISOString();
|
|
114
|
+
const outputDir = resolve(options.output ?? defaultOutputDir(startedAt, runId));
|
|
115
|
+
prepareOutputDir(outputDir);
|
|
116
|
+
const statuses = await collectProbeStatuses(ctx.profile);
|
|
117
|
+
const evidence = buildReportingJoinabilityEvidence({
|
|
118
|
+
runId,
|
|
119
|
+
startedAt,
|
|
120
|
+
completedAt: new Date().toISOString(),
|
|
121
|
+
probes: statuses,
|
|
122
|
+
});
|
|
123
|
+
const evidenceFile = join(outputDir, "reporting-joinability.json");
|
|
124
|
+
const reportFile = join(outputDir, "reporting-joinability.md");
|
|
125
|
+
writeReportingJoinabilityEvidence(evidence, evidenceFile);
|
|
126
|
+
writeReportingJoinabilityReport(evidence, reportFile);
|
|
127
|
+
return {
|
|
128
|
+
recipe: "reporting-joinability",
|
|
129
|
+
outputDir,
|
|
130
|
+
evidenceFile,
|
|
131
|
+
reportFile,
|
|
132
|
+
coverage: evidence.coverage.status,
|
|
133
|
+
privacy: evidence.privacy,
|
|
134
|
+
submitted: false,
|
|
135
|
+
schedulingAllowed: false,
|
|
136
|
+
mcpExposed: false,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
export function readReportingJoinabilityEvidence(runDirectory) {
|
|
140
|
+
const file = join(resolve(runDirectory), "reporting-joinability.json");
|
|
141
|
+
const evidence = readJson(file, "reporting joinability evidence");
|
|
142
|
+
validateEvidence(evidence);
|
|
143
|
+
return evidence;
|
|
144
|
+
}
|
|
145
|
+
export function writeReportingJoinabilityEvidence(evidence, outputFile) {
|
|
146
|
+
validateEvidence(evidence);
|
|
147
|
+
writeRestrictedFile(resolve(outputFile), `${JSON.stringify(evidence, null, 2)}\n`);
|
|
148
|
+
}
|
|
149
|
+
export function renderReportingJoinabilityMarkdown(evidence) {
|
|
150
|
+
validateEvidence(evidence);
|
|
151
|
+
const lines = [
|
|
152
|
+
"# Reporting Joinability",
|
|
153
|
+
"",
|
|
154
|
+
"> Unscored, read-only, local aggregate-only evidence for an operational sequence → meeting → deal chain. It does not audit HubSpot native report/dashboard UI.",
|
|
155
|
+
"",
|
|
156
|
+
`**Coverage:** ${evidence.coverage.status === "complete" ? "Complete" : "Partial"} (${evidence.coverage.collected}/${evidence.probes.length} public-read probes completed)`,
|
|
157
|
+
"",
|
|
158
|
+
"| Link | Observed status | Coverage | Reachable evidence | Unavailable evidence |",
|
|
159
|
+
"| --- | --- | --- | --- | --- |",
|
|
160
|
+
];
|
|
161
|
+
for (const link of evidence.links) {
|
|
162
|
+
lines.push([
|
|
163
|
+
`| ${link.label}`,
|
|
164
|
+
link.observedStatus,
|
|
165
|
+
`${link.coverage.completed}/${link.coverage.expected}`,
|
|
166
|
+
link.reachableEvidence.join("<br>") || "—",
|
|
167
|
+
link.unavailableEvidence.map((item) => item.category).join("<br>") || "—",
|
|
168
|
+
"|",
|
|
169
|
+
].join(" "));
|
|
170
|
+
lines.push(`\n**${link.label} evidence gap:** ${link.evidenceGap}`);
|
|
171
|
+
lines.push(`\n**Human decision:** ${link.humanDecisionPrompt}\n`);
|
|
172
|
+
}
|
|
173
|
+
lines.push("## Native reporting boundary", "", "Report inventory and attribution correctness are unavailable. They are never inferred from this contract.", "", "## Read-only re-check", "", "```bash", ...READ_ONLY_RECHECK, "```", "", "The local artifacts contain no CRM rows, record IDs, response bodies, scopes, profile identity, tokens, cookies, credentials, request transcripts, or report/dashboard inventory.", "");
|
|
174
|
+
return lines.join("\n");
|
|
175
|
+
}
|
|
176
|
+
export function writeReportingJoinabilityReport(evidence, outputFile) {
|
|
177
|
+
const report = renderReportingJoinabilityMarkdown(evidence);
|
|
178
|
+
writeRestrictedFile(resolve(outputFile), report);
|
|
179
|
+
return report;
|
|
180
|
+
}
|
|
181
|
+
async function collectProbeStatuses(profile) {
|
|
182
|
+
const statuses = Object.fromEntries(PROBES.map((probe) => [probe.id, "not_probed"]));
|
|
183
|
+
let client;
|
|
184
|
+
try {
|
|
185
|
+
// This contract must remain read-only at every layer: do not use the
|
|
186
|
+
// profile token provider because it can refresh OAuth credentials and
|
|
187
|
+
// persist the refreshed token before a probe request.
|
|
188
|
+
client = new HubSpotClient(getToken(profile), {
|
|
189
|
+
apiBaseUrl: getApiBaseUrl(profile),
|
|
190
|
+
disableTelemetry: true,
|
|
191
|
+
profile,
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
catch (error) {
|
|
195
|
+
const status = classifyError(error);
|
|
196
|
+
for (const probe of PROBES) {
|
|
197
|
+
if (probe.mode === "status_only")
|
|
198
|
+
statuses[probe.id] = status;
|
|
199
|
+
}
|
|
200
|
+
return statuses;
|
|
201
|
+
}
|
|
202
|
+
for (const probe of PROBES) {
|
|
203
|
+
if (probe.mode === "not_probed")
|
|
204
|
+
continue;
|
|
205
|
+
try {
|
|
206
|
+
await client.request(probe.path, { responseMode: "status", retryMode: "never" });
|
|
207
|
+
statuses[probe.id] = "reachable";
|
|
208
|
+
}
|
|
209
|
+
catch (error) {
|
|
210
|
+
statuses[probe.id] = classifyError(error);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
return statuses;
|
|
214
|
+
}
|
|
215
|
+
function buildProbe(definition, observedStatus) {
|
|
216
|
+
return {
|
|
217
|
+
id: definition.id,
|
|
218
|
+
label: definition.label,
|
|
219
|
+
observedStatus,
|
|
220
|
+
reachableEvidence: observedStatus === "reachable" ? [`${definition.label} was reachable through one approved public read.`] : [],
|
|
221
|
+
unavailableEvidence: unavailableFor(definition, observedStatus),
|
|
222
|
+
evidenceGap: definition.evidenceGap,
|
|
223
|
+
humanDecisionPrompt: definition.humanDecisionPrompt,
|
|
224
|
+
readOnlyRecheck: READ_ONLY_RECHECK,
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
function buildSequenceToMeetingLink(probes) {
|
|
228
|
+
const supporting = pickProbes(probes, ["sequence_surface", "meeting_schema"]);
|
|
229
|
+
return {
|
|
230
|
+
id: "sequence_to_meeting",
|
|
231
|
+
label: "Sequence → meeting",
|
|
232
|
+
observedStatus: "not_probed",
|
|
233
|
+
coverage: coverageFor(supporting),
|
|
234
|
+
reachableEvidence: reachableFor(supporting),
|
|
235
|
+
unavailableEvidence: [
|
|
236
|
+
...unavailableForProbes(supporting),
|
|
237
|
+
{
|
|
238
|
+
category: "not_probed",
|
|
239
|
+
detail: "Sequences are automation resources, not a documented CRM association object type for this aggregate-only contract.",
|
|
240
|
+
},
|
|
241
|
+
],
|
|
242
|
+
evidenceGap: "No direct sequence-to-meeting association is inspected or inferred. The contract does not inspect sequence steps, enrollments, meetings, or CRM rows.",
|
|
243
|
+
humanDecisionPrompt: "Decide how the organisation records a sequence outcome that should lead to a meeting before approving any separate data review.",
|
|
244
|
+
readOnlyRecheck: READ_ONLY_RECHECK,
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
function buildMeetingToDealLink(probes) {
|
|
248
|
+
const supporting = pickProbes(probes, ["meeting_schema", "deal_schema", "meeting_deal_association_definition"]);
|
|
249
|
+
return {
|
|
250
|
+
id: "meeting_to_deal",
|
|
251
|
+
label: "Meeting → deal",
|
|
252
|
+
observedStatus: combineStatuses(supporting.map((probe) => probe.observedStatus)),
|
|
253
|
+
coverage: coverageFor(supporting),
|
|
254
|
+
reachableEvidence: reachableFor(supporting),
|
|
255
|
+
unavailableEvidence: unavailableForProbes(supporting),
|
|
256
|
+
evidenceGap: "A readable association definition does not establish that any meeting is associated with any deal, nor that reporting attribution is correct.",
|
|
257
|
+
humanDecisionPrompt: "Decide whether an approved aggregate association-coverage review is necessary before using this link operationally.",
|
|
258
|
+
readOnlyRecheck: READ_ONLY_RECHECK,
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
function pickProbes(probes, ids) {
|
|
262
|
+
return ids.map((id) => {
|
|
263
|
+
const probe = probes.find((candidate) => candidate.id === id);
|
|
264
|
+
if (!probe)
|
|
265
|
+
throw new CliError("REPORTING_JOINABILITY_PROBE_INVALID", "Reporting joinability is missing a required aggregate probe.");
|
|
266
|
+
return probe;
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
function coverageFor(probes) {
|
|
270
|
+
const completed = probes.filter((probe) => probe.observedStatus !== "not_probed").length;
|
|
271
|
+
return {
|
|
272
|
+
status: completed === probes.length ? "complete" : "partial",
|
|
273
|
+
completed,
|
|
274
|
+
expected: probes.length,
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
function reachableFor(probes) {
|
|
278
|
+
return probes.flatMap((probe) => probe.reachableEvidence);
|
|
279
|
+
}
|
|
280
|
+
function unavailableForProbes(probes) {
|
|
281
|
+
return probes.flatMap((probe) => probe.unavailableEvidence);
|
|
282
|
+
}
|
|
283
|
+
function unavailableFor(definition, status) {
|
|
284
|
+
if (status === "reachable")
|
|
285
|
+
return [];
|
|
286
|
+
return [{
|
|
287
|
+
category: status,
|
|
288
|
+
detail: status === "not_probed" && definition.mode === "not_probed"
|
|
289
|
+
? "The documented sequence-list API requires a user identity. This contract does not derive, store, or send an identity, so no HTTP request was made."
|
|
290
|
+
: UNAVAILABLE_EVIDENCE[status],
|
|
291
|
+
}];
|
|
292
|
+
}
|
|
293
|
+
function combineStatuses(statuses) {
|
|
294
|
+
for (const status of [
|
|
295
|
+
"missing_scope_or_permission",
|
|
296
|
+
"unsupported_endpoint_or_subscription",
|
|
297
|
+
"api_failure",
|
|
298
|
+
"not_probed",
|
|
299
|
+
]) {
|
|
300
|
+
if (statuses.includes(status))
|
|
301
|
+
return status;
|
|
302
|
+
}
|
|
303
|
+
return "reachable";
|
|
304
|
+
}
|
|
305
|
+
function classifyError(error) {
|
|
306
|
+
if (!(error instanceof CliError))
|
|
307
|
+
return "api_failure";
|
|
308
|
+
if (error.status === 401 || error.status === 403 || error.code === "CAPABILITY_SCOPE_MISSING") {
|
|
309
|
+
return "missing_scope_or_permission";
|
|
310
|
+
}
|
|
311
|
+
if (error.status === 404 || error.code === "CAPABILITY_UNSUPPORTED") {
|
|
312
|
+
return "unsupported_endpoint_or_subscription";
|
|
313
|
+
}
|
|
314
|
+
return "api_failure";
|
|
315
|
+
}
|
|
316
|
+
function defaultOutputDir(startedAt, runId) {
|
|
317
|
+
const timestamp = startedAt.replace(/[:.]/g, "-");
|
|
318
|
+
return join(getHscliHomeDir(), "agent-runs", "reporting-joinability", `${timestamp}-${runId.slice(0, 8)}`);
|
|
319
|
+
}
|
|
320
|
+
function prepareOutputDir(outputDir) {
|
|
321
|
+
if (existsSync(outputDir) && readdirSync(outputDir).length > 0) {
|
|
322
|
+
throw new CliError("REPORTING_JOINABILITY_OUTPUT_EXISTS", `Output directory '${outputDir}' is not empty.`);
|
|
323
|
+
}
|
|
324
|
+
mkdirSync(outputDir, { recursive: true, mode: 0o700 });
|
|
325
|
+
if (process.platform !== "win32")
|
|
326
|
+
chmodSync(outputDir, 0o700);
|
|
327
|
+
}
|
|
328
|
+
function validateEvidence(evidence) {
|
|
329
|
+
if (evidence.schema !== "hscli.reporting-joinability/v1"
|
|
330
|
+
|| evidence.source?.product !== "hscli"
|
|
331
|
+
|| evidence.source?.recipe !== "reporting-joinability"
|
|
332
|
+
|| !validRunId(evidence.run?.id)
|
|
333
|
+
|| !isIsoDateTime(evidence.run?.startedAt)
|
|
334
|
+
|| !isIsoDateTime(evidence.run?.completedAt)
|
|
335
|
+
|| !Array.isArray(evidence.probes)
|
|
336
|
+
|| !Array.isArray(evidence.links)
|
|
337
|
+
|| evidence.probes.length !== PROBES.length
|
|
338
|
+
|| evidence.links.length !== 2
|
|
339
|
+
|| evidence.reportInventory?.status !== "unavailable"
|
|
340
|
+
|| evidence.reportInventory?.attributionCorrectness !== "unavailable"
|
|
341
|
+
|| evidence.digest?.algorithm !== "sha256"
|
|
342
|
+
|| !/^[a-f0-9]{64}$/.test(evidence.digest?.value ?? "")) {
|
|
343
|
+
throw new CliError("REPORTING_JOINABILITY_SCHEMA_INVALID", "Expected a complete hscli.reporting-joinability/v1 aggregate evidence file.");
|
|
344
|
+
}
|
|
345
|
+
let canonical;
|
|
346
|
+
try {
|
|
347
|
+
canonical = buildReportingJoinabilityEvidence({
|
|
348
|
+
runId: evidence.run.id,
|
|
349
|
+
startedAt: evidence.run.startedAt,
|
|
350
|
+
completedAt: evidence.run.completedAt,
|
|
351
|
+
probes: Object.fromEntries(evidence.probes.map((probe) => [probe.id, probe.observedStatus])),
|
|
352
|
+
});
|
|
353
|
+
}
|
|
354
|
+
catch {
|
|
355
|
+
throw new CliError("REPORTING_JOINABILITY_SCHEMA_INVALID", "Expected canonical hscli.reporting-joinability/v1 aggregate evidence.");
|
|
356
|
+
}
|
|
357
|
+
const { digest, ...unsigned } = evidence;
|
|
358
|
+
const canonicalUnsigned = Object.fromEntries(Object.entries(canonical).filter(([key]) => key !== "digest"));
|
|
359
|
+
if (stableStringify(unsigned) !== stableStringify(canonicalUnsigned)) {
|
|
360
|
+
throw new CliError("REPORTING_JOINABILITY_SCHEMA_INVALID", "Reporting joinability evidence must contain only the canonical aggregate contract fields.");
|
|
361
|
+
}
|
|
362
|
+
const expected = createHash("sha256").update(stableStringify(unsigned)).digest("hex");
|
|
363
|
+
if (digest.value !== expected) {
|
|
364
|
+
throw new CliError("REPORTING_JOINABILITY_DIGEST_INVALID", "Reporting joinability evidence integrity check failed.");
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
function readJson(file, label) {
|
|
368
|
+
if (!existsSync(file))
|
|
369
|
+
throw new CliError("REPORTING_JOINABILITY_FILE_MISSING", `Missing ${label}.`);
|
|
370
|
+
try {
|
|
371
|
+
if (statSync(file).size > MAX_EVIDENCE_BYTES) {
|
|
372
|
+
throw new CliError("REPORTING_JOINABILITY_FILE_TOO_LARGE", "Reporting joinability evidence exceeds the local aggregate size limit.");
|
|
373
|
+
}
|
|
374
|
+
return JSON.parse(readFileSync(file, "utf8"));
|
|
375
|
+
}
|
|
376
|
+
catch (error) {
|
|
377
|
+
if (error instanceof CliError)
|
|
378
|
+
throw error;
|
|
379
|
+
throw new CliError("REPORTING_JOINABILITY_FILE_INVALID", `Invalid ${label}.`);
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
function writeRestrictedFile(destination, contents) {
|
|
383
|
+
mkdirSync(dirname(destination), { recursive: true, mode: 0o700 });
|
|
384
|
+
if (process.platform !== "win32")
|
|
385
|
+
chmodSync(dirname(destination), 0o700);
|
|
386
|
+
writeFileSync(destination, contents, { mode: 0o600 });
|
|
387
|
+
if (process.platform !== "win32")
|
|
388
|
+
chmodSync(destination, 0o600);
|
|
389
|
+
}
|
|
390
|
+
function isIsoDateTime(value) {
|
|
391
|
+
return typeof value === "string" && value.includes("T") && !Number.isNaN(Date.parse(value));
|
|
392
|
+
}
|
|
393
|
+
function validObservedStatus(value) {
|
|
394
|
+
return value === "reachable"
|
|
395
|
+
|| value === "missing_scope_or_permission"
|
|
396
|
+
|| value === "unsupported_endpoint_or_subscription"
|
|
397
|
+
|| value === "api_failure"
|
|
398
|
+
|| value === "not_probed";
|
|
399
|
+
}
|
|
400
|
+
function validRunId(value) {
|
|
401
|
+
return typeof value === "string" && /^[a-zA-Z0-9-]{1,120}$/.test(value);
|
|
402
|
+
}
|
|
403
|
+
function stableStringify(value) {
|
|
404
|
+
if (Array.isArray(value))
|
|
405
|
+
return `[${value.map(stableStringify).join(",")}]`;
|
|
406
|
+
if (value !== null && typeof value === "object") {
|
|
407
|
+
const record = value;
|
|
408
|
+
return `{${Object.keys(record).sort().map((key) => `${JSON.stringify(key)}:${stableStringify(record[key])}`).join(",")}}`;
|
|
409
|
+
}
|
|
410
|
+
return JSON.stringify(value);
|
|
411
|
+
}
|
|
412
|
+
//# sourceMappingURL=reporting-joinability.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reporting-joinability.js","sourceRoot":"","sources":["../../../src/commands/agent/reporting-joinability.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC/G,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAmB,MAAM,sBAAsB,CAAC;AAEjE,MAAM,kBAAkB,GAAG,IAAI,GAAG,IAAI,CAAC;AACvC,MAAM,iBAAiB,GAAG;IACxB,wCAAwC;IACxC,wFAAwF;CAChF,CAAC;AAEX,MAAM,MAAM,GAAG;IACb;QACE,EAAE,EAAE,kBAAkB;QACtB,KAAK,EAAE,sBAAsB;QAC7B,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,mKAAmK;QAChL,mBAAmB,EAAE,mIAAmI;KACzJ;IACD;QACE,EAAE,EAAE,gBAAgB;QACpB,KAAK,EAAE,0BAA0B;QACjC,IAAI,EAAE,aAAa;QACnB,IAAI,EAAE,8CAA8C;QACpD,WAAW,EAAE,qFAAqF;QAClG,mBAAmB,EAAE,uGAAuG;KAC7H;IACD;QACE,EAAE,EAAE,aAAa;QACjB,KAAK,EAAE,uBAAuB;QAC9B,IAAI,EAAE,aAAa;QACnB,IAAI,EAAE,mCAAmC;QACzC,WAAW,EAAE,iFAAiF;QAC9F,mBAAmB,EAAE,gHA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