lua-cli 3.10.0 → 3.10.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.
|
@@ -11,7 +11,7 @@ import { PrimitiveKind, ManifestPrimitive } from '../compiler/types.js';
|
|
|
11
11
|
import DeviceApi from '../api/device.api.service.js';
|
|
12
12
|
import type { PushDeviceVersionDTO } from '../interfaces/devices.js';
|
|
13
13
|
import { BaseVersionedHandler } from './base.handler.js';
|
|
14
|
-
import type { YamlPrimitiveConfig } from './types.js';
|
|
14
|
+
import type { YamlPrimitiveConfig, ServerSyncData } from './types.js';
|
|
15
15
|
import type { YamlConfigDevice } from '../types/yaml.types.js';
|
|
16
16
|
/**
|
|
17
17
|
* Device primitive handler
|
|
@@ -23,6 +23,20 @@ export declare class DeviceHandler extends BaseVersionedHandler<YamlConfigDevice
|
|
|
23
23
|
readonly deleteCommand = "lua devices remove";
|
|
24
24
|
readonly yamlConfig: YamlPrimitiveConfig;
|
|
25
25
|
protected getApi(apiKey: string, agentId: string): DeviceApi;
|
|
26
|
+
/**
|
|
27
|
+
* Override fetchServerState to treat auth/network errors as non-fatal.
|
|
28
|
+
*
|
|
29
|
+
* The Device Gateway is feature-gated on the server
|
|
30
|
+
* (DEVICE_GATEWAY_ENABLED). When the feature is off or the endpoint
|
|
31
|
+
* doesn't exist for a given agent, the server returns 401 or 404.
|
|
32
|
+
* The base class re-throws AuthenticationError as fatal — which kills
|
|
33
|
+
* the entire compile/sync flow for ALL primitives, not just devices.
|
|
34
|
+
*
|
|
35
|
+
* Devices are an optional primitive. A missing or inaccessible device
|
|
36
|
+
* endpoint should not block compiling skills, webhooks, or anything
|
|
37
|
+
* else. We catch all errors and return empty server state.
|
|
38
|
+
*/
|
|
39
|
+
fetchServerState(apiKey: string, agentId: string): Promise<ServerSyncData>;
|
|
26
40
|
protected fetchFromServer(api: DeviceApi): Promise<any[] | null>;
|
|
27
41
|
protected createOnServer(api: DeviceApi, primitive: ManifestPrimitive): Promise<string | null>;
|
|
28
42
|
isActive(serverItem: any): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device.handler.d.ts","sourceRoot":"","sources":["../../src/primitives/device.handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAkB,MAAM,sBAAsB,CAAC;AAExF,OAAO,SAAS,MAAM,8BAA8B,CAAC;AACrD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"device.handler.d.ts","sourceRoot":"","sources":["../../src/primitives/device.handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAkB,MAAM,sBAAsB,CAAC;AAExF,OAAO,SAAS,MAAM,8BAA8B,CAAC;AACrD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D;;GAEG;AACH,qBAAa,aAAc,SAAQ,oBAAoB,CAAC,gBAAgB,EAAE,oBAAoB,CAAC;IAC7F,QAAQ,CAAC,IAAI,wBAAwB;IACrC,QAAQ,CAAC,WAAW,YAAY;IAChC,QAAQ,CAAC,iBAAiB,aAAa;IACvC,QAAQ,CAAC,aAAa,wBAAwB;IAC9C,QAAQ,CAAC,UAAU,EAAE,mBAAmB,CAGtC;IAEF,SAAS,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS;IAI5D;;;;;;;;;;;;OAYG;IACG,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;cAWhE,eAAe,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;cAQtD,cAAc,CAAC,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAWpG,QAAQ,CAAC,UAAU,EAAE,GAAG,GAAG,OAAO;IAI5B,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,oBAAoB;;;;IAM9F,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;;;;IAMvF;;OAEG;IACH,SAAS,CAAC,aAAa,CAAC,SAAS,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAavG;AAGD,eAAO,MAAM,aAAa,eAAsB,CAAC"}
|
|
@@ -29,6 +29,30 @@ export class DeviceHandler extends BaseVersionedHandler {
|
|
|
29
29
|
getApi(apiKey, agentId) {
|
|
30
30
|
return new DeviceApi(BASE_URLS.API, apiKey, agentId);
|
|
31
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* Override fetchServerState to treat auth/network errors as non-fatal.
|
|
34
|
+
*
|
|
35
|
+
* The Device Gateway is feature-gated on the server
|
|
36
|
+
* (DEVICE_GATEWAY_ENABLED). When the feature is off or the endpoint
|
|
37
|
+
* doesn't exist for a given agent, the server returns 401 or 404.
|
|
38
|
+
* The base class re-throws AuthenticationError as fatal — which kills
|
|
39
|
+
* the entire compile/sync flow for ALL primitives, not just devices.
|
|
40
|
+
*
|
|
41
|
+
* Devices are an optional primitive. A missing or inaccessible device
|
|
42
|
+
* endpoint should not block compiling skills, webhooks, or anything
|
|
43
|
+
* else. We catch all errors and return empty server state.
|
|
44
|
+
*/
|
|
45
|
+
async fetchServerState(apiKey, agentId) {
|
|
46
|
+
try {
|
|
47
|
+
const api = this.getApi(apiKey, agentId);
|
|
48
|
+
const serverItems = await this.fetchFromServer(api);
|
|
49
|
+
return { serverItems };
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
// Silently degrade — device sync is optional.
|
|
53
|
+
return { serverItems: null };
|
|
54
|
+
}
|
|
55
|
+
}
|
|
32
56
|
async fetchFromServer(api) {
|
|
33
57
|
const response = await api.getDevices();
|
|
34
58
|
if (!response.success || !response.data?.devices) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device.handler.js","sourceRoot":"","sources":["../../src/primitives/device.handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,aAAa,EAAqC,MAAM,sBAAsB,CAAC;AACxF,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,SAAS,MAAM,8BAA8B,CAAC;AAErD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAIzD;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,oBAA4D;IAA/F;;QACW,SAAI,GAAG,aAAa,CAAC,MAAM,CAAC;QAC5B,gBAAW,GAAG,QAAQ,CAAC;QACvB,sBAAiB,GAAG,SAAS,CAAC;QAC9B,kBAAa,GAAG,oBAAoB,CAAC;QACrC,eAAU,GAAwB;YACzC,OAAO,EAAE,SAAS;YAClB,OAAO,EAAE,UAAU;SACpB,CAAC;
|
|
1
|
+
{"version":3,"file":"device.handler.js","sourceRoot":"","sources":["../../src/primitives/device.handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,aAAa,EAAqC,MAAM,sBAAsB,CAAC;AACxF,O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AAE,OAAO,EAAE,QAAQ,CAAC,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC;IACvE,CAAC;IAED;;OAEG;IACO,aAAa,CAAC,SAA4B,EAAE,cAAsB;QAC1E,MAAM,MAAM,GAAG,SAA2B,CAAC;QAC3C,OAAO;YACL,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,WAAW,EAAE,MAAM,CAAC,WAAW;YAC/B,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,IAAI,EAAE,cAAc;YACpB,eAAe,EAAE,cAAc;YAC/B,YAAY,EAAE,MAAM,CAAC,IAAI;SAC1B,CAAC;IACJ,CAAC;CACF;AAED,4BAA4B;AAC5B,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,aAAa,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lua-cli",
|
|
3
|
-
"version": "3.10.
|
|
3
|
+
"version": "3.10.1",
|
|
4
4
|
"description": "Build, test, and deploy AI agents with custom tools, webhooks, and scheduled jobs. Features LuaAgent unified configuration, streaming chat, and batch deployment.",
|
|
5
5
|
"readmeFilename": "README.md",
|
|
6
6
|
"main": "dist/api-exports.js",
|