@deepdockai/cli 1.6.2 → 1.8.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.8.0
4
+
5
+ - 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`).
6
+
7
+ ## 1.7.0
8
+
9
+ - The current device API: the error code list gains `document_unreadable` (422, exit 2: a download's stored document is in an archive the device cannot read; a retry will not help). The action index's entry for an action that takes a file now carries `upload` (`field`, `maxBytes`, optional `mediaTypes` and `optional`). The 413 description names the action's file limit next to the 1 MiB body limit.
10
+
3
11
  ## 1.6.2
4
12
 
5
13
  - The skill's access-setup reference describes the setup without naming specific systems. No command, field or error code changed.
package/README.md CHANGED
@@ -154,14 +154,14 @@ your code will receive; `auth`, `orgs select` and `keys create` build it from na
154
154
  failure is one document on stderr, `{ "error": { "code", "message" }, "meta": { "hint" } }`,
155
155
  with the API's error object unchanged. Switch on `code` or on the exit code, never on `message`.
156
156
 
157
- | Exit | Meaning |
158
- | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
159
- | 0 | done |
160
- | 1 | something on the command line to fix (`invalid_usage`, `org_required`) |
161
- | 2 | the API refused the request; do not repeat it unchanged (`invalid_request`, `not_found`, `forbidden`, `rate_limited` and the other refusals) |
162
- | 3 | retry later (`device_offline`, `device_timeout`, `device_syncing`, `device_outdated`, `action_paused`, `access_outdated`, `access_missing`, `credentials_rejected`, `certificate_changed`, `system_unavailable`, `target_busy`, `temporarily_unavailable`, `internal_error`, `outcome_unknown`, `connection_lost`) |
163
- | 4 | the CLI is too old for the API (`cli_outdated`): run `npx @deepdockai/cli@latest` |
164
- | 5 | sign-in needed (`sign_in_needed`, `approval_denied`, `approval_expired`); `auth status` when nobody is signed in |
157
+ | Exit | Meaning |
158
+ | ---- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
159
+ | 0 | done |
160
+ | 1 | something on the command line to fix (`invalid_usage`, `org_required`) |
161
+ | 2 | the API refused the request; do not repeat it unchanged (`invalid_request`, `not_found`, `forbidden`, `rate_limited` and the other refusals) |
162
+ | 3 | retry later (`device_offline`, `device_timeout`, `device_syncing`, `device_outdated`, `upload_incomplete`, `action_paused`, `access_outdated`, `access_missing`, `credentials_rejected`, `certificate_changed`, `system_unavailable`, `target_busy`, `temporarily_unavailable`, `internal_error`, `outcome_unknown`, `connection_lost`) |
163
+ | 4 | the CLI is too old for the API (`cli_outdated`): run `npx @deepdockai/cli@latest` |
164
+ | 5 | sign-in needed (`sign_in_needed`, `approval_denied`, `approval_expired`); `auth status` when nobody is signed in |
165
165
 
166
166
  The CLI never retries on its own: exit 3 says retry, you decide when. `deepdock commands --json`
167
167
  prints the whole command tree.
package/dist/deepdock.js CHANGED
@@ -10875,8 +10875,10 @@ var EXIT_CODES = {
10875
10875
  record_not_editable: 2,
10876
10876
  record_restricted: 2,
10877
10877
  too_many_rows: 2,
10878
+ document_unreadable: 2,
10878
10879
  payload_too_large: 2,
10879
10880
  version_not_covered: 2,
10881
+ upload_incomplete: 3,
10880
10882
  device_offline: 3,
10881
10883
  device_timeout: 3,
10882
10884
  device_syncing: 3,
@@ -11443,7 +11445,7 @@ import { spawn } from "node:child_process";
11443
11445
  import { homedir, hostname } from "node:os";
11444
11446
 
11445
11447
  // src/version.ts
11446
- var VERSION = "1.6.2";
11448
+ var VERSION = "1.8.0";
11447
11449
 
11448
11450
  // src/runtime.ts
11449
11451
  var DEFAULT_BASE_URL = "https://api.deepdock.ai";
@@ -12172,7 +12174,7 @@ var EXIT_CODES_HELP = `Exit codes
12172
12174
  0 done
12173
12175
  1 usage: something on the command line to fix (invalid_usage, org_required)
12174
12176
  2 the API refused the request; do not repeat it unchanged
