geo-ai-search-optimization 1.3.5 → 1.3.7
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 +14 -0
- package/package.json +1 -1
- package/src/cli-agent-execution-commands.js +85 -124
- package/src/cli-planning-delivery-commands.js +151 -181
- package/src/cli-shared.js +38 -0
- package/src/cli-shell-commands.js +47 -0
- package/src/cli.js +5 -50
package/README.md
CHANGED
|
@@ -872,6 +872,20 @@ 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
|
+
|
|
882
|
+
## New in 1.3.7
|
|
883
|
+
|
|
884
|
+
- 开始把重复的 artifact 编排从 adapter 中抽成共享组合器
|
|
885
|
+
- `src/cli-shared.js` 新增 `createArtifactCommandHandler` 和 `createPackCommandHandler`
|
|
886
|
+
- `src/cli-agent-execution-commands.js` 与 `src/cli-planning-delivery-commands.js` 现在改用声明式组合,减少重复的 `create / render / write` handler 模板代码
|
|
887
|
+
- CLI 架构从“按命令族拆文件”进一步推进到“adapter + shared composition”模式
|
|
888
|
+
|
|
875
889
|
## New in 1.2.20
|
|
876
890
|
|
|
877
891
|
- 新增 `agent-continue`
|
package/package.json
CHANGED
|
@@ -20,10 +20,9 @@ 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
|
+
createArtifactCommandHandler,
|
|
23
24
|
getFlagValue,
|
|
24
|
-
getJsonCapableFormat
|
|
25
|
-
getRequiredInput,
|
|
26
|
-
writeOrPrintArtifact
|
|
25
|
+
getJsonCapableFormat
|
|
27
26
|
} from "./cli-shared.js";
|
|
28
27
|
|
|
29
28
|
export const AGENT_EXECUTION_HELP_LINES = [
|
|
@@ -38,164 +37,126 @@ export const AGENT_EXECUTION_HELP_LINES = [
|
|
|
38
37
|
" geo-ai-search-optimization agent-playbook-pack <input> [--task <id>] [--format <markdown|json>] [--out <file>]"
|
|
39
38
|
];
|
|
40
39
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
const handleAgentRunbook = createArtifactCommandHandler({
|
|
41
|
+
commandName: "agent-runbook",
|
|
42
|
+
commandLabel: "agent runbook",
|
|
43
|
+
createArtifact: createAgentRunbook,
|
|
44
|
+
renderMarkdown: renderAgentRunbookMarkdown,
|
|
45
|
+
writeOutput: writeAgentRunbookOutput,
|
|
46
|
+
getOptions: (args) => ({
|
|
45
47
|
intent: getFlagValue(args, "--intent"),
|
|
46
|
-
format,
|
|
48
|
+
format: getFlagValue(args, "--format"),
|
|
47
49
|
taskId: getFlagValue(args, "--task")
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
args,
|
|
51
|
-
commandName: "agent runbook",
|
|
52
|
-
artifact,
|
|
53
|
-
renderMarkdown: renderAgentRunbookMarkdown,
|
|
54
|
-
writeOutput: writeAgentRunbookOutput,
|
|
55
|
-
outputJson: format === "json"
|
|
56
|
-
});
|
|
57
|
-
}
|
|
50
|
+
})
|
|
51
|
+
});
|
|
58
52
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
53
|
+
const handleAgentExecutor = createArtifactCommandHandler({
|
|
54
|
+
commandName: "agent-executor",
|
|
55
|
+
commandLabel: "agent executor",
|
|
56
|
+
createArtifact: createAgentExecutor,
|
|
57
|
+
renderMarkdown: renderAgentExecutorMarkdown,
|
|
58
|
+
writeOutput: writeAgentExecutorOutput,
|
|
59
|
+
getOptions: (args) => ({
|
|
63
60
|
intent: getFlagValue(args, "--intent"),
|
|
64
|
-
format,
|
|
61
|
+
format: getFlagValue(args, "--format"),
|
|
65
62
|
taskId: getFlagValue(args, "--task")
|
|
66
|
-
})
|
|
67
|
-
|
|
68
|
-
args,
|
|
69
|
-
commandName: "agent executor",
|
|
70
|
-
artifact,
|
|
71
|
-
renderMarkdown: renderAgentExecutorMarkdown,
|
|
72
|
-
writeOutput: writeAgentExecutorOutput,
|
|
73
|
-
outputJson: format === "json"
|
|
74
|
-
});
|
|
75
|
-
}
|
|
63
|
+
})
|
|
64
|
+
});
|
|
76
65
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
66
|
+
const handleAgentBatchExecutor = createArtifactCommandHandler({
|
|
67
|
+
commandName: "agent-batch-executor",
|
|
68
|
+
commandLabel: "agent batch executor",
|
|
69
|
+
createArtifact: createAgentBatchExecutor,
|
|
70
|
+
renderMarkdown: renderAgentBatchExecutorMarkdown,
|
|
71
|
+
writeOutput: writeAgentBatchExecutorOutput,
|
|
72
|
+
getOptions: (args) => ({
|
|
80
73
|
intent: getFlagValue(args, "--intent"),
|
|
81
74
|
format: getJsonCapableFormat(args),
|
|
82
75
|
taskId: getFlagValue(args, "--task"),
|
|
83
76
|
count: getFlagValue(args, "--count")
|
|
84
|
-
})
|
|
85
|
-
|
|
86
|
-
args,
|
|
87
|
-
commandName: "agent batch executor",
|
|
88
|
-
artifact,
|
|
89
|
-
renderMarkdown: renderAgentBatchExecutorMarkdown,
|
|
90
|
-
writeOutput: writeAgentBatchExecutorOutput,
|
|
91
|
-
outputJson: artifact.format === "json"
|
|
92
|
-
});
|
|
93
|
-
}
|
|
77
|
+
})
|
|
78
|
+
});
|
|
94
79
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
80
|
+
const handleAgentProgressTracker = createArtifactCommandHandler({
|
|
81
|
+
commandName: "agent-progress-tracker",
|
|
82
|
+
commandLabel: "agent progress tracker",
|
|
83
|
+
createArtifact: createAgentProgressTracker,
|
|
84
|
+
renderMarkdown: renderAgentProgressTrackerMarkdown,
|
|
85
|
+
writeOutput: writeAgentProgressTrackerOutput,
|
|
86
|
+
getOptions: (args) => ({
|
|
98
87
|
format: getJsonCapableFormat(args),
|
|
99
88
|
currentTaskId: getFlagValue(args, "--current"),
|
|
100
89
|
completedPacketIds: getFlagValue(args, "--completed"),
|
|
101
90
|
blockedReasons: getFlagValue(args, "--blocked")
|
|
102
|
-
})
|
|
103
|
-
|
|
104
|
-
args,
|
|
105
|
-
commandName: "agent progress tracker",
|
|
106
|
-
artifact,
|
|
107
|
-
renderMarkdown: renderAgentProgressTrackerMarkdown,
|
|
108
|
-
writeOutput: writeAgentProgressTrackerOutput,
|
|
109
|
-
outputJson: artifact.format === "json"
|
|
110
|
-
});
|
|
111
|
-
}
|
|
91
|
+
})
|
|
92
|
+
});
|
|
112
93
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
94
|
+
const handleAgentStatusBoard = createArtifactCommandHandler({
|
|
95
|
+
commandName: "agent-status-board",
|
|
96
|
+
commandLabel: "agent status board",
|
|
97
|
+
createArtifact: createAgentStatusBoard,
|
|
98
|
+
renderMarkdown: renderAgentStatusBoardMarkdown,
|
|
99
|
+
writeOutput: writeAgentStatusBoardOutput,
|
|
100
|
+
getOptions: (args) => ({
|
|
116
101
|
format: getJsonCapableFormat(args),
|
|
117
102
|
currentTaskId: getFlagValue(args, "--current"),
|
|
118
103
|
completedPacketIds: getFlagValue(args, "--completed"),
|
|
119
104
|
blockedReasons: getFlagValue(args, "--blocked")
|
|
120
|
-
})
|
|
121
|
-
|
|
122
|
-
args,
|
|
123
|
-
commandName: "agent status board",
|
|
124
|
-
artifact,
|
|
125
|
-
renderMarkdown: renderAgentStatusBoardMarkdown,
|
|
126
|
-
writeOutput: writeAgentStatusBoardOutput,
|
|
127
|
-
outputJson: artifact.format === "json"
|
|
128
|
-
});
|
|
129
|
-
}
|
|
105
|
+
})
|
|
106
|
+
});
|
|
130
107
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
108
|
+
const handleAgentCheckpoint = createArtifactCommandHandler({
|
|
109
|
+
commandName: "agent-checkpoint",
|
|
110
|
+
commandLabel: "agent checkpoint",
|
|
111
|
+
createArtifact: createAgentCheckpoint,
|
|
112
|
+
renderMarkdown: renderAgentCheckpointMarkdown,
|
|
113
|
+
writeOutput: writeAgentCheckpointOutput,
|
|
114
|
+
getOptions: (args) => ({
|
|
134
115
|
format: getJsonCapableFormat(args),
|
|
135
116
|
currentTaskId: getFlagValue(args, "--current"),
|
|
136
117
|
completedPacketIds: getFlagValue(args, "--completed"),
|
|
137
118
|
blockedReasons: getFlagValue(args, "--blocked")
|
|
138
|
-
})
|
|
139
|
-
|
|
140
|
-
args,
|
|
141
|
-
commandName: "agent checkpoint",
|
|
142
|
-
artifact,
|
|
143
|
-
renderMarkdown: renderAgentCheckpointMarkdown,
|
|
144
|
-
writeOutput: writeAgentCheckpointOutput,
|
|
145
|
-
outputJson: artifact.format === "json"
|
|
146
|
-
});
|
|
147
|
-
}
|
|
119
|
+
})
|
|
120
|
+
});
|
|
148
121
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
122
|
+
const handleAgentDecisionLog = createArtifactCommandHandler({
|
|
123
|
+
commandName: "agent-decision-log",
|
|
124
|
+
commandLabel: "agent decision log",
|
|
125
|
+
createArtifact: createAgentDecisionLog,
|
|
126
|
+
renderMarkdown: renderAgentDecisionLogMarkdown,
|
|
127
|
+
writeOutput: writeAgentDecisionLogOutput,
|
|
128
|
+
getOptions: (args) => ({
|
|
152
129
|
format: getJsonCapableFormat(args),
|
|
153
130
|
appendFrom: getFlagValue(args, "--append-from"),
|
|
154
131
|
note: getFlagValue(args, "--note"),
|
|
155
132
|
currentTaskId: getFlagValue(args, "--current"),
|
|
156
133
|
completedPacketIds: getFlagValue(args, "--completed"),
|
|
157
134
|
blockedReasons: getFlagValue(args, "--blocked")
|
|
158
|
-
})
|
|
159
|
-
|
|
160
|
-
args,
|
|
161
|
-
commandName: "agent decision log",
|
|
162
|
-
artifact,
|
|
163
|
-
renderMarkdown: renderAgentDecisionLogMarkdown,
|
|
164
|
-
writeOutput: writeAgentDecisionLogOutput,
|
|
165
|
-
outputJson: artifact.format === "json"
|
|
166
|
-
});
|
|
167
|
-
}
|
|
135
|
+
})
|
|
136
|
+
});
|
|
168
137
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
138
|
+
const handleAgentRetrospective = createArtifactCommandHandler({
|
|
139
|
+
commandName: "agent-retrospective",
|
|
140
|
+
commandLabel: "agent retrospective",
|
|
141
|
+
createArtifact: createAgentRetrospective,
|
|
142
|
+
renderMarkdown: renderAgentRetrospectiveMarkdown,
|
|
143
|
+
writeOutput: writeAgentRetrospectiveOutput,
|
|
144
|
+
getOptions: (args) => ({
|
|
172
145
|
format: getJsonCapableFormat(args)
|
|
173
|
-
})
|
|
174
|
-
|
|
175
|
-
args,
|
|
176
|
-
commandName: "agent retrospective",
|
|
177
|
-
artifact,
|
|
178
|
-
renderMarkdown: renderAgentRetrospectiveMarkdown,
|
|
179
|
-
writeOutput: writeAgentRetrospectiveOutput,
|
|
180
|
-
outputJson: artifact.format === "json"
|
|
181
|
-
});
|
|
182
|
-
}
|
|
146
|
+
})
|
|
147
|
+
});
|
|
183
148
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
149
|
+
const handleAgentPlaybookPack = createArtifactCommandHandler({
|
|
150
|
+
commandName: "agent-playbook-pack",
|
|
151
|
+
commandLabel: "agent playbook pack",
|
|
152
|
+
createArtifact: createAgentPlaybookPack,
|
|
153
|
+
renderMarkdown: renderAgentPlaybookPackMarkdown,
|
|
154
|
+
writeOutput: writeAgentPlaybookPackOutput,
|
|
155
|
+
getOptions: (args) => ({
|
|
187
156
|
format: getJsonCapableFormat(args),
|
|
188
157
|
taskId: getFlagValue(args, "--task")
|
|
189
|
-
})
|
|
190
|
-
|
|
191
|
-
args,
|
|
192
|
-
commandName: "agent playbook pack",
|
|
193
|
-
artifact,
|
|
194
|
-
renderMarkdown: renderAgentPlaybookPackMarkdown,
|
|
195
|
-
writeOutput: writeAgentPlaybookPackOutput,
|
|
196
|
-
outputJson: artifact.format === "json"
|
|
197
|
-
});
|
|
198
|
-
}
|
|
158
|
+
})
|
|
159
|
+
});
|
|
199
160
|
|
|
200
161
|
export const AGENT_EXECUTION_COMMAND_HANDLERS = {
|
|
201
162
|
"agent-runbook": handleAgentRunbook,
|
|
@@ -17,7 +17,13 @@ import { renderPublishPackMarkdown, writePublishPack } from "./publish-pack.js";
|
|
|
17
17
|
import { generateReport, writeReportOutput } from "./report.js";
|
|
18
18
|
import { createRoadmap, renderRoadmapMarkdown, writeRoadmapOutput } from "./roadmap.js";
|
|
19
19
|
import { createSharePack, renderSharePackMarkdown, writeSharePackOutput } from "./share-pack.js";
|
|
20
|
-
import {
|
|
20
|
+
import {
|
|
21
|
+
createArtifactCommandHandler,
|
|
22
|
+
createPackCommandHandler,
|
|
23
|
+
getFlagValue,
|
|
24
|
+
getRequiredInput,
|
|
25
|
+
parsePositiveInteger
|
|
26
|
+
} from "./cli-shared.js";
|
|
21
27
|
|
|
22
28
|
export const PLANNING_DELIVERY_HELP_LINES = [
|
|
23
29
|
" geo-ai-search-optimization agent-handoff <input> [--format <markdown|json>] [--out <file>]",
|
|
@@ -37,196 +43,160 @@ export const PLANNING_DELIVERY_HELP_LINES = [
|
|
|
37
43
|
" geo-ai-search-optimization report <input> [--mode <auto|audit|onboarding|scan>] [--format <markdown|html|json>] [--out <file>]"
|
|
38
44
|
];
|
|
39
45
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
format,
|
|
46
|
+
const handleAgentHandoff = createArtifactCommandHandler({
|
|
47
|
+
commandName: "agent-handoff",
|
|
48
|
+
commandLabel: "agent handoff",
|
|
49
|
+
createArtifact: createAgentHandoff,
|
|
50
|
+
renderMarkdown: renderAgentHandoffMarkdown,
|
|
51
|
+
writeOutput: writeAgentHandoffOutput,
|
|
52
|
+
getOptions: (args) => ({
|
|
53
|
+
format: getFlagValue(args, "--format")
|
|
54
|
+
})
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const handleApplyPlan = createArtifactCommandHandler({
|
|
58
|
+
commandName: "apply-plan",
|
|
59
|
+
commandLabel: "apply plan",
|
|
60
|
+
createArtifact: createApplyPlan,
|
|
61
|
+
renderMarkdown: renderApplyPlanMarkdown,
|
|
62
|
+
writeOutput: writeApplyPlanOutput,
|
|
63
|
+
getOptions: (args) => ({
|
|
64
|
+
format: getFlagValue(args, "--format"),
|
|
59
65
|
taskId: getFlagValue(args, "--task")
|
|
60
|
-
})
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
async function handleHandoffBundle(args) {
|
|
86
|
-
const input = getRequiredInput(args, "handoff-bundle");
|
|
87
|
-
const format = getFlagValue(args, "--format");
|
|
88
|
-
const artifact = await createHandoffBundle(input, {
|
|
89
|
-
format,
|
|
66
|
+
})
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
const handleCompletionReport = createArtifactCommandHandler({
|
|
70
|
+
commandName: "completion-report",
|
|
71
|
+
commandLabel: "completion report",
|
|
72
|
+
createArtifact: createCompletionReport,
|
|
73
|
+
renderMarkdown: renderCompletionReportMarkdown,
|
|
74
|
+
writeOutput: writeCompletionReportOutput,
|
|
75
|
+
getOptions: (args) => ({
|
|
76
|
+
format: getFlagValue(args, "--format")
|
|
77
|
+
})
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
const handleHandoffBundle = createArtifactCommandHandler({
|
|
81
|
+
commandName: "handoff-bundle",
|
|
82
|
+
commandLabel: "handoff bundle",
|
|
83
|
+
createArtifact: createHandoffBundle,
|
|
84
|
+
renderMarkdown: renderHandoffBundleMarkdown,
|
|
85
|
+
writeOutput: writeHandoffBundleOutput,
|
|
86
|
+
getOptions: (args) => ({
|
|
87
|
+
format: getFlagValue(args, "--format"),
|
|
90
88
|
taskId: getFlagValue(args, "--task")
|
|
91
|
-
})
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
async function handleSharePack(args) {
|
|
103
|
-
const input = getRequiredInput(args, "share-pack");
|
|
104
|
-
const format = getFlagValue(args, "--format");
|
|
105
|
-
const artifact = await createSharePack(input, {
|
|
106
|
-
format,
|
|
89
|
+
})
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
const handleSharePack = createArtifactCommandHandler({
|
|
93
|
+
commandName: "share-pack",
|
|
94
|
+
commandLabel: "share pack",
|
|
95
|
+
createArtifact: createSharePack,
|
|
96
|
+
renderMarkdown: renderSharePackMarkdown,
|
|
97
|
+
writeOutput: writeSharePackOutput,
|
|
98
|
+
getOptions: (args) => ({
|
|
99
|
+
format: getFlagValue(args, "--format"),
|
|
107
100
|
taskId: getFlagValue(args, "--task")
|
|
108
|
-
})
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
async function handleExportPack(args) {
|
|
120
|
-
const input = getRequiredInput(args, "export-pack");
|
|
121
|
-
const pack = await writeExportPack(input, {
|
|
101
|
+
})
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
const handleExportPack = createPackCommandHandler({
|
|
105
|
+
commandName: "export-pack",
|
|
106
|
+
writePack: writeExportPack,
|
|
107
|
+
renderMarkdown: renderExportPackMarkdown,
|
|
108
|
+
getOptions: (args) => ({
|
|
122
109
|
format: getFlagValue(args, "--format"),
|
|
123
110
|
taskId: getFlagValue(args, "--task"),
|
|
124
111
|
outputDir: getFlagValue(args, "--out-dir")
|
|
125
|
-
})
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
112
|
+
})
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
const handleHtmlPack = createPackCommandHandler({
|
|
116
|
+
commandName: "html-pack",
|
|
117
|
+
writePack: writeHtmlPack,
|
|
118
|
+
renderMarkdown: renderHtmlPackMarkdown,
|
|
119
|
+
getOptions: (args) => ({
|
|
132
120
|
taskId: getFlagValue(args, "--task"),
|
|
133
121
|
outputDir: getFlagValue(args, "--out-dir")
|
|
134
|
-
})
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
122
|
+
})
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
const handlePublishPack = createPackCommandHandler({
|
|
126
|
+
commandName: "publish-pack",
|
|
127
|
+
writePack: writePublishPack,
|
|
128
|
+
renderMarkdown: renderPublishPackMarkdown,
|
|
129
|
+
getOptions: (args) => ({
|
|
141
130
|
taskId: getFlagValue(args, "--task"),
|
|
142
131
|
outputDir: getFlagValue(args, "--out-dir")
|
|
143
|
-
})
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
args,
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
renderMarkdown: renderPmBriefMarkdown,
|
|
212
|
-
writeOutput: writePmBriefOutput,
|
|
213
|
-
outputJson: format === "json"
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
async function handleRoadmap(args) {
|
|
218
|
-
const input = getRequiredInput(args, "roadmap");
|
|
219
|
-
const format = getFlagValue(args, "--format");
|
|
220
|
-
const artifact = await createRoadmap(input, { format });
|
|
221
|
-
return writeOrPrintArtifact({
|
|
222
|
-
args,
|
|
223
|
-
commandName: "roadmap",
|
|
224
|
-
artifact,
|
|
225
|
-
renderMarkdown: renderRoadmapMarkdown,
|
|
226
|
-
writeOutput: writeRoadmapOutput,
|
|
227
|
-
outputJson: format === "json"
|
|
228
|
-
});
|
|
229
|
-
}
|
|
132
|
+
})
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
const handleExecSummary = createArtifactCommandHandler({
|
|
136
|
+
commandName: "exec-summary",
|
|
137
|
+
commandLabel: "exec summary",
|
|
138
|
+
createArtifact: createExecSummary,
|
|
139
|
+
renderMarkdown: renderExecSummaryMarkdown,
|
|
140
|
+
writeOutput: writeExecSummaryOutput,
|
|
141
|
+
getOptions: (args) => ({
|
|
142
|
+
format: getFlagValue(args, "--format")
|
|
143
|
+
})
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
const handleFixPlan = createArtifactCommandHandler({
|
|
147
|
+
commandName: "fix-plan",
|
|
148
|
+
commandLabel: "fix plan",
|
|
149
|
+
createArtifact: createFixPlan,
|
|
150
|
+
renderMarkdown: renderFixPlanMarkdown,
|
|
151
|
+
writeOutput: writeFixPlanOutput,
|
|
152
|
+
getOptions: (args) => ({
|
|
153
|
+
format: getFlagValue(args, "--format")
|
|
154
|
+
})
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
const handleOwnerBoard = createArtifactCommandHandler({
|
|
158
|
+
commandName: "owner-board",
|
|
159
|
+
commandLabel: "owner board",
|
|
160
|
+
createArtifact: createOwnerBoard,
|
|
161
|
+
renderMarkdown: renderOwnerBoardMarkdown,
|
|
162
|
+
writeOutput: writeOwnerBoardOutput,
|
|
163
|
+
getOptions: (args) => ({
|
|
164
|
+
format: getFlagValue(args, "--format")
|
|
165
|
+
})
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
const handleMeetingPack = createArtifactCommandHandler({
|
|
169
|
+
commandName: "meeting-pack",
|
|
170
|
+
commandLabel: "meeting pack",
|
|
171
|
+
createArtifact: createMeetingPack,
|
|
172
|
+
renderMarkdown: renderMeetingPackMarkdown,
|
|
173
|
+
writeOutput: writeMeetingPackOutput,
|
|
174
|
+
getOptions: (args) => ({
|
|
175
|
+
format: getFlagValue(args, "--format")
|
|
176
|
+
})
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
const handlePmBrief = createArtifactCommandHandler({
|
|
180
|
+
commandName: "pm-brief",
|
|
181
|
+
commandLabel: "PM brief",
|
|
182
|
+
createArtifact: createPmBrief,
|
|
183
|
+
renderMarkdown: renderPmBriefMarkdown,
|
|
184
|
+
writeOutput: writePmBriefOutput,
|
|
185
|
+
getOptions: (args) => ({
|
|
186
|
+
format: getFlagValue(args, "--format")
|
|
187
|
+
})
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
const handleRoadmap = createArtifactCommandHandler({
|
|
191
|
+
commandName: "roadmap",
|
|
192
|
+
commandLabel: "roadmap",
|
|
193
|
+
createArtifact: createRoadmap,
|
|
194
|
+
renderMarkdown: renderRoadmapMarkdown,
|
|
195
|
+
writeOutput: writeRoadmapOutput,
|
|
196
|
+
getOptions: (args) => ({
|
|
197
|
+
format: getFlagValue(args, "--format")
|
|
198
|
+
})
|
|
199
|
+
});
|
|
230
200
|
|
|
231
201
|
async function handleReport(args) {
|
|
232
202
|
const input = getRequiredInput(args, "report");
|
package/src/cli-shared.js
CHANGED
|
@@ -52,3 +52,41 @@ export async function writeOrPrintArtifact({
|
|
|
52
52
|
|
|
53
53
|
process.stdout.write(renderedOutput);
|
|
54
54
|
}
|
|
55
|
+
|
|
56
|
+
export function createArtifactCommandHandler({
|
|
57
|
+
commandName,
|
|
58
|
+
commandLabel,
|
|
59
|
+
createArtifact,
|
|
60
|
+
renderMarkdown,
|
|
61
|
+
writeOutput,
|
|
62
|
+
getOptions
|
|
63
|
+
}) {
|
|
64
|
+
return async function artifactCommandHandler(args) {
|
|
65
|
+
const input = getRequiredInput(args, commandName);
|
|
66
|
+
const options = getOptions ? getOptions(args) : {};
|
|
67
|
+
const artifact = await createArtifact(input, options);
|
|
68
|
+
const outputJson = options.format === "json" || hasFlag(args, "--json");
|
|
69
|
+
|
|
70
|
+
return writeOrPrintArtifact({
|
|
71
|
+
args,
|
|
72
|
+
commandName: commandLabel,
|
|
73
|
+
artifact,
|
|
74
|
+
renderMarkdown,
|
|
75
|
+
writeOutput,
|
|
76
|
+
outputJson
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export function createPackCommandHandler({
|
|
82
|
+
commandName,
|
|
83
|
+
writePack,
|
|
84
|
+
renderMarkdown,
|
|
85
|
+
getOptions
|
|
86
|
+
}) {
|
|
87
|
+
return async function packCommandHandler(args) {
|
|
88
|
+
const input = getRequiredInput(args, commandName);
|
|
89
|
+
const pack = await writePack(input, getOptions ? getOptions(args) : {});
|
|
90
|
+
process.stdout.write(renderMarkdown(pack));
|
|
91
|
+
};
|
|
92
|
+
}
|
|
@@ -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
|
|