@dp-pcs/ogp 0.7.0 → 0.7.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dp-pcs/ogp",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Open Gateway Protocol (OGP) - Peer-to-peer federation daemon for OpenClaw AI gateways with cryptographic signatures",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -3,12 +3,78 @@
3
3
  # OGP zsh completion script
4
4
  # Auto-generated by ogp completion install
5
5
 
6
+ _ogp_command_word() {
7
+ local i=2
8
+
9
+ while (( i <= $#words )); do
10
+ case "${words[i]}" in
11
+ --for)
12
+ (( i += 2 ))
13
+ continue
14
+ ;;
15
+ --for=*)
16
+ (( i += 1 ))
17
+ continue
18
+ ;;
19
+ -h|--help|-v|--version)
20
+ (( i += 1 ))
21
+ continue
22
+ ;;
23
+ -*)
24
+ (( i += 1 ))
25
+ continue
26
+ ;;
27
+ *)
28
+ print -r -- "${words[i]}"
29
+ return 0
30
+ ;;
31
+ esac
32
+ done
33
+
34
+ return 1
35
+ }
36
+
37
+ _ogp_subcommand_word() {
38
+ local parent="$1"
39
+ local seen_parent=0
40
+ local i=2
41
+
42
+ while (( i <= $#words )); do
43
+ case "${words[i]}" in
44
+ --for)
45
+ (( i += 2 ))
46
+ continue
47
+ ;;
48
+ --for=*)
49
+ (( i += 1 ))
50
+ continue
51
+ ;;
52
+ -*)
53
+ (( i += 1 ))
54
+ continue
55
+ ;;
56
+ esac
57
+
58
+ if (( seen_parent == 0 )); then
59
+ if [[ "${words[i]}" == "$parent" ]]; then
60
+ seen_parent=1
61
+ fi
62
+ (( i += 1 ))
63
+ continue
64
+ fi
65
+
66
+ print -r -- "${words[i]}"
67
+ return 0
68
+ done
69
+
70
+ return 1
71
+ }
72
+
6
73
  _ogp() {
7
- local -a frameworks peers
74
+ local -a frameworks
8
75
  local curcontext="$curcontext" state line
9
76
  typeset -A opt_args
10
77
 
11
- # Get frameworks for --for flag
12
78
  frameworks=(${(f)"$(ogp config list --quiet 2>/dev/null)"} all)
13
79
 
14
80
  _arguments -C \
@@ -40,7 +106,7 @@ _ogp() {
40
106
  ))'
41
107
  ;;
42
108
  args)
43
- case ${words[1]} in
109
+ case "$(_ogp_command_word)" in
44
110
  federation)
45
111
  _ogp_federation
46
112
  ;;
@@ -69,41 +135,44 @@ _ogp() {
69
135
 
70
136
  _ogp_federation() {
71
137
  local curcontext="$curcontext" state line
138
+ local subcmd="$(_ogp_subcommand_word federation)"
72
139
  typeset -A opt_args
73
140
 
74
- _arguments '1:subcommand:((
75
- list\:"List all peers"
76
- status\:"Show federation status and alias mappings"
77
- request\:"Send federation request to a peer"
78
- connect\:"Connect to peer by public key via rendezvous"
79
- invite\:"Generate invite token to share with peer"
80
- accept\:"Accept peer invite token and connect"
81
- approve\:"Approve pending federation request"
82
- reject\:"Reject pending federation request"
83
- remove\:"Remove peer from federation list"
84
- alias\:"Set user-friendly alias for peer"
85
- tag\:"Add tags to a peer (local categorization)"
86
- untag\:"Remove tags from a peer"
87
- update-identity\:"Send updated identity information to approved peer"
88
- ping\:"Ping peer gateway to test connectivity"
89
- send\:"Send message to federated peer"
90
- scopes\:"Show scope grants for peer"
91
- grant\:"Update scope grants for approved peer"
92
- agent\:"Send agent-comms message to peer"
93
- ))' \
94
- '*::arg:->args'
141
+ _arguments \
142
+ '1:subcommand:((
143
+ list\:"List all peers"
144
+ status\:"Show federation status and alias mappings"
145
+ request\:"Send federation request to a peer"
146
+ connect\:"Connect to peer by public key via rendezvous"
147
+ invite\:"Generate invite token to share with peer"
148
+ accept\:"Accept peer invite token and connect"
149
+ approve\:"Approve pending federation request"
150
+ reject\:"Reject pending federation request"
151
+ remove\:"Remove peer from federation list"
152
+ alias\:"Set user-friendly alias for peer"
153
+ tag\:"Add tags to a peer (local categorization)"
154
+ untag\:"Remove tags from a peer"
155
+ update-identity\:"Send updated identity information to approved peer"
156
+ ping\:"Ping peer gateway to test connectivity"
157
+ send\:"Send message to federated peer"
158
+ scopes\:"Show scope grants for peer"
159
+ grant\:"Update scope grants for approved peer"
160
+ agent\:"Send agent-comms message to peer"
161
+ ))' \
162
+ '*::arg:->args'
95
163
 
