@aiwg/cli 0.0.0-bootstrap.0 → 2026.7.18
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 +22 -1
- package/bin/aiwg.mjs +349 -0
- package/dist/src/a2a/agent-card.js +145 -0
- package/dist/src/a2a/client.js +411 -0
- package/dist/src/a2a/hitl-cli.js +171 -0
- package/dist/src/a2a/hitl-driver.js +370 -0
- package/dist/src/a2a/hitl.js +181 -0
- package/dist/src/a2a/http.js +193 -0
- package/dist/src/a2a/jcs.js +128 -0
- package/dist/src/a2a/jws.js +187 -0
- package/dist/src/a2a/types.js +24 -0
- package/dist/src/a2a/webhook.js +240 -0
- package/dist/src/activity-log/cli.js +348 -0
- package/dist/src/activity-log/parser.js +81 -0
- package/dist/src/activity-log/types.js +50 -0
- package/dist/src/agents/agent-deployer.js +367 -0
- package/dist/src/agents/agent-packager.js +271 -0
- package/dist/src/agents/agent-validator.js +271 -0
- package/dist/src/agents/grounding/knowledge-base.js +161 -0
- package/dist/src/agents/grounding/types.js +12 -0
- package/dist/src/agents/index.js +10 -0
- package/dist/src/agents/packaged-agent-inventory.js +75 -0
- package/dist/src/agents/types.js +7 -0
- package/dist/src/api/index.d.ts +10 -0
- package/dist/src/api/index.js +10 -0
- package/dist/src/artifacts/address-parser.js +73 -0
- package/dist/src/artifacts/audit/cli.js +183 -0
- package/dist/src/artifacts/audit/drift.js +122 -0
- package/dist/src/artifacts/audit/types.js +12 -0
- package/dist/src/artifacts/backends/graphology-backend.js +160 -0
- package/dist/src/artifacts/backends/json-backend.js +129 -0
- package/dist/src/artifacts/backends/sqlite-backend.js +199 -0
- package/dist/src/artifacts/browser-export.js +622 -0
- package/dist/src/artifacts/capability-resolver.js +94 -0
- package/dist/src/artifacts/checksum-manifest.js +91 -0
- package/dist/src/artifacts/citation-parser.js +162 -0
- package/dist/src/artifacts/cli.js +1486 -0
- package/dist/src/artifacts/corpus-tools/citation-densify.js +311 -0
- package/dist/src/artifacts/corpus-tools/cli.js +393 -0
- package/dist/src/artifacts/corpus-tools/corpus-graph.js +225 -0
- package/dist/src/artifacts/corpus-tools/curator.js +186 -0
- package/dist/src/artifacts/corpus-tools/discovery-log.js +70 -0
- package/dist/src/artifacts/corpus-tools/funder-network.js +141 -0
- package/dist/src/artifacts/corpus-tools/induction-audit.js +233 -0
- package/dist/src/artifacts/corpus-tools/integrity-scan.js +202 -0
- package/dist/src/artifacts/corpus-tools/profile-communities.js +166 -0
- package/dist/src/artifacts/corpus-tools/profile-edges.js +72 -0
- package/dist/src/artifacts/corpus-tools/profile-embed.js +113 -0
- package/dist/src/artifacts/corpus-tools/profile-generate-fm.js +167 -0
- package/dist/src/artifacts/corpus-tools/profile-generate.js +181 -0
- package/dist/src/artifacts/corpus-tools/profile-metrics.js +98 -0
- package/dist/src/artifacts/corpus-tools/profile-status.js +86 -0
- package/dist/src/artifacts/corpus-tools/profile-temporal.js +139 -0
- package/dist/src/artifacts/corpus-tools/radar-init.js +93 -0
- package/dist/src/artifacts/corpus-tools/radar-report.js +118 -0
- package/dist/src/artifacts/corpus-tools/radar-shared.js +189 -0
- package/dist/src/artifacts/corpus-tools/radar-status.js +68 -0
- package/dist/src/artifacts/corpus-tools/sidecar-lint.js +233 -0
- package/dist/src/artifacts/corpus-tools/sidecar-repair.js +277 -0
- package/dist/src/artifacts/corpus-tools/snapshot.js +591 -0
- package/dist/src/artifacts/corpus-tools/source-types.js +164 -0
- package/dist/src/artifacts/corpus-tools/vision-extract.js +243 -0
- package/dist/src/artifacts/corpus-views/build.js +126 -0
- package/dist/src/artifacts/corpus-views/corpus-config.js +124 -0
- package/dist/src/artifacts/corpus-views/ref-parser.js +437 -0
- package/dist/src/artifacts/corpus-views/renderers.js +353 -0
- package/dist/src/artifacts/corpus-views/taxonomies.js +131 -0
- package/dist/src/artifacts/dep-graph.js +173 -0
- package/dist/src/artifacts/discover-facets.js +375 -0
- package/dist/src/artifacts/embedding-index.js +354 -0
- package/dist/src/artifacts/enrichment/cli.js +240 -0
- package/dist/src/artifacts/enrichment/prompt.js +47 -0
- package/dist/src/artifacts/enrichment/store.js +90 -0
- package/dist/src/artifacts/enrichment/types.js +12 -0
- package/dist/src/artifacts/fortemi-core-query-adapter.js +475 -0
- package/dist/src/artifacts/fortemi-core-sync.js +251 -0
- package/dist/src/artifacts/fortemi-shard-export.js +44 -0
- package/dist/src/artifacts/fulltext.js +108 -0
- package/dist/src/artifacts/graph-backend.js +51 -0
- package/dist/src/artifacts/graph-query.js +247 -0
- package/dist/src/artifacts/hybrid-query.js +225 -0
- package/dist/src/artifacts/index-builder.js +1089 -0
- package/dist/src/artifacts/index-reader.js +112 -0
- package/dist/src/artifacts/index-status.js +193 -0
- package/dist/src/artifacts/legacy-index-migration.js +169 -0
- package/dist/src/artifacts/move.js +154 -0
- package/dist/src/artifacts/operational-state.js +239 -0
- package/dist/src/artifacts/prebuilt-build-lock.js +49 -0
- package/dist/src/artifacts/query-engine.js +1955 -0
- package/dist/src/artifacts/source-graph.js +529 -0
- package/dist/src/artifacts/stats.js +169 -0
- package/dist/src/artifacts/types.js +606 -0
- package/dist/src/artifacts/views/cli.js +293 -0
- package/dist/src/artifacts/views/definition.js +170 -0
- package/dist/src/artifacts/views/store.js +149 -0
- package/dist/src/artifacts/views/types.js +8 -0
- package/dist/src/artifacts/watcher.js +255 -0
- package/dist/src/catalog/builtin-models.json +636 -0
- package/dist/src/catalog/cli.js +228 -0
- package/dist/src/catalog/cli.mjs +289 -0
- package/dist/src/catalog/index.js +15 -0
- package/dist/src/catalog/loader.js +217 -0
- package/dist/src/catalog/loader.mjs +251 -0
- package/dist/src/catalog/sources.json +41 -0
- package/dist/src/catalog/types.js +8 -0
- package/dist/src/channel/manager.mjs +504 -0
- package/dist/src/cli/agent-spawn.js +178 -0
- package/dist/src/cli/cli-extension-loader.js +245 -0
- package/dist/src/cli/command-log.js +275 -0
- package/dist/src/cli/config-loader.js +232 -0
- package/dist/src/cli/env.js +82 -0
- package/dist/src/cli/errors.js +150 -0
- package/dist/src/cli/find-package-root.js +40 -0
- package/dist/src/cli/git-hooks.js +250 -0
- package/dist/src/cli/handlers/agentcard.js +206 -0
- package/dist/src/cli/handlers/artifacts.js +76 -0
- package/dist/src/cli/handlers/best-practices-audit.js +280 -0
- package/dist/src/cli/handlers/cockpit.js +137 -0
- package/dist/src/cli/handlers/command-log.js +37 -0
- package/dist/src/cli/handlers/daemon.js +59 -0
- package/dist/src/cli/handlers/diagnose.js +300 -0
- package/dist/src/cli/handlers/execution-mode.js +105 -0
- package/dist/src/cli/handlers/feedback.js +341 -0
- package/dist/src/cli/handlers/help.js +147 -0
- package/dist/src/cli/handlers/index.js +302 -0
- package/dist/src/cli/handlers/init.js +179 -0
- package/dist/src/cli/handlers/install.js +129 -0
- package/dist/src/cli/handlers/issues.js +46 -0
- package/dist/src/cli/handlers/lint.js +42 -0
- package/dist/src/cli/handlers/local-executor.js +315 -0
- package/dist/src/cli/handlers/marketplace.js +168 -0
- package/dist/src/cli/handlers/mc.js +1010 -0
- package/dist/src/cli/handlers/models.js +352 -0
- package/dist/src/cli/handlers/packages.js +155 -0
- package/dist/src/cli/handlers/ralph-launcher.js +717 -0
- package/dist/src/cli/handlers/ralph.js +575 -0
- package/dist/src/cli/handlers/refresh.js +432 -0
- package/dist/src/cli/handlers/regenerate.js +336 -0
- package/dist/src/cli/handlers/repo-access.js +109 -0
- package/dist/src/cli/handlers/run.js +165 -0
- package/dist/src/cli/handlers/runtime-info.js +301 -0
- package/dist/src/cli/handlers/sandbox.js +197 -0
- package/dist/src/cli/handlers/scaffolding.js +149 -0
- package/dist/src/cli/handlers/script-runner.js +121 -0
- package/dist/src/cli/handlers/sdlc-accelerate.js +148 -0
- package/dist/src/cli/handlers/serve.js +1835 -0
- package/dist/src/cli/handlers/session.js +348 -0
- package/dist/src/cli/handlers/setup.js +440 -0
- package/dist/src/cli/handlers/skill-lint.js +367 -0
- package/dist/src/cli/handlers/skill-usage.js +74 -0
- package/dist/src/cli/handlers/steward.js +567 -0
- package/dist/src/cli/handlers/subcommands.js +1702 -0
- package/dist/src/cli/handlers/team.js +337 -0
- package/dist/src/cli/handlers/types.js +11 -0
- package/dist/src/cli/handlers/use.js +2772 -0
- package/dist/src/cli/handlers/utilities.js +703 -0
- package/dist/src/cli/handlers/version.js +134 -0
- package/dist/src/cli/handlers/workspace-context.js +93 -0
- package/dist/src/cli/handlers/workspace.js +126 -0
- package/dist/src/cli/help-generator.js +178 -0
- package/dist/src/cli/hooks/builtin/activity-log-hook.js +126 -0
- package/dist/src/cli/hooks/executor.js +96 -0
- package/dist/src/cli/hooks/index.js +15 -0
- package/dist/src/cli/hooks/registry.js +143 -0
- package/dist/src/cli/hooks/types.js +13 -0
- package/dist/src/cli/log.js +492 -0
- package/dist/src/cli/project-isolation/detect.js +70 -0
- package/dist/src/cli/project-isolation/index.js +7 -0
- package/dist/src/cli/project-isolation/signals.js +17 -0
- package/dist/src/cli/project-isolation/warning.js +102 -0
- package/dist/src/cli/prompt-utils.js +155 -0
- package/dist/src/cli/provider-deployment-plan.js +126 -0
- package/dist/src/cli/provider-resolution.js +119 -0
- package/dist/src/cli/router.js +305 -0
- package/dist/src/cli/scope-resolver.js +392 -0
- package/dist/src/cli/skill-usage.js +616 -0
- package/dist/src/cli/ui.js +224 -0
- package/dist/src/cli/watch-service.js +203 -0
- package/dist/src/cli/workflow-orchestrator.js +478 -0
- package/dist/src/cli/workspace-signals.js +321 -0
- package/dist/src/community/footer.js +14 -0
- package/dist/src/community/links.js +123 -0
- package/dist/src/community/milestones.js +46 -0
- package/dist/src/community/nudge-policy.js +93 -0
- package/dist/src/config/aiwg-config.js +883 -0
- package/dist/src/config/cli.js +703 -0
- package/dist/src/config/gitignore.js +156 -0
- package/dist/src/config/project-artifacts.js +76 -0
- package/dist/src/config/user-config.js +428 -0
- package/dist/src/config/user-registry.js +127 -0
- package/dist/src/config/workspace.js +276 -0
- package/dist/src/contributors/detect.js +39 -0
- package/dist/src/contributors/discover.js +172 -0
- package/dist/src/contributors/heuristic.js +186 -0
- package/dist/src/contributors/index.js +11 -0
- package/dist/src/contributors/types.js +13 -0
- package/dist/src/contributors/validation.js +116 -0
- package/dist/src/data/community.schema.json +43 -0
- package/dist/src/data/community.yaml +16 -0
- package/dist/src/extensions/capability-index.js +270 -0
- package/dist/src/extensions/claude-hooks-installer.js +268 -0
- package/dist/src/extensions/commands/definitions.js +3485 -0
- package/dist/src/extensions/deployment-registration.js +463 -0
- package/dist/src/extensions/index.js +22 -0
- package/dist/src/extensions/loader.js +132 -0
- package/dist/src/extensions/managed-marker.js +100 -0
- package/dist/src/extensions/manifest.js +196 -0
- package/dist/src/extensions/project-local-activity.js +114 -0
- package/dist/src/extensions/project-local-discovery.js +261 -0
- package/dist/src/extensions/project-local-doctor.js +281 -0
- package/dist/src/extensions/project-local-gitignore.js +176 -0
- package/dist/src/extensions/project-local-paths.js +121 -0
- package/dist/src/extensions/project-local-promote.js +218 -0
- package/dist/src/extensions/project-local-remove.js +373 -0
- package/dist/src/extensions/project-local-scaffold.js +252 -0
- package/dist/src/extensions/project-quickref.js +291 -0
- package/dist/src/extensions/registry.js +368 -0
- package/dist/src/extensions/shadow-resolver.js +271 -0
- package/dist/src/extensions/types.js +86 -0
- package/dist/src/extensions/upstream-registry.js +195 -0
- package/dist/src/extensions/validation.js +631 -0
- package/dist/src/features/catalog.js +88 -0
- package/dist/src/features/cli.js +197 -0
- package/dist/src/features/installer.js +57 -0
- package/dist/src/features/paths.js +14 -0
- package/dist/src/features/runtime.js +21 -0
- package/dist/src/features/status.js +134 -0
- package/dist/src/hooks/laziness-detection.js +532 -0
- package/dist/src/intake/git-history-analyzer.js +486 -0
- package/dist/src/intake/index.js +9 -0
- package/dist/src/issues/cli.js +327 -0
- package/dist/src/issues/index.js +5 -0
- package/dist/src/issues/live.js +154 -0
- package/dist/src/issues/local.js +666 -0
- package/dist/src/issues/sync.js +143 -0
- package/dist/src/issues/types.js +2 -0
- package/dist/src/issues/workflows.js +164 -0
- package/dist/src/kb/cli.js +173 -0
- package/dist/src/lint/cli.js +171 -0
- package/dist/src/lint/loader.js +225 -0
- package/dist/src/lint/reporters.js +141 -0
- package/dist/src/lint/runner.js +364 -0
- package/dist/src/lint/types.js +10 -0
- package/dist/src/marketplace/cache.js +110 -0
- package/dist/src/marketplace/identifier.js +63 -0
- package/dist/src/marketplace/registry.js +36 -0
- package/dist/src/marketplace/sources/clawhub.js +53 -0
- package/dist/src/marketplace/sources/git.js +45 -0
- package/dist/src/marketplace/types.js +9 -0
- package/dist/src/mcp/adapters/codex-runtime.js +224 -0
- package/dist/src/mcp/cli.mjs +1197 -0
- package/dist/src/mcp/elicitation.mjs +149 -0
- package/dist/src/mcp/helpers.mjs +287 -0
- package/dist/src/mcp/index.mjs +11 -0
- package/dist/src/mcp/profiles.js +263 -0
- package/dist/src/mcp/profiles.mjs +360 -0
- package/dist/src/mcp/registry.js +376 -0
- package/dist/src/mcp/registry.mjs +387 -0
- package/dist/src/mcp/server.mjs +633 -0
- package/dist/src/mcp/test-simple.mjs +271 -0
- package/dist/src/mcp/tools/command-run.mjs +101 -0
- package/dist/src/mcp/tools/discovery.mjs +291 -0
- package/dist/src/mcp/tools/interaction.mjs +87 -0
- package/dist/src/mcp/tools/orchestration.mjs +320 -0
- package/dist/src/mcp/tools/subsystems.mjs +640 -0
- package/dist/src/memory/cli.js +166 -0
- package/dist/src/memory/project-registry.js +282 -0
- package/dist/src/metrics/artifact-metrics.js +184 -0
- package/dist/src/metrics/context-budget.js +174 -0
- package/dist/src/metrics/token-counter.js +133 -0
- package/dist/src/models/config-loader.js +228 -0
- package/dist/src/models/index.js +22 -0
- package/dist/src/models/model-capabilities.v1.json +120 -0
- package/dist/src/models/model-catalog.v1.json +96 -0
- package/dist/src/models/model-discovery.js +521 -0
- package/dist/src/models/provider-models.js +73 -0
- package/dist/src/models/provider-policy.js +273 -0
- package/dist/src/models/resolver.js +245 -0
- package/dist/src/models/router.js +70 -0
- package/dist/src/models/types.js +8 -0
- package/dist/src/models/wrapper-deployment.js +178 -0
- package/dist/src/models/wrapper-route.js +54 -0
- package/dist/src/ops/cli.js +268 -0
- package/dist/src/ops/registry.js +623 -0
- package/dist/src/packages/adapters/clawhub.js +113 -0
- package/dist/src/packages/adapters/git.js +153 -0
- package/dist/src/packages/adapters/gitea.js +93 -0
- package/dist/src/packages/adapters/github.js +69 -0
- package/dist/src/packages/adapters/local-cache.js +89 -0
- package/dist/src/packages/package-registry.js +143 -0
- package/dist/src/packages/registry.js +238 -0
- package/dist/src/packages/types.js +11 -0
- package/dist/src/plugin/cross-framework-ops.js +475 -0
- package/dist/src/plugin/framework-config-loader.js +235 -0
- package/dist/src/plugin/framework-detector.js +186 -0
- package/dist/src/plugin/framework-isolator.js +341 -0
- package/dist/src/plugin/framework-migration.js +371 -0
- package/dist/src/plugin/metadata-validator.js +906 -0
- package/dist/src/plugin/plugin-installer.js +436 -0
- package/dist/src/plugin/plugin-status.js +369 -0
- package/dist/src/plugin/plugin-uninstaller.js +473 -0
- package/dist/src/plugin/registry-validator.js +344 -0
- package/dist/src/plugin/skill-command-translator.js +415 -0
- package/dist/src/plugin/workspace-creator.js +189 -0
- package/dist/src/plugin/workspace-migrator.js +821 -0
- package/dist/src/policy/authorization.js +390 -0
- package/dist/src/policy/repo-access.js +215 -0
- package/dist/src/provenance/cli.js +16 -0
- package/dist/src/providers/capability-matrix.js +300 -0
- package/dist/src/providers/capability-matrix.yaml +514 -0
- package/dist/src/providers/provider-definitions.js +977 -0
- package/dist/src/providers/provider-definitions.mjs +159 -0
- package/dist/src/providers/provider-inventory.js +169 -0
- package/dist/src/quality/feedback-ab.js +174 -0
- package/dist/src/quality/feedback-collector.js +176 -0
- package/dist/src/quality/feedback-tracker.js +123 -0
- package/dist/src/quality/patterns/adr.json +24 -0
- package/dist/src/quality/patterns/sad.json +24 -0
- package/dist/src/quality/patterns/test-plan.json +24 -0
- package/dist/src/quality/patterns/use-case.json +24 -0
- package/dist/src/quality/scoring.js +157 -0
- package/dist/src/reflections/cli.js +15 -0
- package/dist/src/release/plan.js +139 -0
- package/dist/src/research/cache/manager.js +227 -0
- package/dist/src/research/clients/arxiv.js +156 -0
- package/dist/src/research/clients/base.js +197 -0
- package/dist/src/research/clients/crossref.js +112 -0
- package/dist/src/research/clients/semantic-scholar.js +126 -0
- package/dist/src/research/clients/unpaywall.js +87 -0
- package/dist/src/research/index.js +14 -0
- package/dist/src/research/query-cli.js +336 -0
- package/dist/src/research/services/acquisition.js +313 -0
- package/dist/src/research/services/archival.js +225 -0
- package/dist/src/research/services/citation.js +279 -0
- package/dist/src/research/services/discovery.js +243 -0
- package/dist/src/research/services/documentation.js +269 -0
- package/dist/src/research/services/index.js +14 -0
- package/dist/src/research/services/provenance.js +279 -0
- package/dist/src/research/services/quality.js +370 -0
- package/dist/src/research/services/types.js +7 -0
- package/dist/src/research/storage-cli.js +20 -0
- package/dist/src/research/types.js +47 -0
- package/dist/src/resources/index.d.ts +2 -0
- package/dist/src/resources/index.js +2 -0
- package/dist/src/resources/web-release.d.ts +89 -0
- package/dist/src/resources/web-release.js +886 -0
- package/dist/src/rlm/cache/cli.js +162 -0
- package/dist/src/rlm/cache/hash.js +35 -0
- package/dist/src/rlm/cache/store.js +170 -0
- package/dist/src/rlm/cache/types.js +8 -0
- package/dist/src/rlm/cli.js +650 -0
- package/dist/src/serve/a2a-terminal-observer.js +120 -0
- package/dist/src/serve/agent-router.js +205 -0
- package/dist/src/serve/dispatch-router.js +171 -0
- package/dist/src/serve/executor-registry.js +715 -0
- package/dist/src/serve/mission-conductor.js +177 -0
- package/dist/src/serve/orchestrator-adapter.js +113 -0
- package/dist/src/serve/orchestrator-override.js +94 -0
- package/dist/src/serve/orchestrator-pty.js +133 -0
- package/dist/src/serve/pty-bridge.js +799 -0
- package/dist/src/serve/sandbox-registry.js +832 -0
- package/dist/src/serve/screen-reader.js +228 -0
- package/dist/src/serve/stack-adapters.js +68 -0
- package/dist/src/serve/telemetry.js +143 -0
- package/dist/src/skills/adapters/clawhub.js +250 -0
- package/dist/src/skills/adapters/local.js +335 -0
- package/dist/src/skills/adapters/openclaw.js +316 -0
- package/dist/src/skills/cli.js +334 -0
- package/dist/src/skills/registry.js +117 -0
- package/dist/src/skills/run.js +259 -0
- package/dist/src/skills/runtime.js +94 -0
- package/dist/src/skills/types.js +10 -0
- package/dist/src/smiths/agentsmith/demo.js +116 -0
- package/dist/src/smiths/agentsmith/examples.js +300 -0
- package/dist/src/smiths/agentsmith/generator.js +503 -0
- package/dist/src/smiths/agentsmith/index.js +11 -0
- package/dist/src/smiths/agentsmith/types.js +8 -0
- package/dist/src/smiths/commandsmith/example.js +220 -0
- package/dist/src/smiths/commandsmith/generator.js +288 -0
- package/dist/src/smiths/commandsmith/index.js +41 -0
- package/dist/src/smiths/commandsmith/templates.js +296 -0
- package/dist/src/smiths/commandsmith/types.js +7 -0
- package/dist/src/smiths/context-pipeline/aiwg-md.js +104 -0
- package/dist/src/smiths/context-pipeline/allowlist.js +195 -0
- package/dist/src/smiths/context-pipeline/claude-hook.js +127 -0
- package/dist/src/smiths/context-pipeline/discovery.js +187 -0
- package/dist/src/smiths/context-pipeline/external-links-section.js +49 -0
- package/dist/src/smiths/context-pipeline/finalization.js +147 -0
- package/dist/src/smiths/context-pipeline/generator.js +477 -0
- package/dist/src/smiths/context-pipeline/index.js +30 -0
- package/dist/src/smiths/context-pipeline/legacy-inject.js +103 -0
- package/dist/src/smiths/context-pipeline/managed-hook.js +95 -0
- package/dist/src/smiths/context-pipeline/overflow.js +212 -0
- package/dist/src/smiths/context-pipeline/parallelism-section.js +94 -0
- package/dist/src/smiths/context-pipeline/provider-policy.js +64 -0
- package/dist/src/smiths/context-pipeline/sanitizer.js +93 -0
- package/dist/src/smiths/context-pipeline/types.js +23 -0
- package/dist/src/smiths/context-pipeline/workspace-context.js +988 -0
- package/dist/src/smiths/hook-bridge/codex-translator.js +129 -0
- package/dist/src/smiths/hook-bridge/copilot-translator.js +64 -0
- package/dist/src/smiths/hook-bridge/factory-translator.js +43 -0
- package/dist/src/smiths/hook-bridge/hermes-translator.js +88 -0
- package/dist/src/smiths/hook-bridge/index.js +79 -0
- package/dist/src/smiths/hook-bridge/loader.js +116 -0
- package/dist/src/smiths/hook-bridge/shim.js +89 -0
- package/dist/src/smiths/hook-bridge/types.js +31 -0
- package/dist/src/smiths/index.js +39 -0
- package/dist/src/smiths/mcpsmith/analyzers/cli-analyzer.js +390 -0
- package/dist/src/smiths/mcpsmith/example.js +119 -0
- package/dist/src/smiths/mcpsmith/generator.js +236 -0
- package/dist/src/smiths/mcpsmith/index.js +17 -0
- package/dist/src/smiths/mcpsmith/types.js +10 -0
- package/dist/src/smiths/platform-paths.js +101 -0
- package/dist/src/smiths/skillsmith/codex-sidecar.js +85 -0
- package/dist/src/smiths/skillsmith/collision-detector.js +249 -0
- package/dist/src/smiths/skillsmith/demo.js +83 -0
- package/dist/src/smiths/skillsmith/examples.js +161 -0
- package/dist/src/smiths/skillsmith/generator.js +316 -0
- package/dist/src/smiths/skillsmith/index.js +12 -0
- package/dist/src/smiths/skillsmith/namespace-adapter.js +180 -0
- package/dist/src/smiths/skillsmith/platform-resolver.js +157 -0
- package/dist/src/smiths/skillsmith/types.js +9 -0
- package/dist/src/smiths/toolsmith/index.js +10 -0
- package/dist/src/smiths/toolsmith/runtime-discovery.mjs +710 -0
- package/dist/src/smiths/toolsmith/types.js +8 -0
- package/dist/src/storage/backends/fortemi.js +227 -0
- package/dist/src/storage/backends/fs.js +134 -0
- package/dist/src/storage/backends/logseq.js +309 -0
- package/dist/src/storage/backends/obsidian.js +233 -0
- package/dist/src/storage/cli.js +468 -0
- package/dist/src/storage/config.js +272 -0
- package/dist/src/storage/index.js +108 -0
- package/dist/src/storage/subsystem-cli.js +201 -0
- package/dist/src/storage/types.js +33 -0
- package/dist/src/testing/corpus/corpus-builder.js +383 -0
- package/dist/src/testing/corpus/ground-truth-manager.js +460 -0
- package/dist/src/testing/corpus/index.js +10 -0
- package/dist/src/testing/fixtures/index.js +9 -0
- package/dist/src/testing/fixtures/test-data-factory.js +472 -0
- package/dist/src/testing/generators/index.js +11 -0
- package/dist/src/testing/generators/test-case-generator.js +393 -0
- package/dist/src/testing/generators/test-code-generator.js +384 -0
- package/dist/src/testing/generators/use-case-parser.js +325 -0
- package/dist/src/testing/index.js +11 -0
- package/dist/src/tracker/capability-protocol.js +118 -0
- package/dist/src/update/checker.mjs +396 -0
- package/dist/src/update/notifier.mjs +235 -0
- package/dist/src/writing/content-diversifier.js +804 -0
- package/dist/src/writing/example-generator.js +959 -0
- package/dist/src/writing/example-templates.js +99 -0
- package/dist/src/writing/pattern-library.js +486 -0
- package/dist/src/writing/patterns/banned-phrases.json +4413 -0
- package/dist/src/writing/patterns/formulaic-structures.json +1300 -0
- package/dist/src/writing/patterns/generic-adjectives.json +1510 -0
- package/dist/src/writing/patterns/hedging-language.json +2096 -0
- package/dist/src/writing/patterns/transition-words.json +1285 -0
- package/dist/src/writing/patterns/weak-verbs.json +1112 -0
- package/dist/src/writing/prompt-optimizer.js +660 -0
- package/dist/src/writing/prompt-templates.js +583 -0
- package/dist/src/writing/scoring-config-loader.js +168 -0
- package/dist/src/writing/validation-engine.js +595 -0
- package/dist/src/writing/validation-rules.js +380 -0
- package/dist/src/writing/voice-analyzer.js +439 -0
- package/dist/src/writing/voice-calibration.js +661 -0
- package/dist/src/writing/voice-profiles.json +588 -0
- package/package.json +65 -9
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Heuristic Project-Type Inference
|
|
3
|
+
*
|
|
4
|
+
* Fallback used by `project-status` (and any other `kind: status` aggregator)
|
|
5
|
+
* when contributor discovery returns zero in-use contributors. Detects what
|
|
6
|
+
* kind of project this is from cheap local signals — manifest files, file
|
|
7
|
+
* extensions, basic git presence — so the report still says something useful
|
|
8
|
+
* for projects that have not opted into AIWG contributors.
|
|
9
|
+
*
|
|
10
|
+
* Local-only by design: no network calls, no `npm outdated`, no GitHub API.
|
|
11
|
+
* The whole inference returns in O(few hundred ms) on a typical repo because
|
|
12
|
+
* it only checks a small number of well-known paths and runs a handful of
|
|
13
|
+
* bounded globs.
|
|
14
|
+
*
|
|
15
|
+
* @architecture @.aiwg/architecture/decisions/ADR-023-contributor-discovery-convention.md
|
|
16
|
+
* @issue #941
|
|
17
|
+
*/
|
|
18
|
+
import { existsSync, statSync } from 'fs';
|
|
19
|
+
import { glob } from 'glob';
|
|
20
|
+
import path from 'path';
|
|
21
|
+
/**
|
|
22
|
+
* Manifest files that strongly indicate a code project, mapped to a label.
|
|
23
|
+
* Order matters only for the summary string when multiple match.
|
|
24
|
+
*/
|
|
25
|
+
const CODE_MANIFESTS = [
|
|
26
|
+
{ file: 'package.json', label: 'JS/TS' },
|
|
27
|
+
{ file: 'pyproject.toml', label: 'Python' },
|
|
28
|
+
{ file: 'requirements.txt', label: 'Python (pip)' },
|
|
29
|
+
{ file: 'Cargo.toml', label: 'Rust' },
|
|
30
|
+
{ file: 'go.mod', label: 'Go' },
|
|
31
|
+
{ file: 'pom.xml', label: 'Java (Maven)' },
|
|
32
|
+
{ file: 'build.gradle', label: 'JVM (Gradle)' },
|
|
33
|
+
{ file: 'build.gradle.kts', label: 'JVM (Gradle Kotlin)' },
|
|
34
|
+
{ file: 'Gemfile', label: 'Ruby' },
|
|
35
|
+
{ file: 'composer.json', label: 'PHP' },
|
|
36
|
+
{ file: 'mix.exs', label: 'Elixir' },
|
|
37
|
+
];
|
|
38
|
+
/** Common test directory names — presence indicates a code project takes testing seriously. */
|
|
39
|
+
const TEST_DIRS = ['test', 'tests', '__tests__', 'spec'];
|
|
40
|
+
/** Asset file extensions, grouped by kind. Kept tight to avoid false positives on icons in docs. */
|
|
41
|
+
const ASSET_EXTENSIONS = {
|
|
42
|
+
audio: ['mp3', 'flac', 'opus', 'm4a', 'wav', 'aac', 'ogg'],
|
|
43
|
+
video: ['mp4', 'mkv', 'webm', 'mov', 'avi'],
|
|
44
|
+
image: ['jpg', 'jpeg', 'png', 'webp', 'heic', 'tiff'],
|
|
45
|
+
};
|
|
46
|
+
/** Soft thresholds to call something "asset-dominant" rather than "has a few images". */
|
|
47
|
+
const ASSET_DOMINANCE_MIN = 25;
|
|
48
|
+
function existsCheap(p) {
|
|
49
|
+
try {
|
|
50
|
+
return existsSync(p);
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Format a Unix-epoch ms as a relative-age string. Cheap, no extra deps.
|
|
58
|
+
*/
|
|
59
|
+
function relativeAge(mtimeMs) {
|
|
60
|
+
const ageMs = Date.now() - mtimeMs;
|
|
61
|
+
const day = 86_400_000;
|
|
62
|
+
if (ageMs < day)
|
|
63
|
+
return 'today';
|
|
64
|
+
const days = Math.floor(ageMs / day);
|
|
65
|
+
if (days < 30)
|
|
66
|
+
return `${days} day${days === 1 ? '' : 's'} ago`;
|
|
67
|
+
const months = Math.floor(days / 30);
|
|
68
|
+
if (months < 12)
|
|
69
|
+
return `${months} month${months === 1 ? '' : 's'} ago`;
|
|
70
|
+
const years = Math.floor(days / 365);
|
|
71
|
+
return `${years} year${years === 1 ? '' : 's'} ago`;
|
|
72
|
+
}
|
|
73
|
+
async function detectCodeDimension(projectRoot) {
|
|
74
|
+
const matchedManifests = CODE_MANIFESTS.filter(m => existsCheap(path.join(projectRoot, m.file)));
|
|
75
|
+
if (matchedManifests.length === 0)
|
|
76
|
+
return null;
|
|
77
|
+
const details = [
|
|
78
|
+
{ label: 'Manifests', value: matchedManifests.map(m => `${m.file} (${m.label})`).join(', ') },
|
|
79
|
+
];
|
|
80
|
+
const testDirs = TEST_DIRS.filter(d => existsCheap(path.join(projectRoot, d)));
|
|
81
|
+
details.push({
|
|
82
|
+
label: 'Test directories',
|
|
83
|
+
value: testDirs.length > 0 ? testDirs.join(', ') : 'none',
|
|
84
|
+
});
|
|
85
|
+
const readmePath = path.join(projectRoot, 'README.md');
|
|
86
|
+
if (existsCheap(readmePath)) {
|
|
87
|
+
try {
|
|
88
|
+
const stat = statSync(readmePath);
|
|
89
|
+
details.push({ label: 'README', value: `last edited ${relativeAge(stat.mtimeMs)}` });
|
|
90
|
+
}
|
|
91
|
+
catch {
|
|
92
|
+
details.push({ label: 'README', value: 'present (mtime unavailable)' });
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
details.push({ label: 'README', value: 'missing' });
|
|
97
|
+
}
|
|
98
|
+
const gitDir = path.join(projectRoot, '.git');
|
|
99
|
+
details.push({ label: 'Git', value: existsCheap(gitDir) ? 'tracked' : 'not a git repo' });
|
|
100
|
+
// Confidence is high when manifest + test dir + git all agree.
|
|
101
|
+
const signals = (matchedManifests.length > 0 ? 1 : 0) + (testDirs.length > 0 ? 1 : 0) + (existsCheap(gitDir) ? 1 : 0);
|
|
102
|
+
const confidence = signals >= 3 ? 'high' : signals === 2 ? 'medium' : 'low';
|
|
103
|
+
const summary = matchedManifests.length === 1
|
|
104
|
+
? `${matchedManifests[0].label} code project`
|
|
105
|
+
: `code project (${matchedManifests.map(m => m.label).join(' + ')})`;
|
|
106
|
+
return { kind: 'code', confidence, summary, details };
|
|
107
|
+
}
|
|
108
|
+
async function detectDocsDimension(projectRoot) {
|
|
109
|
+
// Cap the scan so this stays cheap on huge repos. We only need the order
|
|
110
|
+
// of magnitude.
|
|
111
|
+
const mdFiles = await glob('**/*.md', {
|
|
112
|
+
cwd: projectRoot,
|
|
113
|
+
nodir: true,
|
|
114
|
+
ignore: ['node_modules/**', '.git/**', 'dist/**', 'build/**', 'target/**'],
|
|
115
|
+
});
|
|
116
|
+
if (mdFiles.length < 5)
|
|
117
|
+
return null;
|
|
118
|
+
const hasCodeManifest = CODE_MANIFESTS.some(m => existsCheap(path.join(projectRoot, m.file)));
|
|
119
|
+
// Docs project = lots of markdown AND no source manifests. With a manifest
|
|
120
|
+
// it's just a code project that has docs — surface both, but mark this
|
|
121
|
+
// dimension's confidence as low so the summary doesn't lie.
|
|
122
|
+
const confidence = hasCodeManifest ? 'low' : mdFiles.length > 50 ? 'high' : 'medium';
|
|
123
|
+
const details = [
|
|
124
|
+
{ label: 'Markdown files', value: String(mdFiles.length) },
|
|
125
|
+
];
|
|
126
|
+
// Top-level docs dirs hint at organization.
|
|
127
|
+
const docsDirs = ['docs', 'doc', 'documentation', 'wiki'].filter(d => existsCheap(path.join(projectRoot, d)));
|
|
128
|
+
details.push({
|
|
129
|
+
label: 'Docs directories',
|
|
130
|
+
value: docsDirs.length > 0 ? docsDirs.join(', ') : 'none at root',
|
|
131
|
+
});
|
|
132
|
+
return {
|
|
133
|
+
kind: 'docs',
|
|
134
|
+
confidence,
|
|
135
|
+
summary: hasCodeManifest
|
|
136
|
+
? `${mdFiles.length} markdown files (code project with docs)`
|
|
137
|
+
: `${mdFiles.length} markdown files (docs / knowledge project)`,
|
|
138
|
+
details,
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
async function detectAssetsDimension(projectRoot) {
|
|
142
|
+
const counts = {};
|
|
143
|
+
let total = 0;
|
|
144
|
+
for (const [kind, exts] of Object.entries(ASSET_EXTENSIONS)) {
|
|
145
|
+
const pattern = `**/*.{${exts.join(',')}}`;
|
|
146
|
+
const matches = await glob(pattern, {
|
|
147
|
+
cwd: projectRoot,
|
|
148
|
+
nodir: true,
|
|
149
|
+
ignore: ['node_modules/**', '.git/**', 'dist/**', 'build/**'],
|
|
150
|
+
});
|
|
151
|
+
counts[kind] = matches.length;
|
|
152
|
+
total += matches.length;
|
|
153
|
+
}
|
|
154
|
+
if (total < ASSET_DOMINANCE_MIN)
|
|
155
|
+
return null;
|
|
156
|
+
const dominant = Object.entries(counts).sort((a, b) => b[1] - a[1])[0];
|
|
157
|
+
return {
|
|
158
|
+
kind: 'assets',
|
|
159
|
+
confidence: total > 200 ? 'high' : total > 50 ? 'medium' : 'low',
|
|
160
|
+
summary: `${total} media file${total === 1 ? '' : 's'} (${dominant[0]} dominant)`,
|
|
161
|
+
details: [
|
|
162
|
+
{ label: 'Audio', value: String(counts.audio) },
|
|
163
|
+
{ label: 'Video', value: String(counts.video) },
|
|
164
|
+
{ label: 'Image', value: String(counts.image) },
|
|
165
|
+
],
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Run all heuristic detectors and return a unified report. The caller
|
|
170
|
+
* decides whether to surface this to the user — typically only when
|
|
171
|
+
* `discoverContributors()` returns zero in-use contributors.
|
|
172
|
+
*/
|
|
173
|
+
export async function inferProjectType(projectRoot) {
|
|
174
|
+
const [code, docs, assets] = await Promise.all([
|
|
175
|
+
detectCodeDimension(projectRoot),
|
|
176
|
+
detectDocsDimension(projectRoot),
|
|
177
|
+
detectAssetsDimension(projectRoot),
|
|
178
|
+
]);
|
|
179
|
+
const dimensions = [code, docs, assets].filter((d) => d !== null);
|
|
180
|
+
return {
|
|
181
|
+
origin: 'heuristic',
|
|
182
|
+
dimensions,
|
|
183
|
+
empty: dimensions.length === 0,
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
//# sourceMappingURL=heuristic.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Contributor Discovery — Public API
|
|
3
|
+
*
|
|
4
|
+
* @architecture @.aiwg/architecture/decisions/ADR-023-contributor-discovery-convention.md
|
|
5
|
+
* @issue #938
|
|
6
|
+
*/
|
|
7
|
+
export { discoverContributors } from './discover.js';
|
|
8
|
+
export { runDetection, isInUse } from './detect.js';
|
|
9
|
+
export { inferProjectType } from './heuristic.js';
|
|
10
|
+
export { StatusContributorSchema, ResearchContributorSchema, getSchemaForKind, getRegisteredKinds, validateContributor, } from './validation.js';
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Contributor Discovery Type Definitions
|
|
3
|
+
*
|
|
4
|
+
* Cross-framework contributor convention per ADR-023. Frameworks, addons,
|
|
5
|
+
* and extensions opt into cross-framework commands (project-status,
|
|
6
|
+
* best-practices-audit, ...) by shipping `<framework>/<kind>/contributor.md`
|
|
7
|
+
* files. The aggregator discovers, validates, and runs detection against them.
|
|
8
|
+
*
|
|
9
|
+
* @architecture @.aiwg/architecture/decisions/ADR-023-contributor-discovery-convention.md
|
|
10
|
+
* @issue #938
|
|
11
|
+
*/
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Contributor Frontmatter Validation
|
|
3
|
+
*
|
|
4
|
+
* Zod schemas for known contributor kinds (`status`, `research`). Schemas are
|
|
5
|
+
* keyed by kind so future consumers register their schema without forking the
|
|
6
|
+
* discovery module.
|
|
7
|
+
*
|
|
8
|
+
* @architecture @.aiwg/architecture/decisions/ADR-023-contributor-discovery-convention.md
|
|
9
|
+
* @issue #938
|
|
10
|
+
*/
|
|
11
|
+
import { z } from 'zod';
|
|
12
|
+
/**
|
|
13
|
+
* Detection spec — declarative globs + counts. Common to every kind.
|
|
14
|
+
*/
|
|
15
|
+
const DetectionSpecSchema = z.object({
|
|
16
|
+
glob: z.array(z.string()).min(1, 'detect.glob must have at least one pattern'),
|
|
17
|
+
minCount: z.number().int().positive().optional(),
|
|
18
|
+
conditions: z.record(z.string()).optional(),
|
|
19
|
+
});
|
|
20
|
+
/**
|
|
21
|
+
* Base frontmatter shared by every kind. Per-kind schemas extend this.
|
|
22
|
+
*/
|
|
23
|
+
const ContributorBaseSchema = z.object({
|
|
24
|
+
kind: z.string().min(1),
|
|
25
|
+
domain: z.string().min(1, 'domain is required'),
|
|
26
|
+
description: z.string().min(1, 'description is required'),
|
|
27
|
+
detect: DetectionSpecSchema,
|
|
28
|
+
});
|
|
29
|
+
/**
|
|
30
|
+
* `kind: status` frontmatter. Reports observed state of a framework/domain
|
|
31
|
+
* (phase, counts, dates). Fields beyond the base schema are descriptive only —
|
|
32
|
+
* no prescriptive `next:` arrays per ADR-023 §Output voice.
|
|
33
|
+
*/
|
|
34
|
+
export const StatusContributorSchema = ContributorBaseSchema.extend({
|
|
35
|
+
kind: z.literal('status'),
|
|
36
|
+
/**
|
|
37
|
+
* Optional declarative field extractors. Each entry pulls a value out of a
|
|
38
|
+
* file using regex or count. Keeps contributors data-driven rather than
|
|
39
|
+
* code-driven; the aggregator reads these to populate the report block.
|
|
40
|
+
*/
|
|
41
|
+
fields: z
|
|
42
|
+
.record(z.object({
|
|
43
|
+
type: z.enum(['string', 'number', 'date']),
|
|
44
|
+
source: z.string(),
|
|
45
|
+
regex: z.string().optional(),
|
|
46
|
+
count: z.string().optional(),
|
|
47
|
+
}))
|
|
48
|
+
.optional(),
|
|
49
|
+
});
|
|
50
|
+
/**
|
|
51
|
+
* `kind: research` frontmatter. Configures research fan-out for a framework's
|
|
52
|
+
* domain — focus areas, source preferences, recency window.
|
|
53
|
+
*/
|
|
54
|
+
export const ResearchContributorSchema = ContributorBaseSchema.extend({
|
|
55
|
+
kind: z.literal('research'),
|
|
56
|
+
sources: z
|
|
57
|
+
.object({
|
|
58
|
+
preferred: z.array(z.string()).optional(),
|
|
59
|
+
exclude: z.array(z.string()).optional(),
|
|
60
|
+
})
|
|
61
|
+
.optional(),
|
|
62
|
+
focus_areas: z.array(z.string()).min(1, 'research contributors must declare at least one focus area'),
|
|
63
|
+
recency_default_months: z.number().int().positive().optional(),
|
|
64
|
+
});
|
|
65
|
+
/**
|
|
66
|
+
* Schema registry. Adding a new kind means adding its schema here — no other
|
|
67
|
+
* code changes are required for the discovery module to validate it.
|
|
68
|
+
*/
|
|
69
|
+
const SCHEMA_REGISTRY = {
|
|
70
|
+
status: StatusContributorSchema,
|
|
71
|
+
research: ResearchContributorSchema,
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Look up the zod schema for a kind. Throws if no schema is registered —
|
|
75
|
+
* unknown kinds must be deliberately added rather than silently accepted.
|
|
76
|
+
*/
|
|
77
|
+
export function getSchemaForKind(kind) {
|
|
78
|
+
const schema = SCHEMA_REGISTRY[kind];
|
|
79
|
+
if (!schema) {
|
|
80
|
+
throw new Error(`Unknown contributor kind '${kind}'. Register a zod schema in src/contributors/validation.ts before using it.`);
|
|
81
|
+
}
|
|
82
|
+
return schema;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* List all registered kinds. Used by validate-metadata to scan for
|
|
86
|
+
* orphaned contributor files (kind in frontmatter but no schema registered).
|
|
87
|
+
*/
|
|
88
|
+
export function getRegisteredKinds() {
|
|
89
|
+
return Object.keys(SCHEMA_REGISTRY);
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Validate a parsed frontmatter object against its kind's schema. Returns
|
|
93
|
+
* either the typed data or an error with formatted issue messages.
|
|
94
|
+
*/
|
|
95
|
+
export function validateContributor(data) {
|
|
96
|
+
const kind = data.kind;
|
|
97
|
+
if (typeof kind !== 'string' || kind.length === 0) {
|
|
98
|
+
return { ok: false, errors: ['frontmatter is missing required field `kind`'] };
|
|
99
|
+
}
|
|
100
|
+
let schema;
|
|
101
|
+
try {
|
|
102
|
+
schema = getSchemaForKind(kind);
|
|
103
|
+
}
|
|
104
|
+
catch (err) {
|
|
105
|
+
return { ok: false, errors: [err.message] };
|
|
106
|
+
}
|
|
107
|
+
const result = schema.safeParse(data);
|
|
108
|
+
if (!result.success) {
|
|
109
|
+
return {
|
|
110
|
+
ok: false,
|
|
111
|
+
errors: result.error.errors.map(e => `${e.path.join('.') || '<root>'}: ${e.message}`),
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
return { ok: true, data: result.data };
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=validation.js.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://aiwg.io/schemas/community.schema.json",
|
|
4
|
+
"title": "AIWG Community Links",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["website", "repository", "channels", "star_cta"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"website": { "type": "string", "format": "uri" },
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "object",
|
|
12
|
+
"additionalProperties": false,
|
|
13
|
+
"required": ["github"],
|
|
14
|
+
"properties": {
|
|
15
|
+
"github": { "type": "string", "format": "uri" },
|
|
16
|
+
"gitea": { "type": "string", "format": "uri" }
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"channels": {
|
|
20
|
+
"type": "array",
|
|
21
|
+
"items": {
|
|
22
|
+
"type": "object",
|
|
23
|
+
"additionalProperties": false,
|
|
24
|
+
"required": ["id", "name", "url", "cta"],
|
|
25
|
+
"properties": {
|
|
26
|
+
"id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]*$" },
|
|
27
|
+
"name": { "type": "string", "minLength": 1 },
|
|
28
|
+
"url": { "type": "string", "format": "uri" },
|
|
29
|
+
"cta": { "type": "string", "minLength": 1 }
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"star_cta": {
|
|
34
|
+
"type": "object",
|
|
35
|
+
"additionalProperties": false,
|
|
36
|
+
"required": ["short", "long"],
|
|
37
|
+
"properties": {
|
|
38
|
+
"short": { "type": "string", "minLength": 1 },
|
|
39
|
+
"long": { "type": "string", "minLength": 1 }
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
website: https://aiwg.io
|
|
2
|
+
repository:
|
|
3
|
+
github: https://github.com/jmagly/aiwg
|
|
4
|
+
gitea: https://git.integrolabs.net/roctinam/aiwg
|
|
5
|
+
channels:
|
|
6
|
+
- id: discord
|
|
7
|
+
name: Discord
|
|
8
|
+
url: https://discord.gg/BuAusFMxdA
|
|
9
|
+
cta: Join the Discord
|
|
10
|
+
- id: telegram
|
|
11
|
+
name: Telegram
|
|
12
|
+
url: https://t.me/+oJg9w2lE6A5lOGFh
|
|
13
|
+
cta: Join the Telegram
|
|
14
|
+
star_cta:
|
|
15
|
+
short: Star AIWG on GitHub
|
|
16
|
+
long: If AIWG saved you time, a star at github.com/jmagly/aiwg helps others find it.
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CapabilityIndex - Capability-based extension discovery system
|
|
3
|
+
*
|
|
4
|
+
* @implements @.aiwg/requirements/use-cases/UC-004-extension-system.md
|
|
5
|
+
* @architecture @.aiwg/architecture/software-architecture-doc.md
|
|
6
|
+
* @tests @test/unit/extensions/capability-index.test.ts
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* CapabilityIndex enables finding extensions by what they can do.
|
|
10
|
+
*
|
|
11
|
+
* Maintains bidirectional mappings:
|
|
12
|
+
* - capability → extension IDs (for queries)
|
|
13
|
+
* - extension ID → capabilities (for updates)
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* const index = new CapabilityIndex();
|
|
18
|
+
* index.index(myExtension);
|
|
19
|
+
*
|
|
20
|
+
* // Find extensions that can format markdown
|
|
21
|
+
* const formatters = index.getByCapability('format:markdown');
|
|
22
|
+
*
|
|
23
|
+
* // Find extensions that can format OR lint
|
|
24
|
+
* const tools = index.query({ any: ['format:markdown', 'lint:markdown'] });
|
|
25
|
+
*
|
|
26
|
+
* // Find formatters that are NOT linters
|
|
27
|
+
* const pureFormatters = index.query({
|
|
28
|
+
* all: ['format:markdown'],
|
|
29
|
+
* not: ['lint:markdown']
|
|
30
|
+
* });
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export class CapabilityIndex {
|
|
34
|
+
/** Map of capability → extension IDs */
|
|
35
|
+
byCapability = new Map();
|
|
36
|
+
/** Map of extension ID → capabilities */
|
|
37
|
+
byExtension = new Map();
|
|
38
|
+
/** Map of extension ID → extension type */
|
|
39
|
+
extensionTypes = new Map();
|
|
40
|
+
/**
|
|
41
|
+
* Index an extension's capabilities for fast lookup.
|
|
42
|
+
*
|
|
43
|
+
* @param extension - Extension to index
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```typescript
|
|
47
|
+
* index.index({
|
|
48
|
+
* id: 'markdown-formatter',
|
|
49
|
+
* type: 'tool',
|
|
50
|
+
* capabilities: ['format:markdown', 'format:commonmark']
|
|
51
|
+
* });
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
index(extension) {
|
|
55
|
+
const extensionId = extension.id;
|
|
56
|
+
const capabilities = extension.capabilities || [];
|
|
57
|
+
// Store extension type
|
|
58
|
+
this.extensionTypes.set(extensionId, extension.type);
|
|
59
|
+
// Remove old mappings if re-indexing
|
|
60
|
+
this.remove(extensionId);
|
|
61
|
+
// Store extension → capabilities mapping
|
|
62
|
+
this.byExtension.set(extensionId, new Set(capabilities));
|
|
63
|
+
// Add to capability → extensions mappings
|
|
64
|
+
for (const capability of capabilities) {
|
|
65
|
+
if (!this.byCapability.has(capability)) {
|
|
66
|
+
this.byCapability.set(capability, new Set());
|
|
67
|
+
}
|
|
68
|
+
this.byCapability.get(capability).add(extensionId);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Remove an extension from the index.
|
|
73
|
+
*
|
|
74
|
+
* @param extensionId - ID of extension to remove
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```typescript
|
|
78
|
+
* index.remove('markdown-formatter');
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
remove(extensionId) {
|
|
82
|
+
// Get capabilities for this extension
|
|
83
|
+
const capabilities = this.byExtension.get(extensionId);
|
|
84
|
+
if (!capabilities) {
|
|
85
|
+
return; // Not indexed
|
|
86
|
+
}
|
|
87
|
+
// Remove from capability → extensions mappings
|
|
88
|
+
const capabilityArray = Array.from(capabilities);
|
|
89
|
+
for (const capability of capabilityArray) {
|
|
90
|
+
const extensions = this.byCapability.get(capability);
|
|
91
|
+
if (extensions) {
|
|
92
|
+
extensions.delete(extensionId);
|
|
93
|
+
// Clean up empty sets
|
|
94
|
+
if (extensions.size === 0) {
|
|
95
|
+
this.byCapability.delete(capability);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
// Remove extension → capabilities mapping
|
|
100
|
+
this.byExtension.delete(extensionId);
|
|
101
|
+
// Remove extension type
|
|
102
|
+
this.extensionTypes.delete(extensionId);
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Query extensions by capabilities.
|
|
106
|
+
*
|
|
107
|
+
* Query logic:
|
|
108
|
+
* 1. Start with all extensions if no `all` or `any` specified
|
|
109
|
+
* 2. Filter to extensions with ALL capabilities in `all` array
|
|
110
|
+
* 3. Filter to extensions with ANY capability in `any` array
|
|
111
|
+
* 4. Exclude extensions with capabilities in `not` array
|
|
112
|
+
* 5. Optionally filter by extension type
|
|
113
|
+
*
|
|
114
|
+
* @param query - Capability query
|
|
115
|
+
* @returns Array of matching extension IDs
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* ```typescript
|
|
119
|
+
* // Extensions that can do BOTH formatting and validation
|
|
120
|
+
* index.query({ all: ['format:markdown', 'validate:markdown'] });
|
|
121
|
+
*
|
|
122
|
+
* // Extensions that can do EITHER formatting or linting
|
|
123
|
+
* index.query({ any: ['format:markdown', 'lint:markdown'] });
|
|
124
|
+
*
|
|
125
|
+
* // Formatters that are NOT linters
|
|
126
|
+
* index.query({
|
|
127
|
+
* all: ['format:markdown'],
|
|
128
|
+
* not: ['lint:markdown']
|
|
129
|
+
* });
|
|
130
|
+
*
|
|
131
|
+
* // Only tool-type extensions with formatting capability
|
|
132
|
+
* index.query({
|
|
133
|
+
* all: ['format:markdown'],
|
|
134
|
+
* type: 'tool'
|
|
135
|
+
* });
|
|
136
|
+
* ```
|
|
137
|
+
*/
|
|
138
|
+
query(query) {
|
|
139
|
+
let candidates;
|
|
140
|
+
// Phase 1: Build initial candidate set
|
|
141
|
+
if (query.all && query.all.length > 0) {
|
|
142
|
+
// Start with extensions that have the first required capability
|
|
143
|
+
const firstCapability = this.byCapability.get(query.all[0]);
|
|
144
|
+
candidates = firstCapability ? new Set(firstCapability) : new Set();
|
|
145
|
+
// Intersect with extensions that have ALL other required capabilities
|
|
146
|
+
for (let i = 1; i < query.all.length; i++) {
|
|
147
|
+
const withCapability = this.byCapability.get(query.all[i]);
|
|
148
|
+
if (!withCapability || withCapability.size === 0) {
|
|
149
|
+
// If any required capability has no extensions, result is empty
|
|
150
|
+
return [];
|
|
151
|
+
}
|
|
152
|
+
// Keep only extensions that have this capability too
|
|
153
|
+
const candidateArray = Array.from(candidates);
|
|
154
|
+
candidates = new Set(candidateArray.filter(id => withCapability.has(id)));
|
|
155
|
+
if (candidates.size === 0) {
|
|
156
|
+
// Early exit if intersection is empty
|
|
157
|
+
return [];
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
else if (query.any && query.any.length > 0) {
|
|
162
|
+
// Union of extensions with ANY of the specified capabilities
|
|
163
|
+
candidates = new Set();
|
|
164
|
+
for (const capability of query.any) {
|
|
165
|
+
const withCapability = this.byCapability.get(capability);
|
|
166
|
+
if (withCapability) {
|
|
167
|
+
const capabilityArray = Array.from(withCapability);
|
|
168
|
+
for (const id of capabilityArray) {
|
|
169
|
+
candidates.add(id);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
// No constraints - start with all extensions
|
|
176
|
+
candidates = new Set(this.byExtension.keys());
|
|
177
|
+
}
|
|
178
|
+
// Phase 2: Apply exclusions
|
|
179
|
+
if (query.not && query.not.length > 0) {
|
|
180
|
+
for (const capability of query.not) {
|
|
181
|
+
const toExclude = this.byCapability.get(capability);
|
|
182
|
+
if (toExclude) {
|
|
183
|
+
const excludeArray = Array.from(toExclude);
|
|
184
|
+
for (const id of excludeArray) {
|
|
185
|
+
candidates.delete(id);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
// Phase 3: Filter by type
|
|
191
|
+
if (query.type) {
|
|
192
|
+
const candidateArray = Array.from(candidates);
|
|
193
|
+
candidates = new Set(candidateArray.filter(id => this.extensionTypes.get(id) === query.type));
|
|
194
|
+
}
|
|
195
|
+
return Array.from(candidates).sort();
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Get all capabilities in the index.
|
|
199
|
+
*
|
|
200
|
+
* @returns Sorted array of capability strings
|
|
201
|
+
*
|
|
202
|
+
* @example
|
|
203
|
+
* ```typescript
|
|
204
|
+
* const capabilities = index.getAllCapabilities();
|
|
205
|
+
* // ['format:markdown', 'lint:markdown', 'validate:markdown']
|
|
206
|
+
* ```
|
|
207
|
+
*/
|
|
208
|
+
getAllCapabilities() {
|
|
209
|
+
return Array.from(this.byCapability.keys()).sort();
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Get all extensions with a specific capability.
|
|
213
|
+
*
|
|
214
|
+
* @param capability - Capability to search for
|
|
215
|
+
* @returns Sorted array of extension IDs
|
|
216
|
+
*
|
|
217
|
+
* @example
|
|
218
|
+
* ```typescript
|
|
219
|
+
* const formatters = index.getByCapability('format:markdown');
|
|
220
|
+
* // ['markdown-formatter', 'prettier-markdown']
|
|
221
|
+
* ```
|
|
222
|
+
*/
|
|
223
|
+
getByCapability(capability) {
|
|
224
|
+
const extensions = this.byCapability.get(capability);
|
|
225
|
+
return extensions ? Array.from(extensions).sort() : [];
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Check if a capability exists in the index.
|
|
229
|
+
*
|
|
230
|
+
* @param capability - Capability to check
|
|
231
|
+
* @returns True if at least one extension has this capability
|
|
232
|
+
*
|
|
233
|
+
* @example
|
|
234
|
+
* ```typescript
|
|
235
|
+
* if (index.hasCapability('format:markdown')) {
|
|
236
|
+
* console.log('Markdown formatting available');
|
|
237
|
+
* }
|
|
238
|
+
* ```
|
|
239
|
+
*/
|
|
240
|
+
hasCapability(capability) {
|
|
241
|
+
const extensions = this.byCapability.get(capability);
|
|
242
|
+
return extensions !== undefined && extensions.size > 0;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Get the number of unique capabilities in the index.
|
|
246
|
+
*
|
|
247
|
+
* @example
|
|
248
|
+
* ```typescript
|
|
249
|
+
* console.log(`Indexed ${index.capabilityCount} capabilities`);
|
|
250
|
+
* ```
|
|
251
|
+
*/
|
|
252
|
+
get capabilityCount() {
|
|
253
|
+
return this.byCapability.size;
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Clear all indexed data.
|
|
257
|
+
*
|
|
258
|
+
* @example
|
|
259
|
+
* ```typescript
|
|
260
|
+
* index.clear();
|
|
261
|
+
* // All mappings reset
|
|
262
|
+
* ```
|
|
263
|
+
*/
|
|
264
|
+
clear() {
|
|
265
|
+
this.byCapability.clear();
|
|
266
|
+
this.byExtension.clear();
|
|
267
|
+
this.extensionTypes.clear();
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
//# sourceMappingURL=capability-index.js.map
|