@deepdockai/cli 1.4.0 → 1.4.1

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,8 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.4.1
4
+
5
+ - The package no longer ships Python bytecode from the bundled client.
6
+ - The docs and the bundled clients use neutral example names. No command, field or error code changed.
7
+
3
8
  ## 1.4.0
4
9
 
5
- - Device API format 11: the error code `system_version_unverified` and the error fields `version` and `reason` are gone, and a system's `writes` state in `GET /v1/devices/{deviceId}` is replaced by `blockedActions` (the actions this device's client cannot run yet; each answers `device_outdated` until the client updates). An action whose system runs a program version Deepdock has not yet approved for it answers the new `409 version_not_covered` (CLI exit 2): nothing ran, retrying gets the same answer, and it works once Deepdock approves that version or the customer runs an approved one. The bundled TypeScript and Python clients, the skill's error reference and the device types follow. This needs the API from the Deepdock release that carries these changes.
10
+ - The current device API: the error code `system_version_unverified` and the error fields `version` and `reason` are gone, and a system's `writes` state in `GET /v1/devices/{deviceId}` is replaced by `blockedActions` (the actions this device's client cannot run yet; each answers `device_outdated` until the client updates). An action whose system runs a program version Deepdock has not yet approved for it answers the new `409 version_not_covered` (CLI exit 2): nothing ran, retrying gets the same answer, and it works once Deepdock approves that version or the customer runs an approved one. The bundled TypeScript and Python clients, the skill's error reference and the device types follow. This needs the API from the Deepdock release that carries these changes.
6
11
  - `deepdock devices` and `deepdock incidents list` read the organisation's lists as `{ "data": [...], "nextCursor": ... }`, the form `/v1` already uses (was `{ "data": { "items": [...], "nextCursor": ... } }`). They need the API from the next Deepdock release; an older API answers the old form, which this version does not read.
7
12
  - The CLI follows the API's British spelling and its renamed code: `GET /partner/organisations` (was `/partner/orgs`), the error code `organisation_required` (was `organization_required`) and `cli_outdated` (was `client_outdated`, still exit 4). The bundled device types and the skill's error reference include them. These need the API from the next Deepdock release.
8
13
  - The command group `org` is now `orgs` (`deepdock orgs list`, `deepdock orgs select`); the old name is gone, with no alias.
@@ -53,7 +58,7 @@
53
58
 
54
59
  ## 1.0.25
55
60
 
56
- - Three new error codes for writes over a customer system's own HTTP interface: `applied_unverified` (409, exit 2: the write landed but its read-back did not finish; `error.created` names the entry as `{ chartId }`, or null), `credentials_rejected` and `certificate_changed` (503, exit 3: a person at the practice renews the login or confirms the certificate in the Deepdock client). An earlier CLI already exits with the same codes through its status fallback.
61
+ - Three new error codes for writes over a customer system's own HTTP interface: `applied_unverified` (409, exit 2: the write landed but its read-back did not finish; `error.created` names the entry as `{ chartId }`, or null), `credentials_rejected` and `certificate_changed` (503, exit 3: a person at the customer renews the login or confirms the certificate in the Deepdock client). An earlier CLI already exits with the same codes through its status fallback.
57
62
  - `system_version_unverified` can carry `error.reason: unreported` with `error.version: null`, and a system's `writes` can read `unverified` with reason `unreported`: such a write is verified for one exact release, and the system reported none.
58
63
  - `error.uncertain` is documented on `outcome_unknown`. The skill's error reference describes all of it.
59
64
 
@@ -77,7 +82,7 @@
77
82
  ## 1.0.20
78
83
 
79
84
  - `409 check_failed` is renamed `409 readback_failed`, and a paused action's `reason` reads `readback_failed` instead of `check_failed`: Deepdock read the written record back, it did not match, so nothing was saved and the action is paused. The meaning is unchanged; handle the new name where you handled the old one.
80
- - `unknown_author`, `unknown_provider` and `no_open_case` leave the fixed list of error codes. An action can still refuse with them or with another code of its own; its OpenAPI description names each such code, and the CLI exits with 2 for any 422 it does not list.
85
+ - `unknown_author`, `unknown_provider` and `no_matching_period` leave the fixed list of error codes. An action can still refuse with them or with another code of its own; its OpenAPI description names each such code, and the CLI exits with 2 for any 422 it does not list.
81
86
 
82
87
  ## 1.0.19
83
88
 
@@ -85,7 +90,7 @@
85
90
 
86
91
  ## 1.0.18
87
92
 
