@deepdockai/cli 1.8.0 → 1.9.0

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,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.9.0
4
+
5
+ - The current device API: every system in `GET /v1/devices` and `GET /v1/devices/{deviceId}` carries `actions`, one entry per action of yours on that system that Deepdock can serve: `{ action, available, reason }`, where `available` is `true` (admitted now), `false` (`reason` is the error code a call answers with now) or `null` (unknown, not unavailable: call it). A stopped system carries `execution` (`{ "status": "stopped", "reason": "device_outdated" | "internal_error" }`) in the device listing, in `GET /v1/devices/{deviceId}/systems` and on each of its actions in the action index. The pinned device API, the bundled TypeScript client's `Device` and `DeviceSystem` types (new `ActionAvailability`, `UnavailableReason` and `ExecutionStop`) and the concepts reference describe both.
6
+
7
+ ## 1.8.1
8
+
9
+ - The current device API: a device's `hostname` and `os` are always strings now (never `null`), in the pinned device API, the bundled TypeScript client's `Device` type and the keys reference. A device registered before both were required reads `unknown`.
10
+
3
11
  ## 1.8.0
4
12
 
5
13
  - The current device API: the error code list gains `upload_incomplete` (400, exit 3: an upload broke off before the device had the whole file; this call wrote nothing, so send it again with the same file and the same `Idempotency-Key`).
package/dist/deepdock.js CHANGED
@@ -11445,7 +11445,7 @@ import { spawn } from "node:child_process";
11445
11445
  import { homedir, hostname } from "node:os";
11446
11446
 
11447
11447
  // src/version.ts
11448
- var VERSION = "1.8.0";
11448
+ var VERSION = "1.9.0";
11449
11449
 
11450
11450
  // src/runtime.ts
11451
11451
  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.8.0",
3
+ "version": "1.9.0",
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",
@@ -86,8 +86,8 @@ curl -X POST "$BASE/v1/devices" \
86
86
 
87
87
  `label` is optional, 1 to 100 characters. The device must be online. Answer: `201` with the device
88
88
  (`id`, `label`, `hostname`, `os`, `clientVersion`, `status`, `lastSeenAt`, `lastKnownAt`, `claimedAt`, `outdated`, `systems`,
89
- and `updateAvailable` when it runs an older build); `hostname`, `os` and `clientVersion` are `null`
90
- until the device has reported them. Keep `id`: it is the `deviceId` of every later call.
89
+ and `updateAvailable` when it runs an older build); `clientVersion` is `null`
90
+ until the device has reported it. Keep `id`: it is the `deviceId` of every later call.
91
91
  `GET /v1/devices` lists your devices a page at a time (`{ data: [...], nextCursor }`; pass `nextCursor` back as `cursor` until it is `null`, `limit` 1 to 500, default 100), and `GET /v1/devices/{deviceId}` reads one; each device has the same shape. `GET /v1/incidents` pages the same way.
92
92
 
93
93
  4. Release with `DELETE /v1/devices/{deviceId}`; the device then shows a new code.
@@ -69,11 +69,40 @@ export type SystemAccess = 'ok' | 'outdated' | 'missing' | 'password_missing' |
69
69
  /** Why a system's `version` is missing, when the device says. */
70
70
  export type VersionIssue = 'not_installed' | 'not_found' | 'unreadable'
71
71
 
72
+ /** Present while the device cannot use the target Deepdock sent for the system: every action of it answers with `reason` (`409 device_outdated` or `500 internal_error`). */
73
+ export type ExecutionStop = { status: 'stopped'; reason: 'device_outdated' | 'internal_error' }
74
+
75
+ /** The error code a call would answer with now, when a check refuses it; where several apply, the first in this order. */
76
+ export type UnavailableReason =
77
+ | 'device_learning_only'
78
+ | 'device_syncing'
79
+ | 'device_outdated'
80
+ | 'internal_error'
81
+ | 'device_connected_twice'
82
+ | 'device_offline'
83
+ | 'action_paused'
84
+ | 'credentials_rejected'
85
+ | 'certificate_changed'
86
+ | 'system_unavailable'
87
+ | 'access_missing'
88
+ | 'access_outdated'
89
+ | 'version_not_covered'
90
+ | 'action_not_configured'
91
+
92
+ /**
93
+ * Whether a fresh call would be admitted now: a snapshot, not a promise. `available: null` is unknown, not unavailable:
94
+ * call the action or read it again later. Test `available === false` for the refused ones; `!available` also matches `null`.
95
+ */
96
+ export type ActionAvailability =
97
+ | { action: string; available: true; reason: null }
98
+ | { action: string; available: false; reason: UnavailableReason }
99
+ | { action: string; available: null; reason: null }
100
+
72
101
  export type Device = {
73
102
  id: string
74
103
  label: string | null
75
- hostname: string | null
76
- os: string | null
104
+ hostname: string
105
+ os: string
77
106
  clientVersion: string | null
78
107
  status: 'connected' | 'offline' | 'inactive'
79
108
  lastSeenAt: string | null
@@ -95,6 +124,9 @@ export type Device = {
95
124
  reportedAt: string
96
125
  /** Actions this device's client cannot run yet: each answers device_outdated until it updates. Absent when none. */
97
126
  blockedActions?: string[]
127
+ execution?: ExecutionStop
128
+ /** Every action of yours on this system Deepdock can serve, refused and unknown ones included, in action index order. */
129
+ actions: ActionAvailability[]
98
130
  }[]
99
131
  }
