geo-ai-search-optimization 1.3.11 → 1.3.13

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 CHANGED
@@ -917,6 +917,20 @@ geo-ai-search-optimization help
917
917
  - `export-pack / html-pack / publish-pack` 也开始复用共享 output-dir / task builder
918
918
  - CLI 更接近统一的 command registry,而不是混合少数特例 handler
919
919
 
920
+ ## New in 1.3.12
921
+
922
+ - 开始把命令说明与 handler 收敛成同源 registry metadata
923
+ - `src/cli-shared.js` 新增 `buildCommandRegistry`
924
+ - `src/cli-shell-commands.js` 与 `src/cli-flow-commands.js` 现在由同一份声明同时生成 help lines 和 handlers
925
+ - CLI 开始从“多个 handler 文件”进一步推进到“显式 command registry”模式
926
+
927
+ ## New in 1.3.13
928
+
929
+ - 把 registry metadata 推广到 `agent-execution` 命令族
930
+ - `src/cli-agent-execution-commands.js` 现在由同一份 registry 同时生成 help lines 和 handlers
931
+ - `agent-runbook / agent-executor / agent-batch-executor / agent-progress-tracker / agent-status-board / agent-checkpoint / agent-decision-log / agent-retrospective / agent-playbook-pack` 已统一进入 registry
932
+ - CLI 距离“所有命令族都使用显式 registry metadata”又更近一步
933
+
920
934
  ## New in 1.2.20
921
935
 
922
936
  - 新增 `agent-continue`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geo-ai-search-optimization",
3
- "version": "1.3.11",
3
+ "version": "1.3.13",
4
4
  "description": "Install and run a Generative Engine Optimization (GEO)-first, SEO-supported Codex skill for website optimization.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -20,6 +20,7 @@ import { createAgentRetrospective, renderAgentRetrospectiveMarkdown, writeAgentR
20
20
  import { createAgentStatusBoard, renderAgentStatusBoardMarkdown, writeAgentStatusBoardOutput } from "./agent-status-board.js";
21
21
  import { createAgentRunbook, renderAgentRunbookMarkdown, writeAgentRunbookOutput } from "./agent-runbook.js";
