@kici-dev/orchestrator 0.0.0 → 0.1.2
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/LICENSE +661 -0
- package/README.md +1 -6
- package/dist/__test-helpers__/mock-db.d.ts +103 -0
- package/dist/__test-helpers__/mock-ws.d.ts +13 -0
- package/dist/agent/dispatcher.d.ts +231 -0
- package/dist/agent/ownership-tracker.d.ts +46 -0
- package/dist/agent/registry.d.ts +255 -0
- package/dist/agent/token-store.d.ts +96 -0
- package/dist/app.d.ts +234 -0
- package/dist/audit/access-log.d.ts +92 -0
- package/dist/audit/sampling-rate-limiter.d.ts +41 -0
- package/dist/cache/build-coordinator.d.ts +42 -0
- package/dist/cache/dep-cache.d.ts +51 -0
- package/dist/cache/index.d.ts +16 -0
- package/dist/cache/pending-builds.d.ts +14 -0
- package/dist/cache/pending-dynamics.d.ts +15 -0
- package/dist/cache/pending-inits.d.ts +19 -0
- package/dist/cache/pending-tracker.d.ts +65 -0
- package/dist/cache/source-cache.d.ts +30 -0
- package/dist/cli/api-client.d.ts +411 -0
- package/dist/cli/commands/access-log.d.ts +30 -0
- package/dist/cli/commands/agent-service/index.d.ts +15 -0
- package/dist/cli/commands/agent-service/install.d.ts +9 -0
- package/dist/cli/commands/agent-service/logs.d.ts +9 -0
- package/dist/cli/commands/agent-service/restart.d.ts +8 -0
- package/dist/cli/commands/agent-service/start.d.ts +8 -0
- package/dist/cli/commands/agent-service/status.d.ts +10 -0
- package/dist/cli/commands/agent-service/stop.d.ts +8 -0
- package/dist/cli/commands/agent-service/uninstall.d.ts +9 -0
- package/dist/cli/commands/agent-service/upgrade.d.ts +11 -0
- package/dist/cli/commands/agent.d.ts +10 -0
- package/dist/cli/commands/api-key.d.ts +12 -0
- package/dist/cli/commands/audit.d.ts +9 -0
- package/dist/cli/commands/backend.d.ts +17 -0
- package/dist/cli/commands/cold-store-impl.d.ts +101 -0
- package/dist/cli/commands/cold-store.d.ts +30 -0
- package/dist/cli/commands/config.d.ts +16 -0
- package/dist/cli/commands/db.d.ts +19 -0
- package/dist/cli/commands/debug-bundle.d.ts +16 -0
- package/dist/cli/commands/diagnose.d.ts +15 -0
- package/dist/cli/commands/environment.d.ts +24 -0
- package/dist/cli/commands/event-dlq.d.ts +19 -0
- package/dist/cli/commands/event-log.d.ts +27 -0
- package/dist/cli/commands/event.d.ts +4 -0
- package/dist/cli/commands/execution.d.ts +17 -0
- package/dist/cli/commands/inspect-bundle.d.ts +16 -0
- package/dist/cli/commands/maintenance.d.ts +4 -0
- package/dist/cli/commands/orchestrator-service/index.d.ts +12 -0
- package/dist/cli/commands/orchestrator-service/install.d.ts +10 -0
- package/dist/cli/commands/orchestrator-service/logs.d.ts +10 -0
- package/dist/cli/commands/orchestrator-service/restart.d.ts +8 -0
- package/dist/cli/commands/orchestrator-service/start.d.ts +8 -0
- package/dist/cli/commands/orchestrator-service/status.d.ts +10 -0
- package/dist/cli/commands/orchestrator-service/stop.d.ts +8 -0
- package/dist/cli/commands/orchestrator-service/uninstall.d.ts +9 -0
- package/dist/cli/commands/orchestrator-service/upgrade.d.ts +12 -0
- package/dist/cli/commands/org-settings.d.ts +17 -0
- package/dist/cli/commands/peer.d.ts +13 -0
- package/dist/cli/commands/queue.d.ts +16 -0
- package/dist/cli/commands/registration.d.ts +18 -0
- package/dist/cli/commands/rotate.d.ts +9 -0
- package/dist/cli/commands/runs.d.ts +34 -0
- package/dist/cli/commands/secret.d.ts +12 -0
- package/dist/cli/commands/shared/db.d.ts +16 -0
- package/dist/cli/commands/shared/versioned-upgrade.d.ts +38 -0
- package/dist/cli/commands/source.d.ts +24 -0
- package/dist/cli/commands/token.d.ts +10 -0
- package/dist/cli/commands/workflow.d.ts +31 -0
- package/dist/cli/join.d.ts +14 -0
- package/dist/cli/kici-admin.d.ts +13 -0
- package/dist/cli/lazy-deps/cache.d.ts +17 -0
- package/dist/cli/lazy-deps/downloader.d.ts +33 -0
- package/dist/cli/lazy-deps/registry.d.ts +43 -0
- package/dist/cli/service/compose.d.ts +25 -0
- package/dist/cli/service/index.d.ts +24 -0
- package/dist/cli/service/launchd.d.ts +34 -0
- package/dist/cli/service/platform-detect.d.ts +59 -0
- package/dist/cli/service/systemd.d.ts +41 -0
- package/dist/cli/service/types.d.ts +91 -0
- package/dist/cli/service/windows.d.ts +20 -0
- package/dist/cli/wizard/agent-wizard.d.ts +24 -0
- package/dist/cli/wizard/orchestrator-wizard.d.ts +38 -0
- package/dist/cli/wizard/prompts.d.ts +23 -0
- package/dist/cli.js +11435 -0
- package/dist/cluster/cluster-identity.d.ts +59 -0
- package/dist/cluster/coordinator.d.ts +204 -0
- package/dist/cluster/health-api.d.ts +30 -0
- package/dist/cluster/index.d.ts +24 -0
- package/dist/cluster/join-client.d.ts +75 -0
- package/dist/cluster/join-handler.d.ts +58 -0
- package/dist/cluster/join-token.d.ts +94 -0
- package/dist/cluster/orphan-recovery.d.ts +67 -0
- package/dist/cluster/peer-client.d.ts +190 -0
- package/dist/cluster/peer-credentials.d.ts +108 -0
- package/dist/cluster/peer-crypto.d.ts +57 -0
- package/dist/cluster/peer-handler.d.ts +97 -0
- package/dist/cluster/peer-registry.d.ts +186 -0
- package/dist/cluster/raft-state.d.ts +36 -0
- package/dist/cluster/raft.d.ts +140 -0
- package/dist/cold-store/load-access-log-range.d.ts +73 -0
- package/dist/cold-store/load-event-log-range.d.ts +62 -0
- package/dist/cold-store/load-secret-audit-log-range.d.ts +38 -0
- package/dist/cold-store/orchestrator-cold-store.d.ts +58 -0
- package/dist/cold-store/tables/access-log.d.ts +80 -0
- package/dist/cold-store/tables/event-log.d.ts +70 -0
- package/dist/cold-store/tables/execution-jobs.d.ts +63 -0
- package/dist/cold-store/tables/execution-runs.d.ts +81 -0
- package/dist/cold-store/tables/execution-steps.d.ts +65 -0
- package/dist/cold-store/tables/secret-audit-log.d.ts +77 -0
- package/dist/concurrency/dispatch-next-queued.d.ts +63 -0
- package/dist/concurrency/group-tracker.d.ts +51 -0
- package/dist/concurrency/index.d.ts +3 -0
- package/dist/concurrency/queue-manager.d.ts +68 -0
- package/dist/concurrency/waiters.d.ts +58 -0
- package/dist/config/encryption.d.ts +82 -0
- package/dist/config/env-overlay.d.ts +45 -0
- package/dist/config/index.d.ts +16 -0
- package/dist/config/loader.d.ts +26 -0
- package/dist/config/reload.d.ts +113 -0
- package/dist/config/resolver.d.ts +47 -0
- package/dist/config/schema.d.ts +210 -0
- package/dist/config/shared-store.d.ts +142 -0
- package/dist/config/types.d.ts +218 -0
- package/dist/config.d.ts +249 -0
- package/dist/cron/cron-scheduler.d.ts +78 -0
- package/dist/cron/cron-store.d.ts +38 -0
- package/dist/dashboard/handler.d.ts +243 -0
- package/dist/db/client.d.ts +13 -0
- package/dist/db/migration-provider.d.ts +9 -0
- package/dist/db/migrations/001_initial.d.ts +8 -0
- package/dist/db/migrations/002_config_versions_key_version.d.ts +16 -0
- package/dist/db/migrations/003_access_log.d.ts +26 -0
- package/dist/db/migrations/004_rename_bundle_to_source.d.ts +19 -0
- package/dist/db/migrations/005_cold_store_chunk_counter.d.ts +19 -0
- package/dist/db/migrations/006_runs_jobs_steps_archived_at.d.ts +38 -0
- package/dist/db/migrations/007_audit_logs_archived_at.d.ts +42 -0
- package/dist/db/migrations/008_event_log_archived_at.d.ts +40 -0
- package/dist/db/migrations/009_access_log_trigram.d.ts +15 -0
- package/dist/db/migrations/010_cold_store_chunks.d.ts +34 -0
- package/dist/db/migrations/011_drop_source_secrets_notify.d.ts +21 -0
- package/dist/db/migrations/012_peer_credentials_active_uniq.d.ts +28 -0
- package/dist/db/migrations/013_execution_log_bytes.d.ts +21 -0
- package/dist/db/migrations/014_kici_events_lease_retry.d.ts +36 -0
- package/dist/db/migrations/015_org_settings_customer_scoped.d.ts +30 -0
- package/dist/db/migrations/016_org_settings_allow_http_npm.d.ts +15 -0
- package/dist/db/migrations/017_org_id_widen.d.ts +4 -0
- package/dist/db/migrations/018_org_id_prefix_backfill.d.ts +4 -0
- package/dist/db/migrator.d.ts +32 -0
- package/dist/db/types.d.ts +1266 -0
- package/dist/diagnostics/bundle-reader.d.ts +48 -0
- package/dist/diagnostics/bundle-writer.d.ts +57 -0
- package/dist/diagnostics/checks/agents.d.ts +10 -0
- package/dist/diagnostics/checks/certs.d.ts +9 -0
- package/dist/diagnostics/checks/config.d.ts +10 -0
- package/dist/diagnostics/checks/db.d.ts +9 -0
- package/dist/diagnostics/checks/disk.d.ts +9 -0
- package/dist/diagnostics/checks/index.d.ts +17 -0
- package/dist/diagnostics/checks/ws.d.ts +9 -0
- package/dist/diagnostics/index.d.ts +13 -0
- package/dist/diagnostics/runner.d.ts +23 -0
- package/dist/diagnostics/types.d.ts +38 -0
- package/dist/entry-helpers.d.ts +93 -0
- package/dist/environments/binding-store.d.ts +27 -0
- package/dist/environments/environment-store.d.ts +74 -0
- package/dist/environments/held-runs.d.ts +64 -0
- package/dist/environments/index.d.ts +10 -0
- package/dist/environments/protection/branch-gate.d.ts +5 -0
- package/dist/environments/protection/concurrency-gate.d.ts +7 -0
- package/dist/environments/protection/pipeline.d.ts +18 -0
- package/dist/environments/protection/reviewer-gate.d.ts +7 -0
- package/dist/environments/protection/trust-gate.d.ts +7 -0
- package/dist/environments/protection/wait-timer-gate.d.ts +7 -0
- package/dist/environments/variable-store.d.ts +39 -0
- package/dist/events/circuit-breaker.d.ts +33 -0
- package/dist/events/event-emitter.d.ts +55 -0
- package/dist/events/event-retry-scanner.d.ts +52 -0
- package/dist/events/event-router.d.ts +183 -0
- package/dist/events/event-store.d.ts +157 -0
- package/dist/events/trust-store.d.ts +54 -0
- package/dist/events/types.d.ts +61 -0
- package/dist/helpers/ip-extraction.d.ts +29 -0
- package/dist/helpers/rate-limiter.d.ts +23 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +772 -0
- package/dist/lockfile-cache.d.ts +39 -0
- package/dist/metrics/agent-metrics-aggregator.d.ts +116 -0
- package/dist/metrics/metrics-reporter.d.ts +40 -0
- package/dist/metrics/prometheus.d.ts +261 -0
- package/dist/metrics/scheduled-jobs.d.ts +20 -0
- package/dist/orchestrator-core.d.ts +193 -0
- package/dist/pipeline/dispatch-matched-workflow.d.ts +102 -0
- package/dist/pipeline/inline-eval.d.ts +28 -0
- package/dist/pipeline/install-secrets-resolver.d.ts +73 -0
- package/dist/pipeline/manual-schedule.d.ts +21 -0
- package/dist/pipeline/needs-scheduler.d.ts +85 -0
- package/dist/pipeline/process-webhook.d.ts +38 -0
- package/dist/pipeline/processor.d.ts +326 -0
- package/dist/pipeline/rerun.d.ts +79 -0
- package/dist/pipeline/test-pipeline.d.ts +110 -0
- package/dist/provider-registry.d.ts +122 -0
- package/dist/providers/generic/index.d.ts +23 -0
- package/dist/providers/generic/normalizer.d.ts +112 -0
- package/dist/providers/generic/verification.d.ts +47 -0
- package/dist/providers/github/auth.d.ts +60 -0
- package/dist/providers/github/changed-files.d.ts +51 -0
- package/dist/providers/github/check-status-poster.d.ts +35 -0
- package/dist/providers/github/contributor-resolver.d.ts +30 -0
- package/dist/providers/github/index.d.ts +20 -0
- package/dist/providers/github/lock-file.d.ts +32 -0
- package/dist/providers/github/normalizer.d.ts +103 -0
- package/dist/providers/github/repo-url.d.ts +35 -0
- package/dist/providers/internal/index.d.ts +32 -0
- package/dist/providers/internal/lock-file-fetcher.d.ts +34 -0
- package/dist/providers/internal/normalizer.d.ts +89 -0
- package/dist/providers/internal/repo-url-builder.d.ts +42 -0
- package/dist/providers/universal-git/changed-files.d.ts +42 -0
- package/dist/providers/universal-git/clone-token.d.ts +83 -0
- package/dist/providers/universal-git/config.d.ts +192 -0
- package/dist/providers/universal-git/index.d.ts +55 -0
- package/dist/providers/universal-git/lock-file.d.ts +71 -0
- package/dist/providers/universal-git/normalizer.d.ts +90 -0
- package/dist/providers/universal-git/repo-url.d.ts +50 -0
- package/dist/providers/universal-git/ssh-auth.d.ts +94 -0
- package/dist/queue/bootstrap.d.ts +50 -0
- package/dist/queue/cleanup.d.ts +41 -0
- package/dist/queue/depth-refresher.d.ts +65 -0
- package/dist/queue/job-queue.d.ts +343 -0
- package/dist/queue/scheduled-job.d.ts +91 -0
- package/dist/registration/extractor.d.ts +44 -0
- package/dist/registration/registration-index.d.ts +162 -0
- package/dist/registration/registration-store.d.ts +111 -0
- package/dist/reporting/check-run-summary.d.ts +102 -0
- package/dist/reporting/commit-status.d.ts +382 -0
- package/dist/reporting/execution-tracker.d.ts +538 -0
- package/dist/reporting/fs-log-storage.d.ts +41 -0
- package/dist/reporting/log-pull-handler.d.ts +35 -0
- package/dist/reporting/log-storage.d.ts +70 -0
- package/dist/reporting/log-writer.d.ts +45 -0
- package/dist/reporting/s3-log-storage.d.ts +42 -0
- package/dist/reporting/step-log-buffer.d.ts +57 -0
- package/dist/routes/admin-access-log.d.ts +34 -0
- package/dist/routes/admin-backends.d.ts +28 -0
- package/dist/routes/admin-config.d.ts +57 -0
- package/dist/routes/admin-db.d.ts +20 -0
- package/dist/routes/admin-environments.d.ts +42 -0
- package/dist/routes/admin-errors.d.ts +4 -0
- package/dist/routes/admin-event-dlq.d.ts +39 -0
- package/dist/routes/admin-event-log.d.ts +42 -0
- package/dist/routes/admin-events.d.ts +46 -0
- package/dist/routes/admin-maintenance.d.ts +22 -0
- package/dist/routes/admin-org-settings.d.ts +29 -0
- package/dist/routes/admin-queue-execution.d.ts +27 -0
- package/dist/routes/admin-registrations.d.ts +37 -0
- package/dist/routes/admin-runs.d.ts +57 -0
- package/dist/routes/admin-scheduled-jobs.d.ts +36 -0
- package/dist/routes/admin-sources.d.ts +18 -0
- package/dist/routes/admin.d.ts +103 -0
- package/dist/routes/capabilities.d.ts +24 -0
- package/dist/routes/diagnostics.d.ts +16 -0
- package/dist/routes/health.d.ts +20 -0
- package/dist/routes/test-trigger.d.ts +41 -0
- package/dist/routes/uploads.d.ts +38 -0
- package/dist/routes/webhooks.d.ts +36 -0
- package/dist/scaler/bare-metal-backend.d.ts +107 -0
- package/dist/scaler/config.d.ts +303 -0
- package/dist/scaler/container-backend.d.ts +125 -0
- package/dist/scaler/file-tail.d.ts +23 -0
- package/dist/scaler/firecracker-api.d.ts +100 -0
- package/dist/scaler/firecracker-backend.d.ts +263 -0
- package/dist/scaler/index.d.ts +24 -0
- package/dist/scaler/ip-allocator.d.ts +177 -0
- package/dist/scaler/label-matcher.d.ts +73 -0
- package/dist/scaler/log-forwarder.d.ts +54 -0
- package/dist/scaler/machine-ledger.d.ts +160 -0
- package/dist/scaler/manager.d.ts +338 -0
- package/dist/scaler/nftables.d.ts +85 -0
- package/dist/scaler/types.d.ts +388 -0
- package/dist/scaler/warm-pool.d.ts +81 -0
- package/dist/secrets/audit-logger.d.ts +65 -0
- package/dist/secrets/backend-health.d.ts +60 -0
- package/dist/secrets/backend-registry.d.ts +68 -0
- package/dist/secrets/backend-sync.d.ts +40 -0
- package/dist/secrets/cleanup.d.ts +40 -0
- package/dist/secrets/config.d.ts +51 -0
- package/dist/secrets/crypto.d.ts +49 -0
- package/dist/secrets/ephemeral-keys.d.ts +49 -0
- package/dist/secrets/index.d.ts +17 -0
- package/dist/secrets/pg-secret-store.d.ts +105 -0
- package/dist/secrets/rbac.d.ts +47 -0
- package/dist/secrets/secret-output-store.d.ts +46 -0
- package/dist/secrets/secret-resolver.d.ts +137 -0
- package/dist/secrets/source-credentials.d.ts +61 -0
- package/dist/secrets/token-manager.d.ts +63 -0
- package/dist/secrets/vault-secret-store.d.ts +85 -0
- package/dist/security/comment-handler.d.ts +67 -0
- package/dist/security/contributor-cache.d.ts +75 -0
- package/dist/security/global-workflow-policy.d.ts +72 -0
- package/dist/security/lock-source.d.ts +34 -0
- package/dist/security/trust-resolver.d.ts +108 -0
- package/dist/security/workflow-diff.d.ts +26 -0
- package/dist/server.d.ts +17 -0
- package/dist/server.js +48055 -0
- package/dist/sources/index.d.ts +10 -0
- package/dist/sources/source-manager.d.ts +63 -0
- package/dist/sources/source-store.d.ts +79 -0
- package/dist/sources/source-validator.d.ts +16 -0
- package/dist/stale-detector/stale-run-detector.d.ts +109 -0
- package/dist/standalone.d.ts +20 -0
- package/dist/standalone.js +41546 -0
- package/dist/storage/blob-routes.d.ts +20 -0
- package/dist/storage/filesystem.d.ts +60 -0
- package/dist/storage/index.d.ts +20 -0
- package/dist/storage/s3.d.ts +68 -0
- package/dist/storage/sign-url.d.ts +45 -0
- package/dist/storage/types.d.ts +98 -0
- package/dist/webhook/dedup.d.ts +44 -0
- package/dist/webhook/event-log.d.ts +83 -0
- package/dist/webhook/generic-sources.d.ts +169 -0
- package/dist/webhook/handler.d.ts +23 -0
- package/dist/webhook/relay-buffer.d.ts +96 -0
- package/dist/webhook/verify-inbound.d.ts +78 -0
- package/dist/worker/in-memory-execution-tracker.d.ts +94 -0
- package/dist/worker/in-memory-job-queue.d.ts +74 -0
- package/dist/worker/static-agent-token-store.d.ts +58 -0
- package/dist/worker/worker-status.d.ts +36 -0
- package/dist/worker-core.d.ts +74 -0
- package/dist/ws/agent-api-registry.d.ts +49 -0
- package/dist/ws/agent-handler.d.ts +176 -0
- package/dist/ws/agent-heartbeat.d.ts +45 -0
- package/dist/ws/dashboard-backends-handler.d.ts +51 -0
- package/dist/ws/dashboard-diagnostics-handler.d.ts +56 -0
- package/dist/ws/dashboard-env-handler.d.ts +107 -0
- package/dist/ws/dashboard-global-workflows-handler.d.ts +72 -0
- package/dist/ws/dashboard-registrations-handler.d.ts +84 -0
- package/dist/ws/event-buffer.d.ts +16 -0
- package/dist/ws/observer-handler.d.ts +42 -0
- package/dist/ws/observer-registry.d.ts +88 -0
- package/dist/ws/platform-client.d.ts +270 -0
- package/dist/ws/server-options.d.ts +15 -0
- package/package.json +87 -7
- package/sbom.spdx.json +14370 -0
- package/index.js +0 -3
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Source management commands for kici-admin.
|
|
3
|
+
*
|
|
4
|
+
* Provides subcommands for webhook source CRUD:
|
|
5
|
+
* source add github Add a new GitHub App source
|
|
6
|
+
* source add generic Add a new generic webhook source
|
|
7
|
+
* source list List all configured sources
|
|
8
|
+
* source get <id> Get details of a specific generic source
|
|
9
|
+
* source update <routingKey> Update a GitHub source
|
|
10
|
+
* source update-generic <id> Update a generic source
|
|
11
|
+
* source remove <routingKey> Remove a source (GitHub or generic with --generic flag)
|
|
12
|
+
* source enable <id> Enable a generic source
|
|
13
|
+
* source disable <id> Disable a generic source
|
|
14
|
+
*
|
|
15
|
+
* Supports multiple secret input modes:
|
|
16
|
+
* --private-key <value> Direct value
|
|
17
|
+
* --private-key @/path/file Read from file (@ prefix)
|
|
18
|
+
* --from-env <VAR_NAME> Read from environment variable
|
|
19
|
+
* --stdin Read from stdin
|
|
20
|
+
*/
|
|
21
|
+
import type { Command } from 'commander';
|
|
22
|
+
import type { AdminApiClient } from '../api-client.js';
|
|
23
|
+
export declare function registerSourceCommands(program: Command, getClient: () => AdminApiClient): void;
|
|
24
|
+
//# sourceMappingURL=source.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Token management commands for kici-admin.
|
|
3
|
+
*
|
|
4
|
+
* Provides CRUD operations for admin API tokens:
|
|
5
|
+
* token create, list, revoke
|
|
6
|
+
*/
|
|
7
|
+
import type { Command } from 'commander';
|
|
8
|
+
import type { AdminApiClient } from '../api-client.js';
|
|
9
|
+
export declare function registerTokenCommands(program: Command, getClient: () => AdminApiClient): void;
|
|
10
|
+
//# sourceMappingURL=token.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow registration commands for kici-admin.
|
|
3
|
+
*
|
|
4
|
+
* Provides operator-facing read access to the workflow_registrations table
|
|
5
|
+
* via the orchestrator's admin HTTP API. This is the dogfooded replacement
|
|
6
|
+
* for "let me just psql the registration table" — every CLI subcommand here
|
|
7
|
+
* goes through AdminApiClient and the existing /api/v1/admin/registrations
|
|
8
|
+
* route.
|
|
9
|
+
*
|
|
10
|
+
* workflow list List registered workflows (table or JSON)
|
|
11
|
+
*
|
|
12
|
+
* Filter flags map 1:1 to the route's query string params:
|
|
13
|
+
* --org -> ?customerId=<id>
|
|
14
|
+
* --routing-key -> ?routingKey=<key>
|
|
15
|
+
* --repo -> ?repoIdentifier=<owner/repo>
|
|
16
|
+
* --trigger-type -> ?triggerType=<type>
|
|
17
|
+
* --event -> ?event=<eventName>
|
|
18
|
+
*
|
|
19
|
+
* Output:
|
|
20
|
+
* default Aligned ASCII table with id, repo_identifier,
|
|
21
|
+
* workflow_name, trigger_types, events, disabled
|
|
22
|
+
* (plus org_id when --org is omitted)
|
|
23
|
+
* --json Raw JSON.stringify of the full response
|
|
24
|
+
*/
|
|
25
|
+
import type { Command } from 'commander';
|
|
26
|
+
import type { AdminApiClient } from '../api-client.js';
|
|
27
|
+
/**
|
|
28
|
+
* Register the `workflow` command group with kici-admin.
|
|
29
|
+
*/
|
|
30
|
+
export declare function registerWorkflowCommands(program: Command, getClient: () => AdminApiClient): void;
|
|
31
|
+
//# sourceMappingURL=workflow.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `kici-admin join` command.
|
|
3
|
+
*
|
|
4
|
+
* Bootstraps a new orchestrator by connecting to an existing cluster via
|
|
5
|
+
* Platform relay or direct peer, receiving an encrypted config bundle, and
|
|
6
|
+
* writing the local YAML config.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* kici-admin join --token kici_join_v1.xxx.yyy --platform wss://platform.kici.dev/ws --api-key KEY
|
|
10
|
+
* kici-admin join --token kici_join_v1.xxx.yyy --peer https://orch-1:8080
|
|
11
|
+
*/
|
|
12
|
+
import type { Command } from 'commander';
|
|
13
|
+
export declare function registerJoinCommand(program: Command): void;
|
|
14
|
+
//# sourceMappingURL=join.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* kici-admin CLI binary.
|
|
4
|
+
*
|
|
5
|
+
* Manages secrets, tokens, key rotation, and audit logs
|
|
6
|
+
* through the orchestrator's admin HTTP API.
|
|
7
|
+
*
|
|
8
|
+
* Global options:
|
|
9
|
+
* --url / -u Orchestrator URL (env: KICI_ADMIN_URL, default: http://localhost:8080)
|
|
10
|
+
* --token / -t Admin API token (env: KICI_ADMIN_TOKEN, required)
|
|
11
|
+
*/
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=kici-admin.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cache directory management for lazy dependencies.
|
|
3
|
+
*
|
|
4
|
+
* Provides cache path resolution and cleanup.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Get the base cache directory path for lazy dependencies.
|
|
8
|
+
* Delegates to platform-detect's getCacheDir() for platform-appropriate paths.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getCacheBasePath(): string;
|
|
11
|
+
/**
|
|
12
|
+
* Remove all cached dependencies.
|
|
13
|
+
*
|
|
14
|
+
* @param cacheDir - Cache directory to clean (from getCacheBasePath())
|
|
15
|
+
*/
|
|
16
|
+
export declare function cleanCache(cacheDir: string): void;
|
|
17
|
+
//# sourceMappingURL=cache.d.ts.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lazy dependency downloader with integrity verification.
|
|
3
|
+
*
|
|
4
|
+
* Downloads, verifies SHA-256 integrity, extracts archives, and caches
|
|
5
|
+
* dependencies for offline use. Uses atomic rename to prevent partial
|
|
6
|
+
* downloads from polluting the cache.
|
|
7
|
+
*/
|
|
8
|
+
import type { LazyDep } from './registry.js';
|
|
9
|
+
/**
|
|
10
|
+
* Verify SHA-256 integrity of downloaded content.
|
|
11
|
+
*
|
|
12
|
+
* @param content - Downloaded file contents as a Buffer
|
|
13
|
+
* @param expectedHash - Expected SHA-256 hex digest
|
|
14
|
+
* @throws If the hash does not match
|
|
15
|
+
*/
|
|
16
|
+
export declare function verifyIntegrity(content: Buffer, expectedHash: string): void;
|
|
17
|
+
/**
|
|
18
|
+
* Ensure a lazy dependency is available in the cache.
|
|
19
|
+
*
|
|
20
|
+
* Flow:
|
|
21
|
+
* 1. Check if already cached -> return path immediately
|
|
22
|
+
* 2. Download from URL to temp directory
|
|
23
|
+
* 3. Verify SHA-256 integrity
|
|
24
|
+
* 4. Extract archive
|
|
25
|
+
* 5. Atomic rename to final cache location
|
|
26
|
+
* 6. Return path to cached dependency
|
|
27
|
+
*
|
|
28
|
+
* @param dep - Dependency metadata from the registry
|
|
29
|
+
* @param cacheDir - Base cache directory
|
|
30
|
+
* @returns Path to the cached dependency
|
|
31
|
+
*/
|
|
32
|
+
export declare function ensureDep(dep: LazyDep, cacheDir: string): Promise<string>;
|
|
33
|
+
//# sourceMappingURL=downloader.d.ts.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Metadata registry for lazy dependencies.
|
|
3
|
+
*
|
|
4
|
+
* Each entry describes a downloadable dependency with platform/arch variants,
|
|
5
|
+
* URLs, SHA-256 integrity hashes, and extraction details.
|
|
6
|
+
*/
|
|
7
|
+
/** Metadata for a single lazy dependency variant. */
|
|
8
|
+
export interface LazyDep {
|
|
9
|
+
/** Dependency name (e.g., "rolldown", "shawl"). */
|
|
10
|
+
name: string;
|
|
11
|
+
/** Version string. */
|
|
12
|
+
version: string;
|
|
13
|
+
/** Target Node.js platform. */
|
|
14
|
+
platform: NodeJS.Platform;
|
|
15
|
+
/** Target architecture (x64, arm64). */
|
|
16
|
+
arch: string;
|
|
17
|
+
/** Download URL. */
|
|
18
|
+
url: string;
|
|
19
|
+
/** Expected SHA-256 hash of the downloaded archive. */
|
|
20
|
+
sha256: string;
|
|
21
|
+
/** Relative path inside the archive to the binary/directory. */
|
|
22
|
+
extractPath: string;
|
|
23
|
+
/** Archive type for extraction. */
|
|
24
|
+
archiveType: 'tar.gz' | 'zip' | 'binary';
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Platform+arch key used for variant lookup.
|
|
28
|
+
* Format: `${platform}-${arch}` (e.g., "linux-x64", "darwin-arm64").
|
|
29
|
+
*/
|
|
30
|
+
type VariantKey = `${NodeJS.Platform}-${string}`;
|
|
31
|
+
/** Registry of all lazy dependencies keyed by name, then platform-arch. */
|
|
32
|
+
export declare const LAZY_DEPS: Record<string, Record<VariantKey, LazyDep>>;
|
|
33
|
+
/**
|
|
34
|
+
* Get dependency metadata for the current (or specified) platform and architecture.
|
|
35
|
+
*
|
|
36
|
+
* @param name - Dependency name (e.g., "rolldown", "shawl")
|
|
37
|
+
* @param platform - Override platform (default: os.platform())
|
|
38
|
+
* @param arch - Override arch (default: process.arch)
|
|
39
|
+
* @throws If the dependency or variant is not found in the registry
|
|
40
|
+
*/
|
|
41
|
+
export declare function getDepMetadata(name: string, platform?: NodeJS.Platform, arch?: string): LazyDep;
|
|
42
|
+
export {};
|
|
43
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Docker/Podman Compose service manager.
|
|
3
|
+
*
|
|
4
|
+
* Generates compose YAML files and manages service lifecycle via
|
|
5
|
+
* `docker compose` or `podman compose` (auto-detected). Provides
|
|
6
|
+
* a container-based service management backend that works on any
|
|
7
|
+
* platform with Docker or Podman installed.
|
|
8
|
+
*/
|
|
9
|
+
import type { ServiceManager, ServiceConfig, ServiceStatus, LogOptions } from './types.js';
|
|
10
|
+
export declare class ComposeServiceManager implements ServiceManager {
|
|
11
|
+
private runtime;
|
|
12
|
+
/** Get the runtime command, detecting it if not already done. */
|
|
13
|
+
private getRuntime;
|
|
14
|
+
/** Run a compose command for the given service config. */
|
|
15
|
+
private runCompose;
|
|
16
|
+
install(config: ServiceConfig): Promise<void>;
|
|
17
|
+
uninstall(config: ServiceConfig): Promise<void>;
|
|
18
|
+
start(config: ServiceConfig): Promise<void>;
|
|
19
|
+
stop(config: ServiceConfig): Promise<void>;
|
|
20
|
+
restart(config: ServiceConfig): Promise<void>;
|
|
21
|
+
status(config: ServiceConfig): Promise<ServiceStatus>;
|
|
22
|
+
logs(config: ServiceConfig, options: LogOptions): Promise<void>;
|
|
23
|
+
isInstalled(config: ServiceConfig): Promise<boolean>;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=compose.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Service management entry point.
|
|
3
|
+
*
|
|
4
|
+
* Re-exports all types and provides a factory function that returns
|
|
5
|
+
* the correct ServiceManager implementation for the detected (or
|
|
6
|
+
* specified) platform. Uses dynamic imports to avoid loading all
|
|
7
|
+
* platform-specific code on every platform.
|
|
8
|
+
*/
|
|
9
|
+
export type { ServiceManager, ServiceConfig, ServiceStatus, ServiceState, ServicePlatform, RestartPolicy, LogOptions, } from './types.js';
|
|
10
|
+
export { DEFAULT_RESTART_POLICY } from './types.js';
|
|
11
|
+
export { detectPlatform, isRoot, getConfigDir, getLogDir, getCacheDir } from './platform-detect.js';
|
|
12
|
+
import type { ServiceManager, ServicePlatform } from './types.js';
|
|
13
|
+
/**
|
|
14
|
+
* Create a ServiceManager for the given platform.
|
|
15
|
+
*
|
|
16
|
+
* Uses dynamic imports so only the relevant platform code is loaded.
|
|
17
|
+
* For example, on Linux only the systemd module is imported, not
|
|
18
|
+
* Windows or launchd code.
|
|
19
|
+
*
|
|
20
|
+
* @param platform - Target platform (from detectPlatform() or --platform flag)
|
|
21
|
+
* @returns The appropriate ServiceManager implementation
|
|
22
|
+
*/
|
|
23
|
+
export declare function createServiceManager(platform: ServicePlatform): Promise<ServiceManager>;
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* launchd service manager implementation.
|
|
3
|
+
*
|
|
4
|
+
* Generates plist files and manages service lifecycle via launchctl.
|
|
5
|
+
* Supports both system-level (/Library/LaunchDaemons/) and
|
|
6
|
+
* user-level (~/Library/LaunchAgents/) agents.
|
|
7
|
+
*/
|
|
8
|
+
import type { ServiceConfig, ServiceManager, ServiceStatus, LogOptions } from './types.js';
|
|
9
|
+
export declare class LaunchdServiceManager implements ServiceManager {
|
|
10
|
+
/** Build the launchd label for a service. */
|
|
11
|
+
private label;
|
|
12
|
+
/** Resolve the log directory based on service level. */
|
|
13
|
+
private logDir;
|
|
14
|
+
/** Resolve the plist file path based on service level. */
|
|
15
|
+
private plistPath;
|
|
16
|
+
/** Parse a .env file into key-value pairs. */
|
|
17
|
+
private parseEnvFile;
|
|
18
|
+
/** Escape XML special characters. */
|
|
19
|
+
private escapeXml;
|
|
20
|
+
/**
|
|
21
|
+
* Generate a launchd plist XML string from a service config.
|
|
22
|
+
* Visible for testing.
|
|
23
|
+
*/
|
|
24
|
+
generatePlist(config: ServiceConfig): string;
|
|
25
|
+
install(config: ServiceConfig): Promise<void>;
|
|
26
|
+
uninstall(config: ServiceConfig): Promise<void>;
|
|
27
|
+
start(config: ServiceConfig): Promise<void>;
|
|
28
|
+
stop(config: ServiceConfig): Promise<void>;
|
|
29
|
+
restart(config: ServiceConfig): Promise<void>;
|
|
30
|
+
status(config: ServiceConfig): Promise<ServiceStatus>;
|
|
31
|
+
logs(config: ServiceConfig, options: LogOptions): Promise<void>;
|
|
32
|
+
isInstalled(config: ServiceConfig): Promise<boolean>;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=launchd.d.ts.map
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform detection and directory resolution for KiCI service management.
|
|
3
|
+
*
|
|
4
|
+
* Detects the init system (systemd, launchd, Windows Services, or Compose fallback)
|
|
5
|
+
* and resolves platform-appropriate directories for config, logs, and cache.
|
|
6
|
+
*/
|
|
7
|
+
import type { ServicePlatform } from './types.js';
|
|
8
|
+
/**
|
|
9
|
+
* Detect the service management platform.
|
|
10
|
+
*
|
|
11
|
+
* Auto-detection order:
|
|
12
|
+
* - win32 -> 'windows'
|
|
13
|
+
* - darwin -> 'launchd'
|
|
14
|
+
* - linux with /run/systemd/system or /sys/fs/cgroup/systemd -> 'systemd'
|
|
15
|
+
* - linux without systemd -> 'compose' (Docker/Podman Compose fallback)
|
|
16
|
+
*
|
|
17
|
+
* @param override - Force a specific platform (e.g., from --platform flag)
|
|
18
|
+
*/
|
|
19
|
+
export declare function detectPlatform(override?: ServicePlatform): ServicePlatform;
|
|
20
|
+
/**
|
|
21
|
+
* Check if the current process has root/admin privileges.
|
|
22
|
+
*
|
|
23
|
+
* - Unix: UID === 0
|
|
24
|
+
* - Windows: attempts `net session` (succeeds only as admin)
|
|
25
|
+
*/
|
|
26
|
+
export declare function isRoot(): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Get the configuration directory for a KiCI service.
|
|
29
|
+
*
|
|
30
|
+
* Paths follow platform conventions:
|
|
31
|
+
* - System Linux/macOS: /etc/kici/
|
|
32
|
+
* - User Linux: ~/.config/kici/
|
|
33
|
+
* - User macOS: ~/Library/Application Support/kici/
|
|
34
|
+
* - System Windows: C:\ProgramData\kici\
|
|
35
|
+
* - User Windows: %LOCALAPPDATA%\kici\
|
|
36
|
+
*/
|
|
37
|
+
export declare function getConfigDir(_serviceName: string, isUserLevel: boolean): string;
|
|
38
|
+
/**
|
|
39
|
+
* Get the log directory for a KiCI service.
|
|
40
|
+
*
|
|
41
|
+
* Paths follow platform conventions:
|
|
42
|
+
* - System Linux/macOS: /var/log/kici/
|
|
43
|
+
* - User Linux: ~/.local/share/kici/logs/
|
|
44
|
+
* - User macOS: ~/Library/Logs/kici/
|
|
45
|
+
* - Windows: C:\ProgramData\kici\logs\
|
|
46
|
+
*/
|
|
47
|
+
export declare function getLogDir(_serviceName: string, isUserLevel: boolean): string;
|
|
48
|
+
/**
|
|
49
|
+
* Get the cache directory for lazy dependency downloads.
|
|
50
|
+
*
|
|
51
|
+
* Resolution order:
|
|
52
|
+
* 1. $XDG_CACHE_HOME/kici/deps/ (if set)
|
|
53
|
+
* 2. Platform default:
|
|
54
|
+
* - Linux: ~/.cache/kici/deps/
|
|
55
|
+
* - macOS: ~/Library/Caches/kici/deps/
|
|
56
|
+
* - Windows: %LOCALAPPDATA%\kici\deps\
|
|
57
|
+
*/
|
|
58
|
+
export declare function getCacheDir(): string;
|
|
59
|
+
//# sourceMappingURL=platform-detect.d.ts.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* systemd service manager implementation.
|
|
3
|
+
*
|
|
4
|
+
* Generates unit files and manages service lifecycle via systemctl,
|
|
5
|
+
* journalctl, and loginctl commands. Supports both system-level
|
|
6
|
+
* (/etc/systemd/system/) and user-level (~/.config/systemd/user/) services.
|
|
7
|
+
*/
|
|
8
|
+
import type { ServiceConfig, ServiceManager, ServiceStatus, LogOptions } from './types.js';
|
|
9
|
+
/**
|
|
10
|
+
* Check whether linger is already enabled for a user.
|
|
11
|
+
*
|
|
12
|
+
* Uses `loginctl show-user <user>` which is readable by any user. Returns
|
|
13
|
+
* true if the user's `Linger` property reads `yes`. Returns false on any
|
|
14
|
+
* parse failure, missing binary, or unknown user — the caller is expected
|
|
15
|
+
* to attempt `enable-linger` in that case.
|
|
16
|
+
*
|
|
17
|
+
* Exported (package-private) for testing.
|
|
18
|
+
*/
|
|
19
|
+
export declare function isLingerEnabled(user: string): boolean;
|
|
20
|
+
export declare class SystemdServiceManager implements ServiceManager {
|
|
21
|
+
/**
|
|
22
|
+
* Generate a systemd unit file from a service config.
|
|
23
|
+
* Visible for testing.
|
|
24
|
+
*/
|
|
25
|
+
generateUnitFile(config: ServiceConfig): string;
|
|
26
|
+
/** Resolve the unit file path based on service level. */
|
|
27
|
+
private unitFilePath;
|
|
28
|
+
/** Build systemctl command args, inserting --user for user-level services. */
|
|
29
|
+
private systemctlArgs;
|
|
30
|
+
/** Run a systemctl command. */
|
|
31
|
+
private systemctl;
|
|
32
|
+
install(config: ServiceConfig): Promise<void>;
|
|
33
|
+
uninstall(config: ServiceConfig): Promise<void>;
|
|
34
|
+
start(config: ServiceConfig): Promise<void>;
|
|
35
|
+
stop(config: ServiceConfig): Promise<void>;
|
|
36
|
+
restart(config: ServiceConfig): Promise<void>;
|
|
37
|
+
status(config: ServiceConfig): Promise<ServiceStatus>;
|
|
38
|
+
logs(config: ServiceConfig, options: LogOptions): Promise<void>;
|
|
39
|
+
isInstalled(config: ServiceConfig): Promise<boolean>;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=systemd.d.ts.map
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared types for the service management system.
|
|
3
|
+
*
|
|
4
|
+
* Defines the ServiceManager interface contract and supporting types
|
|
5
|
+
* used by all platform-specific service managers (systemd, launchd,
|
|
6
|
+
* Windows Services, Docker/Podman Compose).
|
|
7
|
+
*/
|
|
8
|
+
/** Supported service platforms. */
|
|
9
|
+
export type ServicePlatform = 'systemd' | 'launchd' | 'windows' | 'compose';
|
|
10
|
+
/** Restart behavior on service failure. */
|
|
11
|
+
export interface RestartPolicy {
|
|
12
|
+
/** Whether to restart on failure. */
|
|
13
|
+
enabled: boolean;
|
|
14
|
+
/** Backoff delays in seconds between restart attempts. */
|
|
15
|
+
delays: number[];
|
|
16
|
+
/** Maximum consecutive failures before giving up. */
|
|
17
|
+
maxRetries: number;
|
|
18
|
+
/** Window in seconds for counting consecutive failures. */
|
|
19
|
+
windowSeconds: number;
|
|
20
|
+
}
|
|
21
|
+
/** Default restart policy: backoff 1s, 5s, 15s, 30s; max 5 failures in 5 minutes. */
|
|
22
|
+
export declare const DEFAULT_RESTART_POLICY: RestartPolicy;
|
|
23
|
+
/** Configuration for installing a service. */
|
|
24
|
+
export interface ServiceConfig {
|
|
25
|
+
/** Service identifier (e.g., "kici-orchestrator"). */
|
|
26
|
+
name: string;
|
|
27
|
+
/** Human-readable display name. */
|
|
28
|
+
displayName: string;
|
|
29
|
+
/** Service description. */
|
|
30
|
+
description: string;
|
|
31
|
+
/** Path to the executable binary. */
|
|
32
|
+
executablePath: string;
|
|
33
|
+
/** Path to the environment file (.env). */
|
|
34
|
+
envFilePath: string;
|
|
35
|
+
/** Working directory for the service process. */
|
|
36
|
+
workingDirectory: string;
|
|
37
|
+
/** User to run the service as (Unix only). */
|
|
38
|
+
user?: string;
|
|
39
|
+
/** Whether this is a user-level (non-root) service. */
|
|
40
|
+
isUserLevel: boolean;
|
|
41
|
+
/** Restart policy configuration. */
|
|
42
|
+
restartPolicy: RestartPolicy;
|
|
43
|
+
}
|
|
44
|
+
/** Current state of a service. */
|
|
45
|
+
export type ServiceState = 'running' | 'stopped' | 'failed' | 'unknown';
|
|
46
|
+
/** Runtime status information for a service. */
|
|
47
|
+
export interface ServiceStatus {
|
|
48
|
+
/** Current service state. */
|
|
49
|
+
state: ServiceState;
|
|
50
|
+
/** Process ID if running. */
|
|
51
|
+
pid?: number;
|
|
52
|
+
/** Uptime in seconds if running. */
|
|
53
|
+
uptime?: number;
|
|
54
|
+
/** ISO timestamp when the service last started. */
|
|
55
|
+
startedAt?: string;
|
|
56
|
+
}
|
|
57
|
+
/** Options for the logs command. */
|
|
58
|
+
export interface LogOptions {
|
|
59
|
+
/** Show logs since this duration (e.g., "1h", "30m"). */
|
|
60
|
+
since?: string;
|
|
61
|
+
/** Filter by log level. */
|
|
62
|
+
level?: 'error' | 'warn' | 'info';
|
|
63
|
+
/** Output as JSON lines. */
|
|
64
|
+
json?: boolean;
|
|
65
|
+
/** Follow (tail -f) mode. */
|
|
66
|
+
follow?: boolean;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Interface that all platform-specific service managers must implement.
|
|
70
|
+
*
|
|
71
|
+
* Each method operates on a service identified by the ServiceConfig.
|
|
72
|
+
*/
|
|
73
|
+
export interface ServiceManager {
|
|
74
|
+
/** Install and register the service with the init system. */
|
|
75
|
+
install(config: ServiceConfig): Promise<void>;
|
|
76
|
+
/** Remove the service registration (preserves config/data). */
|
|
77
|
+
uninstall(config: ServiceConfig): Promise<void>;
|
|
78
|
+
/** Start the service. */
|
|
79
|
+
start(config: ServiceConfig): Promise<void>;
|
|
80
|
+
/** Stop the service. */
|
|
81
|
+
stop(config: ServiceConfig): Promise<void>;
|
|
82
|
+
/** Restart the service (stop + start). */
|
|
83
|
+
restart(config: ServiceConfig): Promise<void>;
|
|
84
|
+
/** Get the current service status. */
|
|
85
|
+
status(config: ServiceConfig): Promise<ServiceStatus>;
|
|
86
|
+
/** Stream or display service logs. */
|
|
87
|
+
logs(config: ServiceConfig, options: LogOptions): Promise<void>;
|
|
88
|
+
/** Check if the service is currently installed/registered. */
|
|
89
|
+
isInstalled(config: ServiceConfig): Promise<boolean>;
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Windows service manager using shawl + sc.exe.
|
|
3
|
+
*
|
|
4
|
+
* Uses shawl (https://github.com/mtkennerly/shawl) to wrap the KiCI
|
|
5
|
+
* executable as a Windows service. Shawl is downloaded as a lazy
|
|
6
|
+
* dependency on first use. Service configuration (auto-start, recovery)
|
|
7
|
+
* is handled via sc.exe.
|
|
8
|
+
*/
|
|
9
|
+
import type { ServiceManager, ServiceConfig, ServiceStatus, LogOptions } from './types.js';
|
|
10
|
+
export declare class WindowsServiceManager implements ServiceManager {
|
|
11
|
+
install(config: ServiceConfig): Promise<void>;
|
|
12
|
+
uninstall(config: ServiceConfig): Promise<void>;
|
|
13
|
+
start(config: ServiceConfig): Promise<void>;
|
|
14
|
+
stop(config: ServiceConfig): Promise<void>;
|
|
15
|
+
restart(config: ServiceConfig): Promise<void>;
|
|
16
|
+
status(config: ServiceConfig): Promise<ServiceStatus>;
|
|
17
|
+
logs(config: ServiceConfig, _options: LogOptions): Promise<void>;
|
|
18
|
+
isInstalled(config: ServiceConfig): Promise<boolean>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=windows.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interactive wizard for agent service setup.
|
|
3
|
+
*
|
|
4
|
+
* Walks the user through essential agent configuration
|
|
5
|
+
* (orchestrator URL, token, labels). Returns a config object
|
|
6
|
+
* that the install command uses to write the env file.
|
|
7
|
+
*/
|
|
8
|
+
/** Config produced by the agent wizard. */
|
|
9
|
+
interface AgentInstallConfig {
|
|
10
|
+
orchestratorUrl: string;
|
|
11
|
+
agentToken: string;
|
|
12
|
+
labels: string[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Run the interactive agent setup wizard.
|
|
16
|
+
*
|
|
17
|
+
* Asks only essential questions:
|
|
18
|
+
* 1. Orchestrator URL
|
|
19
|
+
* 2. Agent authentication token
|
|
20
|
+
* 3. Labels (optional, comma-separated)
|
|
21
|
+
*/
|
|
22
|
+
export declare function runAgentWizard(): Promise<AgentInstallConfig>;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=agent-wizard.d.ts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interactive wizard for orchestrator service setup.
|
|
3
|
+
*
|
|
4
|
+
* Walks the user through essential configuration (mode, DB URL,
|
|
5
|
+
* port, secrets key) with sensible defaults. Returns a config
|
|
6
|
+
* object that the install command uses to write the env file.
|
|
7
|
+
*/
|
|
8
|
+
/** Config produced by the orchestrator wizard. */
|
|
9
|
+
interface OrchestratorInstallConfig {
|
|
10
|
+
mode: 'platform' | 'hybrid' | 'independent';
|
|
11
|
+
databaseUrl: string;
|
|
12
|
+
port: number;
|
|
13
|
+
secretsKey: string;
|
|
14
|
+
platformUrl?: string;
|
|
15
|
+
platformToken?: string;
|
|
16
|
+
/** Source to add after orchestrator is running. */
|
|
17
|
+
source?: {
|
|
18
|
+
provider: string;
|
|
19
|
+
name: string;
|
|
20
|
+
appId: string;
|
|
21
|
+
privateKey: string;
|
|
22
|
+
webhookSecret?: string;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Run the interactive orchestrator setup wizard.
|
|
27
|
+
*
|
|
28
|
+
* Asks only essential questions per the user decision:
|
|
29
|
+
* 1. Mode (platform/hybrid/independent)
|
|
30
|
+
* 2. Database URL
|
|
31
|
+
* 3. Port
|
|
32
|
+
* 4. Secrets encryption key
|
|
33
|
+
* 5. Platform URL + token (if platform/hybrid mode)
|
|
34
|
+
* 6. Webhook secret (if hybrid/independent mode)
|
|
35
|
+
*/
|
|
36
|
+
export declare function runOrchestratorWizard(): Promise<OrchestratorInstallConfig>;
|
|
37
|
+
export {};
|
|
38
|
+
//# sourceMappingURL=orchestrator-wizard.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared prompt utilities for the setup wizards.
|
|
3
|
+
*
|
|
4
|
+
* Wraps @inquirer/prompts with consistent formatting and
|
|
5
|
+
* validation for common input types (DB URLs, ports, etc.).
|
|
6
|
+
*/
|
|
7
|
+
/** Prompt for a PostgreSQL database URL with validation. */
|
|
8
|
+
export declare function promptDbUrl(): Promise<string>;
|
|
9
|
+
/** Prompt for a port number with validation. */
|
|
10
|
+
export declare function promptPort(defaultPort: number): Promise<number>;
|
|
11
|
+
/** Prompt for a yes/no confirmation. */
|
|
12
|
+
export declare function promptConfirm(message: string, defaultValue?: boolean): Promise<boolean>;
|
|
13
|
+
/** Prompt for a URL with http(s):// validation. */
|
|
14
|
+
export declare function promptUrl(message: string, defaultValue?: string): Promise<string>;
|
|
15
|
+
/** Prompt for a secret/password (masked input). */
|
|
16
|
+
export declare function promptSecret(message: string): Promise<string>;
|
|
17
|
+
/** Prompt for a selection from a list of options. */
|
|
18
|
+
export declare function promptSelect<T extends string>(message: string, choices: {
|
|
19
|
+
name: string;
|
|
20
|
+
value: T;
|
|
21
|
+
description?: string;
|
|
22
|
+
}[], defaultValue?: T): Promise<T>;
|
|
23
|
+
//# sourceMappingURL=prompts.d.ts.map
|