100
132
 
@@ -126,6 +158,7 @@ export type DeviceSystem = {
126
158
  actions: ActionState[]
127
159
  /** The connectors the device runs for this system, by name and kind. */
128
160
  connectors: { name: string; kind: 'database' | 'http' }[]
161
+ execution?: ExecutionStop
129
162
  }
130
163
 
131
164
  export type DeepdockOptions = {
@@ -25,7 +25,7 @@ The Deepdock client installed on the customer's Windows PC next to their system.
25
25
  outwards to Deepdock; nothing in the customer's network is opened to the internet. A device is
26
26
  identified by a UUID (`id`), carries a `label`, `hostname`, `os`, `clientVersion`, `status`
27
27
  (`connected`, `offline` or `inactive`), `lastSeenAt`, `lastKnownAt`, `claimedAt` (may be `null`), `outdated` (an
28
- assigned action needs a newer client: it answers `device_outdated`) and the `systems` it reported (each with a `versionIssue` when `version` is missing, and `blockedActions` when this device's client cannot run some actions yet: those answer `device_outdated` until the client updates, the others keep running). An action whose system runs a program version Deepdock has not yet approved for it answers `version_not_covered`; nothing is sent to the system, and it works once Deepdock has approved that version.
28
+ assigned action needs a newer client: it answers `device_outdated`) and the `systems` it reported (each with a `versionIssue` when `version` is missing, `blockedActions` when this device's client cannot run some actions yet: those answer `device_outdated` until the client updates, the others keep running, `execution` while the system is stopped, and `actions`: whether each of your actions on that system would be admitted now). An action whose system runs a program version Deepdock has not yet approved for it answers `version_not_covered`; nothing is sent to the system, and it works once Deepdock has approved that version.
29
29
 
30
30
  - **Pair**: take a device into your organisation with the 6-character code it shows while unpaired.
31
31
  - **Release**: `DELETE /v1/devices/{deviceId}` gives the device back; it shows a new code.
@@ -59,6 +59,8 @@ has a display `label` (may be `null`), a `version` the device reported (may be a
59
59
  | system `versionIssue` | `not_installed`, `not_found`, `unreadable`, or `null` | why `version` is missing, when the device says: its database service is not on the PC, its program file was not found, or the file carries no readable version. `null` (absent on `GET .../systems`) with a version, and from a device that does not say | show the reason beside the missing version; there is nothing to do on your side |
60
60
  | system `lockedActions` (device list only) | list of action names or `null` | the actions blocked because the device's database account lacks a right they need, under its current action set; on `GET .../systems` they read `blocked` with `access_reapproval`. `null`: no verdict yet, or the verdict is for an older action set | do not offer a listed action as available; it answers `access_outdated` until the customer chooses "Zugang erneut einrichten" (Set up access again) |
61
61
  | system `blockedActions` | list of action names, or absent | the actions this device's Deepdock client cannot run yet, because they need something only a newer client can do. Absent: none | do not offer a listed action as available; a call answers `device_outdated` and nothing runs, until the client updates itself and the action leaves the list |
62
+ | system `execution` | `{ "status": "stopped", "reason": ... }`, or absent | the device cannot use what Deepdock sent for this system: every action of it answers with `reason`, `device_outdated` (`409`: the client needs an update; the device's other systems keep running) or `internal_error` (`500`: only Deepdock can look into it, and Deepdock is told). Also on `GET .../systems` and on each of the system's actions. While it is set, the system's `status` is `unknown`. Absent: no stop confirmed, which is not a promise that the system is ready | do not offer the system's actions as available; the stop lifts once the device confirms it can use the system again |
63
+ | system `actions` (device list and device) | list of `{ action, available, reason }` | one entry per action of yours on this system that Deepdock can serve, refused and unknown ones included, in action index order. `available: true` with `reason: null`: no check refuses a fresh call. `false`: `reason` is the error code a call answers with now (where several apply, the first in this order: `device_learning_only`, `device_syncing`, `device_outdated`, `internal_error`, `device_connected_twice`, `device_offline`, `action_paused`, `credentials_rejected`, `certificate_changed`, `system_unavailable`, `access_missing`, `access_outdated`, `version_not_covered`, `action_not_configured`; meanings in [errors.md](errors.md)). `null` with `reason: null`: no complete verdict, which is **unknown, not unavailable**. A snapshot, not a promise: a call is decided again when it runs, and `true` never means the call will succeed | test `available === false` for the refused ones (`!available` also matches `null`); call an action whose `available` is `null`. Do not wait for `true` |
62
64
  | action state | `active` | the action can be called | normal |
63
65
  | action state | `paused` | the action is paused with a `reason` and `pausedAt` | calls answer `action_paused`; show the feature as paused, poll `GET .../systems` at a low rate |
64
66
  | action state | `blocked` | the action cannot run on this device until its `reason` is resolved; one reason per action, the first that applies in the order below | do not offer it as available |