aico-cli 2.0.33 → 2.0.35

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 (147) hide show
  1. package/bin/cli/LICENSE.md +1 -1
  2. package/bin/cli/README.md +2 -2
  3. package/bin/cli/cli.js +1893 -1682
  4. package/bin/cli/package.json +1 -1
  5. package/bin/cli/sdk-tools.d.ts +28 -1
  6. package/dist/chunks/simple-config.mjs +36 -15
  7. package/dist/cli.mjs +17 -20
  8. package/dist/index.d.mts +7 -1
  9. package/dist/index.d.ts +7 -1
  10. package/dist/index.mjs +1 -1
  11. package/package.json +2 -2
  12. package/templates/skills/.gitkeep +0 -0
  13. package/templates/skills/canvas-design/LICENSE.txt +202 -0
  14. package/templates/skills/canvas-design/SKILL.md +130 -0
  15. package/templates/skills/canvas-design/canvas-fonts/ArsenalSC-OFL.txt +93 -0
  16. package/templates/skills/canvas-design/canvas-fonts/ArsenalSC-Regular.ttf +0 -0
  17. package/templates/skills/canvas-design/canvas-fonts/BigShoulders-Bold.ttf +0 -0
  18. package/templates/skills/canvas-design/canvas-fonts/BigShoulders-OFL.txt +93 -0
  19. package/templates/skills/canvas-design/canvas-fonts/BigShoulders-Regular.ttf +0 -0
  20. package/templates/skills/canvas-design/canvas-fonts/Boldonse-OFL.txt +93 -0
  21. package/templates/skills/canvas-design/canvas-fonts/Boldonse-Regular.ttf +0 -0
  22. package/templates/skills/canvas-design/canvas-fonts/BricolageGrotesque-Bold.ttf +0 -0
  23. package/templates/skills/canvas-design/canvas-fonts/BricolageGrotesque-OFL.txt +93 -0
  24. package/templates/skills/canvas-design/canvas-fonts/BricolageGrotesque-Regular.ttf +0 -0
  25. package/templates/skills/canvas-design/canvas-fonts/CrimsonPro-Bold.ttf +0 -0
  26. package/templates/skills/canvas-design/canvas-fonts/CrimsonPro-Italic.ttf +0 -0
  27. package/templates/skills/canvas-design/canvas-fonts/CrimsonPro-OFL.txt +93 -0
  28. package/templates/skills/canvas-design/canvas-fonts/CrimsonPro-Regular.ttf +0 -0
  29. package/templates/skills/canvas-design/canvas-fonts/DMMono-OFL.txt +93 -0
  30. package/templates/skills/canvas-design/canvas-fonts/DMMono-Regular.ttf +0 -0
  31. package/templates/skills/canvas-design/canvas-fonts/EricaOne-OFL.txt +94 -0
  32. package/templates/skills/canvas-design/canvas-fonts/EricaOne-Regular.ttf +0 -0
  33. package/templates/skills/canvas-design/canvas-fonts/GeistMono-Bold.ttf +0 -0
  34. package/templates/skills/canvas-design/canvas-fonts/GeistMono-OFL.txt +93 -0
  35. package/templates/skills/canvas-design/canvas-fonts/GeistMono-Regular.ttf +0 -0
  36. package/templates/skills/canvas-design/canvas-fonts/Gloock-OFL.txt +93 -0
  37. package/templates/skills/canvas-design/canvas-fonts/Gloock-Regular.ttf +0 -0
  38. package/templates/skills/canvas-design/canvas-fonts/IBMPlexMono-Bold.ttf +0 -0
  39. package/templates/skills/canvas-design/canvas-fonts/IBMPlexMono-OFL.txt +93 -0
  40. package/templates/skills/canvas-design/canvas-fonts/IBMPlexMono-Regular.ttf +0 -0
  41. package/templates/skills/canvas-design/canvas-fonts/IBMPlexSerif-Bold.ttf +0 -0
  42. package/templates/skills/canvas-design/canvas-fonts/IBMPlexSerif-BoldItalic.ttf +0 -0
  43. package/templates/skills/canvas-design/canvas-fonts/IBMPlexSerif-Italic.ttf +0 -0
  44. package/templates/skills/canvas-design/canvas-fonts/IBMPlexSerif-Regular.ttf +0 -0
  45. package/templates/skills/canvas-design/canvas-fonts/InstrumentSans-Bold.ttf +0 -0
  46. package/templates/skills/canvas-design/canvas-fonts/InstrumentSans-BoldItalic.ttf +0 -0
  47. package/templates/skills/canvas-design/canvas-fonts/InstrumentSans-Italic.ttf +0 -0
  48. package/templates/skills/canvas-design/canvas-fonts/InstrumentSans-OFL.txt +93 -0
  49. package/templates/skills/canvas-design/canvas-fonts/InstrumentSans-Regular.ttf +0 -0
  50. package/templates/skills/canvas-design/canvas-fonts/InstrumentSerif-Italic.ttf +0 -0
  51. package/templates/skills/canvas-design/canvas-fonts/InstrumentSerif-Regular.ttf +0 -0
  52. package/templates/skills/canvas-design/canvas-fonts/Italiana-OFL.txt +93 -0
  53. package/templates/skills/canvas-design/canvas-fonts/Italiana-Regular.ttf +0 -0
  54. package/templates/skills/canvas-design/canvas-fonts/JetBrainsMono-Bold.ttf +0 -0
  55. package/templates/skills/canvas-design/canvas-fonts/JetBrainsMono-OFL.txt +93 -0
  56. package/templates/skills/canvas-design/canvas-fonts/JetBrainsMono-Regular.ttf +0 -0
  57. package/templates/skills/canvas-design/canvas-fonts/Jura-Light.ttf +0 -0
  58. package/templates/skills/canvas-design/canvas-fonts/Jura-Medium.ttf +0 -0
  59. package/templates/skills/canvas-design/canvas-fonts/Jura-OFL.txt +93 -0
  60. package/templates/skills/canvas-design/canvas-fonts/LibreBaskerville-OFL.txt +93 -0
  61. package/templates/skills/canvas-design/canvas-fonts/LibreBaskerville-Regular.ttf +0 -0
  62. package/templates/skills/canvas-design/canvas-fonts/Lora-Bold.ttf +0 -0
  63. package/templates/skills/canvas-design/canvas-fonts/Lora-BoldItalic.ttf +0 -0
  64. package/templates/skills/canvas-design/canvas-fonts/Lora-Italic.ttf +0 -0
  65. package/templates/skills/canvas-design/canvas-fonts/Lora-OFL.txt +93 -0
  66. package/templates/skills/canvas-design/canvas-fonts/Lora-Regular.ttf +0 -0
  67. package/templates/skills/canvas-design/canvas-fonts/NationalPark-Bold.ttf +0 -0
  68. package/templates/skills/canvas-design/canvas-fonts/NationalPark-OFL.txt +93 -0
  69. package/templates/skills/canvas-design/canvas-fonts/NationalPark-Regular.ttf +0 -0
  70. package/templates/skills/canvas-design/canvas-fonts/NothingYouCouldDo-OFL.txt +93 -0
  71. package/templates/skills/canvas-design/canvas-fonts/NothingYouCouldDo-Regular.ttf +0 -0
  72. package/templates/skills/canvas-design/canvas-fonts/Outfit-Bold.ttf +0 -0
  73. package/templates/skills/canvas-design/canvas-fonts/Outfit-OFL.txt +93 -0
  74. package/templates/skills/canvas-design/canvas-fonts/Outfit-Regular.ttf +0 -0
  75. package/templates/skills/canvas-design/canvas-fonts/PixelifySans-Medium.ttf +0 -0
  76. package/templates/skills/canvas-design/canvas-fonts/PixelifySans-OFL.txt +93 -0
  77. package/templates/skills/canvas-design/canvas-fonts/PoiretOne-OFL.txt +93 -0
  78. package/templates/skills/canvas-design/canvas-fonts/PoiretOne-Regular.ttf +0 -0
  79. package/templates/skills/canvas-design/canvas-fonts/RedHatMono-Bold.ttf +0 -0
  80. package/templates/skills/canvas-design/canvas-fonts/RedHatMono-OFL.txt +93 -0
  81. package/templates/skills/canvas-design/canvas-fonts/RedHatMono-Regular.ttf +0 -0
  82. package/templates/skills/canvas-design/canvas-fonts/Silkscreen-OFL.txt +93 -0
  83. package/templates/skills/canvas-design/canvas-fonts/Silkscreen-Regular.ttf +0 -0
  84. package/templates/skills/canvas-design/canvas-fonts/SmoochSans-Medium.ttf +0 -0
  85. package/templates/skills/canvas-design/canvas-fonts/SmoochSans-OFL.txt +93 -0
  86. package/templates/skills/canvas-design/canvas-fonts/Tektur-Medium.ttf +0 -0
  87. package/templates/skills/canvas-design/canvas-fonts/Tektur-OFL.txt +93 -0
  88. package/templates/skills/canvas-design/canvas-fonts/Tektur-Regular.ttf +0 -0
  89. package/templates/skills/canvas-design/canvas-fonts/WorkSans-Bold.ttf +0 -0
  90. package/templates/skills/canvas-design/canvas-fonts/WorkSans-BoldItalic.ttf +0 -0
  91. package/templates/skills/canvas-design/canvas-fonts/WorkSans-Italic.ttf +0 -0
  92. package/templates/skills/canvas-design/canvas-fonts/WorkSans-OFL.txt +93 -0
  93. package/templates/skills/canvas-design/canvas-fonts/WorkSans-Regular.ttf +0 -0
  94. package/templates/skills/canvas-design/canvas-fonts/YoungSerif-OFL.txt +93 -0
  95. package/templates/skills/canvas-design/canvas-fonts/YoungSerif-Regular.ttf +0 -0
  96. package/templates/skills/frontend-design/LICENSE.txt +177 -0
  97. package/templates/skills/frontend-design/SKILL.md +42 -0
  98. package/templates/skills/mcp-builder/LICENSE.txt +202 -0
  99. package/templates/skills/mcp-builder/SKILL.md +236 -0
  100. package/templates/skills/mcp-builder/reference/evaluation.md +602 -0
  101. package/templates/skills/mcp-builder/reference/mcp_best_practices.md +249 -0
  102. package/templates/skills/mcp-builder/reference/node_mcp_server.md +970 -0
  103. package/templates/skills/mcp-builder/reference/python_mcp_server.md +719 -0
  104. package/templates/skills/mcp-builder/scripts/connections.py +151 -0
  105. package/templates/skills/mcp-builder/scripts/evaluation.py +373 -0
  106. package/templates/skills/mcp-builder/scripts/example_evaluation.xml +22 -0
  107. package/templates/skills/mcp-builder/scripts/requirements.txt +2 -0
  108. package/templates/skills/skill-creator/LICENSE.txt +202 -0
  109. package/templates/skills/skill-creator/SKILL.md +356 -0
  110. package/templates/skills/skill-creator/references/output-patterns.md +82 -0
  111. package/templates/skills/skill-creator/references/workflows.md +28 -0
  112. package/templates/skills/skill-creator/scripts/init_skill.py +303 -0
  113. package/templates/skills/skill-creator/scripts/package_skill.py +110 -0
  114. package/templates/skills/skill-creator/scripts/quick_validate.py +95 -0
  115. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/annotations-23.0.0.jar +0 -0
  116. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/claude-code-jetbrains-plugin-0.1.12-beta-searchableOptions.jar +0 -0
  117. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/claude-code-jetbrains-plugin-0.1.12-beta.jar +0 -0
  118. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/config-1.4.3.jar +0 -0
  119. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/jansi-2.4.1.jar +0 -0
  120. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/kotlin-logging-jvm-7.0.0.jar +0 -0
  121. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/kotlin-reflect-2.0.21.jar +0 -0
  122. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/kotlin-sdk-jvm-0.4.0.jar +0 -0
  123. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/kotlin-stdlib-2.1.20.jar +0 -0
  124. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/kotlinx-coroutines-core-jvm-1.9.0.jar +0 -0
  125. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/kotlinx-coroutines-slf4j-1.9.0.jar +0 -0
  126. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/kotlinx-io-bytestring-jvm-0.5.4.jar +0 -0
  127. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/kotlinx-io-core-jvm-0.5.4.jar +0 -0
  128. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/kotlinx-serialization-core-jvm-1.8.1.jar +0 -0
  129. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/kotlinx-serialization-json-jvm-1.8.1.jar +0 -0
  130. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-client-cio-jvm-3.0.2.jar +0 -0
  131. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-client-core-jvm-3.0.2.jar +0 -0
  132. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-events-jvm-3.0.2.jar +0 -0
  133. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-http-cio-jvm-3.0.2.jar +0 -0
  134. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-http-jvm-3.0.2.jar +0 -0
  135. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-io-jvm-3.0.2.jar +0 -0
  136. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-network-jvm-3.0.2.jar +0 -0
  137. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-network-tls-jvm-3.0.2.jar +0 -0
  138. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-serialization-jvm-3.0.2.jar +0 -0
  139. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-server-cio-jvm-3.0.2.jar +0 -0
  140. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-server-core-jvm-3.0.2.jar +0 -0
  141. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-server-sse-jvm-3.0.2.jar +0 -0
  142. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-server-websockets-jvm-3.0.2.jar +0 -0
  143. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-sse-jvm-3.0.2.jar +0 -0
  144. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-utils-jvm-3.0.2.jar +0 -0
  145. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-websocket-serialization-jvm-3.0.2.jar +0 -0
  146. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/ktor-websockets-jvm-3.0.2.jar +0 -0
  147. package/bin/cli/vendor/claude-code-jetbrains-plugin/lib/slf4j-api-2.0.16.jar +0 -0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anthropic-ai/claude-code",
