lua-cli 3.28.0 → 3.29.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 +18 -8
- package/dist/api-exports.d.ts +24 -7
- package/dist/api-exports.js +810 -472
- package/dist/api-exports.js.map +1 -1
- package/dist/index.js +1547 -1783
- package/dist/index.js.map +1 -1
- package/docs/README.md +4 -5
- package/package.json +1 -1
- package/template/package.json +1 -1
package/README.md
CHANGED
|
@@ -44,7 +44,7 @@ lua --version
|
|
|
44
44
|
|
|
45
45
|
## Authentication
|
|
46
46
|
|
|
47
|
-
lua-cli authenticates
|
|
47
|
+
lua-cli authenticates with a scoped personal credential or an existing API key. New email login limits the credential to the organization, agents, and role you select. Existing scoped and non-dotted legacy keys remain supported when you supply them directly.
|
|
48
48
|
|
|
49
49
|
The key is resolved from the following sources in priority order:
|
|
50
50
|
|
|
@@ -60,21 +60,31 @@ The key is resolved from the following sources in priority order:
|
|
|
60
60
|
lua auth configure
|
|
61
61
|
```
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
Choose **Email** to confirm an OTP. Select one organization, one or more agents, and an assignable role. Builder is the default role. The CLI stores the scoped credential in `~/.lua-cli/credentials` with mode `0600` on POSIX systems.
|
|
64
|
+
|
|
65
|
+
Choose **API Key** to validate and save an existing scoped or legacy key unchanged. The CLI does not rotate or revoke the supplied key.
|
|
64
66
|
|
|
65
67
|
```bash
|
|
66
68
|
# Non-interactive variants:
|
|
67
|
-
lua auth configure --api-key "
|
|
68
|
-
lua auth configure --email user@example.com
|
|
69
|
-
lua auth configure
|
|
69
|
+
lua auth configure --api-key "your-api-key"
|
|
70
|
+
lua auth configure --email user@example.com
|
|
71
|
+
lua auth configure \
|
|
72
|
+
--email user@example.com \
|
|
73
|
+
--otp 123456 \
|
|
74
|
+
--org-id org_123 \
|
|
75
|
+
--agent-id agent_123 \
|
|
76
|
+
--role builder \
|
|
77
|
+
--name "deployment laptop"
|
|
70
78
|
```
|
|
71
79
|
|
|
80
|
+
Repeat `--agent-id` to bind the credential to more than one agent. For a new local login, prefer the interactive command and keep the email, OTP, and secret out of AI conversations.
|
|
81
|
+
|
|
72
82
|
### Option B — Environment variable (CI/CD, Docker, servers)
|
|
73
83
|
|
|
74
84
|
Set `LUA_API_KEY` in your environment. This takes priority over all other sources and requires no file on disk — ideal for headless servers, VMs, and containers.
|
|
75
85
|
|
|
76
86
|
```bash
|
|
77
|
-
export LUA_API_KEY="
|
|
87
|
+
export LUA_API_KEY="your-api-key"
|
|
78
88
|
lua push all --force --auto-deploy
|
|
79
89
|
```
|
|
80
90
|
|
|
@@ -83,7 +93,7 @@ lua push all --force --auto-deploy
|
|
|
83
93
|
Create a `.env` file in your project root:
|
|
84
94
|
|
|
85
95
|
```bash
|
|
86
|
-
echo 'LUA_API_KEY=
|
|
96
|
+
echo 'LUA_API_KEY=your-api-key' >> .env
|
|
87
97
|
```
|
|
88
98
|
|
|
89
99
|
lua-cli automatically loads `.env` on startup. Add `.env` to your `.gitignore` to avoid committing credentials.
|
|
@@ -138,7 +148,7 @@ lua auth logout --force # No prompt
|
|
|
138
148
|
lua auth configure
|
|
139
149
|
```
|
|
140
150
|
|
|
141
|
-
|
|
151
|
+
Choose **Email** and select the organization, agents, and role for the new scoped credential. If you already have a working key, choose **API Key** to keep using it unchanged. For CI or server environments, set `LUA_API_KEY` from a secret manager. See [Authentication](#authentication).
|
|
142
152
|
|
|
143
153
|
### 2. Initialize Project
|
|
144
154
|
|
package/dist/api-exports.d.ts
CHANGED
|
@@ -1777,11 +1777,12 @@ declare type HeadersResolverFunction = () => Record<string, string>;
|
|
|
1777
1777
|
*/
|
|
1778
1778
|
declare abstract class HttpClient {
|
|
1779
1779
|
protected baseUrl: string;
|
|
1780
|
+
private readonly requestCredential?;
|
|
1780
1781
|
/**
|
|
1781
1782
|
* Creates an instance of HttpClient
|
|
1782
1783
|
* @param baseUrl - The base URL for all API requests
|
|
1783
1784
|
*/
|
|
1784
|
-
constructor(baseUrl: string);
|
|
1785
|
+
constructor(baseUrl: string, requestCredential?: RequestCredentialInput | undefined);
|
|
1785
1786
|
/**
|
|
1786
1787
|
* Makes an HTTP request with standardized error handling
|
|
1787
1788
|
* @param url - The full URL to request
|
|
@@ -1839,6 +1840,7 @@ declare abstract class HttpClient {
|
|
|
1839
1840
|
* cannot be recovered after an ambiguous network or server failure.
|
|
1840
1841
|
*/
|
|
1841
1842
|
protected httpPostOnce<T>(url: string, data?: any, headers?: Record<string, string>): Promise<ApiResponse<T>>;
|
|
1843
|
+
protected httpPostCoreDrainRetry<T>(url: string, data?: any, headers?: Record<string, string>): Promise<ApiResponse<T>>;
|
|
1842
1844
|
/**
|
|
1843
1845
|
* Performs an HTTP PUT request
|
|
1844
1846
|
* @param url - The relative URL path to request (will be appended to baseUrl)
|
|
@@ -2078,15 +2080,15 @@ declare interface Job {
|
|
|
2078
2080
|
* Handles all job-related API calls
|
|
2079
2081
|
*/
|
|
2080
2082
|
declare class JobApi extends HttpClient {
|
|
2081
|
-
apiKey: string;
|
|
2082
2083
|
agentId: string;
|
|
2084
|
+
readonly credential: RequestCredentialInput;
|
|
2083
2085
|
/**
|
|
2084
2086
|
* Creates an instance of JobApi
|
|
2085
2087
|
* @param baseUrl - The base URL for the API
|
|
2086
|
-
* @param
|
|
2088
|
+
* @param credential - The API key for authentication
|
|
2087
2089
|
* @param agentId - The unique identifier of the agent
|
|
2088
2090
|
*/
|
|
2089
|
-
constructor(baseUrl: string,
|
|
2091
|
+
constructor(baseUrl: string, credential: RequestCredentialInput, agentId: string);
|
|
2090
2092
|
/**
|
|
2091
2093
|
* Retrieves all jobs for the agent
|
|
2092
2094
|
* @returns Promise resolving to an ApiResponse containing an array of jobs with their versions
|
|
@@ -4635,15 +4637,14 @@ declare interface OrderAPI {
|
|
|
4635
4637
|
}
|
|
4636
4638
|
|
|
4637
4639
|
declare class OrderApi extends HttpClient implements OrderAPI {
|
|
4638
|
-
private apiKey;
|
|
4639
4640
|
private agentId;
|
|
4640
4641
|
/**
|
|
4641
4642
|
* Creates an instance of OrderApi
|
|
4642
4643
|
* @param baseUrl - The base URL for the API
|
|
4643
|
-
* @param
|
|
4644
|
+
* @param credential - The API key for authentication
|
|
4644
4645
|
* @param agentId - The unique identifier of the agent
|
|
4645
4646
|
*/
|
|
4646
|
-
constructor(baseUrl: string,
|
|
4647
|
+
constructor(baseUrl: string, credential: RequestCredentialInput, agentId: string);
|
|
4647
4648
|
/**
|
|
4648
4649
|
* Creates a new order from a basket
|
|
4649
4650
|
* @param orderData - The order creation request data containing basketId and additional order information
|
|
@@ -5463,6 +5464,22 @@ declare const REASONING_EFFORT_VALUES: readonly ["off", "minimal", "low", "mediu
|
|
|
5463
5464
|
|
|
5464
5465
|
declare type ReasoningEffort = (typeof REASONING_EFFORT_VALUES)[number];
|
|
5465
5466
|
|
|
5467
|
+
declare interface RequestCredential {
|
|
5468
|
+
readonly descriptor: RequestCredentialDescriptor;
|
|
5469
|
+
bearer(): Promise<string>;
|
|
5470
|
+
}
|
|
5471
|
+
|
|
5472
|
+
declare type RequestCredentialDescriptor = {
|
|
5473
|
+
kind: 'api-key';
|
|
5474
|
+
source: 'environment' | 'stored';
|
|
5475
|
+
} | {
|
|
5476
|
+
kind: 'first-party-session';
|
|
5477
|
+
source: 'stored';
|
|
5478
|
+
uid: string;
|
|
5479
|
+
};
|
|
5480
|
+
|
|
5481
|
+
declare type RequestCredentialInput = string | RequestCredential;
|
|
5482
|
+
|
|
5466
5483
|
/**
|
|
5467
5484
|
* Additive field on primitive publish responses. When the agent is under
|
|
5468
5485
|
* versioning the server performs a scoped promote and returns the newly
|