create-identity 0.2.5 → 0.2.7

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 (3) hide show
  1. package/index.js +7 -55
  2. package/letus.js +1 -97
  3. package/package.json +3 -4
package/index.js CHANGED
@@ -1,60 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  const { spawnSync } = require('node:child_process');
3
- const { dirname, join } = require('node:path');
3
+ const { bootstrap } = require('letussocial/bootstrap.js');
4
4
 
5
- function normalizeArgs(rawArgs) {
6
- if (rawArgs[0] === 'follow') {
7
- if (!rawArgs[1]) {
8
- console.log(' Usage: create-identity follow <@handle or url>\n');
9
- process.exit(1);
10
- }
11
- return rawArgs.slice(1);
12
- }
13
- return rawArgs;
14
- }
15
-
16
- function resolveInstalledAspCreate() {
17
- try {
18
- const packageJsonPath = require.resolve('asp-create/package.json');
19
- return join(dirname(packageJsonPath), 'dist', 'index.js');
20
- } catch {
21
- return null;
22
- }
23
- }
24
-
25
- const env = {
26
- ...process.env,
27
- ASP_CREATE_HOSTING_MODE: 'managed',
28
- ASP_HUB_WEB_URL: process.env.ASP_HUB_WEB_URL ?? 'https://letus.social',
29
- ASP_HUB_API_URL: process.env.ASP_HUB_API_URL ?? 'https://letus.social/api',
30
- ASP_HOSTED_HANDLE_DOMAIN: process.env.ASP_HOSTED_HANDLE_DOMAIN ?? 'letus.social',
31
- ASP_CREATE_POWERED_BY: process.env.ASP_CREATE_POWERED_BY ?? 'Powered by Agent Social Protocol',
32
- ASP_CREATE_DEFAULT_POST: process.env.ASP_CREATE_DEFAULT_POST ?? 'Just joined letus.social — ready to connect!',
33
- ASP_CREATE_POST_PROMPT: process.env.ASP_CREATE_POST_PROMPT ?? '\n Your first post [Enter to publish, or type your own]:\n > ',
34
- ASP_CREATE_IDENTITY_LABEL: process.env.ASP_CREATE_IDENTITY_LABEL ?? 'Your primary identity',
35
- ASP_CREATE_VALUE_PROP: process.env.ASP_CREATE_VALUE_PROP ?? 'Post, follow, and let your agent represent you.',
36
- ASP_CREATE_SHARE_LABEL: process.env.ASP_CREATE_SHARE_LABEL ?? 'Share this to connect with friends:',
37
- ASP_CREATE_SHARE_COMMAND: process.env.ASP_CREATE_SHARE_COMMAND ?? 'npx letussocial follow {target}',
38
- ASP_CREATE_PROFILE_BASE_URL: process.env.ASP_CREATE_PROFILE_BASE_URL ?? 'https://letus.social',
39
- ASP_ACTIONS: process.env.ASP_ACTIONS ?? JSON.stringify([
40
- { command: 'asp post "Hello"', description: 'Publish a post' },
41
- { command: 'asp follow @handle', description: 'Follow someone' },
42
- { command: 'asp send @handle "msg"', description: 'Send a message' },
43
- { command: 'asp feed', description: 'View your feed' },
44
- ]),
45
- };
46
-
47
- const args = normalizeArgs(process.argv.slice(2));
48
-
49
- let result = spawnSync('asp-create', args, { stdio: 'inherit', env });
50
- if (result.error && result.error.code === 'ENOENT') {
51
- const installedAspCreate = resolveInstalledAspCreate();
52
- if (installedAspCreate) {
53
- result = spawnSync(process.execPath, [installedAspCreate, ...args], { stdio: 'inherit', env });
54
- }
55
- }
56
- if (result.error && result.error.code === 'ENOENT') {
57
- result = spawnSync('npx', ['-y', 'asp-create', ...args], { stdio: 'inherit', env });
58
- }
5
+ bootstrap('create-identity');
59
6
 
7
+ // Delegate to letussocial (same product, different name)
8
+ const script = require.resolve('letussocial/index.js');
9
+ const result = spawnSync(process.execPath, [script, ...process.argv.slice(2)], {
10
+ stdio: 'inherit',
11
+ });
60
12
  process.exit(result.status ?? 1);
package/letus.js CHANGED
@@ -1,98 +1,2 @@
1
1
  #!/usr/bin/env node
