geo-ai-search-optimization 1.3.5 → 1.3.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/README.md +7 -0
- package/package.json +1 -1
- package/src/cli-shell-commands.js +47 -0
- package/src/cli.js +5 -50
package/README.md
CHANGED
|
@@ -872,6 +872,13 @@ geo-ai-search-optimization help
|
|
|
872
872
|
- 主 `cli.js` 现在只保留 install / skills / where / version / help 与 command routing
|
|
873
873
|
- CLI 已经形成 `flow / execution / planning-delivery / site-ops / shared` 五层 command adapter 结构
|
|
874
874
|
|
|
875
|
+
## New in 1.3.6
|
|
876
|
+
|
|
877
|
+
- 继续做 CLI 架构迭代,把 shell family 也从主 `cli.js` 拆出
|
|
878
|
+
- 新增 `src/cli-shell-commands.js`,接管 `install / skills / where`
|
|
879
|
+
- 主 `cli.js` 现在只保留 `version / help / command routing`
|
|
880
|
+
- CLI 已经形成 `shell / flow / execution / planning-delivery / site-ops / shared` 六层 command adapter 结构
|
|
881
|
+
|
|
875
882
|
## New in 1.2.20
|
|
876
883
|
|
|
877
884
|
- 新增 `agent-continue`
|
package/package.json
CHANGED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { getFlagValue, hasFlag } from "./cli-shared.js";
|
|
2
|
+
import { installSkill } from "./install-skill.js";
|
|
3
|
+
import { getBundledSkillPath, getInstalledSkillPath, getSkillName, getSkillsDir } from "./paths.js";
|
|
4
|
+
import { listBundledSkills, renderBundledSkillsMarkdown } from "./skills.js";
|
|
5
|
+
|
|
6
|
+
export const SHELL_HELP_LINES = [
|
|
7
|
+
" geo-ai-search-optimization install [--target <dir>] [--json]",
|
|
8
|
+
" geo-ai-search-optimization skills [--json]",
|
|
9
|
+
" geo-ai-search-optimization where"
|
|
10
|
+
];
|
|
11
|
+
|
|
12
|
+
async function handleInstall(args) {
|
|
13
|
+
const targetDir = getFlagValue(args, "--target");
|
|
14
|
+
const outputJson = hasFlag(args, "--json");
|
|
15
|
+
const result = await installSkill({ targetDir, silent: outputJson });
|
|
16
|
+
|
|
17
|
+
if (outputJson) {
|
|
18
|
+
process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
async function handleSkills(args) {
|
|
23
|
+
const bundle = await listBundledSkills();
|
|
24
|
+
if (hasFlag(args, "--json")) {
|
|
25
|
+
process.stdout.write(`${JSON.stringify(bundle, null, 2)}\n`);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
process.stdout.write(renderBundledSkillsMarkdown(bundle));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function handleWhere() {
|
|
33
|
+
process.stdout.write(
|
|
34
|
+
[
|
|
35
|
+
`skill: ${getSkillName()}`,
|
|
36
|
+
`bundled: ${getBundledSkillPath()}`,
|
|
37
|
+
`skillsDir: ${getSkillsDir()}`,
|
|
38
|
+
`installed: ${getInstalledSkillPath()}`
|
|
39
|
+
].join("\n") + "\n"
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export const SHELL_COMMAND_HANDLERS = {
|
|
44
|
+
install: handleInstall,
|
|
45
|
+
skills: handleSkills,
|
|
46
|
+
where: handleWhere
|
|
47
|
+
};
|
package/src/cli.js
CHANGED
|
@@ -10,11 +10,8 @@ import {
|
|
|
10
10
|
PLANNING_DELIVERY_COMMAND_HANDLERS,
|
|
11
11
|
PLANNING_DELIVERY_HELP_LINES
|
|
12
12
|
} from "./cli-planning-delivery-commands.js";
|
|
13
|
+
import { SHELL_COMMAND_HANDLERS, SHELL_HELP_LINES } from "./cli-shell-commands.js";
|
|
13
14
|
import { SITE_OPS_COMMAND_HANDLERS, SITE_OPS_HELP_LINES } from "./cli-site-ops-commands.js";
|
|
14
|
-
import { getFlagValue, hasFlag } from "./cli-shared.js";
|
|
15
|
-
import { installSkill } from "./install-skill.js";
|
|
16
|
-
import { getBundledSkillPath, getInstalledSkillPath, getSkillName, getSkillsDir } from "./paths.js";
|
|
17
|
-
import { listBundledSkills, renderBundledSkillsMarkdown } from "./skills.js";
|
|
18
15
|
|
|
19
16
|
let cachedVersion;
|
|
20
17
|
|
|
@@ -36,13 +33,11 @@ function printHelp() {
|
|
|
36
33
|
"",
|
|
37
34
|
"Usage:",
|
|
38
35
|
" geo-ai-search-optimization",
|
|
39
|
-
|
|
36
|
+
...SHELL_HELP_LINES,
|
|
40
37
|
...FLOW_HELP_LINES,
|
|
41
38
|
...AGENT_EXECUTION_HELP_LINES,
|
|
42
39
|
...PLANNING_DELIVERY_HELP_LINES,
|
|
43
40
|
...SITE_OPS_HELP_LINES,
|
|
44
|
-
" geo-ai-search-optimization skills [--json]",
|
|
45
|
-
" geo-ai-search-optimization where",
|
|
46
41
|
" geo-ai-search-optimization version",
|
|
47
42
|
" geo-ai-search-optimization help",
|
|
48
43
|
"",
|
|
@@ -55,39 +50,9 @@ function printHelp() {
|
|
|
55
50
|
);
|
|
56
51
|
}
|
|
57
52
|
|
|
58
|
-
async function handleInstall(args) {
|
|
59
|
-
const targetDir = getFlagValue(args, "--target");
|
|
60
|
-
const outputJson = hasFlag(args, "--json");
|
|
61
|
-
const result = await installSkill({ targetDir, silent: outputJson });
|
|
62
|
-
|
|
63
|
-
if (outputJson) {
|
|
64
|
-
process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function handleWhere() {
|
|
69
|
-
process.stdout.write(
|
|
70
|
-
[
|
|
71
|
-
`skill: ${getSkillName()}`,
|
|
72
|
-
`bundled: ${getBundledSkillPath()}`,
|
|
73
|
-
`skillsDir: ${getSkillsDir()}`,
|
|
74
|
-
`installed: ${getInstalledSkillPath()}`
|
|
75
|
-
].join("\n") + "\n"
|
|
76
|
-
);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
async function handleSkills(args) {
|
|
80
|
-
const bundle = await listBundledSkills();
|
|
81
|
-
if (hasFlag(args, "--json")) {
|
|
82
|
-
process.stdout.write(`${JSON.stringify(bundle, null, 2)}\n`);
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
process.stdout.write(renderBundledSkillsMarkdown(bundle));
|
|
87
|
-
}
|
|
88
|
-
|
|
89
53
|
export async function runCli(args = []) {
|
|
90
54
|
const [command = "install", ...rest] = args;
|
|
55
|
+
const shellHandler = SHELL_COMMAND_HANDLERS[command];
|
|
91
56
|
const flowHandler = FLOW_COMMAND_HANDLERS[command];
|
|
92
57
|
const agentExecutionHandler = AGENT_EXECUTION_COMMAND_HANDLERS[command];
|
|
93
58
|
const planningDeliveryHandler = PLANNING_DELIVERY_COMMAND_HANDLERS[command];
|
|
@@ -103,8 +68,8 @@ export async function runCli(args = []) {
|
|
|
103
68
|
return;
|
|
104
69
|
}
|
|
105
70
|
|
|
106
|
-
if (
|
|
107
|
-
await
|
|
71
|
+
if (shellHandler) {
|
|
72
|
+
await shellHandler(rest);
|
|
108
73
|
return;
|
|
109
74
|
}
|
|
110
75
|
|
|
@@ -128,16 +93,6 @@ export async function runCli(args = []) {
|
|
|
128
93
|
return;
|
|
129
94
|
}
|
|
130
95
|
|
|
131
|
-
if (command === "skills") {
|
|
132
|
-
await handleSkills(rest);
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
if (command === "where") {
|
|
137
|
-
handleWhere();
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
96
|
throw new Error(`Unknown command: ${command}`);
|
|
142
97
|
}
|
|
143
98
|
|