@kynver-app/runtime 0.2.24 → 0.2.28
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/dist/chat/command-auth-proof.js +1 -1
- package/dist/cli.js +69 -68
- package/dist/index.js +89 -88
- package/dist/instruction-bundle/contract.js +2 -2
- package/dist/local-run-store/index.js +6 -6
- package/dist/server/adapter-contract.js +1 -1
- package/dist/server/cleanup.js +9 -9
- package/dist/server/db-credentials.js +2 -2
- package/dist/server/default-repo.js +1 -1
- package/dist/server/heavy-verification.js +1 -1
- package/dist/server/memory-cost-enforce.js +2 -2
- package/dist/server/memory-cost.js +2 -2
- package/dist/server/model-routing.js +3 -3
- package/dist/server/monitor.js +5 -5
- package/dist/server/orchestration.js +1 -1
- package/dist/server/worker-policy.js +2 -2
- package/package.json +4 -2
- package/dist/active-harness-workers.d.ts +0 -11
- package/dist/auto-complete.d.ts +0 -60
- package/dist/bootstrap.d.ts +0 -49
- package/dist/bounded-build/admission.d.ts +0 -30
- package/dist/bounded-build/constants.d.ts +0 -10
- package/dist/bounded-build/exec.d.ts +0 -35
- package/dist/bounded-build/index.d.ts +0 -6
- package/dist/bounded-build/meminfo.d.ts +0 -5
- package/dist/bounded-build/node-options.d.ts +0 -9
- package/dist/bounded-build/systemd-wrap.d.ts +0 -17
- package/dist/box-identity.d.ts +0 -19
- package/dist/box-resource-snapshot-shared.d.ts +0 -13
- package/dist/box-resource-snapshot.d.ts +0 -45
- package/dist/box-worker-cap.d.ts +0 -9
- package/dist/byoc/context-hydration.d.ts +0 -54
- package/dist/byoc/execution-proof.d.ts +0 -46
- package/dist/byoc/index.d.ts +0 -5
- package/dist/byoc/job-envelope.d.ts +0 -39
- package/dist/byoc/m6-golden-path.d.ts +0 -86
- package/dist/byoc/mcp-tool-proof.d.ts +0 -42
- package/dist/callback-headers.d.ts +0 -2
- package/dist/callbacks.d.ts +0 -74
- package/dist/chat/anthropic-credentials.d.ts +0 -11
- package/dist/chat/anthropic-stream.d.ts +0 -43
- package/dist/chat/chat-claim-loop.d.ts +0 -41
- package/dist/chat/chat-primary-cli.d.ts +0 -2
- package/dist/chat/command-allowlist.d.ts +0 -8
- package/dist/chat/command-auth-proof.d.ts +0 -67
- package/dist/chat/command-executor.d.ts +0 -18
- package/dist/chat/delta-batcher.d.ts +0 -13
- package/dist/cleanup-active-worktrees.d.ts +0 -14
- package/dist/cleanup-build-cache-paths.d.ts +0 -5
- package/dist/cleanup-cli.d.ts +0 -1
- package/dist/cleanup-completion-blocker.d.ts +0 -10
- package/dist/cleanup-dependency-scan.d.ts +0 -13
- package/dist/cleanup-dir-size.d.ts +0 -5
- package/dist/cleanup-disk-pressure.d.ts +0 -15
- package/dist/cleanup-duplicate-worktrees.d.ts +0 -8
- package/dist/cleanup-evidence.d.ts +0 -10
- package/dist/cleanup-execute.d.ts +0 -7
- package/dist/cleanup-git-probe.d.ts +0 -5
- package/dist/cleanup-git-rev-cache.d.ts +0 -5
- package/dist/cleanup-git-status-cache.d.ts +0 -5
- package/dist/cleanup-guards-helpers.d.ts +0 -2
- package/dist/cleanup-guards.d.ts +0 -53
- package/dist/cleanup-harness-path-validate.d.ts +0 -5
- package/dist/cleanup-harness-roots.d.ts +0 -6
- package/dist/cleanup-index-status.d.ts +0 -16
- package/dist/cleanup-orphan-safety.d.ts +0 -17
- package/dist/cleanup-path-ownership.d.ts +0 -9
- package/dist/cleanup-privileged-remove.d.ts +0 -13
- package/dist/cleanup-progress.d.ts +0 -2
- package/dist/cleanup-remove-path.d.ts +0 -17
- package/dist/cleanup-retention-config.d.ts +0 -26
- package/dist/cleanup-run-directory.d.ts +0 -20
- package/dist/cleanup-run-liveness.d.ts +0 -21
- package/dist/cleanup-run-terminal-cache.d.ts +0 -6
- package/dist/cleanup-salvage-evidence.d.ts +0 -33
- package/dist/cleanup-scan.d.ts +0 -15
- package/dist/cleanup-summary.d.ts +0 -29
- package/dist/cleanup-types.d.ts +0 -154
- package/dist/cleanup-worker-harness-live.d.ts +0 -9
- package/dist/cleanup-worktree-index.d.ts +0 -18
- package/dist/cleanup-worktree-salvage.d.ts +0 -7
- package/dist/cleanup.d.ts +0 -5
- package/dist/cli-output/worker-start-stdout.d.ts +0 -11
- package/dist/cli.d.ts +0 -14
- package/dist/command-center-contract-cli.d.ts +0 -1
- package/dist/completion-ack.d.ts +0 -18
- package/dist/completion-replay.d.ts +0 -10
- package/dist/completion-response.d.ts +0 -15
- package/dist/config.d.ts +0 -122
- package/dist/context-budget-receipt.d.ts +0 -96
- package/dist/context-preview/chat-memory-preview.d.ts +0 -33
- package/dist/cron/cron-cli-bin.d.ts +0 -7
- package/dist/cron/cron-env-file.d.ts +0 -22
- package/dist/cron/cron-env.d.ts +0 -21
- package/dist/cron/cron-fire.d.ts +0 -8
- package/dist/cron/cron-id.d.ts +0 -3
- package/dist/cron/cron-install-api.d.ts +0 -27
- package/dist/cron/cron-install-cli.d.ts +0 -2
- package/dist/cron/cron-install-plan.d.ts +0 -34
- package/dist/cron/cron-install-secrets.d.ts +0 -6
- package/dist/cron/cron-install-systemd.d.ts +0 -18
- package/dist/cron/cron-install-verify.d.ts +0 -15
- package/dist/cron/cron-install.d.ts +0 -51
- package/dist/cron/cron-lock.d.ts +0 -9
- package/dist/cron/cron-match.d.ts +0 -8
- package/dist/cron/cron-readiness.d.ts +0 -35
- package/dist/cron/cron-status.d.ts +0 -10
- package/dist/cron/cron-store.d.ts +0 -8
- package/dist/cron/cron-tick-cli.d.ts +0 -2
- package/dist/cron/cron-tick-state.d.ts +0 -5
- package/dist/cron/cron-tick.d.ts +0 -19
- package/dist/cron/cron-types.d.ts +0 -53
- package/dist/cron/hermes-provider-notice.d.ts +0 -1
- package/dist/daemon-box-identity.d.ts +0 -16
- package/dist/daemon-heartbeat.d.ts +0 -30
- package/dist/daemon-keeper.d.ts +0 -53
- package/dist/daemon-platform-guard.d.ts +0 -2
- package/dist/daemon-supervision/host.d.ts +0 -4
- package/dist/daemon-supervision/index.d.ts +0 -6
- package/dist/daemon-supervision/policy.d.ts +0 -16
- package/dist/daemon-supervision/setup.d.ts +0 -23
- package/dist/daemon-supervision/start.d.ts +0 -26
- package/dist/daemon-supervision/supervision-health.d.ts +0 -20
- package/dist/daemon-supervision/verify.d.ts +0 -13
- package/dist/daemon.d.ts +0 -5
- package/dist/db-credential-env-paths.d.ts +0 -13
- package/dist/db-credential-resolver.d.ts +0 -38
- package/dist/db-url-hint.d.ts +0 -4
- package/dist/default-repo-cli.d.ts +0 -20
- package/dist/default-repo-discovery.d.ts +0 -25
- package/dist/default-repo.d.ts +0 -32
- package/dist/device-login.d.ts +0 -8
- package/dist/discard-disposable.d.ts +0 -6
- package/dist/disk-gate.d.ts +0 -25
- package/dist/dispatch-callback-timeout.d.ts +0 -1
- package/dist/dispatch-claim-release.d.ts +0 -23
- package/dist/dispatch-lane-normalization.d.ts +0 -14
- package/dist/dispatch-model-guard.d.ts +0 -26
- package/dist/dispatch-progress.d.ts +0 -3
- package/dist/dispatch-resource-gate.d.ts +0 -20
- package/dist/dispatch-start-abort.d.ts +0 -3
- package/dist/dispatch-start-readback.d.ts +0 -27
- package/dist/dispatch.d.ts +0 -24
- package/dist/disposable-artifacts.d.ts +0 -2
- package/dist/doctor/context-envelope-cli.d.ts +0 -1
- package/dist/doctor/context-envelope.d.ts +0 -13
- package/dist/doctor/context-envelope.probes.d.ts +0 -25
- package/dist/doctor/context-envelope.types.d.ts +0 -42
- package/dist/doctor/doctor.types.d.ts +0 -50
- package/dist/doctor/github-readiness.d.ts +0 -16
- package/dist/doctor/index.d.ts +0 -7
- package/dist/doctor/local-store-cli.d.ts +0 -11
- package/dist/doctor/local-store.d.ts +0 -35
- package/dist/doctor/node-runtime-cli.d.ts +0 -6
- package/dist/doctor/node-runtime.d.ts +0 -19
- package/dist/doctor/runner-install-cli.d.ts +0 -1
- package/dist/doctor/runner-install.d.ts +0 -86
- package/dist/doctor/runtime-takeover-cli.d.ts +0 -1
- package/dist/doctor/runtime-takeover-daemon-supervision.d.ts +0 -3
- package/dist/doctor/runtime-takeover-deploy-evidence.d.ts +0 -13
- package/dist/doctor/runtime-takeover-scheduler.d.ts +0 -29
- package/dist/doctor/runtime-takeover.d.ts +0 -3
- package/dist/doctor/runtime-takeover.probes.d.ts +0 -45
- package/dist/executor-ref-routing.d.ts +0 -14
- package/dist/exit-classify.d.ts +0 -12
- package/dist/exited-salvage.d.ts +0 -22
- package/dist/exited-worker-handoff-capture.d.ts +0 -19
- package/dist/factory-status/collect.d.ts +0 -12
- package/dist/factory-status/lightweight.d.ts +0 -5
- package/dist/factory-status/render.d.ts +0 -5
- package/dist/factory-status/types.d.ts +0 -46
- package/dist/factory-status-cli.d.ts +0 -1
- package/dist/factory-steer-delivery.d.ts +0 -7
- package/dist/finalize.d.ts +0 -25
- package/dist/fortress-engagement-gate.d.ts +0 -5
- package/dist/git.d.ts +0 -37
- package/dist/github-repo.d.ts +0 -5
- package/dist/harness-expert-review.d.ts +0 -12
- package/dist/harness-lease-owner.d.ts +0 -13
- package/dist/harness-notice/harness-notice.auto-complete.d.ts +0 -3
- package/dist/harness-notice/harness-notice.monitor-tick.d.ts +0 -6
- package/dist/harness-notice/harness-notice.parse.d.ts +0 -3
- package/dist/harness-notice/harness-notice.tool-response.d.ts +0 -3
- package/dist/harness-notice/harness-notice.types.d.ts +0 -17
- package/dist/harness-notice/harness-notice.worker-complete.d.ts +0 -3
- package/dist/harness-notice/harness-notice.worker-start.d.ts +0 -7
- package/dist/harness-notice/harness-notice.worker-status.d.ts +0 -2
- package/dist/harness-notice/index.d.ts +0 -8
- package/dist/harness-repair-target.d.ts +0 -23
- package/dist/harness-storage-snapshot.d.ts +0 -26
- package/dist/harness-verify-cli.d.ts +0 -1
- package/dist/harness-verify.d.ts +0 -30
- package/dist/harness-worker-active.d.ts +0 -12
- package/dist/harness-worktree-build-guard.d.ts +0 -12
- package/dist/heartbeat-final-result.d.ts +0 -5
- package/dist/heartbeat.d.ts +0 -27
- package/dist/heavy-verification/command-classify.d.ts +0 -9
- package/dist/heavy-verification/gate.d.ts +0 -10
- package/dist/heavy-verification/index.d.ts +0 -5
- package/dist/heavy-verification/paths.d.ts +0 -3
- package/dist/heavy-verification/slot.d.ts +0 -49
- package/dist/heavy-verification/worker-command-gate.d.ts +0 -23
- package/dist/index.d.ts +0 -88
- package/dist/installed-package-versions.d.ts +0 -8
- package/dist/instruction-bundle/cache.d.ts +0 -6
- package/dist/instruction-bundle/client.d.ts +0 -25
- package/dist/instruction-bundle/contract.d.ts +0 -4
- package/dist/instruction-bundle/embedded-bundle.d.ts +0 -3
- package/dist/instruction-bundle/index.d.ts +0 -7
- package/dist/instruction-bundle/keys.d.ts +0 -14
- package/dist/instruction-bundle/state.d.ts +0 -24
- package/dist/instruction-bundle/types.d.ts +0 -42
- package/dist/instruction-bundle/verify.d.ts +0 -15
- package/dist/landing/cli-auth.d.ts +0 -11
- package/dist/landing/land-pr-check-classify.d.ts +0 -17
- package/dist/landing/land-pr-completion-post.d.ts +0 -12
- package/dist/landing/land-pr.d.ts +0 -28
- package/dist/landing-contract-gate.d.ts +0 -27
- package/dist/landing-contract-pr-classify.d.ts +0 -4
- package/dist/landing-gate.d.ts +0 -24
- package/dist/lane/landing-maintainer-local.d.ts +0 -15
- package/dist/lane/landing-maintainer-tick.d.ts +0 -16
- package/dist/lane/lane-spec.d.ts +0 -8
- package/dist/lane/lane-tick-cli.d.ts +0 -1
- package/dist/lease-renewal.d.ts +0 -15
- package/dist/local-pr-attention-reconcile.d.ts +0 -25
- package/dist/local-run-store/admission-enforce.d.ts +0 -38
- package/dist/local-run-store/admission-shadow.d.ts +0 -56
- package/dist/local-run-store/dispatch-claim-recovery-startup.d.ts +0 -11
- package/dist/local-run-store/dispatch-claim-recovery.d.ts +0 -54
- package/dist/local-run-store/dispatch-receipts.d.ts +0 -90
- package/dist/local-run-store/index.d.ts +0 -15
- package/dist/local-run-store/local-run-store.d.ts +0 -106
- package/dist/local-run-store/remote-surface-flags.d.ts +0 -15
- package/dist/local-run-store/small-surfaces.d.ts +0 -37
- package/dist/local-run-store/sqlite/sqlite-filesystem-policy.d.ts +0 -16
- package/dist/local-run-store/sqlite/sqlite-local-run-store.d.ts +0 -68
- package/dist/local-run-store/sqlite/sqlite-recovery.d.ts +0 -14
- package/dist/local-run-store/sqlite/sqlite-schema.d.ts +0 -13
- package/dist/local-run-store/store-lifecycle.d.ts +0 -38
- package/dist/local-run-store/surface-flags.d.ts +0 -47
- package/dist/local-run-store/tick-posture.d.ts +0 -27
- package/dist/material-worktree-changes.d.ts +0 -2
- package/dist/memory-cost-package-version-guard-enforce.d.ts +0 -10
- package/dist/memory-cost-package-version-guard.d.ts +0 -49
- package/dist/mesh-liveness/mesh-cron-lease-store.d.ts +0 -9
- package/dist/model-routing-task-enrich.d.ts +0 -8
- package/dist/model-routing.d.ts +0 -49
- package/dist/monitor/index.d.ts +0 -7
- package/dist/monitor/monitor-cli.d.ts +0 -9
- package/dist/monitor/monitor-loop.d.ts +0 -1
- package/dist/monitor/monitor-spawn.d.ts +0 -18
- package/dist/monitor/monitor.classify.d.ts +0 -15
- package/dist/monitor/monitor.service.d.ts +0 -17
- package/dist/monitor/monitor.store.d.ts +0 -6
- package/dist/monitor/monitor.task-lease.d.ts +0 -11
- package/dist/monitor/monitor.terminal.d.ts +0 -11
- package/dist/monitor/monitor.types.d.ts +0 -77
- package/dist/node-runtime-policy.d.ts +0 -25
- package/dist/orchestration-enforcement/config.d.ts +0 -5
- package/dist/orchestration-enforcement/evaluator.d.ts +0 -6
- package/dist/orchestration-enforcement/idempotency.d.ts +0 -8
- package/dist/orchestration-enforcement/index.d.ts +0 -4
- package/dist/orchestration-enforcement/types.d.ts +0 -24
- package/dist/orchestration-providers/adapter-contract.d.ts +0 -50
- package/dist/orchestration-providers/audit.d.ts +0 -3
- package/dist/orchestration-providers/capabilities.d.ts +0 -3
- package/dist/orchestration-providers/claude-oauth-binding.d.ts +0 -6
- package/dist/orchestration-providers/codex-oauth-binding.d.ts +0 -5
- package/dist/orchestration-providers/codex-orchestration-adapter.d.ts +0 -13
- package/dist/orchestration-providers/cost-router.d.ts +0 -24
- package/dist/orchestration-providers/cursor-oauth-binding.d.ts +0 -5
- package/dist/orchestration-providers/hermes-cli-adapter.d.ts +0 -15
- package/dist/orchestration-providers/hermes-openai-codex-binding.d.ts +0 -15
- package/dist/orchestration-providers/index.d.ts +0 -14
- package/dist/orchestration-providers/inventory.d.ts +0 -54
- package/dist/orchestration-providers/oauth-binding-utils.d.ts +0 -22
- package/dist/orchestration-providers/routing.d.ts +0 -16
- package/dist/orchestration-providers/types.d.ts +0 -45
- package/dist/package-version.d.ts +0 -5
- package/dist/path-values.d.ts +0 -5
- package/dist/paths.d.ts +0 -16
- package/dist/pipeline-dispatch.d.ts +0 -8
- package/dist/pipeline-exact-targets.d.ts +0 -2
- package/dist/pipeline-max-starts.d.ts +0 -26
- package/dist/pipeline-tick.d.ts +0 -50
- package/dist/plan-persist/agentos-api.d.ts +0 -28
- package/dist/plan-persist/body-hash.d.ts +0 -3
- package/dist/plan-persist/drain.d.ts +0 -7
- package/dist/plan-persist/errors.d.ts +0 -9
- package/dist/plan-persist/handoff.d.ts +0 -7
- package/dist/plan-persist/idempotency.d.ts +0 -2
- package/dist/plan-persist/index.d.ts +0 -8
- package/dist/plan-persist/outbox-durability.d.ts +0 -31
- package/dist/plan-persist/outbox-store.d.ts +0 -36
- package/dist/plan-persist/paths.d.ts +0 -8
- package/dist/plan-persist/persist.d.ts +0 -10
- package/dist/plan-persist/readback.d.ts +0 -17
- package/dist/plan-persist/types.d.ts +0 -95
- package/dist/plan-persist-cli.d.ts +0 -3
- package/dist/plan-progress-daemon-sync.d.ts +0 -7
- package/dist/plan-progress-sync.d.ts +0 -21
- package/dist/plan-progress.d.ts +0 -10
- package/dist/post-restart-unblock.d.ts +0 -24
- package/dist/pr-handoff/index.d.ts +0 -6
- package/dist/pr-handoff/pr-handoff-assess.d.ts +0 -44
- package/dist/pr-handoff/pr-handoff-dedupe.d.ts +0 -18
- package/dist/pr-handoff/pr-handoff-gh.d.ts +0 -52
- package/dist/pr-handoff/pr-handoff-supersede.d.ts +0 -17
- package/dist/pr-handoff/pr-handoff.d.ts +0 -8
- package/dist/pr-handoff/pr-handoff.types.d.ts +0 -45
- package/dist/pr-handoff/same-head-pr-guard.d.ts +0 -10
- package/dist/prompt.d.ts +0 -56
- package/dist/provider-evidence/collect.d.ts +0 -31
- package/dist/provider-evidence/exec.d.ts +0 -5
- package/dist/provider-evidence/index.d.ts +0 -7
- package/dist/provider-evidence/recipes-github.d.ts +0 -5
- package/dist/provider-evidence/recipes-vercel.d.ts +0 -2
- package/dist/provider-evidence/registry.d.ts +0 -6
- package/dist/provider-evidence/shared-cache.d.ts +0 -8
- package/dist/provider-evidence/types.d.ts +0 -48
- package/dist/provider-evidence/wanted-store.d.ts +0 -13
- package/dist/provider-quota-preflight.d.ts +0 -38
- package/dist/providers/claude.d.ts +0 -8
- package/dist/providers/codex.d.ts +0 -14
- package/dist/providers/cursor-windows.d.ts +0 -7
- package/dist/providers/cursor.d.ts +0 -13
- package/dist/providers/hermes-codex.d.ts +0 -12
- package/dist/providers/model-preflight.d.ts +0 -41
- package/dist/providers/openai-codex-resilience.d.ts +0 -33
- package/dist/providers/openai-compatible-response.d.ts +0 -23
- package/dist/providers/openai-compatible-runner.d.ts +0 -1
- package/dist/providers/openai-compatible.d.ts +0 -46
- package/dist/providers/registry.d.ts +0 -4
- package/dist/providers/types.d.ts +0 -36
- package/dist/redact.d.ts +0 -1
- package/dist/repair-target-worktree.d.ts +0 -4
- package/dist/repo-search.d.ts +0 -53
- package/dist/resource-gate.d.ts +0 -74
- package/dist/retry-limits.d.ts +0 -12
- package/dist/review-head-reconcile.d.ts +0 -17
- package/dist/run-list.d.ts +0 -38
- package/dist/run-metadata-retention.d.ts +0 -38
- package/dist/run-resolve.d.ts +0 -4
- package/dist/run-store.d.ts +0 -38
- package/dist/run-worker-index.d.ts +0 -10
- package/dist/runner-boundary/index.d.ts +0 -6
- package/dist/runner-boundary/runner-boundary.dispatch-guard.d.ts +0 -4
- package/dist/runner-boundary/runner-boundary.forge-legacy-migration.d.ts +0 -23
- package/dist/runner-boundary/runner-boundary.harness-root.d.ts +0 -17
- package/dist/runner-boundary/runner-boundary.resolve.d.ts +0 -4
- package/dist/runner-boundary/runner-boundary.run-guard.d.ts +0 -12
- package/dist/runner-boundary/runner-boundary.types.d.ts +0 -31
- package/dist/runner-config-backfill.d.ts +0 -18
- package/dist/runner-identity.d.ts +0 -21
- package/dist/runtime-identity.d.ts +0 -9
- package/dist/runtime-memory-envelope.d.ts +0 -16
- package/dist/scheduler-cutover-cli.d.ts +0 -2
- package/dist/scheduler-cutover.d.ts +0 -25
- package/dist/security-review-environment.d.ts +0 -27
- package/dist/server/adapter-contract.d.ts +0 -1
- package/dist/server/cleanup.d.ts +0 -3
- package/dist/server/context-budget-receipt.d.ts +0 -2
- package/dist/server/db-credentials.d.ts +0 -1
- package/dist/server/default-repo.d.ts +0 -1
- package/dist/server/harness-notice.d.ts +0 -2
- package/dist/server/heavy-verification.d.ts +0 -3
- package/dist/server/landing.d.ts +0 -1
- package/dist/server/memory-cost-enforce.d.ts +0 -1
- package/dist/server/memory-cost.d.ts +0 -1
- package/dist/server/model-routing.d.ts +0 -3
- package/dist/server/monitor.d.ts +0 -3
- package/dist/server/node-runtime-policy.d.ts +0 -1
- package/dist/server/orchestration.d.ts +0 -10
- package/dist/server/pr-evidence.d.ts +0 -2
- package/dist/server/prompt.d.ts +0 -1
- package/dist/server/repo-search.d.ts +0 -1
- package/dist/server/worker-policy.d.ts +0 -6
- package/dist/server/wsl-crash-dumps.d.ts +0 -2
- package/dist/shell-command-outcome.d.ts +0 -32
- package/dist/sidecar-cli.d.ts +0 -16
- package/dist/stale-reconcile.d.ts +0 -31
- package/dist/start-box-identity.d.ts +0 -12
- package/dist/start.d.ts +0 -13
- package/dist/status.d.ts +0 -262
- package/dist/stream.d.ts +0 -33
- package/dist/supervisor.d.ts +0 -40
- package/dist/sweep.d.ts +0 -1
- package/dist/util.d.ts +0 -35
- package/dist/validate.d.ts +0 -15
- package/dist/vercel/index.d.ts +0 -4
- package/dist/vercel/vercel-api.d.ts +0 -17
- package/dist/vercel/vercel-evidence.d.ts +0 -48
- package/dist/vercel/vercel-github-status.d.ts +0 -19
- package/dist/vercel/vercel-url.d.ts +0 -18
- package/dist/verify-live/verify-live-prompt.d.ts +0 -2
- package/dist/worker-cap-source.d.ts +0 -29
- package/dist/worker-env.d.ts +0 -52
- package/dist/worker-execution-mode.d.ts +0 -5
- package/dist/worker-final-result-embed.d.ts +0 -1
- package/dist/worker-lease-sync.d.ts +0 -15
- package/dist/worker-lifecycle.d.ts +0 -28
- package/dist/worker-metadata-paths.d.ts +0 -26
- package/dist/worker-metadata-reconcile.d.ts +0 -21
- package/dist/worker-ops.d.ts +0 -45
- package/dist/worker-persona-catalog.d.ts +0 -29
- package/dist/worker-provider-policy.d.ts +0 -43
- package/dist/worker-usage.d.ts +0 -20
- package/dist/workspace-runtime-config.d.ts +0 -10
- package/dist/worktree-base-ref.d.ts +0 -34
- package/dist/worktree-completion-handoff.d.ts +0 -17
- package/dist/worktree.d.ts +0 -44
- package/dist/wsl-crash-dumps-cleanup.d.ts +0 -31
- package/dist/wsl-crash-dumps-cli.d.ts +0 -1
- package/dist/wsl-crash-dumps.d.ts +0 -90
- package/dist/wsl-host.d.ts +0 -71
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var o=(e,r,t)=>()=>{if(t)throw t[0];try{return e&&(r=e(e=0)),r}catch(n){throw t=[n],n}};function $(e){let r=e[vr];return r?new Set(r.split(/[\s,]+/).map(t=>t.trim()).filter(Boolean)):new Set}function y(e,r={}){return pr.has(e)?!0:hr.has(e)||r.operatorAllow?.has(e)||yr.some(t=>e.endsWith(t))?!1:fr.some(t=>e.endsWith(t))}function de(e){let r=$(e);return Object.keys(e).filter(t=>y(t,{operatorAllow:r})).sort()}function me(e){let r=$(e);return r.size===0?[]:Object.keys(e).filter(t=>r.has(t)&&!y(t,{operatorAllow:r})&&y(t)).sort()}function E(e){let r=$(e),t={...e};for(let n of Object.keys(t))y(n,{operatorAllow:r})&&delete t[n];return t}function br(e){let r=de(e),t=me(e);return{forbiddenPresent:r,safe:r.length===0,...t.length?{operatorAllowedActive:t}:{}}}var mr,pr,fr,gr,hr,yr,vr,C=o(()=>{"use strict";mr=["ANTHROPIC_API_KEY","ANALYST_API_KEY","RECRUITER_API_KEY","AUTH_SECRET","NEXTAUTH_SECRET","DATABASE_URL","PRODUCTION_DATABASE_URL","KYNVER_PRODUCTION_DATABASE_URL","REDIS_URL","GOOGLE_CLIENT_SECRET","GITHUB_CLIENT_SECRET","KYNVER_API_KEY","KYNVER_SERVICE_SECRET","KYNVER_RUNTIME_SECRET","KYNVER_CRON_SECRET","OPENCLAW_CRON_SECRET","QSTASH_TOKEN","QSTASH_CURRENT_SIGNING_KEY","QSTASH_NEXT_SIGNING_KEY","TOOL_SECRETS_KEK","TOOL_EXECUTOR_DISPATCH_SECRET","CLOUDFLARE_API_TOKEN","STRIPE_SECRET_KEY","STRIPE_WEBHOOK_SECRET","STRIPE_IDENTITY_WEBHOOK_SECRET","VOYAGE_API_KEY","PERPLEXITY_API_KEY","FRED_API_KEY","FMP_API_KEY","CURSOR_API_KEY","MEMORY_CONTENT_KEK","LLM_BYOK_KEK","KYNVER_COMMAND_AUTH_KEY","KYNVER_INSTRUCTION_BUNDLE_KEY","KYNVER_MEMORY_LEDGER_KEY","KYNVER_JWKS_PRIVATE_KEY_JWK"],pr=new Set(mr),fr=["_SECRET","_API_KEY","_KEK","_KEY","_TOKEN","_PASSWORD","_PASSPHRASE","_SALT"],gr=["GITHUB_TOKEN","GH_TOKEN","CLAUDE_CODE_OAUTH_TOKEN"],hr=new Set(gr),yr=["_PUBLIC_KEY"],vr="KYNVER_WORKER_ENV_ALLOW"});function Y(e){if(!e)return!1;try{return process.kill(e,0),!0}catch{return!1}}var a=o(()=>{"use strict"});var G=o(()=>{"use strict";a();C()});var v=o(()=>{"use strict"});var z=o(()=>{"use strict";G();v()});var d=o(()=>{"use strict"});var P=o(()=>{"use strict"});var ve=o(()=>{"use strict"});var
|
|
2
|
-
${n}`,s=Cr(e.personaSlug);return!!(r.startsWith(_r)||r===Sr||r.startsWith("daemon-review:")||s&&O.has(s)&&(r.includes("evidence")||r.includes("validate")||r.includes("review")||Or(r,i)||V(i))||r.startsWith(Er)&&e.parentTaskId&&s&&O.has(s)||e.planId&&!e.parentTaskId&&s&&O.has(s)&&V(i)||t.includes("expert pr review")||e.parentTaskId&&(t.startsWith("review:")||t.includes("review required")||t.includes("runtime review"))&&s&&O.has(s))}var wr=/^claude[-_]/i,Pr=/^(?:opus|sonnet|haiku)\b/i;function ge(e){let r=e.trim();return wr.test(r)||Pr.test(r)}function he(e){let r=e.trim().toLowerCase();return r.startsWith("gpt-")||r.startsWith("gpt5")||r.includes("codex")}function ye(e){let r=e.trim().toLowerCase();return r.includes("composer")||r.includes("cursor")}function Ir(e){return he(e)?"codex":ge(e)?"claude":(ye(e),"cursor")}function Nr(e){if(!e.startsWith("provider:"))return null;let r=e.slice(9),t=r.indexOf(":"),n=(t>=0?r.slice(0,t):r).trim().toLowerCase(),i=t>=0&&r.slice(t+1).trim()||void 0;return n?n==="claude"||n==="opus"||n==="anthropic"?{provider:"claude",model:i,rule:i?"executor_ref:provider_claude_model":"executor_ref:provider_claude"}:n==="codex"?{provider:"codex",model:i,rule:"executor_ref:provider_codex"}:n==="openai-compatible"||n==="openai"||n==="openai_compatible"?{provider:"openai-compatible",model:i,rule:"executor_ref:provider_openai_compatible"}:n==="cursor"||n==="composer"?{provider:"cursor",model:i,rule:"executor_ref:provider_cursor"}:null:null}function Dr(e){if(!e.startsWith("harness-lane:"))return null;let r=e.split(":").map(i=>i.trim()).filter(Boolean);if(r.length<2)return null;let t=r[1],n=r.slice(2).join(":");return n?ge(n)||he(n)||ye(n)?{lane:t,model:n,provider:Ir(n),rule:"executor_ref:harness_lane_model"}:{lane:t,rule:"executor_ref:harness_lane"}:{lane:t,rule:"executor_ref:harness_lane"}}function A(e){let r=typeof e=="string"?e.trim():"";return r?Nr(r)??Dr(r):null}m();a();a();a();var Wa=process.env.KYNVER_CODEX_DEFAULT_MODEL?.trim()||"gpt-5.4";function it(){return process.env.KYNVER_CODEX_DEFAULT_MODEL?.trim()||"gpt-5.4"}var st=it();a();var Xa=600*1e3;var Xe="composer-2.5";var p="cursor",at={anthropic:"claude",opus:"claude",openai:"openai-compatible",openai_compatible:"openai-compatible","openai-compat":"openai-compatible"};function Ze(e){let r=e.trim().toLowerCase();return at[r]??r}var lt=new Set(["claude","opus","anthropic"]),ct=[/\[worker-provider:\s*claude\]/i,/\[use-claude-worker\]/i,/\[operator-worker-provider:\s*claude\]/i];function R(e,r){let t=e[r];return typeof t=="string"?t.trim():""}function u(e){if(!e?.trim())return!1;let r=e.trim().toLowerCase();return lt.has(r)?!0:r.includes("claude")||r.includes("opus")}function oe(e){if(!e)return!1;let r=e.workerProviderOverride;if(typeof r=="string"&&u(r))return!0;let t=R(e,"executorRef").toLowerCase();if(t==="provider:claude"||t.startsWith("provider:claude:")||t.includes("claude-worker-override")||t.includes("operator-claude"))return!0;let n=A(R(e,"executorRef"));if(n?.provider&&u(n.provider)||n?.model&&u(ut(n.model)))return!0;let i=R(e,"description");if(ct.some(l=>l.test(i)))return!0;let s=R(e,"title");return!!/\[use-claude-worker\]/i.test(s)}function ut(e){let r=e.trim().toLowerCase();return/^claude[-_]/.test(r)||/^(?:opus|sonnet|haiku)\b/.test(r)?"claude":r}function dt(e,r){return{provider:p,model:Xe,rule:`policy:cursor_default${r}`,requestedModel:e}}var mt=["explicit:","executor_ref:","factory:","task:"];function pt(e){return mt.some(r=>e.startsWith(r))}function er(e){if(!e)return!1;let r=e.workerProviderOverride;return typeof r=="string"&&r.trim()||A(R(e,"executorRef"))?.provider?!0:oe(e)}function Qe(e){let{routing:r,task:t}=e,n=e.explicitProvider?.trim().toLowerCase();if(e.explicitProviderIsOperatorOverride&&u(n))return{...r,provider:"claude",rule:r.rule.startsWith("explicit:")?r.rule:"explicit:operator_provider"};if(n||pt(r.rule)||er(t)||!u(r.provider))return r;let i=r.rule&&r.rule!=="default:global"?`:${r.rule.replace(/:/g,"_")}`:"";return dt(r.model,i)}function ft(e,r=p){let t=e?.trim();return t?Ze(t):r}function gt(e){let r=[...new Set(e.map(t=>t.trim().toLowerCase()).filter(Boolean))];return r.includes(p)?[...new Set(r.map(t=>u(t)?p:t))]:r.every(t=>u(t))?[p]:r}var ht=/\b(npm run typecheck|tsc\b[^|&;]*--noEmit|node scripts\/verify-pr-local\.mjs|kynver (harness )?verify)\b/i,yt=/\b(npm run build\b|next build\b)\b/i,vt=/\b(vercel (build|deploy|--prod))\b/i,bt=/\b(openai|anthropic|perplexity|voyage)\b.*\b(api|cli)\b|\b(paid|billable)[-_ ]?compute\b/i;function ie(e){let r=e.trim();return r?bt.test(r)?{heavy:!0,commandClass:"paid_compute",reason:"paid external compute requires heavy-verification token and operator approval"}:vt.test(r)?{heavy:!0,commandClass:"vercel_verify",reason:"Vercel build/deploy verification requires heavy-verification token"}:yt.test(r)?{heavy:!0,commandClass:"full_build",reason:"full app build requires heavy-verification token"}:ht.test(r)?{heavy:!0,commandClass:"full_typecheck",reason:"full repo typecheck requires heavy-verification token"}:{heavy:!1,commandClass:"allowed",reason:null}:{heavy:!1,commandClass:"allowed",reason:null}}var U="heavy_verification_token_required";import{spawnSync as Bt}from"node:child_process";a();import{closeSync as Et,existsSync as k,mkdirSync as Ct,openSync as Ot,readdirSync as or,readFileSync as At,statSync as wt,unlinkSync as ir,writeFileSync as Pt}from"node:fs";import le from"node:path";import{mkdirSync as xt}from"node:fs";import{tmpdir as kt}from"node:os";import M from"node:path";import{homedir as Rt}from"node:os";import rr from"node:path";function tr(){let e=process.env.KYNVER_STATE_ROOT;return e?rr.resolve(e):rr.join(Rt(),".kynver","state")}function _t(){return!!(process.env.VERCEL||process.env.VERCEL_ENV||process.env.AWS_LAMBDA_FUNCTION_NAME||process.env.AWS_EXECUTION_ENV)}function St(){let e=process.env.KYNVER_HEAVY_VERIFICATION_STATE_ROOT;return e?M.resolve(e):_t()?M.join(kt(),"kynver","state","heavy-verification"):M.join(tr(),"heavy-verification")}function se(){return M.join(St(),"slots")}function x(){let e=se();return xt(e,{recursive:!0}),e}var _=120*6e4,nr=1;function It(e,r){let t=Number(e);return!Number.isFinite(t)||t<=0?r:Math.floor(t)}function F(){let e=process.env.KYNVER_HEAVY_VERIFICATION_SKIP?.trim().toLowerCase();return e==="1"||e==="true"||e==="yes"}function L(){let e=process.env.KYNVER_HEAVY_VERIFICATION_MAX_CONCURRENT;return e?It(e,nr):nr}function Nt(e){return`slot-${e}`}function Dt(e,r=se()){return le.join(r,`${e}.json`)}function ce(e){if(!k(e))return null;try{let r=JSON.parse(At(e,"utf8"));if(typeof r.slotId=="string"&&typeof r.pid=="number"&&typeof r.acquiredAt=="string"&&typeof r.command=="string")return r}catch{return null}return null}function sr(e,r=_){if(!e||!Y(e.pid))return!0;let t=Date.parse(e.acquiredAt);return Number.isNaN(t)?!0:Date.now()-t>r}function ar(e,r){let t=ce(e);if(t)return sr(t,r);if(!k(e))return!0;try{return Date.now()-wt(e).mtimeMs>r}catch{return!0}}function Kt(e,r){if(ar(e,r))try{ir(e)}catch{}}function Wt(e){return Ct(e,{recursive:!0}),e}function ue(e={}){let r=Wt(e.slotsDir??x()),t=e.staleMs??_,n=0;for(let i of or(r)){if(!i.endsWith(".json"))continue;let s=le.join(r,i),l=k(s);Kt(s,t),l&&!k(s)&&(n+=1)}return n}function Tt(e={}){let r=e.slotsDir??x(),t=e.staleMs??_;ue({slotsDir:r,staleMs:t});let n=[];for(let i of or(r)){if(!i.endsWith(".json"))continue;let s=ce(le.join(r,i));s&&!sr(s,t)&&n.push(s)}return n}function ae(e={}){return Tt(e).length}function S(e,r={}){if(F())return{admitted:!0,slotId:null,activeSlots:0,maxSlots:L(),reason:null};let t=r.slotsDir??x(),n=r.staleMs??_,i=r.maxSlots??L();ue({slotsDir:t,staleMs:n});for(let l=0;l<i;l+=1){let c=Nt(l),g=Dt(c,t),cr=ce(g);if(ar(g,n))try{ir(g)}catch{}else if(cr||k(g))continue;let ur={slotId:c,pid:process.pid,acquiredAt:new Date().toISOString(),command:e};try{let h=Ot(g,"wx");Pt(h,JSON.stringify(ur,null,2),"utf8"),Et(h);let dr=ae({slotsDir:t,staleMs:n});return{admitted:!0,slotId:c,activeSlots:dr,maxSlots:i,reason:null}}catch(h){if(h.code==="EEXIST")continue;throw h}}let s=ae({slotsDir:t,staleMs:n});return{admitted:!1,slotId:null,activeSlots:s,maxSlots:i,reason:`heavy verification at capacity (${s}/${i} slots)`}}function H(e,r={}){if(F())return{admitted:!0,slotId:null,activeSlots:0,maxSlots:L(),reason:null};let t=r.slotsDir??x(),n=r.staleMs??_,i=r.maxSlots??L();ue({slotsDir:t,staleMs:n});let s=ae({slotsDir:t,staleMs:n}),l=s<i;return{admitted:l,slotId:null,activeSlots:s,maxSlots:i,reason:l?null:`heavy verification at capacity (${s}/${i} slots); waiting for ${e}`}}function Ut(e){e<=0||Bt(process.execPath,["-e",`const d=Date.now()+${Math.floor(e)};while(Date.now()<d);`],{stdio:"ignore"})}function lr(e,r,t=2e3,n={}){let i=Date.now()+Math.max(0,r),s=S(e,n);for(;!s.admitted&&Date.now()<i;)Ut(Math.min(t,i-Date.now())),s=S(e,n);return s}function Mt(e,r={}){let t=ie(e);if(!t.heavy)return{allowed:!0,outcome:"allowed",commandClass:t.commandClass,reason:"command does not require heavy-verification token",verificationGate:{...H(e),slotId:null}};if(F())return{allowed:!0,outcome:"heavy_verification_skipped",commandClass:t.commandClass,reason:"KYNVER_HEAVY_VERIFICATION_SKIP bypasses gate",verificationGate:{...H(e),slotId:null}};let n=r.waitMs??0,i=n>0?lr(e,n,r.pollMs):S(e);return i.admitted?{allowed:!0,outcome:"allowed",commandClass:t.commandClass,reason:t.reason??"heavy-verification token acquired",verificationGate:i}:{allowed:!1,outcome:U,commandClass:t.commandClass,reason:t.reason??i.reason??U,verificationGate:i}}export{p as DEFAULT_WORKER_PROVIDER,U as HEAVY_VERIFICATION_TOKEN_REQUIRED,j as KYNVER_NO_PROD_DB_CREDENTIALS_ENV,kr as auditReviewWorkerCredentialScope,br as auditWorkerEnv,f as buildWorkerSpawnEnv,ie as classifyHeavyShellCommand,Qe as enforceCursorWorkerProvider,Mt as gateWorkerShellCommand,u as isClaudeFamilyProvider,y as isForbiddenWorkerEnvKey,Ar as isHarnessExpertReviewWorker,fe as isNoProdCredentialReviewEnvironment,de as listForbiddenWorkerEnvKeys,me as listOperatorAllowedWorkerEnvKeys,Ze as normalizeWorkerProviderName,gt as preferCursorExecutor,ft as resolveConfiguredWorkerProvider,E as scrubWorkerEnv,oe as taskAllowsClaudeWorker,er as taskExpressesWorkerProviderPreference};
|
|
1
|
+
var o=(e,r,t)=>()=>{if(t)throw t[0];try{return e&&(r=e(e=0)),r}catch(n){throw t=[n],n}};function $(e){let r=e[vr];return r?new Set(r.split(/[\s,]+/).map(t=>t.trim()).filter(Boolean)):new Set}function y(e,r={}){return pr.has(e)?!0:hr.has(e)||r.operatorAllow?.has(e)||yr.some(t=>e.endsWith(t))?!1:fr.some(t=>e.endsWith(t))}function de(e){let r=$(e);return Object.keys(e).filter(t=>y(t,{operatorAllow:r})).sort()}function me(e){let r=$(e);return r.size===0?[]:Object.keys(e).filter(t=>r.has(t)&&!y(t,{operatorAllow:r})&&y(t)).sort()}function E(e){let r=$(e),t={...e};for(let n of Object.keys(t))y(n,{operatorAllow:r})&&delete t[n];return t}function br(e){let r=de(e),t=me(e);return{forbiddenPresent:r,safe:r.length===0,...t.length?{operatorAllowedActive:t}:{}}}var mr,pr,fr,gr,hr,yr,vr,C=o(()=>{"use strict";mr=["ANTHROPIC_API_KEY","ANALYST_API_KEY","RECRUITER_API_KEY","AUTH_SECRET","NEXTAUTH_SECRET","DATABASE_URL","PRODUCTION_DATABASE_URL","KYNVER_PRODUCTION_DATABASE_URL","REDIS_URL","GOOGLE_CLIENT_SECRET","GITHUB_CLIENT_SECRET","KYNVER_API_KEY","KYNVER_SERVICE_SECRET","KYNVER_RUNTIME_SECRET","KYNVER_CRON_SECRET","OPENCLAW_CRON_SECRET","QSTASH_TOKEN","QSTASH_CURRENT_SIGNING_KEY","QSTASH_NEXT_SIGNING_KEY","TOOL_SECRETS_KEK","TOOL_EXECUTOR_DISPATCH_SECRET","CLOUDFLARE_API_TOKEN","STRIPE_SECRET_KEY","STRIPE_WEBHOOK_SECRET","STRIPE_IDENTITY_WEBHOOK_SECRET","VOYAGE_API_KEY","PERPLEXITY_API_KEY","FRED_API_KEY","FMP_API_KEY","CURSOR_API_KEY","MEMORY_CONTENT_KEK","LLM_BYOK_KEK","KYNVER_COMMAND_AUTH_KEY","KYNVER_INSTRUCTION_BUNDLE_KEY","KYNVER_MEMORY_LEDGER_KEY","KYNVER_JWKS_PRIVATE_KEY_JWK"],pr=new Set(mr),fr=["_SECRET","_API_KEY","_KEK","_KEY","_TOKEN","_PASSWORD","_PASSPHRASE","_SALT"],gr=["GITHUB_TOKEN","GH_TOKEN","CLAUDE_CODE_OAUTH_TOKEN","CODEX_API_KEY"],hr=new Set(gr),yr=["_PUBLIC_KEY"],vr="KYNVER_WORKER_ENV_ALLOW"});function Y(e){if(!e)return!1;try{return process.kill(e,0),!0}catch{return!1}}var a=o(()=>{"use strict"});var G=o(()=>{"use strict";a();C()});var v=o(()=>{"use strict"});var z=o(()=>{"use strict";G();v()});var d=o(()=>{"use strict"});var P=o(()=>{"use strict"});var ve=o(()=>{"use strict"});var un,dn,q=o(()=>{"use strict";un=25*1024*1024*1024,dn=12*1024*1024*1024});var hn,yn,be=o(()=>{"use strict";q();hn=5*1024*1024*1024,yn=10*1024*1024*1024});var _n,Sn,J=o(()=>{"use strict";be();q();_n=30*1024*1024*1024,Sn=15*1024*1024*1024});var xe=o(()=>{"use strict";a()});import Kr from"node:path";var Dn,X=o(()=>{"use strict";v();xe();Dn=Kr.join(".openclaw","harness")});var N=o(()=>{"use strict";m();d();P();D();X()});var Se=o(()=>{"use strict";m();X();N();a()});var Z=o(()=>{"use strict";Se();a()});var Ee=o(()=>{"use strict";Z();a()});var Ce=o(()=>{"use strict"});var Oe=o(()=>{"use strict";Ce();a()});var Ae=o(()=>{"use strict"});var we=o(()=>{"use strict";Ae()});var Pe=o(()=>{"use strict";we();a()});var Ie=o(()=>{"use strict"});var Ne=o(()=>{"use strict"});var De=o(()=>{"use strict"});var ee=o(()=>{"use strict"});var Te=o(()=>{"use strict"});var Ke=o(()=>{"use strict";ee();Te()});var We=o(()=>{"use strict";Oe();Pe();Ie();Ne();G();De();Ke();ee();a()});var Be=o(()=>{"use strict";We()});var $r,jr,Me=o(()=>{"use strict";ve();m();d();P();D();J();Z();Ee();Be();a();$r=500*1024*1024,jr=4*1024*1024*1024});var D=o(()=>{"use strict";Me()});import{homedir as Vr}from"node:os";import Yr from"node:path";var Ue,re=o(()=>{"use strict";Ue=Yr.join(Vr(),".kynver",".env")});var Le=o(()=>{"use strict"});var Fe=o(()=>{"use strict";Le()});var He=o(()=>{"use strict"});var te=o(()=>{"use strict";Fe();He()});var $e=o(()=>{"use strict"});var je=o(()=>{"use strict";$e()});var K=o(()=>{"use strict";re();v();m();te();je()});var Ve=o(()=>{"use strict";d();d()});var Ye=o(()=>{"use strict";re();te();K()});var Ge=o(()=>{"use strict";z();d();Ve();m();K();Ye();a();N()});import{homedir as et,totalmem as ws}from"node:os";import ne from"node:path";var ze,Fs,Hs,$s,js,m=o(()=>{"use strict";z();v();a();d();P();D();J();K();Ge();N();ze=ne.join(et(),".kynver"),Fs=ne.join(ze,"config.json"),Hs=ne.join(ze,"credentials"),$s=500*1024*1024,js=4*1024*1024*1024});C();C();var j="KYNVER_NO_PROD_DB_CREDENTIALS",Rr=["KYNVER_ENV_FILE"],xr=new Set(["1","true","yes","on"]);function fe(e){let r=e[j]?.trim().toLowerCase();return r!==void 0&&xr.has(r)}function f(e,r={}){let t=E(e);if(!r.reviewWorker)return t;let n={...t,[j]:"1"};for(let i of Rr)delete n[i];return n}var pe=["DATABASE_URL","PRODUCTION_DATABASE_URL","KYNVER_PRODUCTION_DATABASE_URL"];function kr(e,r={}){let t=f(e,r),n=Object.keys(t).filter(c=>c.endsWith("_SECRET")||c.endsWith("_API_KEY")||pe.includes(c)),i=pe.every(c=>t[c]===void 0),s=r.reviewWorker?t.KYNVER_ENV_FILE===void 0:!0,l=fe(t);return{reviewMode:!!r.reviewWorker,noProdFlagPresent:r.reviewWorker?l:!0,forbiddenKeysAfterScrub:n.sort(),productionDbKeysAbsent:i,envFilePointerStripped:s,safe:i&&n.length===0&&s&&(!r.reviewWorker||l)}}var _r="expert-lane-pr-review:",Sr="plan-review-task",Er="scheduledjob:",O=new Set(["lorentz","dalton","rhea","sentinel"]);function Cr(e){if(!e)return null;let r=e.trim().toLowerCase();return r.length?r:null}function V(e){return/\b(deep[- ]?review|plan review|review .*plan|security review|red[- ]team|lb\d+|risk register|signoff|verification|evidence|prove|gate)\b/.test(e)}function Or(e,r){return e.startsWith("factory:")?e.includes("lb")||V(r):!1}function Ar(e){let r=(e.executorRef??"").toLowerCase(),t=(e.title??"").toLowerCase(),n=(e.description??"").toLowerCase(),i=`${t}
|
|
2
|
+
${n}`,s=Cr(e.personaSlug);return!!(r.startsWith(_r)||r===Sr||r.startsWith("daemon-review:")||s&&O.has(s)&&(r.includes("evidence")||r.includes("validate")||r.includes("review")||Or(r,i)||V(i))||r.startsWith(Er)&&e.parentTaskId&&s&&O.has(s)||e.planId&&!e.parentTaskId&&s&&O.has(s)&&V(i)||t.includes("expert pr review")||e.parentTaskId&&(t.startsWith("review:")||t.includes("review required")||t.includes("runtime review"))&&s&&O.has(s))}var wr=/^claude[-_]/i,Pr=/^(?:opus|sonnet|haiku)\b/i;function ge(e){let r=e.trim();return wr.test(r)||Pr.test(r)}function he(e){let r=e.trim().toLowerCase();return r.startsWith("gpt-")||r.startsWith("gpt5")||r.includes("codex")}function ye(e){let r=e.trim().toLowerCase();return r.includes("composer")||r.includes("cursor")}function Ir(e){return he(e)?"codex":ge(e)?"claude":(ye(e),"cursor")}function Nr(e){if(!e.startsWith("provider:"))return null;let r=e.slice(9),t=r.indexOf(":"),n=(t>=0?r.slice(0,t):r).trim().toLowerCase(),i=t>=0&&r.slice(t+1).trim()||void 0;return n?n==="claude"||n==="opus"||n==="anthropic"?{provider:"claude",model:i,rule:i?"executor_ref:provider_claude_model":"executor_ref:provider_claude"}:n==="codex"?{provider:"codex",model:i,rule:"executor_ref:provider_codex"}:n==="openai-compatible"||n==="openai"||n==="openai_compatible"?{provider:"openai-compatible",model:i,rule:"executor_ref:provider_openai_compatible"}:n==="cursor"||n==="composer"?{provider:"cursor",model:i,rule:"executor_ref:provider_cursor"}:null:null}function Dr(e){if(!e.startsWith("harness-lane:"))return null;let r=e.split(":").map(i=>i.trim()).filter(Boolean);if(r.length<2)return null;let t=r[1],n=r.slice(2).join(":");return n?ge(n)||he(n)||ye(n)?{lane:t,model:n,provider:Ir(n),rule:"executor_ref:harness_lane_model"}:{lane:t,rule:"executor_ref:harness_lane"}:{lane:t,rule:"executor_ref:harness_lane"}}function A(e){let r=typeof e=="string"?e.trim():"";return r?Nr(r)??Dr(r):null}m();a();var ot="kynver",it=["agent_os_context_envelope","agent_os_search_memory","agent_os_search_skills","agent_os_get_skill","agent_os_progress_note"],st=it.map(e=>`mcp__${ot}__${e}`);a();a();var La=process.env.KYNVER_CODEX_DEFAULT_MODEL?.trim()||"gpt-5.4";function lt(){return process.env.KYNVER_CODEX_DEFAULT_MODEL?.trim()||"gpt-5.4"}var ct=lt();a();var tl=600*1e3;var Xe="composer-2.5";var p="cursor",ut={anthropic:"claude",opus:"claude",openai:"openai-compatible",openai_compatible:"openai-compatible","openai-compat":"openai-compatible"};function Ze(e){let r=e.trim().toLowerCase();return ut[r]??r}var dt=new Set(["claude","opus","anthropic"]),mt=[/\[worker-provider:\s*claude\]/i,/\[use-claude-worker\]/i,/\[operator-worker-provider:\s*claude\]/i];function R(e,r){let t=e[r];return typeof t=="string"?t.trim():""}function u(e){if(!e?.trim())return!1;let r=e.trim().toLowerCase();return dt.has(r)?!0:r.includes("claude")||r.includes("opus")}function oe(e){if(!e)return!1;let r=e.workerProviderOverride;if(typeof r=="string"&&u(r))return!0;let t=R(e,"executorRef").toLowerCase();if(t==="provider:claude"||t.startsWith("provider:claude:")||t.includes("claude-worker-override")||t.includes("operator-claude"))return!0;let n=A(R(e,"executorRef"));if(n?.provider&&u(n.provider)||n?.model&&u(pt(n.model)))return!0;let i=R(e,"description");if(mt.some(l=>l.test(i)))return!0;let s=R(e,"title");return!!/\[use-claude-worker\]/i.test(s)}function pt(e){let r=e.trim().toLowerCase();return/^claude[-_]/.test(r)||/^(?:opus|sonnet|haiku)\b/.test(r)?"claude":r}function ft(e,r){return{provider:p,model:Xe,rule:`policy:cursor_default${r}`,requestedModel:e}}var gt=["explicit:","executor_ref:","factory:","task:"];function ht(e){return gt.some(r=>e.startsWith(r))}function er(e){if(!e)return!1;let r=e.workerProviderOverride;return typeof r=="string"&&r.trim()||A(R(e,"executorRef"))?.provider?!0:oe(e)}function Qe(e){let{routing:r,task:t}=e,n=e.explicitProvider?.trim().toLowerCase();if(e.explicitProviderIsOperatorOverride&&u(n))return{...r,provider:"claude",rule:r.rule.startsWith("explicit:")?r.rule:"explicit:operator_provider"};if(n||ht(r.rule)||er(t)||!u(r.provider))return r;let i=r.rule&&r.rule!=="default:global"?`:${r.rule.replace(/:/g,"_")}`:"";return ft(r.model,i)}function yt(e,r=p){let t=e?.trim();return t?Ze(t):r}function vt(e){let r=[...new Set(e.map(t=>t.trim().toLowerCase()).filter(Boolean))];return r.includes(p)?[...new Set(r.map(t=>u(t)?p:t))]:r.every(t=>u(t))?[p]:r}var bt=/\b(npm run typecheck|tsc\b[^|&;]*--noEmit|node scripts\/verify-pr-local\.mjs|kynver (harness )?verify)\b/i,Rt=/\b(npm run build\b|next build\b)\b/i,xt=/\b(vercel (build|deploy|--prod))\b/i,kt=/\b(openai|anthropic|perplexity|voyage)\b.*\b(api|cli)\b|\b(paid|billable)[-_ ]?compute\b/i;function ie(e){let r=e.trim();return r?kt.test(r)?{heavy:!0,commandClass:"paid_compute",reason:"paid external compute requires heavy-verification token and operator approval"}:xt.test(r)?{heavy:!0,commandClass:"vercel_verify",reason:"Vercel build/deploy verification requires heavy-verification token"}:Rt.test(r)?{heavy:!0,commandClass:"full_build",reason:"full app build requires heavy-verification token"}:bt.test(r)?{heavy:!0,commandClass:"full_typecheck",reason:"full repo typecheck requires heavy-verification token"}:{heavy:!1,commandClass:"allowed",reason:null}:{heavy:!1,commandClass:"allowed",reason:null}}var M="heavy_verification_token_required";import{spawnSync as Lt}from"node:child_process";a();import{closeSync as At,existsSync as k,mkdirSync as wt,openSync as Pt,readdirSync as or,readFileSync as It,statSync as Nt,unlinkSync as ir,writeFileSync as Dt}from"node:fs";import le from"node:path";import{mkdirSync as St}from"node:fs";import{tmpdir as Et}from"node:os";import U from"node:path";import{homedir as _t}from"node:os";import rr from"node:path";function tr(){let e=process.env.KYNVER_STATE_ROOT;return e?rr.resolve(e):rr.join(_t(),".kynver","state")}function Ct(){return!!(process.env.VERCEL||process.env.VERCEL_ENV||process.env.AWS_LAMBDA_FUNCTION_NAME||process.env.AWS_EXECUTION_ENV)}function Ot(){let e=process.env.KYNVER_HEAVY_VERIFICATION_STATE_ROOT;return e?U.resolve(e):Ct()?U.join(Et(),"kynver","state","heavy-verification"):U.join(tr(),"heavy-verification")}function se(){return U.join(Ot(),"slots")}function x(){let e=se();return St(e,{recursive:!0}),e}var _=120*6e4,nr=1;function Tt(e,r){let t=Number(e);return!Number.isFinite(t)||t<=0?r:Math.floor(t)}function F(){let e=process.env.KYNVER_HEAVY_VERIFICATION_SKIP?.trim().toLowerCase();return e==="1"||e==="true"||e==="yes"}function L(){let e=process.env.KYNVER_HEAVY_VERIFICATION_MAX_CONCURRENT;return e?Tt(e,nr):nr}function Kt(e){return`slot-${e}`}function Wt(e,r=se()){return le.join(r,`${e}.json`)}function ce(e){if(!k(e))return null;try{let r=JSON.parse(It(e,"utf8"));if(typeof r.slotId=="string"&&typeof r.pid=="number"&&typeof r.acquiredAt=="string"&&typeof r.command=="string")return r}catch{return null}return null}function sr(e,r=_){if(!e||!Y(e.pid))return!0;let t=Date.parse(e.acquiredAt);return Number.isNaN(t)?!0:Date.now()-t>r}function ar(e,r){let t=ce(e);if(t)return sr(t,r);if(!k(e))return!0;try{return Date.now()-Nt(e).mtimeMs>r}catch{return!0}}function Bt(e,r){if(ar(e,r))try{ir(e)}catch{}}function Mt(e){return wt(e,{recursive:!0}),e}function ue(e={}){let r=Mt(e.slotsDir??x()),t=e.staleMs??_,n=0;for(let i of or(r)){if(!i.endsWith(".json"))continue;let s=le.join(r,i),l=k(s);Bt(s,t),l&&!k(s)&&(n+=1)}return n}function Ut(e={}){let r=e.slotsDir??x(),t=e.staleMs??_;ue({slotsDir:r,staleMs:t});let n=[];for(let i of or(r)){if(!i.endsWith(".json"))continue;let s=ce(le.join(r,i));s&&!sr(s,t)&&n.push(s)}return n}function ae(e={}){return Ut(e).length}function S(e,r={}){if(F())return{admitted:!0,slotId:null,activeSlots:0,maxSlots:L(),reason:null};let t=r.slotsDir??x(),n=r.staleMs??_,i=r.maxSlots??L();ue({slotsDir:t,staleMs:n});for(let l=0;l<i;l+=1){let c=Kt(l),g=Wt(c,t),cr=ce(g);if(ar(g,n))try{ir(g)}catch{}else if(cr||k(g))continue;let ur={slotId:c,pid:process.pid,acquiredAt:new Date().toISOString(),command:e};try{let h=Pt(g,"wx");Dt(h,JSON.stringify(ur,null,2),"utf8"),At(h);let dr=ae({slotsDir:t,staleMs:n});return{admitted:!0,slotId:c,activeSlots:dr,maxSlots:i,reason:null}}catch(h){if(h.code==="EEXIST")continue;throw h}}let s=ae({slotsDir:t,staleMs:n});return{admitted:!1,slotId:null,activeSlots:s,maxSlots:i,reason:`heavy verification at capacity (${s}/${i} slots)`}}function H(e,r={}){if(F())return{admitted:!0,slotId:null,activeSlots:0,maxSlots:L(),reason:null};let t=r.slotsDir??x(),n=r.staleMs??_,i=r.maxSlots??L();ue({slotsDir:t,staleMs:n});let s=ae({slotsDir:t,staleMs:n}),l=s<i;return{admitted:l,slotId:null,activeSlots:s,maxSlots:i,reason:l?null:`heavy verification at capacity (${s}/${i} slots); waiting for ${e}`}}function Ft(e){e<=0||Lt(process.execPath,["-e",`const d=Date.now()+${Math.floor(e)};while(Date.now()<d);`],{stdio:"ignore"})}function lr(e,r,t=2e3,n={}){let i=Date.now()+Math.max(0,r),s=S(e,n);for(;!s.admitted&&Date.now()<i;)Ft(Math.min(t,i-Date.now())),s=S(e,n);return s}function Ht(e,r={}){let t=ie(e);if(!t.heavy)return{allowed:!0,outcome:"allowed",commandClass:t.commandClass,reason:"command does not require heavy-verification token",verificationGate:{...H(e),slotId:null}};if(F())return{allowed:!0,outcome:"heavy_verification_skipped",commandClass:t.commandClass,reason:"KYNVER_HEAVY_VERIFICATION_SKIP bypasses gate",verificationGate:{...H(e),slotId:null}};let n=r.waitMs??0,i=n>0?lr(e,n,r.pollMs):S(e);return i.admitted?{allowed:!0,outcome:"allowed",commandClass:t.commandClass,reason:t.reason??"heavy-verification token acquired",verificationGate:i}:{allowed:!1,outcome:M,commandClass:t.commandClass,reason:t.reason??i.reason??M,verificationGate:i}}export{p as DEFAULT_WORKER_PROVIDER,M as HEAVY_VERIFICATION_TOKEN_REQUIRED,j as KYNVER_NO_PROD_DB_CREDENTIALS_ENV,kr as auditReviewWorkerCredentialScope,br as auditWorkerEnv,f as buildWorkerSpawnEnv,ie as classifyHeavyShellCommand,Qe as enforceCursorWorkerProvider,Ht as gateWorkerShellCommand,u as isClaudeFamilyProvider,y as isForbiddenWorkerEnvKey,Ar as isHarnessExpertReviewWorker,fe as isNoProdCredentialReviewEnvironment,de as listForbiddenWorkerEnvKeys,me as listOperatorAllowedWorkerEnvKeys,Ze as normalizeWorkerProviderName,vt as preferCursorExecutor,yt as resolveConfiguredWorkerProvider,E as scrubWorkerEnv,oe as taskAllowsClaudeWorker,er as taskExpressesWorkerProviderPreference};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kynver-app/runtime",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.28",
|
|
4
4
|
"description": "Kynver AgentOS local execution runtime and CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -135,7 +135,9 @@
|
|
|
135
135
|
"dist/**",
|
|
136
136
|
"!dist/**/__tests__/**",
|
|
137
137
|
"!dist/**/*.map",
|
|
138
|
-
"README.md"
|
|
138
|
+
"README.md",
|
|
139
|
+
"!dist/**/*.d.ts",
|
|
140
|
+
"!dist/**/*.d.ts.map"
|
|
139
141
|
],
|
|
140
142
|
"scripts": {
|
|
141
143
|
"build": "esbuild src/cli.ts src/index.ts src/node-runtime-policy.ts src/local-run-store/index.ts src/worker-persona-catalog.ts src/instruction-bundle/contract.ts src/chat/command-auth-proof.ts src/server/monitor.ts src/server/landing.ts src/server/worker-policy.ts src/server/orchestration.ts src/server/adapter-contract.ts src/server/context-budget-receipt.ts src/server/prompt.ts src/server/node-runtime-policy.ts src/server/model-routing.ts src/server/db-credentials.ts src/server/heavy-verification.ts src/server/memory-cost.ts src/server/pr-evidence.ts src/server/default-repo.ts src/server/cleanup.ts src/server/repo-search.ts src/server/harness-notice.ts src/server/memory-cost-enforce.ts src/server/wsl-crash-dumps.ts --bundle --platform=node --format=esm --packages=external --outbase=src --outdir=dist --minify && tsc -p tsconfig.json --emitDeclarationOnly && node scripts/chmod-cli-bin.mjs",
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export interface ActiveHarnessWorkerRef {
|
|
2
|
-
runId: string;
|
|
3
|
-
workerName: string;
|
|
4
|
-
taskId: string;
|
|
5
|
-
pid?: number;
|
|
6
|
-
writeSetPrefixes?: string[];
|
|
7
|
-
ownedPaths?: string[];
|
|
8
|
-
allowConcurrentHotspot?: boolean;
|
|
9
|
-
}
|
|
10
|
-
/** Live harness workers in one run — matches dispatch-next occupancy reporting. */
|
|
11
|
-
export declare function collectRunActiveHarnessWorkers(runId: string): ActiveHarnessWorkerRef[];
|
package/dist/auto-complete.d.ts
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
export interface AutoCompleteArgs {
|
|
2
|
-
run: string;
|
|
3
|
-
name: string;
|
|
4
|
-
agentOsId?: string;
|
|
5
|
-
pollMs?: number;
|
|
6
|
-
maxTotalMs?: number;
|
|
7
|
-
completeAttempts?: number;
|
|
8
|
-
completeBackoffMs?: number;
|
|
9
|
-
baseUrl?: string;
|
|
10
|
-
secret?: string;
|
|
11
|
-
}
|
|
12
|
-
export interface AutoCompleteOutcome {
|
|
13
|
-
worker: string;
|
|
14
|
-
runId: string;
|
|
15
|
-
/** "completed" → finished + completion call returned ok. "blocked" → finished + completion replay refused (structural blocker set). "timed_out" → never finished within the cap. */
|
|
16
|
-
outcome: "completed" | "blocked" | "timed_out" | "missing_link";
|
|
17
|
-
httpStatus?: number;
|
|
18
|
-
attempts: number;
|
|
19
|
-
reason?: string;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Sidecar body: poll the worker until it finishes, then POST completion (with a
|
|
23
|
-
* small retry budget). Pure logic — the CLI just adapts `--`-args in/out.
|
|
24
|
-
*/
|
|
25
|
-
export declare function autoCompleteWorker(raw: Record<string, string | boolean>): Promise<AutoCompleteOutcome>;
|
|
26
|
-
/** CLI entry: write outcome JSON to stdout. Exit code 0 on completed/blocked (both record state); 1 on missing_link / timed_out. */
|
|
27
|
-
export declare function autoCompleteWorkerCli(raw: Record<string, string | boolean>): Promise<void>;
|
|
28
|
-
export interface SpawnSidecarOptions {
|
|
29
|
-
runId: string;
|
|
30
|
-
workerName: string;
|
|
31
|
-
workerDir: string;
|
|
32
|
-
/** Override the CLI script the sidecar invokes. Tests inject this. */
|
|
33
|
-
cliPath?: string;
|
|
34
|
-
/** Override the node executable. Tests inject this. */
|
|
35
|
-
nodeExecutable?: string;
|
|
36
|
-
/**
|
|
37
|
-
* Carry the agentOsId on the command line so the sidecar still resolves
|
|
38
|
-
* its callback target even if `worker.json` is rewritten/relocated.
|
|
39
|
-
*/
|
|
40
|
-
agentOsId?: string;
|
|
41
|
-
/**
|
|
42
|
-
* Pass-through for callers that want a non-default base URL/secret (e.g.
|
|
43
|
-
* tests or operator overrides). Production reads them from env.
|
|
44
|
-
*/
|
|
45
|
-
baseUrl?: string;
|
|
46
|
-
secret?: string;
|
|
47
|
-
}
|
|
48
|
-
export interface SpawnedSidecar {
|
|
49
|
-
pid?: number;
|
|
50
|
-
logPath: string;
|
|
51
|
-
cliPath: string;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Detach a per-worker completion sidecar that owns the worker's
|
|
55
|
-
* finalResult → AgentTask attribution. Returns the spawned pid (or undefined if
|
|
56
|
-
* `dryRun`). Failures here MUST NOT crash `worker start`: the worker is already
|
|
57
|
-
* running; missing the sidecar just means a daemon/watchdog has to replay
|
|
58
|
-
* completion later.
|
|
59
|
-
*/
|
|
60
|
-
export declare function spawnCompletionSidecar(opts: SpawnSidecarOptions): SpawnedSidecar | undefined;
|
package/dist/bootstrap.d.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
interface PrimaryAgentOs {
|
|
2
|
-
id: string;
|
|
3
|
-
slug: string;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* Workspace resolution outcome, discriminated so the CLI can tell "your
|
|
7
|
-
* account is not approved for Agentic OS" (HTTP 401/403 — a human/approval
|
|
8
|
-
* problem) apart from "the network/server is unhappy" (a retry problem).
|
|
9
|
-
*/
|
|
10
|
-
export type PrimaryAgentOsResult = {
|
|
11
|
-
ok: true;
|
|
12
|
-
primary: PrimaryAgentOs;
|
|
13
|
-
} | {
|
|
14
|
-
ok: false;
|
|
15
|
-
kind: "access_denied";
|
|
16
|
-
status: number;
|
|
17
|
-
} | {
|
|
18
|
-
ok: false;
|
|
19
|
-
kind: "no_workspace";
|
|
20
|
-
status: number;
|
|
21
|
-
} | {
|
|
22
|
-
ok: false;
|
|
23
|
-
kind: "server_error";
|
|
24
|
-
status: number;
|
|
25
|
-
} | {
|
|
26
|
-
ok: false;
|
|
27
|
-
kind: "network";
|
|
28
|
-
detail: string;
|
|
29
|
-
};
|
|
30
|
-
/** Where a gated account requests Agentic OS access (admin-approved). */
|
|
31
|
-
export declare function agentOsAccessRequestUrl(base?: string): string;
|
|
32
|
-
/**
|
|
33
|
-
* The access-gated message: Agentic OS access is admin-approved, so a 401/403
|
|
34
|
-
* here is not a bug on the user's box — it means the account needs approval.
|
|
35
|
-
*/
|
|
36
|
-
export declare function formatAgentOsAccessGatedMessage(base?: string): string;
|
|
37
|
-
/** The retry-oriented message for network/transport failures (not an access problem). */
|
|
38
|
-
export declare function formatBootstrapNetworkErrorMessage(base: string, detail: string): string;
|
|
39
|
-
/** Resolve the account's primary AgentOS workspace (id + slug) via GET /api/agent-os. */
|
|
40
|
-
export declare function fetchPrimaryAgentOs(base: string, apiKey: string, fetchImpl?: typeof fetch): Promise<PrimaryAgentOsResult>;
|
|
41
|
-
/**
|
|
42
|
-
* Classify a runner-credential mint failure by its error message.
|
|
43
|
-
* `fetchRunnerCredential` embeds the HTTP status as `(NNN)`; 401/403 mean the
|
|
44
|
-
* account/workspace is gated or the key was revoked — an approval problem the
|
|
45
|
-
* early-access page solves, not something a retry fixes.
|
|
46
|
-
*/
|
|
47
|
-
export declare function classifyRunnerCredentialMintError(message: string): "access_denied" | "transient";
|
|
48
|
-
export declare function runBootstrap(args: Record<string, string | boolean>): Promise<void>;
|
|
49
|
-
export {};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
export interface BuildAdmissionConfig {
|
|
2
|
-
perBuildBudgetBytes: number;
|
|
3
|
-
reserveBytes: number;
|
|
4
|
-
}
|
|
5
|
-
export interface BuildAdmissionVerdict {
|
|
6
|
-
admitted: boolean;
|
|
7
|
-
memAvailableBytes: number;
|
|
8
|
-
requiredBytes: number;
|
|
9
|
-
activeBuilds: number;
|
|
10
|
-
reason: string | null;
|
|
11
|
-
}
|
|
12
|
-
export declare function resolveBuildAdmissionConfig(config?: import("../config.js").KynverUserConfig): BuildAdmissionConfig;
|
|
13
|
-
export declare function getActiveBuildCount(): number;
|
|
14
|
-
/** Reset active build counter (tests). */
|
|
15
|
-
export declare function resetActiveBuildCountForTests(): void;
|
|
16
|
-
export declare function registerBuildStart(): void;
|
|
17
|
-
export declare function registerBuildEnd(): void;
|
|
18
|
-
/**
|
|
19
|
-
* RAM-aware admission: start another worktree build only when MemAvailable ≥
|
|
20
|
-
* per-build budget + reserve. Cross-process serialization is enforced separately
|
|
21
|
-
* by the heavy-verification gate before this check runs.
|
|
22
|
-
*/
|
|
23
|
-
export declare function assessBuildAdmission(opts?: Partial<BuildAdmissionConfig> & {
|
|
24
|
-
memAvailableBytes?: number;
|
|
25
|
-
}): BuildAdmissionVerdict;
|
|
26
|
-
export declare function sleepMs(ms: number): void;
|
|
27
|
-
/** Poll admission until admitted or timeout (ms). Returns last verdict. */
|
|
28
|
-
export declare function waitForBuildAdmission(timeoutMs: number, pollMs?: number, opts?: Partial<BuildAdmissionConfig> & {
|
|
29
|
-
memAvailableBytes?: () => number;
|
|
30
|
-
}): BuildAdmissionVerdict;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/** Per-build RAM budget for admission (aligns with Hermes autopipeline worker sizing). */
|
|
2
|
-
export declare const DEFAULT_BUILD_MEM_BUDGET_BYTES: number;
|
|
3
|
-
/** Headroom reserved for OS / gateway before admitting another build. */
|
|
4
|
-
export declare const DEFAULT_BUILD_MEM_RESERVE_BYTES: number;
|
|
5
|
-
/** Node heap cap for npm/tsc build/check subprocesses unless overridden. */
|
|
6
|
-
export declare const DEFAULT_NODE_OLD_SPACE_SIZE_MB = 1024;
|
|
7
|
-
/** systemd scope MemoryMax for build/check subprocesses. */
|
|
8
|
-
export declare const DEFAULT_SYSTEMD_MEMORY_MAX = "1.5G";
|
|
9
|
-
/** systemd scope MemorySwapMax for build/check subprocesses. */
|
|
10
|
-
export declare const DEFAULT_SYSTEMD_MEMORY_SWAP_MAX = "2G";
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { type HeavyVerificationGateVerdict, type WorkerCommandGateOutcome } from "../heavy-verification/index.js";
|
|
2
|
-
import { type BuildAdmissionVerdict } from "./admission.js";
|
|
3
|
-
export declare function isSystemdScopeError(stderr: string): boolean;
|
|
4
|
-
export interface BoundedBuildExecResult {
|
|
5
|
-
ok: boolean;
|
|
6
|
-
exitCode: number;
|
|
7
|
-
stdout: string;
|
|
8
|
-
stderr: string;
|
|
9
|
-
admitted: boolean;
|
|
10
|
-
wrappedWithSystemd: boolean;
|
|
11
|
-
/** True when systemd scope creation failed and the command was retried via plain shell. */
|
|
12
|
-
systemdScopeFallback?: boolean;
|
|
13
|
-
nodeOptionsFlag: string;
|
|
14
|
-
admission: BuildAdmissionVerdict;
|
|
15
|
-
/** Cross-process heavy-verification lease (typecheck/build throttle). */
|
|
16
|
-
verificationGate: HeavyVerificationGateVerdict;
|
|
17
|
-
/** Typed M2 gate outcome when a heavy command is refused or bypassed. */
|
|
18
|
-
gateOutcome?: WorkerCommandGateOutcome;
|
|
19
|
-
command: string;
|
|
20
|
-
}
|
|
21
|
-
export interface RunBoundedBuildCheckInput {
|
|
22
|
-
cwd: string;
|
|
23
|
-
/** Shell command line (e.g. `npm run typecheck`). */
|
|
24
|
-
command: string;
|
|
25
|
-
env?: NodeJS.ProcessEnv;
|
|
26
|
-
/** Max ms to wait for RAM admission (0 = fail fast). Default 600_000. */
|
|
27
|
-
waitForAdmissionMs?: number;
|
|
28
|
-
timeoutMs?: number;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Run an expensive build/check command with a cross-process heavy-verification
|
|
32
|
-
* lease, NODE_OPTIONS heap cap, optional systemd-run memory scope, and
|
|
33
|
-
* RAM-aware admission.
|
|
34
|
-
*/
|
|
35
|
-
export declare function runBoundedBuildCheck(input: RunBoundedBuildCheckInput): BoundedBuildExecResult;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { DEFAULT_BUILD_MEM_BUDGET_BYTES, DEFAULT_BUILD_MEM_RESERVE_BYTES, DEFAULT_NODE_OLD_SPACE_SIZE_MB, DEFAULT_SYSTEMD_MEMORY_MAX, DEFAULT_SYSTEMD_MEMORY_SWAP_MAX, } from "./constants.js";
|
|
2
|
-
export { readMemAvailableBytes } from "./meminfo.js";
|
|
3
|
-
export { formatNodeOptionsFlag, mergeNodeOptionsForBuildCheck, resolveNodeOldSpaceSizeMb, } from "./node-options.js";
|
|
4
|
-
export { buildSystemdRunArgv, isSystemdRunAvailable, type SystemdWrapOptions, } from "./systemd-wrap.js";
|
|
5
|
-
export { assessBuildAdmission, getActiveBuildCount, registerBuildEnd, registerBuildStart, resetActiveBuildCountForTests, resolveBuildAdmissionConfig, waitForBuildAdmission, type BuildAdmissionConfig, type BuildAdmissionVerdict, } from "./admission.js";
|
|
6
|
-
export { runBoundedBuildCheck, isSystemdScopeError, type BoundedBuildExecResult, type RunBoundedBuildCheckInput } from "./exec.js";
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/** Resolved Node old-space cap in MiB (env override, else default 1024). */
|
|
2
|
-
export declare function resolveNodeOldSpaceSizeMb(): number;
|
|
3
|
-
/**
|
|
4
|
-
* Merge NODE_OPTIONS for build/check subprocesses: set --max-old-space-size unless
|
|
5
|
-
* the caller already set one in NODE_OPTIONS or KYNVER_NODE_OLD_SPACE_SIZE_MB=0
|
|
6
|
-
* disables injection.
|
|
7
|
-
*/
|
|
8
|
-
export declare function mergeNodeOptionsForBuildCheck(baseEnv?: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
|
|
9
|
-
export declare function formatNodeOptionsFlag(mb?: number): string;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export interface SystemdWrapOptions {
|
|
2
|
-
memoryMax?: string;
|
|
3
|
-
memorySwapMax?: string;
|
|
4
|
-
cwd?: string;
|
|
5
|
-
/** argv after `--` (no shell). */
|
|
6
|
-
command: string[];
|
|
7
|
-
env?: NodeJS.ProcessEnv;
|
|
8
|
-
}
|
|
9
|
-
/** Clear cached systemd probe (tests). */
|
|
10
|
-
export declare function resetSystemdAvailabilityCacheForTests(): void;
|
|
11
|
-
/** True when `systemd-run --version` succeeds (Linux hosts with systemd). */
|
|
12
|
-
export declare function isSystemdRunAvailable(): boolean;
|
|
13
|
-
/**
|
|
14
|
-
* Build argv for `systemd-run --scope` with memory properties, then `-- command…`.
|
|
15
|
-
* Does not execute the command.
|
|
16
|
-
*/
|
|
17
|
-
export declare function buildSystemdRunArgv(opts: SystemdWrapOptions): string[];
|
package/dist/box-identity.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { KynverUserConfig } from "./config.js";
|
|
2
|
-
export type WorkerPoolBoxKind = "ghost" | "forge";
|
|
3
|
-
export type BoxKindSource = "config" | "env" | "default";
|
|
4
|
-
export interface ResolvedBoxIdentity {
|
|
5
|
-
boxKind: WorkerPoolBoxKind;
|
|
6
|
-
source: BoxKindSource;
|
|
7
|
-
/** True when identity would have been inferred from KYNVER_AGENT_OS_SLUG without an explicit box kind. */
|
|
8
|
-
slugInferenceBlocked: boolean;
|
|
9
|
-
warnings: string[];
|
|
10
|
-
}
|
|
11
|
-
/** Normalize host/box labels to ghost | forge for worker-pool attribution. */
|
|
12
|
-
export declare function normalizeWorkerPoolBoxKind(raw: string | null | undefined): WorkerPoolBoxKind;
|
|
13
|
-
/**
|
|
14
|
-
* Resolve physical box identity for capacity snapshots and daemon policy.
|
|
15
|
-
* Never maps AgentOS workspace slug alone to box kind — Forge installs must set
|
|
16
|
-
* `boxKind` in ~/.kynver/config.json or `KYNVER_BOX_KIND`.
|
|
17
|
-
*/
|
|
18
|
-
export declare function resolveBoxIdentity(env?: NodeJS.ProcessEnv, config?: Pick<KynverUserConfig, "boxKind" | "boxId">): ResolvedBoxIdentity;
|
|
19
|
-
export declare function resolveBoxKindFromConfig(config?: Pick<KynverUserConfig, "boxKind" | "boxId">, env?: NodeJS.ProcessEnv): WorkerPoolBoxKind;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { KynverUserConfig } from "./config.js";
|
|
2
|
-
export { normalizeWorkerPoolBoxKind, resolveBoxIdentity } from "./box-identity.js";
|
|
3
|
-
/** @deprecated Prefer resolveBoxIdentity — kept for callers that only need the kind string. */
|
|
4
|
-
export declare function resolveBoxKindFromEnv(env?: NodeJS.ProcessEnv): string;
|
|
5
|
-
export declare function defaultBoxId(boxKind: string, hostLabel?: string | null): string;
|
|
6
|
-
export declare function normalizeConfiguredBoxId(raw: string, boxKind: string): string;
|
|
7
|
-
export declare function resolveConfiguredBoxId(input: {
|
|
8
|
-
boxKind: string;
|
|
9
|
-
hostLabel?: string | null;
|
|
10
|
-
explicitBoxId?: string | null;
|
|
11
|
-
config?: Pick<KynverUserConfig, "boxId"> | null;
|
|
12
|
-
env?: NodeJS.ProcessEnv;
|
|
13
|
-
}): string;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import type { RunnerResourceGateShape } from "./resource-gate.js";
|
|
2
|
-
export interface RuntimeBoxResourceSnapshot {
|
|
3
|
-
boxId: string;
|
|
4
|
-
boxKind: string;
|
|
5
|
-
displayName?: string | null;
|
|
6
|
-
hostLabel?: string | null;
|
|
7
|
-
observedAt: string;
|
|
8
|
-
totalMemBytes: number;
|
|
9
|
-
freeMemBytes: number;
|
|
10
|
-
activeWorkers: number;
|
|
11
|
-
maxConcurrentWorkers: number;
|
|
12
|
-
autoCap: number;
|
|
13
|
-
slotsAvailable: number;
|
|
14
|
-
harnessRunId?: string | null;
|
|
15
|
-
queuedTasks?: number | null;
|
|
16
|
-
reason?: string | null;
|
|
17
|
-
prEvidence?: RuntimeBoxResourceSnapshotPrEvidence[];
|
|
18
|
-
}
|
|
19
|
-
export interface RuntimeBoxResourceSnapshotPrEvidence {
|
|
20
|
-
prUrl: string;
|
|
21
|
-
headSha?: string | null;
|
|
22
|
-
mergeable?: string | null;
|
|
23
|
-
observedAt: string;
|
|
24
|
-
source: "heartbeat" | "operator_tick" | "completion" | "handoff";
|
|
25
|
-
}
|
|
26
|
-
export declare function buildBoxResourceSnapshotFromGate(gate: RunnerResourceGateShape, input?: {
|
|
27
|
-
boxKind?: string | null;
|
|
28
|
-
boxId?: string | null;
|
|
29
|
-
displayName?: string | null;
|
|
30
|
-
hostLabel?: string | null;
|
|
31
|
-
harnessRunId?: string | null;
|
|
32
|
-
queuedTasks?: number | null;
|
|
33
|
-
prEvidence?: RuntimeBoxResourceSnapshotPrEvidence[];
|
|
34
|
-
observedAt?: string;
|
|
35
|
-
}): RuntimeBoxResourceSnapshot;
|
|
36
|
-
export interface HeartbeatLineInput {
|
|
37
|
-
ts?: string;
|
|
38
|
-
phase: string;
|
|
39
|
-
summary: string;
|
|
40
|
-
changedFiles?: string[];
|
|
41
|
-
blocker?: string | null;
|
|
42
|
-
boxResourceSnapshot?: RuntimeBoxResourceSnapshot;
|
|
43
|
-
prEvidence?: RuntimeBoxResourceSnapshotPrEvidence[];
|
|
44
|
-
}
|
|
45
|
-
export declare function formatHeartbeatLine(input: HeartbeatLineInput): string;
|
package/dist/box-worker-cap.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { WorkerPoolBoxKind } from "./box-identity.js";
|
|
2
|
-
/** Hermes Forge pool cap — independent of Ghost workspace preference or aggregate totals. */
|
|
3
|
-
export declare const FORGE_POOL_MAX_WORKERS = 4;
|
|
4
|
-
/** Ghost/OpenClaw default when setup auto-sizes (workspace may override higher). */
|
|
5
|
-
export declare const GHOST_POOL_DEFAULT_MAX_WORKERS = 8;
|
|
6
|
-
export declare function defaultMaxWorkersForBoxKind(boxKind: WorkerPoolBoxKind, autoCap: number): number;
|
|
7
|
-
export declare function clampMaxWorkersForBoxKind(boxKind: WorkerPoolBoxKind, maxWorkers: number): number;
|
|
8
|
-
/** True when a persisted Forge cap looks like a Ghost/aggregate inheritance (e.g. 8 or 12). */
|
|
9
|
-
export declare function forgeCapLooksMisInherited(boxKind: WorkerPoolBoxKind, maxWorkers: number): boolean;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* BYOC M0.6 — context hydration.
|
|
3
|
-
*
|
|
4
|
-
* Takes a validated job envelope (jobId + agentOsId + taskId) and resolves
|
|
5
|
-
* the local config needed to run the job: repo path, worktree base, API URL.
|
|
6
|
-
*
|
|
7
|
-
* Pure: reads env/config but makes no network calls and writes nothing.
|
|
8
|
-
* Fail-closed: any missing required field returns a typed error code.
|
|
9
|
-
* No secrets in the returned object.
|
|
10
|
-
*/
|
|
11
|
-
import type { LocalCodexJobEnvelope } from "./job-envelope.js";
|
|
12
|
-
export interface HydratedJobContext {
|
|
13
|
-
/** From the job envelope — unchanged. */
|
|
14
|
-
jobId: string;
|
|
15
|
-
agentOsId: string;
|
|
16
|
-
taskId: string;
|
|
17
|
-
/** Absolute path to the default repo on this host. null when not configured. */
|
|
18
|
-
repoPath: string | null;
|
|
19
|
-
/** Absolute path where worktrees for this job will be created. null = unresolved. */
|
|
20
|
-
worktreeBase: string | null;
|
|
21
|
-
/** Kynver API base URL (no trailing slash). */
|
|
22
|
-
apiBaseUrl: string;
|
|
23
|
-
/** ISO timestamp when hydration ran. */
|
|
24
|
-
hydratedAt: string;
|
|
25
|
-
}
|
|
26
|
-
export type ContextHydrationErrorCode =
|
|
27
|
-
/** No API base URL in env or config. */
|
|
28
|
-
"missing_api_base_url"
|
|
29
|
-
/** Workspace ID in envelope does not match locally configured agentOsId. */
|
|
30
|
-
| "workspace_mismatch";
|
|
31
|
-
export type ContextHydrationResult = {
|
|
32
|
-
ok: true;
|
|
33
|
-
context: HydratedJobContext;
|
|
34
|
-
} | {
|
|
35
|
-
ok: false;
|
|
36
|
-
code: ContextHydrationErrorCode;
|
|
37
|
-
detail: string;
|
|
38
|
-
};
|
|
39
|
-
export interface ContextHydrationOptions {
|
|
40
|
-
env?: NodeJS.ProcessEnv;
|
|
41
|
-
nowMs?: number;
|
|
42
|
-
/** Override config values for tests. */
|
|
43
|
-
config?: {
|
|
44
|
-
agentOsId?: string;
|
|
45
|
-
defaultRepo?: string;
|
|
46
|
-
harnessRoot?: string;
|
|
47
|
-
apiBaseUrl?: string;
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Hydrate a validated job envelope with local runner config.
|
|
52
|
-
* Call after `validateJobEnvelope` and `verifyLocalCodexGoldenPath` pass.
|
|
53
|
-
*/
|
|
54
|
-
export declare function hydrateJobContext(envelope: LocalCodexJobEnvelope, options?: ContextHydrationOptions): ContextHydrationResult;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* BYOC M0.6 — execution readiness proof.
|
|
3
|
-
*
|
|
4
|
-
* Verifies that the local Codex execution plane and target repo are accessible
|
|
5
|
-
* enough to run a task. Does NOT spawn a Codex process — it probes fs
|
|
6
|
-
* accessibility and binary location only.
|
|
7
|
-
*
|
|
8
|
-
* Fail-closed on unexpected errors; returns a typed result, never throws.
|
|
9
|
-
* No secrets in the returned object.
|
|
10
|
-
*/
|
|
11
|
-
import type { HydratedJobContext } from "./context-hydration.js";
|
|
12
|
-
import type { CodexOrchestrationPath } from "../orchestration-providers/codex-orchestration-adapter.js";
|
|
13
|
-
import { resolveCodexOrchestrationAdapter } from "../orchestration-providers/codex-orchestration-adapter.js";
|
|
14
|
-
export interface ExecutionProofResult {
|
|
15
|
-
/** Whether a Codex binary or Hermes OpenAI-Codex path was resolved on this host. */
|
|
16
|
-
codexReachable: boolean;
|
|
17
|
-
/** Which orchestration path was resolved (codex_cli | hermes_openai_codex | none). */
|
|
18
|
-
codexPath: CodexOrchestrationPath;
|
|
19
|
-
/** Absolute path to the codex binary, or null when using Hermes or unavailable. */
|
|
20
|
-
codexBinaryPath: string | null;
|
|
21
|
-
/** Whether the configured repo path exists on disk. */
|
|
22
|
-
repoAccessible: boolean;
|
|
23
|
-
/** Absolute repo path that was probed, or null when not configured. */
|
|
24
|
-
repoPath: string | null;
|
|
25
|
-
/** Whether a worktree base directory exists and is accessible. */
|
|
26
|
-
worktreeBaseAccessible: boolean;
|
|
27
|
-
/** Absolute worktree base path that was probed, or null when not configured. */
|
|
28
|
-
worktreeBase: string | null;
|
|
29
|
-
/** ISO timestamp when the proof ran. */
|
|
30
|
-
probedAt: string;
|
|
31
|
-
/** Wall-clock probe duration. */
|
|
32
|
-
durationMs: number;
|
|
33
|
-
/** First error encountered, or null on full pass. */
|
|
34
|
-
error: string | null;
|
|
35
|
-
}
|
|
36
|
-
export interface ExecutionProofOptions {
|
|
37
|
-
env?: NodeJS.ProcessEnv;
|
|
38
|
-
nowMs?: number;
|
|
39
|
-
/** Injectable codex adapter for tests. */
|
|
40
|
-
codexAdapter?: ReturnType<typeof resolveCodexOrchestrationAdapter>;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Probe execution readiness for the given hydrated job context.
|
|
44
|
-
* All checks are local — no network calls.
|
|
45
|
-
*/
|
|
46
|
-
export declare function probeExecutionReadiness(context: HydratedJobContext, options?: ExecutionProofOptions): ExecutionProofResult;
|
package/dist/byoc/index.d.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Local Codex job envelope — the typed payload Kynver cloud sends to the
|
|
3
|
-
* user's local runner for BYO-compute execution. Contains no secrets.
|
|
4
|
-
*
|
|
5
|
-
* The envelope is opaque to the cloud after dispatch; the local runner
|
|
6
|
-
* validates it against local state (workspace, runner identity, expiry,
|
|
7
|
-
* tool policy) before spawning a Codex worker.
|
|
8
|
-
*/
|
|
9
|
-
export interface LocalCodexJobToolPolicy {
|
|
10
|
-
/** Toolsets the local Codex agent may activate (e.g. ["hermes-cli"]). */
|
|
11
|
-
allowedToolsets: string[];
|
|
12
|
-
/** Whether privileged platform actions (DB writes, deploy, secrets) are permitted. */
|
|
13
|
-
allowPrivilegedPlatformActions: boolean;
|
|
14
|
-
}
|
|
15
|
-
/** Envelope from the Kynver control plane. Never contains secrets or tokens. */
|
|
16
|
-
export interface LocalCodexJobEnvelope {
|
|
17
|
-
jobId: string;
|
|
18
|
-
agentOsId: string;
|
|
19
|
-
taskId: string;
|
|
20
|
-
issuedAt: string;
|
|
21
|
-
expiresAt: string;
|
|
22
|
-
toolPolicy: LocalCodexJobToolPolicy;
|
|
23
|
-
/** Optional runner identity hint — reject if present and mismatched. */
|
|
24
|
-
runnerIdHint?: string | null;
|
|
25
|
-
}
|
|
26
|
-
export type JobEnvelopeValidationError = "missing_job_id" | "missing_agent_os_id" | "missing_task_id" | "missing_issued_at" | "missing_expires_at" | "missing_tool_policy" | "malformed_dates" | "job_expired";
|
|
27
|
-
export type JobEnvelopeValidationResult = {
|
|
28
|
-
ok: true;
|
|
29
|
-
envelope: LocalCodexJobEnvelope;
|
|
30
|
-
} | {
|
|
31
|
-
ok: false;
|
|
32
|
-
code: JobEnvelopeValidationError;
|
|
33
|
-
detail: string;
|
|
34
|
-
};
|
|
35
|
-
/**
|
|
36
|
-
* Validate an envelope from the cloud. Fail closed on any structural or
|
|
37
|
-
* temporal problem — never return partially-valid state.
|
|
38
|
-
*/
|
|
39
|
-
export declare function validateJobEnvelope(input: unknown, nowMs?: number): JobEnvelopeValidationResult;
|