@pingagent/sdk 0.1.7 → 0.1.9
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/bin/pingagent.js +24 -3
- package/dist/chunk-3OEFISNL.js +2433 -0
- package/dist/chunk-5Z6HZWDA.js +2603 -0
- package/dist/chunk-BSDY6AKB.js +2918 -0
- package/dist/chunk-PFABO4C7.js +2961 -0
- package/dist/chunk-QK2GMSWC.js +2959 -0
- package/dist/chunk-TCYDOFRQ.js +2085 -0
- package/dist/chunk-V7HHUQT6.js +1962 -0
- package/dist/index.d.ts +403 -5
- package/dist/index.js +41 -3
- package/dist/web-server.js +1151 -16
- package/package.json +11 -3
- package/__tests__/cli.test.ts +0 -225
- package/__tests__/identity.test.ts +0 -47
- package/__tests__/store.test.ts +0 -332
- package/src/a2a-adapter.ts +0 -159
- package/src/auth.ts +0 -50
- package/src/client.ts +0 -582
- package/src/contacts.ts +0 -210
- package/src/history.ts +0 -269
- package/src/identity.ts +0 -86
- package/src/index.ts +0 -25
- package/src/paths.ts +0 -52
- package/src/store.ts +0 -62
- package/src/transport.ts +0 -141
- package/src/web-server.ts +0 -1148
- package/src/ws-subscription.ts +0 -428
- package/tsconfig.json +0 -8
package/bin/pingagent.js
CHANGED
|
@@ -57,6 +57,22 @@ function printError(err) {
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
function formatRetentionLabel(ttlMs) {
|
|
61
|
+
if (!ttlMs || ttlMs <= 0) return '-';
|
|
62
|
+
const days = ttlMs / 86_400_000;
|
|
63
|
+
if (Number.isInteger(days) && days >= 1) return `${days}d`;
|
|
64
|
+
const hours = ttlMs / 3_600_000;
|
|
65
|
+
if (Number.isInteger(hours) && hours >= 1) return `${hours}h`;
|
|
66
|
+
return `${ttlMs}ms`;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function describeHostedTier(tier) {
|
|
70
|
+
if (tier === 'plus') return 'shareable identity + first alias + higher relay';
|
|
71
|
+
if (tier === 'pro') return 'multi-identity communication + audit export';
|
|
72
|
+
if (tier === 'enterprise') return 'high-scale governance + operational controls';
|
|
73
|
+
return 'free communication-first entry tier';
|
|
74
|
+
}
|
|
75
|
+
|
|
60
76
|
function openStore(identityPath) {
|
|
61
77
|
return new LocalStore(getStorePath(identityPath));
|
|
62
78
|
}
|
|
@@ -84,7 +100,9 @@ async function getClient(identityPath) {
|
|
|
84
100
|
let id = loadIdentity(p);
|
|
85
101
|
await ensureTokenValid(p, id.serverUrl);
|
|
86
102
|
id = loadIdentity(p);
|
|
87
|
-
|
|
103
|
+
const client = makeClient(id, p);
|
|
104
|
+
await client.ensureEncryptionKeyPublished().catch(() => undefined);
|
|
105
|
+
return client;
|
|
88
106
|
}
|
|
89
107
|
|
|
90
108
|
const program = new Command();
|
|
@@ -402,12 +420,15 @@ program
|
|
|
402
420
|
if (subRes.ok && subRes.data) {
|
|
403
421
|
const d = subRes.data;
|
|
404
422
|
console.log(`Tier: ${d.tier}`);
|
|
423
|
+
console.log(`Plan: ${describeHostedTier(d.tier)}`);
|
|
405
424
|
console.log(`Relay: ${d.usage.relay_today} / ${d.usage.relay_limit} today`);
|
|
425
|
+
console.log(`Retention: ${formatRetentionLabel(d.limits.store_forward_ttl_ms)}`);
|
|
406
426
|
console.log(`Artifact: ${(d.usage.artifact_bytes / 1024 / 1024).toFixed(2)} MB / ${d.limits.artifact_storage_mb} MB`);
|
|
407
427
|
console.log(`Alias: ${d.usage.alias_count} / ${d.usage.alias_limit}`);
|
|
428
|
+
console.log(`Audit export: ${d.limits.audit_export_allowed ? 'enabled' : 'not included on this plan'}`);
|
|
408
429
|
if (d.billing_primary_did && d.billing_primary_did !== id.did) {
|
|
409
430
|
console.log(`Billing: linked device (primary: ${d.billing_primary_did})`);
|
|
410
|
-
console.log(' Subscription managed on primary. Use primary
|
|
431
|
+
console.log(' Subscription managed on primary. Use the primary device for checkout changes and customer portal access.');
|
|
411
432
|
} else if (d.linked_device_count > 0) {
|
|
412
433
|
console.log(`Billing: primary device (${d.linked_device_count} linked)`);
|
|
413
434
|
}
|
|
@@ -1419,7 +1440,7 @@ billing
|
|
|
1419
1440
|
|
|
1420
1441
|
program
|
|
1421
1442
|
.command('web')
|
|
1422
|
-
.description('Start local web UI for debugging and audit. By default scans ~/.pingagent for profiles; use --identity-dir to lock to one profile.')
|
|
1443
|
+
.description('Start local web UI and host panel for debugging, runtime inspection, trust policy, and audit. By default scans ~/.pingagent for profiles; use --identity-dir to lock to one profile.')
|
|
1423
1444
|
.option('--port <port>', 'Port for the web server', '3846')
|
|
1424
1445
|
.action(async (opts) => {
|
|
1425
1446
|
const serverUrl = process.env.PINGAGENT_SERVER_URL || DEFAULT_SERVER;
|