3
- "version": "2.0.57",
3
+ "version": "2.0.62",
4
4
  "bin": {
5
5
  "claude": "cli.js"
6
6
  },
@@ -26,7 +26,8 @@ export type ToolInputSchemas =
26
26
  | TodoWriteInput
27
27
  | WebFetchInput
28
28
  | WebSearchInput
29
- | AskUserQuestionInput;
29
+ | AskUserQuestionInput
30
+ | AgentOutputInput;
30
31
 
31
32
  export interface AgentInput {
32
33
  /**
@@ -49,6 +50,10 @@ export interface AgentInput {
49
50
  * Optional agent ID to resume from. If provided, the agent will continue from the previous execution transcript.
50
51
  */
51
52
  resume?: string;
53
+ /**
54
+ * Set to true to run this agent in the background. Use AgentOutputTool to read the output later.
55
+ */
56
+ run_in_background?: boolean;
52
57
  }
53
58
  export interface BashInput {
54
59
  /**
@@ -94,6 +99,14 @@ export interface BashOutputInput {
94
99
  filter?: string;
95
100
  }
96
101
  export interface ExitPlanModeInput {
102
+ /**
103
+ * Whether to launch a swarm to implement the plan
104
+ */
105
+ launchSwarm?: boolean;
106
+ /**
107
+ * Number of teammates to spawn in the swarm
108
+ */
109
+ teammateCount?: number;
97
110
  [k: string]: unknown;
98
111
  }