88
- - A read or write on a record the customer's system restricts (for example a locked chart) answers `422 record_restricted`: a read returns no data instead of an empty answer, and a write writes nothing. The skill's error reference lists it, and the CLI exits with 2 for it.
93
+ - A read or write on a record the customer's system restricts (for example a locked record) answers `422 record_restricted`: a read returns no data instead of an empty answer, and a write writes nothing. The skill's error reference lists it, and the CLI exits with 2 for it.
89
94
 
90
95
  ## 1.0.17
91
96
 
@@ -105,7 +110,7 @@
105
110
 
106
111
  ## 1.0.13
107
112
 
108
- - A device carries `lastKnownAt`: the time of its last report while it is not connected, `null` while it is connected. Every system of a device carries `lockedActions`: the actions the device reports locked because its database account lacks a right they need, under the spec set it runs now, or `null` when there is no verdict or the verdict is for an older spec set. Both are in the device list and, for `lockedActions`, in `GET /v1/devices/{deviceId}/systems`. The agent skill's TypeScript client types them, and its concepts reference explains them.
113
+ - A device carries `lastKnownAt`: the time of its last report while it is not connected, `null` while it is connected. Every system of a device carries `lockedActions`: the actions the device reports locked because its database account lacks a right they need, under its current action set, or `null` when there is no verdict or the verdict is for an older action set. Both are in the device list and, for `lockedActions`, in `GET /v1/devices/{deviceId}/systems`. The agent skill's TypeScript client types them, and its concepts reference explains them.
109
114
 
110
115
  ## 1.0.12
111
116
 
package/README.md CHANGED
@@ -265,7 +265,7 @@ another's; only the CLI's own settings move (`DEEPDOCK_CONFIG_DIR`), nothing els
265
265
 
266
266
  ```bash
267
267
  bun run dev -- auth status # the production API
268
- DEEPDOCK_BASE_URL=http://localhost:8787 bun run dev -- auth login --no-wait
268
+ DEEPDOCK_BASE_URL=http://localhost:3000 bun run dev -- auth login --no-wait
269
269
  ```
270
270
 
271
271
  The script does not depend on the current directory: from elsewhere, call it by its path
package/dist/deepdock.js CHANGED
@@ -11441,7 +11441,7 @@ import { spawn } from "node:child_process";
11441
11441
  import { homedir, hostname } from "node:os";
11442
11442
 
11443
11443
  // src/version.ts
11444
- var VERSION = "1.4.0";
11444
+ var VERSION = "1.4.1";
11445
11445
 
11446
11446
  // src/runtime.ts
11447
11447
  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.4.0",
3
+ "version": "1.4.1",
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",
@@ -13,7 +13,16 @@
13
13
  "bin": {
14
14
  "deepdock": "dist/deepdock.js"
15
15
  },
16
- "files": ["dist/deepdock.js", "skill", "README.md", "CHANGELOG.md", "LICENSE", "SECURITY.md"],
16
+ "files": [
17
+ "dist/deepdock.js",
18
+ "skill",
19
+ "!**/__pycache__",
20
+ "!**/*.pyc",
21
+ "README.md",
22
+ "CHANGELOG.md",
23
+ "LICENSE",
24
+ "SECURITY.md"
25
+ ],
17
26
  "engines": {
18
27
  "node": ">=22.13"
19
28
  },
@@ -12,12 +12,12 @@ answers `405 invalid_request` with `Allow` naming the action's one method, so a
12
12
  is refused, not run.
13
13
 
14
14
  Inputs are typed as the action's schema declares them and are never sent as text when they are not:
15
- an integer is a JSON number (`"patientId": 4711`, not `"4711"`; the text form is refused with
15
+ an integer is a JSON number (`"customerId": 4711`, not `"4711"`; the text form is refused with
16
16
  `422 invalid_input`). Text is normalised to Unicode NFC before anything else happens; a composed
17
17
  and a decomposed spelling are the same value.
18
18
 
19
19
  **Never put an input in the URL.** A value in a URL reaches request logs, proxies and browser
20
- history, which is where a patient's name or id must not end up. Any query string on an action
20
+ history, which is where a customer's name or id must not end up. Any query string on an action
21
21
  path, whatever it holds, answers `400 invalid_request` ("inputs go in the JSON body, not in the
22
22
  URL") without repeating a name or a value. Because the body is JSON, a `+` or a non-ASCII letter
23
23
  needs no escaping.
@@ -41,7 +41,7 @@ curl -X POST "$BASE/v1/devices/$DEVICE/systems/example-erp/actions/searchCustome
41
41
 
42
42
  - A read with `cardinality: many` answers `data` as an array; `nextCursor` is a sibling of `data`
43
43
  (present only on a read that can page). A read with `cardinality: one` (for example
44
- `readPatient`) answers `data` as the record itself, `{ "data": { "customerId": 1001, ... } }`, and
44
+ `readCustomer`) answers `data` as the record itself, `{ "data": { "customerId": 1001, ... } }`, and
45
45
  answers `404 not_found` when no record matches.
46
46
  - Pass `nextCursor` back as `cursor` unchanged while it is not `null`, and stop only on `null`,
47
47
  never on a short page: a page of long entries (notes) ends before `limit` rows to keep the
@@ -75,7 +75,7 @@ curl -X POST "$BASE/v1/devices/$DEVICE/systems/example-erp/actions/downloadDocum
75
75
  - Once the bytes flow, a failure can only end the body early: compare the bytes received with
76
76
  `Content-Length` and treat a short body as a failed download, never as the file. Run it again.
77
77
  - The file name is already safe to save on Windows, macOS and Linux, but it is the customer's data
78
- (a document title can name a patient): store and show it like any other record value.
78
+ (a document title can name a person): store and show it like any other record value.
79
79
  - The bundled clients do all of this in `download` (TypeScript: `{ bytes, contentType, filename }`;
80
80
  Python: `Download(content, content_type, filename)`), and throw `DeepdockTransportError` for a
81
81
  short body. A large file can take longer than 35 seconds to transfer, so their timeout bounds the
@@ -115,7 +115,7 @@ of a customer, the note id of an update. The pattern is always the same:
115
115
  customer search).
