@encorearia/install 1.1.0 → 1.1.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/bin/install.mjs +16 -4
  2. package/package.json +1 -1
package/bin/install.mjs CHANGED
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import process from 'node:process';
3
+ import { readFileSync } from 'node:fs';
3
4
  import { request, ensureDeviceLogin } from '../lib/api.mjs';
4
5
  import { atomicInstall } from '../lib/atomic-install.mjs';
5
6
  import { loadCredentials } from '../lib/credentials.mjs';
@@ -9,7 +10,7 @@ import { loadTrustedKeys, verifyPackage } from '../lib/verify.mjs';
9
10
  const args = process.argv.slice(2);
10
11
  const baseURL = String(valueAfter('--api') || process.env.ENCOREARIA_API_BASE || 'https://encorearia.com').replace(/\/$/, '');
11
12
  const targetArg = valueAfter('--target');
12
- const installerVersion = '1.1.0';
13
+ const installerVersion = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8')).version;
13
14
 
14
15
  if (args.includes('--list')) {
15
16
  const target = (await detectTargets(targetArg ? targetArg.split(',') : []))[0];
@@ -30,18 +31,23 @@ if (args.includes('--list')) {
30
31
  process.exit(0);
31
32
  }
32
33
 
33
- if (positionalArgument()) fail('Usage: npx @encorearia/install [--target codex,claude-code] [--api URL]');
34
+ if (positionalArgument()) fail('用法:npx @encorearia/install [--target codex,claude-code] [--api URL]');
34
35
  const pkg = await request(baseURL, '/api/agent/shell');
35
36
  const trust = await loadTrustedKeys(baseURL);
36
37
  verifyPackage(pkg, trust, installerVersion);
37
38
  const targets = await detectTargets(targetArg ? targetArg.split(',') : []);
38
39
  const primaryTarget = targets[0];
39
40
  await ensureDeviceLogin(baseURL, '', pkg.manifest.shell_version, primaryTarget);
40
- const shellID = pkg.manifest.shell_id || 'encorearia-unified';
41
+ const shellID = pkg.manifest.shell_id || 'encorearia';
41
42
  for (const target of targets) {
42
43
  const destination = await atomicInstall(targetRoot(target), shellID, pkg.files, pkg.manifest);
43
- process.stdout.write(`Installed to ${target}: ${destination}\n`);
44
+ process.stdout.write(`已安装到 ${displayTarget(target)}:${destination}\n`);
44
45
  }
46
+ process.stdout.write('\n安可集已就绪。你可以直接对 AI 说:\n');
47
+ process.stdout.write(' · 看看我的服务\n');
48
+ process.stdout.write(' · 帮我调用 <服务名>\n');
49
+ process.stdout.write(' · 查我的钱包余额\n');
50
+ process.stdout.write('浏览更多服务或充值:https://encorearia.com\n');
45
51
 
46
52
  function valueAfter(flag) {
47
53
  const index = args.indexOf(flag);
@@ -58,6 +64,12 @@ function positionalArgument() {
58
64
  return '';
59
65
  }
60
66
 
67
+ function displayTarget(target) {
68
+ if (target === 'codex') return 'Codex';
69
+ if (target === 'claude-code') return 'Claude Code';
70
+ return target;
71
+ }
72
+
61
73
  function fail(message) {
62
74
  process.stderr.write(message + '\n');
63
75
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@encorearia/install",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Verify and install signed Encore Aria call-shell skills for Codex and Claude Code.",
5
5
  "type": "module",
6
6
  "bin": {