stateplane 0.0.0-stage → 0.0.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/README.md +10 -2
- package/bin/keychain.swift +19 -0
- package/bin/secure-acl.ps1 +69 -0
- package/bin/stateplane.js +4 -0
- package/dist/config.d.ts +41 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1329 -0
- package/dist/run.d.ts +3 -0
- package/dist/transport.d.ts +54 -0
- package/package.json +24 -4
package/dist/run.d.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export declare class StateplaneCliError extends Error {
|
|
2
|
+
readonly code: string;
|
|
3
|
+
readonly requestId?: string | undefined;
|
|
4
|
+
readonly retryAfter?: number | undefined;
|
|
5
|
+
readonly retryable: boolean;
|
|
6
|
+
constructor(code: string, requestId?: string | undefined, retryAfter?: number | undefined, retryable?: boolean);
|
|
7
|
+
}
|
|
8
|
+
export interface ClientOptions {
|
|
9
|
+
endpoint: string;
|
|
10
|
+
token: string;
|
|
11
|
+
fetch?: typeof fetch;
|
|
12
|
+
timeoutMs?: number;
|
|
13
|
+
sleep?: (ms: number) => Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
/** A download's single deadline: the signal aborts every attempt and the body at `end`;
|
|
16
|
+
* the consumer of the body checks `expired` around each local write and before success. */
|
|
17
|
+
export interface Deadline {
|
|
18
|
+
signal: AbortSignal;
|
|
19
|
+
end: number;
|
|
20
|
+
expired(): boolean;
|
|
21
|
+
}
|
|
22
|
+
/** A thin HTTP client. Only read requests may be repeated automatically. */
|
|
23
|
+
export declare class StateplaneHttpClient {
|
|
24
|
+
private readonly endpoint;
|
|
25
|
+
private readonly token;
|
|
26
|
+
private readonly fetcher;
|
|
27
|
+
private readonly timeoutMs;
|
|
28
|
+
private readonly sleep;
|
|
29
|
+
constructor(options: ClientOptions);
|
|
30
|
+
/** One wire attempt; only an explicit safe-read response can request a repeat. A raw
|
|
31
|
+
* exchange returns a successful response unread, for a byte stream, and runs
|
|
32
|
+
* under the download's deadline, which never waits past its end. */
|
|
33
|
+
private exchange;
|
|
34
|
+
/** Resolve the route before any bearer token is attached to a request. */
|
|
35
|
+
private route;
|
|
36
|
+
/** A wire failure is ambiguous for writes, but a read can be repeated twice,
|
|
37
|
+
* within a download's deadline. */
|
|
38
|
+
private recoverWireFailure;
|
|
39
|
+
/** Validate the route once, then bound retries to read-only operations. */
|
|
40
|
+
request(method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE', path: string, body?: unknown, extraHeaders?: Record<string, string>): Promise<unknown>;
|
|
41
|
+
/** Read a byte stream, such as a source's original, asking for it unencoded.
|
|
42
|
+
* The response is returned unread once its status is successful, with the
|
|
43
|
+
* deadline that bounds the whole download, including how its body is consumed;
|
|
44
|
+
* an error response is a CLI error. */
|
|
45
|
+
download(path: string): Promise<{
|
|
46
|
+
response: Response;
|
|
47
|
+
deadline: Deadline;
|
|
48
|
+
}>;
|
|
49
|
+
/** Send exact bytes with their media type, such as one upload attempt. Never repeated. */
|
|
50
|
+
upload(path: string, bytes: Uint8Array, contentType: string): Promise<unknown>;
|
|
51
|
+
/** A download passes its deadline: every attempt, each pause and the body share it.
|
|
52
|
+
* Any other request gives each attempt its own --timeout. */
|
|
53
|
+
private send;
|
|
54
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stateplane",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Stateplane CLI: shared state for all your agents. Built from @stateplane/cli in 21nCo/stateplane",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "21n",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "dist/index.js",
|
|
9
|
+
"types": "dist/index.d.ts",
|
|
10
|
+
"bin": {
|
|
11
|
+
"stateplane": "bin/stateplane.js"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"bin",
|
|
15
|
+
"dist",
|
|
16
|
+
"README.md"
|
|
17
|
+
],
|
|
18
|
+
"engines": {
|
|
19
|
+
"node": ">=22.0.0"
|
|
20
|
+
},
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "git+https://github.com/21nCo/stateplane.git"
|
|
24
|
+
},
|
|
25
|
+
"homepage": "https://github.com/21nCo/stateplane#readme"
|
|
26
|
+
}
|