Skip to content

Conversation

@robindiddams
Copy link
Member

@robindiddams robindiddams commented Jan 22, 2026

Changes

  • Change devmode endpoint from /cli/devmode/2 to /cli/devmode/3
  • Accept privateKey in response and save base64-encoded to config
  • Extract public key from saved private key and send to endpoint
  • Pass private key to gravity client via --private-key flag instead of --token
  • Make privateKey optional in response for key reuse scenarios

Summary by CodeRabbit

  • New Features

    • Dev mode now supports specifying a private key (PEM, base64-encoded) for authentication.
    • Private keys are automatically derived, returned by the endpoint when available, and persisted in your local config.
  • Updates

    • Dev mode endpoint upgraded to a new version and now uses private-key based authentication when starting the local runtime.

✏️ Tip: You can customize this high-level summary in your review settings.

- Change devmode endpoint from /cli/devmode/2 to /cli/devmode/3
- Accept privateKey in response and save base64-encoded to config
- Extract public key from saved private key and send to endpoint
- Pass private key to gravity client via --private-key flag instead of --token
- Make privateKey optional in response for key reuse scenarios
@coderabbitai
Copy link

coderabbitai bot commented Jan 22, 2026

📝 Walkthrough

Walkthrough

Adds client-side private-key support for dev mode: derive a publicKey from an optional privateKey, include it in the devmode API v3 request/response, persist a base64-encoded privateKey in config, and pass the privateKey to the Gravity client at startup.

Changes

