openclaw-node-harness 2.0.0
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/LICENSE +21 -0
- package/README.md +184 -0
- package/bin/discord-read.js +228 -0
- package/bin/fleet-deploy.js +365 -0
- package/bin/lane-watchdog.js +232 -0
- package/bin/mesh-agent.js +714 -0
- package/bin/mesh-bridge.js +535 -0
- package/bin/mesh-deploy-listener.js +322 -0
- package/bin/mesh-deploy.js +1048 -0
- package/bin/mesh-health-publisher.js +247 -0
- package/bin/mesh-task-daemon.js +451 -0
- package/bin/mesh-tool-discord.js +293 -0
- package/bin/mesh.js +649 -0
- package/boot/manifest.yaml +187 -0
- package/cli.js +35 -0
- package/config/daemon.json.template +16 -0
- package/config/obsidian-sync.json.template +39 -0
- package/config/openclaw.json.template +124 -0
- package/config/transcript-sources.json.template +22 -0
- package/identity/AGENTS.md +201 -0
- package/identity/CLAUDE.md +64 -0
- package/identity/DELEGATION.md +304 -0
- package/identity/HEARTBEAT.md +163 -0
- package/identity/MEMORY_SPEC.md +368 -0
- package/identity/PRINCIPLES.md +81 -0
- package/identity/SOUL.md +48 -0
- package/identity/TOOLS.md +47 -0
- package/install.sh +895 -0
- package/lib/agent-activity.js +390 -0
- package/lib/kanban-io.js +352 -0
- package/lib/mesh-registry.js +194 -0
- package/lib/mesh-roles.js +13 -0
- package/lib/mesh-tasks.js +306 -0
- package/lib/nats-resolve.js +108 -0
- package/mission-control/README.md +36 -0
- package/mission-control/drizzle/0000_simple_silhouette.sql +62 -0
- package/mission-control/drizzle/meta/0000_snapshot.json +413 -0
- package/mission-control/drizzle/meta/_journal.json +13 -0
- package/mission-control/drizzle.config.ts +13 -0
- package/mission-control/eslint.config.mjs +18 -0
- package/mission-control/next.config.ts +7 -0
- package/mission-control/package-lock.json +10518 -0
- package/mission-control/package.json +49 -0
- package/mission-control/postcss.config.mjs +7 -0
- package/mission-control/public/file.svg +1 -0
- package/mission-control/public/globe.svg +1 -0
- package/mission-control/public/next.svg +1 -0
- package/mission-control/public/vercel.svg +1 -0
- package/mission-control/public/window.svg +1 -0
- package/mission-control/scripts/enrich-descriptions.js +193 -0
- package/mission-control/scripts/gen-chronology.js +102 -0
- package/mission-control/scripts/import-pipeline-v2.js +523 -0
- package/mission-control/scripts/import-pipeline.js +295 -0
- package/mission-control/src/app/api/activity/live/route.ts +27 -0
- package/mission-control/src/app/api/activity/route.ts +47 -0
- package/mission-control/src/app/api/burndown/route.ts +112 -0
- package/mission-control/src/app/api/critical-path/route.ts +159 -0
- package/mission-control/src/app/api/dependencies/route.ts +176 -0
- package/mission-control/src/app/api/memory/categories/route.ts +93 -0
- package/mission-control/src/app/api/memory/consolidate/route.ts +107 -0
- package/mission-control/src/app/api/memory/doc/route.ts +89 -0
- package/mission-control/src/app/api/memory/flush/route.ts +129 -0
- package/mission-control/src/app/api/memory/graph/route.ts +105 -0
- package/mission-control/src/app/api/memory/items/route.ts +86 -0
- package/mission-control/src/app/api/memory/list/route.ts +48 -0
- package/mission-control/src/app/api/memory/retrieve/route.ts +51 -0
- package/mission-control/src/app/api/memory/search/route.ts +143 -0
- package/mission-control/src/app/api/memory/sync/route.ts +23 -0
- package/mission-control/src/app/api/memory/wikilinks/route.ts +75 -0
- package/mission-control/src/app/api/mesh/events/route.ts +67 -0
- package/mission-control/src/app/api/mesh/nodes/route.ts +221 -0
- package/mission-control/src/app/api/mesh/tokens/route.ts +133 -0
- package/mission-control/src/app/api/projects/route.ts +102 -0
- package/mission-control/src/app/api/resolve-path/route.ts +92 -0
- package/mission-control/src/app/api/scheduler/tick/route.ts +38 -0
- package/mission-control/src/app/api/scheduler/waves/route.ts +54 -0
- package/mission-control/src/app/api/screenshot/route.ts +127 -0
- package/mission-control/src/app/api/settings/gateway/route.ts +92 -0
- package/mission-control/src/app/api/skills/[id]/health/route.ts +57 -0
- package/mission-control/src/app/api/skills/list/route.ts +41 -0
- package/mission-control/src/app/api/souls/[id]/evolution/route.ts +253 -0
- package/mission-control/src/app/api/souls/[id]/prompt/route.ts +205 -0
- package/mission-control/src/app/api/souls/[id]/propagate/route.ts +146 -0
- package/mission-control/src/app/api/souls/route.ts +174 -0
- package/mission-control/src/app/api/tasks/[id]/handoff/route.ts +115 -0
- package/mission-control/src/app/api/tasks/[id]/route.ts +266 -0
- package/mission-control/src/app/api/tasks/[id]/tree/route.ts +94 -0
- package/mission-control/src/app/api/tasks/route.ts +253 -0
- package/mission-control/src/app/api/tts/route.ts +47 -0
- package/mission-control/src/app/api/workspace/files/route.ts +88 -0
- package/mission-control/src/app/api/workspace/read/route.ts +73 -0
- package/mission-control/src/app/burndown/page.tsx +309 -0
- package/mission-control/src/app/calendar/page.tsx +839 -0
- package/mission-control/src/app/favicon.ico +0 -0
- package/mission-control/src/app/globals.css +67 -0
- package/mission-control/src/app/graph/page.tsx +352 -0
- package/mission-control/src/app/layout.tsx +35 -0
- package/mission-control/src/app/live/page.tsx +232 -0
- package/mission-control/src/app/memory/page.tsx +154 -0
- package/mission-control/src/app/mesh/page.tsx +457 -0
- package/mission-control/src/app/obsidian/page.tsx +252 -0
- package/mission-control/src/app/page.tsx +70 -0
- package/mission-control/src/app/roadmap/page.tsx +1757 -0
- package/mission-control/src/app/settings/page.tsx +260 -0
- package/mission-control/src/app/souls/page.tsx +573 -0
- package/mission-control/src/components/board/activity-timeline.tsx +96 -0
- package/mission-control/src/components/board/daily-board.tsx +373 -0
- package/mission-control/src/components/board/kanban-board.tsx +364 -0
- package/mission-control/src/components/board/kanban-column.tsx +105 -0
- package/mission-control/src/components/board/live-stream.tsx +116 -0
- package/mission-control/src/components/board/skill-health-card.tsx +128 -0
- package/mission-control/src/components/board/status-banner.tsx +124 -0
- package/mission-control/src/components/board/task-card.tsx +454 -0
- package/mission-control/src/components/board/unified-task-dialog.tsx +1043 -0
- package/mission-control/src/components/layout/resizable-layout.tsx +68 -0
- package/mission-control/src/components/layout/sidebar.tsx +90 -0
- package/mission-control/src/components/live/audio-spectrum.tsx +106 -0
- package/mission-control/src/components/live/chat-bubble.tsx +52 -0
- package/mission-control/src/components/live/chat-input.tsx +92 -0
- package/mission-control/src/components/memory/doc-reader.tsx +172 -0
- package/mission-control/src/components/memory/memory-list.tsx +169 -0
- package/mission-control/src/components/memory/search-bar.tsx +67 -0
- package/mission-control/src/components/memory/search-results.tsx +149 -0
- package/mission-control/src/components/obsidian/backlinks-panel.tsx +52 -0
- package/mission-control/src/components/obsidian/file-tree.tsx +186 -0
- package/mission-control/src/components/obsidian/local-graph.tsx +107 -0
- package/mission-control/src/components/obsidian/obsidian-graph.tsx +192 -0
- package/mission-control/src/components/obsidian/obsidian-reader.tsx +246 -0
- package/mission-control/src/lib/activity.ts +29 -0
- package/mission-control/src/lib/config.ts +21 -0
- package/mission-control/src/lib/db/index.ts +429 -0
- package/mission-control/src/lib/db/schema.ts +218 -0
- package/mission-control/src/lib/gateway-notify.ts +113 -0
- package/mission-control/src/lib/hooks.ts +536 -0
- package/mission-control/src/lib/memory/categories.ts +125 -0
- package/mission-control/src/lib/memory/entities.ts +482 -0
- package/mission-control/src/lib/memory/extract.ts +369 -0
- package/mission-control/src/lib/memory/retrieval.ts +281 -0
- package/mission-control/src/lib/memory/wikilinks.ts +147 -0
- package/mission-control/src/lib/nats.ts +126 -0
- package/mission-control/src/lib/parsers/clawvault-doc.ts +98 -0
- package/mission-control/src/lib/parsers/daily-log.ts +73 -0
- package/mission-control/src/lib/parsers/memory-md.ts +81 -0
- package/mission-control/src/lib/parsers/task-markdown.ts +459 -0
- package/mission-control/src/lib/parsers/transcript.ts +209 -0
- package/mission-control/src/lib/scheduler.ts +394 -0
- package/mission-control/src/lib/speech/use-speech-pipeline.ts +176 -0
- package/mission-control/src/lib/sync/memory.ts +224 -0
- package/mission-control/src/lib/sync/tasks.ts +271 -0
- package/mission-control/src/lib/tts/edge.ts +31 -0
- package/mission-control/src/lib/tts/google.ts +78 -0
- package/mission-control/src/lib/tts/index.ts +39 -0
- package/mission-control/src/lib/tts/types.ts +18 -0
- package/mission-control/tsconfig.json +42 -0
- package/obsidian-vault/.obsidian/app.json +10 -0
- package/obsidian-vault/.obsidian/community-plugins.json +8 -0
- package/obsidian-vault/.obsidian/graph.json +40 -0
- package/obsidian-vault/.obsidian/plugins/obsidian-local-rest-api/main.js +58769 -0
- package/obsidian-vault/.obsidian/plugins/obsidian-local-rest-api/manifest.json +10 -0
- package/obsidian-vault/.obsidian/plugins/obsidian-local-rest-api/styles.css +47 -0
- package/obsidian-vault/00-meta/.gitkeep +0 -0
- package/obsidian-vault/01-architecture/.gitkeep +0 -0
- package/obsidian-vault/02-smart-contracts/.gitkeep +0 -0
- package/obsidian-vault/03-backend/.gitkeep +0 -0
- package/obsidian-vault/04-mobile/.gitkeep +0 -0
- package/obsidian-vault/05-ar-mapping/.gitkeep +0 -0
- package/obsidian-vault/06-3d-assets/.gitkeep +0 -0
- package/obsidian-vault/07-sound-music/.gitkeep +0 -0
- package/obsidian-vault/08-lore/.gitkeep +0 -0
- package/obsidian-vault/09-quests-playthrough/.gitkeep +0 -0
- package/obsidian-vault/10-economy/.gitkeep +0 -0
- package/obsidian-vault/11-nft-assets/.gitkeep +0 -0
- package/obsidian-vault/12-nft-mechanics/.gitkeep +0 -0
- package/obsidian-vault/13-dao-guild-social/.gitkeep +0 -0
- package/obsidian-vault/14-game-progression/.gitkeep +0 -0
- package/obsidian-vault/15-analytics/.gitkeep +0 -0
- package/obsidian-vault/16-security/.gitkeep +0 -0
- package/obsidian-vault/17-devops/.gitkeep +0 -0
- package/obsidian-vault/18-marketplace/.gitkeep +0 -0
- package/obsidian-vault/19-decisions/.gitkeep +0 -0
- package/obsidian-vault/20-business-strategy/.gitkeep +0 -0
- package/obsidian-vault/21-legal-regulatory/.gitkeep +0 -0
- package/obsidian-vault/nodes/.gitkeep +0 -0
- package/openclaw.env.example +17 -0
- package/package.json +45 -0
- package/services/launchd/ai.openclaw.gateway.plist +59 -0
- package/services/launchd/ai.openclaw.lane-watchdog.plist +32 -0
- package/services/launchd/ai.openclaw.log-rotate.plist +28 -0
- package/services/launchd/ai.openclaw.memory-daemon.plist +36 -0
- package/services/launchd/ai.openclaw.mesh-agent.plist +38 -0
- package/services/launchd/ai.openclaw.mesh-bridge.plist +36 -0
- package/services/launchd/ai.openclaw.mesh-deploy-listener.plist +33 -0
- package/services/launchd/ai.openclaw.mesh-health-publisher.plist +29 -0
- package/services/launchd/ai.openclaw.mesh-task-daemon.plist +36 -0
- package/services/launchd/ai.openclaw.mesh-tool-discord.plist +36 -0
- package/services/launchd/ai.openclaw.mission-control.plist +41 -0
- package/services/service-manifest.json +13 -0
- package/services/systemd/openclaw-gateway.service +21 -0
- package/services/systemd/openclaw-lane-watchdog.service +21 -0
- package/services/systemd/openclaw-log-rotate.service +13 -0
- package/services/systemd/openclaw-log-rotate.timer +9 -0
- package/services/systemd/openclaw-memory-daemon.service +21 -0
- package/services/systemd/openclaw-mesh-agent.service +19 -0
- package/services/systemd/openclaw-mesh-bridge.service +21 -0
- package/services/systemd/openclaw-mesh-deploy-listener.service +23 -0
- package/services/systemd/openclaw-mesh-health-publisher.service +21 -0
- package/services/systemd/openclaw-mesh-task-daemon.service +21 -0
- package/services/systemd/openclaw-mesh-tool-discord.service +21 -0
- package/services/systemd/openclaw-mission-control.service +22 -0
- package/skills/1password/.clawhub/origin.json +7 -0
- package/skills/1password/SKILL.md +63 -0
- package/skills/1password/references/cli-examples.md +29 -0
- package/skills/1password/references/get-started.md +17 -0
- package/skills/acquisition-channel-advisor/SKILL.md +643 -0
- package/skills/acquisition-channel-advisor/examples/conversation-flow.md +531 -0
- package/skills/agent-browser/.clawhub/origin.json +7 -0
- package/skills/agent-browser/CONTRIBUTING.md +63 -0
- package/skills/agent-browser/SKILL.md +338 -0
- package/skills/agentic-compass/.clawhub/origin.json +7 -0
- package/skills/agentic-compass/README.md +96 -0
- package/skills/agentic-compass/SKILL.md +112 -0
- package/skills/agentic-compass/references/README.md +5 -0
- package/skills/agentic-compass/scripts/agentic-compass.py +196 -0
- package/skills/arcane-dev-ops/SKILL.md +61 -0
- package/skills/arcane-dev-ops/references/checklist.md +22 -0
- package/skills/arcane-dev-ops/references/validation-cases.md +11 -0
- package/skills/arcane-dev-ops/scripts/prepush_check.sh +41 -0
- package/skills/auto-updater/.clawhub/origin.json +7 -0
- package/skills/auto-updater/SKILL.md +158 -0
- package/skills/auto-updater/references/agent-guide.md +152 -0
- package/skills/auto-updater/references/summary-examples.md +109 -0
- package/skills/business-health-diagnostic/SKILL.md +782 -0
- package/skills/byterover/.clawhub/origin.json +7 -0
- package/skills/byterover/SKILL.md +105 -0
- package/skills/byterover/TROUBLESHOOTING.md +50 -0
- package/skills/byterover/WORKFLOWS.md +229 -0
- package/skills/capability-evolver/.clawhub/origin.json +7 -0
- package/skills/capability-evolver/CONTRIBUTING.md +11 -0
- package/skills/capability-evolver/README.md +157 -0
- package/skills/capability-evolver/README.zh-CN.md +112 -0
- package/skills/capability-evolver/SKILL.md +93 -0
- package/skills/capability-evolver/assets/gep/capsules.json +5 -0
- package/skills/capability-evolver/assets/gep/genes.json +104 -0
- package/skills/capability-evolver/index.js +59 -0
- package/skills/capability-evolver/package.json +22 -0
- package/skills/capability-evolver/scripts/analyze_by_skill.js +121 -0
- package/skills/capability-evolver/scripts/build_public.js +350 -0
- package/skills/capability-evolver/scripts/export_history.js +98 -0
- package/skills/capability-evolver/scripts/extract_log.js +85 -0
- package/skills/capability-evolver/scripts/generate_history.js +75 -0
- package/skills/capability-evolver/scripts/human_report.js +147 -0
- package/skills/capability-evolver/scripts/publish_public.js +516 -0
- package/skills/capability-evolver/scripts/suggest_version.js +89 -0
- package/skills/capability-evolver/src/evolve.js +594 -0
- package/skills/capability-evolver/src/gep/assetStore.js +204 -0
- package/skills/capability-evolver/src/gep/candidates.js +134 -0
- package/skills/capability-evolver/src/gep/paths.js +23 -0
- package/skills/capability-evolver/src/gep/prompt.js +254 -0
- package/skills/capability-evolver/src/gep/selector.js +89 -0
- package/skills/capability-evolver/src/gep/signals.js +27 -0
- package/skills/cc-godmode/.clawhub/origin.json +7 -0
- package/skills/cc-godmode/CHANGELOG.md +66 -0
- package/skills/cc-godmode/README.md +293 -0
- package/skills/cc-godmode/SKILL.md +242 -0
- package/skills/cc-godmode/docs/AGENTS.md +332 -0
- package/skills/cc-godmode/docs/MIGRATION.md +206 -0
- package/skills/cc-godmode/docs/TROUBLESHOOTING.md +357 -0
- package/skills/cc-godmode/docs/WORKFLOWS.md +329 -0
- package/skills/cc-godmode/references/agents.md +433 -0
- package/skills/cc-godmode/scripts/build-skill.js +232 -0
- package/skills/clawdbot-filesystem/.clawhub/origin.json +7 -0
- package/skills/clawdbot-filesystem/LICENSE.md +21 -0
- package/skills/clawdbot-filesystem/README.md +322 -0
- package/skills/clawdbot-filesystem/SKILL.md +219 -0
- package/skills/clawdbot-filesystem/config.json +41 -0
- package/skills/clawdbot-filesystem/package.json +69 -0
- package/skills/clawdbot-security-check/.clawhub/origin.json +7 -0
- package/skills/clawdbot-security-check/README.md +168 -0
- package/skills/clawdbot-security-check/SKILL.md +145 -0
- package/skills/clawdbot-security-check/references/audit-checks.md +521 -0
- package/skills/clawdbot-security-check/skill.json +42 -0
- package/skills/clawddocs/.clawhub/origin.json +7 -0
- package/skills/clawddocs/SKILL.md +176 -0
- package/skills/clawddocs/package.json +9 -0
- package/skills/clawddocs/scripts/build-index.sh +17 -0
- package/skills/clawddocs/scripts/cache.sh +13 -0
- package/skills/clawddocs/scripts/fetch-doc.sh +7 -0
- package/skills/clawddocs/scripts/recent.sh +5 -0
- package/skills/clawddocs/scripts/search.sh +8 -0
- package/skills/clawddocs/scripts/sitemap.sh +23 -0
- package/skills/clawddocs/scripts/track-changes.sh +16 -0
- package/skills/clawddocs/snippets/common-configs.md +69 -0
- package/skills/clawguard/.clawhub/origin.json +7 -0
- package/skills/clawguard/SKILL.md +137 -0
- package/skills/company-research/SKILL.md +393 -0
- package/skills/company-research/examples/sample.md +164 -0
- package/skills/company-research/template.md +60 -0
- package/skills/crypto-price/.clawhub/origin.json +7 -0
- package/skills/crypto-price/ARCHITECTURE.md +437 -0
- package/skills/crypto-price/README.md +194 -0
- package/skills/crypto-price/SKILL.md +61 -0
- package/skills/crypto-price/requirements.txt +1 -0
- package/skills/crypto-price/scripts/get_price_chart.py +988 -0
- package/skills/customer-journey-map/SKILL.md +343 -0
- package/skills/customer-journey-map/examples/sample.md +33 -0
- package/skills/customer-journey-map/template.md +28 -0
- package/skills/customer-journey-mapping-workshop/SKILL.md +522 -0
- package/skills/deep-research/.clawhub/origin.json +7 -0
- package/skills/deep-research/SKILL.md +93 -0
- package/skills/deep-research/rules/logic.md +32 -0
- package/skills/discord-telegram-triage/SKILL.md +59 -0
- package/skills/discord-telegram-triage/references/discord-runbook.md +28 -0
- package/skills/discord-telegram-triage/references/validation-cases.md +11 -0
- package/skills/discord-telegram-triage/scripts/triage_snapshot.sh +23 -0
- package/skills/discovery-interview-prep/SKILL.md +408 -0
- package/skills/discovery-process/SKILL.md +503 -0
- package/skills/discovery-process/examples/sample.md +60 -0
- package/skills/discovery-process/template.md +39 -0
- package/skills/dist/arcane-dev-ops.skill +0 -0
- package/skills/dist/discord-telegram-triage.skill +0 -0
- package/skills/dist/founder-brief-summarizer.skill +0 -0
- package/skills/epic-breakdown-advisor/SKILL.md +664 -0
- package/skills/epic-hypothesis/SKILL.md +285 -0
- package/skills/epic-hypothesis/examples/sample.md +104 -0
- package/skills/epic-hypothesis/template.md +30 -0
- package/skills/excel/.clawhub/origin.json +7 -0
- package/skills/excel/SKILL.md +332 -0
- package/skills/excel/scripts/excel.py +1120 -0
- package/skills/fast-browser-use/.clawhub/origin.json +7 -0
- package/skills/fast-browser-use/CODEBUDDY.md +142 -0
- package/skills/fast-browser-use/Cargo.toml +77 -0
- package/skills/fast-browser-use/README.md +62 -0
- package/skills/fast-browser-use/SKILL.md +217 -0
- package/skills/fast-browser-use/package-lock.json +28 -0
- package/skills/fast-browser-use/package.json +8 -0
- package/skills/fast-browser-use/rustfmt.toml +10 -0
- package/skills/fast-browser-use/src/bin/cli.rs +373 -0
- package/skills/fast-browser-use/src/bin/mcp_server.rs +203 -0
- package/skills/fast-browser-use/src/browser/config.rs +136 -0
- package/skills/fast-browser-use/src/browser/debug.rs +16 -0
- package/skills/fast-browser-use/src/browser/mod.rs +61 -0
- package/skills/fast-browser-use/src/browser/session.rs +478 -0
- package/skills/fast-browser-use/src/dom/element.rs +442 -0
- package/skills/fast-browser-use/src/dom/extract_dom.js +849 -0
- package/skills/fast-browser-use/src/dom/mod.rs +14 -0
- package/skills/fast-browser-use/src/dom/tree.rs +296 -0
- package/skills/fast-browser-use/src/dom/yaml.rs +149 -0
- package/skills/fast-browser-use/src/error.rs +115 -0
- package/skills/fast-browser-use/src/lib.rs +17 -0
- package/skills/fast-browser-use/src/mcp/handler.rs +63 -0
- package/skills/fast-browser-use/src/mcp/mod.rs +81 -0
- package/skills/fast-browser-use/src/tools/Readability.min.js +1480 -0
- package/skills/fast-browser-use/src/tools/annotate.rs +165 -0
- package/skills/fast-browser-use/src/tools/click.rs +84 -0
- package/skills/fast-browser-use/src/tools/close.rs +35 -0
- package/skills/fast-browser-use/src/tools/close_tab.rs +45 -0
- package/skills/fast-browser-use/src/tools/convert_to_markdown.js +117 -0
- package/skills/fast-browser-use/src/tools/cookies.rs +58 -0
- package/skills/fast-browser-use/src/tools/debug.rs +44 -0
- package/skills/fast-browser-use/src/tools/evaluate.rs +40 -0
- package/skills/fast-browser-use/src/tools/extract.rs +66 -0
- package/skills/fast-browser-use/src/tools/go_back.rs +35 -0
- package/skills/fast-browser-use/src/tools/go_forward.rs +35 -0
- package/skills/fast-browser-use/src/tools/hover.js +33 -0
- package/skills/fast-browser-use/src/tools/hover.rs +97 -0
- package/skills/fast-browser-use/src/tools/html_to_markdown.rs +99 -0
- package/skills/fast-browser-use/src/tools/input.rs +93 -0
- package/skills/fast-browser-use/src/tools/local_storage.rs +159 -0
- package/skills/fast-browser-use/src/tools/markdown.rs +181 -0
- package/skills/fast-browser-use/src/tools/mod.rs +326 -0
- package/skills/fast-browser-use/src/tools/navigate.rs +55 -0
- package/skills/fast-browser-use/src/tools/new_tab.rs +60 -0
- package/skills/fast-browser-use/src/tools/press_key.rs +78 -0
- package/skills/fast-browser-use/src/tools/read_links.rs +59 -0
- package/skills/fast-browser-use/src/tools/readability_script.rs +8 -0
- package/skills/fast-browser-use/src/tools/screenshot.rs +47 -0
- package/skills/fast-browser-use/src/tools/scroll.js +22 -0
- package/skills/fast-browser-use/src/tools/scroll.rs +95 -0
- package/skills/fast-browser-use/src/tools/select.js +23 -0
- package/skills/fast-browser-use/src/tools/select.rs +129 -0
- package/skills/fast-browser-use/src/tools/sitemap.rs +426 -0
- package/skills/fast-browser-use/src/tools/snapshot.rs +324 -0
- package/skills/fast-browser-use/src/tools/switch_tab.rs +69 -0
- package/skills/fast-browser-use/src/tools/tab_list.rs +76 -0
- package/skills/fast-browser-use/src/tools/utils.rs +92 -0
- package/skills/fast-browser-use/src/tools/wait.rs +53 -0
- package/skills/fast-browser-use/test_auth.json +3 -0
- package/skills/fast-browser-use/test_state.json +6 -0
- package/skills/fast-browser-use/tests/browser_tools_integration.rs +233 -0
- package/skills/fast-browser-use/tests/cli_recipes_integration.rs +112 -0
- package/skills/fast-browser-use/tests/cookies_integration.rs +56 -0
- package/skills/fast-browser-use/tests/debug_integration.rs +83 -0
- package/skills/fast-browser-use/tests/dom_integration.rs +170 -0
- package/skills/fast-browser-use/tests/local_storage_integration.rs +75 -0
- package/skills/fast-browser-use/tests/markdown_integration.rs +448 -0
- package/skills/fast-browser-use/tests/navigation_integration.rs +241 -0
- package/skills/fast-browser-use/tests/sitemap_integration.rs +326 -0
- package/skills/fast-browser-use/tests/tab_management_integration.rs +300 -0
- package/skills/feature-investment-advisor/SKILL.md +639 -0
- package/skills/feature-investment-advisor/examples/conversation-flow.md +538 -0
- package/skills/finance-based-pricing-advisor/SKILL.md +763 -0
- package/skills/finance-metrics-quickref/SKILL.md +309 -0
- package/skills/find-skills/.clawhub/origin.json +7 -0
- package/skills/find-skills/SKILL.md +143 -0
- package/skills/flavor-text-writer/SKILL.md +27 -0
- package/skills/founder-brief-summarizer/SKILL.md +52 -0
- package/skills/founder-brief-summarizer/references/response-templates.md +15 -0
- package/skills/founder-brief-summarizer/references/validation-cases.md +11 -0
- package/skills/founder-brief-summarizer/scripts/brief_template.sh +28 -0
- package/skills/frontend-design/.clawhub/origin.json +7 -0
- package/skills/frontend-design/LICENSE.txt +190 -0
- package/skills/frontend-design/SKILL.md +53 -0
- package/skills/gemini/.clawhub/origin.json +7 -0
- package/skills/gemini/SKILL.md +33 -0
- package/skills/gemini-deep-research/.clawhub/origin.json +7 -0
- package/skills/gemini-deep-research/SKILL.md +78 -0
- package/skills/gemini-deep-research/scripts/deep_research.py +176 -0
- package/skills/git-essentials/.clawhub/origin.json +7 -0
- package/skills/git-essentials/SKILL.md +239 -0
- package/skills/git-essentials/references/advanced.md +211 -0
- package/skills/github/.clawhub/origin.json +7 -0
- package/skills/github/SKILL.md +57 -0
- package/skills/google-drive/.clawhub/origin.json +7 -0
- package/skills/google-drive/LICENSE.txt +21 -0
- package/skills/google-drive/SKILL.md +320 -0
- package/skills/growth-loop/SKILL.md +270 -0
- package/skills/growth-loop/_meta.json +9 -0
- package/skills/growth-loop/references/diagnosis-framework.md +84 -0
- package/skills/growth-loop/references/platform-benchmarks.md +79 -0
- package/skills/growth-loop/scripts/init-campaign.sh +274 -0
- package/skills/humanize-ai-text/.clawhub/origin.json +7 -0
- package/skills/humanize-ai-text/SKILL.md +192 -0
- package/skills/humanize-ai-text/scripts/compare.py +58 -0
- package/skills/humanize-ai-text/scripts/detect.py +160 -0
- package/skills/humanize-ai-text/scripts/patterns.json +191 -0
- package/skills/humanize-ai-text/scripts/transform.py +127 -0
- package/skills/humanizer/.clawhub/origin.json +7 -0
- package/skills/humanizer/README.md +82 -0
- package/skills/humanizer/SKILL.md +443 -0
- package/skills/jobs-to-be-done/SKILL.md +378 -0
- package/skills/jobs-to-be-done/examples/sample.md +80 -0
- package/skills/jobs-to-be-done/template.md +65 -0
- package/skills/lean-ux-canvas/SKILL.md +561 -0
- package/skills/lean-ux-canvas/examples/sample.md +88 -0
- package/skills/lean-ux-canvas/template.md +32 -0
- package/skills/markdown-formatter/.clawhub/origin.json +7 -0
- package/skills/markdown-formatter/README.md +137 -0
- package/skills/markdown-formatter/SKILL.md +369 -0
- package/skills/markdown-formatter/config.json +20 -0
- package/skills/markdown-formatter/index.js +439 -0
- package/skills/markdown-formatter/package.json +23 -0
- package/skills/markdown-formatter/test.js +23 -0
- package/skills/marketing-mode/.clawhub/origin.json +7 -0
- package/skills/marketing-mode/README.md +49 -0
- package/skills/marketing-mode/SKILL.md +703 -0
- package/skills/marketing-mode/mode-prompt.md +39 -0
- package/skills/marketing-mode/skill.json +51 -0
- package/skills/memory-hygiene/.clawhub/origin.json +7 -0
- package/skills/memory-hygiene/SKILL.md +91 -0
- package/skills/memory-setup/.clawhub/origin.json +7 -0
- package/skills/memory-setup/SKILL.md +180 -0
- package/skills/memorylayer/.clawhub/origin.json +7 -0
- package/skills/memorylayer/README.md +197 -0
- package/skills/memorylayer/SKILL.md +227 -0
- package/skills/memorylayer/examples/agent-integration.js +145 -0
- package/skills/memorylayer/examples/basic-usage.js +87 -0
- package/skills/memorylayer/examples/token-savings-demo.js +183 -0
- package/skills/memorylayer/index.js +115 -0
- package/skills/memorylayer/package-lock.json +295 -0
- package/skills/memorylayer/package.json +27 -0
- package/skills/memorylayer/python/memorylayer_skill.py +230 -0
- package/skills/memorylayer/python/requirements.txt +7 -0
- package/skills/mesh/SKILL.md +184 -0
- package/skills/model-usage/.clawhub/origin.json +7 -0
- package/skills/model-usage/SKILL.md +54 -0
- package/skills/model-usage/references/codexbar-cli.md +28 -0
- package/skills/model-usage/scripts/model_usage.py +310 -0
- package/skills/moltbook-interact/.clawhub/origin.json +7 -0
- package/skills/moltbook-interact/INSTALL.md +139 -0
- package/skills/moltbook-interact/README.md +198 -0
- package/skills/moltbook-interact/SKILL.md +72 -0
- package/skills/moltbook-interact/references/api.md +106 -0
- package/skills/moltbook-interact/scripts/moltbook.sh +142 -0
- package/skills/moltbook-registry/.clawhub/origin.json +7 -0
- package/skills/moltbook-registry/README.md +26 -0
- package/skills/moltbook-registry/SKILL.md +82 -0
- package/skills/moltbook-registry/index.js +180 -0
- package/skills/moltbook-registry/package.json +11 -0
- package/skills/mythril-scanner/SKILL.md +27 -0
- package/skills/n8n/.clawhub/origin.json +7 -0
- package/skills/n8n/SKILL.md +141 -0
- package/skills/n8n/references/api.md +156 -0
- package/skills/n8n/scripts/n8n_api.py +158 -0
- package/skills/n8n-workflow-automation/.clawhub/origin.json +7 -0
- package/skills/n8n-workflow-automation/SKILL.md +103 -0
- package/skills/n8n-workflow-automation/assets/runbook-template.md +32 -0
- package/skills/narrative-designer/SKILL.md +27 -0
- package/skills/ontology/.clawhub/origin.json +7 -0
- package/skills/ontology/SKILL.md +236 -0
- package/skills/ontology/references/queries.md +211 -0
- package/skills/ontology/references/schema.md +322 -0
- package/skills/ontology/scripts/ontology.py +374 -0
- package/skills/openai-image-gen/.clawhub/origin.json +7 -0
- package/skills/openai-image-gen/SKILL.md +45 -0
- package/skills/openai-image-gen/scripts/gen.py +227 -0
- package/skills/openclaw-agent-optimize/.clawhub/origin.json +7 -0
- package/skills/openclaw-agent-optimize/SKILL.md +33 -0
- package/skills/openclaw-agent-optimize/references/agent-orchestration.md +20 -0
- package/skills/openclaw-agent-optimize/references/context-management.md +15 -0
- package/skills/openclaw-agent-optimize/references/continuous-learning.md +14 -0
- package/skills/openclaw-agent-optimize/references/cron-optimization.md +16 -0
- package/skills/openclaw-agent-optimize/references/memory-patterns.md +14 -0
- package/skills/openclaw-agent-optimize/references/model-selection.md +18 -0
- package/skills/openclaw-skill-scanner/.clawhub/origin.json +7 -0
- package/skills/openclaw-skill-scanner/SKILL.md +88 -0
- package/skills/openclaw-skill-scanner/install-hook.sh +294 -0
- package/skills/openclaw-skill-scanner/report-template.md +53 -0
- package/skills/openclaw-skill-scanner/scanner.py +929 -0
- package/skills/openclaw-skill-scanner/whitelist.json +18 -0
- package/skills/opportunity-solution-tree/SKILL.md +428 -0
- package/skills/opportunity-solution-tree/examples/sample.md +104 -0
- package/skills/opportunity-solution-tree/template.md +33 -0
- package/skills/pdf/.clawhub/origin.json +7 -0
- package/skills/pdf/SKILL.md +304 -0
- package/skills/pestel-analysis/SKILL.md +384 -0
- package/skills/pestel-analysis/examples/sample.md +143 -0
- package/skills/pestel-analysis/template.md +53 -0
- package/skills/pol-probe/SKILL.md +217 -0
- package/skills/pol-probe/examples/sample.md +136 -0
- package/skills/pol-probe/template.md +59 -0
- package/skills/pol-probe-advisor/SKILL.md +492 -0
- package/skills/positioning-statement/SKILL.md +229 -0
- package/skills/positioning-statement/examples/sample.md +51 -0
- package/skills/positioning-statement/template.md +25 -0
- package/skills/positioning-workshop/SKILL.md +424 -0
- package/skills/prd-development/SKILL.md +654 -0
- package/skills/prd-development/examples/sample.md +43 -0
- package/skills/prd-development/template.md +55 -0
- package/skills/press-release/SKILL.md +277 -0
- package/skills/press-release/examples/sample.md +73 -0
- package/skills/press-release/template.md +39 -0
- package/skills/prioritization-advisor/SKILL.md +451 -0
- package/skills/proactive-messages/.clawhub/origin.json +7 -0
- package/skills/proactive-messages/SKILL.md +91 -0
- package/skills/problem-framing-canvas/SKILL.md +466 -0
- package/skills/problem-framing-canvas/examples/sample.md +58 -0
- package/skills/problem-framing-canvas/template.md +22 -0
- package/skills/problem-statement/SKILL.md +255 -0
- package/skills/problem-statement/examples/sample.md +82 -0
- package/skills/problem-statement/template.md +37 -0
- package/skills/product-strategy-session/SKILL.md +434 -0
- package/skills/product-strategy-session/examples/sample.md +67 -0
- package/skills/product-strategy-session/template.md +38 -0
- package/skills/prompt-guard/.clawhub/origin.json +7 -0
- package/skills/prompt-guard/ARCHITECTURE.md +364 -0
- package/skills/prompt-guard/CHANGELOG.md +200 -0
- package/skills/prompt-guard/README.md +215 -0
- package/skills/prompt-guard/SECURITY.md +66 -0
- package/skills/prompt-guard/SKILL.md +174 -0
- package/skills/prompt-guard/blog/how-i-secured-my-ai-agent.md +185 -0
- package/skills/prompt-guard/config.example.yaml +56 -0
- package/skills/prompt-guard/references/detection-patterns.md +298 -0
- package/skills/prompt-guard/requirements.txt +1 -0
- package/skills/prompt-guard/scripts/analyze_log.py +224 -0
- package/skills/prompt-guard/scripts/audit.py +344 -0
- package/skills/prompt-guard/scripts/detect.py +1587 -0
- package/skills/prompt-guard/scripts/hivefence.py +345 -0
- package/skills/proto-persona/SKILL.md +336 -0
- package/skills/proto-persona/examples/sample.md +97 -0
- package/skills/proto-persona/template.md +45 -0
- package/skills/recommendation-canvas/SKILL.md +382 -0
- package/skills/recommendation-canvas/examples/sample.md +94 -0
- package/skills/recommendation-canvas/template.md +86 -0
- package/skills/refactor-suggest/.clawhub/origin.json +7 -0
- package/skills/refactor-suggest/SKILL.md +94 -0
- package/skills/roadmap-planning/SKILL.md +506 -0
- package/skills/roadmap-planning/examples/sample.md +62 -0
- package/skills/roadmap-planning/template.md +30 -0
- package/skills/saas-economics-efficiency-metrics/SKILL.md +694 -0
- package/skills/saas-economics-efficiency-metrics/examples/cash-trap.md +365 -0
- package/skills/saas-economics-efficiency-metrics/examples/healthy-unit-economics.md +279 -0
- package/skills/saas-economics-efficiency-metrics/template.md +263 -0
- package/skills/saas-revenue-growth-metrics/SKILL.md +629 -0
- package/skills/saas-revenue-growth-metrics/examples/healthy-saas.md +131 -0
- package/skills/saas-revenue-growth-metrics/examples/warning-signs.md +229 -0
- package/skills/saas-revenue-growth-metrics/template.md +192 -0
- package/skills/save-money/.clawhub/origin.json +7 -0
- package/skills/save-money/SKILL.md +173 -0
- package/skills/scripts/golden_skills_v3.sh +32 -0
- package/skills/search/.clawhub/origin.json +7 -0
- package/skills/search/SKILL.md +18 -0
- package/skills/search/skill.json +1 -0
- package/skills/second-brain/.clawhub/origin.json +7 -0
- package/skills/second-brain/SKILL.md +278 -0
- package/skills/second-brain/scripts/ensue-api.sh +37 -0
- package/skills/self-improving-agent/.clawhub/origin.json +7 -0
- package/skills/self-improving-agent/.learnings/ERRORS.md +5 -0
- package/skills/self-improving-agent/.learnings/FEATURE_REQUESTS.md +5 -0
- package/skills/self-improving-agent/.learnings/LEARNINGS.md +5 -0
- package/skills/self-improving-agent/SKILL.md +130 -0
- package/skills/self-improving-agent/assets/LEARNINGS.md +45 -0
- package/skills/self-improving-agent/assets/SKILL-TEMPLATE.md +177 -0
- package/skills/self-improving-agent/hooks/openclaw/HOOK.md +23 -0
- package/skills/self-improving-agent/hooks/openclaw/handler.js +56 -0
- package/skills/self-improving-agent/hooks/openclaw/handler.ts +62 -0
- package/skills/self-improving-agent/references/examples.md +374 -0
- package/skills/self-improving-agent/references/hooks-setup.md +223 -0
- package/skills/self-improving-agent/references/openclaw-integration.md +248 -0
- package/skills/self-improving-agent/references/templates.md +480 -0
- package/skills/self-improving-agent/scripts/activator.sh +20 -0
- package/skills/self-improving-agent/scripts/error-detector.sh +55 -0
- package/skills/self-improving-agent/scripts/extract-skill.sh +203 -0
- package/skills/self-improving-agent-1-0-2/.clawhub/origin.json +7 -0
- package/skills/self-improving-agent-1-0-2/SKILL.md +562 -0
- package/skills/self-improving-agent-1-0-2/assets/LEARNINGS.md +45 -0
- package/skills/self-improving-agent-1-0-2/assets/SKILL-TEMPLATE.md +182 -0
- package/skills/self-improving-agent-1-0-2/references/clawdbot-integration.md +311 -0
- package/skills/self-improving-agent-1-0-2/references/examples.md +374 -0
- package/skills/self-improving-agent-1-0-2/references/hooks-setup.md +223 -0
- package/skills/self-improving-agent-1-0-2/scripts/activator.sh +20 -0
- package/skills/self-improving-agent-1-0-2/scripts/error-detector.sh +55 -0
- package/skills/self-improving-agent-1-0-2/scripts/extract-skill.sh +203 -0
- package/skills/self-love-confidence/.clawhub/origin.json +7 -0
- package/skills/self-love-confidence/SKILL.md +79 -0
- package/skills/self-reflection/.clawhub/origin.json +7 -0
- package/skills/self-reflection/README.md +292 -0
- package/skills/self-reflection/SKILL.md +110 -0
- package/skills/self-reflection/self-reflection.example.json +6 -0
- package/skills/slither-analyzer/SKILL.md +27 -0
- package/skills/solidity-audit/SKILL.md +27 -0
- package/skills/soulcraft/.clawhub/origin.json +7 -0
- package/skills/soulcraft/README.md +123 -0
- package/skills/soulcraft/SKILL.md +340 -0
- package/skills/soulcraft/references/question-bank.md +154 -0
- package/skills/soulcraft/references/soul-examples.md +207 -0
- package/skills/soulcraft/research/RESEARCH_REPORT.md +317 -0
- package/skills/spotify-player/.clawhub/origin.json +7 -0
- package/skills/spotify-player/SKILL.md +44 -0
- package/skills/storyboard/SKILL.md +259 -0
- package/skills/storyboard/examples/sample.md +71 -0
- package/skills/storyboard/template.md +41 -0
- package/skills/summarize/.clawhub/origin.json +7 -0
- package/skills/summarize/SKILL.md +59 -0
- package/skills/superdesign/.clawhub/origin.json +7 -0
- package/skills/superdesign/SKILL.md +224 -0
- package/skills/tam-sam-som-calculator/SKILL.md +399 -0
- package/skills/tam-sam-som-calculator/examples/sample.md +142 -0
- package/skills/tam-sam-som-calculator/scripts/market-sizing.py +95 -0
- package/skills/tam-sam-som-calculator/template.md +35 -0
- package/skills/tavily-search/.clawhub/origin.json +7 -0
- package/skills/tavily-search/SKILL.md +49 -0
- package/skills/tavily-search/scripts/extract.mjs +59 -0
- package/skills/tavily-search/scripts/search.mjs +101 -0
- package/skills/twitter/SKILL.md +74 -0
- package/skills/twitter/_meta.json +9 -0
- package/skills/twitter/references/validation-cases.md +53 -0
- package/skills/twitter/scripts/twitter.sh +421 -0
- package/skills/ui-ux-pro-max/.clawhub/origin.json +7 -0
- package/skills/ui-ux-pro-max/SKILL.md +54 -0
- package/skills/ui-ux-pro-max/assets/data/charts.csv +26 -0
- package/skills/ui-ux-pro-max/assets/data/colors.csv +97 -0
- package/skills/ui-ux-pro-max/assets/data/icons.csv +101 -0
- package/skills/ui-ux-pro-max/assets/data/landing.csv +31 -0
- package/skills/ui-ux-pro-max/assets/data/products.csv +97 -0
- package/skills/ui-ux-pro-max/assets/data/react-performance.csv +45 -0
- package/skills/ui-ux-pro-max/assets/data/stacks/astro.csv +54 -0
- package/skills/ui-ux-pro-max/assets/data/stacks/flutter.csv +53 -0
- package/skills/ui-ux-pro-max/assets/data/stacks/html-tailwind.csv +56 -0
- package/skills/ui-ux-pro-max/assets/data/stacks/jetpack-compose.csv +53 -0
- package/skills/ui-ux-pro-max/assets/data/stacks/nextjs.csv +53 -0
- package/skills/ui-ux-pro-max/assets/data/stacks/nuxt-ui.csv +51 -0
- package/skills/ui-ux-pro-max/assets/data/stacks/nuxtjs.csv +59 -0
- package/skills/ui-ux-pro-max/assets/data/stacks/react-native.csv +52 -0
- package/skills/ui-ux-pro-max/assets/data/stacks/react.csv +54 -0
- package/skills/ui-ux-pro-max/assets/data/stacks/shadcn.csv +61 -0
- package/skills/ui-ux-pro-max/assets/data/stacks/svelte.csv +54 -0
- package/skills/ui-ux-pro-max/assets/data/stacks/swiftui.csv +51 -0
- package/skills/ui-ux-pro-max/assets/data/stacks/vue.csv +50 -0
- package/skills/ui-ux-pro-max/assets/data/styles.csv +68 -0
- package/skills/ui-ux-pro-max/assets/data/typography.csv +58 -0
- package/skills/ui-ux-pro-max/assets/data/ui-reasoning.csv +101 -0
- package/skills/ui-ux-pro-max/assets/data/ux-guidelines.csv +100 -0
- package/skills/ui-ux-pro-max/assets/data/web-interface.csv +31 -0
- package/skills/ui-ux-pro-max/references/upstream-README.md +488 -0
- package/skills/ui-ux-pro-max/references/upstream-skill-content.md +288 -0
- package/skills/ui-ux-pro-max/scripts/__init__.py +0 -0
- package/skills/ui-ux-pro-max/scripts/core.py +253 -0
- package/skills/ui-ux-pro-max/scripts/design_system.py +1071 -0
- package/skills/ui-ux-pro-max/scripts/search.py +111 -0
- package/skills/user-story/SKILL.md +272 -0
- package/skills/user-story/examples/sample.md +110 -0
- package/skills/user-story/scripts/user-story-template.py +65 -0
- package/skills/user-story/template.md +32 -0
- package/skills/user-story-mapping/SKILL.md +296 -0
- package/skills/user-story-mapping/examples/sample.md +77 -0
- package/skills/user-story-mapping/template.md +41 -0
- package/skills/user-story-mapping-workshop/SKILL.md +485 -0
- package/skills/user-story-mapping-workshop/template.md +28 -0
- package/skills/user-story-splitting/SKILL.md +313 -0
- package/skills/user-story-splitting/examples/sample.md +147 -0
- package/skills/user-story-splitting/template.md +37 -0
- package/skills/wacli/.clawhub/origin.json +7 -0
- package/skills/wacli/SKILL.md +53 -0
- package/skills/web-search/.clawhub/origin.json +7 -0
- package/skills/web-search/SKILL.md +151 -0
- package/skills/web-search/references/api-details.md +207 -0
- package/skills/web-search/scripts/search.py +576 -0
- package/skills/workshop-facilitation/SKILL.md +88 -0
- package/skills/world-builder/SKILL.md +27 -0
- package/souls/blockchain-auditor/PRINCIPLES.md +75 -0
- package/souls/blockchain-auditor/SOUL.md +56 -0
- package/souls/blockchain-auditor/capabilities.json +33 -0
- package/souls/blockchain-auditor/evolution/capsules.json +4 -0
- package/souls/blockchain-auditor/evolution/events.jsonl +1 -0
- package/souls/blockchain-auditor/evolution/genes.json +62 -0
- package/souls/daedalus/PRINCIPLES.md +78 -0
- package/souls/daedalus/SOUL.md +48 -0
- package/souls/daedalus/capabilities.json +46 -0
- package/souls/identity-architect/PRINCIPLES.md +83 -0
- package/souls/identity-architect/SOUL.md +66 -0
- package/souls/identity-architect/capabilities.json +38 -0
- package/souls/identity-architect/evolution/capsules.json +4 -0
- package/souls/identity-architect/evolution/events.jsonl +0 -0
- package/souls/identity-architect/evolution/genes.json +4 -0
- package/souls/infra-ops/PRINCIPLES.md +77 -0
- package/souls/infra-ops/SOUL.md +56 -0
- package/souls/infra-ops/capabilities.json +33 -0
- package/souls/infra-ops/evolution/capsules.json +4 -0
- package/souls/infra-ops/evolution/events.jsonl +0 -0
- package/souls/infra-ops/evolution/genes.json +4 -0
- package/souls/lore-writer/PRINCIPLES.md +74 -0
- package/souls/lore-writer/SOUL.md +54 -0
- package/souls/lore-writer/capabilities.json +37 -0
- package/souls/lore-writer/evolution/capsules.json +4 -0
- package/souls/lore-writer/evolution/events.jsonl +0 -0
- package/souls/lore-writer/evolution/genes.json +4 -0
- package/souls/qa-evidence/PRINCIPLES.md +97 -0
- package/souls/qa-evidence/SOUL.md +66 -0
- package/souls/qa-evidence/capabilities.json +32 -0
- package/souls/qa-evidence/evolution/capsules.json +4 -0
- package/souls/qa-evidence/evolution/events.jsonl +0 -0
- package/souls/qa-evidence/evolution/genes.json +4 -0
- package/souls/registry.json +211 -0
- package/souls/sync-registry.js +65 -0
- package/uninstall.sh +102 -0
- package/workspace-bin/auto-checkpoint +60 -0
- package/workspace-bin/clawvault-access-control +65 -0
- package/workspace-bin/clawvault-local +28 -0
- package/workspace-bin/compile-boot +494 -0
- package/workspace-bin/daily-log-writer.mjs +251 -0
- package/workspace-bin/evolve +540 -0
- package/workspace-bin/fitness_score.py +395 -0
- package/workspace-bin/hooks/pre-commit +80 -0
- package/workspace-bin/install-daemon +299 -0
- package/workspace-bin/lane-watchdog.js +232 -0
- package/workspace-bin/lib/__init__.py +0 -0
- package/workspace-bin/lib/frontmatter.py +114 -0
- package/workspace-bin/memory-daemon.mjs +879 -0
- package/workspace-bin/memory-maintenance.mjs +531 -0
- package/workspace-bin/mesh-bridge.mjs +154 -0
- package/workspace-bin/multi-review +130 -0
- package/workspace-bin/obsidian +125 -0
- package/workspace-bin/obsidian-sync.mjs +888 -0
- package/workspace-bin/openclaw-register-source +102 -0
- package/workspace-bin/proactive-scan +147 -0
- package/workspace-bin/quality-gate +175 -0
- package/workspace-bin/screenshot +96 -0
- package/workspace-bin/session-recap +453 -0
- package/workspace-bin/skill-audit +494 -0
- package/workspace-bin/skill-quality-check +134 -0
- package/workspace-bin/skill-routing-eval +599 -0
- package/workspace-bin/soul-prompt +251 -0
- package/workspace-bin/subagent-audit.mjs +267 -0
- package/workspace-bin/test-multi-soul-workflow +130 -0
- package/workspace-bin/trust-registry +465 -0
- package/workspace-docs/AGENTS.md +201 -0
- package/workspace-docs/CLAUDE.md +64 -0
- package/workspace-docs/PRINCIPLES.md +81 -0
- package/workspace-docs/SOUL.md +48 -0
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Ontology graph operations: create, query, relate, validate.
|
|
4
|
+
|
|
5
|
+
Usage:
|
|
6
|
+
python ontology.py create --type Person --props '{"name":"Alice"}'
|
|
7
|
+
python ontology.py get --id p_001
|
|
8
|
+
python ontology.py query --type Task --where '{"status":"open"}'
|
|
9
|
+
python ontology.py relate --from proj_001 --rel has_task --to task_001
|
|
10
|
+
python ontology.py related --id proj_001 --rel has_task
|
|
11
|
+
python ontology.py list --type Person
|
|
12
|
+
python ontology.py delete --id p_001
|
|
13
|
+
python ontology.py validate
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
import argparse
|
|
17
|
+
import json
|
|
18
|
+
import os
|
|
19
|
+
import uuid
|
|
20
|
+
from datetime import datetime, timezone
|
|
21
|
+
from pathlib import Path
|
|
22
|
+
|
|
23
|
+
DEFAULT_GRAPH_PATH = "memory/ontology/graph.jsonl"
|
|
24
|
+
DEFAULT_SCHEMA_PATH = "memory/ontology/schema.yaml"
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def generate_id(type_name: str) -> str:
|
|
28
|
+
"""Generate a unique ID for an entity."""
|
|
29
|
+
prefix = type_name.lower()[:4]
|
|
30
|
+
suffix = uuid.uuid4().hex[:8]
|
|
31
|
+
return f"{prefix}_{suffix}"
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def load_graph(path: str) -> tuple[dict, list]:
|
|
35
|
+
"""Load entities and relations from graph file."""
|
|
36
|
+
entities = {}
|
|
37
|
+
relations = []
|
|
38
|
+
|
|
39
|
+
graph_path = Path(path)
|
|
40
|
+
if not graph_path.exists():
|
|
41
|
+
return entities, relations
|
|
42
|
+
|
|
43
|
+
with open(graph_path) as f:
|
|
44
|
+
for line in f:
|
|
45
|
+
line = line.strip()
|
|
46
|
+
if not line:
|
|
47
|
+
continue
|
|
48
|
+
record = json.loads(line)
|
|
49
|
+
op = record.get("op")
|
|
50
|
+
|
|
51
|
+
if op == "create":
|
|
52
|
+
entity = record["entity"]
|
|
53
|
+
entities[entity["id"]] = entity
|
|
54
|
+
elif op == "update":
|
|
55
|
+
entity_id = record["id"]
|
|
56
|
+
if entity_id in entities:
|
|
57
|
+
entities[entity_id]["properties"].update(record.get("properties", {}))
|
|
58
|
+
entities[entity_id]["updated"] = record.get("timestamp")
|
|
59
|
+
elif op == "delete":
|
|
60
|
+
entity_id = record["id"]
|
|
61
|
+
entities.pop(entity_id, None)
|
|
62
|
+
elif op == "relate":
|
|
63
|
+
relations.append({
|
|
64
|
+
"from": record["from"],
|
|
65
|
+
"rel": record["rel"],
|
|
66
|
+
"to": record["to"],
|
|
67
|
+
"properties": record.get("properties", {})
|
|
68
|
+
})
|
|
69
|
+
elif op == "unrelate":
|
|
70
|
+
relations = [r for r in relations
|
|
71
|
+
if not (r["from"] == record["from"]
|
|
72
|
+
and r["rel"] == record["rel"]
|
|
73
|
+
and r["to"] == record["to"])]
|
|
74
|
+
|
|
75
|
+
return entities, relations
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def append_op(path: str, record: dict):
|
|
79
|
+
"""Append an operation to the graph file."""
|
|
80
|
+
graph_path = Path(path)
|
|
81
|
+
graph_path.parent.mkdir(parents=True, exist_ok=True)
|
|
82
|
+
|
|
83
|
+
with open(graph_path, "a") as f:
|
|
84
|
+
f.write(json.dumps(record) + "\n")
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def create_entity(type_name: str, properties: dict, graph_path: str, entity_id: str = None) -> dict:
|
|
88
|
+
"""Create a new entity."""
|
|
89
|
+
entity_id = entity_id or generate_id(type_name)
|
|
90
|
+
timestamp = datetime.now(timezone.utc).isoformat()
|
|
91
|
+
|
|
92
|
+
entity = {
|
|
93
|
+
"id": entity_id,
|
|
94
|
+
"type": type_name,
|
|
95
|
+
"properties": properties,
|
|
96
|
+
"created": timestamp,
|
|
97
|
+
"updated": timestamp
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
record = {"op": "create", "entity": entity, "timestamp": timestamp}
|
|
101
|
+
append_op(graph_path, record)
|
|
102
|
+
|
|
103
|
+
return entity
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
def get_entity(entity_id: str, graph_path: str) -> dict | None:
|
|
107
|
+
"""Get entity by ID."""
|
|
108
|
+
entities, _ = load_graph(graph_path)
|
|
109
|
+
return entities.get(entity_id)
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
def query_entities(type_name: str, where: dict, graph_path: str) -> list:
|
|
113
|
+
"""Query entities by type and properties."""
|
|
114
|
+
entities, _ = load_graph(graph_path)
|
|
115
|
+
results = []
|
|
116
|
+
|
|
117
|
+
for entity in entities.values():
|
|
118
|
+
if type_name and entity["type"] != type_name:
|
|
119
|
+
continue
|
|
120
|
+
|
|
121
|
+
match = True
|
|
122
|
+
for key, value in where.items():
|
|
123
|
+
if entity["properties"].get(key) != value:
|
|
124
|
+
match = False
|
|
125
|
+
break
|
|
126
|
+
|
|
127
|
+
if match:
|
|
128
|
+
results.append(entity)
|
|
129
|
+
|
|
130
|
+
return results
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
def list_entities(type_name: str, graph_path: str) -> list:
|
|
134
|
+
"""List all entities of a type."""
|
|
135
|
+
entities, _ = load_graph(graph_path)
|
|
136
|
+
if type_name:
|
|
137
|
+
return [e for e in entities.values() if e["type"] == type_name]
|
|
138
|
+
return list(entities.values())
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
def update_entity(entity_id: str, properties: dict, graph_path: str) -> dict | None:
|
|
142
|
+
"""Update entity properties."""
|
|
143
|
+
entities, _ = load_graph(graph_path)
|
|
144
|
+
if entity_id not in entities:
|
|
145
|
+
return None
|
|
146
|
+
|
|
147
|
+
timestamp = datetime.now(timezone.utc).isoformat()
|
|
148
|
+
record = {"op": "update", "id": entity_id, "properties": properties, "timestamp": timestamp}
|
|
149
|
+
append_op(graph_path, record)
|
|
150
|
+
|
|
151
|
+
entities[entity_id]["properties"].update(properties)
|
|
152
|
+
entities[entity_id]["updated"] = timestamp
|
|
153
|
+
return entities[entity_id]
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
def delete_entity(entity_id: str, graph_path: str) -> bool:
|
|
157
|
+
"""Delete an entity."""
|
|
158
|
+
entities, _ = load_graph(graph_path)
|
|
159
|
+
if entity_id not in entities:
|
|
160
|
+
return False
|
|
161
|
+
|
|
162
|
+
timestamp = datetime.now(timezone.utc).isoformat()
|
|
163
|
+
record = {"op": "delete", "id": entity_id, "timestamp": timestamp}
|
|
164
|
+
append_op(graph_path, record)
|
|
165
|
+
return True
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
def create_relation(from_id: str, rel_type: str, to_id: str, properties: dict, graph_path: str):
|
|
169
|
+
"""Create a relation between entities."""
|
|
170
|
+
timestamp = datetime.now(timezone.utc).isoformat()
|
|
171
|
+
record = {
|
|
172
|
+
"op": "relate",
|
|
173
|
+
"from": from_id,
|
|
174
|
+
"rel": rel_type,
|
|
175
|
+
"to": to_id,
|
|
176
|
+
"properties": properties,
|
|
177
|
+
"timestamp": timestamp
|
|
178
|
+
}
|
|
179
|
+
append_op(graph_path, record)
|
|
180
|
+
return record
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
def get_related(entity_id: str, rel_type: str, graph_path: str, direction: str = "outgoing") -> list:
|
|
184
|
+
"""Get related entities."""
|
|
185
|
+
entities, relations = load_graph(graph_path)
|
|
186
|
+
results = []
|
|
187
|
+
|
|
188
|
+
for rel in relations:
|
|
189
|
+
if direction == "outgoing" and rel["from"] == entity_id:
|
|
190
|
+
if not rel_type or rel["rel"] == rel_type:
|
|
191
|
+
if rel["to"] in entities:
|
|
192
|
+
results.append({
|
|
193
|
+
"relation": rel["rel"],
|
|
194
|
+
"entity": entities[rel["to"]]
|
|
195
|
+
})
|
|
196
|
+
elif direction == "incoming" and rel["to"] == entity_id:
|
|
197
|
+
if not rel_type or rel["rel"] == rel_type:
|
|
198
|
+
if rel["from"] in entities:
|
|
199
|
+
results.append({
|
|
200
|
+
"relation": rel["rel"],
|
|
201
|
+
"entity": entities[rel["from"]]
|
|
202
|
+
})
|
|
203
|
+
elif direction == "both":
|
|
204
|
+
if rel["from"] == entity_id or rel["to"] == entity_id:
|
|
205
|
+
if not rel_type or rel["rel"] == rel_type:
|
|
206
|
+
other_id = rel["to"] if rel["from"] == entity_id else rel["from"]
|
|
207
|
+
if other_id in entities:
|
|
208
|
+
results.append({
|
|
209
|
+
"relation": rel["rel"],
|
|
210
|
+
"direction": "outgoing" if rel["from"] == entity_id else "incoming",
|
|
211
|
+
"entity": entities[other_id]
|
|
212
|
+
})
|
|
213
|
+
|
|
214
|
+
return results
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
def validate_graph(graph_path: str, schema_path: str) -> list:
|
|
218
|
+
"""Validate graph against schema constraints."""
|
|
219
|
+
entities, relations = load_graph(graph_path)
|
|
220
|
+
errors = []
|
|
221
|
+
|
|
222
|
+
# Load schema if exists
|
|
223
|
+
schema = {}
|
|
224
|
+
schema_file = Path(schema_path)
|
|
225
|
+
if schema_file.exists():
|
|
226
|
+
import yaml
|
|
227
|
+
with open(schema_file) as f:
|
|
228
|
+
schema = yaml.safe_load(f) or {}
|
|
229
|
+
|
|
230
|
+
type_schemas = schema.get("types", {})
|
|
231
|
+
|
|
232
|
+
for entity_id, entity in entities.items():
|
|
233
|
+
type_name = entity["type"]
|
|
234
|
+
type_schema = type_schemas.get(type_name, {})
|
|
235
|
+
|
|
236
|
+
# Check required properties
|
|
237
|
+
required = type_schema.get("required", [])
|
|
238
|
+
for prop in required:
|
|
239
|
+
if prop not in entity["properties"]:
|
|
240
|
+
errors.append(f"{entity_id}: missing required property '{prop}'")
|
|
241
|
+
|
|
242
|
+
# Check forbidden properties
|
|
243
|
+
forbidden = type_schema.get("forbidden_properties", [])
|
|
244
|
+
for prop in forbidden:
|
|
245
|
+
if prop in entity["properties"]:
|
|
246
|
+
errors.append(f"{entity_id}: contains forbidden property '{prop}'")
|
|
247
|
+
|
|
248
|
+
# Check enum values
|
|
249
|
+
for prop, allowed in type_schema.items():
|
|
250
|
+
if prop.endswith("_enum"):
|
|
251
|
+
field = prop.replace("_enum", "")
|
|
252
|
+
value = entity["properties"].get(field)
|
|
253
|
+
if value and value not in allowed:
|
|
254
|
+
errors.append(f"{entity_id}: '{field}' must be one of {allowed}, got '{value}'")
|
|
255
|
+
|
|
256
|
+
return errors
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
def main():
|
|
260
|
+
parser = argparse.ArgumentParser(description="Ontology graph operations")
|
|
261
|
+
subparsers = parser.add_subparsers(dest="command", required=True)
|
|
262
|
+
|
|
263
|
+
# Create
|
|
264
|
+
create_p = subparsers.add_parser("create", help="Create entity")
|
|
265
|
+
create_p.add_argument("--type", "-t", required=True, help="Entity type")
|
|
266
|
+
create_p.add_argument("--props", "-p", default="{}", help="Properties JSON")
|
|
267
|
+
create_p.add_argument("--id", help="Entity ID (auto-generated if not provided)")
|
|
268
|
+
create_p.add_argument("--graph", "-g", default=DEFAULT_GRAPH_PATH)
|
|
269
|
+
|
|
270
|
+
# Get
|
|
271
|
+
get_p = subparsers.add_parser("get", help="Get entity by ID")
|
|
272
|
+
get_p.add_argument("--id", required=True, help="Entity ID")
|
|
273
|
+
get_p.add_argument("--graph", "-g", default=DEFAULT_GRAPH_PATH)
|
|
274
|
+
|
|
275
|
+
# Query
|
|
276
|
+
query_p = subparsers.add_parser("query", help="Query entities")
|
|
277
|
+
query_p.add_argument("--type", "-t", help="Entity type")
|
|
278
|
+
query_p.add_argument("--where", "-w", default="{}", help="Filter JSON")
|
|
279
|
+
query_p.add_argument("--graph", "-g", default=DEFAULT_GRAPH_PATH)
|
|
280
|
+
|
|
281
|
+
# List
|
|
282
|
+
list_p = subparsers.add_parser("list", help="List entities")
|
|
283
|
+
list_p.add_argument("--type", "-t", help="Entity type")
|
|
284
|
+
list_p.add_argument("--graph", "-g", default=DEFAULT_GRAPH_PATH)
|
|
285
|
+
|
|
286
|
+
# Update
|
|
287
|
+
update_p = subparsers.add_parser("update", help="Update entity")
|
|
288
|
+
update_p.add_argument("--id", required=True, help="Entity ID")
|
|
289
|
+
update_p.add_argument("--props", "-p", required=True, help="Properties JSON")
|
|
290
|
+
update_p.add_argument("--graph", "-g", default=DEFAULT_GRAPH_PATH)
|
|
291
|
+
|
|
292
|
+
# Delete
|
|
293
|
+
delete_p = subparsers.add_parser("delete", help="Delete entity")
|
|
294
|
+
delete_p.add_argument("--id", required=True, help="Entity ID")
|
|
295
|
+
delete_p.add_argument("--graph", "-g", default=DEFAULT_GRAPH_PATH)
|
|
296
|
+
|
|
297
|
+
# Relate
|
|
298
|
+
relate_p = subparsers.add_parser("relate", help="Create relation")
|
|
299
|
+
relate_p.add_argument("--from", dest="from_id", required=True, help="From entity ID")
|
|
300
|
+
relate_p.add_argument("--rel", "-r", required=True, help="Relation type")
|
|
301
|
+
relate_p.add_argument("--to", dest="to_id", required=True, help="To entity ID")
|
|
302
|
+
relate_p.add_argument("--props", "-p", default="{}", help="Relation properties JSON")
|
|
303
|
+
relate_p.add_argument("--graph", "-g", default=DEFAULT_GRAPH_PATH)
|
|
304
|
+
|
|
305
|
+
# Related
|
|
306
|
+
related_p = subparsers.add_parser("related", help="Get related entities")
|
|
307
|
+
related_p.add_argument("--id", required=True, help="Entity ID")
|
|
308
|
+
related_p.add_argument("--rel", "-r", help="Relation type filter")
|
|
309
|
+
related_p.add_argument("--dir", "-d", choices=["outgoing", "incoming", "both"], default="outgoing")
|
|
310
|
+
related_p.add_argument("--graph", "-g", default=DEFAULT_GRAPH_PATH)
|
|
311
|
+
|
|
312
|
+
# Validate
|
|
313
|
+
validate_p = subparsers.add_parser("validate", help="Validate graph")
|
|
314
|
+
validate_p.add_argument("--graph", "-g", default=DEFAULT_GRAPH_PATH)
|
|
315
|
+
validate_p.add_argument("--schema", "-s", default=DEFAULT_SCHEMA_PATH)
|
|
316
|
+
|
|
317
|
+
args = parser.parse_args()
|
|
318
|
+
|
|
319
|
+
if args.command == "create":
|
|
320
|
+
props = json.loads(args.props)
|
|
321
|
+
entity = create_entity(args.type, props, args.graph, args.id)
|
|
322
|
+
print(json.dumps(entity, indent=2))
|
|
323
|
+
|
|
324
|
+
elif args.command == "get":
|
|
325
|
+
entity = get_entity(args.id, args.graph)
|
|
326
|
+
if entity:
|
|
327
|
+
print(json.dumps(entity, indent=2))
|
|
328
|
+
else:
|
|
329
|
+
print(f"Entity not found: {args.id}")
|
|
330
|
+
|
|
331
|
+
elif args.command == "query":
|
|
332
|
+
where = json.loads(args.where)
|
|
333
|
+
results = query_entities(args.type, where, args.graph)
|
|
334
|
+
print(json.dumps(results, indent=2))
|
|
335
|
+
|
|
336
|
+
elif args.command == "list":
|
|
337
|
+
results = list_entities(args.type, args.graph)
|
|
338
|
+
print(json.dumps(results, indent=2))
|
|
339
|
+
|
|
340
|
+
elif args.command == "update":
|
|
341
|
+
props = json.loads(args.props)
|
|
342
|
+
entity = update_entity(args.id, props, args.graph)
|
|
343
|
+
if entity:
|
|
344
|
+
print(json.dumps(entity, indent=2))
|
|
345
|
+
else:
|
|
346
|
+
print(f"Entity not found: {args.id}")
|
|
347
|
+
|
|
348
|
+
elif args.command == "delete":
|
|
349
|
+
if delete_entity(args.id, args.graph):
|
|
350
|
+
print(f"Deleted: {args.id}")
|
|
351
|
+
else:
|
|
352
|
+
print(f"Entity not found: {args.id}")
|
|
353
|
+
|
|
354
|
+
elif args.command == "relate":
|
|
355
|
+
props = json.loads(args.props)
|
|
356
|
+
rel = create_relation(args.from_id, args.rel, args.to_id, props, args.graph)
|
|
357
|
+
print(json.dumps(rel, indent=2))
|
|
358
|
+
|
|
359
|
+
elif args.command == "related":
|
|
360
|
+
results = get_related(args.id, args.rel, args.graph, args.dir)
|
|
361
|
+
print(json.dumps(results, indent=2))
|
|
362
|
+
|
|
363
|
+
elif args.command == "validate":
|
|
364
|
+
errors = validate_graph(args.graph, args.schema)
|
|
365
|
+
if errors:
|
|
366
|
+
print("Validation errors:")
|
|
367
|
+
for err in errors:
|
|
368
|
+
print(f" - {err}")
|
|
369
|
+
else:
|
|
370
|
+
print("Graph is valid.")
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
if __name__ == "__main__":
|
|
374
|
+
main()
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: openai-image-gen
|
|
3
|
+
description: "Batch-generate images via OpenAI Images API with random prompt sampler and HTML gallery output. Use when you need to generate AI images, create image batches, or produce an image gallery."
|
|
4
|
+
triggers:
|
|
5
|
+
- "generate images with openai"
|
|
6
|
+
- "create AI images"
|
|
7
|
+
- "batch image generation"
|
|
8
|
+
- "openai image gen"
|
|
9
|
+
negative_triggers:
|
|
10
|
+
- "edit existing image"
|
|
11
|
+
- "take a screenshot"
|
|
12
|
+
- "stable diffusion"
|
|
13
|
+
- "midjourney"
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# OpenAI Image Gen
|
|
17
|
+
|
|
18
|
+
Generate a handful of “random but structured” prompts and render them via OpenAI Images API.
|
|
19
|
+
|
|
20
|
+
## Setup
|
|
21
|
+
|
|
22
|
+
- Needs env: `OPENAI_API_KEY`
|
|
23
|
+
|
|
24
|
+
## Run
|
|
25
|
+
|
|
26
|
+
From any directory (outputs to `~/Projects/tmp/...` when present; else `./tmp/...`):
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
python3 ~/Projects/agent-scripts/skills/openai-image-gen/scripts/gen.py
|
|
30
|
+
open ~/Projects/tmp/openai-image-gen-*/index.html
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Useful flags:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
python3 ~/Projects/agent-scripts/skills/openai-image-gen/scripts/gen.py --count 16 --model gpt-image-1.5
|
|
37
|
+
python3 ~/Projects/agent-scripts/skills/openai-image-gen/scripts/gen.py --prompt "ultra-detailed studio photo of a lobster astronaut" --count 4
|
|
38
|
+
python3 ~/Projects/agent-scripts/skills/openai-image-gen/scripts/gen.py --size 1536x1024 --quality high --out-dir ./out/images
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Output
|
|
42
|
+
|
|
43
|
+
- `*.png` images
|
|
44
|
+
- `prompts.json` (prompt ↔ file mapping)
|
|
45
|
+
- `index.html` (thumbnail gallery)
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
import argparse
|
|
4
|
+
import base64
|
|
5
|
+
import datetime as _dt
|
|
6
|
+
import json
|
|
7
|
+
import os
|
|
8
|
+
import random
|
|
9
|
+
import re
|
|
10
|
+
import sys
|
|
11
|
+
import time
|
|
12
|
+
import urllib.error
|
|
13
|
+
import urllib.request
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def _stamp() -> str:
|
|
17
|
+
return _dt.datetime.now().strftime("%Y-%m-%d-%H%M%S")
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def _slug(text: str, max_len: int = 60) -> str:
|
|
21
|
+
s = text.lower()
|
|
22
|
+
s = re.sub(r"[^a-z0-9]+", "-", s).strip("-")
|
|
23
|
+
return (s[:max_len] or "image").strip("-")
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def _default_out_dir() -> str:
|
|
27
|
+
projects_tmp = os.path.expanduser("~/Projects/tmp")
|
|
28
|
+
if os.path.isdir(projects_tmp):
|
|
29
|
+
return os.path.join(projects_tmp, f"openai-image-gen-{_stamp()}")
|
|
30
|
+
return os.path.join(os.getcwd(), "tmp", f"openai-image-gen-{_stamp()}")
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def _api_url() -> str:
|
|
34
|
+
base = (
|
|
35
|
+
os.environ.get("OPENAI_BASE_URL")
|
|
36
|
+
or os.environ.get("OPENAI_API_BASE")
|
|
37
|
+
or "https://api.openai.com"
|
|
38
|
+
).rstrip("/")
|
|
39
|
+
if base.endswith("/v1"):
|
|
40
|
+
return f"{base}/images/generations"
|
|
41
|
+
return f"{base}/v1/images/generations"
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def _random_prompts(count: int) -> list[str]:
|
|
45
|
+
subjects = [
|
|
46
|
+
"a lobster piloting a vintage scooter",
|
|
47
|
+
"a raccoon librarian in a tiny art-deco library",
|
|
48
|
+
"a glass whale floating above a desert",
|
|
49
|
+
"a moss-covered robot tending a bonsai garden",
|
|
50
|
+
"a candlelit map room with impossible staircases",
|
|
51
|
+
"a retro-futurist diner on the moon at dusk",
|
|
52
|
+
"a hummingbird made of stained glass",
|
|
53
|
+
"a porcelain teapot city in the clouds",
|
|
54
|
+
"a midnight train station built inside a giant clock",
|
|
55
|
+
"a tiny submarine exploring a glowing kelp forest",
|
|
56
|
+
"a baroque observatory with brass telescopes and fog",
|
|
57
|
+
"a koi pond shaped like a circuit board",
|
|
58
|
+
]
|
|
59
|
+
styles = [
|
|
60
|
+
"ultra-detailed studio photo",
|
|
61
|
+
"35mm film still",
|
|
62
|
+
"risograph poster",
|
|
63
|
+
"oil painting on linen",
|
|
64
|
+
"watercolor with ink linework",
|
|
65
|
+
"isometric diorama",
|
|
66
|
+
"mid-century editorial illustration",
|
|
67
|
+
"high-end product shot",
|
|
68
|
+
]
|
|
69
|
+
lighting = [
|
|
70
|
+
"softbox lighting",
|
|
71
|
+
"golden hour",
|
|
72
|
+
"neon rim light",
|
|
73
|
+
"overcast diffuse light",
|
|
74
|
+
"candlelight with deep shadows",
|
|
75
|
+
"dramatic chiaroscuro",
|
|
76
|
+
]
|
|
77
|
+
palettes = [
|
|
78
|
+
"copper + teal + cream",
|
|
79
|
+
"cobalt + vermilion + bone",
|
|
80
|
+
"sage + sand + charcoal",
|
|
81
|
+
"magenta + midnight blue + silver",
|
|
82
|
+
]
|
|
83
|
+
|
|
84
|
+
random.shuffle(subjects)
|
|
85
|
+
prompts: list[str] = []
|
|
86
|
+
for i in range(count):
|
|
87
|
+
subj = subjects[i % len(subjects)]
|
|
88
|
+
prompts.append(
|
|
89
|
+
f"{random.choice(styles)} of {subj}. "
|
|
90
|
+
f"Lighting: {random.choice(lighting)}. "
|
|
91
|
+
f"Palette: {random.choice(palettes)}. "
|
|
92
|
+
"Crisp, no text, no watermark."
|
|
93
|
+
)
|
|
94
|
+
return prompts
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
def _post_json(url: str, api_key: str, payload: dict, timeout_s: int) -> dict:
|
|
98
|
+
body = json.dumps(payload).encode("utf-8")
|
|
99
|
+
req = urllib.request.Request(
|
|
100
|
+
url,
|
|
101
|
+
data=body,
|
|
102
|
+
headers={
|
|
103
|
+
"Authorization": f"Bearer {api_key}",
|
|
104
|
+
"Content-Type": "application/json",
|
|
105
|
+
},
|
|
106
|
+
method="POST",
|
|
107
|
+
)
|
|
108
|
+
try:
|
|
109
|
+
with urllib.request.urlopen(req, timeout=timeout_s) as resp:
|
|
110
|
+
raw = resp.read()
|
|
111
|
+
except urllib.error.HTTPError as e:
|
|
112
|
+
raw = e.read()
|
|
113
|
+
try:
|
|
114
|
+
data = json.loads(raw.decode("utf-8", errors="replace"))
|
|
115
|
+
except Exception:
|
|
116
|
+
raise SystemExit(f"OpenAI HTTP {e.code}: {raw[:300]!r}")
|
|
117
|
+
raise SystemExit(f"OpenAI HTTP {e.code}: {json.dumps(data, indent=2)[:1200]}")
|
|
118
|
+
except Exception as e:
|
|
119
|
+
raise SystemExit(f"request failed: {e}")
|
|
120
|
+
|
|
121
|
+
try:
|
|
122
|
+
return json.loads(raw)
|
|
123
|
+
except Exception:
|
|
124
|
+
raise SystemExit(f"invalid JSON response: {raw[:300]!r}")
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
def _write_index(out_dir: str, items: list[dict]) -> None:
|
|
128
|
+
html = [
|
|
129
|
+
"<!doctype html>",
|
|
130
|
+
"<meta charset='utf-8'>",
|
|
131
|
+
"<meta name='viewport' content='width=device-width, initial-scale=1'>",
|
|
132
|
+
"<title>openai-image-gen</title>",
|
|
133
|
+
"<style>",
|
|
134
|
+
"body{font-family:ui-sans-serif,system-ui;margin:24px;max-width:1060px}",
|
|
135
|
+
".card{display:grid;grid-template-columns:220px 1fr;gap:16px;align-items:start;margin:18px 0}",
|
|
136
|
+
"img{width:220px;height:220px;object-fit:cover;border-radius:14px;box-shadow:0 14px 38px rgba(0,0,0,.14)}",
|
|
137
|
+
"pre{white-space:pre-wrap;margin:0;background:#111;color:#eee;padding:12px 14px;border-radius:14px;line-height:1.35}",
|
|
138
|
+
"</style>",
|
|
139
|
+
"<h1>openai-image-gen</h1>",
|
|
140
|
+
]
|
|
141
|
+
for it in items:
|
|
142
|
+
html.append("<div class='card'>")
|
|
143
|
+
html.append(f"<a href='{it['file']}'><img src='{it['file']}'></a>")
|
|
144
|
+
html.append(f"<pre>{it['prompt']}</pre>")
|
|
145
|
+
html.append("</div>")
|
|
146
|
+
with open(os.path.join(out_dir, "index.html"), "w", encoding="utf-8") as f:
|
|
147
|
+
f.write("\n".join(html))
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
def main(argv: list[str]) -> int:
|
|
151
|
+
p = argparse.ArgumentParser(
|
|
152
|
+
prog="openai-image-gen",
|
|
153
|
+
description="Generate a batch of images via OpenAI Images API (random prompts by default).",
|
|
154
|
+
)
|
|
155
|
+
p.add_argument("--count", type=int, default=8)
|
|
156
|
+
p.add_argument("--model", default="gpt-image-1.5")
|
|
157
|
+
p.add_argument("--size", default="1024x1024")
|
|
158
|
+
p.add_argument("--quality", default="high")
|
|
159
|
+
p.add_argument("--timeout", type=int, default=180, help="per-request timeout (seconds)")
|
|
160
|
+
p.add_argument("--sleep", type=float, default=0.2, help="pause between requests (seconds)")
|
|
161
|
+
p.add_argument("--out-dir", default=None)
|
|
162
|
+
p.add_argument("--api-key", default=None)
|
|
163
|
+
p.add_argument("--prompt", action="append", default=None, help="repeatable; overrides random prompts")
|
|
164
|
+
p.add_argument("--dry-run", action="store_true", help="print prompts + exit (no API calls)")
|
|
165
|
+
args = p.parse_args(argv)
|
|
166
|
+
|
|
167
|
+
api_key = args.api_key or os.environ.get("OPENAI_API_KEY")
|
|
168
|
+
if not api_key:
|
|
169
|
+
print("missing OPENAI_API_KEY (or --api-key)", file=sys.stderr)
|
|
170
|
+
return 2
|
|
171
|
+
|
|
172
|
+
out_dir = args.out_dir or _default_out_dir()
|
|
173
|
+
os.makedirs(out_dir, exist_ok=True)
|
|
174
|
+
|
|
175
|
+
prompts = args.prompt if args.prompt else _random_prompts(args.count)
|
|
176
|
+
if args.dry_run:
|
|
177
|
+
for i, pr in enumerate(prompts, 1):
|
|
178
|
+
print(f"{i:02d} {pr}")
|
|
179
|
+
print(f"out_dir={out_dir}")
|
|
180
|
+
return 0
|
|
181
|
+
|
|
182
|
+
url = _api_url()
|
|
183
|
+
items: list[dict] = []
|
|
184
|
+
|
|
185
|
+
for i, prompt in enumerate(prompts, 1):
|
|
186
|
+
payload = {
|
|
187
|
+
"model": args.model,
|
|
188
|
+
"prompt": prompt,
|
|
189
|
+
"size": args.size,
|
|
190
|
+
"quality": args.quality,
|
|
191
|
+
"n": 1,
|
|
192
|
+
"response_format": "b64_json",
|
|
193
|
+
}
|
|
194
|
+
data = _post_json(url=url, api_key=api_key, payload=payload, timeout_s=args.timeout)
|
|
195
|
+
b64 = (data.get("data") or [{}])[0].get("b64_json")
|
|
196
|
+
if not b64:
|
|
197
|
+
raise SystemExit(f"unexpected response: {json.dumps(data, indent=2)[:1200]}")
|
|
198
|
+
|
|
199
|
+
png = base64.b64decode(b64)
|
|
200
|
+
filename = f"{i:02d}-{_slug(prompt)}.png"
|
|
201
|
+
path = os.path.join(out_dir, filename)
|
|
202
|
+
with open(path, "wb") as f:
|
|
203
|
+
f.write(png)
|
|
204
|
+
|
|
205
|
+
items.append(
|
|
206
|
+
{
|
|
207
|
+
"file": filename,
|
|
208
|
+
"prompt": prompt,
|
|
209
|
+
"model": args.model,
|
|
210
|
+
"size": args.size,
|
|
211
|
+
"quality": args.quality,
|
|
212
|
+
}
|
|
213
|
+
)
|
|
214
|
+
print(f"wrote {filename}")
|
|
215
|
+
if args.sleep > 0:
|
|
216
|
+
time.sleep(args.sleep)
|
|
217
|
+
|
|
218
|
+
with open(os.path.join(out_dir, "prompts.json"), "w", encoding="utf-8") as f:
|
|
219
|
+
json.dump(items, f, indent=2, ensure_ascii=False)
|
|
220
|
+
|
|
221
|
+
_write_index(out_dir, items)
|
|
222
|
+
print(f"out_dir={out_dir}")
|
|
223
|
+
return 0
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
if __name__ == "__main__":
|
|
227
|
+
raise SystemExit(main(sys.argv[1:]))
|