@kmlckj/licos-ai-cli 0.0.20 → 0.0.22

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.
@@ -1,6 +1,6 @@
1
- loglevel=error
1
+ loglevel=warn
2
2
  registry=https://registry.npmmirror.com/
3
- @kmlckj:registry=https://registry.npmjs.org/
3
+ @kmlckj:registry=https://registry.npmmirror.com/
4
4
 
5
5
  strictStorePkgContentCheck=false
6
6
  verifyStoreIntegrity=false
@@ -1,2 +1,2 @@
1
1
  registry=https://registry.npmmirror.com/
2
- @kmlckj:registry=https://registry.npmjs.org/
2
+ @kmlckj:registry=https://registry.npmmirror.com/
@@ -5,7 +5,6 @@
5
5
  "private": true,
6
6
  "scripts": {
7
7
  "check-deps": "npx depcheck",
8
- "postinstall": "npm run install-missing",
9
8
  "install-missing": "node ./scripts/install-missing-deps.js",
10
9
  "lint": "tsc --noEmit; eslint ./ -f ./scripts/formatter.mjs --quiet",
11
10
  "start": "expo start --web --clear",
@@ -1322,7 +1322,7 @@ packages:
1322
1322
  resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==}
1323
1323
 
1324
1324
  '@kmlckj/licos-platform-sdk@0.6.1':
1325
- resolution: {integrity: sha512-eADWtycsGKxO37QZKsHNNI91XDmHZrrbQGZUrR576v8rxASZBLV8X3j/02W8nIwIkfcKK7XC63DOE2IIDDsuuQ==}
1325
+ resolution: {integrity: sha512-8i+MCc7RYLK42NhT+JGF7wG0ddUQtSfcT05WqUtNnEn7SdHewoNLi/JqK4ZJM3DQB+/azOxqqM/To72B9DkIsA==}
1326
1326
 
1327
1327
  '@langchain/core@1.1.17':
1328
1328
  resolution: {integrity: sha512-g7/kcKbKEwNZSyyT7aT0utxn7wTOtKErqz0cL6VjrV4v/aOb9g+dKcfj17YkSm42YQmJp/rB2IXGc17vQPEBqA==}
@@ -1,6 +1,6 @@
1
- loglevel=error
1
+ loglevel=warn
2
2
  registry=https://registry.npmmirror.com/
3
- @kmlckj:registry=https://registry.npmjs.org/
3
+ @kmlckj:registry=https://registry.npmmirror.com/
4
4
 
5
5
  strictStorePkgContentCheck=false
6
6
  verifyStoreIntegrity=false
@@ -1,2 +1,2 @@
1
1
  registry=https://registry.npmmirror.com/
2
- @kmlckj:registry=https://registry.npmjs.org/
2
+ @kmlckj:registry=https://registry.npmmirror.com/
@@ -1335,7 +1335,7 @@ packages:
1335
1335
  resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==}
1336
1336
 
1337
1337
  '@kmlckj/licos-platform-sdk@0.6.1':
1338
- resolution: {integrity: sha512-eADWtycsGKxO37QZKsHNNI91XDmHZrrbQGZUrR576v8rxASZBLV8X3j/02W8nIwIkfcKK7XC63DOE2IIDDsuuQ==}
1338
+ resolution: {integrity: sha512-8i+MCc7RYLK42NhT+JGF7wG0ddUQtSfcT05WqUtNnEn7SdHewoNLi/JqK4ZJM3DQB+/azOxqqM/To72B9DkIsA==}
1339
1339
 
1340
1340
  '@langchain/core@1.1.17':
1341
1341
  resolution: {integrity: sha512-g7/kcKbKEwNZSyyT7aT0utxn7wTOtKErqz0cL6VjrV4v/aOb9g+dKcfj17YkSm42YQmJp/rB2IXGc17vQPEBqA==}
@@ -1,6 +1,6 @@
1
- loglevel=error
1
+ loglevel=warn
2
2
  registry=https://registry.npmmirror.com/
3
- @kmlckj:registry=https://registry.npmjs.org/
3
+ @kmlckj:registry=https://registry.npmmirror.com/
4
4
 
5
5
  strictStorePkgContentCheck=false
6
6
  verifyStoreIntegrity=false
@@ -1,2 +1,2 @@
1
1
  registry=https://registry.npmmirror.com/