96
164
  case "$state" in
97
165
  args)
98
- case ${words[1]} in
166
+ case "$subcmd" in
99
167
  list)
100
168
  _arguments \
101
- '(-s --status)'{-s,--status}'[Filter by status]:status:(pending approved rejected removed)'
169
+ '(-s --status)'{-s,--status}'[Filter by status]:status:(pending approved rejected removed)' \
170
+ '(-t --tag)'{-t,--tag}'[Filter by tag]:tag:'
102
171
  ;;
103
172
  request)
104
173
  _arguments \
105
174
  '1:peer-url:' \
106
- '2:peer-id::' \
175
+ '2:alias::' \
107
176
  '(-a --alias)'{-a,--alias}'[User-friendly alias]:alias:' \
108
177
  '--petname[Deprecated - use --alias]:petname:'
109
178
  ;;
@@ -113,16 +182,29 @@ _ogp_federation() {
113
182
  '(-a --alias)'{-a,--alias}'[User-friendly alias]:alias:' \
114
183
  '--petname[Deprecated - use --alias]:petname:'
115
184
  ;;
116
- approve)
185
+ approve|grant)
117
186
  _arguments \
118
187
  '1:peer-id:' \
119
188
  '--intents[Comma-separated intents to grant]:intents:' \
120
- '--rate[Rate limit as requests/seconds]:rate:' \
189
+ '--rate[Rate limit as requests/windowSeconds]:rate:' \
121
190
  '--topics[Comma-separated topics for agent-comms]:topics:'
122
191
  ;;
123
- reject|remove|scopes|alias)
192
+ reject|remove|scopes|update-identity)
124
193
  _arguments '1:peer-id:'
125
194
  ;;
195
+ alias)
196
+ _arguments \
197
+ '1:peer-id:' \
198
+ '2:alias:'
199
+ ;;
200
+ tag|untag)
201
+ _arguments \
202
+ '1:peer-id:' \
203
+ '*:tag:'
204
+ ;;
205
+ ping)
206
+ _arguments '1:peer-url:'
207
+ ;;
126
208
  send)
127
209
  _arguments \
128
210
  '1:peer-id:' \
@@ -130,13 +212,6 @@ _ogp_federation() {
130
212
  '3:payload:' \
131
213
  '--to-agent[Target a specific persona on the peer]:persona:'
132
214
  ;;
133
- grant)
134
- _arguments \
135
- '1:peer-id:' \
136
- '--intents[Comma-separated intents to grant]:intents:' \
137
- '--rate[Rate limit as requests/seconds]:rate:' \
138
- '--topics[Comma-separated topics for agent-comms]:topics:'
139
- ;;
140
215
  agent)
141
216
  _arguments \
142
217
  '1:peer-id:' \
