@lotics/cli 0.97.0 → 0.98.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/dist/src/cli.js +22 -4
- package/dist/src/client.d.ts +7 -14
- package/dist/src/client.js +1 -31
- package/package.json +1 -1
package/dist/src/cli.js
CHANGED
|
@@ -44165,9 +44165,7 @@ import os2 from "node:os";
|
|
|
44165
44165
|
import path7 from "node:path";
|
|
44166
44166
|
import readline from "node:readline";
|
|
44167
44167
|
|
|
44168
|
-
// src/
|
|
44169
|
-
import fs from "node:fs";
|
|
44170
|
-
import path from "node:path";
|
|
44168
|
+
// ../shared/src/transport_error.ts
|
|
44171
44169
|
function gatewayErrorMessage(status) {
|
|
44172
44170
|
if (status === 524) {
|
|
44173
44171
|
return "The request took too long to finish (gateway timeout). It may still be running \u2014 check back in a moment, or try again.";
|
|
@@ -44181,6 +44179,10 @@ function transportErrorMessage(status, parsed) {
|
|
|
44181
44179
|
const jsonMessage = parsed && typeof parsed.message === "string" ? parsed.message : null;
|
|
44182
44180
|
return parsed === null || status >= 500 || jsonMessage === null ? gatewayErrorMessage(status) : jsonMessage;
|
|
44183
44181
|
}
|
|
44182
|
+
|
|
44183
|
+
// src/client.ts
|
|
44184
|
+
import fs from "node:fs";
|
|
44185
|
+
import path from "node:path";
|
|
44184
44186
|
function findAvailableFilename(dir, filename, reserved) {
|
|
44185
44187
|
const isTaken = (name) => {
|
|
44186
44188
|
const full = path.join(dir, name);
|
|
@@ -64415,7 +64417,8 @@ var aggregateOperationSchema = external_exports.enum([
|
|
|
64415
64417
|
"checked",
|
|
64416
64418
|
"unchecked",
|
|
64417
64419
|
"percent_checked",
|
|
64418
|
-
"percent_unchecked"
|
|
64420
|
+
"percent_unchecked",
|
|
64421
|
+
"string_agg"
|
|
64419
64422
|
]);
|
|
64420
64423
|
var OPERATION_FIELD_TYPES = {
|
|
64421
64424
|
empty: ["text", "number", "date", "select", "select_member", "select_record_link", "files", "formula", "rollup"],
|
|
@@ -64530,12 +64533,21 @@ var queryProjectionColumnSchema = zod_default.union([
|
|
|
64530
64533
|
zod_default.string().describe("Passthrough shorthand: a source field key. Output = the key, type = the field's type."),
|
|
64531
64534
|
queryProjectionColumnObjectSchema
|
|
64532
64535
|
]);
|
|
64536
|
+
var STRING_AGG_MAX_VALUES = 100;
|
|
64537
|
+
var STRING_AGG_DEFAULT_MAX_VALUES = 20;
|
|
64533
64538
|
var queryAggregateColumnSchema = zod_default.object({
|
|
64534
64539
|
output: zod_default.string().describe("Output column name"),
|
|
64535
64540
|
type: queryColumnTypeSchema.describe("Output column type"),
|
|
64536
64541
|
operation: aggregateOperationSchema,
|
|
64537
64542
|
input_column: zod_default.string().optional().describe(
|
|
64538
64543
|
"Input column to aggregate. Required for non-count operations; ignored for count."
|
|
64544
|
+
),
|
|
64545
|
+
separator: zod_default.string().max(8).optional().describe('string_agg only. Joins the values. Defaults to ", ".'),
|
|
64546
|
+
distinct: zod_default.boolean().optional().describe(
|
|
64547
|
+
"string_agg only. Collapses repeats \u2014 a group of containers sized 40HC/40HC/20DC aggregates to '20DC, 40HC'. Defaults to true, which is almost always what a summary column wants."
|
|
64548
|
+
),
|
|
64549
|
+
max_values: zod_default.number().int().min(1).max(STRING_AGG_MAX_VALUES).optional().describe(
|
|
64550
|
+
`string_agg only. Caps how many values are emitted so an unbounded child set cannot produce a giant cell. Defaults to ${STRING_AGG_DEFAULT_MAX_VALUES}. Pair with a \`unique\` aggregate to render an accurate '+N more'.`
|
|
64539
64551
|
)
|
|
64540
64552
|
});
|
|
64541
64553
|
var rankingWindowFunctionSchema = (fn) => zod_default.object({ output: zod_default.string().describe("Output column name"), fn: zod_default.literal(fn) }).strict();
|
|
@@ -64892,6 +64904,12 @@ var appAgentDeclarationSchema = zod_default.object({
|
|
|
64892
64904
|
knowledge_doc_ids: zod_default.array(zod_default.string().min(1)).optional().describe(
|
|
64893
64905
|
"Knowledge docs the agent may read, validated at declare time against the app owner's `use` access. Small docs are inlined into the agent's system prompt each run; a doc too large to inline requires the code tools (code_exec) in tool_names and is read by staging it into a code run. Omit for an agent that needs no knowledge."
|
|
64894
64906
|
),
|
|
64907
|
+
query_aliases: zod_default.array(zod_default.string().min(1)).optional().describe(
|
|
64908
|
+
"Named queries from this app's manifest the agent may run via `run_app_query`, validated at declare time against the app's own queries. This is the agent's ENTIRE read surface over workspace data \u2014 a template fixes the tables, filters, and projection, so it bounds rows and columns, not just tables. Omit for an agent that reads no records."
|
|
64909
|
+
),
|
|
64910
|
+
workflow_aliases: zod_default.array(zod_default.string().min(1)).optional().describe(
|
|
64911
|
+
"Workflows from this app's manifest the agent may invoke via `run_app_workflow`, validated at declare time against the app's own workflows. This is the agent's ENTIRE write surface \u2014 the same declared mutation path the app's UI uses, so table hooks and side-effect harvesting apply. Omit for a read-only agent."
|
|
64912
|
+
),
|
|
64895
64913
|
model_id: zod_default.string().min(1).optional().describe(
|
|
64896
64914
|
"Chat model id the agent runs on, validated against ACCEPTED_CHAT_MODEL_IDS. Omit to follow the platform default chat model, resolved at run time \u2014 the preferred choice: the agent tracks model generations with no per-app rewrite. Pin only a deliberate, tested choice."
|
|
64897
64915
|
),
|
package/dist/src/client.d.ts
CHANGED
|
@@ -1,12 +1,4 @@
|
|
|
1
1
|
import type { ContractConfigEntry, KnowledgeUpgradeEntry, ModifiedArtifact, PackageContentBinding, UpgradeResolutions } from "./package_content_types";
|
|
2
|
-
/**
|
|
3
|
-
* The error message for a non-ok response. A genuine JSON error (a 4xx carrying
|
|
4
|
-
* a `message`) surfaces verbatim; a non-JSON body (a gateway HTML page), any
|
|
5
|
-
* 5xx, or a JSON body without a `message` falls back to a body-free,
|
|
6
|
-
* status-derived message. `parsed` is the JSON.parse of the body, or `null`.
|
|
7
|
-
* In parity (by value, no shared dep) with `packages/app-sdk/src/rpc.ts`.
|
|
8
|
-
*/
|
|
9
|
-
export declare function transportErrorMessage(status: number, parsed: unknown): string;
|
|
10
2
|
/** One sort key forwarded to the app query RPC (wire shape of a `TableRecordSort` entry). */
|
|
11
3
|
export interface AppQuerySortKey {
|
|
12
4
|
field_key: string;
|
|
@@ -89,19 +81,20 @@ export interface ToolInfo {
|
|
|
89
81
|
}
|
|
90
82
|
/**
|
|
91
83
|
* A single knowledge doc with its HYDRATED body — the shape of
|
|
92
|
-
* `GET /v1/knowledge_docs/{id}
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
* internally, so a CLI caller never needs to pass it.
|
|
84
|
+
* `GET /v1/knowledge_docs/{id}`, and the one content-read path a non-sandbox
|
|
85
|
+
* client has. `content_sha` is the concurrency token the REST PATCH echoes back
|
|
86
|
+
* as `expected_content_sha`; the `update_knowledge` TOOL CASes internally, so a
|
|
87
|
+
* CLI caller never needs to pass it.
|
|
97
88
|
*/
|
|
98
89
|
export interface KnowledgeDocDetail {
|
|
99
90
|
id: string;
|
|
100
91
|
workspace_id: string;
|
|
101
92
|
name: string;
|
|
102
93
|
description: string;
|
|
94
|
+
/** Folder address; "" is root. */
|
|
95
|
+
path: string;
|
|
103
96
|
content: string;
|
|
104
|
-
|
|
97
|
+
content_sha: string | null;
|
|
105
98
|
files: unknown[];
|
|
106
99
|
created_at: string;
|
|
107
100
|
updated_at: string;
|
package/dist/src/client.js
CHANGED
|
@@ -1,36 +1,6 @@
|
|
|
1
|
+
import { transportErrorMessage } from "@lotics/shared/transport_error";
|
|
1
2
|
import fs from "node:fs";
|
|
2
3
|
import path from "node:path";
|
|
3
|
-
/**
|
|
4
|
-
* A user-facing message for a transport/gateway failure — derived from the HTTP
|
|
5
|
-
* status, never from the response body. A 524 (edge timeout on a long run), any
|
|
6
|
-
* 5xx, or a non-JSON body (an HTML error page) must NOT surface its raw body. In
|
|
7
|
-
* parity (by value, no shared dep) with the published transport in
|
|
8
|
-
* `packages/app-sdk/src/rpc.ts`.
|
|
9
|
-
*/
|
|
10
|
-
function gatewayErrorMessage(status) {
|
|
11
|
-
if (status === 524) {
|
|
12
|
-
return "The request took too long to finish (gateway timeout). It may still be running — check back in a moment, or try again.";
|
|
13
|
-
}
|
|
14
|
-
if (status >= 500) {
|
|
15
|
-
return "The service is temporarily unavailable. Please try again shortly.";
|
|
16
|
-
}
|
|
17
|
-
return "The service returned an unexpected response. Please try again.";
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* The error message for a non-ok response. A genuine JSON error (a 4xx carrying
|
|
21
|
-
* a `message`) surfaces verbatim; a non-JSON body (a gateway HTML page), any
|
|
22
|
-
* 5xx, or a JSON body without a `message` falls back to a body-free,
|
|
23
|
-
* status-derived message. `parsed` is the JSON.parse of the body, or `null`.
|
|
24
|
-
* In parity (by value, no shared dep) with `packages/app-sdk/src/rpc.ts`.
|
|
25
|
-
*/
|
|
26
|
-
export function transportErrorMessage(status, parsed) {
|
|
27
|
-
const jsonMessage = parsed && typeof parsed.message === "string"
|
|
28
|
-
? parsed.message
|
|
29
|
-
: null;
|
|
30
|
-
return parsed === null || status >= 500 || jsonMessage === null
|
|
31
|
-
? gatewayErrorMessage(status)
|
|
32
|
-
: jsonMessage;
|
|
33
|
-
}
|
|
34
4
|
function findAvailableFilename(dir, filename, reserved) {
|
|
35
5
|
// `reserved` tracks absolute paths claimed by in-flight downloads in the same
|
|
36
6
|
// batch — required for parallel callers because the file may not be on disk
|