runTrainer(file?) | core/runner.ts | What arkor start calls under the hood. Resolves the entry, picks the trainer (preferring arkor, then trainer, then default export), runs start() + wait(). |
readCredentials() / writeCredentials() / ensureCredentials() | core/credentials.ts | Read or write ~/.arkor/credentials.json. ensureCredentials returns the existing record if present and bootstraps a fresh anonymous identity (calls requestAnonymousToken and persists it) when no credentials exist. Throws on a few paths: the credentials file exists but is unreadable / not valid JSON (readCredentials does a bare JSON.parse), or the anonymous-token bootstrap itself fails (network / token-endpoint error). The file is assumed to be SDK-written. |
requestAnonymousToken(baseUrl, kind?) | core/credentials.ts | Mint a fresh anonymous token directly. The CLI uses this on arkor login --anonymous and on first arkor dev. |
credentialsPath() | core/credentials.ts | Absolute path to ~/.arkor/credentials.json. |
readState(cwd?) / writeState(state, cwd?) / statePath(cwd?) | core/state.ts | Read or write .arkor/state.json (project routing). |
isArkor(value) | core/arkor.ts | Type guard for the manifest. |