Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
338e5bd
Add Developer mode and plain device names (Local - Device, Auto (Cloud))
jamessburnss1313-dev Nov 19, 2026
3dbdde7
Dev effort: Fast (low) is a valid saved choice
jamessburnss1313-dev Nov 19, 2026
a48ac87
Chat to Dev handoff in one module, with a test
jamessburnss1313-dev Nov 19, 2026
5e05372
Copy to clipboard in one place; a refused clipboard throws nothing
jamessburnss1313-dev Nov 19, 2026
29de692
Fix: a suggestion row does its act once
jamessburnss1313-dev Nov 19, 2026
337d26b
Fix: Regenerate only where wired; a failed verdict rolls back
jamessburnss1313-dev Nov 19, 2026
5619469
Fix: Keep computer awake toggles once; remove dead run and desk controls
jamessburnss1313-dev Nov 19, 2026
18601c5
Fix: credits refresh after a card is added
jamessburnss1313-dev Nov 19, 2026
1f77611
Fix: Make with AI row cannot overflow
jamessburnss1313-dev Nov 19, 2026
b222ead
Dev screens redesign: landing, library, shelf, project, forge, plans,…
jamessburnss1313-dev Nov 19, 2026
58688fc
Keep computer awake: checkbox row, on only when the lock is granted, …
jamessburnss1313-dev Nov 19, 2026
20d481c
A failed verdict never wipes a newer one
jamessburnss1313-dev Nov 19, 2026
e1a5f5f
Device names keep the machine's own name; translation keys untouched
jamessburnss1313-dev Nov 19, 2026
cc47e15
Export handoff; drop third-party filtering fields not on main
jamessburnss1313-dev Nov 19, 2026
c11274a
Route every clipboard write through clipboard.ts
jamessburnss1313-dev Nov 19, 2026
1acd998
Restore Hanzo's own controls and ungate Developer-mode hiding; use ui…
jamessburnss1313-dev Nov 19, 2026
4c62706
Cut style-only changes; hand-made buttons back to render=button; keep…
jamessburnss1313-dev Nov 19, 2026
d1aed88
Shell tab and Serving badge for everyone; keep-awake releases late gr…
jamessburnss1313-dev Nov 19, 2026
598a44c
chore(release): bump @hanzo/build to 0.2.127
Nov 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hanzo/build",
"version": "0.2.126",
"version": "0.2.127",
"type": "module",
"license": "Apache-2.0 OR MIT",
"description": "Hanzo Build — say what you want, watch it built, deployed and running. The builder as a component, mounted by the Hanzo app at hanzo.ai.",
Expand Down Expand Up @@ -68,6 +68,16 @@
"import": "./lib/mind.js",
"default": "./lib/mind.js"
},
"./handoff": {
"types": "./lib/handoff.d.ts",
"import": "./lib/handoff.js",
"default": "./lib/handoff.js"
},
"./dev-mode": {
"types": "./lib/dev-mode.d.ts",
"import": "./lib/dev-mode.js",
"default": "./lib/dev-mode.js"
},
"./package.json": "./package.json"
},
"files": [
Expand Down
28 changes: 28 additions & 0 deletions src/api/devices.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { describe, expect, it } from 'vitest'

import { displayMachine, machine } from './machines.ts'
import { displayPlace, SANDBOX } from './places.ts'

describe('device names a person reads', () => {
it('keeps a laptop\u2019s own name in Simple mode, with its hardware as the detail', () => {
const m = machine({
id: 'tgt_1',
label: 'MacBook-Pro.local',
kind: 'laptop',
host: 'MacBook-Pro.local',
status: 'online',
metricsAt: '2026-10-04T06:00:00Z',
spec: { os: 'darwin', arch: 'arm64', cpus: 16, memory: 64 * 1024 * 1024 * 1024, gpus: [{ model: 'Apple M2' }] },
})
expect(displayMachine(m, { devMode: false })).toEqual({ title: 'MacBook-Pro', detail: 'Apple M2 · 64 GB · MacBook-Pro.local' })
expect(displayMachine(m, { devMode: true }).title).toBe('MacBook-Pro.local')
})

it('names the cloud workspace Auto (Cloud), or Cloud for a developer', () => {
expect(displayPlace(SANDBOX, { devMode: false })).toEqual({
title: 'Auto (Cloud)',
detail: 'Runs automatically in your Hanzo cloud workspace',
})
expect(displayPlace(SANDBOX, { devMode: true }).title).toBe('Cloud')
})
})
22 changes: 18 additions & 4 deletions src/api/machines.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
* hostname and keeps it online while it runs.
*/
import { phrase } from '@hanzo/i18n'
import type { Say } from '@hanzo/i18n/react'

import { formatDeviceLabel } from '../dev-mode.ts'
import { call, Refusal, seg, type Target } from './call.ts'

export const KINDS = ['laptop', 'gpu', 'cloud', 'cluster', 'machine'] as const
Expand Down Expand Up @@ -119,17 +121,29 @@ export function formatRelative(isoDate?: string): string {
export function specSummary(m: Machine): string {
if (m.spec) {
const parts: string[] = []
if (m.spec.cpus) parts.push(`${m.spec.cpus} vCPU`)
if (m.spec.memory) parts.push(formatBytes(m.spec.memory))
if (m.spec.gpus && m.spec.gpus.length > 0) {
const g = m.spec.gpus[0]
parts.push(`${m.spec.gpus.length}× ${g.model || g.vendor || 'GPU'}${g.memory ? ` (${formatBytes(g.memory)})` : ''}`)
const g = m.spec.gpus[0]!
const gpuLabel = g.model || g.vendor || 'GPU'
parts.push(m.spec.gpus.length > 1 ? `${m.spec.gpus.length}× ${gpuLabel}` : gpuLabel)
} else if (m.spec.cpus) {
parts.push(`${m.spec.cpus} vCPU`)
}
if (m.spec.memory) parts.push(formatBytes(m.spec.memory))
if (parts.length > 0) return parts.join(' · ')
}
return m.capacity || ''
}

function hardwareSummary(m: Machine): string {
const hw = specSummary(m)
const host = m.host && m.host !== hw ? m.host : ''
return [hw, host].filter(Boolean).join(' · ')
}

export function displayMachine(m: Machine, opts?: { devMode?: boolean; say?: Say }): { title: string; detail?: string } {
return formatDeviceLabel(m.label, { hardware: hardwareSummary(m), host: m.host, devMode: opts?.devMode, say: opts?.say })
}

export function machine(raw: unknown): Machine {
const o = (raw && typeof raw === 'object' ? raw : {}) as Record<string, unknown>
const specObj = obj(o.spec)
Expand Down
22 changes: 16 additions & 6 deletions src/api/places.ts
Original file line number Diff line number Diff line change
@@ -1,36 +1,46 @@
/**
* Where a run can run: the platform's sandbox, or one of the org's machines.
* Where a run can run: the platform's cloud workspace, or one of the org's machines.
*
* GET /v1/agent/targets → {targets: [...]}, newest first (machines.ts)
*
* The sandbox is not a row the platform lists — it is what a run gets when it
* The cloud workspace is not a row the platform lists — it is what a run gets when it
* names no target — so it is the first place here and carries no id. A machine
* can take a run only while it is online.
*/
import { phrase } from '@hanzo/i18n'

import type { Say } from '@hanzo/i18n/react'

import { formatDeviceLabel } from '../dev-mode.ts'
import { english } from '../say.ts'
import type { Target } from './call.ts'
import { machines, state } from './machines.ts'

export interface Place {
/** `tgt_…`, or '' for the sandbox. */
/** `tgt_…`, or '' for the cloud workspace. */
id: string
label: string
/** laptop | gpu | cloud | … as the platform names it; 'sandbox' for the sandbox. */
/** laptop | gpu | cloud | … as the platform names it; 'sandbox' for the cloud workspace. */
kind: string
/** online | offline | draining | not seen yet, as machines.ts `state` reads it; the sandbox is always online. */
/** online | offline | draining | not seen yet, as machines.ts `state` reads it; the cloud workspace is always online. */
status: string
/** "10 vCPU / 122G / 1× GB10", when the machine reported one. */
capacity: string
}

/** The sandbox, named in English and marked (`phrase`): a screen draws its label through `t`. */
/** The cloud workspace, named in English and marked (`phrase`): a screen draws its label through `t`. */
export const SANDBOX: Place = { id: '', label: phrase('Hanzo sandbox'), kind: 'sandbox', status: 'online', capacity: '' }

export async function places(t: Target): Promise<Place[]> {
const list = await machines(t)
return [SANDBOX, ...list.map((m) => ({ id: m.id, label: m.label, kind: m.kind, status: state(m), capacity: m.capacity }))]
}

export function displayPlace(p: Place, opts?: { devMode?: boolean; say?: Say }): { title: string; detail?: string } {
const say = opts?.say ?? english
if (!p.id) return opts?.devMode ? { title: 'Cloud' } : { title: say('Auto (Cloud)'), detail: say('Runs automatically in your Hanzo cloud workspace') }
return formatDeviceLabel(p.label, { hardware: p.capacity, devMode: opts?.devMode, say })
}

/** Whether a run sent here now would be taken. */
export const ready = (p: Place): boolean => p.status === 'online'
Loading
Loading