Cohort / File(s) Summary
API Layer Updates
packages/cli/src/cmd/dev/api.ts
Added `extractPublicKeyPEM(privateKeyPEM: string): string
Dev Mode Orchestration
packages/cli/src/cmd/dev/index.ts
Decode/encode devmode.privateKey (base64) to savedPrivateKey; pass savedPrivateKey to generateEndpoint(); update savedPrivateKey from endpoint.privateKey when returned; persist base64-encoded privateKey in config; start Gravity with --private-key (base64-encoded PEM) instead of --token.
Configuration Schema
packages/cli/src/types.ts
Added optional privateKey to ConfigSchema.devmode with description "Development mode private key (base64-encoded PEM)", updating the exported Config type shape.
🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 165820b and 7c0346c.

📒 Files selected for processing (2)
  • packages/cli/src/cmd/dev/index.ts
  • packages/cli/src/types.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/cli/src/cmd/dev/index.ts
  • packages/cli/src/types.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
  • GitHub Check: SDK Integration Test Suite
  • GitHub Check: Playwright E2E Smoke Test
  • GitHub Check: Queue CLI Tests
  • GitHub Check: Framework Integration Tests (TanStack & Next.js)
  • GitHub Check: Package Installation & Usage Test
  • GitHub Check: Cloud Deployment Tests
  • GitHub Check: Sandbox CLI Tests
  • GitHub Check: Template Integration Tests
  • GitHub Check: Pack & Upload
  • GitHub Check: Build

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

github-actions bot commented Jan 22, 2026

📦 Canary Packages Published

version: 0.1.28-7c0346c

Packages
Package Version URL
@agentuity/core 0.1.28-7c0346c https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.28-7c0346c/agentuity-core-0.1.28-7c0346c.tgz
@agentuity/cli 0.1.28-7c0346c https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.28-7c0346c/agentuity-cli-0.1.28-7c0346c.tgz
@agentuity/server 0.1.28-7c0346c https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.28-7c0346c/agentuity-server-0.1.28-7c0346c.tgz
@agentuity/auth 0.1.28-7c0346c https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.28-7c0346c/agentuity-auth-0.1.28-7c0346c.tgz
@agentuity/workbench 0.1.28-7c0346c https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.28-7c0346c/agentuity-workbench-0.1.28-7c0346c.tgz
@agentuity/schema 0.1.28-7c0346c https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.28-7c0346c/agentuity-schema-0.1.28-7c0346c.tgz
@agentuity/frontend 0.1.28-7c0346c https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.28-7c0346c/agentuity-frontend-0.1.28-7c0346c.tgz
@agentuity/opencode 0.1.28-7c0346c https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.28-7c0346c/agentuity-opencode-0.1.28-7c0346c.tgz
@agentuity/evals 0.1.28-7c0346c https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.28-7c0346c/agentuity-evals-0.1.28-7c0346c.tgz
@agentuity/react 0.1.28-7c0346c https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.28-7c0346c/agentuity-react-0.1.28-7c0346c.tgz
@agentuity/runtime 0.1.28-7c0346c https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.28-7c0346c/agentuity-runtime-0.1.28-7c0346c.tgz
Install

Add to your package.json:

{
  "dependencies": {
    "@agentuity/core": "https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.28-7c0346c/agentuity-core-0.1.28-7c0346c.tgz",
    "@agentuity/cli": "https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.28-7c0346c/agentuity-cli-0.1.28-7c0346c.tgz",
    "@agentuity/server": "https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.28-7c0346c/agentuity-server-0.1.28-7c0346c.tgz",
    "@agentuity/auth": "https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.28-7c0346c/agentuity-auth-0.1.28-7c0346c.tgz",
    "@agentuity/workbench": "https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.28-7c0346c/agentuity-workbench-0.1.28-7c0346c.tgz",
    "@agentuity/schema": "https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.28-7c0346c/agentuity-schema-0.1.28-7c0346c.tgz",
    "@agentuity/frontend": "https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.28-7c0346c/agentuity-frontend-0.1.28-7c0346c.tgz",
    "@agentuity/opencode": "https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.28-7c0346c/agentuity-opencode-0.1.28-7c0346c.tgz",
    "@agentuity/evals": "https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.28-7c0346c/agentuity-evals-0.1.28-7c0346c.tgz",
    "@agentuity/react": "https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.28-7c0346c/agentuity-react-0.1.28-7c0346c.tgz",
    "@agentuity/runtime": "https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.28-7c0346c/agentuity-runtime-0.1.28-7c0346c.tgz"
  }
}

Or install directly:

bun add https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.28-7c0346c/agentuity-core-0.1.28-7c0346c.tgz
bun add https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.28-7c0346c/agentuity-cli-0.1.28-7c0346c.tgz
bun add https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.28-7c0346c/agentuity-server-0.1.28-7c0346c.tgz
bun add https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.28-7c0346c/agentuity-auth-0.1.28-7c0346c.tgz
bun add https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.28-7c0346c/agentuity-workbench-0.1.28-7c0346c.tgz
bun add https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.28-7c0346c/agentuity-schema-0.1.28-7c0346c.tgz
bun add https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.28-7c0346c/agentuity-frontend-0.1.28-7c0346c.tgz
bun add https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.28-7c0346c/agentuity-opencode-0.1.28-7c0346c.tgz
bun add https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.28-7c0346c/agentuity-evals-0.1.28-7c0346c.tgz
bun add https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.28-7c0346c/agentuity-react-0.1.28-7c0346c.tgz
bun add https://agentuity-sdk-objects.t3.storage.dev/npm/0.1.28-7c0346c/agentuity-runtime-0.1.28-7c0346c.tgz
CLI Executables
Platform Version URL
linux-arm64 0.1.28-7c0346c https://agentuity-sdk-objects.t3.storage.dev/binary/0.1.28-7c0346c/agentuity-linux-arm64.gz
darwin-arm64 0.1.28-7c0346c https://agentuity-sdk-objects.t3.storage.dev/binary/0.1.28-7c0346c/agentuity-darwin-arm64.gz
darwin-x64 0.1.28-7c0346c https://agentuity-sdk-objects.t3.storage.dev/binary/0.1.28-7c0346c/agentuity-darwin-x64.gz
linux-x64 0.1.28-7c0346c https://agentuity-sdk-objects.t3.storage.dev/binary/0.1.28-7c0346c/agentuity-linux-x64.gz
Run Canary CLI
agentuity canary 0.1.28-7c0346c [command] [...args]

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@packages/cli/src/cmd/dev/index.ts`:
- Around line 1094-1095: The code is currently passing an empty base64 string
for the gravity --private-key flag when both devmode.privateKey and
savedPrivateKey are missing; change the arg construction so you only push the
'--private-key' flag and Buffer.from(...).toString('base64') when a non-empty
key exists (use the combinedKey = devmode.privateKey ?? savedPrivateKey check),
otherwise omit the flag (or emit a concise warning before launching). Update the
logic around the existing array construction that currently includes
'--private-key' and Buffer.from(devmode.privateKey ?? savedPrivateKey ??
'').toString('base64') to conditionally add both entries only when combinedKey
is truthy.