2
- @kmlckj:registry=https://registry.npmjs.org/
2
+ @kmlckj:registry=https://registry.npmmirror.com/
@@ -67,7 +67,7 @@ export default defineNuxtConfig({
67
67
  // Development server configuration
68
68
  devServer: {
69
69
  port: parseInt(process.env.PORT || '<%= port %>', 10),
70
- host: process.env.HOSTNAME || 'localhost',
70
+ host: process.env.HOST || '0.0.0.0',
71
71
  },
72
72
 
73
73
  // TypeScript configuration
@@ -418,7 +418,7 @@ packages:
418
418
  resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==}
419
419
 
420
420
  '@kmlckj/licos-platform-sdk@0.6.1':
421
- resolution: {integrity: sha512-eADWtycsGKxO37QZKsHNNI91XDmHZrrbQGZUrR576v8rxASZBLV8X3j/02W8nIwIkfcKK7XC63DOE2IIDDsuuQ==}
421
+ resolution: {integrity: sha512-8i+MCc7RYLK42NhT+JGF7wG0ddUQtSfcT05WqUtNnEn7SdHewoNLi/JqK4ZJM3DQB+/azOxqqM/To72B9DkIsA==}
422
422
 
423
423
  '@koa/router@12.0.2':
424
424
  resolution: {integrity: sha512-sYcHglGKTxGF+hQ6x67xDfkE9o+NhVlRHBqq6gLywaMc6CojK/5vFZByphdonKinYlMLkEkacm+HEse9HzwgTA==}
@@ -36,4 +36,4 @@ echo "Clearing port ${PORT} before start."
36
36
  kill_port_if_listening
37
37
  echo "Starting Nuxt dev server on port ${PORT}..."
38
38
 
39
- PORT=$PORT pnpm nuxt dev
39
+ HOST=0.0.0.0 PORT=$PORT pnpm nuxt dev --host 0.0.0.0
@@ -14,7 +14,7 @@ DEPLOY_RUN_PORT="${DEPLOY_RUN_PORT:-$PORT}"
14
14
  start_service() {
15
15
  cd "${PROJECT_DIR}"
16
16
  echo "Starting Nuxt.js service on port ${DEPLOY_RUN_PORT} for production..."
17
- PORT=${DEPLOY_RUN_PORT} node .output/server/index.mjs
17
+ HOST=0.0.0.0 PORT=${DEPLOY_RUN_PORT} node .output/server/index.mjs
18
18
  }
19
19
 
20
20
  echo "Starting Nuxt.js service on port ${DEPLOY_RUN_PORT} for production..."
@@ -1,6 +1,6 @@
1
- loglevel=error
1
+ loglevel=warn
2
2
  registry=https://registry.npmmirror.com/
3
- @kmlckj:registry=https://registry.npmjs.org/
3
+ @kmlckj:registry=https://registry.npmmirror.com/
4
4
 
5
5
  strictStorePkgContentCheck=false
6
6
  verifyStoreIntegrity=false
@@ -1,2 +1,2 @@
1
1
  registry=https://registry.npmmirror.com/
2
- @kmlckj:registry=https://registry.npmjs.org/
2
+ @kmlckj:registry=https://registry.npmmirror.com/
@@ -3090,7 +3090,7 @@ packages:
3090
3090
  resolution: {integrity: sha512-dXn3FZhPv0US+7dtJsIi2R+c7qWYiReoEh5zUntWCf4oSpMNib8FDhSoed6m3QyZdx5hK7iLFkYk3rNxwt8vTA==}
3091
3091
 
3092
3092
  '@kmlckj/licos-platform-sdk@0.6.1':
3093
- resolution: {integrity: sha512-eADWtycsGKxO37QZKsHNNI91XDmHZrrbQGZUrR576v8rxASZBLV8X3j/02W8nIwIkfcKK7XC63DOE2IIDDsuuQ==}
3093
+ resolution: {integrity: sha512-8i+MCc7RYLK42NhT+JGF7wG0ddUQtSfcT05WqUtNnEn7SdHewoNLi/JqK4ZJM3DQB+/azOxqqM/To72B9DkIsA==}
3094
3094
 
3095
3095
  '@langchain/core@1.1.16':
3096
3096
  resolution: {integrity: sha512-2XKQKxvQdeQiuIo0tacAmDVojhSVAci8D2WDdmmyN+6CqDusLHEHyIDaOt4o+UBvpkyHXbCdrljzDTQY/AKeqg==}
@@ -1,6 +1,6 @@
1
- loglevel=error
1
+ loglevel=warn
2
2
  registry=https://registry.npmmirror.com/
3
- @kmlckj:registry=https://registry.npmjs.org/
3
+ @kmlckj:registry=https://registry.npmmirror.com/
4
4
 
5
5
  strictStorePkgContentCheck=false
6
6
  verifyStoreIntegrity=false
@@ -1,2 +1,2 @@
1
1
  registry=https://registry.npmmirror.com/
2
- @kmlckj:registry=https://registry.npmjs.org/
2
+ @kmlckj:registry=https://registry.npmmirror.com/
@@ -295,7 +295,7 @@ packages:
295
295
  resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==}
