teamai-cli 0.16.4 → 0.16.6
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/dist/index.js +19 -5
- package/package.json +1 -1
- package/skills/teamai-wiki/SKILL.md +5 -5
package/dist/index.js
CHANGED
|
@@ -128,6 +128,11 @@ function getStatePath(scope, projectRoot) {
|
|
|
128
128
|
function getPushignorePath() {
|
|
129
129
|
return path2.join(process.env.HOME ?? "", ".teamai", "pushignore");
|
|
130
130
|
}
|
|
131
|
+
function isWikiEnabled() {
|
|
132
|
+
if (process.env.TEAMAI_WIKI_DISABLED === "1" || process.env.TEAMAI_WIKI_DISABLED === "true") return false;
|
|
133
|
+
if (process.env.TEAMAI_WIKI_ENABLED === "0" || process.env.TEAMAI_WIKI_ENABLED === "false") return false;
|
|
134
|
+
return true;
|
|
135
|
+
}
|
|
131
136
|
var ToolPathsSchema, ScopeEnum, SharingConfigSchema, SourceConfigSchema, SOURCE_PULL_TTL_MS, TEAMAI_SOURCES_DIR, TeamaiConfigSchema, MemberConfigSchema, LocalConfigSchema, StateSchema, TEAMAI_HOME, TEAMAI_CONFIG_PATH, TEAMAI_STATE_PATH, TEAMAI_TOKEN_PATH, TEAMAI_UPDATE_LOCK_PATH, TEAMAI_RULES_START, TEAMAI_RULES_END, TEAMAI_HOOK_DESCRIPTION_PREFIX, TEAMAI_ENV_START, TEAMAI_ENV_END, TEAMAI_CULTURE_START, TEAMAI_CULTURE_END, TEAMAI_CLAUDEMD_START, TEAMAI_CLAUDEMD_END, SKILL_NAME_REGEX, TEAMAI_USAGE_PATH, TEAMAI_KNOWN_SKILLS_PATH, TEAMAI_PUSHIGNORE_PATH, TEAMAI_SESSIONS_DIR, UsageEventSchema, DASHBOARD_EVENTS_DIR, DASHBOARD_EVENTS_PATH, DASHBOARD_DEFAULT_PORT, DASHBOARD_IDLE_TIMEOUT_MS, DASHBOARD_STALE_TIMEOUT_MS, DASHBOARD_COMPACTION_THRESHOLD, DASHBOARD_STOPPED_DISPLAY_MS, DASHBOARD_PID_CHECK_INTERVAL_MS, CONTRIBUTE_BASE_THRESHOLD, CONTRIBUTE_SMART_THRESHOLD, CONTRIBUTE_SCORE_CACHE_MS, CONTRIBUTE_SESSIONS_DIR, LEARNINGS_LOCAL_DIR, SEARCH_INDEX_PATH, VOTES_LOCAL_DIR, CultureCompanySchema, CultureTeamSchema, CultureFrontmatterSchema;
|
|
132
137
|
var init_types = __esm({
|
|
133
138
|
"src/types.ts"() {
|
|
@@ -2930,7 +2935,7 @@ function getBuiltinSkillsDir() {
|
|
|
2930
2935
|
const distDir = path12.dirname(new URL(import.meta.url).pathname);
|
|
2931
2936
|
return path12.join(distDir, "..", "skills");
|
|
2932
2937
|
}
|
|
2933
|
-
async function deployBuiltinSkills(teamConfig, localConfig) {
|
|
2938
|
+
async function deployBuiltinSkills(teamConfig, localConfig, options) {
|
|
2934
2939
|
const builtinDir = getBuiltinSkillsDir();
|
|
2935
2940
|
if (!await pathExists(builtinDir)) {
|
|
2936
2941
|
log.debug("No built-in skills directory found, skipping deployment");
|
|
@@ -2950,6 +2955,8 @@ async function deployBuiltinSkills(teamConfig, localConfig) {
|
|
|
2950
2955
|
}
|
|
2951
2956
|
}
|
|
2952
2957
|
if (skillNames.length === 0) return 0;
|
|
2958
|
+
const filteredSkills = options?.skipWiki ? skillNames.filter((name) => name !== "teamai-wiki") : skillNames;
|
|
2959
|
+
if (filteredSkills.length === 0) return 0;
|
|
2953
2960
|
const baseDir = localConfig ? resolveBaseDir(localConfig) : process.env.HOME ?? "";
|
|
2954
2961
|
let deployed = 0;
|
|
2955
2962
|
for (const [tool, toolPath] of Object.entries(teamConfig.toolPaths)) {
|
|
@@ -2959,7 +2966,7 @@ async function deployBuiltinSkills(teamConfig, localConfig) {
|
|
|
2959
2966
|
continue;
|
|
2960
2967
|
}
|
|
2961
2968
|
const targetSkillsDir = path12.join(baseDir, toolPath.skills);
|
|
2962
|
-
for (const skillName of
|
|
2969
|
+
for (const skillName of filteredSkills) {
|
|
2963
2970
|
const srcDir = path12.join(builtinDir, skillName);
|
|
2964
2971
|
const destDir = path12.join(targetSkillsDir, skillName);
|
|
2965
2972
|
try {
|
|
@@ -4702,7 +4709,7 @@ async function push(options) {
|
|
|
4702
4709
|
log.debug(`Pre-push sync skipped: ${e.message}`);
|
|
4703
4710
|
}
|
|
4704
4711
|
const spin = spinner("Scanning local resources...").start();
|
|
4705
|
-
const pushableTypes = ["skills", "rules", "env", "wiki"];
|
|
4712
|
+
const pushableTypes = isWikiEnabled() ? ["skills", "rules", "env", "wiki"] : ["skills", "rules", "env"];
|
|
4706
4713
|
const allItems = [];
|
|
4707
4714
|
for (const type of pushableTypes) {
|
|
4708
4715
|
const handler = getHandler(type);
|
|
@@ -4980,6 +4987,7 @@ var init_push = __esm({
|
|
|
4980
4987
|
init_logger();
|
|
4981
4988
|
init_resources();
|
|
4982
4989
|
init_skills();
|
|
4990
|
+
init_types();
|
|
4983
4991
|
init_roles();
|
|
4984
4992
|
init_prompt();
|
|
4985
4993
|
init_fs();
|
|
@@ -6015,7 +6023,8 @@ async function pullForScope(localConfig, options) {
|
|
|
6015
6023
|
}
|
|
6016
6024
|
const tagsConfig = await loadTagsConfig(localConfig.repo.localPath);
|
|
6017
6025
|
const subscribedTags = localConfig.subscribedTags;
|
|
6018
|
-
const
|
|
6026
|
+
const wikiEnabled = isWikiEnabled();
|
|
6027
|
+
const resourceTypes = wikiEnabled ? ["skills", "rules", "docs", "env", "wiki"] : ["skills", "rules", "docs", "env"];
|
|
6019
6028
|
let totalSynced = 0;
|
|
6020
6029
|
let desiredSkillNames = null;
|
|
6021
6030
|
let knownRepoSkillNames = null;
|
|
@@ -6278,7 +6287,7 @@ async function pullForScope(localConfig, options) {
|
|
|
6278
6287
|
if (!options.dryRun) {
|
|
6279
6288
|
try {
|
|
6280
6289
|
const { deployBuiltinSkills: deployBuiltinSkills2 } = await Promise.resolve().then(() => (init_builtin_skills(), builtin_skills_exports));
|
|
6281
|
-
const deployed = await deployBuiltinSkills2(freshConfig, localConfig);
|
|
6290
|
+
const deployed = await deployBuiltinSkills2(freshConfig, localConfig, { skipWiki: !wikiEnabled });
|
|
6282
6291
|
if (deployed > 0) {
|
|
6283
6292
|
log.debug(`[${scopeLabel}] Deployed ${deployed} built-in skill(s)`);
|
|
6284
6293
|
}
|
|
@@ -6736,6 +6745,10 @@ async function status(options) {
|
|
|
6736
6745
|
for (const [type, count] of Object.entries(counts)) {
|
|
6737
6746
|
console.log(` ${type}: ${count}`);
|
|
6738
6747
|
}
|
|
6748
|
+
if (!isWikiEnabled()) {
|
|
6749
|
+
console.log("");
|
|
6750
|
+
log.info("\u2139 Wiki: disabled (TEAMAI_WIKI_DISABLED=1) \u2014 wiki routing handled by external plugin");
|
|
6751
|
+
}
|
|
6739
6752
|
console.log("");
|
|
6740
6753
|
log.info("Local resources not yet pushed:");
|
|
6741
6754
|
let anyNew = false;
|
|
@@ -6902,6 +6915,7 @@ var init_status = __esm({
|
|
|
6902
6915
|
init_skills();
|
|
6903
6916
|
init_known_agents();
|
|
6904
6917
|
init_agent_skills();
|
|
6918
|
+
init_types();
|
|
6905
6919
|
}
|
|
6906
6920
|
});
|
|
6907
6921
|
|
package/package.json
CHANGED
|
@@ -243,10 +243,10 @@ When invoked, first determine the subcommand (init/ingest/query/lint/status/expo
|
|
|
243
243
|
|
|
244
244
|
#### Step 1 — Parse arguments
|
|
245
245
|
|
|
246
|
-
- `WIKI_DIR`:
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
246
|
+
- `WIKI_DIR`: 根据当前项目的 teamai scope 决定:
|
|
247
|
+
- 读取 `<projectRoot>/.teamai/config.yaml` 中的 `scope` 字段
|
|
248
|
+
- **project scope** → `<projectRoot>/.teamai/wiki/`
|
|
249
|
+
- **user scope**(或无项目配置时)→ `~/.teamai/wiki/`
|
|
250
250
|
- `SOURCE_DIR`: 可选的 `dir` 参数
|
|
251
251
|
|
|
252
252
|
如果 `WIKI_DIR` 已经存在且包含 `_metadata.json`,提示用户已经初始化过,询问是否要重新初始化。
|
|
@@ -1009,7 +1009,7 @@ Wiki exported to: <path>
|
|
|
1009
1009
|
8. **_metadata.json 是真相来源** — 页面列表、文件哈希、链接图都以此为准。
|
|
1010
1010
|
9. **命名一致性** — 文件名 kebab-case,标题 Title Case 或人类可读中文。
|
|
1011
1011
|
10. **幂等性** — 重复 ingest 同一源目录应产生相同结果(不会重复创建页面)。
|
|
1012
|
-
11. **wiki
|
|
1012
|
+
11. **wiki 路径** — 读取 `<projectRoot>/.teamai/config.yaml` 的 `scope` 字段:project scope 用 `<projectRoot>/.teamai/wiki/`,user scope 用 `~/.teamai/wiki/`。与 teamai push/pull 的 `WikiHandler.getSharedWikiDir()` 逻辑对齐。
|
|
1013
1013
|
12. **Obsidian 兼容** — 所有 `[[links]]` 使用 Obsidian 格式,方便用户在 Obsidian 中直接浏览。
|
|
1014
1014
|
13. **语言** — Wiki 页面内容默认使用中文撰写,技术术语保持英文原文。
|
|
1015
1015
|
14. **智能分类** — LLM 根据内容自动判断页面归属哪个分类目录,无需用户指定。
|