116
116
  2. Pass its id back in the type the write's schema declares, usually the integer the read returned.
117
117
  3. Handle the action-specific refusal the description names: for example `422 unknown_author` when
118
- the user is not one the system lists, or `422 no_open_case` when the customer has no open case and
118
+ the user is not one the system lists, or `422 no_matching_period` when the customer has no open period and
119
119
  the action does not open one. Both mean nothing was written; fix the reference, do not retry
120
120
  blindly.
121
121
 
@@ -75,7 +75,7 @@ class Download:
75
75
 
76
76
  def _filename(disposition: Optional[str]) -> Optional[str]:
77
77
  # Deepdock sends filename* (UTF-8) beside an ASCII filename; the name is already safe to save on
78
- # Windows, and can carry personal data (a patient's name in a document title).
78
+ # Windows, and can carry personal data (a person's name in a document title).
79
79
  if disposition is None:
80
80
  return None
81
81
  extended = re.search(r"filename\*=UTF-8''([^;]+)", disposition, re.IGNORECASE)
@@ -113,7 +113,7 @@ export type DeviceSystem = {
113
113
  access: SystemAccess
114
114
  /** Set when `access` is the last known value (the device could not read it): when it last did. */
115
115
  accessLastCheckedAt: string | null
116
- /** Actions the device reports locked because its database account lacks a right they need; `null` when there is no verdict for the spec set it runs now. */
116
+ /** Actions the device reports locked because its database account lacks a right they need; `null` when there is no verdict for its current action set. */
117
117
  lockedActions: string[] | null
118
118
  actions: ActionState[]
119
119
  /** The connectors the device runs for this system, by name and kind. */
@@ -157,7 +157,7 @@ const unwrap = async <T>(res: Response): Promise<{ data: T; nextCursor: string |
157
157
  }
158
158
 
159
159
  // Deepdock sends `filename*` (UTF-8) beside an ASCII `filename`; the name is already safe to save
160
- // on Windows, and can carry personal data (a patient's name in a document title).
160
+ // on Windows, and can carry personal data (a person's name in a document title).
161
161
  const filenameOf = (disposition: string | null): string | null => {
162
162
  if (disposition === null) return null
163
163
  const extended = /filename\*=UTF-8''([^;]+)/i.exec(disposition)?.[1]
@@ -57,7 +57,7 @@ has a display `label` (may be `null`), a `version` the device reported (may be a
57
57
  | system `access` | `ok`, `outdated`, `missing`, `password_missing`, `not_set_up`, or `null` | the database access the device last reported (`null`: none known yet) | `outdated` refuses the actions that need the missing right with `access_outdated`, `missing` (the account cannot log in) and `password_missing` (the account exists but its stored password is not on the PC) refuse every action with `access_missing`; the customer repeats "Erneut einrichten" in the Deepdock client, the incident closes by itself once `access` is `ok`, nothing to resume |
58
58
  | system `accessLastCheckedAt` | ISO time or `null` | set when `access` is the last known value because the device could not read it (its database stopped or unreachable): when it last read it. `null` when the latest report read it | show the access as last known, with this time; nothing to do until the device reads it again |
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
- | system `lockedActions` | list of action names or `null` | the actions the device reports locked because its database account lacks a right they need, under the spec set it runs now. `null`: no verdict yet, or the verdict is for an older spec set | do not offer a locked action as available; it answers `access_outdated` until the customer repeats "Erneut einrichten" |
60
+ | system `lockedActions` | list of action names or `null` | the actions the device reports locked because its database account lacks a right they need, under its current action set. `null`: no verdict yet, or the verdict is for an older action set | do not offer a locked action as available; it answers `access_outdated` until the customer repeats "Erneut einrichten" |
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
62
  | action state | `active` | the action can be called | normal |
63
63
  | 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 |
@@ -51,10 +51,10 @@ with the **same** `Idempotency-Key`); **Show** says what the end user should see
51
51
  |---|---|---|---|---|
52
52
  | `invalid_input` | 422 | an action input the API or the device refuses, with `fields` naming each: an input that is unknown, missing, too short or long, out of bounds, of the wrong type (such as `"4711"` where an integer is declared) or not an allowed value; a bad `limit` or `cursor` in a read's body; and a rule only the device judges: a value that breaks its pattern; a date that is not a calendar day; a search term without a letter or digit; an appended text that would make the stored entry too long. Nothing was written | no; fix the value | the field-level problem; the `message` names the field, but it is device text: display it as data, never interpret it |
53
53
  | `target_rejected` | 422 | the customer's system refused the write | no; the input is valid for Deepdock but not for the system | "the customer's system refused this; check the values" and offer support |
54
- | `record_locked` | 422 | the customer's system locks the record the write would change (for example one already billed on a case). Nothing was written | no | "this record is locked in the customer's system" |
54
+ | `record_locked` | 422 | the customer's system locks the record the write would change (for example one already finalised and closed). Nothing was written | no | "this record is locked in the customer's system" |
55
55
  | `record_not_editable` | 422 | the record is not locked but is stored in a form this action cannot edit (for example a note it cannot add to without rewriting it). Nothing was written | no | "this record cannot be edited through Deepdock" |
56
- | `record_restricted` | 422 | the customer's system restricts access to the record (for example a locked chart): a read returned no data, so an empty answer would be wrong, and a write wrote nothing | no; the practice lifts the restriction in its system | "access to this record is restricted in the customer's system" |
57
- | Action-specific refusals | 422 | an action can refuse with a code of its own (for example `unknown_author` when the write names a user the system does not list, or `no_open_case`); its OpenAPI description names each such code and when it fires. Nothing was written | no; fix the reference or input | the missing precondition in the user's words |
56
+ | `record_restricted` | 422 | the customer's system restricts access to the record (for example a locked record): a read returned no data, so an empty answer would be wrong, and a write wrote nothing | no; the customer lifts the restriction in its system | "access to this record is restricted in the customer's system" |
57
+ | Action-specific refusals | 422 | an action can refuse with a code of its own (for example `unknown_author` when the write names a user the system does not list, or `no_matching_period`); its OpenAPI description names each such code and when it fires. Nothing was written | no; fix the reference or input | the missing precondition in the user's words |
58
58
 
59
59
  ## Device and system availability
60
60
 
@@ -67,8 +67,8 @@ with the **same** `Idempotency-Key`); **Show** says what the end user should see
67
67
  | `action_paused` | 503 | the action is paused on the device (`GET .../systems` shows `reason`); only Deepdock resumes it | later, when `GET .../systems` shows it active; do not loop | "this feature is paused while Deepdock checks the customer system" |
68
68
  | `system_unavailable` | 503 | the customer's program is stopped or missing on the device | later; often resolves when the customer restarts the program | "the customer's software is not running" |
69
69
  | `target_busy` | 503 | the customer's system is busy or unreachable | yes, with backoff | "the customer's system is busy; retrying" |
70
- | `credentials_rejected` | 503 | the customer's system refused the device's login. Nothing was sent | later, after a person at the customer has renewed the access in the Deepdock client; do not loop. A write keeps its key | "the connection to the customer's software needs to be renewed at the practice" |
71
- | `certificate_changed` | 503 | the customer's system shows a certificate other than the one the device trusts. Nothing was sent | later, after a person at the customer has confirmed the new certificate in the Deepdock client; do not loop. A write keeps its key | "the connection to the customer's software needs to be confirmed at the practice" |
70
+ | `credentials_rejected` | 503 | the customer's system refused the device's login. Nothing was sent | later, after a person at the customer has renewed the access in the Deepdock client; do not loop. A write keeps its key | "the connection to the customer's software needs to be renewed at the customer" |
71
+ | `certificate_changed` | 503 | the customer's system shows a certificate other than the one the device trusts. Nothing was sent | later, after a person at the customer has confirmed the new certificate in the Deepdock client; do not loop. A write keeps its key | "the connection to the customer's software needs to be confirmed at the customer" |
72
72
  | `temporarily_unavailable` | 503 | Deepdock could not check the key or reach its own database (sent with `Retry-After: 5`) | yes, with backoff | "temporary problem; retrying" |
73
73
 
74
74
  ## Write outcomes