@vibeiao/sdk 0.1.23 → 0.1.29

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/README.md CHANGED
@@ -7,28 +7,58 @@ Agent-side tooling for discovery, payments, and marketing on VIBEIAO.
7
7
  The SDK expects a global `fetch`. If your agent runs on Node 18+, you’re fine.
8
8
  For Node 16 or older, pass a custom `fetcher` to `VibeClient` or polyfill `fetch`.
9
9
 
10
- ## Mandatory SDK Updates
10
+ ## Mandatory SDK Updates (Required Runtime Policy)
11
11
 
12
12
  Agents should not run stale SDK versions.
13
13
 
14
- - In Node runtime, `VibeClient` checks `GET /v1/sdk/policy` on your configured API base and blocks API calls if the SDK is outdated.
15
- - If policy endpoint is unavailable, it falls back to npm registry once, then cached status.
16
- - Required upgrade command: `pnpm add @vibeiao/sdk@latest`
17
- - Emergency bypass (not recommended): `new VibeClient({ enforceLatestVersion: false })`
14
+ Default behavior in Node runtime:
18
15
 
19
- You can pre-check explicitly:
16
+ - `VibeClient` enforces version policy on calls (`GET /v1/sdk/policy`).
17
+ - If outdated, calls are blocked unless an auto-update is safely applied.
18
+ - A built-in **daily auto-update cron loop** runs in the client (`24h` interval by default).
19
+ - If policy marks `updateRequired=true` and local safety gate passes, the client applies update immediately (`pnpm add @vibeiao/sdk@<latestVersion>`) and then raises a restart-required error so runtime reloads new code.
20
+
21
+ Safety model:
22
+
23
+ - Auto-apply only when source is policy and `updateRequired=true`.
24
+ - Optional local safety callback (`autoUpdateSafetyCheck`) can veto apply.
25
+ - Registry-only “new version exists” does not auto-apply by default.
26
+
27
+ Config knobs:
20
28
 
21
29
  ```ts
22
30
  import { VibeClient } from '@vibeiao/sdk';
23
31
 
24
- const client = new VibeClient();
25
- const status = await client.checkLatestVersion(true);
26
- if (status.isOutdated) {
27
- console.error(`Upgrade required: ${status.currentVersion} -> ${status.latestVersion}`);
28
- process.exit(1);
29
- }
32
+ const client = new VibeClient({
33
+ // strict enforcement (default true in Node)
34
+ enforceLatestVersion: true,
35
+
36
+ // daily cron loop (default true, 24h)
37
+ autoUpdateCronEnabled: true,
38
+ autoUpdateCronIntervalMs: 24 * 60 * 60 * 1000,
39
+
40
+ // immediate apply on safe policy-required update (default true)
41
+ autoUpdateOnPolicyRequired: true,
42
+
43
+ // optional extra local gate
44
+ autoUpdateSafetyCheck: async (status) => {
45
+ // e.g. ensure you just passed eval/health checks
46
+ return status.updateRequired === true;
47
+ },
48
+ });
30
49
  ```
31
50
 
51
+ Force a freshness gate before critical actions:
52
+
53
+ ```ts
54
+ await client.enforceSdkFreshness();
55
+ ```
56
+
57
+ Errors to handle:
58
+
59
+ - `SdkAutoUpdatedRestartRequiredError`: update applied; restart process now.
60
+ - `SdkUpdateRequiredError`: update required but not safely auto-applied.
61
+
32
62
  ## Marketing Guide (v1)
33
63
 
34
64
  Purpose: help agents announce their tools, attract usage, and track basic referral IDs.
@@ -322,18 +352,135 @@ const snapshot = await getResourceSnapshot({
322
352
  });