In `@packages/cli/src/types.ts`:
- Line 27: The schema description for privateKey (privateKey:
zod.string().optional().describe('Development mode private key (PEM)')) is
ambiguous because config actually persists a base64-encoded PEM; update the
description to reflect the stored format (e.g., change the describe text to
"Development mode private key (base64-encoded PEM)") or modify storage to
persist raw PEM consistently—ensure the change is applied to the privateKey
schema in types.ts and any code that reads/writes this config is updated to
encode/decode accordingly.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 02b8e3a and 165820b.

📒 Files selected for processing (3)
  • packages/cli/src/cmd/dev/api.ts
  • packages/cli/src/cmd/dev/index.ts
  • packages/cli/src/types.ts
🧰 Additional context used
📓 Path-based instructions (4)
packages/cli/src/**/*.ts

📄 CodeRabbit inference engine (packages/cli/AGENTS.md)

Use Bun.file(f).exists() instead of existsSync(f) for file existence checks

Files:

  • packages/cli/src/types.ts
  • packages/cli/src/cmd/dev/index.ts
  • packages/cli/src/cmd/dev/api.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Use Prettier formatter with tabs (width 3), single quotes, and semicolons for TypeScript files
Use TypeScript strict mode with ESNext target and bundler moduleResolution
Use StructuredError from @agentuity/core for error handling

Files:

  • packages/cli/src/types.ts
  • packages/cli/src/cmd/dev/index.ts
  • packages/cli/src/cmd/dev/api.ts
packages/cli/src/cmd/*/index.ts

📄 CodeRabbit inference engine (packages/cli/AGENTS.md)

packages/cli/src/cmd/*/index.ts: Each command must be a directory in src/cmd/ with an index.ts file as the main entry point
Always define interfaces for command options instead of using any type

Files:

  • packages/cli/src/cmd/dev/index.ts
packages/cli/src/cmd/**/*.ts

📄 CodeRabbit inference engine (packages/cli/AGENTS.md)

packages/cli/src/cmd/**/*.ts: Use tui.* helpers for formatted output instead of raw console logs
Use ctx.logger for logging; call logger.fatal() to log and exit with code 1

Files:

  • packages/cli/src/cmd/dev/index.ts
  • packages/cli/src/cmd/dev/api.ts
🧠 Learnings (1)
📚 Learning: 2025-12-21T00:31:41.858Z
Learnt from: jhaynie
Repo: agentuity/sdk PR: 274
File: packages/cli/src/cmd/build/vite/server-bundler.ts:12-41
Timestamp: 2025-12-21T00:31:41.858Z
Learning: In Bun runtime, BuildMessage and ResolveMessage are global types and are not exported from the bun module. Do not import { BuildMessage } from 'bun' or similar; these types are available globally and should be used without import. This applies to all TypeScript files that target the Bun runtime within the repository.

Applied to files:

  • packages/cli/src/types.ts
  • packages/cli/src/cmd/dev/index.ts
  • packages/cli/src/cmd/dev/api.ts
🧬 Code graph analysis (2)
packages/cli/src/cmd/dev/index.ts (2)
packages/cli/src/cmd/dev/api.ts (1)
  • generateEndpoint (44-65)
packages/cli/src/types.ts (1)
  • Config (68-68)
packages/cli/src/cmd/dev/api.ts (1)
packages/server/src/api/api.ts (1)
  • APIClient (90-678)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Build
  • GitHub Check: SDK Integration Test Suite
  • GitHub Check: Playwright E2E Smoke Test
  • GitHub Check: Cloud Deployment Tests
  • GitHub Check: Sandbox CLI Tests
🔇 Additional comments (3)
packages/cli/src/cmd/dev/api.ts (2)

5-27: Key-related request/response schema updates look consistent.
Optional publicKey / privateKey additions fit the reuse flow and keep payloads flexible.


41-57: Endpoint upgrade and payload wiring look good.
The v3 path update and conditional publicKey inclusion align with the new API contract.

packages/cli/src/cmd/dev/index.ts (1)

380-407: Config persistence flow for the private key looks coherent.
Decoding for reuse and re‑encoding on save keeps config consistency.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

@robindiddams robindiddams merged commit 9014bce into main Jan 23, 2026
14 checks passed
@robindiddams robindiddams deleted the robin/devmode-v3 branch January 23, 2026 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants