geo-ai-search-optimization 1.3.8 → 1.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 +8 -0
- package/package.json +1 -1
- package/src/cli-shared.js +20 -0
- package/src/cli-shell-commands.js +11 -10
- package/src/cli-site-ops-commands.js +30 -40
package/README.md
CHANGED
|
@@ -894,6 +894,14 @@ geo-ai-search-optimization help
|
|
|
894
894
|
- `src/cli-site-ops-commands.js` 现在统一通过组合器编排 `doctor / quick-start / onboard / onboard-url / audit / scan`
|
|
895
895
|
- CLI 架构进一步收敛到“命令族 adapter + shared composition primitives”的模式
|
|
896
896
|
|
|
897
|
+
## New in 1.3.9
|
|
898
|
+
|
|
899
|
+
- 继续把“直接执行型命令”也纳入共享组合模式
|
|
900
|
+
- `src/cli-shared.js` 新增 `createActionCommandHandler`
|
|
901
|
+
- `src/cli-shell-commands.js` 里的 `install` 已改成声明式 action 组合
|
|
902
|
+
- `src/cli-site-ops-commands.js` 里的 `init-llms / init-schema` 已改成声明式 action 组合
|
|
903
|
+
- CLI 现在同时覆盖 artifact、structured-output、action 三类共享 composition primitives
|
|
904
|
+
|
|
897
905
|
## New in 1.2.20
|
|
898
906
|
|
|
899
907
|
- 新增 `agent-continue`
|
package/package.json
CHANGED
package/src/cli-shared.js
CHANGED
|
@@ -113,3 +113,23 @@ export function createStructuredOutputCommandHandler({
|
|
|
113
113
|
process.stdout.write(renderedOutput);
|
|
114
114
|
};
|
|
115
115
|
}
|
|
116
|
+
|
|
117
|
+
export function createActionCommandHandler({
|
|
118
|
+
execute,
|
|
119
|
+
getOutputJson,
|
|
120
|
+
renderText
|
|
121
|
+
}) {
|
|
122
|
+
return async function actionCommandHandler(args) {
|
|
123
|
+
const result = await execute(args);
|
|
124
|
+
const outputJson = getOutputJson ? getOutputJson(args, result) : hasFlag(args, "--json");
|
|
125
|
+
|
|
126
|
+
if (outputJson) {
|
|
127
|
+
process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
if (renderText) {
|
|
132
|
+
process.stdout.write(renderText(result, args));
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getFlagValue, hasFlag } from "./cli-shared.js";
|
|
1
|
+
import { createActionCommandHandler, getFlagValue, hasFlag } from "./cli-shared.js";
|
|
2
2
|
import { installSkill } from "./install-skill.js";
|
|
3
3
|
import { getBundledSkillPath, getInstalledSkillPath, getSkillName, getSkillsDir } from "./paths.js";
|
|
4
4
|
import { listBundledSkills, renderBundledSkillsMarkdown } from "./skills.js";
|
|
@@ -9,15 +9,16 @@ export const SHELL_HELP_LINES = [
|
|
|
9
9
|
" geo-ai-search-optimization where"
|
|
10
10
|
];
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
12
|
+
const handleInstall = createActionCommandHandler({
|
|
13
|
+
execute: async (args) => {
|
|
14
|
+
const outputJson = hasFlag(args, "--json");
|
|
15
|
+
return installSkill({
|
|
16
|
+
targetDir: getFlagValue(args, "--target"),
|
|
17
|
+
silent: outputJson
|
|
18
|
+
});
|
|
19
|
+
},
|
|
20
|
+
getOutputJson: (args) => hasFlag(args, "--json")
|
|
21
|
+
});
|
|
21
22
|
|
|
22
23
|
async function handleSkills(args) {
|
|
23
24
|
const bundle = await listBundledSkills();
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { auditProject, renderAuditMarkdown, writeAuditOutput } from "./audit.js";
|
|
2
2
|
import {
|
|
3
|
+
createActionCommandHandler,
|
|
3
4
|
createStructuredOutputCommandHandler,
|
|
4
5
|
getFlagValue,
|
|
5
6
|
hasFlag,
|
|
@@ -74,46 +75,35 @@ const handleOnboardUrl = createStructuredOutputCommandHandler({
|
|
|
74
75
|
getOutputJson: (args) => hasFlag(args, "--json")
|
|
75
76
|
});
|
|
76
77
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
siteUrl: getFlagValue(rest, "--site-url"),
|
|
107
|
-
overwrite: hasFlag(rest, "--overwrite")
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
if (outputJson) {
|
|
111
|
-
process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
process.stdout.write(`Created ${result.schemaType} schema template at ${result.outputPath}\n`);
|
|
116
|
-
}
|
|
78
|
+
const handleInitLlms = createActionCommandHandler({
|
|
79
|
+
execute: async (args) =>
|
|
80
|
+
createLlmsTxt({
|
|
81
|
+
targetDir: args.find((value) => !value.startsWith("-")) || ".",
|
|
82
|
+
siteName: getFlagValue(args, "--site-name"),
|
|
83
|
+
siteUrl: getFlagValue(args, "--site-url"),
|
|
84
|
+
overwrite: hasFlag(args, "--overwrite")
|
|
85
|
+
}),
|
|
86
|
+
getOutputJson: (args) => hasFlag(args, "--json"),
|
|
87
|
+
renderText: (result) => `Created llms.txt at ${result.outputPath}\n`
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
const handleInitSchema = createActionCommandHandler({
|
|
91
|
+
execute: async (args) => {
|
|
92
|
+
const [schemaType, ...rest] = args;
|
|
93
|
+
if (!schemaType || schemaType.startsWith("-")) {
|
|
94
|
+
throw new Error("init-schema requires a schema type");
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return createSchemaTemplate({
|
|
98
|
+
schemaType,
|
|
99
|
+
targetDir: rest.find((value) => !value.startsWith("-")) || ".",
|
|
100
|
+
siteUrl: getFlagValue(rest, "--site-url"),
|
|
101
|
+
overwrite: hasFlag(rest, "--overwrite")
|
|
102
|
+
});
|
|
103
|
+
},
|
|
104
|
+
getOutputJson: (args) => hasFlag(args, "--json"),
|
|
105
|
+
renderText: (result) => `Created ${result.schemaType} schema template at ${result.outputPath}\n`
|
|
106
|
+
});
|
|
117
107
|
|
|
118
108
|
const handleAudit = createStructuredOutputCommandHandler({
|
|
119
109
|
commandLabel: "审计",
|