@dp-pcs/ogp 0.3.3 → 0.4.3

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.
Files changed (112) hide show
  1. package/README.md +317 -61
  2. package/dist/cli/completion.d.ts +5 -0
  3. package/dist/cli/completion.d.ts.map +1 -0
  4. package/dist/cli/completion.js +148 -0
  5. package/dist/cli/completion.js.map +1 -0
  6. package/dist/cli/config.d.ts +3 -0
  7. package/dist/cli/config.d.ts.map +1 -0
  8. package/dist/cli/config.js +207 -0
  9. package/dist/cli/config.js.map +1 -0
  10. package/dist/cli/expose.d.ts.map +1 -1
  11. package/dist/cli/expose.js +20 -13
  12. package/dist/cli/expose.js.map +1 -1
  13. package/dist/cli/federation.d.ts +14 -0
  14. package/dist/cli/federation.d.ts.map +1 -1
  15. package/dist/cli/federation.js +347 -23
  16. package/dist/cli/federation.js.map +1 -1
  17. package/dist/cli/project.d.ts +4 -3
  18. package/dist/cli/project.d.ts.map +1 -1
  19. package/dist/cli/project.js +34 -24
  20. package/dist/cli/project.js.map +1 -1
  21. package/dist/cli/setup.d.ts +23 -0
  22. package/dist/cli/setup.d.ts.map +1 -1
  23. package/dist/cli/setup.js +560 -32
  24. package/dist/cli/setup.js.map +1 -1
  25. package/dist/cli.js +358 -35
  26. package/dist/cli.js.map +1 -1
  27. package/dist/daemon/agent-comms.d.ts.map +1 -1
  28. package/dist/daemon/agent-comms.js +15 -10
  29. package/dist/daemon/agent-comms.js.map +1 -1
  30. package/dist/daemon/heartbeat.d.ts +22 -0
  31. package/dist/daemon/heartbeat.d.ts.map +1 -0
  32. package/dist/daemon/heartbeat.js +119 -0
  33. package/dist/daemon/heartbeat.js.map +1 -0
  34. package/dist/daemon/intent-registry.d.ts.map +1 -1
  35. package/dist/daemon/intent-registry.js +19 -10
  36. package/dist/daemon/intent-registry.js.map +1 -1
  37. package/dist/daemon/keypair.d.ts +1 -0
  38. package/dist/daemon/keypair.d.ts.map +1 -1
  39. package/dist/daemon/keypair.js +151 -18
  40. package/dist/daemon/keypair.js.map +1 -1
  41. package/dist/daemon/message-handler.d.ts.map +1 -1
  42. package/dist/daemon/message-handler.js +30 -16
  43. package/dist/daemon/message-handler.js.map +1 -1
  44. package/dist/daemon/notify.d.ts +19 -0
  45. package/dist/daemon/notify.d.ts.map +1 -1
  46. package/dist/daemon/notify.js +376 -73
  47. package/dist/daemon/notify.js.map +1 -1
  48. package/dist/daemon/openclaw-bridge.d.ts +34 -0
  49. package/dist/daemon/openclaw-bridge.d.ts.map +1 -0
  50. package/dist/daemon/openclaw-bridge.js +261 -0
  51. package/dist/daemon/openclaw-bridge.js.map +1 -0
  52. package/dist/daemon/peers.d.ts +21 -0
  53. package/dist/daemon/peers.d.ts.map +1 -1
  54. package/dist/daemon/peers.js +125 -20
  55. package/dist/daemon/peers.js.map +1 -1
  56. package/dist/daemon/projects.d.ts +9 -6
  57. package/dist/daemon/projects.d.ts.map +1 -1
  58. package/dist/daemon/projects.js +30 -20
  59. package/dist/daemon/projects.js.map +1 -1
  60. package/dist/daemon/server.d.ts +17 -0
  61. package/dist/daemon/server.d.ts.map +1 -1
  62. package/dist/daemon/server.js +188 -77
  63. package/dist/daemon/server.js.map +1 -1
  64. package/dist/shared/config.d.ts +52 -1
  65. package/dist/shared/config.d.ts.map +1 -1
  66. package/dist/shared/config.js +18 -11
  67. package/dist/shared/config.js.map +1 -1
  68. package/dist/shared/framework-detection.d.ts +31 -0
  69. package/dist/shared/framework-detection.d.ts.map +1 -0
  70. package/dist/shared/framework-detection.js +91 -0
  71. package/dist/shared/framework-detection.js.map +1 -0
  72. package/dist/shared/help.d.ts +5 -0
  73. package/dist/shared/help.d.ts.map +1 -0
  74. package/dist/shared/help.js +281 -0
  75. package/dist/shared/help.js.map +1 -0
  76. package/dist/shared/meta-config.d.ts +44 -0
  77. package/dist/shared/meta-config.d.ts.map +1 -0
  78. package/dist/shared/meta-config.js +89 -0
  79. package/dist/shared/meta-config.js.map +1 -0
  80. package/dist/shared/migration.d.ts +57 -0
  81. package/dist/shared/migration.d.ts.map +1 -0
  82. package/dist/shared/migration.js +255 -0
  83. package/dist/shared/migration.js.map +1 -0
  84. package/docs/CLI-REFERENCE.md +1361 -0
  85. package/docs/GETTING-STARTED.md +953 -0
  86. package/docs/MIGRATION.md +202 -0
  87. package/docs/MULTI-FRAMEWORK-DEMO.md +352 -0
  88. package/docs/MULTI-FRAMEWORK-DESIGN.md +378 -0
  89. package/docs/MULTI-FRAMEWORK-IMPL.md +197 -0
  90. package/docs/case-studies/CRASH_RESOLUTION_20260407.md +190 -0
  91. package/docs/case-studies/OpenClaw_Hermes_Status_Report_20260407.md +142 -0
  92. package/docs/case-studies/OpenClaw_Stability_Fix_Summary.md +209 -0
  93. package/docs/case-studies/README.md +40 -0
  94. package/docs/case-studies/crash_observations.md +250 -0
  95. package/docs/cloudflare-named-tunnel-setup.md +126 -0
  96. package/docs/federation-flow.md +27 -37
  97. package/docs/hermes-implementation-checklist.md +4 -0
  98. package/docs/project-intent-testing.md +97 -0
  99. package/docs/quickstart.md +12 -4
  100. package/docs/rendezvous.md +13 -14
  101. package/docs/scopes.md +13 -13
  102. package/package.json +12 -6
  103. package/scripts/completion.bash +123 -0
  104. package/scripts/completion.zsh +372 -0
  105. package/scripts/install-skills.js +19 -1
  106. package/scripts/test-migration-execute.js +74 -0
  107. package/scripts/test-migration.js +42 -0
  108. package/scripts/test-project-intents.mjs +614 -0
  109. package/skills/ogp/SKILL.md +197 -64
  110. package/skills/ogp-agent-comms/SKILL.md +107 -41
  111. package/skills/ogp-expose/SKILL.md +183 -25
  112. package/skills/ogp-project/SKILL.md +110 -88
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { existsSync, mkdirSync, cpSync, readdirSync } from 'node:fs';
2
+ import { existsSync, mkdirSync, cpSync, readdirSync, rmSync, readFileSync } from 'node:fs';
3
3
  import { join } from 'node:path';
