@lunnoa/client 2.1.0 → 2.2.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 CHANGED
@@ -277,13 +277,14 @@ npx @lunnoa/client tools get http_action_send-request --json
277
277
  npx @lunnoa/client apps list --json
278
278
  npx @lunnoa/client apps get http --json
279
279
  npx @lunnoa/client connections list --app gmail --json
280
+ npx @lunnoa/client ai-connections list --json
280
281
  npx @lunnoa/client agents list --json
281
282
  npx @lunnoa/client workflows list --json
282
283
  npx @lunnoa/client entity-types list --json
283
284
  npx @lunnoa/client features --json
284
285
  ```
285
286
 
286
- `tools list` is compact (`appId`, `actionId`, name, flags). `tools get` prints `inputConfig` and a `defineAction({ id, appId, input })` sketch. Auth flags and `LUNNOA_URL` / `LUNNOA_API_KEY` / `lunnoa.config` work the same as deploy. The CLI also reads `./.env` (real environment variables win).
287
+ `tools list` is compact (`appId`, `actionId`, name, flags). `tools get` prints `inputConfig` and a `defineAction({ id, appId, input })` sketch. `ai-connections list --json` prints the model ids each AI connection accepts; use `models[].id` as `defineAgent({ model })`. Auth flags and `LUNNOA_URL` / `LUNNOA_API_KEY` / `lunnoa.config` work the same as deploy. The CLI also reads `./.env` (real environment variables win).
287
288
 
288
289
  ## Regenerating the API types
289
290
 
package/dist/cli.js CHANGED
@@ -472,7 +472,7 @@ var AgentChatClient = class {
472
472
  function messageTaskBody(message, options = {}) {
473
473
  return {
474
474
  messages: [message],
475
- ...options.chatMode ? { chatMode: options.chatMode } : {},
475
+ chatMode: options.chatMode ?? "preview",
476
476
  ...options.data ? { data: options.data } : {},
477
477
  ...options.piiResolution ? { piiResolution: options.piiResolution } : {}
478
478
  };
@@ -852,6 +852,22 @@ var SsoAuthResource = class {
852
852
  }
853
853
  };
854
854
 
855
+ // src/resources/ai-connections.ts
856
+ var AiConnectionsResource = class {
857
+ constructor(http) {
858
+ this.http = http;
859
+ }
860
+ http;
861
+ /**
862
+ * Lists AI connections the caller can assign to an agent, with the model
863
+ * ids each connection accepts. Credentials are never included.
864
+ * Requires `agents:create` (the same permission as agent deploy).
865
+ */
866
+ list() {
867
+ return this.http.get("/api/ai-connections");
868
+ }
869
+ };
870
+
855
871
  // src/resources/connections.ts
856
872
  var ConnectionsResource = class {
857
873
  constructor(http) {
@@ -2077,6 +2093,8 @@ var LunnoaClient = class {
2077
2093
  variables;
2078
2094
  scorecards;
2079
2095
  connections;
2096
+ /** AI provider connections and the model ids each one accepts. */
2097
+ aiConnections;
2080
2098
  workflowApps;
2081
2099
  discovery;
2082
2100
  constructor(options) {
@@ -2100,6 +2118,7 @@ var LunnoaClient = class {
2100
2118
  this.variables = new VariablesResource(this.http);
2101
2119
  this.scorecards = new ScorecardsResource(this.http);
2102
2120
  this.connections = new ConnectionsResource(this.http);
2121
+ this.aiConnections = new AiConnectionsResource(this.http);
2103
2122
  this.discovery = new DiscoveryResource(this.http);
2104
2123
  }
2105
2124
  };
@@ -2113,6 +2132,7 @@ var GROUPS_WITH_SUBCOMMAND = /* @__PURE__ */ new Set([
2113
2132
  "tools",
2114
2133
  "apps",
2115
2134
  "connections",
2135
+ "ai-connections",
2116
2136
  "skills"
2117
2137
  ]);
2118
2138
  var VALUE_FLAGS = /* @__PURE__ */ new Set([
@@ -2210,6 +2230,7 @@ var USAGE = `Usage:
2210
2230
  npx @lunnoa/client apps get <appId> [--json]
2211
2231
  npx @lunnoa/client connections list [--app <appId>] [--json]
2212
2232
  npx @lunnoa/client connections get <connectionId> [--json]
2233
+ npx @lunnoa/client ai-connections list [--json]
2213
2234
  npx @lunnoa/client agents list [--json]
2214
2235
  npx @lunnoa/client workflows list [--json]
2215
2236
  npx @lunnoa/client entity-types list [--json]
@@ -2239,6 +2260,9 @@ Options:
2239
2260
  Environment: LUNNOA_URL, LUNNOA_API_KEY (also read from ./.env)
2240
2261
  Optional config file: lunnoa.config.ts | .mjs | .js | .json
2241
2262
 
2263
+ ai-connections list prints the model ids each AI connection accepts. Use
2264
+ models[].id as defineAgent({ model }). connections list is app connections
2265
+ (Gmail, HTTP), not model providers.
2242
2266
  tools get prints inputConfig and a defineAction() sketch. tools list is compact;
2243
2267
  run tools get for the schema. An entity-type slug is unique on the deployment
2244
2268
  and grants the API key's workspace when the slug is new.
@@ -2602,6 +2626,40 @@ async function runAppsGet(client, args) {
2602
2626
  { key: "needsConnection", header: "NEEDS_CONN" }
2603
2627
  ]);
2604
2628
  }