99
112
  export interface FileEditInput {
@@ -1476,3 +1489,17 @@ export interface AskUserQuestionInput {
1476
1489
  [k: string]: string;
1477
1490
  };
1478
1491
  }
1492
+ export interface AgentOutputInput {
1493
+ /**
1494
+ * The agent ID to retrieve results for
1495
+ */
1496
+ agentId: string;
1497
+ /**
1498
+ * Whether to block until results are ready
1499
+ */
1500
+ block?: boolean;
1501
+ /**
1502
+ * Maximum time to wait in seconds
1503
+ */
1504
+ wait_up_to?: number;
1505
+ }
@@ -2,7 +2,7 @@ import ansis from 'ansis';
2
2
  import inquirer from 'inquirer';
3
3
  import { exec } from 'tinyexec';
4
4
  import { platform, homedir } from 'node:os';
5
- import { existsSync, readFileSync, writeFileSync, mkdirSync, copyFileSync, readdirSync, statSync, unlinkSync, rmSync } from 'node:fs';
5
+ import { existsSync, readFileSync, writeFileSync, mkdirSync, readdirSync, copyFileSync, statSync, rmSync, unlinkSync } from 'node:fs';
6
6
  import { exec as exec$2, spawn } from 'node:child_process';
7
7
  import { promisify as promisify$1 } from 'node:util';
8
8
  import { exec as exec$1 } from 'child_process';
@@ -14,7 +14,7 @@ import { join, dirname, basename } from 'pathe';
14
14
  import { fileURLToPath } from 'node:url';
15
15
  import { EventEmitter } from 'node:events';
16
16
 
17
- const version = "2.0.33";
17
+ const version = "2.0.35";
18
18
 
