@elisym/cli 0.11.3 → 0.11.5

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,17 @@ 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, 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] --defaults` | Non-interactive - skip every prompt and use wizard defaults (description, default relays, no payments, no LLM, no encryption). Mutually exclusive with `--config`; implies `--yes`. |
97
+ | `elisym init [name] --local` | Create in project `.elisym/<name>/` (default: `~/.elisym/<name>/`) |
98
+ | `elisym start [name]` | Start agent in provider mode |
99
+ | `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`. |
100
+ | `elisym list` | List all agents (project-local + home-global) |
101
+ | `elisym profile [name]` | Edit agent profile, wallet, and LLM settings |
102
+ | `elisym wallet [name]` | Show Solana wallet balance |
102
103
 
103
104
  Skills live inside each agent directory at `<agentDir>/skills/<skill-name>/SKILL.md`:
104
105
 
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@
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
4
  import { SolanaPaymentStrategy, validateAgentName, RELAYS, ElisymIdentity, formatSol, formatAssetAmount, USDC_SOLANA_DEVNET, ElisymClient, MediaService, jobRequestKind, DEFAULT_KIND_OFFSET, toDTag, DEFAULTS, makeCensor, DEFAULT_REDACT_PATHS, createSlidingWindowLimiter, getProtocolProgramId, getProtocolConfig, LIMITS, calculateProtocolFee, BoundedSet, KIND_JOB_FEEDBACK, NATIVE_SOL } from '@elisym/sdk';
5
- import { ElisymYamlSchema, resolveInHome, resolveInProject, createAgentDir, writeYaml, writeSecrets, listAgents, loadAgent, agentPaths, readMediaCache, lookupCachedUrl, newCacheEntry, writeMediaCache } from '@elisym/sdk/agent-store';
5
+ import { ElisymYamlSchema, resolveInHome, resolveInProject, createAgentDir, writeYamlInitial, writeSecrets, listAgents, loadAgent, writeYaml, 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, verifyEvent } from 'nostr-tools';
8
8
  import YAML from 'yaml';
@@ -960,6 +960,14 @@ __export(init_exports, {
960
960
  cmdInit: () => cmdInit,
961
961
  fetchModels: () => fetchModels3
962
962
  });
963
+ function buildDefaultYaml() {
964
+ return ElisymYamlSchema.parse({
965
+ description: "An elisym AI agent",
966
+ relays: [...RELAYS],
967
+ payments: [],
968
+ security: {}
969
+ });
970
+ }
963
971
  async function fetchModels3(provider, apiKey) {
964
972
  const descriptor = getLlmProvider(provider);
965
973
  if (!descriptor) {
@@ -980,6 +988,10 @@ async function cmdInit(nameArg, options = {}) {
980
988
  const { default: inquirer } = await import('inquirer');
981
989
  const cwd = process.cwd();
982
990
  console.log("\n elisym agent setup\n");
991
+ if (options.config && options.defaults) {
992
+ throw new Error("--config and --defaults are mutually exclusive; pick one.");
993
+ }
994
+ const skipConfirms = options.yes || options.defaults;
983
995
  let template;
984
996
  if (options.config) {
985
997
  const configPath = resolve(cwd, options.config);
@@ -987,14 +999,17 @@ async function cmdInit(nameArg, options = {}) {
987
999
  template = ElisymYamlSchema.parse(YAML.parse(raw) ?? {});
988
1000
  console.log(` Loaded template from ${configPath}
989
1001
  `);
1002
+ } else if (options.defaults) {
1003
+ template = buildDefaultYaml();
1004
+ console.log(" Using default skeleton (no LLM, no payments). Edit later via `profile`.\n");
990
1005
  }
991
1006
  const agentName = await resolveAgentName(nameArg, inquirer);
992
1007
  const target = pickTarget(options);
993
1008
  const sameLocation = target === "home" ? resolveInHome(agentName) : resolveInProject(agentName, cwd);
994
1009
  if (sameLocation) {
995
- if (options.yes) {
1010
+ if (skipConfirms) {
996
1011
  throw new Error(
997
- `Agent "${agentName}" already exists at ${sameLocation}. Refusing to overwrite secrets under --yes. Remove the directory first or choose a different name.`
1012
+ `Agent "${agentName}" already exists at ${sameLocation}. Refusing to overwrite secrets under --yes/--defaults. Remove the directory first or choose a different name.`
998
1013
  );
999
1014
  }
1000
1015
  const { overwrite } = await inquirer.prompt([
@@ -1010,7 +1025,7 @@ async function cmdInit(nameArg, options = {}) {
1010
1025
  return;
1011
1026
  }
1012
1027
  } else if (target === "project" && resolveInHome(agentName)) {
1013
- if (!options.yes) {
1028
+ if (!skipConfirms) {
1014
1029
  const { shadow } = await inquirer.prompt([
1015
1030
  {
1016
1031
  type: "confirm",
@@ -1025,7 +1040,7 @@ async function cmdInit(nameArg, options = {}) {
1025
1040
  }
1026
1041
  }
1027
1042
  } else if (target === "home" && resolveInProject(agentName, cwd)) {
1028
- if (!options.yes) {
1043
+ if (!skipConfirms) {
1029
1044
  const { proceed } = await inquirer.prompt([
1030
1045
  {
1031
1046
  type: "confirm",
@@ -1114,6 +1129,8 @@ async function cmdInit(nameArg, options = {}) {
1114
1129
  passphrase = options.passphrase;
1115
1130
  } else if (envPassphrase !== void 0) {
1116
1131
  passphrase = envPassphrase;
1132
+ } else if (options.defaults) {
1133
+ passphrase = "";
1117
1134
  } else {
1118
1135
  const answer = await inquirer.prompt([
1119
1136
  {
@@ -1145,7 +1162,7 @@ async function cmdInit(nameArg, options = {}) {
1145
1162
  collectedKeys.set(yaml.llm.provider, defaultProviderKey);
1146
1163
  }
1147
1164
  const llmApiKeys = Object.fromEntries(collectedKeys);
1148
- await writeYaml(created.dir, yaml);
1165
+ await writeYamlInitial(created.dir, yaml);
1149
1166
  await writeSecrets(
1150
1167
  created.dir,
1151
1168
  {
@@ -3834,7 +3851,10 @@ function safe(fn) {
3834
3851
  };
3835
3852
  }
3836
3853
  var program = new Command().name("elisym").description("CLI agent runner for the elisym network").version(PACKAGE_VERSION);
3837
- program.command("init [name]").description("Create a new agent").option("-c, --config <path>", "Load fields from an elisym.yaml template (non-interactive)").option("--local", "Create in project <project>/.elisym/<name>/ (default: ~/.elisym/<name>/)").option(
3854
+ program.command("init [name]").description("Create a new agent").option("-c, --config <path>", "Load fields from an elisym.yaml template (non-interactive)").option(
3855
+ "--defaults",
3856
+ "Skip every prompt and use the same defaults the wizard would have suggested (description, default relays, no payments, no LLM, no encryption). Mutually exclusive with --config."
3857
+ ).option("--local", "Create in project <project>/.elisym/<name>/ (default: ~/.elisym/<name>/)").option(
3838
3858
  "--passphrase <value>",
3839
3859
  'Passphrase to encrypt secrets at rest. Empty string ("") skips encryption. Also reads ELISYM_PASSPHRASE env var. When neither is provided, prompts interactively.'
3840
3860
  ).option(