@kynver-app/runtime 0.2.23 → 0.2.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -18
- package/dist/bootstrap.d.ts +48 -0
- package/dist/cli.d.ts +11 -0
- package/dist/cli.js +73 -65
- package/dist/daemon-keeper.d.ts +32 -0
- package/dist/doctor/runner-install.d.ts +86 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.js +95 -87
- package/dist/orchestration-providers/inventory.d.ts +27 -4
- package/dist/providers/model-preflight.d.ts +8 -0
- package/dist/providers/openai-compatible-response.d.ts +23 -0
- package/dist/providers/openai-compatible-runner.d.ts +1 -0
- package/dist/providers/openai-compatible.d.ts +46 -0
- package/dist/server/cleanup.js +14 -14
- package/dist/server/default-repo.js +1 -1
- package/dist/server/model-routing.js +4 -4
- package/dist/server/monitor.js +7 -7
- package/dist/server/orchestration.d.ts +1 -1
- package/dist/server/orchestration.js +1 -1
- package/dist/server/worker-policy.d.ts +1 -1
- package/dist/server/worker-policy.js +2 -2
- package/dist/status.d.ts +3 -1
- package/dist/stream.d.ts +13 -0
- package/dist/worker-provider-policy.d.ts +21 -4
- package/dist/worker-usage.d.ts +20 -0
- package/dist/worktree.d.ts +33 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -1,33 +1,49 @@
|
|
|
1
1
|
# @kynver-app/runtime
|
|
2
2
|
|
|
3
|
-
Standalone Kynver AgentOS execution runtime and CLI (`kynver`).
|
|
3
|
+
Standalone Kynver AgentOS execution runtime and CLI (`kynver`) — run Kynver's agent harness on **your own machine**, on your own provider subscriptions. Provider credentials stay local to the box; the daemon talks to Kynver over scoped, revocable `krc1.*` runner tokens.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Requirements
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
- **Node.js 24.11.0+** (npm 11). This is a hard engine floor: below it the CLI **fails closed at startup** — every work-executing command refuses to run, and only `--version` and the `doctor` diagnostic commands stay reachable for diagnosis. Check any host with:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
kynver doctor node-runtime # report-only JSON classification + remediation
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
- A worker-provider CLI on PATH with an active login/subscription (see [Worker providers](#worker-providers)).
|
|
14
|
+
- **Agentic OS access** on your Kynver account. Access is **admin-approved**: if `kynver bootstrap` reports that your account has no access, request it at <https://www.kynver.com/agent-os/early-access> — once approved, your account works here with no further changes (just re-run `kynver bootstrap`).
|
|
15
|
+
|
|
16
|
+
## Quick start
|
|
11
17
|
|
|
12
18
|
```bash
|
|
13
|
-
|
|
19
|
+
npm install -g @kynver-app/runtime
|
|
20
|
+
kynver bootstrap --api-base-url https://www.kynver.com
|
|
21
|
+
kynver start
|
|
14
22
|
```
|
|
15
23
|
|
|
16
|
-
|
|
24
|
+
That is the whole golden path: `bootstrap` links this machine to your account and workspace; `start` brings the agent online (keeper-supervised daemon — Ctrl-C stops it). For a persistent background agent on Linux: `kynver start --install-systemd`.
|
|
25
|
+
|
|
26
|
+
### What `kynver bootstrap` does
|
|
27
|
+
|
|
28
|
+
1. **Device login** — prints a URL and a short code; approve in the browser. No API-key pasting; the minted key is saved to `~/.kynver/credentials`.
|
|
29
|
+
2. **Workspace resolution** — resolves your account's primary AgentOS workspace. If the account is not approved for Agentic OS yet, bootstrap says so and links the request page (see Requirements above).
|
|
30
|
+
3. **Machine setup** — persists `~/.kynver/config.json` (API base URL, workspace id, repo discovery, worker caps, box identity) and mints a scoped `krc1.*` runner credential.
|
|
31
|
+
|
|
32
|
+
Bootstrap does **not** start any work — bringing workers online is `kynver start`.
|
|
33
|
+
|
|
34
|
+
### Troubleshooting → `kynver doctor runner-install`
|
|
35
|
+
|
|
36
|
+
If `bootstrap` or `start` fails, or the agent seems dead:
|
|
17
37
|
|
|
18
38
|
```bash
|
|
19
|
-
|
|
20
|
-
npm run kynver -- setup --api-base-url http://localhost:3000 --agent-os-id <id> [--repo /path/to/repo] --max-workers 13
|
|
21
|
-
npm run kynver -- login --api-key "$KYNVER_API_KEY"
|
|
22
|
-
npm run kynver -- runner credential --agent-os-id <id>
|
|
23
|
-
npm run kynver -- config ensure-default-repo # persist defaultRepo in ~/.kynver/config.json
|
|
24
|
-
npm run kynver -- run create [--repo /path/to/repo] --name my-run
|
|
25
|
-
npm run kynver -- daemon --run <runId> --agent-os-id <id> --execute
|
|
39
|
+
kynver doctor runner-install
|
|
26
40
|
```
|
|
27
41
|
|
|
42
|
+
It walks the whole first-run lifecycle — install, device login, workspace binding, repo selection, runner credential, daemon liveness — plus the first-run blockers: worker-provider CLI on PATH, `boxKind` identity, repo base ref (`origin/main` / remote default branch), and live API reachability/auth (a 401 means a revoked key → `kynver login`; a 403 means access is gated → request it at the early-access page). Every failing check carries the exact command that fixes it.
|
|
43
|
+
|
|
28
44
|
### Callback auth (scoped runner tokens)
|
|
29
45
|
|
|
30
|
-
User-hosted runners should **not** use deployment-wide `OPENCLAW_CRON_SECRET` / `KYNVER_RUNTIME_SECRET`.
|
|
46
|
+
User-hosted runners should **not** use deployment-wide `OPENCLAW_CRON_SECRET` / `KYNVER_RUNTIME_SECRET`. `kynver bootstrap` mints a workspace-bound token automatically; to re-mint one:
|
|
31
47
|
|
|
32
48
|
```bash
|
|
33
49
|
kynver runner credential --agent-os-id <id>
|
|
@@ -40,12 +56,15 @@ Global env secrets are accepted on by-id callbacks **only** when the deployment
|
|
|
40
56
|
## CLI verbs
|
|
41
57
|
|
|
42
58
|
```text
|
|
59
|
+
bootstrap | start | status | setup | login | daemon
|
|
43
60
|
run create | list | status | dispatch | sweep
|
|
44
61
|
worker start | status | tail | stop | complete
|
|
45
|
-
|
|
62
|
+
runner credential [mint|status|list|revoke|rotate]
|
|
63
|
+
config ensure-default-repo
|
|
64
|
+
doctor runner-install | node-runtime | local-store | context-envelope | runtime-takeover
|
|
46
65
|
```
|
|
47
66
|
|
|
48
|
-
`scripts/opus-harness.mjs` is a compatibility shim that delegates to this package.
|
|
67
|
+
Run `kynver help` for the full flag-level usage. `scripts/opus-harness.mjs` is a compatibility shim that delegates to this package.
|
|
49
68
|
|
|
50
69
|
## Worker providers
|
|
51
70
|
|
|
@@ -63,6 +82,21 @@ Install Cursor CLI (Windows PowerShell): `irm 'https://cursor.com/install?win32=
|
|
|
63
82
|
|
|
64
83
|
Default Cursor model: `composer-2.5`. Override with `--model` on dispatch/worker start.
|
|
65
84
|
|
|
85
|
+
## Advanced / monorepo development
|
|
86
|
+
|
|
87
|
+
Power users and monorepo contributors can drive the harness explicitly instead of `kynver start` (from the Kynver repo root, `npm run kynver -- <verb…>` invokes the workspace build):
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
kynver setup --api-base-url http://localhost:3000 --agent-os-id <id> [--repo /path/to/repo] --max-workers 13
|
|
91
|
+
kynver login --api-key "$KYNVER_API_KEY"
|
|
92
|
+
kynver runner credential --agent-os-id <id>
|
|
93
|
+
kynver config ensure-default-repo # persist defaultRepo in ~/.kynver/config.json
|
|
94
|
+
kynver run create [--repo /path/to/repo] --name my-run
|
|
95
|
+
kynver daemon --run <runId> --agent-os-id <id> --execute
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
New runs are cut from `origin/main`; when that ref does not exist the run falls back to the remote default branch (`origin/HEAD`), and `--base <ref>` / `KYNVER_RUN_BASE_REF` / `defaultBase` in `~/.kynver/config.json` override the base explicitly.
|
|
99
|
+
|
|
66
100
|
### Targeted dispatch (after creating a board task)
|
|
67
101
|
|
|
68
102
|
Broad `lane:any` dispatch still sweeps the ready queue (review lane first, then priority/age). To start **one specific task** you just created — without admitting an older ready row — pass the task id:
|
package/dist/bootstrap.d.ts
CHANGED
|
@@ -1 +1,49 @@
|
|
|
1
|
+
interface PrimaryAgentOs {
|
|
2
|
+
id: string;
|
|
3
|
+
slug: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Workspace resolution outcome, discriminated so the CLI can tell "your
|
|
7
|
+
* account is not approved for Agentic OS" (HTTP 401/403 — a human/approval
|
|
8
|
+
* problem) apart from "the network/server is unhappy" (a retry problem).
|
|
9
|
+
*/
|
|
10
|
+
export type PrimaryAgentOsResult = {
|
|
11
|
+
ok: true;
|
|
12
|
+
primary: PrimaryAgentOs;
|
|
13
|
+
} | {
|
|
14
|
+
ok: false;
|
|
15
|
+
kind: "access_denied";
|
|
16
|
+
status: number;
|
|
17
|
+
} | {
|
|
18
|
+
ok: false;
|
|
19
|
+
kind: "no_workspace";
|
|
20
|
+
status: number;
|
|
21
|
+
} | {
|
|
22
|
+
ok: false;
|
|
23
|
+
kind: "server_error";
|
|
24
|
+
status: number;
|
|
25
|
+
} | {
|
|
26
|
+
ok: false;
|
|
27
|
+
kind: "network";
|
|
28
|
+
detail: string;
|
|
29
|
+
};
|
|
30
|
+
/** Where a gated account requests Agentic OS access (admin-approved). */
|
|
31
|
+
export declare function agentOsAccessRequestUrl(base?: string): string;
|
|
32
|
+
/**
|
|
33
|
+
* The access-gated message: Agentic OS access is admin-approved, so a 401/403
|
|
34
|
+
* here is not a bug on the user's box — it means the account needs approval.
|
|
35
|
+
*/
|
|
36
|
+
export declare function formatAgentOsAccessGatedMessage(base?: string): string;
|
|
37
|
+
/** The retry-oriented message for network/transport failures (not an access problem). */
|
|
38
|
+
export declare function formatBootstrapNetworkErrorMessage(base: string, detail: string): string;
|
|
39
|
+
/** Resolve the account's primary AgentOS workspace (id + slug) via GET /api/agent-os. */
|
|
40
|
+
export declare function fetchPrimaryAgentOs(base: string, apiKey: string, fetchImpl?: typeof fetch): Promise<PrimaryAgentOsResult>;
|
|
41
|
+
/**
|
|
42
|
+
* Classify a runner-credential mint failure by its error message.
|
|
43
|
+
* `fetchRunnerCredential` embeds the HTTP status as `(NNN)`; 401/403 mean the
|
|
44
|
+
* account/workspace is gated or the key was revoked — an approval problem the
|
|
45
|
+
* early-access page solves, not something a retry fixes.
|
|
46
|
+
*/
|
|
47
|
+
export declare function classifyRunnerCredentialMintError(message: string): "access_denied" | "transient";
|
|
1
48
|
export declare function runBootstrap(args: Record<string, string | boolean>): Promise<void>;
|
|
49
|
+
export {};
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Every routable CLI verb path, exactly as `main()` dispatches them. This is
|
|
4
|
+
* the docs-truth contract: the README + user-hosted-runner runbook tests pin
|
|
5
|
+
* every `kynver <verb…>` command they mention against this list, so a doc can
|
|
6
|
+
* never again teach a command that does not exist (`kynver runner start`,
|
|
7
|
+
* bare `kynver doctor`, `kynver selftest`). Keep in lockstep with the
|
|
8
|
+
* scope/action routing in `main()` below.
|
|
9
|
+
*/
|
|
10
|
+
export declare const KNOWN_CLI_VERBS: readonly string[];
|
|
11
|
+
/** Snapshot of {@link KNOWN_CLI_VERBS} for docs-truth tests and tooling. */
|
|
12
|
+
export declare function listKnownCliVerbs(): string[];
|
|
2
13
|
export declare function usage(code?: number): never;
|
|
3
14
|
export declare function main(argv?: string[]): Promise<void>;
|