2629
+ async function runAiConnectionsList(client, args) {
2630
+ const connections = await client.aiConnections.list();
2631
+ if (args.json) {
2632
+ printJson(connections);
2633
+ return;
2634
+ }
2635
+ const rows = connections.flatMap((connection) => {
2636
+ if (connection.models.length === 0) {
2637
+ return [
2638
+ {
2639
+ name: connection.name,
2640
+ provider: connection.provider,
2641
+ model: "",
2642
+ isDefault: connection.isDefault,
2643
+ id: connection.id
2644
+ }
2645
+ ];
2646
+ }
2647
+ return connection.models.map((model) => ({
2648
+ name: connection.name,
2649
+ provider: connection.provider,
2650
+ model: model.id,
2651
+ isDefault: connection.isDefault && model.isDefault,
2652
+ id: connection.id
2653
+ }));
2654
+ });
2655
+ printTable(rows, [
2656
+ { key: "name", header: "CONNECTION" },
2657
+ { key: "provider", header: "PROVIDER" },
2658
+ { key: "model", header: "MODEL" },
2659
+ { key: "isDefault", header: "DEFAULT" },
2660
+ { key: "id", header: "ID" }
2661
+ ]);
2662
+ }
2605
2663
  async function runConnectionsList(client, args) {
2606
2664
  const connections = await client.connections.list({
2607
2665
  expansion: ["workflowAppId", "connectionId", "createdAt"]
@@ -3490,6 +3548,7 @@ var DISCOVERY_SUBCOMMANDS = {
3490
3548
  tools: ["list", "get", "search"],
3491
3549
  apps: ["list", "get"],
3492
3550
  connections: ["list", "get"],
3551
+ "ai-connections": ["list"],
3493
3552
  tables: ["list", "get"],
3494
3553
  features: void 0
3495
3554
  };
@@ -3523,7 +3582,7 @@ ${USAGE}`
3523
3582
  }
3524
3583
  async function runDiscovery(args) {
3525
3584
  const { command, subcommand } = args;
3526
- if (command === "tools" || command === "apps" || command === "connections" || command === "tables") {
3585
+ if (command === "tools" || command === "apps" || command === "connections" || command === "ai-connections" || command === "tables") {
3527
3586
  assertKnownDiscoveryShape(args);
3528
3587
  }
3529
3588
  if (!isDiscoveryCommand(args)) {
@@ -3558,6 +3617,10 @@ async function runDiscovery(args) {
3558
3617
  await runConnectionsGet(client, args);
3559
3618
  return true;
3560
3619
  }
3620
+ if (command === "ai-connections" && subcommand === "list") {
3621
+ await runAiConnectionsList(client, args);
3622
+ return true;
3623
+ }
3561
3624
  if (command === "agents" && subcommand === "list") {
3562
3625
  await runAgentsList(client, args);
3563
3626
  return true;
package/dist/index.cjs CHANGED
@@ -468,7 +468,7 @@ var AgentChatClient = class {
468
468
  function messageTaskBody(message, options = {}) {
469
469
  return {
470
470
  messages: [message],
471
- ...options.chatMode ? { chatMode: options.chatMode } : {},
471
+ chatMode: options.chatMode ?? "preview",
472
472
  ...options.data ? { data: options.data } : {},
473
473
  ...options.piiResolution ? { piiResolution: options.piiResolution } : {}
474
474
  };
@@ -894,6 +894,22 @@ var SsoAuthResource = class {
894
894
  }
895
895
  };
896
896
 
897
+ // src/resources/ai-connections.ts
898
+ var AiConnectionsResource = class {
899
+ constructor(http) {
900
+ this.http = http;
901
+ }
902
+ http;
903
+ /**
904
+ * Lists AI connections the caller can assign to an agent, with the model
905
+ * ids each connection accepts. Credentials are never included.
906
+ * Requires `agents:create` (the same permission as agent deploy).
907
+ */
908
+ list() {
909
+ return this.http.get("/api/ai-connections");
910
+ }
911
+ };
912
+
897
913
  // src/resources/connections.ts
898
914
  var ConnectionsResource = class {
899
915
  constructor(http) {
@@ -2119,6 +2135,8 @@ var LunnoaClient = class {
2119
2135
  variables;
2120
2136
  scorecards;
2121
2137
  connections;
2138
+ /** AI provider connections and the model ids each one accepts. */
2139
+ aiConnections;
2122
2140
  workflowApps;
2123
2141
  discovery;
2124
2142
  constructor(options) {
@@ -2142,6 +2160,7 @@ var LunnoaClient = class {
2142
2160
  this.variables = new VariablesResource(this.http);
2143
2161
  this.scorecards = new ScorecardsResource(this.http);
2144
2162
  this.connections = new ConnectionsResource(this.http);
2163
+ this.aiConnections = new AiConnectionsResource(this.http);
2145
2164
  this.discovery = new DiscoveryResource(this.http);
2146
2165
  }
2147
2166
  };
@@ -2223,6 +2242,7 @@ exports.ActionsResource = ActionsResource;
2223
2242
  exports.AgentChatClient = AgentChatClient;
2224
2243
  exports.AgentChatStream = AgentChatStream;
2225
2244
  exports.AgentsResource = AgentsResource;
2245
+ exports.AiConnectionsResource = AiConnectionsResource;
2226
2246
  exports.ApprovalsResource = ApprovalsResource;
2227
2247
  exports.AuthResource = AuthResource;
2228
2248
  exports.ConnectionsResource = ConnectionsResource;