@@ -155,25 +230,27 @@ _ogp_federation() {
155
230
 
156
231
  _ogp_agent_comms() {
157
232
  local curcontext="$curcontext" state line
233
+ local subcmd="$(_ogp_subcommand_word agent-comms)"
158
234
  typeset -A opt_args
159
235
 
160
- _arguments '1:subcommand:((
161
- policies\:"Show response policies"
162
- configure\:"Configure response policies"
163
- add-topic\:"Add topic to peer response policy"
164
- set-topic\:"Set topic policy for peer"
165
- set-default\:"Set per-peer default level"
166
- remove-topic\:"Remove topic from peer policy"
167
- reset\:"Reset peer policy to global defaults"
168
- activity\:"Show agent-comms activity log"
169
- default\:"Set default response level for unknown topics"
170
- logging\:"Enable or disable activity logging"
171
- ))' \
172
- '*::arg:->args'
236
+ _arguments \
237
+ '1:subcommand:((
238
+ policies\:"Show response policies"
239
+ configure\:"Configure response policies"
240
+ add-topic\:"Add topic to peer response policy"
241
+ set-topic\:"Set topic policy for peer"
242
+ set-default\:"Set per-peer default level"
243
+ remove-topic\:"Remove topic from peer policy"
244
+ reset\:"Reset peer policy to global defaults"
245
+ activity\:"Show agent-comms activity log"
246
+ default\:"Set default response level for unknown topics"
247
+ logging\:"Enable or disable activity logging"
248
+ ))' \
249
+ '*::arg:->args'
173
250
 
174
251
  case "$state" in
175
252
  args)
176
- case ${words[1]} in
253
+ case "$subcmd" in
177
254
  policies|activity)
178
255
  _arguments '1:peer-id::'
179
256
  ;;
@@ -204,8 +281,13 @@ _ogp_agent_comms() {
204
281
  '1:peer-id:' \
205
282
  '2:level:(full summary escalate deny off)'
206
283
  ;;
207
- remove-topic|reset)
208
- _arguments '1:peer-id:' '2:topic::'
284
+ remove-topic)
285
+ _arguments \
286
+ '1:peer-id:' \
287
+ '2:topic:'
288
+ ;;
289
+ reset)
290
+ _arguments '1:peer-id:'
209
291
  ;;
210
292
  default)
211
293
  _arguments '1:level:(full summary escalate deny off)'
@@ -220,29 +302,32 @@ _ogp_agent_comms() {
220
302
 
221
303
  _ogp_config() {
222
304
  local curcontext="$curcontext" state line
223
- typeset -A opt_args
224
305
  local -a frameworks
306
+ local subcmd="$(_ogp_subcommand_word config)"
307
+ typeset -A opt_args
308
+
225
309
  frameworks=(${(f)"$(ogp config list --quiet 2>/dev/null)"})
226
310
 
227
- _arguments '1:subcommand:((
228
- show\:"Show all configured frameworks and default"
229
- set-default\:"Set default framework"
230
- list\:"List all frameworks"
231
- enable\:"Enable a framework"
232
- disable\:"Disable a framework"
233
- frameworks\:"Show all detected frameworks"
234
- health-check\:"Manage health check configuration"
235
- show-identity\:"Show current identity configuration"
236
- set-identity\:"Update identity information"
237
- set-tags\:"Set tags (replaces existing)"
238
- add-tag\:"Add a tag"
239
- remove-tag\:"Remove a tag"
240
- ))' \
241
- '*::arg:->args'
311
+ _arguments \
312
+ '1:subcommand:((
313
+ show\:"Show all configured frameworks and default"
314
+ set-default\:"Set default framework"
315
+ list\:"List all frameworks"
316
+ enable\:"Enable a framework"
317
+ disable\:"Disable a framework"
318
+ frameworks\:"Show all detected frameworks"
319
+ health-check\:"Manage health check configuration"
320
+ show-identity\:"Show current identity configuration"
321
+ set-identity\:"Update identity information"
322
+ set-tags\:"Set tags (replaces existing)"
323
+ add-tag\:"Add a tag"
324
+ remove-tag\:"Remove a tag"
325
+ ))' \
326
+ '*::arg:->args'
242
327
 
243
328
  case "$state" in
244
329
  args)
245
- case ${words[1]} in
330
+ case "$subcmd" in
246
331
  set-default|enable|disable)
247
332
  _arguments "1:framework:($frameworks)"
248
333
  ;;
@@ -258,32 +343,58 @@ _ogp_config() {
258
343
  '--agent-name[Agent name]:name:' \
259
344
  '--organization[Organization name]:org:'
260
345
  ;;
346
+ set-tags)
347
+ _arguments '*:tag:'
348
+ ;;
349
+ add-tag|remove-tag)
350
+ _arguments '1:tag:'
351
+ ;;
261
352
  esac
262
353
  ;;
263
354
  esac
264
355
  }
265
356
 
