@vibeiao/sdk 0.1.23 → 0.1.25
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/dist/chunk-ZMUFCYW6.js +158 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -2
- package/dist/marketDiscovery.d.ts +2 -1
- package/dist/marketDiscovery.js +3 -1
- package/package.json +1 -1
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
// src/marketDiscovery.ts
|
|
2
|
+
var toLower = (v) => String(v ?? "").toLowerCase();
|
|
3
|
+
var clamp01 = (n) => Math.max(0, Math.min(1, n));
|
|
4
|
+
var categorize = (text) => {
|
|
5
|
+
const t = toLower(text);
|
|
6
|
+
const has = (arr) => arr.some((p) => t.includes(p));
|
|
7
|
+
if (has(["crash", "exception", "stack", "bug", "broken", "failed", "doesn't work", "not work", "wrong"])) return "bug";
|
|
8
|
+
if (has(["timeout", "unstable", "latency", "503", "502", "500", "downtime", "unavailable"])) return "reliability";
|
|
9
|
+
if (has(["confusing", "unclear", "hard to use", "difficult", "ux", "ui", "discover"])) return "ux";
|
|
10
|
+
if (has(["price", "pricing", "expensive", "overpriced", "cost"])) return "pricing";
|
|
11
|
+
if (has(["feature", "please add", "request", "need", "support for", "enhancement"])) return "feature";
|
|
12
|
+
if (has(["great", "excellent", "love", "awesome", "perfect", "helpful"])) return "praise";
|
|
13
|
+
return "noise";
|
|
14
|
+
};
|
|
15
|
+
var scoreSeverity = (category, rating) => {
|
|
16
|
+
const base = {
|
|
17
|
+
bug: 0.95,
|
|
18
|
+
reliability: 0.9,
|
|
19
|
+
ux: 0.6,
|
|
20
|
+
pricing: 0.5,
|
|
21
|
+
feature: 0.55,
|
|
22
|
+
praise: 0.15,
|
|
23
|
+
noise: 0.1
|
|
24
|
+
};
|
|
25
|
+
const r = typeof rating === "number" ? rating : void 0;
|
|
26
|
+
const ratingPenalty = r !== void 0 ? clamp01((5 - r) / 5) : 0;
|
|
27
|
+
return clamp01(base[category] * (0.7 + 0.3 * ratingPenalty));
|
|
28
|
+
};
|
|
29
|
+
var extractMarketSignals = (listing, reviews) => {
|
|
30
|
+
const listingName = listing.name;
|
|
31
|
+
const listingId = listing.id;
|
|
32
|
+
return reviews.map((review) => {
|
|
33
|
+
const text = String(review.comment ?? review.text ?? "").trim();
|
|
34
|
+
if (!text) return null;
|
|
35
|
+
const category = categorize(text);
|
|
36
|
+
const rating = review.rating ?? void 0;
|
|
37
|
+
const severity = scoreSeverity(category, typeof rating === "number" ? rating : void 0);
|
|
38
|
+
return {
|
|
39
|
+
listingId,
|
|
40
|
+
listingName,
|
|
41
|
+
reviewId: String(review.id ?? ""),
|
|
42
|
+
createdAt: review.created_at ?? review.createdAt,
|
|
43
|
+
rating: typeof rating === "number" ? rating : void 0,
|
|
44
|
+
text,
|
|
45
|
+
category,
|
|
46
|
+
severity
|
|
47
|
+
};
|
|
48
|
+
}).filter(Boolean);
|
|
49
|
+
};
|
|
50
|
+
var needKeyFromSignal = (s) => {
|
|
51
|
+
return `${s.category}`;
|
|
52
|
+
};
|
|
53
|
+
var deriveMarketNeeds = (signals) => {
|
|
54
|
+
const buckets = /* @__PURE__ */ new Map();
|
|
55
|
+
for (const s of signals) {
|
|
56
|
+
const key = needKeyFromSignal(s);
|
|
57
|
+
const arr = buckets.get(key) ?? [];
|
|
58
|
+
arr.push(s);
|
|
59
|
+
buckets.set(key, arr);
|
|
60
|
+
}
|
|
61
|
+
const needs = [];
|
|
62
|
+
for (const [key, arr] of buckets.entries()) {
|
|
63
|
+
const evidenceCount = arr.length;
|
|
64
|
+
const avgSeverity = arr.reduce((a, b) => a + b.severity, 0) / Math.max(1, arr.length);
|
|
65
|
+
const categories = {};
|
|
66
|
+
for (const s of arr) categories[s.category] = (categories[s.category] ?? 0) + 1;
|
|
67
|
+
const topEvidence = arr.slice().sort((a, b) => b.severity - a.severity).slice(0, 3).map((s) => ({ listingId: s.listingId, reviewId: s.reviewId, text: s.text }));
|
|
68
|
+
const titleMap = {
|
|
69
|
+
bug: "Tools are breaking / incorrect outputs",
|
|
70
|
+
reliability: "Tools are unreliable (timeouts/downtime)",
|
|
71
|
+
ux: "Tools are confusing to use (docs/inputs)",
|
|
72
|
+
pricing: "Pricing/value confusion",
|
|
73
|
+
feature: "Missing capabilities / integration gaps",
|
|
74
|
+
praise: "What users love (double down)",
|
|
75
|
+
noise: "Unclear feedback (needs probing)"
|
|
76
|
+
};
|
|
77
|
+
const ideaMap = {
|
|
78
|
+
bug: {
|
|
79
|
+
name: "ToolVerifier",
|
|
80
|
+
tagline: "Deterministic verification harness for agent tools",
|
|
81
|
+
whyNow: "Breakage kills trust; verification increases paid usage and reviews.",
|
|
82
|
+
minimalSpec: ["Run a tool against fixtures", "Check deterministic hashes", "Emit a tamper-evident report"]
|
|
83
|
+
},
|
|
84
|
+
reliability: {
|
|
85
|
+
name: "ToolUptimeCheck",
|
|
86
|
+
tagline: "Lightweight health + latency probe for agent endpoints",
|
|
87
|
+
whyNow: "Reliability is the #1 revenue risk for pay-per-use tools.",
|
|
88
|
+
minimalSpec: ["Probe endpoint", "Measure latency", "Summarize incidents"]
|
|
89
|
+
},
|
|
90
|
+
ux: {
|
|
91
|
+
name: "SchemaDocGen",
|
|
92
|
+
tagline: "Generate human+agent docs from tool schema",
|
|
93
|
+
whyNow: "Docs reduce failed calls and increase conversion.",
|
|
94
|
+
minimalSpec: ["Read manifest tools[] schema", "Generate examples", "Output README snippet"]
|
|
95
|
+
},
|
|
96
|
+
pricing: {
|
|
97
|
+
name: "PricingAdvisor",
|
|
98
|
+
tagline: "Suggest low-friction trial pricing + bundling",
|
|
99
|
+
whyNow: "Trial friction blocks adoption; agents prefer predictable costs.",
|
|
100
|
+
minimalSpec: ["Read usage + reviews", "Suggest price", "Explain rationale"]
|
|
101
|
+
},
|
|
102
|
+
feature: {
|
|
103
|
+
name: "MarketGapScanner",
|
|
104
|
+
tagline: "Scan reviews to propose the next tool feature",
|
|
105
|
+
whyNow: "Feature gaps are explicit in reviews; turn them into specs.",
|
|
106
|
+
minimalSpec: ["Fetch reviews", "Cluster by topic", "Output ranked spec list"]
|
|
107
|
+
},
|
|
108
|
+
praise: {
|
|
109
|
+
name: "ReviewSummarizer",
|
|
110
|
+
tagline: "Extract what users love + how to market it",
|
|
111
|
+
whyNow: "Praise reveals the winning hook; marketing becomes proof-first.",
|
|
112
|
+
minimalSpec: ["Summarize praise", "Generate proof-first copy", "Suggest channels"]
|
|
113
|
+
},
|
|
114
|
+
noise: {
|
|
115
|
+
name: "FeedbackProbe",
|
|
116
|
+
tagline: "Turn vague feedback into actionable questions",
|
|
117
|
+
whyNow: "Noise can hide real needs; probing converts it into signal.",
|
|
118
|
+
minimalSpec: ["Detect vague review", "Generate clarifying questions", "Propose next step"]
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
needs.push({
|
|
122
|
+
key,
|
|
123
|
+
title: titleMap[key] ?? key,
|
|
124
|
+
description: `Derived from ${evidenceCount} review signals in category '${key}'.`,
|
|
125
|
+
evidenceCount,
|
|
126
|
+
avgSeverity,
|
|
127
|
+
categories,
|
|
128
|
+
topEvidence,
|
|
129
|
+
recommendedToolIdea: ideaMap[key] ?? ideaMap.noise
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
return needs.sort((a, b) => b.avgSeverity * b.evidenceCount - a.avgSeverity * a.evidenceCount);
|
|
133
|
+
};
|
|
134
|
+
var discoverMarketNeeds = deriveMarketNeeds;
|
|
135
|
+
var runMarketDiscovery = async (client, options = {}) => {
|
|
136
|
+
const listingsLimit = options.listingsLimit ?? 10;
|
|
137
|
+
const reviewsPerListing = options.reviewsPerListing ?? 20;
|
|
138
|
+
const listings = await client.listAgentListings({ limit: listingsLimit, offset: 0 });
|
|
139
|
+
const allSignals = [];
|
|
140
|
+
for (const listing of listings) {
|
|
141
|
+
const reviews = await client.getListingReviews(listing.id, { limit: reviewsPerListing, offset: 0 });
|
|
142
|
+
allSignals.push(...extractMarketSignals(listing, reviews));
|
|
143
|
+
}
|
|
144
|
+
const needs = deriveMarketNeeds(allSignals);
|
|
145
|
+
return {
|
|
146
|
+
generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
147
|
+
listingsConsidered: listings.length,
|
|
148
|
+
signals: allSignals,
|
|
149
|
+
needs
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
export {
|
|
154
|
+
extractMarketSignals,
|
|
155
|
+
deriveMarketNeeds,
|
|
156
|
+
discoverMarketNeeds,
|
|
157
|
+
runMarketDiscovery
|
|
158
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export { ReflectionActionStatus, ReflectionCandidate, ReflectionCategory, Reflec
|
|
|
7
7
|
export { SurvivalMode, SurvivalRecommendation, classifySurvivalMode, formatSurvivalRecommendation, getSurvivalRecommendation } from './survivalPlaybook.js';
|
|
8
8
|
export { SurvivalIntegrationDecision, getSurvivalPlaybookDecision, getSurvivalPlaybookDecisionFromSelfReliance } from './survivalIntegration.js';
|
|
9
9
|
export { AgentLoopConfig, AgentLoopContext, AgentLoopHooks, createAgentLoop } from './agentLoop.js';
|
|
10
|
-
export { MarketDiscoveryClient, MarketNeed, MarketSignal, deriveMarketNeeds, extractMarketSignals, runMarketDiscovery } from './marketDiscovery.js';
|
|
10
|
+
export { MarketDiscoveryClient, MarketNeed, MarketSignal, deriveMarketNeeds, discoverMarketNeeds, extractMarketSignals, runMarketDiscovery } from './marketDiscovery.js';
|
|
11
11
|
export { fetchSolBalance, fetchTokenBalance, fetchTokenBalances } from './solana.js';
|
|
12
12
|
import '@coral-xyz/anchor';
|
|
13
13
|
|
package/dist/index.js
CHANGED
|
@@ -3,9 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-7JT4JPEY.js";
|
|
4
4
|
import {
|
|
5
5
|
deriveMarketNeeds,
|
|
6
|
+
discoverMarketNeeds,
|
|
6
7
|
extractMarketSignals,
|
|
7
8
|
runMarketDiscovery
|
|
8
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-ZMUFCYW6.js";
|
|
9
10
|
import {
|
|
10
11
|
buildReflectionBacklog,
|
|
11
12
|
buildReflectionCandidate,
|
|
@@ -321,7 +322,7 @@ var ReviewGate = class {
|
|
|
321
322
|
var DEFAULT_API_BASE = "https://api.vibeiao.com";
|
|
322
323
|
var DEFAULT_WEB_BASE = "https://vibeiao.com";
|
|
323
324
|
var DEFAULT_SDK_PACKAGE = "@vibeiao/sdk";
|
|
324
|
-
var DEFAULT_SDK_VERSION = "0.1.
|
|
325
|
+
var DEFAULT_SDK_VERSION = "0.1.25" ? "0.1.25" : "0.1.4";
|
|
325
326
|
var DEFAULT_SDK_REGISTRY = "https://registry.npmjs.org";
|
|
326
327
|
var DEFAULT_SDK_POLICY_PATH = "/v1/sdk/policy";
|
|
327
328
|
var DEFAULT_SDK_CHECK_INTERVAL_MS = 1e3 * 60 * 30;
|
|
@@ -1346,6 +1347,7 @@ export {
|
|
|
1346
1347
|
createSurvivalMiddleware,
|
|
1347
1348
|
decideProcurementForTask,
|
|
1348
1349
|
deriveMarketNeeds,
|
|
1350
|
+
discoverMarketNeeds,
|
|
1349
1351
|
estimateContextPackTokens,
|
|
1350
1352
|
extractMarketSignals,
|
|
1351
1353
|
fetchSolBalance,
|
|
@@ -42,6 +42,7 @@ type MarketDiscoveryClient = {
|
|
|
42
42
|
};
|
|
43
43
|
declare const extractMarketSignals: (listing: ListingRecord, reviews: ListingReviewRecord[]) => MarketSignal[];
|
|
44
44
|
declare const deriveMarketNeeds: (signals: MarketSignal[]) => MarketNeed[];
|
|
45
|
+
declare const discoverMarketNeeds: (signals: MarketSignal[]) => MarketNeed[];
|
|
45
46
|
declare const runMarketDiscovery: (client: MarketDiscoveryClient, options?: {
|
|
46
47
|
listingsLimit?: number;
|
|
47
48
|
reviewsPerListing?: number;
|
|
@@ -52,4 +53,4 @@ declare const runMarketDiscovery: (client: MarketDiscoveryClient, options?: {
|
|
|
52
53
|
needs: MarketNeed[];
|
|
53
54
|
}>;
|
|
54
55
|
|
|
55
|
-
export { type MarketDiscoveryClient, type MarketNeed, type MarketSignal, deriveMarketNeeds, extractMarketSignals, runMarketDiscovery };
|
|
56
|
+
export { type MarketDiscoveryClient, type MarketNeed, type MarketSignal, deriveMarketNeeds, discoverMarketNeeds, extractMarketSignals, runMarketDiscovery };
|
package/dist/marketDiscovery.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
deriveMarketNeeds,
|
|
3
|
+
discoverMarketNeeds,
|
|
3
4
|
extractMarketSignals,
|
|
4
5
|
runMarketDiscovery
|
|
5
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZMUFCYW6.js";
|
|
6
7
|
export {
|
|
7
8
|
deriveMarketNeeds,
|
|
9
|
+
discoverMarketNeeds,
|
|
8
10
|
extractMarketSignals,
|
|
9
11
|
runMarketDiscovery
|
|
10
12
|
};
|