296
296
 
297
297
  '@kmlckj/licos-platform-sdk@0.6.1':
298
- resolution: {integrity: sha512-eADWtycsGKxO37QZKsHNNI91XDmHZrrbQGZUrR576v8rxASZBLV8X3j/02W8nIwIkfcKK7XC63DOE2IIDDsuuQ==}
298
+ resolution: {integrity: sha512-8i+MCc7RYLK42NhT+JGF7wG0ddUQtSfcT05WqUtNnEn7SdHewoNLi/JqK4ZJM3DQB+/azOxqqM/To72B9DkIsA==}
299
299
 
300
300
  '@langchain/core@1.1.16':
301
301
  resolution: {integrity: sha512-2XKQKxvQdeQiuIo0tacAmDVojhSVAci8D2WDdmmyN+6CqDusLHEHyIDaOt4o+UBvpkyHXbCdrljzDTQY/AKeqg==}
package/lib/cli.js CHANGED
@@ -2107,7 +2107,7 @@ const EventBuilder = {
2107
2107
  };
2108
2108
 
2109
2109
  var name = "@kmlckj/licos-ai-cli";
2110
- var version = "0.0.20";
2110
+ var version = "0.0.22";
2111
2111
  var description = "LICOS AI coding workspace CLI - project template engine and dev tools";
2112
2112
  var license = "MIT";
2113
2113
  var author = "kmlckj";