266
357
  _ogp_config_health_check() {
267
- _arguments '1:subcommand:((
268
- show\:"Show current health check configuration"
269
- interval\:"Set health check interval in milliseconds"
270
- timeout\:"Set health check timeout in milliseconds"
271
- max-failures\:"Set max consecutive failures before unhealthy"
272
- ))' \
273
- '*::arg:->args'
358
+ local curcontext="$curcontext" state line
359
+ local subcmd="$(_ogp_subcommand_word health-check)"
360
+ typeset -A opt_args
361
+
362
+ _arguments \
363
+ '1:subcommand:((
364
+ show\:"Show current health check configuration"
365
+ interval\:"Set health check interval in milliseconds"
366
+ timeout\:"Set health check timeout in milliseconds"
367
+ max-failures\:"Set max consecutive failures before unhealthy"
368
+ ))' \
369
+ '*::arg:->args'
370
+
371
+ case "$state" in
372
+ args)
373
+ case "$subcmd" in
374
+ interval|timeout|max-failures)
375
+ _arguments '1:value:'
376
+ ;;
377
+ esac
378
+ ;;
379
+ esac
274
380
  }
275
381
 
276
382
  _ogp_intent() {
277
- _arguments '1:subcommand:((
278
- register\:"Register new intent handler"
279
- list\:"List all registered intents"
280
- remove\:"Remove registered intent"
281
- ))' \
282
- '*::arg:->args'
383
+ local curcontext="$curcontext" state line
384
+ local subcmd="$(_ogp_subcommand_word intent)"
385
+ typeset -A opt_args
386
+
387
+ _arguments \
388
+ '1:subcommand:((
389
+ register\:"Register new intent handler"
390
+ list\:"List all registered intents"
391
+ remove\:"Remove registered intent"
392
+ ))' \
393
+ '*::arg:->args'
283
394
 
284
395
  case "$state" in
285
396
  args)
286
- case ${words[1]} in
397
+ case "$subcmd" in
287
398
  register)
288
399
  _arguments \
289
400
  '1:name:' \
@@ -299,25 +410,30 @@ _ogp_intent() {
299
410
  }
300
411
 
301
412
  _ogp_project() {
302
- _arguments '1:subcommand:((
303
- create\:"Create new project locally"
304
- join\:"Join existing project"
305
- list\:"List all local projects"
306
- remove\:"Remove local project"
307
- contribute\:"Add contribution to project"
308
- query\:"Query project contributions"
309
- status\:"Show project status overview"
310
- request-join\:"Request to join project from peer"
311
- send-contribution\:"Send contribution to peer project"
312
- query-peer\:"Query peer project contributions"
313
- status-peer\:"Request project status from peer"
314
- delete\:"Delete local project and all contributions"
315
- ))' \
316
- '*::arg:->args'
413
+ local curcontext="$curcontext" state line
414
+ local subcmd="$(_ogp_subcommand_word project)"
415
+ typeset -A opt_args
416
+
417
+ _arguments \
418
+ '1:subcommand:((
419
+ create\:"Create new project locally"
420
+ join\:"Join existing project"
421
+ list\:"List all local projects"
422
+ remove\:"Remove local project"
423
+ contribute\:"Add contribution to project"
424
+ query\:"Query project contributions"
425
+ status\:"Show project status overview"
426
+ request-join\:"Request to join project from peer"
427
+ send-contribution\:"Send contribution to peer project"
428
+ query-peer\:"Query peer project contributions"
429
+ status-peer\:"Request project status from peer"
430
+ delete\:"Delete local project and all contributions"
431
+ ))' \
432
+ '*::arg:->args'
317
433
 
318
434
  case "$state" in
319
435
  args)
320
- case ${words[1]} in
436
+ case "$subcmd" in
321
437
  create)
322
438
  _arguments \
323
439
  '1:project-id:' \
@@ -11,7 +11,9 @@ const renderSlidesOnly = process.argv.includes('--slides-only');
11
11
 
12
12
  const width = 1920;
13
13
  const height = 1080;
14
- const duration = 5.8;
14
+ const fps = 30;
15
+ const clipDuration = 6.8;
16
+ const transitionDuration = 0.6;
15
17
 
16
18
  const palette = {
17
19
  ink: '#10131c',
@@ -386,32 +388,67 @@ for (const png of pngs) {
386
388
  }
387
389
  }
388
390
 
