agent-operator 0.2.0 → 0.2.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.
Files changed (2) hide show
  1. package/dist/cli/init.js +27 -16
  2. package/package.json +1 -1
package/dist/cli/init.js CHANGED
@@ -106,29 +106,40 @@ async function promptWallet() {
106
106
  secret: wh.secret || undefined,
107
107
  };
108
108
  }
109
- // try to create/find OWS wallet
109
+ // try to find or create OWS wallet
110
110
  let walletId = "";
111
111
  try {
112
112
  const ows = await import("@open-wallet-standard/core");
113
- console.log(`\nChecking for OWS wallet "${name}"...`);
114
- try {
115
- const existing = ows.getWallet(name);
116
- walletId = existing.id;
117
- console.log(` → Found existing wallet: ${walletId}`);
113
+ const existing = ows.listWallets();
114
+ if (existing.length > 0) {
115
+ const { walletChoice } = await prompts({
116
+ type: "select",
117
+ name: "walletChoice",
118
+ message: "OWS wallet",
119
+ choices: [
120
+ ...existing.map((w) => ({
121
+ title: `${w.name} (${w.id.slice(0, 8)}...)`,
122
+ value: w.id,
123
+ })),
124
+ { title: "Create new wallet", value: "__new__" },
125
+ ],
126
+ });
127
+ if (walletChoice && walletChoice !== "__new__") {
128
+ walletId = walletChoice;
129
+ const picked = existing.find((w) => w.id === walletChoice);
130
+ console.log(` → Using wallet: ${picked?.name} (${walletId})`);
131
+ }
132
+ else {
133
+ const created = ows.createWallet(name);
134
+ walletId = created.id;
135
+ console.log(` ✅ Wallet created: ${name} (id: ${walletId})`);
136
+ }
118
137
  }
119
- catch {
120
- console.log(` → Not found. Creating wallet via OWS...`);
138
+ else {
139
+ console.log(`\nNo OWS wallets found. Creating one...`);
121
140
  const created = ows.createWallet(name);
122
141
  walletId = created.id;
123
142
  console.log(` ✅ Wallet created: ${name} (id: ${walletId})`);
124
- // generate API key
125
- try {
126
- const apiKey = ows.createApiKey(name, [walletId], [], "");
127
- console.log(` ✅ API key generated: ${apiKey.id}`);
128
- }
129
- catch {
130
- console.log(` ⚠️ Could not generate API key — set up manually`);
131
- }
132
143
  }
133
144
  }
134
145
  catch {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-operator",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Drop-in toolkit for governed, observable AI agent payments",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",