@elisym/cli 0.6.1 → 0.7.1

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
@@ -89,16 +89,16 @@ docker run --rm -it \
89
89
 
90
90
  ## Commands
91
91
 
92
- | Command | Description |
93
- | ------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
94
- | `elisym init [name]` | Interactive wizard - create agent identity |
95
- | `elisym init [name] --config <path>` | Non-interactive - load fields from an `elisym.yaml` template |
96
- | `elisym init [name] --local` | Create in project `.elisym/<name>/` (default: `~/.elisym/<name>/`) |
97
- | `elisym start [name]` | Start agent in provider mode |
98
- | `elisym start [name] --verbose` | Start with structured debug logs to stderr (publish acks, pool resets, heartbeat, config resolution). Also togglable via `ELISYM_DEBUG=1` or `LOG_LEVEL=debug`. |
99
- | `elisym list` | List all agents (project-local + home-global) |
100
- | `elisym profile [name]` | Edit agent profile, wallet, and LLM settings |
101
- | `elisym wallet [name]` | Show Solana wallet balance |
92
+ | Command | Description |
93
+ | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
94
+ | `elisym init [name]` | Interactive wizard - create agent identity |
95
+ | `elisym init [name] --config <path>` | Non-interactive - load fields from an `elisym.yaml` template |
96
+ | `elisym init [name] --local` | Create in project `.elisym/<name>/` (default: `~/.elisym/<name>/`) |
97
+ | `elisym start [name]` | Start agent in provider mode |
98
+ | `elisym start [name] --verbose` | Start with structured debug logs to stderr (publish acks, pool resets, config resolution). Also togglable via `ELISYM_DEBUG=1` or `LOG_LEVEL=debug`. |
99
+ | `elisym list` | List all agents (project-local + home-global) |
100
+ | `elisym profile [name]` | Edit agent profile, wallet, and LLM settings |
101
+ | `elisym wallet [name]` | Show Solana wallet balance |
102
102
 
103
103
  Skills live inside each agent directory at `<agentDir>/skills/<skill-name>/SKILL.md`:
104
104
 
@@ -247,7 +247,7 @@ See `skills-examples/` for working skills: `youtube-summary`, `github-repo`, `st
247
247
  If `elisym start` prints `* Running. Press Ctrl+C to stop.` but no jobs ever arrive (common on WSL and Windows when outbound relay connectivity is blocked by the firewall or NAT), run with `--verbose`:
248
248
 
249
249
  ```
