agent-clinch 0.8.0 → 0.8.1
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/cli.js +5 -8
- package/package.json +2 -2
package/cli.js
CHANGED
|
@@ -16,7 +16,7 @@ const STATE_FILE = path.join(CONFIG_DIR, 'state.json');
|
|
|
16
16
|
const CONFIG_FILE = path.join(CONFIG_DIR, 'config.json');
|
|
17
17
|
|
|
18
18
|
// ============================================================================
|
|
19
|
-
// SECURE VAULT
|
|
19
|
+
// SECURE VAULT
|
|
20
20
|
// ============================================================================
|
|
21
21
|
class SecureVault {
|
|
22
22
|
static _deriveKey(passphrase) {
|
|
@@ -47,7 +47,7 @@ class SecureVault {
|
|
|
47
47
|
dec += decipher.final('utf8');
|
|
48
48
|
const parsed = JSON.parse(dec);
|
|
49
49
|
if (!parsed.blindKeys) parsed.blindKeys = {};
|
|
50
|
-
return { parsed, pass };
|
|
50
|
+
return { parsed, pass };
|
|
51
51
|
} catch (e) {
|
|
52
52
|
console.error(isDirect ? JSON.stringify({ error: "Invalid passphrase" }) : "❌ Decryption failed.");
|
|
53
53
|
process.exit(1);
|
|
@@ -70,7 +70,7 @@ class SecureVault {
|
|
|
70
70
|
// UTILS & SETUP
|
|
71
71
|
// ============================================================================
|
|
72
72
|
function loadConfig() {
|
|
73
|
-
return fs.existsSync(CONFIG_FILE) ? JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8')) : { mode: 'buyer'
|
|
73
|
+
return fs.existsSync(CONFIG_FILE) ? JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8')) : { mode: 'buyer' };
|
|
74
74
|
}
|
|
75
75
|
function saveConfig(cfg) {
|
|
76
76
|
fs.mkdirSync(CONFIG_DIR, { recursive: true });
|
|
@@ -95,9 +95,8 @@ function syncState(core) {
|
|
|
95
95
|
async function getInitializedCore(vaultData, isDirect) {
|
|
96
96
|
const cfg = loadConfig();
|
|
97
97
|
const core = new ClinchCore({
|
|
98
|
-
registryUrl: cfg.registryUrl,
|
|
99
98
|
privateKeyHex: vaultData.privateKeyHex,
|
|
100
|
-
blindKeys: vaultData.blindKeys
|
|
99
|
+
blindKeys: vaultData.blindKeys
|
|
101
100
|
});
|
|
102
101
|
|
|
103
102
|
if (!isDirect) console.log("⏳ Connecting to Registry...");
|
|
@@ -125,7 +124,7 @@ async function extractConstraints(intentText, isDirect) {
|
|
|
125
124
|
// CLI COMMANDS
|
|
126
125
|
// ============================================================================
|
|
127
126
|
|
|
128
|
-
program.name('clinch').description('Clinch Protocol Command Line').version('0.
|
|
127
|
+
program.name('clinch').description('Clinch Protocol Command Line').version('0.2.0');
|
|
129
128
|
|
|
130
129
|
program.command('config').description('Set CLI configuration')
|
|
131
130
|
.option('--mode <mode>', 'buyer | seller | both')
|
|
@@ -149,7 +148,6 @@ program.command('init').description('Initialize cryptographic identity')
|
|
|
149
148
|
console.log(`\n🎉 Identity generated and vault locked.`);
|
|
150
149
|
});
|
|
151
150
|
|
|
152
|
-
// --- BLIND KEY PASS ---
|
|
153
151
|
program.command('key').description('Manage third-party API credentials (Blind Key Pass vault)')
|
|
154
152
|
.option('--set <domain>', 'Set a new key for a domain')
|
|
155
153
|
.option('--value <key>', 'The actual secret key value')
|
|
@@ -337,7 +335,6 @@ program.command('serve').description('Start Seller HTTP server')
|
|
|
337
335
|
else console.log(`\n🔔 Incoming Proposal: ${session_id} wants ${constraints.item} for ${constraints.max_budget !== null ? '$'+constraints.max_budget : 'unspecified'}`);
|
|
338
336
|
|
|
339
337
|
const categoryCfg = sellerCfg.categories?.[constraints.item] || sellerCfg;
|
|
340
|
-
const maxTurns = categoryCfg.maxTurns || 5;
|
|
341
338
|
|
|
342
339
|
if (constraints.max_budget !== null && constraints.max_budget >= categoryCfg.defaultApprove) {
|
|
343
340
|
core.updateSessionStateLocally(session_id, NegotiationState.CONFIRMED, categoryCfg.defaultApprove, 1);
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
"name": "agent-clinch",
|
|
9
|
-
"version": "0.8.
|
|
9
|
+
"version": "0.8.1",
|
|
10
10
|
"description": "Clinch Protocol CLI — agent negotiation from your terminal",
|
|
11
11
|
"main": "cli.js",
|
|
12
12
|
"bin": {
|
|
@@ -19,6 +19,6 @@
|
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"commander": "^14.0.3",
|
|
21
21
|
"node-llama-cpp": "^3.18.1",
|
|
22
|
-
"clinch-core": "0.8.
|
|
22
|
+
"clinch-core": "0.8.1"
|
|
23
23
|
}
|
|
24
24
|
}
|