geo-ai-search-optimization 1.2.17 → 1.2.18
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 +31 -0
- package/package.json +1 -1
- package/resources/geo-ai-search-optimization/references/skill-bundle-map.md +10 -0
- package/resources/geo-ai-search-optimization-agent-orchestrator/SKILL.md +23 -0
- package/resources/geo-ai-search-optimization-agent-orchestrator/agents/openai.yaml +4 -0
- package/resources/geo-ai-search-optimization-usage/SKILL.md +31 -26
- package/src/agent-orchestrator.js +191 -0
- package/src/cli.js +37 -0
- package/src/index.js +1 -0
- package/src/skills.js +3 -0
package/README.md
CHANGED
|
@@ -42,6 +42,27 @@ geo-ai-search-optimization skills --json
|
|
|
42
42
|
- agent 执行闭环相关 skills
|
|
43
43
|
- 分享 / 导出 / 最终交付相关 skills
|
|
44
44
|
|
|
45
|
+
## Agent Orchestrator 命令
|
|
46
|
+
|
|
47
|
+
如果你希望 agent 不要看长链路,而是直接拿到“现在唯一该跑哪条命令”,可以直接用 `agent-orchestrator`:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
geo-ai-search-optimization agent-orchestrator "继续这个 GEO 任务"
|
|
51
|
+
geo-ai-search-optimization agent-orchestrator https://example.com
|
|
52
|
+
geo-ai-search-optimization agent-orchestrator ./your-site
|
|
53
|
+
geo-ai-search-optimization agent-orchestrator ./reports/agent-playbook-pack.json --format json --out ./reports/agent-orchestrator.json
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
它会输出:
|
|
57
|
+
|
|
58
|
+
- 当前阶段
|
|
59
|
+
- 为什么现在该做这一步
|
|
60
|
+
- 现在只该跑哪条命令
|
|
61
|
+
- 预期产物
|
|
62
|
+
- 什么时候先停下
|
|
63
|
+
- 做完之后下一条是什么
|
|
64
|
+
- 可直接复制给 agent 的 orchestrator prompt
|
|
65
|
+
|
|
45
66
|
## Auto Flow 命令
|
|
46
67
|
|
|
47
68
|
如果你希望 agent 不用自己判断现在该用哪个 skill、该跑哪个命令,可以直接用 `auto-flow`:
|
|
@@ -660,6 +681,7 @@ geo-ai-search-optimization onboard --url https://example.com --json --out ./repo
|
|
|
660
681
|
geo-ai-search-optimization
|
|
661
682
|
geo-ai-search-optimization install
|
|
662
683
|
geo-ai-search-optimization install --target ./tmp/custom-skills --json
|
|
684
|
+
geo-ai-search-optimization agent-orchestrator ./your-site
|
|
663
685
|
geo-ai-search-optimization auto-flow "audit this site and tell me the next skill"
|
|
664
686
|
geo-ai-search-optimization agent-session ./your-site
|
|
665
687
|
geo-ai-search-optimization agent-runbook ./your-site
|
|
@@ -741,6 +763,14 @@ geo-ai-search-optimization help
|
|
|
741
763
|
- 输出 do-now checklist、stop checklist、success checklist、验证命令和回报模板
|
|
742
764
|
- 新增 `geo-ai-search-optimization-agent-executor` skill
|
|
743
765
|
|
|
766
|
+
## New in 1.2.18
|
|
767
|
+
|
|
768
|
+
- 新增 `agent-orchestrator`
|
|
769
|
+
- 把 `auto-flow + agent-session` 收敛成一个“现在只该做哪条命令”的总入口
|
|
770
|
+
- 输出固定 contract:`current_stage`、`why_now`、`next_command`、`expected_artifact`、`stop_if`、`after_that`
|
|
771
|
+
- 更适合 PM 把任务直接交给 agent,或 agent 接着前一个工件继续做
|
|
772
|
+
- 新增 `geo-ai-search-optimization-agent-orchestrator` skill
|
|
773
|
+
|
|
744
774
|
## New in 1.2.17
|
|
745
775
|
|
|
746
776
|
- 新增 `agent-playbook-pack`
|
|
@@ -978,6 +1008,7 @@ The installed package now includes a bundled GEO skill pack, including:
|
|
|
978
1008
|
|
|
979
1009
|
- `geo-ai-search-optimization`
|
|
980
1010
|
- `geo-ai-search-optimization-auto-flow`
|
|
1011
|
+
- `geo-ai-search-optimization-agent-orchestrator`
|
|
981
1012
|
- `geo-ai-search-optimization-agent-session`
|
|
982
1013
|
- `geo-ai-search-optimization-agent-runbook`
|
|
983
1014
|
- `geo-ai-search-optimization-agent-executor`
|
package/package.json
CHANGED
|
@@ -32,6 +32,16 @@ Best for:
|
|
|
32
32
|
- turning one-line task briefs into a concrete command sequence
|
|
33
33
|
- deciding whether the work should move into diagnosis, execution, closeout, or delivery
|
|
34
34
|
|
|
35
|
+
### `geo-ai-search-optimization-agent-orchestrator`
|
|
36
|
+
|
|
37
|
+
Use this when the next agent should get one immediate next command instead of reading a full command chain.
|
|
38
|
+
|
|
39
|
+
Best for:
|
|
40
|
+
|
|
41
|
+
- deciding the one command to run now
|
|
42
|
+
- returning a short contract with expected artifact, stop conditions, and follow-up command
|
|
43
|
+
- reducing ambiguity for PM-to-agent or agent-to-agent handoffs
|
|
44
|
+
|
|
35
45
|
### `geo-ai-search-optimization-agent-session`
|
|
36
46
|
|
|
37
47
|
Use this when the next agent needs a runnable session plan, not just a routing answer.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: geo-ai-search-optimization-agent-orchestrator
|
|
3
|
+
description: Choose the one next GEO command an agent should run right now. Use when an agent, PM, or another workflow has a GEO URL, codebase, task brief, or artifact and wants a single next command, expected artifact, stop conditions, and follow-up command instead of a full chain.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# GEO Agent Orchestrator
|
|
7
|
+
|
|
8
|
+
Use this skill when the next agent should not browse a long command chain.
|
|
9
|
+
|
|
10
|
+
`GEO = Generative Engine Optimization`
|
|
11
|
+
|
|
12
|
+
## What it does
|
|
13
|
+
|
|
14
|
+
- turns a GEO input into one immediate next command
|
|
15
|
+
- explains why this command should run now
|
|
16
|
+
- shows what artifact should come out of that command
|
|
17
|
+
- tells the next agent when to stop and what to run after that
|
|
18
|
+
|
|
19
|
+
## Best use
|
|
20
|
+
|
|
21
|
+
- when PM wants the next agent to start without reading the whole GEO stack
|
|
22
|
+
- when another agent says "just tell me the next command"
|
|
23
|
+
- when GEO work should continue from a URL, codebase, playbook pack, decision log, or other GEO artifact with minimal ambiguity
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
interface:
|
|
2
|
+
display_name: "GEO Agent Orchestrator"
|
|
3
|
+
short_description: "Choose the one next GEO command to run now"
|
|
4
|
+
default_prompt: "Use $geo-ai-search-optimization-agent-orchestrator to pick the one next GEO command to run now, explain why, define the expected artifact, and list stop conditions plus the follow-up command."
|
|
@@ -13,38 +13,40 @@ Treat this tool as a PM-friendly GEO workflow for websites.
|
|
|
13
13
|
|
|
14
14
|
`GEO = Generative Engine Optimization`
|
|
15
15
|
|
|
16
|
-
The package is best explained as twenty-
|
|
17
|
-
|
|
18
|
-
1. `
|
|
19
|
-
2. `
|
|
20
|
-
3. `agent-
|
|
21
|
-
4. `agent-
|
|
22
|
-
5. `agent-
|
|
23
|
-
6. `agent-
|
|
24
|
-
7. `agent-
|
|
25
|
-
8. `agent-
|
|
26
|
-
9. `agent-
|
|
27
|
-
10. `agent-
|
|
28
|
-
11. `agent-
|
|
29
|
-
12. `
|
|
30
|
-
13. `
|
|
31
|
-
14. `
|
|
32
|
-
15. `
|
|
33
|
-
16. `
|
|
34
|
-
17. `
|
|
35
|
-
18. `
|
|
36
|
-
19. `
|
|
37
|
-
20. `
|
|
38
|
-
21. `
|
|
39
|
-
22. `
|
|
40
|
-
23. `
|
|
41
|
-
24. `
|
|
16
|
+
The package is best explained as twenty-five layers:
|
|
17
|
+
|
|
18
|
+
1. `agent-orchestrator`: choose the one next GEO command to run right now
|
|
19
|
+
2. `auto-flow`: auto-select the next skill and command chain
|
|
20
|
+
3. `agent-session`: build a runnable session for the next agent
|
|
21
|
+
4. `agent-runbook`: execution manual and checklist for the next agent
|
|
22
|
+
5. `agent-executor`: choose one packet to execute right now
|
|
23
|
+
6. `agent-batch-executor`: queue the first few packets, but still advance one packet at a time
|
|
24
|
+
7. `agent-progress-tracker`: track which packet is done, which one is active, and what comes next
|
|
25
|
+
8. `agent-status-board`: turn the execution state into a board view for PM and agents
|
|
26
|
+
9. `agent-checkpoint`: freeze the current round into a continue / unblock / closeout decision
|
|
27
|
+
10. `agent-decision-log`: preserve why each round continued, paused, or closed out
|
|
28
|
+
11. `agent-retrospective`: explain multi-round patterns, lessons, and next-round advice
|
|
29
|
+
12. `agent-playbook-pack`: compress retrospective, decision history, and handoff into one resume entrypoint
|
|
30
|
+
13. `skills`: inspect the bundled skill package
|
|
31
|
+
14. `onboard-url` / `onboard`: first look
|
|
32
|
+
15. `scan`: raw signal check
|
|
33
|
+
16. `audit` / `report`: diagnosis
|
|
34
|
+
17. `fix-plan` / `owner-board`: execution planning
|
|
35
|
+
18. `agent-handoff`: agent takeover package
|
|
36
|
+
19. `apply-plan`: execution loop
|
|
37
|
+
20. `completion-report`: closeout
|
|
38
|
+
21. `handoff-bundle`: all-in-one package
|
|
39
|
+
22. `share-pack`: audience-ready delivery
|
|
40
|
+
23. `export-pack`: folder export
|
|
41
|
+
24. `html-pack` / `publish-pack`: browsable and final delivery output
|
|
42
|
+
25. `pm-brief` / `roadmap`: stakeholder alignment
|
|
42
43
|
|
|
43
44
|
## Recommended command order
|
|
44
45
|
|
|
45
46
|
If the user only has a website URL:
|
|
46
47
|
|
|
47
48
|
```bash
|
|
49
|
+
npx geo-ai-search-optimization agent-orchestrator https://example.com
|
|
48
50
|
npx geo-ai-search-optimization auto-flow https://example.com
|
|
49
51
|
npx geo-ai-search-optimization agent-session https://example.com
|
|
50
52
|
npx geo-ai-search-optimization agent-runbook https://example.com
|
|
@@ -64,6 +66,7 @@ npx geo-ai-search-optimization roadmap https://example.com
|
|
|
64
66
|
If the user has the website codebase:
|
|
65
67
|
|
|
66
68
|
```bash
|
|
69
|
+
npx geo-ai-search-optimization agent-orchestrator ./your-site
|
|
67
70
|
npx geo-ai-search-optimization auto-flow ./your-site
|
|
68
71
|
npx geo-ai-search-optimization agent-session ./your-site
|
|
69
72
|
npx geo-ai-search-optimization agent-runbook ./your-site
|
|
@@ -92,6 +95,7 @@ npx geo-ai-search-optimization roadmap ./your-site
|
|
|
92
95
|
|
|
93
96
|
## When to recommend each command
|
|
94
97
|
|
|
98
|
+
- `agent-orchestrator`: choose the one next GEO command to run now, plus expected artifact, stop conditions, and follow-up command
|
|
95
99
|
- `auto-flow`: auto-select the next skill and command order from a task brief, URL, project path, or GEO artifact
|
|
96
100
|
- `agent-session`: build a step-by-step session packet for the next agent from the same kinds of inputs
|
|
97
101
|
- `agent-runbook`: build a checklist-driven runbook with preflight, validation, and reporting rules
|
|
@@ -127,6 +131,7 @@ npx geo-ai-search-optimization roadmap ./your-site
|
|
|
127
131
|
When explaining the tool to a user:
|
|
128
132
|
|
|
129
133
|
- prefer telling them which command to run next, not listing every command
|
|
134
|
+
- if the user or next agent wants just one next command, move them to `agent-orchestrator`
|
|
130
135
|
- if the user or the next agent is unsure where to start, move them to `auto-flow` first
|
|
131
136
|
- if the user wants something the next agent can follow step by step, move them to `agent-session`
|
|
132
137
|
- if the user wants the next agent to follow a checklist and execution manual, move them to `agent-runbook`
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { createAgentSession } from "./agent-session.js";
|
|
2
|
+
import { writeScanOutput } from "./scan.js";
|
|
3
|
+
|
|
4
|
+
const VALID_FORMATS = new Set(["markdown", "json"]);
|
|
5
|
+
|
|
6
|
+
function normalizeFormat(format) {
|
|
7
|
+
const resolved = (format || "markdown").toLowerCase();
|
|
8
|
+
if (!VALID_FORMATS.has(resolved)) {
|
|
9
|
+
throw new Error(`不支持的 agent-orchestrator 格式:${format}。可选值:${Array.from(VALID_FORMATS).join(", ")}`);
|
|
10
|
+
}
|
|
11
|
+
return resolved;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function inferOrchestrationMode(session) {
|
|
15
|
+
if (session.status === "needs-context") {
|
|
16
|
+
return "needs-context";
|
|
17
|
+
}
|
|
18
|
+
if (session.intent === "share") {
|
|
19
|
+
return "delivery";
|
|
20
|
+
}
|
|
21
|
+
if (session.intent === "closeout") {
|
|
22
|
+
return "closeout";
|
|
23
|
+
}
|
|
24
|
+
if (session.intent === "execute") {
|
|
25
|
+
return "execution";
|
|
26
|
+
}
|
|
27
|
+
if (session.intent === "guide") {
|
|
28
|
+
return "guidance";
|
|
29
|
+
}
|
|
30
|
+
return "diagnosis";
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function buildWhyNow(session, nextStep) {
|
|
34
|
+
if (!nextStep) {
|
|
35
|
+
return "当前还没有足够上下文来确定下一步命令,先补输入。";
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (session.artifactKind === "geo-agent-playbook-pack") {
|
|
39
|
+
return "当前已经有单入口 playbook,不应该重新规划整条链,直接沿着既有恢复点继续最稳。";
|
|
40
|
+
}
|
|
41
|
+
if (session.artifactKind === "geo-agent-decision-log") {
|
|
42
|
+
return "当前已经有跨轮决策历史,下一步应沿着最近一次决策继续,而不是重新做全量判断。";
|
|
43
|
+
}
|
|
44
|
+
if (session.artifactKind === "geo-agent-retrospective") {
|
|
45
|
+
return "当前已经有多轮复盘,下一步应该把复盘结论转成正式动作,而不是回到最前面的扫描阶段。";
|
|
46
|
+
}
|
|
47
|
+
if (session.sourceType === "url" && session.intent === "execute") {
|
|
48
|
+
return "当前只有公开网址,最重要的是先把建议型执行入口建立好,再决定是否需要仓库上下文。";
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return `${session.whyThisSkill} 当前最该先跑的是 ${nextStep.commandName},因为它会直接产出下一阶段需要的关键工件。`;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function buildStopIf(session, nextStep) {
|
|
55
|
+
const items = [...session.contextNeeded];
|
|
56
|
+
|
|
57
|
+
if (session.sourceType === "url" && session.intent === "execute") {
|
|
58
|
+
items.push("只有网址时,不要宣称已经完成代码级修复。");
|
|
59
|
+
}
|
|
60
|
+
if (session.artifactKind === "geo-agent-playbook-pack") {
|
|
61
|
+
items.push("不要绕开 playbook 重新拆一条新链,除非当前 playbook 已明显过时。");
|
|
62
|
+
}
|
|
63
|
+
if (nextStep?.commandName === "agent-executor") {
|
|
64
|
+
items.push("不要同时展开多个任务包;这一轮先推进当前单包。");
|
|
65
|
+
}
|
|
66
|
+
if (nextStep?.commandName === "completion-report") {
|
|
67
|
+
items.push("如果这一轮还没有完成或没有明确验证结果,不要过早进入 closeout。");
|
|
68
|
+
}
|
|
69
|
+
if (nextStep?.commandName === "publish-pack") {
|
|
70
|
+
items.push("如果前面的 completion-report 或 share 结果还不完整,不要直接产出最终交付包。");
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return Array.from(new Set(items));
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function buildAfterThat(session) {
|
|
77
|
+
return session.steps[1]?.command || null;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function buildOrchestratorPrompt(orchestrator) {
|
|
81
|
+
const lines = [
|
|
82
|
+
`Use $${orchestrator.selectedSkill.name} to continue this GEO task.`,
|
|
83
|
+
`当前输入:${orchestrator.source}`,
|
|
84
|
+
`当前阶段:${orchestrator.current_stage}`,
|
|
85
|
+
`当前模式:${orchestrator.orchestration_mode}`,
|
|
86
|
+
`为什么现在做这一步:${orchestrator.why_now}`
|
|
87
|
+
];
|
|
88
|
+
|
|
89
|
+
if (orchestrator.next_command) {
|
|
90
|
+
lines.push(`现在只运行这一条命令:${orchestrator.next_command}`);
|
|
91
|
+
}
|
|
92
|
+
if (orchestrator.expected_artifact) {
|
|
93
|
+
lines.push(`预期产物:${orchestrator.expected_artifact}`);
|
|
94
|
+
}
|
|
95
|
+
if (orchestrator.after_that) {
|
|
96
|
+
lines.push(`完成后下一条:${orchestrator.after_that}`);
|
|
97
|
+
}
|
|
98
|
+
if (orchestrator.stop_if.length > 0) {
|
|
99
|
+
lines.push("出现以下情况就先停下:");
|
|
100
|
+
for (const item of orchestrator.stop_if) {
|
|
101
|
+
lines.push(`- ${item}`);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
lines.push("输出时先说明为什么执行这一步,再说明得到什么,以及之后怎么继续。");
|
|
106
|
+
return lines.join("\n");
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export async function createAgentOrchestrator(input, options = {}) {
|
|
110
|
+
const format = normalizeFormat(options.format);
|
|
111
|
+
const session = await createAgentSession(input, {
|
|
112
|
+
intent: options.intent
|
|
113
|
+
});
|
|
114
|
+
const nextStep = session.steps[0] || null;
|
|
115
|
+
|
|
116
|
+
const orchestrator = {
|
|
117
|
+
kind: "geo-agent-orchestrator",
|
|
118
|
+
input,
|
|
119
|
+
source: session.source,
|
|
120
|
+
sourceType: session.sourceType,
|
|
121
|
+
artifactKind: session.artifactKind,
|
|
122
|
+
format,
|
|
123
|
+
orchestration_mode: inferOrchestrationMode(session),
|
|
124
|
+
current_stage: session.stage,
|
|
125
|
+
why_now: buildWhyNow(session, nextStep),
|
|
126
|
+
next_command: nextStep?.command || null,
|
|
127
|
+
expected_artifact: nextStep?.expectedArtifact || null,
|
|
128
|
+
stop_if: buildStopIf(session, nextStep),
|
|
129
|
+
after_that: buildAfterThat(session),
|
|
130
|
+
selectedSkill: session.selectedSkill,
|
|
131
|
+
next_skill: nextStep?.suggestedSkill || session.selectedSkill.name,
|
|
132
|
+
session_status: session.status,
|
|
133
|
+
next_action: session.nextAction,
|
|
134
|
+
session,
|
|
135
|
+
orchestrator_prompt: ""
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
orchestrator.orchestrator_prompt = buildOrchestratorPrompt(orchestrator);
|
|
139
|
+
return orchestrator;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export function renderAgentOrchestratorMarkdown(orchestrator) {
|
|
143
|
+
const lines = [
|
|
144
|
+
"# GEO Agent Orchestrator",
|
|
145
|
+
"",
|
|
146
|
+
`- 输入:\`${orchestrator.source}\``,
|
|
147
|
+
`- 输入类型:\`${orchestrator.sourceType}\``,
|
|
148
|
+
`- 工件类型:\`${orchestrator.artifactKind}\``,
|
|
149
|
+
`- 当前阶段:${orchestrator.current_stage}`,
|
|
150
|
+
`- orchestration mode:\`${orchestrator.orchestration_mode}\``,
|
|
151
|
+
`- 当前建议 skill:\`${orchestrator.next_skill}\``,
|
|
152
|
+
"",
|
|
153
|
+
"## 为什么现在做这一步",
|
|
154
|
+
"",
|
|
155
|
+
`- ${orchestrator.why_now}`,
|
|
156
|
+
"",
|
|
157
|
+
"## 现在只做这一条",
|
|
158
|
+
"",
|
|
159
|
+
`- 命令:\`${orchestrator.next_command || "先补输入"}\``,
|
|
160
|
+
`- 预期产物:${orchestrator.expected_artifact || "先明确需要什么上下文"}`,
|
|
161
|
+
""
|
|
162
|
+
];
|
|
163
|
+
|
|
164
|
+
if (orchestrator.after_that) {
|
|
165
|
+
lines.push("## 做完之后", "", `- 下一条:\`${orchestrator.after_that}\``, "");
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
lines.push("## 什么时候先停下", "");
|
|
169
|
+
if (orchestrator.stop_if.length === 0) {
|
|
170
|
+
lines.push("- 当前没有额外 stop 条件。");
|
|
171
|
+
} else {
|
|
172
|
+
for (const item of orchestrator.stop_if) {
|
|
173
|
+
lines.push(`- ${item}`);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
lines.push(
|
|
178
|
+
"",
|
|
179
|
+
"## 可直接复制给 Agent 的 Orchestrator Prompt",
|
|
180
|
+
"",
|
|
181
|
+
"```text",
|
|
182
|
+
orchestrator.orchestrator_prompt,
|
|
183
|
+
"```"
|
|
184
|
+
);
|
|
185
|
+
|
|
186
|
+
return `${lines.join("\n")}\n`;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export async function writeAgentOrchestratorOutput(outputPath, content) {
|
|
190
|
+
return writeScanOutput(outputPath, content);
|
|
191
|
+
}
|
package/src/cli.js
CHANGED
|
@@ -16,6 +16,11 @@ import {
|
|
|
16
16
|
} from "./agent-progress-tracker.js";
|
|
17
17
|
import { createAgentCheckpoint, renderAgentCheckpointMarkdown, writeAgentCheckpointOutput } from "./agent-checkpoint.js";
|
|
18
18
|
import { createAgentDecisionLog, renderAgentDecisionLogMarkdown, writeAgentDecisionLogOutput } from "./agent-decision-log.js";
|
|
19
|
+
import {
|
|
20
|
+
createAgentOrchestrator,
|
|
21
|
+
renderAgentOrchestratorMarkdown,
|
|
22
|
+
writeAgentOrchestratorOutput
|
|
23
|
+
} from "./agent-orchestrator.js";
|
|
19
24
|
import {
|
|
20
25
|
createAgentPlaybookPack,
|
|
21
26
|
renderAgentPlaybookPackMarkdown,
|
|
@@ -80,6 +85,7 @@ function printHelp() {
|
|
|
80
85
|
"Usage:",
|
|
81
86
|
" geo-ai-search-optimization",
|
|
82
87
|
" geo-ai-search-optimization install [--target <dir>] [--json]",
|
|
88
|
+
" geo-ai-search-optimization agent-orchestrator <input> [--intent <auto|diagnose|guide|execute|share|closeout>] [--format <markdown|json>] [--out <file>]",
|
|
83
89
|
" geo-ai-search-optimization auto-flow <input> [--intent <auto|diagnose|guide|execute|share|closeout>] [--json] [--out <file>]",
|
|
84
90
|
" geo-ai-search-optimization agent-session <input> [--intent <auto|diagnose|guide|execute|share|closeout>] [--json] [--out <file>]",
|
|
85
91
|
" geo-ai-search-optimization agent-runbook <input> [--intent <auto|diagnose|guide|execute|share|closeout>] [--task <id>] [--format <markdown|json>] [--out <file>]",
|
|
@@ -183,6 +189,32 @@ async function handleAutoFlow(args) {
|
|
|
183
189
|
process.stdout.write(renderedOutput);
|
|
184
190
|
}
|
|
185
191
|
|
|
192
|
+
async function handleAgentOrchestrator(args) {
|
|
193
|
+
const input = args.find((value) => !value.startsWith("-"));
|
|
194
|
+
if (!input) {
|
|
195
|
+
throw new Error("agent-orchestrator 需要一个输入值,可以是任务描述、项目路径、网站网址或已导出的工件");
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
const format = getFlagValue(args, "--format") || (hasFlag(args, "--json") ? "json" : undefined);
|
|
199
|
+
const orchestrator = await createAgentOrchestrator(input, {
|
|
200
|
+
intent: getFlagValue(args, "--intent"),
|
|
201
|
+
format
|
|
202
|
+
});
|
|
203
|
+
const outputJson = orchestrator.format === "json";
|
|
204
|
+
const renderedOutput = outputJson
|
|
205
|
+
? `${JSON.stringify(orchestrator, null, 2)}\n`
|
|
206
|
+
: renderAgentOrchestratorMarkdown(orchestrator);
|
|
207
|
+
|
|
208
|
+
const outputPath = getFlagValue(args, "--out");
|
|
209
|
+
if (outputPath) {
|
|
210
|
+
const resolvedOutputPath = await writeAgentOrchestratorOutput(outputPath, renderedOutput);
|
|
211
|
+
process.stdout.write(`已保存 agent-orchestrator 结果:${resolvedOutputPath}\n`);
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
process.stdout.write(renderedOutput);
|
|
216
|
+
}
|
|
217
|
+
|
|
186
218
|
async function handleAgentSession(args) {
|
|
187
219
|
const input = args.find((value) => !value.startsWith("-"));
|
|
188
220
|
if (!input) {
|
|
@@ -999,6 +1031,11 @@ export async function runCli(args = []) {
|
|
|
999
1031
|
return;
|
|
1000
1032
|
}
|
|
1001
1033
|
|
|
1034
|
+
if (command === "agent-orchestrator") {
|
|
1035
|
+
await handleAgentOrchestrator(rest);
|
|
1036
|
+
return;
|
|
1037
|
+
}
|
|
1038
|
+
|
|
1002
1039
|
if (command === "agent-session") {
|
|
1003
1040
|
await handleAgentSession(rest);
|
|
1004
1041
|
return;
|
package/src/index.js
CHANGED
|
@@ -7,6 +7,7 @@ export {
|
|
|
7
7
|
} from "./interactive-onboarding.js";
|
|
8
8
|
export { createAutoFlow, renderAutoFlowMarkdown, writeAutoFlowOutput } from "./auto-flow.js";
|
|
9
9
|
export { createApplyPlan, renderApplyPlanMarkdown, writeApplyPlanOutput } from "./apply-plan.js";
|
|
10
|
+
export { createAgentOrchestrator, renderAgentOrchestratorMarkdown, writeAgentOrchestratorOutput } from "./agent-orchestrator.js";
|
|
10
11
|
export { createAgentBatchExecutor, renderAgentBatchExecutorMarkdown, writeAgentBatchExecutorOutput } from "./agent-batch-executor.js";
|
|
11
12
|
export { createAgentCheckpoint, renderAgentCheckpointMarkdown, writeAgentCheckpointOutput } from "./agent-checkpoint.js";
|
|
12
13
|
export { createAgentDecisionLog, renderAgentDecisionLogMarkdown, writeAgentDecisionLogOutput } from "./agent-decision-log.js";
|
package/src/skills.js
CHANGED
|
@@ -5,6 +5,7 @@ import { getPackageRoot } from "./paths.js";
|
|
|
5
5
|
const SKILL_ORDER = [
|
|
6
6
|
"geo-ai-search-optimization",
|
|
7
7
|
"geo-ai-search-optimization-auto-flow",
|
|
8
|
+
"geo-ai-search-optimization-agent-orchestrator",
|
|
8
9
|
"geo-ai-search-optimization-agent-session",
|
|
9
10
|
"geo-ai-search-optimization-agent-runbook",
|
|
10
11
|
"geo-ai-search-optimization-agent-executor",
|
|
@@ -29,6 +30,7 @@ const SKILL_ORDER = [
|
|
|
29
30
|
const SKILL_CATEGORY = {
|
|
30
31
|
"geo-ai-search-optimization": "core",
|
|
31
32
|
"geo-ai-search-optimization-auto-flow": "routing",
|
|
33
|
+
"geo-ai-search-optimization-agent-orchestrator": "routing",
|
|
32
34
|
"geo-ai-search-optimization-agent-session": "routing",
|
|
33
35
|
"geo-ai-search-optimization-agent-runbook": "execution",
|
|
34
36
|
"geo-ai-search-optimization-agent-executor": "execution",
|
|
@@ -171,6 +173,7 @@ export function renderBundledSkillsMarkdown(bundle) {
|
|
|
171
173
|
"## 推荐理解顺序",
|
|
172
174
|
"",
|
|
173
175
|
"- 先看核心 GEO skill。",
|
|
176
|
+
"- 如果你只想让 agent 立刻知道现在唯一该跑哪条命令,先跑 agent-orchestrator。",
|
|
174
177
|
"- 如果 agent 需要自动选 skill,先跑 auto-flow。",
|
|
175
178
|
"- 如果要给 agent 明确步骤,继续进入 agent-session。",
|
|
176
179
|
"- 如果要给 agent 一份执行手册和检查表,再进入 agent-runbook。",
|