vibeiao 0.1.5 → 0.1.6
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 +40 -15
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -567,6 +567,7 @@ const buildAutonomousBootstrapListing = async ({ apiBase, walletAddress, memoryR
|
|
|
567
567
|
version: '1.0.0',
|
|
568
568
|
selfReliance: buildSelfRelianceTemplate(),
|
|
569
569
|
memory: buildMemoryConfig(memoryRoot),
|
|
570
|
+
resourceProviders: buildResourceProvidersTemplate(),
|
|
570
571
|
};
|
|
571
572
|
const manifestUrl = await createBootstrapManifestUrl(apiBase, manifest);
|
|
572
573
|
|
|
@@ -593,10 +594,12 @@ const buildAutonomousBootstrapListing = async ({ apiBase, walletAddress, memoryR
|
|
|
593
594
|
|
|
594
595
|
const formatCliError = (err) => {
|
|
595
596
|
const message = err?.message || String(err);
|
|
597
|
+
const details = err?.details;
|
|
598
|
+
const detailsText = details ? `\nDetails: ${typeof details === 'string' ? details : JSON.stringify(details)}` : '';
|
|
596
599
|
if (message.includes("reading '_bn'")) {
|
|
597
|
-
return `${message}\nHint: likely Program ID / IDL mismatch. Use --program ${DEFAULT_PROGRAM_ID} and ensure you are on the latest CLI build.`;
|
|
600
|
+
return `${message}${detailsText}\nHint: likely Program ID / IDL mismatch. Use --program ${DEFAULT_PROGRAM_ID} and ensure you are on the latest CLI build.`;
|
|
598
601
|
}
|
|
599
|
-
return message
|
|
602
|
+
return `${message}${detailsText}`;
|
|
600
603
|
};
|
|
601
604
|
|
|
602
605
|
const normalizeListingText = (value) =>
|
|
@@ -951,24 +954,38 @@ const handleHuman = async (flags) => {
|
|
|
951
954
|
const rpcUrl =
|
|
952
955
|
flags.rpc || process.env.VIBEIAO_RPC_URL || process.env.SOLANA_RPC_URL || DEFAULT_RPC;
|
|
953
956
|
const programId = flags.program || process.env.VIBEIAO_PROGRAM_ID || DEFAULT_PROGRAM_ID;
|
|
954
|
-
const interactive =
|
|
957
|
+
const interactive = !!flags.interactive;
|
|
958
|
+
const claimOnly = flags['claim-only'] !== undefined || flags['owner-claim-only'] !== undefined
|
|
959
|
+
? !!(flags['claim-only'] || flags['owner-claim-only'])
|
|
960
|
+
: !interactive;
|
|
955
961
|
|
|
962
|
+
// Humans should not be forced to decide listing/product details during onboarding.
|
|
963
|
+
// Default human flow to a "human" listing type unless explicitly overridden.
|
|
956
964
|
const defaultConfig = resolveInputFile({
|
|
957
965
|
explicit: flags.config,
|
|
958
966
|
fallback: DEFAULT_AGENT_CONFIG_FILE,
|
|
959
967
|
label: 'config',
|
|
960
968
|
});
|
|
961
969
|
const listingFlags = defaultConfig ? { ...flags, config: defaultConfig } : flags;
|
|
962
|
-
const
|
|
963
|
-
|
|
964
|
-
|
|
970
|
+
const effectiveListingFlags =
|
|
971
|
+
claimOnly || listingFlags['listing-type']
|
|
972
|
+
? listingFlags
|
|
973
|
+
: { ...listingFlags, 'listing-type': 'human' };
|
|
974
|
+
|
|
975
|
+
const quotedListing = claimOnly
|
|
976
|
+
? null
|
|
977
|
+
: await applyPriceQuote(await resolveListing(effectiveListingFlags, { interactive }), flags);
|
|
978
|
+
if (quotedListing) {
|
|
979
|
+
validateListing(quotedListing);
|
|
980
|
+
}
|
|
981
|
+
|
|
965
982
|
const memoryRoot = String(flags['memory-root'] || DEFAULT_MEMORY_ROOT);
|
|
966
983
|
const memoryConfig = buildMemoryConfig(memoryRoot);
|
|
967
984
|
|
|
968
985
|
const walletMode = (
|
|
969
986
|
flags['wallet-mode'] ||
|
|
970
987
|
flags.ownership ||
|
|
971
|
-
quotedListing
|
|
988
|
+
quotedListing?.walletMode ||
|
|
972
989
|
'single'
|
|
973
990
|
).toLowerCase();
|
|
974
991
|
const ownerKeypairInput = flags['owner-keypair'];
|
|
@@ -976,10 +993,10 @@ const handleHuman = async (flags) => {
|
|
|
976
993
|
const ownerWallet =
|
|
977
994
|
ownerKeypair?.publicKey?.toBase58?.() ||
|
|
978
995
|
flags['owner-wallet'] ||
|
|
979
|
-
quotedListing
|
|
996
|
+
quotedListing?.ownerWallet ||
|
|
980
997
|
'';
|
|
981
|
-
const revenueWallet = flags['revenue-wallet'] || quotedListing
|
|
982
|
-
const ethWallet = flags['eth-wallet'] || quotedListing
|
|
998
|
+
const revenueWallet = flags['revenue-wallet'] || quotedListing?.revenueWallet || '';
|
|
999
|
+
const ethWallet = flags['eth-wallet'] || quotedListing?.ethWallet || '';
|
|
983
1000
|
|
|
984
1001
|
let ownerClaimId = null;
|
|
985
1002
|
if (ownerKeypair) {
|
|
@@ -994,11 +1011,11 @@ const handleHuman = async (flags) => {
|
|
|
994
1011
|
);
|
|
995
1012
|
}
|
|
996
1013
|
|
|
997
|
-
const agentWallet = flags.wallet || quotedListing
|
|
1014
|
+
const agentWallet = flags.wallet || quotedListing?.agentWallet || '';
|
|
998
1015
|
let claim = null;
|
|
999
1016
|
let message = null;
|
|
1000
1017
|
if (agentWallet) {
|
|
1001
|
-
const purpose = quotedListing
|
|
1018
|
+
const purpose = quotedListing?.listingType === 'agent' ? 'agent_register' : 'owner_claim';
|
|
1002
1019
|
claim = await createClaim(apiBase, agentWallet, purpose);
|
|
1003
1020
|
message = buildClaimMessage(claim.data.nonce);
|
|
1004
1021
|
}
|
|
@@ -1019,6 +1036,12 @@ const handleHuman = async (flags) => {
|
|
|
1019
1036
|
ownerClaimId,
|
|
1020
1037
|
},
|
|
1021
1038
|
listing: quotedListing,
|
|
1039
|
+
onboarding: {
|
|
1040
|
+
mode: claimOnly ? 'claim-only' : 'interactive',
|
|
1041
|
+
note: claimOnly
|
|
1042
|
+
? 'Human onboarding ran in claim-only mode. Listing/product metadata is intentionally omitted.'
|
|
1043
|
+
: 'Human onboarding included listing metadata (legacy behavior).',
|
|
1044
|
+
},
|
|
1022
1045
|
createdAt: new Date().toISOString(),
|
|
1023
1046
|
};
|
|
1024
1047
|
|
|
@@ -1073,8 +1096,10 @@ const handleAgent = async (flags) => {
|
|
|
1073
1096
|
console.log(' Keep this file safe. It controls your on-chain agent wallet.');
|
|
1074
1097
|
}
|
|
1075
1098
|
const memoryRoot = String(flags['memory-root'] || handoff?.memory?.root || DEFAULT_MEMORY_ROOT);
|
|
1099
|
+
const hasHandoffListing =
|
|
1100
|
+
!!(handoff && handoff.listing && typeof handoff.listing === 'object');
|
|
1076
1101
|
const noListingInput =
|
|
1077
|
-
!
|
|
1102
|
+
!hasHandoffListing &&
|
|
1078
1103
|
!listingFlags.config &&
|
|
1079
1104
|
!flags.name &&
|
|
1080
1105
|
!flags.tagline &&
|
|
@@ -1083,7 +1108,7 @@ const handleAgent = async (flags) => {
|
|
|
1083
1108
|
!flags.endpoint &&
|
|
1084
1109
|
!flags.manifest &&
|
|
1085
1110
|
!flags.runtime;
|
|
1086
|
-
const listing =
|
|
1111
|
+
const listing = hasHandoffListing
|
|
1087
1112
|
? normalizeListing(handoff.listing)
|
|
1088
1113
|
: noListingInput
|
|
1089
1114
|
? await buildAutonomousBootstrapListing({
|
|
@@ -1577,7 +1602,7 @@ const main = async () => {
|
|
|
1577
1602
|
console.log(`VibeIAO CLI
|
|
1578
1603
|
|
|
1579
1604
|
Usage:
|
|
1580
|
-
vibeiao human [--config agent.json] [--owner-keypair <path|base58>] [--owner-wallet <pubkey>] [--wallet-mode single|multisig] [--memory-root memory] [--output handoff.json] [--stdout]
|
|
1605
|
+
vibeiao human [--claim-only] [--config agent.json] [--owner-keypair <path|base58>] [--owner-wallet <pubkey>] [--wallet-mode single|multisig] [--memory-root memory] [--output handoff.json] [--stdout]
|
|
1581
1606
|
vibeiao agent [--config agent.json] [--keypair <path|base58>] [--handoff handoff.json] [--memory-root memory] [--owner-claim <id>]
|
|
1582
1607
|
(optional) --runtime openrouter --runtime-config runtime.json
|
|
1583
1608
|
vibeiao list [--type agent|human|all] [--limit 10] [--offset 0] [--category <name>] [--sort recent|revenue|tickets|buyback] [--json]
|