@deepdockai/cli 1.8.1 → 1.10.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.10.0
|
|
4
|
+
|
|
5
|
+
- The current device API: pairing a device answers `409 device_update_required` (exit 2) when its Deepdock client is too old for a system of your organisation, or has not reported its client yet. `error.reason` is `lacks` (update the client on the device, then pair again) or `unreported` (retry in a minute). The pinned device API, the error code list and the errors reference describe it.
|
|
6
|
+
|
|
7
|
+
## 1.9.0
|
|
8
|
+
|
|
9
|
+
- 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.
|
|
10
|
+
|
|
3
11
|
## 1.8.1
|
|
4
12
|
|
|
5
13
|
- 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`.
|
package/dist/deepdock.js
CHANGED
|
@@ -10861,6 +10861,7 @@ var EXIT_CODES = {
|
|
|
10861
10861
|
invalid_input: 2,
|
|
10862
10862
|
pairing_code_invalid: 2,
|
|
10863
10863
|
other_partner_build: 2,
|
|
10864
|
+
device_update_required: 2,
|
|
10864
10865
|
device_learning_only: 2,
|
|
10865
10866
|
device_answer_unreadable: 2,
|
|
10866
10867
|
device_connected_twice: 2,
|
|
@@ -11445,7 +11446,7 @@ import { spawn } from "node:child_process";
|
|
|
11445
11446
|
import { homedir, hostname } from "node:os";
|
|
11446
11447
|
|
|
11447
11448
|
// src/version.ts
|
|
11448
|
-
var VERSION = "1.
|
|
11449
|
+
var VERSION = "1.10.0";
|
|
11449
11450
|
|
|
11450
11451
|
// src/runtime.ts
|
|
11451
11452
|
var DEFAULT_BASE_URL = "https://api.deepdock.ai";
|
package/package.json
CHANGED
|
@@ -99,6 +99,7 @@ Pairing answers:
|
|
|
99
99
|
| `invalid_request` | 400 | the code is malformed; fix the input |
|
|
100
100
|
| `pairing_code_invalid` | 404 | unknown, expired, replaced, already used, or the device is offline; ask for a fresh code |
|
|
101
101
|
| `other_partner_build` | 409 | the device runs another partner's branded client; only that partner can pair it |
|
|
102
|
+
| `device_update_required` | 409 | the device's Deepdock client is too old for a system of your organisation (`error.reason` `lacks`), or has not reported its client yet (`unreported`, retry in a minute); update the client on the device, then pair again |
|
|
102
103
|
| `rate_limited` | 429 | more than 5 failed pairing attempts in 60 seconds with this key; wait up to a minute |
|
|
103
104
|
|
|
104
105
|
Successful pairings do not count against the limit; malformed codes are refused before counting.
|
|
@@ -69,6 +69,35 @@ 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
|
|
@@ -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,
|
|
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 |
|
|
@@ -41,6 +41,7 @@ with the **same** `Idempotency-Key`); **Show** says what the end user should see
|
|
|
41
41
|
| `access_missing` | 409 | the device's database access is gone (a removed database account or a lost secret on the PC); every action of that system is refused. Nothing was run. **No `Retry-After`** | as `access_outdated` | as `access_outdated` |
|
|
42
42
|
| `pairing_code_invalid` | 404 | pairing: the code is unknown, expired, replaced, used, or its device is offline | with a fresh code | "read the code off the device screen again" |
|
|
43
43
|
| `other_partner_build` | 409 | pairing: the device runs another partner's client build | no | "this device is set up for another provider" |
|
|
44
|
+
| `device_update_required` | 409 | pairing: the device's Deepdock client is too old for a system of your organisation that has several database connectors, so pairing it would leave actions that cannot run. `error.reason` is `lacks` (the client is too old) or `unreported` (it has not reported its client yet) | `lacks`: no, until the Deepdock client on the PC is updated, then pair with a fresh code. `unreported`: yes, after a minute | "the Deepdock client on this PC needs an update before it can be paired" |
|
|
44
45
|
| `device_learning_only` | 409 | the PC runs the Deepdock client for learning only, which runs no actions; nothing was sent to it. Reads, writes and the systems list on it all answer this | no; it changes only when the Deepdock service is installed on that PC | "this PC needs the Deepdock service to run actions" |
|
|
45
46
|
| `device_connected_twice` | 409 | two PCs are connected with this device's identity (a copied PC or VM snapshot); nothing ran, so the `Idempotency-Key` is free | no; a person shuts the copy down, and calls work again about five minutes after only one PC is connected | "two PCs use this device; shut the copy down" |
|
|
46
47
|
| `device_answer_unreadable` | 502 | the device sent an answer Deepdock cannot read (for example from a client build with a fault); on a write the device may have applied it. The body carries `requestId` for support | no, and not with the same `Idempotency-Key` either; it changes only when the Deepdock client on that PC is updated. After a write, read the record back before writing again | "the connected PC sent an answer that could not be read; contact Deepdock with the request id" |
|
|
@@ -101,6 +102,7 @@ const REACTION: Record<string, Reaction> = {
|
|
|
101
102
|
action_not_configured: 'stop',
|
|
102
103
|
pairing_code_invalid: 'fix-input',
|
|
103
104
|
other_partner_build: 'stop',
|
|
105
|
+
device_update_required: 'stop', // reason `unreported`: retry after a minute
|
|
104
106
|
device_learning_only: 'stop',
|
|
105
107
|
device_connected_twice: 'stop',
|
|
106
108
|
device_answer_unreadable: 'stop',
|