@contextecf/guardian-cli 0.1.4 → 0.1.5
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.
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __esm = (fn, res
|
|
5
|
-
|
|
6
|
-
try {
|
|
7
|
-
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
8
|
-
} catch (e) {
|
|
9
|
-
throw err = [e], e;
|
|
10
|
-
}
|
|
4
|
+
var __esm = (fn, res) => function __init() {
|
|
5
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
11
6
|
};
|
|
12
7
|
var __export = (target, all) => {
|
|
13
8
|
for (var name in all)
|
|
@@ -78,7 +73,7 @@ var init_core = __esm({
|
|
|
78
73
|
NEVER = /* @__PURE__ */ Object.freeze({
|
|
79
74
|
status: "aborted"
|
|
80
75
|
});
|
|
81
|
-
$brand =
|
|
76
|
+
$brand = Symbol("zod_brand");
|
|
82
77
|
$ZodAsyncError = class extends Error {
|
|
83
78
|
constructor() {
|
|
84
79
|
super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
|
|
@@ -10247,8 +10242,8 @@ function registry() {
|
|
|
10247
10242
|
var _a2, $output, $input, $ZodRegistry, globalRegistry;
|
|
10248
10243
|
var init_registries = __esm({
|
|
10249
10244
|
"node_modules/zod/v4/core/registries.js"() {
|
|
10250
|
-
$output =
|
|
10251
|
-
$input =
|
|
10245
|
+
$output = Symbol("ZodOutput");
|
|
10246
|
+
$input = Symbol("ZodInput");
|
|
10252
10247
|
$ZodRegistry = class {
|
|
10253
10248
|
constructor() {
|
|
10254
10249
|
this._map = /* @__PURE__ */ new WeakMap();
|
|
@@ -20616,7 +20611,7 @@ function drainMessages() {
|
|
|
20616
20611
|
|
|
20617
20612
|
async function handleNativeMessage(raw) {
|
|
20618
20613
|
const message = JSON.parse(raw);
|
|
20619
|
-
if (!message || message.
|
|
20614
|
+
if (!message || message.adapter !== 'browser_mv3') {
|
|
20620
20615
|
sendNativeMessage({ ok: false, error: 'Unsupported Guardian native message.' });
|
|
20621
20616
|
return;
|
|
20622
20617
|
}
|
|
@@ -20627,12 +20622,44 @@ async function handleNativeMessage(raw) {
|
|
|
20627
20622
|
return;
|
|
20628
20623
|
}
|
|
20629
20624
|
const token = readRuntimeToken();
|
|
20630
|
-
|
|
20631
|
-
|
|
20632
|
-
|
|
20633
|
-
|
|
20634
|
-
|
|
20635
|
-
|
|
20625
|
+
|
|
20626
|
+
if (message.type === 'GUARDIAN_BRIDGE_DISCOVER') {
|
|
20627
|
+
sendNativeMessage({
|
|
20628
|
+
ok: true,
|
|
20629
|
+
bridgeConfig: {
|
|
20630
|
+
schema_version: 'contextecf/project-guardian-browser-bridge/v1',
|
|
20631
|
+
loopbackBaseUrl,
|
|
20632
|
+
token,
|
|
20633
|
+
pairedAt: new Date().toISOString(),
|
|
20634
|
+
source: 'native-host-discovery',
|
|
20635
|
+
transport: 'native_then_loopback',
|
|
20636
|
+
nativeHostName: 'com.contextecf.guardian',
|
|
20637
|
+
},
|
|
20638
|
+
});
|
|
20639
|
+
return;
|
|
20640
|
+
}
|
|
20641
|
+
|
|
20642
|
+
if (message.type === 'GUARDIAN_PROMPT_CHECK') {
|
|
20643
|
+
const response = await postJson(
|
|
20644
|
+
loopbackBaseUrl + '/v1/guardian/process-prompt',
|
|
20645
|
+
JSON.stringify({ adapter: 'browser_mv3', request: message.request }),
|
|
20646
|
+
token
|
|
20647
|
+
);
|
|
20648
|
+
sendNativeMessage(response);
|
|
20649
|
+
return;
|
|
20650
|
+
}
|
|
20651
|
+
|
|
20652
|
+
if (message.type === 'GUARDIAN_LIVE_COACH_EVENT') {
|
|
20653
|
+
const response = await postJson(
|
|
20654
|
+
loopbackBaseUrl + '/v1/guardian/live-coach-event',
|
|
20655
|
+
JSON.stringify({ adapter: 'browser_mv3', request: message.request }),
|
|
20656
|
+
token
|
|
20657
|
+
);
|
|
20658
|
+
sendNativeMessage(response);
|
|
20659
|
+
return;
|
|
20660
|
+
}
|
|
20661
|
+
|
|
20662
|
+
sendNativeMessage({ ok: false, error: 'Unsupported Guardian native message.' });
|
|
20636
20663
|
}
|
|
20637
20664
|
|
|
20638
20665
|
function readRuntimeToken() {
|
|
@@ -23140,7 +23167,7 @@ var init_runtime = __esm({
|
|
|
23140
23167
|
"use strict";
|
|
23141
23168
|
init_src();
|
|
23142
23169
|
init_src2();
|
|
23143
|
-
GUARDIAN_CLI_VERSION = "0.1.
|
|
23170
|
+
GUARDIAN_CLI_VERSION = "0.1.5";
|
|
23144
23171
|
GUARDIAN_PROFILE_SCHEMA_VERSION = "contextecf/project-guardian-profile/v1";
|
|
23145
23172
|
GUARDIAN_NPM_PACKAGE_NAME = "@contextecf/guardian-cli";
|
|
23146
23173
|
GUARDIAN_NPM_REGISTRY = "https://registry.npmjs.org/";
|
|
@@ -593,7 +593,7 @@ function $constructor(name, initializer3, params) {
|
|
|
593
593
|
Object.defineProperty(_, "name", { value: name });
|
|
594
594
|
return _;
|
|
595
595
|
}
|
|
596
|
-
var $brand =
|
|
596
|
+
var $brand = Symbol("zod_brand");
|
|
597
597
|
var $ZodAsyncError = class extends Error {
|
|
598
598
|
constructor() {
|
|
599
599
|
super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
|
|
@@ -10336,8 +10336,8 @@ function yo_default() {
|
|
|
10336
10336
|
|
|
10337
10337
|
// node_modules/zod/v4/core/registries.js
|
|
10338
10338
|
var _a2;
|
|
10339
|
-
var $output =
|
|
10340
|
-
var $input =
|
|
10339
|
+
var $output = Symbol("ZodOutput");
|
|
10340
|
+
var $input = Symbol("ZodInput");
|
|
10341
10341
|
var $ZodRegistry = class {
|
|
10342
10342
|
constructor() {
|
|
10343
10343
|
this._map = /* @__PURE__ */ new WeakMap();
|
|
@@ -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.
|
|
16278
|
+
var GUARDIAN_CLI_VERSION = "0.1.5";
|
|
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/";
|
|
@@ -20442,7 +20442,7 @@ function drainMessages() {
|
|
|
20442
20442
|
|
|
20443
20443
|
async function handleNativeMessage(raw) {
|
|
20444
20444
|
const message = JSON.parse(raw);
|
|
20445
|
-
if (!message || message.
|
|
20445
|
+
if (!message || message.adapter !== 'browser_mv3') {
|
|
20446
20446
|
sendNativeMessage({ ok: false, error: 'Unsupported Guardian native message.' });
|
|
20447
20447
|
return;
|
|
20448
20448
|
}
|
|
@@ -20453,12 +20453,44 @@ async function handleNativeMessage(raw) {
|
|
|
20453
20453
|
return;
|
|
20454
20454
|
}
|
|
20455
20455
|
const token = readRuntimeToken();
|
|
20456
|
-
|
|
20457
|
-
|
|
20458
|
-
|
|
20459
|
-
|
|
20460
|
-
|
|
20461
|
-
|
|
20456
|
+
|
|
20457
|
+
if (message.type === 'GUARDIAN_BRIDGE_DISCOVER') {
|
|
20458
|
+
sendNativeMessage({
|
|
20459
|
+
ok: true,
|
|
20460
|
+
bridgeConfig: {
|
|
20461
|
+
schema_version: 'contextecf/project-guardian-browser-bridge/v1',
|
|
20462
|
+
loopbackBaseUrl,
|
|
20463
|
+
token,
|
|
20464
|
+
pairedAt: new Date().toISOString(),
|
|
20465
|
+
source: 'native-host-discovery',
|
|
20466
|
+
transport: 'native_then_loopback',
|
|
20467
|
+
nativeHostName: 'com.contextecf.guardian',
|
|
20468
|
+
},
|
|
20469
|
+
});
|
|
20470
|
+
return;
|
|
20471
|
+
}
|
|
20472
|
+
|
|
20473
|
+
if (message.type === 'GUARDIAN_PROMPT_CHECK') {
|
|
20474
|
+
const response = await postJson(
|
|
20475
|
+
loopbackBaseUrl + '/v1/guardian/process-prompt',
|
|
20476
|
+
JSON.stringify({ adapter: 'browser_mv3', request: message.request }),
|
|
20477
|
+
token
|
|
20478
|
+
);
|
|
20479
|
+
sendNativeMessage(response);
|
|
20480
|
+
return;
|
|
20481
|
+
}
|
|
20482
|
+
|
|
20483
|
+
if (message.type === 'GUARDIAN_LIVE_COACH_EVENT') {
|
|
20484
|
+
const response = await postJson(
|
|
20485
|
+
loopbackBaseUrl + '/v1/guardian/live-coach-event',
|
|
20486
|
+
JSON.stringify({ adapter: 'browser_mv3', request: message.request }),
|
|
20487
|
+
token
|
|
20488
|
+
);
|
|
20489
|
+
sendNativeMessage(response);
|
|
20490
|
+
return;
|
|
20491
|
+
}
|
|
20492
|
+
|
|
20493
|
+
sendNativeMessage({ ok: false, error: 'Unsupported Guardian native message.' });
|
|
20462
20494
|
}
|
|
20463
20495
|
|
|
20464
20496
|
function readRuntimeToken() {
|
|
@@ -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.
|
|
4
|
+
export declare const GUARDIAN_CLI_VERSION = "0.1.5";
|
|
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/";
|