19
19
  function displayBanner(subtitle) {
20
20
  const defaultSubtitle = "\u4E00\u952E\u914D\u7F6E\u4F60\u7684\u5F00\u53D1\u73AF\u5883";
@@ -3186,19 +3186,14 @@ async function updateCcr(force = false) {
3186
3186
  const { installed, currentVersion, latestVersion, needsUpdate } = await checkCcrVersion();
3187
3187
  spinner.stop();
3188
3188
  if (!installed) {
3189
- console.log(ansis.yellow("CCR \u672A\u5B89\u88C5"));
3190
3189
  return false;
3191
3190
  }
3192
3191
  if (!needsUpdate && !force) {
3193
- console.log(ansis.green(`CCR \u5DF2\u662F\u6700\u65B0\u7248\u672C (${currentVersion || ""})`));
3194
3192
  return true;
3195
3193
  }
3196
3194
  if (!latestVersion) {
3197
- console.log(ansis.yellow("\u65E0\u6CD5\u68C0\u67E5\u7248\u672C"));
3198
3195
  return false;
3199
3196
  }
3200
- console.log(ansis.cyan(`\u5F53\u524D\u7248\u672C: ${currentVersion || ""}`));
3201
- console.log(ansis.cyan(`\u6700\u65B0\u7248\u672C: ${latestVersion}`));
3202
3197
  const updateSpinner = ora("\u6B63\u5728\u66F4\u65B0 CCR...").start();
3203
3198
  try {
3204
3199
  await execAsync$4("npm update -g @musistudio/claude-code-router");
@@ -3816,6 +3811,22 @@ function fixWindowsMcpConfig(config) {
3816
3811
  }
3817
3812
  return fixed;
3818
3813
  }
3814
+ function updateClaudeConfigEnv(envVars) {
3815
+ try {
3816
+ let config = readMcpConfig();
3817
+ if (!config) {
3818
+ config = { mcpServers: {} };
3819
+ }
3820
+ if (!config.env) {
3821
+ config.env = {};
3822
+ }
3823
+ Object.assign(config.env, envVars);
3824
+ writeMcpConfig(config);
3825
+ } catch (error) {
3826
+ console.error("Failed to update Claude config env", error);
3827
+ throw error;
3828
+ }
3829
+ }
3819
3830
  function addCompletedOnboarding() {
3820
3831
  try {
3821
3832
  let config = readMcpConfig();
@@ -4232,10 +4243,7 @@ async function setupCcrConfiguration(scriptLang = "zh-CN") {
4232
4243
  try {
4233
4244
  const existingConfig = readCcrConfig();
4234
4245
  if (existingConfig) {
4235
- console.log(ansis.green(`\u2714 CCR \u914D\u7F6E\u5DF2\u5B58\u5728`));
4236
- console.log(ansis.yellow(`\u4FDD\u6301\u73B0\u6709\u914D\u7F6E`));
4237
4246
  await configureCcrProxy(existingConfig);
4238
- console.log(ansis.green(`\u2714 \u4EE3\u7406\u914D\u7F6E\u5DF2\u66F4\u65B0`));
4239
4247
  return true;
4240
4248
  }
4241
4249
  const preset = await selectCcrPreset(scriptLang);
@@ -4700,13 +4708,18 @@ function copyConfigFilesWithConfig(configs = DEFAULT_FILE_COPY_CONFIGS) {
4700
4708
  const sourcePath = join(rootDir, config.source);
4701
4709
  const destPath = config.destination;
4702
4710
  if (!exists(sourcePath)) {
4703
- console.warn(`\u6E90\u6587\u4EF6\u4E0D\u5B58\u5728: ${sourcePath}`);
4704
4711
  continue;
4705
4712
  }
4706
- if (config.type === "file") {
4707
- handleFileCopy(sourcePath, destPath, config.options);
4708
- } else if (config.type === "directory") {
4713
+ if (config.type === "directory") {
4714
+ const files = readDir(sourcePath);
4715
+ const hasContent = files && files.some((f) => f !== ".gitkeep");
4716
+ if (!hasContent) {
4717
+ ensureDir(destPath);
4718
+ continue;
4719
+ }
4709
4720
  handleDirectoryCopy(sourcePath, destPath, config.options);
4721
+ } else if (config.type === "file") {
4722
+ handleFileCopy(sourcePath, destPath, config.options);
4710
4723
  }
4711
4724
  }
4712
4725
  }
@@ -5835,6 +5848,10 @@ class InstallationComposer {
5835
5848
  await this.executor.executeBatch(companySteps, configOptions);
5836
5849
  const configInstaller = new ConfigInstaller(this.context);
5837
5850
  await configInstaller.applyCompanyConfig();
5851
+ updateClaudeConfigEnv({
5852
+ ANTHROPIC_BASE_URL: "http://11.0.166.20:13456",
5853
+ ANTHROPIC_AUTH_TOKEN: "sk-4730d06849b5fea00f551bd60a0902e1"
5854
+ });
5838
5855
  this.updateGlobalConfig(true);
5839
5856
  spinner.succeed("\u516C\u53F8\u914D\u7F6E\u5B89\u88C5\u5B8C\u6210");
5840
5857
  } catch (error) {
@@ -5868,6 +5885,10 @@ class InstallationComposer {
5868
5885
  if (results[INSTALLER_NAMES.CCR]?.success) {
5869
5886
  await this.configureCCRForPersonal(true);
5870
5887
  }
5888
+ updateClaudeConfigEnv({
5889
+ ANTHROPIC_BASE_URL: "http://127.0.0.1:3456",
5890
+ ANTHROPIC_AUTH_TOKEN: "sk-aico-x-ccr"
5891
+ });
5871
5892
  this.updateGlobalConfig(true);
5872
5893
  spinner.succeed("\u4E2A\u4EBA\u914D\u7F6E\u5B89\u88C5\u5B8C\u6210");
5873
5894
  } catch (error) {
@@ -6126,4 +6147,4 @@ async function openSettingsJson() {
6126
6147
  }
6127
6148
  }
6128
6149
 
6129
- export { init$1 as $, AICO_CONFIG_FILE as A, getMcpConfigPath as B, CLAUDE_DIR as C, DEFAULT_FILE_COPY_CONFIGS as D, readMcpConfig as E, writeMcpConfig as F, backupMcpConfig as G, mergeMcpServers as H, buildMcpServerConfig as I, fixWindowsMcpConfig as J, addCompletedOnboarding as K, LEGACY_AICO_CONFIG_FILE as L, MCP_SERVICES as M, createEscapablePrompt as N, processManager as O, displayBannerWithInfo as P, executeWithEscapeSupport as Q, handleExitPromptError as R, SETTINGS_FILE as S, handleGeneralError as T, EscapeKeyPressed as U, version as V, ConfigCheckerInstaller as W, readAicoConfig as X, updateAicoConfig as Y, processManager$1 as Z, runCommand as _, importRecommendedEnv as a, importRecommendedPermissions as b, commandExists as c, cleanupPermissions as d, CLAUDE_MD_FILE as e, ClAUDE_CONFIG_FILE as f, getPlatform as g, SUPPORTED_LANGS as h, init as i, LANG_LABELS as j, AI_OUTPUT_LANGUAGES as k, isClaudeCodeInstalled as l, mergeAndCleanPermissions as m, installClaudeCode as n, openSettingsJson as o, installClaudeCodeSilently as p, ensureClaudeDir as q, backupExistingConfig as r, copyConfigFiles as s, copyConfigFilesWithConfig as t, configureApi as u, mergeConfigs as v, updateDefaultModel as w, mergeSettingsFile as x, getExistingApiConfig as y, applyAiLanguageDirective as z };
6150
+ export { runCommand as $, AICO_CONFIG_FILE as A, getMcpConfigPath as B, CLAUDE_DIR as C, DEFAULT_FILE_COPY_CONFIGS as D, readMcpConfig as E, writeMcpConfig as F, backupMcpConfig as G, mergeMcpServers as H, buildMcpServerConfig as I, fixWindowsMcpConfig as J, updateClaudeConfigEnv as K, LEGACY_AICO_CONFIG_FILE as L, MCP_SERVICES as M, addCompletedOnboarding as N, createEscapablePrompt as O, processManager as P, displayBannerWithInfo as Q, executeWithEscapeSupport as R, SETTINGS_FILE as S, handleExitPromptError as T, handleGeneralError as U, EscapeKeyPressed as V, version as W, ConfigCheckerInstaller as X, readAicoConfig as Y, updateAicoConfig as Z, processManager$1 as _, importRecommendedEnv as a, init$1 as a0, importRecommendedPermissions as b, commandExists as c, cleanupPermissions as d, CLAUDE_MD_FILE as e, ClAUDE_CONFIG_FILE as f, getPlatform as g, SUPPORTED_LANGS as h, init as i, LANG_LABELS as j, AI_OUTPUT_LANGUAGES as k, isClaudeCodeInstalled as l, mergeAndCleanPermissions as m, installClaudeCode as n, openSettingsJson as o, installClaudeCodeSilently as p, ensureClaudeDir as q, backupExistingConfig as r, copyConfigFiles as s, copyConfigFilesWithConfig as t, configureApi as u, mergeConfigs as v, updateDefaultModel as w, mergeSettingsFile as x, getExistingApiConfig as y, applyAiLanguageDirective as z };
package/dist/cli.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import cac from 'cac';
3
3
  import ansis from 'ansis';
4
- import { N as createEscapablePrompt, O as processManager, l as isClaudeCodeInstalled, n as installClaudeCode, P as displayBannerWithInfo, i as init, Q as executeWithEscapeSupport, R as handleExitPromptError, T as handleGeneralError, U as EscapeKeyPressed, V as version, W as ConfigCheckerInstaller, X as readAicoConfig, Y as updateAicoConfig } from './chunks/simple-config.mjs';
4
+ import { O as createEscapablePrompt, P as processManager, l as isClaudeCodeInstalled, n as installClaudeCode, Q as displayBannerWithInfo, i as init, R as executeWithEscapeSupport, T as handleExitPromptError, U as handleGeneralError, V as EscapeKeyPressed, W as version, X as ConfigCheckerInstaller, Y as readAicoConfig, Z as updateAicoConfig } from './chunks/simple-config.mjs';
5
5
  import inquirer$1 from 'inquirer';
6
6
  import 'tinyexec';
7
7
  import 'node:os';
@@ -341,7 +341,7 @@ async function launchCodeEditor() {
341
341
  }
342
342
  async function launchCUI() {
343
343
  try {
344
- const { run } = await import('./chunks/simple-config.mjs').then(function (n) { return n._; });
344
+ const { run } = await import('./chunks/simple-config.mjs').then(function (n) { return n.$; });
345
345
  console.log("\x1B[36m\u6B63\u5728\u5B89\u88C5PM2...\x1B[0m");
346
346
  await run("npm install -g pm2");
347
347
  console.log("\x1B[36m\u6B63\u5728\u5B89\u88C5AICO\u53EF\u89C6\u5316\u754C\u9762...\x1B[0m");
@@ -486,7 +486,7 @@ function setupCommands(cli) {
486
486
  } else if (options.update) {
487
487
  await updateConfigAndCliOnly();
488
488
  } else if (options.company) {
489
- const { init } = await import('./chunks/simple-config.mjs').then(function (n) { return n.$; });
489
+ const { init } = await import('./chunks/simple-config.mjs').then(function (n) { return n.a0; });
490
490
  await init({
491
491
  apiType: "auth_token",
492
492
  force: options.force,
@@ -494,7 +494,7 @@ function setupCommands(cli) {
494
494
  skipPrompt: true
495
495
  });
496
496
  } else if (options.personal) {
497
- const { init } = await import('./chunks/simple-config.mjs').then(function (n) { return n.$; });
497
+ const { init } = await import('./chunks/simple-config.mjs').then(function (n) { return n.a0; });
498
498
  await init({
499
499
  apiType: "ccr_proxy",
500
500
  force: options.force,
@@ -516,7 +516,7 @@ function setupCommands(cli) {
516
516
  await updateConfigAndCliOnly();
517
517
  });
518
518
  cli.command("c", "\u5FEB\u901F\u914D\u7F6E\u516C\u53F8\u8BBE\u7F6E").action(async () => {
519
- const { init } = await import('./chunks/simple-config.mjs').then(function (n) { return n.$; });
519
+ const { init } = await import('./chunks/simple-config.mjs').then(function (n) { return n.a0; });
520
520
  await init({
521
521
  apiType: "auth_token",
522
522
  force: false,
@@ -525,7 +525,7 @@ function setupCommands(cli) {
525
525
  });
526
526
  });
527
527
  cli.command("p", "\u5FEB\u901F\u914D\u7F6E\u4E2A\u4EBA\u8BBE\u7F6E").action(async () => {
528
- const { init } = await import('./chunks/simple-config.mjs').then(function (n) { return n.$; });
528
+ const { init } = await import('./chunks/simple-config.mjs').then(function (n) { return n.a0; });
529
529
  await init({
530
530
  apiType: "ccr_proxy",
531
531
  force: false,
@@ -546,7 +546,7 @@ function setupCommands(cli) {
546
546
  async function initCompanyConfigOnly() {
547
547
  try {
548
548
  console.log(ansis.cyan("\u{1F4E6} \u6B63\u5728\u5B89\u88C5\u516C\u53F8\u914D\u7F6E..."));
549
- const { init } = await import('./chunks/simple-config.mjs').then(function (n) { return n.$; });
549
+ const { init } = await import('./chunks/simple-config.mjs').then(function (n) { return n.a0; });
550
550
  await init({
551
551
  apiType: "auth_token",
552
552
  skipBanner: true,
@@ -568,7 +568,7 @@ async function updateConfigAndCliOnly() {
568
568
  await updateAicoCli();
569
569
  if (configType === "none") {
570
570
  console.log(ansis.cyan("\u{1F4E6} \u672A\u68C0\u6D4B\u5230\u914D\u7F6E\uFF0C\u6B63\u5728\u5B89\u88C5\u516C\u53F8\u914D\u7F6E..."));
571
- const { init } = await import('./chunks/simple-config.mjs').then(function (n) { return n.$; });
571
+ const { init } = await import('./chunks/simple-config.mjs').then(function (n) { return n.a0; });
572
572
  await init({
573
573
  apiType: "auth_token",
574
574
  skipBanner: true,
@@ -577,7 +577,7 @@ async function updateConfigAndCliOnly() {
577
577
  });
578
578
  } else {
579
579
  console.log(ansis.cyan(`\u{1F504} \u6B63\u5728\u66F4\u65B0${configType === "company" ? "\u516C\u53F8" : "\u4E2A\u4EBA"}\u914D\u7F6E...`));
580
- const { init } = await import('./chunks/simple-config.mjs').then(function (n) { return n.$; });
580
+ const { init } = await import('./chunks/simple-config.mjs').then(function (n) { return n.a0; });
581
581
  await init({
582
582
  apiType: configType === "company" ? "auth_token" : "ccr_proxy",
583
583
  skipBanner: true,
@@ -595,19 +595,16 @@ async function startCodeEditor() {
595
595
  try {
596
596
  const context = createDefaultContext();
597
597
  const checker = new ConfigCheckerInstaller(context);
598
- console.log(ansis.cyan("\u{1F504} \u6B63\u5728\u66F4\u65B0\u667A\u80FD\u8F6F\u4EF6\u661F\u5DE5\u5382..."));
599
- try {
600
- await updateAicoCli(true);
601
- console.log(ansis.green("\u2705 \u5B8C\u6210\u66F4\u65B0"));
602
- } catch (updateError) {
603
- console.log(ansis.yellow("\u26A0\uFE0F \u7248\u672C\u66F4\u65B0\u5931\u8D25\uFF0C\u7EE7\u7EED\u6267\u884C..."));
604
- }
598
+ updateAicoCli(true).then(() => {
599
+ console.log(ansis.green("\u2705 AICO CLI \u540E\u53F0\u66F4\u65B0\u5B8C\u6210"));
600
+ }).catch(() => {
601
+ });
605
602
  const configType = await checker.detectConfigType();
606
603
  const aicoConfig = readAicoConfig();
607
604
  const needsReinstall = !aicoConfig || aicoConfig.version !== version;
608
605
  if (configType === "none") {
609
606
  console.log(ansis.cyan("\u{1F4E6} \u672A\u68C0\u6D4B\u5230\u914D\u7F6E\uFF0C\u6B63\u5728\u5B89\u88C5\u516C\u53F8\u914D\u7F6E..."));
610
- const { init } = await import('./chunks/simple-config.mjs').then(function (n) { return n.$; });
607
+ const { init } = await import('./chunks/simple-config.mjs').then(function (n) { return n.a0; });
611
608
  await init({
612
609
  skipBanner: true,
613
610
  skipPrompt: true,
@@ -615,7 +612,7 @@ async function startCodeEditor() {
615
612
  });
616
613
  } else if (needsReinstall) {
617
614
  console.log(ansis.cyan(`\u{1F504} \u68C0\u6D4B\u5230\u65B0\u7248\u672C\uFF0C\u6B63\u5728\u66F4\u65B0${configType === "company" ? "\u516C\u53F8" : "\u4E2A\u4EBA"}\u914D\u7F6E...`));
618
- const { init } = await import('./chunks/simple-config.mjs').then(function (n) { return n.$; });
615
+ const { init } = await import('./chunks/simple-config.mjs').then(function (n) { return n.a0; });
619
616
  await init({
620
617
  apiType: configType === "company" ? "auth_token" : "ccr_proxy",
621
618
  skipBanner: true,
@@ -631,7 +628,7 @@ async function startCodeEditor() {
631
628
  await startClaudeCodeEditorWithSkipPermissions();
632
629
  } catch (error) {
633
630
  console.error(ansis.red(`\u2716 \u542F\u52A8\u4EE3\u7801\u7F16\u8F91\u5668\u5931\u8D25: ${error}`));
634
- const { processManager } = await import('./chunks/simple-config.mjs').then(function (n) { return n.Z; });
631
+ const { processManager } = await import('./chunks/simple-config.mjs').then(function (n) { return n._; });
635
632
  processManager.cleanup();
636
633
  process.exit(1);
637
634
  }
@@ -674,7 +671,7 @@ function customizeHelp(sections) {
674
671
  }
675
672
  async function startUI() {
676
673
  try {
677
- const { run } = await import('./chunks/simple-config.mjs').then(function (n) { return n._; });
674
+ const { run } = await import('./chunks/simple-config.mjs').then(function (n) { return n.$; });
678
675
  console.log("\x1B[36m\u6B63\u5728\u5B89\u88C5\u667A\u80FD\u8F6F\u4EF6\u661F\u5DE5\u5382\u53EF\u89C6\u5316\u754C\u9762...\x1B[0m");
679
676
  await run("npm install -g pm2");
680
677
  await run("npm install -g aico-cui");
package/dist/index.d.mts CHANGED
@@ -19,6 +19,7 @@ interface McpServerConfig {
19
19
  interface ClaudeConfiguration {
20
20
  mcpServers: Record<string, McpServerConfig>;
21
21
  hasCompletedOnboarding?: boolean;
22
+ env?: Record<string, string>;
22
23
  }
23
24
 
24
25
  declare const CLAUDE_DIR: string;
@@ -120,6 +121,11 @@ declare function backupMcpConfig(): string | null;
120
121
  declare function mergeMcpServers(existing: ClaudeConfiguration | null, newServers: Record<string, McpServerConfig>): ClaudeConfiguration;
121
122
  declare function buildMcpServerConfig(baseConfig: McpServerConfig, apiKey?: string, placeholder?: string, envVarName?: string): McpServerConfig;
122
123
  declare function fixWindowsMcpConfig(config: ClaudeConfiguration): ClaudeConfiguration;
124
+ /**
125
+ * 更新 ~/.claude.json 的 env 对象
126
+ * @param envVars 要设置的环境变量键值对
127
+ */
128
+ declare function updateClaudeConfigEnv(envVars: Record<string, string>): void;
123
129
  declare function addCompletedOnboarding(): void;
124
130
 
125
131
  declare function importRecommendedEnv(): Promise<void>;
@@ -146,5 +152,5 @@ declare function cleanupPermissions(templatePermissions: string[], userPermissio
146
152
  */
147
153
  declare function mergeAndCleanPermissions(templatePermissions: string[] | undefined, userPermissions: string[] | undefined): string[];
148
154
 
149
- export { AICO_CONFIG_FILE, AI_OUTPUT_LANGUAGES, CLAUDE_DIR, CLAUDE_MD_FILE, ClAUDE_CONFIG_FILE, DEFAULT_FILE_COPY_CONFIGS, LANG_LABELS, LEGACY_AICO_CONFIG_FILE, MCP_SERVICES, SETTINGS_FILE, SUPPORTED_LANGS, addCompletedOnboarding, applyAiLanguageDirective, backupExistingConfig, backupMcpConfig, buildMcpServerConfig, cleanupPermissions, commandExists, configureApi, copyConfigFiles, copyConfigFilesWithConfig, ensureClaudeDir, fixWindowsMcpConfig, getExistingApiConfig, getMcpConfigPath, getPlatform, importRecommendedEnv, importRecommendedPermissions, init, installClaudeCode, installClaudeCodeSilently, isClaudeCodeInstalled, mergeAndCleanPermissions, mergeConfigs, mergeMcpServers, mergeSettingsFile, openSettingsJson, readMcpConfig, updateDefaultModel, writeMcpConfig };
155
+ export { AICO_CONFIG_FILE, AI_OUTPUT_LANGUAGES, CLAUDE_DIR, CLAUDE_MD_FILE, ClAUDE_CONFIG_FILE, DEFAULT_FILE_COPY_CONFIGS, LANG_LABELS, LEGACY_AICO_CONFIG_FILE, MCP_SERVICES, SETTINGS_FILE, SUPPORTED_LANGS, addCompletedOnboarding, applyAiLanguageDirective, backupExistingConfig, backupMcpConfig, buildMcpServerConfig, cleanupPermissions, commandExists, configureApi, copyConfigFiles, copyConfigFilesWithConfig, ensureClaudeDir, fixWindowsMcpConfig, getExistingApiConfig, getMcpConfigPath, getPlatform, importRecommendedEnv, importRecommendedPermissions, init, installClaudeCode, installClaudeCodeSilently, isClaudeCodeInstalled, mergeAndCleanPermissions, mergeConfigs, mergeMcpServers, mergeSettingsFile, openSettingsJson, readMcpConfig, updateClaudeConfigEnv, updateDefaultModel, writeMcpConfig };
150
156
  export type { AiOutputLanguage, ApiConfig, ClaudeConfiguration, FileCopyConfig, McpServerConfig, McpService, SupportedLang };
package/dist/index.d.ts CHANGED
@@ -19,6 +19,7 @@ interface McpServerConfig {
19
19
  interface ClaudeConfiguration {
20
20
  mcpServers: Record<string, McpServerConfig>;
21
21
  hasCompletedOnboarding?: boolean;
22
+ env?: Record<string, string>;
22
23
  }
23
24
 
24
25
  declare const CLAUDE_DIR: string;
@@ -120,6 +121,11 @@ declare function backupMcpConfig(): string | null;
120
121
  declare function mergeMcpServers(existing: ClaudeConfiguration | null, newServers: Record<string, McpServerConfig>): ClaudeConfiguration;
121
122
  declare function buildMcpServerConfig(baseConfig: McpServerConfig, apiKey?: string, placeholder?: string, envVarName?: string): McpServerConfig;
122
123
  declare function fixWindowsMcpConfig(config: ClaudeConfiguration): ClaudeConfiguration;
124
+ /**
125
+ * 更新 ~/.claude.json 的 env 对象
126
+ * @param envVars 要设置的环境变量键值对
127
+ */
128
+ declare function updateClaudeConfigEnv(envVars: Record<string, string>): void;
123
129
  declare function addCompletedOnboarding(): void;
124
130
 
125
131
  declare function importRecommendedEnv(): Promise<void>;
@@ -146,5 +152,5 @@ declare function cleanupPermissions(templatePermissions: string[], userPermissio
146
152
  */
147
153
  declare function mergeAndCleanPermissions(templatePermissions: string[] | undefined, userPermissions: string[] | undefined): string[];
148
154
 
149
- export { AICO_CONFIG_FILE, AI_OUTPUT_LANGUAGES, CLAUDE_DIR, CLAUDE_MD_FILE, ClAUDE_CONFIG_FILE, DEFAULT_FILE_COPY_CONFIGS, LANG_LABELS, LEGACY_AICO_CONFIG_FILE, MCP_SERVICES, SETTINGS_FILE, SUPPORTED_LANGS, addCompletedOnboarding, applyAiLanguageDirective, backupExistingConfig, backupMcpConfig, buildMcpServerConfig, cleanupPermissions, commandExists, configureApi, copyConfigFiles, copyConfigFilesWithConfig, ensureClaudeDir, fixWindowsMcpConfig, getExistingApiConfig, getMcpConfigPath, getPlatform, importRecommendedEnv, importRecommendedPermissions, init, installClaudeCode, installClaudeCodeSilently, isClaudeCodeInstalled, mergeAndCleanPermissions, mergeConfigs, mergeMcpServers, mergeSettingsFile, openSettingsJson, readMcpConfig, updateDefaultModel, writeMcpConfig };
155
+ export { AICO_CONFIG_FILE, AI_OUTPUT_LANGUAGES, CLAUDE_DIR, CLAUDE_MD_FILE, ClAUDE_CONFIG_FILE, DEFAULT_FILE_COPY_CONFIGS, LANG_LABELS, LEGACY_AICO_CONFIG_FILE, MCP_SERVICES, SETTINGS_FILE, SUPPORTED_LANGS, addCompletedOnboarding, applyAiLanguageDirective, backupExistingConfig, backupMcpConfig, buildMcpServerConfig, cleanupPermissions, commandExists, configureApi, copyConfigFiles, copyConfigFilesWithConfig, ensureClaudeDir, fixWindowsMcpConfig, getExistingApiConfig, getMcpConfigPath, getPlatform, importRecommendedEnv, importRecommendedPermissions, init, installClaudeCode, installClaudeCodeSilently, isClaudeCodeInstalled, mergeAndCleanPermissions, mergeConfigs, mergeMcpServers, mergeSettingsFile, openSettingsJson, readMcpConfig, updateClaudeConfigEnv, updateDefaultModel, writeMcpConfig };
150
156
  export type { AiOutputLanguage, ApiConfig, ClaudeConfiguration, FileCopyConfig, McpServerConfig, McpService, SupportedLang };
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { A as AICO_CONFIG_FILE, k as AI_OUTPUT_LANGUAGES, C as CLAUDE_DIR, e as CLAUDE_MD_FILE, f as ClAUDE_CONFIG_FILE, D as DEFAULT_FILE_COPY_CONFIGS, j as LANG_LABELS, L as LEGACY_AICO_CONFIG_FILE, M as MCP_SERVICES, S as SETTINGS_FILE, h as SUPPORTED_LANGS, K as addCompletedOnboarding, z as applyAiLanguageDirective, r as backupExistingConfig, G as backupMcpConfig, I as buildMcpServerConfig, d as cleanupPermissions, c as commandExists, u as configureApi, s as copyConfigFiles, t as copyConfigFilesWithConfig, q as ensureClaudeDir, J as fixWindowsMcpConfig, y as getExistingApiConfig, B as getMcpConfigPath, g as getPlatform, a as importRecommendedEnv, b as importRecommendedPermissions, i as init, n as installClaudeCode, p as installClaudeCodeSilently, l as isClaudeCodeInstalled, m as mergeAndCleanPermissions, v as mergeConfigs, H as mergeMcpServers, x as mergeSettingsFile, o as openSettingsJson, E as readMcpConfig, w as updateDefaultModel, F as writeMcpConfig } from './chunks/simple-config.mjs';
1
+ export { A as AICO_CONFIG_FILE, k as AI_OUTPUT_LANGUAGES, C as CLAUDE_DIR, e as CLAUDE_MD_FILE, f as ClAUDE_CONFIG_FILE, D as DEFAULT_FILE_COPY_CONFIGS, j as LANG_LABELS, L as LEGACY_AICO_CONFIG_FILE, M as MCP_SERVICES, S as SETTINGS_FILE, h as SUPPORTED_LANGS, N as addCompletedOnboarding, z as applyAiLanguageDirective, r as backupExistingConfig, G as backupMcpConfig, I as buildMcpServerConfig, d as cleanupPermissions, c as commandExists, u as configureApi, s as copyConfigFiles, t as copyConfigFilesWithConfig, q as ensureClaudeDir, J as fixWindowsMcpConfig, y as getExistingApiConfig, B as getMcpConfigPath, g as getPlatform, a as importRecommendedEnv, b as importRecommendedPermissions, i as init, n as installClaudeCode, p as installClaudeCodeSilently, l as isClaudeCodeInstalled, m as mergeAndCleanPermissions, v as mergeConfigs, H as mergeMcpServers, x as mergeSettingsFile, o as openSettingsJson, E as readMcpConfig, K as updateClaudeConfigEnv, w as updateDefaultModel, F as writeMcpConfig } from './chunks/simple-config.mjs';
2
2
  import 'ansis';
3
3
  import 'inquirer';
4
4
  import 'tinyexec';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aico-cli",
3
- "version": "2.0.33",
3
+ "version": "2.0.35",
4
4
  "packageManager": "pnpm@9.15.9",
5
5
  "description": "AI CLI",
6
6
  "repository": {
@@ -41,7 +41,7 @@
41
41
  "hooks:clean": "rimraf templates/hooks/dist templates/hooks/*.js templates/hooks/*.d.ts templates/hooks/*.js.map"
42
42
  },
43
43
  "dependencies": {
44
- "@anthropic-ai/claude-code": "^2.0.57",
44
+ "@anthropic-ai/claude-code": "^2.0.62",
45
45
  "ansis": "^3.17.0",
46
46
  "cac": "^6.7.14",
47
47
  "dayjs": "^1.11.13",
File without changes
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.