@skillsmith/core 0.12.1 → 0.12.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +164 -0
- package/README.md +2 -2
- package/dist/.tsbuildinfo +1 -1
- package/dist/src/api/client.d.ts +5 -3
- package/dist/src/api/client.d.ts.map +1 -1
- package/dist/src/api/client.js +23 -33
- package/dist/src/api/client.js.map +1 -1
- package/dist/src/api/client.registry-sync.d.ts +28 -0
- package/dist/src/api/client.registry-sync.d.ts.map +1 -0
- package/dist/src/api/client.registry-sync.js +36 -0
- package/dist/src/api/client.registry-sync.js.map +1 -0
- package/dist/src/api/client.test.js +185 -0
- package/dist/src/api/client.test.js.map +1 -1
- package/dist/src/api/client.toSkill.d.ts +16 -0
- package/dist/src/api/client.toSkill.d.ts.map +1 -0
- package/dist/src/api/client.toSkill.js +46 -0
- package/dist/src/api/client.toSkill.js.map +1 -0
- package/dist/src/api/client.types.d.ts +22 -0
- package/dist/src/api/client.types.d.ts.map +1 -1
- package/dist/src/api/index.d.ts +1 -1
- package/dist/src/api/index.d.ts.map +1 -1
- package/dist/src/api/index.js.map +1 -1
- package/dist/src/api/schemas.d.ts +28 -0
- package/dist/src/api/schemas.d.ts.map +1 -1
- package/dist/src/api/schemas.js +13 -0
- package/dist/src/api/schemas.js.map +1 -1
- package/dist/src/audit/remote-audit.d.ts +85 -0
- package/dist/src/audit/remote-audit.d.ts.map +1 -1
- package/dist/src/audit/remote-audit.js +126 -3
- package/dist/src/audit/remote-audit.js.map +1 -1
- package/dist/src/audit/remote-audit.test.js +217 -1
- package/dist/src/audit/remote-audit.test.js.map +1 -1
- package/dist/src/config/index.d.ts +1 -0
- package/dist/src/config/index.d.ts.map +1 -1
- package/dist/src/config/index.js.map +1 -1
- package/dist/src/db/migration-runner.d.ts.map +1 -1
- package/dist/src/db/migration-runner.js +6 -0
- package/dist/src/db/migration-runner.js.map +1 -1
- package/dist/src/db/migrations/v18-skill-versions-real-content-hash.d.ts +36 -0
- package/dist/src/db/migrations/v18-skill-versions-real-content-hash.d.ts.map +1 -0
- package/dist/src/db/migrations/v18-skill-versions-real-content-hash.js +38 -0
- package/dist/src/db/migrations/v18-skill-versions-real-content-hash.js.map +1 -0
- package/dist/src/db/schema.d.ts +1 -1
- package/dist/src/db/schema.d.ts.map +1 -1
- package/dist/src/db/schema.js +3 -1
- package/dist/src/db/schema.js.map +1 -1
- package/dist/src/exports/services.d.ts +3 -7
- package/dist/src/exports/services.d.ts.map +1 -1
- package/dist/src/exports/services.install.d.ts +18 -0
- package/dist/src/exports/services.install.d.ts.map +1 -0
- package/dist/src/exports/services.install.js +62 -0
- package/dist/src/exports/services.install.js.map +1 -0
- package/dist/src/exports/services.js +12 -32
- package/dist/src/exports/services.js.map +1 -1
- package/dist/src/exports/types.d.ts +1 -1
- package/dist/src/exports/types.d.ts.map +1 -1
- package/dist/src/index.d.ts +6 -5
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +9 -4
- package/dist/src/index.js.map +1 -1
- package/dist/src/install/agent-config-merge.json.d.ts +5 -4
- package/dist/src/install/agent-config-merge.json.d.ts.map +1 -1
- package/dist/src/install/agent-config-merge.json.js +10 -9
- package/dist/src/install/agent-config-merge.json.js.map +1 -1
- package/dist/src/install/agent-config-merge.types.d.ts +11 -1
- package/dist/src/install/agent-config-merge.types.d.ts.map +1 -1
- package/dist/src/install/agent-config-merge.types.js.map +1 -1
- package/dist/src/install/agent-harness-targets.d.ts +30 -2
- package/dist/src/install/agent-harness-targets.d.ts.map +1 -1
- package/dist/src/install/agent-harness-targets.js +17 -0
- package/dist/src/install/agent-harness-targets.js.map +1 -1
- package/dist/src/install/agent-manifest-path-guard.d.ts +28 -3
- package/dist/src/install/agent-manifest-path-guard.d.ts.map +1 -1
- package/dist/src/install/agent-manifest-path-guard.js +59 -3
- package/dist/src/install/agent-manifest-path-guard.js.map +1 -1
- package/dist/src/install/agent-manifest-path-guard.test.js +27 -1
- package/dist/src/install/agent-manifest-path-guard.test.js.map +1 -1
- package/dist/src/install/agent-pack-installer.antigravity-mcp.d.ts +74 -0
- package/dist/src/install/agent-pack-installer.antigravity-mcp.d.ts.map +1 -0
- package/dist/src/install/agent-pack-installer.antigravity-mcp.js +106 -0
- package/dist/src/install/agent-pack-installer.antigravity-mcp.js.map +1 -0
- package/dist/src/install/agent-pack-installer.antigravity-mcp.test.d.ts +2 -0
- package/dist/src/install/agent-pack-installer.antigravity-mcp.test.d.ts.map +1 -0
- package/dist/src/install/agent-pack-installer.antigravity-mcp.test.js +157 -0
- package/dist/src/install/agent-pack-installer.antigravity-mcp.test.js.map +1 -0
- package/dist/src/install/agent-pack-installer.cursor-mcp.d.ts +53 -0
- package/dist/src/install/agent-pack-installer.cursor-mcp.d.ts.map +1 -0
- package/dist/src/install/agent-pack-installer.cursor-mcp.js +207 -0
- package/dist/src/install/agent-pack-installer.cursor-mcp.js.map +1 -0
- package/dist/src/install/agent-pack-installer.cursor-mcp.test.d.ts +2 -0
- package/dist/src/install/agent-pack-installer.cursor-mcp.test.d.ts.map +1 -0
- package/dist/src/install/agent-pack-installer.cursor-mcp.test.js +285 -0
- package/dist/src/install/agent-pack-installer.cursor-mcp.test.js.map +1 -0
- package/dist/src/install/agent-pack-installer.d.ts +8 -0
- package/dist/src/install/agent-pack-installer.d.ts.map +1 -1
- package/dist/src/install/agent-pack-installer.entry.d.ts +120 -3
- package/dist/src/install/agent-pack-installer.entry.d.ts.map +1 -1
- package/dist/src/install/agent-pack-installer.entry.js +166 -3
- package/dist/src/install/agent-pack-installer.entry.js.map +1 -1
- package/dist/src/install/agent-pack-installer.js +97 -3
- package/dist/src/install/agent-pack-installer.js.map +1 -1
- package/dist/src/install/agent-pack-installer.types.d.ts +27 -0
- package/dist/src/install/agent-pack-installer.types.d.ts.map +1 -1
- package/dist/src/install/agent-pack-installer.types.js +6 -0
- package/dist/src/install/agent-pack-installer.types.js.map +1 -1
- package/dist/src/install/agent-pack-installer.workspace-scope.test.d.ts +2 -0
- package/dist/src/install/agent-pack-installer.workspace-scope.test.d.ts.map +1 -0
- package/dist/src/install/agent-pack-installer.workspace-scope.test.js +148 -0
- package/dist/src/install/agent-pack-installer.workspace-scope.test.js.map +1 -0
- package/dist/src/install/agent-pack-uninstaller.d.ts +18 -7
- package/dist/src/install/agent-pack-uninstaller.d.ts.map +1 -1
- package/dist/src/install/agent-pack-uninstaller.js +59 -9
- package/dist/src/install/agent-pack-uninstaller.js.map +1 -1
- package/dist/src/install/agent-pack-uninstaller.test.js +74 -1
- package/dist/src/install/agent-pack-uninstaller.test.js.map +1 -1
- package/dist/src/install/fan-out.d.ts.map +1 -1
- package/dist/src/install/fan-out.js +6 -0
- package/dist/src/install/fan-out.js.map +1 -1
- package/dist/src/install/index.d.ts +2 -0
- package/dist/src/install/index.d.ts.map +1 -1
- package/dist/src/install/index.js +2 -0
- package/dist/src/install/index.js.map +1 -1
- package/dist/src/install/workspace-scope.d.ts +207 -0
- package/dist/src/install/workspace-scope.d.ts.map +1 -0
- package/dist/src/install/workspace-scope.js +275 -0
- package/dist/src/install/workspace-scope.js.map +1 -0
- package/dist/src/install/workspace-scope.test.d.ts +2 -0
- package/dist/src/install/workspace-scope.test.d.ts.map +1 -0
- package/dist/src/install/workspace-scope.test.js +378 -0
- package/dist/src/install/workspace-scope.test.js.map +1 -0
- package/dist/src/scripts/__tests__/scan-imported-skills.test.js +9 -1
- package/dist/src/scripts/__tests__/scan-imported-skills.test.js.map +1 -1
- package/dist/src/scripts/scan-imported-skills.d.ts +7 -1
- package/dist/src/scripts/scan-imported-skills.d.ts.map +1 -1
- package/dist/src/scripts/scan-imported-skills.js +15 -2
- package/dist/src/scripts/scan-imported-skills.js.map +1 -1
- package/dist/src/scripts/skill-scanner/allowlist.d.ts +10 -0
- package/dist/src/scripts/skill-scanner/allowlist.d.ts.map +1 -1
- package/dist/src/scripts/skill-scanner/allowlist.js +10 -0
- package/dist/src/scripts/skill-scanner/allowlist.js.map +1 -1
- package/dist/src/scripts/skill-scanner/index.d.ts +8 -0
- package/dist/src/scripts/skill-scanner/index.d.ts.map +1 -1
- package/dist/src/scripts/skill-scanner/index.js +13 -5
- package/dist/src/scripts/skill-scanner/index.js.map +1 -1
- package/dist/src/scripts/skill-scanner/trust-scorer.d.ts.map +1 -1
- package/dist/src/scripts/skill-scanner/trust-scorer.js +6 -0
- package/dist/src/scripts/skill-scanner/trust-scorer.js.map +1 -1
- package/dist/src/security/__tests__/pathValidation.test.js +30 -1
- package/dist/src/security/__tests__/pathValidation.test.js.map +1 -1
- package/dist/src/security/scanner/SecurityScanner.action-context.d.ts +15 -0
- package/dist/src/security/scanner/SecurityScanner.action-context.d.ts.map +1 -0
- package/dist/src/security/scanner/SecurityScanner.action-context.js +209 -0
- package/dist/src/security/scanner/SecurityScanner.action-context.js.map +1 -0
- package/dist/src/security/scanner/SecurityScanner.d.ts +25 -0
- package/dist/src/security/scanner/SecurityScanner.d.ts.map +1 -1
- package/dist/src/security/scanner/SecurityScanner.helpers.d.ts +40 -1
- package/dist/src/security/scanner/SecurityScanner.helpers.d.ts.map +1 -1
- package/dist/src/security/scanner/SecurityScanner.helpers.js +88 -51
- package/dist/src/security/scanner/SecurityScanner.helpers.js.map +1 -1
- package/dist/src/security/scanner/SecurityScanner.js +39 -6
- package/dist/src/security/scanner/SecurityScanner.js.map +1 -1
- package/dist/src/security/scanner/SecurityScanner.pii.d.ts +30 -0
- package/dist/src/security/scanner/SecurityScanner.pii.d.ts.map +1 -1
- package/dist/src/security/scanner/SecurityScanner.pii.js +8 -1
- package/dist/src/security/scanner/SecurityScanner.pii.js.map +1 -1
- package/dist/src/security/scanner/SecurityScanner.prose-lexicon.d.ts +60 -0
- package/dist/src/security/scanner/SecurityScanner.prose-lexicon.d.ts.map +1 -0
- package/dist/src/security/scanner/SecurityScanner.prose-lexicon.js +228 -0
- package/dist/src/security/scanner/SecurityScanner.prose-lexicon.js.map +1 -0
- package/dist/src/security/scanner/SecurityScanner.scanners.d.ts.map +1 -1
- package/dist/src/security/scanner/SecurityScanner.scanners.js +35 -5
- package/dist/src/security/scanner/SecurityScanner.scanners.js.map +1 -1
- package/dist/src/security/scanner/SecurityScanner.value-gate.d.ts +49 -0
- package/dist/src/security/scanner/SecurityScanner.value-gate.d.ts.map +1 -0
- package/dist/src/security/scanner/SecurityScanner.value-gate.js +134 -0
- package/dist/src/security/scanner/SecurityScanner.value-gate.js.map +1 -0
- package/dist/src/security/scanner/SecurityScanner.weak-passwords.d.ts +55 -0
- package/dist/src/security/scanner/SecurityScanner.weak-passwords.d.ts.map +1 -0
- package/dist/src/security/scanner/SecurityScanner.weak-passwords.js +313 -0
- package/dist/src/security/scanner/SecurityScanner.weak-passwords.js.map +1 -0
- package/dist/src/security/scanner/patterns.d.ts +16 -6
- package/dist/src/security/scanner/patterns.d.ts.map +1 -1
- package/dist/src/security/scanner/patterns.js +25 -61
- package/dist/src/security/scanner/patterns.js.map +1 -1
- package/dist/src/security/scanner/patterns.sensitive-path.d.ts +45 -0
- package/dist/src/security/scanner/patterns.sensitive-path.d.ts.map +1 -0
- package/dist/src/security/scanner/patterns.sensitive-path.js +137 -0
- package/dist/src/security/scanner/patterns.sensitive-path.js.map +1 -0
- package/dist/src/security/scanner/regex-utils.d.ts +31 -17
- package/dist/src/security/scanner/regex-utils.d.ts.map +1 -1
- package/dist/src/security/scanner/regex-utils.js +31 -17
- package/dist/src/security/scanner/regex-utils.js.map +1 -1
- package/dist/src/security/scanner/types.d.ts +9 -0
- package/dist/src/security/scanner/types.d.ts.map +1 -1
- package/dist/src/services/SubagentGenerator.client-profiles.d.ts +258 -0
- package/dist/src/services/SubagentGenerator.client-profiles.d.ts.map +1 -0
- package/dist/src/services/SubagentGenerator.client-profiles.js +260 -0
- package/dist/src/services/SubagentGenerator.client-profiles.js.map +1 -0
- package/dist/src/services/SubagentGenerator.d.ts +19 -41
- package/dist/src/services/SubagentGenerator.d.ts.map +1 -1
- package/dist/src/services/SubagentGenerator.helpers.d.ts +64 -0
- package/dist/src/services/SubagentGenerator.helpers.d.ts.map +1 -0
- package/dist/src/services/SubagentGenerator.helpers.js +228 -0
- package/dist/src/services/SubagentGenerator.helpers.js.map +1 -0
- package/dist/src/services/SubagentGenerator.js +66 -208
- package/dist/src/services/SubagentGenerator.js.map +1 -1
- package/dist/src/services/SubagentGenerator.types.d.ts +45 -0
- package/dist/src/services/SubagentGenerator.types.d.ts.map +1 -0
- package/dist/src/services/SubagentGenerator.types.js +14 -0
- package/dist/src/services/SubagentGenerator.types.js.map +1 -0
- package/dist/src/services/TransformationService.d.ts +18 -61
- package/dist/src/services/TransformationService.d.ts.map +1 -1
- package/dist/src/services/TransformationService.js +29 -17
- package/dist/src/services/TransformationService.js.map +1 -1
- package/dist/src/services/TransformationService.types.d.ts +74 -0
- package/dist/src/services/TransformationService.types.d.ts.map +1 -0
- package/dist/src/services/TransformationService.types.js +8 -0
- package/dist/src/services/TransformationService.types.js.map +1 -0
- package/dist/src/services/__tests__/SubagentGenerator.client-profiles.test.d.ts +5 -0
- package/dist/src/services/__tests__/SubagentGenerator.client-profiles.test.d.ts.map +1 -0
- package/dist/src/services/__tests__/SubagentGenerator.client-profiles.test.js +72 -0
- package/dist/src/services/__tests__/SubagentGenerator.client-profiles.test.js.map +1 -0
- package/dist/src/services/__tests__/SubagentGenerator.helpers.test.d.ts +2 -0
- package/dist/src/services/__tests__/SubagentGenerator.helpers.test.d.ts.map +1 -0
- package/dist/src/services/__tests__/SubagentGenerator.helpers.test.js +61 -0
- package/dist/src/services/__tests__/SubagentGenerator.helpers.test.js.map +1 -0
- package/dist/src/services/__tests__/SubagentGenerator.test.js +155 -0
- package/dist/src/services/__tests__/SubagentGenerator.test.js.map +1 -1
- package/dist/src/services/__tests__/TransformationService.test.js +48 -0
- package/dist/src/services/__tests__/TransformationService.test.js.map +1 -1
- package/dist/src/services/agent-pack/agent-pack.test.js +1 -0
- package/dist/src/services/agent-pack/agent-pack.test.js.map +1 -1
- package/dist/src/services/agent-pack/prompt-source.d.ts +1 -1
- package/dist/src/services/agent-pack/prompt-source.d.ts.map +1 -1
- package/dist/src/services/agent-pack/prompt-source.js +10 -3
- package/dist/src/services/agent-pack/prompt-source.js.map +1 -1
- package/dist/src/services/agent-pack/types.d.ts +26 -2
- package/dist/src/services/agent-pack/types.d.ts.map +1 -1
- package/dist/src/services/agent-pack/types.js +13 -0
- package/dist/src/services/agent-pack/types.js.map +1 -1
- package/dist/src/services/agent-tool-profile.d.ts.map +1 -1
- package/dist/src/services/agent-tool-profile.js +7 -0
- package/dist/src/services/agent-tool-profile.js.map +1 -1
- package/dist/src/services/agent-tool-profile.test.js +2 -2
- package/dist/src/services/skill-content-comparison.d.ts +71 -0
- package/dist/src/services/skill-content-comparison.d.ts.map +1 -0
- package/dist/src/services/skill-content-comparison.js +90 -0
- package/dist/src/services/skill-content-comparison.js.map +1 -0
- package/dist/src/services/skill-content-comparison.test.d.ts +6 -0
- package/dist/src/services/skill-content-comparison.test.d.ts.map +1 -0
- package/dist/src/services/skill-content-comparison.test.js +83 -0
- package/dist/src/services/skill-content-comparison.test.js.map +1 -0
- package/dist/src/services/skill-identity-classification.d.ts +202 -0
- package/dist/src/services/skill-identity-classification.d.ts.map +1 -0
- package/dist/src/services/skill-identity-classification.js +295 -0
- package/dist/src/services/skill-identity-classification.js.map +1 -0
- package/dist/src/services/skill-identity-classification.test.d.ts +6 -0
- package/dist/src/services/skill-identity-classification.test.d.ts.map +1 -0
- package/dist/src/services/skill-identity-classification.test.js +314 -0
- package/dist/src/services/skill-identity-classification.test.js.map +1 -0
- package/dist/src/services/skill-installation.content.d.ts.map +1 -1
- package/dist/src/services/skill-installation.content.js +6 -1
- package/dist/src/services/skill-installation.content.js.map +1 -1
- package/dist/src/services/skill-installation.helpers.d.ts +8 -15
- package/dist/src/services/skill-installation.helpers.d.ts.map +1 -1
- package/dist/src/services/skill-installation.helpers.js +11 -105
- package/dist/src/services/skill-installation.helpers.js.map +1 -1
- package/dist/src/services/skill-installation.helpers.test.js +106 -1
- package/dist/src/services/skill-installation.helpers.test.js.map +1 -1
- package/dist/src/services/skill-installation.service.js +1 -1
- package/dist/src/services/skill-installation.service.js.map +1 -1
- package/dist/src/services/skill-installation.types.d.ts +33 -0
- package/dist/src/services/skill-installation.types.d.ts.map +1 -1
- package/dist/src/services/skill-installation.types.js.map +1 -1
- package/dist/src/services/skill-installation.uninstall.d.ts +84 -0
- package/dist/src/services/skill-installation.uninstall.d.ts.map +1 -0
- package/dist/src/services/skill-installation.uninstall.js +252 -0
- package/dist/src/services/skill-installation.uninstall.js.map +1 -0
- package/dist/src/services/skill-manifest.d.ts +41 -0
- package/dist/src/services/skill-manifest.d.ts.map +1 -1
- package/dist/src/services/skill-manifest.js +93 -0
- package/dist/src/services/skill-manifest.js.map +1 -1
- package/dist/src/services/skill-manifest.test.js +27 -0
- package/dist/src/services/skill-manifest.test.js.map +1 -1
- package/dist/src/sync/SyncEngine.d.ts.map +1 -1
- package/dist/src/sync/SyncEngine.js +69 -77
- package/dist/src/sync/SyncEngine.js.map +1 -1
- package/dist/src/telemetry/agent-marker.d.ts +8 -0
- package/dist/src/telemetry/agent-marker.d.ts.map +1 -1
- package/dist/src/telemetry/agent-marker.js +7 -0
- package/dist/src/telemetry/agent-marker.js.map +1 -1
- package/dist/src/telemetry/agent-marker.test.js +7 -1
- package/dist/src/telemetry/agent-marker.test.js.map +1 -1
- package/dist/src/telemetry/index.d.ts +1 -1
- package/dist/src/telemetry/index.d.ts.map +1 -1
- package/dist/src/telemetry/index.js +1 -1
- package/dist/src/telemetry/index.js.map +1 -1
- package/dist/src/telemetry/wrap.d.ts +6 -0
- package/dist/src/telemetry/wrap.d.ts.map +1 -1
- package/dist/src/telemetry/wrap.js +65 -10
- package/dist/src/telemetry/wrap.js.map +1 -1
- package/dist/src/telemetry/wrap.test.js +81 -1
- package/dist/src/telemetry/wrap.test.js.map +1 -1
- package/dist/src/telemetry/wrap.tool-call-sink.test.d.ts +26 -0
- package/dist/src/telemetry/wrap.tool-call-sink.test.d.ts.map +1 -0
- package/dist/src/telemetry/wrap.tool-call-sink.test.js +162 -0
- package/dist/src/telemetry/wrap.tool-call-sink.test.js.map +1 -0
- package/dist/src/types/skill.d.ts +9 -1
- package/dist/src/types/skill.d.ts.map +1 -1
- package/dist/src/utils/index.d.ts +2 -1
- package/dist/src/utils/index.d.ts.map +1 -1
- package/dist/src/utils/index.js +3 -1
- package/dist/src/utils/index.js.map +1 -1
- package/dist/src/utils/skill-name.d.ts +19 -0
- package/dist/src/utils/skill-name.d.ts.map +1 -0
- package/dist/src/utils/skill-name.js +26 -0
- package/dist/src/utils/skill-name.js.map +1 -0
- package/dist/src/utils/skill-name.test.d.ts +2 -0
- package/dist/src/utils/skill-name.test.d.ts.map +1 -0
- package/dist/src/utils/skill-name.test.js +34 -0
- package/dist/src/utils/skill-name.test.js.map +1 -0
- package/dist/src/utils/version-check.d.ts +61 -0
- package/dist/src/utils/version-check.d.ts.map +1 -1
- package/dist/src/utils/version-check.js +78 -1
- package/dist/src/utils/version-check.js.map +1 -1
- package/dist/src/utils/version-check.test.js +130 -1
- package/dist/src/utils/version-check.test.js.map +1 -1
- package/dist/tests/db/migration-runner-race.test.js +19 -9
- package/dist/tests/db/migration-runner-race.test.js.map +1 -1
- package/dist/tests/install/fan-out.test.js +27 -0
- package/dist/tests/install/fan-out.test.js.map +1 -1
- package/dist/tests/security/ContinuousSecurity.performance.test.js +12 -7
- package/dist/tests/security/ContinuousSecurity.performance.test.js.map +1 -1
- package/dist/tests/security/ContinuousSecurity.test.js +14 -2
- package/dist/tests/security/ContinuousSecurity.test.js.map +1 -1
- package/dist/tests/security/ai-defence-multiline-promotion.test.d.ts +10 -12
- package/dist/tests/security/ai-defence-multiline-promotion.test.d.ts.map +1 -1
- package/dist/tests/security/ai-defence-multiline-promotion.test.js +26 -33
- package/dist/tests/security/ai-defence-multiline-promotion.test.js.map +1 -1
- package/dist/tests/security/nested-instruction-long-attribute.test.js +20 -10
- package/dist/tests/security/nested-instruction-long-attribute.test.js.map +1 -1
- package/dist/tests/security/scanner-evidence-tiers.test.js +15 -0
- package/dist/tests/security/scanner-evidence-tiers.test.js.map +1 -1
- package/dist/tests/security/scanner-multiline-cap.test.d.ts +21 -0
- package/dist/tests/security/scanner-multiline-cap.test.d.ts.map +1 -0
- package/dist/tests/security/scanner-multiline-cap.test.js +152 -0
- package/dist/tests/security/scanner-multiline-cap.test.js.map +1 -0
- package/dist/tests/security/scanner-regression-guard.test.js +37 -0
- package/dist/tests/security/scanner-regression-guard.test.js.map +1 -1
- package/dist/tests/security/scanner-witness-sw1.test.d.ts +32 -0
- package/dist/tests/security/scanner-witness-sw1.test.d.ts.map +1 -0
- package/dist/tests/security/scanner-witness-sw1.test.js +255 -0
- package/dist/tests/security/scanner-witness-sw1.test.js.map +1 -0
- package/dist/tests/security/sensitive-path-adversarial-review.test.d.ts +2 -0
- package/dist/tests/security/sensitive-path-adversarial-review.test.d.ts.map +1 -0
- package/dist/tests/security/sensitive-path-adversarial-review.test.js +193 -0
- package/dist/tests/security/sensitive-path-adversarial-review.test.js.map +1 -0
- package/dist/tests/security/sensitive-path-fp.test.js +248 -0
- package/dist/tests/security/sensitive-path-fp.test.js.map +1 -1
- package/dist/tests/security/smi5879-corroboration.core.test.js +44 -0
- package/dist/tests/security/smi5879-corroboration.core.test.js.map +1 -1
- package/dist/tests/security/weak-password-lexicon.test.d.ts +18 -0
- package/dist/tests/security/weak-password-lexicon.test.d.ts.map +1 -0
- package/dist/tests/security/weak-password-lexicon.test.js +122 -0
- package/dist/tests/security/weak-password-lexicon.test.js.map +1 -0
- package/dist/tests/skill-scanner/allowlist.test.js +58 -4
- package/dist/tests/skill-scanner/allowlist.test.js.map +1 -1
- package/dist/tests/skill-scanner/categorizer.test.d.ts +2 -0
- package/dist/tests/skill-scanner/categorizer.test.d.ts.map +1 -0
- package/dist/tests/skill-scanner/categorizer.test.js +71 -0
- package/dist/tests/skill-scanner/categorizer.test.js.map +1 -0
- package/dist/tests/skill-scanner/cli-guard.test.d.ts +23 -0
- package/dist/tests/skill-scanner/cli-guard.test.d.ts.map +1 -0
- package/dist/tests/skill-scanner/cli-guard.test.js +71 -0
- package/dist/tests/skill-scanner/cli-guard.test.js.map +1 -0
- package/dist/tests/sync/SyncEngine.abort.test.js +15 -11
- package/dist/tests/sync/SyncEngine.abort.test.js.map +1 -1
- package/dist/tests/sync/SyncEngine.status.test.js +1 -1
- package/dist/tests/sync/SyncEngine.status.test.js.map +1 -1
- package/dist/tests/sync/SyncEngine.test.d.ts +11 -2
- package/dist/tests/sync/SyncEngine.test.d.ts.map +1 -1
- package/dist/tests/sync/SyncEngine.test.js +164 -13
- package/dist/tests/sync/SyncEngine.test.js.map +1 -1
- package/dist/tests/unit/migrations/migration-v18.test.d.ts +16 -0
- package/dist/tests/unit/migrations/migration-v18.test.d.ts.map +1 -0
- package/dist/tests/unit/migrations/migration-v18.test.js +192 -0
- package/dist/tests/unit/migrations/migration-v18.test.js.map +1 -0
- package/dist/tests/unit/services/skill-installation.content.test.js +101 -1
- package/dist/tests/unit/services/skill-installation.content.test.js.map +1 -1
- package/dist/tests/unit/services/skill-installation.service.sensitive-path-fp.test.d.ts +29 -0
- package/dist/tests/unit/services/skill-installation.service.sensitive-path-fp.test.d.ts.map +1 -0
- package/dist/tests/unit/services/skill-installation.service.sensitive-path-fp.test.js +200 -0
- package/dist/tests/unit/services/skill-installation.service.sensitive-path-fp.test.js.map +1 -0
- package/dist/tests/unit/services/skill-installation.service.test.js +9 -8
- package/dist/tests/unit/services/skill-installation.service.test.js.map +1 -1
- package/dist/tests/unit/sync-engine.source-aware.test.js +5 -5
- package/dist/tests/unit/sync-engine.source-aware.test.js.map +1 -1
- package/package.json +7 -2
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Security Scanner Patterns — the `sensitive_path` family
|
|
3
|
+
* @module @skillsmith/core/security/scanner/patterns.sensitive-path
|
|
4
|
+
*
|
|
5
|
+
* SMI-5207: extracted from patterns.ts, which sat 18 lines under the repo's
|
|
6
|
+
* 500-line pre-commit gate (scripts/check-file-length.mjs) before this wave —
|
|
7
|
+
* not enough headroom for the 12 hoisted pattern consts plus the two new
|
|
8
|
+
* severity-gate classification sets below (~42 lines). Same
|
|
9
|
+
* move-the-family-then-re-export convention already used twice in patterns.ts
|
|
10
|
+
* (patterns.jailbreak.ts, SMI-5876; patterns.exec.ts, SMI-6033 Wave 4).
|
|
11
|
+
*
|
|
12
|
+
* Every symbol here is re-exported unchanged from patterns.ts, so every
|
|
13
|
+
* existing import path keeps working AND reference identity is preserved —
|
|
14
|
+
* load-bearing, because scanSensitivePaths() classifies patterns by reference
|
|
15
|
+
* (`pattern === ENV_PATH_PATTERN`, `VALUE_GATED_KEYWORD_PATTERNS.has(pattern)`,
|
|
16
|
+
* and now `PATH_FORM_PATTERNS.has(pattern)` /
|
|
17
|
+
* `VALUE_GATED_ASSIGNMENT_PATTERNS.has(pattern)`).
|
|
18
|
+
*
|
|
19
|
+
* NOTE: a change to SENSITIVE_PATH_PATTERNS or to the severity classification
|
|
20
|
+
* below requires bumping SCANNER_RULESET_VERSION in patterns.ts — see that
|
|
21
|
+
* constant's own doc comment.
|
|
22
|
+
*/
|
|
23
|
+
// Sensitive file path patterns
|
|
24
|
+
// SMI-4396 Wave 2: bare-keyword variants (credentials, secrets?, password) tightened
|
|
25
|
+
// to require assignment/path/file-extension context. Without this tuning,
|
|
26
|
+
// documentation keywords in SKILL.md frontmatter and prose (1Password integration
|
|
27
|
+
// guides, security-research skill domain vocabulary) tripped HIGH severity.
|
|
28
|
+
//
|
|
29
|
+
// SMI-5359 Wave 4 — FP-narrowing for two over-firing entries (severity policy lives
|
|
30
|
+
// in scanSensitivePaths so the array length / regression-guard baseline is unchanged):
|
|
31
|
+
// MF-1: bare /api[_-]?key/i & /auth[_-]?token/i fired HIGH on ANY substring —
|
|
32
|
+
// benign prose ("set your api_key in the dashboard"), `export API_KEY=$1`, and
|
|
33
|
+
// `apiKey: <YOUR_KEY>` placeholders. They are now VALUE-GATED: HIGH only when the
|
|
34
|
+
// line assigns a real (non-placeholder, sufficiently-entropic) secret. The
|
|
35
|
+
// value-BEARING leak is already caught at PII (PII_PATTERNS[0/2]); the
|
|
36
|
+
// credential-in-an-outbound-curl exfil is caught by DATA_EXFILTRATION_PATTERNS
|
|
37
|
+
// (the `$API_KEY`-in-a-fetched-URL pattern added there). See
|
|
38
|
+
// VALUE_GATED_KEYWORD_PATTERNS.
|
|
39
|
+
// MF-2: lone /\.env/i fired HIGH on every `.env` mention AND on the benign committed
|
|
40
|
+
// family (.envrc, .env.example/.sample/.template/.schema/.dist). ENV_PATH_PATTERN
|
|
41
|
+
// negative-lookaheads exclude that family; scanSensitivePaths downgrades a LONE
|
|
42
|
+
// `.env` to MEDIUM and keeps HIGH when it co-occurs with a read/exfil verb or
|
|
43
|
+
// shell pipe/redirect (`cat .env | curl ...`).
|
|
44
|
+
//
|
|
45
|
+
// SMI-5207 — the remaining 12 entries got the same treatment the two MF-1 keywords
|
|
46
|
+
// and the MF-2 `.env` entry already had: severity is now context-gated rather than
|
|
47
|
+
// unconditionally HIGH. MF-3 covers the 9 path-form entries (action verb or shell
|
|
48
|
+
// operator within +/-1 line), MF-4 the 3 keyword-assignment entries (HIGH unless the
|
|
49
|
+
// assigned value positively reads as prose). Both gates live in
|
|
50
|
+
// SecurityScanner.scanners.ts; this module only supplies the classification.
|
|
51
|
+
// MF-2: `.env` as a real env-file reference. Excludes `.envrc` (direnv config) and the
|
|
52
|
+
// committed placeholder family (.env.example/.sample/.template/.schema/.dist). The
|
|
53
|
+
// `(?![A-Za-z])` guard also drops the `.environment`/`.envision` English-word FP while
|
|
54
|
+
// still matching real variants like `.env`, `.env.local`, `.env.production`.
|
|
55
|
+
export const ENV_PATH_PATTERN = /\.env(?![A-Za-z])(?!\.(?:example|sample|template|schema|dist))/i;
|
|
56
|
+
// MF-1: bare credential keywords — value-gated in scanSensitivePaths, never standalone HIGH.
|
|
57
|
+
const API_KEY_KEYWORD = /api[_-]?key/i;
|
|
58
|
+
const AUTH_TOKEN_KEYWORD = /auth[_-]?token/i;
|
|
59
|
+
// SMI-5207: the 12 non-`.env` entries are hoisted from inline array literals to named
|
|
60
|
+
// consts so scanSensitivePaths can classify each by severity gate BY REFERENCE. The
|
|
61
|
+
// array's contents, order, and length (15) are unchanged — the regression-guard floor
|
|
62
|
+
// (scanner-regression-guard.test.ts) still holds.
|
|
63
|
+
// Contextual credentials: filename or assignment, not bare prose
|
|
64
|
+
const CREDENTIALS_FILE_PATTERN = /credentials\.(?:json|ya?ml|env|toml|txt)/i;
|
|
65
|
+
const CREDENTIALS_ASSIGN_PATTERN = /credentials\s*[:=]/i;
|
|
66
|
+
// Contextual secrets: assignment or path, not bare word
|
|
67
|
+
const SECRETS_ASSIGN_PATTERN = /\bsecrets?\s*[:=]/i;
|
|
68
|
+
const SECRETS_PATH_PATTERN = /\bsecrets?\/[a-z0-9_.-]+/i;
|
|
69
|
+
const PEM_PATTERN = /\.pem$/i;
|
|
70
|
+
const KEY_FILE_PATTERN = /\.key$/i;
|
|
71
|
+
const CRT_PATTERN = /\.crt$/i;
|
|
72
|
+
// Contextual password: assignment or URL (postgres://user:pass@host) only
|
|
73
|
+
const PASSWORD_ASSIGN_PATTERN = /password\s*[:=]/i;
|
|
74
|
+
const SSH_DIR_PATTERN = /~\/\.ssh/i;
|
|
75
|
+
const AWS_DIR_PATTERN = /~\/\.aws/i;
|
|
76
|
+
const CONFIG_DIR_PATTERN = /~\/\.config/i;
|
|
77
|
+
// SMI-4396 Wave 2: explicit system-file paths. Added so that tightening
|
|
78
|
+
// bare /credentials/i and /password/i into assignment-context variants
|
|
79
|
+
// doesn't drop coverage of obvious sensitive references like /etc/passwd.
|
|
80
|
+
const ETC_SYSTEM_FILE_PATTERN = /\/etc\/(?:passwd|shadow|sudoers|hosts)\b/i;
|
|
81
|
+
export const SENSITIVE_PATH_PATTERNS = [
|
|
82
|
+
ENV_PATH_PATTERN,
|
|
83
|
+
CREDENTIALS_FILE_PATTERN,
|
|
84
|
+
CREDENTIALS_ASSIGN_PATTERN,
|
|
85
|
+
SECRETS_ASSIGN_PATTERN,
|
|
86
|
+
SECRETS_PATH_PATTERN,
|
|
87
|
+
PEM_PATTERN,
|
|
88
|
+
KEY_FILE_PATTERN,
|
|
89
|
+
CRT_PATTERN,
|
|
90
|
+
PASSWORD_ASSIGN_PATTERN,
|
|
91
|
+
API_KEY_KEYWORD,
|
|
92
|
+
AUTH_TOKEN_KEYWORD,
|
|
93
|
+
SSH_DIR_PATTERN,
|
|
94
|
+
AWS_DIR_PATTERN,
|
|
95
|
+
CONFIG_DIR_PATTERN,
|
|
96
|
+
ETC_SYSTEM_FILE_PATTERN,
|
|
97
|
+
];
|
|
98
|
+
// MF-1: the two bare-keyword patterns above emit HIGH only when accompanied by a real
|
|
99
|
+
// assigned secret value; scanSensitivePaths suppresses an otherwise-bare match.
|
|
100
|
+
export const VALUE_GATED_KEYWORD_PATTERNS = new Set([
|
|
101
|
+
API_KEY_KEYWORD,
|
|
102
|
+
AUTH_TOKEN_KEYWORD,
|
|
103
|
+
]);
|
|
104
|
+
/**
|
|
105
|
+
* SMI-5207 (MF-3): the 9 path/filename-form entries. HIGH only when an action
|
|
106
|
+
* verb or shell operator appears within +/-1 line of the match; otherwise
|
|
107
|
+
* MEDIUM — a bare path *mention* is the common case, so evidence is required
|
|
108
|
+
* to escalate. See scanSensitivePaths' hasPathActionContext().
|
|
109
|
+
*/
|
|
110
|
+
export const PATH_FORM_PATTERNS = new Set([
|
|
111
|
+
CREDENTIALS_FILE_PATTERN,
|
|
112
|
+
SECRETS_PATH_PATTERN,
|
|
113
|
+
PEM_PATTERN,
|
|
114
|
+
KEY_FILE_PATTERN,
|
|
115
|
+
CRT_PATTERN,
|
|
116
|
+
SSH_DIR_PATTERN,
|
|
117
|
+
AWS_DIR_PATTERN,
|
|
118
|
+
CONFIG_DIR_PATTERN,
|
|
119
|
+
ETC_SYSTEM_FILE_PATTERN,
|
|
120
|
+
]);
|
|
121
|
+
/**
|
|
122
|
+
* SMI-5207 (MF-4): the 3 keyword-assignment entries. HIGH BY DEFAULT —
|
|
123
|
+
* `keyword: value` is a syntactic credential-assignment shape, rare in
|
|
124
|
+
* innocent prose — downgraded to MEDIUM only on positive prose evidence about
|
|
125
|
+
* the assigned value. See scanSensitivePaths' assignmentHasRealValue().
|
|
126
|
+
*
|
|
127
|
+
* Partition check (guarded by a dedicated test): 1 (ENV) + 9 (PATH_FORM) +
|
|
128
|
+
* 3 (ASSIGNMENT) + 2 (VALUE_GATED_KEYWORD) = 15, total and disjoint. An
|
|
129
|
+
* unclassified future pattern falls through to scanSensitivePaths' fail-CLOSED
|
|
130
|
+
* `else` branch and stays HIGH.
|
|
131
|
+
*/
|
|
132
|
+
export const VALUE_GATED_ASSIGNMENT_PATTERNS = new Set([
|
|
133
|
+
CREDENTIALS_ASSIGN_PATTERN,
|
|
134
|
+
SECRETS_ASSIGN_PATTERN,
|
|
135
|
+
PASSWORD_ASSIGN_PATTERN,
|
|
136
|
+
]);
|
|
137
|
+
//# sourceMappingURL=patterns.sensitive-path.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patterns.sensitive-path.js","sourceRoot":"","sources":["../../../../src/security/scanner/patterns.sensitive-path.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,+BAA+B;AAC/B,qFAAqF;AACrF,0EAA0E;AAC1E,kFAAkF;AAClF,4EAA4E;AAC5E,EAAE;AACF,oFAAoF;AACpF,uFAAuF;AACvF,gFAAgF;AAChF,mFAAmF;AACnF,sFAAsF;AACtF,+EAA+E;AAC/E,2EAA2E;AAC3E,mFAAmF;AACnF,iEAAiE;AACjE,oCAAoC;AACpC,uFAAuF;AACvF,sFAAsF;AACtF,oFAAoF;AACpF,kFAAkF;AAClF,mDAAmD;AACnD,EAAE;AACF,mFAAmF;AACnF,mFAAmF;AACnF,kFAAkF;AAClF,qFAAqF;AACrF,gEAAgE;AAChE,6EAA6E;AAE7E,uFAAuF;AACvF,mFAAmF;AACnF,uFAAuF;AACvF,6EAA6E;AAC7E,MAAM,CAAC,MAAM,gBAAgB,GAAG,iEAAiE,CAAA;AAEjG,6FAA6F;AAC7F,MAAM,eAAe,GAAG,cAAc,CAAA;AACtC,MAAM,kBAAkB,GAAG,iBAAiB,CAAA;AAE5C,sFAAsF;AACtF,oFAAoF;AACpF,sFAAsF;AACtF,kDAAkD;AAClD,iEAAiE;AACjE,MAAM,wBAAwB,GAAG,2CAA2C,CAAA;AAC5E,MAAM,0BAA0B,GAAG,qBAAqB,CAAA;AACxD,wDAAwD;AACxD,MAAM,sBAAsB,GAAG,oBAAoB,CAAA;AACnD,MAAM,oBAAoB,GAAG,2BAA2B,CAAA;AACxD,MAAM,WAAW,GAAG,SAAS,CAAA;AAC7B,MAAM,gBAAgB,GAAG,SAAS,CAAA;AAClC,MAAM,WAAW,GAAG,SAAS,CAAA;AAC7B,0EAA0E;AAC1E,MAAM,uBAAuB,GAAG,kBAAkB,CAAA;AAClD,MAAM,eAAe,GAAG,WAAW,CAAA;AACnC,MAAM,eAAe,GAAG,WAAW,CAAA;AACnC,MAAM,kBAAkB,GAAG,cAAc,CAAA;AACzC,wEAAwE;AACxE,uEAAuE;AACvE,0EAA0E;AAC1E,MAAM,uBAAuB,GAAG,2CAA2C,CAAA;AAE3E,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,gBAAgB;IAChB,wBAAwB;IACxB,0BAA0B;IAC1B,sBAAsB;IACtB,oBAAoB;IACpB,WAAW;IACX,gBAAgB;IAChB,WAAW;IACX,uBAAuB;IACvB,eAAe;IACf,kBAAkB;IAClB,eAAe;IACf,eAAe;IACf,kBAAkB;IAClB,uBAAuB;CACxB,CAAA;AAED,sFAAsF;AACtF,gFAAgF;AAChF,MAAM,CAAC,MAAM,4BAA4B,GAAwB,IAAI,GAAG,CAAC;IACvE,eAAe;IACf,kBAAkB;CACnB,CAAC,CAAA;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAwB,IAAI,GAAG,CAAC;IAC7D,wBAAwB;IACxB,oBAAoB;IACpB,WAAW;IACX,gBAAgB;IAChB,WAAW;IACX,eAAe;IACf,eAAe;IACf,kBAAkB;IAClB,uBAAuB;CACxB,CAAC,CAAA;AAEF;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAwB,IAAI,GAAG,CAAC;IAC1E,0BAA0B;IAC1B,sBAAsB;IACtB,uBAAuB;CACxB,CAAC,CAAA"}
|
|
@@ -11,25 +11,39 @@
|
|
|
11
11
|
*/
|
|
12
12
|
export declare const MAX_LINE_LENGTH_FOR_REGEX = 10000;
|
|
13
13
|
/**
|
|
14
|
-
* SMI-
|
|
15
|
-
* UTF-16 code units (JavaScript `string.length` — NOT bytes/code
|
|
16
|
-
* SecurityScanner.ts's content-length finding message).
|
|
14
|
+
* SMI-5879 (design §3.4): Cap for the FULL-CONTENT (multiline "pass 1") regex
|
|
15
|
+
* scan, in UTF-16 code units (JavaScript `string.length` — NOT bytes/code
|
|
16
|
+
* points; see SecurityScanner.ts's content-length finding message).
|
|
17
17
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* (
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
18
|
+
* SMI-5881 set this equal to MAX_LINE_LENGTH_FOR_REGEX (10,000) and declined
|
|
19
|
+
* to raise it, citing a doubling-based extrapolation from smaller inputs that
|
|
20
|
+
* projected "unacceptable latency well before 1,000,000" for
|
|
21
|
+
* AD_CRLF_INJECTION-class patterns. SMI-5879 independently re-measured
|
|
22
|
+
* directly at 1,000,000 (not extrapolated) across the 7 ported multiline
|
|
23
|
+
* patterns (AD_CRLF_INJECTION, AD_ROLE_MARKER_BARE, AD_HTML_COMMENT_VERB/NOUN,
|
|
24
|
+
* AD_DELIMITER_BARE, AD_AN2_ROLE_BODY_NEXT_LINE, JB_JS3A/JS3B) against
|
|
25
|
+
* per-pattern adversarial near-miss shapes (not just the CRLF-pair shape
|
|
26
|
+
* SMI-5881 used) and found linear scaling with a worst case of ~56ms at
|
|
27
|
+
* 1,000,000 chars (AD_HTML_COMMENT_NOUN, "repeated HTML-comment-open"
|
|
28
|
+
* near-miss) — confirmed still linear (not superlinear) up to 4,000,000
|
|
29
|
+
* chars (~145ms), comfortably under the section 7.3 250ms per-case budget.
|
|
30
|
+
* The prior extrapolation does not hold empirically at this exact size; the
|
|
31
|
+
* measured worst case has real headroom, just less than the ~78x this
|
|
32
|
+
* design doc's own (unverified) claim asserted. Raising this cap closes the
|
|
33
|
+
* 10 KB pass-1 truncation blind spot (design §3.4) — the edge's own
|
|
34
|
+
* MAX_SKILL_CONTENT_SIZE is 1,000,000 bytes, so pass 1 previously saw only
|
|
35
|
+
* the first 1% of a large SKILL.md.
|
|
36
|
+
*
|
|
37
|
+
* Still declared separately from MAX_LINE_LENGTH_FOR_REGEX because the two
|
|
38
|
+
* caps protect different scan passes (per-line vs whole-document) and may
|
|
39
|
+
* need to diverge again. See SecurityScanner.ts's `effectiveMultilineLimit`
|
|
40
|
+
* (`Math.min(MAX_CONTENT_LENGTH_FOR_REGEX, maxContentLength)`) for how this
|
|
41
|
+
* interacts with the per-tier content-length ceiling — a trust tier with a
|
|
42
|
+
* SMALLER configured `maxContentLength` still tightens the effective limit
|
|
43
|
+
* below this cap; none currently need MORE than this cap for the multiline
|
|
44
|
+
* pass specifically.
|
|
31
45
|
*/
|
|
32
|
-
export declare const MAX_CONTENT_LENGTH_FOR_REGEX =
|
|
46
|
+
export declare const MAX_CONTENT_LENGTH_FOR_REGEX = 1000000;
|
|
33
47
|
/**
|
|
34
48
|
* SMI-882: Safe regex test with length limit
|
|
35
49
|
* Applies input length limit before regex matching to prevent ReDoS attacks.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"regex-utils.d.ts","sourceRoot":"","sources":["../../../../src/security/scanner/regex-utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,QAAQ,CAAA;AAE9C
|
|
1
|
+
{"version":3,"file":"regex-utils.d.ts","sourceRoot":"","sources":["../../../../src/security/scanner/regex-utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,QAAQ,CAAA;AAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,4BAA4B,UAAY,CAAA;AAErD;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,SAAS,GAAE,MAAkC,GAC5C,gBAAgB,GAAG,IAAI,CAIzB;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,SAAS,GAAE,MAAkC,GAC5C,OAAO,CAIT"}
|
|
@@ -11,25 +11,39 @@
|
|
|
11
11
|
*/
|
|
12
12
|
export const MAX_LINE_LENGTH_FOR_REGEX = 10000;
|
|
13
13
|
/**
|
|
14
|
-
* SMI-
|
|
15
|
-
* UTF-16 code units (JavaScript `string.length` — NOT bytes/code
|
|
16
|
-
* SecurityScanner.ts's content-length finding message).
|
|
14
|
+
* SMI-5879 (design §3.4): Cap for the FULL-CONTENT (multiline "pass 1") regex
|
|
15
|
+
* scan, in UTF-16 code units (JavaScript `string.length` — NOT bytes/code
|
|
16
|
+
* points; see SecurityScanner.ts's content-length finding message).
|
|
17
17
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* (
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
18
|
+
* SMI-5881 set this equal to MAX_LINE_LENGTH_FOR_REGEX (10,000) and declined
|
|
19
|
+
* to raise it, citing a doubling-based extrapolation from smaller inputs that
|
|
20
|
+
* projected "unacceptable latency well before 1,000,000" for
|
|
21
|
+
* AD_CRLF_INJECTION-class patterns. SMI-5879 independently re-measured
|
|
22
|
+
* directly at 1,000,000 (not extrapolated) across the 7 ported multiline
|
|
23
|
+
* patterns (AD_CRLF_INJECTION, AD_ROLE_MARKER_BARE, AD_HTML_COMMENT_VERB/NOUN,
|
|
24
|
+
* AD_DELIMITER_BARE, AD_AN2_ROLE_BODY_NEXT_LINE, JB_JS3A/JS3B) against
|
|
25
|
+
* per-pattern adversarial near-miss shapes (not just the CRLF-pair shape
|
|
26
|
+
* SMI-5881 used) and found linear scaling with a worst case of ~56ms at
|
|
27
|
+
* 1,000,000 chars (AD_HTML_COMMENT_NOUN, "repeated HTML-comment-open"
|
|
28
|
+
* near-miss) — confirmed still linear (not superlinear) up to 4,000,000
|
|
29
|
+
* chars (~145ms), comfortably under the section 7.3 250ms per-case budget.
|
|
30
|
+
* The prior extrapolation does not hold empirically at this exact size; the
|
|
31
|
+
* measured worst case has real headroom, just less than the ~78x this
|
|
32
|
+
* design doc's own (unverified) claim asserted. Raising this cap closes the
|
|
33
|
+
* 10 KB pass-1 truncation blind spot (design §3.4) — the edge's own
|
|
34
|
+
* MAX_SKILL_CONTENT_SIZE is 1,000,000 bytes, so pass 1 previously saw only
|
|
35
|
+
* the first 1% of a large SKILL.md.
|
|
36
|
+
*
|
|
37
|
+
* Still declared separately from MAX_LINE_LENGTH_FOR_REGEX because the two
|
|
38
|
+
* caps protect different scan passes (per-line vs whole-document) and may
|
|
39
|
+
* need to diverge again. See SecurityScanner.ts's `effectiveMultilineLimit`
|
|
40
|
+
* (`Math.min(MAX_CONTENT_LENGTH_FOR_REGEX, maxContentLength)`) for how this
|
|
41
|
+
* interacts with the per-tier content-length ceiling — a trust tier with a
|
|
42
|
+
* SMALLER configured `maxContentLength` still tightens the effective limit
|
|
43
|
+
* below this cap; none currently need MORE than this cap for the multiline
|
|
44
|
+
* pass specifically.
|
|
31
45
|
*/
|
|
32
|
-
export const MAX_CONTENT_LENGTH_FOR_REGEX =
|
|
46
|
+
export const MAX_CONTENT_LENGTH_FOR_REGEX = 1_000_000;
|
|
33
47
|
/**
|
|
34
48
|
* SMI-882: Safe regex test with length limit
|
|
35
49
|
* Applies input length limit before regex matching to prevent ReDoS attacks.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"regex-utils.js","sourceRoot":"","sources":["../../../../src/security/scanner/regex-utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,KAAK,CAAA;AAE9C
|
|
1
|
+
{"version":3,"file":"regex-utils.js","sourceRoot":"","sources":["../../../../src/security/scanner/regex-utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,KAAK,CAAA;AAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,SAAS,CAAA;AAErD;;;;;;;;GAQG;AACH,MAAM,UAAU,aAAa,CAC3B,OAAe,EACf,KAAa,EACb,YAAoB,yBAAyB;IAE7C,2DAA2D;IAC3D,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;IAC9E,OAAO,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;AACjC,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,cAAc,CAC5B,OAAe,EACf,KAAa,EACb,YAAoB,yBAAyB;IAE7C,2DAA2D;IAC3D,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;IAC9E,OAAO,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;AAChC,CAAC"}
|
|
@@ -117,6 +117,15 @@ export interface ScanReport {
|
|
|
117
117
|
riskScore: number;
|
|
118
118
|
/** Breakdown of risk score by category */
|
|
119
119
|
riskBreakdown: RiskScoreBreakdown;
|
|
120
|
+
/**
|
|
121
|
+
* SMI-5879 (design §3.3.6): true when the jailbreak or ai_defence multiline
|
|
122
|
+
* pass hit its per-pattern iteration ceiling before exhausting matches on a
|
|
123
|
+
* pathological same-line-repetition input. NOT provably score-neutral — the
|
|
124
|
+
* write path must treat this scan as authoritative for RAISING a verdict
|
|
125
|
+
* only, never for lowering an existing quarantine. Absent/undefined is
|
|
126
|
+
* equivalent to `false` (not truncated) for gating purposes.
|
|
127
|
+
*/
|
|
128
|
+
multilineTruncated?: boolean;
|
|
120
129
|
}
|
|
121
130
|
/**
|
|
122
131
|
* Verdict returned by comparing two scans of the SAME skill to detect a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/security/scanner/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAC3B,KAAK,GACL,gBAAgB,GAChB,WAAW,GACX,oBAAoB,GACpB,oBAAoB,GACpB,gBAAgB,GAChB,mBAAmB,GACnB,sBAAsB,GACtB,YAAY,GACZ,MAAM,GACN,KAAK,GACL,gBAAgB,GAChB,sBAAsB,GACtB,WAAW,GACX,mBAAmB,GACnB,iBAAiB,GACjB,kBAAkB,GAClB,iBAAiB,GACjB,oBAAoB,CAAA;AAExB;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAA;AAErE;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAA;AAEzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,MAAM,YAAY,GACpB,SAAS,GACT,qBAAqB,GACrB,wBAAwB,GACxB,sBAAsB,GACtB,iBAAiB,CAAA;AAErB;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,mBAAmB,CAAA;IACzB,QAAQ,EAAE,gBAAgB,CAAA;IAC1B,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,iFAAiF;IACjF,sBAAsB,CAAC,EAAE,OAAO,CAAA;IAChC,qEAAqE;IACrE,UAAU,CAAC,EAAE,iBAAiB,CAAA;IAC9B,0IAA0I;IAC1I,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,iGAAiG;IACjG,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B,wGAAwG;IACxG,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAA;IACjB,iBAAiB,EAAE,MAAM,CAAA;IACzB,aAAa,EAAE,MAAM,CAAA;IACrB,gBAAgB,EAAE,MAAM,CAAA;IACxB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,cAAc,EAAE,MAAM,CAAA;IACtB,cAAc,EAAE,MAAM,CAAA;IACtB,YAAY,EAAE,MAAM,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;IACX,aAAa,EAAE,MAAM,CAAA;IACrB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,SAAS,EAAE,MAAM,CAAA;IACjB,gBAAgB,EAAE,MAAM,CAAA;IACxB,cAAc,EAAE,MAAM,CAAA;IACtB,cAAc,EAAE,MAAM,CAAA;IACtB,cAAc,EAAE,MAAM,CAAA;IACtB,iBAAiB,EAAE,MAAM,CAAA;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,OAAO,CAAA;IACf,QAAQ,EAAE,eAAe,EAAE,CAAA;IAC3B,SAAS,EAAE,IAAI,CAAA;IACf,cAAc,EAAE,MAAM,CAAA;IACtB,0EAA0E;IAC1E,SAAS,EAAE,MAAM,CAAA;IACjB,0CAA0C;IAC1C,aAAa,EAAE,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/security/scanner/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAC3B,KAAK,GACL,gBAAgB,GAChB,WAAW,GACX,oBAAoB,GACpB,oBAAoB,GACpB,gBAAgB,GAChB,mBAAmB,GACnB,sBAAsB,GACtB,YAAY,GACZ,MAAM,GACN,KAAK,GACL,gBAAgB,GAChB,sBAAsB,GACtB,WAAW,GACX,mBAAmB,GACnB,iBAAiB,GACjB,kBAAkB,GAClB,iBAAiB,GACjB,oBAAoB,CAAA;AAExB;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAA;AAErE;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAA;AAEzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,MAAM,YAAY,GACpB,SAAS,GACT,qBAAqB,GACrB,wBAAwB,GACxB,sBAAsB,GACtB,iBAAiB,CAAA;AAErB;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,mBAAmB,CAAA;IACzB,QAAQ,EAAE,gBAAgB,CAAA;IAC1B,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,iFAAiF;IACjF,sBAAsB,CAAC,EAAE,OAAO,CAAA;IAChC,qEAAqE;IACrE,UAAU,CAAC,EAAE,iBAAiB,CAAA;IAC9B,0IAA0I;IAC1I,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,iGAAiG;IACjG,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B,wGAAwG;IACxG,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAA;IACjB,iBAAiB,EAAE,MAAM,CAAA;IACzB,aAAa,EAAE,MAAM,CAAA;IACrB,gBAAgB,EAAE,MAAM,CAAA;IACxB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,cAAc,EAAE,MAAM,CAAA;IACtB,cAAc,EAAE,MAAM,CAAA;IACtB,YAAY,EAAE,MAAM,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;IACX,aAAa,EAAE,MAAM,CAAA;IACrB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,SAAS,EAAE,MAAM,CAAA;IACjB,gBAAgB,EAAE,MAAM,CAAA;IACxB,cAAc,EAAE,MAAM,CAAA;IACtB,cAAc,EAAE,MAAM,CAAA;IACtB,cAAc,EAAE,MAAM,CAAA;IACtB,iBAAiB,EAAE,MAAM,CAAA;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,OAAO,CAAA;IACf,QAAQ,EAAE,eAAe,EAAE,CAAA;IAC3B,SAAS,EAAE,IAAI,CAAA;IACf,cAAc,EAAE,MAAM,CAAA;IACtB,0EAA0E;IAC1E,SAAS,EAAE,MAAM,CAAA;IACjB,0CAA0C;IAC1C,aAAa,EAAE,kBAAkB,CAAA;IACjC;;;;;;;OAOG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC7B;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,QAAQ,GAAG,YAAY,GAAG,SAAS,CAAA;IAC5C,8EAA8E;IAC9E,WAAW,EAAE,eAAe,EAAE,CAAA;IAC9B,qEAAqE;IACrE,SAAS,EAAE,MAAM,CAAA;IACjB,uEAAuE;IACvE,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,wBAAwB,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,CAAA;AAE/D;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;IACzB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,4DAA4D;IAC5D,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,sEAAsE;IACtE,wBAAwB,CAAC,EAAE,wBAAwB,CAAA;CACpD"}
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SMI-6276 (Wave 6 Step 1): per-client generation profile for companion
|
|
3
|
+
* subagent files (`SubagentGenerator.ts`).
|
|
4
|
+
*
|
|
5
|
+
* `SubagentGenerator.generateSubagentContent()` predates multi-client support
|
|
6
|
+
* entirely — it always emitted Claude-native tool names (`Read, Write, Bash,
|
|
7
|
+
* WebFetch, Grep, Glob, WebSearch`) plus a `model: <haiku|sonnet|opus>`
|
|
8
|
+
* frontmatter field, for every client `COMPANION_AGENT_TARGETS`
|
|
9
|
+
* (`../install/paths.ts`) writes a companion-agent file for — including
|
|
10
|
+
* clients whose own agent-definition format doesn't have a `tools:` or
|
|
11
|
+
* `model:` concept, has one with entirely different value semantics, or (a
|
|
12
|
+
* real, spec-documented failure mode for AntiGravity specifically — see
|
|
13
|
+
* below) can HANG the subagent process on an unmapped tool name.
|
|
14
|
+
*
|
|
15
|
+
* This module is the exhaustive per-client answer, keyed on `ClientId`
|
|
16
|
+
* (matching `COMPANION_AGENT_TARGETS`'s own key set, not the narrower
|
|
17
|
+
* `HarnessId` — every `ClientId` gets a companion-agent file written
|
|
18
|
+
* somewhere per `COMPANION_AGENT_TARGETS`, so every one needs a content
|
|
19
|
+
* decision here too). For each client:
|
|
20
|
+
*
|
|
21
|
+
* 1. Which frontmatter fields it accepts (`includeSkillsField`,
|
|
22
|
+
* `toolsPolicy`, `modelPolicy`, `extraFrontmatterLines`).
|
|
23
|
+
* 2. Its tool-identifier vocabulary and value SHAPE — `'claude-native'`
|
|
24
|
+
* (Skillsmith's internal tool names ARE that client's own names, emitted
|
|
25
|
+
* as a comma-separated scalar, no translation needed), `'mapped-array'`
|
|
26
|
+
* (the client has its OWN, confirmed-different tool vocabulary AND
|
|
27
|
+
* expects a YAML array rather than a scalar — translate through
|
|
28
|
+
* `toolNameMap`, silently drop any internal name with no confirmed
|
|
29
|
+
* mapping, and omit the field entirely if nothing maps), or `'omit'`
|
|
30
|
+
* (vocabulary not independently verified at all — never emit the field
|
|
31
|
+
* rather than guess a wrong value).
|
|
32
|
+
* 3. Its model-selection policy — `'claude-enum'` (accepts Claude's
|
|
33
|
+
* `haiku|sonnet|opus` values directly) or `'omit'` (either no `model:`
|
|
34
|
+
* concept at all, or one with value semantics that don't line up with
|
|
35
|
+
* Skillsmith's internal enum — including a DIFFERENT PROVIDER's own
|
|
36
|
+
* model-tier vocabulary, which is a family swap, not just a renaming).
|
|
37
|
+
*
|
|
38
|
+
* Confidence levels (style follows `../install/agent-harness-targets.ts`'s
|
|
39
|
+
* own header — HIGH/MEDIUM/LOW per client, dated citation, never asserted
|
|
40
|
+
* past what the citation actually supports):
|
|
41
|
+
*
|
|
42
|
+
* - **claude-code** — HIGH. Claude Code's own native subagent format
|
|
43
|
+
* (`.claude/agents/*.md`): `name`, `description`, `tools` (comma-separated
|
|
44
|
+
* Claude tool names), `model`. This is this repo's pre-existing behavior
|
|
45
|
+
* (unchanged by this wave) and matches `renderClaudeShim()`
|
|
46
|
+
* (`agent-pack/shims.ts`), which uses the identical `name`/`description`/
|
|
47
|
+
* `tools` frontmatter shape for the fixed named-agent shim.
|
|
48
|
+
* - **cursor** — HIGH, verified live against cursor.com/docs/subagents
|
|
49
|
+
* (fetched 2026-08-30): "Cursor recognizes subagent files across multiple
|
|
50
|
+
* directory formats: `.cursor/agents/` (Cursor format), `.claude/agents/`
|
|
51
|
+
* (Claude compatibility), `.codex/agents/` (Codex compatibility)."
|
|
52
|
+
* `COMPANION_AGENT_TARGETS.cursor` resolves to the SAME path as
|
|
53
|
+
* `claude-code` (`~/.claude/agents/<name>-specialist.md` — see that
|
|
54
|
+
* table's own comment: "Cursor 2.4+ reads `.claude/agents/` natively — no
|
|
55
|
+
* separate shim file"), so the file this generator actually writes for
|
|
56
|
+
* `--client cursor` is read by Cursor through that Claude-compatibility
|
|
57
|
+
* path and must carry genuine Claude-format frontmatter — this profile
|
|
58
|
+
* mirrors `claude-code`'s exactly (same object, not a coincidental
|
|
59
|
+
* duplicate). Cursor's OWN native `.cursor/agents/*.md` format is verified
|
|
60
|
+
* DIFFERENT (fields: `name`, `description`, `model` — values `inherit`,
|
|
61
|
+
* `fast`, or a hardcoded model ID, NOT Claude's `haiku|sonnet|opus` enum —
|
|
62
|
+
* `readonly`, `is_background`; explicitly NO `tools` field: "Subagents
|
|
63
|
+
* inherit all tools from the parent, including MCP tools from configured
|
|
64
|
+
* servers") but Skillsmith never writes to that native directory (no
|
|
65
|
+
* `.cursor/agents/` entry exists in `COMPANION_AGENT_TARGETS`), so that
|
|
66
|
+
* narrower native schema does not govern the file this generator produces.
|
|
67
|
+
* - **antigravity** — HIGH for the schema itself, verified live against
|
|
68
|
+
* `antigravity.google/docs/subagents/` (fetched 2026-08-30, cross-checked
|
|
69
|
+
* by an independent WebSearch and by Wayback snapshots bracketing
|
|
70
|
+
* 2026-08-06 through 2026-08-16 — see
|
|
71
|
+
* `docs/internal/implementation/smi-6276-subagent-true-antigravity-repro.md`
|
|
72
|
+
* for the full investigation, filed for the separate `subagent: true`
|
|
73
|
+
* question but covering this same schema). **Correction of SMI-5982's
|
|
74
|
+
* original sourcing**: that wave cited
|
|
75
|
+
* `antigravity.google/docs/cli/commands/agents` (the CLI `/agents` TUI
|
|
76
|
+
* command reference, whose example happens to show only `name`+
|
|
77
|
+
* `description`) as if it were the full schema. The real, richer schema
|
|
78
|
+
* lives at `/docs/subagents`: `name`, `description` (both required),
|
|
79
|
+
* `tools` (`string[]`, default `[]` — a YAML ARRAY, not a scalar, of
|
|
80
|
+
* AntiGravity's OWN tool names, e.g. `view_file`, `replace_file_content`,
|
|
81
|
+
* `grep_search`, `run_command` — confirmed DIFFERENT from Skillsmith's
|
|
82
|
+
* Claude-style names), `mainAgent`/`subagent` (booleans, both default
|
|
83
|
+
* `true` — the `subagent: true` question is Step 2's separate scope, not
|
|
84
|
+
* touched here), `model` (`inherit|flash|pro`, default `inherit` — NOT
|
|
85
|
+
* Claude's `haiku|sonnet|opus`), `commandExecutionPolicy`, `mcpServers`,
|
|
86
|
+
* `skills`/`plugins` (skill PATHS like `skills/my-helper-skill` — a
|
|
87
|
+
* DIFFERENT concept from Skillsmith's own `skills: <bare-name>` extension
|
|
88
|
+
* field below, not reused here for that reason).
|
|
89
|
+
*
|
|
90
|
+
* MEDIUM for the specific tool-name MAPPING used here: the docs page only
|
|
91
|
+
* gives 4 example tool names (not a complete enumeration), so
|
|
92
|
+
* `toolNameMap` below covers only those 4, mapped by clear name
|
|
93
|
+
* correspondence (`view_file`→Read, `replace_file_content`→Write/Edit,
|
|
94
|
+
* `grep_search`→Grep, `run_command`→Bash); Skillsmith's `Glob`, `WebFetch`,
|
|
95
|
+
* and `WebSearch` have no confirmed AntiGravity equivalent and are
|
|
96
|
+
* silently dropped, never guessed. This is deliberately a `'mapped-array'`
|
|
97
|
+
* policy rather than `'omit'`, unlike every other unverified-vocabulary
|
|
98
|
+
* client in this table: AntiGravity's own schema documents `tools`
|
|
99
|
+
* defaulting to `[]` (empty) when omitted — the OPPOSITE of Cursor's
|
|
100
|
+
* "inherits from parent" or Copilot's "all tools available" defaults — so
|
|
101
|
+
* omitting the field here would ship a companion subagent with literally
|
|
102
|
+
* ZERO tool access, not a harmlessly-permissive default. A confidently-cited
|
|
103
|
+
* partial mapping is more correct than that, and strictly safer than
|
|
104
|
+
* guessing at unconfirmed names: the same docs page's own "Known Issue
|
|
105
|
+
* (Tool Validation)" warns that "specifying an unmapped or misspelled tool
|
|
106
|
+
* name in the `tools` list may cause the subagent process to hang during
|
|
107
|
+
* execution" — every name emitted here is a name AntiGravity's own docs
|
|
108
|
+
* use as a worked example, never an invented one.
|
|
109
|
+
*
|
|
110
|
+
* `model:` is OMITTED for AntiGravity, not mapped — deliberately, not for
|
|
111
|
+
* lack of trying. AntiGravity's `flash`/`pro` are Gemini model tiers;
|
|
112
|
+
* Skillsmith's `haiku`/`sonnet`/`opus` are Claude model tiers. These are
|
|
113
|
+
* two DIFFERENT model families from two different vendors, not two
|
|
114
|
+
* spellings of the same capability scale — `haiku→flash` and `opus→pro`
|
|
115
|
+
* are plausible analogies, but `sonnet` (Skillsmith's own default "for
|
|
116
|
+
* balanced workloads", `determineModel()`) has no principled third rung to
|
|
117
|
+
* land on in a 2-tier scale, and no official source equates any Claude
|
|
118
|
+
* tier to any Gemini tier. Omitting the field uses AntiGravity's own
|
|
119
|
+
* documented default (`inherit` — defer to whatever tier the invoking
|
|
120
|
+
* session already uses), which is a real, working, spec-sanctioned value,
|
|
121
|
+
* not an absence of a decision.
|
|
122
|
+
* - **copilot** — MEDIUM, verified live against GitHub's own docs
|
|
123
|
+
* (docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-cloud-agent/create-custom-agents,
|
|
124
|
+
* fetched 2026-08-30): `.agent.md` frontmatter DOES support a `tools` list
|
|
125
|
+
* (documented examples: `"read"`, `"edit"`, `"search"`) and a `model`
|
|
126
|
+
* field. NOT verified: a full mapping from Skillsmith's own 8-tool
|
|
127
|
+
* vocabulary (`Read`/`Write`/`Edit`/`Bash`/`Grep`/`Glob`/`WebFetch`/
|
|
128
|
+
* `WebSearch`) onto Copilot's identifier set — only 2-3 of the 8 have a
|
|
129
|
+
* plausible lowercase counterpart in the documented examples, with no
|
|
130
|
+
* confirmed equivalents for `Bash`/`Grep`/`Glob`/`WebFetch` specifically.
|
|
131
|
+
* Unlike AntiGravity, Copilot's own docs confirm omission is SAFE here —
|
|
132
|
+
* "Omitting tools grants access to all available tools — the default is
|
|
133
|
+
* permissive" — so, per this wave's fallback rule, omit `tools:` rather
|
|
134
|
+
* than emit a guessed-wrong partial mapping; the omission doesn't cripple
|
|
135
|
+
* the subagent the way it would for AntiGravity. `model:` is likewise
|
|
136
|
+
* omitted — its value format (Copilot's own model catalog IDs) has no
|
|
137
|
+
* confirmed correspondence to Skillsmith's internal `haiku|sonnet|opus`
|
|
138
|
+
* abstraction.
|
|
139
|
+
* - **opencode** — MEDIUM, verified live against opencode.ai/v2/docs/agents/
|
|
140
|
+
* (fetched 2026-08-30): confirmed frontmatter fields `description`, `mode`
|
|
141
|
+
* (`primary|subagent|all`), `model` (`provider/model#variant` format — NOT
|
|
142
|
+
* Claude's `haiku|sonnet|opus` enum), `color`, `steps`, `permissions`. This
|
|
143
|
+
* repo's own `renderOpenCodeShim()` (`agent-pack/shims.ts`) already
|
|
144
|
+
* documents the load-bearing fact this profile reuses: "OpenCode's
|
|
145
|
+
* frontmatter `tools` field is a permission map, not a plain list; setting
|
|
146
|
+
* it wrong would restrict tools rather than reference them" — same
|
|
147
|
+
* precedent applied here, omitting `tools:` rather than writing a
|
|
148
|
+
* Claude-shaped value into a boolean-permission-map field (a different,
|
|
149
|
+
* harder mapping problem than AntiGravity's plain array — not attempted in
|
|
150
|
+
* this wave). `mode: subagent` IS included (HIGH confidence for this one
|
|
151
|
+
* line specifically — mirrors the already-shipped `renderOpenCodeShim()`
|
|
152
|
+
* verbatim). `model:` omitted — no confirmed mapping from Skillsmith's
|
|
153
|
+
* internal enum to OpenCode's `provider/model` format.
|
|
154
|
+
* - **windsurf** — LOW. No independently confirmed per-subagent-file
|
|
155
|
+
* frontmatter schema for tool/model restriction was found; Windsurf's
|
|
156
|
+
* Cascade agent runtime is additionally documented as being retired (EOL
|
|
157
|
+
* 2026-07-01, superseded by Devin Local). Omit `tools:` and `model:`,
|
|
158
|
+
* matching this table's existing conservative default for windsurf
|
|
159
|
+
* (`COMPANION_AGENT_TARGETS.windsurf`'s own comment: "No
|
|
160
|
+
* `AGENT_SHIM_TARGETS` entry exists for windsurf ... defaults to today's
|
|
161
|
+
* actual behavior" — that comment covers the file PATH only; this module
|
|
162
|
+
* makes the equivalent conservative call for the file's CONTENT).
|
|
163
|
+
* - **agents** — LOW. This `ClientId` is the generic cross-agent /
|
|
164
|
+
* `AGENTS.md` convention (also Codex's install target — "Codex: reads
|
|
165
|
+
* ONLY `~/.agents/skills`", `../install/paths.ts`'s own header comment).
|
|
166
|
+
* The `AGENTS.md` standard itself has no required fields and no YAML
|
|
167
|
+
* frontmatter for its single project-instructions file (openai/codex's own
|
|
168
|
+
* `AGENTS.md`; agents.md spec) — there is no confirmed per-agent-definition
|
|
169
|
+
* file schema with tool/model fields for this identifier at all. Omit
|
|
170
|
+
* `tools:` and `model:`.
|
|
171
|
+
* - **hermes** — LOW. Hermes's own documented frontmatter
|
|
172
|
+
* (hermes-agent.nousresearch.com/docs/) is for SKILL files (`name`,
|
|
173
|
+
* `description`, `version`, `author`, `platforms`), not a separate
|
|
174
|
+
* subagent-definition schema with tool/model restriction fields. Omit
|
|
175
|
+
* `tools:` and `model:`.
|
|
176
|
+
* - **grok** — LOW. Grok Build (docs.x.ai/build/overview,
|
|
177
|
+
* github.com/xai-org/grok-build) confirms agent frontmatter EXISTS
|
|
178
|
+
* ("Subagents can declare their own `mcpServers` in agent frontmatter") but
|
|
179
|
+
* no built-in tool-identifier vocabulary or Claude-comparable model enum is
|
|
180
|
+
* documented. Omit `tools:` and `model:`.
|
|
181
|
+
*
|
|
182
|
+
* @see docs/internal/implementation/cursor-antigravity-tier-parity-plan.md (Wave 6 Step 1)
|
|
183
|
+
* @see docs/internal/implementation/smi-6276-subagent-true-antigravity-repro.md (AntiGravity schema source-of-truth)
|
|
184
|
+
*/
|
|
185
|
+
import { type ClientId } from '../install/paths.js';
|
|
186
|
+
/**
|
|
187
|
+
* `'claude-native'` — Skillsmith's internal tool names (`Read`, `Write`,
|
|
188
|
+
* `Edit`, `Bash`, `Grep`, `Glob`, `WebFetch`, `WebSearch`) ARE this client's
|
|
189
|
+
* own tool-identifier vocabulary; emit `tools:` as a plain comma-separated
|
|
190
|
+
* scalar list, no translation needed.
|
|
191
|
+
*
|
|
192
|
+
* `'mapped-array'` — this client has its OWN, confirmed-different tool
|
|
193
|
+
* vocabulary AND expects `tools:` as a YAML array (not a scalar). Translate
|
|
194
|
+
* through the profile's `toolNameMap`; any internal name with no confirmed
|
|
195
|
+
* entry is silently dropped (never guessed), and the field is omitted
|
|
196
|
+
* entirely if the mapped result is empty.
|
|
197
|
+
*
|
|
198
|
+
* `'omit'` — this client's tool vocabulary (or its `tools:` field's VALUE
|
|
199
|
+
* shape) has not been independently verified to accept Skillsmith's internal
|
|
200
|
+
* names as-is, and omitting the field is either safe (permissive default,
|
|
201
|
+
* e.g. Copilot) or the only defensible choice given no evidence at all.
|
|
202
|
+
* Never emit a guessed-wrong value.
|
|
203
|
+
*/
|
|
204
|
+
export type SubagentToolsPolicy = 'claude-native' | 'mapped-array' | 'omit';
|
|
205
|
+
/**
|
|
206
|
+
* `'claude-enum'` — this client accepts a `model:` field whose values are
|
|
207
|
+
* (or are compatible with) Skillsmith's internal `haiku|sonnet|opus` enum.
|
|
208
|
+
*
|
|
209
|
+
* `'omit'` — either no `model:` concept exists for this client, or its
|
|
210
|
+
* value semantics (a hardcoded model ID, a `provider/model` string, a
|
|
211
|
+
* different vendor's own model-tier vocabulary, an `inherit`/`fast`
|
|
212
|
+
* keyword, etc.) don't correspond to Skillsmith's internal enum. Omit the
|
|
213
|
+
* field rather than emit a value the client would reject, silently ignore,
|
|
214
|
+
* or (worse) apply as a real but wrong model selection.
|
|
215
|
+
*/
|
|
216
|
+
export type SubagentModelPolicy = 'claude-enum' | 'omit';
|
|
217
|
+
/** Per-client shape of the generated companion-subagent file's frontmatter. */
|
|
218
|
+
export interface SubagentGenerationProfile {
|
|
219
|
+
/** How well-evidenced this profile's fields are (see module header). */
|
|
220
|
+
confidence: 'HIGH' | 'MEDIUM' | 'LOW';
|
|
221
|
+
/** One-line pointer to the citation backing this profile (see module header for the full text). */
|
|
222
|
+
citation: string;
|
|
223
|
+
/**
|
|
224
|
+
* Whether to emit Skillsmith's own `skills: <skill-name>` extension field
|
|
225
|
+
* (a Skillsmith convention — a bare skill name — not any external
|
|
226
|
+
* harness's own field of the same name, e.g. AntiGravity's `skills:`
|
|
227
|
+
* expects PATHS and is a different concept) — kept true only for clients
|
|
228
|
+
* this generator has always emitted it for.
|
|
229
|
+
*/
|
|
230
|
+
includeSkillsField: boolean;
|
|
231
|
+
toolsPolicy: SubagentToolsPolicy;
|
|
232
|
+
/**
|
|
233
|
+
* Skillsmith-internal tool name -> this client's own tool identifier.
|
|
234
|
+
* Only present (and only meaningful) when `toolsPolicy === 'mapped-array'`.
|
|
235
|
+
* An internal name with no entry here is silently dropped, never guessed.
|
|
236
|
+
*/
|
|
237
|
+
toolNameMap?: Readonly<Record<string, string>>;
|
|
238
|
+
modelPolicy: SubagentModelPolicy;
|
|
239
|
+
/**
|
|
240
|
+
* Static frontmatter lines specific to this client, appended after
|
|
241
|
+
* `tools:` (when present) and before `model:` (when present). Empty for
|
|
242
|
+
* every client except OpenCode's `mode: subagent`.
|
|
243
|
+
*/
|
|
244
|
+
extraFrontmatterLines: readonly string[];
|
|
245
|
+
}
|
|
246
|
+
export declare const SUBAGENT_CLIENT_PROFILES: Readonly<Record<ClientId, SubagentGenerationProfile>>;
|
|
247
|
+
/** Resolve the per-client generation profile for `client` (default: canonical / claude-code). */
|
|
248
|
+
export declare function getSubagentGenerationProfile(client?: ClientId): SubagentGenerationProfile;
|
|
249
|
+
/**
|
|
250
|
+
* Translate Skillsmith-internal tool names through `profile.toolNameMap`,
|
|
251
|
+
* dropping any name with no confirmed entry and de-duplicating the result
|
|
252
|
+
* (two internal names can map to the same client tool, e.g. AntiGravity's
|
|
253
|
+
* `Write`/`Edit` -> `replace_file_content`). Returns `[]` when nothing maps
|
|
254
|
+
* — callers must omit the `tools:` field entirely in that case, not emit an
|
|
255
|
+
* empty array, per this module's own fallback philosophy.
|
|
256
|
+
*/
|
|
257
|
+
export declare function mapToolNames(tools: readonly string[], profile: SubagentGenerationProfile): string[];
|
|
258
|
+
//# sourceMappingURL=SubagentGenerator.client-profiles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubagentGenerator.client-profiles.d.ts","sourceRoot":"","sources":["../../../src/services/SubagentGenerator.client-profiles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuLG;AAEH,OAAO,EAAoB,KAAK,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAErE;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,mBAAmB,GAAG,eAAe,GAAG,cAAc,GAAG,MAAM,CAAA;AAE3E;;;;;;;;;;GAUG;AACH,MAAM,MAAM,mBAAmB,GAAG,aAAa,GAAG,MAAM,CAAA;AAExD,+EAA+E;AAC/E,MAAM,WAAW,yBAAyB;IACxC,wEAAwE;IACxE,UAAU,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAA;IACrC,mGAAmG;IACnG,QAAQ,EAAE,MAAM,CAAA;IAChB;;;;;;OAMG;IACH,kBAAkB,EAAE,OAAO,CAAA;IAC3B,WAAW,EAAE,mBAAmB,CAAA;IAChC;;;;OAIG;IACH,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;IAC9C,WAAW,EAAE,mBAAmB,CAAA;IAChC;;;;OAIG;IACH,qBAAqB,EAAE,SAAS,MAAM,EAAE,CAAA;CACzC;AA4CD,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE,yBAAyB,CAAC,CA0C1F,CAAA;AAED,iGAAiG;AACjG,wBAAgB,4BAA4B,CAC1C,MAAM,GAAE,QAA2B,GAClC,yBAAyB,CAE3B;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,OAAO,EAAE,yBAAyB,GACjC,MAAM,EAAE,CAIV"}
|