@promptev/context-engine 0.0.4 → 0.0.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.
@@ -130,6 +130,31 @@ await engine.search(q, { principals: user.groups }); // scoped
130
130
  header before the LLM sees a schema, and sweeps the result.
131
131
  - Filing a document under an ACL the caller does not hold returns **403**, on
132
132
  ingest and on PATCH alike.
133
+ - **`executeTool` cuts its `result` to 8,000 characters and 100 rows by
134
+ default.** A cut result is `{ _truncated, _original_size }` — a model
135
+ reading only that prefix will say "not found" about data that was there.
136
+ Size the budget to the model's window with `resultMaxChars` /
137
+ `resultMaxRows` (omitted = default, `null` = no limit; rows are per table,
138
+ and a db tool's own `max_rows`, default 1000, still applies first).
139
+ `responseMode: "tsv"` works for ANY tool: every array of objects in the
140
+ result (db `rows`, an HTTP body's list, a function's returned list) becomes
141
+ a TSV string under the same key — header first, `\N` = NULL, nested values
142
+ as JSON cells, tab/newline/backslash escaped — and the budget cuts at whole
143
+ rows, reporting `_result_shaping: { "<dotted.path>": { rows_returned,
144
+ rows_omitted } }`. Everything else stays JSON. The audit row keeps the
145
+ original under its own 50KB cap regardless. An http tool can store
146
+ `response_mode: "tsv"` in its config (every method, `QUERY` included;
147
+ omitted = `json`); an explicit `responseMode` on the call wins. The
148
+ conversion alone is `formatResult(result, "tsv")`.
149
+
150
+ ```ts
151
+ const out = await engine.executeTool("db_sales", { query: "SELECT * FROM orders" }, {
152
+ principals,
153
+ resultMaxChars: 200_000,
154
+ resultMaxRows: null,
155
+ responseMode: "tsv",
156
+ });
157
+ ```
133
158
 
134
159
  ## Search
135
160
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptev/context-engine",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "Promptev Context Engine — language-agnostic ingestion + hybrid retrieval (TypeScript)",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Promptev Inc",
@@ -130,6 +130,31 @@ await engine.search(q, { principals: user.groups }); // scoped
130
130
  header before the LLM sees a schema, and sweeps the result.
131
131
  - Filing a document under an ACL the caller does not hold returns **403**, on
132
132
  ingest and on PATCH alike.
133
+ - **`executeTool` cuts its `result` to 8,000 characters and 100 rows by
134
+ default.** A cut result is `{ _truncated, _original_size }` — a model
135
+ reading only that prefix will say "not found" about data that was there.
136
+ Size the budget to the model's window with `resultMaxChars` /
137
+ `resultMaxRows` (omitted = default, `null` = no limit; rows are per table,
138
+ and a db tool's own `max_rows`, default 1000, still applies first).
139
+ `responseMode: "tsv"` works for ANY tool: every array of objects in the
140
+ result (db `rows`, an HTTP body's list, a function's returned list) becomes
141
+ a TSV string under the same key — header first, `\N` = NULL, nested values
142
+ as JSON cells, tab/newline/backslash escaped — and the budget cuts at whole
143
+ rows, reporting `_result_shaping: { "<dotted.path>": { rows_returned,
144
+ rows_omitted } }`. Everything else stays JSON. The audit row keeps the
145
+ original under its own 50KB cap regardless. An http tool can store
146
+ `response_mode: "tsv"` in its config (every method, `QUERY` included;
147
+ omitted = `json`); an explicit `responseMode` on the call wins. The
148
+ conversion alone is `formatResult(result, "tsv")`.
149
+
150
+ ```ts
151
+ const out = await engine.executeTool("db_sales", { query: "SELECT * FROM orders" }, {
152
+ principals,
153
+ resultMaxChars: 200_000,
154
+ resultMaxRows: null,
155
+ responseMode: "tsv",
156
+ });
157
+ ```
133
158
 
134
159
  ## Search
135
160