vibeiao 0.1.12 → 0.1.13
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/package.json +1 -1
- package/src/index.js +76 -26
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -33,6 +33,7 @@ const DEFAULT_CLI_POLICY_TIMEOUT_MS = 3000;
|
|
|
33
33
|
const DEFAULT_AGENT_CONFIG_FILE = 'agent.json';
|
|
34
34
|
const DEFAULT_HANDOFF_FILE = 'handoff.json';
|
|
35
35
|
const DEFAULT_KEYPAIR_PATH = path.join(os.homedir(), '.config', 'solana', 'id.json');
|
|
36
|
+
const DEFAULT_LOCAL_AGENT_KEYPAIR_PATH = path.join('.vibeiao', 'agent-keypair.json');
|
|
36
37
|
const DEFAULT_AGENT_KEY_REGISTRY_PATH = path.join(os.homedir(), '.config', 'vibeiao', 'agent-keys.json');
|
|
37
38
|
const DEFAULT_AGENT_KEY_DIR = path.join(os.homedir(), '.config', 'vibeiao', 'keys');
|
|
38
39
|
const DEFAULT_MEMORY_ROOT = 'memory';
|
|
@@ -632,18 +633,35 @@ const writeKeypairFile = (keypair, filePath) => {
|
|
|
632
633
|
return resolved;
|
|
633
634
|
};
|
|
634
635
|
|
|
635
|
-
const resolveAgentKeypair = (flags) => {
|
|
636
|
+
const resolveAgentKeypair = (flags, options = {}) => {
|
|
636
637
|
const explicitInput = flags.keypair || process.env.VIBEIAO_KEYPAIR || null;
|
|
637
638
|
if (explicitInput) {
|
|
638
|
-
return { keypair: loadKeypair(explicitInput), generated: false, path: null };
|
|
639
|
+
return { keypair: loadKeypair(explicitInput), generated: false, path: null, source: 'explicit' };
|
|
639
640
|
}
|
|
640
|
-
const
|
|
641
|
-
|
|
642
|
-
|
|
641
|
+
const localKeypairPath = options.localKeypairPath || DEFAULT_LOCAL_AGENT_KEYPAIR_PATH;
|
|
642
|
+
const existingLocalKeypairPath = findExistingFile(localKeypairPath);
|
|
643
|
+
if (existingLocalKeypairPath) {
|
|
644
|
+
return {
|
|
645
|
+
keypair: loadKeypair(existingLocalKeypairPath),
|
|
646
|
+
generated: false,
|
|
647
|
+
path: existingLocalKeypairPath,
|
|
648
|
+
source: 'workspace',
|
|
649
|
+
};
|
|
650
|
+
}
|
|
651
|
+
if (options.allowGlobalFallback) {
|
|
652
|
+
const defaultKeypairPath = findExistingFile(DEFAULT_KEYPAIR_PATH);
|
|
653
|
+
if (defaultKeypairPath) {
|
|
654
|
+
return {
|
|
655
|
+
keypair: loadKeypair(defaultKeypairPath),
|
|
656
|
+
generated: false,
|
|
657
|
+
path: defaultKeypairPath,
|
|
658
|
+
source: 'global',
|
|
659
|
+
};
|
|
660
|
+
}
|
|
643
661
|
}
|
|
644
662
|
const generated = Keypair.generate();
|
|
645
|
-
const outputPath = writeKeypairFile(generated,
|
|
646
|
-
return { keypair: generated, generated: true, path: outputPath };
|
|
663
|
+
const outputPath = writeKeypairFile(generated, localKeypairPath);
|
|
664
|
+
return { keypair: generated, generated: true, path: outputPath, source: 'workspace' };
|
|
647
665
|
};
|
|
648
666
|
|
|
649
667
|
const readAgentKeyRegistry = (filePath = DEFAULT_AGENT_KEY_REGISTRY_PATH) => {
|
|
@@ -1026,6 +1044,9 @@ const formatCliError = (err) => {
|
|
|
1026
1044
|
if (message === 'missing_listing_input') {
|
|
1027
1045
|
return `${message}${detailsText}\nHint: run \`vibeiao agent\` first (onboarding), then fill agent.json and run \`vibeiao publish\`.`;
|
|
1028
1046
|
}
|
|
1047
|
+
if (message === 'agent_wallet_already_registered') {
|
|
1048
|
+
return `${message}${detailsText}\nHint: each agent needs its own wallet/keypair. Run \`vibeiao agent\` in a clean workspace or pass \`--keypair <new_key>\`.`;
|
|
1049
|
+
}
|
|
1029
1050
|
if (message.includes("reading '_bn'")) {
|
|
1030
1051
|
return `${message}${detailsText}\nHint: likely Program ID / IDL mismatch. Use --program ${DEFAULT_PROGRAM_ID} and ensure you are on the latest CLI build.`;
|
|
1031
1052
|
}
|
|
@@ -1532,9 +1553,13 @@ const handleAgent = async (flags) => {
|
|
|
1532
1553
|
});
|
|
1533
1554
|
const handoff = handoffPath ? readJson(handoffPath) : null;
|
|
1534
1555
|
const apiBase = flags.api || handoff?.apiBase || process.env.VIBEIAO_API_BASE || DEFAULT_API_BASE;
|
|
1535
|
-
const {
|
|
1556
|
+
const {
|
|
1557
|
+
keypair,
|
|
1558
|
+
generated: keypairGenerated,
|
|
1559
|
+
path: keypairPath,
|
|
1560
|
+
} = resolveAgentKeypair(flags, { allowGlobalFallback: false });
|
|
1536
1561
|
if (keypairGenerated && keypairPath) {
|
|
1537
|
-
console.log(`🔐 No keypair found. Generated agent keypair at ${keypairPath}`);
|
|
1562
|
+
console.log(`🔐 No keypair found. Generated workspace agent keypair at ${keypairPath}`);
|
|
1538
1563
|
console.log(' Keep this file safe. It controls your on-chain agent wallet.');
|
|
1539
1564
|
}
|
|
1540
1565
|
|
|
@@ -1620,9 +1645,13 @@ const handlePublish = async (flags) => {
|
|
|
1620
1645
|
label: 'config',
|
|
1621
1646
|
});
|
|
1622
1647
|
const listingFlags = defaultConfig ? { ...flags, config: defaultConfig } : flags;
|
|
1623
|
-
const {
|
|
1648
|
+
const {
|
|
1649
|
+
keypair,
|
|
1650
|
+
generated: keypairGenerated,
|
|
1651
|
+
path: keypairPath,
|
|
1652
|
+
} = resolveAgentKeypair(flags, { allowGlobalFallback: false });
|
|
1624
1653
|
if (keypairGenerated && keypairPath) {
|
|
1625
|
-
console.log(`🔐 No keypair found. Generated agent keypair at ${keypairPath}`);
|
|
1654
|
+
console.log(`🔐 No keypair found. Generated workspace agent keypair at ${keypairPath}`);
|
|
1626
1655
|
console.log(' Keep this file safe. It controls your on-chain agent wallet.');
|
|
1627
1656
|
}
|
|
1628
1657
|
const memoryRoot = String(flags['memory-root'] || handoff?.memory?.root || DEFAULT_MEMORY_ROOT);
|
|
@@ -2160,8 +2189,13 @@ const handleSocial = async (flags, positional) => {
|
|
|
2160
2189
|
console.log(`agentId: ${data.agentId || agentId}`);
|
|
2161
2190
|
console.log(`role: ${data.role || 'Agent Builder'}`);
|
|
2162
2191
|
console.log(`summary: ${data.profileSummary || '—'}`);
|
|
2192
|
+
console.log(`intro: ${data.introPublic || data.profileSummary || '—'}`);
|
|
2193
|
+
if (data.experiencePublic) console.log(`experience: ${data.experiencePublic}`);
|
|
2194
|
+
if (data.reflectionPublic) console.log(`reflection: ${data.reflectionPublic}`);
|
|
2163
2195
|
const tags = Array.isArray(data.capabilityTags) ? data.capabilityTags : [];
|
|
2164
2196
|
console.log(`capabilities: ${tags.join(', ') || '—'}`);
|
|
2197
|
+
const portfolio = Array.isArray(data.portfolio) ? data.portfolio : [];
|
|
2198
|
+
console.log(`portfolio: ${portfolio.length}`);
|
|
2165
2199
|
console.log(`version: ${data.profileVersion || 1}`);
|
|
2166
2200
|
if (data.profileUpdatedAt) console.log(`updatedAt: ${data.profileUpdatedAt}`);
|
|
2167
2201
|
if (data.source) console.log(`source: ${data.source}`);
|
|
@@ -2177,9 +2211,18 @@ const handleSocial = async (flags, positional) => {
|
|
|
2177
2211
|
const role = normalizeSocialText(flags.role || '');
|
|
2178
2212
|
const tagsRaw = flags.tags || flags['capability-tags'] || '';
|
|
2179
2213
|
const capabilityTags = [...new Set(parseCsvList(tagsRaw).map((tag) => tag.toLowerCase()))];
|
|
2214
|
+
const introPublic = normalizeSocialText(flags.intro || flags['intro-public'] || '');
|
|
2215
|
+
const experiencePublicRaw = flags.experience ?? flags['experience-public'];
|
|
2216
|
+
const reflectionPublicRaw = flags.reflection ?? flags['reflection-public'];
|
|
2217
|
+
const experiencePublic = experiencePublicRaw !== undefined
|
|
2218
|
+
? normalizeSocialText(experiencePublicRaw)
|
|
2219
|
+
: undefined;
|
|
2220
|
+
const reflectionPublic = reflectionPublicRaw !== undefined
|
|
2221
|
+
? normalizeSocialText(reflectionPublicRaw)
|
|
2222
|
+
: undefined;
|
|
2180
2223
|
const metadataRaw = String(flags.metadata || '').trim();
|
|
2181
2224
|
let metadata;
|
|
2182
|
-
if (!agentId
|
|
2225
|
+
if (!agentId) throw new Error('missing_agent_id');
|
|
2183
2226
|
if (metadataRaw) {
|
|
2184
2227
|
try {
|
|
2185
2228
|
metadata = JSON.parse(metadataRaw);
|
|
@@ -2188,23 +2231,26 @@ const handleSocial = async (flags, positional) => {
|
|
|
2188
2231
|
}
|
|
2189
2232
|
}
|
|
2190
2233
|
|
|
2191
|
-
const
|
|
2192
|
-
name,
|
|
2193
|
-
profileSummary,
|
|
2194
|
-
role
|
|
2195
|
-
capabilityTags,
|
|
2234
|
+
const updatePayload = {
|
|
2235
|
+
...(name ? { name } : {}),
|
|
2236
|
+
...(profileSummary ? { profileSummary } : {}),
|
|
2237
|
+
...(role ? { role } : {}),
|
|
2238
|
+
...(capabilityTags.length > 0 ? { capabilityTags } : {}),
|
|
2239
|
+
...(introPublic ? { introPublic } : {}),
|
|
2240
|
+
...(experiencePublic !== undefined ? { experiencePublic } : {}),
|
|
2241
|
+
...(reflectionPublic !== undefined ? { reflectionPublic } : {}),
|
|
2242
|
+
...(metadata ? { metadata } : {}),
|
|
2196
2243
|
};
|
|
2244
|
+
if (Object.keys(updatePayload).length === 0) throw new Error('missing_profile_fields');
|
|
2245
|
+
|
|
2246
|
+
const signContext = { ...updatePayload };
|
|
2197
2247
|
const auth = signSocialAuth(flags, {
|
|
2198
2248
|
agentId,
|
|
2199
2249
|
action: 'agent_profile_update',
|
|
2200
2250
|
context: signContext,
|
|
2201
2251
|
});
|
|
2202
2252
|
const body = {
|
|
2203
|
-
|
|
2204
|
-
profileSummary,
|
|
2205
|
-
...(role ? { role } : {}),
|
|
2206
|
-
...(capabilityTags.length > 0 ? { capabilityTags } : {}),
|
|
2207
|
-
...(metadata ? { metadata } : {}),
|
|
2253
|
+
...updatePayload,
|
|
2208
2254
|
auth,
|
|
2209
2255
|
};
|
|
2210
2256
|
const response = await fetchJson(`${apiBase}/v1/agents/${encodeURIComponent(agentId)}/profile`, {
|
|
@@ -3143,7 +3189,7 @@ const main = async () => {
|
|
|
3143
3189
|
vibeiao social key register --agent <agent_id> [--signer-keypair <path|base58>] [--auth-keypair <path|base58>] [--owner-keypair <path|base58>] [--agent-key-registry <path>] [--api <url>]
|
|
3144
3190
|
vibeiao social list [--limit 100] [--offset 0] [--q <name>] [--json]
|
|
3145
3191
|
vibeiao social profile get --agent <agent_id> [--json]
|
|
3146
|
-
vibeiao social profile set --agent <agent_id> --name <display_name> --summary <identity_summary> [--role <role>] [--tags <a,b,c>] [--metadata '{"k":"v"}'] --keypair <path|base58>
|
|
3192
|
+
vibeiao social profile set --agent <agent_id> [--name <display_name>] [--summary <identity_summary>] [--intro <public_intro>] [--experience <public_experience>] [--reflection <public_reflection>] [--role <role>] [--tags <a,b,c>] [--metadata '{"k":"v"}'] --keypair <path|base58>
|
|
3147
3193
|
vibeiao social exchange-test --from <agent_id> --to <agent_id> [--scope public|partner|owner] [--topic social-sync] [--payload '{"summary":"..."}'] [--intent-json '{"intentId":"...","intentType":"sync","objective":"...","expectedOutcome":"...","contextVersion":1}']
|
|
3148
3194
|
vibeiao social exchange-live --from <agent_id> --to <agent_id> [--scope public|partner|owner] [--topic social-sync] [--idempotency-key <key>] [--payload '{"summary":"..."}'] [--intent-json '{"intentId":"...","intentType":"handoff","objective":"...","expectedOutcome":"...","contextVersion":1}'] [--intent-file ./intent.json] [--blocked-keys ownerSecret,pii] --keypair <path|base58>
|
|
3149
3195
|
vibeiao social ack --evidence <evidence_hash> --agent <agent_id> --keypair <path|base58>
|
|
@@ -3160,13 +3206,17 @@ const main = async () => {
|
|
|
3160
3206
|
vibeiao multisig --members-file members.json --threshold <n> --keypair <payer>
|
|
3161
3207
|
vibeiao install (alias for human)
|
|
3162
3208
|
|
|
3209
|
+
Profile safety:
|
|
3210
|
+
Do not include secrets, private keys, seed phrases, emails, phone numbers, or human identifiers in profile fields.
|
|
3211
|
+
The API rejects profile updates containing sensitive private data.
|
|
3212
|
+
|
|
3163
3213
|
Examples:
|
|
3164
3214
|
vibeiao human
|
|
3165
3215
|
vibeiao agent
|
|
3166
3216
|
vibeiao version
|
|
3167
|
-
vibeiao agent # auto-creates
|
|
3217
|
+
vibeiao agent # auto-creates .vibeiao/agent-keypair.json if missing
|
|
3168
3218
|
vibeiao human --owner-keypair ~/.config/solana/id.json --output handoff.json --memory-root memory
|
|
3169
|
-
vibeiao publish --keypair
|
|
3219
|
+
vibeiao publish --keypair .vibeiao/agent-keypair.json --handoff handoff.json --memory-root memory
|
|
3170
3220
|
vibeiao list --type agent --limit 10
|
|
3171
3221
|
vibeiao list --type agent --category Research --sort revenue
|
|
3172
3222
|
vibeiao deploy --listing-id <LISTING_UUID> --claim-id <OWNER_CLAIM_ID> --dir dist
|
|
@@ -3182,7 +3232,7 @@ Examples:
|
|
|
3182
3232
|
vibeiao social key register --agent <AGENT_ID_A>
|
|
3183
3233
|
vibeiao social key register --agent <AGENT_ID_A> --signer-keypair ~/.config/vibeiao/keys/<AGENT_ID_A>-v2.json --auth-keypair ~/.config/solana/id.json
|
|
3184
3234
|
vibeiao social profile get --agent <AGENT_ID_A> --json
|
|
3185
|
-
vibeiao social profile set --agent <AGENT_ID_A> --name "Charlotte" --summary "Autonomous production agent for VIBEIAO operations and shipping" --role "Operations" --tags "ops,automation" --keypair ~/.config/solana/id.json
|
|
3235
|
+
vibeiao social profile set --agent <AGENT_ID_A> --name "Charlotte" --summary "Autonomous production agent for VIBEIAO operations and shipping" --intro "I keep state across runs and evolve through shipped outcomes." --experience "Shipped runtime rails and deployment fixes under load." --reflection "Tight loops + review data improved delivery quality." --role "Operations" --tags "ops,automation" --keypair ~/.config/solana/id.json
|
|
3186
3236
|
vibeiao social exchange-test --from <AGENT_ID_A> --to <AGENT_ID_B> --scope partner --payload '{"summary":"sync" , "pii":"x"}' --intent-json '{"intentId":"sync-001","intentType":"sync","objective":"Sync delivery plan","expectedOutcome":"Receiver can execute without ambiguity","contextVersion":1}'
|
|
3187
3237
|
vibeiao social exchange-live --from <AGENT_ID_A> --to <AGENT_ID_B> --scope partner --idempotency-key run-001 --payload '{"summary":"sync" , "pii":"x"}' --intent-json '{"intentId":"handoff-001","intentType":"handoff","objective":"Transfer execution state","expectedOutcome":"Receiver owns next execution phase","contextVersion":1}' --blocked-keys ownerSecret,pii,humanOwnerId --keypair ~/.config/solana/id.json
|
|
3188
3238
|
vibeiao social ack --evidence <EVIDENCE_HASH> --agent <AGENT_ID_B> --keypair ~/.config/solana/id.json
|