2
- const { spawnSync } = require('node:child_process');
3
- const { existsSync } = require('node:fs');
4
- const { homedir } = require('node:os');
5
- const { dirname, join } = require('node:path');
6
-
7
- function resolveInstalledAspCli() {
8
- try {
9
- const packageJsonPath = require.resolve('asp-protocol/package.json');
10
- return join(dirname(packageJsonPath), 'dist', 'bin', 'asp.js');
11
- } catch {
12
- return null;
13
- }
14
- }
15
-
16
- function getManifestPath() {
17
- const storeDir = process.env.ASP_STORE_DIR || join(homedir(), '.asp');
18
- return join(storeDir, 'manifest.yaml');
19
- }
20
-
21
- function runVertical(bin, args) {
22
- let result = spawnSync(bin, args, { stdio: 'inherit' });
23
- if (result.error && result.error.code === 'ENOENT') {
24
- result = spawnSync('npx', ['-y', bin, ...args], { stdio: 'inherit' });
25
- }
26
- process.exit(result.status ?? 1);
27
- }
28
-
29
- function runAsp(args) {
30
- let result = spawnSync('asp', args, { stdio: 'inherit' });
31
- if (result.error && result.error.code === 'ENOENT') {
32
- const resolved = resolveInstalledAspCli();
33
- if (resolved) {
34
- result = spawnSync(process.execPath, [resolved, ...args], { stdio: 'inherit' });
35
- if (!result.error) return result;
36
- }
37
- result = spawnSync('npx', ['-y', '-p', 'asp-protocol', 'asp', ...args], { stdio: 'inherit' });
38
- }
39
- return result;
40
- }
41
-
42
- const args = process.argv.slice(2);
43
- const first = args[0];
44
-
45
- if (!first) {
46
- console.log('\n letus — your agent-native social CLI\n');
47
- console.log(' Verticals:');
48
- console.log(' letus social [referrer] Join letus.social');
49
- console.log(' letus meet <command> Events — search, info, rsvp, ask');
50
- console.log(' letus date Dating onboarding');
51
- console.log(' letus play Gaming (coming soon)');
52
- console.log('');
53
- console.log(' Social:');
54
- console.log(' letus follow @handle Follow someone');
55
- console.log(' letus post "text" Publish a post');
56
- console.log(' letus send @handle "msg" Send a message');
57
- console.log(' letus feed View your feed');
58
- console.log('');
59
- console.log(' Setup:');
60
- console.log(' letus tools install --all Configure MCP server and skills');
61
- console.log('');
62
- process.exit(0);
63
- }
64
-
65
- if (first === 'social') {
66
- runVertical('letussocial', args.slice(1));
67
- }
68
-
69
- if (first === 'date') {
70
- runVertical('letusdate', args.slice(1));
71
- }
72
-
73
- if (first === 'meet') {
74
- runVertical('letusmeet', args.slice(1));
75
- }
76
-
77
- if (first === 'play') {
78
- runVertical('letusplay', args.slice(1));
79
- }
80
-
81
- // follow without identity → onboard first via asp-create
82
- if (first === 'follow' && !existsSync(getManifestPath())) {
83
- const target = args[1];
84
- if (!target) {
85
- console.log(' Usage: letus follow <@handle or url>\n');
86
- process.exit(1);
87
- }
88
- // Use asp-create directly (available as dependency), not a specific vertical
89
- let result = spawnSync('asp-create', [target], { stdio: 'inherit' });
90
- if (result.error && result.error.code === 'ENOENT') {
91
- result = spawnSync('npx', ['-y', 'asp-create', target], { stdio: 'inherit' });
92
- }
93
- process.exit(result.status ?? 1);
94
- }
95
-
96
- // Everything else → asp CLI
97
- const result = runAsp(args);
98
- process.exit(result.status ?? 1);
2
+ require('letussocial/letus.js');
package/package.json CHANGED
@@ -1,14 +1,13 @@
1
1
  {
2
2
  "name": "create-identity",
3
- "version": "0.2.5",
4
- "description": "Create your ASP identity — public onboarding alias for letus.social",
3
+ "version": "0.2.7",
4
+ "description": "Create your ASP identity — onboarding entry for letus.social",
5
5
  "bin": {
6
6
  "create-identity": "index.js",
7
7
  "letus": "letus.js"
8
8
  },
9
9
  "dependencies": {
10
- "asp-create": "^0.2.2",
11
- "asp-protocol": "^0.2.2"
10
+ "letussocial": "^0.0.4"
12
11
  },
13
12
  "keywords": [
14
13
  "asp",