12175
- 3 retry later (device_offline, device_timeout, device_syncing, device_outdated,
12177
+ 3 retry later (device_offline, device_timeout, device_syncing, device_outdated, upload_incomplete,
12176
12178
  action_paused, access_outdated, access_missing,
12177
12179
  credentials_rejected, certificate_changed,
12178
12180
  system_unavailable, target_busy, temporarily_unavailable, internal_error,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deepdockai/cli",
3
- "version": "1.6.2",
3
+ "version": "1.8.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",
@@ -84,7 +84,7 @@ A failure is one document on stderr: the API's error object unchanged plus what
84
84
  | 0 | done | |
85
85
  | 1 | something on the command line to fix | `invalid_usage` (a bad flag, an unknown slug, a question with no terminal and no `--yes`, an env file git does not ignore), `org_required` |
86
86
  | 2 | the API refused the request; do not repeat it unchanged | `invalid_request`, `not_found`, `device_not_found`, `pairing_code_invalid`, `other_partner_build`, `rate_limited`, `forbidden`, `conflict` and the other refusals (not `access_outdated` and `access_missing`, see exit 3) |
87
- | 3 | retry later (`access_outdated` and `access_missing`: after the customer sets up the access again in the Deepdock client ("Zugang erneut einrichten", Set up access again)) | `device_offline`, `device_timeout`, `device_syncing`, `device_outdated`, `action_paused`, `access_outdated`, `access_missing`, `credentials_rejected`, `certificate_changed`, `system_unavailable`, `target_busy`, `temporarily_unavailable`, `internal_error`, `outcome_unknown`, `connection_lost` |
87
+ | 3 | retry later (`access_outdated` and `access_missing`: after the customer sets up the access again in the Deepdock client ("Zugang erneut einrichten", Set up access again)) | `device_offline`, `device_timeout`, `device_syncing`, `device_outdated`, `upload_incomplete`, `action_paused`, `access_outdated`, `access_missing`, `credentials_rejected`, `certificate_changed`, `system_unavailable`, `target_busy`, `temporarily_unavailable`, `internal_error`, `outcome_unknown`, `connection_lost` |
88
88
  | 4 | the CLI is too old for the API: run `npx @deepdockai/cli@latest` | `cli_outdated` |
89
89
  | 5 | sign-in needed: run `deepdock auth login` | `sign_in_needed`, `approval_denied`, `approval_expired` |
90
90
 
@@ -238,6 +238,7 @@ class Deepdock:
238
238
  CONFLICT_RETRIES = 5 # a running write finishes within seconds; beyond this, treat it as unknown
239
239
 
240
240
  RETRY_SAME_KEY = {"device_offline", "device_timeout", "device_syncing", "device_outdated",
241
+ "upload_incomplete",
241
242
  "target_busy", "temporarily_unavailable", "internal_error", "action_paused",
242
243
  "system_unavailable"}
243
244
 
@@ -463,6 +463,7 @@ const RETRY_SAME_KEY = new Set([
463
463
  'device_timeout',
464
464
  'device_syncing',
465
465
  'device_outdated',
466
+ 'upload_incomplete',
466
467
  'target_busy',
467
468
  'temporarily_unavailable',
468
469
  'internal_error',
@@ -55,12 +55,14 @@ with the **same** `Idempotency-Key`); **Show** says what the end user should see
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
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
57
  | `too_many_rows` | 409 | the inputs match more records than this write may change; it was rolled back and nothing changed | no; narrow the inputs to the record you mean | "that matches more than one record; please be more specific" |
58
+ | `document_unreadable` | 422 | a download whose stored document is packed in an archive the device cannot read (damaged, cut or not of the declared kind). Nothing was served, never a partial file | no; the same document reads the same way again | "this document cannot be opened from the customer's system" and offer support |
58
59
  | 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 |
59
60
 
60
61
  ## Device and system availability
61
62
 
62
63
  | Code | Status | Meaning | Retry | Show |
63
64
  |---|---|---|---|---|
65
+ | `upload_incomplete` | 400 | an upload broke off before the device had the whole file. This call wrote nothing | yes, at once: send it again with the same file and the same `Idempotency-Key` | "the upload was interrupted; we will send it again" |
64
66
  | `device_offline` | 503 | the device is not connected, is shutting down, did not answer within 20 s, or the call was cut off inside Deepdock by a restart or deploy. **A write may still have landed** | yes, with backoff (seconds to minutes); a write only with the same key | "the customer PC is offline; we will retry" |
65
67
  | `device_timeout` | 503 | the device ran out of its time budget before it began the call or before it committed. Nothing was written | yes, with backoff; a write with the same key | "the customer PC was too slow; retrying" |
66
68
  | `device_syncing` | 503 | the device has not reported its Deepdock client yet (just paired, or its report did not come through); Deepdock asks it again. Nothing was written | yes, after `Retry-After` (5 s); a write with the same key | "the customer PC is connecting; retrying" |
@@ -108,11 +110,13 @@ const REACTION: Record<string, Reaction> = {
108
110
  record_not_editable: 'stop',
109
111
  record_restricted: 'stop',
110
112
  too_many_rows: 'fix-input',
113
+ document_unreadable: 'stop',
111
114
  payload_too_large: 'fix-code',
112
115
  access_outdated: 'wait-setup',
113
116
  access_missing: 'wait-setup',
114
117
  credentials_rejected: 'wait-setup',
115
118
  certificate_changed: 'wait-setup',
119
+ upload_incomplete: 'retry-same-key',
116
120
  device_offline: 'retry-same-key',
117
121
  device_timeout: 'retry-same-key',
118
122
  device_syncing: 'retry-same-key',
@@ -70,7 +70,7 @@ input, a status (`pending`, `sent`, `done`, `unknown`, `refused`) and the result
70
70
 
71
71
  ```
72
72
  pending ──send──▶ sent ──2xx (fresh or replayed)──────────────▶ done
73
- │ ──device_offline, device_syncing, device_outdated, timeout, network error, target_busy, temporarily_unavailable, internal_error ▶ sent (retry later, same key)
73
+ │ ──device_offline, device_syncing, device_outdated, upload_incomplete, timeout, network error, target_busy, temporarily_unavailable, internal_error ▶ sent (retry later, same key)
74
74
  │ ──idempotency_conflict, retries left ───▶ sent (retry, same key, same input)
75
75
  │ ──idempotency_conflict, retries spent ──▶ unknown (read back before anything else)
76
76
  │ ──outcome_unknown ──────────────────────▶ unknown (read back before anything else)