@2kw/ai 7.0.0-dev.8 → 7.0.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
@@ -110,7 +110,7 @@ kubectl-style contexts switch between organizations and environments:
110
110
  | `tracing` | Inspect request traces and tracing settings |
111
111
  | `memory` | Your agent memory files (list, read, write, delete, forget); member totals and erasure for admins |
112
112
  | `providers` | Manage BYOK AI providers |
113
- | `analytics` | Usage analytics: spend, quality, providers, errors |
113
+ | `analytics` | Usage analytics: operations, tokens, quality, providers, errors |
114
114
  | `billing` | Check subscription tier and usage limits |
115
115
  | `agents` | Run agents and answer paused runs (approvals and relayed tool calls); apply, export and scaffold agent.yaml; manage versions, labels, approvals and tool catalogs |
116
116
  | `skills` | Import and export SKILL.md bundles; manage skill versions and labels |
@@ -8,7 +8,7 @@ function addDateOptions(cmd) {
8
8
  }
9
9
  export function makeAnalyticsCommand() {
10
10
  const cmd = new Command("analytics").description("Organization analytics");
11
- const summary = new Command("summary").description("Cross-surface summary (total ops, spend, p95, per-surface breakdown)");
11
+ const summary = new Command("summary").description("Cross-surface summary (total ops, tokens, p95, per-surface breakdown)");
12
12
  addDateOptions(summary);
13
13
  summary.action(async (opts, command) => {
14
14
  await runAction(command, async () => {
@@ -66,7 +66,6 @@ export function makeAnalyticsCommand() {
66
66
  "successfulExtractions",
67
67
  "successRate",
68
68
  "totalTokens",
69
- "totalCost",
70
69
  "avgDurationMs",
71
70
  ]);
72
71
  });
@@ -89,7 +88,6 @@ export function makeAnalyticsCommand() {
89
88
  "successfulExtractions",
90
89
  "successRate",
91
90
  "totalTokens",
92
- "totalCost",
93
91
  "avgDurationMs",
94
92
  ]);
95
93
  });
@@ -8,19 +8,20 @@ import { formatPage, formatDetail, formatSuccess, withSpinner } from "../lib/out
8
8
  import { addPaginationOptions, paginationParams } from "../lib/pagination.js";
9
9
  import { fileToBlob } from "../lib/multipart.js";
10
10
  /**
11
- * Upload a single file with purpose=agent_input|knowledge. The generated type
12
- * describes the "file" part as a binary string, which FormData cannot match,
13
- * so the placeholder body satisfies the type and bodySerializer sends the
14
- * real part.
11
+ * Upload a single file with purpose=agent_input|knowledge. Both are multipart
12
+ * form parts. The generated type describes the "file" part as a binary string,
13
+ * which FormData cannot match, so the placeholder body satisfies the type and
14
+ * bodySerializer sends the real parts.
15
15
  */
16
16
  async function uploadFile(command, filePath, purpose) {
17
17
  const { blob, filename } = fileToBlob(filePath);
18
18
  const formData = new FormData();
19
19
  formData.append("file", blob, filename);
20
+ formData.append("purpose", purpose);
20
21
  const client = getClient(command);
21
22
  const { data } = await client.POST("/v1/files", {
22
- params: { query: { purpose } },
23
- body: { file: "" },
23
+ // The server validates the purpose and answers 400 for an unknown one, so the CLI does not narrow it.
24
+ body: { file: "", purpose: purpose },
24
25
  bodySerializer: () => formData,
25
26
  });
26
27
  return data;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@2kw/ai",
3
- "version": "7.0.0-dev.8",
3
+ "version": "7.0.0",
4
4
  "description": "CLI for 2kw.ai — schema-driven document extraction, an OpenAI-compatible EU LLM gateway, transcription, prompts, datasets, and experiments from your terminal or agentic workflows. Ships as 2kw, backbone, and bb.",
5
5
  "keywords": [
6
6
  "cli",