@contextecf/guardian-cli 0.1.2 → 0.1.3

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.
@@ -17443,6 +17443,15 @@ async function statusGuardian(flags, options) {
17443
17443
  const releaseEvidence = await buildGuardianReleaseEvidenceStatus(home);
17444
17444
  const serviceSupervision = await buildGuardianServiceSupervisionStatus(home);
17445
17445
  const osKeyStorage = await buildGuardianOsKeyStorageStatus(home);
17446
+ const privacy = {
17447
+ rawContentCaptureEnabled: profile?.privacy.raw_content_capture_enabled ?? false,
17448
+ cloudSyncEnabled: profile?.privacy.cloud_sync_enabled ?? false,
17449
+ localAppAutopilotEnabled: profile?.privacy.local_app_autopilot_enabled ?? false
17450
+ };
17451
+ const nextCommands = buildGuardianStatusNextCommands({
17452
+ installed: profile !== void 0,
17453
+ daemonStatus: daemonHealth.daemon.status
17454
+ });
17446
17455
  const result = {
17447
17456
  schema_version: "contextecf/project-guardian-status/v1",
17448
17457
  cli_version: GUARDIAN_CLI_VERSION,
@@ -17456,11 +17465,7 @@ async function statusGuardian(flags, options) {
17456
17465
  controlTowerUrl: daemonHealth.controlTowerUrl,
17457
17466
  controlTowerUrlSource: profile?.control_tower?.source ?? "default_loopback",
17458
17467
  daemon: daemonHealth.daemon,
17459
- privacy: {
17460
- rawContentCaptureEnabled: profile?.privacy.raw_content_capture_enabled ?? false,
17461
- cloudSyncEnabled: profile?.privacy.cloud_sync_enabled ?? false,
17462
- localAppAutopilotEnabled: profile?.privacy.local_app_autopilot_enabled ?? false
17463
- },
17468
+ privacy,
17464
17469
  preferences: {
17465
17470
  promptCoachMode: profile?.prompt_coach_mode ?? "not_installed",
17466
17471
  learningGraphEnabled: profile?.learning_graph.enabled ?? false
@@ -17479,7 +17484,8 @@ async function statusGuardian(flags, options) {
17479
17484
  releaseEvidence,
17480
17485
  serviceSupervision,
17481
17486
  osKeyStorage,
17482
- notProvenProductionGates: GUARDIAN_NOT_PROVEN_PRODUCTION_GATES
17487
+ notProvenProductionGates: GUARDIAN_NOT_PROVEN_PRODUCTION_GATES,
17488
+ nextCommands
17483
17489
  };
17484
17490
  if (flags.has("json")) {
17485
17491
  return `${JSON.stringify(result, null, 2)}
@@ -17502,11 +17508,36 @@ async function statusGuardian(flags, options) {
17502
17508
  `Service supervision: ${result.serviceSupervision.status}`,
17503
17509
  `OS key storage: ${result.osKeyStorage.status}`,
17504
17510
  `Not-proven production gates: ${result.notProvenProductionGates.length}`,
17505
- "Privacy: raw capture off, cloud sync off, local app autopilot off",
17506
- result.installed ? "Next: guardian launch" : "Next: guardian install"
17511
+ formatGuardianPrivacyStatus(result.privacy),
17512
+ `Next: ${result.nextCommands.join("; ")}`
17507
17513
  ].filter(Boolean).join("\n")}
17508
17514
  `;
17509
17515
  }
17516
+ function buildGuardianStatusNextCommands(input2) {
17517
+ if (!input2.installed) {
17518
+ return ["guardian install"];
17519
+ }
17520
+ if (input2.daemonStatus === "reachable") {
17521
+ return ["guardian open", "guardian readiness", "guardian extension open-setup"];
17522
+ }
17523
+ if (input2.daemonStatus === "unauthorized") {
17524
+ return ["guardian stop", "guardian launch --port=4322", "guardian status"];
17525
+ }
17526
+ if (input2.daemonStatus === "token_missing" || input2.daemonStatus === "invalid_control_tower_url") {
17527
+ return ["guardian setup", "guardian launch", "guardian status"];
17528
+ }
17529
+ return ["guardian launch", "guardian status"];
17530
+ }
17531
+ function formatGuardianPrivacyStatus(input2) {
17532
+ return [
17533
+ `Privacy: raw capture ${formatOnOff(input2.rawContentCaptureEnabled)}`,
17534
+ `cloud sync ${formatOnOff(input2.cloudSyncEnabled)}`,
17535
+ `local app autopilot ${formatOnOff(input2.localAppAutopilotEnabled)}`
17536
+ ].join(", ");
17537
+ }
17538
+ function formatOnOff(enabled) {
17539
+ return enabled ? "on" : "off";
17540
+ }
17510
17541
  async function runControlTowerOpenCommand(flags, options) {
17511
17542
  const stdout = options.stdout ?? process.stdout;
17512
17543
  const stderr = options.stderr ?? process.stderr;
@@ -22286,7 +22317,7 @@ var init_runtime = __esm({
22286
22317
  "use strict";
22287
22318
  init_src();
22288
22319
  init_src2();
22289
- GUARDIAN_CLI_VERSION = "0.1.2";
22320
+ GUARDIAN_CLI_VERSION = "0.1.3";
22290
22321
  GUARDIAN_PROFILE_SCHEMA_VERSION = "contextecf/project-guardian-profile/v1";
22291
22322
  GUARDIAN_NPM_PACKAGE_NAME = "@contextecf/guardian-cli";
22292
22323
  GUARDIAN_GLOBAL_INSTALL_COMMAND = `npm install -g ${GUARDIAN_NPM_PACKAGE_NAME}`;
@@ -26573,6 +26604,7 @@ function renderControlTowerStatusPage(profile, receipts = [], searchGraph = { no
26573
26604
  .activity-heading { justify-content: space-between; gap: 16px; margin-bottom: 12px; }
26574
26605
  .activity-heading h2 { margin: 0; }
26575
26606
  .filter-chips { gap: 8px; flex-wrap: wrap; }
26607
+ .activity-filter-status { margin: 0 0 12px; color: #91a1b8; font-size: 14px; font-weight: 650; }
26576
26608
  .chip {
26577
26609
  min-width: auto;
26578
26610
  min-height: 36px;
@@ -26686,6 +26718,7 @@ ${heroMetricCards}
26686
26718
  <button type="button" class="chip" data-activity-filter="allowed" aria-pressed="false">Allowed</button>
26687
26719
  </div>
26688
26720
  </div>
26721
+ <p class="activity-filter-status" data-activity-filter-status aria-live="polite">Showing all local Guardian activity.</p>
26689
26722
  <div class="activity-list" data-activity-list>
26690
26723
  ${activityFeedHtml}
26691
26724
  <div class="empty-filter-state" data-activity-empty hidden>No activity matches this filter yet.</div>
@@ -26950,12 +26983,37 @@ ${learningEventRows}
26950
26983
  const filters = Array.from(document.querySelectorAll('[data-activity-filter]'));
26951
26984
  const list = document.querySelector('[data-activity-list]');
26952
26985
  const emptyState = document.querySelector('[data-activity-empty]');
26986
+ const filterStatus = document.querySelector('[data-activity-filter-status]');
26987
+ const filterCopy = {
26988
+ all: {
26989
+ status: 'Showing all local Guardian activity.',
26990
+ empty: 'No Guardian activity recorded yet.',
26991
+ },
26992
+ blocked: {
26993
+ status: 'Showing blocked Guardian decisions.',
26994
+ empty: 'No blocked activity recorded yet.',
26995
+ },
26996
+ flagged: {
26997
+ status: 'Showing flagged Guardian decisions.',
26998
+ empty: 'No flagged activity recorded yet.',
26999
+ },
27000
+ allowed: {
27001
+ status: 'Showing allowed Guardian decisions.',
27002
+ empty: 'No allowed activity recorded yet.',
27003
+ },
27004
+ };
27005
+ const setFilterCopy = (selectedFilter) => {
27006
+ const copy = filterCopy[selectedFilter] || filterCopy.all;
27007
+ if (filterStatus) filterStatus.textContent = copy.status;
27008
+ if (emptyState) emptyState.textContent = copy.empty;
27009
+ };
26953
27010
  const setSelectedFilter = (selectedFilter) => {
26954
27011
  for (const filter of filters) {
26955
27012
  const selected = filter.getAttribute('data-activity-filter') === selectedFilter;
26956
27013
  filter.classList.toggle('is-active', selected);
26957
27014
  filter.setAttribute('aria-pressed', selected ? 'true' : 'false');
26958
27015
  }
27016
+ setFilterCopy(selectedFilter);
26959
27017
  };
26960
27018
  const createActivityCard = (activity) => {
26961
27019
  const card = document.createElement('article');
@@ -16275,7 +16275,7 @@ function cloneList(values) {
16275
16275
  }
16276
16276
 
16277
16277
  // packages/guardian-cli/src/runtime.ts
16278
- var GUARDIAN_CLI_VERSION = "0.1.2";
16278
+ var GUARDIAN_CLI_VERSION = "0.1.3";
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_GLOBAL_INSTALL_COMMAND = `npm install -g ${GUARDIAN_NPM_PACKAGE_NAME}`;
@@ -17286,6 +17286,15 @@ async function statusGuardian(flags, options) {
17286
17286
  const releaseEvidence = await buildGuardianReleaseEvidenceStatus(home);
17287
17287
  const serviceSupervision = await buildGuardianServiceSupervisionStatus(home);
17288
17288
  const osKeyStorage = await buildGuardianOsKeyStorageStatus(home);
17289
+ const privacy = {
17290
+ rawContentCaptureEnabled: profile?.privacy.raw_content_capture_enabled ?? false,
17291
+ cloudSyncEnabled: profile?.privacy.cloud_sync_enabled ?? false,
17292
+ localAppAutopilotEnabled: profile?.privacy.local_app_autopilot_enabled ?? false
17293
+ };
17294
+ const nextCommands = buildGuardianStatusNextCommands({
17295
+ installed: profile !== void 0,
17296
+ daemonStatus: daemonHealth.daemon.status
17297
+ });
17289
17298
  const result = {
17290
17299
  schema_version: "contextecf/project-guardian-status/v1",
17291
17300
  cli_version: GUARDIAN_CLI_VERSION,
@@ -17299,11 +17308,7 @@ async function statusGuardian(flags, options) {
17299
17308
  controlTowerUrl: daemonHealth.controlTowerUrl,
17300
17309
  controlTowerUrlSource: profile?.control_tower?.source ?? "default_loopback",
17301
17310
  daemon: daemonHealth.daemon,
17302
- privacy: {
17303
- rawContentCaptureEnabled: profile?.privacy.raw_content_capture_enabled ?? false,
17304
- cloudSyncEnabled: profile?.privacy.cloud_sync_enabled ?? false,
17305
- localAppAutopilotEnabled: profile?.privacy.local_app_autopilot_enabled ?? false
17306
- },
17311
+ privacy,
17307
17312
  preferences: {
17308
17313
  promptCoachMode: profile?.prompt_coach_mode ?? "not_installed",
17309
17314
  learningGraphEnabled: profile?.learning_graph.enabled ?? false
@@ -17322,7 +17327,8 @@ async function statusGuardian(flags, options) {
17322
17327
  releaseEvidence,
17323
17328
  serviceSupervision,
17324
17329
  osKeyStorage,
17325
- notProvenProductionGates: GUARDIAN_NOT_PROVEN_PRODUCTION_GATES
17330
+ notProvenProductionGates: GUARDIAN_NOT_PROVEN_PRODUCTION_GATES,
17331
+ nextCommands
17326
17332
  };
17327
17333
  if (flags.has("json")) {
17328
17334
  return `${JSON.stringify(result, null, 2)}
@@ -17345,11 +17351,36 @@ async function statusGuardian(flags, options) {
17345
17351
  `Service supervision: ${result.serviceSupervision.status}`,
17346
17352
  `OS key storage: ${result.osKeyStorage.status}`,
17347
17353
  `Not-proven production gates: ${result.notProvenProductionGates.length}`,
17348
- "Privacy: raw capture off, cloud sync off, local app autopilot off",
17349
- result.installed ? "Next: guardian launch" : "Next: guardian install"
17354
+ formatGuardianPrivacyStatus(result.privacy),
17355
+ `Next: ${result.nextCommands.join("; ")}`
17350
17356
  ].filter(Boolean).join("\n")}
17351
17357
  `;
17352
17358
  }
17359
+ function buildGuardianStatusNextCommands(input) {
17360
+ if (!input.installed) {
17361
+ return ["guardian install"];
17362
+ }
17363
+ if (input.daemonStatus === "reachable") {
17364
+ return ["guardian open", "guardian readiness", "guardian extension open-setup"];
17365
+ }
17366
+ if (input.daemonStatus === "unauthorized") {
17367
+ return ["guardian stop", "guardian launch --port=4322", "guardian status"];
17368
+ }
17369
+ if (input.daemonStatus === "token_missing" || input.daemonStatus === "invalid_control_tower_url") {
17370
+ return ["guardian setup", "guardian launch", "guardian status"];
17371
+ }
17372
+ return ["guardian launch", "guardian status"];
17373
+ }
17374
+ function formatGuardianPrivacyStatus(input) {
17375
+ return [
17376
+ `Privacy: raw capture ${formatOnOff(input.rawContentCaptureEnabled)}`,
17377
+ `cloud sync ${formatOnOff(input.cloudSyncEnabled)}`,
17378
+ `local app autopilot ${formatOnOff(input.localAppAutopilotEnabled)}`
17379
+ ].join(", ");
17380
+ }
17381
+ function formatOnOff(enabled) {
17382
+ return enabled ? "on" : "off";
17383
+ }
17353
17384
  async function runControlTowerOpenCommand(flags, options) {
17354
17385
  const stdout = options.stdout ?? process.stdout;
17355
17386
  const stderr = options.stderr ?? process.stderr;
@@ -1,7 +1,7 @@
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.2";
4
+ export declare const GUARDIAN_CLI_VERSION = "0.1.3";
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_GLOBAL_INSTALL_COMMAND = "npm install -g @contextecf/guardian-cli";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contextecf/guardian-cli",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Project Guardian local-first Personal Context Fabric CLI",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",