@deepdockai/cli 1.0.5 → 1.0.6

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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.6
4
+
5
+ - The agent skill's TypeScript client types a device's `hostname`, `os` and `clientVersion` as `string | null`, as the API answers them before the device has reported them. The skill names `GET /v1/devices` and `GET /v1/devices/{deviceId}`.
6
+
3
7
  ## 1.0.5
4
8
 
5
9
  - The agent skill's clients: `systems()` is typed as the list of systems the API answers, and a paired `Device` lists its systems as objects, with `outdated` and a `claimedAt` that can be `null`.
package/dist/deepdock.js CHANGED
@@ -11424,7 +11424,7 @@ import { spawn } from "node:child_process";
11424
11424
  import { homedir, hostname } from "node:os";
11425
11425
 
11426
11426
  // src/version.ts
11427
- var VERSION = "1.0.5";
11427
+ var VERSION = "1.0.6";
11428
11428
 
11429
11429
  // src/runtime.ts
11430
11430
  var DEFAULT_BASE_URL = "https://api.deepdock.ai";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deepdockai/cli",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "Deepdock partner CLI: pair devices, see systems and actions, create the API key your code runs them with.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -31,6 +31,7 @@
31
31
  "lint:fix": "biome lint --write .",
32
32
  "typecheck": "tsc --noEmit",
33
33
  "gen:codes": "bun scripts/genCodes.ts",
34
+ "gen:devices": "bun scripts/genDevices.ts",
34
35
  "check:public": "bun scripts/checkPublic.ts --pack",
35
36
  "test": "bun run build && bun --bun vitest run",
36
37
  "test:node": "vitest run",
@@ -84,9 +84,10 @@ curl -X POST "$BASE/v1/devices" \
84
84
  ```
85
85
 
86
86
  `label` is optional, 1 to 100 characters. The device must be online. Answer: `201` with the device
87
- (`id`, `label`, `hostname`, `os`, `clientVersion`, `status`, `lastSeenAt`, `claimedAt`, `systems`,
88
- and `updateAvailable` when it runs an older build). Keep `id`: it is the `deviceId` of every later
89
- call, and there is no `/v1` call to list devices (use `deepdock devices list` or the dashboard).
87
+ (`id`, `label`, `hostname`, `os`, `clientVersion`, `status`, `lastSeenAt`, `claimedAt`, `outdated`, `systems`,
88
+ and `updateAvailable` when it runs an older build); `hostname`, `os` and `clientVersion` are `null`
89
+ until the device has reported them. Keep `id`: it is the `deviceId` of every later call.
90
+ `GET /v1/devices` lists your devices and `GET /v1/devices/{deviceId}` reads one, in the same shape.
90
91
 
91
92
  4. Release with `DELETE /v1/devices/{deviceId}`; the device then shows a new code.
92
93
 
@@ -46,9 +46,9 @@ export type SystemAccess = 'ok' | 'outdated' | 'missing' | 'not_set_up' | null
46
46
  export type Device = {
47
47
  id: string
48
48
  label: string | null
49
- hostname: string
50
- os: string
51
- clientVersion: string
49
+ hostname: string | null
50
+ os: string | null
51
+ clientVersion: string | null
52
52
  status: 'connected' | 'offline' | 'inactive'
53
53
  lastSeenAt: string | null
54
54
  claimedAt: string | null
@@ -58,6 +58,8 @@ export type Device = {
58
58
  systems: { system: string; version: string | null; status: SystemStatus; access: SystemAccess; reportedAt: string }[]
59
59
  }
60
60
 
61
+ export type PairBody = { code: string; label?: string }
62
+
61
63
  export type ActionState =
62
64
  | { action: string; state: 'active' }
63
65
  | { action: string; state: 'paused'; reason: 'structure_changed' | 'check_failed'; pausedAt: string }
@@ -199,11 +201,12 @@ export class Deepdock {
199
201
 
200
202
  /** Claims a device by the pairing code it shows. Keep the returned `id`. */
201
203
  async pair(code: string, label?: string): Promise<Device> {
204
+ const body: PairBody = label === undefined ? { code } : { code, label }
202
205
  return (
203
206
  await this.send<Device>('/v1/devices', {
204
207
  method: 'POST',
205
208
  headers: { 'Content-Type': 'application/json' },
206
- body: JSON.stringify(label === undefined ? { code } : { code, label }),
209
+ body: JSON.stringify(body),
207
210
  })
208
211
  ).data
209
212
  }