@engini/sdk 0.27.0 → 0.28.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/README.md +3 -0
- package/dist/resources/opa.d.ts +2 -0
- package/dist/resources/opa.js +2 -1
- package/dist/resources/tools.d.ts +7 -1
- package/dist/resources/tools.js +13 -4
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -85,6 +85,9 @@ console.log(agent.token); // a credential - store it, do not log it
|
|
|
85
85
|
const a = await client.opa.get(agent.agentId);
|
|
86
86
|
console.log(a.status, a.version, a.lastSeenAt);
|
|
87
87
|
|
|
88
|
+
// Only agents changed at or after a point in time (CLI: engini opa list --updated-after <iso>)
|
|
89
|
+
const recent = await client.opa.list({ updatedAfter: "2026-10-01T00:00:00Z" });
|
|
90
|
+
|
|
88
91
|
// Change its log level; the agent picks it up on its next poll
|
|
89
92
|
const r = await client.opa.update(agent.agentId, { logLevel: "Debug" });
|
|
90
93
|
if (!r.appliedToAgent) console.log("stored; the agent is not Online yet");
|
package/dist/resources/opa.d.ts
CHANGED
|
@@ -40,10 +40,12 @@ export declare class OpaResource {
|
|
|
40
40
|
* `status` is one of `WaitingForConnection`, `Online`, `Offline` or `Disabled`
|
|
41
41
|
* (case-insensitive on the wire; an unknown value is a 400, not a silently-ignored
|
|
42
42
|
* filter). `name` is a substring match.
|
|
43
|
+
* `updatedAfter` (ISO 8601 datetime) keeps agents changed at or after that instant (include `Z` or an offset).
|
|
43
44
|
*/
|
|
44
45
|
list(params?: {
|
|
45
46
|
status?: string;
|
|
46
47
|
name?: string;
|
|
48
|
+
updatedAfter?: string;
|
|
47
49
|
}): Promise<OnPremAgentListItem[]>;
|
|
48
50
|
/**
|
|
49
51
|
* One agent's status, self-reported version, last heartbeat and settings.
|
package/dist/resources/opa.js
CHANGED
|
@@ -40,12 +40,13 @@ export class OpaResource {
|
|
|
40
40
|
* `status` is one of `WaitingForConnection`, `Online`, `Offline` or `Disabled`
|
|
41
41
|
* (case-insensitive on the wire; an unknown value is a 400, not a silently-ignored
|
|
42
42
|
* filter). `name` is a substring match.
|
|
43
|
+
* `updatedAfter` (ISO 8601 datetime) keeps agents changed at or after that instant (include `Z` or an offset).
|
|
43
44
|
*/
|
|
44
45
|
async list(params = {}) {
|
|
45
46
|
const transport = this.client._transport;
|
|
46
47
|
return collect(paginate((offset, top) => call(onPremAgentsListAgents, {
|
|
47
48
|
client: transport,
|
|
48
|
-
query: { offset, top, status: params.status, name: params.name },
|
|
49
|
+
query: { offset, top, status: params.status, name: params.name, updatedAfter: params.updatedAfter },
|
|
49
50
|
})));
|
|
50
51
|
}
|
|
51
52
|
/**
|
|
@@ -26,7 +26,13 @@ export declare class ToolsResource {
|
|
|
26
26
|
private readonly client;
|
|
27
27
|
constructor(client: ToolsClient);
|
|
28
28
|
get(options?: ToolsGetOptions): Promise<ToolSchema[]>;
|
|
29
|
-
|
|
29
|
+
/**
|
|
30
|
+
* `connectionId` returns the schema as that connection sees it. Such a call bypasses
|
|
31
|
+
* the cache both ways: the cache is keyed by slug alone, so serving it would return
|
|
32
|
+
* the wrong connection's schema and writing it would poison later slug-only lookups
|
|
33
|
+
* (the `supports*` gate in `execute`).
|
|
34
|
+
*/
|
|
35
|
+
getOne(toolSlug: string, applicationSlug?: string, connectionId?: number): Promise<ToolSchema>;
|
|
30
36
|
execute(toolSlug: string, args?: Record<string, unknown>, options?: ToolsExecuteOptions): Promise<ToolExecuteResult>;
|
|
31
37
|
private gate;
|
|
32
38
|
private discoverSlugs;
|
package/dist/resources/tools.js
CHANGED
|
@@ -29,16 +29,25 @@ export class ToolsResource {
|
|
|
29
29
|
pairs = pairs.slice(0, options.limit);
|
|
30
30
|
return Promise.all(pairs.map(([slug, app]) => this.getOne(slug, app)));
|
|
31
31
|
}
|
|
32
|
-
|
|
32
|
+
/**
|
|
33
|
+
* `connectionId` returns the schema as that connection sees it. Such a call bypasses
|
|
34
|
+
* the cache both ways: the cache is keyed by slug alone, so serving it would return
|
|
35
|
+
* the wrong connection's schema and writing it would poison later slug-only lookups
|
|
36
|
+
* (the `supports*` gate in `execute`).
|
|
37
|
+
*/
|
|
38
|
+
async getOne(toolSlug, applicationSlug, connectionId) {
|
|
33
39
|
const cached = this.client._toolCache.get(toolSlug);
|
|
34
|
-
if (cached)
|
|
40
|
+
if (cached && connectionId === undefined)
|
|
35
41
|
return cached;
|
|
36
42
|
const detail = await call(toolsGetTool, {
|
|
37
43
|
client: this.client._transport,
|
|
38
44
|
path: { toolSlug },
|
|
39
|
-
query: applicationSlug !== undefined
|
|
45
|
+
query: applicationSlug !== undefined || connectionId !== undefined
|
|
46
|
+
? { applicationSlug, connectionId }
|
|
47
|
+
: undefined,
|
|
40
48
|
});
|
|
41
|
-
|
|
49
|
+
if (connectionId === undefined)
|
|
50
|
+
this.client._toolCache.set(toolSlug, detail);
|
|
42
51
|
return detail;
|
|
43
52
|
}
|
|
44
53
|
async execute(toolSlug, args = {}, options = {}) {
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@engini/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.0",
|
|
4
4
|
"description": "Engini SDK — agent-first ergonomic layer over the Engini Public API",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"test": "vitest run"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@engini/client": "0.
|
|
30
|
+
"@engini/client": "0.14.0",
|
|
31
31
|
"undici": "^6.0.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|