@sage-protocol/cli 0.8.0 → 0.8.3

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 (34) hide show
  1. package/README.md +12 -11
  2. package/dist/cli/commands/boost.js +339 -62
  3. package/dist/cli/commands/bounty.js +28 -4
  4. package/dist/cli/commands/config.js +10 -1
  5. package/dist/cli/commands/contributor.js +16 -6
  6. package/dist/cli/commands/dao.js +1 -1
  7. package/dist/cli/commands/discover.js +3 -3
  8. package/dist/cli/commands/governance.js +141 -58
  9. package/dist/cli/commands/install.js +178 -36
  10. package/dist/cli/commands/ipfs.js +12 -2
  11. package/dist/cli/commands/library.js +277 -268
  12. package/dist/cli/commands/members.js +132 -18
  13. package/dist/cli/commands/multiplier.js +101 -13
  14. package/dist/cli/commands/nft.js +16 -3
  15. package/dist/cli/commands/personal.js +69 -2
  16. package/dist/cli/commands/prompt.js +1 -1
  17. package/dist/cli/commands/proposals.js +153 -3
  18. package/dist/cli/commands/stake-status.js +130 -56
  19. package/dist/cli/commands/sxxx.js +37 -4
  20. package/dist/cli/commands/wallet.js +5 -10
  21. package/dist/cli/contracts/index.js +2 -1
  22. package/dist/cli/index.js +5 -0
  23. package/dist/cli/privy-auth-wallet-manager.js +3 -2
  24. package/dist/cli/services/config/chain-defaults.js +1 -1
  25. package/dist/cli/services/config/manager.js +3 -0
  26. package/dist/cli/services/config/schema.js +1 -0
  27. package/dist/cli/services/ipfs/onboarding.js +11 -0
  28. package/dist/cli/utils/aliases.js +62 -3
  29. package/dist/cli/utils/cli-ui.js +1 -1
  30. package/dist/cli/utils/provider.js +7 -3
  31. package/dist/cli/wallet-manager.js +7 -12
  32. package/dist/prompts/e2e-test-prompt.md +22 -0
  33. package/dist/prompts/skills/build-web3/plugin.json +11 -0
  34. package/package.json +1 -1
@@ -56,6 +56,8 @@ const COMMAND_CATALOG = {
56
56
  'execute',
57
57
  'status',
58
58
  'inspect',
59
+ 'decode',
60
+ 'summary',
59
61
  'watch',
60
62
  'power',
61
63
  'preflight',
@@ -83,14 +85,22 @@ const COMMAND_CATALOG = {
83
85
  'votes',
84
86
  'snapshot-power',
85
87
  'config',
86
- 'timelock-info',
87
- 'authority'
88
+ 'timelock',
89
+ 'authority',
90
+ // Added missing subcommands
91
+ 'decode',
92
+ 'summary',
93
+ 'cache-show',
94
+ 'last',
95
+ 'cancel',
96
+ 'cancelability'
88
97
  ],
89
98
  subcommandAliases: {
90
99
  ls: 'list',
91
100
  exec: 'execute',
92
101
  q: 'queue',
93
- status: 'status'
102
+ status: 'status',
103
+ 'timelock-info': 'timelock'
94
104
  }
95
105
  },
