@fleetless/sdk 3.0.2 → 3.1.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 +19 -0
- package/CONTRIBUTING.md +76 -71
- package/README.md +66 -344
- package/SECURITY.md +11 -11
- package/dist/index.cjs +311 -209
- package/dist/index.d.cts +331 -94
- package/dist/index.d.ts +331 -94
- package/dist/index.js +311 -209
- package/package.json +9 -5
- package/RELEASING.md +0 -195
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,25 @@ All notable changes to `@fleetless/sdk`. The format follows Keep a Changelog; th
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [3.1.0] — 2026-09-17
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- **`client.robots`** — `list()` answers the robots the caller reaches, with bridge state and published version; `describe(robotId)` answers the datasheet: every granted datapoint, action, service, publisher and camera with unit, decimals and parameter JSON Schema, plus the `action_history` and `assets` capabilities. The same rows and the same sheet the MCP tools `robots_list` and `robot_describe` answer, from the same server code. Needs a cloud that serves contracts 1.1.0.
|
|
12
|
+
- **`client.jobs.history(robotId, options?)`** — the run history the reference described since 3.0.0 and the package never shipped. Filters `slug`, `state`, `kind`, `limit`, `beforeSeq`, `fromMs`, `toMs`; page until `next_cursor` is `null`.
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
|
|
16
|
+
- Re-pinned to `@fleetless/contracts` 1.1.0. `ClientRobotListItem`, `McpRobotDatasheet`, `McpExposure`, `McpCapabilities`, `JobRun` and `JobRunListResponse` are re-exported.
|
|
17
|
+
|
|
18
|
+
## [3.0.3] — 2026-09-16
|
|
19
|
+
|
|
20
|
+
- Published from GitHub Actions by npm trusted publishing: no publish token exists anywhere, and every version from this one on carries a provenance attestation linking it to the commit and the run that built it. `npm audit signatures` checks it.
|
|
21
|
+
|
|
22
|
+
- **The README is a lobby now, not the reference.** What Fleetless is, what this package does, one snippet, and links into docs.fleetless.dev; the seven walkthroughs it carried are the SDK reference's job. The four doc comments and the one runtime error message that sent a developer to a README section point at the SDK reference instead, and the test that resolved those pointers now refuses any new one.
|
|
23
|
+
- `RELEASING.md` no longer ships in the package; the published `CONTRIBUTING.md` points at it without a link.
|
|
24
|
+
- The prose guard treats a path into the company-site repository the way it treats every other sibling repository's path.
|
|
25
|
+
|
|
7
26
|
## [3.0.2] — 2026-09-07
|
|
8
27
|
|
|
9
28
|
No API change, and one documentation example that now compiles. The guard
|
package/CONTRIBUTING.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Contributing to `@fleetless/sdk`
|
|
2
2
|
|
|
3
|
-
This
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
This is the TypeScript client for the Fleetless API — the thing a developer's
|
|
4
|
+
app calls directly. Change a method here and every app built on it feels it;
|
|
5
|
+
change what a method *sends* and the platform feels it too.
|
|
6
6
|
|
|
7
7
|
## Setup
|
|
8
8
|
|
|
@@ -14,12 +14,12 @@ corepack enable
|
|
|
14
14
|
pnpm install
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
No private dependencies — `pnpm install` needs nothing but a network
|
|
18
|
+
connection to npm. The wire schemas come from `@fleetless/contracts`, a
|
|
19
|
+
public package.
|
|
20
20
|
|
|
21
|
-
`pnpm install` runs `prepare
|
|
22
|
-
|
|
21
|
+
`pnpm install` runs `prepare` and builds `dist/`. Some checks below read the
|
|
22
|
+
built bundle, so a fresh checkout is already ready for them.
|
|
23
23
|
|
|
24
24
|
## The checks
|
|
25
25
|
|
|
@@ -32,94 +32,98 @@ read the built bundle, so a fresh checkout is ready for them.
|
|
|
32
32
|
|
|
33
33
|
To run one test file, use `pnpm vitest run test/<name>.test.ts`.
|
|
34
34
|
|
|
35
|
-
## The rule this repository is most serious about: a real server, not a mocked `fetch`
|
|
35
|
+
## 🔌 The rule this repository is most serious about: a real server, not a mocked `fetch`
|
|
36
36
|
|
|
37
37
|
**The auth suites drive the SDK's own default `fetch` against a real
|
|
38
|
-
`node:http` server** (`test/local-api.ts`)
|
|
39
|
-
`createClient
|
|
38
|
+
`node:http` server** (`test/local-api.ts`) — no `fetch` option passed to
|
|
39
|
+
`createClient`.
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
that
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
socket:
|
|
41
|
+
Not ceremony. A suite that supplies its own `fetch` never touches the code
|
|
42
|
+
that ships: `client.ts` resolves `globalThis.fetch.bind(globalThis)`, so "what
|
|
43
|
+
the SDK sends" becomes "what a `vi.fn()` agreed to pretend to send." This
|
|
44
|
+
package's two most expensive defects were both invisible to a mocked `fetch`
|
|
45
|
+
and both obvious to a socket:
|
|
47
46
|
|
|
48
47
|
- `createClient` defaulted to a **detached** `globalThis.fetch`. A real
|
|
49
|
-
browser's `fetch` is a Web IDL method
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
-
|
|
53
|
-
|
|
54
|
-
parsed the URL.
|
|
48
|
+
browser's `fetch` is a Web IDL method and throws "Illegal invocation"
|
|
49
|
+
unless the receiver is the global object; Node's undici doesn't check.
|
|
50
|
+
Every test passed, every browser failed on the first call.
|
|
51
|
+
- `../../../admin` reached a real server as a traversal — the encoding was
|
|
52
|
+
asserted against a double that never parsed the URL.
|
|
55
53
|
|
|
56
|
-
|
|
57
|
-
`test/local-api.ts`.** A double is fine for
|
|
58
|
-
|
|
54
|
+
**If your change touches what leaves the process, test it against
|
|
55
|
+
`test/local-api.ts`.** A double is fine for branching, refcounting, timers,
|
|
56
|
+
error mapping — most of the suite uses one for exactly that.
|
|
59
57
|
|
|
60
|
-
`test/client.test.ts`
|
|
61
|
-
|
|
58
|
+
`test/client.test.ts` names a test for this property on its own, so removing
|
|
59
|
+
it shows up in a diff instead of in production.
|
|
62
60
|
|
|
63
61
|
## Licence headers
|
|
64
62
|
|
|
65
|
-
Every source file
|
|
66
|
-
|
|
67
|
-
`test/license-headers.test.ts`
|
|
68
|
-
|
|
69
|
-
|
|
63
|
+
Every source file's first line is the SPDX header
|
|
64
|
+
`// SPDX-License-Identifier: MIT` — only a `#!` shebang may sit above it.
|
|
65
|
+
`test/license-headers.test.ts` checks the whole set, sourced from
|
|
66
|
+
`git ls-files` rather than a list of directories, so a new file is swept the
|
|
67
|
+
day it's added.
|
|
70
68
|
|
|
71
|
-
## Nothing internal reaches the published bytes
|
|
69
|
+
## 📦 Nothing internal reaches the published bytes
|
|
72
70
|
|
|
73
71
|
`tsup` bundles `@fleetless/contracts` **into** `dist/index.js` and
|
|
74
|
-
`dist/index.cjs
|
|
75
|
-
module
|
|
76
|
-
build this is therefore a comment an editor shows to
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
repository's source.
|
|
72
|
+
`dist/index.cjs` — doc comments and all — and writes the source path of each
|
|
73
|
+
inlined module as a comment beside it. A comment meant for the people who
|
|
74
|
+
build this is therefore a comment an editor shows to whoever installed it.
|
|
75
|
+
Four published versions did exactly that: German paragraphs, internal defect
|
|
76
|
+
ids, an internal hostname — none of it in this repository's source.
|
|
80
77
|
|
|
81
|
-
Write a comment
|
|
82
|
-
was found, on which machine, under which
|
|
83
|
-
the team happened to be thinking that day.
|
|
78
|
+
Write a comment for what the code does for a caller, not for how the
|
|
79
|
+
behaviour was found, on which machine, under which ticket, or in which
|
|
80
|
+
language the team happened to be thinking that day.
|
|
84
81
|
|
|
85
|
-
`test/published-prose.test.ts`
|
|
86
|
-
|
|
87
|
-
|
|
82
|
+
`test/published-prose.test.ts` checks `dist/`, `src/`, `test/`, `scripts/`
|
|
83
|
+
and the shipped markdown, and names which class of thing came back and on
|
|
84
|
+
which line.
|
|
88
85
|
|
|
89
86
|
## Pull requests
|
|
90
87
|
|
|
91
|
-
**The public repository is not open yet.** It will be
|
|
92
|
-
describes how it
|
|
93
|
-
<hello@fleetless.dev>. Either way
|
|
94
|
-
method signature or what a method sends before you write it, so we can
|
|
95
|
-
else has to move with it.
|
|
96
|
-
|
|
97
|
-
**CI runs on
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
pull request
|
|
88
|
+
**The public repository is not open yet.** It will be — this section
|
|
89
|
+
describes how it works once it is. Until then, send patches and questions to
|
|
90
|
+
<hello@fleetless.dev>. Either way: raise anything that changes an existing
|
|
91
|
+
method signature or what a method sends *before* you write it, so we can
|
|
92
|
+
tell you what else has to move with it.
|
|
93
|
+
|
|
94
|
+
**CI runs on GitHub Actions**, in this repository
|
|
95
|
+
(`.github/workflows/verify.yml`) — the suite, on every push and every pull
|
|
96
|
+
request. `release.yml` publishes on a release tag and calls that same file
|
|
97
|
+
first, so a release is never checked by a different pipeline than a push.
|
|
98
|
+
|
|
99
|
+
**Your pull request is verified, a fork's included** — the same suite, the
|
|
100
|
+
same file. GitHub holds a first-time contributor's first run until a
|
|
101
|
+
maintainer approves it, so the checks can sit idle for a while before they
|
|
102
|
+
start; that is the queue, not a failure. The run reads the code and nothing
|
|
103
|
+
else: it is granted `contents: read`, no secret is available to it, and
|
|
104
|
+
publishing lives in a workflow a pull request cannot trigger. Running
|
|
105
|
+
`pnpm typecheck && pnpm test && pnpm run test:pack` yourself first still
|
|
106
|
+
saves you a round trip — it is everything `verify` will tell you.
|
|
103
107
|
|
|
104
108
|
## The CLA
|
|
105
109
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
Your first pull request will ask you to sign a Contributor Licence Agreement.
|
|
111
|
+
It grants Dehne Robotik GmbH the right to license your contribution under
|
|
112
|
+
terms other than MIT later — that's the whole point, and why the project can
|
|
113
|
+
relicense without hunting down every past contributor. It doesn't take your
|
|
114
|
+
copyright, and it doesn't stop you from using your own contribution however
|
|
115
|
+
you like.
|
|
112
116
|
|
|
113
117
|
## Commit messages
|
|
114
118
|
|
|
115
119
|
[Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/):
|
|
116
|
-
`feat:`, `fix:`, `docs:`, `chore:`, `ci:`, `refactor:`, `test:`.
|
|
117
|
-
|
|
118
|
-
|
|
120
|
+
`feat:`, `fix:`, `docs:`, `chore:`, `ci:`, `refactor:`, `test:`. Changing an
|
|
121
|
+
existing method's signature or what it sends is breaking — mark it with a
|
|
122
|
+
`!` and a `BREAKING CHANGE:` footer, since that's what decides the next
|
|
119
123
|
version number.
|
|
120
124
|
|
|
121
|
-
Everything
|
|
122
|
-
|
|
125
|
+
Everything here is written in **English** — code, comments, commit messages,
|
|
126
|
+
documentation.
|
|
123
127
|
|
|
124
128
|
## Code of conduct
|
|
125
129
|
|
|
@@ -127,5 +131,6 @@ By participating you agree to the [Code of Conduct](CODE_OF_CONDUCT.md).
|
|
|
127
131
|
|
|
128
132
|
## Releasing (maintainers)
|
|
129
133
|
|
|
130
|
-
See
|
|
131
|
-
|
|
134
|
+
See RELEASING.md in the repository — it is not part of the published
|
|
135
|
+
package. The `release` workflow publishes; `npm publish` from a working tree
|
|
136
|
+
is not how a version gets to the registry.
|