@biaoo/tiangong-wiki 0.3.7 → 0.3.9
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/README.md +3 -1
- package/README.zh-CN.md +3 -1
- package/assets/config.example.env +4 -5
- package/dist/commands/check-config.js +16 -1
- package/dist/core/agent-auth.js +101 -0
- package/dist/core/codex-workflow.js +0 -4
- package/dist/core/onboarding.js +14 -1
- package/dist/core/paths.js +1 -1
- package/dist/core/workflow-context.js +2 -0
- package/dist/core/workspace-skills.js +21 -6
- package/dist/dashboard/assets/{index-6A0PWT4X.js → index--rPAFg6i.js} +5 -5
- package/dist/dashboard/index.html +1 -1
- package/dist/index.js +0 -0
- package/package.json +1 -1
- package/references/cli-interface.md +1 -1
- package/references/troubleshooting.md +26 -4
- package/references/vault-to-wiki-instruction.md +4 -1
- package/dist/core/agent.js +0 -201
package/README.md
CHANGED
|
@@ -86,7 +86,7 @@ tiangong-wiki sync # index Markdown pages
|
|
|
86
86
|
|
|
87
87
|
That means commands still work best from inside a workspace, but they can also run from outside the workspace after setup, or target a specific workspace explicitly with `--env-file`.
|
|
88
88
|
|
|
89
|
-
For automatic vault processing, new setup runs default to `WIKI_AGENT_AUTH_MODE=codex-login`,
|
|
89
|
+
For automatic vault processing, new setup runs default to `WIKI_AGENT_AUTH_MODE=codex-login`, the current user's standard Codex home (`~/.codex`, or the user profile `.codex` directory on Windows), and `WIKI_AGENT_MODEL=gpt-5.5`. If you want an isolated Codex home, set `WIKI_AGENT_CODEX_HOME=/absolute/path/to/.codex-tiangong-wiki` and first run `CODEX_HOME=/absolute/path/to/.codex-tiangong-wiki codex login`.
|
|
90
90
|
|
|
91
91
|
```bash
|
|
92
92
|
tiangong-wiki find --type concept --status active # structured query
|
|
@@ -117,6 +117,8 @@ tiangong-wiki dashboard # open dashboard in browse
|
|
|
117
117
|
|
|
118
118
|
> Environment variables are managed via `.wiki.env` (created by `tiangong-wiki setup`). The CLI prefers the nearest local `.wiki.env`, then falls back to the global default workspace config. See [references/troubleshooting.md](./references/troubleshooting.md) for the full reference. For a centralized Linux + `systemd` + Nginx deployment, see [references/centralized-service-deployment.md](./references/centralized-service-deployment.md). That deployment guide now also includes Git repository / GitHub remote setup for daemon-side commit and optional auto-push.
|
|
119
119
|
|
|
120
|
+
For document-heavy vaults, set `WIKI_PARSER_SKILLS=document-granular-decompose` and configure `UNSTRUCTURED_API_BASE_URL` plus `UNSTRUCTURED_AUTH_TOKEN` to prefer the TianGong Unstructure parser. The wiki workflow uses `return_txt=true` and consumes the plain `txt` text as the agent input; `UNSTRUCTURED_PROVIDER` and `UNSTRUCTURED_MODEL` are optional overrides.
|
|
121
|
+
|
|
120
122
|
## MCP Server
|
|
121
123
|
|
|
122
124
|
Tiangong Wiki ships a separate MCP adapter that talks to the daemon over HTTP. It uses the MCP Streamable HTTP transport, not stdio.
|
package/README.zh-CN.md
CHANGED
|
@@ -86,7 +86,7 @@ tiangong-wiki sync # 索引 Markdown 文件
|
|
|
86
86
|
|
|
87
87
|
这意味着命令仍然最适合在 workspace 内执行;但 setup 之后,即使在 workspace 外运行,也可以通过默认配置正常工作,或者通过 `--env-file` 显式指定目标工作区。
|
|
88
88
|
|
|
89
|
-
如果启用自动 vault 处理,新的 setup 默认使用 `WIKI_AGENT_AUTH_MODE=codex-login
|
|
89
|
+
如果启用自动 vault 处理,新的 setup 默认使用 `WIKI_AGENT_AUTH_MODE=codex-login`、当前用户标准 Codex home(Linux/macOS 为 `~/.codex`,Windows 为用户目录下的 `.codex`)和 `WIKI_AGENT_MODEL=gpt-5.5`。如果需要隔离目录,可手动设置 `WIKI_AGENT_CODEX_HOME=/absolute/path/to/.codex-tiangong-wiki`,并先执行 `CODEX_HOME=/absolute/path/to/.codex-tiangong-wiki codex login`。
|
|
90
90
|
|
|
91
91
|
```bash
|
|
92
92
|
tiangong-wiki find --type concept --status active # 结构化查询
|
|
@@ -117,6 +117,8 @@ tiangong-wiki dashboard # 在浏览器中打开仪
|
|
|
117
117
|
|
|
118
118
|
> 环境变量通过 `.wiki.env` 管理(由 `tiangong-wiki setup` 创建)。CLI 会优先使用最近的本地 `.wiki.env`,找不到时再 fallback 到全局默认工作区配置。完整参考见 [references/troubleshooting.md](./references/troubleshooting.md)。如需部署中心化服务(Linux + `systemd` + Nginx),见 [references/centralized-service-deployment.md](./references/centralized-service-deployment.md)。该部署文档现在也包含了 Git 仓库初始化、GitHub remote 配置和 daemon 自动 push 的 Git 配置说明。
|
|
119
119
|
|
|
120
|
+
如果 vault 里以文档解析为主,可设置 `WIKI_PARSER_SKILLS=document-granular-decompose`,并配置 `UNSTRUCTURED_API_BASE_URL` 与 `UNSTRUCTURED_AUTH_TOKEN`,让 workflow 优先使用 TianGong Unstructure parser。wiki workflow 会使用 `return_txt=true`,并把返回的纯 `txt` 文本作为 agent 主输入;`UNSTRUCTURED_PROVIDER` 和 `UNSTRUCTURED_MODEL` 只是可选覆盖项。
|
|
121
|
+
|
|
120
122
|
## MCP Server
|
|
121
123
|
|
|
122
124
|
Tiangong Wiki 提供了独立的 MCP 适配层,通过 HTTP 调用 daemon。它使用的是 MCP 的 Streamable HTTP 传输,不是 stdio。
|
|
@@ -11,12 +11,11 @@ EMBEDDING_MODEL=text-embedding-3-small
|
|
|
11
11
|
EMBEDDING_DIMENSIONS=1536
|
|
12
12
|
|
|
13
13
|
WIKI_AGENT_ENABLED=false
|
|
14
|
-
# For local Codex login auth, run
|
|
15
|
-
# CODEX_HOME="$HOME/.codex-tiangong-wiki" codex login
|
|
16
|
-
# On Windows PowerShell:
|
|
17
|
-
# $env:CODEX_HOME = "$env:USERPROFILE\.codex-tiangong-wiki"; codex login
|
|
14
|
+
# For local Codex login auth, run `codex login` once as the same user.
|
|
18
15
|
WIKI_AGENT_AUTH_MODE=codex-login
|
|
19
|
-
# Optional. Leave unset to use the current user's
|
|
16
|
+
# Optional. Leave unset to use the current user's standard Codex home: <home>/.codex
|
|
17
|
+
# For an isolated directory, set this to an absolute path and first run:
|
|
18
|
+
# CODEX_HOME=/absolute/path/to/.codex-tiangong-wiki codex login
|
|
20
19
|
# WIKI_AGENT_CODEX_HOME=/absolute/path/to/.codex-tiangong-wiki
|
|
21
20
|
#
|
|
22
21
|
# To use an API key instead of Codex login:
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
+
import { inspectWikiAgentCodexLogin } from "../core/agent-auth.js";
|
|
2
3
|
import { loadRuntimeConfig } from "../core/runtime.js";
|
|
3
4
|
import { EmbeddingClient } from "../core/embedding.js";
|
|
4
5
|
import { getWikiAgentStatus } from "../core/vault-processing.js";
|
|
@@ -20,6 +21,17 @@ export function registerCheckConfigCommand(program) {
|
|
|
20
21
|
if (wikiAgent.enabled && wikiAgent.missing.length > 0) {
|
|
21
22
|
throw new AppError(`WIKI_AGENT_ENABLED=true but missing required settings: ${wikiAgent.missing.join(", ")}`, "config");
|
|
22
23
|
}
|
|
24
|
+
const agentCodexLogin = inspectWikiAgentCodexLogin(wikiAgent);
|
|
25
|
+
if (!agentCodexLogin.ready) {
|
|
26
|
+
throw new AppError([
|
|
27
|
+
agentCodexLogin.summary,
|
|
28
|
+
agentCodexLogin.recommendation,
|
|
29
|
+
].filter(Boolean).join(" "), "config");
|
|
30
|
+
}
|
|
31
|
+
const safeWikiAgent = {
|
|
32
|
+
...wikiAgent,
|
|
33
|
+
apiKey: wikiAgent.apiKey ? "<redacted>" : null,
|
|
34
|
+
};
|
|
23
35
|
const templateChecks = Object.keys(config.templates).map((pageType) => {
|
|
24
36
|
const templatePath = resolveTemplateFilePath(config, paths.wikiRoot, pageType);
|
|
25
37
|
return {
|
|
@@ -44,7 +56,8 @@ export function registerCheckConfigCommand(program) {
|
|
|
44
56
|
templatesPath: paths.templatesPath,
|
|
45
57
|
configVersion: config.configVersion,
|
|
46
58
|
embeddingConfigured: embeddingClient !== null,
|
|
47
|
-
agentProcessing:
|
|
59
|
+
agentProcessing: safeWikiAgent,
|
|
60
|
+
agentCodexLogin,
|
|
48
61
|
probe,
|
|
49
62
|
templateChecks,
|
|
50
63
|
};
|
|
@@ -70,6 +83,8 @@ export function registerCheckConfigCommand(program) {
|
|
|
70
83
|
agentBatchSize: wikiAgent.batchSize,
|
|
71
84
|
agentWorkflowTimeoutSeconds: wikiAgent.workflowTimeoutSeconds,
|
|
72
85
|
agentMissing: wikiAgent.missing.join(", "),
|
|
86
|
+
agentCodexLoginReady: agentCodexLogin.checked ? agentCodexLogin.ready : "",
|
|
87
|
+
agentCodexLoginAuthJson: agentCodexLogin.authJsonPath ?? "",
|
|
73
88
|
probe,
|
|
74
89
|
}),
|
|
75
90
|
"",
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { statSync } from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
function inspectPathKind(targetPath) {
|
|
4
|
+
try {
|
|
5
|
+
const stats = statSync(targetPath);
|
|
6
|
+
if (stats.isDirectory()) {
|
|
7
|
+
return { kind: "directory" };
|
|
8
|
+
}
|
|
9
|
+
if (stats.isFile()) {
|
|
10
|
+
return { kind: "file" };
|
|
11
|
+
}
|
|
12
|
+
return { kind: "other" };
|
|
13
|
+
}
|
|
14
|
+
catch (error) {
|
|
15
|
+
const code = error.code;
|
|
16
|
+
if (code === "ENOENT" || code === "ENOTDIR") {
|
|
17
|
+
return { kind: "missing" };
|
|
18
|
+
}
|
|
19
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
20
|
+
return { kind: "inaccessible", errorMessage: message };
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function codexLoginRecommendation(codexHome) {
|
|
24
|
+
return `Run \`CODEX_HOME=${codexHome} codex login\` before starting automatic vault processing.`;
|
|
25
|
+
}
|
|
26
|
+
export function inspectWikiAgentCodexLogin(settings) {
|
|
27
|
+
if (!settings.enabled || settings.authMode !== "codex-login") {
|
|
28
|
+
return {
|
|
29
|
+
checked: false,
|
|
30
|
+
ready: true,
|
|
31
|
+
codexHome: settings.codexHome,
|
|
32
|
+
authJsonPath: null,
|
|
33
|
+
summary: "Codex login auth is not enabled.",
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
if (!settings.codexHome) {
|
|
37
|
+
return {
|
|
38
|
+
checked: true,
|
|
39
|
+
ready: false,
|
|
40
|
+
codexHome: null,
|
|
41
|
+
authJsonPath: null,
|
|
42
|
+
summary: "WIKI_AGENT_CODEX_HOME is not configured for codex-login auth.",
|
|
43
|
+
recommendation: "Set WIKI_AGENT_CODEX_HOME or rerun `tiangong-wiki setup`.",
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
const codexHome = settings.codexHome;
|
|
47
|
+
const authJsonPath = path.join(codexHome, "auth.json");
|
|
48
|
+
const home = inspectPathKind(codexHome);
|
|
49
|
+
if (home.kind === "missing") {
|
|
50
|
+
return {
|
|
51
|
+
checked: true,
|
|
52
|
+
ready: false,
|
|
53
|
+
codexHome,
|
|
54
|
+
authJsonPath,
|
|
55
|
+
summary: `WIKI_AGENT_CODEX_HOME does not exist: ${codexHome}`,
|
|
56
|
+
recommendation: codexLoginRecommendation(codexHome),
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
if (home.kind !== "directory") {
|
|
60
|
+
return {
|
|
61
|
+
checked: true,
|
|
62
|
+
ready: false,
|
|
63
|
+
codexHome,
|
|
64
|
+
authJsonPath,
|
|
65
|
+
summary: home.kind === "inaccessible"
|
|
66
|
+
? `WIKI_AGENT_CODEX_HOME cannot be inspected: ${codexHome} (${home.errorMessage})`
|
|
67
|
+
: `WIKI_AGENT_CODEX_HOME is not a directory: ${codexHome}`,
|
|
68
|
+
recommendation: codexLoginRecommendation(codexHome),
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
const authJson = inspectPathKind(authJsonPath);
|
|
72
|
+
if (authJson.kind === "missing") {
|
|
73
|
+
return {
|
|
74
|
+
checked: true,
|
|
75
|
+
ready: false,
|
|
76
|
+
codexHome,
|
|
77
|
+
authJsonPath,
|
|
78
|
+
summary: `Codex login auth.json was not found under WIKI_AGENT_CODEX_HOME: ${authJsonPath}`,
|
|
79
|
+
recommendation: codexLoginRecommendation(codexHome),
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
if (authJson.kind !== "file") {
|
|
83
|
+
return {
|
|
84
|
+
checked: true,
|
|
85
|
+
ready: false,
|
|
86
|
+
codexHome,
|
|
87
|
+
authJsonPath,
|
|
88
|
+
summary: authJson.kind === "inaccessible"
|
|
89
|
+
? `Codex login auth.json cannot be inspected: ${authJsonPath} (${authJson.errorMessage})`
|
|
90
|
+
: `Codex login auth.json is not a file: ${authJsonPath}`,
|
|
91
|
+
recommendation: codexLoginRecommendation(codexHome),
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
return {
|
|
95
|
+
checked: true,
|
|
96
|
+
ready: true,
|
|
97
|
+
codexHome,
|
|
98
|
+
authJsonPath,
|
|
99
|
+
summary: `Codex login auth is available at ${codexHome}.`,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import { mkdirSync } from "node:fs";
|
|
3
2
|
import childProcess from "node:child_process";
|
|
4
3
|
import { syncBuiltinESMExports } from "node:module";
|
|
5
4
|
import { readWorkflowResult } from "./workflow-result.js";
|
|
@@ -54,9 +53,6 @@ async function loadCodexSdk() {
|
|
|
54
53
|
}
|
|
55
54
|
function normalizeEnv(input) {
|
|
56
55
|
const agentSettings = resolveAgentSettings(input.env);
|
|
57
|
-
if (agentSettings.authMode === "codex-login" && agentSettings.codexHome) {
|
|
58
|
-
mkdirSync(agentSettings.codexHome, { recursive: true });
|
|
59
|
-
}
|
|
60
56
|
const normalized = {};
|
|
61
57
|
for (const [key, value] of Object.entries({
|
|
62
58
|
...process.env,
|
package/dist/core/onboarding.js
CHANGED
|
@@ -2,6 +2,7 @@ import { accessSync, constants, readFileSync } from "node:fs";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
import { confirm, input, password, select } from "@inquirer/prompts";
|
|
5
|
+
import { inspectWikiAgentCodexLogin } from "./agent-auth.js";
|
|
5
6
|
import { DEFAULT_WIKI_ENV_FILE, getCliEnvironmentInfo, parseEnvFile, serializeEnvEntries } from "./cli-env.js";
|
|
6
7
|
import { resolveTemplateFilePath, loadConfig } from "./config.js";
|
|
7
8
|
import { DEFAULT_EMBEDDING_DIMENSIONS, EmbeddingClient } from "./embedding.js";
|
|
@@ -496,7 +497,7 @@ async function collectAgentSettings(driver, ctx, defaults) {
|
|
|
496
497
|
{
|
|
497
498
|
value: "codex-login",
|
|
498
499
|
label: "codex-login",
|
|
499
|
-
description: "Use
|
|
500
|
+
description: "Use the current user's Codex login by default (~/.codex); set WIKI_AGENT_CODEX_HOME for isolation.",
|
|
500
501
|
},
|
|
501
502
|
{
|
|
502
503
|
value: "api-key",
|
|
@@ -792,6 +793,11 @@ export async function runSetupWizard(env = process.env, options = {}) {
|
|
|
792
793
|
`- Example: cd ${JSON.stringify(workspaceRoot)} && tiangong-wiki init`,
|
|
793
794
|
"- Run `tiangong-wiki doctor` to validate the generated configuration.",
|
|
794
795
|
"- Run `tiangong-wiki init` to create index.db and perform the first sync.",
|
|
796
|
+
...(values.agentEnabled && values.agentAuthMode === "codex-login" && values.agentCodexHome
|
|
797
|
+
? [
|
|
798
|
+
`- Codex login auth uses ${values.agentCodexHome}; if needed, run \`CODEX_HOME=${values.agentCodexHome} codex login\` before starting the daemon.`,
|
|
799
|
+
]
|
|
800
|
+
: []),
|
|
795
801
|
...(values.vaultSource === "synology"
|
|
796
802
|
? ["- Protect `.wiki.env` carefully because it now stores Synology credentials."]
|
|
797
803
|
: []),
|
|
@@ -969,6 +975,13 @@ function inspectAgent(checks, env) {
|
|
|
969
975
|
collectDoctorCheck(checks, "error", "agent", `Automatic vault processing is enabled but missing: ${settings.missing.join(", ")}`, "Set the missing WIKI_AGENT_* values in `.wiki.env` or rerun `tiangong-wiki setup`.");
|
|
970
976
|
return;
|
|
971
977
|
}
|
|
978
|
+
if (settings.authMode === "codex-login") {
|
|
979
|
+
const codexLogin = inspectWikiAgentCodexLogin(settings);
|
|
980
|
+
if (!codexLogin.ready) {
|
|
981
|
+
collectDoctorCheck(checks, "error", "agent", codexLogin.summary, codexLogin.recommendation);
|
|
982
|
+
return;
|
|
983
|
+
}
|
|
984
|
+
}
|
|
972
985
|
collectDoctorCheck(checks, "ok", "agent", settings.authMode === "codex-login"
|
|
973
986
|
? `Automatic vault processing is enabled with model ${settings.model} via Codex login at ${settings.codexHome}.`
|
|
974
987
|
: `Automatic vault processing is enabled with model ${settings.model} via API key auth.`);
|
package/dist/core/paths.js
CHANGED
|
@@ -88,7 +88,7 @@ function normalizeOptionalAbsolutePath(label, rawValue) {
|
|
|
88
88
|
return path.resolve(value);
|
|
89
89
|
}
|
|
90
90
|
export function defaultWikiAgentCodexHome() {
|
|
91
|
-
return path.join(os.homedir(), ".codex
|
|
91
|
+
return path.join(os.homedir(), ".codex");
|
|
92
92
|
}
|
|
93
93
|
export function parseVaultHashMode(raw) {
|
|
94
94
|
const value = (raw ?? "content").trim().toLowerCase();
|
|
@@ -83,6 +83,8 @@ export function buildVaultWorkflowPrompt(input) {
|
|
|
83
83
|
"",
|
|
84
84
|
"1. Read queue-item.json next to RESULT_JSON_PATH.",
|
|
85
85
|
"2. Read the target vault file at VAULT_FILE_PATH. Refer to `references/vault-to-wiki-instruction.md` (Phase 1) in the wiki package for file-type-specific reading strategies, parser skill discovery, image handling, and metadata utilization.",
|
|
86
|
+
" - If `WIKI_PARSER_SKILLS` includes `document-granular-decompose` and `UNSTRUCTURED_API_BASE_URL` plus `UNSTRUCTURED_AUTH_TOKEN` are set, prefer that skill for supported document/image formats before the legacy type-specific parser skills.",
|
|
87
|
+
" - When using `document-granular-decompose`, request `return_txt=true`, treat the pure text extracted from `response.txt`/`txt` as the main input, and keep raw JSON only for debugging or page-number evidence.",
|
|
86
88
|
"3. Discover the current page type ontology via `tiangong-wiki type list` and `tiangong-wiki type show <type>`. Do not assume any type, template, or default target type.",
|
|
87
89
|
"4. Search the existing wiki for overlapping or related content:",
|
|
88
90
|
" - Use `tiangong-wiki fts` and `tiangong-wiki search` with key terms from the source.",
|
|
@@ -8,14 +8,21 @@ import { copyDirectoryContentsSync, ensureDirSync, pathExistsSync, readTextFileS
|
|
|
8
8
|
import { resolveRuntimePaths } from "./paths.js";
|
|
9
9
|
import { toOffsetIso } from "../utils/time.js";
|
|
10
10
|
export const PARSER_SKILL_SOURCE = "https://github.com/anthropics/skills";
|
|
11
|
+
export const TIANGONG_PARSER_SKILL_SOURCE = "https://github.com/tiangong-ai/skills";
|
|
11
12
|
export const MANAGED_SKILL_STATE_FILE = ".tiangong-wiki-skill.json";
|
|
12
13
|
export const OPTIONAL_PARSER_SKILLS = [
|
|
13
|
-
{ name: "pdf", summary: "Process PDF files" },
|
|
14
|
-
{ name: "docx", summary: "Process DOCX files" },
|
|
15
|
-
{ name: "pptx", summary: "Process PPTX files" },
|
|
16
|
-
{ name: "xlsx", summary: "Process XLSX/CSV files" },
|
|
14
|
+
{ name: "pdf", summary: "Process PDF files", source: PARSER_SKILL_SOURCE },
|
|
15
|
+
{ name: "docx", summary: "Process DOCX files", source: PARSER_SKILL_SOURCE },
|
|
16
|
+
{ name: "pptx", summary: "Process PPTX files", source: PARSER_SKILL_SOURCE },
|
|
17
|
+
{ name: "xlsx", summary: "Process XLSX/CSV files", source: PARSER_SKILL_SOURCE },
|
|
18
|
+
{
|
|
19
|
+
name: "document-granular-decompose",
|
|
20
|
+
summary: "Process documents through TianGong Unstructure and return plain fulltext",
|
|
21
|
+
source: TIANGONG_PARSER_SKILL_SOURCE,
|
|
22
|
+
},
|
|
17
23
|
];
|
|
18
24
|
const OPTIONAL_PARSER_SKILL_NAMES = new Set(OPTIONAL_PARSER_SKILLS.map((skill) => skill.name));
|
|
25
|
+
const OPTIONAL_PARSER_SKILL_BY_NAME = new Map(OPTIONAL_PARSER_SKILLS.map((skill) => [skill.name, skill]));
|
|
19
26
|
const MANAGED_SKILL_SOURCE_KINDS = new Set([
|
|
20
27
|
"workspace-package",
|
|
21
28
|
"curated-parser",
|
|
@@ -228,11 +235,15 @@ function normalizeManagedSource(rawSource) {
|
|
|
228
235
|
return source;
|
|
229
236
|
}
|
|
230
237
|
function createParserDescriptor(workspaceRoot, name, configured) {
|
|
238
|
+
const definition = OPTIONAL_PARSER_SKILL_BY_NAME.get(name);
|
|
239
|
+
if (!definition) {
|
|
240
|
+
throw new AppError(`Unsupported parser skill: ${name}`, "config");
|
|
241
|
+
}
|
|
231
242
|
return {
|
|
232
243
|
name,
|
|
233
244
|
sourceKind: "curated-parser",
|
|
234
245
|
configured,
|
|
235
|
-
source:
|
|
246
|
+
source: definition.source,
|
|
236
247
|
skillPath: resolveWorkspaceSkillPath(workspaceRoot, name),
|
|
237
248
|
};
|
|
238
249
|
}
|
|
@@ -656,7 +667,11 @@ export function ensureWikiSkillInstall(wikiPath, packageRoot) {
|
|
|
656
667
|
};
|
|
657
668
|
}
|
|
658
669
|
export function buildParserSkillInstallInvocation(skillName) {
|
|
659
|
-
|
|
670
|
+
const definition = OPTIONAL_PARSER_SKILL_BY_NAME.get(skillName);
|
|
671
|
+
if (!definition) {
|
|
672
|
+
throw new AppError(`Unsupported parser skill: ${skillName}`, "config");
|
|
673
|
+
}
|
|
674
|
+
return buildExternalSkillInstallInvocation(definition.source, skillName);
|
|
660
675
|
}
|
|
661
676
|
export function installParserSkill(skillName, workspaceRoot, options = {}) {
|
|
662
677
|
const installed = installManagedExternalSkill(createParserDescriptor(workspaceRoot, skillName, true), {
|