@kal-elsam/kairo-runtime 0.1.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/README.md +937 -0
- package/bin/harness.js +11 -0
- package/bin/kairo-runtime.js +11 -0
- package/bin/kairo.js +11 -0
- package/global-template/components/catalog.json +25 -0
- package/global-template/components/orchestrator/orchestrator.md +55 -0
- package/global-template/components/sdd-core/handoff.md +38 -0
- package/global-template/components/sdd-core/spec-sizing.md +38 -0
- package/global-template/components/sdd-core/workflow.md +31 -0
- package/global-template/core/orchestrator.md +55 -0
- package/package.json +64 -0
- package/prompts/HARNESS_ENFORCEMENT_UPGRADE.md +11 -0
- package/prompts/HARNESS_ENTERPRISE.md +33 -0
- package/prompts/HARNESS_INSTALLER_MASTER.md +853 -0
- package/prompts/HARNESS_MINIMAL.md +30 -0
- package/prompts/HARNESS_SPEC_SIZING_UPGRADE.md +41 -0
- package/prompts/HARNESS_STANDARD.md +35 -0
- package/prompts/HARNESS_UNIVERSAL_PARITY.md +56 -0
- package/repo-template/.claude/agents/adapter-parity-reviewer.md +17 -0
- package/repo-template/.claude/agents/architect.md +17 -0
- package/repo-template/.claude/agents/eval-engineer.md +17 -0
- package/repo-template/.claude/agents/reviewer.md +17 -0
- package/repo-template/.claude/agents/sdd-reviewer.md +17 -0
- package/repo-template/.claude/agents/sdd-spec-writer.md +17 -0
- package/repo-template/.claude/skills/checkpoint/SKILL.md +13 -0
- package/repo-template/.claude/skills/eval-design/SKILL.md +3 -0
- package/repo-template/.claude/skills/evals/SKILL.md +13 -0
- package/repo-template/.claude/skills/loop-engineering/SKILL.md +16 -0
- package/repo-template/.claude/skills/maintainability-review/SKILL.md +3 -0
- package/repo-template/.claude/skills/quality-gate-review/SKILL.md +3 -0
- package/repo-template/.claude/skills/sdd/SKILL.md +13 -0
- package/repo-template/.claude/skills/spec-complexity-classifier/SKILL.md +10 -0
- package/repo-template/.claude/skills/spec-escalation-review/SKILL.md +10 -0
- package/repo-template/.claude/skills/spec-intake/SKILL.md +10 -0
- package/repo-template/.claude/skills/tdd/SKILL.md +13 -0
- package/repo-template/.claude/skills/trust-review/SKILL.md +3 -0
- package/repo-template/.codex/skills/adapter-parity/SKILL.md +29 -0
- package/repo-template/.codex/skills/checkpoint/SKILL.md +36 -0
- package/repo-template/.codex/skills/eval-design/SKILL.md +3 -0
- package/repo-template/.codex/skills/evals/SKILL.md +28 -0
- package/repo-template/.codex/skills/loop-engineering/SKILL.md +24 -0
- package/repo-template/.codex/skills/maintainability-review/SKILL.md +3 -0
- package/repo-template/.codex/skills/quality-gate-review/SKILL.md +3 -0
- package/repo-template/.codex/skills/sdd/SKILL.md +30 -0
- package/repo-template/.codex/skills/spec-complexity-classifier/SKILL.md +10 -0
- package/repo-template/.codex/skills/spec-escalation-review/SKILL.md +10 -0
- package/repo-template/.codex/skills/spec-intake/SKILL.md +10 -0
- package/repo-template/.codex/skills/tdd/SKILL.md +27 -0
- package/repo-template/.codex/skills/trust-review/SKILL.md +3 -0
- package/repo-template/.cursor/agents/adapter-parity-reviewer.md +29 -0
- package/repo-template/.cursor/agents/architect.md +27 -0
- package/repo-template/.cursor/agents/context-engineer.md +27 -0
- package/repo-template/.cursor/agents/debugger.md +27 -0
- package/repo-template/.cursor/agents/eval-engineer.md +27 -0
- package/repo-template/.cursor/agents/harness-orchestrator.md +27 -0
- package/repo-template/.cursor/agents/loop-controller.md +17 -0
- package/repo-template/.cursor/agents/loop-debugger.md +16 -0
- package/repo-template/.cursor/agents/reviewer.md +27 -0
- package/repo-template/.cursor/agents/sdd/sdd-acceptance-reviewer.md +31 -0
- package/repo-template/.cursor/agents/sdd/sdd-implementation-guardian.md +31 -0
- package/repo-template/.cursor/agents/sdd/sdd-intake-analyst.md +31 -0
- package/repo-template/.cursor/agents/sdd/sdd-orchestrator.md +31 -0
- package/repo-template/.cursor/agents/sdd/sdd-spec-reviewer.md +31 -0
- package/repo-template/.cursor/agents/sdd/sdd-spec-writer.md +31 -0
- package/repo-template/.cursor/agents/sdd/sdd-task-breakdown.md +31 -0
- package/repo-template/.cursor/agents/sdd/sdd-technical-planner.md +31 -0
- package/repo-template/.cursor/agents/sdd/sdd-test-planner.md +31 -0
- package/repo-template/.cursor/agents/spec-intake-analyst.md +14 -0
- package/repo-template/.cursor/agents/test-engineer.md +27 -0
- package/repo-template/.cursor/commands/adapter-parity.md +34 -0
- package/repo-template/.cursor/commands/checkpoint.md +30 -0
- package/repo-template/.cursor/commands/debug.md +13 -0
- package/repo-template/.cursor/commands/init-eval.md +12 -0
- package/repo-template/.cursor/commands/init-feature.md +12 -0
- package/repo-template/.cursor/commands/init-harness.md +13 -0
- package/repo-template/.cursor/commands/loop-debug.md +3 -0
- package/repo-template/.cursor/commands/loop-review.md +3 -0
- package/repo-template/.cursor/commands/loop-run.md +5 -0
- package/repo-template/.cursor/commands/review.md +21 -0
- package/repo-template/.cursor/commands/sdd-intake.md +18 -0
- package/repo-template/.cursor/commands/sdd-plan.md +18 -0
- package/repo-template/.cursor/commands/sdd-spec.md +18 -0
- package/repo-template/.cursor/commands/sdd-tasks.md +18 -0
- package/repo-template/.cursor/commands/sdd-validate.md +18 -0
- package/repo-template/.cursor/commands/spec-escalate.md +9 -0
- package/repo-template/.cursor/commands/spec-intake.md +10 -0
- package/repo-template/.cursor/commands/spec-size.md +21 -0
- package/repo-template/.cursor/rules/adapter-parity.mdc +20 -0
- package/repo-template/.cursor/rules/api.mdc +12 -0
- package/repo-template/.cursor/rules/core.mdc +21 -0
- package/repo-template/.cursor/rules/enforcement.mdc +16 -0
- package/repo-template/.cursor/rules/evals.mdc +10 -0
- package/repo-template/.cursor/rules/git.mdc +19 -0
- package/repo-template/.cursor/rules/harness.mdc +14 -0
- package/repo-template/.cursor/rules/loops.mdc +17 -0
- package/repo-template/.cursor/rules/testing.mdc +13 -0
- package/repo-template/.cursor/rules/ui.mdc +13 -0
- package/repo-template/.cursor/skills/api-design/SKILL.md +23 -0
- package/repo-template/.cursor/skills/architecture/SKILL.md +23 -0
- package/repo-template/.cursor/skills/code-review/SKILL.md +23 -0
- package/repo-template/.cursor/skills/context-graph/SKILL.md +23 -0
- package/repo-template/.cursor/skills/debugging/SKILL.md +23 -0
- package/repo-template/.cursor/skills/evals/SKILL.md +23 -0
- package/repo-template/.cursor/skills/git-workflow/SKILL.md +23 -0
- package/repo-template/.cursor/skills/testing/SKILL.md +23 -0
- package/repo-template/.cursor/skills/ui-design/SKILL.md +23 -0
- package/repo-template/.gentle-ai/README.md +37 -0
- package/repo-template/.gentle-ai/loops/README.md +27 -0
- package/repo-template/.gentle-ai/loops/sdd-tdd-repair.loop.md +27 -0
- package/repo-template/.gentle-ai/model-routing.md +25 -0
- package/repo-template/.github/copilot-instructions.md +37 -0
- package/repo-template/.github/dependabot.yml +11 -0
- package/repo-template/.github/instructions/harness.instructions.md +11 -0
- package/repo-template/.github/workflows/harness-quality-gate.yml +67 -0
- package/repo-template/.github/workflows/harness-security-gate.yml +32 -0
- package/repo-template/.harness/spec-sizing.json +33 -0
- package/repo-template/.opencode/README.md +71 -0
- package/repo-template/.opencode/agents/adapter-parity-reviewer.md +23 -0
- package/repo-template/.opencode/agents/architect.md +38 -0
- package/repo-template/.opencode/agents/checkpoint-reviewer.md +38 -0
- package/repo-template/.opencode/agents/eval-engineer.md +38 -0
- package/repo-template/.opencode/agents/loop-controller.md +38 -0
- package/repo-template/.opencode/agents/loop-debugger.md +38 -0
- package/repo-template/.opencode/agents/model-router.md +38 -0
- package/repo-template/.opencode/agents/sdd-orchestrator.md +38 -0
- package/repo-template/.opencode/agents/sdd-spec-reviewer.md +38 -0
- package/repo-template/.opencode/agents/spec-intake-analyst.md +19 -0
- package/repo-template/.opencode/agents/tdd-engineer.md +38 -0
- package/repo-template/.opencode/commands/checkpoint.md +3 -0
- package/repo-template/.opencode/commands/eval-design.md +3 -0
- package/repo-template/.opencode/commands/maintainability-review.md +3 -0
- package/repo-template/.opencode/commands/quality-gate.md +3 -0
- package/repo-template/.opencode/commands/spec-escalate.md +9 -0
- package/repo-template/.opencode/commands/spec-intake.md +10 -0
- package/repo-template/.opencode/commands/spec-size.md +21 -0
- package/repo-template/.opencode/commands/trust-review.md +3 -0
- package/repo-template/.opencode/loops/ai-behavior-improvement.loop.md +15 -0
- package/repo-template/.opencode/loops/bug-repair.loop.md +16 -0
- package/repo-template/.opencode/loops/documentation-sync.loop.md +13 -0
- package/repo-template/.opencode/loops/feature-development.loop.md +25 -0
- package/repo-template/.opencode/skills/spec-complexity-classifier/SKILL.md +10 -0
- package/repo-template/.opencode/skills/spec-escalation-review/SKILL.md +10 -0
- package/repo-template/.opencode/skills/spec-intake/SKILL.md +10 -0
- package/repo-template/.pi/README.md +21 -0
- package/repo-template/.pi/prompts/checkpoint.md +11 -0
- package/repo-template/.pi/prompts/loop-run.md +10 -0
- package/repo-template/.pi/prompts/sdd-plan.md +11 -0
- package/repo-template/.pi/prompts/sdd-spec.md +13 -0
- package/repo-template/.pi/prompts/spec-escalate.md +9 -0
- package/repo-template/.pi/prompts/spec-intake.md +10 -0
- package/repo-template/.pi/prompts/spec-size.md +21 -0
- package/repo-template/.pi/skills/adapter-parity/SKILL.md +7 -0
- package/repo-template/.pi/skills/checkpoint/SKILL.md +7 -0
- package/repo-template/.pi/skills/eval-design/SKILL.md +3 -0
- package/repo-template/.pi/skills/evals/SKILL.md +7 -0
- package/repo-template/.pi/skills/loop-engineering/SKILL.md +7 -0
- package/repo-template/.pi/skills/maintainability-review/SKILL.md +3 -0
- package/repo-template/.pi/skills/quality-gate-review/SKILL.md +3 -0
- package/repo-template/.pi/skills/sdd/SKILL.md +7 -0
- package/repo-template/.pi/skills/spec-complexity-classifier/SKILL.md +10 -0
- package/repo-template/.pi/skills/spec-escalation-review/SKILL.md +10 -0
- package/repo-template/.pi/skills/spec-intake/SKILL.md +10 -0
- package/repo-template/.pi/skills/tdd/SKILL.md +7 -0
- package/repo-template/.pi/skills/trust-review/SKILL.md +3 -0
- package/repo-template/AGENT.md +8 -0
- package/repo-template/AGENTS.md +165 -0
- package/repo-template/CLAUDE.md +9 -0
- package/repo-template/GEMINI.md +9 -0
- package/repo-template/docs/ai/adapter-parity.md +135 -0
- package/repo-template/docs/ai/agent-workflow.md +45 -0
- package/repo-template/docs/ai/api.md +28 -0
- package/repo-template/docs/ai/architecture.md +53 -0
- package/repo-template/docs/ai/context-budget.md +54 -0
- package/repo-template/docs/ai/context-graph.md +39 -0
- package/repo-template/docs/ai/conventions.md +34 -0
- package/repo-template/docs/ai/decision-log.md +5 -0
- package/repo-template/docs/ai/enforcement.md +63 -0
- package/repo-template/docs/ai/eval-strategy.md +42 -0
- package/repo-template/docs/ai/evals.md +44 -0
- package/repo-template/docs/ai/git-workflow.md +35 -0
- package/repo-template/docs/ai/governance.md +61 -0
- package/repo-template/docs/ai/harness.md +49 -0
- package/repo-template/docs/ai/installer-cli.md +34 -0
- package/repo-template/docs/ai/loop-log.md +5 -0
- package/repo-template/docs/ai/loop-observability.md +57 -0
- package/repo-template/docs/ai/loop-policy.md +86 -0
- package/repo-template/docs/ai/loops.md +95 -0
- package/repo-template/docs/ai/maintainability-gates.md +26 -0
- package/repo-template/docs/ai/memory.md +71 -0
- package/repo-template/docs/ai/model-policy.md +105 -0
- package/repo-template/docs/ai/observability-runtime.md +48 -0
- package/repo-template/docs/ai/provider-routing.md +138 -0
- package/repo-template/docs/ai/quality-gates.md +48 -0
- package/repo-template/docs/ai/rollback-runtime.md +25 -0
- package/repo-template/docs/ai/security.md +12 -0
- package/repo-template/docs/ai/spec-driven-development.md +124 -0
- package/repo-template/docs/ai/spec-escalation.md +44 -0
- package/repo-template/docs/ai/spec-intake.md +46 -0
- package/repo-template/docs/ai/spec-sizing.md +207 -0
- package/repo-template/docs/ai/test-driven-development.md +35 -0
- package/repo-template/docs/ai/testing.md +28 -0
- package/repo-template/docs/ai/tool-adapters.md +186 -0
- package/repo-template/docs/ai/trust-allowlist.md +5 -0
- package/repo-template/docs/ai/trust-policy.md +41 -0
- package/repo-template/docs/ai/ui.md +17 -0
- package/repo-template/docs/skills/adapter-parity-review.md +46 -0
- package/repo-template/docs/skills/api-design.md +37 -0
- package/repo-template/docs/skills/architecture.md +37 -0
- package/repo-template/docs/skills/code-review.md +37 -0
- package/repo-template/docs/skills/context-graph.md +38 -0
- package/repo-template/docs/skills/debugging.md +37 -0
- package/repo-template/docs/skills/eval-design.md +12 -0
- package/repo-template/docs/skills/evals.md +37 -0
- package/repo-template/docs/skills/git-workflow.md +37 -0
- package/repo-template/docs/skills/look-trust-review.md +12 -0
- package/repo-template/docs/skills/loop-debugging.md +16 -0
- package/repo-template/docs/skills/loop-design.md +39 -0
- package/repo-template/docs/skills/loop-retrospective.md +15 -0
- package/repo-template/docs/skills/loop-review.md +16 -0
- package/repo-template/docs/skills/maintainability-review.md +12 -0
- package/repo-template/docs/skills/model-selection.md +36 -0
- package/repo-template/docs/skills/quality-gate-review.md +12 -0
- package/repo-template/docs/skills/spec-complexity-classifier.md +41 -0
- package/repo-template/docs/skills/spec-escalation-review.md +34 -0
- package/repo-template/docs/skills/spec-intake.md +25 -0
- package/repo-template/docs/skills/testing.md +37 -0
- package/repo-template/docs/skills/tool-adapter-sync.md +36 -0
- package/repo-template/docs/skills/ui-design.md +37 -0
- package/repo-template/docs/specs/README.md +9 -0
- package/repo-template/docs/specs/templates/basic-spec.md +41 -0
- package/repo-template/docs/specs/templates/complex-spec.md +145 -0
- package/repo-template/docs/specs/templates/standard-spec.md +58 -0
- package/repo-template/evals/README.md +11 -0
- package/repo-template/evals/golden/sample-golden.json +12 -0
- package/repo-template/evals/loop-regression/README.md +11 -0
- package/repo-template/evals/regression/sample-regression.json +12 -0
- package/repo-template/evals/schema/sample-schema.json +12 -0
- package/repo-template/evals/tool-calls/sample-tool-calls.json +12 -0
- package/repo-template/opencode.json.sample +29 -0
- package/repo-template/scripts/harness/backup.mjs +7 -0
- package/repo-template/scripts/harness/doctor.mjs +20 -0
- package/repo-template/scripts/harness/run-evals.mjs +27 -0
- package/repo-template/setup-agent-links.sh +54 -0
- package/scripts/check-published-release.mjs +127 -0
- package/scripts/check-release-commit.mjs +32 -0
- package/scripts/install.sh +225 -0
- package/scripts/installer-smoke-test.sh +155 -0
- package/scripts/lib/attribution-guard.mjs +59 -0
- package/scripts/registry-smoke-test.sh +149 -0
- package/scripts/smoke-test.sh +197 -0
- package/scripts/ux-smoke-test.sh +140 -0
- package/src/cli.js +625 -0
- package/src/doctor.js +68 -0
- package/src/global/adapter-context.js +27 -0
- package/src/global/adapter-matrix.js +38 -0
- package/src/global/adapters/claude.js +8 -0
- package/src/global/adapters/codex.js +8 -0
- package/src/global/adapters/cursor.js +8 -0
- package/src/global/adapters/opencode.js +8 -0
- package/src/global/agents.js +7 -0
- package/src/global/apply-confirmation.js +62 -0
- package/src/global/backups.js +54 -0
- package/src/global/brand/cli.js +52 -0
- package/src/global/brand/index.js +85 -0
- package/src/global/clack/setup-preview.js +48 -0
- package/src/global/clack/setup-wizard-constants.js +6 -0
- package/src/global/clack/setup-wizard.js +207 -0
- package/src/global/clack/theme.js +145 -0
- package/src/global/component-authoring.js +121 -0
- package/src/global/component-builders.js +43 -0
- package/src/global/component-distribution.js +270 -0
- package/src/global/component-installer.js +106 -0
- package/src/global/component-paths.js +22 -0
- package/src/global/component-registry.js +89 -0
- package/src/global/components/orchestrator.js +14 -0
- package/src/global/components/sdd-core.js +17 -0
- package/src/global/diff.js +233 -0
- package/src/global/drift.js +264 -0
- package/src/global/explain.js +144 -0
- package/src/global/global-cli.js +1145 -0
- package/src/global/global-doctor.js +67 -0
- package/src/global/global-installer.js +284 -0
- package/src/global/history.js +313 -0
- package/src/global/ink/run-setup-ink.js +77 -0
- package/src/global/ink/setup-app.js +278 -0
- package/src/global/ink/setup-routing.js +51 -0
- package/src/global/ink/setup-state.js +180 -0
- package/src/global/ink/terminal.js +13 -0
- package/src/global/json-output.js +22 -0
- package/src/global/load-component-catalog.js +41 -0
- package/src/global/load-workspace-component-catalog.js +123 -0
- package/src/global/managed-body.js +28 -0
- package/src/global/managed-config-adapter.js +134 -0
- package/src/global/managed-section.js +73 -0
- package/src/global/npm-registry.js +25 -0
- package/src/global/paths.js +22 -0
- package/src/global/policy.js +344 -0
- package/src/global/preflight.js +65 -0
- package/src/global/registry.js +79 -0
- package/src/global/report.js +110 -0
- package/src/global/rollback.js +126 -0
- package/src/global/setup.js +284 -0
- package/src/global/state-migration.js +65 -0
- package/src/global/state.js +50 -0
- package/src/global/status.js +94 -0
- package/src/global/sync.js +129 -0
- package/src/global/upgrade.js +145 -0
- package/src/harness-files.js +145 -0
- package/src/harness-updater.js +120 -0
- package/src/hash.js +5 -0
- package/src/manifest.js +36 -0
- package/src/project-detection.js +105 -0
- package/src/template-installer.js +72 -0
- package/src/text-template.js +24 -0
- package/src/workspace-cli.js +115 -0
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
#!/usr/bin/env sh
|
|
2
|
+
# Bootstrap installer for Kairo Runtime (@kal-elsam/kairo-runtime).
|
|
3
|
+
#
|
|
4
|
+
# Safe by design:
|
|
5
|
+
# - no sudo
|
|
6
|
+
# - no shell profile changes
|
|
7
|
+
# - does not install Cursor/Codex/OpenCode/Claude
|
|
8
|
+
# - default ends with setup --dry-run (no writes)
|
|
9
|
+
# - explicit apply: pass --yes to run setup --yes
|
|
10
|
+
#
|
|
11
|
+
# Usage:
|
|
12
|
+
# curl -fsSL https://raw.githubusercontent.com/Kal-elSam/harness/main/scripts/install.sh | sh
|
|
13
|
+
# curl -fsSL https://raw.githubusercontent.com/Kal-elSam/harness/main/scripts/install.sh | sh -s -- --dry-run
|
|
14
|
+
# curl -fsSL https://raw.githubusercontent.com/Kal-elSam/harness/main/scripts/install.sh | sh -s -- --yes
|
|
15
|
+
# curl -fsSL https://raw.githubusercontent.com/Kal-elSam/harness/main/scripts/install.sh | sh -s -- --version 0.13.0
|
|
16
|
+
# curl -fsSL https://raw.githubusercontent.com/Kal-elSam/harness/main/scripts/install.sh | sh -s -- --agents all --yes
|
|
17
|
+
#
|
|
18
|
+
set -eu
|
|
19
|
+
|
|
20
|
+
PACKAGE="@kal-elsam/kairo-runtime"
|
|
21
|
+
PREFERRED_CLI="kairo"
|
|
22
|
+
VERSION="latest"
|
|
23
|
+
INSTALLER_DRY_RUN=0
|
|
24
|
+
APPLY=0
|
|
25
|
+
SETUP_EXTRA=""
|
|
26
|
+
|
|
27
|
+
usage() {
|
|
28
|
+
printf '%s\n' \
|
|
29
|
+
"Kairo Runtime bootstrap installer" \
|
|
30
|
+
"" \
|
|
31
|
+
"Usage:" \
|
|
32
|
+
" install.sh [--dry-run] [--yes] [--version <semver|latest>]" \
|
|
33
|
+
" [--agents <list|all>] [--components <list>] [--no-default-components]" \
|
|
34
|
+
"" \
|
|
35
|
+
"Options:" \
|
|
36
|
+
" --dry-run Print the plan only. Does not download or run kairo." \
|
|
37
|
+
" --yes, -y Apply setup (runs kairo setup --yes)." \
|
|
38
|
+
" --version <version> Package version to run (default: latest)." \
|
|
39
|
+
" --agents <list|all> Passed through to kairo setup." \
|
|
40
|
+
" --components <list> Passed through to kairo setup." \
|
|
41
|
+
" --no-default-components Passed through to kairo setup." \
|
|
42
|
+
" -h, --help Show this help." \
|
|
43
|
+
"" \
|
|
44
|
+
"What it does:" \
|
|
45
|
+
" 1. Checks for Node.js and npm." \
|
|
46
|
+
" 2. Runs the package via npx (or npm exec) with setup --dry-run (default) or setup --yes (--yes)." \
|
|
47
|
+
" 3. Prints next steps." \
|
|
48
|
+
"" \
|
|
49
|
+
"Security:" \
|
|
50
|
+
" - Never uses sudo." \
|
|
51
|
+
" - Never modifies shell profiles (.bashrc, .zshrc, etc.)." \
|
|
52
|
+
" - Never installs Cursor/Codex/OpenCode/Claude." \
|
|
53
|
+
" - Default preview only (setup --dry-run). Writes managed sections only with --yes."
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
die() {
|
|
57
|
+
printf '%s\n' "$*" >&2
|
|
58
|
+
exit 1
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
append_setup_arg() {
|
|
62
|
+
SETUP_EXTRA="${SETUP_EXTRA}${SETUP_EXTRA:+ }$1"
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
while [ "$#" -gt 0 ]; do
|
|
66
|
+
case "$1" in
|
|
67
|
+
--dry-run)
|
|
68
|
+
INSTALLER_DRY_RUN=1
|
|
69
|
+
shift
|
|
70
|
+
;;
|
|
71
|
+
--yes|-y)
|
|
72
|
+
APPLY=1
|
|
73
|
+
shift
|
|
74
|
+
;;
|
|
75
|
+
--version)
|
|
76
|
+
[ "$#" -ge 2 ] || die "Missing value for --version"
|
|
77
|
+
VERSION="$2"
|
|
78
|
+
shift 2
|
|
79
|
+
;;
|
|
80
|
+
--version=*)
|
|
81
|
+
VERSION="${1#*=}"
|
|
82
|
+
shift
|
|
83
|
+
;;
|
|
84
|
+
--agents)
|
|
85
|
+
[ "$#" -ge 2 ] || die "Missing value for --agents"
|
|
86
|
+
append_setup_arg "--agents"
|
|
87
|
+
append_setup_arg "$2"
|
|
88
|
+
shift 2
|
|
89
|
+
;;
|
|
90
|
+
--agents=*)
|
|
91
|
+
append_setup_arg "$1"
|
|
92
|
+
shift
|
|
93
|
+
;;
|
|
94
|
+
--components)
|
|
95
|
+
[ "$#" -ge 2 ] || die "Missing value for --components"
|
|
96
|
+
append_setup_arg "--components"
|
|
97
|
+
append_setup_arg "$2"
|
|
98
|
+
shift 2
|
|
99
|
+
;;
|
|
100
|
+
--components=*)
|
|
101
|
+
append_setup_arg "$1"
|
|
102
|
+
shift
|
|
103
|
+
;;
|
|
104
|
+
--no-default-components)
|
|
105
|
+
append_setup_arg "--no-default-components"
|
|
106
|
+
shift
|
|
107
|
+
;;
|
|
108
|
+
-h|--help)
|
|
109
|
+
usage
|
|
110
|
+
exit 0
|
|
111
|
+
;;
|
|
112
|
+
*)
|
|
113
|
+
die "Unknown option: $1 (try --help)"
|
|
114
|
+
;;
|
|
115
|
+
esac
|
|
116
|
+
done
|
|
117
|
+
|
|
118
|
+
[ -n "$VERSION" ] || die "--version must not be empty"
|
|
119
|
+
|
|
120
|
+
if [ "$APPLY" -eq 1 ]; then
|
|
121
|
+
SETUP_MODE="--yes"
|
|
122
|
+
else
|
|
123
|
+
SETUP_MODE="--dry-run"
|
|
124
|
+
fi
|
|
125
|
+
|
|
126
|
+
require_cmd() {
|
|
127
|
+
command_name="$1"
|
|
128
|
+
if ! command -v "$command_name" >/dev/null 2>&1; then
|
|
129
|
+
die "Missing required command: ${command_name}
|
|
130
|
+
Install Node.js 20.12+ (includes npm), then re-run this installer.
|
|
131
|
+
https://nodejs.org/"
|
|
132
|
+
fi
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
require_cmd node
|
|
136
|
+
require_cmd npm
|
|
137
|
+
|
|
138
|
+
NODE_VERSION="$(node --version 2>/dev/null || true)"
|
|
139
|
+
NPM_VERSION="$(npm --version 2>/dev/null || true)"
|
|
140
|
+
|
|
141
|
+
if command -v npx >/dev/null 2>&1; then
|
|
142
|
+
RUNNER="npx"
|
|
143
|
+
RUN_CMD="npx --yes ${PACKAGE}@${VERSION} setup ${SETUP_MODE}${SETUP_EXTRA:+ ${SETUP_EXTRA}}"
|
|
144
|
+
else
|
|
145
|
+
RUNNER="npm-exec"
|
|
146
|
+
RUN_CMD="npm exec --yes --package=${PACKAGE}@${VERSION} -- ${PREFERRED_CLI} setup ${SETUP_MODE}${SETUP_EXTRA:+ ${SETUP_EXTRA}}"
|
|
147
|
+
fi
|
|
148
|
+
|
|
149
|
+
printf '%s\n' \
|
|
150
|
+
"Kairo Runtime bootstrap installer" \
|
|
151
|
+
"================================" \
|
|
152
|
+
"" \
|
|
153
|
+
"Prerequisites:" \
|
|
154
|
+
" node ${NODE_VERSION:-unknown}" \
|
|
155
|
+
" npm ${NPM_VERSION:-unknown}" \
|
|
156
|
+
" runner ${RUNNER}" \
|
|
157
|
+
"" \
|
|
158
|
+
"Will run:" \
|
|
159
|
+
" ${RUN_CMD}" \
|
|
160
|
+
"" \
|
|
161
|
+
"Effects:" \
|
|
162
|
+
" - Downloads/runs ${PACKAGE}@${VERSION} via npm (no global install required)." \
|
|
163
|
+
" - Configures managed sections only (never installs AI apps)." \
|
|
164
|
+
" - Never uses sudo or modifies shell profiles." \
|
|
165
|
+
""
|
|
166
|
+
|
|
167
|
+
if [ "$APPLY" -eq 1 ]; then
|
|
168
|
+
printf '%s\n' \
|
|
169
|
+
" - Applies the ecosystem plan (setup --yes)." \
|
|
170
|
+
" - Writes managed agent sections and ~/.harness components." \
|
|
171
|
+
""
|
|
172
|
+
else
|
|
173
|
+
printf '%s\n' \
|
|
174
|
+
" - Previews the local ecosystem plan (setup --dry-run)." \
|
|
175
|
+
" - Does NOT write agent configs or ~/.harness." \
|
|
176
|
+
""
|
|
177
|
+
fi
|
|
178
|
+
|
|
179
|
+
if [ "$INSTALLER_DRY_RUN" -eq 1 ]; then
|
|
180
|
+
printf '%s\n' "Dry run: plan only. Nothing was downloaded or executed."
|
|
181
|
+
exit 0
|
|
182
|
+
fi
|
|
183
|
+
|
|
184
|
+
if [ "$APPLY" -eq 1 ]; then
|
|
185
|
+
printf '%s\n' "Applying setup..." ""
|
|
186
|
+
else
|
|
187
|
+
printf '%s\n' "Running preview..." ""
|
|
188
|
+
fi
|
|
189
|
+
|
|
190
|
+
if [ "$RUNNER" = "npx" ]; then
|
|
191
|
+
# shellcheck disable=SC2086
|
|
192
|
+
npx --yes "${PACKAGE}@${VERSION}" setup ${SETUP_MODE} ${SETUP_EXTRA}
|
|
193
|
+
else
|
|
194
|
+
# shellcheck disable=SC2086
|
|
195
|
+
npm exec --yes --package="${PACKAGE}@${VERSION}" -- ${PREFERRED_CLI} setup ${SETUP_MODE} ${SETUP_EXTRA}
|
|
196
|
+
fi
|
|
197
|
+
|
|
198
|
+
if [ "$APPLY" -eq 1 ]; then
|
|
199
|
+
printf '%s\n' \
|
|
200
|
+
"" \
|
|
201
|
+
"Bootstrap complete (applied)." \
|
|
202
|
+
"Next steps:" \
|
|
203
|
+
" 1. Check health: ${PREFERRED_CLI} status" \
|
|
204
|
+
" 2. Repair drift: ${PREFERRED_CLI} sync" \
|
|
205
|
+
" 3. Upgrade latest: npx ${PACKAGE}@latest setup --yes" \
|
|
206
|
+
"" \
|
|
207
|
+
"Version:" \
|
|
208
|
+
" Installed CLI: npx ${PACKAGE} --version" \
|
|
209
|
+
" Published package: npm view ${PACKAGE} version" \
|
|
210
|
+
" Preview upgrade: ${PREFERRED_CLI} upgrade --dry-run"
|
|
211
|
+
else
|
|
212
|
+
printf '%s\n' \
|
|
213
|
+
"" \
|
|
214
|
+
"Bootstrap complete." \
|
|
215
|
+
"Next steps:" \
|
|
216
|
+
" 1. Apply the plan: npx ${PACKAGE}@${VERSION} setup --yes" \
|
|
217
|
+
" (or re-run installer: curl ... | sh -s -- --yes)" \
|
|
218
|
+
" 2. Check health: npx ${PACKAGE}@${VERSION} status" \
|
|
219
|
+
" 3. Repair drift: npx ${PACKAGE}@${VERSION} sync" \
|
|
220
|
+
"" \
|
|
221
|
+
"Version:" \
|
|
222
|
+
" Installed CLI: npx ${PACKAGE} --version" \
|
|
223
|
+
" Published package: npm view ${PACKAGE} version" \
|
|
224
|
+
" Update / converge: npx ${PACKAGE}@latest sync"
|
|
225
|
+
fi
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
PACKAGE="@kal-elsam/kairo-runtime"
|
|
5
|
+
PREFERRED_CLI="kairo"
|
|
6
|
+
VERSION="latest"
|
|
7
|
+
REPO="Kal-elSam/harness"
|
|
8
|
+
|
|
9
|
+
while [ "$#" -gt 0 ]; do
|
|
10
|
+
case "$1" in
|
|
11
|
+
--package)
|
|
12
|
+
PACKAGE="$2"
|
|
13
|
+
shift 2
|
|
14
|
+
;;
|
|
15
|
+
--package=*)
|
|
16
|
+
PACKAGE="${1#*=}"
|
|
17
|
+
shift
|
|
18
|
+
;;
|
|
19
|
+
--version)
|
|
20
|
+
VERSION="$2"
|
|
21
|
+
shift 2
|
|
22
|
+
;;
|
|
23
|
+
--version=*)
|
|
24
|
+
VERSION="${1#*=}"
|
|
25
|
+
shift
|
|
26
|
+
;;
|
|
27
|
+
*)
|
|
28
|
+
echo "Unknown option: $1" >&2
|
|
29
|
+
exit 1
|
|
30
|
+
;;
|
|
31
|
+
esac
|
|
32
|
+
done
|
|
33
|
+
|
|
34
|
+
WORKDIR="$(mktemp -d)"
|
|
35
|
+
FAKE_HOME="$(mktemp -d)"
|
|
36
|
+
NPM_CACHE="$(mktemp -d)"
|
|
37
|
+
|
|
38
|
+
cleanup() {
|
|
39
|
+
rm -rf "$WORKDIR" "$FAKE_HOME" "$NPM_CACHE"
|
|
40
|
+
}
|
|
41
|
+
trap cleanup EXIT
|
|
42
|
+
|
|
43
|
+
assert_harness_home_isolated() {
|
|
44
|
+
if [ -z "${HARNESS_HOME:-}" ]; then
|
|
45
|
+
echo "HARNESS_HOME must be set for installer smoke tests" >&2
|
|
46
|
+
exit 1
|
|
47
|
+
fi
|
|
48
|
+
|
|
49
|
+
if [ "$HARNESS_HOME" = "$HOME" ] || [ "$HARNESS_HOME" = "${HOME}/.harness" ]; then
|
|
50
|
+
echo "Installer smoke must not use the real home directory" >&2
|
|
51
|
+
exit 1
|
|
52
|
+
fi
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
resolve_install_script_url() {
|
|
56
|
+
if [ "$VERSION" = "latest" ]; then
|
|
57
|
+
printf '%s\n' "https://raw.githubusercontent.com/${REPO}/main/scripts/install.sh"
|
|
58
|
+
return
|
|
59
|
+
fi
|
|
60
|
+
|
|
61
|
+
printf '%s\n' "https://raw.githubusercontent.com/${REPO}/v${VERSION}/scripts/install.sh"
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
assert_no_harness_state() {
|
|
65
|
+
if [ -d "$HARNESS_HOME/.harness" ]; then
|
|
66
|
+
echo "Expected no ~/.harness state at $HARNESS_HOME/.harness" >&2
|
|
67
|
+
exit 1
|
|
68
|
+
fi
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
assert_status_ok() {
|
|
72
|
+
local status_json="$1"
|
|
73
|
+
node -e "
|
|
74
|
+
const payload = JSON.parse(process.argv[1]);
|
|
75
|
+
if (!payload.ok || payload.overall !== 'ok') {
|
|
76
|
+
console.error('Expected status --json overall=ok');
|
|
77
|
+
process.exit(1);
|
|
78
|
+
}
|
|
79
|
+
const managed = payload.agents.filter((agent) => agent.managed).map((agent) => agent.id).sort();
|
|
80
|
+
const expected = ['claude', 'codex', 'cursor', 'opencode'];
|
|
81
|
+
if (JSON.stringify(managed) !== JSON.stringify(expected)) {
|
|
82
|
+
console.error('Expected all four agents managed');
|
|
83
|
+
process.exit(1);
|
|
84
|
+
}
|
|
85
|
+
" "$status_json"
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
assert_managed_configs_removed() {
|
|
89
|
+
node -e "
|
|
90
|
+
const fs = require('node:fs');
|
|
91
|
+
const path = require('node:path');
|
|
92
|
+
const home = process.env.HARNESS_HOME;
|
|
93
|
+
const targets = [
|
|
94
|
+
'.cursor/AGENTS.md',
|
|
95
|
+
'.codex/AGENTS.md',
|
|
96
|
+
'.config/opencode/AGENTS.md',
|
|
97
|
+
'.claude/CLAUDE.md'
|
|
98
|
+
];
|
|
99
|
+
|
|
100
|
+
for (const relativePath of targets) {
|
|
101
|
+
const filePath = path.join(home, relativePath);
|
|
102
|
+
if (!fs.existsSync(filePath)) continue;
|
|
103
|
+
const content = fs.readFileSync(filePath, 'utf8');
|
|
104
|
+
if (content.includes('<!-- harness:managed:start -->')) {
|
|
105
|
+
console.error('Managed marker still present in ' + relativePath);
|
|
106
|
+
process.exit(1);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
"
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export HARNESS_HOME="$FAKE_HOME"
|
|
113
|
+
export npm_config_cache="$NPM_CACHE"
|
|
114
|
+
assert_harness_home_isolated
|
|
115
|
+
|
|
116
|
+
cd "$WORKDIR"
|
|
117
|
+
|
|
118
|
+
INSTALL_SCRIPT_URL="$(resolve_install_script_url)"
|
|
119
|
+
echo "Installer smoke for ${PACKAGE}@${VERSION}"
|
|
120
|
+
echo "Install script: ${INSTALL_SCRIPT_URL}"
|
|
121
|
+
echo "Harness home: ${HARNESS_HOME}"
|
|
122
|
+
|
|
123
|
+
echo
|
|
124
|
+
echo "== curl install.sh | sh --version ${VERSION} (preview, no writes) =="
|
|
125
|
+
curl -fsSL "$INSTALL_SCRIPT_URL" | sh -s -- --version "$VERSION"
|
|
126
|
+
assert_no_harness_state
|
|
127
|
+
|
|
128
|
+
mkdir -p \
|
|
129
|
+
"$FAKE_HOME/.cursor" \
|
|
130
|
+
"$FAKE_HOME/.codex" \
|
|
131
|
+
"$FAKE_HOME/.config/opencode" \
|
|
132
|
+
"$FAKE_HOME/.claude"
|
|
133
|
+
|
|
134
|
+
echo
|
|
135
|
+
echo "== curl install.sh | sh --version ${VERSION} --yes --agents all =="
|
|
136
|
+
curl -fsSL "$INSTALL_SCRIPT_URL" | sh -s -- --version "$VERSION" --yes --agents all
|
|
137
|
+
|
|
138
|
+
if [ ! -d "$FAKE_HOME/.harness" ]; then
|
|
139
|
+
echo "Expected install.sh --yes to create ~/.harness state" >&2
|
|
140
|
+
exit 1
|
|
141
|
+
fi
|
|
142
|
+
|
|
143
|
+
echo
|
|
144
|
+
echo "== ${PREFERRED_CLI} status --json =="
|
|
145
|
+
STATUS_JSON="$(npx --yes "${PACKAGE}@${VERSION}" status --json)"
|
|
146
|
+
echo "$STATUS_JSON"
|
|
147
|
+
assert_status_ok "$STATUS_JSON"
|
|
148
|
+
|
|
149
|
+
echo
|
|
150
|
+
echo "== ${PREFERRED_CLI} uninstall =="
|
|
151
|
+
npx --yes "${PACKAGE}@${VERSION}" uninstall
|
|
152
|
+
assert_managed_configs_removed
|
|
153
|
+
|
|
154
|
+
echo
|
|
155
|
+
echo "Installer smoke test passed."
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
const ATTRIBUTION_PATTERN = /co-authored-by/i;
|
|
2
|
+
|
|
3
|
+
export function assertCleanReleaseMessage(message) {
|
|
4
|
+
if (ATTRIBUTION_PATTERN.test(message)) {
|
|
5
|
+
throw new Error("Release commit message must not contain Co-authored-by or AI attribution.");
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function assertCleanReleaseMessages(messages) {
|
|
10
|
+
for (const message of messages) {
|
|
11
|
+
assertCleanReleaseMessage(message);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function parseAttributionGuardArgs(argv) {
|
|
16
|
+
const args = [...argv];
|
|
17
|
+
let range = null;
|
|
18
|
+
|
|
19
|
+
for (let index = 2; index < args.length; index += 1) {
|
|
20
|
+
const arg = args[index];
|
|
21
|
+
|
|
22
|
+
if (arg === "--range") {
|
|
23
|
+
range = args[++index];
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (arg.startsWith("--range=")) {
|
|
28
|
+
range = arg.slice("--range=".length);
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
throw new Error(`Unknown option "${arg}".`);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (range !== null && range.trim() === "") {
|
|
36
|
+
throw new Error("Missing value for --range.");
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return { range };
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function readCommitMessages({ range = null, runGit }) {
|
|
43
|
+
if (range) {
|
|
44
|
+
const output = runGit(`git log ${range} --format=%B%x1E`).trim();
|
|
45
|
+
if (!output) return [];
|
|
46
|
+
|
|
47
|
+
return output
|
|
48
|
+
.split("\x1E")
|
|
49
|
+
.filter((message) => message.length > 0);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return [runGit("git log -1 --format=%B")];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function runAttributionGuard({ range = null, runGit }) {
|
|
56
|
+
const messages = readCommitMessages({ range, runGit });
|
|
57
|
+
assertCleanReleaseMessages(messages);
|
|
58
|
+
return { checked: messages.length, range };
|
|
59
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
PACKAGE="@kal-elsam/kairo-runtime"
|
|
5
|
+
PREFERRED_CLI="kairo"
|
|
6
|
+
VERSION="latest"
|
|
7
|
+
|
|
8
|
+
while [ "$#" -gt 0 ]; do
|
|
9
|
+
case "$1" in
|
|
10
|
+
--package)
|
|
11
|
+
PACKAGE="$2"
|
|
12
|
+
shift 2
|
|
13
|
+
;;
|
|
14
|
+
--package=*)
|
|
15
|
+
PACKAGE="${1#*=}"
|
|
16
|
+
shift
|
|
17
|
+
;;
|
|
18
|
+
--version)
|
|
19
|
+
VERSION="$2"
|
|
20
|
+
shift 2
|
|
21
|
+
;;
|
|
22
|
+
--version=*)
|
|
23
|
+
VERSION="${1#*=}"
|
|
24
|
+
shift
|
|
25
|
+
;;
|
|
26
|
+
*)
|
|
27
|
+
echo "Unknown option: $1" >&2
|
|
28
|
+
exit 1
|
|
29
|
+
;;
|
|
30
|
+
esac
|
|
31
|
+
done
|
|
32
|
+
|
|
33
|
+
WORKDIR="$(mktemp -d)"
|
|
34
|
+
FAKE_HOME="$(mktemp -d)"
|
|
35
|
+
NPM_CACHE="$(mktemp -d)"
|
|
36
|
+
|
|
37
|
+
cleanup() {
|
|
38
|
+
rm -rf "$WORKDIR" "$FAKE_HOME" "$NPM_CACHE"
|
|
39
|
+
}
|
|
40
|
+
trap cleanup EXIT
|
|
41
|
+
|
|
42
|
+
assert_harness_home_isolated() {
|
|
43
|
+
if [ -z "${HARNESS_HOME:-}" ]; then
|
|
44
|
+
echo "HARNESS_HOME must be set for registry smoke tests" >&2
|
|
45
|
+
exit 1
|
|
46
|
+
fi
|
|
47
|
+
|
|
48
|
+
if [ "$HARNESS_HOME" = "$HOME" ] || [ "$HARNESS_HOME" = "${HOME}/.harness" ]; then
|
|
49
|
+
echo "Registry smoke must not use the real home directory" >&2
|
|
50
|
+
exit 1
|
|
51
|
+
fi
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export HARNESS_HOME="$FAKE_HOME"
|
|
55
|
+
export npm_config_cache="$NPM_CACHE"
|
|
56
|
+
assert_harness_home_isolated
|
|
57
|
+
|
|
58
|
+
mkdir -p \
|
|
59
|
+
"$FAKE_HOME/.cursor" \
|
|
60
|
+
"$FAKE_HOME/.codex" \
|
|
61
|
+
"$FAKE_HOME/.config/opencode" \
|
|
62
|
+
"$FAKE_HOME/.claude"
|
|
63
|
+
|
|
64
|
+
echo "Installing ${PACKAGE}@${VERSION} from npm registry"
|
|
65
|
+
cd "$WORKDIR"
|
|
66
|
+
npm init -y >/dev/null
|
|
67
|
+
npm install "${PACKAGE}@${VERSION}" >/dev/null
|
|
68
|
+
|
|
69
|
+
INSTALLED_VERSION="$(node -p "require('./node_modules/${PACKAGE}/package.json').version")"
|
|
70
|
+
echo "Installed ${PACKAGE}@${INSTALLED_VERSION}"
|
|
71
|
+
|
|
72
|
+
if [ "$VERSION" != "latest" ] && [ "$INSTALLED_VERSION" != "$VERSION" ]; then
|
|
73
|
+
echo "Expected version ${VERSION}, got ${INSTALLED_VERSION}" >&2
|
|
74
|
+
exit 1
|
|
75
|
+
fi
|
|
76
|
+
|
|
77
|
+
CLI_VERSION="$(npx --no-install ${PREFERRED_CLI} --version)"
|
|
78
|
+
if [ "$CLI_VERSION" != "$INSTALLED_VERSION" ]; then
|
|
79
|
+
echo "${PREFERRED_CLI} --version (${CLI_VERSION}) does not match installed package (${INSTALLED_VERSION})" >&2
|
|
80
|
+
exit 1
|
|
81
|
+
fi
|
|
82
|
+
|
|
83
|
+
echo
|
|
84
|
+
echo "== ${PREFERRED_CLI} setup --dry-run =="
|
|
85
|
+
npx --no-install ${PREFERRED_CLI} setup --dry-run
|
|
86
|
+
|
|
87
|
+
echo
|
|
88
|
+
echo "== ${PREFERRED_CLI} setup --yes =="
|
|
89
|
+
npx --no-install ${PREFERRED_CLI} setup --yes
|
|
90
|
+
|
|
91
|
+
echo
|
|
92
|
+
echo "== ${PREFERRED_CLI} adapters --json =="
|
|
93
|
+
ADAPTERS_JSON="$(npx --no-install ${PREFERRED_CLI} adapters --json)"
|
|
94
|
+
echo "$ADAPTERS_JSON"
|
|
95
|
+
node -e "
|
|
96
|
+
const payload = JSON.parse(process.argv[1]);
|
|
97
|
+
const expected = ['cursor', 'codex', 'opencode', 'claude'].sort();
|
|
98
|
+
if (payload.managedCount !== 4 || payload.detectedCount !== 4) process.exit(1);
|
|
99
|
+
const managed = payload.adapters.filter((entry) => entry.managed).map((entry) => entry.id).sort();
|
|
100
|
+
if (JSON.stringify(managed) !== JSON.stringify(expected)) process.exit(1);
|
|
101
|
+
" "$ADAPTERS_JSON"
|
|
102
|
+
|
|
103
|
+
echo
|
|
104
|
+
echo "== ${PREFERRED_CLI} status --json =="
|
|
105
|
+
STATUS_JSON="$(npx --no-install ${PREFERRED_CLI} status --json)"
|
|
106
|
+
echo "$STATUS_JSON"
|
|
107
|
+
node -e "
|
|
108
|
+
const payload = JSON.parse(process.argv[1]);
|
|
109
|
+
if (!payload.ok || payload.overall !== 'ok') process.exit(1);
|
|
110
|
+
const managed = payload.agents.filter((agent) => agent.managed).map((agent) => agent.id).sort();
|
|
111
|
+
const expected = ['claude', 'codex', 'cursor', 'opencode'];
|
|
112
|
+
if (JSON.stringify(managed) !== JSON.stringify(expected)) process.exit(1);
|
|
113
|
+
" "$STATUS_JSON"
|
|
114
|
+
|
|
115
|
+
echo
|
|
116
|
+
echo "== ${PREFERRED_CLI} upgrade --dry-run =="
|
|
117
|
+
npx --no-install ${PREFERRED_CLI} upgrade --dry-run
|
|
118
|
+
|
|
119
|
+
echo
|
|
120
|
+
echo "== simulate drift =="
|
|
121
|
+
rm -f "$FAKE_HOME/.harness/components/sdd-core/workflow.md"
|
|
122
|
+
node -e "
|
|
123
|
+
const fs = require('node:fs');
|
|
124
|
+
const path = require('node:path');
|
|
125
|
+
const config = path.join(process.env.HARNESS_HOME, '.config', 'opencode', 'AGENTS.md');
|
|
126
|
+
const content = fs.readFileSync(config, 'utf8');
|
|
127
|
+
fs.writeFileSync(config, content.replace('### SDD Core', '### Broken'));
|
|
128
|
+
"
|
|
129
|
+
|
|
130
|
+
echo
|
|
131
|
+
echo "== ${PREFERRED_CLI} sync =="
|
|
132
|
+
npx --no-install ${PREFERRED_CLI} sync --yes
|
|
133
|
+
|
|
134
|
+
echo
|
|
135
|
+
echo "== ${PREFERRED_CLI} status --json confirms OK =="
|
|
136
|
+
STATUS_JSON="$(npx --no-install ${PREFERRED_CLI} status --json)"
|
|
137
|
+
echo "$STATUS_JSON"
|
|
138
|
+
OVERALL="$(node -e "const p=JSON.parse(process.argv[1]); if(!p.ok||p.overall!=='ok'){process.exit(1)} console.log(p.overall)" "$STATUS_JSON")"
|
|
139
|
+
if [ "$OVERALL" != "ok" ]; then
|
|
140
|
+
echo "Expected status --json overall=ok after sync" >&2
|
|
141
|
+
exit 1
|
|
142
|
+
fi
|
|
143
|
+
|
|
144
|
+
echo
|
|
145
|
+
echo "== ${PREFERRED_CLI} uninstall =="
|
|
146
|
+
npx --no-install ${PREFERRED_CLI} uninstall
|
|
147
|
+
|
|
148
|
+
echo
|
|
149
|
+
echo "Registry smoke test passed."
|