@bonesofspring/ai-rules 0.2.64 → 0.2.65
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 +46 -11
- package/README.md +6 -6
- package/bin/lib/engine-scripts.js +14 -5
- package/bin/lib/seed-ai-local-team.js +7 -0
- package/docs/PRESET-CONTRIBUTION.md +41 -0
- package/docs/TEAM-DB.md +193 -52
- package/docs/openapi/team-db.v1.json +1238 -377
- package/mcp/defectdojo-mcp.mjs +7 -5
- package/mcp/lib/defectdojo.mjs +26 -14
- package/package.json +26 -20
- package/presets/_shared/ai-local/scripts/process-lease.mjs +576 -0
- package/presets/_shared/ai-local/scripts/processes.mjs +1618 -0
- package/presets/_shared/ai-local/scripts/run.mjs +5 -5
- package/presets/_shared/ai-local/scripts/team-db-api.mjs +465 -152
- package/presets/_shared/ai-local/scripts/team-db-dashboard.mjs +235 -10
- package/presets/_shared/ai-local/scripts/team-db-openapi.mjs +416 -176
- package/presets/_shared/ai-local/scripts/team-db-project.mjs +171 -62
- package/presets/_shared/ai-local/scripts/team-db-scheduler.mjs +4 -0
- package/presets/_shared/ai-local/scripts/team-db-schema.mjs +143 -5
- package/presets/_shared/ai-local/scripts/team-db-task-runner.mjs +567 -0
- package/presets/_shared/ai-local/scripts/{team-db-backlog.mjs → team-db-tracker.mjs} +900 -197
- package/presets/_shared/ai-local/scripts/team-db-ui.mjs +750 -0
- package/presets/_shared/ai-local/scripts/team-db.mjs +104 -23
- package/presets/_shared/core/agent-team/agent-team-orchestrator.md +1 -1
- package/presets/_shared/hooks/chain-team-phases.sh.tmpl +105 -17
- package/presets/_shared/hooks/guard-shell-command.mjs.tmpl +40 -2
- package/presets/claude/android-kotlin/hooks/chain-team-phases.sh +105 -17
- package/presets/claude/android-kotlin/hooks/guard-shell-command.mjs +41 -2
- package/presets/claude/android-kotlin/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
- package/presets/claude/android-kotlin/settings.json +6 -1
- package/presets/claude/go/hooks/chain-team-phases.sh +105 -17
- package/presets/claude/go/hooks/guard-shell-command.mjs +41 -2
- package/presets/claude/go/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
- package/presets/claude/go/settings.json +6 -1
- package/presets/claude/ios-swift/hooks/chain-team-phases.sh +105 -17
- package/presets/claude/ios-swift/hooks/guard-shell-command.mjs +41 -2
- package/presets/claude/ios-swift/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
- package/presets/claude/ios-swift/settings.json +6 -1
- package/presets/claude/java/hooks/chain-team-phases.sh +105 -17
- package/presets/claude/java/hooks/guard-shell-command.mjs +41 -2
- package/presets/claude/java/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
- package/presets/claude/java/settings.json +6 -1
- package/presets/claude/mcp-ts/hooks/chain-team-phases.sh +105 -17
- package/presets/claude/mcp-ts/hooks/guard-shell-command.mjs +41 -2
- package/presets/claude/mcp-ts/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
- package/presets/claude/mcp-ts/settings.json +6 -1
- package/presets/claude/mol/hooks/chain-team-phases.sh +105 -17
- package/presets/claude/mol/hooks/guard-shell-command.mjs +41 -2
- package/presets/claude/mol/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
- package/presets/claude/mol/settings.json +6 -1
- package/presets/claude/next/MCP.md +2 -0
- package/presets/claude/next/REPO_AGENTS.md +2 -0
- package/presets/claude/next/agents/build-verifier.md +1 -1
- package/presets/claude/next/agents/ci-investigator.md +3 -0
- package/presets/claude/next/agents/debugger.md +3 -0
- package/presets/claude/next/agents/feature-developer.md +3 -0
- package/presets/claude/next/agents/mockup-reviewer.md +2 -0
- package/presets/claude/next/agents/performance-auditor.md +2 -0
- package/presets/claude/next/agents/playwright-test-generator.md +3 -0
- package/presets/claude/next/agents/playwright-test-healer.md +3 -0
- package/presets/claude/next/agents/playwright-test-planner.md +3 -0
- package/presets/claude/next/agents/qa-tester.md +3 -0
- package/presets/claude/next/commands/README.md +6 -0
- package/presets/claude/next/commands/ui-start.md +78 -0
- package/presets/claude/next/commands/ui-stop.md +71 -0
- package/presets/claude/next/hooks/chain-team-phases.sh +105 -17
- package/presets/claude/next/hooks/guard-shell-command.mjs +41 -2
- package/presets/claude/next/rules/README.md +2 -1
- package/presets/claude/next/rules/stack/next-app-core.md +1 -0
- package/presets/claude/next/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
- package/presets/claude/next/rules/tooling-and-review/dev-process-lifecycle.md +43 -0
- package/presets/claude/next/settings.json +6 -1
- package/presets/claude/nuxt/hooks/chain-team-phases.sh +105 -17
- package/presets/claude/nuxt/hooks/guard-shell-command.mjs +41 -2
- package/presets/claude/nuxt/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
- package/presets/claude/nuxt/settings.json +6 -1
- package/presets/claude/php-hexagonal/hooks/chain-team-phases.sh +105 -17
- package/presets/claude/php-hexagonal/hooks/guard-shell-command.mjs +41 -2
- package/presets/claude/php-hexagonal/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
- package/presets/claude/php-hexagonal/settings.json +6 -1
- package/presets/claude/php-laravel/hooks/chain-team-phases.sh +106 -18
- package/presets/claude/php-laravel/hooks/guard-shell-command.mjs +41 -2
- package/presets/claude/php-laravel/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
- package/presets/claude/php-laravel/settings.json +6 -1
- package/presets/claude/svelte/hooks/chain-team-phases.sh +105 -17
- package/presets/claude/svelte/hooks/guard-shell-command.mjs +41 -2
- package/presets/claude/svelte/rules/tooling-and-review/agent-team-orchestrator.md +1 -1
- package/presets/claude/svelte/settings.json +6 -1
- package/presets/cursor/android-kotlin/hooks/chain-team-phases.sh +105 -17
- package/presets/cursor/android-kotlin/hooks/guard-shell-command.mjs +41 -2
- package/presets/cursor/go/hooks/chain-team-phases.sh +105 -17
- package/presets/cursor/go/hooks/guard-shell-command.mjs +41 -2
- package/presets/cursor/ios-swift/hooks/chain-team-phases.sh +105 -17
- package/presets/cursor/ios-swift/hooks/guard-shell-command.mjs +41 -2
- package/presets/cursor/java/hooks/chain-team-phases.sh +105 -17
- package/presets/cursor/java/hooks/guard-shell-command.mjs +41 -2
- package/presets/cursor/mcp-ts/hooks/chain-team-phases.sh +105 -17
- package/presets/cursor/mcp-ts/hooks/guard-shell-command.mjs +41 -2
- package/presets/cursor/mol/hooks/chain-team-phases.sh +105 -17
- package/presets/cursor/mol/hooks/guard-shell-command.mjs +41 -2
- package/presets/cursor/next/MCP.md +2 -0
- package/presets/cursor/next/REPO_AGENTS.md +2 -0
- package/presets/cursor/next/agents/build-verifier.md +1 -1
- package/presets/cursor/next/agents/ci-investigator.md +2 -0
- package/presets/cursor/next/agents/debugger.md +2 -0
- package/presets/cursor/next/agents/feature-developer.md +2 -0
- package/presets/cursor/next/agents/mockup-reviewer.md +2 -0
- package/presets/cursor/next/agents/performance-auditor.md +2 -0
- package/presets/cursor/next/agents/playwright-test-generator.md +2 -0
- package/presets/cursor/next/agents/playwright-test-healer.md +2 -0
- package/presets/cursor/next/agents/playwright-test-planner.md +2 -0
- package/presets/cursor/next/agents/qa-tester.md +2 -0
- package/presets/cursor/next/ai-local/rules-library/storybook-dev-compare-figma.md +1 -1
- package/presets/cursor/next/commands/README.md +6 -0
- package/presets/cursor/next/commands/ui-start.md +78 -0
- package/presets/cursor/next/commands/ui-stop.md +71 -0
- package/presets/cursor/next/hooks/chain-team-phases.sh +105 -17
- package/presets/cursor/next/hooks/guard-shell-command.mjs +41 -2
- package/presets/cursor/next/rules/README.md +2 -1
- package/presets/cursor/next/rules/dev-process-lifecycle.mdc +43 -0
- package/presets/cursor/next/rules/next-app-core.mdc +1 -0
- package/presets/cursor/nuxt/hooks/chain-team-phases.sh +105 -17
- package/presets/cursor/nuxt/hooks/guard-shell-command.mjs +41 -2
- package/presets/cursor/php-hexagonal/hooks/chain-team-phases.sh +105 -17
- package/presets/cursor/php-hexagonal/hooks/guard-shell-command.mjs +41 -2
- package/presets/cursor/php-laravel/hooks/chain-team-phases.sh +106 -18
- package/presets/cursor/php-laravel/hooks/guard-shell-command.mjs +41 -2
- package/presets/cursor/svelte/hooks/chain-team-phases.sh +105 -17
- package/presets/cursor/svelte/hooks/guard-shell-command.mjs +41 -2
- package/presets/mavis/android-kotlin/adapter-map.json +1 -1
- package/presets/mavis/android-kotlin/hooks/chain-team-phases.sh +105 -17
- package/presets/mavis/android-kotlin/rules/agent-team-orchestrator.md +1 -1
- package/presets/mavis/go/adapter-map.json +1 -1
- package/presets/mavis/go/hooks/chain-team-phases.sh +105 -17
- package/presets/mavis/go/rules/agent-team-orchestrator.md +1 -1
- package/presets/mavis/ios-swift/adapter-map.json +1 -1
- package/presets/mavis/ios-swift/hooks/chain-team-phases.sh +105 -17
- package/presets/mavis/ios-swift/rules/agent-team-orchestrator.md +1 -1
- package/presets/mavis/java/adapter-map.json +1 -1
- package/presets/mavis/java/hooks/chain-team-phases.sh +105 -17
- package/presets/mavis/java/rules/agent-team-orchestrator.md +1 -1
- package/presets/mavis/mcp-ts/adapter-map.json +1 -1
- package/presets/mavis/mcp-ts/hooks/chain-team-phases.sh +105 -17
- package/presets/mavis/mcp-ts/rules/agent-team-orchestrator.md +1 -1
- package/presets/mavis/mol/adapter-map.json +1 -1
- package/presets/mavis/mol/hooks/chain-team-phases.sh +105 -17
- package/presets/mavis/mol/rules/agent-team-orchestrator.md +1 -1
- package/presets/mavis/next/MCP.md +2 -0
- package/presets/mavis/next/REPO_AGENTS.md +2 -0
- package/presets/mavis/next/adapter-map.json +25 -1
- package/presets/mavis/next/agents/build-verifier.md +1 -1
- package/presets/mavis/next/agents/ci-investigator.md +3 -0
- package/presets/mavis/next/agents/debugger.md +3 -0
- package/presets/mavis/next/agents/feature-developer.md +3 -0
- package/presets/mavis/next/agents/mockup-reviewer.md +2 -0
- package/presets/mavis/next/agents/performance-auditor.md +2 -0
- package/presets/mavis/next/agents/playwright-test-generator.md +3 -0
- package/presets/mavis/next/agents/playwright-test-healer.md +3 -0
- package/presets/mavis/next/agents/playwright-test-planner.md +3 -0
- package/presets/mavis/next/agents/qa-tester.md +3 -0
- package/presets/mavis/next/ai-local/rules-library/storybook-dev-compare-figma.md +1 -1
- package/presets/mavis/next/commands/README.md +6 -0
- package/presets/mavis/next/commands/ui-start.md +73 -0
- package/presets/mavis/next/commands/ui-stop.md +66 -0
- package/presets/mavis/next/hooks/chain-team-phases.sh +105 -17
- package/presets/mavis/next/rules/agent-team-orchestrator.md +1 -1
- package/presets/mavis/next/rules/dev-process-lifecycle.md +38 -0
- package/presets/mavis/next/rules/next-app-core.md +1 -0
- package/presets/mavis/nuxt/adapter-map.json +1 -1
- package/presets/mavis/nuxt/hooks/chain-team-phases.sh +105 -17
- package/presets/mavis/nuxt/rules/agent-team-orchestrator.md +1 -1
- package/presets/mavis/php-hexagonal/adapter-map.json +1 -1
- package/presets/mavis/php-hexagonal/hooks/chain-team-phases.sh +105 -17
- package/presets/mavis/php-hexagonal/rules/agent-team-orchestrator.md +1 -1
- package/presets/mavis/php-laravel/adapter-map.json +1 -1
- package/presets/mavis/php-laravel/hooks/chain-team-phases.sh +106 -18
- package/presets/mavis/php-laravel/rules/agent-team-orchestrator.md +1 -1
- package/presets/mavis/svelte/adapter-map.json +1 -1
- package/presets/mavis/svelte/hooks/chain-team-phases.sh +105 -17
- package/presets/mavis/svelte/rules/agent-team-orchestrator.md +1 -1
- package/presets/opencode/android-kotlin/adapter-map.json +1 -1
- package/presets/opencode/android-kotlin/hooks/chain-team-phases.sh +105 -17
- package/presets/opencode/android-kotlin/opencode.json +5 -1
- package/presets/opencode/android-kotlin/rules/agent-team-orchestrator.md +1 -1
- package/presets/opencode/go/adapter-map.json +1 -1
- package/presets/opencode/go/hooks/chain-team-phases.sh +105 -17
- package/presets/opencode/go/opencode.json +5 -1
- package/presets/opencode/go/rules/agent-team-orchestrator.md +1 -1
- package/presets/opencode/ios-swift/adapter-map.json +1 -1
- package/presets/opencode/ios-swift/hooks/chain-team-phases.sh +105 -17
- package/presets/opencode/ios-swift/opencode.json +5 -1
- package/presets/opencode/ios-swift/rules/agent-team-orchestrator.md +1 -1
- package/presets/opencode/java/adapter-map.json +1 -1
- package/presets/opencode/java/hooks/chain-team-phases.sh +105 -17
- package/presets/opencode/java/opencode.json +5 -1
- package/presets/opencode/java/rules/agent-team-orchestrator.md +1 -1
- package/presets/opencode/mcp-ts/adapter-map.json +1 -1
- package/presets/opencode/mcp-ts/hooks/chain-team-phases.sh +105 -17
- package/presets/opencode/mcp-ts/opencode.json +5 -1
- package/presets/opencode/mcp-ts/rules/agent-team-orchestrator.md +1 -1
- package/presets/opencode/mol/adapter-map.json +1 -1
- package/presets/opencode/mol/hooks/chain-team-phases.sh +105 -17
- package/presets/opencode/mol/opencode.json +4 -0
- package/presets/opencode/mol/rules/agent-team-orchestrator.md +1 -1
- package/presets/opencode/next/MCP.md +2 -0
- package/presets/opencode/next/REPO_AGENTS.md +2 -0
- package/presets/opencode/next/adapter-map.json +25 -1
- package/presets/opencode/next/agents/build-verifier.md +1 -1
- package/presets/opencode/next/agents/ci-investigator.md +3 -0
- package/presets/opencode/next/agents/debugger.md +3 -0
- package/presets/opencode/next/agents/feature-developer.md +3 -0
- package/presets/opencode/next/agents/mockup-reviewer.md +2 -0
- package/presets/opencode/next/agents/performance-auditor.md +2 -0
- package/presets/opencode/next/agents/playwright-test-generator.md +3 -0
- package/presets/opencode/next/agents/playwright-test-healer.md +3 -0
- package/presets/opencode/next/agents/playwright-test-planner.md +3 -0
- package/presets/opencode/next/agents/qa-tester.md +3 -0
- package/presets/opencode/next/ai-local/rules-library/storybook-dev-compare-figma.md +1 -1
- package/presets/opencode/next/commands/README.md +6 -0
- package/presets/opencode/next/commands/ui-start.md +81 -0
- package/presets/opencode/next/commands/ui-stop.md +74 -0
- package/presets/opencode/next/hooks/chain-team-phases.sh +105 -17
- package/presets/opencode/next/opencode.json +4 -0
- package/presets/opencode/next/rules/agent-team-orchestrator.md +1 -1
- package/presets/opencode/next/rules/dev-process-lifecycle.md +38 -0
- package/presets/opencode/next/rules/next-app-core.md +1 -0
- package/presets/opencode/nuxt/adapter-map.json +1 -1
- package/presets/opencode/nuxt/hooks/chain-team-phases.sh +105 -17
- package/presets/opencode/nuxt/opencode.json +4 -0
- package/presets/opencode/nuxt/rules/agent-team-orchestrator.md +1 -1
- package/presets/opencode/php-hexagonal/adapter-map.json +1 -1
- package/presets/opencode/php-hexagonal/hooks/chain-team-phases.sh +105 -17
- package/presets/opencode/php-hexagonal/opencode.json +5 -1
- package/presets/opencode/php-hexagonal/rules/agent-team-orchestrator.md +1 -1
- package/presets/opencode/php-laravel/adapter-map.json +1 -1
- package/presets/opencode/php-laravel/hooks/chain-team-phases.sh +106 -18
- package/presets/opencode/php-laravel/opencode.json +5 -1
- package/presets/opencode/php-laravel/rules/agent-team-orchestrator.md +1 -1
- package/presets/opencode/svelte/adapter-map.json +1 -1
- package/presets/opencode/svelte/hooks/chain-team-phases.sh +105 -17
- package/presets/opencode/svelte/opencode.json +4 -0
- package/presets/opencode/svelte/rules/agent-team-orchestrator.md +1 -1
- package/presets/zcode/android-kotlin/adapter-map.json +1 -1
- package/presets/zcode/android-kotlin/hooks/chain-team-phases.sh +105 -17
- package/presets/zcode/android-kotlin/rules/agent-team-orchestrator.md +1 -1
- package/presets/zcode/go/adapter-map.json +1 -1
- package/presets/zcode/go/hooks/chain-team-phases.sh +105 -17
- package/presets/zcode/go/rules/agent-team-orchestrator.md +1 -1
- package/presets/zcode/ios-swift/adapter-map.json +1 -1
- package/presets/zcode/ios-swift/hooks/chain-team-phases.sh +105 -17
- package/presets/zcode/ios-swift/rules/agent-team-orchestrator.md +1 -1
- package/presets/zcode/java/adapter-map.json +1 -1
- package/presets/zcode/java/hooks/chain-team-phases.sh +105 -17
- package/presets/zcode/java/rules/agent-team-orchestrator.md +1 -1
- package/presets/zcode/mcp-ts/adapter-map.json +1 -1
- package/presets/zcode/mcp-ts/hooks/chain-team-phases.sh +105 -17
- package/presets/zcode/mcp-ts/rules/agent-team-orchestrator.md +1 -1
- package/presets/zcode/mol/adapter-map.json +1 -1
- package/presets/zcode/mol/hooks/chain-team-phases.sh +105 -17
- package/presets/zcode/mol/rules/agent-team-orchestrator.md +1 -1
- package/presets/zcode/next/MCP.md +2 -0
- package/presets/zcode/next/REPO_AGENTS.md +2 -0
- package/presets/zcode/next/adapter-map.json +25 -1
- package/presets/zcode/next/agents/build-verifier.md +1 -1
- package/presets/zcode/next/agents/ci-investigator.md +3 -0
- package/presets/zcode/next/agents/debugger.md +3 -0
- package/presets/zcode/next/agents/feature-developer.md +3 -0
- package/presets/zcode/next/agents/mockup-reviewer.md +2 -0
- package/presets/zcode/next/agents/performance-auditor.md +2 -0
- package/presets/zcode/next/agents/playwright-test-generator.md +3 -0
- package/presets/zcode/next/agents/playwright-test-healer.md +3 -0
- package/presets/zcode/next/agents/playwright-test-planner.md +3 -0
- package/presets/zcode/next/agents/qa-tester.md +3 -0
- package/presets/zcode/next/ai-local/rules-library/storybook-dev-compare-figma.md +1 -1
- package/presets/zcode/next/commands/README.md +6 -0
- package/presets/zcode/next/commands/ui-start.md +81 -0
- package/presets/zcode/next/commands/ui-stop.md +74 -0
- package/presets/zcode/next/hooks/chain-team-phases.sh +105 -17
- package/presets/zcode/next/rules/agent-team-orchestrator.md +1 -1
- package/presets/zcode/next/rules/dev-process-lifecycle.md +38 -0
- package/presets/zcode/next/rules/next-app-core.md +1 -0
- package/presets/zcode/nuxt/adapter-map.json +1 -1
- package/presets/zcode/nuxt/hooks/chain-team-phases.sh +105 -17
- package/presets/zcode/nuxt/rules/agent-team-orchestrator.md +1 -1
- package/presets/zcode/php-hexagonal/adapter-map.json +1 -1
- package/presets/zcode/php-hexagonal/hooks/chain-team-phases.sh +105 -17
- package/presets/zcode/php-hexagonal/rules/agent-team-orchestrator.md +1 -1
- package/presets/zcode/php-laravel/adapter-map.json +1 -1
- package/presets/zcode/php-laravel/hooks/chain-team-phases.sh +106 -18
- package/presets/zcode/php-laravel/rules/agent-team-orchestrator.md +1 -1
- package/presets/zcode/svelte/adapter-map.json +1 -1
- package/presets/zcode/svelte/hooks/chain-team-phases.sh +105 -17
- package/presets/zcode/svelte/rules/agent-team-orchestrator.md +1 -1
package/mcp/defectdojo-mcp.mjs
CHANGED
|
@@ -8,15 +8,15 @@
|
|
|
8
8
|
* `.env.defectdojo`; the token is never written by this package.
|
|
9
9
|
*/
|
|
10
10
|
import { readFileSync } from 'node:fs';
|
|
11
|
-
import { basename
|
|
11
|
+
import { basename } from 'node:path';
|
|
12
12
|
import { createInterface } from 'node:readline';
|
|
13
13
|
import {
|
|
14
14
|
ApiError,
|
|
15
15
|
ConfigError,
|
|
16
|
-
isAllowedImportPath,
|
|
17
16
|
isAllowedPath,
|
|
18
17
|
loadDefectDojoConfig,
|
|
19
18
|
request,
|
|
19
|
+
resolveImportPath,
|
|
20
20
|
} from './lib/defectdojo.mjs';
|
|
21
21
|
|
|
22
22
|
const PROTOCOL_VERSION = '2025-06-18';
|
|
@@ -208,14 +208,16 @@ function requireInteger(value, name) {
|
|
|
208
208
|
}
|
|
209
209
|
|
|
210
210
|
function readFileForImport(root, file) {
|
|
211
|
-
|
|
211
|
+
// Read the resolved path, never re-resolve the raw argument: the validated
|
|
212
|
+
// object and the uploaded object must be the same filesystem entry.
|
|
213
|
+
const absolute = resolveImportPath(root, file);
|
|
214
|
+
|
|
215
|
+
if (absolute === null) {
|
|
212
216
|
throw new ConfigError(
|
|
213
217
|
'file must be a repo-relative path inside the project root; absolute paths, ".." traversal and symlink escapes are refused',
|
|
214
218
|
);
|
|
215
219
|
}
|
|
216
220
|
|
|
217
|
-
const absolute = resolve(root, file);
|
|
218
|
-
|
|
219
221
|
return { buffer: readFileSync(absolute), name: basename(absolute) };
|
|
220
222
|
}
|
|
221
223
|
|
package/mcp/lib/defectdojo.mjs
CHANGED
|
@@ -166,40 +166,52 @@ export function isAllowedPath(path, baseUrl) {
|
|
|
166
166
|
* under the *real* project root: a symlink that leaves the root is an escape,
|
|
167
167
|
* not a read. Deny closed: an unreadable, unresolvable, or malformed-encoding
|
|
168
168
|
* path is a refusal, never a best-effort read.
|
|
169
|
+
*
|
|
170
|
+
* Returns the real path the caller must read. Resolving the name once is
|
|
171
|
+
* deliberate: a validator that trims and a reader that resolves the raw input
|
|
172
|
+
* can approve one filesystem object and read another (a whitespace-padded
|
|
173
|
+
* symlink alias is a distinct directory entry on POSIX). Padded names are
|
|
174
|
+
* refused, never trimmed, for the same reason.
|
|
169
175
|
*/
|
|
170
|
-
export function
|
|
171
|
-
if (typeof root !== 'string' || root === '' || typeof input !== 'string' || input
|
|
172
|
-
return
|
|
176
|
+
export function resolveImportPath(root, input) {
|
|
177
|
+
if (typeof root !== 'string' || root === '' || typeof input !== 'string' || input === '') {
|
|
178
|
+
return null;
|
|
179
|
+
}
|
|
180
|
+
if (input.trim() === '' || input !== input.trim()) {
|
|
181
|
+
return null;
|
|
173
182
|
}
|
|
174
183
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
if (isAbsolute(trimmed) || /^[a-zA-Z]:[/\\]/.test(trimmed) || trimmed.startsWith('\\\\')) {
|
|
178
|
-
return false;
|
|
184
|
+
if (isAbsolute(input) || /^[a-zA-Z]:[/\\]/.test(input) || input.startsWith('\\\\')) {
|
|
185
|
+
return null;
|
|
179
186
|
}
|
|
180
187
|
|
|
181
|
-
const forms = [
|
|
188
|
+
const forms = [input];
|
|
182
189
|
try {
|
|
183
|
-
forms.push(decodeURIComponent(
|
|
190
|
+
forms.push(decodeURIComponent(input));
|
|
184
191
|
} catch {
|
|
185
|
-
return
|
|
192
|
+
return null;
|
|
186
193
|
}
|
|
187
194
|
|
|
188
195
|
for (const form of forms) {
|
|
189
196
|
if (form.split(/[\\/]/).includes('..')) {
|
|
190
|
-
return
|
|
197
|
+
return null;
|
|
191
198
|
}
|
|
192
199
|
}
|
|
193
200
|
|
|
194
201
|
try {
|
|
195
202
|
const realRoot = realpathSync(root);
|
|
196
|
-
const realFile = realpathSync(resolve(root,
|
|
197
|
-
return realFile === realRoot || realFile.startsWith(realRoot + sep);
|
|
203
|
+
const realFile = realpathSync(resolve(root, input));
|
|
204
|
+
return realFile === realRoot || realFile.startsWith(realRoot + sep) ? realFile : null;
|
|
198
205
|
} catch {
|
|
199
|
-
return
|
|
206
|
+
return null;
|
|
200
207
|
}
|
|
201
208
|
}
|
|
202
209
|
|
|
210
|
+
/** Boolean form of {@link resolveImportPath} for callers that only gate. */
|
|
211
|
+
export function isAllowedImportPath(root, input) {
|
|
212
|
+
return resolveImportPath(root, input) !== null;
|
|
213
|
+
}
|
|
214
|
+
|
|
203
215
|
export function buildUrl(baseUrl, path, query = {}) {
|
|
204
216
|
const url = /^https?:\/\//.test(path) ? new URL(path) : new URL(`${baseUrl}/${apiPath(path)}`);
|
|
205
217
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bonesofspring/ai-rules",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.65",
|
|
4
4
|
"description": "Presets of Cursor, Claude, Mavis, OpenCode, and ZCode rules/commands for Revy Ross personal use",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Revy Ross",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"scripts": {
|
|
38
38
|
"check:fast": "bash scripts/check-preset-fast.sh",
|
|
39
39
|
"check:changed": "node scripts/check-preset-delta.mjs --base HEAD",
|
|
40
|
-
"test:hooks": "node scripts/test-chain-team-phases-coverage.mjs && node scripts/test-agent-task-metrics-hooks.mjs",
|
|
40
|
+
"test:hooks": "node scripts/test-chain-team-phases-coverage.mjs && node scripts/test-agent-task-metrics-hooks.mjs && node scripts/test-chain-team-phases-dev-cleanup.mjs",
|
|
41
41
|
"check:preset-structure": "bash scripts/check-preset-structure.sh",
|
|
42
42
|
"release:gate": "bash scripts/release-gate.sh",
|
|
43
43
|
"check:platform-scripts": "node scripts/check-platform-scripts.mjs",
|
|
@@ -49,27 +49,27 @@
|
|
|
49
49
|
"check:claude-agent-blocks": "node scripts/check-claude-agent-blocks.mjs",
|
|
50
50
|
"check:claude-agent-parity": "node scripts/check-claude-agent-parity.mjs",
|
|
51
51
|
"test:claude-agent-parity": "node scripts/test-claude-agent-parity.mjs",
|
|
52
|
-
"check:consumer-links": "node scripts/check-consumer-links.mjs",
|
|
52
|
+
"check:consumer-links": "node scripts/run-locked.mjs --label check:consumer-links -- node scripts/check-consumer-links.mjs",
|
|
53
53
|
"test:consumer-links": "node scripts/test-consumer-links.mjs",
|
|
54
|
-
"check:preset-twin-map": "bash scripts/check-preset-twin-map.sh",
|
|
55
|
-
"check:preset-twin-drift": "node scripts/check-preset-twin-drift.mjs",
|
|
54
|
+
"check:preset-twin-map": "node scripts/run-locked.mjs --label check:preset-twin-map -- bash scripts/check-preset-twin-map.sh",
|
|
55
|
+
"check:preset-twin-drift": "node scripts/run-locked.mjs --label check:preset-twin-drift -- node scripts/check-preset-twin-drift.mjs",
|
|
56
56
|
"test:twin-drift-fixtures": "node scripts/test-preset-twin-drift.mjs",
|
|
57
|
-
"check:preset-token-budget": "bash scripts/check-preset-token-budget.sh",
|
|
58
|
-
"check:preset-leakage": "bash scripts/check-preset-leakage.sh",
|
|
57
|
+
"check:preset-token-budget": "node scripts/run-locked.mjs --label check:preset-token-budget -- bash scripts/check-preset-token-budget.sh",
|
|
58
|
+
"check:preset-leakage": "node scripts/run-locked.mjs --label check:preset-leakage -- bash scripts/check-preset-leakage.sh",
|
|
59
59
|
"check:figma-contract": "bash scripts/check-figma-contract-presence.sh",
|
|
60
60
|
"check:hook-only-lifecycle": "bash scripts/check-hook-only-lifecycle.sh",
|
|
61
|
-
"check:preset-reachability": "bash scripts/check-preset-reachability.sh",
|
|
61
|
+
"check:preset-reachability": "node scripts/run-locked.mjs --label check:preset-reachability -- bash scripts/check-preset-reachability.sh",
|
|
62
62
|
"check:local-overlay": "bash scripts/check-local-overlay.sh",
|
|
63
|
-
"check:preset-i18n": "AI_RULES_I18N_FAIL=1 AI_RULES_I18N_SOFT=0 bash scripts/check-preset-i18n.sh",
|
|
64
|
-
"check:frontmatter": "node scripts/check-frontmatter.mjs",
|
|
65
|
-
"check:shared-core-drift": "bash scripts/check-shared-core-drift.sh",
|
|
63
|
+
"check:preset-i18n": "node scripts/run-locked.mjs --label check:preset-i18n -- env AI_RULES_I18N_FAIL=1 AI_RULES_I18N_SOFT=0 bash scripts/check-preset-i18n.sh",
|
|
64
|
+
"check:frontmatter": "node scripts/run-locked.mjs --label check:frontmatter -- node scripts/check-frontmatter.mjs",
|
|
65
|
+
"check:shared-core-drift": "node scripts/run-locked.mjs --label check:shared-core-drift -- bash scripts/check-shared-core-drift.sh",
|
|
66
66
|
"check:product-specs": "bash scripts/check-product-specs.sh",
|
|
67
67
|
"check:product-specs:self-test": "bash scripts/check-product-specs.sh --self-test",
|
|
68
68
|
"check:product-specs:dogfood": "bash scripts/check-product-specs.sh ../../dogfood/mcp-ts-sample",
|
|
69
69
|
"check:rule-eval": "node scripts/check-rule-eval.mjs",
|
|
70
70
|
"check:next-attached-budget": "node scripts/check-next-attached-budget.mjs",
|
|
71
71
|
"check:release-consistency": "node scripts/check-release-consistency.mjs",
|
|
72
|
-
"check:generated-drift": "node scripts/check-generated-drift.mjs",
|
|
72
|
+
"check:generated-drift": "node scripts/run-locked.mjs --label check:generated-drift -- node scripts/check-generated-drift.mjs",
|
|
73
73
|
"check:hook-body-parity": "node scripts/check-hook-body-parity.mjs",
|
|
74
74
|
"test:hook-body-parity-fixtures": "node scripts/test-hook-body-parity-fixtures.mjs",
|
|
75
75
|
"test:shared-core-drift-lineage-fixtures": "node scripts/test-shared-core-drift-lineage-fixtures.mjs",
|
|
@@ -77,8 +77,10 @@
|
|
|
77
77
|
"test:generate-claude-fixtures": "node scripts/test-generate-claude-fixtures.mjs",
|
|
78
78
|
"test:generated-drift-claude-fixtures": "node scripts/test-generated-drift-claude-fixtures.mjs",
|
|
79
79
|
"test:rule-improver": "node scripts/test-rule-improver-ledger.mjs",
|
|
80
|
+
"test:guard-shell-command": "node scripts/test-guard-shell-command.mjs",
|
|
81
|
+
"check:processes": "node scripts/test-process-lease.mjs && node scripts/test-process-adapters.mjs && node scripts/test-process-scan.mjs",
|
|
80
82
|
"test:cli-mcp-merge": "node scripts/test-cli-mcp-merge.mjs",
|
|
81
|
-
"test:cli-init-clean": "node scripts/test-cli-init-clean.mjs",
|
|
83
|
+
"test:cli-init-clean": "node scripts/run-locked.mjs --label test:cli-init-clean -- node scripts/test-cli-init-clean.mjs",
|
|
82
84
|
"test:cli-update": "node scripts/test-cli-update.mjs",
|
|
83
85
|
"test:cli-install-doctor": "node scripts/test-install-doctor.mjs",
|
|
84
86
|
"test:engine-upgrade": "node scripts/test-engine-upgrade.mjs",
|
|
@@ -95,15 +97,17 @@
|
|
|
95
97
|
"test:team-db:api": "node scripts/test-team-db-api.mjs",
|
|
96
98
|
"test:team-db:security": "node scripts/test-team-db-security.mjs",
|
|
97
99
|
"test:team-db:dashboard": "node scripts/test-team-db-dashboard.mjs",
|
|
100
|
+
"test:team-db:ui": "node scripts/test-team-db-ui.mjs",
|
|
98
101
|
"test:team-db:concurrency": "node scripts/test-team-db-concurrency.mjs",
|
|
99
|
-
"test:team-db:
|
|
100
|
-
"test:team-db:
|
|
101
|
-
"test:team-db:
|
|
102
|
-
"test:team-db:
|
|
103
|
-
"test:team-db:
|
|
102
|
+
"test:team-db:tracker": "node scripts/test-team-db-tracker.mjs",
|
|
103
|
+
"test:team-db:tracker-order": "node scripts/test-team-db-tracker-order.mjs",
|
|
104
|
+
"test:team-db:tracker-project": "node scripts/test-team-db-tracker-project.mjs",
|
|
105
|
+
"test:team-db:tracker-queue": "node scripts/test-team-db-tracker-queue.mjs",
|
|
106
|
+
"test:team-db:tracker-import": "node scripts/test-team-db-tracker-import.mjs",
|
|
107
|
+
"test:team-db:task-runner": "node scripts/test-team-db-task-runner.mjs",
|
|
104
108
|
"test:team-db:scheduler": "node scripts/test-team-db-scheduler.mjs",
|
|
105
109
|
"test:team-db:fixtures": "node scripts/test-team-db-fixtures.mjs",
|
|
106
|
-
"test:team-db": "node scripts/test-team-db-schema.mjs && node scripts/test-team-db-project.mjs && node scripts/test-team-db-migrate-tasks.mjs && node scripts/test-team-db-dualwrite.mjs && node scripts/check-team-db-contract.mjs && node scripts/test-team-db-api.mjs && node scripts/test-team-db-security.mjs && node scripts/test-team-db-dashboard.mjs && node scripts/test-team-db-concurrency.mjs && node scripts/test-team-db-
|
|
110
|
+
"test:team-db": "node scripts/test-team-db-schema.mjs && node scripts/test-team-db-project.mjs && node scripts/test-team-db-migrate-tasks.mjs && node scripts/test-team-db-dualwrite.mjs && node scripts/check-team-db-contract.mjs && node scripts/test-team-db-api.mjs && node scripts/test-team-db-security.mjs && node scripts/test-team-db-dashboard.mjs && node scripts/test-team-db-ui.mjs && node scripts/test-team-db-concurrency.mjs && node scripts/test-team-db-tracker.mjs && node scripts/test-team-db-tracker-order.mjs && node scripts/test-team-db-tracker-project.mjs && node scripts/test-team-db-tracker-queue.mjs && node scripts/test-team-db-tracker-import.mjs && node scripts/test-team-db-task-runner.mjs && node scripts/test-team-db-scheduler.mjs && node scripts/test-team-db-fixtures.mjs",
|
|
107
111
|
"check:team-db-contract": "node scripts/check-team-db-contract.mjs",
|
|
108
112
|
"check:mavis-platform-contract": "node scripts/check-mavis-platform-contract.mjs --self-test",
|
|
109
113
|
"check:mavis-adapter-map": "node scripts/check-mavis-adapter-map.mjs --self-test",
|
|
@@ -121,11 +125,13 @@
|
|
|
121
125
|
"check:zcode-local-overlay": "node scripts/check-zcode-local-overlay.mjs",
|
|
122
126
|
"test:opencode-context-budget": "node scripts/test-opencode-context-budget.mjs",
|
|
123
127
|
"test:probe-mavis-capabilities": "node scripts/test-probe-mavis-capabilities.mjs",
|
|
128
|
+
"preset:loop": "yarn fix:generated && yarn check:changed && yarn check:fast",
|
|
124
129
|
"fix:generated": "node scripts/fix-generated.mjs",
|
|
125
130
|
"generate:claude": "node scripts/generate-claude.mjs",
|
|
126
131
|
"generate:mavis": "node scripts/generate-mavis.mjs",
|
|
127
132
|
"generate:opencode": "node scripts/generate-opencode.mjs",
|
|
128
|
-
"generate:zcode": "node scripts/generate-zcode.mjs"
|
|
133
|
+
"generate:zcode": "node scripts/generate-zcode.mjs",
|
|
134
|
+
"test:dev-processes": "node scripts/test-dev-processes.mjs"
|
|
129
135
|
},
|
|
130
136
|
"engines": {
|
|
131
137
|
"node": ">=20"
|