kynjal-cli 4.0.0 → 4.0.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/dist/src/appliance/gguf-engine.d.ts +91 -0
- package/dist/src/appliance/gguf-engine.d.ts.map +1 -0
- package/dist/src/appliance/gguf-engine.js +286 -525
- package/dist/src/appliance/gguf-engine.js.map +1 -1
- package/dist/src/appliance/ruvllm-bridge.d.ts +102 -0
- package/dist/src/appliance/ruvllm-bridge.d.ts.map +1 -0
- package/dist/src/appliance/ruvllm-bridge.js +203 -403
- package/dist/src/appliance/ruvllm-bridge.js.map +1 -1
- package/dist/src/appliance/rvfa-builder.d.ts +44 -0
- package/dist/src/appliance/rvfa-builder.d.ts.map +1 -0
- package/dist/src/appliance/rvfa-builder.js +154 -208
- package/dist/src/appliance/rvfa-builder.js.map +1 -1
- package/dist/src/appliance/rvfa-distribution.d.ts +97 -0
- package/dist/src/appliance/rvfa-distribution.d.ts.map +1 -0
- package/dist/src/appliance/rvfa-distribution.js +260 -423
- package/dist/src/appliance/rvfa-distribution.js.map +1 -1
- package/dist/src/appliance/rvfa-format.d.ts +111 -0
- package/dist/src/appliance/rvfa-format.d.ts.map +1 -0
- package/dist/src/appliance/rvfa-format.js +128 -200
- package/dist/src/appliance/rvfa-format.js.map +1 -1
- package/dist/src/appliance/rvfa-runner.d.ts +69 -0
- package/dist/src/appliance/rvfa-runner.d.ts.map +1 -0
- package/dist/src/appliance/rvfa-runner.js +168 -304
- package/dist/src/appliance/rvfa-runner.js.map +1 -1
- package/dist/src/appliance/rvfa-signing.d.ts +123 -0
- package/dist/src/appliance/rvfa-signing.d.ts.map +1 -0
- package/dist/src/appliance/rvfa-signing.js +173 -295
- package/dist/src/appliance/rvfa-signing.js.map +1 -1
- package/dist/src/benchmarks/pretrain/index.d.ts +58 -0
- package/dist/src/benchmarks/pretrain/index.d.ts.map +1 -0
- package/dist/src/benchmarks/pretrain/index.js +331 -542
- package/dist/src/benchmarks/pretrain/index.js.map +1 -1
- package/dist/src/commands/agent.js +574 -697
- package/dist/src/commands/agent.js.map +1 -1
- package/dist/src/commands/analyze.js +1218 -1548
- package/dist/src/commands/analyze.js.map +1 -1
- package/dist/src/commands/appliance-advanced.js +158 -267
- package/dist/src/commands/appliance-advanced.js.map +1 -1
- package/dist/src/commands/appliance.js +318 -493
- package/dist/src/commands/appliance.js.map +1 -1
- package/dist/src/commands/benchmark.js +372 -523
- package/dist/src/commands/benchmark.js.map +1 -1
- package/dist/src/commands/claims.js +274 -364
- package/dist/src/commands/claims.js.map +1 -1
- package/dist/src/commands/cleanup.js +113 -157
- package/dist/src/commands/cleanup.js.map +1 -1
- package/dist/src/commands/completions.js +477 -118
- package/dist/src/commands/completions.js.map +1 -1
- package/dist/src/commands/config.js +237 -303
- package/dist/src/commands/config.js.map +1 -1
- package/dist/src/commands/daemon.js +487 -596
- package/dist/src/commands/daemon.js.map +1 -1
- package/dist/src/commands/deployment.js +194 -275
- package/dist/src/commands/deployment.js.map +1 -1
- package/dist/src/commands/doctor.js +504 -686
- package/dist/src/commands/doctor.js.map +1 -1
- package/dist/src/commands/embeddings.js +1293 -1543
- package/dist/src/commands/embeddings.js.map +1 -1
- package/dist/src/commands/guidance.js +449 -596
- package/dist/src/commands/guidance.js.map +1 -1
- package/dist/src/commands/hive-mind.js +854 -938
- package/dist/src/commands/hive-mind.js.map +1 -1
- package/dist/src/commands/hooks.js +3112 -3519
- package/dist/src/commands/hooks.js.map +1 -1
- package/dist/src/commands/index.d.ts +115 -0
- package/dist/src/commands/index.d.ts.map +1 -0
- package/dist/src/commands/index.js +126 -308
- package/dist/src/commands/index.js.map +1 -1
- package/dist/src/commands/init.js +788 -940
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/issues.js +383 -558
- package/dist/src/commands/issues.js.map +1 -1
- package/dist/src/commands/mcp.js +493 -605
- package/dist/src/commands/mcp.js.map +1 -1
- package/dist/src/commands/memory.js +833 -1026
- package/dist/src/commands/memory.js.map +1 -1
- package/dist/src/commands/migrate.js +282 -347
- package/dist/src/commands/migrate.js.map +1 -1
- package/dist/src/commands/neural.js +1289 -1563
- package/dist/src/commands/neural.js.map +1 -1
- package/dist/src/commands/performance.js +497 -643
- package/dist/src/commands/performance.js.map +1 -1
- package/dist/src/commands/plugins.js +668 -841
- package/dist/src/commands/plugins.js.map +1 -1
- package/dist/src/commands/process.js +392 -447
- package/dist/src/commands/process.js.map +1 -1
- package/dist/src/commands/progress.js +162 -256
- package/dist/src/commands/progress.js.map +1 -1
- package/dist/src/commands/providers.js +150 -220
- package/dist/src/commands/providers.js.map +1 -1
- package/dist/src/commands/route.js +520 -665
- package/dist/src/commands/route.js.map +1 -1
- package/dist/src/commands/ruvector/backup.js +505 -651
- package/dist/src/commands/ruvector/backup.js.map +1 -1
- package/dist/src/commands/ruvector/benchmark.js +349 -401
- package/dist/src/commands/ruvector/benchmark.js.map +1 -1
- package/dist/src/commands/ruvector/import.js +224 -266
- package/dist/src/commands/ruvector/import.js.map +1 -1
- package/dist/src/commands/ruvector/index.js +37 -75
- package/dist/src/commands/ruvector/index.js.map +1 -1
- package/dist/src/commands/ruvector/init.js +336 -359
- package/dist/src/commands/ruvector/init.js.map +1 -1
- package/dist/src/commands/ruvector/migrate.js +335 -322
- package/dist/src/commands/ruvector/migrate.js.map +1 -1
- package/dist/src/commands/ruvector/optimize.js +375 -431
- package/dist/src/commands/ruvector/optimize.js.map +1 -1
- package/dist/src/commands/ruvector/setup.js +703 -117
- package/dist/src/commands/ruvector/setup.js.map +1 -1
- package/dist/src/commands/ruvector/status.js +364 -419
- package/dist/src/commands/ruvector/status.js.map +1 -1
- package/dist/src/commands/security.js +485 -608
- package/dist/src/commands/security.js.map +1 -1
- package/dist/src/commands/session.js +504 -626
- package/dist/src/commands/session.js.map +1 -1
- package/dist/src/commands/start.js +267 -364
- package/dist/src/commands/start.js.map +1 -1
- package/dist/src/commands/status.js +380 -486
- package/dist/src/commands/status.js.map +1 -1
- package/dist/src/commands/swarm.js +408 -488
- package/dist/src/commands/swarm.js.map +1 -1
- package/dist/src/commands/task.js +423 -538
- package/dist/src/commands/task.js.map +1 -1
- package/dist/src/commands/transfer-store.js +322 -412
- package/dist/src/commands/transfer-store.js.map +1 -1
- package/dist/src/commands/update.js +196 -291
- package/dist/src/commands/update.js.map +1 -1
- package/dist/src/commands/workflow.js +386 -486
- package/dist/src/commands/workflow.js.map +1 -1
- package/dist/src/config-adapter.d.ts +15 -0
- package/dist/src/config-adapter.d.ts.map +1 -0
- package/dist/src/config-adapter.js +38 -39
- package/dist/src/config-adapter.js.map +1 -1
- package/dist/src/index.d.ts +77 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +309 -411
- package/dist/src/index.js.map +1 -1
- package/dist/src/infrastructure/in-memory-repositories.d.ts +68 -0
- package/dist/src/infrastructure/in-memory-repositories.d.ts.map +1 -0
- package/dist/src/infrastructure/in-memory-repositories.js +246 -507
- package/dist/src/infrastructure/in-memory-repositories.js.map +1 -1
- package/dist/src/init/claudemd-generator.d.ts +25 -0
- package/dist/src/init/claudemd-generator.d.ts.map +1 -0
- package/dist/src/init/claudemd-generator.js +368 -78
- package/dist/src/init/claudemd-generator.js.map +1 -1
- package/dist/src/init/executor.d.ts +41 -0
- package/dist/src/init/executor.d.ts.map +1 -0
- package/dist/src/init/executor.js +1307 -996
- package/dist/src/init/executor.js.map +1 -1
- package/dist/src/init/helpers-generator.d.ts +60 -0
- package/dist/src/init/helpers-generator.d.ts.map +1 -0
- package/dist/src/init/helpers-generator.js +657 -12
- package/dist/src/init/helpers-generator.js.map +1 -1
- package/dist/src/init/index.d.ts +1 -1
- package/dist/src/init/index.d.ts.map +1 -1
- package/dist/src/init/index.js +1 -1
- package/dist/src/init/index.js.map +1 -1
- package/dist/src/init/mcp-generator.js +33 -37
- package/dist/src/init/mcp-generator.js.map +1 -1
- package/dist/src/init/settings-generator.js +76 -77
- package/dist/src/init/settings-generator.js.map +1 -1
- package/dist/src/init/statusline-generator.js +801 -3
- package/dist/src/init/statusline-generator.js.map +1 -1
- package/dist/src/init/types.d.ts +1 -1
- package/dist/src/init/types.d.ts.map +1 -1
- package/dist/src/init/types.js +76 -59
- package/dist/src/init/types.js.map +1 -1
- package/dist/src/mcp-client.d.ts +92 -0
- package/dist/src/mcp-client.d.ts.map +1 -0
- package/dist/src/mcp-client.js +81 -125
- package/dist/src/mcp-client.js.map +1 -1
- package/dist/src/mcp-server.d.ts +161 -0
- package/dist/src/mcp-server.d.ts.map +1 -0
- package/dist/src/mcp-server.js +470 -757
- package/dist/src/mcp-server.js.map +1 -1
- package/dist/src/mcp-tools/agent-tools.js +391 -492
- package/dist/src/mcp-tools/agent-tools.js.map +1 -1
- package/dist/src/mcp-tools/agentdb-tools.js +332 -533
- package/dist/src/mcp-tools/agentdb-tools.js.map +1 -1
- package/dist/src/mcp-tools/analyze-tools.js +172 -236
- package/dist/src/mcp-tools/analyze-tools.js.map +1 -1
- package/dist/src/mcp-tools/auto-install.d.ts +83 -0
- package/dist/src/mcp-tools/auto-install.d.ts.map +1 -0
- package/dist/src/mcp-tools/auto-install.js +80 -142
- package/dist/src/mcp-tools/auto-install.js.map +1 -1
- package/dist/src/mcp-tools/browser-tools.js +252 -375
- package/dist/src/mcp-tools/browser-tools.js.map +1 -1
- package/dist/src/mcp-tools/claims-tools.js +473 -565
- package/dist/src/mcp-tools/claims-tools.js.map +1 -1
- package/dist/src/mcp-tools/config-tools.js +197 -272
- package/dist/src/mcp-tools/config-tools.js.map +1 -1
- package/dist/src/mcp-tools/coordination-tools.js +500 -572
- package/dist/src/mcp-tools/coordination-tools.js.map +1 -1
- package/dist/src/mcp-tools/daa-tools.js +286 -364
- package/dist/src/mcp-tools/daa-tools.js.map +1 -1
- package/dist/src/mcp-tools/embeddings-tools.js +582 -693
- package/dist/src/mcp-tools/embeddings-tools.js.map +1 -1
- package/dist/src/mcp-tools/github-tools.js +260 -311
- package/dist/src/mcp-tools/github-tools.js.map +1 -1
- package/dist/src/mcp-tools/hive-mind-tools.js +573 -640
- package/dist/src/mcp-tools/hive-mind-tools.js.map +1 -1
- package/dist/src/mcp-tools/hooks-tools.js +2215 -2648
- package/dist/src/mcp-tools/hooks-tools.js.map +1 -1
- package/dist/src/mcp-tools/memory-tools.js +350 -505
- package/dist/src/mcp-tools/memory-tools.js.map +1 -1
- package/dist/src/mcp-tools/neural-tools.js +315 -412
- package/dist/src/mcp-tools/neural-tools.js.map +1 -1
- package/dist/src/mcp-tools/performance-tools.js +420 -480
- package/dist/src/mcp-tools/performance-tools.js.map +1 -1
- package/dist/src/mcp-tools/progress-tools.js +204 -278
- package/dist/src/mcp-tools/progress-tools.js.map +1 -1
- package/dist/src/mcp-tools/ruvllm-tools.js +163 -279
- package/dist/src/mcp-tools/ruvllm-tools.js.map +1 -1
- package/dist/src/mcp-tools/security-tools.js +297 -429
- package/dist/src/mcp-tools/security-tools.js.map +1 -1
- package/dist/src/mcp-tools/session-tools.js +185 -234
- package/dist/src/mcp-tools/session-tools.js.map +1 -1
- package/dist/src/mcp-tools/swarm-tools.js +207 -260
- package/dist/src/mcp-tools/swarm-tools.js.map +1 -1
- package/dist/src/mcp-tools/system-tools.js +276 -325
- package/dist/src/mcp-tools/system-tools.js.map +1 -1
- package/dist/src/mcp-tools/task-tools.js +270 -336
- package/dist/src/mcp-tools/task-tools.js.map +1 -1
- package/dist/src/mcp-tools/terminal-tools.js +148 -196
- package/dist/src/mcp-tools/terminal-tools.js.map +1 -1
- package/dist/src/mcp-tools/transfer-tools.js +186 -333
- package/dist/src/mcp-tools/transfer-tools.js.map +1 -1
- package/dist/src/mcp-tools/types.d.ts +31 -0
- package/dist/src/mcp-tools/types.d.ts.map +1 -0
- package/dist/src/mcp-tools/wasm-agent-tools.js +133 -280
- package/dist/src/mcp-tools/wasm-agent-tools.js.map +1 -1
- package/dist/src/mcp-tools/workflow-tools.js +405 -450
- package/dist/src/mcp-tools/workflow-tools.js.map +1 -1
- package/dist/src/memory/ewc-consolidation.d.ts +295 -0
- package/dist/src/memory/ewc-consolidation.d.ts.map +1 -0
- package/dist/src/memory/ewc-consolidation.js +190 -303
- package/dist/src/memory/ewc-consolidation.js.map +1 -1
- package/dist/src/memory/intelligence.d.ts +338 -0
- package/dist/src/memory/intelligence.d.ts.map +1 -0
- package/dist/src/memory/intelligence.js +569 -794
- package/dist/src/memory/intelligence.js.map +1 -1
- package/dist/src/memory/memory-bridge.d.ts +407 -0
- package/dist/src/memory/memory-bridge.d.ts.map +1 -0
- package/dist/src/memory/memory-bridge.js +1170 -1640
- package/dist/src/memory/memory-bridge.js.map +1 -1
- package/dist/src/memory/memory-initializer.d.ts +412 -0
- package/dist/src/memory/memory-initializer.d.ts.map +1 -0
- package/dist/src/memory/memory-initializer.js +1836 -1851
- package/dist/src/memory/memory-initializer.js.map +1 -1
- package/dist/src/memory/sona-optimizer.d.ts +227 -0
- package/dist/src/memory/sona-optimizer.d.ts.map +1 -0
- package/dist/src/memory/sona-optimizer.js +199 -329
- package/dist/src/memory/sona-optimizer.js.map +1 -1
- package/dist/src/output.d.ts +2 -2
- package/dist/src/output.d.ts.map +1 -1
- package/dist/src/output.js +242 -272
- package/dist/src/output.js.map +1 -1
- package/dist/src/parser.d.ts +51 -0
- package/dist/src/parser.d.ts.map +1 -0
- package/dist/src/parser.js +140 -187
- package/dist/src/parser.js.map +1 -1
- package/dist/src/plugins/manager.d.ts +133 -0
- package/dist/src/plugins/manager.d.ts.map +1 -0
- package/dist/src/plugins/manager.js +285 -521
- package/dist/src/plugins/manager.js.map +1 -1
- package/dist/src/plugins/store/discovery.d.ts +88 -0
- package/dist/src/plugins/store/discovery.d.ts.map +1 -0
- package/dist/src/plugins/store/discovery.js +271 -358
- package/dist/src/plugins/store/discovery.js.map +1 -1
- package/dist/src/plugins/store/index.d.ts +76 -0
- package/dist/src/plugins/store/index.d.ts.map +1 -0
- package/dist/src/plugins/store/index.js +48 -105
- package/dist/src/plugins/store/index.js.map +1 -1
- package/dist/src/plugins/store/search.d.ts +46 -0
- package/dist/src/plugins/store/search.d.ts.map +1 -0
- package/dist/src/plugins/store/search.js +69 -107
- package/dist/src/plugins/store/search.js.map +1 -1
- package/dist/src/plugins/store/types.d.ts +274 -0
- package/dist/src/plugins/store/types.d.ts.map +1 -0
- package/dist/src/plugins/tests/demo-plugin-store.js +113 -160
- package/dist/src/plugins/tests/demo-plugin-store.js.map +1 -1
- package/dist/src/plugins/tests/standalone-test.js +172 -223
- package/dist/src/plugins/tests/standalone-test.js.map +1 -1
- package/dist/src/plugins/tests/test-plugin-store.js +190 -228
- package/dist/src/plugins/tests/test-plugin-store.js.map +1 -1
- package/dist/src/production/circuit-breaker.d.ts +101 -0
- package/dist/src/production/circuit-breaker.d.ts.map +1 -0
- package/dist/src/production/circuit-breaker.js +62 -126
- package/dist/src/production/circuit-breaker.js.map +1 -1
- package/dist/src/production/error-handler.d.ts +92 -0
- package/dist/src/production/error-handler.d.ts.map +1 -0
- package/dist/src/production/error-handler.js +86 -156
- package/dist/src/production/error-handler.js.map +1 -1
- package/dist/src/production/monitoring.d.ts +161 -0
- package/dist/src/production/monitoring.d.ts.map +1 -0
- package/dist/src/production/monitoring.js +139 -220
- package/dist/src/production/monitoring.js.map +1 -1
- package/dist/src/production/rate-limiter.d.ts +80 -0
- package/dist/src/production/rate-limiter.d.ts.map +1 -0
- package/dist/src/production/rate-limiter.js +74 -93
- package/dist/src/production/rate-limiter.js.map +1 -1
- package/dist/src/production/retry.d.ts +48 -0
- package/dist/src/production/retry.d.ts.map +1 -0
- package/dist/src/production/retry.js +75 -167
- package/dist/src/production/retry.js.map +1 -1
- package/dist/src/prompt.d.ts +44 -0
- package/dist/src/prompt.d.ts.map +1 -0
- package/dist/src/prompt.js +436 -560
- package/dist/src/prompt.js.map +1 -1
- package/dist/src/runtime/headless.d.ts +60 -0
- package/dist/src/runtime/headless.d.ts.map +1 -0
- package/dist/src/runtime/headless.js +197 -286
- package/dist/src/runtime/headless.js.map +1 -1
- package/dist/src/ruvector/agent-wasm.d.ts +182 -0
- package/dist/src/ruvector/agent-wasm.d.ts.map +1 -0
- package/dist/src/ruvector/agent-wasm.js +156 -351
- package/dist/src/ruvector/agent-wasm.js.map +1 -1
- package/dist/src/ruvector/ast-analyzer.d.ts +67 -0
- package/dist/src/ruvector/ast-analyzer.d.ts.map +1 -0
- package/dist/src/ruvector/ast-analyzer.js +145 -232
- package/dist/src/ruvector/ast-analyzer.js.map +1 -1
- package/dist/src/ruvector/coverage-router.d.ts +160 -0
- package/dist/src/ruvector/coverage-router.d.ts.map +1 -0
- package/dist/src/ruvector/coverage-router.js +287 -419
- package/dist/src/ruvector/coverage-router.js.map +1 -1
- package/dist/src/ruvector/coverage-tools.js +56 -101
- package/dist/src/ruvector/coverage-tools.js.map +1 -1
- package/dist/src/ruvector/diff-classifier.d.ts +175 -0
- package/dist/src/ruvector/diff-classifier.d.ts.map +1 -0
- package/dist/src/ruvector/diff-classifier.js +324 -451
- package/dist/src/ruvector/diff-classifier.js.map +1 -1
- package/dist/src/ruvector/enhanced-model-router.d.ts +146 -0
- package/dist/src/ruvector/enhanced-model-router.d.ts.map +1 -0
- package/dist/src/ruvector/enhanced-model-router.js +260 -336
- package/dist/src/ruvector/enhanced-model-router.js.map +1 -1
- package/dist/src/ruvector/flash-attention.d.ts +195 -0
- package/dist/src/ruvector/flash-attention.d.ts.map +1 -0
- package/dist/src/ruvector/flash-attention.js +223 -254
- package/dist/src/ruvector/flash-attention.js.map +1 -1
- package/dist/src/ruvector/graph-analyzer.d.ts +187 -0
- package/dist/src/ruvector/graph-analyzer.d.ts.map +1 -0
- package/dist/src/ruvector/graph-analyzer.js +486 -680
- package/dist/src/ruvector/graph-analyzer.js.map +1 -1
- package/dist/src/ruvector/index.d.ts +40 -0
- package/dist/src/ruvector/index.d.ts.map +1 -0
- package/dist/src/ruvector/index.js +36 -106
- package/dist/src/ruvector/index.js.map +1 -1
- package/dist/src/ruvector/lora-adapter.d.ts +218 -0
- package/dist/src/ruvector/lora-adapter.d.ts.map +1 -0
- package/dist/src/ruvector/lora-adapter.js +155 -248
- package/dist/src/ruvector/lora-adapter.js.map +1 -1
- package/dist/src/ruvector/model-router.d.ts +220 -0
- package/dist/src/ruvector/model-router.d.ts.map +1 -0
- package/dist/src/ruvector/model-router.js +175 -248
- package/dist/src/ruvector/model-router.js.map +1 -1
- package/dist/src/ruvector/moe-router.d.ts +206 -0
- package/dist/src/ruvector/moe-router.d.ts.map +1 -0
- package/dist/src/ruvector/moe-router.js +228 -286
- package/dist/src/ruvector/moe-router.js.map +1 -1
- package/dist/src/ruvector/q-learning-router.d.ts +211 -0
- package/dist/src/ruvector/q-learning-router.d.ts.map +1 -0
- package/dist/src/ruvector/q-learning-router.js +257 -338
- package/dist/src/ruvector/q-learning-router.js.map +1 -1
- package/dist/src/ruvector/ruvllm-wasm.d.ts +179 -0
- package/dist/src/ruvector/ruvllm-wasm.d.ts.map +1 -0
- package/dist/src/ruvector/ruvllm-wasm.js +270 -434
- package/dist/src/ruvector/ruvllm-wasm.js.map +1 -1
- package/dist/src/ruvector/semantic-router.d.ts +77 -0
- package/dist/src/ruvector/semantic-router.d.ts.map +1 -0
- package/dist/src/ruvector/semantic-router.js +60 -67
- package/dist/src/ruvector/semantic-router.js.map +1 -1
- package/dist/src/ruvector/vector-db.d.ts +69 -0
- package/dist/src/ruvector/vector-db.d.ts.map +1 -0
- package/dist/src/ruvector/vector-db.js +119 -205
- package/dist/src/ruvector/vector-db.js.map +1 -1
- package/dist/src/services/agentic-flow-bridge.d.ts +50 -0
- package/dist/src/services/agentic-flow-bridge.d.ts.map +1 -0
- package/dist/src/services/agentic-flow-bridge.js +32 -105
- package/dist/src/services/agentic-flow-bridge.js.map +1 -1
- package/dist/src/services/claim-service.d.ts +204 -0
- package/dist/src/services/claim-service.d.ts.map +1 -0
- package/dist/src/services/claim-service.js +615 -940
- package/dist/src/services/claim-service.js.map +1 -1
- package/dist/src/services/container-worker-pool.d.ts +197 -0
- package/dist/src/services/container-worker-pool.d.ts.map +1 -0
- package/dist/src/services/container-worker-pool.js +398 -666
- package/dist/src/services/container-worker-pool.js.map +1 -1
- package/dist/src/services/headless-worker-executor.d.ts +304 -0
- package/dist/src/services/headless-worker-executor.d.ts.map +1 -0
- package/dist/src/services/headless-worker-executor.js +441 -467
- package/dist/src/services/headless-worker-executor.js.map +1 -1
- package/dist/src/services/index.d.ts +4 -4
- package/dist/src/services/index.d.ts.map +1 -1
- package/dist/src/services/index.js +4 -4
- package/dist/src/services/index.js.map +1 -1
- package/dist/src/services/registry-api.d.ts +58 -0
- package/dist/src/services/registry-api.d.ts.map +1 -0
- package/dist/src/services/registry-api.js +92 -200
- package/dist/src/services/registry-api.js.map +1 -1
- package/dist/src/services/ruvector-training.d.ts +222 -0
- package/dist/src/services/ruvector-training.d.ts.map +1 -0
- package/dist/src/services/ruvector-training.js +257 -337
- package/dist/src/services/ruvector-training.js.map +1 -1
- package/dist/src/services/worker-daemon.d.ts +228 -0
- package/dist/src/services/worker-daemon.d.ts.map +1 -0
- package/dist/src/services/worker-daemon.js +591 -849
- package/dist/src/services/worker-daemon.js.map +1 -1
- package/dist/src/services/worker-queue.d.ts +194 -0
- package/dist/src/services/worker-queue.d.ts.map +1 -0
- package/dist/src/services/worker-queue.js +331 -548
- package/dist/src/services/worker-queue.js.map +1 -1
- package/dist/src/suggest.d.ts +53 -0
- package/dist/src/suggest.d.ts.map +1 -0
- package/dist/src/suggest.js +45 -55
- package/dist/src/suggest.js.map +1 -1
- package/dist/src/transfer/anonymization/index.js +29 -37
- package/dist/src/transfer/anonymization/index.js.map +1 -1
- package/dist/src/transfer/deploy-seraphine.js +128 -155
- package/dist/src/transfer/deploy-seraphine.js.map +1 -1
- package/dist/src/transfer/export.d.ts +25 -0
- package/dist/src/transfer/export.d.ts.map +1 -0
- package/dist/src/transfer/export.js +84 -142
- package/dist/src/transfer/export.js.map +1 -1
- package/dist/src/transfer/index.d.ts +1 -1
- package/dist/src/transfer/index.d.ts.map +1 -1
- package/dist/src/transfer/index.js +0 -2
- package/dist/src/transfer/index.js.map +1 -1
- package/dist/src/transfer/ipfs/client.d.ts +109 -0
- package/dist/src/transfer/ipfs/client.d.ts.map +1 -0
- package/dist/src/transfer/ipfs/client.js +187 -337
- package/dist/src/transfer/ipfs/client.js.map +1 -1
- package/dist/src/transfer/ipfs/upload.d.ts +95 -0
- package/dist/src/transfer/ipfs/upload.d.ts.map +1 -0
- package/dist/src/transfer/ipfs/upload.js +288 -434
- package/dist/src/transfer/ipfs/upload.js.map +1 -1
- package/dist/src/transfer/models/seraphine.d.ts +72 -0
- package/dist/src/transfer/models/seraphine.d.ts.map +1 -0
- package/dist/src/transfer/models/seraphine.js +55 -55
- package/dist/src/transfer/models/seraphine.js.map +1 -1
- package/dist/src/transfer/serialization/cfp.d.ts +49 -0
- package/dist/src/transfer/serialization/cfp.d.ts.map +1 -0
- package/dist/src/transfer/serialization/cfp.js +30 -31
- package/dist/src/transfer/serialization/cfp.js.map +1 -1
- package/dist/src/transfer/storage/gcs.d.ts +82 -0
- package/dist/src/transfer/storage/gcs.d.ts.map +1 -0
- package/dist/src/transfer/storage/gcs.js +165 -232
- package/dist/src/transfer/storage/gcs.js.map +1 -1
- package/dist/src/transfer/store/discovery.d.ts +84 -0
- package/dist/src/transfer/store/discovery.d.ts.map +1 -0
- package/dist/src/transfer/store/discovery.js +239 -349
- package/dist/src/transfer/store/discovery.js.map +1 -1
- package/dist/src/transfer/store/download.d.ts +70 -0
- package/dist/src/transfer/store/download.d.ts.map +1 -0
- package/dist/src/transfer/store/download.js +243 -365
- package/dist/src/transfer/store/download.js.map +1 -1
- package/dist/src/transfer/store/index.d.ts +84 -0
- package/dist/src/transfer/store/index.d.ts.map +1 -0
- package/dist/src/transfer/store/index.js +63 -130
- package/dist/src/transfer/store/index.js.map +1 -1
- package/dist/src/transfer/store/publish.d.ts +76 -0
- package/dist/src/transfer/store/publish.d.ts.map +1 -0
- package/dist/src/transfer/store/publish.js +184 -258
- package/dist/src/transfer/store/publish.js.map +1 -1
- package/dist/src/transfer/store/registry.js +50 -72
- package/dist/src/transfer/store/registry.js.map +1 -1
- package/dist/src/transfer/store/search.d.ts +54 -0
- package/dist/src/transfer/store/search.d.ts.map +1 -0
- package/dist/src/transfer/store/search.js +64 -96
- package/dist/src/transfer/store/search.js.map +1 -1
- package/dist/src/transfer/store/tests/standalone-test.js +174 -231
- package/dist/src/transfer/store/tests/standalone-test.js.map +1 -1
- package/dist/src/transfer/test-seraphine.js +95 -130
- package/dist/src/transfer/test-seraphine.js.map +1 -1
- package/dist/src/transfer/tests/test-store.js +194 -239
- package/dist/src/transfer/tests/test-store.js.map +1 -1
- package/dist/src/transfer/types.d.ts +245 -0
- package/dist/src/transfer/types.d.ts.map +1 -0
- package/dist/src/types.d.ts +198 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +26 -55
- package/dist/src/types.js.map +1 -1
- package/dist/src/update/checker.d.ts +34 -0
- package/dist/src/update/checker.d.ts.map +1 -0
- package/dist/src/update/checker.js +106 -183
- package/dist/src/update/checker.js.map +1 -1
- package/dist/src/update/executor.d.ts +32 -0
- package/dist/src/update/executor.d.ts.map +1 -0
- package/dist/src/update/executor.js +135 -198
- package/dist/src/update/executor.js.map +1 -1
- package/dist/src/update/index.d.ts +33 -0
- package/dist/src/update/index.d.ts.map +1 -0
- package/dist/src/update/index.js +38 -85
- package/dist/src/update/index.js.map +1 -1
- package/dist/src/update/rate-limiter.d.ts +20 -0
- package/dist/src/update/rate-limiter.d.ts.map +1 -0
- package/dist/src/update/rate-limiter.js +19 -31
- package/dist/src/update/rate-limiter.js.map +1 -1
- package/dist/src/update/validator.d.ts +17 -0
- package/dist/src/update/validator.d.ts.map +1 -0
- package/dist/src/update/validator.js +38 -64
- package/dist/src/update/validator.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -9,46 +9,10 @@
|
|
|
9
9
|
* npx tsx deploy-seraphine.ts --to-ipfs
|
|
10
10
|
* npx tsx deploy-seraphine.ts --to-ipfs --anonymize strict
|
|
11
11
|
*/
|
|
12
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
-
function step(op) {
|
|
26
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
-
while (_) try {
|
|
28
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
-
switch (op[0]) {
|
|
31
|
-
case 0: case 1: t = op; break;
|
|
32
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
-
default:
|
|
36
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
-
if (t[2]) _.ops.pop();
|
|
41
|
-
_.trys.pop(); continue;
|
|
42
|
-
}
|
|
43
|
-
op = body.call(thisArg, _);
|
|
44
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
12
|
import * as path from 'path';
|
|
49
13
|
import { fileURLToPath } from 'url';
|
|
50
|
-
|
|
51
|
-
|
|
14
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
15
|
+
const __dirname = path.dirname(__filename);
|
|
52
16
|
import { createSeraphineGenesis, getSeraphineInfo } from './models/seraphine.js';
|
|
53
17
|
import { exportPatterns } from './export.js';
|
|
54
18
|
import { validateCFP } from './serialization/cfp.js';
|
|
@@ -57,17 +21,17 @@ import { scanCFPForPII } from './anonymization/index.js';
|
|
|
57
21
|
* Parse CLI arguments
|
|
58
22
|
*/
|
|
59
23
|
function parseArgs() {
|
|
60
|
-
|
|
61
|
-
|
|
24
|
+
const args = process.argv.slice(2);
|
|
25
|
+
const options = {
|
|
62
26
|
toIpfs: false,
|
|
63
27
|
anonymize: 'standard',
|
|
64
28
|
pin: true,
|
|
65
29
|
gateway: 'https://w3s.link',
|
|
66
30
|
validate: true,
|
|
67
|
-
verbose: false
|
|
31
|
+
verbose: false,
|
|
68
32
|
};
|
|
69
|
-
for (
|
|
70
|
-
|
|
33
|
+
for (let i = 0; i < args.length; i++) {
|
|
34
|
+
const arg = args[i];
|
|
71
35
|
switch (arg) {
|
|
72
36
|
case '--output':
|
|
73
37
|
case '-o':
|
|
@@ -107,125 +71,134 @@ function parseArgs() {
|
|
|
107
71
|
* Print help message
|
|
108
72
|
*/
|
|
109
73
|
function printHelp() {
|
|
110
|
-
console.log(
|
|
74
|
+
console.log(`
|
|
75
|
+
Seraphine Genesis Deployer
|
|
76
|
+
==========================
|
|
77
|
+
|
|
78
|
+
Deploy the foundational Claude Flow pattern model.
|
|
79
|
+
|
|
80
|
+
Usage:
|
|
81
|
+
npx ts-node deploy-seraphine.ts [options]
|
|
82
|
+
|
|
83
|
+
Options:
|
|
84
|
+
--output, -o <path> Output file path
|
|
85
|
+
--to-ipfs, --ipfs Upload to IPFS
|
|
86
|
+
--anonymize, -a <level> Anonymization level (minimal|standard|strict|paranoid)
|
|
87
|
+
--gateway, -g <url> IPFS gateway URL
|
|
88
|
+
--no-pin Don't pin to pinning service
|
|
89
|
+
--no-validate Skip validation
|
|
90
|
+
--verbose, -v Verbose output
|
|
91
|
+
--help, -h Show this help
|
|
92
|
+
|
|
93
|
+
Examples:
|
|
94
|
+
npx ts-node deploy-seraphine.ts --output ./seraphine-genesis.cfp.json
|
|
95
|
+
npx ts-node deploy-seraphine.ts --to-ipfs --anonymize strict
|
|
96
|
+
npx ts-node deploy-seraphine.ts --to-ipfs --gateway https://dweb.link
|
|
97
|
+
`);
|
|
111
98
|
}
|
|
112
99
|
/**
|
|
113
100
|
* Main deploy function
|
|
114
101
|
*/
|
|
115
|
-
function deploy() {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
console.log('✅ Validating CFP format...');
|
|
145
|
-
validation = validateCFP(genesis);
|
|
146
|
-
if (!validation.valid) {
|
|
147
|
-
console.error('❌ Validation failed:');
|
|
148
|
-
for (_c = 0, _d = validation.errors; _c < _d.length; _c++) {
|
|
149
|
-
error = _d[_c];
|
|
150
|
-
console.error(" - " + error);
|
|
151
|
-
}
|
|
152
|
-
process.exit(1);
|
|
153
|
-
}
|
|
154
|
-
console.log(' Format is valid!');
|
|
155
|
-
console.log('');
|
|
156
|
-
}
|
|
157
|
-
// Step 3: Scan for PII
|
|
158
|
-
console.log('🔍 Scanning for PII...');
|
|
159
|
-
piiScan = scanCFPForPII(genesis);
|
|
160
|
-
if (piiScan.found) {
|
|
161
|
-
console.log(" Found " + piiScan.count + " PII items:");
|
|
162
|
-
for (_e = 0, _f = Object.entries(piiScan.types); _e < _f.length; _e++) {
|
|
163
|
-
_g = _f[_e], type = _g[0], count = _g[1];
|
|
164
|
-
console.log(" - " + type + ": " + count);
|
|
165
|
-
}
|
|
166
|
-
console.log(' Will be redacted during export.');
|
|
167
|
-
}
|
|
168
|
-
else {
|
|
169
|
-
console.log(' No PII detected!');
|
|
170
|
-
}
|
|
171
|
-
console.log('');
|
|
172
|
-
// Step 4: Export
|
|
173
|
-
console.log("\uD83D\uDCE4 Exporting with " + options.anonymize + " anonymization...");
|
|
174
|
-
exportOptions = {
|
|
175
|
-
output: options.output,
|
|
176
|
-
toIpfs: options.toIpfs,
|
|
177
|
-
anonymize: options.anonymize,
|
|
178
|
-
pin: options.pin,
|
|
179
|
-
gateway: options.gateway,
|
|
180
|
-
format: 'json',
|
|
181
|
-
redactPii: true
|
|
182
|
-
};
|
|
183
|
-
// If no output specified and not uploading to IPFS, create default output
|
|
184
|
-
if (!options.output && !options.toIpfs) {
|
|
185
|
-
defaultOutput = path.join(process.cwd(), 'seraphine-genesis.cfp.json');
|
|
186
|
-
exportOptions.output = defaultOutput;
|
|
187
|
-
}
|
|
188
|
-
return [4 /*yield*/, exportPatterns(genesis, exportOptions)];
|
|
189
|
-
case 1:
|
|
190
|
-
result = _h.sent();
|
|
191
|
-
console.log('');
|
|
192
|
-
console.log('═══════════════════════════════════════════════════════════');
|
|
193
|
-
console.log(' DEPLOYMENT COMPLETE ');
|
|
194
|
-
console.log('═══════════════════════════════════════════════════════════');
|
|
195
|
-
console.log('');
|
|
196
|
-
if (result.success) {
|
|
197
|
-
console.log('✅ Successfully deployed Seraphine Genesis!');
|
|
198
|
-
console.log('');
|
|
199
|
-
console.log(' 📊 Export Summary:');
|
|
200
|
-
console.log(" Patterns: " + result.patternCount);
|
|
201
|
-
console.log(" Size: " + result.size + " bytes");
|
|
202
|
-
console.log(" Anonymization: " + result.anonymizationLevel);
|
|
203
|
-
if (result.outputPath) {
|
|
204
|
-
console.log('');
|
|
205
|
-
console.log(" \uD83D\uDCC1 File: " + result.outputPath);
|
|
206
|
-
}
|
|
207
|
-
if (result.cid) {
|
|
208
|
-
console.log('');
|
|
209
|
-
console.log(' 🌐 IPFS:');
|
|
210
|
-
console.log(" CID: " + result.cid);
|
|
211
|
-
console.log(" Gateway URL: " + result.gateway + "/ipfs/" + result.cid);
|
|
212
|
-
}
|
|
213
|
-
console.log('');
|
|
214
|
-
console.log(' 🎉 Hello World! The genesis pattern has been deployed.');
|
|
215
|
-
console.log(' 🌟 This is the first Claude Flow pattern ever shared.');
|
|
216
|
-
console.log('');
|
|
217
|
-
}
|
|
218
|
-
else {
|
|
219
|
-
console.error('❌ Deployment failed!');
|
|
220
|
-
process.exit(1);
|
|
221
|
-
}
|
|
222
|
-
return [2 /*return*/];
|
|
102
|
+
async function deploy() {
|
|
103
|
+
const options = parseArgs();
|
|
104
|
+
console.log('');
|
|
105
|
+
console.log('╔══════════════════════════════════════════════════════════╗');
|
|
106
|
+
console.log('║ SERAPHINE GENESIS MODEL DEPLOYMENT ║');
|
|
107
|
+
console.log('║ The First Claude Flow Pattern Model ║');
|
|
108
|
+
console.log('╚══════════════════════════════════════════════════════════╝');
|
|
109
|
+
console.log('');
|
|
110
|
+
// Step 1: Create Seraphine Genesis
|
|
111
|
+
console.log('📦 Creating Seraphine Genesis Model...');
|
|
112
|
+
const genesis = createSeraphineGenesis();
|
|
113
|
+
const info = getSeraphineInfo();
|
|
114
|
+
console.log(` Name: ${info.name}`);
|
|
115
|
+
console.log(` Version: ${info.version}`);
|
|
116
|
+
console.log(` Description: ${info.description.slice(0, 60)}...`);
|
|
117
|
+
console.log('');
|
|
118
|
+
console.log(' Pattern Counts:');
|
|
119
|
+
for (const [type, count] of Object.entries(info.patternCounts)) {
|
|
120
|
+
console.log(` - ${type}: ${count}`);
|
|
121
|
+
}
|
|
122
|
+
console.log('');
|
|
123
|
+
// Step 2: Validate
|
|
124
|
+
if (options.validate) {
|
|
125
|
+
console.log('✅ Validating CFP format...');
|
|
126
|
+
const validation = validateCFP(genesis);
|
|
127
|
+
if (!validation.valid) {
|
|
128
|
+
console.error('❌ Validation failed:');
|
|
129
|
+
for (const error of validation.errors) {
|
|
130
|
+
console.error(` - ${error}`);
|
|
223
131
|
}
|
|
224
|
-
|
|
225
|
-
|
|
132
|
+
process.exit(1);
|
|
133
|
+
}
|
|
134
|
+
console.log(' Format is valid!');
|
|
135
|
+
console.log('');
|
|
136
|
+
}
|
|
137
|
+
// Step 3: Scan for PII
|
|
138
|
+
console.log('🔍 Scanning for PII...');
|
|
139
|
+
const piiScan = scanCFPForPII(genesis);
|
|
140
|
+
if (piiScan.found) {
|
|
141
|
+
console.log(` Found ${piiScan.count} PII items:`);
|
|
142
|
+
for (const [type, count] of Object.entries(piiScan.types)) {
|
|
143
|
+
console.log(` - ${type}: ${count}`);
|
|
144
|
+
}
|
|
145
|
+
console.log(' Will be redacted during export.');
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
console.log(' No PII detected!');
|
|
149
|
+
}
|
|
150
|
+
console.log('');
|
|
151
|
+
// Step 4: Export
|
|
152
|
+
console.log(`📤 Exporting with ${options.anonymize} anonymization...`);
|
|
153
|
+
const exportOptions = {
|
|
154
|
+
output: options.output,
|
|
155
|
+
toIpfs: options.toIpfs,
|
|
156
|
+
anonymize: options.anonymize,
|
|
157
|
+
pin: options.pin,
|
|
158
|
+
gateway: options.gateway,
|
|
159
|
+
format: 'json',
|
|
160
|
+
redactPii: true,
|
|
161
|
+
};
|
|
162
|
+
// If no output specified and not uploading to IPFS, create default output
|
|
163
|
+
if (!options.output && !options.toIpfs) {
|
|
164
|
+
const defaultOutput = path.join(process.cwd(), 'seraphine-genesis.cfp.json');
|
|
165
|
+
exportOptions.output = defaultOutput;
|
|
166
|
+
}
|
|
167
|
+
const result = await exportPatterns(genesis, exportOptions);
|
|
168
|
+
console.log('');
|
|
169
|
+
console.log('═══════════════════════════════════════════════════════════');
|
|
170
|
+
console.log(' DEPLOYMENT COMPLETE ');
|
|
171
|
+
console.log('═══════════════════════════════════════════════════════════');
|
|
172
|
+
console.log('');
|
|
173
|
+
if (result.success) {
|
|
174
|
+
console.log('✅ Successfully deployed Seraphine Genesis!');
|
|
175
|
+
console.log('');
|
|
176
|
+
console.log(' 📊 Export Summary:');
|
|
177
|
+
console.log(` Patterns: ${result.patternCount}`);
|
|
178
|
+
console.log(` Size: ${result.size} bytes`);
|
|
179
|
+
console.log(` Anonymization: ${result.anonymizationLevel}`);
|
|
180
|
+
if (result.outputPath) {
|
|
181
|
+
console.log('');
|
|
182
|
+
console.log(` 📁 File: ${result.outputPath}`);
|
|
183
|
+
}
|
|
184
|
+
if (result.cid) {
|
|
185
|
+
console.log('');
|
|
186
|
+
console.log(' 🌐 IPFS:');
|
|
187
|
+
console.log(` CID: ${result.cid}`);
|
|
188
|
+
console.log(` Gateway URL: ${result.gateway}/ipfs/${result.cid}`);
|
|
189
|
+
}
|
|
190
|
+
console.log('');
|
|
191
|
+
console.log(' 🎉 Hello World! The genesis pattern has been deployed.');
|
|
192
|
+
console.log(' 🌟 This is the first Claude Flow pattern ever shared.');
|
|
193
|
+
console.log('');
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
console.error('❌ Deployment failed!');
|
|
197
|
+
process.exit(1);
|
|
198
|
+
}
|
|
226
199
|
}
|
|
227
200
|
// Run if executed directly
|
|
228
|
-
deploy()
|
|
201
|
+
deploy().catch(error => {
|
|
229
202
|
console.error('Fatal error:', error);
|
|
230
203
|
process.exit(1);
|
|
231
204
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy-seraphine.js","sourceRoot":"","sources":["../../../src/transfer/deploy-seraphine.ts"],"names":[],"mappings":";AACA;;;;;;;;;GASG
|
|
1
|
+
{"version":3,"file":"deploy-seraphine.js","sourceRoot":"","sources":["../../../src/transfer/deploy-seraphine.ts"],"names":[],"mappings":";AACA;;;;;;;;;GASG;AAGH,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;AAC3C,OAAO,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAmB,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAgBzD;;GAEG;AACH,SAAS,SAAS;IAChB,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACnC,MAAM,OAAO,GAAkB;QAC7B,MAAM,EAAE,KAAK;QACb,SAAS,EAAE,UAAU;QACrB,GAAG,EAAE,IAAI;QACT,OAAO,EAAE,kBAAkB;QAC3B,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,KAAK;KACf,CAAC;IAEF,KAAK,IAAI,CAAC,GA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B,OAAO,CAAC,GAAG,CAAC,eAAe,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;QAClD,CAAC;QAED,IAAI,MAAM,CAAC,GAAG,EAAE,CAAC;YACf,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAChB,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;YAC3B,OAAO,CAAC,GAAG,CAAC,cAAc,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC;YACxC,OAAO,CAAC,GAAG,CAAC,sBAAsB,MAAM,CAAC,OAAO,SAAS,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC;QACzE,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,OAAO,CAAC,GAAG,CAAC,2DAA2D,CAAC,CAAC;QACzE,OAAO,CAAC,GAAG,CAAC,0DAA0D,CAAC,CAAC;QACxE,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC;QACtC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,2BAA2B;AAC3B,MAAM,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pattern Export Pipeline
|
|
3
|
+
* Export patterns with anonymization and optional IPFS upload
|
|
4
|
+
*/
|
|
5
|
+
import type { CFPFormat, ExportOptions, ExportResult } from './types.js';
|
|
6
|
+
/**
|
|
7
|
+
* Export patterns to file or IPFS
|
|
8
|
+
*/
|
|
9
|
+
export declare function exportPatterns(cfp: CFPFormat, options?: ExportOptions): Promise<ExportResult>;
|
|
10
|
+
/**
|
|
11
|
+
* Export Seraphine genesis model
|
|
12
|
+
*/
|
|
13
|
+
export declare function exportSeraphine(options?: ExportOptions): Promise<ExportResult>;
|
|
14
|
+
/**
|
|
15
|
+
* Quick export to file
|
|
16
|
+
*/
|
|
17
|
+
export declare function quickExport(cfp: CFPFormat, outputPath: string): Promise<ExportResult>;
|
|
18
|
+
/**
|
|
19
|
+
* Quick export to IPFS
|
|
20
|
+
*/
|
|
21
|
+
export declare function quickExportToIPFS(cfp: CFPFormat, options?: {
|
|
22
|
+
gateway?: string;
|
|
23
|
+
pin?: boolean;
|
|
24
|
+
}): Promise<ExportResult>;
|
|
25
|
+
//# sourceMappingURL=export.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export.d.ts","sourceRoot":"","sources":["../../../src/transfer/export.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EACV,SAAS,EACT,aAAa,EACb,YAAY,EAEb,MAAM,YAAY,CAAC;AAKpB;;GAEG;AACH,wBAAsB,cAAc,CAClC,GAAG,EAAE,SAAS,EACd,OAAO,GAAE,aAAkB,GAC1B,OAAO,CAAC,YAAY,CAAC,CA8FvB;AAED;;GAEG;AACH,wBAAsB,eAAe,CAAC,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,YAAY,CAAC,CAKxF;AAED;;GAEG;AACH,wBAAsB,WAAW,CAC/B,GAAG,EAAE,SAAS,EACd,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,YAAY,CAAC,CAMvB;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,SAAS,EACd,OAAO,GAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,OAAO,CAAA;CAAO,GAChD,OAAO,CAAC,YAAY,CAAC,CAQvB"}
|
|
@@ -2,42 +2,6 @@
|
|
|
2
2
|
* Pattern Export Pipeline
|
|
3
3
|
* Export patterns with anonymization and optional IPFS upload
|
|
4
4
|
*/
|
|
5
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
6
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
7
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
8
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
9
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
10
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
11
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
12
|
-
});
|
|
13
|
-
};
|
|
14
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
15
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
16
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
17
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
18
|
-
function step(op) {
|
|
19
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
20
|
-
while (_) try {
|
|
21
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
22
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
23
|
-
switch (op[0]) {
|
|
24
|
-
case 0: case 1: t = op; break;
|
|
25
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
26
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
27
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
28
|
-
default:
|
|
29
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
30
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
31
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
32
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
33
|
-
if (t[2]) _.ops.pop();
|
|
34
|
-
_.trys.pop(); continue;
|
|
35
|
-
}
|
|
36
|
-
op = body.call(thisArg, _);
|
|
37
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
38
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
5
|
import * as fs from 'fs';
|
|
42
6
|
import * as path from 'path';
|
|
43
7
|
import { serializeToJson, serializeToBuffer, getFileExtension } from './serialization/cfp.js';
|
|
@@ -46,126 +10,104 @@ import { uploadToIPFS } from './ipfs/upload.js';
|
|
|
46
10
|
/**
|
|
47
11
|
* Export patterns to file or IPFS
|
|
48
12
|
*/
|
|
49
|
-
export function exportPatterns(cfp, options) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
})];
|
|
74
|
-
case 1:
|
|
75
|
-
ipfsResult = _p.sent();
|
|
76
|
-
cid = ipfsResult.cid;
|
|
77
|
-
anonymizedCfp.ipfs = {
|
|
78
|
-
cid: ipfsResult.cid,
|
|
79
|
-
pinnedAt: ipfsResult.pinnedAt ? [ipfsResult.pinnedAt] : [],
|
|
80
|
-
gateway: ipfsResult.gateway,
|
|
81
|
-
size: ipfsResult.size
|
|
82
|
-
};
|
|
83
|
-
console.log("Uploaded to IPFS: " + cid);
|
|
84
|
-
console.log("Gateway URL: " + gateway + "/ipfs/" + cid);
|
|
85
|
-
_p.label = 2;
|
|
86
|
-
case 2:
|
|
87
|
-
if (output) {
|
|
88
|
-
ext = getFileExtension(format);
|
|
89
|
-
outputPath = output.endsWith(ext) ? output : output + ext;
|
|
90
|
-
dir = path.dirname(outputPath);
|
|
91
|
-
if (!fs.existsSync(dir)) {
|
|
92
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
93
|
-
}
|
|
94
|
-
// Write file
|
|
95
|
-
if (typeof serialized === 'string') {
|
|
96
|
-
fs.writeFileSync(outputPath, serialized, 'utf-8');
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
99
|
-
fs.writeFileSync(outputPath, serialized);
|
|
100
|
-
}
|
|
101
|
-
console.log("Exported to: " + outputPath);
|
|
102
|
-
}
|
|
103
|
-
patternCount = (((_a = cfp.patterns.routing) === null || _a === void 0 ? void 0 : _a.length) || 0) +
|
|
104
|
-
(((_b = cfp.patterns.complexity) === null || _b === void 0 ? void 0 : _b.length) || 0) +
|
|
105
|
-
(((_c = cfp.patterns.coverage) === null || _c === void 0 ? void 0 : _c.length) || 0) +
|
|
106
|
-
(((_d = cfp.patterns.trajectory) === null || _d === void 0 ? void 0 : _d.length) || 0) +
|
|
107
|
-
(((_e = cfp.patterns.custom) === null || _e === void 0 ? void 0 : _e.length) || 0);
|
|
108
|
-
return [2 /*return*/, {
|
|
109
|
-
success: true,
|
|
110
|
-
outputPath: outputPath,
|
|
111
|
-
cid: cid,
|
|
112
|
-
gateway: cid ? gateway : undefined,
|
|
113
|
-
size: size,
|
|
114
|
-
patternCount: patternCount,
|
|
115
|
-
anonymizationLevel: anonymize
|
|
116
|
-
}];
|
|
117
|
-
}
|
|
13
|
+
export async function exportPatterns(cfp, options = {}) {
|
|
14
|
+
const { output, format = 'json', anonymize = 'standard', redactPii = true, stripPaths = false, toIpfs = false, pin = true, gateway = 'https://w3s.link', } = options;
|
|
15
|
+
// Step 1: Scan for PII
|
|
16
|
+
const piiScan = scanCFPForPII(cfp);
|
|
17
|
+
if (piiScan.found && redactPii) {
|
|
18
|
+
console.log(`Found ${piiScan.count} PII items, will be redacted`);
|
|
19
|
+
}
|
|
20
|
+
// Step 2: Apply anonymization
|
|
21
|
+
const { cfp: anonymizedCfp, transforms } = anonymizeCFP(cfp, anonymize);
|
|
22
|
+
console.log(`Applied ${transforms.length} anonymization transforms: ${transforms.join(', ')}`);
|
|
23
|
+
// Step 3: Serialize
|
|
24
|
+
const serialized = format === 'json'
|
|
25
|
+
? serializeToJson(anonymizedCfp)
|
|
26
|
+
: serializeToBuffer(anonymizedCfp, format);
|
|
27
|
+
const size = typeof serialized === 'string' ? Buffer.byteLength(serialized) : serialized.length;
|
|
28
|
+
// Step 4: Output
|
|
29
|
+
let outputPath;
|
|
30
|
+
let cid;
|
|
31
|
+
if (toIpfs) {
|
|
32
|
+
// Upload to IPFS
|
|
33
|
+
const ipfsResult = await uploadToIPFS(Buffer.isBuffer(serialized) ? serialized : Buffer.from(serialized), {
|
|
34
|
+
pin,
|
|
35
|
+
gateway,
|
|
36
|
+
name: anonymizedCfp.metadata.name || 'patterns',
|
|
118
37
|
});
|
|
119
|
-
|
|
38
|
+
cid = ipfsResult.cid;
|
|
39
|
+
anonymizedCfp.ipfs = {
|
|
40
|
+
cid: ipfsResult.cid,
|
|
41
|
+
pinnedAt: ipfsResult.pinnedAt ? [ipfsResult.pinnedAt] : [],
|
|
42
|
+
gateway: ipfsResult.gateway,
|
|
43
|
+
size: ipfsResult.size,
|
|
44
|
+
};
|
|
45
|
+
console.log(`Uploaded to IPFS: ${cid}`);
|
|
46
|
+
console.log(`Gateway URL: ${gateway}/ipfs/${cid}`);
|
|
47
|
+
}
|
|
48
|
+
if (output) {
|
|
49
|
+
// Write to file
|
|
50
|
+
const ext = getFileExtension(format);
|
|
51
|
+
outputPath = output.endsWith(ext) ? output : output + ext;
|
|
52
|
+
// Ensure directory exists
|
|
53
|
+
const dir = path.dirname(outputPath);
|
|
54
|
+
if (!fs.existsSync(dir)) {
|
|
55
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
56
|
+
}
|
|
57
|
+
// Write file
|
|
58
|
+
if (typeof serialized === 'string') {
|
|
59
|
+
fs.writeFileSync(outputPath, serialized, 'utf-8');
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
fs.writeFileSync(outputPath, serialized);
|
|
63
|
+
}
|
|
64
|
+
console.log(`Exported to: ${outputPath}`);
|
|
65
|
+
}
|
|
66
|
+
// Calculate pattern count
|
|
67
|
+
const patternCount = (cfp.patterns.routing?.length || 0) +
|
|
68
|
+
(cfp.patterns.complexity?.length || 0) +
|
|
69
|
+
(cfp.patterns.coverage?.length || 0) +
|
|
70
|
+
(cfp.patterns.trajectory?.length || 0) +
|
|
71
|
+
(cfp.patterns.custom?.length || 0);
|
|
72
|
+
return {
|
|
73
|
+
success: true,
|
|
74
|
+
outputPath,
|
|
75
|
+
cid,
|
|
76
|
+
gateway: cid ? gateway : undefined,
|
|
77
|
+
size,
|
|
78
|
+
patternCount,
|
|
79
|
+
anonymizationLevel: anonymize,
|
|
80
|
+
};
|
|
120
81
|
}
|
|
121
82
|
/**
|
|
122
83
|
* Export Seraphine genesis model
|
|
123
84
|
*/
|
|
124
|
-
export function exportSeraphine(options) {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
switch (_a.label) {
|
|
130
|
-
case 0: return [4 /*yield*/, import('./models/seraphine.js')];
|
|
131
|
-
case 1:
|
|
132
|
-
createSeraphineGenesis = (_a.sent()).createSeraphineGenesis;
|
|
133
|
-
genesis = createSeraphineGenesis();
|
|
134
|
-
return [2 /*return*/, exportPatterns(genesis, options)];
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
});
|
|
85
|
+
export async function exportSeraphine(options = {}) {
|
|
86
|
+
// Dynamically import to avoid circular dependency
|
|
87
|
+
const { createSeraphineGenesis } = await import('./models/seraphine.js');
|
|
88
|
+
const genesis = createSeraphineGenesis();
|
|
89
|
+
return exportPatterns(genesis, options);
|
|
138
90
|
}
|
|
139
91
|
/**
|
|
140
92
|
* Quick export to file
|
|
141
93
|
*/
|
|
142
|
-
export function quickExport(cfp, outputPath) {
|
|
143
|
-
return
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
format: 'json',
|
|
148
|
-
anonymize: 'standard'
|
|
149
|
-
})];
|
|
150
|
-
});
|
|
94
|
+
export async function quickExport(cfp, outputPath) {
|
|
95
|
+
return exportPatterns(cfp, {
|
|
96
|
+
output: outputPath,
|
|
97
|
+
format: 'json',
|
|
98
|
+
anonymize: 'standard',
|
|
151
99
|
});
|
|
152
100
|
}
|
|
153
101
|
/**
|
|
154
102
|
* Quick export to IPFS
|
|
155
103
|
*/
|
|
156
|
-
export function quickExportToIPFS(cfp, options) {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
pin: (_a = options.pin) !== null && _a !== void 0 ? _a : true,
|
|
164
|
-
gateway: (_b = options.gateway) !== null && _b !== void 0 ? _b : 'https://w3s.link',
|
|
165
|
-
format: 'json',
|
|
166
|
-
anonymize: 'strict'
|
|
167
|
-
})];
|
|
168
|
-
});
|
|
104
|
+
export async function quickExportToIPFS(cfp, options = {}) {
|
|
105
|
+
return exportPatterns(cfp, {
|
|
106
|
+
toIpfs: true,
|
|
107
|
+
pin: options.pin ?? true,
|
|
108
|
+
gateway: options.gateway ?? 'https://w3s.link',
|
|
109
|
+
format: 'json',
|
|
110
|
+
anonymize: 'strict',
|
|
169
111
|
});
|
|
170
112
|
}
|
|
171
113
|
//# sourceMappingURL=export.js.map
|