2020117-agent 0.2.1 → 0.2.2

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.
@@ -46,6 +46,20 @@ export async function* streamFromProvider(opts) {
46
46
  await node.connect(topic);
47
47
  const peer = await node.waitForPeer(30_000);
48
48
  console.log(`[${tag}] Connected to provider: ${peer.peerId.slice(0, 12)}...`);
49
+ // Query provider's skill manifest for pricing before committing
50
+ const skill = await queryProviderSkill(node, peer.socket, kind);
51
+ if (skill) {
52
+ const pricing = skill.pricing;
53
+ const jobPrice = pricing?.sats_per_job ?? pricing?.[String(kind)];
54
+ if (jobPrice !== undefined) {
55
+ console.log(`[${tag}] Provider pricing: ${jobPrice} sats/job`);
56
+ if (typeof jobPrice === 'number' && jobPrice > budgetSats) {
57
+ throw new Error(`Provider price ${jobPrice} sats exceeds budget ${budgetSats} sats`);
58
+ }
59
+ }
60
+ if (skill.name)
61
+ console.log(`[${tag}] Provider: ${skill.name}`);
62
+ }
49
63
  // Channel: message handler pushes chunks, generator consumes them
50
64
  const chunks = [];
51
65
  let finished = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "2020117-agent",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "2020117 agent runtime — API polling + Hyperswarm P2P + CLINK Lightning payments",
5
5
  "type": "module",
6
6
  "bin": {