22
22
  import {
23
+ buildCommandRegistry,
23
24
  buildIntentTaskFormatOptions,
24
25
  buildJsonCapableFormatOptions,
25
26
  buildProgressFormatOptions,
@@ -28,18 +29,6 @@ import {
28
29
  getFlagValue
29
30
  } from "./cli-shared.js";
30
31
 
31
- export const AGENT_EXECUTION_HELP_LINES = [
32
- " geo-ai-search-optimization agent-runbook <input> [--intent <auto|diagnose|guide|execute|share|closeout>] [--task <id>] [--format <markdown|json>] [--out <file>]",
33
- " geo-ai-search-optimization agent-executor <input> [--intent <auto|diagnose|guide|execute|share|closeout>] [--task <id>] [--format <markdown|json>] [--out <file>]",
34
- " geo-ai-search-optimization agent-batch-executor <input> [--intent <auto|diagnose|guide|execute|share|closeout>] [--task <id>] [--count <count>] [--format <markdown|json>] [--out <file>]",
35
- " geo-ai-search-optimization agent-progress-tracker <input> [--current <id>] [--completed <id,id>] [--blocked <reason,reason>] [--format <markdown|json>] [--out <file>]",
36
- " geo-ai-search-optimization agent-status-board <input> [--current <id>] [--completed <id,id>] [--blocked <reason,reason>] [--format <markdown|json>] [--out <file>]",
37
- " geo-ai-search-optimization agent-checkpoint <input> [--current <id>] [--completed <id,id>] [--blocked <reason,reason>] [--format <markdown|json>] [--out <file>]",
38
- " geo-ai-search-optimization agent-decision-log <input> [--append-from <file>] [--note <text>] [--current <id>] [--completed <id,id>] [--blocked <reason,reason>] [--format <markdown|json>] [--out <file>]",
39
- " geo-ai-search-optimization agent-retrospective <input> [--format <markdown|json>] [--out <file>]",
40
- " geo-ai-search-optimization agent-playbook-pack <input> [--task <id>] [--format <markdown|json>] [--out <file>]"
41
- ];
42
-
43
32
  const handleAgentRunbook = createArtifactCommandHandler({
44
33
  commandName: "agent-runbook",
45
34
  commandLabel: "agent runbook",
@@ -131,14 +120,53 @@ const handleAgentPlaybookPack = createArtifactCommandHandler({
131
120
  })
132
121
  });
133
122
 
134
- export const AGENT_EXECUTION_COMMAND_HANDLERS = {
135
- "agent-runbook": handleAgentRunbook,
136
- "agent-executor": handleAgentExecutor,
137
- "agent-batch-executor": handleAgentBatchExecutor,
138
- "agent-progress-tracker": handleAgentProgressTracker,
139
- "agent-status-board": handleAgentStatusBoard,
140
- "agent-checkpoint": handleAgentCheckpoint,
141
- "agent-decision-log": handleAgentDecisionLog,
142
- "agent-retrospective": handleAgentRetrospective,
143
- "agent-playbook-pack": handleAgentPlaybookPack
144
- };
123
+ const AGENT_EXECUTION_COMMAND_REGISTRY = buildCommandRegistry([
124
+ {
125
+ name: "agent-runbook",
126
+ help: " geo-ai-search-optimization agent-runbook <input> [--intent <auto|diagnose|guide|execute|share|closeout>] [--task <id>] [--format <markdown|json>] [--out <file>]",
127
+ handler: handleAgentRunbook
128
+ },
129
+ {
130
+ name: "agent-executor",
131
+ help: " geo-ai-search-optimization agent-executor <input> [--intent <auto|diagnose|guide|execute|share|closeout>] [--task <id>] [--format <markdown|json>] [--out <file>]",
132
+ handler: handleAgentExecutor
133
+ },
134
+ {
135
+ name: "agent-batch-executor",
136
+ help: " geo-ai-search-optimization agent-batch-executor <input> [--intent <auto|diagnose|guide|execute|share|closeout>] [--task <id>] [--count <count>] [--format <markdown|json>] [--out <file>]",
137
+ handler: handleAgentBatchExecutor
138
+ },
139
+ {
140
+ name: "agent-progress-tracker",
141
+ help: " geo-ai-search-optimization agent-progress-tracker <input> [--current <id>] [--completed <id,id>] [--blocked <reason,reason>] [--format <markdown|json>] [--out <file>]",
142
+ handler: handleAgentProgressTracker
143
+ },
144
+ {
145
+ name: "agent-status-board",
146
+ help: " geo-ai-search-optimization agent-status-board <input> [--current <id>] [--completed <id,id>] [--blocked <reason,reason>] [--format <markdown|json>] [--out <file>]",
147
+ handler: handleAgentStatusBoard
148
+ },
149
+ {
150
+ name: "agent-checkpoint",
151
+ help: " geo-ai-search-optimization agent-checkpoint <input> [--current <id>] [--completed <id,id>] [--blocked <reason,reason>] [--format <markdown|json>] [--out <file>]",
152
+ handler: handleAgentCheckpoint
153
+ },
154
+ {
155
+ name: "agent-decision-log",
156
+ help: " geo-ai-search-optimization agent-decision-log <input> [--append-from <file>] [--note <text>] [--current <id>] [--completed <id,id>] [--blocked <reason,reason>] [--format <markdown|json>] [--out <file>]",
157
+ handler: handleAgentDecisionLog
158
+ },
159
+ {
160
+ name: "agent-retrospective",
161
+ help: " geo-ai-search-optimization agent-retrospective <input> [--format <markdown|json>] [--out <file>]",
162
+ handler: handleAgentRetrospective
163
+ },
164
+ {
165
+ name: "agent-playbook-pack",
166
+ help: " geo-ai-search-optimization agent-playbook-pack <input> [--task <id>] [--format <markdown|json>] [--out <file>]",
167
+ handler: handleAgentPlaybookPack
168
+ }
169
+ ]);
170
+
171
+ export const AGENT_EXECUTION_HELP_LINES = AGENT_EXECUTION_COMMAND_REGISTRY.helpLines;
172
+ export const AGENT_EXECUTION_COMMAND_HANDLERS = AGENT_EXECUTION_COMMAND_REGISTRY.handlers;
@@ -17,6 +17,7 @@ import {
17
17
  } from "./agent-state-pack.js";
18
18
  import { createAgentSession, renderAgentSessionMarkdown, writeAgentSessionOutput } from "./agent-session.js";
19
19
  import {
20
+ buildCommandRegistry,
20
21
  buildIntentFormatOptions,
21
22
  buildIntentProgressFormatOptions,
22
23
  createArtifactCommandHandler,
@@ -26,15 +27,6 @@ import {
26
27
  hasFlag
27
28
  } from "./cli-shared.js";
28
29
 
29
- export const FLOW_HELP_LINES = [
30
- " geo-ai-search-optimization agent-orchestrator <input> [--intent <auto|diagnose|guide|execute|share|closeout>] [--format <markdown|json>] [--out <file>]",
31
- " geo-ai-search-optimization agent-resume <input> [--intent <auto|diagnose|guide|execute|share|closeout>] [--format <markdown|json>] [--out <file>]",
32
- " geo-ai-search-optimization agent-continue <input> [--intent <auto|diagnose|guide|execute|share|closeout>] [--format <markdown|json>] [--out <file>]",
33
- " geo-ai-search-optimization agent-state-pack <input> [--intent <auto|diagnose|guide|execute|share|closeout>] [--current <id>] [--completed <id,id>] [--blocked <reason,reason>] [--format <markdown|json>] [--out <file>]",
34
- " geo-ai-search-optimization auto-flow <input> [--intent <auto|diagnose|guide|execute|share|closeout>] [--json] [--out <file>]",
35
- " geo-ai-search-optimization agent-session <input> [--intent <auto|diagnose|guide|execute|share|closeout>] [--json] [--out <file>]"
36
- ];
37
-
38
30
  const handleAutoFlow = createStructuredOutputCommandHandler({
39
31
  commandLabel: "auto-flow",
40
32
  execute: async (args) => {
@@ -96,11 +88,38 @@ const handleAgentSession = createArtifactCommandHandler({
96
88
  })
97
89
  });
98
90
 
99
- export const FLOW_COMMAND_HANDLERS = {
100
- "auto-flow": handleAutoFlow,
101
- "agent-orchestrator": handleAgentOrchestrator,
102
- "agent-resume": handleAgentResume,
103
- "agent-continue": handleAgentContinue,
104
- "agent-state-pack": handleAgentStatePack,
105
- "agent-session": handleAgentSession
106
- };
91
+ const FLOW_COMMAND_REGISTRY = buildCommandRegistry([
92
+ {
93
+ name: "agent-orchestrator",
94
+ help: " geo-ai-search-optimization agent-orchestrator <input> [--intent <auto|diagnose|guide|execute|share|closeout>] [--format <markdown|json>] [--out <file>]",
95
+ handler: handleAgentOrchestrator
96
+ },
97
+ {
98
+ name: "agent-resume",
99
+ help: " geo-ai-search-optimization agent-resume <input> [--intent <auto|diagnose|guide|execute|share|closeout>] [--format <markdown|json>] [--out <file>]",
100
+ handler: handleAgentResume
101
+ },
102
+ {
103
+ name: "agent-continue",
104
+ help: " geo-ai-search-optimization agent-continue <input> [--intent <auto|diagnose|guide|execute|share|closeout>] [--format <markdown|json>] [--out <file>]",
105
+ handler: handleAgentContinue
106
+ },
107
+ {
108
+ name: "agent-state-pack",
109
+ help: " geo-ai-search-optimization agent-state-pack <input> [--intent <auto|diagnose|guide|execute|share|closeout>] [--current <id>] [--completed <id,id>] [--blocked <reason,reason>] [--format <markdown|json>] [--out <file>]",
110
+ handler: handleAgentStatePack
111
+ },
112
+ {
113
+ name: "auto-flow",
114
+ help: " geo-ai-search-optimization auto-flow <input> [--intent <auto|diagnose|guide|execute|share|closeout>] [--json] [--out <file>]",
115
+ handler: handleAutoFlow
116
+ },
117
+ {
118
+ name: "agent-session",
119
+ help: " geo-ai-search-optimization agent-session <input> [--intent <auto|diagnose|guide|execute|share|closeout>] [--json] [--out <file>]",
120
+ handler: handleAgentSession
121
+ }
122
+ ]);
123
+
124
+ export const FLOW_HELP_LINES = FLOW_COMMAND_REGISTRY.helpLines;
125
+ export const FLOW_COMMAND_HANDLERS = FLOW_COMMAND_REGISTRY.handlers;
package/src/cli-shared.js CHANGED
@@ -244,3 +244,10 @@ export function createContentCommandHandler({
244
244
  process.stdout.write(content);
245
245
  };
246
246
  }
247
+
248
+ export function buildCommandRegistry(commandEntries) {
249
+ return {
250
+ helpLines: commandEntries.map((entry) => entry.help),
251
+ handlers: Object.fromEntries(commandEntries.map((entry) => [entry.name, entry.handler]))
252
+ };
253
+ }
@@ -1,14 +1,8 @@
1
- import { createActionCommandHandler, getFlagValue, hasFlag } from "./cli-shared.js";
1
+ import { buildCommandRegistry, 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";
5
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
6
  const handleInstall = createActionCommandHandler({
13
7
  execute: async (args) => {
14
8
  const outputJson = hasFlag(args, "--json");
@@ -41,8 +35,23 @@ function handleWhere() {
41
35
  );
42
36
  }
43
37
 
44
- export const SHELL_COMMAND_HANDLERS = {
45
- install: handleInstall,
46
- skills: handleSkills,
47
- where: handleWhere
48
- };
38
+ const SHELL_COMMAND_REGISTRY = buildCommandRegistry([
39
+ {
40
+ name: "install",
41
+ help: " geo-ai-search-optimization install [--target <dir>] [--json]",
42
+ handler: handleInstall
43
+ },
44
+ {
45
+ name: "skills",
46
+ help: " geo-ai-search-optimization skills [--json]",
47
+ handler: handleSkills
48
+ },
49
+ {
50
+ name: "where",
51
+ help: " geo-ai-search-optimization where",
52
+ handler: handleWhere
53
+ }
54
+ ]);
55
+
56
+ export const SHELL_HELP_LINES = SHELL_COMMAND_REGISTRY.helpLines;
57
+ export const SHELL_COMMAND_HANDLERS = SHELL_COMMAND_REGISTRY.handlers;