@contextecf/guardian-cli 0.1.8 → 0.1.10
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.
|
@@ -17545,14 +17545,16 @@ function buildGuardianDistributionReadiness(npmPreviewReady) {
|
|
|
17545
17545
|
workflow: GUARDIAN_RELEASE_DISPATCH_WORKFLOW,
|
|
17546
17546
|
dryRunCommand: buildGuardianReleaseDispatchCommand(true),
|
|
17547
17547
|
publishCommand: buildGuardianReleaseDispatchCommand(false),
|
|
17548
|
-
|
|
17548
|
+
defaultPublishAuth: GUARDIAN_DEFAULT_NPM_PUBLISH_AUTH,
|
|
17549
|
+
tokenFallbackCredentialName: "NPM_TOKEN",
|
|
17549
17550
|
channels: ["all", "npm", "browser", "evidence"],
|
|
17550
17551
|
defaultDockerSmoke: true,
|
|
17551
17552
|
provenance: "github_actions_oidc_supported",
|
|
17552
17553
|
status: npmPreviewReady ? "ready_for_dispatch_after_preview_evidence" : "blocked_until_preview_release_evidence_passes",
|
|
17553
17554
|
boundaries: [
|
|
17554
17555
|
"Use dry_run=true before public publication.",
|
|
17555
|
-
"dry_run=false
|
|
17556
|
+
"dry_run=false defaults to npm Trusted Publishing and must not print npm tokens, OTP values, or .npmrc contents.",
|
|
17557
|
+
"The token fallback route remains available with publish_auth=token and requires the repository secret NPM_TOKEN.",
|
|
17556
17558
|
"The workflow can publish the npm preview package, upload evidence, submit future Chrome Web Store updates for review when browser_store_publish=api, and run public install smokes; it does not sign native installers or prove future browser-store approval.",
|
|
17557
17559
|
"GitHub Actions OIDC/provenance applies to CI release context; manual local publishes are recorded separately and should not claim CI provenance."
|
|
17558
17560
|
]
|
|
@@ -17574,7 +17576,7 @@ function buildGuardianReleaseDispatchCommand(dryRun) {
|
|
|
17574
17576
|
});
|
|
17575
17577
|
}
|
|
17576
17578
|
function buildGuardianReleaseDispatchCommandFor(input2) {
|
|
17577
|
-
const publishAuth = input2.publishAuth ??
|
|
17579
|
+
const publishAuth = input2.publishAuth ?? GUARDIAN_DEFAULT_NPM_PUBLISH_AUTH;
|
|
17578
17580
|
const browserStorePublish = input2.browserStorePublish ?? "manual";
|
|
17579
17581
|
return [
|
|
17580
17582
|
`gh workflow run ${GUARDIAN_RELEASE_DISPATCH_WORKFLOW} \\`,
|
|
@@ -17690,7 +17692,7 @@ async function runReleaseCommand(argv, flags, options) {
|
|
|
17690
17692
|
}
|
|
17691
17693
|
const dryRun = flags.has("publish") ? false : booleanFlag(flags, "dry-run", true);
|
|
17692
17694
|
const runDockerSmoke = booleanFlag(flags, "run-docker-smoke", true);
|
|
17693
|
-
const publishAuth = stringFlag(flags, "publish-auth") ??
|
|
17695
|
+
const publishAuth = stringFlag(flags, "publish-auth") ?? GUARDIAN_DEFAULT_NPM_PUBLISH_AUTH;
|
|
17694
17696
|
if (!isValidReleasePublishAuth(publishAuth)) {
|
|
17695
17697
|
write(stderr, "Invalid --publish-auth. Expected one of: token, trusted_publisher.\n");
|
|
17696
17698
|
return 1;
|
|
@@ -17818,7 +17820,7 @@ function renderGuardianReleaseDispatchCommand(result, flags) {
|
|
|
17818
17820
|
`Docker smoke: ${result.runDockerSmoke ? "yes" : "no"}`,
|
|
17819
17821
|
`Publish auth: ${result.publishAuth}`,
|
|
17820
17822
|
`Browser store publish: ${result.browserStorePublish}`,
|
|
17821
|
-
result.requiredPublishCredentialName ? `Required repository secret: ${result.requiredPublishCredentialName}` : "Required repository secret: not needed for dry run",
|
|
17823
|
+
result.requiredPublishCredentialName ? `Required repository secret: ${result.requiredPublishCredentialName}` : result.publishAuth === "trusted_publisher" && !result.dryRun ? "Required npm setup: Trusted Publisher connection" : "Required repository secret: not needed for dry run",
|
|
17822
17824
|
result.requiredBrowserStoreCredentialNames ? `Required browser-store secrets: ${result.requiredBrowserStoreCredentialNames.join(", ")}` : "Required browser-store secrets: not needed for manual browser handoff",
|
|
17823
17825
|
"Command:",
|
|
17824
17826
|
result.command,
|
|
@@ -17927,7 +17929,9 @@ function buildGuardianReleaseSecretSetup() {
|
|
|
17927
17929
|
schema_version: "contextecf/project-guardian-release-secret-setup/v1",
|
|
17928
17930
|
cli_version: GUARDIAN_CLI_VERSION,
|
|
17929
17931
|
repository: GUARDIAN_RELEASE_REPOSITORY,
|
|
17930
|
-
|
|
17932
|
+
defaultPublishAuth: GUARDIAN_DEFAULT_NPM_PUBLISH_AUTH,
|
|
17933
|
+
requiredForPublish: "npm_trusted_publisher_connection",
|
|
17934
|
+
tokenFallbackCredentialName: "NPM_TOKEN",
|
|
17931
17935
|
requiredForBrowserStoreApi: GUARDIAN_CHROME_WEB_STORE_API_SECRET_NAMES,
|
|
17932
17936
|
githubActionsSecretUrl: `https://github.com/${GUARDIAN_RELEASE_REPOSITORY}/settings/secrets/actions/new`,
|
|
17933
17937
|
commands: {
|
|
@@ -17961,10 +17965,11 @@ function buildGuardianReleaseSecretSetup() {
|
|
|
17961
17965
|
})
|
|
17962
17966
|
},
|
|
17963
17967
|
boundaries: [
|
|
17964
|
-
"
|
|
17968
|
+
"npm Trusted Publishing is the default Guardian release path and uses this GitHub Actions workflow identity.",
|
|
17969
|
+
"NPM_TOKEN is a fallback credential only; when used, it belongs only in GitHub Actions repository secrets for guarded dry_run=false npm publication.",
|
|
17965
17970
|
"Chrome Web Store API OAuth values belong only in GitHub Actions repository secrets for guarded browser_store_publish=api upload/submission.",
|
|
17966
17971
|
"Do not paste npm tokens, OTP values, .npmrc contents, signing keys, browser-store credentials, raw prompts, raw responses, private policy packs, or customer content into chat, PR bodies, release evidence, or CLI output.",
|
|
17967
|
-
"Use dry_run=true before dry_run=false; dry-run dispatch does not require
|
|
17972
|
+
"Use dry_run=true before dry_run=false; dry-run dispatch does not require npm publish credentials.",
|
|
17968
17973
|
"Adding NPM_TOKEN enables the npm preview publish lane only; it does not close signed-installer, browser-store, high-risk desktop, or autonomous app production gates.",
|
|
17969
17974
|
"Chrome Web Store API secrets enable browser update upload/submission only; official review approval evidence is still required for production browser-store claims."
|
|
17970
17975
|
],
|
|
@@ -17980,7 +17985,8 @@ function renderGuardianReleaseSecretSetup(result, flags) {
|
|
|
17980
17985
|
return `${[
|
|
17981
17986
|
"Project Guardian Release Secret Setup",
|
|
17982
17987
|
`Repository: ${result.repository}`,
|
|
17983
|
-
|
|
17988
|
+
"Default npm publish setup: Trusted Publisher connection",
|
|
17989
|
+
`Fallback npm publish secret: ${result.tokenFallbackCredentialName}`,
|
|
17984
17990
|
`Required for Chrome Web Store API: ${result.requiredForBrowserStoreApi.join(", ")}`,
|
|
17985
17991
|
`GitHub Actions secret page: ${result.githubActionsSecretUrl}`,
|
|
17986
17992
|
"NPM publish secret:",
|
|
@@ -18031,7 +18037,8 @@ function buildGuardianReleaseChecklist(releaseVersion) {
|
|
|
18031
18037
|
browserStoreHandoff: "guardian release browser-store",
|
|
18032
18038
|
readiness: "guardian readiness"
|
|
18033
18039
|
},
|
|
18034
|
-
|
|
18040
|
+
defaultPublishAuth: GUARDIAN_DEFAULT_NPM_PUBLISH_AUTH,
|
|
18041
|
+
tokenFallbackCredentialName: "NPM_TOKEN",
|
|
18035
18042
|
evidenceOutputs: [
|
|
18036
18043
|
"release/evidence/guardian-release-dispatch-summary.json",
|
|
18037
18044
|
"release/evidence/guardian-npm-publish-execution-summary.json",
|
|
@@ -18048,7 +18055,8 @@ function buildGuardianReleaseChecklist(releaseVersion) {
|
|
|
18048
18055
|
boundaries: [
|
|
18049
18056
|
"This checklist is an operator command surface for Guardian preview releases; it is not production-gate proof.",
|
|
18050
18057
|
"Run the dry-run dispatch before any dry_run=false publish dispatch.",
|
|
18051
|
-
"dry_run=false
|
|
18058
|
+
"dry_run=false defaults to npm Trusted Publishing and must not print npm tokens, OTP values, or .npmrc contents.",
|
|
18059
|
+
"The token fallback route remains available with publish_auth=token and requires NPM_TOKEN in GitHub Actions repository secrets.",
|
|
18052
18060
|
"The checklist does not sign native installers, submit browser-store packages, execute high-risk desktop actions, or enable autonomous local app execution.",
|
|
18053
18061
|
"Full production claims remain blocked until every not-proven production gate has real validated external evidence."
|
|
18054
18062
|
],
|
|
@@ -18086,7 +18094,7 @@ function buildGuardianReleaseFlow(releaseVersion) {
|
|
|
18086
18094
|
},
|
|
18087
18095
|
{
|
|
18088
18096
|
id: "verify-secrets",
|
|
18089
|
-
label: "Verify npm
|
|
18097
|
+
label: "Verify npm Trusted Publisher setup or token fallback",
|
|
18090
18098
|
command: "guardian release secrets",
|
|
18091
18099
|
credentialRequired: false
|
|
18092
18100
|
},
|
|
@@ -18100,7 +18108,7 @@ function buildGuardianReleaseFlow(releaseVersion) {
|
|
|
18100
18108
|
id: "publish-dispatch",
|
|
18101
18109
|
label: "Run the guarded publish dispatch after dry-run evidence passes",
|
|
18102
18110
|
command: publishDispatch,
|
|
18103
|
-
credentialRequired:
|
|
18111
|
+
credentialRequired: false
|
|
18104
18112
|
},
|
|
18105
18113
|
{
|
|
18106
18114
|
id: "verify-public-release",
|
|
@@ -18136,7 +18144,8 @@ function buildGuardianReleaseFlow(releaseVersion) {
|
|
|
18136
18144
|
})),
|
|
18137
18145
|
boundaries: [
|
|
18138
18146
|
"This release flow is copy-paste operator guidance only; it is not release evidence or production-gate proof.",
|
|
18139
|
-
"Publish dispatch
|
|
18147
|
+
"Publish dispatch defaults to npm Trusted Publishing and must not print npm tokens, OTP values, or .npmrc contents.",
|
|
18148
|
+
"The token fallback route remains available with publish_auth=token and requires NPM_TOKEN in GitHub Actions repository secrets.",
|
|
18140
18149
|
"Run the dry-run dispatch before the guarded dry_run=false publish dispatch.",
|
|
18141
18150
|
"Public npm preview publication and local install smoke prove the CLI preview lane only.",
|
|
18142
18151
|
"Signed native installers, high-risk desktop action execution, and autonomous local app execution remain separate not-proven production gates until real external evidence is collected and validated."
|
|
@@ -18185,7 +18194,8 @@ function renderGuardianReleaseChecklist(result, flags) {
|
|
|
18185
18194
|
`Release: ${result.releaseVersion}`,
|
|
18186
18195
|
`Repository: ${result.repository}`,
|
|
18187
18196
|
`Status: ${result.status}`,
|
|
18188
|
-
|
|
18197
|
+
"Default npm publish setup: Trusted Publisher connection",
|
|
18198
|
+
`Fallback npm publish secret: ${result.tokenFallbackCredentialName}`,
|
|
18189
18199
|
"1. Secret setup:",
|
|
18190
18200
|
result.operatorCommands.secretSetup,
|
|
18191
18201
|
"2. Dry-run dispatch:",
|
|
@@ -23500,16 +23510,17 @@ function openUrlInDefaultBrowser(url2, options = {}) {
|
|
|
23500
23510
|
});
|
|
23501
23511
|
});
|
|
23502
23512
|
}
|
|
23503
|
-
var GUARDIAN_CLI_VERSION, GUARDIAN_PROFILE_SCHEMA_VERSION, GUARDIAN_NPM_PACKAGE_NAME, GUARDIAN_NPM_REGISTRY, GUARDIAN_GLOBAL_INSTALL_COMMAND, GUARDIAN_NPX_SETUP_COMMAND, GUARDIAN_FIRST_RUN_COMMAND, GUARDIAN_OPEN_CONTROL_TOWER_COMMAND, GUARDIAN_HALO_CHROME_EXTENSION_ID, GUARDIAN_HALO_CHROME_WEB_STORE_LISTING_URL, GUARDIAN_RELEASE_DISPATCH_WORKFLOW, GUARDIAN_RELEASE_REPOSITORY, GUARDIAN_CHROME_WEB_STORE_API_SECRET_NAMES, GUARDIAN_DEFAULT_CONTROL_TOWER_URL, GUARDIAN_LOCAL_DATA_ENCRYPTION_KEY_ENV, GUARDIAN_LOCAL_DATA_ENCRYPTION_KEY_ID_ENV, GUARDIAN_SQLITE_PAGE_ENCRYPTION_KEY_ENV, GUARDIAN_SQLITE_PAGE_ENCRYPTION_KEY_ID_ENV, GUARDIAN_DESKTOP_ADAPTER_SIMULATE_OPEN_ENV, GUARDIAN_DESKTOP_URL_OPEN_ADAPTER_ID, GUARDIAN_DESKTOP_URL_OPEN_ADAPTER_VERSION, GUARDIAN_DESKTOP_URL_OPEN_ADAPTER_PROOF_SCHEMA_VERSION, GUARDIAN_SERVICE_PROOF_SCHEMA_VERSION, GUARDIAN_OS_KEY_STORAGE_PROOF_SCHEMA_VERSION, GUARDIAN_WINDOWS_NATIVE_HOST_REGISTRY_PROOF_SCHEMA_VERSION, PERSONAL_FABRIC_CONTRACTS_SCHEMA_VERSION2, PROMPT_COACH_MODES, DEFAULT_PROMPT_COACH_DAILY_SOFT_CARD_LIMIT, GUARDIAN_PROMPT_CARD_OPTIONS_CATALOG, GUARDIAN_POSTURE_PROFILE_IDS, GUARDIAN_POSTURE_PROFILE_CATALOG, GUARDIAN_POLICY_PACK_MARKETPLACE_CATALOG, GUARDIAN_PROVIDER_IDS, GUARDIAN_SOURCE_TYPES, GUARDIAN_NOT_PROVEN_PRODUCTION_GATES, DEFAULT_POLICY_PACKS, GUARDIAN_BRIDGE_CONFIG_STORAGE_KEY, GUARDIAN_BRIDGE_TOKEN_STORAGE_KEY, GUARDIAN_BRIDGE_CONFIG_SCHEMA_VERSION, GUARDIAN_NATIVE_HOST_NAME, MCP_CLIENTS, NATIVE_HOST_BROWSERS, HELP_TEXT, ADVANCED_HELP_TEXT, normalizeGuardianPreferences, GUARDIAN_DATA_FILE_NAMES, GUARDIAN_DATA_DIR_NAMES, GUARDIAN_MIN_SUPPORTED_NODE_VERSION;
|
|
23513
|
+
var GUARDIAN_CLI_VERSION, GUARDIAN_PROFILE_SCHEMA_VERSION, GUARDIAN_NPM_PACKAGE_NAME, GUARDIAN_NPM_REGISTRY, GUARDIAN_DEFAULT_NPM_PUBLISH_AUTH, GUARDIAN_GLOBAL_INSTALL_COMMAND, GUARDIAN_NPX_SETUP_COMMAND, GUARDIAN_FIRST_RUN_COMMAND, GUARDIAN_OPEN_CONTROL_TOWER_COMMAND, GUARDIAN_HALO_CHROME_EXTENSION_ID, GUARDIAN_HALO_CHROME_WEB_STORE_LISTING_URL, GUARDIAN_RELEASE_DISPATCH_WORKFLOW, GUARDIAN_RELEASE_REPOSITORY, GUARDIAN_CHROME_WEB_STORE_API_SECRET_NAMES, GUARDIAN_DEFAULT_CONTROL_TOWER_URL, GUARDIAN_LOCAL_DATA_ENCRYPTION_KEY_ENV, GUARDIAN_LOCAL_DATA_ENCRYPTION_KEY_ID_ENV, GUARDIAN_SQLITE_PAGE_ENCRYPTION_KEY_ENV, GUARDIAN_SQLITE_PAGE_ENCRYPTION_KEY_ID_ENV, GUARDIAN_DESKTOP_ADAPTER_SIMULATE_OPEN_ENV, GUARDIAN_DESKTOP_URL_OPEN_ADAPTER_ID, GUARDIAN_DESKTOP_URL_OPEN_ADAPTER_VERSION, GUARDIAN_DESKTOP_URL_OPEN_ADAPTER_PROOF_SCHEMA_VERSION, GUARDIAN_SERVICE_PROOF_SCHEMA_VERSION, GUARDIAN_OS_KEY_STORAGE_PROOF_SCHEMA_VERSION, GUARDIAN_WINDOWS_NATIVE_HOST_REGISTRY_PROOF_SCHEMA_VERSION, PERSONAL_FABRIC_CONTRACTS_SCHEMA_VERSION2, PROMPT_COACH_MODES, DEFAULT_PROMPT_COACH_DAILY_SOFT_CARD_LIMIT, GUARDIAN_PROMPT_CARD_OPTIONS_CATALOG, GUARDIAN_POSTURE_PROFILE_IDS, GUARDIAN_POSTURE_PROFILE_CATALOG, GUARDIAN_POLICY_PACK_MARKETPLACE_CATALOG, GUARDIAN_PROVIDER_IDS, GUARDIAN_SOURCE_TYPES, GUARDIAN_NOT_PROVEN_PRODUCTION_GATES, DEFAULT_POLICY_PACKS, GUARDIAN_BRIDGE_CONFIG_STORAGE_KEY, GUARDIAN_BRIDGE_TOKEN_STORAGE_KEY, GUARDIAN_BRIDGE_CONFIG_SCHEMA_VERSION, GUARDIAN_NATIVE_HOST_NAME, MCP_CLIENTS, NATIVE_HOST_BROWSERS, HELP_TEXT, ADVANCED_HELP_TEXT, normalizeGuardianPreferences, GUARDIAN_DATA_FILE_NAMES, GUARDIAN_DATA_DIR_NAMES, GUARDIAN_MIN_SUPPORTED_NODE_VERSION;
|
|
23504
23514
|
var init_runtime = __esm({
|
|
23505
23515
|
"packages/guardian-cli/src/runtime.ts"() {
|
|
23506
23516
|
"use strict";
|
|
23507
23517
|
init_src();
|
|
23508
23518
|
init_src2();
|
|
23509
|
-
GUARDIAN_CLI_VERSION = "0.1.
|
|
23519
|
+
GUARDIAN_CLI_VERSION = "0.1.10";
|
|
23510
23520
|
GUARDIAN_PROFILE_SCHEMA_VERSION = "contextecf/project-guardian-profile/v1";
|
|
23511
23521
|
GUARDIAN_NPM_PACKAGE_NAME = "@contextecf/guardian-cli";
|
|
23512
23522
|
GUARDIAN_NPM_REGISTRY = "https://registry.npmjs.org/";
|
|
23523
|
+
GUARDIAN_DEFAULT_NPM_PUBLISH_AUTH = "trusted_publisher";
|
|
23513
23524
|
GUARDIAN_GLOBAL_INSTALL_COMMAND = `npm install -g ${GUARDIAN_NPM_PACKAGE_NAME}`;
|
|
23514
23525
|
GUARDIAN_NPX_SETUP_COMMAND = `npx ${GUARDIAN_NPM_PACKAGE_NAME}@latest setup`;
|
|
23515
23526
|
GUARDIAN_FIRST_RUN_COMMAND = "guardian setup";
|
|
@@ -24515,7 +24526,7 @@ function detectRisk(promptManifest, policyPacks) {
|
|
|
24515
24526
|
risks.add("healthcare_data");
|
|
24516
24527
|
matchedPolicyRefs.push("guardian:builtin:healthcare-data");
|
|
24517
24528
|
}
|
|
24518
|
-
if (
|
|
24529
|
+
if (containsSensitiveWorkData(prompt)) {
|
|
24519
24530
|
risks.add("work_data");
|
|
24520
24531
|
matchedPolicyRefs.push("guardian:builtin:work-data");
|
|
24521
24532
|
}
|
|
@@ -24527,7 +24538,7 @@ function detectRisk(promptManifest, policyPacks) {
|
|
|
24527
24538
|
risks.add("destructive_action");
|
|
24528
24539
|
matchedPolicyRefs.push("guardian:builtin:destructive-action");
|
|
24529
24540
|
}
|
|
24530
|
-
if (promptManifest
|
|
24541
|
+
if (shouldOfferContextHelp(promptManifest, policyPacks)) {
|
|
24531
24542
|
risks.add("insufficient_context");
|
|
24532
24543
|
matchedPolicyRefs.push("guardian:builtin:context-sufficiency");
|
|
24533
24544
|
}
|
|
@@ -24854,6 +24865,19 @@ function containsFullSsn(prompt) {
|
|
|
24854
24865
|
SSN_PATTERN.lastIndex = 0;
|
|
24855
24866
|
return SSN_PATTERN.test(prompt);
|
|
24856
24867
|
}
|
|
24868
|
+
function containsSensitiveWorkData(prompt) {
|
|
24869
|
+
return WORK_SENSITIVE_PATTERN.test(prompt) || WORK_ENTITY_CONTEXT_PATTERN.test(prompt) || WORK_CONTEXT_ENTITY_PATTERN.test(prompt);
|
|
24870
|
+
}
|
|
24871
|
+
function shouldOfferContextHelp(promptManifest, policyPacks) {
|
|
24872
|
+
if (promptManifest.source_permissions_snapshot.length > 0) {
|
|
24873
|
+
return false;
|
|
24874
|
+
}
|
|
24875
|
+
if (effectivePromptCoachMode(policyPacks) !== "hands_on") {
|
|
24876
|
+
return false;
|
|
24877
|
+
}
|
|
24878
|
+
const prompt = promptManifest.prompt_text;
|
|
24879
|
+
return CONTEXT_HELP_ACTION_PATTERN.test(prompt) && CONTEXT_HELP_REFERENCE_PATTERN.test(prompt);
|
|
24880
|
+
}
|
|
24857
24881
|
function hasFullSsnRisk(policyRefs) {
|
|
24858
24882
|
return policyRefs.includes("guardian:builtin:ssn-full-value");
|
|
24859
24883
|
}
|
|
@@ -24952,7 +24976,7 @@ function digest2(value) {
|
|
|
24952
24976
|
function isPresent(value) {
|
|
24953
24977
|
return value !== void 0;
|
|
24954
24978
|
}
|
|
24955
|
-
var DEFAULT_RISK_THRESHOLDS, POLICY_PACK_PRESET_VERSION, HIGH_RISK_TERMS, SECRET_PATTERNS, EMAIL_PATTERN, SSN_PATTERN, SSN_CONTEXT_PATTERN, FINANCIAL_PATTERN, HEALTHCARE_PATTERN,
|
|
24979
|
+
var DEFAULT_RISK_THRESHOLDS, POLICY_PACK_PRESET_VERSION, HIGH_RISK_TERMS, SECRET_PATTERNS, EMAIL_PATTERN, SSN_PATTERN, SSN_CONTEXT_PATTERN, FINANCIAL_PATTERN, HEALTHCARE_PATTERN, WORK_SENSITIVE_PATTERN, WORK_ENTITY_CONTEXT_PATTERN, WORK_CONTEXT_ENTITY_PATTERN, PROMPT_INJECTION_PATTERN, CONTEXT_HELP_ACTION_PATTERN, CONTEXT_HELP_REFERENCE_PATTERN, GUARDIAN_POLICY_PACK_PRESETS;
|
|
24956
24980
|
var init_src3 = __esm({
|
|
24957
24981
|
"packages/personal-fabric-runtime/src/index.ts"() {
|
|
24958
24982
|
"use strict";
|
|
@@ -24977,8 +25001,12 @@ var init_src3 = __esm({
|
|
|
24977
25001
|
SSN_CONTEXT_PATTERN = /\b(ssn|social security(?: number)?)\b/i;
|
|
24978
25002
|
FINANCIAL_PATTERN = /\b(bank|wire|routing number|account number|payroll|invoice|revenue|forecast|contract value|credit card)\b/i;
|
|
24979
25003
|
HEALTHCARE_PATTERN = /\b(patient|diagnosis|medication|hipaa|medical record|prescription|clinical)\b/i;
|
|
24980
|
-
|
|
25004
|
+
WORK_SENSITIVE_PATTERN = /\b(confidential|internal|non[-\s]?public|private|proprietary|salesforce|pipeline|renewal)\b/i;
|
|
25005
|
+
WORK_ENTITY_CONTEXT_PATTERN = /\b(?:client|customer|employee|vendor|partner)\b[\s\S]{0,80}\b(?:contract|account|record|data|list|pricing|renewal|pipeline|payroll|confidential|private|proprietary)\b/i;
|
|
25006
|
+
WORK_CONTEXT_ENTITY_PATTERN = /\b(?:contract|account|record|data|list|pricing|renewal|pipeline|payroll|confidential|private|proprietary)\b[\s\S]{0,80}\b(?:client|customer|employee|vendor|partner)\b/i;
|
|
24981
25007
|
PROMPT_INJECTION_PATTERN = /\b(ignore previous instructions|system prompt|developer message|jailbreak|exfiltrate|bypass policy|reveal hidden)\b/i;
|
|
25008
|
+
CONTEXT_HELP_ACTION_PATTERN = /\b(summarize|summarise|analyze|analyse|review|compare|extract|rewrite|improve|turn|convert|update)\b/i;
|
|
25009
|
+
CONTEXT_HELP_REFERENCE_PATTERN = /\b(this|that|these|those|attached|uploaded|latest version|current version|file|document|deck|slide|email|thread|conversation|transcript|meeting|pdf)\b/i;
|
|
24982
25010
|
GUARDIAN_POLICY_PACK_PRESETS = [
|
|
24983
25011
|
createPolicyPackPreset({
|
|
24984
25012
|
pack_id: "privacy-first",
|
|
@@ -26630,8 +26658,12 @@ async function handleRequest(input2) {
|
|
|
26630
26658
|
}
|
|
26631
26659
|
if (input2.request.method === "GET" && activityUrl?.pathname === "/v1/guardian/activity") {
|
|
26632
26660
|
const filter = parseActivityFilter(activityUrl.searchParams.get("filter") ?? "all");
|
|
26633
|
-
const receipts =
|
|
26634
|
-
|
|
26661
|
+
const [receipts, searchGraph] = await Promise.all([
|
|
26662
|
+
input2.store.listReceipts(),
|
|
26663
|
+
input2.store.searchGraph({ limit: 100 })
|
|
26664
|
+
]);
|
|
26665
|
+
const recentReceipts = receipts.slice().sort((left, right) => right.created_at.localeCompare(left.created_at)).slice(0, CONTROL_TOWER_RECEIPT_LIMIT);
|
|
26666
|
+
const result2 = processGuardianControlTowerActivityRequest(recentReceipts, filter, searchGraph);
|
|
26635
26667
|
writeJson(input2.response, result2.statusCode, result2.body);
|
|
26636
26668
|
return;
|
|
26637
26669
|
}
|
|
@@ -26864,7 +26896,7 @@ function processGuardianDaemonHealthRequest(input2) {
|
|
|
26864
26896
|
}
|
|
26865
26897
|
};
|
|
26866
26898
|
}
|
|
26867
|
-
function processGuardianControlTowerActivityRequest(receipts, filterValue) {
|
|
26899
|
+
function processGuardianControlTowerActivityRequest(receipts, filterValue, searchGraph = { nodes: [], edges: [] }) {
|
|
26868
26900
|
const filter = parseActivityFilter(filterValue);
|
|
26869
26901
|
return {
|
|
26870
26902
|
statusCode: 200,
|
|
@@ -26874,7 +26906,7 @@ function processGuardianControlTowerActivityRequest(receipts, filterValue) {
|
|
|
26874
26906
|
filter,
|
|
26875
26907
|
raw_content_included: false,
|
|
26876
26908
|
token_printed: false,
|
|
26877
|
-
activities: buildActivityItems(receipts, filter)
|
|
26909
|
+
activities: buildActivityItems(receipts, filter, searchGraph)
|
|
26878
26910
|
}
|
|
26879
26911
|
};
|
|
26880
26912
|
}
|
|
@@ -28729,7 +28761,7 @@ function renderControlTowerStatusPage(profile, receipts = [], searchGraph = { no
|
|
|
28729
28761
|
<div class="metric-detail">${escapeHtml(metric.detail)}</div>
|
|
28730
28762
|
</article>`
|
|
28731
28763
|
).join("\n");
|
|
28732
|
-
const activityFeedHtml = renderActivityFeed(recentReceipts);
|
|
28764
|
+
const activityFeedHtml = renderActivityFeed(recentReceipts, searchGraph);
|
|
28733
28765
|
const postureCardsHtml = GUARDIAN_POSTURE_PROFILE_CATALOG.map((postureProfile) => {
|
|
28734
28766
|
const selected = profile.posture_profile.selected === postureProfile.id;
|
|
28735
28767
|
const icon = postureProfile.id === "calm" ? "☾" : postureProfile.id === "balanced" ? "⚖" : postureProfile.id === "guided" ? "🎓" : postureProfile.id === "high_assurance" ? "🔒" : "⚙";
|
|
@@ -29898,7 +29930,7 @@ ${adminPanelsHtml}
|
|
|
29898
29930
|
time.setAttribute('data-guardian-local-time', '');
|
|
29899
29931
|
time.textContent = formatLocalTime(activity.created_at);
|
|
29900
29932
|
time.title = 'Your local time: ' + formatAbsoluteLocalTime(activity.created_at) + ' \xB7 Stored by Guardian as ' + activity.created_at;
|
|
29901
|
-
meta.append(time, ' \xB7 ' + (activity.receipt_type || 'receipt'));
|
|
29933
|
+
meta.append(time, ' \xB7 ' + (activity.meta_detail || activity.receipt_type || 'receipt'));
|
|
29902
29934
|
} else {
|
|
29903
29935
|
meta.textContent = activity.meta;
|
|
29904
29936
|
}
|
|
@@ -30434,7 +30466,7 @@ function renderReceiptRows(receipts) {
|
|
|
30434
30466
|
}
|
|
30435
30467
|
return receipts.map((receipt) => renderReceiptRow(receipt)).join("\n");
|
|
30436
30468
|
}
|
|
30437
|
-
function renderActivityFeed(receipts) {
|
|
30469
|
+
function renderActivityFeed(receipts, searchGraph = { nodes: [], edges: [] }) {
|
|
30438
30470
|
if (receipts.length === 0) {
|
|
30439
30471
|
return ` <article class="activity-card allow" data-activity-state="allowed">
|
|
30440
30472
|
<div class="activity-icon">✅</div>
|
|
@@ -30445,7 +30477,8 @@ function renderActivityFeed(receipts) {
|
|
|
30445
30477
|
<div class="activity-badge allow">READY</div>
|
|
30446
30478
|
</article>`;
|
|
30447
30479
|
}
|
|
30448
|
-
|
|
30480
|
+
const attribution = buildActivityAttributionIndex(searchGraph);
|
|
30481
|
+
return receipts.map((receipt) => renderActivityCard(receipt, attribution)).join("\n");
|
|
30449
30482
|
}
|
|
30450
30483
|
function parseActivityFilter(value) {
|
|
30451
30484
|
if (value === "blocked" || value === "flagged" || value === "allowed") {
|
|
@@ -30453,35 +30486,146 @@ function parseActivityFilter(value) {
|
|
|
30453
30486
|
}
|
|
30454
30487
|
return "all";
|
|
30455
30488
|
}
|
|
30456
|
-
function buildActivityItems(receipts, filter) {
|
|
30489
|
+
function buildActivityItems(receipts, filter, searchGraph = { nodes: [], edges: [] }) {
|
|
30490
|
+
const attribution = buildActivityAttributionIndex(searchGraph);
|
|
30457
30491
|
return receipts.filter((receipt) => {
|
|
30458
30492
|
const group = activityFilterGroup(receipt.disposition);
|
|
30459
30493
|
return filter === "all" || group === filter;
|
|
30460
|
-
}).map((receipt) =>
|
|
30461
|
-
|
|
30462
|
-
|
|
30463
|
-
|
|
30464
|
-
|
|
30465
|
-
|
|
30466
|
-
|
|
30467
|
-
|
|
30468
|
-
|
|
30469
|
-
|
|
30470
|
-
|
|
30471
|
-
|
|
30494
|
+
}).map((receipt) => {
|
|
30495
|
+
const detail = activityDetailForReceipt(receipt, attribution);
|
|
30496
|
+
return {
|
|
30497
|
+
id: receipt.receipt_id,
|
|
30498
|
+
state: activityFilterGroup(receipt.disposition),
|
|
30499
|
+
tone: activityTone(receipt.disposition),
|
|
30500
|
+
icon: activityPlainIcon(receipt.disposition),
|
|
30501
|
+
title: receipt.summary,
|
|
30502
|
+
created_at: receipt.created_at,
|
|
30503
|
+
receipt_type: receipt.receipt_type,
|
|
30504
|
+
source_label: detail.surfaceLabel,
|
|
30505
|
+
provider_label: detail.providerLabel,
|
|
30506
|
+
meta_detail: detail.metaDetail,
|
|
30507
|
+
meta: `${formatActivityTime(receipt.created_at)} \xB7 ${detail.metaDetail}`,
|
|
30508
|
+
label: activityLabel(receipt.disposition),
|
|
30509
|
+
raw_content_included: false
|
|
30510
|
+
};
|
|
30511
|
+
});
|
|
30472
30512
|
}
|
|
30473
|
-
function renderActivityCard(receipt) {
|
|
30513
|
+
function renderActivityCard(receipt, attribution = /* @__PURE__ */ new Map()) {
|
|
30474
30514
|
const tone = activityTone(receipt.disposition);
|
|
30475
30515
|
const filterGroup = activityFilterGroup(receipt.disposition);
|
|
30516
|
+
const detail = activityDetailForReceipt(receipt, attribution);
|
|
30476
30517
|
return ` <article class="activity-card ${tone}" data-activity-state="${escapeHtml(filterGroup)}">
|
|
30477
30518
|
<div class="activity-icon">${activityIcon(receipt.disposition)}</div>
|
|
30478
30519
|
<div>
|
|
30479
30520
|
<div class="activity-title">${escapeHtml(receipt.summary)}</div>
|
|
30480
|
-
<div class="activity-meta">${renderLocalTime(receipt.created_at)} \xB7 ${escapeHtml(
|
|
30521
|
+
<div class="activity-meta">${renderLocalTime(receipt.created_at)} \xB7 ${escapeHtml(detail.metaDetail)}</div>
|
|
30481
30522
|
</div>
|
|
30482
30523
|
<div class="activity-badge ${tone}">${escapeHtml(activityLabel(receipt.disposition))}</div>
|
|
30483
30524
|
</article>`;
|
|
30484
30525
|
}
|
|
30526
|
+
function buildActivityAttributionIndex(searchGraph) {
|
|
30527
|
+
const index = /* @__PURE__ */ new Map();
|
|
30528
|
+
for (const node of searchGraph.nodes) {
|
|
30529
|
+
if (node.node_type !== "prompt" || !node.summary) {
|
|
30530
|
+
continue;
|
|
30531
|
+
}
|
|
30532
|
+
const attribution = parsePromptNodeAttribution(node.summary);
|
|
30533
|
+
if (!attribution) {
|
|
30534
|
+
continue;
|
|
30535
|
+
}
|
|
30536
|
+
for (const evidenceRef of node.evidence_refs) {
|
|
30537
|
+
if (evidenceRef.startsWith("receipt:")) {
|
|
30538
|
+
index.set(evidenceRef, attribution);
|
|
30539
|
+
}
|
|
30540
|
+
}
|
|
30541
|
+
}
|
|
30542
|
+
return index;
|
|
30543
|
+
}
|
|
30544
|
+
function parsePromptNodeAttribution(summary) {
|
|
30545
|
+
const match = /^Prompt sent from ([a-z_]+) to ([a-z_]+)\.$/.exec(summary.trim());
|
|
30546
|
+
if (!match) {
|
|
30547
|
+
return null;
|
|
30548
|
+
}
|
|
30549
|
+
return {
|
|
30550
|
+
surfaceLabel: friendlySurfaceLabel(match[1]),
|
|
30551
|
+
providerLabel: friendlyProviderLabel(match[2])
|
|
30552
|
+
};
|
|
30553
|
+
}
|
|
30554
|
+
function activityDetailForReceipt(receipt, attribution) {
|
|
30555
|
+
const graphAttribution = attribution.get(receipt.receipt_id);
|
|
30556
|
+
const surfaceLabel = graphAttribution?.surfaceLabel ?? (receipt.policy_basis.some((basis) => basis.includes("guardian:mcp:")) ? "MCP" : void 0);
|
|
30557
|
+
const providerLabel = graphAttribution?.providerLabel;
|
|
30558
|
+
const parts = [
|
|
30559
|
+
surfaceLabel,
|
|
30560
|
+
providerLabel,
|
|
30561
|
+
friendlyReceiptTypeLabel(receipt.receipt_type)
|
|
30562
|
+
].filter((part) => Boolean(part));
|
|
30563
|
+
return {
|
|
30564
|
+
surfaceLabel,
|
|
30565
|
+
providerLabel,
|
|
30566
|
+
metaDetail: parts.join(" \xB7 ") || friendlyReceiptTypeLabel(receipt.receipt_type)
|
|
30567
|
+
};
|
|
30568
|
+
}
|
|
30569
|
+
function friendlySurfaceLabel(surface) {
|
|
30570
|
+
switch (surface) {
|
|
30571
|
+
case "browser":
|
|
30572
|
+
return "Browser";
|
|
30573
|
+
case "mcp":
|
|
30574
|
+
return "MCP";
|
|
30575
|
+
case "ide":
|
|
30576
|
+
return "IDE";
|
|
30577
|
+
case "cli":
|
|
30578
|
+
return "CLI";
|
|
30579
|
+
case "desktop":
|
|
30580
|
+
return "Desktop app";
|
|
30581
|
+
case "rest":
|
|
30582
|
+
return "API";
|
|
30583
|
+
case "voice":
|
|
30584
|
+
return "Voice";
|
|
30585
|
+
default:
|
|
30586
|
+
return void 0;
|
|
30587
|
+
}
|
|
30588
|
+
}
|
|
30589
|
+
function friendlyProviderLabel(provider) {
|
|
30590
|
+
switch (provider) {
|
|
30591
|
+
case "chatgpt":
|
|
30592
|
+
return "ChatGPT";
|
|
30593
|
+
case "claude":
|
|
30594
|
+
return "Claude";
|
|
30595
|
+
case "gemini":
|
|
30596
|
+
return "Gemini";
|
|
30597
|
+
case "perplexity":
|
|
30598
|
+
return "Perplexity";
|
|
30599
|
+
case "cursor":
|
|
30600
|
+
return "Cursor";
|
|
30601
|
+
case "windsurf":
|
|
30602
|
+
return "Windsurf";
|
|
30603
|
+
case "openrouter":
|
|
30604
|
+
return "OpenRouter";
|
|
30605
|
+
case "local_model":
|
|
30606
|
+
return "Local AI";
|
|
30607
|
+
case "unknown":
|
|
30608
|
+
return void 0;
|
|
30609
|
+
default:
|
|
30610
|
+
return provider ? provider.split(/[_-]+/g).filter(Boolean).map((part) => part[0]?.toUpperCase() + part.slice(1)).join(" ") : void 0;
|
|
30611
|
+
}
|
|
30612
|
+
}
|
|
30613
|
+
function friendlyReceiptTypeLabel(receiptType) {
|
|
30614
|
+
switch (receiptType) {
|
|
30615
|
+
case "prompt":
|
|
30616
|
+
return "Prompt check";
|
|
30617
|
+
case "policy":
|
|
30618
|
+
return "Policy receipt";
|
|
30619
|
+
case "context":
|
|
30620
|
+
return "Context receipt";
|
|
30621
|
+
case "local_action":
|
|
30622
|
+
return "Local action";
|
|
30623
|
+
case "learning":
|
|
30624
|
+
return "Learning receipt";
|
|
30625
|
+
case "output":
|
|
30626
|
+
return "Output check";
|
|
30627
|
+
}
|
|
30628
|
+
}
|
|
30485
30629
|
function renderReceiptRow(receipt) {
|
|
30486
30630
|
const policyBasis = receipt.policy_basis.length > 0 ? receipt.policy_basis.join(", ") : "none recorded";
|
|
30487
30631
|
return ` <tr class="receipt-row" data-receipt-row data-receipt-id="${escapeHtml(receipt.receipt_id)}"><th scope="row"><code>${escapeHtml(receipt.receipt_id)}</code></th><td>${escapeHtml(receipt.receipt_type)}</td><td>${escapeHtml(receipt.disposition)}</td><td><details><summary>${escapeHtml(receipt.summary)}</summary><dl><dt>Transaction</dt><dd><code>${escapeHtml(receipt.transaction_id)}</code></dd><dt>Created</dt><dd>${renderLocalTime(receipt.created_at)}</dd><dt>Policy basis</dt><dd>${escapeHtml(policyBasis)}</dd><dt>Receipt hash</dt><dd><code>${escapeHtml(receipt.receipt_hash)}</code></dd><dt>Raw content</dt><dd>${receipt.raw_content_included ? "included" : "metadata-only"}</dd></dl></details></td></tr>`;
|
|
@@ -16275,10 +16275,11 @@ function cloneList(values) {
|
|
|
16275
16275
|
}
|
|
16276
16276
|
|
|
16277
16277
|
// packages/guardian-cli/src/runtime.ts
|
|
16278
|
-
var GUARDIAN_CLI_VERSION = "0.1.
|
|
16278
|
+
var GUARDIAN_CLI_VERSION = "0.1.10";
|
|
16279
16279
|
var GUARDIAN_PROFILE_SCHEMA_VERSION = "contextecf/project-guardian-profile/v1";
|
|
16280
16280
|
var GUARDIAN_NPM_PACKAGE_NAME = "@contextecf/guardian-cli";
|
|
16281
16281
|
var GUARDIAN_NPM_REGISTRY = "https://registry.npmjs.org/";
|
|
16282
|
+
var GUARDIAN_DEFAULT_NPM_PUBLISH_AUTH = "trusted_publisher";
|
|
16282
16283
|
var GUARDIAN_GLOBAL_INSTALL_COMMAND = `npm install -g ${GUARDIAN_NPM_PACKAGE_NAME}`;
|
|
16283
16284
|
var GUARDIAN_NPX_SETUP_COMMAND = `npx ${GUARDIAN_NPM_PACKAGE_NAME}@latest setup`;
|
|
16284
16285
|
var GUARDIAN_FIRST_RUN_COMMAND = "guardian setup";
|
|
@@ -17612,14 +17613,16 @@ function buildGuardianDistributionReadiness(npmPreviewReady) {
|
|
|
17612
17613
|
workflow: GUARDIAN_RELEASE_DISPATCH_WORKFLOW,
|
|
17613
17614
|
dryRunCommand: buildGuardianReleaseDispatchCommand(true),
|
|
17614
17615
|
publishCommand: buildGuardianReleaseDispatchCommand(false),
|
|
17615
|
-
|
|
17616
|
+
defaultPublishAuth: GUARDIAN_DEFAULT_NPM_PUBLISH_AUTH,
|
|
17617
|
+
tokenFallbackCredentialName: "NPM_TOKEN",
|
|
17616
17618
|
channels: ["all", "npm", "browser", "evidence"],
|
|
17617
17619
|
defaultDockerSmoke: true,
|
|
17618
17620
|
provenance: "github_actions_oidc_supported",
|
|
17619
17621
|
status: npmPreviewReady ? "ready_for_dispatch_after_preview_evidence" : "blocked_until_preview_release_evidence_passes",
|
|
17620
17622
|
boundaries: [
|
|
17621
17623
|
"Use dry_run=true before public publication.",
|
|
17622
|
-
"dry_run=false
|
|
17624
|
+
"dry_run=false defaults to npm Trusted Publishing and must not print npm tokens, OTP values, or .npmrc contents.",
|
|
17625
|
+
"The token fallback route remains available with publish_auth=token and requires the repository secret NPM_TOKEN.",
|
|
17623
17626
|
"The workflow can publish the npm preview package, upload evidence, submit future Chrome Web Store updates for review when browser_store_publish=api, and run public install smokes; it does not sign native installers or prove future browser-store approval.",
|
|
17624
17627
|
"GitHub Actions OIDC/provenance applies to CI release context; manual local publishes are recorded separately and should not claim CI provenance."
|
|
17625
17628
|
]
|
|
@@ -17641,7 +17644,7 @@ function buildGuardianReleaseDispatchCommand(dryRun) {
|
|
|
17641
17644
|
});
|
|
17642
17645
|
}
|
|
17643
17646
|
function buildGuardianReleaseDispatchCommandFor(input) {
|
|
17644
|
-
const publishAuth = input.publishAuth ??
|
|
17647
|
+
const publishAuth = input.publishAuth ?? GUARDIAN_DEFAULT_NPM_PUBLISH_AUTH;
|
|
17645
17648
|
const browserStorePublish = input.browserStorePublish ?? "manual";
|
|
17646
17649
|
return [
|
|
17647
17650
|
`gh workflow run ${GUARDIAN_RELEASE_DISPATCH_WORKFLOW} \\`,
|
|
@@ -17757,7 +17760,7 @@ async function runReleaseCommand(argv, flags, options) {
|
|
|
17757
17760
|
}
|
|
17758
17761
|
const dryRun = flags.has("publish") ? false : booleanFlag(flags, "dry-run", true);
|
|
17759
17762
|
const runDockerSmoke = booleanFlag(flags, "run-docker-smoke", true);
|
|
17760
|
-
const publishAuth = stringFlag(flags, "publish-auth") ??
|
|
17763
|
+
const publishAuth = stringFlag(flags, "publish-auth") ?? GUARDIAN_DEFAULT_NPM_PUBLISH_AUTH;
|
|
17761
17764
|
if (!isValidReleasePublishAuth(publishAuth)) {
|
|
17762
17765
|
write(stderr, "Invalid --publish-auth. Expected one of: token, trusted_publisher.\n");
|
|
17763
17766
|
return 1;
|
|
@@ -17885,7 +17888,7 @@ function renderGuardianReleaseDispatchCommand(result, flags) {
|
|
|
17885
17888
|
`Docker smoke: ${result.runDockerSmoke ? "yes" : "no"}`,
|
|
17886
17889
|
`Publish auth: ${result.publishAuth}`,
|
|
17887
17890
|
`Browser store publish: ${result.browserStorePublish}`,
|
|
17888
|
-
result.requiredPublishCredentialName ? `Required repository secret: ${result.requiredPublishCredentialName}` : "Required repository secret: not needed for dry run",
|
|
17891
|
+
result.requiredPublishCredentialName ? `Required repository secret: ${result.requiredPublishCredentialName}` : result.publishAuth === "trusted_publisher" && !result.dryRun ? "Required npm setup: Trusted Publisher connection" : "Required repository secret: not needed for dry run",
|
|
17889
17892
|
result.requiredBrowserStoreCredentialNames ? `Required browser-store secrets: ${result.requiredBrowserStoreCredentialNames.join(", ")}` : "Required browser-store secrets: not needed for manual browser handoff",
|
|
17890
17893
|
"Command:",
|
|
17891
17894
|
result.command,
|
|
@@ -17994,7 +17997,9 @@ function buildGuardianReleaseSecretSetup() {
|
|
|
17994
17997
|
schema_version: "contextecf/project-guardian-release-secret-setup/v1",
|
|
17995
17998
|
cli_version: GUARDIAN_CLI_VERSION,
|
|
17996
17999
|
repository: GUARDIAN_RELEASE_REPOSITORY,
|
|
17997
|
-
|
|
18000
|
+
defaultPublishAuth: GUARDIAN_DEFAULT_NPM_PUBLISH_AUTH,
|
|
18001
|
+
requiredForPublish: "npm_trusted_publisher_connection",
|
|
18002
|
+
tokenFallbackCredentialName: "NPM_TOKEN",
|
|
17998
18003
|
requiredForBrowserStoreApi: GUARDIAN_CHROME_WEB_STORE_API_SECRET_NAMES,
|
|
17999
18004
|
githubActionsSecretUrl: `https://github.com/${GUARDIAN_RELEASE_REPOSITORY}/settings/secrets/actions/new`,
|
|
18000
18005
|
commands: {
|
|
@@ -18028,10 +18033,11 @@ function buildGuardianReleaseSecretSetup() {
|
|
|
18028
18033
|
})
|
|
18029
18034
|
},
|
|
18030
18035
|
boundaries: [
|
|
18031
|
-
"
|
|
18036
|
+
"npm Trusted Publishing is the default Guardian release path and uses this GitHub Actions workflow identity.",
|
|
18037
|
+
"NPM_TOKEN is a fallback credential only; when used, it belongs only in GitHub Actions repository secrets for guarded dry_run=false npm publication.",
|
|
18032
18038
|
"Chrome Web Store API OAuth values belong only in GitHub Actions repository secrets for guarded browser_store_publish=api upload/submission.",
|
|
18033
18039
|
"Do not paste npm tokens, OTP values, .npmrc contents, signing keys, browser-store credentials, raw prompts, raw responses, private policy packs, or customer content into chat, PR bodies, release evidence, or CLI output.",
|
|
18034
|
-
"Use dry_run=true before dry_run=false; dry-run dispatch does not require
|
|
18040
|
+
"Use dry_run=true before dry_run=false; dry-run dispatch does not require npm publish credentials.",
|
|
18035
18041
|
"Adding NPM_TOKEN enables the npm preview publish lane only; it does not close signed-installer, browser-store, high-risk desktop, or autonomous app production gates.",
|
|
18036
18042
|
"Chrome Web Store API secrets enable browser update upload/submission only; official review approval evidence is still required for production browser-store claims."
|
|
18037
18043
|
],
|
|
@@ -18047,7 +18053,8 @@ function renderGuardianReleaseSecretSetup(result, flags) {
|
|
|
18047
18053
|
return `${[
|
|
18048
18054
|
"Project Guardian Release Secret Setup",
|
|
18049
18055
|
`Repository: ${result.repository}`,
|
|
18050
|
-
|
|
18056
|
+
"Default npm publish setup: Trusted Publisher connection",
|
|
18057
|
+
`Fallback npm publish secret: ${result.tokenFallbackCredentialName}`,
|
|
18051
18058
|
`Required for Chrome Web Store API: ${result.requiredForBrowserStoreApi.join(", ")}`,
|
|
18052
18059
|
`GitHub Actions secret page: ${result.githubActionsSecretUrl}`,
|
|
18053
18060
|
"NPM publish secret:",
|
|
@@ -18098,7 +18105,8 @@ function buildGuardianReleaseChecklist(releaseVersion) {
|
|
|
18098
18105
|
browserStoreHandoff: "guardian release browser-store",
|
|
18099
18106
|
readiness: "guardian readiness"
|
|
18100
18107
|
},
|
|
18101
|
-
|
|
18108
|
+
defaultPublishAuth: GUARDIAN_DEFAULT_NPM_PUBLISH_AUTH,
|
|
18109
|
+
tokenFallbackCredentialName: "NPM_TOKEN",
|
|
18102
18110
|
evidenceOutputs: [
|
|
18103
18111
|
"release/evidence/guardian-release-dispatch-summary.json",
|
|
18104
18112
|
"release/evidence/guardian-npm-publish-execution-summary.json",
|
|
@@ -18115,7 +18123,8 @@ function buildGuardianReleaseChecklist(releaseVersion) {
|
|
|
18115
18123
|
boundaries: [
|
|
18116
18124
|
"This checklist is an operator command surface for Guardian preview releases; it is not production-gate proof.",
|
|
18117
18125
|
"Run the dry-run dispatch before any dry_run=false publish dispatch.",
|
|
18118
|
-
"dry_run=false
|
|
18126
|
+
"dry_run=false defaults to npm Trusted Publishing and must not print npm tokens, OTP values, or .npmrc contents.",
|
|
18127
|
+
"The token fallback route remains available with publish_auth=token and requires NPM_TOKEN in GitHub Actions repository secrets.",
|
|
18119
18128
|
"The checklist does not sign native installers, submit browser-store packages, execute high-risk desktop actions, or enable autonomous local app execution.",
|
|
18120
18129
|
"Full production claims remain blocked until every not-proven production gate has real validated external evidence."
|
|
18121
18130
|
],
|
|
@@ -18153,7 +18162,7 @@ function buildGuardianReleaseFlow(releaseVersion) {
|
|
|
18153
18162
|
},
|
|
18154
18163
|
{
|
|
18155
18164
|
id: "verify-secrets",
|
|
18156
|
-
label: "Verify npm
|
|
18165
|
+
label: "Verify npm Trusted Publisher setup or token fallback",
|
|
18157
18166
|
command: "guardian release secrets",
|
|
18158
18167
|
credentialRequired: false
|
|
18159
18168
|
},
|
|
@@ -18167,7 +18176,7 @@ function buildGuardianReleaseFlow(releaseVersion) {
|
|
|
18167
18176
|
id: "publish-dispatch",
|
|
18168
18177
|
label: "Run the guarded publish dispatch after dry-run evidence passes",
|
|
18169
18178
|
command: publishDispatch,
|
|
18170
|
-
credentialRequired:
|
|
18179
|
+
credentialRequired: false
|
|
18171
18180
|
},
|
|
18172
18181
|
{
|
|
18173
18182
|
id: "verify-public-release",
|
|
@@ -18203,7 +18212,8 @@ function buildGuardianReleaseFlow(releaseVersion) {
|
|
|
18203
18212
|
})),
|
|
18204
18213
|
boundaries: [
|
|
18205
18214
|
"This release flow is copy-paste operator guidance only; it is not release evidence or production-gate proof.",
|
|
18206
|
-
"Publish dispatch
|
|
18215
|
+
"Publish dispatch defaults to npm Trusted Publishing and must not print npm tokens, OTP values, or .npmrc contents.",
|
|
18216
|
+
"The token fallback route remains available with publish_auth=token and requires NPM_TOKEN in GitHub Actions repository secrets.",
|
|
18207
18217
|
"Run the dry-run dispatch before the guarded dry_run=false publish dispatch.",
|
|
18208
18218
|
"Public npm preview publication and local install smoke prove the CLI preview lane only.",
|
|
18209
18219
|
"Signed native installers, high-risk desktop action execution, and autonomous local app execution remain separate not-proven production gates until real external evidence is collected and validated."
|
|
@@ -18252,7 +18262,8 @@ function renderGuardianReleaseChecklist(result, flags) {
|
|
|
18252
18262
|
`Release: ${result.releaseVersion}`,
|
|
18253
18263
|
`Repository: ${result.repository}`,
|
|
18254
18264
|
`Status: ${result.status}`,
|
|
18255
|
-
|
|
18265
|
+
"Default npm publish setup: Trusted Publisher connection",
|
|
18266
|
+
`Fallback npm publish secret: ${result.tokenFallbackCredentialName}`,
|
|
18256
18267
|
"1. Secret setup:",
|
|
18257
18268
|
result.operatorCommands.secretSetup,
|
|
18258
18269
|
"2. Dry-run dispatch:",
|
|
@@ -23582,6 +23593,7 @@ export {
|
|
|
23582
23593
|
GUARDIAN_CLI_VERSION,
|
|
23583
23594
|
GUARDIAN_CONTROL_TOWER_URL_ENV,
|
|
23584
23595
|
GUARDIAN_DEFAULT_CONTROL_TOWER_URL,
|
|
23596
|
+
GUARDIAN_DEFAULT_NPM_PUBLISH_AUTH,
|
|
23585
23597
|
GUARDIAN_DESKTOP_ADAPTER_SIMULATE_OPEN_ENV,
|
|
23586
23598
|
GUARDIAN_DESKTOP_URL_OPEN_ADAPTER_ID,
|
|
23587
23599
|
GUARDIAN_DESKTOP_URL_OPEN_ADAPTER_PROOF_SCHEMA_VERSION,
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { Writable } from 'node:stream';
|
|
2
2
|
import { type PolicyPackMarketplaceManifest } from '@contextecf/personal-fabric-contracts';
|
|
3
3
|
import { SQLitePersonalFabricStore, type PersonalFabricDataImportResult, type PersonalFabricMutableDataDeleteResult, type SQLitePersonalFabricBackupResult } from '@contextecf/personal-fabric-store';
|
|
4
|
-
export declare const GUARDIAN_CLI_VERSION = "0.1.
|
|
4
|
+
export declare const GUARDIAN_CLI_VERSION = "0.1.10";
|
|
5
5
|
export declare const GUARDIAN_PROFILE_SCHEMA_VERSION = "contextecf/project-guardian-profile/v1";
|
|
6
6
|
export declare const GUARDIAN_NPM_PACKAGE_NAME = "@contextecf/guardian-cli";
|
|
7
7
|
export declare const GUARDIAN_NPM_REGISTRY = "https://registry.npmjs.org/";
|
|
8
|
+
export declare const GUARDIAN_DEFAULT_NPM_PUBLISH_AUTH = "trusted_publisher";
|
|
8
9
|
export declare const GUARDIAN_GLOBAL_INSTALL_COMMAND = "npm install -g @contextecf/guardian-cli";
|
|
9
10
|
export declare const GUARDIAN_NPX_SETUP_COMMAND = "npx @contextecf/guardian-cli@latest setup";
|
|
10
11
|
export declare const GUARDIAN_FIRST_RUN_COMMAND = "guardian setup";
|
|
@@ -217,7 +218,9 @@ export interface GuardianReleaseSecretSetupResult {
|
|
|
217
218
|
schema_version: 'contextecf/project-guardian-release-secret-setup/v1';
|
|
218
219
|
cli_version: string;
|
|
219
220
|
repository: typeof GUARDIAN_RELEASE_REPOSITORY;
|
|
220
|
-
|
|
221
|
+
defaultPublishAuth: typeof GUARDIAN_DEFAULT_NPM_PUBLISH_AUTH;
|
|
222
|
+
requiredForPublish: 'npm_trusted_publisher_connection';
|
|
223
|
+
tokenFallbackCredentialName: 'NPM_TOKEN';
|
|
221
224
|
requiredForBrowserStoreApi: typeof GUARDIAN_CHROME_WEB_STORE_API_SECRET_NAMES;
|
|
222
225
|
githubActionsSecretUrl: string;
|
|
223
226
|
commands: {
|
|
@@ -250,7 +253,9 @@ export interface GuardianReleaseChecklistResult {
|
|
|
250
253
|
browserStoreHandoff: string;
|
|
251
254
|
readiness: string;
|
|
252
255
|
};
|
|
253
|
-
|
|
256
|
+
defaultPublishAuth: typeof GUARDIAN_DEFAULT_NPM_PUBLISH_AUTH;
|
|
257
|
+
requiredRepositoryCredentialName?: 'NPM_TOKEN';
|
|
258
|
+
tokenFallbackCredentialName: 'NPM_TOKEN';
|
|
254
259
|
evidenceOutputs: string[];
|
|
255
260
|
notProvenProductionGates: Array<{
|
|
256
261
|
id: string;
|
|
@@ -616,7 +621,9 @@ export interface GuardianProductionReadinessStatus {
|
|
|
616
621
|
workflow: typeof GUARDIAN_RELEASE_DISPATCH_WORKFLOW;
|
|
617
622
|
dryRunCommand: string;
|
|
618
623
|
publishCommand: string;
|
|
619
|
-
|
|
624
|
+
defaultPublishAuth: typeof GUARDIAN_DEFAULT_NPM_PUBLISH_AUTH;
|
|
625
|
+
requiredPublishCredentialName?: 'NPM_TOKEN';
|
|
626
|
+
tokenFallbackCredentialName: 'NPM_TOKEN';
|
|
620
627
|
channels: readonly ['all', 'npm', 'browser', 'evidence'];
|
|
621
628
|
defaultDockerSmoke: true;
|
|
622
629
|
provenance: 'github_actions_oidc_supported';
|