4
4
  import { homedir } from 'node:os';
5
5
  import { fileURLToPath } from 'node:url';
@@ -55,6 +55,13 @@ const availableSkills = readdirSync(skillsSrc, { withFileTypes: true })
55
55
  .filter(d => d.isDirectory() && existsSync(join(skillsSrc, d.name, 'SKILL.md')))
56
56
  .map(d => d.name);
57
57
 
58
+ function getSkillVersion(skill) {
59
+ const skillFile = join(skillsSrc, skill, 'SKILL.md');
60
+ const content = readFileSync(skillFile, 'utf8');
61
+ const match = content.match(/^version:\s*(.+)$/m);
62
+ return match?.[1]?.trim() ?? 'unknown';
63
+ }
64
+
58
65
  if (availableSkills.length === 0) {
59
66
  console.log('No skills found in the skills/ directory.');
60
67
  process.exit(0);
@@ -176,6 +183,9 @@ async function main() {
176
183
  const src = join(skillsSrc, skill);
177
184
  const dest = join(platform.skillsDir, skill);
178
185
  try {
186
+ // Replace the installed skill directory wholesale so stale files from
187
+ // previous package versions do not survive upgrades.
188
+ rmSync(dest, { recursive: true, force: true });
179
189
  cpSync(src, dest, { recursive: true });
180
190
  console.log(` ✓ ${skill}`);
181
191
  installed++;
@@ -192,6 +202,14 @@ async function main() {
192
202
  console.log(`\n✅ Successfully installed ${totalInstalled} skill(s) to ${selectedPlatforms.length} platform(s)`);
193
203
  console.log('');
194
204
 
205
+ const installedVersions = selectedSkills
206
+ .map(skill => `${skill}@${getSkillVersion(skill)}`)
207
+ .join(', ');
208
+ console.log(`Installed skill versions: ${installedVersions}`);
209
+ console.log('Verify installed copies with:');
210
+ console.log(" rg -n '^version:' ~/.openclaw/skills/ogp*/SKILL.md ~/.claude/skills/ogp*/SKILL.md 2>/dev/null");
211
+ console.log('');
212
+
195
213
  // Platform-specific restart instructions
196
214
  const platformNames = selectedPlatforms.map(p => p.name);
197
215
  if (platformNames.includes('OpenClaw')) {
@@ -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 ===');