@kya-os/cli 1.8.1 → 1.8.3
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/commands/agent.d.ts +35 -0
- package/dist/commands/agent.d.ts.map +1 -0
- package/dist/commands/agent.js +321 -0
- package/dist/commands/agent.js.map +1 -0
- package/dist/commands/build.js +2 -2
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/check.js +3 -3
- package/dist/commands/check.js.map +1 -1
- package/dist/commands/checkpoint-init.d.ts +1 -1
- package/dist/commands/checkpoint-init.d.ts.map +1 -1
- package/dist/commands/checkpoint-init.js +8 -41
- package/dist/commands/checkpoint-init.js.map +1 -1
- package/dist/commands/claim.js +2 -2
- package/dist/commands/claim.js.map +1 -1
- package/dist/commands/dco.d.ts +59 -0
- package/dist/commands/dco.d.ts.map +1 -1
- package/dist/commands/dco.js +280 -5
- package/dist/commands/dco.js.map +1 -1
- package/dist/commands/dev.js +1 -1
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +18 -24
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/env.js +6 -6
- package/dist/commands/env.js.map +1 -1
- package/dist/commands/identity.js +3 -3
- package/dist/commands/identity.js.map +1 -1
- package/dist/commands/init-stages.d.ts +141 -0
- package/dist/commands/init-stages.d.ts.map +1 -0
- package/dist/commands/init-stages.js +684 -0
- package/dist/commands/init-stages.js.map +1 -0
- package/dist/commands/init.d.ts +46 -16
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +229 -279
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/orchestrator.d.ts +18 -0
- package/dist/commands/orchestrator.d.ts.map +1 -0
- package/dist/commands/orchestrator.js +251 -0
- package/dist/commands/orchestrator.js.map +1 -0
- package/dist/commands/register.d.ts +1 -1
- package/dist/commands/register.d.ts.map +1 -1
- package/dist/commands/register.js +35 -7
- package/dist/commands/register.js.map +1 -1
- package/dist/commands/review.d.ts +48 -0
- package/dist/commands/review.d.ts.map +1 -0
- package/dist/commands/review.js +220 -0
- package/dist/commands/review.js.map +1 -0
- package/dist/commands/rotate.js +4 -4
- package/dist/commands/rotate.js.map +1 -1
- package/dist/commands/score.d.ts +15 -0
- package/dist/commands/score.d.ts.map +1 -0
- package/dist/commands/score.js +471 -0
- package/dist/commands/score.js.map +1 -0
- package/dist/commands/start.js +3 -3
- package/dist/commands/start.js.map +1 -1
- package/dist/commands/status.js +1 -1
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/verify.js +6 -6
- package/dist/commands/verify.js.map +1 -1
- package/dist/dco.d.ts +4 -0
- package/dist/dco.d.ts.map +1 -0
- package/dist/dco.js +23 -0
- package/dist/dco.js.map +1 -0
- package/dist/index.js +52 -9
- package/dist/orchestrator/daemon.d.ts +137 -0
- package/dist/orchestrator/daemon.d.ts.map +1 -0
- package/dist/orchestrator/daemon.js +242 -0
- package/dist/orchestrator/daemon.js.map +1 -0
- package/dist/orchestrator/db/dispatches.d.ts +108 -0
- package/dist/orchestrator/db/dispatches.d.ts.map +1 -0
- package/dist/orchestrator/db/dispatches.js +122 -0
- package/dist/orchestrator/db/dispatches.js.map +1 -0
- package/dist/orchestrator/db/index.d.ts +50 -0
- package/dist/orchestrator/db/index.d.ts.map +1 -0
- package/dist/orchestrator/db/index.js +116 -0
- package/dist/orchestrator/db/index.js.map +1 -0
- package/dist/orchestrator/db/journal.d.ts +93 -0
- package/dist/orchestrator/db/journal.d.ts.map +1 -0
- package/dist/orchestrator/db/journal.js +91 -0
- package/dist/orchestrator/db/journal.js.map +1 -0
- package/dist/orchestrator/db/liveness.d.ts +97 -0
- package/dist/orchestrator/db/liveness.d.ts.map +1 -0
- package/dist/orchestrator/db/liveness.js +105 -0
- package/dist/orchestrator/db/liveness.js.map +1 -0
- package/dist/orchestrator/db/mission.d.ts +78 -0
- package/dist/orchestrator/db/mission.d.ts.map +1 -0
- package/dist/orchestrator/db/mission.js +99 -0
- package/dist/orchestrator/db/mission.js.map +1 -0
- package/dist/orchestrator/db/schema.d.ts +14 -0
- package/dist/orchestrator/db/schema.d.ts.map +1 -0
- package/dist/orchestrator/db/schema.js +169 -0
- package/dist/orchestrator/db/schema.js.map +1 -0
- package/dist/orchestrator/db/tickets.d.ts +147 -0
- package/dist/orchestrator/db/tickets.d.ts.map +1 -0
- package/dist/orchestrator/db/tickets.js +238 -0
- package/dist/orchestrator/db/tickets.js.map +1 -0
- package/dist/orchestrator/db/verdicts.d.ts +187 -0
- package/dist/orchestrator/db/verdicts.d.ts.map +1 -0
- package/dist/orchestrator/db/verdicts.js +197 -0
- package/dist/orchestrator/db/verdicts.js.map +1 -0
- package/dist/orchestrator/events.d.ts +69 -0
- package/dist/orchestrator/events.d.ts.map +1 -0
- package/dist/orchestrator/events.js +20 -0
- package/dist/orchestrator/events.js.map +1 -0
- package/dist/orchestrator/github-credential-anchor-sender.d.ts +159 -0
- package/dist/orchestrator/github-credential-anchor-sender.d.ts.map +1 -0
- package/dist/orchestrator/github-credential-anchor-sender.js +313 -0
- package/dist/orchestrator/github-credential-anchor-sender.js.map +1 -0
- package/dist/orchestrator/hub-dispatch.d.ts +120 -0
- package/dist/orchestrator/hub-dispatch.d.ts.map +1 -0
- package/dist/orchestrator/hub-dispatch.js +257 -0
- package/dist/orchestrator/hub-dispatch.js.map +1 -0
- package/dist/orchestrator/hub-observer.d.ts +201 -0
- package/dist/orchestrator/hub-observer.d.ts.map +1 -0
- package/dist/orchestrator/hub-observer.js +474 -0
- package/dist/orchestrator/hub-observer.js.map +1 -0
- package/dist/orchestrator/journal-writer.d.ts +80 -0
- package/dist/orchestrator/journal-writer.d.ts.map +1 -0
- package/dist/orchestrator/journal-writer.js +113 -0
- package/dist/orchestrator/journal-writer.js.map +1 -0
- package/dist/orchestrator/mcp/server.d.ts +136 -0
- package/dist/orchestrator/mcp/server.d.ts.map +1 -0
- package/dist/orchestrator/mcp/server.js +582 -0
- package/dist/orchestrator/mcp/server.js.map +1 -0
- package/dist/orchestrator/mcp/stdio.d.ts +22 -0
- package/dist/orchestrator/mcp/stdio.d.ts.map +1 -0
- package/dist/orchestrator/mcp/stdio.js +51 -0
- package/dist/orchestrator/mcp/stdio.js.map +1 -0
- package/dist/orchestrator/review.d.ts +131 -0
- package/dist/orchestrator/review.d.ts.map +1 -0
- package/dist/orchestrator/review.js +322 -0
- package/dist/orchestrator/review.js.map +1 -0
- package/dist/tui/app.d.ts +33 -0
- package/dist/tui/app.d.ts.map +1 -0
- package/dist/tui/app.js +71 -0
- package/dist/tui/app.js.map +1 -0
- package/dist/tui/components.d.ts +110 -0
- package/dist/tui/components.d.ts.map +1 -0
- package/dist/tui/components.js +118 -0
- package/dist/tui/components.js.map +1 -0
- package/dist/tui/index.d.ts +30 -0
- package/dist/tui/index.d.ts.map +1 -0
- package/dist/tui/index.js +95 -0
- package/dist/tui/index.js.map +1 -0
- package/dist/tui/keymap.d.ts +33 -0
- package/dist/tui/keymap.d.ts.map +1 -0
- package/dist/tui/keymap.js +49 -0
- package/dist/tui/keymap.js.map +1 -0
- package/dist/tui/nav.d.ts +29 -0
- package/dist/tui/nav.d.ts.map +1 -0
- package/dist/tui/nav.js +39 -0
- package/dist/tui/nav.js.map +1 -0
- package/dist/tui/sanitize.d.ts +25 -0
- package/dist/tui/sanitize.d.ts.map +1 -0
- package/dist/tui/sanitize.js +36 -0
- package/dist/tui/sanitize.js.map +1 -0
- package/dist/tui/theme.d.ts +32 -0
- package/dist/tui/theme.d.ts.map +1 -0
- package/dist/tui/theme.js +63 -0
- package/dist/tui/theme.js.map +1 -0
- package/dist/tui/views/agents.d.ts +67 -0
- package/dist/tui/views/agents.d.ts.map +1 -0
- package/dist/tui/views/agents.js +231 -0
- package/dist/tui/views/agents.js.map +1 -0
- package/dist/tui/views/index.d.ts +93 -0
- package/dist/tui/views/index.d.ts.map +1 -0
- package/dist/tui/views/index.js +150 -0
- package/dist/tui/views/index.js.map +1 -0
- package/dist/tui/views/registry.d.ts +22 -0
- package/dist/tui/views/registry.d.ts.map +1 -0
- package/dist/tui/views/registry.js +110 -0
- package/dist/tui/views/registry.js.map +1 -0
- package/dist/utils/agent/backoff.d.ts +31 -0
- package/dist/utils/agent/backoff.d.ts.map +1 -0
- package/dist/utils/agent/backoff.js +51 -0
- package/dist/utils/agent/backoff.js.map +1 -0
- package/dist/utils/agent/markers.d.ts +87 -0
- package/dist/utils/agent/markers.d.ts.map +1 -0
- package/dist/utils/agent/markers.js +147 -0
- package/dist/utils/agent/markers.js.map +1 -0
- package/dist/utils/agent/review.d.ts +67 -0
- package/dist/utils/agent/review.d.ts.map +1 -0
- package/dist/utils/agent/review.js +305 -0
- package/dist/utils/agent/review.js.map +1 -0
- package/dist/utils/agent/spawn-agent.d.ts +117 -0
- package/dist/utils/agent/spawn-agent.d.ts.map +1 -0
- package/dist/utils/agent/spawn-agent.js +177 -0
- package/dist/utils/agent/spawn-agent.js.map +1 -0
- package/dist/utils/agent/task.d.ts +101 -0
- package/dist/utils/agent/task.d.ts.map +1 -0
- package/dist/utils/agent/task.js +357 -0
- package/dist/utils/agent/task.js.map +1 -0
- package/dist/utils/agent/verify.d.ts +47 -0
- package/dist/utils/agent/verify.d.ts.map +1 -0
- package/dist/utils/agent/verify.js +144 -0
- package/dist/utils/agent/verify.js.map +1 -0
- package/dist/utils/agent-detector.d.ts +48 -0
- package/dist/utils/agent-detector.d.ts.map +1 -0
- package/dist/utils/agent-detector.js +74 -0
- package/dist/utils/agent-detector.js.map +1 -0
- package/dist/utils/agent-profile-stage.d.ts +70 -0
- package/dist/utils/agent-profile-stage.d.ts.map +1 -0
- package/dist/utils/agent-profile-stage.js +153 -0
- package/dist/utils/agent-profile-stage.js.map +1 -0
- package/dist/utils/agent-profiles.d.ts +27 -0
- package/dist/utils/agent-profiles.d.ts.map +1 -0
- package/dist/utils/agent-profiles.js +61 -0
- package/dist/utils/agent-profiles.js.map +1 -0
- package/dist/utils/checkpoint-api.d.ts +1 -1
- package/dist/utils/checkpoint-api.js +1 -1
- package/dist/utils/checkpoint-env.d.ts +1 -1
- package/dist/utils/checkpoint-env.js +2 -2
- package/dist/utils/checkpoint-env.js.map +1 -1
- package/dist/utils/checkpoint-scaffold.d.ts +1 -1
- package/dist/utils/checkpoint-scaffold.js +1 -1
- package/dist/utils/cli-kit/browser.d.ts +24 -0
- package/dist/utils/cli-kit/browser.d.ts.map +1 -0
- package/dist/utils/cli-kit/browser.js +58 -0
- package/dist/utils/cli-kit/browser.js.map +1 -0
- package/dist/utils/cli-kit/claim-polling.d.ts +18 -0
- package/dist/utils/cli-kit/claim-polling.d.ts.map +1 -0
- package/dist/utils/{claim-polling.js → cli-kit/claim-polling.js} +19 -26
- package/dist/utils/cli-kit/claim-polling.js.map +1 -0
- package/dist/utils/cli-kit/diagnostics.d.ts +9 -0
- package/dist/utils/cli-kit/diagnostics.d.ts.map +1 -0
- package/dist/utils/cli-kit/diagnostics.js +11 -0
- package/dist/utils/cli-kit/diagnostics.js.map +1 -0
- package/dist/utils/cli-kit/fs-safe.d.ts +14 -0
- package/dist/utils/cli-kit/fs-safe.d.ts.map +1 -0
- package/dist/utils/cli-kit/fs-safe.js +20 -0
- package/dist/utils/cli-kit/fs-safe.js.map +1 -0
- package/dist/utils/cli-kit/index.d.ts +15 -0
- package/dist/utils/cli-kit/index.d.ts.map +1 -0
- package/dist/utils/cli-kit/index.js +10 -0
- package/dist/utils/cli-kit/index.js.map +1 -0
- package/dist/utils/cli-kit/json-file.d.ts +21 -0
- package/dist/utils/cli-kit/json-file.d.ts.map +1 -0
- package/dist/utils/cli-kit/json-file.js +51 -0
- package/dist/utils/cli-kit/json-file.js.map +1 -0
- package/dist/utils/cli-kit/marker-block.d.ts +26 -0
- package/dist/utils/cli-kit/marker-block.d.ts.map +1 -0
- package/dist/utils/cli-kit/marker-block.js +61 -0
- package/dist/utils/cli-kit/marker-block.js.map +1 -0
- package/dist/utils/cli-kit/paths.d.ts +15 -0
- package/dist/utils/cli-kit/paths.d.ts.map +1 -0
- package/dist/utils/cli-kit/paths.js +21 -0
- package/dist/utils/cli-kit/paths.js.map +1 -0
- package/dist/utils/cli-kit/secure-storage.d.ts +14 -0
- package/dist/utils/cli-kit/secure-storage.d.ts.map +1 -0
- package/dist/utils/cli-kit/secure-storage.js +20 -0
- package/dist/utils/cli-kit/secure-storage.js.map +1 -0
- package/dist/utils/cli-kit/step-report.d.ts +16 -0
- package/dist/utils/cli-kit/step-report.d.ts.map +1 -0
- package/dist/utils/cli-kit/step-report.js +36 -0
- package/dist/utils/cli-kit/step-report.js.map +1 -0
- package/dist/utils/dco/agent-metadata.d.ts +1 -1
- package/dist/utils/dco/agent-metadata.js +1 -1
- package/dist/utils/dco/agent-metadata.js.map +1 -1
- package/dist/utils/dco/claude-config.d.ts +18 -14
- package/dist/utils/dco/claude-config.d.ts.map +1 -1
- package/dist/utils/dco/claude-config.js +31 -97
- package/dist/utils/dco/claude-config.js.map +1 -1
- package/dist/utils/dco/dispatch.d.ts +134 -0
- package/dist/utils/dco/dispatch.d.ts.map +1 -0
- package/dist/utils/dco/dispatch.js +399 -0
- package/dist/utils/dco/dispatch.js.map +1 -0
- package/dist/utils/dco/fix.d.ts +122 -0
- package/dist/utils/dco/fix.d.ts.map +1 -0
- package/dist/utils/dco/fix.js +560 -0
- package/dist/utils/dco/fix.js.map +1 -0
- package/dist/utils/dco/git-config.d.ts.map +1 -1
- package/dist/utils/dco/git-config.js +5 -3
- package/dist/utils/dco/git-config.js.map +1 -1
- package/dist/utils/dco/github.d.ts +101 -0
- package/dist/utils/dco/github.d.ts.map +1 -1
- package/dist/utils/dco/github.js +133 -0
- package/dist/utils/dco/github.js.map +1 -1
- package/dist/utils/dco/paths.d.ts +1 -8
- package/dist/utils/dco/paths.d.ts.map +1 -1
- package/dist/utils/dco/paths.js +3 -12
- package/dist/utils/dco/paths.js.map +1 -1
- package/dist/utils/dco/render.d.ts +1 -1
- package/dist/utils/dco/render.d.ts.map +1 -1
- package/dist/utils/dco/render.js +4 -21
- package/dist/utils/dco/render.js.map +1 -1
- package/dist/utils/dco/resolve-agent.d.ts +54 -0
- package/dist/utils/dco/resolve-agent.d.ts.map +1 -0
- package/dist/utils/dco/resolve-agent.js +164 -0
- package/dist/utils/dco/resolve-agent.js.map +1 -0
- package/dist/utils/dco/setup.d.ts +10 -7
- package/dist/utils/dco/setup.d.ts.map +1 -1
- package/dist/utils/dco/setup.js +264 -200
- package/dist/utils/dco/setup.js.map +1 -1
- package/dist/utils/dco/signing-key-writer.d.ts +40 -0
- package/dist/utils/dco/signing-key-writer.d.ts.map +1 -0
- package/dist/utils/dco/signing-key-writer.js +76 -0
- package/dist/utils/dco/signing-key-writer.js.map +1 -0
- package/dist/utils/dco/ssh-key.d.ts +50 -0
- package/dist/utils/dco/ssh-key.d.ts.map +1 -1
- package/dist/utils/dco/ssh-key.js +129 -8
- package/dist/utils/dco/ssh-key.js.map +1 -1
- package/dist/utils/dco/status.d.ts +1 -1
- package/dist/utils/dco/status.d.ts.map +1 -1
- package/dist/utils/dco/status.js +3 -3
- package/dist/utils/dco/status.js.map +1 -1
- package/dist/utils/dco/verify.d.ts +170 -0
- package/dist/utils/dco/verify.d.ts.map +1 -0
- package/dist/utils/dco/verify.js +550 -0
- package/dist/utils/dco/verify.js.map +1 -0
- package/dist/utils/dependency-installer.d.ts +37 -0
- package/dist/utils/dependency-installer.d.ts.map +1 -0
- package/dist/utils/dependency-installer.js +32 -0
- package/dist/utils/dependency-installer.js.map +1 -0
- package/dist/utils/github-credential-stage.d.ts +87 -0
- package/dist/utils/github-credential-stage.d.ts.map +1 -0
- package/dist/utils/github-credential-stage.js +168 -0
- package/dist/utils/github-credential-stage.js.map +1 -0
- package/dist/utils/github-credential.d.ts +160 -0
- package/dist/utils/github-credential.d.ts.map +1 -0
- package/dist/utils/github-credential.js +308 -0
- package/dist/utils/github-credential.js.map +1 -0
- package/dist/utils/gitignore.d.ts +17 -0
- package/dist/utils/gitignore.d.ts.map +1 -0
- package/dist/utils/gitignore.js +40 -0
- package/dist/utils/gitignore.js.map +1 -0
- package/dist/utils/hub-config.d.ts +21 -0
- package/dist/utils/hub-config.d.ts.map +1 -0
- package/dist/utils/hub-config.js +28 -0
- package/dist/utils/hub-config.js.map +1 -0
- package/dist/utils/identity-heal.d.ts +16 -0
- package/dist/utils/identity-heal.d.ts.map +1 -0
- package/dist/utils/identity-heal.js +37 -0
- package/dist/utils/identity-heal.js.map +1 -0
- package/dist/utils/init/pipeline.d.ts +74 -0
- package/dist/utils/init/pipeline.d.ts.map +1 -0
- package/dist/utils/init/pipeline.js +96 -0
- package/dist/utils/init/pipeline.js.map +1 -0
- package/dist/utils/poll.d.ts +15 -1
- package/dist/utils/poll.d.ts.map +1 -1
- package/dist/utils/poll.js +6 -3
- package/dist/utils/poll.js.map +1 -1
- package/dist/utils/register-agent-identity.d.ts +67 -0
- package/dist/utils/register-agent-identity.d.ts.map +1 -0
- package/dist/utils/register-agent-identity.js +34 -0
- package/dist/utils/register-agent-identity.js.map +1 -0
- package/dist/utils/review/did-web-key.d.ts +34 -0
- package/dist/utils/review/did-web-key.d.ts.map +1 -0
- package/dist/utils/review/did-web-key.js +104 -0
- package/dist/utils/review/did-web-key.js.map +1 -0
- package/dist/utils/review/load-registry.d.ts +33 -0
- package/dist/utils/review/load-registry.d.ts.map +1 -0
- package/dist/utils/review/load-registry.js +62 -0
- package/dist/utils/review/load-registry.js.map +1 -0
- package/dist/utils/review/verdict-verify.d.ts +43 -0
- package/dist/utils/review/verdict-verify.d.ts.map +1 -0
- package/dist/utils/review/verdict-verify.js +53 -0
- package/dist/utils/review/verdict-verify.js.map +1 -0
- package/dist/utils/review-registry-writer.d.ts +52 -0
- package/dist/utils/review-registry-writer.d.ts.map +1 -0
- package/dist/utils/review-registry-writer.js +79 -0
- package/dist/utils/review-registry-writer.js.map +1 -0
- package/dist/utils/should-install-dependency.d.ts +17 -0
- package/dist/utils/should-install-dependency.d.ts.map +1 -0
- package/dist/utils/should-install-dependency.js +25 -0
- package/dist/utils/should-install-dependency.js.map +1 -0
- package/dist/utils/tool-readiness.d.ts +57 -0
- package/dist/utils/tool-readiness.d.ts.map +1 -0
- package/dist/utils/tool-readiness.js +114 -0
- package/dist/utils/tool-readiness.js.map +1 -0
- package/dist/utils/which.d.ts +2 -0
- package/dist/utils/which.d.ts.map +1 -0
- package/dist/utils/which.js +22 -0
- package/dist/utils/which.js.map +1 -0
- package/dist/version.d.ts +15 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +29 -0
- package/dist/version.js.map +1 -0
- package/package.json +19 -6
- package/dist/utils/claim-polling.d.ts +0 -21
- package/dist/utils/claim-polling.d.ts.map +0 -1
- package/dist/utils/claim-polling.js.map +0 -1
- package/dist/utils/dco/fs-safe.d.ts +0 -14
- package/dist/utils/dco/fs-safe.d.ts.map +0 -1
- package/dist/utils/dco/fs-safe.js +0 -20
- package/dist/utils/dco/fs-safe.js.map +0 -1
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { type AgentProfile } from "./agent-profiles.js";
|
|
2
|
+
import { type AcquireGithubCredentialOptions, type SaveGithubCredentialResult, type StoredGithubCredential } from "./github-credential.js";
|
|
3
|
+
import { buildGithubCredentialAnchor as defaultBuildGithubCredentialAnchor, identityForAgentProfile as defaultIdentityForAgentProfile, readPendingAnchor as defaultReadPendingAnchor, type BuiltGithubCredentialAnchor, type DeliverGithubCredentialAnchorResult } from "../orchestrator/github-credential-anchor-sender.js";
|
|
4
|
+
import type { ObserverIdentity } from "../orchestrator/hub-observer.js";
|
|
5
|
+
/**
|
|
6
|
+
* Orchestrates `kya-os init`'s GitHub credential stage (review-loop P16
|
|
7
|
+
* commit 4): acquire the single per-machine GitHub credential, store it,
|
|
8
|
+
* and anchor it in the hub, binding it to every agent profile already on
|
|
9
|
+
* this machine (the P15 profile stage, which this runs strictly after --
|
|
10
|
+
* an anchor with no `agentDids` to bind is meaningless, so this stage is a
|
|
11
|
+
* clean skip on a machine with none).
|
|
12
|
+
*
|
|
13
|
+
* Every side effect (listing profiles, reading the env, acquiring,
|
|
14
|
+
* confirming rotation, saving, building, delivering) is an injectable seam,
|
|
15
|
+
* mirroring `agent-profile-stage.ts`'s pattern, so the whole stage runs in
|
|
16
|
+
* tests with zero real `gh`, prompt, or network access.
|
|
17
|
+
*/
|
|
18
|
+
export interface GithubCredentialStageOptions {
|
|
19
|
+
interactive: boolean;
|
|
20
|
+
/** `--skip-github`: skip this stage entirely. */
|
|
21
|
+
skipGithub?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* `--github-token-env <NAME>`: read the token from that env var instead
|
|
24
|
+
* of `gh auth token` or an interactive prompt. The ONLY non-interactive
|
|
25
|
+
* path -- without it, a non-interactive run skips this stage rather than
|
|
26
|
+
* risk hanging on a prompt with no TTY to answer it.
|
|
27
|
+
*/
|
|
28
|
+
githubTokenEnv?: string;
|
|
29
|
+
/** Resolved hub endpoint (e.g. from `--hub` or `DIDCOMM_HUB_ENDPOINT`), or undefined = not configured. */
|
|
30
|
+
hubEndpoint?: string;
|
|
31
|
+
now?: () => string;
|
|
32
|
+
onNotice?: (message: string) => void;
|
|
33
|
+
listProfilesImpl?: () => AgentProfile[];
|
|
34
|
+
readEnvImpl?: (name: string) => string | undefined;
|
|
35
|
+
acquireCredentialImpl?: (options: AcquireGithubCredentialOptions) => Promise<StoredGithubCredential>;
|
|
36
|
+
/** Pass-through acquisition seams (gh/prompt mocks) for full test isolation. */
|
|
37
|
+
acquisitionSeams?: Pick<AcquireGithubCredentialOptions, "isGhInstalledImpl" | "isGhAuthenticatedImpl" | "apiUserWithHeadersImpl" | "apiUserWithHeadersForTokenImpl" | "ghAuthTokenImpl" | "promptForTokenImpl" | "randomBytesImpl">;
|
|
38
|
+
confirmRotateImpl?: () => Promise<boolean>;
|
|
39
|
+
saveCredentialImpl?: (credential: StoredGithubCredential, options: {
|
|
40
|
+
confirmRotateImpl: () => Promise<boolean>;
|
|
41
|
+
}) => Promise<SaveGithubCredentialResult>;
|
|
42
|
+
buildAnchorImpl?: typeof defaultBuildGithubCredentialAnchor;
|
|
43
|
+
deliverAnchorImpl?: (anchor: BuiltGithubCredentialAnchor["anchor"], identity: BuiltGithubCredentialAnchor["identity"], options: {
|
|
44
|
+
hubEndpoint?: string;
|
|
45
|
+
onNotice?: (message: string) => void;
|
|
46
|
+
}) => Promise<DeliverGithubCredentialAnchorResult>;
|
|
47
|
+
/** Reads `~/.mcpi/github/pending-anchor.json`, or undefined if nothing is queued. */
|
|
48
|
+
readPendingAnchorImpl?: typeof defaultReadPendingAnchor;
|
|
49
|
+
/** Derives the signer profile's wire identity for re-authenticating a pending anchor's delivery. */
|
|
50
|
+
identityForAgentProfileImpl?: typeof defaultIdentityForAgentProfile;
|
|
51
|
+
deliverPendingAnchorImpl?: (resolveIdentity: (signerDid: string) => ObserverIdentity | undefined, options: {
|
|
52
|
+
hubEndpoint?: string;
|
|
53
|
+
onNotice?: (message: string) => void;
|
|
54
|
+
}) => Promise<DeliverGithubCredentialAnchorResult | {
|
|
55
|
+
status: "none";
|
|
56
|
+
}>;
|
|
57
|
+
}
|
|
58
|
+
export type GithubCredentialStageResult = {
|
|
59
|
+
status: "skipped";
|
|
60
|
+
reason: "flag" | "no-profiles" | "non-interactive";
|
|
61
|
+
} | {
|
|
62
|
+
status: "declined-rotation";
|
|
63
|
+
} | {
|
|
64
|
+
status: "completed";
|
|
65
|
+
githubLogin: string;
|
|
66
|
+
anchorDelivery: "delivered" | "pending";
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* The credential was acquired and IS saved on disk (usable by `dco setup`
|
|
70
|
+
* and friends today), but building the signed anchor threw before an
|
|
71
|
+
* anchor object ever existed -- e.g. the signer profile's signing key file
|
|
72
|
+
* is missing or unreadable. Distinct from `completed`'s `anchorDelivery:
|
|
73
|
+
* "pending"` (a valid anchor exists and is queued at
|
|
74
|
+
* `pending-anchor.json`, just not yet delivered): here there is nothing
|
|
75
|
+
* valid to queue, since `pending-anchor.json` requires a real signature.
|
|
76
|
+
* Reported explicitly rather than let the exception propagate into a
|
|
77
|
+
* generic catch, so the operator learns their credential WAS saved but
|
|
78
|
+
* is NOT yet anchored anywhere, instead of the two states being
|
|
79
|
+
* indistinguishable from "something in this stage failed."
|
|
80
|
+
*/
|
|
81
|
+
| {
|
|
82
|
+
status: "anchor-build-failed";
|
|
83
|
+
githubLogin: string;
|
|
84
|
+
reason: string;
|
|
85
|
+
};
|
|
86
|
+
export declare function runGithubCredentialStage(options: GithubCredentialStageOptions): Promise<GithubCredentialStageResult>;
|
|
87
|
+
//# sourceMappingURL=github-credential-stage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github-credential-stage.d.ts","sourceRoot":"","sources":["../../src/utils/github-credential-stage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuC,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC7F,OAAO,EAIL,KAAK,8BAA8B,EACnC,KAAK,0BAA0B,EAC/B,KAAK,sBAAsB,EAC5B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,2BAA2B,IAAI,kCAAkC,EAGjE,uBAAuB,IAAI,8BAA8B,EACzD,iBAAiB,IAAI,wBAAwB,EAC7C,KAAK,2BAA2B,EAChC,KAAK,mCAAmC,EACzC,MAAM,oDAAoD,CAAC;AAC5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAExE;;;;;;;;;;;;GAYG;AAEH,MAAM,WAAW,4BAA4B;IAC3C,WAAW,EAAE,OAAO,CAAC;IACrB,iDAAiD;IACjD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,0GAA0G;IAC1G,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAErC,gBAAgB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,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;KAAE,KACpE,OAAO,CAAC,mCAAmC,GAAG;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACxE;AAED,MAAM,MAAM,2BAA2B,GACnC;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,MAAM,GAAG,aAAa,GAAG,iBAAiB,CAAA;CAAE,GACzE;IAAE,MAAM,EAAE,mBAAmB,CAAA;CAAE,GAC/B;IAAE,MAAM,EAAE,WAAW,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,WAAW,GAAG,SAAS,CAAA;CAAE;AACvF;;;;;;;;;;;;GAYG;GACD;IAAE,MAAM,EAAE,qBAAqB,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAkD3E,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,4BAA4B,GACpC,OAAO,CAAC,2BAA2B,CAAC,CAgJtC"}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { listProfiles as defaultListProfiles } from "./agent-profiles.js";
|
|
2
|
+
import { acquireGithubCredential as defaultAcquireGithubCredential, fingerprintSecret, saveGithubCredential as defaultSaveGithubCredential, } from "./github-credential.js";
|
|
3
|
+
import { buildGithubCredentialAnchor as defaultBuildGithubCredentialAnchor, deliverGithubCredentialAnchor as defaultDeliverGithubCredentialAnchor, deliverPendingGithubCredentialAnchor as defaultDeliverPendingGithubCredentialAnchor, identityForAgentProfile as defaultIdentityForAgentProfile, readPendingAnchor as defaultReadPendingAnchor, } from "../orchestrator/github-credential-anchor-sender.js";
|
|
4
|
+
/**
|
|
5
|
+
* Decide where this run's token is coming from, without acquiring it yet:
|
|
6
|
+
* `--github-token-env` (validated non-empty), or "the normal acquisition
|
|
7
|
+
* flow decides" (gh-auth or an interactive prompt) when interactive, or a
|
|
8
|
+
* clean skip when neither applies. Factored out of `runGithubCredentialStage`
|
|
9
|
+
* so that function reads as one pipeline (resolve source -> acquire -> save
|
|
10
|
+
* -> anchor -> deliver) instead of interleaving this branch with it.
|
|
11
|
+
*/
|
|
12
|
+
function resolveGithubTokenSource(options, onNotice) {
|
|
13
|
+
if (!options.githubTokenEnv) {
|
|
14
|
+
if (options.interactive)
|
|
15
|
+
return {};
|
|
16
|
+
// Non-interactive with no explicit token source: never risk hanging on
|
|
17
|
+
// a masked prompt with no TTY to answer it.
|
|
18
|
+
onNotice("Non-interactive and no --github-token-env given -- skipping the GitHub credential stage.");
|
|
19
|
+
return { skip: { status: "skipped", reason: "non-interactive" } };
|
|
20
|
+
}
|
|
21
|
+
const readEnvImpl = options.readEnvImpl ?? ((name) => process.env[name]);
|
|
22
|
+
const presetToken = readEnvImpl(options.githubTokenEnv);
|
|
23
|
+
if (!presetToken) {
|
|
24
|
+
throw new Error(`--github-token-env ${options.githubTokenEnv} was given but that environment variable is empty or unset.`);
|
|
25
|
+
}
|
|
26
|
+
return { presetToken };
|
|
27
|
+
}
|
|
28
|
+
async function defaultConfirmRotate() {
|
|
29
|
+
const inquirer = (await import("inquirer")).default;
|
|
30
|
+
const { confirmed } = await inquirer.prompt([
|
|
31
|
+
{
|
|
32
|
+
type: "confirm",
|
|
33
|
+
name: "confirmed",
|
|
34
|
+
message: "A GitHub credential is already stored on this machine. Rotate it?",
|
|
35
|
+
default: false,
|
|
36
|
+
},
|
|
37
|
+
]);
|
|
38
|
+
return confirmed;
|
|
39
|
+
}
|
|
40
|
+
/** `--github-token-env` always rotates without asking: the operator handed over a specific token value to write, which is itself the confirmation an interactive run gets by prompt. */
|
|
41
|
+
async function autoConfirmRotate() {
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
export async function runGithubCredentialStage(options) {
|
|
45
|
+
const onNotice = options.onNotice ?? (() => { });
|
|
46
|
+
if (options.skipGithub) {
|
|
47
|
+
return { status: "skipped", reason: "flag" };
|
|
48
|
+
}
|
|
49
|
+
const listProfilesImpl = options.listProfilesImpl ?? defaultListProfiles;
|
|
50
|
+
const profiles = listProfilesImpl();
|
|
51
|
+
if (profiles.length === 0) {
|
|
52
|
+
onNotice("No agent profiles to bind a GitHub credential to yet -- run `kya-os init` again after setting up at least one.");
|
|
53
|
+
return { status: "skipped", reason: "no-profiles" };
|
|
54
|
+
}
|
|
55
|
+
// The first profile on the machine signs a FRESH anchor (see the build
|
|
56
|
+
// step below) -- but a previously QUEUED anchor may have been signed by
|
|
57
|
+
// a different profile than whichever one `listProfiles()` happens to
|
|
58
|
+
// return first today (its order is `readdirSync`'s, not stable), so the
|
|
59
|
+
// pending-flush path below resolves the signer by the DID actually
|
|
60
|
+
// recorded at queue time, never by re-deriving "profiles[0]".
|
|
61
|
+
const signer = profiles[0];
|
|
62
|
+
// Flush a previously queued anchor before acquiring anything new -- but
|
|
63
|
+
// ONLY when this run has no explicit intent to acquire a SPECIFIC token
|
|
64
|
+
// right now. `--github-token-env` IS that explicit intent: flushing
|
|
65
|
+
// first would either silently skip the rotation the operator just asked
|
|
66
|
+
// for (flush succeeds, the OLD credential's anchor lands in the hub and
|
|
67
|
+
// the stage returns before ever reading the env var) or discard the
|
|
68
|
+
// queued anchor for an unrelated fresh one (flush fails, the normal flow
|
|
69
|
+
// below auto-rotates per --github-token-env regardless). The plain "just
|
|
70
|
+
// re-run kya-os init to see if the hub is up now" case -- no token
|
|
71
|
+
// source override -- is what this retry exists for; without it,
|
|
72
|
+
// deliverPendingGithubCredentialAnchor was dead code, since this stage
|
|
73
|
+
// never called it and a queued anchor sat on disk forever.
|
|
74
|
+
if (!options.githubTokenEnv) {
|
|
75
|
+
const readPendingAnchorImpl = options.readPendingAnchorImpl ?? defaultReadPendingAnchor;
|
|
76
|
+
const pending = readPendingAnchorImpl();
|
|
77
|
+
if (pending) {
|
|
78
|
+
const identityForAgentProfileImpl = options.identityForAgentProfileImpl ?? defaultIdentityForAgentProfile;
|
|
79
|
+
const deliverPendingAnchorImpl = options.deliverPendingAnchorImpl ?? defaultDeliverPendingGithubCredentialAnchor;
|
|
80
|
+
const resolveIdentityForDid = (did) => {
|
|
81
|
+
const match = profiles.find((p) => p.did === did);
|
|
82
|
+
return match ? identityForAgentProfileImpl(match.did, match.slug) : undefined;
|
|
83
|
+
};
|
|
84
|
+
const pendingResult = await deliverPendingAnchorImpl(resolveIdentityForDid, {
|
|
85
|
+
hubEndpoint: options.hubEndpoint,
|
|
86
|
+
onNotice,
|
|
87
|
+
});
|
|
88
|
+
if (pendingResult.status === "delivered") {
|
|
89
|
+
onNotice(`Delivered the previously queued GitHub credential anchor for ${pending.anchor.githubLogin} to the hub.`);
|
|
90
|
+
return {
|
|
91
|
+
status: "completed",
|
|
92
|
+
githubLogin: pending.anchor.githubLogin,
|
|
93
|
+
anchorDelivery: "delivered",
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
// "pending" (still can't reach the hub, or the signer profile is
|
|
97
|
+
// gone) -- fall through to the normal flow below exactly as before;
|
|
98
|
+
// re-acquiring will re-queue or redeliver an anchor.
|
|
99
|
+
// deliverPendingAnchorImpl never returns "none" here: `pending`
|
|
100
|
+
// above already proved something is queued.
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
const tokenSource = resolveGithubTokenSource(options, onNotice);
|
|
104
|
+
if ("skip" in tokenSource) {
|
|
105
|
+
return tokenSource.skip;
|
|
106
|
+
}
|
|
107
|
+
const { presetToken } = tokenSource;
|
|
108
|
+
const acquireCredentialImpl = options.acquireCredentialImpl ?? defaultAcquireGithubCredential;
|
|
109
|
+
const credential = await acquireCredentialImpl({
|
|
110
|
+
...options.acquisitionSeams,
|
|
111
|
+
presetToken,
|
|
112
|
+
now: options.now,
|
|
113
|
+
onNotice,
|
|
114
|
+
});
|
|
115
|
+
const saveCredentialImpl = options.saveCredentialImpl ?? defaultSaveGithubCredential;
|
|
116
|
+
// `--github-token-env` is the documented non-interactive rotation path
|
|
117
|
+
// (docs/single-account-github.md): defaulting to the interactive prompt
|
|
118
|
+
// here regardless meant a second `--github-token-env` run against an
|
|
119
|
+
// existing credentials.json hung waiting for a TTY (or threw, off one),
|
|
120
|
+
// instead of rotating as documented. A `presetToken` came from that exact
|
|
121
|
+
// flag, which is itself the operator's explicit confirmation -- an
|
|
122
|
+
// interactive run (no presetToken) still gets asked.
|
|
123
|
+
const confirmRotateImpl = options.confirmRotateImpl ?? (presetToken !== undefined ? autoConfirmRotate : defaultConfirmRotate);
|
|
124
|
+
const saveResult = await saveCredentialImpl(credential, { confirmRotateImpl });
|
|
125
|
+
if (saveResult.status === "declined") {
|
|
126
|
+
onNotice("Keeping the existing GitHub credential -- rotation was not confirmed.");
|
|
127
|
+
return { status: "declined-rotation" };
|
|
128
|
+
}
|
|
129
|
+
// `signer` (the first profile on the machine, declared above) signs the
|
|
130
|
+
// anchor -- same "first profile is special" convention
|
|
131
|
+
// runProfileStageAndUpdateRegistry already uses to pick the review
|
|
132
|
+
// registry's fixer candidate -- but EVERY profile's DID is bound as
|
|
133
|
+
// authorized, since the credential is shared machine-wide.
|
|
134
|
+
const buildAnchorImpl = options.buildAnchorImpl ?? defaultBuildGithubCredentialAnchor;
|
|
135
|
+
let built;
|
|
136
|
+
try {
|
|
137
|
+
built = buildAnchorImpl(credential, {
|
|
138
|
+
tokenFingerprint: fingerprintSecret(credential.token),
|
|
139
|
+
webhookSecretFingerprint: fingerprintSecret(credential.webhookSecret),
|
|
140
|
+
}, {
|
|
141
|
+
agentDid: signer.did,
|
|
142
|
+
agentSlug: signer.slug,
|
|
143
|
+
agentDids: profiles.map((p) => p.did),
|
|
144
|
+
supersedes: saveResult.supersedesFingerprint,
|
|
145
|
+
now: options.now,
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
catch (error) {
|
|
149
|
+
// The credential is already saved -- surface that distinctly rather
|
|
150
|
+
// than let this propagate into a generic "the stage failed" catch that
|
|
151
|
+
// would leave the operator unsure whether anything was persisted.
|
|
152
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
153
|
+
onNotice(`GitHub credential saved, but the anchor could not be signed (${reason}) -- it is NOT yet anchored in the hub. Run \`kya-os init\` again once this is fixed.`);
|
|
154
|
+
return { status: "anchor-build-failed", githubLogin: credential.githubLogin, reason };
|
|
155
|
+
}
|
|
156
|
+
const { anchor, identity } = built;
|
|
157
|
+
const deliverAnchorImpl = options.deliverAnchorImpl ?? defaultDeliverGithubCredentialAnchor;
|
|
158
|
+
const deliveryResult = await deliverAnchorImpl(anchor, identity, {
|
|
159
|
+
hubEndpoint: options.hubEndpoint,
|
|
160
|
+
onNotice,
|
|
161
|
+
});
|
|
162
|
+
return {
|
|
163
|
+
status: "completed",
|
|
164
|
+
githubLogin: credential.githubLogin,
|
|
165
|
+
anchorDelivery: deliveryResult.status,
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
//# sourceMappingURL=github-credential-stage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github-credential-stage.js","sourceRoot":"","sources":["../../src/utils/github-credential-stage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,IAAI,mBAAmB,EAAqB,MAAM,qBAAqB,CAAC;AAC7F,OAAO,EACL,uBAAuB,IAAI,8BAA8B,EACzD,iBAAiB,EACjB,oBAAoB,IAAI,2BAA2B,GAIpD,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,2BAA2B,IAAI,kCAAkC,EACjE,6BAA6B,IAAI,oCAAoC,EACrE,oCAAoC,IAAI,2CAA2C,EACnF,uBAAuB,IAAI,8BAA8B,EACzD,iBAAiB,IAAI,wBAAwB,GAG9C,MAAM,oDAAoD,CAAC;AAyF5D;;;;;;;GAOG;AACH,SAAS,wBAAwB,CAC/B,OAA6F,EAC7F,QAAmC;IAEnC,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC;QAC5B,IAAI,OAAO,CAAC,WAAW;YAAE,OAAO,EAAE,CAAC;QACnC,uEAAuE;QACvE,4CAA4C;QAC5C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IACD,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAEnC,MAAM,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,IAAI,oCAAoC,CAAC;IAC5F,MAAM,cAAc,GAAG,MAAM,iBAAiB,CAAC,MAAM,EAAE,QAAQ,EAAE;QAC/D,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,QAAQ;KACT,CAAC,CAAC;IAEH,OAAO;QACL,MAAM,EAAE,WAAW;QACnB,WAAW,EAAE,UAAU,CAAC,WAAW;QACnC,cAAc,EAAE,cAAc,CAAC,MAAM;KACtC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single-account GitHub credential onboarding (review-loop P16).
|
|
3
|
+
*
|
|
4
|
+
* One person's ONE GitHub credential, acquired once per machine and shared
|
|
5
|
+
* by every one of that person's agent profiles (P15) -- not one GitHub
|
|
6
|
+
* account per agent, not a GitHub App. Sentinel's PAT flow is the precedent
|
|
7
|
+
* (local checkout `/Users/marshall/@kya-os/sentinel` @ 83c0ed5): classic
|
|
8
|
+
* `repo` + `admin:repo_hook`, or the fine-grained equivalent
|
|
9
|
+
* ({@link FINE_GRAINED_GRANTS}). No octokit dependency anywhere in this
|
|
10
|
+
* module -- every GitHub call shells out to `gh`, the same house pattern
|
|
11
|
+
* `dco/github.ts` uses.
|
|
12
|
+
*
|
|
13
|
+
* SECURITY: the token and the webhook secret this module generates must
|
|
14
|
+
* NEVER be logged, printed, or written anywhere but
|
|
15
|
+
* {@link credentialsPath}. Read the incident note this module follows
|
|
16
|
+
* before touching any of the write paths below: checkpoint
|
|
17
|
+
* `apps/web/scripts/provision-scout.ts:49-56` documents a live credential
|
|
18
|
+
* that sat one `git add -A` away from being committed because a script
|
|
19
|
+
* wrote it into the repo checkout's cwd instead of a dedicated,
|
|
20
|
+
* gitignore-independent location. `credentialsPath()` resolves under
|
|
21
|
+
* `~/.mcpi/github/`, never the process cwd, for exactly that reason.
|
|
22
|
+
*
|
|
23
|
+
* @module cli/utils/github-credential
|
|
24
|
+
*/
|
|
25
|
+
export interface StoredGithubCredential {
|
|
26
|
+
githubLogin: string;
|
|
27
|
+
/** The raw PAT. Never logged; never leaves this machine. */
|
|
28
|
+
token: string;
|
|
29
|
+
/** 32 random bytes, hex-encoded. Generated at acquisition time (see module doc). */
|
|
30
|
+
webhookSecret: string;
|
|
31
|
+
/** Scopes/grants as acquired -- see {@link acquireGithubCredential}. */
|
|
32
|
+
scopes: string[];
|
|
33
|
+
createdAt: string;
|
|
34
|
+
}
|
|
35
|
+
/** Absolute path to the credential directory, e.g. ~/.mcpi/github. Overridable for tests via MCPI_GITHUB_DIR. */
|
|
36
|
+
export declare function credentialsDir(): string;
|
|
37
|
+
/** Absolute path to the credential store file. */
|
|
38
|
+
export declare function credentialsPath(): string;
|
|
39
|
+
/**
|
|
40
|
+
* sha256 hex digest of a secret's raw bytes (the token, or the webhook
|
|
41
|
+
* secret). GitHub PATs and this module's hex-encoded webhook secrets are
|
|
42
|
+
* always ASCII, so UTF-8 encoding is exact-byte equivalent to hashing the
|
|
43
|
+
* secret's actual byte representation. This is the ONLY form either secret
|
|
44
|
+
* is ever allowed to leave this module in -- the anchor (see
|
|
45
|
+
* `github-credential-anchor.ts`) carries fingerprints exclusively.
|
|
46
|
+
*/
|
|
47
|
+
export declare function fingerprintSecret(secret: string): string;
|
|
48
|
+
/** The currently stored credential, or undefined if none exists (or the file is unreadable/corrupt). */
|
|
49
|
+
export declare function readStoredCredential(): StoredGithubCredential | undefined;
|
|
50
|
+
export type SaveGithubCredentialResult = {
|
|
51
|
+
status: "saved";
|
|
52
|
+
credential: StoredGithubCredential;
|
|
53
|
+
/** The prior credential's tokenFingerprint, set only when this save rotated an existing one. */
|
|
54
|
+
supersedesFingerprint?: string;
|
|
55
|
+
} | {
|
|
56
|
+
status: "declined";
|
|
57
|
+
};
|
|
58
|
+
export interface SaveGithubCredentialOptions {
|
|
59
|
+
/**
|
|
60
|
+
* Asked only when a credential file already exists. Declining leaves the
|
|
61
|
+
* existing file completely untouched. No default: a caller that forgets
|
|
62
|
+
* to wire this in non-interactive contexts gets a type error, not an
|
|
63
|
+
* accidental silent overwrite of a live credential.
|
|
64
|
+
*/
|
|
65
|
+
confirmRotateImpl: () => Promise<boolean>;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Persist `credential` at {@link credentialsPath}, 0600 inside a 0700
|
|
69
|
+
* directory ({@link credentialsDir}).
|
|
70
|
+
*
|
|
71
|
+
* A pre-existing file is never silently overwritten (sentinel `8297a1e`'s
|
|
72
|
+
* lesson, transposed: operate only on YOUR OWN prior credential, and only
|
|
73
|
+
* once that's been confirmed, never by assuming the file is stale). This
|
|
74
|
+
* check is on FILE PRESENCE, not on `readStoredCredential`'s shape-validated
|
|
75
|
+
* result: a file that exists but fails the shape guard (corrupt, truncated
|
|
76
|
+
* by an interrupted prior write, or a future incompatible format) still has
|
|
77
|
+
* a live token sitting in it and must still gate on confirmation -- treating
|
|
78
|
+
* "can't parse it" the same as "nothing here" would silently discard that
|
|
79
|
+
* token with no rotation record, exactly the audit-trail gap anchoring
|
|
80
|
+
* exists to close. On a confirmed rotation the old file is replaced
|
|
81
|
+
* atomically (write temp + rename, `writeFileAtomicSafe`) and, when the
|
|
82
|
+
* prior file WAS well-formed, the result carries its token's fingerprint as
|
|
83
|
+
* `supersedesFingerprint` for the caller to bind into the next anchor's
|
|
84
|
+
* `supersedes` field -- absent when the prior file was corrupt, since there
|
|
85
|
+
* is no valid token to fingerprint.
|
|
86
|
+
*/
|
|
87
|
+
export declare function saveGithubCredential(credential: StoredGithubCredential, options: SaveGithubCredentialOptions): Promise<SaveGithubCredentialResult>;
|
|
88
|
+
/** Sentinel's proven classic-token grant list (README:33-35, `Know-That-Ai/sentinel` @ 83c0ed5). */
|
|
89
|
+
export declare const CLASSIC_REQUIRED_SCOPES: readonly ["repo", "admin:repo_hook"];
|
|
90
|
+
/** Sentinel's proven fine-grained equivalent, printed verbatim for the user to grant. */
|
|
91
|
+
export declare const FINE_GRAINED_GRANTS: readonly ["Metadata: Read", "Pull requests: Read & Write", "Contents: Read", "Webhooks: Read & Write"];
|
|
92
|
+
export declare const GITHUB_PAT_SETTINGS_URL = "https://github.com/settings/personal-access-tokens/new";
|
|
93
|
+
export interface ScopeProbeResult {
|
|
94
|
+
/**
|
|
95
|
+
* Which probe actually ran. Classic tokens report scopes via the
|
|
96
|
+
* `X-OAuth-Scopes` response header; fine-grained tokens report nothing,
|
|
97
|
+
* so the probe falls back to the least-privileged read available to any
|
|
98
|
+
* authenticated token (`GET /user`) and can only confirm the token
|
|
99
|
+
* authenticates, not which grants it actually holds.
|
|
100
|
+
*/
|
|
101
|
+
probe: "classic-x-oauth-scopes" | "fine-grained-user-read";
|
|
102
|
+
ok: boolean;
|
|
103
|
+
login?: string;
|
|
104
|
+
/** Only ever populated for the classic probe -- see `probe`'s doc. */
|
|
105
|
+
scopes?: string[];
|
|
106
|
+
/** Only ever populated for a failed classic probe. */
|
|
107
|
+
missing?: string[];
|
|
108
|
+
/** Human-readable, always present, names which probe ran either way. */
|
|
109
|
+
detail: string;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Parse `gh api user -i` output (headers followed by a blank line, then the
|
|
113
|
+
* JSON body) into a {@link ScopeProbeResult}. Pure -- no process spawning --
|
|
114
|
+
* so this is unit-testable directly against canned `gh` output without a
|
|
115
|
+
* live GitHub call or even a `gh` binary on PATH.
|
|
116
|
+
*/
|
|
117
|
+
export declare function parseGhApiUserWithHeaders(raw: string): ScopeProbeResult;
|
|
118
|
+
export interface AcquireGithubCredentialOptions {
|
|
119
|
+
isGhInstalledImpl?: () => Promise<boolean>;
|
|
120
|
+
isGhAuthenticatedImpl?: () => Promise<boolean>;
|
|
121
|
+
/** `gh api user -i` using gh's own stored auth. */
|
|
122
|
+
apiUserWithHeadersImpl?: () => Promise<string>;
|
|
123
|
+
/** `gh api user -i` authenticated as a pasted token. */
|
|
124
|
+
apiUserWithHeadersForTokenImpl?: (token: string) => Promise<string>;
|
|
125
|
+
ghAuthTokenImpl?: () => Promise<string>;
|
|
126
|
+
promptForTokenImpl?: () => Promise<string>;
|
|
127
|
+
randomBytesImpl?: (size: number) => Buffer;
|
|
128
|
+
now?: () => string;
|
|
129
|
+
/** Surfaces probe/scope detail to the user -- injectable so tests assert on it without a real console write. */
|
|
130
|
+
onNotice?: (message: string) => void;
|
|
131
|
+
/**
|
|
132
|
+
* A token supplied directly (e.g. `kya-os init --github-token-env NAME`),
|
|
133
|
+
* bypassing BOTH `gh auth token` and the interactive paste prompt. The
|
|
134
|
+
* caller is responsible for reading it from the named env var and never
|
|
135
|
+
* logging it; this module still verifies it the same way a pasted token
|
|
136
|
+
* is verified, and still never echoes it.
|
|
137
|
+
*/
|
|
138
|
+
presetToken?: string;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Acquire the single GitHub credential for this person on this machine.
|
|
142
|
+
*
|
|
143
|
+
* Acquisition order:
|
|
144
|
+
* 0. `options.presetToken`, when supplied (`kya-os init --github-token-env
|
|
145
|
+
* NAME`) -- skips both of the below entirely, for a fully
|
|
146
|
+
* non-interactive run. Verified the same way a pasted token is.
|
|
147
|
+
* 1. `gh auth token`, when `gh` is installed, authenticated, and the
|
|
148
|
+
* scope probe against its stored token passes (classic: all of
|
|
149
|
+
* {@link CLASSIC_REQUIRED_SCOPES} present via `X-OAuth-Scopes`;
|
|
150
|
+
* fine-grained: the `GET /user` probe authenticates).
|
|
151
|
+
* 2. Otherwise, prompt for a pasted fine-grained PAT created with
|
|
152
|
+
* {@link FINE_GRAINED_GRANTS}, verified the same way.
|
|
153
|
+
*
|
|
154
|
+
* Always generates a fresh `webhookSecret` (32 random bytes, hex) even
|
|
155
|
+
* though the webhook receiver itself ships in P17 -- the anchor binds it
|
|
156
|
+
* from day one so the rotation history the hub sees is complete from the
|
|
157
|
+
* very first anchor.
|
|
158
|
+
*/
|
|
159
|
+
export declare function acquireGithubCredential(options?: AcquireGithubCredentialOptions): Promise<StoredGithubCredential>;
|
|
160
|
+
//# sourceMappingURL=github-credential.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github-credential.d.ts","sourceRoot":"","sources":["../../src/utils/github-credential.ts"],"names":[],"mappings":"AAeA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAIH,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,4DAA4D;IAC5D,KAAK,EAAE,MAAM,CAAC;IACd,oFAAoF;IACpF,aAAa,EAAE,MAAM,CAAC;IACtB,wEAAwE;IACxE,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,iHAAiH;AACjH,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED,kDAAkD;AAClD,wBAAgB,eAAe,IAAI,MAAM,CAExC;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAExD;AAgBD,wGAAwG;AACxG,wBAAgB,oBAAoB,IAAI,sBAAsB,GAAG,SAAS,CASzE;AAED,MAAM,MAAM,0BAA0B,GAClC;IACE,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,sBAAsB,CAAC;IACnC,gGAAgG;IAChG,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC,GACD;IAAE,MAAM,EAAE,UAAU,CAAA;CAAE,CAAC;AAE3B,MAAM,WAAW,2BAA2B;IAC1C;;;;;OAKG;IACH,iBAAiB,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;CAC3C;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,oBAAoB,CACxC,UAAU,EAAE,sBAAsB,EAClC,OAAO,EAAE,2BAA2B,GACnC,OAAO,CAAC,0BAA0B,CAAC,CAsBrC;AAID,oGAAoG;AACpG,eAAO,MAAM,u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