@soat/cli 0.15.3 → 0.15.5

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.
Files changed (2) hide show
  1. package/dist/index.mjs +140 -11
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -3,6 +3,8 @@ import { createHmac, timingSafeEqual } from "node:crypto";
3
3
  import { createServer } from "node:http";
4
4
  import * as path from "node:path";
5
5
  import { fileURLToPath } from "node:url";
6
+ import input from "@inquirer/input";
7
+ import password from "@inquirer/password";
6
8
  import * as sdk from "@soat/sdk";
7
9
  import { createClient, createConfig } from "@soat/sdk";
8
10
  import { program } from "commander";
@@ -11,7 +13,7 @@ import { load } from "js-yaml";
11
13
  import * as os from "node:os";
12
14
 
13
15
  //#region package.json
14
- var version = "0.15.3";
16
+ var version = "0.15.5";
15
17
 
16
18
  //#endregion
17
19
  //#region src/cli-wrappers/wrappers/formations.ts
@@ -3556,6 +3558,18 @@ var routes = {
3556
3558
  "required": false,
3557
3559
  "type": "string",
3558
3560
  "in": "body"
3561
+ }, {
3562
+ "name": "tags",
3563
+ "description": "Per-entry tag strings, used for entry-granularity filtering in search-knowledge (memory_tags)",
3564
+ "required": false,
3565
+ "type": "array",
3566
+ "in": "body"
3567
+ }, {
3568
+ "name": "metadata",
3569
+ "description": "Arbitrary structured metadata attached to the entry",
3570
+ "required": false,
3571
+ "type": "object",
3572
+ "in": "body"
3559
3573
  }, {
3560
3574
  "name": "duplicate_threshold",
3561
3575
  "description": "Cosine similarity score at or above which the incoming content is considered a duplicate and skipped (default 0.95)",
@@ -3604,6 +3618,18 @@ var routes = {
3604
3618
  "required": false,
3605
3619
  "type": "string",
3606
3620
  "in": "body"
3621
+ }, {
3622
+ "name": "tags",
3623
+ "description": "Replaces the entry's tags. Pass null or an empty array to clear.",
3624
+ "required": false,
3625
+ "type": "array",
3626
+ "in": "body"
3627
+ }, {
3628
+ "name": "metadata",
3629
+ "description": "Replaces the entry's metadata. Pass null to clear.",
3630
+ "required": false,
3631
+ "type": "object",
3632
+ "in": "body"
3607
3633
  }]
3608
3634
  },
