@volcengine/tls-observer-pi-install 0.0.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.
package/LICENCE ADDED
@@ -0,0 +1,13 @@
1
+ # Copyright 2023 Beijing Volcano Engine Technology Ltd.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
package/README.md ADDED
@@ -0,0 +1,70 @@
1
+ # TLS Observer Pi Installer
2
+
3
+ 一键安装 `@volcengine/tls-observer-pi` 到 Pi Coding Agent。
4
+
5
+ ## 安装
6
+
7
+ ```bash
8
+ npm exec -y \
9
+ --package=@volcengine/tls-observer-pi-install -- \
10
+ tls-observer-pi-install
11
+ ```
12
+
13
+ 安装器默认从 registry 安装插件 `@latest`。使用 beta:
14
+
15
+ ```bash
16
+ npm exec -y \
17
+ --package=@volcengine/tls-observer-pi-install -- \
18
+ tls-observer-pi-install --beta
19
+ ```
20
+
21
+ `--plugin-version <version>` 可以指定精确版本或 dist-tag,并覆盖 `--beta`。
22
+
23
+ ## 安装结果
24
+
25
+ - Pi 插件包:由 Pi CLI 通过 `pi install` 安装,可使用 `pi list` 查看
26
+ - TLS env:`~/.pi/agent/tls-observer-pi.env`
27
+ - 运行数据:`~/.pi/agent/tls-observer-pi`
28
+
29
+ 安装器不会写入当前项目的 `.pi/settings.json`。本地路径安装使用用户级 `pi install <path>`;不要使用 `pi install <path> -l` 代替安装器默认行为,因为 `-l` 会写入项目级配置。
30
+
31
+ 如果 `pi` 不在 `PATH`,可以通过 `--pi-bin <path>` 或 `PI_TLS_PI_BIN=/absolute/path/to/pi` 指定 Pi CLI 路径。
32
+
33
+ ## 非交互安装
34
+
35
+ ```bash
36
+ npm exec -y \
37
+ --package=@volcengine/tls-observer-pi-install -- \
38
+ tls-observer-pi-install \
39
+ --non-interactive \
40
+ --force \
41
+ --trace-topic-id <trace-topic-id> \
42
+ --api-key <api-key>
43
+ ```
44
+
45
+ TLS Region 默认是 `cn-beijing`,TLS Producer endpoint 会根据最终 Region 自动生成为 `tls-cn-beijing.volces.com`。如需切换 Region,使用 `--region <region>`;如需单独覆盖 endpoint,使用 `--tls-endpoint <host>`。
46
+
47
+ AK/SK 模式将 `--api-key` 替换为 `--ak`、`--sk`。Pi 安装器不会自动创建或发现 TLS LogApp,因此仍需提供 `--trace-topic-id`。
48
+
49
+ 如果只想安装插件、不写 TLS env,可使用:
50
+
51
+ ```bash
52
+ npm exec -y \
53
+ --package=@volcengine/tls-observer-pi-install -- \
54
+ tls-observer-pi-install --skip-tls-config
55
+ ```
56
+
57
+ ## 本地开发
58
+
59
+ ```bash
60
+ emo run build --filter @volcengine/tls-observer-pi
61
+ emo run check --filter @volcengine/tls-observer-pi-install
62
+ emo run build --filter @volcengine/tls-observer-pi-install
63
+
64
+ PI_PLUGIN_SOURCE="$PWD/packages/pi" \
65
+ node packages/pi-install/bin/tls-observer-pi-install.mjs --force --skip-tls-config
66
+ ```
67
+
68
+ 安装器会读取源码包的 `publishConfig.directory`,因此本地开发与正式发布都会使用构建生成的 `dist-package`。`PI_PLUGIN_SOURCE` 也可以直接指向 `packages/pi/dist-package`。
69
+
70
+ 本地源安装使用 `pi install <local-path>`。历史兼容变量 `PI_TLS_PLUGIN_SOURCE`、`TRAE_TLS_PLUGIN_SOURCE` 仍可识别,但新命令建议使用 `PI_PLUGIN_SOURCE`。
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+ import { run } from '../dist/index.js';
3
+
4
+ export { run } from '../dist/index.js';
5
+
6
+ run().catch((error) => {
7
+ console.error(error instanceof Error ? error.message : String(error));
8
+ process.exit(1);
9
+ });
@@ -0,0 +1 @@
1
+ export { applyDerivedDefaults, buildTlsEnv, findLocalPluginSource, installPiPackage, installPlugin, parseCliOptions, pluginPackageSpec, run, runInstaller, validateBaseTlsConfig, validateTlsConfig, writeEnvFile, writeTlsEnv, } from './installer/installer-runner';