@dp-pcs/ogp 0.3.3 → 0.4.2
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 +275 -49
- package/dist/cli/completion.d.ts +5 -0
- package/dist/cli/completion.d.ts.map +1 -0
- package/dist/cli/completion.js +148 -0
- package/dist/cli/completion.js.map +1 -0
- package/dist/cli/config.d.ts +3 -0
- package/dist/cli/config.d.ts.map +1 -0
- package/dist/cli/config.js +207 -0
- package/dist/cli/config.js.map +1 -0
- package/dist/cli/expose.d.ts.map +1 -1
- package/dist/cli/expose.js +20 -13
- package/dist/cli/expose.js.map +1 -1
- package/dist/cli/federation.d.ts.map +1 -1
- package/dist/cli/federation.js +182 -6
- package/dist/cli/federation.js.map +1 -1
- package/dist/cli/setup.d.ts +19 -0
- package/dist/cli/setup.d.ts.map +1 -1
- package/dist/cli/setup.js +507 -32
- package/dist/cli/setup.js.map +1 -1
- package/dist/cli.js +348 -32
- package/dist/cli.js.map +1 -1
- package/dist/daemon/agent-comms.d.ts.map +1 -1
- package/dist/daemon/agent-comms.js +14 -9
- package/dist/daemon/agent-comms.js.map +1 -1
- package/dist/daemon/intent-registry.d.ts.map +1 -1
- package/dist/daemon/intent-registry.js +7 -4
- package/dist/daemon/intent-registry.js.map +1 -1
- package/dist/daemon/keypair.d.ts.map +1 -1
- package/dist/daemon/keypair.js +34 -13
- package/dist/daemon/keypair.js.map +1 -1
- package/dist/daemon/message-handler.d.ts.map +1 -1
- package/dist/daemon/message-handler.js +7 -0
- package/dist/daemon/message-handler.js.map +1 -1
- package/dist/daemon/notify.d.ts +19 -0
- package/dist/daemon/notify.d.ts.map +1 -1
- package/dist/daemon/notify.js +329 -73
- package/dist/daemon/notify.js.map +1 -1
- package/dist/daemon/openclaw-bridge.d.ts +34 -0
- package/dist/daemon/openclaw-bridge.d.ts.map +1 -0
- package/dist/daemon/openclaw-bridge.js +261 -0
- package/dist/daemon/openclaw-bridge.js.map +1 -0
- package/dist/daemon/peers.d.ts +8 -0
- package/dist/daemon/peers.d.ts.map +1 -1
- package/dist/daemon/peers.js +48 -14
- package/dist/daemon/peers.js.map +1 -1
- package/dist/daemon/projects.d.ts.map +1 -1
- package/dist/daemon/projects.js +7 -4
- package/dist/daemon/projects.js.map +1 -1
- package/dist/daemon/server.d.ts +16 -0
- package/dist/daemon/server.d.ts.map +1 -1
- package/dist/daemon/server.js +147 -46
- package/dist/daemon/server.js.map +1 -1
- package/dist/shared/config.d.ts +52 -1
- package/dist/shared/config.d.ts.map +1 -1
- package/dist/shared/config.js +18 -11
- package/dist/shared/config.js.map +1 -1
- package/dist/shared/framework-detection.d.ts +31 -0
- package/dist/shared/framework-detection.d.ts.map +1 -0
- package/dist/shared/framework-detection.js +91 -0
- package/dist/shared/framework-detection.js.map +1 -0
- package/dist/shared/help.d.ts +5 -0
- package/dist/shared/help.d.ts.map +1 -0
- package/dist/shared/help.js +280 -0
- package/dist/shared/help.js.map +1 -0
- package/dist/shared/meta-config.d.ts +44 -0
- package/dist/shared/meta-config.d.ts.map +1 -0
- package/dist/shared/meta-config.js +89 -0
- package/dist/shared/meta-config.js.map +1 -0
- package/dist/shared/migration.d.ts +57 -0
- package/dist/shared/migration.d.ts.map +1 -0
- package/dist/shared/migration.js +255 -0
- package/dist/shared/migration.js.map +1 -0
- package/docs/CLI-REFERENCE.md +1360 -0
- package/docs/GETTING-STARTED.md +942 -0
- package/docs/MIGRATION.md +202 -0
- package/docs/MULTI-FRAMEWORK-DEMO.md +352 -0
- package/docs/MULTI-FRAMEWORK-DESIGN.md +378 -0
- package/docs/MULTI-FRAMEWORK-IMPL.md +197 -0
- package/docs/case-studies/CRASH_RESOLUTION_20260407.md +190 -0
- package/docs/case-studies/OpenClaw_Hermes_Status_Report_20260407.md +142 -0
- package/docs/case-studies/OpenClaw_Stability_Fix_Summary.md +209 -0
- package/docs/case-studies/README.md +40 -0
- package/docs/case-studies/crash_observations.md +250 -0
- package/docs/federation-flow.md +21 -31
- package/docs/hermes-implementation-checklist.md +4 -0
- package/docs/rendezvous.md +13 -14
- package/package.json +9 -3
- package/scripts/completion.bash +123 -0
- package/scripts/completion.zsh +372 -0
- package/scripts/test-migration-execute.js +74 -0
- package/scripts/test-migration.js +42 -0
- package/skills/ogp/SKILL.md +197 -64
- package/skills/ogp-agent-comms/SKILL.md +107 -41
- package/skills/ogp-expose/SKILL.md +84 -21
- package/skills/ogp-project/SKILL.md +66 -58
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
#compdef ogp
|
|
2
|
+
|
|
3
|
+
# OGP zsh completion script
|
|
4
|
+
# Auto-generated by ogp completion install
|
|
5
|
+
|
|
6
|
+
_ogp() {
|
|
7
|
+
local -a frameworks peers
|
|
8
|
+
local curcontext="$curcontext" state line
|
|
9
|
+
typeset -A opt_args
|
|
10
|
+
|
|
11
|
+
# Get frameworks for --for flag
|
|
12
|
+
frameworks=(${(f)"$(ogp config list --quiet 2>/dev/null)"} all)
|
|
13
|
+
|
|
14
|
+
_arguments -C \
|
|
15
|
+
'(- *)'{-h,--help}'[Show help]' \
|
|
16
|
+
'(- *)'{-v,--version}'[Show version]' \
|
|
17
|
+
'--for[Select framework]:framework:($frameworks)' \
|
|
18
|
+
'1: :->command' \
|
|
19
|
+
'*::arg:->args'
|
|
20
|
+
|
|
21
|
+
case "$state" in
|
|
22
|
+
command)
|
|
23
|
+
_arguments '1:command:((
|
|
24
|
+
setup\:"Initialize OGP configuration"
|
|
25
|
+
start\:"Start OGP daemon"
|
|
26
|
+
stop\:"Stop OGP daemon"
|
|
27
|
+
status\:"Show daemon status"
|
|
28
|
+
federation\:"Manage federation"
|
|
29
|
+
agent-comms\:"Configure agent-to-agent messaging"
|
|
30
|
+
config\:"Manage configuration"
|
|
31
|
+
expose\:"Expose daemon via tunnel"
|
|
32
|
+
expose-stop\:"Stop background tunnel"
|
|
33
|
+
shutdown\:"Stop daemon and tunnel"
|
|
34
|
+
install\:"Install LaunchAgent (macOS)"
|
|
35
|
+
uninstall\:"Uninstall LaunchAgent (macOS)"
|
|
36
|
+
intent\:"Manage custom intents"
|
|
37
|
+
project\:"Manage project contexts"
|
|
38
|
+
completion\:"Install completion scripts"
|
|
39
|
+
))'
|
|
40
|
+
;;
|
|
41
|
+
args)
|
|
42
|
+
case ${words[1]} in
|
|
43
|
+
federation)
|
|
44
|
+
_ogp_federation
|
|
45
|
+
;;
|
|
46
|
+
agent-comms)
|
|
47
|
+
_ogp_agent_comms
|
|
48
|
+
;;
|
|
49
|
+
config)
|
|
50
|
+
_ogp_config
|
|
51
|
+
;;
|
|
52
|
+
intent)
|
|
53
|
+
_ogp_intent
|
|
54
|
+
;;
|
|
55
|
+
project)
|
|
56
|
+
_ogp_project
|
|
57
|
+
;;
|
|
58
|
+
completion)
|
|
59
|
+
_ogp_completion
|
|
60
|
+
;;
|
|
61
|
+
expose)
|
|
62
|
+
_ogp_expose
|
|
63
|
+
;;
|
|
64
|
+
esac
|
|
65
|
+
;;
|
|
66
|
+
esac
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
_ogp_federation() {
|
|
70
|
+
local curcontext="$curcontext" state line
|
|
71
|
+
typeset -A opt_args
|
|
72
|
+
|
|
73
|
+
_arguments '1:subcommand:((
|
|
74
|
+
list\:"List all peers"
|
|
75
|
+
status\:"Show federation status and alias mappings"
|
|
76
|
+
request\:"Send federation request to a peer"
|
|
77
|
+
connect\:"Connect to peer by public key via rendezvous"
|
|
78
|
+
invite\:"Generate invite token to share with peer"
|
|
79
|
+
accept\:"Accept peer invite token and connect"
|
|
80
|
+
approve\:"Approve pending federation request"
|
|
81
|
+
reject\:"Reject pending federation request"
|
|
82
|
+
remove\:"Remove peer from federation list"
|
|
83
|
+
alias\:"Set user-friendly alias for peer"
|
|
84
|
+
ping\:"Ping peer gateway to test connectivity"
|
|
85
|
+
send\:"Send message to federated peer"
|
|
86
|
+
scopes\:"Show scope grants for peer"
|
|
87
|
+
grant\:"Update scope grants for approved peer"
|
|
88
|
+
agent\:"Send agent-comms message to peer"
|
|
89
|
+
))' \
|
|
90
|
+
'*::arg:->args'
|
|
91
|
+
|
|
92
|
+
case "$state" in
|
|
93
|
+
args)
|
|
94
|
+
case ${words[1]} in
|
|
95
|
+
list)
|
|
96
|
+
_arguments \
|
|
97
|
+
'(-s --status)'{-s,--status}'[Filter by status]:status:(pending approved rejected removed)'
|
|
98
|
+
;;
|
|
99
|
+
request)
|
|
100
|
+
_arguments \
|
|
101
|
+
'1:peer-url:' \
|
|
102
|
+
'2:peer-id::' \
|
|
103
|
+
'(-a --alias)'{-a,--alias}'[User-friendly alias]:alias:' \
|
|
104
|
+
'--petname[Deprecated - use --alias]:petname:'
|
|
105
|
+
;;
|
|
106
|
+
connect|accept)
|
|
107
|
+
_arguments \
|
|
108
|
+
'1:identifier:' \
|
|
109
|
+
'(-a --alias)'{-a,--alias}'[User-friendly alias]:alias:' \
|
|
110
|
+
'--petname[Deprecated - use --alias]:petname:'
|
|
111
|
+
;;
|
|
112
|
+
approve)
|
|
113
|
+
_arguments \
|
|
114
|
+
'1:peer-id:' \
|
|
115
|
+
'--intents[Comma-separated intents to grant]:intents:' \
|
|
116
|
+
'--rate[Rate limit as requests/seconds]:rate:' \
|
|
117
|
+
'--topics[Comma-separated topics for agent-comms]:topics:'
|
|
118
|
+
;;
|
|
119
|
+
reject|remove|scopes|alias)
|
|
120
|
+
_arguments '1:peer-id:'
|
|
121
|
+
;;
|
|
122
|
+
send)
|
|
123
|
+
_arguments \
|
|
124
|
+
'1:peer-id:' \
|
|
125
|
+
'2:intent:' \
|
|
126
|
+
'3:payload:'
|
|
127
|
+
;;
|
|
128
|
+
grant)
|
|
129
|
+
_arguments \
|
|
130
|
+
'1:peer-id:' \
|
|
131
|
+
'--intents[Comma-separated intents to grant]:intents:' \
|
|
132
|
+
'--rate[Rate limit as requests/seconds]:rate:' \
|
|
133
|
+
'--topics[Comma-separated topics for agent-comms]:topics:'
|
|
134
|
+
;;
|
|
135
|
+
agent)
|
|
136
|
+
_arguments \
|
|
137
|
+
'1:peer-id:' \
|
|
138
|
+
'2:topic:' \
|
|
139
|
+
'3:message:' \
|
|
140
|
+
'(-p --priority)'{-p,--priority}'[Priority level]:priority:(low normal high)' \
|
|
141
|
+
'(-c --conversation)'{-c,--conversation}'[Conversation ID]:conversation-id:' \
|
|
142
|
+
'(-w --wait)'{-w,--wait}'[Wait for reply]' \
|
|
143
|
+
'(-t --timeout)'{-t,--timeout}'[Reply timeout in milliseconds]:timeout:'
|
|
144
|
+
;;
|
|
145
|
+
esac
|
|
146
|
+
;;
|
|
147
|
+
esac
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
_ogp_agent_comms() {
|
|
151
|
+
local curcontext="$curcontext" state line
|
|
152
|
+
typeset -A opt_args
|
|
153
|
+
|
|
154
|
+
_arguments '1:subcommand:((
|
|
155
|
+
policies\:"Show response policies"
|
|
156
|
+
configure\:"Configure response policies"
|
|
157
|
+
add-topic\:"Add topic to peer response policy"
|
|
158
|
+
set-topic\:"Set topic policy for peer"
|
|
159
|
+
set-default\:"Set per-peer default level"
|
|
160
|
+
remove-topic\:"Remove topic from peer policy"
|
|
161
|
+
reset\:"Reset peer policy to global defaults"
|
|
162
|
+
activity\:"Show agent-comms activity log"
|
|
163
|
+
default\:"Set default response level for unknown topics"
|
|
164
|
+
logging\:"Enable or disable activity logging"
|
|
165
|
+
))' \
|
|
166
|
+
'*::arg:->args'
|
|
167
|
+
|
|
168
|
+
case "$state" in
|
|
169
|
+
args)
|
|
170
|
+
case ${words[1]} in
|
|
171
|
+
policies|activity)
|
|
172
|
+
_arguments '1:peer-id::'
|
|
173
|
+
;;
|
|
174
|
+
configure)
|
|
175
|
+
_arguments \
|
|
176
|
+
'1:peer-ids::' \
|
|
177
|
+
'--global[Configure global default policies]' \
|
|
178
|
+
'--topics[Comma-separated topics]:topics:' \
|
|
179
|
+
'--level[Response level]:level:(full summary escalate deny off)' \
|
|
180
|
+
'--notes[Policy notes]:notes:'
|
|
181
|
+
;;
|
|
182
|
+
add-topic)
|
|
183
|
+
_arguments \
|
|
184
|
+
'1:peer-id:' \
|
|
185
|
+
'2:topic:' \
|
|
186
|
+
'--level[Response level]:level:(full summary escalate deny off)' \
|
|
187
|
+
'--notes[Topic notes]:notes:'
|
|
188
|
+
;;
|
|
189
|
+
set-topic)
|
|
190
|
+
_arguments \
|
|
191
|
+
'1:peer-id:' \
|
|
192
|
+
'2:topic:' \
|
|
193
|
+
'3:level:(full summary escalate deny off)' \
|
|
194
|
+
'--notes[Topic notes]:notes:'
|
|
195
|
+
;;
|
|
196
|
+
set-default)
|
|
197
|
+
_arguments \
|
|
198
|
+
'1:peer-id:' \
|
|
199
|
+
'2:level:(full summary escalate deny off)'
|
|
200
|
+
;;
|
|
201
|
+
remove-topic|reset)
|
|
202
|
+
_arguments '1:peer-id:' '2:topic::'
|
|
203
|
+
;;
|
|
204
|
+
default)
|
|
205
|
+
_arguments '1:level:(full summary escalate deny off)'
|
|
206
|
+
;;
|
|
207
|
+
logging)
|
|
208
|
+
_arguments '1:state:(on off true false enable disable)'
|
|
209
|
+
;;
|
|
210
|
+
esac
|
|
211
|
+
;;
|
|
212
|
+
esac
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
_ogp_config() {
|
|
216
|
+
local curcontext="$curcontext" state line
|
|
217
|
+
typeset -A opt_args
|
|
218
|
+
local -a frameworks
|
|
219
|
+
frameworks=(${(f)"$(ogp config list --quiet 2>/dev/null)"})
|
|
220
|
+
|
|
221
|
+
_arguments '1:subcommand:((
|
|
222
|
+
show\:"Show all configured frameworks and default"
|
|
223
|
+
set-default\:"Set default framework"
|
|
224
|
+
list\:"List all frameworks"
|
|
225
|
+
enable\:"Enable a framework"
|
|
226
|
+
disable\:"Disable a framework"
|
|
227
|
+
frameworks\:"Show all detected frameworks"
|
|
228
|
+
))' \
|
|
229
|
+
'*::arg:->args'
|
|
230
|
+
|
|
231
|
+
case "$state" in
|
|
232
|
+
args)
|
|
233
|
+
case ${words[1]} in
|
|
234
|
+
set-default|enable|disable)
|
|
235
|
+
_arguments "1:framework:($frameworks)"
|
|
236
|
+
;;
|
|
237
|
+
list)
|
|
238
|
+
_arguments '(-q --quiet)'{-q,--quiet}'[Output framework IDs only]'
|
|
239
|
+
;;
|
|
240
|
+
esac
|
|
241
|
+
;;
|
|
242
|
+
esac
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
_ogp_intent() {
|
|
246
|
+
_arguments '1:subcommand:((
|
|
247
|
+
register\:"Register new intent handler"
|
|
248
|
+
list\:"List all registered intents"
|
|
249
|
+
remove\:"Remove registered intent"
|
|
250
|
+
))' \
|
|
251
|
+
'*::arg:->args'
|
|
252
|
+
|
|
253
|
+
case "$state" in
|
|
254
|
+
args)
|
|
255
|
+
case ${words[1]} in
|
|
256
|
+
register)
|
|
257
|
+
_arguments \
|
|
258
|
+
'1:name:' \
|
|
259
|
+
'--script[Path to handler script]:script:_files' \
|
|
260
|
+
'--description[Intent description]:description:'
|
|
261
|
+
;;
|
|
262
|
+
remove)
|
|
263
|
+
_arguments '1:name:'
|
|
264
|
+
;;
|
|
265
|
+
esac
|
|
266
|
+
;;
|
|
267
|
+
esac
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
_ogp_project() {
|
|
271
|
+
_arguments '1:subcommand:((
|
|
272
|
+
create\:"Create new project locally"
|
|
273
|
+
join\:"Join existing project"
|
|
274
|
+
list\:"List all local projects"
|
|
275
|
+
remove\:"Remove local project"
|
|
276
|
+
contribute\:"Add contribution to project"
|
|
277
|
+
query\:"Query project contributions"
|
|
278
|
+
status\:"Show project status overview"
|
|
279
|
+
request-join\:"Request to join project from peer"
|
|
280
|
+
send-contribution\:"Send contribution to peer project"
|
|
281
|
+
query-peer\:"Query peer project contributions"
|
|
282
|
+
status-peer\:"Request project status from peer"
|
|
283
|
+
delete\:"Delete local project and all contributions"
|
|
284
|
+
))' \
|
|
285
|
+
'*::arg:->args'
|
|
286
|
+
|
|
287
|
+
case "$state" in
|
|
288
|
+
args)
|
|
289
|
+
case ${words[1]} in
|
|
290
|
+
create)
|
|
291
|
+
_arguments \
|
|
292
|
+
'1:project-id:' \
|
|
293
|
+
'2:project-name:' \
|
|
294
|
+
'--description[Project description]:description:'
|
|
295
|
+
;;
|
|
296
|
+
join)
|
|
297
|
+
_arguments \
|
|
298
|
+
'1:project-id:' \
|
|
299
|
+
'2:project-name::' \
|
|
300
|
+
'--create[Create project if not exists]' \
|
|
301
|
+
'--description[Project description]:description:'
|
|
302
|
+
;;
|
|
303
|
+
remove|status|delete)
|
|
304
|
+
_arguments \
|
|
305
|
+
'1:project-id:' \
|
|
306
|
+
'--force[Skip confirmation prompt]'
|
|
307
|
+
;;
|
|
308
|
+
contribute)
|
|
309
|
+
_arguments \
|
|
310
|
+
'1:project-id:' \
|
|
311
|
+
'2:type:' \
|
|
312
|
+
'3:summary:' \
|
|
313
|
+
'--metadata[Additional structured data as JSON]:metadata:' \
|
|
314
|
+
'--local-only[Skip auto-push to federated peers]'
|
|
315
|
+
;;
|
|
316
|
+
query)
|
|
317
|
+
_arguments \
|
|
318
|
+
'1:project-id:' \
|
|
319
|
+
'--type[Filter by entry type]:type:' \
|
|
320
|
+
'--topic[Filter by entry type (alias)]:topic:' \
|
|
321
|
+
'--author[Filter by author]:author:' \
|
|
322
|
+
'--search[Search by text content]:search:' \
|
|
323
|
+
'--limit[Maximum results]:limit:'
|
|
324
|
+
;;
|
|
325
|
+
request-join)
|
|
326
|
+
_arguments \
|
|
327
|
+
'1:peer-id:' \
|
|
328
|
+
'2:project-id:' \
|
|
329
|
+
'3:project-name:' \
|
|
330
|
+
'--description[Project description]:description:'
|
|
331
|
+
;;
|
|
332
|
+
send-contribution)
|
|
333
|
+
_arguments \
|
|
334
|
+
'1:peer-id:' \
|
|
335
|
+
'2:project-id:' \
|
|
336
|
+
'3:type:' \
|
|
337
|
+
'4:summary:' \
|
|
338
|
+
'--metadata[Additional structured data as JSON]:metadata:'
|
|
339
|
+
;;
|
|
340
|
+
query-peer)
|
|
341
|
+
_arguments \
|
|
342
|
+
'1:peer-id:' \
|
|
343
|
+
'2:project-id:' \
|
|
344
|
+
'--type[Filter by entry type]:type:' \
|
|
345
|
+
'--topic[Filter by entry type (alias)]:topic:' \
|
|
346
|
+
'--author[Filter by author]:author:' \
|
|
347
|
+
'--limit[Maximum results]:limit:' \
|
|
348
|
+
'--timeout[Response timeout in milliseconds]:timeout:'
|
|
349
|
+
;;
|
|
350
|
+
status-peer)
|
|
351
|
+
_arguments \
|
|
352
|
+
'1:peer-id:' \
|
|
353
|
+
'2:project-id:'
|
|
354
|
+
;;
|
|
355
|
+
esac
|
|
356
|
+
;;
|
|
357
|
+
esac
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
_ogp_completion() {
|
|
361
|
+
_arguments '1:subcommand:((
|
|
362
|
+
install\:"Install completion scripts for current shell"
|
|
363
|
+
))'
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
_ogp_expose() {
|
|
367
|
+
_arguments \
|
|
368
|
+
'(-m --method)'{-m,--method}'[Tunnel method]:method:(cloudflared ngrok)' \
|
|
369
|
+
'(-b --background)'{-b,--background}'[Run in background]'
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
_ogp
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Test script for executing migration
|
|
5
|
+
* Usage: node scripts/test-migration-execute.js [--dry-run]
|
|
6
|
+
*
|
|
7
|
+
* Use --dry-run to see what would happen without actually executing
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { detectExistingInstallations, executeMigration } from '../dist/shared/migration.js';
|
|
11
|
+
import { loadMetaConfig } from '../dist/shared/meta-config.js';
|
|
12
|
+
|
|
13
|
+
const dryRun = process.argv.includes('--dry-run');
|
|
14
|
+
|
|
15
|
+
console.log('=== OGP Migration Execution Test ===\n');
|
|
16
|
+
|
|
17
|
+
if (dryRun) {
|
|
18
|
+
console.log('DRY RUN MODE - No changes will be made\n');
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Detect existing installations
|
|
22
|
+
const plan = detectExistingInstallations();
|
|
23
|
+
|
|
24
|
+
if (!plan.needed) {
|
|
25
|
+
console.log('No migration needed.');
|
|
26
|
+
process.exit(0);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
console.log('Detected Installations:');
|
|
30
|
+
for (const install of plan.existingInstalls) {
|
|
31
|
+
console.log(` - ${install.path} (${install.framework})`);
|
|
32
|
+
}
|
|
33
|
+
console.log('');
|
|
34
|
+
|
|
35
|
+
console.log('Migration Plan:');
|
|
36
|
+
for (const action of plan.actions) {
|
|
37
|
+
console.log(` ${action.type.toUpperCase()}: ${action.description}`);
|
|
38
|
+
if (action.from && action.to) {
|
|
39
|
+
console.log(` ${action.from} -> ${action.to}`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
console.log('');
|
|
43
|
+
|
|
44
|
+
if (dryRun) {
|
|
45
|
+
console.log('Dry run complete. Use without --dry-run to execute migration.');
|
|
46
|
+
process.exit(0);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Execute migration
|
|
50
|
+
console.log('Executing migration...\n');
|
|
51
|
+
try {
|
|
52
|
+
await executeMigration(plan);
|
|
53
|
+
console.log('\n✓ Migration completed successfully!\n');
|
|
54
|
+
|
|
55
|
+
// Load and display the new meta config
|
|
56
|
+
const metaConfig = loadMetaConfig();
|
|
57
|
+
console.log('Meta Configuration:');
|
|
58
|
+
console.log(` Version: ${metaConfig.version}`);
|
|
59
|
+
console.log(` Default Framework: ${metaConfig.default}`);
|
|
60
|
+
console.log(' Frameworks:');
|
|
61
|
+
for (const framework of metaConfig.frameworks) {
|
|
62
|
+
console.log(` - ${framework.id} (${framework.name})`);
|
|
63
|
+
console.log(` Enabled: ${framework.enabled}`);
|
|
64
|
+
console.log(` Config Dir: ${framework.configDir}`);
|
|
65
|
+
console.log(` Daemon Port: ${framework.daemonPort}`);
|
|
66
|
+
console.log(` Display Name: ${framework.displayName}`);
|
|
67
|
+
console.log('');
|
|
68
|
+
}
|
|
69
|
+
} catch (error) {
|
|
70
|
+
console.error('\n✗ Migration failed:', error.message);
|
|
71
|
+
process.exit(1);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
console.log('=== Test Complete ===');
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Test script for migration detection
|
|
5
|
+
* Usage: node scripts/test-migration.js
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { detectExistingInstallations, checkMigrationStatus } from '../dist/shared/migration.js';
|
|
9
|
+
|
|
10
|
+
console.log('=== OGP Migration Detection Test ===\n');
|
|
11
|
+
|
|
12
|
+
// Check migration status
|
|
13
|
+
const status = checkMigrationStatus();
|
|
14
|
+
console.log('Migration Status:');
|
|
15
|
+
console.log(` Needed: ${status.migrationNeeded}`);
|
|
16
|
+
console.log(` Summary: ${status.summary}\n`);
|
|
17
|
+
|
|
18
|
+
if (status.plan) {
|
|
19
|
+
const plan = status.plan;
|
|
20
|
+
|
|
21
|
+
console.log('Detected Installations:');
|
|
22
|
+
for (const install of plan.existingInstalls) {
|
|
23
|
+
console.log(` - ${install.path}`);
|
|
24
|
+
console.log(` Framework: ${install.framework}`);
|
|
25
|
+
console.log(` Display Name: ${install.config.displayName}`);
|
|
26
|
+
console.log(` Daemon Port: ${install.config.daemonPort}`);
|
|
27
|
+
console.log(` Platform: ${install.config.platform || '(not set)'}`);
|
|
28
|
+
console.log('');
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
console.log('Migration Actions:');
|
|
32
|
+
for (const action of plan.actions) {
|
|
33
|
+
console.log(` ${action.type.toUpperCase()}: ${action.description}`);
|
|
34
|
+
if (action.from && action.to) {
|
|
35
|
+
console.log(` ${action.from} -> ${action.to}`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
} else {
|
|
39
|
+
console.log('No migration plan needed.');
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
console.log('\n=== Test Complete ===');
|