3609
3635
  "delete-memory-entry": {
@@ -5166,7 +5192,7 @@ var routes = {
5166
5192
  description: "Returns the raw usage-meter rows the caller can access, most recent first, optionally filtered by agent and generation. Each row is the per-generation token usage as reported by the provider, for audit and reconciliation.",
5167
5193
  moduleDocsUrl: "https://soat.ttoss.dev/docs/modules/usage",
5168
5194
  pathParams: [],
5169
- queryParams: ["agent_id", "generation_id", "trace_id", "trigger_id", "action_id", "limit", "offset"],
5195
+ queryParams: ["agent_id", "generation_id", "trace_id", "trigger_id", "action_id", "meter_type", "limit", "offset"],
5170
5196
  flags: [{
5171
5197
  "name": "agent_id",
5172
5198
  "description": "Filter by agent public ID",
@@ -5197,6 +5223,12 @@ var routes = {
5197
5223
  "required": false,
5198
5224
  "type": "string",
5199
5225
  "in": "query"
5226
+ }, {
5227
+ "name": "meter_type",
5228
+ "description": "Filter by meter type (e.g. `llm_tokens`, `compute_execution`, `api_request`, `storage`)\n",
5229
+ "required": false,
5230
+ "type": "string",
5231
+ "in": "query"
5200
5232
  }, {
5201
5233
  "name": "limit",
5202
5234
  "description": "",
@@ -5211,17 +5243,119 @@ var routes = {
5211
5243
  "in": "query"
5212
5244
  }]
5213
5245
  },
5246
+ "get-usage": {
5247
+ serviceClass: "Usage",
5248
+ operationId: "getUsage",
5249
+ description: "Returns a project's usage rolled up over an optional `[from, to]` time window, bucketed by a single dimension. Each group and the grand total carry summed token counts and `cost_usd` (null when no event in the bucket was priced). This is the per-project cost-by-range/by-category query — a monthly figure without scanning raw meter rows client-side.",
5250
+ moduleDocsUrl: "https://soat.ttoss.dev/docs/modules/usage",
5251
+ pathParams: [],
5252
+ queryParams: ["project_id", "group_by", "from", "to"],
5253
+ flags: [{
5254
+ "name": "project_id",
5255
+ "description": "Project public ID to aggregate usage for",
5256
+ "required": true,
5257
+ "type": "string",
5258
+ "in": "query"
5259
+ }, {
5260
+ "name": "group_by",
5261
+ "description": "Dimension to bucket by. `day` buckets on the event's UTC calendar day; the others bucket on the matching column.\n",
5262
+ "required": true,
5263
+ "type": "string",
5264
+ "in": "query"
5265
+ }, {
5266
+ "name": "from",
5267
+ "description": "Inclusive lower bound (ISO-8601 timestamp) on the event created_at. Omit for no lower bound.\n",
5268
+ "required": false,
5269
+ "type": "string",
5270
+ "in": "query"
5271
+ }, {
5272
+ "name": "to",
5273
+ "description": "Inclusive upper bound (ISO-8601 timestamp) on the event created_at. Omit for no upper bound.\n",
5274
+ "required": false,
5275
+ "type": "string",
5276
+ "in": "query"
5277
+ }]
5278
+ },
5279
+ "list-usage-thresholds": {
5280
+ serviceClass: "Usage",
5281
+ operationId: "listUsageThresholds",
5282
+ description: "Lists the usage alert thresholds the caller can access, optionally filtered by project_id. Each threshold fires the `usage.threshold_crossed` webhook when a project's cost or token usage over a calendar-month or rolling-24h window crosses the configured value.",
5283
+ moduleDocsUrl: "https://soat.ttoss.dev/docs/modules/usage",
5284
+ pathParams: [],
5285
+ queryParams: ["project_id"],
5286
+ flags: [{
5287
+ "name": "project_id",
5288
+ "description": "Filter by project public ID",
5289
+ "required": false,
5290
+ "type": "string",
5291
+ "in": "query"
5292
+ }]
5293
+ },
5294
+ "create-usage-threshold": {
5295
+ serviceClass: "Usage",
5296
+ operationId: "createUsageThreshold",
5297
+ description: "Creates a usage alert threshold on a project. Thresholds are immutable apart from deletion — to change one, delete and recreate it (which resets its fire state).",
5298
+ moduleDocsUrl: "https://soat.ttoss.dev/docs/modules/usage",
5299
+ pathParams: [],
5300
+ queryParams: [],
5301
+ flags: [{
5302
+ "name": "project_id",
5303
+ "description": "",
5304
+ "required": true,
5305
+ "type": "string",
5306
+ "in": "body"
5307
+ }, {
5308
+ "name": "metric",
5309
+ "description": "",
5310
+ "required": true,
5311
+ "type": "string",
5312
+ "in": "body"
5313
+ }, {
5314
+ "name": "window",
5315
+ "description": "",
5316
+ "required": true,
5317
+ "type": "string",
5318
+ "in": "body"
5319
+ }, {
5320
+ "name": "threshold",
5321
+ "description": "Must be greater than 0",
5322
+ "required": true,
5323
+ "type": "number",
5324
+ "in": "body"
5325
+ }]
5326
+ },
5327
+ "delete-usage-threshold": {
5328
+ serviceClass: "Usage",
5329
+ operationId: "deleteUsageThreshold",
5330
+ description: "Deletes a usage threshold, resetting its fire state. Recreating a threshold starts its once-per-window / hysteresis state fresh.",
5331
+ moduleDocsUrl: "https://soat.ttoss.dev/docs/modules/usage",
5332
+ pathParams: ["threshold_id"],
5333
+ queryParams: [],
5334
+ flags: [{
5335
+ "name": "threshold_id",
5336
+ "description": "Threshold public ID",
5337
+ "required": true,
5338
+ "type": "string",
5339
+ "in": "path"
5340
+ }]
5341
+ },
5214
5342
  "get-usage-receipt": {
5215
5343
  serviceClass: "Usage",
5216
5344
  operationId: "getUsageReceipt",
5217
- description: "Returns a billing receipt for a completed generation: per-model line items (tokens, the price-book version that priced them, and cost) plus totals.",
5345
+ description: "Returns a billing receipt. Pass generation_id for a per-generation receipt, or run_id for a per-run receipt summed across the orchestration run's meters — both share the same shape (per-model line items with tokens, the price-book version that priced them, and cost, plus totals). Exactly one of generation_id or run_id must be supplied.",
5218
5346
  moduleDocsUrl: "https://soat.ttoss.dev/docs/modules/usage",
5219
5347
  pathParams: [],
5220
- queryParams: ["generation_id"],
5348
+ queryParams: ["generation_id", "run_id"],
5221
5349
  flags: [{
5222
5350
  "name": "generation_id",
5223
- "description": "Generation public ID",
5224
- "required": true,
5351
+ "description": "Generation public ID. Mutually exclusive with run_id.\n",
5352
+ "required": false,
5353
+ "type": "string",
5354
+ "in": "query"
5355
+ }, {
5356
+ "name": "run_id",
5357
+ "description": "Orchestration run public ID. Returns the receipt summed across every generation the run metered. Mutually exclusive with generation_id.\n",
5358
+ "required": false,
5225
5359
  "type": "string",
5226
5360
  "in": "query"
5227
5361
  }]
@@ -5660,11 +5794,6 @@ var resolveServiceClass = serviceClassName => {
5660
5794
  program.name("soat").description("SOAT CLI").version(version).option("-p, --profile <name>", "config profile to use");
5661
5795
  program.addHelpText("after", "\nTip: Run `soat <command> --help` to see command-specific flags and docs.");
5662
5796
  program.command("configure").description("Save credentials to a named profile (~/.soat/config.json)").option("-p, --profile <name>", "profile name", "default").action(async opts => {
5663
- const [{
5664
- default: input
5665
- }, {
5666
- default: password
5667
- }] = await Promise.all([import("@inquirer/input"), import("@inquirer/password")]);
5668
5797
  const baseUrl = await input({
5669
5798
  message: "Base URL:"
5670
5799
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soat/cli",
3
- "version": "0.15.3",
3
+ "version": "0.15.5",
4
4
  "type": "module",
5
5
  "dependencies": {
6
6
  "@inquirer/input": "^5.1.2",
@@ -8,7 +8,7 @@
8
8
  "@ttoss/logger": "^0.8.19",
9
9
  "commander": "^15.0.0",
10
10
  "js-yaml": "^5.2.1",
11
- "@soat/sdk": "0.15.3"
11
+ "@soat/sdk": "0.15.5"
12
12
  },
13
13
  "devDependencies": {
14
14
  "@ttoss/config": "^1.37.17",