96
106
  library: {
@@ -101,6 +111,7 @@ const COMMAND_CATALOG = {
101
111
  'info',
102
112
  'fork',
103
113
  'personal',
114
+ 'vault',
104
115
  'delete'
105
116
  ],
106
117
  subcommandAliases: {
@@ -224,6 +235,54 @@ const COMMAND_CATALOG = {
224
235
  needsSubcommand: false,
225
236
  subcommands: ['list', 'run'],
226
237
  subcommandAliases: { ls: 'list' }
238
+ },
239
+ nft: {
240
+ aliases: [],
241
+ needsSubcommand: true,
242
+ subcommands: ['doctor', 'list-tiers', 'my-multiplier', 'tier', 'mint', 'public-mint', 'auction'],
243
+ subcommandAliases: { list: 'list-tiers', tiers: 'list-tiers' }
244
+ },
245
+ sbt: {
246
+ aliases: [],
247
+ needsSubcommand: true,
248
+ subcommands: ['list-reasons', 'doctor', 'mint', 'revoke', 'propose-mint', 'propose-revoke'],
249
+ subcommandAliases: { list: 'list-reasons' }
250
+ },
251
+ council: {
252
+ aliases: [],
253
+ needsSubcommand: true,
254
+ subcommands: ['doctor', 'set-config', 'allow', 'show', 'suggest-allowlist', 'exec', 'schedule'],
255
+ subcommandAliases: { status: 'doctor' }
256
+ },
257
+ profile: {
258
+ aliases: [],
259
+ needsSubcommand: true,
260
+ subcommands: ['get', 'set', 'upload', 'interactive'],
261
+ subcommandAliases: { show: 'get' }
262
+ },
263
+ members: {
264
+ aliases: [],
265
+ needsSubcommand: true,
266
+ subcommands: ['list', 'current-stake'],
267
+ subcommandAliases: {}
268
+ },
269
+ multiplier: {
270
+ aliases: [],
271
+ needsSubcommand: true,
272
+ subcommands: ['status', 'calculate', 'describe', 'propose-tier', 'auction'],
273
+ subcommandAliases: {}
274
+ },
275
+ boost: {
276
+ aliases: [],
277
+ needsSubcommand: true,
278
+ subcommands: ['list', 'create', 'set-merkle-root', 'status', 'finalize', 'claim', 'fund'],
279
+ subcommandAliases: {}
280
+ },
281
+ 'voting-status': {
282
+ aliases: [],
283
+ needsSubcommand: false,
284
+ subcommands: [],
285
+ subcommandAliases: {}
227
286
  }
228
287
  };
229
288
 
@@ -402,7 +402,7 @@ function keyValue(data) {
402
402
  * @param {boolean} [options.pretty=true] - Pretty print
403
403
  */
404
404
  function json(data, options = {}) {
405
- const { pretty = true } = options;
405
+ const { pretty = true } = options || {};
406
406
  console.log(pretty ? JSON.stringify(data, null, 2) : JSON.stringify(data));
407
407
  }
408
408
 
@@ -14,11 +14,15 @@ async function getWallet(provider, options = {}) {
14
14
  throw new Error('Signer unavailable. Connect a wallet capable of signing transactions.');
15
15
  }
16
16
 
17
- if (!session.signer.provider && provider) {
18
- session.signer.connect(provider);
17
+ let signer = session.signer;
18
+
19
+ // ethers v6 Signer#connect returns a NEW signer; it does not mutate.
20
+ // Ensure the returned signer is connected so read calls (eth_call) work.
21
+ if (!signer.provider && provider && typeof signer.connect === 'function') {
22
+ signer = signer.connect(provider);
19
23
  }
20
24
 
21
- return session.signer;
25
+ return signer;
22
26
  }
23
27
 
24
28
  module.exports = {
@@ -133,19 +133,14 @@ class WalletManager {
133
133
  process.env.SAGE_PRIVY_RELAY_URL = defaults.SAGE_PRIVY_RELAY_URL;
134
134
  }
135
135
 
136
- // Device code flow via relay works with just appId (no secret needed)
137
- // Use PrivyAuthWalletManager when appId is available
136
+ // Prefer relay-based web login by default (no localhost callback).
137
+ // Use PrivyAuthWalletManager when appId is available.
138
138
  if (appId) {
139
- // Force device code mode when secret is not available
140
- if (!appSecret) {
141
- process.env.SAGE_PRIVY_LOGIN_MODE = 'device';
142
- if (!process.env.SAGE_QUIET_JSON && process.env.SAGE_VERBOSE === '1') {
143
- console.log('🔐 Using device code authentication via web app relay...');
144
- }
145
- } else {
146
- if (!process.env.SAGE_QUIET_JSON && process.env.SAGE_VERBOSE === '1') {
147
- console.log('🔐 Using Privy OAuth authentication (same wallet as web app)');
148
- }
139
+ if (!process.env.SAGE_PRIVY_LOGIN_MODE) {
140
+ process.env.SAGE_PRIVY_LOGIN_MODE = 'web';
141
+ }
142
+ if (!process.env.SAGE_QUIET_JSON && process.env.SAGE_VERBOSE === '1') {
143
+ console.log('🔐 Using web relay authentication (same wallet as web app)');
149
144
  }
150
145
  this.wallet = new PrivyAuthWalletManager();
151
146
  const ok = await this.wallet.initialize();
@@ -0,0 +1,22 @@
1
+ ---
2
+ name: E2E Test Prompt
3
+ description: A test prompt for validating the /prompt/:cid endpoint
4
+ tags: [test, e2e, validation]
5
+ kind: "prompt"
6
+ publishable: true
7
+ targets: []
8
+ ---
9
+
10
+ # E2E Test Prompt
11
+
12
+ This is a test prompt created to validate the prompt allowlist flow.
13
+
14
+ ## Purpose
15
+ - Test that prompts published to a DAO get added to the allowlist
16
+ - Verify that `/prompt/:cid` endpoint serves allowlisted prompts
17
+ - Confirm library sync properly indexes prompt CIDs
18
+
19
+ ## Instructions
20
+ When this prompt is accessible via the API, the allowlist flow is working correctly.
21
+
22
+ Created: 2025-12-26
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "build-web3",
3
+ "description": "Build Web3 dApps and smart contracts from scratch through shipping. Full lifecycle for EVM/Base development with Solidity, Foundry, Next.js, and viem/wagmi. Covers contracts, frontend, testing, security analysis, and deployment.",
4
+ "version": "1.0.0",
5
+ "author": "Sage Protocol",
6
+ "license": "MIT",
7
+ "keywords": ["web3", "solidity", "foundry", "next.js", "viem", "wagmi", "smart-contracts", "dapp"],
8
+ "category": "development",
9
+ "homepage": "https://github.com/sage-protocol",
10
+ "repository": "https://github.com/sage-protocol/sage-protocol"
11
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sage-protocol/cli",
3
- "version": "0.8.0",
3
+ "version": "0.8.3",
4
4
  "description": "Sage Protocol CLI for managing AI prompt libraries",
5
5
  "bin": {
6
6
  "sage": "./bin/sage.js"