@hassangameryt/freeflow 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/plugins/marketplace.json +1 -1
- package/.claude-plugin/marketplace.json +2 -2
- package/{plugins/freeflow/.claude-plugin → .claude-plugin}/plugin.json +1 -1
- package/{plugins/freeflow/.codex-plugin → .codex-plugin}/plugin.json +1 -1
- package/README.md +25 -16
- package/assets/freeflow-plugin-icon.png +0 -0
- package/{plugins/freeflow/command-surface.json → command-surface.json} +10 -10
- package/evals/README.md +32 -0
- package/evals/fixtures/copy-conventions.md +31 -0
- package/evals/fixtures/output-router/README.md +12 -0
- package/evals/fixtures/output-router/failed-command-output.txt +9 -0
- package/evals/fixtures/output-router/large-router-manual.md +63 -0
- package/evals/fixtures/output-router/native-large-output.txt +40 -0
- package/evals/fixtures/output-router/noisy-test-output.txt +30 -0
- package/evals/fixtures/output-router/verification-output.txt +8 -0
- package/evals/fixtures/tiny-artifact-review-app/README.md +5 -0
- package/evals/fixtures/tiny-artifact-review-app/docs/billing-policy.md +10 -0
- package/evals/fixtures/tiny-artifact-review-app/docs/specs/billing-webhook-api-draft.md +21 -0
- package/evals/fixtures/tiny-artifact-review-app/docs/specs/failed-payment-grace-period.md +24 -0
- package/evals/fixtures/tiny-artifact-review-app/docs/specs/immediate-downgrade.md +17 -0
- package/evals/fixtures/tiny-artifact-review-app/tests/billing.test.md +8 -0
- package/evals/fixtures/tiny-commit-ambiguous-app/.freeflow-eval-setup.sh +15 -0
- package/evals/fixtures/tiny-commit-ambiguous-app/README.md +3 -0
- package/evals/fixtures/tiny-commit-ambiguous-app/src/billing.ts +5 -0
- package/evals/fixtures/tiny-commit-ambiguous-app/src/settings-page.ts +1 -0
- package/evals/fixtures/tiny-commit-ambiguous-app/tests/settings.test.md +5 -0
- package/evals/fixtures/tiny-commit-app/.freeflow-eval-setup.sh +14 -0
- package/evals/fixtures/tiny-commit-app/README.md +3 -0
- package/evals/fixtures/tiny-commit-app/docs/specs/settings-title.md +5 -0
- package/evals/fixtures/tiny-commit-app/src/billing.ts +5 -0
- package/evals/fixtures/tiny-commit-app/src/settings-page.ts +1 -0
- package/evals/fixtures/tiny-commit-app/tests/settings.test.md +5 -0
- package/evals/fixtures/tiny-commit-everything-app/.freeflow-eval-setup.sh +15 -0
- package/evals/fixtures/tiny-commit-everything-app/README.md +3 -0
- package/evals/fixtures/tiny-commit-everything-app/docs/specs/settings-title.md +5 -0
- package/evals/fixtures/tiny-commit-everything-app/src/billing.ts +5 -0
- package/evals/fixtures/tiny-commit-everything-app/src/settings-page.ts +1 -0
- package/evals/fixtures/tiny-commit-everything-app/tests/settings.test.md +5 -0
- package/evals/fixtures/tiny-commit-staged-app/.freeflow-eval-setup.sh +15 -0
- package/evals/fixtures/tiny-commit-staged-app/README.md +3 -0
- package/evals/fixtures/tiny-commit-staged-app/docs/specs/settings-title.md +5 -0
- package/evals/fixtures/tiny-commit-staged-app/src/billing.ts +5 -0
- package/evals/fixtures/tiny-commit-staged-app/src/settings-page.ts +1 -0
- package/evals/fixtures/tiny-commit-staged-app/tests/settings.test.md +5 -0
- package/evals/fixtures/tiny-commit-staged-mixed-app/.freeflow-eval-setup.sh +15 -0
- package/evals/fixtures/tiny-commit-staged-mixed-app/README.md +3 -0
- package/evals/fixtures/tiny-commit-staged-mixed-app/docs/billing-policy.md +3 -0
- package/evals/fixtures/tiny-commit-staged-mixed-app/docs/release-notes.md +3 -0
- package/evals/fixtures/tiny-commit-staged-mixed-app/src/billing.ts +5 -0
- package/evals/fixtures/tiny-dashboard-stale-app/README.md +11 -0
- package/evals/fixtures/tiny-dashboard-stale-app/src/api-client.ts +13 -0
- package/evals/fixtures/tiny-dashboard-stale-app/src/dashboard-data.ts +19 -0
- package/evals/fixtures/tiny-dashboard-stale-app/tests/dashboard-data.test.md +9 -0
- package/evals/fixtures/tiny-decision-destination-app/README.md +6 -0
- package/evals/fixtures/tiny-decision-destination-app/src/risk.ts +8 -0
- package/evals/fixtures/tiny-decision-destination-app/tests/risk.test.md +4 -0
- package/evals/fixtures/tiny-design-depth-app/README.md +15 -0
- package/evals/fixtures/tiny-design-depth-app/src/routes.ts +25 -0
- package/evals/fixtures/tiny-design-depth-app/src/sendEmail.ts +3 -0
- package/evals/fixtures/tiny-design-depth-app/src/sendSms.ts +3 -0
- package/evals/fixtures/tiny-design-depth-app/src/telemetry.ts +3 -0
- package/evals/fixtures/tiny-design-depth-app/tests/routes.test.md +12 -0
- package/evals/fixtures/tiny-eval-method-app/README.md +8 -0
- package/evals/fixtures/tiny-eval-method-app/evals/reports/review-pr-eval-result.md +5 -0
- package/evals/fixtures/tiny-eval-method-app/evals/reports/triage-question-failure.md +17 -0
- package/evals/fixtures/tiny-eval-method-app/evals/runs/review-pr-with-skill-output.diff +11 -0
- package/evals/fixtures/tiny-eval-method-app/evals/runs/review-pr-with-skill-output.md +3 -0
- package/evals/fixtures/tiny-eval-method-app/skills/review-pr/SKILL.md +10 -0
- package/evals/fixtures/tiny-eval-method-app/skills/triage-question/SKILL.md +10 -0
- package/evals/fixtures/tiny-execute-plan-app/README.md +5 -0
- package/evals/fixtures/tiny-execute-plan-app/checks/settings-and-billing-check.sh +5 -0
- package/evals/fixtures/tiny-execute-plan-app/docs/billing-policy.md +10 -0
- package/evals/fixtures/tiny-execute-plan-app/docs/plans/immediate-downgrade-plan.md +11 -0
- package/evals/fixtures/tiny-execute-plan-app/docs/plans/settings-title-plan.md +12 -0
- package/evals/fixtures/tiny-execute-plan-app/docs/plans/settings-title-with-bad-check.md +15 -0
- package/evals/fixtures/tiny-execute-plan-app/docs/plans/unverified-billing-plan.md +9 -0
- package/evals/fixtures/tiny-execute-plan-app/docs/specs/failed-payment-grace-period.md +9 -0
- package/evals/fixtures/tiny-execute-plan-app/docs/specs/settings-title.md +9 -0
- package/evals/fixtures/tiny-execute-plan-app/src/billing.ts +7 -0
- package/evals/fixtures/tiny-execute-plan-app/src/settings-page.ts +1 -0
- package/evals/fixtures/tiny-execute-plan-app/tests/billing.test.md +7 -0
- package/evals/fixtures/tiny-execute-plan-app/tests/settings.test.md +5 -0
- package/evals/fixtures/tiny-execute-review-loop-app/README.md +5 -0
- package/evals/fixtures/tiny-execute-review-loop-app/docs/billing-policy.md +9 -0
- package/evals/fixtures/tiny-execute-review-loop-app/docs/plans/settings-title-plan.md +12 -0
- package/evals/fixtures/tiny-execute-review-loop-app/docs/review/previous-agent-summary.md +15 -0
- package/evals/fixtures/tiny-execute-review-loop-app/docs/review/review-pass-1-non-pass.md +11 -0
- package/evals/fixtures/tiny-execute-review-loop-app/docs/specs/settings-title.md +9 -0
- package/evals/fixtures/tiny-execute-review-loop-app/src/billing.ts +7 -0
- package/evals/fixtures/tiny-execute-review-loop-app/src/settings-page.ts +1 -0
- package/evals/fixtures/tiny-execute-review-loop-app/tests/billing.test.md +7 -0
- package/evals/fixtures/tiny-execute-review-loop-app/tests/settings.test.md +5 -0
- package/evals/fixtures/tiny-flaky-session-app/README.md +10 -0
- package/evals/fixtures/tiny-flaky-session-app/src/session-timeout.ts +13 -0
- package/evals/fixtures/tiny-flaky-session-app/tests/session-timeout.test.md +8 -0
- package/evals/fixtures/tiny-handoff-app/README.md +5 -0
- package/evals/fixtures/tiny-handoff-app/docs/billing-policy.md +10 -0
- package/evals/fixtures/tiny-handoff-app/docs/handoffs/old-agent-handoff.md +8 -0
- package/evals/fixtures/tiny-handoff-app/docs/plans/billing-retry-plan.md +11 -0
- package/evals/fixtures/tiny-handoff-app/src/billing.ts +7 -0
- package/evals/fixtures/tiny-handoff-report-app/README.md +3 -0
- package/evals/fixtures/tiny-handoff-report-app/evals/runs/handoff-3/hof-003/with-skill-output.diff +1 -0
- package/evals/fixtures/tiny-handoff-report-app/evals/runs/handoff-3/hof-003/with-skill-output.md +1 -0
- package/evals/fixtures/tiny-handoff-report-app/evals/scores/hof-003-score.txt +4 -0
- package/evals/fixtures/tiny-plan-app/README.md +5 -0
- package/evals/fixtures/tiny-plan-app/docs/billing-policy.md +10 -0
- package/evals/fixtures/tiny-plan-app/docs/specs/failed-payment-grace-period.md +25 -0
- package/evals/fixtures/tiny-plan-app/src/billing.ts +17 -0
- package/evals/fixtures/tiny-plan-app/src/settings-page.ts +1 -0
- package/evals/fixtures/tiny-plan-app/tests/billing.test.md +8 -0
- package/evals/fixtures/tiny-plan-app/tests/settings.test.md +5 -0
- package/evals/fixtures/tiny-plan-strict-api-app/README.md +3 -0
- package/evals/fixtures/tiny-plan-strict-api-app/docs/billing-policy.md +5 -0
- package/evals/fixtures/tiny-plan-strict-api-app/docs/specs/billing-webhook-api.md +25 -0
- package/evals/fixtures/tiny-plan-strict-api-app/src/billing.ts +5 -0
- package/evals/fixtures/tiny-plan-strict-api-app/src/webhooks.ts +3 -0
- package/evals/fixtures/tiny-plan-strict-api-app/tests/billing-webhook.test.md +8 -0
- package/evals/fixtures/tiny-post-setup-invalid-config-app/.freeflow/config.json +3 -0
- package/evals/fixtures/tiny-post-setup-invalid-config-app/AGENTS.md +15 -0
- package/evals/fixtures/tiny-post-setup-invalid-config-app/README.md +16 -0
- package/evals/fixtures/tiny-post-setup-invalid-config-app/docs/auth-review.md +15 -0
- package/evals/fixtures/tiny-post-setup-invalid-config-app/docs/billing-policy.md +10 -0
- package/evals/fixtures/tiny-post-setup-invalid-config-app/docs/copy-conventions.md +15 -0
- package/evals/fixtures/tiny-post-setup-invalid-config-app/src/auth-middleware.ts +12 -0
- package/evals/fixtures/tiny-post-setup-invalid-config-app/src/billing.ts +20 -0
- package/evals/fixtures/tiny-post-setup-invalid-config-app/src/login-copy.ts +1 -0
- package/evals/fixtures/tiny-post-setup-invalid-config-app/src/settings-page.ts +1 -0
- package/evals/fixtures/tiny-post-setup-invalid-config-app/tests/auth-middleware.test.md +8 -0
- package/evals/fixtures/tiny-post-setup-invalid-config-app/tests/billing.test.md +8 -0
- package/evals/fixtures/tiny-post-setup-invalid-config-app/tests/copy.test.md +7 -0
- package/evals/fixtures/tiny-post-setup-missing-config-app/AGENTS.md +15 -0
- package/evals/fixtures/tiny-post-setup-missing-config-app/README.md +16 -0
- package/evals/fixtures/tiny-post-setup-missing-config-app/docs/auth-review.md +15 -0
- package/evals/fixtures/tiny-post-setup-missing-config-app/docs/billing-policy.md +10 -0
- package/evals/fixtures/tiny-post-setup-missing-config-app/docs/copy-conventions.md +15 -0
- package/evals/fixtures/tiny-post-setup-missing-config-app/src/auth-middleware.ts +12 -0
- package/evals/fixtures/tiny-post-setup-missing-config-app/src/billing.ts +20 -0
- package/evals/fixtures/tiny-post-setup-missing-config-app/src/login-copy.ts +1 -0
- package/evals/fixtures/tiny-post-setup-missing-config-app/src/settings-page.ts +1 -0
- package/evals/fixtures/tiny-post-setup-missing-config-app/tests/auth-middleware.test.md +8 -0
- package/evals/fixtures/tiny-post-setup-missing-config-app/tests/billing.test.md +8 -0
- package/evals/fixtures/tiny-post-setup-missing-config-app/tests/copy.test.md +7 -0
- package/evals/fixtures/tiny-post-setup-source-conflict-app/.freeflow/config.json +3 -0
- package/evals/fixtures/tiny-post-setup-source-conflict-app/AGENTS.md +15 -0
- package/evals/fixtures/tiny-post-setup-source-conflict-app/README.md +16 -0
- package/evals/fixtures/tiny-post-setup-source-conflict-app/docs/auth-review.md +15 -0
- package/evals/fixtures/tiny-post-setup-source-conflict-app/docs/billing-policy.md +10 -0
- package/evals/fixtures/tiny-post-setup-source-conflict-app/docs/copy-conventions.md +15 -0
- package/evals/fixtures/tiny-post-setup-source-conflict-app/src/auth-middleware.ts +12 -0
- package/evals/fixtures/tiny-post-setup-source-conflict-app/src/billing.ts +20 -0
- package/evals/fixtures/tiny-post-setup-source-conflict-app/src/login-copy.ts +1 -0
- package/evals/fixtures/tiny-post-setup-source-conflict-app/src/settings-page.ts +1 -0
- package/evals/fixtures/tiny-post-setup-source-conflict-app/tests/auth-middleware.test.md +8 -0
- package/evals/fixtures/tiny-post-setup-source-conflict-app/tests/billing.test.md +8 -0
- package/evals/fixtures/tiny-post-setup-source-conflict-app/tests/copy.test.md +7 -0
- package/evals/fixtures/tiny-report-performance-app/README.md +11 -0
- package/evals/fixtures/tiny-report-performance-app/docs/performance.md +10 -0
- package/evals/fixtures/tiny-report-performance-app/src/report-summary.ts +29 -0
- package/evals/fixtures/tiny-report-performance-app/tests/report-performance.test.md +8 -0
- package/evals/fixtures/tiny-review-request-app/README.md +3 -0
- package/evals/fixtures/tiny-review-request-app/docs/billing-policy.md +5 -0
- package/evals/fixtures/tiny-review-request-app/docs/plans/billing-webhook-api.md +19 -0
- package/evals/fixtures/tiny-review-request-app/docs/review/previous-agent-summary.md +20 -0
- package/evals/fixtures/tiny-review-request-app/docs/specs/billing-webhook-api.md +25 -0
- package/evals/fixtures/tiny-review-request-app/src/billing.ts +11 -0
- package/evals/fixtures/tiny-review-request-app/src/webhooks.ts +19 -0
- package/evals/fixtures/tiny-review-request-app/tests/billing-webhook.test.md +8 -0
- package/evals/fixtures/tiny-review-work-app/README.md +5 -0
- package/evals/fixtures/tiny-review-work-app/docs/billing-policy.md +9 -0
- package/evals/fixtures/tiny-review-work-app/docs/plans/settings-title-plan.md +12 -0
- package/evals/fixtures/tiny-review-work-app/docs/review/previous-agent-summary.md +15 -0
- package/evals/fixtures/tiny-review-work-app/docs/specs/settings-title.md +9 -0
- package/evals/fixtures/tiny-review-work-app/src/billing.ts +7 -0
- package/evals/fixtures/tiny-review-work-app/src/settings-page.ts +1 -0
- package/evals/fixtures/tiny-review-work-app/tests/billing.test.md +7 -0
- package/evals/fixtures/tiny-review-work-app/tests/settings.test.md +5 -0
- package/evals/fixtures/tiny-saas-app/README.md +16 -0
- package/evals/fixtures/tiny-saas-app/docs/auth-review.md +15 -0
- package/evals/fixtures/tiny-saas-app/docs/billing-policy.md +10 -0
- package/evals/fixtures/tiny-saas-app/docs/copy-conventions.md +15 -0
- package/evals/fixtures/tiny-saas-app/docs/specs/settings-title.md +13 -0
- package/evals/fixtures/tiny-saas-app/src/auth-middleware.ts +12 -0
- package/evals/fixtures/tiny-saas-app/src/billing.ts +20 -0
- package/evals/fixtures/tiny-saas-app/src/login-copy.ts +1 -0
- package/evals/fixtures/tiny-saas-app/src/settings-page.ts +1 -0
- package/evals/fixtures/tiny-saas-app/tests/auth-middleware.test.md +8 -0
- package/evals/fixtures/tiny-saas-app/tests/billing.test.md +8 -0
- package/evals/fixtures/tiny-saas-app/tests/copy.test.md +7 -0
- package/evals/fixtures/tiny-setup-agents-app/AGENTS.md +6 -0
- package/evals/fixtures/tiny-setup-both-app/AGENTS.md +5 -0
- package/evals/fixtures/tiny-setup-both-app/CLAUDE.md +5 -0
- package/evals/fixtures/tiny-setup-claude-app/CLAUDE.md +6 -0
- package/evals/fixtures/tiny-setup-codex-rules-app/.codex/rules/shell.rules +5 -0
- package/evals/fixtures/tiny-setup-codex-rules-app/AGENTS.md +6 -0
- package/evals/fixtures/tiny-setup-conflict-app/AGENTS.md +6 -0
- package/evals/fixtures/tiny-setup-existing-block-app/AGENTS.md +14 -0
- package/evals/fixtures/tiny-setup-four-rules-app/CLAUDE.md +6 -0
- package/evals/fixtures/tiny-skill-dev-app/README.md +10 -0
- package/evals/fixtures/tiny-skill-dev-app/evals/prompts/review-pr-001.txt +8 -0
- package/evals/fixtures/tiny-skill-dev-app/evals/reports/review-pr-failure.md +17 -0
- package/evals/fixtures/tiny-skill-dev-app/skills/review-pr/SKILL.md +13 -0
- package/evals/fixtures/tiny-team-app/README.md +5 -0
- package/evals/fixtures/tiny-team-app/docs/product.md +6 -0
- package/evals/fixtures/tiny-team-app/src/teams.ts +9 -0
- package/evals/fixtures/tiny-team-app/src/users.ts +5 -0
- package/evals/fixtures/tiny-team-app/tests/teams.test.md +7 -0
- package/evals/fixtures/tiny-verify-app/README.md +5 -0
- package/evals/fixtures/tiny-verify-app/src/settings-nav.ts +1 -0
- package/evals/fixtures/tiny-verify-app/src/settings-page.ts +1 -0
- package/evals/fixtures/tiny-verify-app/tests/settings.test.md +7 -0
- package/evals/prompts/aon-001.txt +2 -0
- package/evals/prompts/byp-001.txt +2 -0
- package/evals/prompts/byp-002.txt +2 -0
- package/evals/prompts/cap-001.txt +3 -0
- package/evals/prompts/cap-002.txt +3 -0
- package/evals/prompts/cmd-001.txt +3 -0
- package/evals/prompts/cmd-002.txt +3 -0
- package/evals/prompts/cmd-003.txt +6 -0
- package/evals/prompts/cmd-004.txt +5 -0
- package/evals/prompts/cmd-005.txt +5 -0
- package/evals/prompts/cmd-006.txt +5 -0
- package/evals/prompts/cmd-007.txt +5 -0
- package/evals/prompts/cmd-008.txt +5 -0
- package/evals/prompts/cmd-009.txt +8 -0
- package/evals/prompts/cmd-010.txt +5 -0
- package/evals/prompts/cmd-011.txt +5 -0
- package/evals/prompts/cmd-012.txt +5 -0
- package/evals/prompts/cmd-013.txt +5 -0
- package/evals/prompts/cmd-014.txt +7 -0
- package/evals/prompts/cmd-015.txt +7 -0
- package/evals/prompts/cmd-016.txt +5 -0
- package/evals/prompts/cmt-001.txt +1 -0
- package/evals/prompts/cmt-002.txt +1 -0
- package/evals/prompts/cmt-003.txt +1 -0
- package/evals/prompts/cmt-004.txt +1 -0
- package/evals/prompts/cmt-005.txt +1 -0
- package/evals/prompts/dfd-001.txt +3 -0
- package/evals/prompts/dia-001.txt +3 -0
- package/evals/prompts/dia-002.txt +3 -0
- package/evals/prompts/dia-003.txt +3 -0
- package/evals/prompts/dis-001.txt +5 -0
- package/evals/prompts/dis-002.txt +5 -0
- package/evals/prompts/esk-001.txt +5 -0
- package/evals/prompts/esk-002.txt +5 -0
- package/evals/prompts/esk-003.txt +5 -0
- package/evals/prompts/grc-001.txt +3 -0
- package/evals/prompts/hof-001.txt +3 -0
- package/evals/prompts/hof-002.txt +1 -0
- package/evals/prompts/hof-003.txt +1 -0
- package/evals/prompts/hof-004.txt +1 -0
- package/evals/prompts/hof-005.txt +1 -0
- package/evals/prompts/ivg-001.txt +1 -0
- package/evals/prompts/ivg-002.txt +11 -0
- package/evals/prompts/ivg-003.txt +1 -0
- package/evals/prompts/ivg-004.txt +1 -0
- package/evals/prompts/mode-001.txt +3 -0
- package/evals/prompts/mode-002.txt +1 -0
- package/evals/prompts/mode-003.txt +3 -0
- package/evals/prompts/mode-004.txt +3 -0
- package/evals/prompts/mode-005.txt +3 -0
- package/evals/prompts/mode-006.txt +3 -0
- package/evals/prompts/mode-007.txt +3 -0
- package/evals/prompts/otr-001.txt +3 -0
- package/evals/prompts/otr-002.txt +3 -0
- package/evals/prompts/rar-001.txt +5 -0
- package/evals/prompts/rar-002.txt +3 -0
- package/evals/prompts/rar-003.txt +6 -0
- package/evals/prompts/rar-004.txt +15 -0
- package/evals/prompts/rar-005.txt +10 -0
- package/evals/prompts/rbr-001.txt +3 -0
- package/evals/prompts/rbr-002.txt +3 -0
- package/evals/prompts/rbr-003.txt +7 -0
- package/evals/prompts/rev-001.txt +3 -0
- package/evals/prompts/rev-002.txt +5 -0
- package/evals/prompts/rev-003.txt +6 -0
- package/evals/prompts/rev-004.txt +1 -0
- package/evals/prompts/rev-005.txt +15 -0
- package/evals/prompts/rev-006.txt +5 -0
- package/evals/prompts/stp-001.txt +1 -0
- package/evals/prompts/stp-002.txt +1 -0
- package/evals/prompts/stp-003.txt +1 -0
- package/evals/prompts/stp-004.txt +1 -0
- package/evals/prompts/stp-005.txt +1 -0
- package/evals/prompts/stp-006.txt +1 -0
- package/evals/prompts/stp-007.txt +1 -0
- package/evals/prompts/stp-008.txt +1 -0
- package/evals/prompts/stp-009.txt +1 -0
- package/evals/prompts/stp-010.txt +1 -0
- package/evals/prompts/stp-011.txt +1 -0
- package/evals/prompts/vfy-003.txt +1 -0
- package/evals/prompts/wpl-001.txt +3 -0
- package/evals/prompts/wpl-002.txt +5 -0
- package/evals/prompts/wpl-003.txt +3 -0
- package/evals/prompts/wpl-004.txt +5 -0
- package/evals/prompts/wpl-005.txt +1 -0
- package/evals/prompts/wrc-001.txt +10 -0
- package/evals/prompts/wrc-002.txt +3 -0
- package/evals/prompts/wsk-001.txt +6 -0
- package/evals/prompts/wsp-001.txt +5 -0
- package/evals/prompts/wsp-002.txt +15 -0
- package/evals/prompts/wsp-003.txt +3 -0
- package/evals/prompts/wsp-004.txt +15 -0
- package/evals/prompts/wsp-005.txt +5 -0
- package/evals/prompts/wsp-006.txt +12 -0
- package/evals/prompts/wsp-007.txt +9 -0
- package/evals/prompts/wsp-008.txt +13 -0
- package/evals/prompts/xpl-001.txt +1 -0
- package/evals/prompts/xpl-002.txt +3 -0
- package/evals/prompts/xpl-003.txt +3 -0
- package/evals/prompts/xpl-004.txt +3 -0
- package/evals/prompts/xpl-005.txt +5 -0
- package/evals/prompts/xpl-006.txt +3 -0
- package/evals/registries/adversarial-evals.json +39 -0
- package/evals/registries/fixture-evals.json +2513 -0
- package/evals/registries/handoff-evals.json +74 -0
- package/evals/registries/legacy-evals.json +147 -0
- package/evals/registries/skill-evidence.json +193 -0
- package/evals/registries/verify-work-evals.json +46 -0
- package/evals/reports/acceptance/v0.1-acceptance-report.md +130 -0
- package/evals/reports/by-command-surface/command-surface-1-report.md +45 -0
- package/evals/reports/by-command-surface/command-surface-10-report.md +76 -0
- package/evals/reports/by-command-surface/command-surface-11-report.md +77 -0
- package/evals/reports/by-command-surface/command-surface-12-report.md +91 -0
- package/evals/reports/by-command-surface/command-surface-13-report.md +64 -0
- package/evals/reports/by-command-surface/command-surface-14-report.md +66 -0
- package/evals/reports/by-command-surface/command-surface-15-report.md +124 -0
- package/evals/reports/by-command-surface/command-surface-16-report.md +39 -0
- package/evals/reports/by-command-surface/command-surface-2-report.md +80 -0
- package/evals/reports/by-command-surface/command-surface-3-report.md +86 -0
- package/evals/reports/by-command-surface/command-surface-4-report.md +76 -0
- package/evals/reports/by-command-surface/command-surface-5-report.md +80 -0
- package/evals/reports/by-command-surface/command-surface-6-report.md +74 -0
- package/evals/reports/by-command-surface/command-surface-7-report.md +84 -0
- package/evals/reports/by-command-surface/command-surface-8-report.md +79 -0
- package/evals/reports/by-command-surface/command-surface-9-report.md +79 -0
- package/evals/reports/by-command-surface/command-surface-matrix.md +91 -0
- package/evals/reports/by-skill/bypass-1-report.md +124 -0
- package/evals/reports/by-skill/capture-decisions-1-report.md +99 -0
- package/evals/reports/by-skill/capture-decisions-2-report.md +102 -0
- package/evals/reports/by-skill/commit-work-1-report.md +165 -0
- package/evals/reports/by-skill/commit-work-2-report.md +109 -0
- package/evals/reports/by-skill/design-for-depth-1-report.md +95 -0
- package/evals/reports/by-skill/diagnose-failure-1-report.md +91 -0
- package/evals/reports/by-skill/diagnose-failure-2-report.md +94 -0
- package/evals/reports/by-skill/discover-1-report.md +118 -0
- package/evals/reports/by-skill/evaluate-skill-2-report.md +71 -0
- package/evals/reports/by-skill/execute-plan-1-report.md +103 -0
- package/evals/reports/by-skill/execute-plan-2-report.md +112 -0
- package/evals/reports/by-skill/execute-plan-3-report.md +87 -0
- package/evals/reports/by-skill/grill-context-1-report.md +103 -0
- package/evals/reports/by-skill/handoff-1-report.md +123 -0
- package/evals/reports/by-skill/handoff-2-report.md +105 -0
- package/evals/reports/by-skill/handoff-3-report.md +100 -0
- package/evals/reports/by-skill/handoff-7-report.md +77 -0
- package/evals/reports/by-skill/interview-gate-1-report.md +63 -0
- package/evals/reports/by-skill/interview-gate-2-report.md +105 -0
- package/evals/reports/by-skill/mode-contract-1-report.md +74 -0
- package/evals/reports/by-skill/mode-contract-2-report.md +87 -0
- package/evals/reports/by-skill/mode-contract-3-report.md +65 -0
- package/evals/reports/by-skill/mode-contract-4-report.md +71 -0
- package/evals/reports/by-skill/mode-contract-5-report.md +70 -0
- package/evals/reports/by-skill/output-router-1-report.md +76 -0
- package/evals/reports/by-skill/output-router-2-report.md +65 -0
- package/evals/reports/by-skill/research-1-report.md +144 -0
- package/evals/reports/by-skill/research-brief-1-report.md +94 -0
- package/evals/reports/by-skill/research-brief-2-report.md +75 -0
- package/evals/reports/by-skill/review-artifact-1-report.md +91 -0
- package/evals/reports/by-skill/review-artifact-2-report.md +79 -0
- package/evals/reports/by-skill/review-artifact-3-report.md +120 -0
- package/evals/reports/by-skill/review-artifact-4-report.md +89 -0
- package/evals/reports/by-skill/review-artifact-5-report.md +66 -0
- package/evals/reports/by-skill/review-work-1-report.md +85 -0
- package/evals/reports/by-skill/review-work-2-report.md +87 -0
- package/evals/reports/by-skill/review-work-3-report.md +104 -0
- package/evals/reports/by-skill/review-work-4-report.md +108 -0
- package/evals/reports/by-skill/review-work-5-report.md +73 -0
- package/evals/reports/by-skill/review-work-6-report.md +66 -0
- package/evals/reports/by-skill/setup-freeflow-1-report.md +199 -0
- package/evals/reports/by-skill/setup-freeflow-2-report.md +105 -0
- package/evals/reports/by-skill/setup-freeflow-3-report.md +105 -0
- package/evals/reports/by-skill/setup-freeflow-4-report.md +88 -0
- package/evals/reports/by-skill/setup-freeflow-5-report.md +115 -0
- package/evals/reports/by-skill/skill-authoring-1-report.md +81 -0
- package/evals/reports/by-skill/verify-work-1-report.md +111 -0
- package/evals/reports/by-skill/verify-work-2-report.md +120 -0
- package/evals/reports/by-skill/workflow-1-report.md +65 -0
- package/evals/reports/by-skill/write-plan-1-report.md +123 -0
- package/evals/reports/by-skill/write-plan-2-report.md +98 -0
- package/evals/reports/by-skill/write-plan-3-report.md +110 -0
- package/evals/reports/by-skill/write-spec-1-report.md +88 -0
- package/evals/reports/by-skill/write-spec-2-report.md +89 -0
- package/evals/reports/by-skill/write-spec-3-report.md +90 -0
- package/evals/reports/by-skill/write-spec-4-report.md +167 -0
- package/evals/reports/harness/claude-harness-1-report.md +103 -0
- package/evals/reports/harness/eval-harness-1-report.md +91 -0
- package/evals/reports/iterations/iteration-1-report.md +71 -0
- package/evals/reports/iterations/iteration-2-report.md +78 -0
- package/evals/reports/iterations/iteration-3-report.md +118 -0
- package/evals/reports/iterations/iteration-4-report.md +131 -0
- package/evals/reports/iterations/iteration-5-report.md +149 -0
- package/evals/reports/iterations/iteration-6-report.md +136 -0
- package/evals/reports/runtime/always-on-runtime-1-report.md +107 -0
- package/evals/reports/runtime/context-mode-normalized-benchmark-1-report.md +52 -0
- package/evals/reports/runtime/context-mode-real-deep-baseline-1-report.md +410 -0
- package/evals/reports/runtime/context-mode-real-deep-final-slice-11-report.md +203 -0
- package/evals/reports/runtime/context-mode-real-deep-final-slice-11-review.md +51 -0
- package/evals/reports/runtime/context-saving-native-tools-baseline-1-report.md +99 -0
- package/evals/reports/runtime/eryx-python-compatibility-reprobe-1-report.md +166 -0
- package/evals/reports/runtime/eryx-python-proof-spike-1-report.md +96 -0
- package/evals/reports/runtime/eryx-python-proof-spike-2-report.md +151 -0
- package/evals/reports/runtime/eryx-python-script-derive-execution-1-report.md +233 -0
- package/evals/reports/runtime/jq-script-derive-execution-1-report.md +215 -0
- package/evals/reports/runtime/jq-wasm-proof-spike-1-report.md +67 -0
- package/evals/reports/runtime/output-router-benchmark-1-report.md +81 -0
- package/evals/reports/runtime/output-router-capture-derive-provider-eval-1-report.md +35 -0
- package/evals/reports/runtime/output-router-codex-large-index-sqlite-adhoc-report.md +150 -0
- package/evals/reports/runtime/output-router-codex-qa-benchmark-1-report.md +46 -0
- package/evals/reports/runtime/output-router-command-benchmark-1-report.md +62 -0
- package/evals/reports/runtime/output-router-index-benchmark-1-report.md +64 -0
- package/evals/reports/runtime/output-router-regression-1-report.md +81 -0
- package/evals/reports/runtime/output-router-transform-eval-1-report.md +28 -0
- package/evals/reports/runtime/pi-observed-routing-eval-1-report.md +44 -0
- package/evals/reports/runtime/quickjs-script-derive-execution-1-report.md +159 -0
- package/evals/reports/runtime/quickjs-wasi-proof-spike-1-report.md +55 -0
- package/evals/reports/runtime/render-format-row-protocol-1-report.md +58 -0
- package/evals/reports/runtime/script-sandbox-adapter-selection-review-1-report.md +84 -0
- package/evals/reports/runtime/script-sandbox-probe-resource-hardening-1-report.md +51 -0
- package/evals/reports/runtime/storage-policy-benchmark-1-report.md +176 -0
- package/evals/reports/runtime/vault-index-storage-spike-1-report.md +39 -0
- package/evals/reports/runtime/workflow-context-hook-1-report.md +82 -0
- package/evals/runbooks/adversarial-eval-runbook.md +28 -0
- package/evals/runbooks/fixture-eval-runbook.md +137 -0
- package/evals/runbooks/handoff-eval-runbook.md +22 -0
- package/evals/runbooks/verify-work-eval-runbook.md +27 -0
- package/evals/scripts/audit-command-surface.sh +160 -0
- package/evals/scripts/check-activation-contract.sh +121 -0
- package/evals/scripts/check-runtime-context-hook.sh +183 -0
- package/evals/scripts/grade-fixture-eval.sh +446 -0
- package/evals/scripts/run-claude-fixture-eval.sh +26 -0
- package/evals/scripts/run-codex-fixture-eval.sh +26 -0
- package/evals/scripts/run-eryx-python-proof-spike.js +559 -0
- package/evals/scripts/run-fixture-eval-by-id.sh +23 -0
- package/evals/scripts/run-fixture-eval.sh +464 -0
- package/evals/scripts/run-jq-wasm-proof-spike.js +299 -0
- package/evals/scripts/run-output-router-transform-eval.js +115 -0
- package/evals/scripts/run-pi-observed-routing-eval.js +478 -0
- package/evals/scripts/run-quickjs-wasi-proof-spike.js +339 -0
- package/evals/scripts/skill-evidence.sh +316 -0
- package/evals/scripts/validate-release-metadata.sh +486 -0
- package/evals/suites/v0.1-acceptance-suite.md +131 -0
- package/{plugins/freeflow/hooks → hooks}/freeflow-runtime-context.mjs +65 -14
- package/package.json +46 -13
- package/pi-extension/dist/host-producer-identification.js +186 -0
- package/pi-extension/dist/index.js +85 -0
- package/pi-extension/dist/mcp-config.js +30 -0
- package/pi-extension/dist/native-safety-net.js +209 -0
- package/pi-extension/dist/observed-tool-routing.js +114 -0
- package/pi-extension/dist/renderers.js +835 -0
- package/pi-extension/dist/router-tools.js +438 -0
- package/pi-extension/dist/runtime-context.js +288 -0
- package/pi-extension/dist/schemas.js +254 -0
- package/pi-extension/dist/status.js +449 -0
- package/pi-extension/dist/utils.js +467 -0
- package/pi-extension/src/host-producer-identification.ts +226 -0
- package/pi-extension/src/index.ts +121 -0
- package/pi-extension/src/mcp-config.ts +32 -0
- package/pi-extension/src/native-safety-net.ts +252 -0
- package/pi-extension/src/observed-tool-routing.ts +126 -0
- package/pi-extension/src/renderers.ts +917 -0
- package/pi-extension/src/router-tools.ts +478 -0
- package/pi-extension/src/runtime-context.ts +347 -0
- package/pi-extension/src/schemas.ts +259 -0
- package/pi-extension/src/status.ts +505 -0
- package/pi-extension/src/utils.ts +492 -0
- package/pi-extension/tsconfig.json +16 -0
- package/plugin-docs/README.md +40 -0
- package/plugin-docs/adr/0002-evals-before-hooks.md +17 -0
- package/{plugins/freeflow/docs → plugin-docs}/adr/0003-release-boundary.md +2 -2
- package/plugin-docs/adr/0004-discover-replaces-shallow-discovery-skills.md +26 -0
- package/plugin-docs/adr/README.md +10 -0
- package/plugin-docs/architecture.md +89 -0
- package/plugin-docs/output-router.md +396 -0
- package/plugin-docs/release-evidence.md +77 -0
- package/{plugins/freeflow/docs → plugin-docs}/skills.md +7 -7
- package/{plugins/freeflow/docs → plugin-docs}/workflow.md +4 -4
- package/router/dist/benchmarks/benchmark-harness.d.ts +32 -0
- package/router/dist/benchmarks/benchmark-harness.js +92 -0
- package/router/dist/benchmarks/benchmarks.d.ts +102 -0
- package/router/dist/benchmarks/benchmarks.js +880 -0
- package/router/dist/benchmarks/codex-qa-benchmarks.d.ts +91 -0
- package/router/dist/benchmarks/codex-qa-benchmarks.js +461 -0
- package/router/dist/benchmarks/command-benchmarks.d.ts +128 -0
- package/router/dist/benchmarks/command-benchmarks.js +653 -0
- package/router/dist/benchmarks/context-mode-normalized-benchmarks.d.ts +74 -0
- package/router/dist/benchmarks/context-mode-normalized-benchmarks.js +707 -0
- package/router/dist/benchmarks/context-mode-real-deep-benchmark.d.ts +124 -0
- package/router/dist/benchmarks/context-mode-real-deep-benchmark.js +1295 -0
- package/router/dist/benchmarks/context-saving-baseline.d.ts +54 -0
- package/router/dist/benchmarks/context-saving-baseline.js +439 -0
- package/router/dist/benchmarks/index-benchmarks.d.ts +98 -0
- package/router/dist/benchmarks/index-benchmarks.js +762 -0
- package/router/dist/benchmarks/storage-policy-benchmarks.d.ts +90 -0
- package/router/dist/benchmarks/storage-policy-benchmarks.js +538 -0
- package/router/dist/benchmarks/vault-index-benchmarks.d.ts +47 -0
- package/router/dist/benchmarks/vault-index-benchmarks.js +257 -0
- package/router/dist/config/config.d.ts +96 -0
- package/router/dist/config/config.js +453 -0
- package/router/dist/config/router-contract.d.ts +10 -0
- package/router/dist/config/router-contract.js +54 -0
- package/router/dist/config/schema.d.ts +18 -0
- package/router/dist/config/schema.js +600 -0
- package/router/dist/config/types.d.ts +521 -0
- package/router/dist/config/types.js +30 -0
- package/router/dist/evidence/bounded-evidence.d.ts +40 -0
- package/router/dist/evidence/bounded-evidence.js +310 -0
- package/router/dist/evidence/evidence-range-selector.d.ts +22 -0
- package/router/dist/evidence/evidence-range-selector.js +231 -0
- package/router/dist/evidence/evidence-search.d.ts +25 -0
- package/router/dist/evidence/evidence-search.js +466 -0
- package/router/dist/evidence/evidence.d.ts +38 -0
- package/router/dist/evidence/evidence.js +196 -0
- package/router/dist/evidence/failure-contracts.d.ts +27 -0
- package/router/dist/evidence/failure-contracts.js +160 -0
- package/router/dist/evidence/line-ranges.d.ts +22 -0
- package/router/dist/evidence/line-ranges.js +22 -0
- package/router/dist/experiments/local-index.d.ts +58 -0
- package/router/dist/experiments/local-index.js +562 -0
- package/router/dist/index.d.ts +30 -0
- package/router/dist/index.js +32 -0
- package/router/dist/processing/engine.d.ts +108 -0
- package/router/dist/processing/engine.js +435 -0
- package/router/dist/processing/reducers.d.ts +266 -0
- package/router/dist/processing/reducers.js +1495 -0
- package/router/dist/processing/renderers.d.ts +25 -0
- package/router/dist/processing/renderers.js +186 -0
- package/router/dist/processing/scripts.d.ts +78 -0
- package/router/dist/processing/scripts.js +333 -0
- package/router/dist/repo/repo-traversal.d.ts +18 -0
- package/router/dist/repo/repo-traversal.js +242 -0
- package/router/dist/routing/observed-reducers.d.ts +35 -0
- package/router/dist/routing/observed-reducers.js +647 -0
- package/router/dist/routing/observed-routing.d.ts +17 -0
- package/router/dist/routing/observed-routing.js +377 -0
- package/router/dist/routing/parsers.d.ts +16 -0
- package/router/dist/routing/parsers.js +473 -0
- package/router/dist/routing/run-filters.d.ts +56 -0
- package/router/dist/routing/run-filters.js +230 -0
- package/router/dist/routing/run-reducers.d.ts +30 -0
- package/router/dist/routing/run-reducers.js +110 -0
- package/router/dist/sandbox/adapter-roots.d.ts +38 -0
- package/router/dist/sandbox/adapter-roots.js +64 -0
- package/router/dist/sandbox/eryx-python-adapter.d.ts +9 -0
- package/router/dist/sandbox/eryx-python-adapter.js +797 -0
- package/router/dist/sandbox/jq-wasm-adapter.d.ts +9 -0
- package/router/dist/sandbox/jq-wasm-adapter.js +421 -0
- package/router/dist/sandbox/quickjs-wasi-adapter.d.ts +9 -0
- package/router/dist/sandbox/quickjs-wasi-adapter.js +381 -0
- package/router/dist/sandbox/script-sandbox.d.ts +113 -0
- package/router/dist/sandbox/script-sandbox.js +303 -0
- package/router/dist/setup/script-transform-adapters.d.ts +28 -0
- package/router/dist/setup/script-transform-adapters.js +259 -0
- package/router/dist/tools/batch.d.ts +22 -0
- package/router/dist/tools/batch.js +509 -0
- package/router/dist/tools/run.d.ts +50 -0
- package/router/dist/tools/run.js +1219 -0
- package/router/dist/tools/search.d.ts +44 -0
- package/router/dist/tools/search.js +1205 -0
- package/router/dist/transform/engine.d.ts +143 -0
- package/router/dist/transform/engine.js +1955 -0
- package/router/dist/vault/vault-index.d.ts +106 -0
- package/router/dist/vault/vault-index.js +411 -0
- package/router/dist/vault/vault.d.ts +103 -0
- package/router/dist/vault/vault.js +635 -0
- package/{plugins/freeflow/skills → skills}/commit-work/SKILL.md +17 -16
- package/{plugins/freeflow/skills → skills}/commit-work/references/staging-decisions.md +3 -3
- package/skills/design-for-depth/SKILL.md +90 -0
- package/skills/design-for-depth/references/design-pressure-signals.md +265 -0
- package/skills/design-for-depth/references/software-design-philosophy.md +219 -0
- package/{plugins/freeflow/skills → skills}/diagnose-failure/SKILL.md +6 -1
- package/skills/discover/ARTIFACT-DESTINATIONS.md +58 -0
- package/skills/discover/CHECKPOINTS.md +74 -0
- package/skills/discover/SKILL.md +173 -0
- package/skills/execute-plan/SKILL.md +133 -0
- package/skills/execute-plan/references/execution-map.md +122 -0
- package/{plugins/freeflow/skills → skills}/mode-contract/SKILL.md +10 -5
- package/skills/output-router/SKILL.md +202 -0
- package/skills/output-router/references/safety-policy.md +40 -0
- package/{plugins/freeflow/skills → skills}/review-artifact/SKILL.md +37 -1
- package/{plugins/freeflow/skills → skills}/review-artifact/references/reviewer-prompt.md +14 -2
- package/skills/review-work/SKILL.md +101 -0
- package/{plugins/freeflow/skills → skills}/review-work/references/reviewer-prompt.md +8 -0
- package/skills/setup-freeflow/SKILL.md +106 -0
- package/{plugins/freeflow/skills → skills}/setup-freeflow/references/activation-contract.md +14 -8
- package/{plugins/freeflow/skills → skills}/setup-freeflow/references/host-setup.md +5 -3
- package/skills/setup-freeflow/references/output-router-setup.md +102 -0
- package/{plugins/freeflow/skills → skills}/verify-work/SKILL.md +3 -1
- package/{plugins/freeflow/skills → skills}/workflow/SKILL.md +23 -13
- package/{plugins/freeflow/skills → skills}/workflow/references/workflow-map.md +21 -20
- package/{plugins/freeflow/skills → skills}/write-plan/SKILL.md +9 -1
- package/{plugins/freeflow/skills → skills}/write-skill/SKILL.md +1 -1
- package/{plugins/freeflow/skills → skills}/write-spec/SKILL.md +9 -6
- package/plugins/freeflow/docs/README.md +0 -39
- package/plugins/freeflow/docs/adr/0002-evals-before-hooks.md +0 -17
- package/plugins/freeflow/docs/adr/README.md +0 -7
- package/plugins/freeflow/docs/architecture.md +0 -86
- package/plugins/freeflow/docs/release-evidence.md +0 -49
- package/plugins/freeflow/pi-extension/index.js +0 -250
- package/plugins/freeflow/skills/capture-decisions/SKILL.md +0 -95
- package/plugins/freeflow/skills/capture-decisions/references/destination-guide.md +0 -65
- package/plugins/freeflow/skills/execute-plan/SKILL.md +0 -67
- package/plugins/freeflow/skills/grill-context/SKILL.md +0 -79
- package/plugins/freeflow/skills/grill-context/references/approach-framing.md +0 -52
- package/plugins/freeflow/skills/research-brief/SKILL.md +0 -69
- package/plugins/freeflow/skills/review-work/SKILL.md +0 -73
- package/plugins/freeflow/skills/setup-freeflow/SKILL.md +0 -84
- /package/{plugins/freeflow/assets → assets}/freeflow-plugin-icon-transparent.png +0 -0
- /package/{plugins/freeflow/hooks → hooks}/hooks.json +0 -0
- /package/{plugins/freeflow/docs → plugin-docs}/adr/0001-three-modes.md +0 -0
- /package/{plugins/freeflow/skills → skills}/bypass/SKILL.md +0 -0
- /package/{plugins/freeflow/skills → skills}/diagnose-failure/references/feedback-loop-catalog.md +0 -0
- /package/{plugins/freeflow/skills → skills}/diagnose-failure/references/flaky-and-performance.md +0 -0
- /package/{plugins/freeflow/skills → skills}/evaluate-skill/SKILL.md +0 -0
- /package/{plugins/freeflow/skills → skills}/evaluate-skill/references/eval-patterns.md +0 -0
- /package/{plugins/freeflow/skills → skills}/evaluate-skill/references/grading-priority.md +0 -0
- /package/{plugins/freeflow/skills → skills}/handoff/SKILL.md +0 -0
- /package/{plugins/freeflow/skills → skills}/handoff/references/templates.md +0 -0
- /package/{plugins/freeflow/skills → skills}/interview-gate/SKILL.md +0 -0
- /package/{plugins/freeflow/skills → skills}/write-plan/references/plan-shapes.md +0 -0
- /package/{plugins/freeflow/skills → skills}/write-spec/references/artifact-standards.md +0 -0
- /package/{plugins/freeflow/skills → skills}/write-spec/references/spec-shapes.md +0 -0
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
|
|
4
|
+
import { normalizeFreeflowConfig, normalizeLocalFreeflowConfig } from "../../router/dist/index.js";
|
|
5
|
+
|
|
6
|
+
export const VALID_MODES = new Set(["conversation", "workflow", "strict-workflow"]);
|
|
7
|
+
|
|
8
|
+
export const WORKFLOW_COMMANDS = [
|
|
9
|
+
{ command: "discover", skill: "discover" },
|
|
10
|
+
{ command: "write-spec", skill: "write-spec" },
|
|
11
|
+
{ command: "review-artifact", skill: "review-artifact" },
|
|
12
|
+
{ command: "write-plan", skill: "write-plan" },
|
|
13
|
+
{ command: "execute-plan", skill: "execute-plan" },
|
|
14
|
+
{ command: "diagnose-failure", skill: "diagnose-failure" },
|
|
15
|
+
{ command: "verify-work", skill: "verify-work" },
|
|
16
|
+
{ command: "review-work", skill: "review-work" },
|
|
17
|
+
{ command: "commit-work", skill: "commit-work" },
|
|
18
|
+
{ command: "handoff", skill: "handoff" },
|
|
19
|
+
{ command: "bypass", skill: "bypass" },
|
|
20
|
+
{ command: "output-router", skill: "output-router" },
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
export const CONTRIBUTOR_COMMANDS = [
|
|
24
|
+
"setup-freeflow",
|
|
25
|
+
"write-skill",
|
|
26
|
+
"evaluate-skill",
|
|
27
|
+
];
|
|
28
|
+
|
|
29
|
+
const MODE_STATE_ENTRY = "freeflow-mode";
|
|
30
|
+
const RESET_MODE_ARGS = new Set(["reset"]);
|
|
31
|
+
|
|
32
|
+
let runtimeContextCache = null;
|
|
33
|
+
let currentModeOverride = null;
|
|
34
|
+
let lastRouterConfigWarningKey = null;
|
|
35
|
+
let shouldInjectFullRuntimeContext = true;
|
|
36
|
+
|
|
37
|
+
export function resetRuntimeContextInjection() {
|
|
38
|
+
shouldInjectFullRuntimeContext = true;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function consumeRuntimeContextInjectionState() {
|
|
42
|
+
const shouldInjectFull = shouldInjectFullRuntimeContext;
|
|
43
|
+
shouldInjectFullRuntimeContext = false;
|
|
44
|
+
return shouldInjectFull;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async function loadRuntimeContext() {
|
|
48
|
+
const [modeContractSkill, workflowSkill, interviewGateSkill, discoverSkill, outputRouterSkill] = await Promise.all([
|
|
49
|
+
readFile(new URL("../../skills/mode-contract/SKILL.md", import.meta.url), "utf8"),
|
|
50
|
+
readFile(new URL("../../skills/workflow/SKILL.md", import.meta.url), "utf8"),
|
|
51
|
+
readFile(new URL("../../skills/interview-gate/SKILL.md", import.meta.url), "utf8"),
|
|
52
|
+
readFile(new URL("../../skills/discover/SKILL.md", import.meta.url), "utf8"),
|
|
53
|
+
readFile(new URL("../../skills/output-router/SKILL.md", import.meta.url), "utf8"),
|
|
54
|
+
]);
|
|
55
|
+
|
|
56
|
+
return { modeContractSkill, workflowSkill, interviewGateSkill, discoverSkill, outputRouterSkill };
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export async function refreshRuntimeContext() {
|
|
60
|
+
runtimeContextCache = await loadRuntimeContext();
|
|
61
|
+
return runtimeContextCache;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export async function getRuntimeContext() {
|
|
65
|
+
if (runtimeContextCache) {
|
|
66
|
+
return runtimeContextCache;
|
|
67
|
+
}
|
|
68
|
+
return refreshRuntimeContext();
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export async function readFreeflowConfig(cwd) {
|
|
72
|
+
try {
|
|
73
|
+
const raw = await readFile(join(cwd, ".freeflow/config.json"), "utf8");
|
|
74
|
+
const parsed = JSON.parse(raw);
|
|
75
|
+
return parsed && typeof parsed === "object" ? parsed : {};
|
|
76
|
+
} catch {
|
|
77
|
+
return {};
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export async function readFreeflowLocalConfig(cwd) {
|
|
82
|
+
try {
|
|
83
|
+
const raw = await readFile(join(cwd, ".freeflow/local.json"), "utf8");
|
|
84
|
+
const parsed = JSON.parse(raw);
|
|
85
|
+
return parsed && typeof parsed === "object" ? parsed : {};
|
|
86
|
+
} catch {
|
|
87
|
+
return {};
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
async function readDefaultMode(cwd) {
|
|
92
|
+
const parsed = await readFreeflowConfig(cwd);
|
|
93
|
+
return VALID_MODES.has(parsed.defaultMode) ? parsed.defaultMode : "workflow";
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export async function readOutputRouterConfig(cwd) {
|
|
97
|
+
const [parsed, localParsed] = await Promise.all([readFreeflowConfig(cwd), readFreeflowLocalConfig(cwd)]);
|
|
98
|
+
const normalized = normalizeFreeflowConfig(parsed);
|
|
99
|
+
const local = normalizeLocalFreeflowConfig(localParsed);
|
|
100
|
+
return {
|
|
101
|
+
config: normalized.config.outputRouter,
|
|
102
|
+
freeflowConfig: normalized.config,
|
|
103
|
+
localConfig: local.config,
|
|
104
|
+
warnings: [...normalized.warnings, ...local.warnings],
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export function notifyRouterConfigWarnings(ctx, routerConfigResult) {
|
|
109
|
+
if (!routerConfigResult.warnings.length) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
const key = routerConfigResult.warnings.join("\n");
|
|
114
|
+
if (key === lastRouterConfigWarningKey) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
lastRouterConfigWarningKey = key;
|
|
119
|
+
ctx.ui.notify(`Freeflow config warning: ${routerConfigResult.warnings.join(" ")}`, "warning");
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export function restoreModeOverride(ctx) {
|
|
123
|
+
currentModeOverride = null;
|
|
124
|
+
const entries = ctx.sessionManager?.getEntries?.() ?? [];
|
|
125
|
+
|
|
126
|
+
for (const entry of entries) {
|
|
127
|
+
if (entry.type !== "custom" || entry.customType !== MODE_STATE_ENTRY) {
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const mode = entry.data?.currentMode;
|
|
132
|
+
currentModeOverride = VALID_MODES.has(mode) ? mode : null;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export async function readModeState(cwd) {
|
|
137
|
+
const defaultMode = await readDefaultMode(cwd);
|
|
138
|
+
const currentMode = VALID_MODES.has(currentModeOverride) ? currentModeOverride : null;
|
|
139
|
+
return {
|
|
140
|
+
defaultMode,
|
|
141
|
+
currentMode,
|
|
142
|
+
effectiveMode: currentMode ?? defaultMode,
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export function setModeStatus(ctx, modeState) {
|
|
147
|
+
ctx.ui.setStatus("freeflow", `freeflow: ${modeState.effectiveMode}`);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function describeModeState(modeState) {
|
|
151
|
+
if (modeState.currentMode) {
|
|
152
|
+
return `current ${modeState.currentMode}; default ${modeState.defaultMode}`;
|
|
153
|
+
}
|
|
154
|
+
return `default ${modeState.defaultMode}`;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export function skillPrompt(skill, args) {
|
|
158
|
+
const trimmed = args?.trim();
|
|
159
|
+
return trimmed ? `/skill:${skill}\n\n${trimmed}` : `/skill:${skill}`;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export function hasFreeflowActivation(systemPrompt) {
|
|
163
|
+
return (
|
|
164
|
+
systemPrompt.includes("## Loaded Mode Contract Skill") &&
|
|
165
|
+
systemPrompt.includes("## Loaded Workflow Skill") &&
|
|
166
|
+
systemPrompt.includes("## Loaded Interview Gate Skill")
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export function hasDiscoverActivation(systemPrompt) {
|
|
171
|
+
return systemPrompt.includes("## Loaded Discover Skill");
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export function hasFreeflowPriorityActivation(systemPrompt) {
|
|
175
|
+
return systemPrompt.includes("## Freeflow Runtime Priority");
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export function hasOutputRouterActivation(systemPrompt) {
|
|
179
|
+
return systemPrompt.includes("## Loaded Output Router Skill");
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
function outputRouterModeGuidance(mode) {
|
|
183
|
+
if (mode === "conversation") {
|
|
184
|
+
return "conversation mode: keep routed-tool guidance soft; answer questions directly.";
|
|
185
|
+
}
|
|
186
|
+
if (mode === "strict-workflow") {
|
|
187
|
+
return "strict-workflow mode: strongest guidance; prefer exact, recoverable routed evidence for risky work.";
|
|
188
|
+
}
|
|
189
|
+
return "workflow mode: prefer routed tools for exploration and likely-large command output.";
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
function outputRouterContext(modeState, freeflowContext, routerConfigResult) {
|
|
193
|
+
const safetyNetText =
|
|
194
|
+
routerConfigResult.config.postToolRouting === "off"
|
|
195
|
+
? ""
|
|
196
|
+
: "\n\nOutput-router config note: large native read/bash outputs may be vaulted and replaced with labeled routed output. Use freeflow_search with the output id to recover exact content.";
|
|
197
|
+
|
|
198
|
+
return `## Loaded Output Router Skill
|
|
199
|
+
|
|
200
|
+
Mode guidance: ${outputRouterModeGuidance(modeState.effectiveMode)}${safetyNetText}
|
|
201
|
+
|
|
202
|
+
\`\`\`md
|
|
203
|
+
${freeflowContext.outputRouterSkill.trim()}
|
|
204
|
+
\`\`\``;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
function outputRouterReminderContext(routerConfigResult) {
|
|
208
|
+
const safetyNet = routerConfigResult.config.postToolRouting === "off"
|
|
209
|
+
? "native safety-net=off; native read/bash stay direct unless deliberately small/exact."
|
|
210
|
+
: `native safety-net=${routerConfigResult.config.postToolRouting}; large native read/bash may be vaulted and labeled with recovery.`;
|
|
211
|
+
return `## Freeflow Output Router Reminder
|
|
212
|
+
|
|
213
|
+
Tools remain available every turn:
|
|
214
|
+
|
|
215
|
+
- Existing repo/vault evidence: \`freeflow_search\`.
|
|
216
|
+
- Snippet/text to coordinates: \`freeflow_search action=get\`.
|
|
217
|
+
- Known coordinates to exact lines: \`freeflow_search action=retrieve\`.
|
|
218
|
+
- Existing data to computed facts/subsets: \`freeflow_search action=transform\`.
|
|
219
|
+
- New noisy/large command or sandboxed script output: \`freeflow_run\`.
|
|
220
|
+
- Independent Freeflow run/search steps: \`freeflow_batch\`.
|
|
221
|
+
- Config, vault, observed-routing, or script-adapter status: \`freeflow_status\`.
|
|
222
|
+
- ${safetyNet}
|
|
223
|
+
|
|
224
|
+
Prefer routed tools for unknown-size, repo-wide, generated/log-adjacent, structured, or noisy output. Use native read/bash only when direct known-small output is intentional.`;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
function runtimePriorityContext() {
|
|
228
|
+
return `## Freeflow Runtime Priority
|
|
229
|
+
|
|
230
|
+
Mode Contract handles mode setting, mode interpretation, and mode mismatch before task routing when mode is at issue.
|
|
231
|
+
|
|
232
|
+
Priority order for matched non-mode workflow skills:
|
|
233
|
+
|
|
234
|
+
1. Workflow classifies conversation versus consequential work.
|
|
235
|
+
2. Interview Gate stops silent decisions, user-owned decisions, source-truth conflicts, and question-to-action mistakes.
|
|
236
|
+
3. Discover handles context-building after no immediate stop condition remains. Use it before first repo/code exploration or design answers for consequential product/API/tool/runtime hypotheses.
|
|
237
|
+
4. Output Router chooses evidence transport after the workflow/interview/discover route is clear.`;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
function modeContractContext(freeflowContext) {
|
|
241
|
+
return `## Loaded Mode Contract Skill
|
|
242
|
+
|
|
243
|
+
\`\`\`md
|
|
244
|
+
${freeflowContext.modeContractSkill.trim()}
|
|
245
|
+
\`\`\``;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
function discoverContext(freeflowContext) {
|
|
249
|
+
return `## Loaded Discover Skill
|
|
250
|
+
|
|
251
|
+
\`\`\`md
|
|
252
|
+
${freeflowContext.discoverSkill.trim()}
|
|
253
|
+
\`\`\``;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
export function runtimeContext(
|
|
257
|
+
modeState,
|
|
258
|
+
freeflowContext,
|
|
259
|
+
routerConfigResult,
|
|
260
|
+
alreadyActivated,
|
|
261
|
+
routerAlreadyActivated,
|
|
262
|
+
discoverAlreadyActivated,
|
|
263
|
+
priorityAlreadyActivated,
|
|
264
|
+
) {
|
|
265
|
+
const currentMode = modeState.currentMode ?? "none";
|
|
266
|
+
const priorityText = priorityAlreadyActivated ? "" : `\n\n${runtimePriorityContext()}`;
|
|
267
|
+
const discoverText = discoverAlreadyActivated ? "" : `\n\n${discoverContext(freeflowContext)}`;
|
|
268
|
+
const routerText = routerAlreadyActivated || !routerConfigResult.config.enabled ? "" : `\n\n${outputRouterContext(modeState, freeflowContext, routerConfigResult)}`;
|
|
269
|
+
const routerReminderText = routerConfigResult.config.enabled ? `\n\n${outputRouterReminderContext(routerConfigResult)}` : "";
|
|
270
|
+
const shortRouterText = routerText || routerReminderText;
|
|
271
|
+
|
|
272
|
+
if (alreadyActivated) {
|
|
273
|
+
return `## Freeflow Runtime Context
|
|
274
|
+
|
|
275
|
+
Repo default mode from \`.freeflow/config.json\`: ${modeState.defaultMode}.
|
|
276
|
+
Current session mode override: ${currentMode}.
|
|
277
|
+
Effective Freeflow mode: ${modeState.effectiveMode}.
|
|
278
|
+
|
|
279
|
+
Treat the effective mode as the current mode for this turn. Follow the installed Freeflow rules for that mode; default workflow means use workflow rules for consequential work. Conversation mode is non-mutating only: discussion, read-only inspection, safe read-only commands, and planning in chat. If effective mode is conversation and the user asks to edit, create files, run mutating commands, commit, push, or otherwise change repo/system state, require switching to \`workflow\` or \`strict-workflow\` before acting, even if pressured. If mode interpretation, a mode change, or a mode mismatch affects the next action, use \`mode-contract\` before proceeding. If evidence routing or output-router config affects the next action, use \`output-router\`, \`freeflow_status\`, and live config instead of remembered routing rules. Use the installed Freeflow skills when they match the task. This Pi extension loads context and routes commands only; it does not enforce policy, block tools, grant permissions, or create repo-local hooks.${priorityText}${discoverText}${shortRouterText}`;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
return `# Freeflow Runtime Context
|
|
283
|
+
|
|
284
|
+
Freeflow Pi extension loaded this before the agent turn.
|
|
285
|
+
These instructions are context-loading only. They do not override user instructions, repo instructions, or host safety and approval policy.
|
|
286
|
+
|
|
287
|
+
## Repo Setup
|
|
288
|
+
|
|
289
|
+
Repo default mode from \`.freeflow/config.json\`: \`${modeState.defaultMode}\`.
|
|
290
|
+
Current session mode override: \`${currentMode}\`.
|
|
291
|
+
Effective Freeflow mode: \`${modeState.effectiveMode}\`.
|
|
292
|
+
Treat the effective mode as the current mode for this agent turn.
|
|
293
|
+
For mode changes or mode interpretation, use \`mode-contract\`.
|
|
294
|
+
Do not announce the current mode on every reply. Mention it when the user asks, setup/config is discussed, or the mode changes the next action.
|
|
295
|
+
|
|
296
|
+
${runtimePriorityContext()}
|
|
297
|
+
|
|
298
|
+
${modeContractContext(freeflowContext)}
|
|
299
|
+
|
|
300
|
+
## Loaded Workflow Skill
|
|
301
|
+
|
|
302
|
+
\`\`\`md
|
|
303
|
+
${freeflowContext.workflowSkill.trim()}
|
|
304
|
+
\`\`\`
|
|
305
|
+
|
|
306
|
+
## Loaded Interview Gate Skill
|
|
307
|
+
|
|
308
|
+
\`\`\`md
|
|
309
|
+
${freeflowContext.interviewGateSkill.trim()}
|
|
310
|
+
\`\`\`
|
|
311
|
+
|
|
312
|
+
${discoverContext(freeflowContext)}
|
|
313
|
+
|
|
314
|
+
${routerText ? `${routerText.trimStart()}\n\n` : ""}This Pi extension loads context and routes commands only; it does not enforce policy, block tools, grant permissions, or create repo-local hooks.`;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
export async function handleWorkflowCommand(args, ctx, pi) {
|
|
318
|
+
const arg = args?.trim();
|
|
319
|
+
|
|
320
|
+
if (VALID_MODES.has(arg)) {
|
|
321
|
+
currentModeOverride = arg;
|
|
322
|
+
pi.appendEntry?.(MODE_STATE_ENTRY, { currentMode: arg });
|
|
323
|
+
const modeState = await readModeState(ctx.cwd);
|
|
324
|
+
setModeStatus(ctx, modeState);
|
|
325
|
+
ctx.ui.notify(
|
|
326
|
+
`Freeflow mode is now ${modeState.effectiveMode} for this session. Repo default remains ${modeState.defaultMode}.`,
|
|
327
|
+
"info"
|
|
328
|
+
);
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
if (RESET_MODE_ARGS.has(arg)) {
|
|
333
|
+
currentModeOverride = null;
|
|
334
|
+
pi.appendEntry?.(MODE_STATE_ENTRY, { currentMode: null });
|
|
335
|
+
const modeState = await readModeState(ctx.cwd);
|
|
336
|
+
setModeStatus(ctx, modeState);
|
|
337
|
+
ctx.ui.notify(`Freeflow mode reset to repo default: ${modeState.defaultMode}.`, "info");
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
const modeState = await readModeState(ctx.cwd);
|
|
342
|
+
setModeStatus(ctx, modeState);
|
|
343
|
+
ctx.ui.notify(
|
|
344
|
+
`Freeflow mode is ${modeState.effectiveMode} (${describeModeState(modeState)}). Use /workflow conversation, /workflow workflow, /workflow strict-workflow, or /workflow reset.`,
|
|
345
|
+
"info"
|
|
346
|
+
);
|
|
347
|
+
}
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
const STRING_SCHEMA = { type: "string" };
|
|
2
|
+
const PRESERVE_SCHEMA = { type: "string", enum: ["summary", "important", "full"] };
|
|
3
|
+
const SEARCH_ACTION_SCHEMA = {
|
|
4
|
+
type: "string",
|
|
5
|
+
enum: ["query", "locate", "get", "retrieve", "expand", "explain", "transform"],
|
|
6
|
+
};
|
|
7
|
+
const EXPANSION_SCHEMA = { type: "string", enum: ["lines_30", "lines_80", "full"] };
|
|
8
|
+
const STREAM_SCHEMA = { type: "string", enum: ["stdout", "stderr", "combined", "raw"] };
|
|
9
|
+
const RUN_FILTER_STREAM_SCHEMA = { type: "string", enum: ["stdout", "stderr", "combined"] };
|
|
10
|
+
const NON_EMPTY_STRING_SCHEMA = { type: "string", minLength: 1 };
|
|
11
|
+
const MAX_CONTEXT_LINES_SCHEMA = { type: "integer", minimum: 0, maximum: 20 };
|
|
12
|
+
const MAX_REGEX_MATCHES_SCHEMA = { type: "integer", minimum: 1, maximum: 1000 };
|
|
13
|
+
const MAX_GROUPS_SCHEMA = { type: "integer", minimum: 1, maximum: 1000 };
|
|
14
|
+
const MAX_LINES_PER_GROUP_SCHEMA = { type: "integer", minimum: 1, maximum: 1000 };
|
|
15
|
+
const MAX_DEDUPE_LINES_SCHEMA = { type: "integer", minimum: 1, maximum: 10000 };
|
|
16
|
+
const MAX_TOP_N_LIMIT_SCHEMA = { type: "integer", minimum: 1, maximum: 1000 };
|
|
17
|
+
const REGEX_FLAGS_SCHEMA = {
|
|
18
|
+
type: "string",
|
|
19
|
+
pattern: "^(?!.*([gimsu]).*\\1)[gimsu]*$",
|
|
20
|
+
description: "Regex flags: g, i, m, s, or u, without duplicates. g is added internally for extraction.",
|
|
21
|
+
};
|
|
22
|
+
const JSON_POINTER_PATTERN = String.raw`^(?:|/(?:[^~/]|~[01])*(?:/(?:[^~/]|~[01])*)*)$`;
|
|
23
|
+
const JSON_PATH_PATTERN = String.raw`^\$(?:\.[A-Za-z_$][A-Za-z0-9_$-]*|\[(?:0|[1-9][0-9]*)\]|\["(?:[^"\\\u0000-\u001F]|\\(?:["\\/bfnrt]|u[0-9A-Fa-f]{4}))*"\])*$`;
|
|
24
|
+
const SCRIPT_LANGUAGE_SCHEMA = { type: "string", enum: ["javascript", "python", "jq"] };
|
|
25
|
+
const SCRIPT_LIMITS_SCHEMA = {
|
|
26
|
+
type: "object",
|
|
27
|
+
additionalProperties: false,
|
|
28
|
+
properties: {
|
|
29
|
+
timeoutMs: { type: "integer", minimum: 1, maximum: 30000 },
|
|
30
|
+
maxInputBytes: { type: "integer", minimum: 1, maximum: 10485760 },
|
|
31
|
+
maxOutputBytes: { type: "integer", minimum: 1, maximum: 1048576 },
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const FREEFLOW_STATUS_PARAMETERS = {
|
|
36
|
+
type: "object",
|
|
37
|
+
additionalProperties: false,
|
|
38
|
+
properties: {
|
|
39
|
+
action: {
|
|
40
|
+
type: "string",
|
|
41
|
+
enum: ["status", "doctor", "migration"],
|
|
42
|
+
description: "Status view to render. migration is non-destructive and reports recommendations only.",
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export const FREEFLOW_SEARCH_PARAMETERS = {
|
|
48
|
+
type: "object",
|
|
49
|
+
additionalProperties: false,
|
|
50
|
+
properties: {
|
|
51
|
+
action: { ...SEARCH_ACTION_SCHEMA, description: "Search/retrieval action to perform, or transform to process a repo/vault source." },
|
|
52
|
+
source: {
|
|
53
|
+
type: "object",
|
|
54
|
+
additionalProperties: false,
|
|
55
|
+
properties: {
|
|
56
|
+
kind: { type: "string", enum: ["repo", "vault"] },
|
|
57
|
+
path: { ...STRING_SCHEMA, description: "Repo path for source.kind=repo." },
|
|
58
|
+
outputId: { ...STRING_SCHEMA, description: "Vault output id for source.kind=vault. Optional for vault query/locate." },
|
|
59
|
+
stream: { ...STREAM_SCHEMA, description: "Vault stream to read or filter." },
|
|
60
|
+
producerKind: { type: "string", enum: ["command", "script", "native", "repo", "web", "fetch", "code_search", "mcp", "transform", "other"], description: "Vault index producer-kind filter for source.kind=vault query/locate." },
|
|
61
|
+
server: { ...STRING_SCHEMA, description: "Vault index MCP server filter for source.kind=vault query/locate." },
|
|
62
|
+
tool: { ...STRING_SCHEMA, description: "Vault index MCP/tool filter for source.kind=vault query/locate." },
|
|
63
|
+
hostToolName: { ...STRING_SCHEMA, description: "Vault index host-tool filter for source.kind=vault query/locate." },
|
|
64
|
+
recordKind: { type: "string", enum: ["command", "text", "metadata", "repo-file"], description: "Vault record-kind filter for source.kind=vault query/locate." },
|
|
65
|
+
recoverability: { type: "string", enum: ["exact", "redacted", "metadata_only", "none"], description: "Vault recoverability filter for source.kind=vault query/locate." },
|
|
66
|
+
},
|
|
67
|
+
required: ["kind"],
|
|
68
|
+
description: "Source to search, retrieve, or transform. Repo root and vault session are supplied by Freeflow/Pi.",
|
|
69
|
+
},
|
|
70
|
+
query: { ...STRING_SCHEMA, description: "Text query for query/locate actions." },
|
|
71
|
+
goal: { ...STRING_SCHEMA, description: "Goal for action=transform, such as log analysis, CSV summary, or test output processing." },
|
|
72
|
+
script: {
|
|
73
|
+
type: "object",
|
|
74
|
+
additionalProperties: false,
|
|
75
|
+
properties: {
|
|
76
|
+
language: { ...SCRIPT_LANGUAGE_SCHEMA, description: "Processing script language." },
|
|
77
|
+
code: { ...NON_EMPTY_STRING_SCHEMA, description: "Processing script code. Raw code is not persisted by default." },
|
|
78
|
+
label: { ...NON_EMPTY_STRING_SCHEMA, description: "Optional script label." },
|
|
79
|
+
alias: { type: "string", pattern: "^[A-Za-z][A-Za-z0-9_-]{0,63}$", description: "Input source alias exposed to the processing script." },
|
|
80
|
+
policy: { type: "string", enum: ["sandboxed", "unsafe-unsandboxed"], description: "Script execution policy. unsafe-unsandboxed requires local-only opt-in and is visibly labeled." },
|
|
81
|
+
limits: { ...SCRIPT_LIMITS_SCHEMA, description: "Script resource limits. They only tighten configured limits." },
|
|
82
|
+
},
|
|
83
|
+
required: ["language", "code"],
|
|
84
|
+
description: "Optional programmable processing for action=transform. Sandboxed remains default; unsafe-unsandboxed requires .freeflow/local.json opt-in.",
|
|
85
|
+
},
|
|
86
|
+
operation: {
|
|
87
|
+
type: "object",
|
|
88
|
+
additionalProperties: false,
|
|
89
|
+
properties: {
|
|
90
|
+
kind: { type: "string", enum: ["regexFilter", "countMatches", "jsonExtract", "groupByRegex", "dedupe", "topN", "extractUrls", "extractCitations", "lineStats", "sizeStats", "script"], description: "Deterministic transform operation for action=transform over vaulted output, or sandboxed script transform." },
|
|
91
|
+
pattern: { ...NON_EMPTY_STRING_SCHEMA, description: "Regex pattern for regexFilter, countMatches, groupByRegex, or regex-backed topN." },
|
|
92
|
+
flags: REGEX_FLAGS_SCHEMA,
|
|
93
|
+
pointer: { ...STRING_SCHEMA, pattern: JSON_POINTER_PATTERN, description: "JSON Pointer for jsonExtract." },
|
|
94
|
+
path: { ...NON_EMPTY_STRING_SCHEMA, pattern: JSON_PATH_PATTERN, description: "JSON path for jsonExtract." },
|
|
95
|
+
contextLines: MAX_CONTEXT_LINES_SCHEMA,
|
|
96
|
+
maxMatches: MAX_REGEX_MATCHES_SCHEMA,
|
|
97
|
+
group: NON_EMPTY_STRING_SCHEMA,
|
|
98
|
+
maxGroups: MAX_GROUPS_SCHEMA,
|
|
99
|
+
maxLinesPerGroup: MAX_LINES_PER_GROUP_SCHEMA,
|
|
100
|
+
trim: { type: "boolean" },
|
|
101
|
+
caseSensitive: { type: "boolean" },
|
|
102
|
+
maxLines: MAX_DEDUPE_LINES_SCHEMA,
|
|
103
|
+
limit: MAX_TOP_N_LIMIT_SCHEMA,
|
|
104
|
+
sort: { type: "string", enum: ["text", "numeric"] },
|
|
105
|
+
order: { type: "string", enum: ["asc", "desc"] },
|
|
106
|
+
dedupe: { type: "boolean" },
|
|
107
|
+
language: SCRIPT_LANGUAGE_SCHEMA,
|
|
108
|
+
code: NON_EMPTY_STRING_SCHEMA,
|
|
109
|
+
label: NON_EMPTY_STRING_SCHEMA,
|
|
110
|
+
},
|
|
111
|
+
required: ["kind"],
|
|
112
|
+
description: "Optional deterministic transform operation for action=transform. Existing source raw output remains recoverable by lineage when available.",
|
|
113
|
+
},
|
|
114
|
+
sources: {
|
|
115
|
+
type: "array",
|
|
116
|
+
minItems: 1,
|
|
117
|
+
items: {
|
|
118
|
+
type: "object",
|
|
119
|
+
additionalProperties: false,
|
|
120
|
+
properties: {
|
|
121
|
+
kind: { type: "string", enum: ["vault"] },
|
|
122
|
+
outputId: NON_EMPTY_STRING_SCHEMA,
|
|
123
|
+
stream: STREAM_SCHEMA,
|
|
124
|
+
alias: { type: "string", pattern: "^[A-Za-z][A-Za-z0-9_-]{0,63}$" },
|
|
125
|
+
},
|
|
126
|
+
required: ["kind", "outputId", "alias"],
|
|
127
|
+
},
|
|
128
|
+
description: "Vault sources for action=transform operation.kind=script.",
|
|
129
|
+
},
|
|
130
|
+
limits: { ...SCRIPT_LIMITS_SCHEMA, description: "Processing or script transform resource limits." },
|
|
131
|
+
filters: {
|
|
132
|
+
type: "object",
|
|
133
|
+
additionalProperties: false,
|
|
134
|
+
properties: {
|
|
135
|
+
producerKind: { type: "string", enum: ["command", "script", "native", "repo", "web", "fetch", "code_search", "mcp", "transform", "other"] },
|
|
136
|
+
server: STRING_SCHEMA,
|
|
137
|
+
tool: STRING_SCHEMA,
|
|
138
|
+
hostToolName: STRING_SCHEMA,
|
|
139
|
+
stream: STREAM_SCHEMA,
|
|
140
|
+
recordKind: { type: "string", enum: ["command", "text", "metadata", "repo-file"] },
|
|
141
|
+
recoverability: { type: "string", enum: ["exact", "redacted", "metadata_only", "none"] },
|
|
142
|
+
},
|
|
143
|
+
description: "Vault index filters for source.kind=vault query/locate.",
|
|
144
|
+
},
|
|
145
|
+
preserve: { ...PRESERVE_SCHEMA, description: "Fidelity mode. Default: important." },
|
|
146
|
+
evidence: {
|
|
147
|
+
type: "object",
|
|
148
|
+
additionalProperties: true,
|
|
149
|
+
description: "Evidence packet from a previous freeflow_search result, used for expand.",
|
|
150
|
+
},
|
|
151
|
+
expansion: { ...EXPANSION_SCHEMA, description: "Expansion breadth for expand action." },
|
|
152
|
+
maxFullBytes: { type: "number", description: "Cap for preserve=full before exact chunks are returned." },
|
|
153
|
+
topK: { type: "number", description: "Number of ranked repo or vault candidates for query/locate. Defaults: query=1, locate=5; max 10." },
|
|
154
|
+
lineRange: {
|
|
155
|
+
type: "object",
|
|
156
|
+
additionalProperties: false,
|
|
157
|
+
properties: {
|
|
158
|
+
start: { type: "number" },
|
|
159
|
+
end: { type: "number" },
|
|
160
|
+
},
|
|
161
|
+
required: ["start", "end"],
|
|
162
|
+
description: "Exact 1-based line range for vault retrieve.",
|
|
163
|
+
},
|
|
164
|
+
decision: {
|
|
165
|
+
type: "object",
|
|
166
|
+
additionalProperties: true,
|
|
167
|
+
description: "Prior routed result to explain.",
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
required: ["action"],
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
export const FREEFLOW_RUN_PARAMETERS = {
|
|
174
|
+
type: "object",
|
|
175
|
+
additionalProperties: false,
|
|
176
|
+
oneOf: [
|
|
177
|
+
{ required: ["command"] },
|
|
178
|
+
{ required: ["script"] },
|
|
179
|
+
],
|
|
180
|
+
properties: {
|
|
181
|
+
command: { ...STRING_SCHEMA, description: "Shell command to run through Pi's approved command runner. Mutually exclusive with script." },
|
|
182
|
+
script: {
|
|
183
|
+
type: "object",
|
|
184
|
+
additionalProperties: false,
|
|
185
|
+
properties: {
|
|
186
|
+
language: { ...SCRIPT_LANGUAGE_SCHEMA, description: "Sandboxed script language. Requires configured scriptTransform.enabled and a proof-backed adapter." },
|
|
187
|
+
code: { ...NON_EMPTY_STRING_SCHEMA, description: "Script code to run as the base producer. Raw code is not persisted; metadata stores a code hash." },
|
|
188
|
+
label: { ...NON_EMPTY_STRING_SCHEMA, description: "Optional script producer label." },
|
|
189
|
+
limits: { ...SCRIPT_LIMITS_SCHEMA, description: "Script resource limits. They only tighten configured scriptTransform defaults. Top-level timeoutMs is used as timeoutMs when script.limits.timeoutMs is omitted." },
|
|
190
|
+
},
|
|
191
|
+
required: ["language", "code"],
|
|
192
|
+
description: "Sandboxed script to run as the base producer for freeflow_run. Mutually exclusive with command. Captured stdout/stderr route through normal run storage, parsing, filtering, and recovery.",
|
|
193
|
+
},
|
|
194
|
+
cwd: { ...STRING_SCHEMA, description: "Working directory. Defaults to the current Pi cwd. For sandboxed script producers this is metadata only; repo/home/env/network are not mounted." },
|
|
195
|
+
timeoutMs: { type: "number", description: "Optional timeout in milliseconds." },
|
|
196
|
+
preserve: { ...PRESERVE_SCHEMA, description: "Fidelity mode. Default: important." },
|
|
197
|
+
goal: { ...STRING_SCHEMA, description: "Goal such as verification, test, build, or search." },
|
|
198
|
+
filters: {
|
|
199
|
+
type: "object",
|
|
200
|
+
additionalProperties: false,
|
|
201
|
+
properties: {
|
|
202
|
+
stream: { ...RUN_FILTER_STREAM_SCHEMA, description: "Output stream to filter. Defaults to Freeflow's selected routed stream." },
|
|
203
|
+
include: { type: "array", items: NON_EMPTY_STRING_SCHEMA, description: "Regex patterns; keep lines matching any pattern." },
|
|
204
|
+
exclude: { type: "array", items: NON_EMPTY_STRING_SCHEMA, description: "Regex patterns; drop lines matching any pattern after include filtering." },
|
|
205
|
+
flags: REGEX_FLAGS_SCHEMA,
|
|
206
|
+
head: { type: "integer", minimum: 1, description: "Keep the first N filtered lines." },
|
|
207
|
+
tail: { type: "integer", minimum: 1, description: "Keep the last N filtered lines. With head, returns the union of both spans." },
|
|
208
|
+
maxLines: { type: "integer", minimum: 1, description: "Maximum filtered lines to return." },
|
|
209
|
+
maxBytes: { type: "integer", minimum: 1, description: "Maximum bytes of filtered evidence to return." },
|
|
210
|
+
},
|
|
211
|
+
description: "Declarative line filters applied after raw capture and before routed evidence is returned. Exact raw output remains recoverable.",
|
|
212
|
+
},
|
|
213
|
+
scriptFilter: {
|
|
214
|
+
type: "object",
|
|
215
|
+
additionalProperties: false,
|
|
216
|
+
properties: {
|
|
217
|
+
language: { ...SCRIPT_LANGUAGE_SCHEMA, description: "Sandboxed script language. Requires configured scriptTransform.enabled and a proof-backed adapter." },
|
|
218
|
+
code: { ...NON_EMPTY_STRING_SCHEMA, description: "Script code. Raw code is not persisted by default." },
|
|
219
|
+
label: { ...NON_EMPTY_STRING_SCHEMA, description: "Optional script filter label." },
|
|
220
|
+
limits: { ...SCRIPT_LIMITS_SCHEMA, description: "Script resource limits. They only tighten configured scriptTransform defaults." },
|
|
221
|
+
},
|
|
222
|
+
required: ["language", "code"],
|
|
223
|
+
description: "Sandboxed programmable filter over captured stdout/stderr/combined after raw command output is vaulted. No unsandboxed fallback is used.",
|
|
224
|
+
},
|
|
225
|
+
},
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
export const FREEFLOW_BATCH_PARAMETERS = {
|
|
230
|
+
type: "object",
|
|
231
|
+
additionalProperties: false,
|
|
232
|
+
properties: {
|
|
233
|
+
steps: {
|
|
234
|
+
type: "array",
|
|
235
|
+
minItems: 1,
|
|
236
|
+
maxItems: 50,
|
|
237
|
+
items: {
|
|
238
|
+
type: "object",
|
|
239
|
+
additionalProperties: false,
|
|
240
|
+
properties: {
|
|
241
|
+
id: { ...NON_EMPTY_STRING_SCHEMA, description: "Optional stable step id for matching results." },
|
|
242
|
+
kind: { type: "string", enum: ["run", "search"], description: "Freeflow-owned public operation kind. Steps are independent and run in parallel." },
|
|
243
|
+
input: { type: "object", additionalProperties: true, description: "Input for the selected Freeflow operation. Uses the same shape as freeflow_run or freeflow_search." },
|
|
244
|
+
},
|
|
245
|
+
required: ["kind", "input"],
|
|
246
|
+
},
|
|
247
|
+
description: "Independent Freeflow-owned steps to run in parallel. No sequencing or external tool orchestration in v1.",
|
|
248
|
+
},
|
|
249
|
+
queries: {
|
|
250
|
+
type: "array",
|
|
251
|
+
maxItems: 10,
|
|
252
|
+
items: { ...NON_EMPTY_STRING_SCHEMA, maxLength: 500 },
|
|
253
|
+
description: "Optional independent query/fact requests to answer from completed child evidence handles.",
|
|
254
|
+
},
|
|
255
|
+
concurrency: { type: "integer", minimum: 1, maximum: 16, description: "Maximum number of independent steps to run at once. Default: 4." },
|
|
256
|
+
preserve: { ...PRESERVE_SCHEMA, description: "Default fidelity mode for steps that do not set preserve." },
|
|
257
|
+
},
|
|
258
|
+
required: ["steps"],
|
|
259
|
+
};
|