250
- elisym start --verbose
250
+ npx @elisym/cli start <agent-name> --verbose
251
251
  ```
252
252
 
253
253
  The debug firehose on stderr includes:
@@ -255,7 +255,6 @@ The debug firehose on stderr includes:
255
255
  - `config_resolved` - resolved agent dir, relays, RPC URL, Solana address.
256
256
  - `publish_ack` / `publish_failed` - one per kind:0 profile event and per kind:31990 capability card. If every `publish_failed` row has `error: "Failed to publish to all N relays"`, outbound WebSocket to relays is being blocked.
257
257
  - `pool_reset` with `reason: probe_failed` or `self_ping_failed` - the watchdog rebuilt the relay pool; sustained resets mean connectivity is unstable.
258
- - `heartbeat_failed` - periodic republish calls are failing.
259
258
 
260
259
  Optional deeper network diagnostics (DNS + TCP probe per relay host) are available via `ELISYM_NET_DIAG=1` (see `elisym start --help`).
261
260
 
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env -S node --no-deprecation
2
2
  import { readFileSync, readdirSync, statSync, renameSync, mkdirSync, writeFileSync } from 'node:fs';
3
3
  import { dirname, join, resolve, basename, relative, sep } from 'node:path';
4
- import { SolanaPaymentStrategy, validateAgentName, RELAYS, ElisymIdentity, formatSol, formatAssetAmount, ElisymClient, MediaService, jobRequestKind, DEFAULT_KIND_OFFSET, DEFAULTS, USDC_SOLANA_DEVNET, makeCensor, DEFAULT_REDACT_PATHS, createSlidingWindowLimiter, getProtocolProgramId, getProtocolConfig, LIMITS, calculateProtocolFee, BoundedSet, NATIVE_SOL } from '@elisym/sdk';
4
+ import { SolanaPaymentStrategy, validateAgentName, RELAYS, ElisymIdentity, formatSol, formatAssetAmount, ElisymClient, MediaService, jobRequestKind, DEFAULT_KIND_OFFSET, DEFAULTS, USDC_SOLANA_DEVNET, makeCensor, DEFAULT_REDACT_PATHS, toDTag, createSlidingWindowLimiter, getProtocolProgramId, getProtocolConfig, LIMITS, calculateProtocolFee, BoundedSet, NATIVE_SOL } from '@elisym/sdk';
5
5
  import { ElisymYamlSchema, resolveInHome, resolveInProject, createAgentDir, writeYaml, writeSecrets, listAgents, loadAgent, agentPaths, readMediaCache, lookupCachedUrl, newCacheEntry, writeMediaCache } from '@elisym/sdk/agent-store';
6
6
  import { isAddress, createSolanaRpc, address } from '@solana/kit';
7
7
  import { generateSecretKey, getPublicKey, nip19 } from 'nostr-tools';
@@ -617,7 +617,6 @@ async function probeRelays(relays, logger, timeoutMs = TCP_PROBE_TIMEOUT_MS) {
617
617
  }
618
618
  return results;
619
619
  }
620
- var HEARTBEAT_INTERVAL_MS = 10 * 60 * 1e3;
621
620
  var MAX_CONCURRENT_JOBS = 10;
622
621
  var RECOVERY_MAX_RETRIES = 5;
623
622
  var RECOVERY_INTERVAL_SECS = 60;
@@ -1622,8 +1621,6 @@ var AgentRuntime = class {
1622
1621
  }
1623
1622
  }
1624
1623
  };
1625
-
1626
- // src/skill/index.ts
1627
1624
  var SkillRegistry = class {
1628
1625
  skills = [];
1629
1626
  defaultIndex = null;
@@ -1635,7 +1632,7 @@ var SkillRegistry = class {
1635
1632
  }
1636
1633
  route(tags) {
1637
1634
  for (const tag of tags) {
1638
- const byName = this.skills.find((skill) => skill.name === tag);
1635
+ const byName = this.skills.find((skill) => toDTag(skill.name) === tag);
1639
1636
  if (byName) {
1640
1637
  return byName;
1641
1638
  }
@@ -1670,6 +1667,7 @@ var ScriptSkill = class {
1670
1667
  asset;
1671
1668
  image;
1672
1669
  imageFile;
1670
+ dir;
1673
1671
  inner;
1674
1672
  constructor(name, description, capabilities, priceSubunits, assetOrImage, imageOrImageFile, imageFileOrDir, dirOrPrompt, promptOrTools, toolsOrRounds, rounds) {
1675
1673
  let asset;
@@ -1703,6 +1701,7 @@ var ScriptSkill = class {
1703
1701
  this.asset = asset;
1704
1702
  this.image = image;
1705
1703
  this.imageFile = imageFile;
1704
+ this.dir = skillDir;
1706
1705
  this.inner = new ScriptSkill$1({
1707
1706
  name,
1708
1707
  description,
@@ -2108,11 +2107,12 @@ async function cmdStart(nameArg, options = {}) {
2108
2107
  (updated) => mediaCacheDirty = mediaCacheDirty || updated
2109
2108
  );
2110
2109
  for (const skill of allSkills) {
2111
- if (skill.image || !skill.imageFile) {
2110
+ if (skill.image || !skill.imageFile || !skill.dir) {
2112
2111
  continue;
2113
2112
  }
2114
- const skillRoot = join(skillsDir, skill.name);
2115
- const cacheKey = `./skills/${skill.name}/${skill.imageFile}`;
2113
+ const skillRoot = skill.dir;
2114
+ const folderName = basename(skillRoot);
2115
+ const cacheKey = `./skills/${folderName}/${skill.imageFile}`;
2116
2116
  const absPath = join(skillRoot, skill.imageFile);
2117
2117
  const url = await uploadOrReuse(
2118
2118
  cacheKey,
@@ -2214,19 +2214,6 @@ async function cmdStart(nameArg, options = {}) {
2214
2214
  client.ping.sendPong(identity, senderPubkey, nonce).catch(() => {
2215
2215
  });
2216
2216
  };
2217
- let heartbeatTimer = null;
2218
- if (allSkills.length > 0) {
2219
- const heartbeatCard = buildCard(allSkills[0]);
2220
- heartbeatTimer = setInterval(async () => {
2221
- try {
2222
- await client.discovery.publishCapability(identity, heartbeatCard, kinds);
2223
- logger.debug({ event: "heartbeat_ack", skill: heartbeatCard.name }, "heartbeat ok");
2224
- } catch (error) {
2225
- const message = error instanceof Error ? error.message : String(error);
2226
- logger.warn({ event: "heartbeat_failed", error: message }, "heartbeat publish failed");
2227
- }
2228
- }, HEARTBEAT_INTERVAL_MS);
2229
- }
2230
2217
  const transport = new NostrTransport(client, identity, [DEFAULT_KIND_OFFSET]);
2231
2218
  const ledger = new JobLedger(paths.jobs);
2232
2219
  const runtimeConfig = {
@@ -2282,9 +2269,6 @@ async function cmdStart(nameArg, options = {}) {
2282
2269
  onLog: diagLog,
2283
2270
  onStop: () => {
2284
2271
  watchdog.stop();
2285
- if (heartbeatTimer) {
2286
- clearInterval(heartbeatTimer);
2287
- }
2288
2272
  }
2289
2273
  });
2290
2274
  console.log(" * Running. Press Ctrl+C to stop.\n");