@@ -5811,6 +5811,10 @@ const loadLicosConfig = async (
5811
5811
  try {
5812
5812
  content = await fs$1.readFile(licosConfigPath, 'utf-8');
5813
5813
  } catch (error) {
5814
+ const recoveredConfig = await recoverLicosConfig(projectPath);
5815
+ if (recoveredConfig) {
5816
+ return recoveredConfig;
5817
+ }
5814
5818
  throw new Error(
5815
5819
  `.licos config file not found in ${projectPath}\n` +
5816
5820
  'Please ensure you are in a project directory initialized with licos-coding.\n' +
@@ -5968,6 +5972,96 @@ const detectTemplateKey = async (
5968
5972
  }
5969
5973
  };
5970
5974
 
5975
+ const resolveProjectScriptCommand = (
5976
+ projectPath,
5977
+ scriptPath,
5978
+ fallback,
5979
+ ) => {
5980
+ if (fs.existsSync(path.join(projectPath, scriptPath))) {
5981
+ return ['bash', `./${scriptPath.replace(/\\/g, '/')}`];
5982
+ }
5983
+
5984
+ return fallback;
5985
+ };
5986
+
5987
+ const createFallbackLicosConfig = async (
5988
+ projectPath,
5989
+ ) => {
5990
+ const template = await detectTemplateKey(projectPath);
5991
+ if (!template) {
5992
+ return null;
5993
+ }
5994
+
5995
+ const common = {
5996
+ project: {
5997
+ requires: ['nodejs-24'],
5998
+ template,
5999
+ version: packageJson.version,
6000
+ appliedPatches: [],
6001
+ },
6002
+ };
6003
+
6004
+ if (template === 'expo') {
6005
+ return {
6006
+ ...common,
6007
+ dev: {
6008
+ build: resolveProjectScriptCommand(projectPath, '.licosproj/scripts/dev_build.sh', ['pnpm', 'install']),
6009
+ run: resolveProjectScriptCommand(projectPath, '.licosproj/scripts/dev_run.sh', ['pnpm', 'dev']),
6010
+ },
6011
+ deploy: {
6012
+ build: resolveProjectScriptCommand(projectPath, '.licosproj/scripts/prod_build.sh', ['pnpm', 'build']),
6013
+ run: resolveProjectScriptCommand(projectPath, '.licosproj/scripts/prod_run.sh', ['pnpm', 'start']),
6014
+ },
6015
+ };
6016
+ }
6017
+
6018
+ if (template === 'taro') {
6019
+ return {
6020
+ ...common,
6021
+ dev: {
6022
+ build: resolveProjectScriptCommand(projectPath, '.licosproj/scripts/dev_build.sh', ['pnpm', 'install']),
6023
+ run: resolveProjectScriptCommand(projectPath, '.licosproj/scripts/dev_run.sh', ['pnpm', 'dev']),
6024
+ },
6025
+ deploy: {
6026
+ build: resolveProjectScriptCommand(projectPath, '.licosproj/scripts/deploy_build.sh', ['pnpm', 'build']),
6027
+ run: resolveProjectScriptCommand(projectPath, '.licosproj/scripts/deploy_run.sh', ['pnpm', 'start']),
6028
+ },
6029
+ };
6030
+ }
6031
+
6032
+ const fallbackDevRun =
6033
+ template === 'nextjs'
6034
+ ? ['pnpm', 'dev', '--hostname', '0.0.0.0', '-p', '${LICOS_RUN_PORT:-5000}']
6035
+ : ['pnpm', 'dev', '--', '--host', '0.0.0.0'];
6036
+
6037
+ return {
6038
+ ...common,
6039
+ dev: {
6040
+ build: resolveProjectScriptCommand(projectPath, 'scripts/prepare.sh', ['pnpm', 'install']),
6041
+ run: resolveProjectScriptCommand(projectPath, 'scripts/dev.sh', fallbackDevRun),
6042
+ },
6043
+ deploy: {
6044
+ build: resolveProjectScriptCommand(projectPath, 'scripts/build.sh', ['pnpm', 'build']),
6045
+ run: resolveProjectScriptCommand(projectPath, 'scripts/start.sh', ['pnpm', 'start']),
6046
+ },
6047
+ };
6048
+ };
6049
+
6050
+ const recoverLicosConfig = async (
6051
+ projectPath,
6052
+ ) => {
6053
+ const config = await createFallbackLicosConfig(projectPath);
6054
+ if (!config) {
6055
+ return null;
6056
+ }
6057
+
6058
+ logger.warn(
6059
+ `.licos config file not found in ${projectPath}; recovered config for ${config.project.template}`,
6060
+ );
6061
+ await saveTomlLicosConfig(config, projectPath);
6062
+ return config;
6063
+ };
6064
+
5971
6065
  const PATCH_FG_ENDPOINT =
5972
6066
  'about:blank';
5973
6067
  const PATCH_FG_TIMEOUT_MS = 2000;
@@ -6579,7 +6673,7 @@ const loadExistingTomlConfig = async (
6579
6673
  try {
6580
6674
  await fs$1.access(path.resolve(projectFolder, '.licos'));
6581
6675
  } catch (e) {
6582
- return null;
6676
+ return recoverLicosConfig(projectFolder);
6583
6677
  }
6584
6678
 
6585
6679
  return loadTomlLicosConfig(projectFolder);
@@ -6908,7 +7002,24 @@ const executeRun = async (
6908
7002
  const logFilePath = resolveLogFilePath(options.logFile);
6909
7003
  const logStream = createLogStream(logFilePath);
6910
7004
 
6911
- // 4. 执行命令
7005
+ // 4. 开发预览先执行 dev.build,例如 pnpm install / framework prepare。
7006
+ if (commandName === 'dev') {
7007
+ const devBuildArgs = _optionalChain$4([config, 'access', _ => _.dev, 'optionalAccess', _2 => _2.build]);
7008
+ if (Array.isArray(devBuildArgs) && devBuildArgs.length > 0) {
7009
+ const devBuildCommand = devBuildArgs.join(' ');
7010
+ logger.info(`Executing dev build step: ${devBuildCommand}`);
7011
+ logger.info(`Working directory: ${process.cwd()}`);
7012
+ const buildResult = shelljs.exec(devBuildCommand, {
7013
+ silent: false,
7014
+ env: buildProjectProgramEnv(),
7015
+ });
7016
+ if (buildResult.code !== 0) {
7017
+ throw new Error(`Dev build step exited with code ${buildResult.code}`);
7018
+ }
7019
+ }
7020
+ }
7021
+
7022
+ // 5. 执行命令
6912
7023
  const commandString = commandArgs.join(' ');
6913
7024
 
6914
7025
  logger.info(`Executing: ${commandString}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmlckj/licos-ai-cli",
3
- "version": "0.0.20",
3
+ "version": "0.0.22",
4
4
  "description": "LICOS AI coding workspace CLI - project template engine and dev tools",
5
5
  "license": "MIT",
6
6
  "author": "kmlckj",