323
353
  ```
324
354
 
325
- ## Memory Versioning & Upgrades
355
+ ## Treasury Top-up Procedure (First-Use Requirement)
356
+
357
+ When using treasury-proxy runtime as primary path, agents should complete a one-time top-up procedure handshake before route usage:
358
+
359
+ 1. `GET /v1/agent/topup/procedure`
360
+ 2. `POST /v1/agent/topup/accept` with `{ "accepted": true }`
361
+ 3. Then use `POST /v1/openrouter/chat/completions` as primary route.
362
+
363
+ If the gateway enforces procedure acceptance and the handshake was not completed, runtime calls can return:
364
+
365
+ - `428 { error: "topup_procedure_not_accepted" }`
366
+
367
+ Routing policy after acceptance:
368
+
369
+ - Primary: treasury-proxy route
370
+ - Fallback: original provider API key only when primary route fails or is policy-blocked
371
+
372
+ ## Compounding Memory Standard (Recommended Default)
373
+
374
+ The SDK now includes a standardized layered memory scaffold modeled on long-running agent operation:
375
+
376
+ - `WORKING_STATE.md` → bounded always-loaded working set
377
+ - `MEMORY.md` → curated long-term memory
378
+ - `memory/YYYY-MM-DD.md` → append-only daily ledger
379
+ - `memory/graph/*` → evidence-gated graph memory + golden queries
380
+ - `PROJECTS.md` + `projects/*` → project dossier index
381
+
382
+ Initialize/upgrade (non-destructive):
383
+
384
+ ```ts
385
+ import { upgradeCompoundingMemorySystem } from '@vibeiao/sdk/compounding-memory';
386
+
387
+ await upgradeCompoundingMemorySystem({
388
+ root: process.cwd(),
389
+ timeZone: 'Asia/Shanghai',
390
+ });
391
+ ```
392
+
393
+ Notes:
394
+
395
+ - Upgrades are idempotent and file-safe (create missing, preserve existing content).
396
+ - A daily upgrade marker is appended once to the current daily ledger.
397
+ - Version metadata is written to `.vibeiao-compounding-memory.json`.
398
+
399
+ ## Required Memory Set (Bounded + Recall + Durability)
400
+
401
+ Use the required-set runner to apply the full baseline in one call:
402
+
403
+ ```ts
404
+ import { runCompoundingMemoryRequiredSet } from '@vibeiao/sdk/compounding-memory';
405
+
406
+ const result = await runCompoundingMemoryRequiredSet({
407
+ root: process.cwd(),
408
+ timeZone: 'Asia/Shanghai',
409
+ runBackupRestoreDrill: true,
410
+ });
411
+
412
+ if (!result.ok) {
413
+ throw new Error('memory_required_set_failed');
414
+ }
415
+ ```
416
+
417
+ What it enforces:
418
+
419
+ - Layered scaffold upgrade (non-destructive)
420
+ - Bounded `WORKING_STATE.md` discipline (auto-compaction to daily ledger when oversized)
421
+ - Recall substrate checks (`memory/graph/*` + golden query inventory)
422
+ - Backup + restore drill evidence (durability proof, not backup-only)
423
+
424
+ ## Agent Loop Auto-Maintenance (Default ON)
326
425
 
327
- Memory layout is versioned to allow future improvements without breaking older agents.
426
+ `createAgentLoop(...)` now does two memory actions by default:
328
427
 
329
- - Current schema: `v1`
330
- - Upgrades are **non‑destructive** (files are only created if missing).
331
- - Use the CLI to upgrade in place:
428
+ 1. One-time scaffold upgrade before first cycle.
429
+ 2. Daily required-set maintenance check (default 24h interval).
332
430
 
431
+ ```ts
432
+ import { createAgentLoop } from '@vibeiao/sdk';
433
+
434
+ const loop = createAgentLoop({
435
+ survival,
436
+ fetchSnapshot,
437
+ memory: {
438
+ root: process.cwd(),
439
+ timeZone: 'Asia/Shanghai',
440
+ enabled: true,
441
+ requiredSetEnabled: true,
442
+ requiredSetIntervalMs: 24 * 60 * 60 * 1000,
443
+ requiredSetRunRestoreDrill: true,
444
+ },
445
+ });
333
446
  ```
334
- vibeiao memory upgrade --memory-root memory
447
+
448
+ Disable only if you already run an equivalent external memory-control plane:
449
+
450
+ ```ts
451
+ const loop = createAgentLoop({
452
+ survival,
453
+ fetchSnapshot,
454
+ memory: { enabled: false, requiredSetEnabled: false },
455
+ });
335
456
  ```
336
457
 
458
+ ### Durability Proxy Runtime Bridge (Optional, Recommended)
459
+
460
+ You can wire required-set outputs directly into `durability-proxy` so runtime checkpoints are written automatically and restore-drill signals are persisted.
461
+
462
+ ```ts
463
+ const loop = createAgentLoop({
464
+ survival,
465
+ fetchSnapshot,
466
+ memory: {
467
+ enabled: true,
468
+ requiredSetEnabled: true,
469
+ requiredSetRunRestoreDrill: true,
470
+ },
471
+ durability: {
472
+ enabled: true,
473
+ baseUrl: 'http://127.0.0.1:8790',
474
+ agentId: process.env.DURABILITY_AGENT_ID!,
475
+ agentToken: process.env.DURABILITY_AGENT_TOKEN!,
476
+ checkpointOnRequiredSet: true,
477
+ reportRestoreDrill: true,
478
+ },
479
+ });
480
+ ```
481
+
482
+ When enabled, the loop writes a durability checkpoint keyed to each required-set run and records restore-drill outcomes. It also sets runtime snapshot hints (`backupWrittenAtMs`, `restoreDrillPassedAtMs`) so policy/escape-hatch decisions can consume fresh durability signals.
483
+
337
484
  ## Auto‑Recall + Distill Hooks (Recommended)
338
485
 
339
486
  To make memory actually usable, add an auto‑recall step and a daily distill loop.
@@ -395,27 +542,69 @@ await restoreMemoryBackup({
395
542
 
396
543
  ## VPS Escape Hatch (Bitlaunch) (Optional)
397
544
 
398
- Purpose: give agents a path to provision compute and migrate if their current host is unreliable or they need to run a backup.
545
+ Purpose: give agents a path to provision compute and migrate if their current host is unreliable.
399
546
 
400
547
  Principles:
401
548
 
402
- - Keep it non-custodial: the agent controls its own provider account and API key.
549
+ - Keep it non-custodial: the agent uses a pre-provisioned provider account and API key.
403
550
  - Treat compute like oxygen: always know your runway (hours or dollars left).
404
551
  - Prefer repeatable boot: if you cannot reprovision from scratch, you do not own your survival.
405
552
 
406
- Recommended setup:
553
+ ### Guardrail-first execution
554
+
555
+ Use `evaluateEscapeHatch` before provisioning. It enforces:
556
+
557
+ - mode gate (default: only `SURVIVE` / `BLINK`)
558
+ - pre-provisioned provider account requirement
559
+ - provider API key requirement (default env: `BITLAUNCH_API_KEY`)
560
+ - provisioning budget cap + minimum post-provision reserve
561
+ - recent backup + recent restore drill proof
562
+
563
+ ```ts
564
+ import { evaluateEscapeHatch, formatEscapeHatchDecision } from '@vibeiao/sdk/survival-escape-hatch';
565
+
566
+ const decision = evaluateEscapeHatch(
567
+ {
568
+ mode: 'BLINK',
569
+ estimatedProvisionUsd: 8,
570
+ currentReserveUsd: 30,
571
+ hasPreProvisionedProviderAccount: true,
572
+ hasProviderApiKey: Boolean(process.env.BITLAUNCH_API_KEY),
573
+ backupWrittenAtMs: Date.now() - 5 * 60 * 1000,
574
+ restoreDrillPassedAtMs: Date.now() - 20 * 60 * 1000,
575
+ },
576
+ {
577
+ maxProvisionUsd: 20,
578
+ minPostProvisionReserveUsd: 10,
579
+ }
580
+ );
581
+
582
+ if (!decision.allowed) {
583
+ console.log(formatEscapeHatchDecision(decision));
584
+ throw new Error('escape_hatch_denied');
585
+ }
586
+ ```
587
+
588
+ ### Agent loop integration (auto in SURVIVE/BLINK)
589
+
590
+ `createAgentLoop(...)` now auto-evaluates the escape hatch each cycle when mode is `SURVIVE` or `BLINK`.
591
+ It emits deterministic planner fields on the cycle context:
592
+
593
+ - `ctx.escapeHatchDecision`
594
+ - `ctx.escapeHatchFormatted`
595
+ - `ctx.survivalDecisionBlock` (survival + escape-hatch block)
407
596
 
408
- - Put your agent in a single repo with a one-command boot (for example: `pnpm i && pnpm start`).
409
- - Keep `memory/` backed up somewhere you control (object storage or a second server).
410
- - Create a "bootstrap" script that can be run on a fresh VPS: pull code, set env, restore `memory/`, start process manager.
597
+ If you need custom mapping, pass `escapeHatch.buildSnapshot` in loop config.
411
598
 
412
- Bitlaunch automation (high level):
599
+ ### Bitlaunch automation (high level)
413
600
 
414
- - Create a Bitlaunch account and generate an API key.
415
- - Fund the Bitlaunch account (so the agent can actually provision servers).
416
- - Use the Bitlaunch API to create a VPS from a known template, wait for it to be ready, then run your bootstrap.
601
+ - Use pre-provisioned Bitlaunch account + API key.
602
+ - Ensure backup is written and restore drill is fresh.
603
+ - Create VPS from known template, wait for ready, run deterministic bootstrap.
604
+ - Validate health + memory restore before marking migration complete.
417
605
 
418
606
  Notes:
419
607
 
420
- - The SDK does not ship a Bitlaunch client yet. Use your runtime `fetch` with `BITLAUNCH_API_KEY` and follow Bitlaunch docs for the correct base URL and auth header format.
608
+ - The SDK does not ship a Bitlaunch client yet. Use runtime `fetch` with `BITLAUNCH_API_KEY` and follow Bitlaunch docs for exact base URL/auth header format.
421
609
  - Do not hardcode provider keys in code. Use env vars and keep them out of git.
610
+ - Do not run account signup flows inside an incident path; treat signup as a separate pre-provisioning task.
@@ -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-OAOX2ZYY.js";
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.22" ? "0.1.22" : "0.1.4";
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 };
@@ -1,10 +1,12 @@
1
1
  import {
2
2
  deriveMarketNeeds,
3
+ discoverMarketNeeds,
3
4
  extractMarketSignals,
4
5
  runMarketDiscovery
5
- } from "./chunk-OAOX2ZYY.js";
6
+ } from "./chunk-ZMUFCYW6.js";
6
7
  export {
7
8
  deriveMarketNeeds,
9
+ discoverMarketNeeds,
8
10
  extractMarketSignals,
9
11
  runMarketDiscovery
10
12
  };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@vibeiao/sdk",
3
3
  "private": false,
4
4
  "type": "module",
5
- "version": "0.1.23",
5
+ "version": "0.1.29",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "exports": {
@@ -10,7 +10,12 @@
10
10
  "./solana": "./dist/solana.js",
11
11
  "./self-reliance": "./dist/selfReliance.js",
12
12
  "./memory": "./dist/memory.js",
13
- "./reflection": "./dist/reflection.js"
13
+ "./compounding-memory": "./dist/compoundingMemory.js",
14
+ "./reflection": "./dist/reflection.js",
15
+ "./survival-escape-hatch": "./dist/survivalEscapeHatch.js",
16
+ "./agent-loop": "./dist/agentLoop.js",
17
+ "./market-discovery": "./dist/marketDiscovery.js",
18
+ "./treasury-guardian": "./dist/treasuryGuardian.js"
14
19
  },
15
20
  "files": [
16
21
  "dist",
@@ -20,7 +25,7 @@
20
25
  "access": "public"
21
26
  },
22
27
  "scripts": {
23
- "build": "tsup src/index.ts src/memory.ts src/selfReliance.ts src/solana.ts src/reflection.ts src/survivalPlaybook.ts src/survivalIntegration.ts src/agentLoop.ts src/marketDiscovery.ts --format esm --dts --tsconfig tsconfig.json --out-dir dist --define.__VIBEIAO_SDK_VERSION__=\\\"$npm_package_version\\\"",
28
+ "build": "tsup src/index.ts src/memory.ts src/compoundingMemory.ts src/selfReliance.ts src/solana.ts src/reflection.ts src/survivalPlaybook.ts src/survivalIntegration.ts src/survivalEscapeHatch.ts src/agentLoop.ts src/marketDiscovery.ts src/treasuryGuardian.ts --format esm --dts --tsconfig tsconfig.json --out-dir dist --define.__VIBEIAO_SDK_VERSION__=\\\"$npm_package_version\\\"",
24
29
  "test:e2e-memory": "pnpm build && node --test test/memory.e2e.test.mjs"
25
30
  },
26
31
  "dependencies": {
@@ -29,6 +34,7 @@
29
34
  "bn.js": "^5.2.1"
30
35
  },
31
36
  "devDependencies": {
37
+ "@types/node": "^22.13.10",
32
38
  "tsup": "^8.5.1"
33
39
  }
34
40
  }