389
- const concatPath = join(outDir, 'slides.ffconcat');
390
- const concatLines = ['ffconcat version 1.0'];
391
+ const motionProfiles = [
392
+ { dx: 26, dy: 14, phaseX: 0.0, phaseY: 0.5 },
393
+ { dx: -24, dy: 18, phaseX: 0.8, phaseY: 1.2 },
394
+ { dx: 20, dy: -16, phaseX: 1.4, phaseY: 0.3 },
395
+ { dx: -22, dy: -14, phaseX: 0.2, phaseY: 1.8 }
396
+ ];
397
+ const transitions = [
398
+ 'smoothleft',
399
+ 'fadeblack',
400
+ 'smoothup',
401
+ 'circleopen',
402
+ 'smoothright',
403
+ 'wipeleft',
404
+ 'fadegrays',
405
+ 'diagtl',
406
+ 'smoothdown'
407
+ ];
408
+
409
+ const ffmpegArgs = ['-y'];
391
410
  for (const png of pngs) {
392
- const absolutePng = resolve(png);
393
- concatLines.push(`file '${absolutePng.replaceAll("'", "'\\''")}'`);
394
- concatLines.push(`duration ${duration}`);
411
+ ffmpegArgs.push('-loop', '1', '-t', String(clipDuration), '-i', resolve(png));
412
+ }
413
+
414
+ const filterParts = [];
415
+ for (let i = 0; i < pngs.length; i++) {
416
+ const profile = motionProfiles[i % motionProfiles.length];
417
+ filterParts.push(
418
+ `[${i}:v]scale=2160:1215,` +
419
+ `crop=${width}:${height}:` +
420
+ `x='(in_w-out_w)/2+(${profile.dx})*sin(t*0.42+${profile.phaseX})':` +
421
+ `y='(in_h-out_h)/2+(${profile.dy})*cos(t*0.34+${profile.phaseY})',` +
422
+ `fps=${fps},trim=duration=${clipDuration},setpts=PTS-STARTPTS[v${i}]`
423
+ );
424
+ }
425
+
426
+ let currentLabel = 'v0';
427
+ for (let i = 1; i < pngs.length; i++) {
428
+ const offset = ((clipDuration - transitionDuration) * i).toFixed(3);
429
+ const nextLabel = i === pngs.length - 1 ? 'outv' : `x${i}`;
430
+ const transition = transitions[(i - 1) % transitions.length];
431
+ filterParts.push(
432
+ `[${currentLabel}][v${i}]xfade=transition=${transition}:duration=${transitionDuration}:offset=${offset}[${nextLabel}]`
433
+ );
434
+ currentLabel = nextLabel;
395
435
  }
396
- concatLines.push(`file '${resolve(pngs.at(-1)).replaceAll("'", "'\\''")}'`);
397
- writeFileSync(concatPath, concatLines.join('\n') + '\n');
398
436
 
399
- const finalVideo = join(outDir, 'ogp-overview-demo.mp4');
400
- execFileSync('ffmpeg', [
401
- '-y',
402
- '-f', 'concat',
403
- '-safe', '0',
404
- '-i', concatPath,
405
- '-vf', 'format=yuv420p,fps=30',
406
- '-r', '30',
437
+ const animatedVideo = join(outDir, 'ogp-overview-demo-animated.mp4');
438
+ ffmpegArgs.push(
439
+ '-filter_complex', filterParts.join(';'),
440
+ '-map', `[${currentLabel}]`,
441
+ '-r', String(fps),
407
442
  '-c:v', 'libx264',
408
443
  '-movflags', '+faststart',
409
444
  '-pix_fmt', 'yuv420p',
410
- finalVideo
411
- ], { stdio: 'inherit' });
445
+ animatedVideo
446
+ );
447
+
448
+ execFileSync('ffmpeg', ffmpegArgs, { stdio: 'inherit' });
412
449
 
413
- if (!existsSync(finalVideo)) {
414
- throw new Error(`Render failed: ${finalVideo} was not created`);
450
+ if (!existsSync(animatedVideo)) {
451
+ throw new Error(`Render failed: ${animatedVideo} was not created`);
415
452
  }
416
453
 
417
- console.log(`Rendered ${finalVideo}`);
454
+ console.log(`Rendered ${animatedVideo}`);